원인: Ctrl+Shift+E의 CheatFillEnergy는 #75에서 energy-only로 만들어져 self.Energy만 채우고 self.PlayerHp는 전혀 건드리지 않았다(설계상 체력 미회복). 바인딩·발동은 정상(Ctrl+Shift+C 카드 picker와 동일 입력 메커니즘)이라 에너지는 차지만 체력은 회복된 적이 없었음 → "체력 회복 안됨". 수정: CheatFillEnergy에 self.PlayerHp = self.PlayerMaxHp 추가 + RenderCombat() 호출(HP 표시 갱신). 누르던 Ctrl+Shift+E 그대로 체력+에너지 전체 회복으로 확장. 토스트 "치트: 체력·에너지 회복", README 디버그 단축키 표기도 갱신. 산출물 재생성: SlayDeckController.codeblock. 검증: cbgap GAP 0, JS 41/41. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
112 lines
5.6 KiB
JavaScript
112 lines
5.6 KiB
JavaScript
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, luaCharsTable, 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 bootMethods = [
|
|
method('OnBeginPlay', `${luaCardsTable(CARDS.cards)}
|
|
${luaFramesTable()}
|
|
${luaNodeIconsTable()}
|
|
${luaCharsTable()}
|
|
${luaSoulShopTable(SOUL_UNLOCKS)}
|
|
self.SoulUnlocks = {}
|
|
self.SoulPoints = self.SoulPoints or 0
|
|
local uiTries = 0
|
|
local uiInit = 0
|
|
uiInit = _TimerService:SetTimerRepeat(function()
|
|
uiTries = uiTries + 1
|
|
if _EntityService:GetEntityByPath("/ui/DeckUIGroup") ~= nil then
|
|
self:ActivateUIGroups()
|
|
self:ShowMainMenu()
|
|
_TimerService:ClearTimer(uiInit)
|
|
elseif uiTries > 80 then
|
|
_TimerService:ClearTimer(uiInit)
|
|
end
|
|
end, 0.1)
|
|
local lp = _UserService.LocalPlayer
|
|
if lp ~= nil then
|
|
self:ReqLoadAscension(lp.PlayerComponent.UserId)
|
|
self:ReqLoadSouls(lp.PlayerComponent.UserId)
|
|
end
|
|
_InputService:ConnectEvent(KeyDownEvent, function(e)
|
|
if e.key == KeyboardKey.LeftControl then
|
|
self.DebugCtrlDown = true
|
|
local lp2 = _UserService.LocalPlayer
|
|
if lp2 ~= nil and lp2.CurrentMapName == "${LOBBY_MAP}" and self.RunActive ~= true then
|
|
self:PlayerAttackMotion()
|
|
end
|
|
elseif e.key == KeyboardKey.LeftShift or e.key == KeyboardKey.RightShift then
|
|
self.DebugShiftDown = true
|
|
elseif e.key == KeyboardKey.C then
|
|
if self.DebugCtrlDown == true and self.DebugShiftDown == true then
|
|
self:OpenDebugCardPicker()
|
|
end
|
|
elseif e.key == KeyboardKey.E then
|
|
if self.DebugCtrlDown == true and self.DebugShiftDown == true then
|
|
self:CheatFillEnergy()
|
|
end
|
|
end
|
|
end)
|
|
_InputService:ConnectEvent(KeyUpEvent, function(e)
|
|
if e.key == KeyboardKey.LeftControl then
|
|
self.DebugCtrlDown = false
|
|
elseif e.key == KeyboardKey.LeftShift or e.key == KeyboardKey.RightShift then
|
|
self.DebugShiftDown = false
|
|
end
|
|
end)`),
|
|
method('CheatFillEnergy', `if self.RunActive ~= true or self.CombatOver == true then
|
|
return
|
|
end
|
|
self.PlayerHp = self.PlayerMaxHp
|
|
self.Energy = self.MaxEnergy
|
|
self:RenderCombat()
|
|
self:RenderPiles()
|
|
self:Toast("치트: 체력·에너지 회복")`),
|
|
method('ReqLoadAscension', `local ds = _DataStorageService:GetUserDataStorage(userId)
|
|
local errCode, value = ds:GetAndWait("ascensionUnlocked")
|
|
local n = 0
|
|
if errCode == 0 and value ~= nil and value ~= "" then
|
|
n = tonumber(value) or 0
|
|
end
|
|
self:RecvAscension(n, userId)`, [{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'userId' }], 5),
|
|
method('RecvAscension', `self.AscensionUnlocked = n
|
|
if self.AscensionLevel > self.AscensionUnlocked then
|
|
self.AscensionLevel = self.AscensionUnlocked
|
|
end
|
|
self:RenderAscension()`, [
|
|
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'n' },
|
|
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'userId' },
|
|
], 6),
|
|
method('SaveAscension', `local ds = _DataStorageService:GetUserDataStorage(userId)
|
|
ds:SetAndWait("ascensionUnlocked", tostring(n))`, [
|
|
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'n' },
|
|
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'userId' },
|
|
], 5),
|
|
method('AdjustAscension', `local v = self.AscensionLevel + delta
|
|
if v < 0 then v = 0 end
|
|
if v > self.AscensionUnlocked then v = self.AscensionUnlocked end
|
|
self.AscensionLevel = v
|
|
self:RenderAscension()`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'delta' }]),
|
|
method('RenderAscension', `self:SetText("/ui/DefaultGroup/MainMenu/AscLabel", "승천 " .. string.format("%d", self.AscensionLevel) .. " / 해금 " .. string.format("%d", self.AscensionUnlocked))
|
|
self:SetText("/ui/LobbyUIGroup/LobbyHud/AscLabel", "승천 " .. string.format("%d", self.AscensionLevel) .. " / 해금 " .. string.format("%d", self.AscensionUnlocked))`),
|
|
method('AscHpMult', `local m = 1
|
|
if self.AscensionLevel >= 1 then m = m + 0.1 end
|
|
if self.AscensionLevel >= 6 then m = m + 0.1 end
|
|
return m`, [], 0, 'number'),
|
|
method('AscAtkMult', `local m = 1
|
|
if self.AscensionLevel >= 2 then m = m + 0.1 end
|
|
if self.AscensionLevel >= 7 then m = m + 0.1 end
|
|
return m`, [], 0, 'number'),
|
|
method('AscEliteBonus', `local b = 0
|
|
if self.AscensionLevel >= 4 then b = b + 0.2 end
|
|
if self.AscensionLevel >= 9 then b = b + 0.2 end
|
|
return b`, [], 0, 'number'),
|
|
method('AscGoldMult', `local m = 1
|
|
if self.AscensionLevel >= 5 then m = m - 0.25 end
|
|
if self.AscensionLevel >= 10 then m = m - 0.25 end
|
|
return m`, [], 0, 'number'),
|
|
method('AscStartHpPenalty', `local p = 0
|
|
if self.AscensionLevel >= 3 then p = p + 10 end
|
|
if self.AscensionLevel >= 8 then p = p + 10 end
|
|
return p`, [], 0, 'number'),
|
|
];
|