Merge pull request #824 from argonui/token-spawning

Updated token offsets for 2 / 3 / 4 tokens
This commit is contained in:
dscarpac 2024-08-15 16:55:10 -05:00 committed by GitHub
commit ee95af53d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1995,11 +1995,15 @@ end
-- Generates the offsets for tokens on a card (clues on locations are different and have their own function)
---@param maxTokens number Maximum amount of tokens on a card
function TokenManager.generateOffsets(maxTokens)
tokenOffsets = {}
for numTokens = 1, maxTokens do
if numTokens == 1 then
tokenOffsets[1] = { Vector(0, 3, -0.2) }
else
tokenOffsets = {
[1] = { Vector(0, 3, -0.2) },
[2] = { Vector(0.4, 3, -0.2), Vector(-0.4, 3, -0.2) },
[3] = { Vector(0, 3, -0.9), Vector(0.4, 3, -0.2), Vector(-0.4, 3, -0.2) },
[4] = { Vector(0.4, 3, -0.9), Vector(-0.4, 3, -0.9), Vector(0.4, 3, -0.2), Vector(-0.4, 3, -0.2) }
}
-- generate offsets for numTokens > 4 dynamically
for numTokens = 5, maxTokens do
local offsets = {}
local rows = math.min(4, math.ceil(numTokens / 3))
local tokensPlaced = 0
@ -2020,7 +2024,7 @@ function TokenManager.generateOffsets(maxTokens)
end
tokenOffsets[numTokens] = offsets
end
end
return tokenOffsets
end
-- Spawns tokens for the card. This function is built to just throw a card at it and let it do