Added helper for Elle Rubash

This commit is contained in:
Chr1Z93 2024-11-02 00:12:07 +01:00
parent 0958f6fa7e
commit d7e14fd9ec
5 changed files with 51 additions and 4 deletions

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false, "IgnoreFoW": false,
"LayoutGroupSortIndex": 0, "LayoutGroupSortIndex": 0,
"Locked": false, "Locked": false,
"LuaScript": "", "LuaScript": "require(\"playercards/cards/ElleRubash2\")",
"LuaScriptState": "", "LuaScriptState": "",
"MeasureMovement": false, "MeasureMovement": false,
"Name": "Card", "Name": "Card",
@ -43,7 +43,8 @@
"Sticky": true, "Sticky": true,
"Tags": [ "Tags": [
"Asset", "Asset",
"PlayerCard" "PlayerCard",
"CardWithHelper"
], ],
"Tooltip": true, "Tooltip": true,
"Transform": { "Transform": {
@ -58,5 +59,5 @@
"scaleZ": 1 "scaleZ": 1
}, },
"Value": 0, "Value": 0,
"XmlUI": "" "XmlUI": "\u003cInclude src=\"playercards/ElleRubash2.xml\"/\u003e"
} }

View File

@ -2708,6 +2708,10 @@ end
-- Callback functions for token spawning -- Callback functions for token spawning
--------------------------------------------------------- ---------------------------------------------------------
function addTagToToken(obj, tag)
obj.addTag(tag)
end
function updateUniversalActionAbilityToken(obj, params) function updateUniversalActionAbilityToken(obj, params)
obj.call("updateClassAndSymbol", params) obj.call("updateClassAndSymbol", params)
if params.addTag then if params.addTag then

View File

@ -0,0 +1,28 @@
require("playercards/CardsWithHelper")
local tokenManagerApi = require("core/token/TokenManagerApi")
-- intentionally global
hasXML = true
isHelperEnabled = false
function updateSave()
self.script_state = JSON.encode({ isHelperEnabled = isHelperEnabled })
end
function onLoad(savedData)
if savedData and savedData ~= "" then
local loadedData = JSON.decode(savedData)
isHelperEnabled = loadedData.isHelperEnabled
if isHelperEnabled then updateDisplay() end
end
end
function spawnIgnoredDoom()
tokenManagerApi.spawnToken(
self.positionToWorld({ 0, 0, -0.9 }) + Vector(0, 1, 0),
"doom",
self.getRotation(),
"addTagToToken",
"DoomCounter_ignore"
)
end

View File

@ -0,0 +1,14 @@
<Button active="false"
id="Helper"
height="550"
width="1200"
rotation="0 0 180"
scale="0.1 0.1 1"
position="0 -25 -22"
padding="50 50 50 50"
font="font_teutonic-arkham"
fontSize="200"
onClick="spawnIgnoredDoom"
color="#AA1C0080"
textColor="White"
text="Spawn Ignored&#xA;Doom Token"/>