mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-08 00:39:30 +02:00
balancing
This commit is contained in:
parent
353fc4ad38
commit
e603d1a655
@ -126,14 +126,28 @@ ai.main_attack = function()
|
||||
end
|
||||
end
|
||||
|
||||
--Prevent Players from damaging Rocket Silos
|
||||
local function protect_silo(event)
|
||||
if event.cause then
|
||||
if event.cause.type == "unit" then return end
|
||||
end
|
||||
if event.entity.name ~= "rocket-silo" then return end
|
||||
event.entity.health = event.entity.health + event.final_damage_amount
|
||||
end
|
||||
|
||||
--Biter Evasion
|
||||
local function on_entity_damaged(event)
|
||||
local function evade(event)
|
||||
if not event.entity.valid then return end
|
||||
if event.entity.type ~= "unit" then return end
|
||||
if global.bb_evasion[event.entity.force.name] < math_random(1,1000) then return end
|
||||
event.entity.health = event.entity.health + event.final_damage_amount
|
||||
end
|
||||
|
||||
local function on_entity_damaged(event)
|
||||
evade(event)
|
||||
protect_silo(event)
|
||||
end
|
||||
|
||||
--Biter Threat Value Substraction
|
||||
local function on_entity_died(event)
|
||||
if not event.entity.valid then return end
|
||||
|
@ -59,29 +59,31 @@ local function feed_biters(player, food)
|
||||
for a = 1, flask_amount, 1 do
|
||||
--SET THREAT INCOME
|
||||
local e = (global.bb_evolution[biter_force_name] * 100) + 1
|
||||
--local diminishing_modifier = 1 / (10 ^ (e * 0.03))
|
||||
local diminishing_modifier = (1 / (10 ^ (e * 0.014))) / (e * 0.5)
|
||||
global.bb_threat_income[biter_force_name] = global.bb_threat_income[biter_force_name] + (food_values[food].value * diminishing_modifier * 12)
|
||||
|
||||
local diminishing_modifier = (1 / (10 ^ (e * 0.015))) / (e * 0.5)
|
||||
global.bb_threat_income[biter_force_name] = global.bb_threat_income[biter_force_name] + (food_values[food].value * diminishing_modifier * 12)
|
||||
|
||||
---SET EVOLUTION
|
||||
local e = (game.forces[biter_force_name].evolution_factor * 100) + 1
|
||||
local diminishing_modifier = (1 / (10 ^ (e * 0.014))) / (e * 0.5)
|
||||
global.bb_evolution[biter_force_name] = global.bb_evolution[biter_force_name] + (food_values[food].value * diminishing_modifier)
|
||||
if global.bb_evolution[biter_force_name] < 1 then
|
||||
local e2 = (game.forces[biter_force_name].evolution_factor * 100) + 1
|
||||
local diminishing_modifier = (1 / (10 ^ (e2 * 0.015))) / (e2 * 0.5)
|
||||
local evo_gain = (food_values[food].value * diminishing_modifier)
|
||||
global.bb_evolution[biter_force_name] = global.bb_evolution[biter_force_name] + evo_gain
|
||||
if global.bb_evolution[biter_force_name] <= 1 then
|
||||
game.forces[biter_force_name].evolution_factor = global.bb_evolution[biter_force_name]
|
||||
else
|
||||
game.forces[biter_force_name].evolution_factor = 1
|
||||
|
||||
--SET EVASION
|
||||
local e3 = global.bb_evasion[biter_force_name] + 1
|
||||
local diminishing_modifier = 1 / (0.05 + (e3 * 0.0005))
|
||||
global.bb_evasion[biter_force_name] = global.bb_evasion[biter_force_name] + 75 * evo_gain * diminishing_modifier
|
||||
if global.bb_evasion[biter_force_name] > 950 then global.bb_evasion[biter_force_name] = 950 end
|
||||
end
|
||||
|
||||
|
||||
--ADD INSTANT THREAT
|
||||
local diminishing_modifier = 1 / (0.2 + (e * 0.018))
|
||||
local diminishing_modifier = 1 / (0.2 + (e2 * 0.018))
|
||||
global.bb_threat[biter_force_name] = global.bb_threat[biter_force_name] + (food_values[food].value * 200 * diminishing_modifier)
|
||||
end
|
||||
|
||||
end
|
||||
set_biter_endgame_damage(biter_force_name, game.forces[biter_force_name])
|
||||
|
||||
global.bb_evasion[biter_force_name] = (global.bb_evolution[biter_force_name] - 1) * 333
|
||||
if global.bb_evasion[biter_force_name] > 950 then global.bb_evasion[biter_force_name] = 950 end
|
||||
end
|
||||
|
||||
return feed_biters
|
@ -272,7 +272,14 @@ local function on_entity_died(event)
|
||||
global.spy_fish_timeout["north"] = game.tick + 999999
|
||||
global.spy_fish_timeout["south"] = game.tick + 999999
|
||||
global.server_restart_timer = 180
|
||||
|
||||
|
||||
event.entity.surface.create_entity({
|
||||
name = "atomic-rocket",
|
||||
position = event.entity.position,
|
||||
force = "enemy",
|
||||
target = event.entity.position,
|
||||
speed = 1
|
||||
})
|
||||
fireworks(event.entity.surface)
|
||||
annihilate_base(event.entity.position, event.entity.surface, event.entity.force.name)
|
||||
end
|
||||
|
@ -273,15 +273,6 @@ local function on_robot_built_entity(event)
|
||||
event.created_entity.destroy()
|
||||
end
|
||||
|
||||
--Prevent Players from damaging the Rocket Silo
|
||||
local function on_entity_damaged(event)
|
||||
if event.cause then
|
||||
if event.cause.type == "unit" then return end
|
||||
end
|
||||
if event.entity.name ~= "rocket-silo" then return end
|
||||
event.entity.health = event.entity.health + event.final_damage_amount
|
||||
end
|
||||
|
||||
local function on_marked_for_deconstruction(event)
|
||||
if not event.entity.valid then return end
|
||||
if event.entity.name == "fish" then event.entity.cancel_deconstruction(game.players[event.player_index].force.name) end
|
||||
|
Loading…
Reference in New Issue
Block a user