refactor(cb): 컨트롤러 횡단 관심사 모듈 분리 (이동·본문 무변경)

화면 전환·NPC·포지션 관심사를 state.mjs/render.mjs/runend.mjs에서
전용 모듈로 분리. 런타임은 단일 SlayDeckController codeblock 유지.

- state.mjs → screens.mjs 개명 (화면 라우팅·버튼 바인딩)
- npc.mjs 신규: OnLobbyNpcInteract
- navigation.mjs 신규: GoLobbyMap·TeleportToActMap (월드 텔레포트)
- layout.mjs 신규: PositionMonsterSlot (UI 슬롯 배치)
- gen-slaydeck.mjs import·spread 갱신

검증: tools/verify/cbset.mjs (순서 무관 집합 비교) = 189/189 무손실,
본문/exec/params 변경 0. cbgap GAP 0, 테스트 93/93.
산출물 재생성(SlayDeckController.codeblock) 포함 — 메서드 순서만 바뀜.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-26 18:35:51 +09:00
parent 7b5e79bcf2
commit 8d2e320d60
9 changed files with 691 additions and 627 deletions

18
tools/deck/cb/npc.mjs Normal file
View File

@@ -0,0 +1,18 @@
import { method, RUN_LENGTH, GOLD_PER_WIN, CARD_PRICE, REST_HEAL, RELIC_PRICE, ACT_COUNT, ACT_MAPS, LOBBY_MAP, LOBBY_SPAWN } from '../lib/codeblock.mjs';
import { CARDS, ENEMIES, CLASSES, JOBS, SOUL_UNLOCKS, CARDFRAMES, RARITIES, MAP_ROWS, MAP_COLS, CHEST_CLOSED_RUID, CHEST_OPEN_RUID, NODEICONS, CHARS, CAM, RELICS, POTIONS, luaSoulShopTable, frameRuid, luaFramesTable, luaNodeIconsTable, luaRelicsTable, luaPotionsTable, luaIntentsArray, luaEnemiesTable, luaStr, luaJobsTable, luaCardsTable, luaDeckTable } from '../lib/data.mjs';
import { UI_FILE, COMMON_FILE, UI_ROOT, GENERATED_UI_SECTIONS, UI_APPEND_ORDER, DISABLED_STOCK_CONTROLS, TRANSPARENT, DARK, GOLD, ATTACK, DEFEND, SKILL, DAMAGE_DIGIT_RUIDS, DAMAGE_POP_MAX_DIGITS, DAMAGE_POP_DIGIT_W, DAMAGE_POP_DIGIT_H, DAMAGE_POP_DIGIT_SPACING, MAX_MONSTERS, HEAD_OFFSET_Y, HP_BAR_W, WHITE, CARD_NAME_TEXT, CARD_DESC_TEXT, cardFaceLayout, CARD_W, CARD_H, CARD_SPACING, CARD_XS, ALIGN_CENTER, ALIGN_BOTTOM_CENTER, guid, transform, sprite, button, text, scrollLayoutGroup, popupLayerFor, uiOrderFor, displayOrderFor, applySortingOverride, entity, uiPath, sectionRoot, isGeneratedUiEntity, appendUiSection } from '../lib/ui-helpers.mjs';
export const npcMethods = [
method('OnLobbyNpcInteract', `if self.RunActive == true then
return
end
if id == "run" then
self:ShowCharacterSelect()
elseif id == "codex" then
self:ShowCodex()
elseif id == "shop" then
self:ShowSoulShop()
elseif id == "board" then
self:ShowBoard()
end`, [{ Type: 'string', DefaultValue: '""', SyncDirection: 0, Attributes: [], Name: 'id' }]),
];