1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-16 02:47:48 +02:00
ComfyFactorio/modules/flamethrower_nerf.lua
Gerkiz e91b6a352f 2.0 changes
Change global -> storage
Rework how rendering works
Game prototypes are now stored inside 'prototypes.#'
Renamed entity names
2024-10-22 21:47:11 +02:00

23 lines
1.1 KiB
Lua

--Flamethrower Turret Nerf
local function on_research_finished(event)
local research = event.research
local force_name = research.force.name
if research.name == 'military' then
if not storage.flamethrower_damage then
storage.flamethrower_damage = {}
end
storage.flamethrower_damage[force_name] = -0.50
game.forces[force_name].set_turret_attack_modifier('flamethrower-turret', storage.flamethrower_damage[force_name])
game.forces[force_name].set_ammo_damage_modifier('flamethrower', storage.flamethrower_damage[force_name])
end
if string.sub(research.name, 0, 18) == 'refined-flammables' then
storage.flamethrower_damage[force_name] = storage.flamethrower_damage[force_name] + 0.10
game.forces[force_name].set_turret_attack_modifier('flamethrower-turret', storage.flamethrower_damage[force_name])
game.forces[force_name].set_ammo_damage_modifier('flamethrower', storage.flamethrower_damage[force_name])
end
end
local event = require 'utils.event'
event.add(defines.events.on_research_finished, on_research_finished)