fixed "Accept your Fate" tarot reading

This commit is contained in:
Chr1Z93 2024-08-02 10:01:01 +02:00
parent 1b03926cb2
commit 1faacc2128

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 _, card in ipairs(self.getObjects()) do
for _, reading in ipairs(READING) do
if string.match(card.name, reading) ~= nil then
for _, tarotName in ipairs(READING) do
for _, card in ipairs(self.getObjects()) do
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