more fixes
This commit is contained in:
parent
ed79143964
commit
956e35f5e3
@ -300,18 +300,19 @@ function makeButtonsToRedraw()
|
||||
return
|
||||
end
|
||||
|
||||
local chaosbag = findChaosBag()
|
||||
local matchingTokensInPlay = {}
|
||||
|
||||
-- nil handling
|
||||
redrawData.VALID_TOKENS = redrawData.VALID_TOKENS or {}
|
||||
redrawData.INVALID_TOKENS = redrawData.INVALID_TOKENS or {}
|
||||
|
||||
-- determine if only some tokens are able to be returned to the bag
|
||||
for _, token in ipairs(chaosTokens) do
|
||||
local tokenName = getReadableTokenName(token.getName())
|
||||
-- nil handling
|
||||
redrawData.VALID_TOKENS = redrawData.VALID_TOKENS or {}
|
||||
redrawData.INVALID_TOKENS = redrawData.INVALID_TOKENS or {}
|
||||
|
||||
|
||||
-- allow valid tokens or not invalid tokens, also allow any token if both lists empty
|
||||
if (redrawData.VALID_TOKENS[tokenName] and #redrawData.INVALID_TOKENS == 0) ~= nil or (isTableEmpty(redrawData.VALID_TOKENS) and not redrawData.INVALID_TOKENS[tokenName]) or
|
||||
if (redrawData.VALID_TOKENS[tokenName] ~= nil and isTableEmpty(redrawData.INVALID_TOKENS)) or (isTableEmpty(redrawData.VALID_TOKENS) and not redrawData.INVALID_TOKENS[tokenName]) or
|
||||
(isTableEmpty(redrawData.VALID_TOKENS) and isTableEmpty(redrawData.INVALID_TOKENS)) then
|
||||
table.insert(matchingTokensInPlay, token)
|
||||
end
|
||||
@ -388,9 +389,9 @@ function returnAndRedraw(_, tokenGUID)
|
||||
|
||||
returnChaosTokenToBag(returnedToken)
|
||||
if redrawData.redrawnTokenType == "random" then
|
||||
token = drawChaosToken({mat = mat, drawAdditional = true, takeParameters = takeParameters})
|
||||
chaosTokens[indexOfReturnedToken] = drawChaosToken({mat = mat, drawAdditional = true, takeParameters = takeParameters})
|
||||
else
|
||||
token = drawChaosToken({mat = mat, drawAdditional = true, takeParameters = takeParameters, tokenType = redrawData.redrawnTokenType})
|
||||
chaosTokens[indexOfReturnedToken] = drawChaosToken({mat = mat, drawAdditional = true, takeParameters = takeParameters, tokenType = redrawData.redrawnTokenType})
|
||||
end
|
||||
|
||||
chaosTokens[indexOfReturnedToken] = token
|
||||
|
@ -46,7 +46,6 @@ end
|
||||
|
||||
function triggerXMLTokenLabelCreation()
|
||||
-- needs to be its own function in order to pass originParams as a table
|
||||
log(originParams)
|
||||
Global.call("activeRedrawEffect", originParams)
|
||||
end
|
||||
|
||||
|
@ -7,8 +7,6 @@ buttonRotation = "0 0 90"
|
||||
originParams = {
|
||||
triggeringCard = "Wendy",
|
||||
redrawnTokenType = "random",
|
||||
VALID_TOKENS = {},
|
||||
INVALID_TOKENS = {}
|
||||
}
|
||||
|
||||
require("playercards/CardsThatRedrawTokens")
|
Loading…
Reference in New Issue
Block a user