ah_sce_unpacked/unpacked/Checker_white Token Spawner ad74a0.ttslua
2021-02-13 14:46:01 -05:00

78 lines
18 KiB
Plaintext

---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Whimsical.
--- DateTime: 2021-01-14 1:10 a.m.
---
local TILE_TYPE_CIRCLE = 2
local HEIGHT_ADJUSTMENT = 1.0
local VALID_INDEX = {false, false, false, true, false, true, true, true, true}
local INDEX_DAMAGE = 4
local INDEX_HORROR = 6
local INDEX_CLUE = 7
local INDEX_DOOM = 8
local INDEX_RESOURCE = 9
local TOKEN_CLUE = "https://i.imgur.com/wfCaVU0.png"
local TOKEN_DOOM = "https://i.imgur.com/EoL7yaZ.png"
local TOKEN_RESOURCE = "https://i.imgur.com/j5v5E3j.png"
local CLOOM_SCALE = Vector(0.25, 1, 0.25)
local RESOURCE_SCALE = Vector(0.17, 0.17, 0.17)
local DAMAGE_JSON = "{\"GUID\":\"142b55\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-38.6177826,\"posY\":1.688475,\"posZ\":10.7887154,\"rotX\":359.9204,\"rotY\":270.009583,\"rotZ\":0.0172974449,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/XIJHw3J.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\",\"States\":{\"2\":{\"GUID\":\"c6ddbe\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444748,\"posY\":1.112169,\"posZ\":19.0119534,\"rotX\":0.000318417122,\"rotY\":270.007721,\"rotZ\":359.99176,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/55w514N.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"3\":{\"GUID\":\"a0f2a0\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444748,\"posY\":1.11216891,\"posZ\":19.0119534,\"rotX\":0.0003119017,\"rotY\":270.007874,\"rotZ\":359.99173,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/eqRC712.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"4\":{\"GUID\":\"24c940\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444748,\"posY\":1.11216891,\"posZ\":19.0119534,\"rotX\":0.0003254045,\"rotY\":270.008026,\"rotZ\":359.99173,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/2j2uZm4.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"5\":{\"GUID\":\"ec79a1\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444748,\"posY\":1.11216879,\"posZ\":19.0119534,\"rotX\":0.000309352879,\"rotY\":270.008,\"rotZ\":359.99173,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/TA30vp2.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"6\":{\"GUID\":\"afe500\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444729,\"posY\":1.11216879,\"posZ\":19.0119514,\"rotX\":0.00031043886,\"rotY\":270.008423,\"rotZ\":359.99176,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/3KcFeRP.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"7\":{\"GUID\":\"c7cbd1\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444729,\"posY\":1.11216891,\"posZ\":19.0119514,\"rotX\":0.000295429461,\"rotY\":270.00824,\"rotZ\":359.99176,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/1ebIZMK.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"8\":{\"GUID\":\"67b357\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.3444729,\"posY\":1.11216891,\"posZ\":19.01195,\"rotX\":0.000306701084,\"rotY\":270.0082,\"rotZ\":359.99173,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/Rsb9QIq.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"9\":{\"GUID\":\"582a00\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-28.2681675,\"posY\":1.21000624,\"posZ\":14.044548,\"rotX\":-0.0000358944635,\"rotY\":270.006958,\"rotZ\":-0.00000148946117,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Damage\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/vysRt4N.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"}}}"
local HORROR_JSON = "{\"GUID\":\"36be72\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-44.08369,\"posY\":1.69583237,\"posZ\":9.886347,\"rotX\":359.9201,\"rotY\":270.008972,\"rotZ\":0.0168560985,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/Bh0BO47.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\",\"States\":{\"2\":{\"GUID\":\"5c2361\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.7533741,\"posY\":1.210006,\"posZ\":15.9442654,\"rotX\":-0.0000202706469,\"rotY\":270.015259,\"rotZ\":0.0000220759175,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/NM2enxD.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"3\":{\"GUID\":\"3a3415\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.7533741,\"posY\":1.210006,\"posZ\":15.9442368,\"rotX\":-0.0000104253941,\"rotY\":270.015137,\"rotZ\":0.0000102804506,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/pZvTKA7.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"4\":{\"GUID\":\"4a91a8\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.7533741,\"posY\":1.21000612,\"posZ\":15.9442348,\"rotX\":0.00000189065361,\"rotY\":270.01532,\"rotZ\":0.0000159575811,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/T7nvZBP.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"5\":{\"GUID\":\"887aae\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.7533741,\"posY\":1.21000612,\"posZ\":15.9442024,\"rotX\":-0.00003432232,\"rotY\":270.016,\"rotZ\":-0.00000373151761,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/mOmg6pc.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"6\":{\"GUID\":\"baa831\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.7533741,\"posY\":1.21000624,\"posZ\":15.94415,\"rotX\":-0.0000249414188,\"rotY\":270.0157,\"rotZ\":0.00000292043842,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/eZcWjw1.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"7\":{\"GUID\":\"da94da\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.7533741,\"posY\":1.21000612,\"posZ\":15.944108,\"rotX\":-0.0000233948358,\"rotY\":270.015656,\"rotZ\":0.00000218774017,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/r4zrAr7.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"8\":{\"GUID\":\"2e1687\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.753376,\"posY\":1.210006,\"posZ\":15.9440966,\"rotX\":-1.57902083e-8,\"rotY\":270.016541,\"rotZ\":-0.0000219759459,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/nFG5R0W.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"},\"9\":{\"GUID\":\"a6f1e0\",\"Name\":\"Custom_Token\",\"Transform\":{\"posX\":-27.753376,\"posY\":1.21000612,\"posZ\":15.9440622,\"rotX\":-0.0000209277514,\"rotY\":270.016724,\"rotZ\":0.00004970206,\"scaleX\":0.25,\"scaleY\":1,\"scaleZ\":0.25},\"Nickname\":\"Horror\",\"Description\":\"\",\"GMNotes\":\"\",\"ColorDiffuse\":{\"r\":1,\"g\":1,\"b\":1},\"LayoutGroupSortIndex\":0,\"Locked\":false,\"Grid\":false,\"Snap\":false,\"IgnoreFoW\":false,\"MeasureMovement\":false,\"DragSelectable\":true,\"Autoraise\":true,\"Sticky\":true,\"Tooltip\":true,\"GridProjection\":false,\"HideWhenFaceDown\":false,\"Hands\":false,\"CustomImage\":{\"ImageURL\":\"https://i.imgur.com/Ud4OpBD.png\",\"ImageSecondaryURL\":\"\",\"ImageScalar\":1,\"WidthScale\":0,\"CustomToken\":{\"Thickness\":0.1,\"MergeDistancePixels\":5,\"StandUp\":false,\"Stackable\":false}},\"LuaScript\":\"\",\"LuaScriptState\":\"\",\"XmlUI\":\"\"}}}"
---@param index number
---@param player_color string
function onScriptingButtonDown(index, player_color)
if not VALID_INDEX[index] then return end
local isResource = index==INDEX_RESOURCE
---@type Player
local player = Player[player_color]
local rotation = player:getPointerRotation()
local position = player:getPointerPosition()
position.y = position.y + HEIGHT_ADJUSTMENT
---@type SpawnObjectParams
local parameters = {
snap_to_grid = false,
position = position,
rotation = Vector(0, rotation, index==INDEX_DOOM and 180 or 0),
scale = isResource and RESOURCE_SCALE or CLOOM_SCALE,
type = isResource and "Custom_Token" or "Custom_Tile",
sound = false
}
if index<=INDEX_HORROR then
parameters.json = index==INDEX_DAMAGE and DAMAGE_JSON or HORROR_JSON
spawnObjectJSON(parameters)
else
local object = spawnObject(parameters)
if index==INDEX_RESOURCE then makeResource(object) else makeCloom(object) end
end
end
---@param object TTSObject
function makeCloom(object)
object:setCustomObject {
type = TILE_TYPE_CIRCLE,
image = TOKEN_CLUE,
image_bottom = TOKEN_DOOM,
stackable = true,
thickness = 0.1
}
end
---@param object TTSObject
function makeResource(object)
object:setCustomObject {
image = TOKEN_RESOURCE,
thickness = 0.3,
merge_distance = 5,
stackable = true
}
end