feat: P14 — 반복 런·로비·영혼·도적·몬스터 랜덤성 (요청 17항목) #52

Merged
maple merged 11 commits from feature/p14-loop-lobby-soul into main 2026-06-14 01:50:20 +09:00
3 changed files with 6336 additions and 13 deletions
Showing only changes of commit 7ee323ea8b - Show all commits

View File

@@ -204,6 +204,34 @@
"Attributes": [],
"Name": "AllDeckCloseHandler"
},
{
"Type": "number",
"DefaultValue": "0",
"SyncDirection": 0,
"Attributes": [],
"Name": "SoulPoints"
},
{
"Type": "boolean",
"DefaultValue": "false",
"SyncDirection": 0,
"Attributes": [],
"Name": "LobbyBound"
},
{
"Type": "boolean",
"DefaultValue": "false",
"SyncDirection": 0,
"Attributes": [],
"Name": "CodexMode"
},
{
"Type": "any",
"DefaultValue": "nil",
"SyncDirection": 0,
"Attributes": [],
"Name": "CodexCards"
},
{
"Type": "string",
"DefaultValue": "\"\"",
@@ -565,7 +593,7 @@
"Name": null
},
"Arguments": [],
"Code": "self:ShowMainMenu()\nlocal lp = _UserService.LocalPlayer\nif lp ~= nil then\n\tself:ReqLoadAscension(lp.PlayerComponent.UserId)\nend",
"Code": "self:ShowLobby()\nlocal lp = _UserService.LocalPlayer\nif lp ~= nil then\n\tself:ReqLoadAscension(lp.PlayerComponent.UserId)\nend",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
@@ -686,7 +714,7 @@
"Name": null
},
"Arguments": [],
"Code": "self:SetText(\"/ui/DefaultGroup/MainMenu/AscLabel\", \"승천 \" .. string.format(\"%d\", self.AscensionLevel) .. \" / 해금 \" .. string.format(\"%d\", self.AscensionUnlocked))",
"Code": "self:SetText(\"/ui/DefaultGroup/MainMenu/AscLabel\", \"승천 \" .. string.format(\"%d\", self.AscensionLevel) .. \" / 해금 \" .. string.format(\"%d\", self.AscensionUnlocked))\nself:SetText(\"/ui/DefaultGroup/LobbyHud/AscLabel\", \"승천 \" .. string.format(\"%d\", self.AscensionLevel) .. \" / 해금 \" .. string.format(\"%d\", self.AscensionUnlocked))",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
@@ -776,7 +804,7 @@
"Name": null
},
"Arguments": [],
"Code": "self:SetEntityEnabled(\"/ui/DefaultGroup/Button_Attack\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/Button_Jump\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/UIJoystick\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CardHand\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/RewardHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/MapHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/ShopHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/RestHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/TreasureHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/JobChoiceHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/JobSelectHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckInspectHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckAllHud\", false)",
"Code": "self:SetEntityEnabled(\"/ui/DefaultGroup/Button_Attack\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/Button_Jump\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/UIJoystick\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CardHand\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/RewardHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/MapHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/ShopHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/RestHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/TreasureHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/JobChoiceHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/JobSelectHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckInspectHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckAllHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/LobbyHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/BoardHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/SoulShopHud\", false)",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
@@ -799,7 +827,7 @@
"Name": "state"
}
],
"Code": "self:HideGameHud()\nself:SetEntityEnabled(\"/ui/DefaultGroup/MainMenu\", state == \"menu\")\nself:SetEntityEnabled(\"/ui/DefaultGroup/CharacterSelectHud\", state == \"charselect\")\nif state == \"map\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/MapHud\", true)\nelseif state == \"combat\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud\", true)\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/DeckHud\", true)\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CardHand\", true)\nelseif state == \"shop\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/ShopHud\", true)\nelseif state == \"rest\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/RestHud\", true)\nelseif state == \"treasure\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/TreasureHud\", true)\nend",
"Code": "self:HideGameHud()\nself:SetEntityEnabled(\"/ui/DefaultGroup/MainMenu\", state == \"menu\")\nself:SetEntityEnabled(\"/ui/DefaultGroup/CharacterSelectHud\", state == \"charselect\")\nself:SetEntityEnabled(\"/ui/DefaultGroup/LobbyHud\", state == \"lobby\")\nif state == \"map\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/MapHud\", true)\nelseif state == \"combat\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud\", true)\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/DeckHud\", true)\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CardHand\", true)\nelseif state == \"shop\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/ShopHud\", true)\nelseif state == \"rest\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/RestHud\", true)\nelseif state == \"treasure\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/TreasureHud\", true)\nend",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
@@ -835,6 +863,126 @@
"Attributes": [],
"Name": "BindMenuButtons"
},
{
"Return": {
"Type": "void",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [],
"Code": "self.SelectedClass = \"\"\nself:RenderAscension()\nself:RenderSoulLabel()\nself:ShowState(\"lobby\")\nself:SetEntityEnabled(\"/ui/DefaultGroup/BoardHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/SoulShopHud\", false)\nself:BindLobbyButtons()\nself:BindMenuButtons()",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "ShowLobby"
},
{
"Return": {
"Type": "void",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [],
"Code": "local s = self.SoulPoints or 0\nself:SetText(\"/ui/DefaultGroup/LobbyHud/SoulLabel\", \"영혼 \" .. string.format(\"%d\", s))\nself:SetText(\"/ui/DefaultGroup/SoulShopHud/Souls\", \"영혼 \" .. string.format(\"%d\", s))",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "RenderSoulLabel"
},
{
"Return": {
"Type": "void",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [],
"Code": "if self.LobbyBound == true then\n\treturn\nend\nself.LobbyBound = true\nlocal function bindClick(path, fn)\n\tlocal e = _EntityService:GetEntityByPath(path)\n\tif e ~= nil and e.ButtonComponent ~= nil then\n\t\te:ConnectEvent(ButtonClickEvent, fn)\n\tend\nend\nbindClick(\"/ui/DefaultGroup/LobbyHud/NpcRun\", function() self:ShowCharacterSelect() end)\nbindClick(\"/ui/DefaultGroup/LobbyHud/NpcCodex\", function() self:ShowCodex() end)\nbindClick(\"/ui/DefaultGroup/LobbyHud/NpcShop\", function() self:ShowSoulShop() end)\nbindClick(\"/ui/DefaultGroup/LobbyHud/NpcBoard\", function() self:ShowBoard() end)\nbindClick(\"/ui/DefaultGroup/LobbyHud/AscMinus\", function() self:AdjustAscension(-1) end)\nbindClick(\"/ui/DefaultGroup/LobbyHud/AscPlus\", function() self:AdjustAscension(1) end)\nbindClick(\"/ui/DefaultGroup/BoardHud/Close\", function() self:CloseBoard() end)\nbindClick(\"/ui/DefaultGroup/SoulShopHud/Close\", function() self:CloseSoulShop() end)",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "BindLobbyButtons"
},
{
"Return": {
"Type": "void",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [],
"Code": "self.CodexMode = true\nlocal list = {}\nfor id, c in pairs(self.Cards) do\n\tif c.curse ~= true then\n\t\ttable.insert(list, id)\n\tend\nend\ntable.sort(list)\nself.CodexCards = list\nlocal close = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud/Close\")\nif close ~= nil and close.ButtonComponent ~= nil then\n\tif self.AllDeckCloseHandler ~= nil then\n\t\tclose:DisconnectEvent(ButtonClickEvent, self.AllDeckCloseHandler)\n\tend\n\tself.AllDeckCloseHandler = close:ConnectEvent(ButtonClickEvent, function() self:CloseAllDeck() end)\nend\nself:SetEntityEnabled(\"/ui/DefaultGroup/LobbyHud\", false)\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud\")\nif hud ~= nil then\n\thud.Enable = true\nend\nself:RenderAllDeck()",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "ShowCodex"
},
{
"Return": {
"Type": "void",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [],
"Code": "self:SetEntityEnabled(\"/ui/DefaultGroup/BoardHud\", true)",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "ShowBoard"
},
{
"Return": {
"Type": "void",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [],
"Code": "self:SetEntityEnabled(\"/ui/DefaultGroup/BoardHud\", false)",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "CloseBoard"
},
{
"Return": {
"Type": "void",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [],
"Code": "self:RenderSoulLabel()\nself:SetEntityEnabled(\"/ui/DefaultGroup/SoulShopHud\", true)",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "ShowSoulShop"
},
{
"Return": {
"Type": "void",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [],
"Code": "self:SetEntityEnabled(\"/ui/DefaultGroup/SoulShopHud\", false)",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "CloseSoulShop"
},
{
"Return": {
"Type": "void",
@@ -1288,7 +1436,7 @@
"Name": null
},
"Arguments": [],
"Code": "self.DeckAllOpen = false\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud\")\nif hud ~= nil then\n\thud.Enable = false\nend",
"Code": "self.DeckAllOpen = false\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud\")\nif hud ~= nil then\n\thud.Enable = false\nend\nif self.CodexMode == true then\n\tself.CodexMode = false\n\tself:ShowLobby()\nend",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
@@ -1303,7 +1451,7 @@
"Name": null
},
"Arguments": [],
"Code": "local pile = self.RunDeck or {}\nlocal count = #pile\nself:SetText(\"/ui/DefaultGroup/DeckAllHud/Title\", \"모든 덱 (\" .. tostring(count) .. \")\")\nlocal empty = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud/Empty\")\nif empty ~= nil then\n\tempty.Enable = count <= 0\nend\nfor i = 1, 120 do\n\tlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud/Grid/Card\" .. tostring(i))\n\tif e ~= nil then\n\t\tlocal cardId = pile[i]\n\t\tif cardId == nil then\n\t\t\te.Enable = false\n\t\telse\n\t\t\te.Enable = true\n\t\t\tself:ApplyAllDeckCardVisual(i, cardId)\n\t\tend\n\tend\nend",
"Code": "local pile = self.RunDeck or {}\nlocal title = \"모든 덱\"\nif self.CodexMode == true then\n\tpile = self.CodexCards or {}\n\ttitle = \"카드 도감\"\nend\nlocal count = #pile\nself:SetText(\"/ui/DefaultGroup/DeckAllHud/Title\", title .. \" (\" .. tostring(count) .. \")\")\nlocal empty = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud/Empty\")\nif empty ~= nil then\n\tempty.Enable = count <= 0\nend\nfor i = 1, 120 do\n\tlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud/Grid/Card\" .. tostring(i))\n\tif e ~= nil then\n\t\tlocal cardId = pile[i]\n\t\tif cardId == nil then\n\t\t\te.Enable = false\n\t\telse\n\t\t\te.Enable = true\n\t\t\tself:ApplyAllDeckCardVisual(i, cardId)\n\t\tend\n\tend\nend",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
@@ -2064,7 +2212,7 @@
"Name": "text"
}
],
"Code": "local msg = text\nif text == \"런 클리어!\" and self.AscensionLevel >= self.AscensionUnlocked and self.AscensionUnlocked < 10 then\n\tself.AscensionUnlocked = self.AscensionUnlocked + 1\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil then\n\t\tself:SaveAscension(self.AscensionUnlocked, lp.PlayerComponent.UserId)\n\tend\n\tself:RenderAscension()\n\tmsg = \"런 클리어! 승천 \" .. string.format(\"%d\", self.AscensionUnlocked) .. \" 해금!\"\nend\nself:ShowResult(msg)\nself.RunActive = false\n_TimerService:SetTimerOnce(function() self:ShowMainMenu() end, 4)",
"Code": "local msg = text\nif text == \"런 클리어!\" and self.AscensionLevel >= self.AscensionUnlocked and self.AscensionUnlocked < 10 then\n\tself.AscensionUnlocked = self.AscensionUnlocked + 1\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil then\n\t\tself:SaveAscension(self.AscensionUnlocked, lp.PlayerComponent.UserId)\n\tend\n\tself:RenderAscension()\n\tmsg = \"런 클리어! 승천 \" .. string.format(\"%d\", self.AscensionUnlocked) .. \" 해금!\"\nend\nself:ShowResult(msg)\nself.RunActive = false\n_TimerService:SetTimerOnce(function() self:ShowLobby() end, 4)",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],

View File

@@ -168,6 +168,9 @@ const GENERATED_UI_SECTIONS = [
'JobSelectHud',
'MainMenu',
'CharacterSelectHud',
'LobbyHud',
'BoardHud',
'SoulShopHud',
];
const UI_APPEND_ORDER = [
'DeckHud',
@@ -183,6 +186,9 @@ const UI_APPEND_ORDER = [
'DeckAllHud',
'MainMenu',
'CharacterSelectHud',
'LobbyHud',
'BoardHud',
'SoulShopHud',
];
const DISABLED_STOCK_CONTROLS = ['Button_Attack', 'Button_Jump', 'UIJoystick'];
@@ -225,7 +231,7 @@ const ALIGN_BOTTOM_CENTER = 6;
function guid(prefix, n) {
// 유효한 8-4-4-4-12 hex GUID 생성. prefix는 충돌 방지용 네임스페이스 바이트로 매핑.
const ns = prefix === 'hud' ? 0xd0 : prefix === 'dck' ? 0xca : prefix === 'cmb' ? 0xcb : prefix === 'rwd' ? 0xcc : prefix === 'map' ? 0xcd : prefix === 'shp' ? 0xce : prefix === 'rst' ? 0xcf : prefix === 'menu' ? 0xe0 : prefix === 'ins' ? 0xe1 : prefix === 'all' ? 0xe2 : prefix === 'trs' ? 0xe3 : prefix === 'job' ? 0xe4
: prefix === 'ins2' ? 0xe5 : prefix === 'all2' ? 0xe6 : prefix === 'rwd2' ? 0xe7 : prefix === 'shp2' ? 0xe8 : 0xfe;
: prefix === 'ins2' ? 0xe5 : prefix === 'all2' ? 0xe6 : prefix === 'rwd2' ? 0xe7 : prefix === 'shp2' ? 0xe8 : prefix === 'lob' ? 0xe9 : prefix === 'brd' ? 0xea : prefix === 'soul' ? 0xeb : 0xfe;
const v = (ns * 0x100000 + n) >>> 0;
return `${v.toString(16).padStart(8, '0')}-0000-4000-8000-${v.toString(16).padStart(12, '0')}`;
}
@@ -2397,6 +2403,226 @@ function upsertUi() {
emit('MainMenu', menu);
emit('CharacterSelectHud', select);
// ── LobbyHud — 반복 런의 허브. NPC 클릭으로 런시작/도감/영혼상점/게시판 ──
const lobby = [];
let lobId = 0;
const lobbyRoot = entity({
id: guid('lob', lobId++),
path: '/ui/DefaultGroup/LobbyHud',
modelId: 'uisprite', entryId: 'UISprite',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
displayOrder: 11,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 1920, y: 1080 }, pos: { x: 0, y: 0 }, align: ALIGN_CENTER }),
sprite({ color: { r: 0.07, g: 0.08, b: 0.13, a: 1 }, type: 1, raycast: true }),
],
});
lobbyRoot.jsonString.enable = false;
lobby.push(lobbyRoot);
const lobTexts = [
['Title', 0, 470, 760, '메이플 로비', 48, GOLD],
['Subtitle', 0, 408, 900, 'NPC를 클릭해 런을 준비하세요', 24, { r: 0.82, g: 0.86, b: 0.92, a: 1 }],
['SoulLabel', 700, 470, 320, '영혼 0', 28, { r: 0.6, g: 0.85, b: 1, a: 1 }],
['AscLabel', -560, 470, 380, '승천 0 / 해금 0', 22, { r: 0.9, g: 0.7, b: 0.5, a: 1 }],
['Hint', 0, -430, 1300, '런을 클리어하거나 패배하면 로비로 돌아옵니다', 20, { r: 0.6, g: 0.64, b: 0.7, a: 1 }],
];
for (const [suffix, x, y, w, value, fs, color] of lobTexts) {
lobby.push(entity({
id: guid('lob', lobId++),
path: `/ui/DefaultGroup/LobbyHud/${suffix}`,
modelId: 'uitext', entryId: 'UIText',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
displayOrder: 1,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: w, y: 56 }, pos: { x, y } }),
sprite({ color: TRANSPARENT }),
text({ value, fontSize: fs, bold: true, color, alignment: 4 }),
],
}));
}
for (const [suffix, x, label] of [['AscMinus', -780, '<'], ['AscPlus', -540, '>']]) {
lobby.push(entity({
id: guid('lob', lobId++),
path: `/ui/DefaultGroup/LobbyHud/${suffix}`,
modelId: 'uibutton', entryId: 'UIButton',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent',
displayOrder: 2,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 46, y: 42 }, pos: { x, y: 470 }, align: ALIGN_CENTER }),
sprite({ color: { r: 0.2, g: 0.24, b: 0.3, a: 1 }, type: 1, raycast: true }),
button(),
text({ value: label, fontSize: 28, bold: true, color: WHITE, alignment: 4 }),
],
}));
}
const npcs = [
{ key: 'NpcRun', x: -540, name: '모험가', role: '런 시작', tint: { r: 0.74, g: 0.32, b: 0.28, a: 1 } },
{ key: 'NpcCodex', x: -180, name: '사서', role: '카드 도감', tint: { r: 0.3, g: 0.55, b: 0.5, a: 1 } },
{ key: 'NpcShop', x: 180, name: '상인', role: '영혼 상점', tint: { r: 0.55, g: 0.45, b: 0.75, a: 1 } },
{ key: 'NpcBoard', x: 540, name: '안내원', role: '게시판', tint: { r: 0.4, g: 0.5, b: 0.7, a: 1 } },
];
for (const npc of npcs) {
const base = `/ui/DefaultGroup/LobbyHud/${npc.key}`;
lobby.push(entity({
id: guid('lob', lobId++),
path: base,
modelId: 'uibutton', entryId: 'UIButton',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent',
displayOrder: 4,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 240, y: 320 }, pos: { x: npc.x, y: 20 }, align: ALIGN_CENTER }),
sprite({ color: { r: 0.13, g: 0.15, b: 0.2, a: 1 }, type: 1, raycast: true }),
button(),
],
}));
lobby.push(entity({
id: guid('lob', lobId++),
path: `${base}/Figure`,
modelId: 'uisprite', entryId: 'UISprite',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
displayOrder: 1,
components: [
transform({ parentW: 240, parentH: 320, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 130, y: 130 }, pos: { x: 0, y: 30 } }),
sprite({ color: npc.tint, type: 1 }),
],
}));
lobby.push(entity({
id: guid('lob', lobId++),
path: `${base}/Name`,
modelId: 'uitext', entryId: 'UIText',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
displayOrder: 2,
components: [
transform({ parentW: 240, parentH: 320, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 220, y: 40 }, pos: { x: 0, y: 122 } }),
sprite({ color: TRANSPARENT }),
text({ value: npc.name, fontSize: 28, bold: true, color: GOLD, alignment: 4 }),
],
}));
lobby.push(entity({
id: guid('lob', lobId++),
path: `${base}/Role`,
modelId: 'uitext', entryId: 'UIText',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
displayOrder: 2,
components: [
transform({ parentW: 240, parentH: 320, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 220, y: 36 }, pos: { x: 0, y: -122 } }),
sprite({ color: TRANSPARENT }),
text({ value: npc.role, fontSize: 22, bold: false, color: { r: 0.86, g: 0.9, b: 0.94, a: 1 }, alignment: 4 }),
],
}));
}
emit('LobbyHud', lobby);
// ── BoardHud — 게시판(공지/팁) ──
const board = [];
let brdId = 0;
const boardRoot = entity({
id: guid('brd', brdId++),
path: '/ui/DefaultGroup/BoardHud',
modelId: 'uisprite', entryId: 'UISprite',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
displayOrder: 14,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 1920, y: 1080 }, pos: { x: 0, y: 0 }, align: ALIGN_CENTER }),
sprite({ color: { r: 0.05, g: 0.06, b: 0.09, a: 0.95 }, type: 1, raycast: true }),
],
});
boardRoot.jsonString.enable = false;
board.push(boardRoot);
board.push(entity({
id: guid('brd', brdId++),
path: '/ui/DefaultGroup/BoardHud/Title',
modelId: 'uitext', entryId: 'UIText',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
displayOrder: 1,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 700, y: 60 }, pos: { x: 0, y: 400 } }),
sprite({ color: TRANSPARENT }),
text({ value: '게시판', fontSize: 44, bold: true, color: GOLD, alignment: 4 }),
],
}));
board.push(entity({
id: guid('brd', brdId++),
path: '/ui/DefaultGroup/BoardHud/Body',
modelId: 'uitext', entryId: 'UIText',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
displayOrder: 1,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 1100, y: 520 }, pos: { x: 0, y: 20 } }),
sprite({ color: { r: 0.1, g: 0.12, b: 0.16, a: 0.9 }, type: 1 }),
text({ value: '· 카드는 직업/등급에 따라 보상 확률이 다릅니다.\n· 몬스터는 매 턴 정해진 행동 중 하나를 무작위로 합니다.\n· 일부 몬스터는 덱에 저주 카드(상처/화상)를 넣습니다.\n· 손패는 최대 10장, 초과분은 자동으로 버려집니다.\n· 2차 전직 후 보스를 잡으면 영혼이 쌓입니다.\n· 영혼은 상인 NPC에서 덱빌딩 해금에 사용합니다.', fontSize: 24, bold: false, color: { r: 0.86, g: 0.9, b: 0.94, a: 1 }, alignment: 0 }),
],
}));
board.push(entity({
id: guid('brd', brdId++),
path: '/ui/DefaultGroup/BoardHud/Close',
modelId: 'uibutton', entryId: 'UIButton',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent',
displayOrder: 2,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 200, y: 60 }, pos: { x: 0, y: -380 }, align: ALIGN_CENTER }),
sprite({ color: { r: 0.2, g: 0.24, b: 0.3, a: 1 }, type: 1, raycast: true }),
button(),
text({ value: '닫기', fontSize: 28, bold: true, color: WHITE, alignment: 4 }),
],
}));
emit('BoardHud', board);
// ── SoulShopHud — 영혼 메타 상점 (Phase 9에서 해금 항목·구매 로직 채움) ──
const soulShop = [];
let soulId = 0;
const soulRoot = entity({
id: guid('soul', soulId++),
path: '/ui/DefaultGroup/SoulShopHud',
modelId: 'uisprite', entryId: 'UISprite',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
displayOrder: 15,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 1920, y: 1080 }, pos: { x: 0, y: 0 }, align: ALIGN_CENTER }),
sprite({ color: { r: 0.05, g: 0.06, b: 0.09, a: 0.95 }, type: 1, raycast: true }),
],
});
soulRoot.jsonString.enable = false;
soulShop.push(soulRoot);
soulShop.push(entity({
id: guid('soul', soulId++),
path: '/ui/DefaultGroup/SoulShopHud/Title',
modelId: 'uitext', entryId: 'UIText',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
displayOrder: 1,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 700, y: 60 }, pos: { x: 0, y: 410 } }),
sprite({ color: TRANSPARENT }),
text({ value: '영혼 상점', fontSize: 44, bold: true, color: { r: 0.6, g: 0.85, b: 1, a: 1 }, alignment: 4 }),
],
}));
soulShop.push(entity({
id: guid('soul', soulId++),
path: '/ui/DefaultGroup/SoulShopHud/Souls',
modelId: 'uitext', entryId: 'UIText',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
displayOrder: 1,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 400, y: 44 }, pos: { x: 0, y: 345 } }),
sprite({ color: TRANSPARENT }),
text({ value: '영혼 0', fontSize: 28, bold: true, color: { r: 0.6, g: 0.85, b: 1, a: 1 }, alignment: 4 }),
],
}));
soulShop.push(entity({
id: guid('soul', soulId++),
path: '/ui/DefaultGroup/SoulShopHud/Close',
modelId: 'uibutton', entryId: 'UIButton',
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent',
displayOrder: 2,
components: [
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 200, y: 60 }, pos: { x: 0, y: -400 }, align: ALIGN_CENTER }),
sprite({ color: { r: 0.2, g: 0.24, b: 0.3, a: 1 }, type: 1, raycast: true }),
button(),
text({ value: '닫기', fontSize: 28, bold: true, color: WHITE, alignment: 4 }),
],
}));
emit('SoulShopHud', soulShop);
for (const section of UI_APPEND_ORDER) {
const entities = uiSections.get(section);
if (entities == null) {
@@ -2500,6 +2726,10 @@ function writeCodeblocks() {
prop('any', 'DeckInspectCloseHandler'),
prop('any', 'AllDeckHandler'),
prop('any', 'AllDeckCloseHandler'),
prop('number', 'SoulPoints', '0'),
prop('boolean', 'LobbyBound', 'false'),
prop('boolean', 'CodexMode', 'false'),
prop('any', 'CodexCards'),
prop('string', 'DeckInspectKind', '""'),
prop('boolean', 'DeckAllOpen', 'false'),
prop('any', 'Cards'),
@@ -2551,7 +2781,7 @@ function writeCodeblocks() {
prop('boolean', 'ChestOpened', 'false'),
prop('string', 'PlayerJob', '""'),
], [
method('OnBeginPlay', `self:ShowMainMenu()
method('OnBeginPlay', `self:ShowLobby()
local lp = _UserService.LocalPlayer
if lp ~= nil then
self:ReqLoadAscension(lp.PlayerComponent.UserId)
@@ -2581,7 +2811,8 @@ 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))`),
method('RenderAscension', `self:SetText("/ui/DefaultGroup/MainMenu/AscLabel", "승천 " .. string.format("%d", self.AscensionLevel) .. " / 해금 " .. string.format("%d", self.AscensionUnlocked))
self:SetText("/ui/DefaultGroup/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
@@ -2616,10 +2847,14 @@ self:SetEntityEnabled("/ui/DefaultGroup/TreasureHud", false)
self:SetEntityEnabled("/ui/DefaultGroup/JobChoiceHud", false)
self:SetEntityEnabled("/ui/DefaultGroup/JobSelectHud", false)
self:SetEntityEnabled("/ui/DefaultGroup/DeckInspectHud", false)
self:SetEntityEnabled("/ui/DefaultGroup/DeckAllHud", false)`),
self:SetEntityEnabled("/ui/DefaultGroup/DeckAllHud", false)
self:SetEntityEnabled("/ui/DefaultGroup/LobbyHud", false)
self:SetEntityEnabled("/ui/DefaultGroup/BoardHud", false)
self:SetEntityEnabled("/ui/DefaultGroup/SoulShopHud", false)`),
method('ShowState', `self:HideGameHud()
self:SetEntityEnabled("/ui/DefaultGroup/MainMenu", state == "menu")
self:SetEntityEnabled("/ui/DefaultGroup/CharacterSelectHud", state == "charselect")
self:SetEntityEnabled("/ui/DefaultGroup/LobbyHud", state == "lobby")
if state == "map" then
self:SetEntityEnabled("/ui/DefaultGroup/MapHud", true)
elseif state == "combat" then
@@ -2696,6 +2931,62 @@ if ascPlus ~= nil and ascPlus.ButtonComponent ~= nil then
end
self.AscPlusHandler = ascPlus:ConnectEvent(ButtonClickEvent, function() self:AdjustAscension(1) end)
end`),
method('ShowLobby', `self.SelectedClass = ""
self:RenderAscension()
self:RenderSoulLabel()
self:ShowState("lobby")
self:SetEntityEnabled("/ui/DefaultGroup/BoardHud", false)
self:SetEntityEnabled("/ui/DefaultGroup/SoulShopHud", false)
self:BindLobbyButtons()
self:BindMenuButtons()`),
method('RenderSoulLabel', `local s = self.SoulPoints or 0
self:SetText("/ui/DefaultGroup/LobbyHud/SoulLabel", "영혼 " .. string.format("%d", s))
self:SetText("/ui/DefaultGroup/SoulShopHud/Souls", "영혼 " .. string.format("%d", s))`),
method('BindLobbyButtons', `if self.LobbyBound == true then
return
end
self.LobbyBound = true
local function bindClick(path, fn)
local e = _EntityService:GetEntityByPath(path)
if e ~= nil and e.ButtonComponent ~= nil then
e:ConnectEvent(ButtonClickEvent, fn)
end
end
bindClick("/ui/DefaultGroup/LobbyHud/NpcRun", function() self:ShowCharacterSelect() end)
bindClick("/ui/DefaultGroup/LobbyHud/NpcCodex", function() self:ShowCodex() end)
bindClick("/ui/DefaultGroup/LobbyHud/NpcShop", function() self:ShowSoulShop() end)
bindClick("/ui/DefaultGroup/LobbyHud/NpcBoard", function() self:ShowBoard() end)
bindClick("/ui/DefaultGroup/LobbyHud/AscMinus", function() self:AdjustAscension(-1) end)
bindClick("/ui/DefaultGroup/LobbyHud/AscPlus", function() self:AdjustAscension(1) end)
bindClick("/ui/DefaultGroup/BoardHud/Close", function() self:CloseBoard() end)
bindClick("/ui/DefaultGroup/SoulShopHud/Close", function() self:CloseSoulShop() end)`),
method('ShowCodex', `self.CodexMode = true
local list = {}
for id, c in pairs(self.Cards) do
if c.curse ~= true then
table.insert(list, id)
end
end
table.sort(list)
self.CodexCards = list
local close = _EntityService:GetEntityByPath("/ui/DefaultGroup/DeckAllHud/Close")
if close ~= nil and close.ButtonComponent ~= nil then
if self.AllDeckCloseHandler ~= nil then
close:DisconnectEvent(ButtonClickEvent, self.AllDeckCloseHandler)
end
self.AllDeckCloseHandler = close:ConnectEvent(ButtonClickEvent, function() self:CloseAllDeck() end)
end
self:SetEntityEnabled("/ui/DefaultGroup/LobbyHud", false)
local hud = _EntityService:GetEntityByPath("/ui/DefaultGroup/DeckAllHud")
if hud ~= nil then
hud.Enable = true
end
self:RenderAllDeck()`),
method('ShowBoard', `self:SetEntityEnabled("/ui/DefaultGroup/BoardHud", true)`),
method('CloseBoard', `self:SetEntityEnabled("/ui/DefaultGroup/BoardHud", false)`),
method('ShowSoulShop', `self:RenderSoulLabel()
self:SetEntityEnabled("/ui/DefaultGroup/SoulShopHud", true)`),
method('CloseSoulShop', `self:SetEntityEnabled("/ui/DefaultGroup/SoulShopHud", false)`),
method('ShowCharacterSelect', `self.SelectedClass = ""
self:ShowState("charselect")
self:RenderCharacterSelect()`),
@@ -3260,10 +3551,19 @@ end`),
local hud = _EntityService:GetEntityByPath("/ui/DefaultGroup/DeckAllHud")
if hud ~= nil then
hud.Enable = false
end
if self.CodexMode == true then
self.CodexMode = false
self:ShowLobby()
end`),
method('RenderAllDeck', `local pile = self.RunDeck or {}
local title = "모든 덱"
if self.CodexMode == true then
pile = self.CodexCards or {}
title = "카드 도감"
end
local count = #pile
self:SetText("/ui/DefaultGroup/DeckAllHud/Title", "모든 덱 (" .. tostring(count) .. ")")
self:SetText("/ui/DefaultGroup/DeckAllHud/Title", title .. " (" .. tostring(count) .. ")")
local empty = _EntityService:GetEntityByPath("/ui/DefaultGroup/DeckAllHud/Empty")
if empty ~= nil then
empty.Enable = count <= 0
@@ -3941,7 +4241,7 @@ if text == "런 클리어!" and self.AscensionLevel >= self.AscensionUnlocked an
end
self:ShowResult(msg)
self.RunActive = false
_TimerService:SetTimerOnce(function() self:ShowMainMenu() end, 4)`, [{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'text' }]),
_TimerService:SetTimerOnce(function() self:ShowLobby() end, 4)`, [{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'text' }]),
method('BuffsLabel', `local parts = {}
if str ~= nil and str > 0 then table.insert(parts, "힘+" .. tostring(str)) end
if weak ~= nil and weak > 0 then table.insert(parts, "약화" .. tostring(weak)) end

File diff suppressed because it is too large Load Diff