2019-12-18 13:25:51 +02:00
|
|
|
local Public = {}
|
2019-12-20 22:13:50 +02:00
|
|
|
local string_sub = string.sub
|
|
|
|
|
|
|
|
local balance_functions = {
|
2021-03-24 17:46:00 +02:00
|
|
|
['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
|
2019-12-20 22:13:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function Public.research(event)
|
2021-03-24 17:46:00 +02:00
|
|
|
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
|
2019-12-20 22:13:50 +02:00
|
|
|
end
|
2019-12-18 13:25:51 +02:00
|
|
|
|
|
|
|
function Public.fish(event)
|
2021-03-24 17:46:00 +02:00
|
|
|
if event.item.name ~= 'raw-fish' then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
local player = game.players[event.player_index]
|
|
|
|
player.character.health = player.character.health - 80
|
2019-12-18 13:25:51 +02:00
|
|
|
end
|
|
|
|
|
2021-03-24 17:46:00 +02:00
|
|
|
return Public
|