fix(ui): 카드 효과 드로우 애니메이션 적용
- DrawCards에 animate 인자를 추가해 새로 뽑힌 손패 슬롯만 덱 위치에서 손패 위치로 이동하도록 처리 - 카드 효과의 draw 호출은 animate=true로 실행해 즉시 생성되는 느낌을 제거 - 턴 시작 드로우와 유물 드로우는 기존 렌더 흐름을 유지 - SlayDeckController.codeblock 산출물을 생성기로 재생성 검증: - node --check tools/deck/gen-slaydeck.mjs - node --test tools/balance/sim-balance.test.mjs tools/map/rogue-map.test.mjs
This commit is contained in:
@@ -3079,7 +3079,8 @@ if self.PlayerVuln > 0 then self.PlayerVuln = self.PlayerVuln - 1 end
|
||||
self:RenderHand(false)
|
||||
self:RenderPiles()
|
||||
self:EnemyTurn()`),
|
||||
method('DrawCards', `for i = 1, amount do
|
||||
method('DrawCards', `local drawnSlots = {}
|
||||
for i = 1, amount do
|
||||
\tif #self.DrawPile <= 0 then
|
||||
\t\tself:RecycleDiscardIntoDraw()
|
||||
\tend
|
||||
@@ -3088,8 +3089,22 @@ self:EnemyTurn()`),
|
||||
\tend
|
||||
\tlocal cardId = table.remove(self.DrawPile)
|
||||
\ttable.insert(self.Hand, cardId)
|
||||
\tif #self.Hand <= 5 then
|
||||
\t\ttable.insert(drawnSlots, #self.Hand)
|
||||
\tend
|
||||
end
|
||||
self:RenderPiles()`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'amount' }]),
|
||||
self:RenderPiles()
|
||||
if animate == true and #drawnSlots > 0 then
|
||||
\tself:RenderHand(false)
|
||||
\tlocal drawStart = Vector2(-590, 8)
|
||||
\tfor i = 1, #drawnSlots do
|
||||
\t\tlocal slot = drawnSlots[i]
|
||||
\t\tself:AnimateCardFrom(slot, drawStart, Vector2((slot - 3) * 200, 0), 0.08 + i * 0.045)
|
||||
\tend
|
||||
end`, [
|
||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'amount' },
|
||||
{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'animate' },
|
||||
]),
|
||||
method('RecycleDiscardIntoDraw', `if self.DiscardPile == nil or #self.DiscardPile <= 0 then
|
||||
\treturn
|
||||
end
|
||||
@@ -3466,7 +3481,7 @@ if c.kind ~= "Power" then
|
||||
table.insert(self.DiscardPile, cardId)
|
||||
end
|
||||
if c.draw ~= nil then
|
||||
self:DrawCards(c.draw)
|
||||
self:DrawCards(c.draw, true)
|
||||
end
|
||||
self:RenderHand(false)
|
||||
self:RenderPiles()
|
||||
|
||||
Reference in New Issue
Block a user