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
callback = function(spawned) spawned.setState(stateID) end
elseif tokenType == "universalActionAbility" then
local matColor = playermatApi.getMatColorByPosition(card.getPosition())
local class = playermatApi.returnInvestigatorClass(matColor)
callback = function(spawned) spawned.call("updateClassAndSymbol", { class = class, symbol = subType or class }) end
callback = function(spawned)
local matColor = playermatApi.getMatColorByPosition(card.getPosition())
local activeInvestigatorData = playermatApi.getActiveInvestigatorData(matColor)
spawned.call("updateClassAndSymbol", {
class = activeInvestigatorData.class,
symbol = subType or activeInvestigatorData.class
})
end
end
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
elseif tokenType == "universalActionAbility" then
local matColor = playermatApi.getMatColorByPosition(position)
local matRotation = playermatApi.returnRotation(matColor)
local class = playermatApi.returnInvestigatorClass(matColor)
callback = function(spawned)
local matColor = playermatApi.getMatColorByPosition(position)
local matRotation = playermatApi.returnRotation(matColor)
local activeInvestigatorData = playermatApi.getActiveInvestigatorData(matColor)
spawned.setRotation(matRotation)
spawned.call("updateClassAndSymbol", { class = class, symbol = class })
spawned.call("updateClassAndSymbol", {
class = activeInvestigatorData.class,
symbol = activeInvestigatorData.class
})
end
end