2020-05-17 12:23:55 +02:00
|
|
|
local Event = require 'utils.event'
|
2020-10-30 23:05:05 +02:00
|
|
|
local Difficulty = require 'modules.difficulty_vote_by_amount'
|
2020-06-25 17:59:16 +02:00
|
|
|
|
2020-05-17 12:23:55 +02:00
|
|
|
local Public = {}
|
2020-06-25 17:59:16 +02:00
|
|
|
|
2020-05-23 21:18:18 +02:00
|
|
|
Public.events = {breached_wall = Event.generate_event_name('breached_wall')}
|
2020-05-17 12:23:55 +02:00
|
|
|
|
|
|
|
function Public.init_enemy_weapon_damage()
|
|
|
|
local data = {
|
2020-07-28 11:24:16 +02:00
|
|
|
['artillery-shell'] = -1.3,
|
2020-06-03 20:09:00 +02:00
|
|
|
['biological'] = 0,
|
2021-05-16 14:42:15 +02:00
|
|
|
['beam'] = 0,
|
2020-06-03 20:09:00 +02:00
|
|
|
['bullet'] = 0,
|
2020-05-17 12:23:55 +02:00
|
|
|
['cannon-shell'] = 0,
|
|
|
|
['capsule'] = 0,
|
|
|
|
['electric'] = 0,
|
|
|
|
['flamethrower'] = 0,
|
|
|
|
['grenade'] = 0,
|
2021-05-16 14:42:15 +02:00
|
|
|
['laser'] = 0,
|
2020-05-17 12:23:55 +02:00
|
|
|
['landmine'] = 0,
|
2020-06-03 20:09:00 +02:00
|
|
|
['melee'] = 0,
|
2020-05-17 12:23:55 +02:00
|
|
|
['rocket'] = 0,
|
|
|
|
['shotgun-shell'] = 0
|
|
|
|
}
|
|
|
|
|
|
|
|
local e = game.forces.enemy
|
|
|
|
|
2020-06-03 20:09:00 +02:00
|
|
|
e.technologies['refined-flammables-1'].researched = true
|
|
|
|
e.technologies['refined-flammables-2'].researched = true
|
|
|
|
e.technologies['energy-weapons-damage-1'].researched = true
|
|
|
|
|
2020-05-17 12:23:55 +02:00
|
|
|
for k, v in pairs(data) do
|
|
|
|
e.set_ammo_damage_modifier(k, v)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
local function enemy_weapon_damage()
|
|
|
|
local e = game.forces.enemy
|
|
|
|
|
|
|
|
local data = {
|
2020-10-29 14:07:42 +02:00
|
|
|
['artillery-shell'] = 0.05,
|
2021-02-01 00:59:49 +02:00
|
|
|
['biological'] = 0.06,
|
2021-05-16 14:42:15 +02:00
|
|
|
['beam'] = 0.08,
|
2020-05-23 21:18:18 +02:00
|
|
|
['bullet'] = 0.08,
|
|
|
|
['capsule'] = 0.08,
|
|
|
|
['electric'] = 0.08,
|
|
|
|
['flamethrower'] = 0.08,
|
2021-05-16 14:42:15 +02:00
|
|
|
['laser'] = 0.08,
|
2020-06-03 20:09:00 +02:00
|
|
|
['landmine'] = 0.08,
|
2020-05-23 21:18:18 +02:00
|
|
|
['melee'] = 0.08
|
2020-05-17 12:23:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for k, v in pairs(data) do
|
2020-06-25 17:59:16 +02:00
|
|
|
local new = Difficulty.get().difficulty_vote_value * v
|
2020-05-17 12:23:55 +02:00
|
|
|
|
|
|
|
local e_old = e.get_ammo_damage_modifier(k)
|
|
|
|
|
|
|
|
e.set_ammo_damage_modifier(k, new + e_old)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-05-23 21:18:18 +02:00
|
|
|
Event.add(Public.events.breached_wall, enemy_weapon_damage)
|
|
|
|
|
2020-05-17 12:23:55 +02:00
|
|
|
return Public
|