From 32a0b2437b29df35cab829d5ea1aaefdca45d12c Mon Sep 17 00:00:00 2001 From: gahusb Date: Thu, 11 Jun 2026 08:48:03 +0900 Subject: [PATCH] =?UTF-8?q?feat(act-maps):=20=EB=A7=89=EB=B3=84=20?= =?UTF-8?q?=EB=A7=B5=20=ED=85=94=EB=A0=88=ED=8F=AC=ED=8A=B8=20+=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=20=EB=A7=B5=20=ED=95=84=ED=84=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- RootDesk/MyDesk/CombatMonster.codeblock | 2 +- tools/deck/gen-slaydeck.mjs | 25 +++++++++++++++++++++++-- tools/monster/gen-combat-monster.mjs | 6 +++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/RootDesk/MyDesk/CombatMonster.codeblock b/RootDesk/MyDesk/CombatMonster.codeblock index de3f3d8..d978331 100644 --- a/RootDesk/MyDesk/CombatMonster.codeblock +++ b/RootDesk/MyDesk/CombatMonster.codeblock @@ -61,7 +61,7 @@ "Name": null }, "Arguments": [], - "Code": "self.RegTries = 0\nlocal eventId = 0\nlocal function reg()\n\tself.RegTries = self.RegTries + 1\n\tlocal c = _EntityService:GetEntityByPath(\"/common\")\n\tif c ~= nil and c.SlayDeckController ~= nil then\n\t\tc.SlayDeckController:RegisterMonster(self.Entity, self.EnemyId, self.Group)\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.RegTries > 50 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(reg, 0.1)", + "Code": "self.RegTries = 0\nlocal eventId = 0\nlocal function reg()\n\tself.RegTries = self.RegTries + 1\n\tlocal c = _EntityService:GetEntityByPath(\"/common\")\n\tif c ~= nil and c.SlayDeckController ~= nil then\n\t\tlocal mapName = \"\"\n\t\tif self.Entity.CurrentMapName ~= nil then\n\t\t\tmapName = self.Entity.CurrentMapName\n\t\tend\n\t\tc.SlayDeckController:RegisterMonster(self.Entity, self.EnemyId, self.Group, mapName)\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.RegTries > 50 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(reg, 0.1)", "Scope": 2, "ExecSpace": 6, "Attributes": [], diff --git a/tools/deck/gen-slaydeck.mjs b/tools/deck/gen-slaydeck.mjs index 2632b78..5855687 100644 --- a/tools/deck/gen-slaydeck.mjs +++ b/tools/deck/gen-slaydeck.mjs @@ -1838,6 +1838,7 @@ function writeCodeblocks() { const REST_HEAL = 30; const RELIC_PRICE = 60; const ACT_COUNT = 3; + const ACT_MAPS = ['map01', 'map02', 'map03']; const combat = codeblock('SlayDeckController', 'SlayDeckController', [ prop('any', 'DrawPile'), prop('any', 'DiscardPile'), @@ -2019,15 +2020,21 @@ self:RenderCombat()`), end local g = group if g == nil or g == "" then g = "combat" end -table.insert(self.Registered, { entity = monster, enemyId = enemyId, group = g })`, [ +local mp = mapName +if mp == nil then mp = "" end +table.insert(self.Registered, { entity = monster, enemyId = enemyId, group = g, map = mp })`, [ { Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'monster' }, { Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'enemyId' }, { Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'group' }, + { Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'mapName' }, ]), method('BuildMonsters', `self.Monsters = {} local g = "combat" local node = self.MapNodes[self.CurrentNodeId] if node ~= nil and node.type ~= nil then g = node.type end +local pmap = "" +local lp = _UserService.LocalPlayer +if lp ~= nil and lp.CurrentMapName ~= nil then pmap = lp.CurrentMapName end local reg = self.Registered or {} for i = 1, #reg do if reg[i].entity ~= nil and isvalid(reg[i].entity) then @@ -2037,7 +2044,7 @@ end local list = {} for i = 1, #reg do local r = reg[i] - if r.entity ~= nil and isvalid(r.entity) and r.group == g then + if r.entity ~= nil and isvalid(r.entity) and r.group == g and (r.map == nil or r.map == "" or pmap == "" or r.map == pmap) then local x = 0 if r.entity.TransformComponent ~= nil then x = r.entity.TransformComponent.WorldPosition.x @@ -2642,6 +2649,7 @@ if anyAlive == false then self.CurrentNodeId = "" self.CurrentEnemyId = "" self:RenderRun() + self:TeleportToActMap() self:ShowMap() else self:ShowResult("런 클리어!") @@ -2655,6 +2663,19 @@ elseif self.PlayerHp <= 0 then self:ShowResult("패배...") self.RunActive = false end`), + method('TeleportToActMap', `local maps = { ${ACT_MAPS.map((m) => `"${m}"`).join(', ')} } +local target = maps[self.Floor] +if target == nil then + return +end +local lp = _UserService.LocalPlayer +if lp == nil then + return +end +if lp.CurrentMapName == target then + return +end +_TeleportService:TeleportToMapPosition(lp, Vector3(-6, 0.03, 0), target)`), method('ShowResult', `self:SetText("/ui/DefaultGroup/CombatHud/Result", text) local entity = _EntityService:GetEntityByPath("/ui/DefaultGroup/CombatHud/Result") if entity ~= nil then diff --git a/tools/monster/gen-combat-monster.mjs b/tools/monster/gen-combat-monster.mjs index b5afece..f37b7c3 100644 --- a/tools/monster/gen-combat-monster.mjs +++ b/tools/monster/gen-combat-monster.mjs @@ -31,7 +31,11 @@ local function reg() self.RegTries = self.RegTries + 1 local c = _EntityService:GetEntityByPath("/common") if c ~= nil and c.SlayDeckController ~= nil then - c.SlayDeckController:RegisterMonster(self.Entity, self.EnemyId, self.Group) + local mapName = "" + if self.Entity.CurrentMapName ~= nil then + mapName = self.Entity.CurrentMapName + end + c.SlayDeckController:RegisterMonster(self.Entity, self.EnemyId, self.Group, mapName) _TimerService:ClearTimer(eventId) elseif self.RegTries > 50 then _TimerService:ClearTimer(eventId)