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

View File

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

View File

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