1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-30 04:40:54 +02:00
ComfyFactorio/modules/shotgun_buff.lua
Gerkiz 690c1b6e48 2.0 changes
Change global -> storage
Rework how rendering works
Game prototypes are now stored inside 'prototypes.#'
Renamed entity names
2024-09-24 19:37:11 +02:00

21 lines
764 B
Lua

local function on_research_finished(event)
local research = event.research
if string.sub(research.name, 0, 26) ~= 'physical-projectile-damage' then
return
end
local multiplier = 4
if storage.shotgun_shell_damage_research_multiplier then
multiplier = storage.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)
end
local event = require 'utils.event'
event.add(defines.events.on_research_finished, on_research_finished)