bugfix for spawning a single damage / horror
This commit is contained in:
parent
c9b8ae3a51
commit
d1ae804266
@ -172,8 +172,7 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror
|
-- Spawns a single counter token and sets the value to tokenValue. Used for damage and horror tokens.
|
||||||
-- tokens.
|
|
||||||
---@param card tts__Object Card to spawn tokens on
|
---@param card tts__Object Card to spawn tokens on
|
||||||
---@param tokenType string type of token to spawn, valid values are "damage" and "horror". Other
|
---@param tokenType string type of token to spawn, valid values are "damage" and "horror". Other
|
||||||
-- types should use spawnMultipleTokens()
|
-- types should use spawnMultipleTokens()
|
||||||
@ -183,7 +182,12 @@ do
|
|||||||
|
|
||||||
local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))
|
local pos = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[1][1] + Vector(0, 0, shiftDown))
|
||||||
local rot = card.getRotation()
|
local rot = card.getRotation()
|
||||||
TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end)
|
TokenManager.spawnToken(pos, tokenType, rot, function(spawned)
|
||||||
|
-- token starts in state 1, so don't attempt to change it to avoid error
|
||||||
|
if tokenValue ~= 1 then
|
||||||
|
spawned.setState(tokenValue)
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
TokenManager.spawnResourceCounterToken = function(card, tokenCount)
|
TokenManager.spawnResourceCounterToken = function(card, tokenCount)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user