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

21 lines
762 B
Lua
Raw Normal View History

2019-10-25 08:09:39 +02:00
local function on_research_finished(event)
2021-03-24 17:46:00 +02:00
local research = event.research
if string.sub(research.name, 0, 26) ~= 'physical-projectile-damage' then
return
end
local multiplier = 4
if global.shotgun_shell_damage_research_multiplier then
multiplier = global.shotgun_shell_damage_research_multiplier
end
local modifier = game.forces[research.force.name].get_ammo_damage_modifier('shotgun-shell')
modifier = modifier - research.effects[3].modifier
modifier = modifier + research.effects[3].modifier * multiplier
game.forces[research.force.name].set_ammo_damage_modifier('shotgun-shell', modifier)
2019-10-25 08:09:39 +02:00
end
local event = require 'utils.event'
2021-03-24 17:46:00 +02:00
event.add(defines.events.on_research_finished, on_research_finished)