fixes
This commit is contained in:
parent
16948afebe
commit
d8fd9cbb58
@ -2136,10 +2136,10 @@ function TokenManager.spawnMultipleTokens(card, tokenType, tokenCount, shiftDown
|
||||
local matColor = playermatApi.getMatColorByPosition(card.getPosition())
|
||||
local activeInvestigatorData = playermatApi.getActiveInvestigatorData(matColor)
|
||||
callbackName = "updateUniversalActionAbilityToken"
|
||||
callbackParams = { class = activeInvestigatorData.class, symbol = subType or activeInvestigatorData.class}
|
||||
|
||||
if temporary then
|
||||
callbackParams = { class = activeInvestigatorData.class, symbol = subType or activeInvestigatorData.class, addTag = "Temporary" }
|
||||
else
|
||||
callbackParams = { class = activeInvestigatorData.class, symbol = subType or activeInvestigatorData.class}
|
||||
callbackParams.addTag = "Temporary"
|
||||
end
|
||||
end
|
||||
|
||||
@ -2525,6 +2525,7 @@ function TokenManager.addUseToCard(params)
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- generates the data to spawn an infinite bag of a specific type of resources
|
||||
function TokenManager.getDataForInfiniteBag(params)
|
||||
|
@ -1,9 +1,7 @@
|
||||
require("playercards/CardsWithHelper")
|
||||
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||
local playermatApi = require("playermat/PlayermatApi")
|
||||
local searchLib = require("util/SearchLib")
|
||||
local tokenManagerApi = require("core/token/TokenManagerApi")
|
||||
|
||||
local tokenManagerApi = require("core/token/TokenManagerApi")
|
||||
|
||||
-- intentionally global
|
||||
hasXML = true
|
||||
@ -30,16 +28,17 @@ end
|
||||
|
||||
function addCharge(player)
|
||||
tokenManagerApi.addUseToCard(self, "resource")
|
||||
Wait.frames(function() local foundTokens = searchSelfForTokens()
|
||||
if foundTokens == 3 then
|
||||
addAction(player)
|
||||
end
|
||||
Wait.frames(function()
|
||||
local foundTokens = searchSelfForTokens()
|
||||
if foundTokens == 3 then
|
||||
addAction(player)
|
||||
end
|
||||
end, 5)
|
||||
end
|
||||
|
||||
function searchSelfForTokens()
|
||||
clickableResourceCounter = nil
|
||||
foundTokens = 0
|
||||
local foundTokens = 0
|
||||
|
||||
for _, obj in ipairs(searchLib.onObject(self, "isTileOrToken", 0.8)) do
|
||||
local memo = obj.getMemo()
|
||||
@ -55,7 +54,7 @@ function searchSelfForTokens()
|
||||
end
|
||||
|
||||
function takeAll(player)
|
||||
foundTokens = searchSelfForTokens()
|
||||
local foundTokens = searchSelfForTokens()
|
||||
local matColor = playermatApi.getMatColorByPosition(self.getPosition())
|
||||
playermatApi.updateCounter(matColor, "ResourceCounter", _, foundTokens)
|
||||
|
||||
|
@ -18,14 +18,12 @@
|
||||
active="false">
|
||||
<Row>
|
||||
<Cell>
|
||||
<Button id="Resources"
|
||||
onClick="takeAll"
|
||||
<Button onClick="takeAll"
|
||||
color="#173B0BE6"
|
||||
text="Take"/>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Button id="Charges"
|
||||
onClick="addCharge"
|
||||
<Button onClick="addCharge"
|
||||
color="#77674DE6"
|
||||
text="Place"/>
|
||||
</Cell>
|
||||
|
Loading…
x
Reference in New Issue
Block a user