From 1f0a8099eea8f4a4caab68ae429a6faefac693c6 Mon Sep 17 00:00:00 2001 From: gahusb Date: Sun, 14 Jun 2026 02:59:34 +0900 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=EC=B9=B4=EB=93=9C=20=ED=9A=A8?= =?UTF-8?q?=EA=B3=BC=20=EB=93=9C=EB=A1=9C=EC=9A=B0=20=EC=95=A0=EB=8B=88?= =?UTF-8?q?=EB=A9=94=EC=9D=B4=EC=85=98=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- RootDesk/MyDesk/SlayDeckController.codeblock | 11 ++++++++-- tools/deck/gen-slaydeck.mjs | 21 +++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/RootDesk/MyDesk/SlayDeckController.codeblock b/RootDesk/MyDesk/SlayDeckController.codeblock index a43cfe7..3f715ce 100644 --- a/RootDesk/MyDesk/SlayDeckController.codeblock +++ b/RootDesk/MyDesk/SlayDeckController.codeblock @@ -1135,9 +1135,16 @@ "SyncDirection": 0, "Attributes": [], "Name": "amount" + }, + { + "Type": "boolean", + "DefaultValue": null, + "SyncDirection": 0, + "Attributes": [], + "Name": "animate" } ], - "Code": "for i = 1, amount do\n\tif #self.DrawPile <= 0 then\n\t\tself:RecycleDiscardIntoDraw()\n\tend\n\tif #self.DrawPile <= 0 then\n\t\tbreak\n\tend\n\tlocal cardId = table.remove(self.DrawPile)\n\ttable.insert(self.Hand, cardId)\nend\nself:RenderPiles()", + "Code": "local drawnSlots = {}\nfor i = 1, amount do\n\tif #self.DrawPile <= 0 then\n\t\tself:RecycleDiscardIntoDraw()\n\tend\n\tif #self.DrawPile <= 0 then\n\t\tbreak\n\tend\n\tlocal cardId = table.remove(self.DrawPile)\n\ttable.insert(self.Hand, cardId)\n\tif #self.Hand <= 5 then\n\t\ttable.insert(drawnSlots, #self.Hand)\n\tend\nend\nself:RenderPiles()\nif animate == true and #drawnSlots > 0 then\n\tself:RenderHand(false)\n\tlocal drawStart = Vector2(-590, 8)\n\tfor i = 1, #drawnSlots do\n\t\tlocal slot = drawnSlots[i]\n\t\tself:AnimateCardFrom(slot, drawStart, Vector2((slot - 3) * 200, 0), 0.08 + i * 0.045)\n\tend\nend", "Scope": 2, "ExecSpace": 6, "Attributes": [], @@ -1573,7 +1580,7 @@ "Name": "slot" } ], - "Code": "if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then\n\treturn\nend\nif self.Hand == nil then\n\treturn\nend\nlocal cardId = self.Hand[slot]\nif cardId == nil then\n\treturn\nend\nlocal c = self.Cards[cardId]\nif c == nil then\n\treturn\nend\nif self.Energy < c.cost then\n\tself:Toast(\"에너지가 부족합니다\")\n\treturn\nend\nself.Energy = self.Energy - c.cost\nif c.kind == \"Attack\" then\n\tif c.damage ~= nil then\n\t\tself:PlayerAttackMotion()\n\t\tlocal total = 0\n\t\tlocal hitN = c.hits or 1\n\t\tfor h = 1, hitN do\n\t\t\ttotal = total + self:CalcPlayerAttack(c.damage)\n\t\tend\n\t\tif c.aoe == true then\n\t\t\tself:PlayAoeFx(c.image, total)\n\t\telse\n\t\t\tself:PlayAttackFx(self.TargetIndex, c.image, total, c.pierce == true)\n\t\tend\n\tend\n\tif c.block ~= nil then\n\t\tself.PlayerBlock = self.PlayerBlock + c.block\n\tend\n\tself:ApplyRelics(\"cardPlayed\")\nelseif c.kind == \"Skill\" then\n\tif c.block ~= nil then\n\t\tself.PlayerBlock = self.PlayerBlock + c.block\n\tend\nelseif c.kind == \"Power\" then\n\tif c.powerEffect ~= nil then\n\t\ttable.insert(self.PlayerPowers, cardId)\n\tend\nend\nif c.strength ~= nil then\n\tself.PlayerStr = self.PlayerStr + c.strength\nend\nif c.selfVuln ~= nil then\n\tself.PlayerVuln = self.PlayerVuln + c.selfVuln\nend\nif c.heal ~= nil then\n\tself.PlayerHp = math.min(self.PlayerHp + c.heal, self.PlayerMaxHp)\nend\nif c.weak ~= nil or c.vuln ~= nil or c.poison ~= nil then\n\tlocal tm = self.Monsters[self.TargetIndex]\n\tif tm ~= nil and tm.alive == true then\n\t\tif c.weak ~= nil then tm.weak = tm.weak + c.weak end\n\t\tif c.poison ~= nil then tm.poison = (tm.poison or 0) + c.poison end\n\t\tif c.vuln ~= nil then\n\t\t\ttm.vuln = tm.vuln + c.vuln\n\t\t\tif self:HasRelic(\"championBelt\") then\n\t\t\t\ttm.weak = tm.weak + 1\n\t\t\tend\n\t\tend\n\tend\nend\ntable.remove(self.Hand, slot)\nif c.kind ~= \"Power\" then\n\ttable.insert(self.DiscardPile, cardId)\nend\nif c.draw ~= nil then\n\tself:DrawCards(c.draw)\nend\nself:RenderHand(false)\nself:RenderPiles()\nself:RenderCombat()\nself:CheckCombatEnd()", + "Code": "if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then\n\treturn\nend\nif self.Hand == nil then\n\treturn\nend\nlocal cardId = self.Hand[slot]\nif cardId == nil then\n\treturn\nend\nlocal c = self.Cards[cardId]\nif c == nil then\n\treturn\nend\nif self.Energy < c.cost then\n\tself:Toast(\"에너지가 부족합니다\")\n\treturn\nend\nself.Energy = self.Energy - c.cost\nif c.kind == \"Attack\" then\n\tif c.damage ~= nil then\n\t\tself:PlayerAttackMotion()\n\t\tlocal total = 0\n\t\tlocal hitN = c.hits or 1\n\t\tfor h = 1, hitN do\n\t\t\ttotal = total + self:CalcPlayerAttack(c.damage)\n\t\tend\n\t\tif c.aoe == true then\n\t\t\tself:PlayAoeFx(c.image, total)\n\t\telse\n\t\t\tself:PlayAttackFx(self.TargetIndex, c.image, total, c.pierce == true)\n\t\tend\n\tend\n\tif c.block ~= nil then\n\t\tself.PlayerBlock = self.PlayerBlock + c.block\n\tend\n\tself:ApplyRelics(\"cardPlayed\")\nelseif c.kind == \"Skill\" then\n\tif c.block ~= nil then\n\t\tself.PlayerBlock = self.PlayerBlock + c.block\n\tend\nelseif c.kind == \"Power\" then\n\tif c.powerEffect ~= nil then\n\t\ttable.insert(self.PlayerPowers, cardId)\n\tend\nend\nif c.strength ~= nil then\n\tself.PlayerStr = self.PlayerStr + c.strength\nend\nif c.selfVuln ~= nil then\n\tself.PlayerVuln = self.PlayerVuln + c.selfVuln\nend\nif c.heal ~= nil then\n\tself.PlayerHp = math.min(self.PlayerHp + c.heal, self.PlayerMaxHp)\nend\nif c.weak ~= nil or c.vuln ~= nil or c.poison ~= nil then\n\tlocal tm = self.Monsters[self.TargetIndex]\n\tif tm ~= nil and tm.alive == true then\n\t\tif c.weak ~= nil then tm.weak = tm.weak + c.weak end\n\t\tif c.poison ~= nil then tm.poison = (tm.poison or 0) + c.poison end\n\t\tif c.vuln ~= nil then\n\t\t\ttm.vuln = tm.vuln + c.vuln\n\t\t\tif self:HasRelic(\"championBelt\") then\n\t\t\t\ttm.weak = tm.weak + 1\n\t\t\tend\n\t\tend\n\tend\nend\ntable.remove(self.Hand, slot)\nif c.kind ~= \"Power\" then\n\ttable.insert(self.DiscardPile, cardId)\nend\nif c.draw ~= nil then\n\tself:DrawCards(c.draw, true)\nend\nself:RenderHand(false)\nself:RenderPiles()\nself:RenderCombat()\nself:CheckCombatEnd()", "Scope": 2, "ExecSpace": 6, "Attributes": [], diff --git a/tools/deck/gen-slaydeck.mjs b/tools/deck/gen-slaydeck.mjs index a272fa1..09449bc 100644 --- a/tools/deck/gen-slaydeck.mjs +++ b/tools/deck/gen-slaydeck.mjs @@ -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()