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)
|
|
|
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
|
|
require("playercards/RandomWeaknessGenerator")
|
|
|
|
end)
|
|
|
|
__bundle_register("playercards/RandomWeaknessGenerator", function(require, _LOADED, __bundle_register, __bundle_modules)
|
2021-10-18 15:54:27 -04:00
|
|
|
local allCardsBagGuid = "15bb07"
|
|
|
|
|
|
|
|
function onLoad(saved_data)
|
|
|
|
createDrawButton()
|
|
|
|
end
|
|
|
|
|
|
|
|
function createDrawButton()
|
|
|
|
self.createButton({
|
|
|
|
label="Draw Random\nWeakness", click_function="buttonClick_draw", function_owner=self,
|
|
|
|
position={0,0.1,2.1}, rotation={0,0,0}, height=600, width=1800,
|
|
|
|
font_size=250, color={0,0,0}, font_color={1,1,1}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Draw a random weakness and spawn it below the object
|
|
|
|
function buttonClick_draw()
|
|
|
|
local allCardsBag = getObjectFromGUID(allCardsBagGuid)
|
|
|
|
local weaknessId = allCardsBag.call("getRandomWeaknessId")
|
2022-03-27 10:12:31 -04:00
|
|
|
if (weaknessId == nil) then
|
|
|
|
broadcastToAll("All basic weaknesses are in play!", {0.9, 0.2, 0.2})
|
|
|
|
return
|
|
|
|
end
|
2021-10-18 15:54:27 -04:00
|
|
|
local card = allCardsBag.call("getCardById", { id = weaknessId })
|
|
|
|
spawnObjectData({
|
|
|
|
data = card.data,
|
|
|
|
position = self.positionToWorld({0, 1, 5.5}),
|
|
|
|
rotation = self.getRotation()})
|
2022-12-13 14:02:30 -05:00
|
|
|
end
|
|
|
|
end)
|
|
|
|
return __bundle_require("__root")
|