feat(act-maps): 막별 맵 텔레포트 + 등록 맵 필터
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user