From f704d0f14ea29a43e343b0c481338a391d7402c3 Mon Sep 17 00:00:00 2001 From: gahusb Date: Wed, 10 Jun 2026 01:29:27 +0900 Subject: [PATCH] =?UTF-8?q?refactor(combat):=20=EC=A3=BD=EC=9D=80=20?= =?UTF-8?q?=EB=8B=A8=EC=9D=BC=EC=A0=81=20=EC=BD=94=EB=93=9C=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20+=20HP=5FBAR=5FW=20=EC=83=81=EC=88=98=20=EC=B6=94?= =?UTF-8?q?=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- tools/deck/gen-slaydeck.mjs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/tools/deck/gen-slaydeck.mjs b/tools/deck/gen-slaydeck.mjs index 35d2140..04c053b 100644 --- a/tools/deck/gen-slaydeck.mjs +++ b/tools/deck/gen-slaydeck.mjs @@ -12,7 +12,6 @@ for (const id of CARDS.starterDeck) { if (!ENEMIES.enemies[ENEMIES.activeEnemy]) { throw new Error(`[gen-slaydeck] activeEnemy가 enemies에 없음: ${ENEMIES.activeEnemy}`); } -const ACTIVE_ENEMY = ENEMIES.enemies[ENEMIES.activeEnemy]; const MAP = JSON.parse(readFileSync('data/map.json', 'utf8')); for (const id of MAP.start) { @@ -74,15 +73,6 @@ function luaCardsTable(cards) { function luaDeckTable(deck) { return `self.DrawPile = { ${deck.map(luaStr).join(', ')} }`; } -function luaIntentsTable(intents) { - const lines = intents.map((it) => `\t{ kind = ${luaStr(it.kind)}, value = ${it.value} },`); - return `self.EnemyIntents = {\n${lines.join('\n')}\n}`; -} -function intentText(it) { - if (it.kind === 'Attack') return `의도: 공격 ${it.value}`; - if (it.kind === 'Defend') return `의도: 방어 ${it.value}`; - return ''; -} const UI_FILE = 'ui/DefaultGroup.ui'; const COMMON_FILE = 'Global/common.gamelogic'; @@ -96,6 +86,7 @@ const SKILL = { r: 0.46, g: 0.68, b: 0.52, a: 1 }; const MAX_MONSTERS = 4; +const HP_BAR_W = 120; const CARD_W = 180; const CARD_H = 250; const CARD_SPACING = 200; @@ -477,7 +468,7 @@ function upsertUi() { componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent', displayOrder: 2, components: [ - transform({ parentW: SLOT_W, parentH: SLOT_H, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 120, y: 14 }, pos: { x: 0, y: -14 } }), + transform({ parentW: SLOT_W, parentH: SLOT_H, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: HP_BAR_W, y: 14 }, pos: { x: 0, y: -14 } }), sprite({ color: { r: 0.18, g: 0.05, b: 0.06, a: 1 }, type: 1 }), ], })); @@ -486,7 +477,7 @@ function upsertUi() { componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent', displayOrder: 3, components: [ - transform({ parentW: SLOT_W, parentH: SLOT_H, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0, y: 0.5 }, size: { x: 120, y: 14 }, pos: { x: -60, y: -14 } }), + transform({ parentW: SLOT_W, parentH: SLOT_H, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0, y: 0.5 }, size: { x: HP_BAR_W, y: 14 }, pos: { x: -HP_BAR_W / 2, y: -14 } }), sprite({ color: { r: 0.86, g: 0.35, b: 0.32, a: 1 }, type: 1 }), ], })); @@ -1529,7 +1520,7 @@ end local ratio = 0 if maxHp > 0 then ratio = hp / maxHp end if ratio < 0 then ratio = 0 end -local w = 120 * ratio +local w = ${HP_BAR_W} * ratio e.UITransformComponent.RectSize = Vector2(w, 14)`, [ { Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'path' }, { Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'hp' },