improved code
This commit is contained in:
parent
f190d3ccea
commit
3aa3ebd0cb
@ -48,7 +48,7 @@ Thus it should be implemented like this:
|
||||
> ["+1"] = true,
|
||||
> ["Elder Sign"] = true
|
||||
> }
|
||||
> require ("playercards/CardsThatSealTokens") -- includes a space after "require" to not executing bundling
|
||||
> require...
|
||||
----------------------------------------------------------
|
||||
Example 2: Holy Spear
|
||||
This card features the following abilities (just listing the relevant parts):
|
||||
@ -60,7 +60,8 @@ Thus it should be implemented like this:
|
||||
> }
|
||||
> SHOW_SINGLE_RELEASE = true
|
||||
> SHOW_MULTI_SEAL = 2
|
||||
> require ("playercards/CardsThatSealTokens") -- includes a space after "require" to not executing bundling
|
||||
> require...
|
||||
----------------------------------------------------------]]
|
||||
----------------------------------------------------------]]
|
||||
|
||||
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
|
||||
@ -167,16 +168,12 @@ function sealToken(name, playerColor)
|
||||
end
|
||||
|
||||
-- release the last sealed token
|
||||
function releaseOneToken(playerColor, doPrint)
|
||||
function releaseOneToken(playerColor)
|
||||
if not Global.call("canTouchChaosTokens") then return end
|
||||
if #sealedTokens == 0 then
|
||||
if doPrint or doPrint == nil then
|
||||
printToColor("No sealed token(s) found", playerColor)
|
||||
end
|
||||
else
|
||||
if doPrint or doPrint == nil then
|
||||
printToColor("Releasing token", playerColor)
|
||||
end
|
||||
putTokenAway(table.remove(sealedTokens))
|
||||
end
|
||||
end
|
||||
@ -185,9 +182,9 @@ end
|
||||
function releaseMultipleTokens(playerColor)
|
||||
if SHOW_MULTI_RELEASE <= #sealedTokens then
|
||||
for i = 1, SHOW_MULTI_RELEASE do
|
||||
releaseOneToken(playerColor, false)
|
||||
putTokenAway(table.remove(sealedTokens))
|
||||
end
|
||||
printToColor("Releasing tokens", playerColor)
|
||||
printToColor("Releasing " .. SHOW_MULTI_RELEASE .. " tokens", playerColor)
|
||||
else
|
||||
printToColor("Not enough tokens sealed.", playerColor)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user