File size: 4,814 Bytes
898c672
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
local to_effect = function(effects)
  local result = {}
  for k, effect in pairs (effects) do
    local type = effect.type
    if type == "ammo-damage" then
      result[k] = function(force)
        force.set_ammo_damage_modifier(effect.ammo_category, force.get_ammo_damage_modifier(effect.ammo_category) + effect.modifier)
      end
    elseif type == "turret-attack" then
      result[k] = function(force)
        force.set_turret_attack_modifier(effect.turret_id, force.get_turret_attack_modifier(effect.turret_id) + effect.modifier)
      end
    elseif type == "gun-speed" then
      result[k] = function(force)
        force.set_gun_speed_modifier(effect.ammo_category, force.get_gun_speed_modifier(effect.ammo_category) + effect.modifier)
      end
    elseif type == "maximum-following-robots-count" then
      result[k] = function(force)
        force.maximum_following_robot_count = force.maximum_following_robot_count + effect.modifier
      end
    elseif type == "mining-drill-productivity-bonus" then
      result[k] = function(force)
        force.mining_drill_productivity_bonus = force.mining_drill_productivity_bonus + effect.modifier
      end
    else error(type.." - This type has no relevant upgrade effect") end
  end
  return result
end

local floor = math.floor

local upgrades = {}

upgrades.physical_projectile_damage =
{
  modifier = "+10%",
  sprite = "technology/physical-projectile-damage-7",
  caption = {"technology-name.physical-projectile-damage"},
  price = function(x) return floor((1 + x)) * 250 end,
  effect = to_effect(
  {
    {
      type = "ammo-damage",
      ammo_category = "bullet",
      modifier = 0.1
    },
    {
      type = "turret-attack",
      turret_id = "gun-turret",
      modifier = 0.1
    },
    {
      type = "ammo-damage",
      ammo_category = "shotgun-shell",
      modifier = 0.1
    },
    {
      type = "ammo-damage",
      ammo_category = "cannon-shell",
      modifier = 0.1
    }
  })
}

upgrades.weapon_shooting_speed =
{
  modifier = "+10%",
  sprite = "technology/weapon-shooting-speed-4",
  caption = {"technology-name.weapon-shooting-speed"},
  price = function(x) return floor((1 + x)) * 250 end,
  effect = to_effect(
  {
    {
      type = "gun-speed",
      ammo_category = "bullet",
      modifier = 0.1
    },
    {
      type = "gun-speed",
      ammo_category = "shotgun-shell",
      modifier = 0.1
    },
    {
      type = "gun-speed",
      ammo_category = "rocket",
      modifier = 0.1
    }
  })
}

upgrades.stronger_explosives =
{
  modifier = "+25%",
  sprite = "technology/stronger-explosives-7",
  caption = {"technology-name.stronger-explosives"},
  price = function(x) return floor((1 + x)) * 250 end,
  effect = to_effect(
  {
    {
      type = "ammo-damage",
      ammo_category = "rocket",
      modifier = 0.25
    },
    {
      type = "ammo-damage",
      ammo_category = "grenade",
      modifier = 0.25
    },
    {
      type = "ammo-damage",
      ammo_category = "landmine",
      modifier = 0.25
    }
  })
}

upgrades.refined_flammables =
{
  modifier = "+10%",
  sprite = "technology/refined-flammables-3",
  caption = {"technology-name.refined-flammables"},
  price = function(x) return floor((1 + x)) * 500 end,
  effect = to_effect(
  {
    {
      type = "ammo-damage",
      ammo_category = "flamethrower",
      modifier = 0.1
    },
    {
      type = "turret-attack",
      turret_id = "flamethrower-turret",
      modifier = 0.1
    }
  })
}

upgrades.energy_weapons_damage =
{
  modifier = "+20%",
  sprite = "technology/energy-weapons-damage-4",
  caption = {"technology-name.energy-weapons-damage"},
  price = function(x) return floor((1 + x)) * 250 end,
  effect = to_effect(
  {
    {
      type = "ammo-damage",
      ammo_category = "laser",
      modifier = 0.2
    }
  })
}

upgrades.laser_turret_shooting_speed =
{
  modifier = "+10%",
  sprite = "technology/laser-shooting-speed-6",
  caption = {"technology-name.laser-shooting-speed"},
  price = function(x) return floor((1 + x)) * 250 end,
  effect = to_effect(
  {
    {
      type = "gun-speed",
      ammo_category = "laser",
      modifier = 0.1
    }
  })
}

upgrades.mining_productivity =
{
  modifier = "+10%",
  sprite = "technology/mining-productivity-1",
  caption = {"technology-name.mining-productivity"},
  price = function(x) return floor((1 + x)) * 500 end,
  effect = to_effect(
  {
    {
      type = "mining-drill-productivity-bonus",
      modifier = 0.1
    }
  })
}

upgrades.following_robot_count =
{
  modifier = "+5",
  sprite = "technology/follower-robot-count-1",
  caption = {"technology-name.follower-robot-count"},
  price = function(x) return floor((1 + x)) * 100 end,
  effect = to_effect(
  {
    {
      type = "maximum-following-robots-count",
      modifier = 5
    }
  })
}

return upgrades