1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-08 00:39:30 +02:00
ComfyFactorio/modules/towny/combat_balance.lua
2021-03-24 16:46:00 +01:00

35 lines
926 B
Lua

local Public = {}
local string_sub = string.sub
local balance_functions = {
['land-mine'] = function(force_name)
game.forces[force_name].set_ammo_damage_modifier('landmine', -0.6)
end,
['stronger-explosives'] = function(force_name)
game.forces[force_name].set_ammo_damage_modifier('landmine', -0.6)
end
}
function Public.research(event)
local research_name = event.research.name
local force_name = event.research.force.name
local key
for b = 1, string.len(research_name), 1 do
key = string_sub(research_name, 0, b)
if balance_functions[key] then
balance_functions[key](force_name)
return
end
end
end
function Public.fish(event)
if event.item.name ~= 'raw-fish' then
return
end
local player = game.players[event.player_index]
player.character.health = player.character.health - 80
end
return Public