added padding for action token spawning

This commit is contained in:
Chr1Z93 2024-10-29 14:16:48 +01:00
parent 2c2d009ae7
commit ff928bac34
2 changed files with 19 additions and 16 deletions

View File

@ -2221,7 +2221,12 @@ function TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown
return
end
for i = 1, tokenCount do
offsets[i] = card.positionToWorld(tokenOffsets[tokenCount][i])
-- if spawning action tokens, increase offsets slightly since they are larger
if tokenType == "universalActionAbility" then
offsets[i] = card.positionToWorld(tokenOffsets[tokenCount][i] * Vector(1.2, 1, 1.2))
else
offsets[i] = card.positionToWorld(tokenOffsets[tokenCount][i])
end
end
end

View File

@ -1,11 +1,11 @@
require("playercards/CardsWithHelper")
local playermatApi = require("playermat/PlayermatApi")
local searchLib = require("util/SearchLib")
local tokenManagerApi = require("core/token/TokenManagerApi")
local playermatApi = require("playermat/PlayermatApi")
local searchLib = require("util/SearchLib")
local tokenManagerApi = require("core/token/TokenManagerApi")
-- intentionally global
hasXML = true
isHelperEnabled = false
hasXML = true
isHelperEnabled = false
function onLoad(savedData)
-- get level via metadata and proceed accordingly:
@ -68,25 +68,23 @@ function takeAll(player)
end
end
end
local messageString = "Moved " .. foundTokens .. " resource(s) to " .. matColor .. "'s resource pool"
if notes.id == "08058" then
Wait.time(function() addCharge(player) end, 0.5)
broadcastToColor("Moved " .. foundTokens .. " resource(s) to " .. matColor .. "'s resource pool and placed one charge.", player.color)
else
broadcastToColor("Moved " .. foundTokens .. " resource(s) to " .. matColor .. "'s resource pool.", player.color)
messageString = messageString .. " and placed one charge"
end
broadcastToColor(messageString .. ".", player.color)
end
function addAction(player)
local numTokens
if notes.id == "08058" then
spawnActionToken(2)
numTokens = 2
broadcastToColor("Spawning two temporary action tokens.", player.color)
else
spawnActionToken(1)
numTokens = 1
broadcastToColor("Spawning one temporary action token.", player.color)
end
end
function spawnActionToken(numTokens)
tokenManagerApi.spawnTokenGroup(self, "universalActionAbility", numTokens, 0.8, _, true)
tokenManagerApi.spawnTokenGroup(self, "universalActionAbility", numTokens, 0.91, _, true)
end