diff --git a/RootDesk/MyDesk/SlayDeckController.codeblock b/RootDesk/MyDesk/SlayDeckController.codeblock index 5b2be3a..cfde1d9 100644 --- a/RootDesk/MyDesk/SlayDeckController.codeblock +++ b/RootDesk/MyDesk/SlayDeckController.codeblock @@ -218,20 +218,6 @@ "Attributes": [], "Name": "TargetIndex" }, - { - "Type": "any", - "DefaultValue": "nil", - "SyncDirection": 0, - "Attributes": [], - "Name": "SlotPos" - }, - { - "Type": "any", - "DefaultValue": "nil", - "SyncDirection": 0, - "Attributes": [], - "Name": "ActiveSlotPos" - }, { "Type": "any", "DefaultValue": "nil", @@ -527,7 +513,7 @@ "Name": null }, "Arguments": [], - "Code": "self.PlayerMaxHp = 80\nself.PlayerHp = self.PlayerMaxHp\nself.Gold = 0\nself.Floor = 1\nself.RunLength = 3\nself.RunDeck = { \"Strike\", \"Strike\", \"Strike\", \"Strike\", \"Strike\", \"Defend\", \"Defend\", \"Defend\", \"Defend\", \"Bash\" }\nself.RunActive = true\nself.RunRelics = {}\nself.Relics = {\n\tironHeart = { name = \"강철 심장\", desc = \"전투 시작 시 방어도 +6\", hook = \"combatStart\", effect = \"block\", value = 6 },\n\tenergyCore = { name = \"에너지 코어\", desc = \"턴 시작 시 에너지 +1\", hook = \"turnStart\", effect = \"energy\", value = 1 },\n\tvampire = { name = \"흡혈 송곳니\", desc = \"공격 카드 사용 시 HP +1\", hook = \"cardPlayed\", effect = \"healOnAttack\", value = 1 },\n\tgoldIdol = { name = \"황금 우상\", desc = \"전투 승리 시 골드 +10\", hook = \"combatReward\", effect = \"gold\", value = 10 },\n}\nself.RelicPool = { \"energyCore\", \"vampire\", \"goldIdol\" }\nself.Enemies = {\n\tslime = { name = \"슬라임\", maxHp = 45, intents = { { kind = \"Attack\", value = 10 }, { kind = \"Attack\", value = 6 }, { kind = \"Defend\", value = 8 } } },\n\tslime_elite = { name = \"정예 슬라임\", maxHp = 70, intents = { { kind = \"Attack\", value = 14 }, { kind = \"Attack\", value = 8 }, { kind = \"Defend\", value = 10 } } },\n\tslime_boss = { name = \"슬라임 킹\", maxHp = 120, intents = { { kind = \"Attack\", value = 18 }, { kind = \"Defend\", value = 12 }, { kind = \"Attack\", value = 10 }, { kind = \"Attack\", value = 22 } } },\n\torange_mushroom = { name = \"주황버섯\", maxHp = 16, intents = { { kind = \"Attack\", value = 5 }, { kind = \"Defend\", value = 4 }, { kind = \"Attack\", value = 7 } } },\n\tblue_mushroom = { name = \"파란버섯\", maxHp = 22, intents = { { kind = \"Attack\", value = 8 }, { kind = \"Attack\", value = 4 } } },\n\tpig = { name = \"돼지\", maxHp = 18, intents = { { kind = \"Attack\", value = 6 }, { kind = \"Defend\", value = 3 } } },\n\tgreen_mushroom = { name = \"초록버섯\", maxHp = 20, intents = { { kind = \"Attack\", value = 7 }, { kind = \"Attack\", value = 4 } } },\n\tmushmom = { name = \"머쉬맘\", maxHp = 75, intents = { { kind = \"Attack\", value = 14 }, { kind = \"Defend\", value = 10 }, { kind = \"Attack\", value = 9 } } },\n\tmodified_snail = { name = \"변형된 달팽이\", maxHp = 60, intents = { { kind = \"Attack\", value = 12 }, { kind = \"Attack\", value = 7 }, { kind = \"Defend\", value = 8 } } },\n\tking_slime = { name = \"킹 슬라임\", maxHp = 130, intents = { { kind = \"Attack\", value = 18 }, { kind = \"Defend\", value = 14 }, { kind = \"Attack\", value = 12 }, { kind = \"Attack\", value = 24 } } },\n}\nself.MapNodes = {\n\tA = { type = \"combat\", enemy = \"slime\", row = 1, col = -1, next = { \"C\", \"D\" } },\n\tB = { type = \"combat\", enemy = \"slime\", row = 1, col = 1, next = { \"C\", \"D\" } },\n\tC = { type = \"rest\", row = 2, col = -1, next = { \"E\", \"F\" } },\n\tD = { type = \"shop\", row = 2, col = 1, next = { \"E\", \"F\" } },\n\tE = { type = \"elite\", enemy = \"slime_elite\", row = 3, col = -1, next = { \"BOSS\" } },\n\tF = { type = \"combat\", enemy = \"slime\", row = 3, col = 1, next = { \"BOSS\" } },\n\tBOSS = { type = \"boss\", enemy = \"slime_boss\", row = 4, col = 0, next = { } },\n}\nself.MapStart = { \"A\", \"B\" }\nself.SlotPos = { combat = { { x = 430, y = 140 }, { x = 600, y = 140 }, { x = 770, y = 140 }, { x = 900, y = 140 } }, elite = { { x = 430, y = 160 }, { x = 650, y = 160 }, { x = 850, y = 160 }, { x = 980, y = 160 } }, boss = { { x = 520, y = 200 }, { x = 760, y = 160 }, { x = 940, y = 150 }, { x = 1040, y = 150 } } }\nself.CurrentNodeId = \"\"\nself.CurrentEnemyId = \"\"\nself:BindButtons()\nself:AddRelic(\"ironHeart\")\nself:ShowMap()", + "Code": "self.PlayerMaxHp = 80\nself.PlayerHp = self.PlayerMaxHp\nself.Gold = 0\nself.Floor = 1\nself.RunLength = 3\nself.RunDeck = { \"Strike\", \"Strike\", \"Strike\", \"Strike\", \"Strike\", \"Defend\", \"Defend\", \"Defend\", \"Defend\", \"Bash\" }\nself.RunActive = true\nself.RunRelics = {}\nself.Relics = {\n\tironHeart = { name = \"강철 심장\", desc = \"전투 시작 시 방어도 +6\", hook = \"combatStart\", effect = \"block\", value = 6 },\n\tenergyCore = { name = \"에너지 코어\", desc = \"턴 시작 시 에너지 +1\", hook = \"turnStart\", effect = \"energy\", value = 1 },\n\tvampire = { name = \"흡혈 송곳니\", desc = \"공격 카드 사용 시 HP +1\", hook = \"cardPlayed\", effect = \"healOnAttack\", value = 1 },\n\tgoldIdol = { name = \"황금 우상\", desc = \"전투 승리 시 골드 +10\", hook = \"combatReward\", effect = \"gold\", value = 10 },\n}\nself.RelicPool = { \"energyCore\", \"vampire\", \"goldIdol\" }\nself.Enemies = {\n\tslime = { name = \"슬라임\", maxHp = 45, intents = { { kind = \"Attack\", value = 10 }, { kind = \"Attack\", value = 6 }, { kind = \"Defend\", value = 8 } } },\n\tslime_elite = { name = \"정예 슬라임\", maxHp = 70, intents = { { kind = \"Attack\", value = 14 }, { kind = \"Attack\", value = 8 }, { kind = \"Defend\", value = 10 } } },\n\tslime_boss = { name = \"슬라임 킹\", maxHp = 120, intents = { { kind = \"Attack\", value = 18 }, { kind = \"Defend\", value = 12 }, { kind = \"Attack\", value = 10 }, { kind = \"Attack\", value = 22 } } },\n\torange_mushroom = { name = \"주황버섯\", maxHp = 16, intents = { { kind = \"Attack\", value = 5 }, { kind = \"Defend\", value = 4 }, { kind = \"Attack\", value = 7 } } },\n\tblue_mushroom = { name = \"파란버섯\", maxHp = 22, intents = { { kind = \"Attack\", value = 8 }, { kind = \"Attack\", value = 4 } } },\n\tpig = { name = \"돼지\", maxHp = 18, intents = { { kind = \"Attack\", value = 6 }, { kind = \"Defend\", value = 3 } } },\n\tgreen_mushroom = { name = \"초록버섯\", maxHp = 20, intents = { { kind = \"Attack\", value = 7 }, { kind = \"Attack\", value = 4 } } },\n\tmushmom = { name = \"머쉬맘\", maxHp = 75, intents = { { kind = \"Attack\", value = 14 }, { kind = \"Defend\", value = 10 }, { kind = \"Attack\", value = 9 } } },\n\tmodified_snail = { name = \"변형된 달팽이\", maxHp = 60, intents = { { kind = \"Attack\", value = 12 }, { kind = \"Attack\", value = 7 }, { kind = \"Defend\", value = 8 } } },\n\tking_slime = { name = \"킹 슬라임\", maxHp = 130, intents = { { kind = \"Attack\", value = 18 }, { kind = \"Defend\", value = 14 }, { kind = \"Attack\", value = 12 }, { kind = \"Attack\", value = 24 } } },\n}\nself.MapNodes = {\n\tA = { type = \"combat\", enemy = \"slime\", row = 1, col = -1, next = { \"C\", \"D\" } },\n\tB = { type = \"combat\", enemy = \"slime\", row = 1, col = 1, next = { \"C\", \"D\" } },\n\tC = { type = \"rest\", row = 2, col = -1, next = { \"E\", \"F\" } },\n\tD = { type = \"shop\", row = 2, col = 1, next = { \"E\", \"F\" } },\n\tE = { type = \"elite\", enemy = \"slime_elite\", row = 3, col = -1, next = { \"BOSS\" } },\n\tF = { type = \"combat\", enemy = \"slime\", row = 3, col = 1, next = { \"BOSS\" } },\n\tBOSS = { type = \"boss\", enemy = \"slime_boss\", row = 4, col = 0, next = { } },\n}\nself.MapStart = { \"A\", \"B\" }\nself.CurrentNodeId = \"\"\nself.CurrentEnemyId = \"\"\nself:BindButtons()\nself:AddRelic(\"ironHeart\")\nself:ShowMap()", "Scope": 2, "ExecSpace": 6, "Attributes": [], @@ -594,7 +580,7 @@ "Name": null }, "Arguments": [], - "Code": "self.Monsters = {}\nlocal g = \"combat\"\nlocal node = self.MapNodes[self.CurrentNodeId]\nif node ~= nil and node.type ~= nil then g = node.type end\nself.ActiveSlotPos = self.SlotPos[g]\nlocal reg = self.Registered or {}\nfor i = 1, #reg do\n\tif reg[i].entity ~= nil and isvalid(reg[i].entity) then\n\t\treg[i].entity:SetVisible(false)\n\tend\nend\nlocal list = {}\nfor i = 1, #reg do\n\tlocal r = reg[i]\n\tif r.entity ~= nil and isvalid(r.entity) and r.group == g then\n\t\tlocal x = 0\n\t\tif r.entity.TransformComponent ~= nil then\n\t\t\tx = r.entity.TransformComponent.WorldPosition.x\n\t\tend\n\t\ttable.insert(list, { entity = r.entity, enemyId = r.enemyId, x = x })\n\tend\nend\ntable.sort(list, function(a, b) return a.x < b.x end)\nlocal mult = 1 + (self.Floor - 1) * 0.6\nlocal n = #list\nif n > 4 then n = 4 end\nfor i = 1, n do\n\tlocal item = list[i]\n\tlocal e = self.Enemies[item.enemyId]\n\tif e == nil then e = { name = item.enemyId, maxHp = 10, intents = { { kind = \"Attack\", value = 5 } } } end\n\tlocal intents = {}\n\tfor k = 1, #e.intents do\n\t\tintents[k] = { kind = e.intents[k].kind, value = math.floor(e.intents[k].value * mult) }\n\tend\n\tlocal maxHp = math.floor(e.maxHp * mult)\n\tself.Monsters[i] = { entity = item.entity, enemyId = item.enemyId, name = e.name,\n\t\thp = maxHp, maxHp = maxHp, block = 0, intents = intents, intentIdx = 1, alive = true, slot = i }\n\tself:ReviveMonsterEntity(item.entity)\n\tself:PositionMonsterSlot(i)\nend\nself.TargetIndex = 1", + "Code": "self.Monsters = {}\nlocal g = \"combat\"\nlocal node = self.MapNodes[self.CurrentNodeId]\nif node ~= nil and node.type ~= nil then g = node.type end\nlocal reg = self.Registered or {}\nfor i = 1, #reg do\n\tif reg[i].entity ~= nil and isvalid(reg[i].entity) then\n\t\treg[i].entity:SetVisible(false)\n\tend\nend\nlocal list = {}\nfor i = 1, #reg do\n\tlocal r = reg[i]\n\tif r.entity ~= nil and isvalid(r.entity) and r.group == g then\n\t\tlocal x = 0\n\t\tif r.entity.TransformComponent ~= nil then\n\t\t\tx = r.entity.TransformComponent.WorldPosition.x\n\t\tend\n\t\ttable.insert(list, { entity = r.entity, enemyId = r.enemyId, x = x })\n\tend\nend\ntable.sort(list, function(a, b) return a.x < b.x end)\nlocal mult = 1 + (self.Floor - 1) * 0.6\nlocal n = #list\nif n > 4 then n = 4 end\nfor i = 1, n do\n\tlocal item = list[i]\n\tlocal e = self.Enemies[item.enemyId]\n\tif e == nil then e = { name = item.enemyId, maxHp = 10, intents = { { kind = \"Attack\", value = 5 } } } end\n\tlocal intents = {}\n\tfor k = 1, #e.intents do\n\t\tintents[k] = { kind = e.intents[k].kind, value = math.floor(e.intents[k].value * mult) }\n\tend\n\tlocal maxHp = math.floor(e.maxHp * mult)\n\tself.Monsters[i] = { entity = item.entity, enemyId = item.enemyId, name = e.name,\n\t\thp = maxHp, maxHp = maxHp, block = 0, intents = intents, intentIdx = 1, alive = true, slot = i }\n\tself:ReviveMonsterEntity(item.entity)\n\tself:PositionMonsterSlot(i)\nend\nself.TargetIndex = 1", "Scope": 2, "ExecSpace": 6, "Attributes": [], @@ -1281,7 +1267,7 @@ "Name": "slot" } ], - "Code": "local sp = self.ActiveSlotPos\nif sp == nil or sp[slot] == nil then\n\treturn\nend\nlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(slot))\nif e ~= nil and e.UITransformComponent ~= nil then\n\te.UITransformComponent.anchoredPosition = Vector2(sp[slot].x, sp[slot].y)\nend", + "Code": "local m = self.Monsters[slot]\nif m == nil or m.entity == nil or not isvalid(m.entity) then\n\treturn\nend\nlocal tr = m.entity.TransformComponent\nif tr == nil then\n\treturn\nend\nlocal wp = tr.WorldPosition\nlocal screen = _UILogic:WorldToScreenPosition(Vector2(wp.x, wp.y + 1.4))\nlocal uipos = _UILogic:ScreenToUIPosition(screen)\nlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(slot))\nif e ~= nil and e.UITransformComponent ~= nil then\n\te.UITransformComponent.anchoredPosition = uipos\nend", "Scope": 2, "ExecSpace": 6, "Attributes": [], diff --git a/data/monster-slots.json b/data/monster-slots.json deleted file mode 100644 index 378dd10..0000000 --- a/data/monster-slots.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "combat": [ - { "x": 430, "y": 140 }, - { "x": 600, "y": 140 }, - { "x": 770, "y": 140 }, - { "x": 900, "y": 140 } - ], - "elite": [ - { "x": 430, "y": 160 }, - { "x": 650, "y": 160 }, - { "x": 850, "y": 160 }, - { "x": 980, "y": 160 } - ], - "boss": [ - { "x": 520, "y": 200 }, - { "x": 760, "y": 160 }, - { "x": 940, "y": 150 }, - { "x": 1040, "y": 150 } - ] -} diff --git a/map/map01.map b/map/map01.map index 9321cb8..2941431 100644 --- a/map/map01.map +++ b/map/map01.map @@ -31,15 +31,15 @@ "@components": [ { "@type": "MOD.Core.MapComponent", - "AirAccelerationXFactor": 1.0, - "AirDecelerationXFactor": 1.0, - "FallSpeedMaxXFactor": 1.0, - "FallSpeedMaxYFactor": 1.0, - "Gravity": 1.0, + "AirAccelerationXFactor": 1, + "AirDecelerationXFactor": 1, + "FallSpeedMaxXFactor": 1, + "FallSpeedMaxYFactor": 1, + "Gravity": 1, "IsInstanceMap": false, "TileMapMode": 0, - "WalkAccelerationFactor": 1.0, - "WalkDrag": 1.0, + "WalkAccelerationFactor": 1, + "WalkDrag": 1, "Enable": true }, { @@ -54,9 +54,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -73,8 +73,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -85,9 +85,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -104,8 +104,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -116,9 +116,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -135,8 +135,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -147,9 +147,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -166,8 +166,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -178,9 +178,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -197,8 +197,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -209,9 +209,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -228,8 +228,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -240,9 +240,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -259,8 +259,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -271,9 +271,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -290,8 +290,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -302,9 +302,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -321,8 +321,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -333,9 +333,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -352,8 +352,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -364,9 +364,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -383,8 +383,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -395,9 +395,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -414,8 +414,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -426,9 +426,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -445,8 +445,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -457,9 +457,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -476,8 +476,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -488,9 +488,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -507,8 +507,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -519,9 +519,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -538,8 +538,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -550,9 +550,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -569,8 +569,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -581,9 +581,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -600,8 +600,8 @@ "y": -0.04000002 }, "Variance": { - "x": 1.0, - "y": 0.0 + "x": 1, + "y": 0 } }, { @@ -612,9 +612,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -631,8 +631,8 @@ "y": -0.9 }, "Variance": { - "x": 0.0, - "y": -1.0 + "x": 0, + "y": -1 } }, { @@ -643,9 +643,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -662,8 +662,8 @@ "y": -1.50000012 }, "Variance": { - "x": 0.0, - "y": -1.0 + "x": 0, + "y": -1 } }, { @@ -674,9 +674,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -693,8 +693,8 @@ "y": -2.10000014 }, "Variance": { - "x": 0.0, - "y": -1.0 + "x": 0, + "y": -1 } }, { @@ -705,9 +705,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -724,8 +724,8 @@ "y": -2.7 }, "Variance": { - "x": 0.0, - "y": -1.0 + "x": 0, + "y": -1 } }, { @@ -736,9 +736,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -755,8 +755,8 @@ "y": -3.30000019 }, "Variance": { - "x": 0.0, - "y": -1.0 + "x": 0, + "y": -1 } }, { @@ -767,9 +767,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -786,8 +786,8 @@ "y": -3.9 }, "Variance": { - "x": 0.0, - "y": -1.0 + "x": 0, + "y": -1 } }, { @@ -798,9 +798,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -817,8 +817,8 @@ "y": -4.50000048 }, "Variance": { - "x": 0.0, - "y": -1.0 + "x": 0, + "y": -1 } }, { @@ -829,9 +829,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -848,8 +848,8 @@ "y": -5.10000038 }, "Variance": { - "x": 0.0, - "y": -1.0 + "x": 0, + "y": -1 } }, { @@ -860,9 +860,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -879,8 +879,8 @@ "y": -0.04000002 }, "Variance": { - "x": 0.0, - "y": 1.0 + "x": 0, + "y": 1 } }, { @@ -891,9 +891,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -910,8 +910,8 @@ "y": -0.9000001 }, "Variance": { - "x": 0.0, - "y": 1.0 + "x": 0, + "y": 1 } }, { @@ -922,9 +922,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -941,8 +941,8 @@ "y": -1.50000012 }, "Variance": { - "x": 0.0, - "y": 1.0 + "x": 0, + "y": 1 } }, { @@ -953,9 +953,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -972,8 +972,8 @@ "y": -2.10000014 }, "Variance": { - "x": 0.0, - "y": 1.0 + "x": 0, + "y": 1 } }, { @@ -984,9 +984,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -1003,8 +1003,8 @@ "y": -2.70000029 }, "Variance": { - "x": 0.0, - "y": 1.0 + "x": 0, + "y": 1 } }, { @@ -1015,9 +1015,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -1034,8 +1034,8 @@ "y": -3.30000019 }, "Variance": { - "x": 0.0, - "y": 1.0 + "x": 0, + "y": 1 } }, { @@ -1046,9 +1046,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -1065,8 +1065,8 @@ "y": -3.90000033 }, "Variance": { - "x": 0.0, - "y": 1.0 + "x": 0, + "y": 1 } }, { @@ -1077,9 +1077,9 @@ "layer": 1, "sortingLayerName": "MapLayer0", "attribute": { - "walk": 1.0, - "force": 0.0, - "drag": 1.0, + "walk": 1, + "force": 0, + "drag": 1, "isBlockVertical": false, "isDynamic": false, "isCustomFoothold": false, @@ -1096,8 +1096,8 @@ "y": -4.5 }, "Variance": { - "x": 0.0, - "y": 1.0 + "x": 0, + "y": 1 } } ] @@ -1213,32 +1213,32 @@ "Position": { "x": -0.225, "y": -0.15, - "z": 1000.0 + "z": 1000 }, "QuaternionRotation": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 1.0 + "x": 0, + "y": 0, + "z": 0, + "w": 1 }, "Scale": { - "x": 1.0, - "y": 1.0, - "z": 1.0 + "x": 1, + "y": 1, + "z": 1 }, "Enable": true }, { "@type": "MOD.Core.TileMapComponent", "Color": { - "r": 1.0, - "g": 1.0, - "b": 1.0, - "a": 1.0 + "r": 1, + "g": 1, + "b": 1, + "a": 1 }, - "FootholdDrag": 1.0, - "FootholdForce": 0.0, - "FootholdWalkSpeedFactor": 1.0, + "FootholdDrag": 1, + "FootholdForce": 0, + "FootholdWalkSpeedFactor": 1, "IgnoreMapLayerCheck": false, "IsOddGridPosition": false, "OrderInLayer": 1, @@ -6306,27 +6306,27 @@ { "@type": "MOD.Core.TransformComponent", "Rotation": { - "x": 0.0, - "y": 0.0, - "z": 0.0 + "x": 0, + "y": 0, + "z": 0 }, "Position": { - "x": -5.0, - "y": 0.0, + "x": -5, + "y": 0, "z": 999.999 }, "QuaternionRotation": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 1.0 + "x": 0, + "y": 0, + "z": 0, + "w": 1 }, "Scale": { - "x": 1.0, - "y": 1.0, - "z": 1.0 + "x": 1, + "y": 1, + "z": 1 }, - "ZRotation": 0.0, + "ZRotation": 0, "Enable": true }, { @@ -6338,20 +6338,20 @@ "FlipY": false, "IgnoreMapLayerCheck": false, "OrderInLayer": 0, - "PlayRate": 1.0, + "PlayRate": 1, "RenderSetting": 0, "SortingLayer": "Default", "SpriteRUID": "8ef238e0d0ca4bb783aca526cff35d11", "StartFrameIndex": 0, "TiledSize": { - "x": 1.0, - "y": 1.0 + "x": 1, + "y": 1 }, "Color": { - "r": 1.0, - "g": 1.0, - "b": 1.0, - "a": 1.0 + "r": 1, + "g": 1, + "b": 1, + "a": 1 }, "Enable": true }, @@ -6394,15 +6394,15 @@ "z": 999.999 }, "QuaternionRotation": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 1.0 + "x": 0, + "y": 0, + "z": 0, + "w": 1 }, "Scale": { - "x": 1.0, - "y": 1.0, - "z": 1.0 + "x": 1, + "y": 1, + "z": 1 }, "Enable": true }, @@ -6430,19 +6430,19 @@ { "@type": "MOD.Core.RigidbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "RealMoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.MovementComponent", - "InputSpeed": 0.0, - "JumpForce": 6.0, + "InputSpeed": 0, + "JumpForce": 6, "Enable": false }, { @@ -6476,27 +6476,27 @@ "@type": "script.MonsterAttack", "Enable": true, "SpriteSize": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "PositionOffset": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 } }, { "@type": "MOD.Core.KinematicbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.SideviewbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, @@ -6548,10 +6548,10 @@ "z": 999.999 }, "QuaternionRotation": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 1.0 + "x": 0, + "y": 0, + "z": 0, + "w": 1 }, "Enable": true }, @@ -6579,19 +6579,19 @@ { "@type": "MOD.Core.RigidbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "RealMoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.MovementComponent", "InputSpeed": 1.5, - "JumpForce": 6.0, + "JumpForce": 6, "Enable": true }, { @@ -6606,7 +6606,7 @@ "y": 0.4 }, "ColliderOffset": { - "x": 0.0, + "x": 0, "y": 0.2 }, "IsLegacy": false, @@ -6625,27 +6625,27 @@ "@type": "script.MonsterAttack", "Enable": true, "SpriteSize": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "PositionOffset": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 } }, { "@type": "MOD.Core.KinematicbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.SideviewbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, @@ -6690,10 +6690,10 @@ "z": 999.999 }, "QuaternionRotation": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 1.0 + "x": 0, + "y": 0, + "z": 0, + "w": 1 }, "Enable": true }, @@ -6721,19 +6721,19 @@ { "@type": "MOD.Core.RigidbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "RealMoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.MovementComponent", - "InputSpeed": 1.0, - "JumpForce": 0.0, + "InputSpeed": 1, + "JumpForce": 0, "Enable": true }, { @@ -6767,27 +6767,27 @@ "@type": "script.MonsterAttack", "Enable": true, "SpriteSize": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "PositionOffset": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 } }, { "@type": "MOD.Core.KinematicbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.SideviewbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, @@ -6827,15 +6827,15 @@ { "@type": "MOD.Core.TransformComponent", "Position": { - "x": 0.761952639, + "x": 3, "y": 0.03499998, "z": 999.999 }, "QuaternionRotation": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 1.0 + "x": 0, + "y": 0, + "z": 0, + "w": 1 }, "Enable": true }, @@ -6864,19 +6864,19 @@ { "@type": "MOD.Core.RigidbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "RealMoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.MovementComponent", "InputSpeed": 1.5, - "JumpForce": 6.0, + "JumpForce": 6, "Enable": true }, { @@ -6910,27 +6910,27 @@ "@type": "script.MonsterAttack", "Enable": true, "SpriteSize": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "PositionOffset": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 } }, { "@type": "MOD.Core.KinematicbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.SideviewbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, @@ -6970,15 +6970,15 @@ { "@type": "MOD.Core.TransformComponent", "Position": { - "x": -1.02145791, + "x": 5, "y": 0.03499998, "z": 999.999 }, "QuaternionRotation": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 1.0 + "x": 0, + "y": 0, + "z": 0, + "w": 1 }, "Enable": true }, @@ -7007,19 +7007,19 @@ { "@type": "MOD.Core.RigidbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "RealMoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.MovementComponent", - "InputSpeed": 1.0, - "JumpForce": 0.0, + "InputSpeed": 1, + "JumpForce": 0, "Enable": true }, { @@ -7053,27 +7053,27 @@ "@type": "script.MonsterAttack", "Enable": true, "SpriteSize": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "PositionOffset": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 } }, { "@type": "MOD.Core.KinematicbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.SideviewbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, @@ -7113,15 +7113,15 @@ { "@type": "MOD.Core.TransformComponent", "Position": { - "x": -3.25780082, + "x": 4, "y": 0.03499998, "z": 999.999 }, "QuaternionRotation": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 1.0 + "x": 0, + "y": 0, + "z": 0, + "w": 1 }, "Enable": true }, @@ -7151,19 +7151,19 @@ { "@type": "MOD.Core.RigidbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "RealMoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.MovementComponent", "InputSpeed": 1.5, - "JumpForce": 6.0, + "JumpForce": 6, "Enable": true }, { @@ -7197,27 +7197,27 @@ "@type": "script.MonsterAttack", "Enable": true, "SpriteSize": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "PositionOffset": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 } }, { "@type": "MOD.Core.KinematicbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, { "@type": "MOD.Core.SideviewbodyComponent", "MoveVelocity": { - "x": 0.0, - "y": 0.0 + "x": 0, + "y": 0 }, "Enable": true }, diff --git a/tools/deck/gen-slaydeck.mjs b/tools/deck/gen-slaydeck.mjs index ca011f0..8cf39dc 100644 --- a/tools/deck/gen-slaydeck.mjs +++ b/tools/deck/gen-slaydeck.mjs @@ -26,7 +26,6 @@ for (const [id, n] of Object.entries(MAP.nodes)) { const MAX_ROW = Math.max(...Object.values(MAP.nodes).map((n) => n.row)); const RELICS = JSON.parse(readFileSync('data/relics.json', 'utf8')); -const SLOTS = JSON.parse(readFileSync('data/monster-slots.json', 'utf8')); if (!RELICS.relics[RELICS.startingRelic]) throw new Error(`[gen-slaydeck] startingRelic 없음: ${RELICS.startingRelic}`); for (const id of RELICS.relicPool) { if (!RELICS.relics[id]) throw new Error(`[gen-slaydeck] relicPool에 없는 유물 id: ${id}`); @@ -73,9 +72,6 @@ function luaCardsTable(cards) { function luaDeckTable(deck) { return `self.DrawPile = { ${deck.map(luaStr).join(', ')} }`; } -function luaSlotGroup(arr) { - return '{ ' + arr.map((s) => `{ x = ${s.x}, y = ${s.y} }`).join(', ') + ' }'; -} const UI_FILE = 'ui/DefaultGroup.ui'; const COMMON_FILE = 'Global/common.gamelogic'; @@ -88,6 +84,7 @@ const DEFEND = { r: 0.42, g: 0.55, b: 0.85, a: 1 }; const SKILL = { r: 0.46, g: 0.68, b: 0.52, a: 1 }; const MAX_MONSTERS = 4; +const HEAD_OFFSET_Y = 1.4; // 몬스터 월드 원점 위로 띄울 높이(머리 위) — world→screen 변환 전 가산 const HP_BAR_W = 120; const CARD_W = 180; @@ -311,11 +308,6 @@ function entity({ id, path, modelId, entryId, componentNames, components, displa } function upsertUi() { - for (const g of ['combat', 'elite', 'boss']) { - if (!Array.isArray(SLOTS[g]) || SLOTS[g].length < MAX_MONSTERS) { - throw new Error(`[gen-slaydeck] monster-slots.json "${g}" 그룹 좌표(${SLOTS[g] ? SLOTS[g].length : 0}) < MAX_MONSTERS(${MAX_MONSTERS})`); - } - } const ui = JSON.parse(readFileSync(UI_FILE, 'utf8')); const E = ui.ContentProto.Entities; ui.ContentProto.Entities = E.filter((e) => !e.path.startsWith('/ui/DefaultGroup/DeckHud') && !e.path.startsWith('/ui/DefaultGroup/DeckInspectHud') && !e.path.startsWith('/ui/DefaultGroup/DeckAllHud') && !e.path.startsWith('/ui/DefaultGroup/CombatHud') && !e.path.startsWith('/ui/DefaultGroup/RewardHud') && !e.path.startsWith('/ui/DefaultGroup/MapHud') && !e.path.startsWith('/ui/DefaultGroup/ShopHud') && !e.path.startsWith('/ui/DefaultGroup/RestHud') && !e.path.startsWith('/ui/DefaultGroup/MainMenu') && !e.path.startsWith('/ui/DefaultGroup/CharacterSelectHud')); @@ -1564,8 +1556,6 @@ function writeCodeblocks() { prop('any', 'Monsters'), prop('any', 'Registered'), prop('number', 'TargetIndex', '1'), - prop('any', 'SlotPos'), - prop('any', 'ActiveSlotPos'), prop('any', 'RunDeck'), prop('number', 'Gold', '0'), prop('number', 'Floor', '0'), @@ -1677,7 +1667,6 @@ self.RelicPool = { ${RELICS.relicPool.map(luaStr).join(', ')} } ${luaEnemiesTable(ENEMIES.enemies)} ${luaMapNodesTable(MAP.nodes)} ${luaStartArray(MAP.start)} -self.SlotPos = { combat = ${luaSlotGroup(SLOTS.combat)}, elite = ${luaSlotGroup(SLOTS.elite)}, boss = ${luaSlotGroup(SLOTS.boss)} } self.CurrentNodeId = "" self.CurrentEnemyId = "" self:BindButtons() @@ -1718,7 +1707,6 @@ table.insert(self.Registered, { entity = monster, enemyId = enemyId, group = g } local g = "combat" local node = self.MapNodes[self.CurrentNodeId] if node ~= nil and node.type ~= nil then g = node.type end -self.ActiveSlotPos = self.SlotPos[g] local reg = self.Registered or {} for i = 1, #reg do if reg[i].entity ~= nil and isvalid(reg[i].entity) then @@ -2285,13 +2273,20 @@ e.UITransformComponent.RectSize = Vector2(w, 14)`, [ { Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'hp' }, { Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'maxHp' }, ]), - method('PositionMonsterSlot', `local sp = self.ActiveSlotPos -if sp == nil or sp[slot] == nil then + method('PositionMonsterSlot', `local m = self.Monsters[slot] +if m == nil or m.entity == nil or not isvalid(m.entity) then return end +local tr = m.entity.TransformComponent +if tr == nil then + return +end +local wp = tr.WorldPosition +local screen = _UILogic:WorldToScreenPosition(Vector2(wp.x, wp.y + ${HEAD_OFFSET_Y})) +local uipos = _UILogic:ScreenToUIPosition(screen) local e = _EntityService:GetEntityByPath("/ui/DefaultGroup/CombatHud/MonsterSlot" .. tostring(slot)) if e ~= nil and e.UITransformComponent ~= nil then - e.UITransformComponent.anchoredPosition = Vector2(sp[slot].x, sp[slot].y) + e.UITransformComponent.anchoredPosition = uipos end`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }]), method('SetTarget', `if self.Monsters[slot] ~= nil and self.Monsters[slot].alive == true then self.TargetIndex = slot