This commit is contained in:
dscarpac 2024-10-05 10:23:14 -05:00
parent 16948afebe
commit d8fd9cbb58
3 changed files with 14 additions and 16 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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>