Added helper for Elle Rubash
This commit is contained in:
parent
0958f6fa7e
commit
d7e14fd9ec
@ -33,7 +33,7 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": false,
|
||||
"LuaScript": "",
|
||||
"LuaScript": "require(\"playercards/cards/ElleRubash2\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Card",
|
||||
@ -43,7 +43,8 @@
|
||||
"Sticky": true,
|
||||
"Tags": [
|
||||
"Asset",
|
||||
"PlayerCard"
|
||||
"PlayerCard",
|
||||
"CardWithHelper"
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
@ -58,5 +59,5 @@
|
||||
"scaleZ": 1
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
"XmlUI": "\u003cInclude src=\"playercards/ElleRubash2.xml\"/\u003e"
|
||||
}
|
||||
|
@ -2708,6 +2708,10 @@ end
|
||||
-- Callback functions for token spawning
|
||||
---------------------------------------------------------
|
||||
|
||||
function addTagToToken(obj, tag)
|
||||
obj.addTag(tag)
|
||||
end
|
||||
|
||||
function updateUniversalActionAbilityToken(obj, params)
|
||||
obj.call("updateClassAndSymbol", params)
|
||||
if params.addTag then
|
||||
|
28
src/playercards/cards/ElleRubash2.ttslua
Normal file
28
src/playercards/cards/ElleRubash2.ttslua
Normal 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
|
@ -1,7 +1,7 @@
|
||||
VALID_TOKENS = {}
|
||||
|
||||
INVALID_TOKENS = {
|
||||
["Auto-fail"] = true
|
||||
["Auto-fail"] = true
|
||||
}
|
||||
|
||||
UPDATE_ON_HOVER = true
|
||||
|
14
xml/playercards/ElleRubash2.xml
Normal file
14
xml/playercards/ElleRubash2.xml
Normal 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
Doom Token"/>
|
Loading…
Reference in New Issue
Block a user