ah_sce_unpacked/unpacked/Bag Tarot Deck (Scripted) a230f9/Card The Chariot · VII f633db.ttslua

72 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

2023-08-27 21:09:46 -04: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)
2024-02-04 10:51:51 -05:00
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
require("playercards/Tarotcard")
end)
2023-08-27 21:09:46 -04:00
__bundle_register("playercards/Tarotcard", function(require, _LOADED, __bundle_register, __bundle_modules)
-- context menu to manually fix rotation
function onLoad()
self.addContextMenuItem("Rotate Preview", rotatePreview)
self.addContextMenuItem("Rotate Card+Preview", rotateSelfAndPreview)
end
-- rotates the alt_view_angle
2024-07-27 21:47:52 -04:00
function rotatePreview(playerColor)
Player[playerColor].clearSelectedObjects()
2023-08-27 21:09:46 -04:00
local angle = self.alt_view_angle
if angle.y == 0 then
angle.y = 180
else
angle.y = 0
end
self.alt_view_angle = angle
end
-- rotates this card and the preview
2024-07-27 21:47:52 -04:00
function rotateSelfAndPreview(playerColor)
2023-08-27 21:09:46 -04:00
self.setRotationSmooth(self.getRotation() + Vector(0, 180, 0))
2024-07-27 21:47:52 -04:00
rotatePreview(playerColor)
2023-08-27 21:09:46 -04:00
end
end)
return __bundle_require("__root")