ah_sce_unpacked/unpacked/Checker_black Arkham Deck Cutter 445115.ttslua
2023-04-22 16:56:01 -04:00

79 lines
2.1 KiB
Plaintext

-- 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)
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
require("util/DeckCutter")
end)
__bundle_register("util/DeckCutter", function(require, _LOADED, __bundle_register, __bundle_modules)
-- cut 3 (6) cards from a deck if numpad 1 (2) is pressed
function onScriptingButtonDown(index, player_color)
if not (index >= 1 and index <= 2) then return end
local count = index * 3
local player = Player[player_color]
local object = player.getHoverObject()
if not object then
broadcastToColor("Hover over a deck and try again.", player_color, "Orange")
return
end
if object.tag ~= "Deck" then
broadcastToColor("Hover over a deck and try again.", player_color, "Orange")
return
end
if count >= object.getQuantity() then
broadcastToColor("Deck is too small to cut " .. count .. " cards.", player_color, "Orange")
return
end
local pos = object.positionToWorld(Vector(0, 0, -3.5))
for _ = 1, count do
object.takeObject {
index = 0,
position = pos,
smooth = false
}
end
end
end)
return __bundle_require("__root")