1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-10 00:43:27 +02:00
ComfyFactorio/modules/flamethrower_nerf.lua

23 lines
1.1 KiB
Lua
Raw Normal View History

2019-11-09 00:53:16 +02:00
--Flamethrower Turret Nerf
local function on_research_finished(event)
2021-03-24 17:46:00 +02:00
local research = event.research
local force_name = research.force.name
if research.name == 'military' then
if not global.flamethrower_damage then
global.flamethrower_damage = {}
end
global.flamethrower_damage[force_name] = -0.50
game.forces[force_name].set_turret_attack_modifier('flamethrower-turret', global.flamethrower_damage[force_name])
game.forces[force_name].set_ammo_damage_modifier('flamethrower', global.flamethrower_damage[force_name])
end
2019-11-09 00:53:16 +02:00
2021-03-24 17:46:00 +02:00
if string.sub(research.name, 0, 18) == 'refined-flammables' then
global.flamethrower_damage[force_name] = global.flamethrower_damage[force_name] + 0.10
game.forces[force_name].set_turret_attack_modifier('flamethrower-turret', global.flamethrower_damage[force_name])
game.forces[force_name].set_ammo_damage_modifier('flamethrower', global.flamethrower_damage[force_name])
end
2019-11-09 00:53:16 +02:00
end
local event = require 'utils.event'
2020-05-06 14:59:23 +02:00
event.add(defines.events.on_research_finished, on_research_finished)