Merge branch 'main' into playermat-xml

This commit is contained in:
Chr1Z93 2024-08-02 21:00:49 +02:00
commit d130cc9283
3 changed files with 19 additions and 12 deletions

View File

@ -12,15 +12,15 @@ READING = {
} }
function onLoad() function onLoad()
self.addContextMenuItem("Chaos", chaos, false) self.addContextMenuItem("Chaos", chaos)
self.addContextMenuItem("Balance", balance, false) self.addContextMenuItem("Balance", balance)
self.addContextMenuItem("Choice", choice, false) self.addContextMenuItem("Choice", choice)
self.addContextMenuItem("Destiny (Campaign)", destiny, false) self.addContextMenuItem("Destiny (Campaign)", destiny)
self.addContextMenuItem("Accept Your Fate", fate, false) self.addContextMenuItem("Accept Your Fate", fate)
math.randomseed(os.time()) math.randomseed(os.time())
end end
function chaos(color) function chaos()
self.shuffle() self.shuffle()
self.takeObject({ self.takeObject({
position = self.getPosition() + CARD_OFFSET, position = self.getPosition() + CARD_OFFSET,
@ -29,7 +29,7 @@ function chaos(color)
}) })
end end
function balance(color) function balance()
self.shuffle() self.shuffle()
for i = 1, 2 do for i = 1, 2 do
self.takeObject({ self.takeObject({
@ -66,9 +66,9 @@ end
function fate(color) function fate(color)
local i = 0 local i = 0
for _, tarotName in ipairs(READING) do
for _, card in ipairs(self.getObjects()) do for _, card in ipairs(self.getObjects()) do
for _, reading in ipairs(READING) do if string.match(card.name, tarotName) ~= nil then
if string.match(card.name, reading) ~= nil then
i = i + 1 i = i + 1
self.takeObject({ self.takeObject({
guid = card.guid, guid = card.guid,
@ -76,6 +76,7 @@ function fate(color)
rotation = ORIENTATIONS[1], rotation = ORIENTATIONS[1],
smooth = true smooth = true
}) })
break
end end
end end
end end

View File

@ -390,8 +390,8 @@ function doUpkeep(_, clickedByColor, isRightClick)
return return
end end
-- gain a resource (or two if playing Jenny Barnes) -- gain a resource (or two if playing non-parallel Jenny Barnes)
if string.match(activeInvestigatorData.id, "%d%d%d%d%d") == "02003" then if activeInvestigatorData.id == "02003" or activeInvestigatorData.id == "02003-pb" then
updateCounter({ type = "ResourceCounter", modifier = 2 }) updateCounter({ type = "ResourceCounter", modifier = 2 })
printToColor("Gaining 2 resources (Jenny)", messageColor) printToColor("Gaining 2 resources (Jenny)", messageColor)
else else
@ -1108,6 +1108,8 @@ end
function spawnTokensFor(object) function spawnTokensFor(object)
local extraUses = {} local extraUses = {}
-- add one additional charge for Akachi Onyele
if activeInvestigatorData.id == "03004" then if activeInvestigatorData.id == "03004" then
extraUses["Charge"] = 1 extraUses["Charge"] = 1
end end

View File

@ -43,3 +43,7 @@ end
function onPickUp() function onPickUp()
disable() disable()
end end
function onDestroy()
disable()
end