- TopBar: RelicSlot×10(+오버플로)·PotionSlot×5 (UITouchReceive hover 툴팁) - TooltipBox(이름+설명)·PotionMenu(사용/버리기/닫기) 팝업 - ShopHud Potion 판매 항목, AllDeckButton 우측 이동 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2372 lines
116 KiB
Plaintext
2372 lines
116 KiB
Plaintext
{
|
|
"Id": "",
|
|
"GameId": "",
|
|
"EntryKey": "codeblock://SlayDeckController",
|
|
"ContentType": "x-mod/codeblock",
|
|
"Content": "",
|
|
"Usage": 0,
|
|
"UsePublish": 1,
|
|
"UseService": 0,
|
|
"CoreVersion": "26.5.0.0",
|
|
"StudioVersion": "",
|
|
"DynamicLoading": 0,
|
|
"ContentProto": {
|
|
"Use": "Json",
|
|
"Json": {
|
|
"CoreVersion": {
|
|
"Major": 0,
|
|
"Minor": 2
|
|
},
|
|
"ScriptVersion": {
|
|
"Major": 1,
|
|
"Minor": 0
|
|
},
|
|
"Description": "",
|
|
"Id": "SlayDeckController",
|
|
"Language": 1,
|
|
"Name": "SlayDeckController",
|
|
"Type": 1,
|
|
"Source": 0,
|
|
"Target": null,
|
|
"Properties": [
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "DrawPile"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "DiscardPile"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Hand"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Energy"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "3",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "MaxEnergy"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Turn"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "TweenEventId"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "EndTurnHandler"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "NewGameHandler"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "WarriorSelectHandler"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "StartGameHandler"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": "\"\"",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "SelectedClass"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "DrawPileHandler"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "DiscardPileHandler"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "DeckInspectCloseHandler"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "AllDeckHandler"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "AllDeckCloseHandler"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": "\"\"",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "DeckInspectKind"
|
|
},
|
|
{
|
|
"Type": "boolean",
|
|
"DefaultValue": "false",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "DeckAllOpen"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Cards"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "PlayerHp"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "80",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "PlayerMaxHp"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "PlayerBlock"
|
|
},
|
|
{
|
|
"Type": "boolean",
|
|
"DefaultValue": "false",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "CombatOver"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Monsters"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Registered"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "1",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "TargetIndex"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "RunDeck"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Gold"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Floor"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "3",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "RunLength"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "RewardChoices"
|
|
},
|
|
{
|
|
"Type": "boolean",
|
|
"DefaultValue": "false",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "RunActive"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Enemies"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "MapNodes"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "MapStart"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": "\"\"",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "CurrentNodeId"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": "\"\"",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "CurrentEnemyId"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "ShopChoices"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "ShopBought"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Relics"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "RunRelics"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "RelicPool"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": "\"\"",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "ShopRelic"
|
|
},
|
|
{
|
|
"Type": "boolean",
|
|
"DefaultValue": "false",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "ShopRelicBought"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "DragSlot"
|
|
},
|
|
{
|
|
"Type": "boolean",
|
|
"DefaultValue": "false",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "FxBusy"
|
|
},
|
|
{
|
|
"Type": "boolean",
|
|
"DefaultValue": "false",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "TurnBusy"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "PlayerStr"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "PlayerWeak"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "PlayerVuln"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "PlayerPowers"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "Potions"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": "nil",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "RunPotions"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "3",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "PotionSlots"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": "\"\"",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "ShopPotion"
|
|
},
|
|
{
|
|
"Type": "boolean",
|
|
"DefaultValue": "false",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "ShopPotionBought"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "FightAttackCount"
|
|
},
|
|
{
|
|
"Type": "boolean",
|
|
"DefaultValue": "false",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "FirstHpLossDone"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "ClayBlockNext"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "PotionMenuSlot"
|
|
}
|
|
],
|
|
"Methods": [
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"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/Button_Attack\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/Button_Jump\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/UIJoystick\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CardHand\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/RewardHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/MapHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/ShopHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/RestHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckInspectHud\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckAllHud\", false)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "HideGameHud"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "state"
|
|
}
|
|
],
|
|
"Code": "self:HideGameHud()\nself:SetEntityEnabled(\"/ui/DefaultGroup/MainMenu\", state == \"menu\")\nself:SetEntityEnabled(\"/ui/DefaultGroup/CharacterSelectHud\", state == \"charselect\")\nif state == \"map\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/MapHud\", true)\nelseif state == \"combat\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud\", true)\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/DeckHud\", true)\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CardHand\", true)\nelseif state == \"shop\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/ShopHud\", true)\nelseif state == \"rest\" then\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/RestHud\", true)\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ShowState"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self.SelectedClass = \"\"\nself:ShowState(\"menu\")\nself:SetText(\"/ui/DefaultGroup/MainMenu/Title\", \"메이플 덱 어드벤처\")\nself:SetText(\"/ui/DefaultGroup/MainMenu/Subtitle\", \"캐릭터를 고르고 덱을 만들어 모험을 시작하세요\")\nself:SetText(\"/ui/DefaultGroup/MainMenu/NewGameButton\", \"새 게임\")\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 and buttonEntity.ButtonComponent ~= nil then\n\tif self.NewGameHandler ~= nil then\n\t\tbuttonEntity:DisconnectEvent(ButtonClickEvent, self.NewGameHandler)\n\t\tself.NewGameHandler = nil\n\tend\n\tself.NewGameHandler = buttonEntity:ConnectEvent(ButtonClickEvent, function() self:ShowCharacterSelect() end)\nend\nlocal warrior = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CharacterSelectHud/WarriorButton\")\nif warrior ~= nil and warrior.ButtonComponent ~= nil then\n\tif self.WarriorSelectHandler ~= nil then\n\t\twarrior:DisconnectEvent(ButtonClickEvent, self.WarriorSelectHandler)\n\t\tself.WarriorSelectHandler = nil\n\tend\n\tself.WarriorSelectHandler = warrior:ConnectEvent(ButtonClickEvent, function() self:SelectClass(\"warrior\") end)\nend\nlocal start = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CharacterSelectHud/StartButton\")\nif start ~= nil and start.ButtonComponent ~= nil then\n\tif self.StartGameHandler ~= nil then\n\t\tstart:DisconnectEvent(ButtonClickEvent, self.StartGameHandler)\n\t\tself.StartGameHandler = nil\n\tend\n\tself.StartGameHandler = start:ConnectEvent(ButtonClickEvent, function() self:StartNewGame() end)\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "BindMenuButtons"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self.SelectedClass = \"\"\nself:ShowState(\"charselect\")\nself:RenderCharacterSelect()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ShowCharacterSelect"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "className"
|
|
}
|
|
],
|
|
"Code": "self.SelectedClass = className\nself:RenderCharacterSelect()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "SelectClass"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local warrior = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CharacterSelectHud/WarriorButton\")\nif warrior ~= nil and warrior.SpriteGUIRendererComponent ~= nil then\n\tif self.SelectedClass == \"warrior\" then\n\t\twarrior.SpriteGUIRendererComponent.Color = Color(0.28, 0.36, 0.46, 1)\n\telse\n\t\twarrior.SpriteGUIRendererComponent.Color = Color(0.16, 0.2, 0.26, 1)\n\tend\nend\nif self.SelectedClass == \"warrior\" then\n\tself:SetText(\"/ui/DefaultGroup/CharacterSelectHud/Status\", \"전사 선택됨\")\nelse\n\tself:SetText(\"/ui/DefaultGroup/CharacterSelectHud/Status\", \"전사를 선택하고 시작하세요\")\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderCharacterSelect"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "if self.SelectedClass ~= \"warrior\" then\n\tself:SetText(\"/ui/DefaultGroup/CharacterSelectHud/Status\", \"현재는 전사만 선택할 수 있습니다\")\n\treturn\nend\nself:StartRun()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "StartNewGame"
|
|
},
|
|
{
|
|
"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 e = _EntityService:GetEntityByPath(path)\nif e ~= nil then\n\te.Enable = enabled\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "SetEntityEnabled"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"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.RunPotions = {}\nself.PotionSlots = 3\nself.Potions = {\n\tredPotion = { name = \"빨간 포션\", desc = \"HP 20 회복\", effect = \"heal\", value = 20, icon = \"393e2a0d8da544899eaa8b22c97f832b\" },\n\tfirebomb = { name = \"화염병\", desc = \"적에게 피해 20\", effect = \"damage\", value = 20, icon = \"7ddb464c2574456289a4eb72ce86f193\" },\n\twarriorElixir = { name = \"전사의 물약\", desc = \"힘 +2\", effect = \"strength\", value = 2, icon = \"7cfbd410581e4073815daaf5f3e6c72f\" },\n\tguardPotion = { name = \"수호의 물약\", desc = \"방어도 +12\", effect = \"block\", value = 12, icon = \"8f8402dfa0f746e18bf606ed74302c0a\" },\n\tmanaElixir = { name = \"마나 엘릭서\", desc = \"에너지 +2\", effect = \"energy\", value = 2, icon = \"ec2778c366f6477ab0f8e7f06bcd73f4\" },\n\tcursedVial = { name = \"저주의 병\", desc = \"적에게 약화 3\", effect = \"weak\", value = 3, icon = \"a9a2763fdb6849dcba3028c737487680\" },\n}\nself.Relics = {\n\tironHeart = { name = \"강철 심장\", desc = \"전투 시작 시 방어도 +6\", hook = \"combatStart\", effect = \"block\", value = 6, icon = \"e555b3a62f3c49dbb2c53784e6bd481f\" },\n\tenergyCore = { name = \"에너지 코어\", desc = \"턴 시작 시 에너지 +1\", hook = \"turnStart\", effect = \"energy\", value = 1, icon = \"a41014f28b47434ab9f49ef104523862\" },\n\tvampire = { name = \"흡혈 송곳니\", desc = \"공격 카드 사용 시 HP +1\", hook = \"cardPlayed\", effect = \"healOnAttack\", value = 1, icon = \"ed64cde7e6c44b9e99502847e54f04e9\" },\n\tgoldIdol = { name = \"황금 우상\", desc = \"전투 승리 시 골드 +10\", hook = \"combatReward\", effect = \"gold\", value = 10, icon = \"03bb05c92b8f45edb0f3dad2e118fd5a\" },\n\tpotionBelt = { name = \"장인의 벨트\", desc = \"물약 슬롯이 5칸으로 늘어난다\", hook = \"passive\", effect = \"potionSlots\", value = 5, icon = \"36725b4566ac40d4902e2ab2113c2096\" },\n\tburningBlood = { name = \"자쿰의 투구\", desc = \"전투 승리 시 HP 6 회복\", hook = \"combatEnd\", effect = \"healOnWin\", value = 6, icon = \"07f994825ce34131b419d43e890c878d\" },\n\tvajra = { name = \"미스릴 해머\", desc = \"전투 시작 시 힘 +1\", hook = \"combatStart\", effect = \"strength\", value = 1, icon = \"59d2579d46dc41d590a9e6b141ad458b\" },\n\tanchor = { name = \"메이플 실드\", desc = \"첫 턴 방어도 +10\", hook = \"combatStart\", effect = \"block\", value = 10, icon = \"6349413e08cc49848862591863d056a0\" },\n\tbagOfPrep = { name = \"모험가의 배낭\", desc = \"첫 턴 드로우 +2\", hook = \"combatStart\", effect = \"draw\", value = 2, icon = \"77b240cb8af245b4801a714380267ae9\" },\n\tbloodVial = { name = \"피의 목걸이\", desc = \"전투 시작 시 HP 2 회복\", hook = \"combatStart\", effect = \"heal\", value = 2, icon = \"c782e949506a42c49eb139c7e65527d7\" },\n\tbronzeScales = { name = \"브론즈 체인메일\", desc = \"피격 시 공격자에게 3 반사\", hook = \"onPlayerDamaged\", effect = \"thorns\", value = 3, icon = \"87272346b145412391622cf803f888d1\" },\n\tstrawberry = { name = \"건강의 반지\", desc = \"획득 시 최대 HP +7\", hook = \"passive\", effect = \"maxHp\", value = 7, icon = \"58f643e29c354c2783a5ce9a72ec155c\" },\n\tpenNib = { name = \"황금 깃펜\", desc = \"10번째 공격마다 피해 2배\", hook = \"attackCalc\", effect = \"penNib\", value = 10, icon = \"4d38d721cc064d14b31b9e9a92754139\" },\n\tboot = { name = \"브론즈 부츠\", desc = \"5 미만 공격 피해가 5로\", hook = \"attackCalc\", effect = \"boot\", value = 5, icon = \"d572b3aa4dac4162aa0d9e551b055dce\" },\n\takabeko = { name = \"황소 투구\", desc = \"전투 첫 공격 피해 +8\", hook = \"attackCalc\", effect = \"akabeko\", value = 8, icon = \"eb3330a6e2274eff958639f8792119d3\" },\n\tcentennialPuzzle = { name = \"백년의 부적\", desc = \"전투 첫 피격 시 드로우 3\", hook = \"onPlayerDamaged\", effect = \"firstLossDraw\", value = 3, icon = \"cfe5ed6556b944fc83ab58b774bb2b73\" },\n\tmeatOnBone = { name = \"고기 망치\", desc = \"승리 시 HP 50% 이하면 12 회복\", hook = \"combatEnd\", effect = \"healIfLow\", value = 12, icon = \"a93e8e87f184411c98c96b877d9f8b10\" },\n\tselfFormingClay = { name = \"점토 갑옷\", desc = \"피해를 받으면 다음 턴 방어 +3\", hook = \"onPlayerDamaged\", effect = \"clayBlock\", value = 3, icon = \"bb446793c5204d5db7d33563fe79f648\" },\n\tchampionBelt = { name = \"챔피언 벨트\", desc = \"취약 부여 시 약화 1 추가\", hook = \"cardDebuff\", effect = \"vulnAddsWeak\", value = 1, icon = \"7ca8c63026034113a561d6adf679fed2\" },\n}\nself.RelicPool = { \"energyCore\", \"vampire\", \"goldIdol\", \"potionBelt\", \"burningBlood\", \"vajra\", \"anchor\", \"bagOfPrep\", \"bloodVial\", \"bronzeScales\", \"strawberry\", \"penNib\", \"boot\", \"akabeko\", \"centennialPuzzle\", \"meatOnBone\", \"selfFormingClay\", \"championBelt\" }\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 }, { kind = \"Debuff\", value = 1, effect = \"weak\" } } },\n\tslime_boss = { name = \"슬라임 킹\", maxHp = 120, intents = { { kind = \"Attack\", value = 18 }, { kind = \"Defend\", value = 12 }, { kind = \"Debuff\", value = 2, effect = \"vuln\" }, { kind = \"Attack\", value = 10 }, { kind = \"Attack\", value = 22 } } },\n\torange_mushroom = { name = \"주황버섯\", maxHp = 16, intents = { { kind = \"Attack\", value = 5 }, { kind = \"Attack\", value = 5 }, { kind = \"Defend\", value = 4 }, { kind = \"Attack\", value = 8 } } },\n\tblue_mushroom = { name = \"파란버섯\", maxHp = 22, intents = { { kind = \"Attack\", value = 4 }, { kind = \"Attack\", value = 4 }, { kind = \"Attack\", value = 10 } } },\n\tpig = { name = \"돼지\", maxHp = 18, intents = { { kind = \"Attack\", value = 6 }, { kind = \"Attack\", value = 6 }, { kind = \"Defend\", value = 5 } } },\n\tgreen_mushroom = { name = \"초록버섯\", maxHp = 20, intents = { { kind = \"Attack\", value = 7 }, { kind = \"Defend\", value = 3 }, { kind = \"Attack\", value = 9 } } },\n\tmushmom = { name = \"머쉬맘\", maxHp = 75, intents = { { kind = \"Defend\", value = 10 }, { kind = \"Debuff\", value = 2, effect = \"weak\" }, { kind = \"Attack\", value = 16 }, { kind = \"Attack\", value = 9 }, { kind = \"Defend\", value = 6 } } },\n\tmodified_snail = { name = \"변형된 달팽이\", maxHp = 60, intents = { { kind = \"Attack\", value = 12 }, { kind = \"Defend\", value = 8 }, { kind = \"Attack\", value = 7 }, { kind = \"Attack\", value = 14 }, { kind = \"Debuff\", value = 1, effect = \"weak\" } } },\n\tking_slime = { name = \"킹 슬라임\", maxHp = 130, intents = { { kind = \"Attack\", value = 18 }, { kind = \"Defend\", value = 14 }, { kind = \"Debuff\", value = 2, effect = \"vuln\" }, { 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:RenderPotions()\nself:ShowMap()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "StartRun"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self:ShowState(\"combat\")\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/Result\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/PotionMenu\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/TooltipBox\", false)\nself.MaxEnergy = 3\nself.Turn = 0\nself.PlayerBlock = 0\nself.PlayerStr = 0\nself.PlayerWeak = 0\nself.PlayerVuln = 0\nself.PlayerPowers = {}\nself.FightAttackCount = 0\nself.FirstHpLossDone = false\nself.ClayBlockNext = 0\nself.CombatOver = false\nself.DiscardPile = {}\nself.Hand = {}\nself.Cards = {\n\tStrike = { name = \"파워 스트라이크\", cost = 1, desc = \"피해 6\", kind = \"Attack\", damage = 6, image = \"a71b116807904ef2b38e1dc013e2f9a2\" },\n\tDefend = { name = \"아이언 바디\", cost = 1, desc = \"방어도 5\", kind = \"Skill\", block = 5, image = \"1ae9b6741c5947a8b528a0f515b50e3e\" },\n\tBash = { name = \"슬래시 블러스트\", cost = 2, desc = \"피해 10\", kind = \"Attack\", damage = 10, image = \"d5bc2953fcab4cfe9062af81c35aff86\" },\n\tWarLeap = { name = \"워 리프\", cost = 1, desc = \"피해 4, 방어도 3\", kind = \"Attack\", damage = 4, block = 3, image = \"992dabf6aff2400e92b2f4f705d8ebe7\" },\n\tBrandish = { name = \"브랜디시\", cost = 2, desc = \"피해 13\", kind = \"Attack\", damage = 13, image = \"21af4bccc5054a5dbc8245dfa7f08681\" },\n\tChargedBlow = { name = \"차지 블로우\", cost = 2, desc = \"피해 8, 취약 2\", kind = \"Attack\", damage = 8, vuln = 2, image = \"fe83c7635b0e49ed83d75a2833adb53e\" },\n\tThreaten = { name = \"위협\", cost = 0, desc = \"약화 2 부여\", kind = \"Skill\", weak = 2, image = \"64daadf1a98e490d9c14ef52ec776e63\" },\n\tEnrage = { name = \"인레이지\", cost = 1, desc = \"힘 +2\", kind = \"Skill\", strength = 2, image = \"09370fc7551e47238fd103a80fba558e\" },\n\tRage = { name = \"분노\", cost = 1, desc = \"매 턴 시작 시 힘 +1\", kind = \"Power\", powerEffect = \"strengthPerTurn\", value = 1, image = \"379d86e3de064959aa4612f71e84ccfb\" },\n}\nself.DrawPile = {}\nfor i = 1, #self.RunDeck do\n\tself.DrawPile[i] = self.RunDeck[i]\nend\nself:Shuffle(self.DrawPile)\nself:BuildMonsters()\nself:RenderCombat()\nself:StartPlayerTurn()\nself:ApplyRelics(\"combatStart\")\nself:RenderCombat()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "StartCombat"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"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"
|
|
}
|
|
],
|
|
"Code": "if self.Registered == nil then\n\tself.Registered = {}\nend\nlocal g = group\nif g == nil or g == \"\" then g = \"combat\" end\nlocal mp = mapName\nif mp == nil then mp = \"\" end\ntable.insert(self.Registered, { entity = monster, enemyId = enemyId, group = g, map = mp })",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RegisterMonster"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"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\nlocal pmap = \"\"\nlocal lp = _UserService.LocalPlayer\nif lp ~= nil and lp.CurrentMapName ~= nil then pmap = lp.CurrentMapName 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 and (r.map == nil or r.map == \"\" or pmap == \"\" or r.map == pmap) 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\tlocal v = e.intents[k].value\n\t\tif e.intents[k].kind ~= \"Debuff\" then\n\t\t\tv = math.floor(v * mult)\n\t\tend\n\t\tintents[k] = { kind = e.intents[k].kind, value = v, effect = e.intents[k].effect }\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, str = 0, weak = 0, vuln = 0,\n\t\tintents = 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": [],
|
|
"Name": "BuildMonsters"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "monster"
|
|
}
|
|
],
|
|
"Code": "if monster == nil or not isvalid(monster) then\n\treturn\nend\nmonster:SetEnable(true)\nmonster:SetVisible(true)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ReviveMonsterEntity"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "list"
|
|
}
|
|
],
|
|
"Code": "if list == nil then\n\treturn\nend\nfor i = #list, 2, -1 do\n\tlocal j = math.random(1, i)\n\tlist[i], list[j] = list[j], list[i]\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "Shuffle"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local endTurn = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckHud/EndTurnButton\")\nif endTurn ~= nil and endTurn.ButtonComponent ~= nil then\n\tif self.EndTurnHandler ~= nil then\n\t\tendTurn:DisconnectEvent(ButtonClickEvent, self.EndTurnHandler)\n\t\tself.EndTurnHandler = nil\n\tend\n\tself.EndTurnHandler = endTurn:ConnectEvent(ButtonClickEvent, function() self:EndPlayerTurn() end)\nend\nlocal drawPile = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckHud/DrawPile\")\nif drawPile ~= nil and drawPile.ButtonComponent ~= nil then\n\tif self.DrawPileHandler ~= nil then\n\t\tdrawPile:DisconnectEvent(ButtonClickEvent, self.DrawPileHandler)\n\t\tself.DrawPileHandler = nil\n\tend\n\tself.DrawPileHandler = drawPile:ConnectEvent(ButtonClickEvent, function() self:OpenDeckInspect(\"draw\") end)\nend\nlocal discardPile = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckHud/DiscardPile\")\nif discardPile ~= nil and discardPile.ButtonComponent ~= nil then\n\tif self.DiscardPileHandler ~= nil then\n\t\tdiscardPile:DisconnectEvent(ButtonClickEvent, self.DiscardPileHandler)\n\t\tself.DiscardPileHandler = nil\n\tend\n\tself.DiscardPileHandler = discardPile:ConnectEvent(ButtonClickEvent, function() self:OpenDeckInspect(\"discard\") end)\nend\nlocal inspectClose = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckInspectHud/Close\")\nif inspectClose ~= nil and inspectClose.ButtonComponent ~= nil then\n\tif self.DeckInspectCloseHandler ~= nil then\n\t\tinspectClose:DisconnectEvent(ButtonClickEvent, self.DeckInspectCloseHandler)\n\t\tself.DeckInspectCloseHandler = nil\n\tend\n\tself.DeckInspectCloseHandler = inspectClose:ConnectEvent(ButtonClickEvent, function() self:CloseDeckInspect() end)\nend\nlocal allDeckButton = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/TopBar/AllDeckButton\")\nif allDeckButton ~= nil and allDeckButton.ButtonComponent ~= nil then\n\tif self.AllDeckHandler ~= nil then\n\t\tallDeckButton:DisconnectEvent(ButtonClickEvent, self.AllDeckHandler)\n\t\tself.AllDeckHandler = nil\n\tend\n\tself.AllDeckHandler = allDeckButton:ConnectEvent(ButtonClickEvent, function() self:OpenAllDeck() end)\nend\nlocal allDeckClose = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud/Close\")\nif allDeckClose ~= nil and allDeckClose.ButtonComponent ~= nil then\n\tif self.AllDeckCloseHandler ~= nil then\n\t\tallDeckClose:DisconnectEvent(ButtonClickEvent, self.AllDeckCloseHandler)\n\t\tself.AllDeckCloseHandler = nil\n\tend\n\tself.AllDeckCloseHandler = allDeckClose:ConnectEvent(ButtonClickEvent, function() self:CloseAllDeck() end)\nend\nfor i = 1, 5 do\n\tlocal cardEntity = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(i))\n\tif cardEntity ~= nil and cardEntity.UITouchReceiveComponent ~= nil then\n\t\tcardEntity:ConnectEvent(UITouchBeginDragEvent, function(ev) self:OnCardDragBegin(i) end)\n\t\tcardEntity:ConnectEvent(UITouchDragEvent, function(ev) self:OnCardDrag(i, ev.TouchPoint) end)\n\t\tcardEntity:ConnectEvent(UITouchEndDragEvent, function(ev) self:OnCardDragEnd(i, ev.TouchPoint) end)\n\tend\nend\nfor i = 1, 3 do\n\tlocal rc = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/RewardHud/Reward\" .. tostring(i))\n\tif rc ~= nil and rc.ButtonComponent ~= nil then\n\t\trc:ConnectEvent(ButtonClickEvent, function() self:PickReward(i) end)\n\tend\nend\nlocal skip = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/RewardHud/Skip\")\nif skip ~= nil and skip.ButtonComponent ~= nil then\n\tskip:ConnectEvent(ButtonClickEvent, function() self:PickReward(0) end)\nend\nlocal mapNodeIds = { \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"BOSS\" }\nfor i = 1, #mapNodeIds do\n\tlocal nid = mapNodeIds[i]\n\tlocal mn = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/MapHud/Node_\" .. nid)\n\tif mn ~= nil and mn.ButtonComponent ~= nil then\n\t\tmn:ConnectEvent(ButtonClickEvent, function() self:PickNode(nid) end)\n\tend\nend\nfor i = 1, 3 do\n\tlocal sc = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/ShopHud/Card\" .. tostring(i))\n\tif sc ~= nil and sc.ButtonComponent ~= nil then\n\t\tsc:ConnectEvent(ButtonClickEvent, function() self:BuyCard(i) end)\n\tend\nend\nlocal shopLeave = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/ShopHud/Leave\")\nif shopLeave ~= nil and shopLeave.ButtonComponent ~= nil then\n\tshopLeave:ConnectEvent(ButtonClickEvent, function() self:LeaveNode() end)\nend\nlocal shopRelic = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/ShopHud/Relic\")\nif shopRelic ~= nil and shopRelic.ButtonComponent ~= nil then\n\tshopRelic:ConnectEvent(ButtonClickEvent, function() self:BuyRelic() end)\nend\nlocal restLeave = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/RestHud/Leave\")\nif restLeave ~= nil and restLeave.ButtonComponent ~= nil then\n\trestLeave:ConnectEvent(ButtonClickEvent, function() self:LeaveNode() end)\nend\nfor i = 1, 4 do\n\tlocal ms = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(i))\n\tif ms ~= nil and ms.ButtonComponent ~= nil then\n\t\tms:ConnectEvent(ButtonClickEvent, function() self:SetTarget(i) end)\n\tend\nend\nfor i = 1, 10 do\n\tlocal rs = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/TopBar/RelicSlot\" .. tostring(i))\n\tif rs ~= nil and rs.UITouchReceiveComponent ~= nil then\n\t\tlocal idx = i\n\t\trs:ConnectEvent(UITouchEnterEvent, function()\n\t\t\tlocal rid = nil\n\t\t\tif self.RunRelics ~= nil then rid = self.RunRelics[idx] end\n\t\t\tif rid ~= nil and self.Relics[rid] ~= nil then\n\t\t\t\tself:ShowTooltip(self.Relics[rid].name, self.Relics[rid].desc, -240 + (idx - 1) * 48)\n\t\t\tend\n\t\tend)\n\t\trs:ConnectEvent(UITouchExitEvent, function() self:HideTooltip() end)\n\tend\nend\nfor i = 1, 5 do\n\tlocal ps = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/TopBar/PotionSlot\" .. tostring(i))\n\tif ps ~= nil and ps.UITouchReceiveComponent ~= nil then\n\t\tlocal idx = i\n\t\tps:ConnectEvent(UITouchEnterEvent, function()\n\t\t\tlocal pid = nil\n\t\t\tif self.RunPotions ~= nil then pid = self.RunPotions[idx] end\n\t\t\tif pid ~= nil and self.Potions[pid] ~= nil then\n\t\t\t\tself:ShowTooltip(self.Potions[pid].name, self.Potions[pid].desc, 240 + (idx - 1) * 44)\n\t\t\tend\n\t\tend)\n\t\tps:ConnectEvent(UITouchExitEvent, function() self:HideTooltip() end)\n\t\tps:ConnectEvent(UITouchDownEvent, function() self:OpenPotionMenu(idx) end)\n\tend\nend\nlocal pmUse = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/PotionMenu/Use\")\nif pmUse ~= nil and pmUse.ButtonComponent ~= nil then\n\tpmUse:ConnectEvent(ButtonClickEvent, function() self:UsePotion() end)\nend\nlocal pmToss = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/PotionMenu/Toss\")\nif pmToss ~= nil and pmToss.ButtonComponent ~= nil then\n\tpmToss:ConnectEvent(ButtonClickEvent, function() self:TossPotion() end)\nend\nlocal pmClose = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/PotionMenu/Close\")\nif pmClose ~= nil and pmClose.ButtonComponent ~= nil then\n\tpmClose:ConnectEvent(ButtonClickEvent, function() self:ClosePotionMenu() end)\nend\nlocal shopPotion = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/ShopHud/Potion\")\nif shopPotion ~= nil and shopPotion.ButtonComponent ~= nil then\n\tshopPotion:ConnectEvent(ButtonClickEvent, function() self:BuyPotion() end)\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "BindButtons"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self.Turn = self.Turn + 1\nself.Energy = self.MaxEnergy\nself:ApplyRelics(\"turnStart\")\nif self.PlayerPowers ~= nil then\n\tfor i = 1, #self.PlayerPowers do\n\t\tlocal pc = self.Cards[self.PlayerPowers[i]]\n\t\tif pc ~= nil and pc.powerEffect == \"strengthPerTurn\" then\n\t\t\tself.PlayerStr = self.PlayerStr + pc.value\n\t\tend\n\tend\nend\nself.PlayerBlock = 0\nif self.ClayBlockNext > 0 then\n\tself.PlayerBlock = self.PlayerBlock + self.ClayBlockNext\n\tself.ClayBlockNext = 0\nend\nself:DrawCards(5)\nself:RenderHand(true)\nself:RenderCombat()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "StartPlayerTurn"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then\n\treturn\nend\nfor i = 1, #self.Hand do\n\ttable.insert(self.DiscardPile, self.Hand[i])\nend\nself.Hand = {}\nif self.PlayerWeak > 0 then self.PlayerWeak = self.PlayerWeak - 1 end\nif self.PlayerVuln > 0 then self.PlayerVuln = self.PlayerVuln - 1 end\nself:RenderHand(false)\nself:RenderPiles()\nself:EnemyTurn()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "EndPlayerTurn"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "amount"
|
|
}
|
|
],
|
|
"Code": "for i = 1, amount do\n\tif #self.DrawPile <= 0 then\n\t\tself:RecycleDiscardIntoDraw()\n\tend\n\tif #self.DrawPile <= 0 then\n\t\tbreak\n\tend\n\tlocal cardId = table.remove(self.DrawPile)\n\ttable.insert(self.Hand, cardId)\nend\nself:RenderPiles()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "DrawCards"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "if self.DiscardPile == nil or #self.DiscardPile <= 0 then\n\treturn\nend\nself.DrawPile = {}\nfor i = 1, #self.DiscardPile do\n\tself.DrawPile[i] = self.DiscardPile[i]\nend\nself.DiscardPile = {}\nself:Shuffle(self.DrawPile)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RecycleDiscardIntoDraw"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self:SetText(\"/ui/DefaultGroup/DeckHud/DrawPile/Count\", tostring(#self.DrawPile))\nself:SetText(\"/ui/DefaultGroup/DeckHud/DiscardPile/Count\", tostring(#self.DiscardPile))\nself:SetText(\"/ui/DefaultGroup/DeckHud/EnergyOrb/Value\", string.format(\"%d\", self.Energy) .. \"/\" .. string.format(\"%d\", self.MaxEnergy))\nlocal inspect = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckInspectHud\")\nif inspect ~= nil and inspect.Enable == true and self.DeckInspectKind ~= \"\" then\n\tself:OpenDeckInspect(self.DeckInspectKind)\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderPiles"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "kind"
|
|
}
|
|
],
|
|
"Code": "self.DeckInspectKind = kind\nif self.DeckAllOpen == true then\n\tself.DeckAllOpen = false\n\tlocal allHud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud\")\n\tif allHud ~= nil then\n\t\tallHud.Enable = false\n\tend\nend\nlocal pile = {}\nlocal title = \"\"\nif kind == \"discard\" then\n\tpile = self.DiscardPile or {}\n\ttitle = \"버린 덱\"\nelse\n\tpile = self.DrawPile or {}\n\ttitle = \"뽑을 덱\"\nend\nself:RenderDeckInspect(pile, title)\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckInspectHud\")\nif hud ~= nil then\n\thud.Enable = true\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "OpenDeckInspect"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self.DeckInspectKind = \"\"\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckInspectHud\")\nif hud ~= nil then\n\thud.Enable = false\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "CloseDeckInspect"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "pile"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "title"
|
|
}
|
|
],
|
|
"Code": "local count = 0\nif pile ~= nil then\n\tcount = #pile\nend\nlocal suffix = \" (\" .. tostring(count) .. \")\"\nif count > 60 then\n\tsuffix = suffix .. \" - 60장까지 표시\"\nend\nself:SetText(\"/ui/DefaultGroup/DeckInspectHud/Title\", title .. suffix)\nlocal empty = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckInspectHud/Empty\")\nif empty ~= nil then\n\tempty.Enable = count <= 0\nend\nfor i = 1, 60 do\n\tlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckInspectHud/Grid/Card\" .. tostring(i))\n\tif e ~= nil then\n\t\tlocal cardId = nil\n\t\tif pile ~= nil then\n\t\t\tcardId = pile[i]\n\t\tend\n\t\tif cardId == nil then\n\t\t\te.Enable = false\n\t\telse\n\t\t\te.Enable = true\n\t\t\tself:ApplyInspectCardVisual(i, cardId)\n\t\tend\n\tend\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderDeckInspect"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "cardId"
|
|
}
|
|
],
|
|
"Code": "self:ApplyCardFace(\"/ui/DefaultGroup/DeckInspectHud/Grid/Card\" .. tostring(slot), cardId)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ApplyInspectCardVisual"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local inspectHud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckInspectHud\")\nif inspectHud ~= nil then\n\tinspectHud.Enable = false\nend\nself.DeckInspectKind = \"\"\nself.DeckAllOpen = true\nself:RenderAllDeck()\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud\")\nif hud ~= nil then\n\thud.Enable = true\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "OpenAllDeck"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self.DeckAllOpen = false\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud\")\nif hud ~= nil then\n\thud.Enable = false\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "CloseAllDeck"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local pile = self.RunDeck or {}\nlocal count = #pile\nself:SetText(\"/ui/DefaultGroup/DeckAllHud/Title\", \"모든 덱 (\" .. tostring(count) .. \")\")\nlocal empty = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud/Empty\")\nif empty ~= nil then\n\tempty.Enable = count <= 0\nend\nfor i = 1, 120 do\n\tlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud/Grid/Card\" .. tostring(i))\n\tif e ~= nil then\n\t\tlocal cardId = pile[i]\n\t\tif cardId == nil then\n\t\t\te.Enable = false\n\t\telse\n\t\t\te.Enable = true\n\t\t\tself:ApplyAllDeckCardVisual(i, cardId)\n\t\tend\n\tend\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderAllDeck"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "cardId"
|
|
}
|
|
],
|
|
"Code": "self:ApplyCardFace(\"/ui/DefaultGroup/DeckAllHud/Grid/Card\" .. tostring(slot), cardId)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ApplyAllDeckCardVisual"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "boolean",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "animate"
|
|
}
|
|
],
|
|
"Code": "local drawStart = Vector2(-590, 8)\nfor i = 1, 5 do\n\tlocal cardEntity = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(i))\n\tif cardEntity ~= nil then\n\t\tlocal cardId = self.Hand[i]\n\t\tif cardId == nil then\n\t\t\tcardEntity.Enable = false\n\t\telse\n\t\t\tcardEntity.Enable = true\n\t\t\tself:ApplyCardVisual(i, cardId)\n\t\t\tif animate == true then\n\t\t\t\tself:AnimateCardFrom(i, drawStart, Vector2((i - 3) * 200, 0), 0.16 + i * 0.045)\n\t\t\tend\n\t\tend\n\tend\nend\nself:RenderPiles()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderHand"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "base"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "cardId"
|
|
}
|
|
],
|
|
"Code": "local c = self.Cards[cardId]\nif c == nil then\n\tc = { name = cardId, cost = 0, desc = \"\", kind = \"Skill\" }\nend\nlocal e = _EntityService:GetEntityByPath(base)\nif e ~= nil and e.SpriteGUIRendererComponent ~= nil then\n\tif c.kind == \"Attack\" then\n\t\te.SpriteGUIRendererComponent.Color = Color(0.86, 0.42, 0.38, 1)\n\telseif c.kind == \"Power\" then\n\t\te.SpriteGUIRendererComponent.Color = Color(0.46, 0.68, 0.52, 1)\n\telse\n\t\te.SpriteGUIRendererComponent.Color = Color(0.42, 0.55, 0.85, 1)\n\tend\nend\nself:SetText(base .. \"/Cost\", string.format(\"%d\", c.cost))\nself:SetText(base .. \"/Name\", c.name)\nself:SetText(base .. \"/Desc\", c.desc)\nlocal art = _EntityService:GetEntityByPath(base .. \"/Art\")\nif art ~= nil then\n\tif c.image ~= nil and c.image ~= \"\" then\n\t\tart.Enable = true\n\t\tif art.SpriteGUIRendererComponent ~= nil then\n\t\t\tart.SpriteGUIRendererComponent.ImageRUID = c.image\n\t\tend\n\telse\n\t\tart.Enable = false\n\tend\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ApplyCardFace"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "cardId"
|
|
}
|
|
],
|
|
"Code": "self:ApplyCardFace(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot), cardId)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ApplyCardVisual"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "path"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "value"
|
|
}
|
|
],
|
|
"Code": "local entity = _EntityService:GetEntityByPath(path)\nif entity ~= nil and entity.TextComponent ~= nil then\n\tentity.TextComponent.Text = value\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "SetText"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "fromPos"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "toPos"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "duration"
|
|
}
|
|
],
|
|
"Code": "local cardEntity = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot))\nif cardEntity == nil or cardEntity.UITransformComponent == nil then\n\treturn\nend\nlocal tr = cardEntity.UITransformComponent\ntr.anchoredPosition = fromPos\nlocal elapsed = 0\nlocal eventId = 0\neventId = _TimerService:SetTimerRepeat(function()\n\telapsed = elapsed + 1 / 60\n\tlocal t = math.min(elapsed / duration, 1)\n\tlocal eased = _TweenLogic:Ease(0, 1, 1, EaseType.SineEaseOut, t)\n\ttr.anchoredPosition = Vector2(fromPos.x + (toPos.x - fromPos.x) * eased, fromPos.y + (toPos.y - fromPos.y) * eased)\n\tif t >= 1 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend, 1 / 60)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "AnimateCardFrom"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "base"
|
|
}
|
|
],
|
|
"Code": "local base2 = base\nself.FightAttackCount = self.FightAttackCount + 1\nif self.FightAttackCount == 1 and self:HasRelic(\"akabeko\") then\n\tbase2 = base2 + 8\nend\nlocal dmg = base2 + self.PlayerStr\nif self:HasRelic(\"penNib\") and self.FightAttackCount % 10 == 0 then\n\tdmg = dmg * 2\nend\nif self.PlayerWeak > 0 then\n\tdmg = math.floor(dmg * 0.75)\nend\nif dmg > 0 and dmg < 5 and self:HasRelic(\"boot\") then\n\tdmg = 5\nend\nif dmg < 0 then\n\tdmg = 0\nend\nreturn dmg",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "CalcPlayerAttack"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
}
|
|
],
|
|
"Code": "if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then\n\treturn\nend\nif self.Hand == nil then\n\treturn\nend\nlocal cardId = self.Hand[slot]\nif cardId == nil then\n\treturn\nend\nlocal c = self.Cards[cardId]\nif c == nil then\n\treturn\nend\nif self.Energy < c.cost then\n\tself:Toast(\"에너지가 부족합니다\")\n\treturn\nend\nself.Energy = self.Energy - c.cost\nif c.kind == \"Attack\" then\n\tif c.damage ~= nil then\n\t\tself:PlayAttackFx(self.TargetIndex, c.image, self:CalcPlayerAttack(c.damage))\n\tend\n\tif c.block ~= nil then\n\t\tself.PlayerBlock = self.PlayerBlock + c.block\n\tend\n\tself:ApplyRelics(\"cardPlayed\")\nelseif c.kind == \"Skill\" then\n\tif c.block ~= nil then\n\t\tself.PlayerBlock = self.PlayerBlock + c.block\n\tend\nelseif c.kind == \"Power\" then\n\tif c.powerEffect ~= nil then\n\t\ttable.insert(self.PlayerPowers, cardId)\n\tend\nend\nif c.strength ~= nil then\n\tself.PlayerStr = self.PlayerStr + c.strength\nend\nif c.weak ~= nil or c.vuln ~= nil then\n\tlocal tm = self.Monsters[self.TargetIndex]\n\tif tm ~= nil and tm.alive == true then\n\t\tif c.weak ~= nil then tm.weak = tm.weak + c.weak end\n\t\tif c.vuln ~= nil then\n\t\t\ttm.vuln = tm.vuln + c.vuln\n\t\t\tif self:HasRelic(\"championBelt\") then\n\t\t\t\ttm.weak = tm.weak + 1\n\t\t\tend\n\t\tend\n\tend\nend\ntable.remove(self.Hand, slot)\nif c.kind ~= \"Power\" then\n\ttable.insert(self.DiscardPile, cardId)\nend\nself:RenderHand(false)\nself:RenderPiles()\nself:RenderCombat()\nself:CheckCombatEnd()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "PlayCard"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
}
|
|
],
|
|
"Code": "if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then\n\treturn\nend\nif self.Hand == nil or self.Hand[slot] == nil then\n\treturn\nend\nself.DragSlot = slot",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "OnCardDragBegin"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "touchPoint"
|
|
}
|
|
],
|
|
"Code": "if self.DragSlot ~= slot then\n\treturn\nend\nlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot))\nif e ~= nil and e.UITransformComponent ~= nil then\n\tlocal ui = _UILogic:ScreenToUIPosition(touchPoint)\n\te.UITransformComponent.anchoredPosition = Vector2(ui.x, ui.y + 360)\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "OnCardDrag"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "touchPoint"
|
|
}
|
|
],
|
|
"Code": "if self.DragSlot ~= slot then\n\treturn\nend\nself.DragSlot = 0\nlocal cardXs = { -400, -200, 0, 200, 400 }\nlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot))\nif e ~= nil and e.UITransformComponent ~= nil then\n\te.UITransformComponent.anchoredPosition = Vector2(cardXs[slot], 0)\nend\nself:ResolveCardDrop(slot, touchPoint)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "OnCardDragEnd"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
},
|
|
{
|
|
"Type": "any",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "touchPoint"
|
|
}
|
|
],
|
|
"Code": "if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then\n\treturn\nend\nlocal cardId = self.Hand[slot]\nif cardId == nil then\n\treturn\nend\nlocal c = self.Cards[cardId]\nif c == nil then\n\treturn\nend\nif c.kind == \"Attack\" then\n\tlocal best = 0\n\tlocal bestDist = 200\n\tfor i = 1, #self.Monsters do\n\t\tlocal m = self.Monsters[i]\n\t\tif m.alive == true and m.entity ~= nil and isvalid(m.entity) and m.entity.TransformComponent ~= nil then\n\t\t\tlocal wp = m.entity.TransformComponent.WorldPosition\n\t\t\tlocal sp = _UILogic:WorldToScreenPosition(Vector2(wp.x, wp.y + 0.7))\n\t\t\tlocal dx = sp.x - touchPoint.x\n\t\t\tlocal dy = sp.y - touchPoint.y\n\t\t\tlocal d = math.sqrt(dx * dx + dy * dy)\n\t\t\tif d < bestDist then\n\t\t\t\tbestDist = d\n\t\t\t\tbest = i\n\t\t\tend\n\t\tend\n\tend\n\tif best > 0 then\n\t\tself.TargetIndex = best\n\t\tself:PlayCard(slot)\n\tend\nelse\n\tlocal ui = _UILogic:ScreenToUIPosition(touchPoint)\n\tif ui.y > -180 then\n\t\tself:PlayCard(slot)\n\tend\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ResolveCardDrop"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "message"
|
|
}
|
|
],
|
|
"Code": "log(message)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "Toast"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "amount"
|
|
}
|
|
],
|
|
"Code": "local m = self.Monsters[self.TargetIndex]\nif m == nil or m.alive ~= true then\n\tm = nil\n\tfor i = 1, #self.Monsters do\n\t\tif self.Monsters[i].alive == true then m = self.Monsters[i]; self.TargetIndex = i; break end\n\tend\nend\nif m == nil then\n\treturn\nend\nlocal dmg = amount\nif m.vuln > 0 then\n\tdmg = math.floor(dmg * 1.5)\nend\nif m.block > 0 then\n\tlocal absorbed = math.min(m.block, dmg)\n\tm.block = m.block - absorbed\n\tdmg = dmg - absorbed\nend\nm.hp = m.hp - dmg\nif m.hp <= 0 then\n\tm.hp = 0\n\tself:KillMonster(m.slot)\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "DealDamageToTarget"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "targetIndex"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "image"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "damage"
|
|
}
|
|
],
|
|
"Code": "local m = self.Monsters[targetIndex]\nif m == nil or m.alive ~= true or m.entity == nil or not isvalid(m.entity) then\n\tself:DealDamageToTarget(damage)\n\tself:RenderCombat()\n\tself:CheckCombatEnd()\n\treturn\nend\nself.FxBusy = true\nlocal fx = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/SkillFx\")\nif fx ~= nil then\n\tif fx.SpriteGUIRendererComponent ~= nil and image ~= nil and image ~= \"\" then\n\t\tfx.SpriteGUIRendererComponent.ImageRUID = image\n\tend\n\tif fx.UITransformComponent ~= nil and m.entity.TransformComponent ~= nil then\n\t\tlocal wp = m.entity.TransformComponent.WorldPosition\n\t\tlocal sp = _UILogic:WorldToScreenPosition(Vector2(wp.x, wp.y + 0.7))\n\t\tfx.UITransformComponent.anchoredPosition = _UILogic:ScreenToUIPosition(sp)\n\tend\n\tfx.Enable = true\nend\n_TimerService:SetTimerOnce(function()\n\tif fx ~= nil then fx.Enable = false end\n\tself.FxBusy = false\n\tlocal shown = damage\n\tlocal mt = self.Monsters[targetIndex]\n\tif mt ~= nil and mt.alive == true and mt.vuln > 0 then\n\t\tshown = math.floor(damage * 1.5)\n\tend\n\tself:DealDamageToTarget(damage)\n\tself:ShowDmgPop(targetIndex, shown)\n\tself:RenderCombat()\n\tself:CheckCombatEnd()\nend, 0.35)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "PlayAttackFx"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
}
|
|
],
|
|
"Code": "local m = self.Monsters[slot]\nif m == nil then\n\treturn\nend\nm.alive = false\nif m.entity ~= nil and isvalid(m.entity) then\n\tlocal ent = m.entity\n\t_TimerService:SetTimerOnce(function() if isvalid(ent) then ent:SetVisible(false) end end, 0.4)\nend\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(slot), false)\nfor i = 1, #self.Monsters do\n\tif self.Monsters[i].alive == true then self.TargetIndex = i; break end\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "KillMonster"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "amount"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "attackerSlot"
|
|
}
|
|
],
|
|
"Code": "local dmg = amount\nif self.PlayerBlock > 0 then\n\tlocal absorbed = math.min(self.PlayerBlock, dmg)\n\tself.PlayerBlock = self.PlayerBlock - absorbed\n\tdmg = dmg - absorbed\nend\nif dmg > 0 then\n\tself.PlayerHp = self.PlayerHp - dmg\n\tif self:HasRelic(\"bronzeScales\") and attackerSlot ~= nil and attackerSlot > 0 then\n\t\tlocal am = self.Monsters[attackerSlot]\n\t\tif am ~= nil and am.alive == true then\n\t\t\tam.hp = am.hp - 3\n\t\t\tif am.hp <= 0 then\n\t\t\t\tam.hp = 0\n\t\t\t\tself:KillMonster(am.slot)\n\t\t\tend\n\t\tend\n\tend\n\tif self:HasRelic(\"selfFormingClay\") then\n\t\tself.ClayBlockNext = self.ClayBlockNext + 3\n\tend\n\tif self:HasRelic(\"centennialPuzzle\") and self.FirstHpLossDone == false then\n\t\tself.FirstHpLossDone = true\n\t\tself:DrawCards(3)\n\t\tself:RenderHand(false)\n\tend\nend\nif self.PlayerHp < 0 then\n\tself.PlayerHp = 0\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "DealDamageToPlayer"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self.TurnBusy = true\nself:EnemyActStep(1)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "EnemyTurn"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "fromIndex"
|
|
}
|
|
],
|
|
"Code": "local idx = 0\nfor i = fromIndex, #self.Monsters do\n\tif self.Monsters[i].alive == true then idx = i; break end\nend\nif idx == 0 or self.PlayerHp <= 0 then\n\tself:FinishEnemyTurn()\n\treturn\nend\nlocal m = self.Monsters[idx]\nlocal base = \"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(idx)\nself:SetEntityEnabled(base .. \"/ActFrame\", true)\n_TimerService:SetTimerOnce(function()\n\tm.block = 0\n\tlocal intent = m.intents[m.intentIdx]\n\tif intent ~= nil then\n\t\tif intent.kind == \"Attack\" then\n\t\t\tlocal atk = intent.value + m.str\n\t\t\tif m.weak > 0 then\n\t\t\t\tatk = math.floor(atk * 0.75)\n\t\t\tend\n\t\t\tif self.PlayerVuln > 0 then\n\t\t\t\tatk = math.floor(atk * 1.5)\n\t\t\tend\n\t\t\tlocal before = self.PlayerHp\n\t\t\tself:DealDamageToPlayer(atk, idx)\n\t\t\tself:ShowPlayerDmgPop(before - self.PlayerHp)\n\t\telseif intent.kind == \"Defend\" then\n\t\t\tm.block = m.block + intent.value\n\t\telseif intent.kind == \"Debuff\" then\n\t\t\tif intent.effect == \"weak\" then\n\t\t\t\tself.PlayerWeak = self.PlayerWeak + intent.value\n\t\t\telseif intent.effect == \"vuln\" then\n\t\t\t\tself.PlayerVuln = self.PlayerVuln + intent.value\n\t\t\tend\n\t\tend\n\tend\n\tm.intentIdx = m.intentIdx + 1\n\tif m.intentIdx > #m.intents then\n\t\tm.intentIdx = 1\n\tend\n\tif m.weak > 0 then m.weak = m.weak - 1 end\n\tif m.vuln > 0 then m.vuln = m.vuln - 1 end\n\tself:RenderCombat()\n\tself:SetEntityEnabled(base .. \"/ActFrame\", false)\n\t_TimerService:SetTimerOnce(function() self:EnemyActStep(idx + 1) end, 0.15)\nend, 0.45)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "EnemyActStep"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self.TurnBusy = false\nself:CheckCombatEnd()\nif self.CombatOver == true then\n\treturn\nend\n_TimerService:SetTimerOnce(function() self:StartPlayerTurn() end, 0.45)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "FinishEnemyTurn"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local anyAlive = false\nfor i = 1, #self.Monsters do\n\tif self.Monsters[i].alive == true then anyAlive = true; break end\nend\nif anyAlive == false then\n\tself.CombatOver = true\n\tself.Gold = self.Gold + 25\n\tself:ApplyRelics(\"combatEnd\")\n\tself:ApplyRelics(\"combatReward\")\n\tself:MaybeDropPotion()\n\tself:RenderRun()\n\tlocal node = self.MapNodes[self.CurrentNodeId]\n\tif node ~= nil and node.type == \"elite\" then\n\t\tself.Gold = self.Gold + 15\n\t\tlocal nid = self:PickNewRelic()\n\t\tif nid ~= \"\" then\n\t\t\tself:AddRelic(nid)\n\t\t\tlocal nr = self.Relics[nid]\n\t\t\tif nr ~= nil then\n\t\t\t\tself:Toast(\"유물 획득: \" .. nr.name)\n\t\t\tend\n\t\tend\n\tend\n\tif node ~= nil and node.type == \"boss\" then\n\t\tlocal bid = self:PickNewRelic()\n\t\tif bid ~= \"\" then\n\t\t\tself:AddRelic(bid)\n\t\t\tlocal br = self.Relics[bid]\n\t\t\tif br ~= nil then\n\t\t\t\tself:Toast(\"유물 획득: \" .. br.name)\n\t\t\tend\n\t\tend\n\tend\n\tif node ~= nil and node.type == \"boss\" then\n\t\tif self.Floor < self.RunLength then\n\t\t\tself.Floor = self.Floor + 1\n\t\t\tself.CurrentNodeId = \"\"\n\t\t\tself.CurrentEnemyId = \"\"\n\t\t\tself:RenderRun()\n\t\t\tself:TeleportToActMap()\n\t\t\tself:ShowMap()\n\t\telse\n\t\t\tself:EndRun(\"런 클리어!\")\n\t\tend\n\telse\n\t\tself:OfferReward()\n\tend\nelseif self.PlayerHp <= 0 then\n\tself.CombatOver = true\n\tself:EndRun(\"패배...\")\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "CheckCombatEnd"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local maps = { \"map01\", \"map02\", \"map03\" }\nlocal target = maps[self.Floor]\nif target == nil then\n\treturn\nend\nlocal lp = _UserService.LocalPlayer\nif lp == nil then\n\treturn\nend\nif lp.CurrentMapName == target then\n\treturn\nend\n_TeleportService:TeleportToMapPosition(lp, Vector3(-6, 0.03, 0), target)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "TeleportToActMap"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "text"
|
|
}
|
|
],
|
|
"Code": "self:SetText(\"/ui/DefaultGroup/CombatHud/Result\", text)\nlocal entity = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/Result\")\nif entity ~= nil then\n\tentity.Enable = true\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ShowResult"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "text"
|
|
}
|
|
],
|
|
"Code": "self:ShowResult(text)\nself.RunActive = false\n_TimerService:SetTimerOnce(function() self:ShowMainMenu() end, 4)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "EndRun"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "str"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "weak"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "vuln"
|
|
}
|
|
],
|
|
"Code": "local parts = {}\nif str ~= nil and str > 0 then table.insert(parts, \"힘+\" .. tostring(str)) end\nif weak ~= nil and weak > 0 then table.insert(parts, \"약화\" .. tostring(weak)) end\nif vuln ~= nil and vuln > 0 then table.insert(parts, \"취약\" .. tostring(vuln)) end\nreturn table.concat(parts, \" \")",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "BuffsLabel"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "for i = 1, 4 do\n\tlocal base = \"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(i)\n\tlocal m = self.Monsters[i]\n\tif m ~= nil and m.alive == true then\n\t\tself:SetEntityEnabled(base, true)\n\t\tself:SetText(base .. \"/Name\", m.name)\n\t\tself:SetText(base .. \"/Hp\", string.format(\"%d\", m.hp) .. \"/\" .. string.format(\"%d\", m.maxHp))\n\t\tlocal intent = m.intents[m.intentIdx]\n\t\tlocal t = \"\"\n\t\tif intent ~= nil then\n\t\t\tif intent.kind == \"Attack\" then\n\t\t\t\tlocal atk = intent.value + m.str\n\t\t\t\tif m.weak > 0 then atk = math.floor(atk * 0.75) end\n\t\t\t\tif self.PlayerVuln > 0 then atk = math.floor(atk * 1.5) end\n\t\t\t\tt = \"공격 \" .. tostring(atk)\n\t\t\telseif intent.kind == \"Defend\" then t = \"방어 \" .. tostring(intent.value)\n\t\t\telseif intent.kind == \"Debuff\" then\n\t\t\t\tif intent.effect == \"weak\" then t = \"약화 \" .. tostring(intent.value) .. \" 부여\"\n\t\t\t\telse t = \"취약 \" .. tostring(intent.value) .. \" 부여\" end\n\t\t\tend\n\t\tend\n\t\tself:SetText(base .. \"/Intent\", t)\n\t\tself:SetEntityEnabled(base .. \"/TargetFrame\", i == self.TargetIndex)\n\t\tlocal intentEntity = _EntityService:GetEntityByPath(base .. \"/Intent\")\n\t\tif intentEntity ~= nil and intentEntity.TextComponent ~= nil and intent ~= nil then\n\t\t\tif intent.kind == \"Attack\" then\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(1, 0.45, 0.35, 1)\n\t\t\telseif intent.kind == \"Debuff\" then\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(0.8, 0.5, 1, 1)\n\t\t\telse\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(0.5, 0.75, 1, 1)\n\t\t\tend\n\t\tend\n\t\tself:SetHpBar(base .. \"/HpBarFill\", m.hp, m.maxHp, 140)\n\t\tself:SetEntityEnabled(base .. \"/BlockBadge\", m.block > 0)\n\t\tself:SetText(base .. \"/BlockBadge/Value\", string.format(\"%d\", m.block))\n\t\tself:SetText(base .. \"/Buffs\", self:BuffsLabel(m.str, m.weak, m.vuln))\n\telse\n\t\tself:SetEntityEnabled(base, false)\n\tend\nend\nself:SetText(\"/ui/DefaultGroup/CombatHud/PlayerPanel/HpText\", string.format(\"%d\", self.PlayerHp) .. \"/\" .. string.format(\"%d\", self.PlayerMaxHp))\nself:SetHpBar(\"/ui/DefaultGroup/CombatHud/PlayerPanel/HpBarFill\", self.PlayerHp, self.PlayerMaxHp, 220)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/PlayerPanel/BlockBadge\", self.PlayerBlock > 0)\nself:SetText(\"/ui/DefaultGroup/CombatHud/PlayerPanel/BlockBadge/Value\", string.format(\"%d\", self.PlayerBlock))\nlocal pb = self:BuffsLabel(self.PlayerStr, self.PlayerWeak, self.PlayerVuln)\nif self.PlayerPowers ~= nil and #self.PlayerPowers > 0 then\n\tlocal names = {}\n\tfor i = 1, #self.PlayerPowers do\n\t\tlocal pc = self.Cards[self.PlayerPowers[i]]\n\t\tif pc ~= nil then table.insert(names, pc.name) end\n\tend\n\tif pb ~= \"\" then pb = pb .. \" · \" end\n\tpb = pb .. table.concat(names, \" \")\nend\nself:SetText(\"/ui/DefaultGroup/CombatHud/PlayerPanel/Buffs\", pb)\nself:RenderRun()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderCombat"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "amount"
|
|
}
|
|
],
|
|
"Code": "local base = \"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(slot) .. \"/DmgPop\"\nself:SetText(base, \"-\" .. string.format(\"%d\", amount))\nself:SetEntityEnabled(base, true)\n_TimerService:SetTimerOnce(function() self:SetEntityEnabled(base, false) end, 0.6)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ShowDmgPop"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "amount"
|
|
}
|
|
],
|
|
"Code": "local base = \"/ui/DefaultGroup/CombatHud/PlayerPanel/DmgPop\"\nif amount > 0 then\n\tself:SetText(base, \"-\" .. string.format(\"%d\", amount))\nelse\n\tself:SetText(base, \"막음\")\nend\nself:SetEntityEnabled(base, true)\n_TimerService:SetTimerOnce(function() self:SetEntityEnabled(base, false) end, 0.6)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ShowPlayerDmgPop"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "path"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "hp"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "maxHp"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "width"
|
|
}
|
|
],
|
|
"Code": "local e = _EntityService:GetEntityByPath(path)\nif e == nil or e.UITransformComponent == nil then\n\treturn\nend\nlocal ratio = 0\nif maxHp > 0 then ratio = hp / maxHp end\nif ratio < 0 then ratio = 0 end\nlocal w = width * ratio\ne.UITransformComponent.RectSize = Vector2(w, 14)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "SetHpBar"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
}
|
|
],
|
|
"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": [],
|
|
"Name": "PositionMonsterSlot"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
}
|
|
],
|
|
"Code": "if self.Monsters[slot] ~= nil and self.Monsters[slot].alive == true then\n\tself.TargetIndex = slot\n\tself:RenderCombat()\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "SetTarget"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self:SetText(\"/ui/DefaultGroup/CombatHud/TopBar/Floor\", \"막 \" .. string.format(\"%d\", self.Floor) .. \"/\" .. string.format(\"%d\", self.RunLength))\nself:SetText(\"/ui/DefaultGroup/CombatHud/TopBar/Gold\", \"골드 \" .. string.format(\"%d\", self.Gold))",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderRun"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self:SetEntityEnabled(\"/ui/DefaultGroup/CardHand\", false)\nself:SetEntityEnabled(\"/ui/DefaultGroup/DeckHud\", false)\nlocal pool = {}\nfor id, _ in pairs(self.Cards) do\n\ttable.insert(pool, id)\nend\nself.RewardChoices = {}\nfor i = 1, 3 do\n\tself.RewardChoices[i] = pool[math.random(1, #pool)]\n\tself:ApplyRewardVisual(i, self.RewardChoices[i])\nend\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/RewardHud\")\nif hud ~= nil then\n\thud.Enable = true\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "OfferReward"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "cardId"
|
|
}
|
|
],
|
|
"Code": "self:ApplyCardFace(\"/ui/DefaultGroup/RewardHud/Reward\" .. tostring(slot), cardId)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ApplyRewardVisual"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
}
|
|
],
|
|
"Code": "if self.CombatOver ~= true or self.RunActive ~= true then\n\treturn\nend\nif slot ~= 0 and self.RewardChoices ~= nil then\n\tlocal id = self.RewardChoices[slot]\n\tif id ~= nil then\n\t\ttable.insert(self.RunDeck, id)\n\tend\nend\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/RewardHud\")\nif hud ~= nil then\n\thud.Enable = false\nend\nself:ShowMap()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "PickReward"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "boolean",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "id"
|
|
}
|
|
],
|
|
"Code": "if self.RunRelics == nil then\n\treturn false\nend\nfor i = 1, #self.RunRelics do\n\tif self.RunRelics[i] == id then\n\t\treturn true\n\tend\nend\nreturn false",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "HasRelic"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "hook"
|
|
}
|
|
],
|
|
"Code": "if self.RunRelics == nil then\n\treturn\nend\nfor i = 1, #self.RunRelics do\n\tlocal r = self.Relics[self.RunRelics[i]]\n\tif r ~= nil and r.hook == hook then\n\t\tif r.effect == \"block\" then\n\t\t\tself.PlayerBlock = self.PlayerBlock + r.value\n\t\telseif r.effect == \"energy\" then\n\t\t\tself.Energy = self.Energy + r.value\n\t\telseif r.effect == \"strength\" then\n\t\t\tself.PlayerStr = self.PlayerStr + r.value\n\t\telseif r.effect == \"draw\" then\n\t\t\tself:DrawCards(r.value)\n\t\t\tself:RenderHand(false)\n\t\telseif r.effect == \"heal\" or r.effect == \"healOnAttack\" or r.effect == \"healOnWin\" then\n\t\t\tself.PlayerHp = self.PlayerHp + r.value\n\t\t\tif self.PlayerHp > self.PlayerMaxHp then\n\t\t\t\tself.PlayerHp = self.PlayerMaxHp\n\t\t\tend\n\t\telseif r.effect == \"healIfLow\" then\n\t\t\tif self.PlayerHp * 2 <= self.PlayerMaxHp then\n\t\t\t\tself.PlayerHp = self.PlayerHp + r.value\n\t\t\t\tif self.PlayerHp > self.PlayerMaxHp then\n\t\t\t\t\tself.PlayerHp = self.PlayerMaxHp\n\t\t\t\tend\n\t\t\tend\n\t\telseif r.effect == \"gold\" then\n\t\t\tself.Gold = self.Gold + r.value\n\t\tend\n\tend\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ApplyRelics"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "id"
|
|
}
|
|
],
|
|
"Code": "if self.RunRelics == nil then\n\tself.RunRelics = {}\nend\ntable.insert(self.RunRelics, id)\nlocal r = self.Relics[id]\nif r ~= nil and r.hook == \"passive\" then\n\tif r.effect == \"potionSlots\" then\n\t\tself.PotionSlots = r.value\n\t\tself:RenderPotions()\n\telseif r.effect == \"maxHp\" then\n\t\tself.PlayerMaxHp = self.PlayerMaxHp + r.value\n\t\tself.PlayerHp = self.PlayerHp + r.value\n\tend\nend\nself:RenderRelics()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "AddRelic"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local pool = {}\nfor i = 1, #self.RelicPool do\n\tif self:HasRelic(self.RelicPool[i]) == false then\n\t\ttable.insert(pool, self.RelicPool[i])\n\tend\nend\nif #pool == 0 then\n\tself.Gold = self.Gold + 25\n\tself:Toast(\"유물을 모두 모았습니다! 골드 +25\")\n\treturn \"\"\nend\nreturn pool[math.random(1, #pool)]",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "PickNewRelic"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "boolean",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "pid"
|
|
}
|
|
],
|
|
"Code": "if self.RunPotions == nil then\n\tself.RunPotions = {}\nend\nif #self.RunPotions >= self.PotionSlots then\n\tself:Toast(\"물약 슬롯이 가득 찼습니다\")\n\treturn false\nend\ntable.insert(self.RunPotions, pid)\nself:RenderPotions()\nreturn true",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "AddPotion"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "if math.random() > 0.4 then\n\treturn\nend\nlocal keys = {}\nfor pid, _ in pairs(self.Potions) do\n\ttable.insert(keys, pid)\nend\ntable.sort(keys)\nlocal pid = keys[math.random(1, #keys)]\nif self:AddPotion(pid) == true then\n\tlocal p = self.Potions[pid]\n\tself:Toast(\"물약 획득: \" .. p.name)\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "MaybeDropPotion"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "for i = 1, 5 do\n\tlocal base = \"/ui/DefaultGroup/CombatHud/TopBar/PotionSlot\" .. tostring(i)\n\tlocal e = _EntityService:GetEntityByPath(base)\n\tif e ~= nil and e.SpriteGUIRendererComponent ~= nil then\n\t\tlocal pid = nil\n\t\tif self.RunPotions ~= nil then\n\t\t\tpid = self.RunPotions[i]\n\t\tend\n\t\tif pid ~= nil and self.Potions[pid] ~= nil then\n\t\t\te.SpriteGUIRendererComponent.ImageRUID = self.Potions[pid].icon\n\t\t\te.SpriteGUIRendererComponent.Color = Color(1, 1, 1, 1)\n\t\telseif i > self.PotionSlots then\n\t\t\te.SpriteGUIRendererComponent.ImageRUID = \"\"\n\t\t\te.SpriteGUIRendererComponent.Color = Color(0.1, 0.1, 0.12, 0.85)\n\t\telse\n\t\t\te.SpriteGUIRendererComponent.ImageRUID = \"\"\n\t\t\te.SpriteGUIRendererComponent.Color = Color(0.22, 0.25, 0.3, 0.9)\n\t\tend\n\tend\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderPotions"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
}
|
|
],
|
|
"Code": "if self.RunPotions == nil or self.RunPotions[slot] == nil then\n\treturn\nend\nself.PotionMenuSlot = slot\nlocal pid = self.RunPotions[slot]\nlocal p = self.Potions[pid]\nif p ~= nil then\n\tself:SetText(\"/ui/DefaultGroup/CombatHud/PotionMenu/Title\", p.name .. \" — \" .. p.desc)\nend\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/PotionMenu\", true)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "OpenPotionMenu"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self.PotionMenuSlot = 0\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/PotionMenu\", false)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ClosePotionMenu"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "if self.PotionMenuSlot <= 0 then\n\treturn\nend\nif self.CombatOver == true or self.TurnBusy == true or self.FxBusy == true then\n\tself:Toast(\"지금은 사용할 수 없습니다\")\n\treturn\nend\nlocal combat = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud\")\nlocal hand = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CardHand\")\nif combat == nil or combat.Enable ~= true or hand == nil or hand.Enable ~= true then\n\tself:Toast(\"전투 중에만 사용할 수 있습니다\")\n\treturn\nend\nlocal pid = self.RunPotions[self.PotionMenuSlot]\nif pid == nil then\n\treturn\nend\nlocal p = self.Potions[pid]\nif p == nil then\n\treturn\nend\nif p.effect == \"heal\" then\n\tself.PlayerHp = math.min(self.PlayerHp + p.value, self.PlayerMaxHp)\nelseif p.effect == \"damage\" then\n\tself:DealDamageToTarget(p.value)\n\tself:ShowDmgPop(self.TargetIndex, p.value)\nelseif p.effect == \"strength\" then\n\tself.PlayerStr = self.PlayerStr + p.value\nelseif p.effect == \"block\" then\n\tself.PlayerBlock = self.PlayerBlock + p.value\nelseif p.effect == \"energy\" then\n\tself.Energy = self.Energy + p.value\nelseif p.effect == \"weak\" then\n\tlocal tm = self.Monsters[self.TargetIndex]\n\tif tm ~= nil and tm.alive == true then\n\t\ttm.weak = tm.weak + p.value\n\tend\nend\ntable.remove(self.RunPotions, self.PotionMenuSlot)\nself:Toast(\"물약 사용: \" .. p.name)\nself:ClosePotionMenu()\nself:RenderPotions()\nself:RenderPiles()\nself:RenderCombat()\nself:CheckCombatEnd()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "UsePotion"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "if self.PotionMenuSlot <= 0 then\n\treturn\nend\nlocal pid = self.RunPotions[self.PotionMenuSlot]\nif pid ~= nil then\n\tlocal p = self.Potions[pid]\n\ttable.remove(self.RunPotions, self.PotionMenuSlot)\n\tif p ~= nil then\n\t\tself:Toast(\"물약 버림: \" .. p.name)\n\tend\nend\nself:ClosePotionMenu()\nself:RenderPotions()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "TossPotion"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local count = 0\nif self.RunRelics ~= nil then\n\tcount = #self.RunRelics\nend\nfor i = 1, 10 do\n\tlocal base = \"/ui/DefaultGroup/CombatHud/TopBar/RelicSlot\" .. tostring(i)\n\tlocal e = _EntityService:GetEntityByPath(base)\n\tif e ~= nil and e.SpriteGUIRendererComponent ~= nil then\n\t\tlocal rid = nil\n\t\tif self.RunRelics ~= nil then\n\t\t\trid = self.RunRelics[i]\n\t\tend\n\t\tif rid ~= nil and self.Relics[rid] ~= nil and (i < 10 or count <= 10) then\n\t\t\te.SpriteGUIRendererComponent.ImageRUID = self.Relics[rid].icon\n\t\t\te.SpriteGUIRendererComponent.Color = Color(1, 1, 1, 1)\n\t\telse\n\t\t\te.SpriteGUIRendererComponent.ImageRUID = \"\"\n\t\t\te.SpriteGUIRendererComponent.Color = Color(0.15, 0.16, 0.2, 0.6)\n\t\tend\n\tend\nend\nlocal of = \"\"\nif count > 10 then\n\tof = \"+\" .. tostring(count - 9)\nend\nself:SetText(\"/ui/DefaultGroup/CombatHud/TopBar/RelicOverflow\", of)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderRelics"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "name"
|
|
},
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "desc"
|
|
},
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "x"
|
|
}
|
|
],
|
|
"Code": "self:SetText(\"/ui/DefaultGroup/CombatHud/TooltipBox/Name\", name)\nself:SetText(\"/ui/DefaultGroup/CombatHud/TooltipBox/Desc\", desc)\nlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/TooltipBox\")\nif e ~= nil then\n\tif e.UITransformComponent ~= nil then\n\t\te.UITransformComponent.anchoredPosition = Vector2(x, 400)\n\tend\n\te.Enable = true\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ShowTooltip"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/TooltipBox\", false)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "HideTooltip"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self:ShowState(\"map\")\nself:RenderMap()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ShowMap"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "boolean",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "id"
|
|
}
|
|
],
|
|
"Code": "local list\nif self.CurrentNodeId == \"\" then\n\tlist = self.MapStart\nelse\n\tlocal node = self.MapNodes[self.CurrentNodeId]\n\tif node == nil then\n\t\treturn false\n\tend\n\tlist = node.next\nend\nfor i = 1, #list do\n\tif list[i] == id then\n\t\treturn true\n\tend\nend\nreturn false",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "IsReachable"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "for id, node in pairs(self.MapNodes) do\n\tlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/MapHud/Node_\" .. id)\n\tif e ~= nil then\n\t\tlocal reachable = self:IsReachable(id)\n\t\tif e.SpriteGUIRendererComponent ~= nil then\n\t\t\tif reachable then\n\t\t\t\te.SpriteGUIRendererComponent.Color = Color(0.3, 0.55, 0.85, 1)\n\t\t\telse\n\t\t\t\te.SpriteGUIRendererComponent.Color = Color(0.2, 0.22, 0.26, 0.6)\n\t\t\tend\n\t\tend\n\t\tif e.ButtonComponent ~= nil then\n\t\t\te.ButtonComponent.Enable = reachable\n\t\tend\n\tend\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderMap"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "string",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "id"
|
|
}
|
|
],
|
|
"Code": "if self.RunActive ~= true then\n\treturn\nend\nif self:IsReachable(id) ~= true then\n\treturn\nend\nself.CurrentNodeId = id\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/MapHud\")\nif hud ~= nil then\n\thud.Enable = false\nend\nlocal node = self.MapNodes[id]\nif node.type == \"shop\" then\n\tself:ShowShop()\nelseif node.type == \"rest\" then\n\tself:ShowRest()\nelse\n\tself.CurrentEnemyId = node.enemy\n\tself:StartCombat()\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "PickNode"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local pool = {}\nfor cid, _ in pairs(self.Cards) do\n\ttable.insert(pool, cid)\nend\nself.ShopChoices = {}\nself.ShopBought = { false, false, false }\nfor i = 1, 3 do\n\tself.ShopChoices[i] = pool[math.random(1, #pool)]\nend\nself.ShopRelic = self.RelicPool[math.random(1, #self.RelicPool)]\nself.ShopRelicBought = false\nlocal pkeys = {}\nfor pid, _ in pairs(self.Potions) do\n\ttable.insert(pkeys, pid)\nend\ntable.sort(pkeys)\nself.ShopPotion = pkeys[math.random(1, #pkeys)]\nself.ShopPotionBought = false\nself:RenderShop()\nself:ShowState(\"shop\")",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ShowShop"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self:SetText(\"/ui/DefaultGroup/ShopHud/Gold\", \"골드 \" .. string.format(\"%d\", self.Gold))\nfor i = 1, 3 do\n\tlocal cid = self.ShopChoices[i]\n\tlocal c = self.Cards[cid]\n\tlocal base = \"/ui/DefaultGroup/ShopHud/Card\" .. tostring(i)\n\tif c ~= nil then\n\t\tself:ApplyCardFace(base, cid)\n\t\tself:SetText(base .. \"/Price\", string.format(\"%d\", 30) .. \" 골드\")\n\t\tlocal e = _EntityService:GetEntityByPath(base)\n\t\tif e ~= nil and e.SpriteGUIRendererComponent ~= nil then\n\t\t\tif self.ShopBought[i] == true then\n\t\t\t\te.SpriteGUIRendererComponent.Color = Color(0.2, 0.22, 0.26, 0.6)\n\t\t\tend\n\t\tend\n\tend\nend\nlocal rr = self.Relics[self.ShopRelic]\nif rr ~= nil then\n\tself:SetText(\"/ui/DefaultGroup/ShopHud/Relic/Label\", rr.name .. \" — \" .. rr.desc)\n\tself:SetText(\"/ui/DefaultGroup/ShopHud/Relic/Price\", string.format(\"%d\", 60) .. \" 골드\")\n\tlocal re = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/ShopHud/Relic\")\n\tif re ~= nil and re.SpriteGUIRendererComponent ~= nil then\n\t\tif self.ShopRelicBought == true then\n\t\t\tre.SpriteGUIRendererComponent.Color = Color(0.2, 0.22, 0.26, 0.6)\n\t\telse\n\t\t\tre.SpriteGUIRendererComponent.Color = Color(0.7, 0.55, 0.85, 1)\n\t\tend\n\tend\nend\nlocal pp = self.Potions[self.ShopPotion]\nif pp ~= nil then\n\tself:SetText(\"/ui/DefaultGroup/ShopHud/Potion/Label\", pp.name .. \" — \" .. pp.desc)\n\tself:SetText(\"/ui/DefaultGroup/ShopHud/Potion/Price\", string.format(\"%d\", 20) .. \" 골드\")\n\tlocal pe = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/ShopHud/Potion\")\n\tif pe ~= nil and pe.SpriteGUIRendererComponent ~= nil then\n\t\tif self.ShopPotionBought == true then\n\t\t\tpe.SpriteGUIRendererComponent.Color = Color(0.2, 0.22, 0.26, 0.6)\n\t\telse\n\t\t\tpe.SpriteGUIRendererComponent.Color = Color(0.45, 0.7, 0.55, 1)\n\t\tend\n\tend\nend",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "RenderShop"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "if self.ShopRelicBought == true then\n\treturn\nend\nif self.Gold < 60 then\n\treturn\nend\nself.Gold = self.Gold - 60\nself:AddRelic(self.ShopRelic)\nself.ShopRelicBought = true\nself:RenderShop()\nself:RenderRun()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "BuyRelic"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "if self.ShopPotionBought == true then\n\treturn\nend\nif self.Gold < 20 then\n\treturn\nend\nif self.RunPotions ~= nil and #self.RunPotions >= self.PotionSlots then\n\tself:Toast(\"물약 슬롯이 가득 찼습니다\")\n\treturn\nend\nif self:AddPotion(self.ShopPotion) == true then\n\tself.Gold = self.Gold - 20\n\tself.ShopPotionBought = true\nend\nself:RenderShop()\nself:RenderRun()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "BuyPotion"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "slot"
|
|
}
|
|
],
|
|
"Code": "if self.ShopBought == nil or self.ShopBought[slot] == true then\n\treturn\nend\nif self.Gold < 30 then\n\treturn\nend\nself.Gold = self.Gold - 30\ntable.insert(self.RunDeck, self.ShopChoices[slot])\nself.ShopBought[slot] = true\nself:RenderShop()\nself:RenderRun()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "BuyCard"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local old = self.PlayerHp\nself.PlayerHp = self.PlayerHp + 30\nif self.PlayerHp > self.PlayerMaxHp then\n\tself.PlayerHp = self.PlayerMaxHp\nend\nlocal healed = self.PlayerHp - old\nself:SetText(\"/ui/DefaultGroup/RestHud/Info\", \"HP \" .. string.format(\"%d\", old) .. \" → \" .. string.format(\"%d\", self.PlayerHp) .. \" (+\" .. string.format(\"%d\", healed) .. \")\")\nself:RenderCombat()\nself:ShowState(\"rest\")",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "ShowRest"
|
|
},
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "local s = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/ShopHud\")\nif s ~= nil then\n\ts.Enable = false\nend\nlocal r = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/RestHud\")\nif r ~= nil then\n\tr.Enable = false\nend\nself:ShowMap()",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "LeaveNode"
|
|
}
|
|
],
|
|
"EntityEventHandlers": []
|
|
}
|
|
}
|
|
} |