Merge pull request #801 from argonui/investigator-data-bugfix

Bugfix for getting investigator data
This commit is contained in:
dscarpac 2024-08-03 12:26:43 -05:00 committed by GitHub
commit 73014a03bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 7 deletions

View File

@ -245,9 +245,15 @@ do
if tokenType == "resource" and stateID ~= nil and stateID ~= 1 then if tokenType == "resource" and stateID ~= nil and stateID ~= 1 then
callback = function(spawned) spawned.setState(stateID) end callback = function(spawned) spawned.setState(stateID) end
elseif tokenType == "universalActionAbility" then elseif tokenType == "universalActionAbility" then
local matColor = playermatApi.getMatColorByPosition(card.getPosition()) callback = function(spawned)
local class = playermatApi.returnInvestigatorClass(matColor) local matColor = playermatApi.getMatColorByPosition(card.getPosition())
callback = function(spawned) spawned.call("updateClassAndSymbol", { class = class, symbol = subType or class }) end local activeInvestigatorData = playermatApi.getActiveInvestigatorData(matColor)
spawned.call("updateClassAndSymbol", {
class = activeInvestigatorData.class,
symbol = subType or activeInvestigatorData.class
})
end
end end
for i = 1, tokenCount do for i = 1, tokenCount do

View File

@ -66,12 +66,16 @@ function onScriptingButtonDown(index, playerColor)
-- check for nearest investigator card and change action token state to its class -- check for nearest investigator card and change action token state to its class
elseif tokenType == "universalActionAbility" then elseif tokenType == "universalActionAbility" then
local matColor = playermatApi.getMatColorByPosition(position)
local matRotation = playermatApi.returnRotation(matColor)
local class = playermatApi.returnInvestigatorClass(matColor)
callback = function(spawned) callback = function(spawned)
local matColor = playermatApi.getMatColorByPosition(position)
local matRotation = playermatApi.returnRotation(matColor)
local activeInvestigatorData = playermatApi.getActiveInvestigatorData(matColor)
spawned.setRotation(matRotation) spawned.setRotation(matRotation)
spawned.call("updateClassAndSymbol", { class = class, symbol = class }) spawned.call("updateClassAndSymbol", {
class = activeInvestigatorData.class,
symbol = activeInvestigatorData.class
})
end end
end end