ah_sce_unpacked/unpacked/Bag Tarot Deck (Scripted) a230f9.ttslua

132 lines
3.3 KiB
Plaintext
Raw Normal View History

2022-12-13 14:02:30 -05:00
-- Bundled by luabundle {"version":"1.6.0"}
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
local loadingPlaceholder = {[{}] = true}
local register
local modules = {}
local require
local loaded = {}
register = function(name, body)
if not modules[name] then
modules[name] = body
end
end
require = function(name)
local loadedModule = loaded[name]
if loadedModule then
if loadedModule == loadingPlaceholder then
return nil
end
else
if not modules[name] then
if not superRequire then
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
error('Tried to require ' .. identifier .. ', but no such module has been registered')
else
return superRequire(name)
end
end
loaded[name] = loadingPlaceholder
loadedModule = modules[name](require, loaded, register, modules)
loaded[name] = loadedModule
end
return loadedModule
end
return require, loaded, register, modules
end)(nil)
2023-01-29 19:31:52 -05:00
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
require("playercards/ScriptedTarot")
end)
2022-12-13 14:02:30 -05:00
__bundle_register("playercards/ScriptedTarot", function(require, _LOADED, __bundle_register, __bundle_modules)
2023-08-27 21:09:46 -04:00
CARD_OFFSET = Vector(0, 0.1, -2)
2021-07-12 15:49:54 -04:00
ORIENTATIONS = { {0, 270, 0}, { 0, 90, 0} }
READING = {
2023-08-27 21:09:46 -04:00
"Temperance",
"Justice",
"Hermit",
"Hanged Man",
"Hierophant",
"Lovers",
"Chariot",
"Wheel of Fortune"
2021-07-12 15:49:54 -04:00
}
function onLoad()
2023-08-27 21:09:46 -04:00
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)
math.randomseed(os.time())
2021-07-12 15:49:54 -04:00
end
function chaos(color)
2023-08-27 21:09:46 -04:00
self.shuffle()
self.takeObject({
position = self.getPosition() + CARD_OFFSET,
rotation = ORIENTATIONS[math.random(2)],
smooth = true
})
2021-07-12 15:49:54 -04:00
end
function balance(color)
2023-08-27 21:09:46 -04:00
self.shuffle()
for i = 1, 2 do
2021-07-12 15:49:54 -04:00
self.takeObject({
2023-08-27 21:09:46 -04:00
position = self.getPosition() + i * CARD_OFFSET,
rotation = ORIENTATIONS[i],
smooth = true
2021-07-12 15:49:54 -04:00
})
2023-08-27 21:09:46 -04:00
end
2021-07-12 15:49:54 -04:00
end
function choice(color)
2023-08-27 21:09:46 -04:00
self.shuffle()
for i = 1, 3 do
self.takeObject({
position = self.getPosition() + i * CARD_OFFSET,
rotation = ORIENTATIONS[1],
smooth = true
})
end
broadcastToColor("Choose and reverse two of the cards.", color)
2021-07-12 15:49:54 -04:00
end
function destiny(color)
2023-08-27 21:09:46 -04:00
self.shuffle()
for i = 1, 8 do
self.takeObject({
position = self.getPosition() + i * CARD_OFFSET,
rotation = ORIENTATIONS[1],
smooth = true
})
end
broadcastToColor("Each card corresponds to one scenario, leftmost is first. Choose and reverse half of the cards (rounded up).", color)
2021-07-12 15:49:54 -04:00
end
function fate(color)
2023-08-27 21:09:46 -04:00
local i = 0
for _, card in ipairs(self.getObjects()) do
for _, reading in ipairs(READING) do
if string.match(card.name, reading) ~= nil then
i = i + 1
2021-07-12 15:49:54 -04:00
self.takeObject({
2023-08-27 21:09:46 -04:00
guid = card.guid,
position = self.getPosition() + i * CARD_OFFSET,
rotation = ORIENTATIONS[1],
smooth = true
2021-07-12 15:49:54 -04:00
})
2023-08-27 21:09:46 -04:00
end
2021-07-12 15:49:54 -04:00
end
2023-08-27 21:09:46 -04:00
end
broadcastToColor("Each card corresponds to one scenario, leftmost is first. Choose and reverse half of the cards (rounded up).", color)
2022-12-13 14:02:30 -05:00
end
end)
return __bundle_require("__root")