forked from UberWaffe/ScienceCostTweaker
-
Notifications
You must be signed in to change notification settings - Fork 17
/
control.lua
43 lines (39 loc) · 1.66 KB
/
control.lua
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
local sct = {}
sct.unlockstart = function(playerforce)
-- log(serpent.block(playerforce.technologies["sct-lab-t1"]))
if
playerforce.technologies["sct-lab-t1"] and
playerforce.technologies["sct-lab-t1"].valid and
playerforce.technologies["sct-lab-t1"].enabled and (
playerforce.technologies["sct-lab-t1"].researched == false and (
not playerforce.technologies["sct-lab-t1"].prerequisites or
table_size(playerforce.technologies["sct-lab-t1"].prerequisites) == 0
)
)
then
playerforce.technologies["sct-lab-t1"].researched = true
end
-- log(serpent.block(playerforce.technologies["sct-automation-science-pack"]))
if
playerforce.technologies["sct-automation-science-pack"] and
playerforce.technologies["sct-automation-science-pack"].valid and
playerforce.technologies["sct-automation-science-pack"].enabled and (
not playerforce.technologies["sct-automation-science-pack"].researched and (
not playerforce.technologies["sct-automation-science-pack"].prerequisites or
table_size(playerforce.technologies["sct-automation-science-pack"].prerequisites) == 0 or (
table_size(playerforce.technologies["sct-automation-science-pack"].prerequisites) == 1 and
playerforce.technologies["sct-automation-science-pack"].prerequisites["sct-lab-t1"] and
playerforce.technologies["sct-lab-t1"].researched
)
)
)
then
playerforce.technologies["sct-automation-science-pack"].researched = true
end
end
script.on_event(defines.events.on_player_joined_game, function(e)
sct.unlockstart(game.players[e.player_index].force)
end)
script.on_event(defines.events.on_player_created, function(e)
sct.unlockstart(game.players[e.player_index].force)
end)