-
Notifications
You must be signed in to change notification settings - Fork 1
/
AllLib.ttslua
46 lines (40 loc) · 1.32 KB
/
AllLib.ttslua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
replace_guids = {
'5997ea', -- hitler deck
'5f2055','fb58cf', '4a3cf4', -- fascist decks
'b156f7', 'd1735a', 'c8ab2a', 'b2873d', '313939', '40d8f5' -- liberal decks
}
function onLoad(saveString)
local parameters = {}
parameters.identifier = 'setupExtraOption' .. self.getGUID()
parameters.function_name = 'setupExtraOption'
parameters.function_owner = self
parameters.delay = 0.1
Timer.create(parameters)
end
function setupExtraOption()
local global_name = Global.getVar('MOD_NAME')
local started = Global.getVar('started')
if global_name ~= 'Secret Hitler: CE' then
printToAll('ERROR: Secret Hitler: CE not found.', {1,0,0})
else
if started then
printToAll('ERROR: Can not add this option. Game has already started.', {1,0,0})
else
self.setPosition({0, 100, 0})
local objGUID
local tmpObj
local params = {}
for _, objGUID in ipairs(replace_guids) do
local tmpObj = getObjectFromGUID(objGUID)
params.rotation = tmpObj.getRotation()
params.position = tmpObj.getPosition()
destroyObject(tmpObj)
tmpObj = self.takeObject(params)
tmpObj.setLock(true)
tmpObj.interactable = false
end
Global.setVar('game_mode', 'all_lib')
destroyObject(self)
end
end
end