-
Notifications
You must be signed in to change notification settings - Fork 0
/
balance.lua
109 lines (95 loc) · 2.5 KB
/
balance.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
local combat_technologies =
{
"follower-robot-count",
"combat-robot-damage",
"laser-turret-damage",
"laser-turret-speed",
"bullet-damage",
"bullet-speed",
"shotgun-shell-damage",
"shotgun-shell-speed",
"gun-turret-damage",
"rocket-damage",
"rocket-speed",
"grenade-damage",
"flamethrower-damage"
}
function disable_combat_technologies(force)
if not global.config.unlock_combat_research then return end
local tech = force.technologies
for k, name in pairs (combat_technologies) do
for i = 1, 20 do
local full_name = name.."-"..i
if tech[full_name] then
tech[full_name].researched = false
end
end
end
clear_combat_modifiers(force)
end
function apply_character_modifiers(force)
for name, modifier in pairs (global.modifier_list.character_modifiers) do
force[name] = modifier
end
end
global.modifier_list =
{
["character_modifiers"] =
{
["character_running_speed_modifier"] = 0.3,
["character_health_bonus"] = 100
},
["turret_attack_modifier"] =
{
["laser-turret"] = -0.5,
["gun-turret"] = -0.5,
["flamethrower-turret"] = -0.5
},
["ammo_damage_modifier"] =
{
["bullet"] = 0.5,
["shotgun-shell"] = 0,
["cannon-shell"] = 0.5,
["rocket"] = 0.5,
["flame-thrower"] = -0.3,
["grenade"] = -0.3,
["combat-robot-beam"] = 0,
["combat-robot-laser"] = 0,
["laser-turret"] = 0
},
["gun_speed_modifier"] =
{
["bullet"] = 0,
["shotgun-shell"] = 0,
["cannon-shell"] = 0.5,
["rocket"] = 0,
["flame-thrower"] = 0,
["laser-turret"] = 0
}
}
function apply_combat_modifiers(force)
for name, modifier in pairs (global.modifier_list.turret_attack_modifier) do
force.set_turret_attack_modifier(name, modifier)
end
for name, modifier in pairs (global.modifier_list.ammo_damage_modifier) do
force.set_ammo_damage_modifier(name, modifier)
end
for name, modifier in pairs (global.modifier_list.gun_speed_modifier) do
force.set_gun_speed_modifier(name, modifier)
end
end
function clear_combat_modifiers(force)
for name, modifier in pairs (global.modifier_list.turret_attack_modifier) do
force.set_turret_attack_modifier(name, 0)
end
for name, modifier in pairs (global.modifier_list.ammo_damage_modifier) do
force.set_ammo_damage_modifier(name, 0)
end
for name, modifier in pairs (global.modifier_list.gun_speed_modifier) do
force.set_gun_speed_modifier(name, 0)
end
end
function apply_balance(force)
apply_character_modifiers(force)
apply_combat_modifiers(force)
end