1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-24 03:47:58 +02:00
ComfyFactorio/maps/biter_battles_v2/combat_balance.lua

45 lines
2.1 KiB
Lua
Raw Normal View History

2020-01-02 16:09:24 +01:00
local Public = {}
2019-12-17 12:50:42 +01:00
local string_sub = string.sub
local balance_functions = {
["flamethrower"] = function(force_name)
global.combat_balance[force_name].flamethrower_damage = -0.6
game.forces[force_name].set_turret_attack_modifier("flamethrower-turret", global.combat_balance[force_name].flamethrower_damage)
game.forces[force_name].set_ammo_damage_modifier("flamethrower", global.combat_balance[force_name].flamethrower_damage)
end,
["refined-flammables"] = function(force_name)
global.combat_balance[force_name].flamethrower_damage = global.combat_balance[force_name].flamethrower_damage + 0.05
game.forces[force_name].set_turret_attack_modifier("flamethrower-turret", global.combat_balance[force_name].flamethrower_damage)
game.forces[force_name].set_ammo_damage_modifier("flamethrower", global.combat_balance[force_name].flamethrower_damage)
end,
["land-mine"] = function(force_name)
2019-12-24 12:43:47 +01:00
if not global.combat_balance[force_name].land_mine then global.combat_balance[force_name].land_mine = -0.75 end
2019-12-17 12:50:42 +01:00
game.forces[force_name].set_ammo_damage_modifier("landmine", global.combat_balance[force_name].land_mine)
end,
["stronger-explosives"] = function(force_name)
2019-12-24 12:43:47 +01:00
if not global.combat_balance[force_name].land_mine then global.combat_balance[force_name].land_mine = -0.75 end
2019-12-17 12:50:42 +01:00
global.combat_balance[force_name].land_mine = global.combat_balance[force_name].land_mine + 0.05
game.forces[force_name].set_ammo_damage_modifier("landmine", global.combat_balance[force_name].land_mine)
end,
["military"] = function(force_name)
global.combat_balance[force_name].shotgun = 1
game.forces[force_name].set_ammo_damage_modifier("shotgun-shell", global.combat_balance[force_name].shotgun)
end,
}
2020-01-02 16:09:24 +01:00
function Public.research_finished(event)
2019-12-17 12:50:42 +01: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
if not global.combat_balance[force_name] then global.combat_balance[force_name] = {} end
balance_functions[key](force_name)
return
end
end
end
2020-01-02 16:09:24 +01:00
return Public