Add main menu flow #7
@@ -23,7 +23,6 @@
|
||||
"MOD.Core.SpriteRendererComponent",
|
||||
"MOD.Core.RigidbodyComponent",
|
||||
"MOD.Core.MovementComponent",
|
||||
"MOD.Core.AIChaseComponent",
|
||||
"MOD.Core.StateComponent",
|
||||
"MOD.Core.HitComponent",
|
||||
"MOD.Core.DamageSkinSpawnerComponent",
|
||||
@@ -150,4 +149,4 @@
|
||||
"Children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": 1.0
|
||||
"Value": 0
|
||||
},
|
||||
{
|
||||
"TargetType": null,
|
||||
@@ -39,7 +39,7 @@
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": 1.0
|
||||
"Value": 0
|
||||
},
|
||||
{
|
||||
"TargetType": null,
|
||||
@@ -48,7 +48,7 @@
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": 1.0
|
||||
"Value": 0
|
||||
},
|
||||
{
|
||||
"TargetType": null,
|
||||
@@ -57,7 +57,7 @@
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": 1.0
|
||||
"Value": 1
|
||||
},
|
||||
{
|
||||
"TargetType": null,
|
||||
@@ -118,7 +118,7 @@
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": 0.0
|
||||
"Value": 0
|
||||
},
|
||||
{
|
||||
"TargetType": null,
|
||||
@@ -129,8 +129,8 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODVector2, MOD.Core",
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -185,7 +185,7 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODVector2, MOD.Core",
|
||||
"x": 0.0,
|
||||
"x": 0,
|
||||
"y": 0.35
|
||||
}
|
||||
},
|
||||
@@ -198,7 +198,7 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODVector2, MOD.Core",
|
||||
"x": 0.0,
|
||||
"x": 0,
|
||||
"y": 0.35
|
||||
}
|
||||
},
|
||||
@@ -218,7 +218,7 @@
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": 500.0
|
||||
"Value": 500
|
||||
},
|
||||
{
|
||||
"TargetType": "script.PlayerHit",
|
||||
@@ -254,7 +254,7 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODVector2, MOD.Core",
|
||||
"x": 0.0,
|
||||
"x": 0,
|
||||
"y": 0.35
|
||||
}
|
||||
},
|
||||
@@ -265,7 +265,7 @@
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": 1.0
|
||||
"Value": 0
|
||||
},
|
||||
{
|
||||
"TargetType": "MOD.Core.MovementComponent",
|
||||
@@ -274,7 +274,7 @@
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": 1.0
|
||||
"Value": 0
|
||||
},
|
||||
{
|
||||
"TargetType": "MOD.Core.PlayerComponent",
|
||||
@@ -302,4 +302,4 @@
|
||||
"Children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
"MOD.Core.SpriteRendererComponent",
|
||||
"MOD.Core.RigidbodyComponent",
|
||||
"MOD.Core.MovementComponent",
|
||||
"MOD.Core.AIWanderComponent",
|
||||
"MOD.Core.StateComponent",
|
||||
"MOD.Core.HitComponent",
|
||||
"MOD.Core.DamageSkinSpawnerComponent",
|
||||
@@ -141,4 +140,4 @@
|
||||
"Children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
"MOD.Core.SpriteRendererComponent",
|
||||
"MOD.Core.RigidbodyComponent",
|
||||
"MOD.Core.MovementComponent",
|
||||
"MOD.Core.AIWanderComponent",
|
||||
"MOD.Core.StateComponent",
|
||||
"MOD.Core.HitComponent",
|
||||
"MOD.Core.DamageSkinSpawnerComponent",
|
||||
@@ -57,10 +56,10 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODQuaternion, MOD.Core",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 1.0
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -186,8 +185,8 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODVector2, MOD.Core",
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -199,8 +198,8 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODVector2, MOD.Core",
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -219,7 +218,7 @@
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": 1.0
|
||||
"Value": 0
|
||||
},
|
||||
{
|
||||
"TargetType": "MOD.Core.MovementComponent",
|
||||
@@ -228,7 +227,7 @@
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": 0.0
|
||||
"Value": 0
|
||||
},
|
||||
{
|
||||
"TargetType": "MOD.Core.MovementComponent",
|
||||
@@ -239,24 +238,6 @@
|
||||
},
|
||||
"Value": true
|
||||
},
|
||||
{
|
||||
"TargetType": "MOD.Core.AIWanderComponent",
|
||||
"Name": "IsLegacy",
|
||||
"ValueType": {
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": false
|
||||
},
|
||||
{
|
||||
"TargetType": "MOD.Core.AIWanderComponent",
|
||||
"Name": "Enable",
|
||||
"ValueType": {
|
||||
"$type": "MODNativeType",
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
},
|
||||
"Value": true
|
||||
},
|
||||
{
|
||||
"TargetType": "MOD.Core.StateComponent",
|
||||
"Name": "IsLegacy",
|
||||
@@ -376,8 +357,8 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODVector2, MOD.Core",
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -389,8 +370,8 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODVector2, MOD.Core",
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -402,8 +383,8 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODVector2, MOD.Core",
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -424,8 +405,8 @@
|
||||
},
|
||||
"Value": {
|
||||
"$type": "MOD.Core.MODVector2, MOD.Core",
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -460,4 +441,4 @@
|
||||
"Children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,13 @@
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": "EndTurnHandler"
|
||||
},
|
||||
{
|
||||
"Type": "any",
|
||||
"DefaultValue": "nil",
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": "NewGameHandler"
|
||||
}
|
||||
],
|
||||
"Methods": [
|
||||
@@ -96,12 +103,57 @@
|
||||
"Name": null
|
||||
},
|
||||
"Arguments": [],
|
||||
"Code": "self:StartCombat()",
|
||||
"Code": "self:ShowMainMenu()",
|
||||
"Scope": 2,
|
||||
"ExecSpace": 6,
|
||||
"Attributes": [],
|
||||
"Name": "OnBeginPlay"
|
||||
},
|
||||
{
|
||||
"Return": {
|
||||
"Type": "void",
|
||||
"DefaultValue": null,
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": null
|
||||
},
|
||||
"Arguments": [],
|
||||
"Code": "self:SetEntityEnabled(\"/ui/DefaultGroup/MainMenu\", true)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CardHand\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckHud\", false)\nself:BindMenuButtons()",
|
||||
"Scope": 2,
|
||||
"ExecSpace": 6,
|
||||
"Attributes": [],
|
||||
"Name": "ShowMainMenu"
|
||||
},
|
||||
{
|
||||
"Return": {
|
||||
"Type": "void",
|
||||
"DefaultValue": null,
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": null
|
||||
},
|
||||
"Arguments": [],
|
||||
"Code": "local buttonEntity = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/MainMenu/NewGameButton\")\nif buttonEntity == nil or buttonEntity.ButtonComponent == nil then\n\treturn\nend\nif self.NewGameHandler ~= nil then\n\tbuttonEntity:DisconnectEvent(ButtonClickEvent, self.NewGameHandler)\n\tself.NewGameHandler = nil\nend\nself.NewGameHandler = buttonEntity:ConnectEvent(ButtonClickEvent, self.StartNewGame)",
|
||||
"Scope": 2,
|
||||
"ExecSpace": 6,
|
||||
"Attributes": [],
|
||||
"Name": "BindMenuButtons"
|
||||
},
|
||||
{
|
||||
"Return": {
|
||||
"Type": "void",
|
||||
"DefaultValue": null,
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": null
|
||||
},
|
||||
"Arguments": [],
|
||||
"Code": "self:SetEntityEnabled(\"/ui/DefaultGroup/MainMenu\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CardHand\", true)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckHud\", true)\nself:ConfigureTurnBasedMonsters()\nself:ConfigureTurnBasedPlayer()\nself:StartCombat()",
|
||||
"Scope": 2,
|
||||
"ExecSpace": 6,
|
||||
"Attributes": [],
|
||||
"Name": "StartNewGame"
|
||||
},
|
||||
{
|
||||
"Return": {
|
||||
"Type": "void",
|
||||
@@ -117,6 +169,59 @@
|
||||
"Attributes": [],
|
||||
"Name": "StartCombat"
|
||||
},
|
||||
{
|
||||
"Return": {
|
||||
"Type": "void",
|
||||
"DefaultValue": null,
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": null
|
||||
},
|
||||
"Arguments": [],
|
||||
"Code": "for mapIndex = 1, 11 do\n\tlocal mapName = \"map\" .. string.format(\"%02d\", mapIndex)\n\tfor i = 1, 6 do\n\t\tself:ConfigureMonsterForTurnCombat(_EntityService:GetEntityByPath(\"/maps/\" .. mapName .. \"/Monster\" .. tostring(i)))\n\tend\n\tself:ConfigureMonsterForTurnCombat(_EntityService:GetEntityByPath(\"/maps/\" .. mapName .. \"/StaticMonsterTemplate\"))\n\tself:ConfigureMonsterForTurnCombat(_EntityService:GetEntityByPath(\"/maps/\" .. mapName .. \"/MoveMonsterTemplate\"))\n\tself:ConfigureMonsterForTurnCombat(_EntityService:GetEntityByPath(\"/maps/\" .. mapName .. \"/ChaseMonsterTemplate\"))\n\tself:ConfigureMonsterForTurnCombat(_EntityService:GetEntityByPath(\"/maps/\" .. mapName .. \"/monster-43\"))\nend",
|
||||
"Scope": 2,
|
||||
"ExecSpace": 6,
|
||||
"Attributes": [],
|
||||
"Name": "ConfigureTurnBasedMonsters"
|
||||
},
|
||||
{
|
||||
"Return": {
|
||||
"Type": "void",
|
||||
"DefaultValue": null,
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": null
|
||||
},
|
||||
"Arguments": [
|
||||
{
|
||||
"Type": "Entity",
|
||||
"DefaultValue": null,
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": "monster"
|
||||
}
|
||||
],
|
||||
"Code": "if monster == nil then\n\treturn\nend\nif monster.AIWanderComponent ~= nil then\n\tmonster.AIWanderComponent.Enable = false\nend\nif monster.AIChaseComponent ~= nil then\n\tmonster.AIChaseComponent.Enable = false\nend\nif monster.MovementComponent ~= nil then\n\tmonster.MovementComponent.Enable = false\nend\nif monster.RigidbodyComponent ~= nil then\n\tmonster.RigidbodyComponent.MoveVelocity = Vector2.zero\n\tmonster.RigidbodyComponent.RealMoveVelocity = Vector2.zero\nend\nif monster.TransformComponent ~= nil then\n\tlocal scale = monster.TransformComponent.Scale\n\tmonster.TransformComponent.Scale = Vector3(math.abs(scale.x), math.abs(scale.y), scale.z)\nend\nif monster.StateAnimationComponent ~= nil and monster.SpriteRendererComponent ~= nil then\n\tlocal stand = monster.StateAnimationComponent.ActionSheet[\"stand\"]\n\tif stand ~= nil and stand ~= \"\" then\n\t\tmonster.SpriteRendererComponent.SpriteRUID = stand\n\tend\nend",
|
||||
"Scope": 2,
|
||||
"ExecSpace": 6,
|
||||
"Attributes": [],
|
||||
"Name": "ConfigureMonsterForTurnCombat"
|
||||
},
|
||||
{
|
||||
"Return": {
|
||||
"Type": "void",
|
||||
"DefaultValue": null,
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": null
|
||||
},
|
||||
"Arguments": [],
|
||||
"Code": "local player = nil\npcall(function()\n\tif _UserService ~= nil and _UserService.LocalPlayer ~= nil then\n\t\tplayer = _UserService.LocalPlayer\n\tend\nend)\npcall(function()\n\tif player == nil and _UserService ~= nil and _UserService.LocalPlayerEntity ~= nil then\n\t\tplayer = _UserService.LocalPlayerEntity\n\tend\nend)\npcall(function()\n\tif player == nil and _UserService ~= nil and _UserService.GetLocalPlayer ~= nil then\n\t\tplayer = _UserService:GetLocalPlayer()\n\tend\nend)\nif player ~= nil and player.Entity ~= nil then\n\tplayer = player.Entity\nend\nif player == nil then\n\treturn\nend\nif player.PlayerControllerComponent ~= nil then\n\tplayer.PlayerControllerComponent.Enable = false\n\tpcall(function() player.PlayerControllerComponent.LookDirectionX = 1 end)\nend\nif player.MovementComponent ~= nil then\n\tplayer.MovementComponent.Enable = false\n\tpcall(function() player.MovementComponent.InputSpeed = 0 end)\n\tpcall(function() player.MovementComponent.JumpForce = 0 end)\nend\nif player.RigidbodyComponent ~= nil then\n\tplayer.RigidbodyComponent.MoveVelocity = Vector2.zero\n\tplayer.RigidbodyComponent.RealMoveVelocity = Vector2.zero\nend\nif player.TransformComponent ~= nil then\n\tlocal scale = player.TransformComponent.Scale\n\tplayer.TransformComponent.Scale = Vector3(math.abs(scale.x), math.abs(scale.y), scale.z)\nend",
|
||||
"Scope": 2,
|
||||
"ExecSpace": 6,
|
||||
"Attributes": [],
|
||||
"Name": "ConfigureTurnBasedPlayer"
|
||||
},
|
||||
{
|
||||
"Return": {
|
||||
"Type": "void",
|
||||
@@ -285,7 +390,7 @@
|
||||
"Name": "cardId"
|
||||
}
|
||||
],
|
||||
"Code": "local name = cardId\nlocal cost = 0\nlocal desc = \"\"\nlocal kind = \"Skill\"\nif cardId == \"Strike\" then\n\tname = \"타격\"\n\tcost = 1\n\tdesc = \"피해 6\"\n\tkind = \"Attack\"\nelseif cardId == \"Defend\" then\n\tname = \"방어\"\n\tcost = 1\n\tdesc = \"방어도 5\"\n\tkind = \"Skill\"\nelseif cardId == \"Bash\" then\n\tname = \"강타\"\n\tcost = 2\n\tdesc = \"피해 10\"\n\tkind = \"Attack\"\nend\nself:SetText(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot) .. \"/Cost\", tostring(cost))\nself:SetText(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot) .. \"/Name\", name)\nself:SetText(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot) .. \"/Desc\", desc)\nlocal cardEntity = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot))\nif cardEntity ~= nil and cardEntity.SpriteGUIRendererComponent ~= nil then\n\tlocal ok = false\n\tlocal color = nil\n\tif kind == \"Attack\" then\n\t\tok, color = pcall(function() return Color(0.86, 0.42, 0.38, 1) end)\n\telseif kind == \"Skill\" then\n\t\tok, color = pcall(function() return Color(0.42, 0.55, 0.85, 1) end)\n\telse\n\t\tok, color = pcall(function() return Color(0.46, 0.68, 0.52, 1) end)\n\tend\n\tif ok == true and color ~= nil then\n\t\tcardEntity.SpriteGUIRendererComponent.Color = color\n\tend\nend",
|
||||
"Code": "local name = cardId\nlocal cost = 0\nlocal desc = \"\"\nlocal kind = \"Skill\"\nif cardId == \"Strike\" then\n\tname = \"타격\"\n\tcost = 1\n\tdesc = \"피해 6\"\n\tkind = \"Attack\"\nelseif cardId == \"Defend\" then\n\tname = \"방어\"\n\tcost = 1\n\tdesc = \"방어도 5\"\n\tkind = \"Skill\"\nelseif cardId == \"Bash\" then\n\tname = \"강타\"\n\tcost = 2\n\tdesc = \"피해 10\"\n\tkind = \"Attack\"\nend\nself:SetText(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot) .. \"/Cost\", tostring(cost))\nself:SetText(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot) .. \"/Name\", name)\nself:SetText(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot) .. \"/Desc\", desc)\nlocal cardEntity = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot))\nif cardEntity ~= nil and cardEntity.SpriteGUIRendererComponent ~= nil then\n\tlocal ok = false\n\tlocal color = nil\n\tif kind == \"Attack\" then\n\t\tok, color = pcall(function() return Color(0.86, 0.42, 0.38, 1) end)\n\telseif kind == \"Skill\" then\n\t\tok, color = pcall(function() return Color(0.42, 0.55, 0.85, 1) end)\n\tend\n\tif ok == true and color ~= nil then\n\t\tcardEntity.SpriteGUIRendererComponent.Color = color\n\tend\nend",
|
||||
"Scope": 2,
|
||||
"ExecSpace": 6,
|
||||
"Attributes": [],
|
||||
@@ -321,6 +426,36 @@
|
||||
"Attributes": [],
|
||||
"Name": "SetText"
|
||||
},
|
||||
{
|
||||
"Return": {
|
||||
"Type": "void",
|
||||
"DefaultValue": null,
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": null
|
||||
},
|
||||
"Arguments": [
|
||||
{
|
||||
"Type": "string",
|
||||
"DefaultValue": null,
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": "path"
|
||||
},
|
||||
{
|
||||
"Type": "boolean",
|
||||
"DefaultValue": null,
|
||||
"SyncDirection": 0,
|
||||
"Attributes": [],
|
||||
"Name": "enabled"
|
||||
}
|
||||
],
|
||||
"Code": "local entity = _EntityService:GetEntityByPath(path)\nif entity ~= nil then\n\tentity.Enable = enabled\nend",
|
||||
"Scope": 2,
|
||||
"ExecSpace": 6,
|
||||
"Attributes": [],
|
||||
"Name": "SetEntityEnabled"
|
||||
},
|
||||
{
|
||||
"Return": {
|
||||
"Type": "void",
|
||||
|
||||
620
map/map01.map
620
map/map01.map
File diff suppressed because it is too large
Load Diff
@@ -6479,7 +6479,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6626,7 +6627,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6651,4 +6653,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6479,7 +6479,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6626,7 +6627,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6651,4 +6653,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6479,7 +6479,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6626,7 +6627,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6651,4 +6653,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6479,7 +6479,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6626,7 +6627,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6651,4 +6653,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6479,7 +6479,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6626,7 +6627,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6651,4 +6653,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6479,7 +6479,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6626,7 +6627,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6651,4 +6653,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6479,7 +6479,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6626,7 +6627,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6651,4 +6653,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6479,7 +6479,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6626,7 +6627,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6651,4 +6653,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6479,7 +6479,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6626,7 +6627,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6651,4 +6653,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6479,7 +6479,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6626,7 +6627,8 @@
|
||||
},
|
||||
{
|
||||
"@type": "MOD.Core.MovementComponent",
|
||||
"Enable": true
|
||||
"Enable": false,
|
||||
"InputSpeed": 0
|
||||
},
|
||||
{
|
||||
"@type": "script.Monster",
|
||||
@@ -6651,4 +6653,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
83
tools/freeze-turn-monsters.mjs
Normal file
83
tools/freeze-turn-monsters.mjs
Normal file
@@ -0,0 +1,83 @@
|
||||
import { readFileSync, writeFileSync } from 'node:fs';
|
||||
|
||||
const AI_COMPONENTS = new Set([
|
||||
'MOD.Core.AIWanderComponent',
|
||||
'MOD.Core.AIChaseComponent',
|
||||
]);
|
||||
|
||||
const mapFiles = Array.from({ length: 11 }, (_, i) => `map/map${String(i + 1).padStart(2, '0')}.map`);
|
||||
const modelFiles = [
|
||||
'Global/MoveMonster.model',
|
||||
'Global/ChaseMonster.model',
|
||||
'RootDesk/MyDesk/Model_monster-43.model',
|
||||
];
|
||||
|
||||
function isMonster(entity) {
|
||||
return (entity.componentNames || '').includes('script.Monster');
|
||||
}
|
||||
|
||||
function component(entity, type) {
|
||||
return entity.jsonString['@components'].find((c) => c['@type'] === type);
|
||||
}
|
||||
|
||||
function patchMonsterEntity(entity) {
|
||||
const components = entity.jsonString['@components'];
|
||||
entity.jsonString['@components'] = components.filter((c) => !AI_COMPONENTS.has(c['@type']));
|
||||
entity.componentNames = entity.jsonString['@components'].map((c) => c['@type']).join(',');
|
||||
|
||||
const movement = component(entity, 'MOD.Core.MovementComponent');
|
||||
if (movement) {
|
||||
movement.Enable = false;
|
||||
movement.InputSpeed = 0;
|
||||
}
|
||||
|
||||
const rigidbody = component(entity, 'MOD.Core.RigidbodyComponent');
|
||||
if (rigidbody) {
|
||||
rigidbody.MoveVelocity = { x: 0, y: 0 };
|
||||
rigidbody.RealMoveVelocity = { x: 0, y: 0 };
|
||||
}
|
||||
|
||||
const transform = component(entity, 'MOD.Core.TransformComponent');
|
||||
if (transform?.Scale) {
|
||||
transform.Scale.x = Math.abs(transform.Scale.x || 1);
|
||||
transform.Scale.y = Math.abs(transform.Scale.y || 1);
|
||||
}
|
||||
|
||||
const stateAnimation = component(entity, 'MOD.Core.StateAnimationComponent');
|
||||
const renderer = component(entity, 'MOD.Core.SpriteRendererComponent');
|
||||
const stand = stateAnimation?.ActionSheet?.stand;
|
||||
if (renderer && stand) {
|
||||
renderer.SpriteRUID = stand;
|
||||
}
|
||||
}
|
||||
|
||||
function patchMap(file) {
|
||||
const data = JSON.parse(readFileSync(file, 'utf8'));
|
||||
for (const entity of data.ContentProto.Entities.filter(isMonster)) {
|
||||
patchMonsterEntity(entity);
|
||||
}
|
||||
writeFileSync(file, `${JSON.stringify(data, null, 2)}\n`, 'utf8');
|
||||
}
|
||||
|
||||
function patchModel(file) {
|
||||
const data = JSON.parse(readFileSync(file, 'utf8'));
|
||||
const json = data.ContentProto.Json;
|
||||
json.Components = (json.Components || []).filter((name) => !AI_COMPONENTS.has(name));
|
||||
json.Values = (json.Values || []).filter((value) => !AI_COMPONENTS.has(value.TargetType));
|
||||
for (const value of json.Values) {
|
||||
if (value.TargetType === 'MOD.Core.MovementComponent' && value.Name === 'InputSpeed') {
|
||||
value.Value = 0;
|
||||
}
|
||||
}
|
||||
writeFileSync(file, `${JSON.stringify(data, null, 2)}\n`, 'utf8');
|
||||
}
|
||||
|
||||
for (const file of mapFiles) {
|
||||
patchMap(file);
|
||||
}
|
||||
|
||||
for (const file of modelFiles) {
|
||||
patchModel(file);
|
||||
}
|
||||
|
||||
console.log('Turn-combat monster movement disabled.');
|
||||
20
tools/freeze-turn-player.mjs
Normal file
20
tools/freeze-turn-player.mjs
Normal file
@@ -0,0 +1,20 @@
|
||||
import { readFileSync, writeFileSync } from 'node:fs';
|
||||
|
||||
const file = 'Global/DefaultPlayer.model';
|
||||
const data = JSON.parse(readFileSync(file, 'utf8'));
|
||||
const values = data.ContentProto.Json.Values || [];
|
||||
|
||||
for (const value of values) {
|
||||
if (value.TargetType === null && ['speed', 'jumpForce', 'walkAcceleration'].includes(value.Name)) {
|
||||
value.Value = 0;
|
||||
}
|
||||
if (value.TargetType === 'MOD.Core.MovementComponent' && ['InputSpeed', 'JumpForce'].includes(value.Name)) {
|
||||
value.Value = 0;
|
||||
}
|
||||
if (value.TargetType === 'MOD.Core.RigidbodyComponent' && ['MoveVelocity', 'RealMoveVelocity'].includes(value.Name)) {
|
||||
value.Value = { x: 0, y: 0 };
|
||||
}
|
||||
}
|
||||
|
||||
writeFileSync(file, `${JSON.stringify(data, null, 2)}\n`, 'utf8');
|
||||
console.log('Turn-combat player movement disabled.');
|
||||
@@ -8,13 +8,10 @@ const DARK = { r: 0.08, g: 0.09, b: 0.11, a: 0.92 };
|
||||
const GOLD = { r: 0.94, g: 0.74, b: 0.26, a: 1 };
|
||||
const ATTACK = { r: 0.86, g: 0.42, b: 0.38, a: 1 };
|
||||
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 CARD_W = 180;
|
||||
const CARD_H = 250;
|
||||
const CARD_SPACING = 200;
|
||||
const CARD_XS = [-400, -200, 0, 200, 400];
|
||||
|
||||
const ALIGN_CENTER = 0;
|
||||
const ALIGN_BOTTOM_CENTER = 6;
|
||||
|
||||
@@ -23,8 +20,6 @@ function guid(prefix, n) {
|
||||
}
|
||||
|
||||
function transform({ parentW, parentH, anchor, pivot, size, pos, align = 0 }) {
|
||||
const offMin = { x: pos.x - pivot.x * size.x, y: pos.y - pivot.y * size.y };
|
||||
const offMax = { x: pos.x + (1 - pivot.x) * size.x, y: pos.y + (1 - pivot.y) * size.y };
|
||||
return {
|
||||
'@type': 'MOD.Core.UITransformComponent',
|
||||
ActivePlatform: 255,
|
||||
@@ -32,8 +27,8 @@ function transform({ parentW, parentH, anchor, pivot, size, pos, align = 0 }) {
|
||||
AnchorsMax: anchor,
|
||||
AnchorsMin: anchor,
|
||||
MobileOnly: false,
|
||||
OffsetMax: offMax,
|
||||
OffsetMin: offMin,
|
||||
OffsetMax: { x: pos.x + (1 - pivot.x) * size.x, y: pos.y + (1 - pivot.y) * size.y },
|
||||
OffsetMin: { x: pos.x - pivot.x * size.x, y: pos.y - pivot.y * size.y },
|
||||
Pivot: pivot,
|
||||
RectSize: size,
|
||||
UIMode: 1,
|
||||
@@ -83,7 +78,7 @@ function sprite({ dataId = '', color = TRANSPARENT, type = 1, raycast = false })
|
||||
};
|
||||
}
|
||||
|
||||
function button() {
|
||||
function button({ enabled = true } = {}) {
|
||||
return {
|
||||
'@type': 'MOD.Core.ButtonComponent',
|
||||
Colors: {
|
||||
@@ -104,7 +99,7 @@ function button() {
|
||||
KeyCode: 0,
|
||||
OverrideSorting: false,
|
||||
Transition: 1,
|
||||
Enable: true,
|
||||
Enable: enabled,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -135,7 +130,7 @@ function text({ value, fontSize, bold = false, color = { r: 1, g: 1, b: 1, a: 1
|
||||
};
|
||||
}
|
||||
|
||||
function entity({ id, path, modelId, entryId, componentNames, components, displayOrder }) {
|
||||
function entity({ id, path, modelId, entryId, componentNames, components, displayOrder, enable = true }) {
|
||||
const parts = path.split('/');
|
||||
const name = parts[parts.length - 1];
|
||||
return {
|
||||
@@ -146,7 +141,7 @@ function entity({ id, path, modelId, entryId, componentNames, components, displa
|
||||
name,
|
||||
path,
|
||||
nameEditable: true,
|
||||
enable: true,
|
||||
enable,
|
||||
visible: true,
|
||||
localize: true,
|
||||
displayOrder,
|
||||
@@ -168,10 +163,15 @@ function entity({ id, path, modelId, entryId, componentNames, components, displa
|
||||
|
||||
function upsertUi() {
|
||||
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'));
|
||||
ui.ContentProto.Entities = ui.ContentProto.Entities.filter(
|
||||
(e) => !e.path.startsWith('/ui/DefaultGroup/DeckHud')
|
||||
&& !e.path.startsWith('/ui/DefaultGroup/MainMenu')
|
||||
&& !e.path.startsWith('/ui/DefaultGroup/CardHand/Card5/'),
|
||||
);
|
||||
|
||||
const byPath = new Map(ui.ContentProto.Entities.map((e) => [e.path, e]));
|
||||
const cardHand = byPath.get('/ui/DefaultGroup/CardHand');
|
||||
if (cardHand) cardHand.jsonString.enable = false;
|
||||
|
||||
const cards = [
|
||||
{ name: '타격', cost: '1', desc: '피해 6', tint: ATTACK },
|
||||
@@ -181,7 +181,7 @@ function upsertUi() {
|
||||
{ name: '강타', cost: '2', desc: '피해 10', tint: ATTACK },
|
||||
];
|
||||
|
||||
for (let i = 1; i <= 5; i++) {
|
||||
for (let i = 1; i <= 5; i += 1) {
|
||||
const card = byPath.get(`/ui/DefaultGroup/CardHand/Card${i}`);
|
||||
if (!card) continue;
|
||||
const tr = card.jsonString['@components'].find((c) => c['@type'] === 'MOD.Core.UITransformComponent');
|
||||
@@ -193,25 +193,24 @@ function upsertUi() {
|
||||
sp.ImageRUID = { DataId: '' };
|
||||
sp.Type = 1;
|
||||
sp.Color = cards[i - 1].tint;
|
||||
card.jsonString.enable = true;
|
||||
card.jsonString.visible = true;
|
||||
card.jsonString.enable = false;
|
||||
|
||||
const children = [
|
||||
for (const [suffix, cfg] of [
|
||||
['Cost', { size: { x: 50, y: 50 }, pos: { x: -60, y: 95 }, value: cards[i - 1].cost, fontSize: 34, bold: true }],
|
||||
['Name', { size: { x: 160, y: 50 }, pos: { x: 0, y: 50 }, value: cards[i - 1].name, fontSize: 26, bold: true }],
|
||||
['Desc', { size: { x: 160, y: 82 }, pos: { x: 0, y: -80 }, value: cards[i - 1].desc, fontSize: 20, bold: false }],
|
||||
];
|
||||
for (const [suffix, cfg] of children) {
|
||||
]) {
|
||||
const path = `/ui/DefaultGroup/CardHand/Card${i}/${suffix}`;
|
||||
let child = byPath.get(path);
|
||||
if (!child) {
|
||||
child = entity({
|
||||
id: guid('dck', i * 10 + children.findIndex(([s]) => s === suffix)),
|
||||
id: guid('d00e', i * 10 + (suffix === 'Cost' ? 0 : suffix === 'Name' ? 1 : 2)),
|
||||
path,
|
||||
modelId: 'uitext',
|
||||
entryId: 'UIText',
|
||||
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
|
||||
displayOrder: suffix === 'Cost' ? 0 : suffix === 'Name' ? 1 : 2,
|
||||
enable: false,
|
||||
components: [
|
||||
transform({ parentW: CARD_W, parentH: CARD_H, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: cfg.size, pos: cfg.pos }),
|
||||
sprite({ color: TRANSPARENT }),
|
||||
@@ -221,8 +220,7 @@ function upsertUi() {
|
||||
ui.ContentProto.Entities.push(child);
|
||||
byPath.set(path, child);
|
||||
} else {
|
||||
child.jsonString.enable = true;
|
||||
child.jsonString.visible = true;
|
||||
child.jsonString.enable = false;
|
||||
child.jsonString['@components'][2].Text = cfg.value;
|
||||
child.jsonString['@components'][2].FontSize = cfg.fontSize;
|
||||
child.jsonString['@components'][2].MaxSize = cfg.fontSize;
|
||||
@@ -230,16 +228,84 @@ function upsertUi() {
|
||||
}
|
||||
}
|
||||
|
||||
const hud = [];
|
||||
const add = (e) => hud.push(e);
|
||||
const ents = [];
|
||||
const add = (e) => ents.push(e);
|
||||
|
||||
add(entity({
|
||||
id: guid('hud', 0),
|
||||
id: guid('f00d', 0),
|
||||
path: '/ui/DefaultGroup/MainMenu',
|
||||
modelId: 'uisprite',
|
||||
entryId: 'UISprite',
|
||||
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
|
||||
displayOrder: 20,
|
||||
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.04, g: 0.05, b: 0.07, a: 0.96 }, type: 1, raycast: true }),
|
||||
],
|
||||
}));
|
||||
add(entity({
|
||||
id: guid('f00d', 1),
|
||||
path: '/ui/DefaultGroup/MainMenu/Title',
|
||||
modelId: 'uitext',
|
||||
entryId: 'UIText',
|
||||
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
|
||||
displayOrder: 0,
|
||||
components: [
|
||||
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 720, y: 100 }, pos: { x: 0, y: 180 }, align: ALIGN_CENTER }),
|
||||
sprite({ color: TRANSPARENT }),
|
||||
text({ value: '슬레이 메이플', fontSize: 64, bold: true, color: GOLD, alignment: 0 }),
|
||||
],
|
||||
}));
|
||||
add(entity({
|
||||
id: guid('f00d', 2),
|
||||
path: '/ui/DefaultGroup/MainMenu/Subtitle',
|
||||
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: 760, y: 48 }, pos: { x: 0, y: 104 }, align: ALIGN_CENTER }),
|
||||
sprite({ color: TRANSPARENT }),
|
||||
text({ value: '카드를 뽑고, 덱을 만들고, 첨탑을 오른다', fontSize: 24, color: { r: 0.82, g: 0.86, b: 0.9, a: 1 }, alignment: 0 }),
|
||||
],
|
||||
}));
|
||||
add(entity({
|
||||
id: guid('f00d', 3),
|
||||
path: '/ui/DefaultGroup/MainMenu/NewGameButton',
|
||||
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: 260, y: 68 }, pos: { x: 0, y: -20 }, align: ALIGN_CENTER }),
|
||||
sprite({ color: { r: 0.13, g: 0.15, b: 0.18, a: 1 }, type: 1, raycast: true }),
|
||||
button(),
|
||||
text({ value: '새 게임', fontSize: 30, bold: true, color: GOLD, alignment: 0 }),
|
||||
],
|
||||
}));
|
||||
add(entity({
|
||||
id: guid('f00d', 4),
|
||||
path: '/ui/DefaultGroup/MainMenu/ContinueButton',
|
||||
modelId: 'uibutton',
|
||||
entryId: 'UIButton',
|
||||
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent',
|
||||
displayOrder: 3,
|
||||
components: [
|
||||
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 260, y: 58 }, pos: { x: 0, y: -100 }, align: ALIGN_CENTER }),
|
||||
sprite({ color: { r: 0.1, g: 0.11, b: 0.13, a: 0.78 }, type: 1, raycast: false }),
|
||||
button({ enabled: false }),
|
||||
text({ value: '이어하기', fontSize: 24, bold: true, color: { r: 0.55, g: 0.58, b: 0.62, a: 1 }, alignment: 0 }),
|
||||
],
|
||||
}));
|
||||
|
||||
add(entity({
|
||||
id: guid('feed', 0),
|
||||
path: '/ui/DefaultGroup/DeckHud',
|
||||
modelId: 'uiempty',
|
||||
entryId: 'UIEmpty',
|
||||
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
|
||||
displayOrder: 5,
|
||||
enable: false,
|
||||
components: [
|
||||
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 1280, y: 330 }, pos: { x: 0, y: 180 }, align: ALIGN_BOTTOM_CENTER }),
|
||||
sprite({ color: TRANSPARENT }),
|
||||
@@ -247,11 +313,11 @@ function upsertUi() {
|
||||
}));
|
||||
|
||||
for (const pile of [
|
||||
{ key: 'DrawPile', x: -590, label: '뽑을 덱', count: '10', color: { r: 0.17, g: 0.20, b: 0.25, a: 1 } },
|
||||
{ key: 'DrawPile', x: -590, label: '뽑을 덱', count: '10', color: { r: 0.17, g: 0.2, b: 0.25, a: 1 } },
|
||||
{ key: 'DiscardPile', x: 590, label: '버린 덱', count: '0', color: { r: 0.22, g: 0.18, b: 0.16, a: 1 } },
|
||||
]) {
|
||||
add(entity({
|
||||
id: guid('hud', hud.length),
|
||||
id: guid('feed', ents.length),
|
||||
path: `/ui/DefaultGroup/DeckHud/${pile.key}`,
|
||||
modelId: 'uisprite',
|
||||
entryId: 'UISprite',
|
||||
@@ -263,7 +329,7 @@ function upsertUi() {
|
||||
],
|
||||
}));
|
||||
add(entity({
|
||||
id: guid('hud', hud.length),
|
||||
id: guid('feed', ents.length),
|
||||
path: `/ui/DefaultGroup/DeckHud/${pile.key}/Label`,
|
||||
modelId: 'uitext',
|
||||
entryId: 'UIText',
|
||||
@@ -276,7 +342,7 @@ function upsertUi() {
|
||||
],
|
||||
}));
|
||||
add(entity({
|
||||
id: guid('hud', hud.length),
|
||||
id: guid('feed', ents.length),
|
||||
path: `/ui/DefaultGroup/DeckHud/${pile.key}/Count`,
|
||||
modelId: 'uitext',
|
||||
entryId: 'UIText',
|
||||
@@ -291,7 +357,7 @@ function upsertUi() {
|
||||
}
|
||||
|
||||
add(entity({
|
||||
id: guid('hud', hud.length),
|
||||
id: guid('feed', ents.length),
|
||||
path: '/ui/DefaultGroup/DeckHud/EndTurnButton',
|
||||
modelId: 'uibutton',
|
||||
entryId: 'UIButton',
|
||||
@@ -304,9 +370,8 @@ function upsertUi() {
|
||||
text({ value: '턴 종료', fontSize: 25, bold: true, color: GOLD, alignment: 0 }),
|
||||
],
|
||||
}));
|
||||
|
||||
add(entity({
|
||||
id: guid('hud', hud.length),
|
||||
id: guid('feed', ents.length),
|
||||
path: '/ui/DefaultGroup/DeckHud/Energy',
|
||||
modelId: 'uitext',
|
||||
entryId: 'UIText',
|
||||
@@ -319,7 +384,7 @@ function upsertUi() {
|
||||
],
|
||||
}));
|
||||
|
||||
ui.ContentProto.Entities.push(...hud);
|
||||
ui.ContentProto.Entities.push(...ents);
|
||||
JSON.parse(JSON.stringify(ui));
|
||||
writeFileSync(UI_FILE, JSON.stringify(ui, null, 2), 'utf8');
|
||||
}
|
||||
@@ -328,13 +393,13 @@ function prop(Type, Name, DefaultValue = 'nil') {
|
||||
return { Type, DefaultValue, SyncDirection: 0, Attributes: [], Name };
|
||||
}
|
||||
|
||||
function method(Name, Code, Arguments = [], ExecSpace = 0) {
|
||||
function method(Name, Code, Arguments = []) {
|
||||
return {
|
||||
Return: { Type: 'void', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: null },
|
||||
Arguments,
|
||||
Code,
|
||||
Scope: 2,
|
||||
ExecSpace,
|
||||
ExecSpace: 6,
|
||||
Attributes: [],
|
||||
Name,
|
||||
};
|
||||
@@ -383,8 +448,28 @@ function writeCodeblocks() {
|
||||
prop('number', 'Turn', '0'),
|
||||
prop('number', 'TweenEventId', '0'),
|
||||
prop('any', 'EndTurnHandler'),
|
||||
prop('any', 'NewGameHandler'),
|
||||
], [
|
||||
method('OnBeginPlay', `self:StartCombat()`),
|
||||
method('OnBeginPlay', `self:ShowMainMenu()`),
|
||||
method('ShowMainMenu', `self:SetEntityEnabled("/ui/DefaultGroup/MainMenu", true)
|
||||
self:SetEntityEnabled("/ui/DefaultGroup/CardHand", false)
|
||||
self:SetEntityEnabled("/ui/DefaultGroup/DeckHud", false)
|
||||
self:BindMenuButtons()`),
|
||||
method('BindMenuButtons', `local buttonEntity = _EntityService:GetEntityByPath("/ui/DefaultGroup/MainMenu/NewGameButton")
|
||||
if buttonEntity == nil or buttonEntity.ButtonComponent == nil then
|
||||
\treturn
|
||||
end
|
||||
if self.NewGameHandler ~= nil then
|
||||
\tbuttonEntity:DisconnectEvent(ButtonClickEvent, self.NewGameHandler)
|
||||
\tself.NewGameHandler = nil
|
||||
end
|
||||
self.NewGameHandler = buttonEntity:ConnectEvent(ButtonClickEvent, self.StartNewGame)`),
|
||||
method('StartNewGame', `self:SetEntityEnabled("/ui/DefaultGroup/MainMenu", false)
|
||||
self:SetEntityEnabled("/ui/DefaultGroup/CardHand", true)
|
||||
self:SetEntityEnabled("/ui/DefaultGroup/DeckHud", true)
|
||||
self:ConfigureTurnBasedMonsters()
|
||||
self:ConfigureTurnBasedPlayer()
|
||||
self:StartCombat()`),
|
||||
method('StartCombat', `self.MaxEnergy = 3
|
||||
self.Turn = 0
|
||||
self.DiscardPile = {}
|
||||
@@ -393,6 +478,81 @@ self.DrawPile = { "Strike", "Strike", "Strike", "Strike", "Strike", "Defend", "D
|
||||
self:Shuffle(self.DrawPile)
|
||||
self:BindButtons()
|
||||
self:StartPlayerTurn()`),
|
||||
method('ConfigureTurnBasedMonsters', `for mapIndex = 1, 11 do
|
||||
\tlocal mapName = "map" .. string.format("%02d", mapIndex)
|
||||
\tfor i = 1, 6 do
|
||||
\t\tself:ConfigureMonsterForTurnCombat(_EntityService:GetEntityByPath("/maps/" .. mapName .. "/Monster" .. tostring(i)))
|
||||
\tend
|
||||
\tself:ConfigureMonsterForTurnCombat(_EntityService:GetEntityByPath("/maps/" .. mapName .. "/StaticMonsterTemplate"))
|
||||
\tself:ConfigureMonsterForTurnCombat(_EntityService:GetEntityByPath("/maps/" .. mapName .. "/MoveMonsterTemplate"))
|
||||
\tself:ConfigureMonsterForTurnCombat(_EntityService:GetEntityByPath("/maps/" .. mapName .. "/ChaseMonsterTemplate"))
|
||||
\tself:ConfigureMonsterForTurnCombat(_EntityService:GetEntityByPath("/maps/" .. mapName .. "/monster-43"))
|
||||
end`),
|
||||
method('ConfigureMonsterForTurnCombat', `if monster == nil then
|
||||
\treturn
|
||||
end
|
||||
if monster.AIWanderComponent ~= nil then
|
||||
\tmonster.AIWanderComponent.Enable = false
|
||||
end
|
||||
if monster.AIChaseComponent ~= nil then
|
||||
\tmonster.AIChaseComponent.Enable = false
|
||||
end
|
||||
if monster.MovementComponent ~= nil then
|
||||
\tmonster.MovementComponent.Enable = false
|
||||
end
|
||||
if monster.RigidbodyComponent ~= nil then
|
||||
\tmonster.RigidbodyComponent.MoveVelocity = Vector2.zero
|
||||
\tmonster.RigidbodyComponent.RealMoveVelocity = Vector2.zero
|
||||
end
|
||||
if monster.TransformComponent ~= nil then
|
||||
\tlocal scale = monster.TransformComponent.Scale
|
||||
\tmonster.TransformComponent.Scale = Vector3(math.abs(scale.x), math.abs(scale.y), scale.z)
|
||||
end
|
||||
if monster.StateAnimationComponent ~= nil and monster.SpriteRendererComponent ~= nil then
|
||||
\tlocal stand = monster.StateAnimationComponent.ActionSheet["stand"]
|
||||
\tif stand ~= nil and stand ~= "" then
|
||||
\t\tmonster.SpriteRendererComponent.SpriteRUID = stand
|
||||
\tend
|
||||
end`, [{ Type: 'Entity', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'monster' }]),
|
||||
method('ConfigureTurnBasedPlayer', `local player = nil
|
||||
pcall(function()
|
||||
\tif _UserService ~= nil and _UserService.LocalPlayer ~= nil then
|
||||
\t\tplayer = _UserService.LocalPlayer
|
||||
\tend
|
||||
end)
|
||||
pcall(function()
|
||||
\tif player == nil and _UserService ~= nil and _UserService.LocalPlayerEntity ~= nil then
|
||||
\t\tplayer = _UserService.LocalPlayerEntity
|
||||
\tend
|
||||
end)
|
||||
pcall(function()
|
||||
\tif player == nil and _UserService ~= nil and _UserService.GetLocalPlayer ~= nil then
|
||||
\t\tplayer = _UserService:GetLocalPlayer()
|
||||
\tend
|
||||
end)
|
||||
if player ~= nil and player.Entity ~= nil then
|
||||
\tplayer = player.Entity
|
||||
end
|
||||
if player == nil then
|
||||
\treturn
|
||||
end
|
||||
if player.PlayerControllerComponent ~= nil then
|
||||
\tplayer.PlayerControllerComponent.Enable = false
|
||||
\tpcall(function() player.PlayerControllerComponent.LookDirectionX = 1 end)
|
||||
end
|
||||
if player.MovementComponent ~= nil then
|
||||
\tplayer.MovementComponent.Enable = false
|
||||
\tpcall(function() player.MovementComponent.InputSpeed = 0 end)
|
||||
\tpcall(function() player.MovementComponent.JumpForce = 0 end)
|
||||
end
|
||||
if player.RigidbodyComponent ~= nil then
|
||||
\tplayer.RigidbodyComponent.MoveVelocity = Vector2.zero
|
||||
\tplayer.RigidbodyComponent.RealMoveVelocity = Vector2.zero
|
||||
end
|
||||
if player.TransformComponent ~= nil then
|
||||
\tlocal scale = player.TransformComponent.Scale
|
||||
\tplayer.TransformComponent.Scale = Vector3(math.abs(scale.x), math.abs(scale.y), scale.z)
|
||||
end`),
|
||||
method('Shuffle', `if list == nil then
|
||||
\treturn
|
||||
end
|
||||
@@ -491,8 +651,6 @@ if cardEntity ~= nil and cardEntity.SpriteGUIRendererComponent ~= nil then
|
||||
\t\tok, color = pcall(function() return Color(0.86, 0.42, 0.38, 1) end)
|
||||
\telseif kind == "Skill" then
|
||||
\t\tok, color = pcall(function() return Color(0.42, 0.55, 0.85, 1) end)
|
||||
\telse
|
||||
\t\tok, color = pcall(function() return Color(0.46, 0.68, 0.52, 1) end)
|
||||
\tend
|
||||
\tif ok == true and color ~= nil then
|
||||
\t\tcardEntity.SpriteGUIRendererComponent.Color = color
|
||||
@@ -508,6 +666,13 @@ end`, [
|
||||
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'path' },
|
||||
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'value' },
|
||||
]),
|
||||
method('SetEntityEnabled', `local entity = _EntityService:GetEntityByPath(path)
|
||||
if entity ~= nil then
|
||||
\tentity.Enable = enabled
|
||||
end`, [
|
||||
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'path' },
|
||||
{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'enabled' },
|
||||
]),
|
||||
method('AnimateCardFrom', `local cardEntity = _EntityService:GetEntityByPath("/ui/DefaultGroup/CardHand/Card" .. tostring(slot))
|
||||
if cardEntity == nil or cardEntity.UITransformComponent == nil then
|
||||
\treturn
|
||||
@@ -531,9 +696,6 @@ end, 1 / 60)`, [
|
||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'duration' },
|
||||
]),
|
||||
]);
|
||||
for (const m of combat.ContentProto.Json.Methods) {
|
||||
m.ExecSpace = 6;
|
||||
}
|
||||
writeFileSync('RootDesk/MyDesk/SlayDeckController.codeblock', JSON.stringify(combat, null, 2), 'utf8');
|
||||
}
|
||||
|
||||
@@ -552,4 +714,4 @@ upsertUi();
|
||||
writeCodeblocks();
|
||||
patchCommon();
|
||||
|
||||
console.log('Slay deck UI and combat codeblocks generated.');
|
||||
console.log('Slay deck UI and main menu generated.');
|
||||
|
||||
1055
ui/DefaultGroup.ui
1055
ui/DefaultGroup.ui
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user