mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-03 13:12:11 +02:00
grace period to 150s, evo bump on killing nests removed
This commit is contained in:
parent
d7eff5940f
commit
4cf8830585
@ -54,7 +54,7 @@ function Public.Tick_actions(tickinterval)
|
||||
if destination.type ~= Surfaces.enum.ISLAND then return end
|
||||
if memory.boat.state ~= Boats.enum_state.LANDED and memory.boat.state ~= Boats.enum_state.RETREATING then return end
|
||||
|
||||
if (memory.game_lost) or (destination.dynamic_data.timeratlandingtime and destination.dynamic_data.timer < destination.dynamic_data.timeratlandingtime + Common.seconds_after_landing_to_enable_AI) then return end
|
||||
if (memory.game_lost) or (destination.dynamic_data.timeratlandingtime and destination.dynamic_data.timer < destination.dynamic_data.timeratlandingtime + Common.grace_period_on_arriving_at_island_seconds) then return end
|
||||
|
||||
if game.tick % (tickinterval * 2) == 0 and memory.boat.state == Boats.enum_state.LANDED then
|
||||
local extra_evo = 2 * tickinterval / 60 * Balance.evolution_per_second()
|
||||
@ -239,7 +239,7 @@ function Public.tell_biters_near_silo_to_attack_it()
|
||||
local enemy_force_name = memory.enemy_force_name
|
||||
|
||||
-- don't do this too early
|
||||
if destination.dynamic_data.timeratlandingtime and destination.dynamic_data.timer < destination.dynamic_data.timeratlandingtime + Common.seconds_after_landing_to_enable_AI * 4 then return end
|
||||
if destination.dynamic_data.timeratlandingtime and destination.dynamic_data.timer < destination.dynamic_data.timeratlandingtime + Common.grace_period_on_arriving_at_island_seconds * 2 then return end
|
||||
if not (destination.dynamic_data.rocketsilos and destination.dynamic_data.rocketsilos[1] and destination.dynamic_data.rocketsilos[1].valid and destination.dynamic_data.rocketsilos[1].destructible) then return end
|
||||
|
||||
local attackcommand = Public.attack_target_entity(destination.dynamic_data.rocketsilos[1])
|
||||
|
@ -215,7 +215,7 @@ end
|
||||
Public.expected_time_fraction = 0.7
|
||||
|
||||
function Public.expected_time_on_island() --always >0
|
||||
return Public.expected_time_fraction * Public.max_time_on_island_formula_seconds()
|
||||
return Public.expected_time_fraction * Public.max_time_on_island_formula_seconds() + Public.grace_period_on_arriving_at_island_seconds
|
||||
end
|
||||
|
||||
function Public.fuel_depletion_rate_static()
|
||||
@ -255,21 +255,23 @@ function Public.boat_passive_pollution_per_minute(time)
|
||||
|
||||
local boost
|
||||
if time then --sharp rise approaching T, steady increase thereafter
|
||||
if time > T then
|
||||
boost = 20 + 10 * (time - T) / (30 / 100 * T)
|
||||
elseif time >= 90 / 100 * T then
|
||||
local adjusted_time = Math.max(0, time - Public.grace_period_on_arriving_at_island_seconds)
|
||||
|
||||
if adjusted_time > T then
|
||||
boost = 20 + 10 * (adjusted_time - T) / (30 / 100 * T)
|
||||
elseif adjusted_time >= 90 / 100 * T then
|
||||
boost = 16
|
||||
elseif time >= 85 / 100 * T then
|
||||
elseif adjusted_time >= 85 / 100 * T then
|
||||
boost = 12
|
||||
elseif time >= 80 / 100 * T then
|
||||
elseif adjusted_time >= 80 / 100 * T then
|
||||
boost = 8
|
||||
elseif time >= 70 / 100 * T then
|
||||
elseif adjusted_time >= 70 / 100 * T then
|
||||
boost = 5
|
||||
elseif time >= 60 / 100 * T then
|
||||
elseif adjusted_time >= 60 / 100 * T then
|
||||
boost = 3
|
||||
elseif time >= 50 / 100 * T then
|
||||
elseif adjusted_time >= 50 / 100 * T then
|
||||
boost = 2
|
||||
elseif time >= 40 / 100 * T then
|
||||
elseif adjusted_time >= 40 / 100 * T then
|
||||
boost = 1.5
|
||||
else
|
||||
boost = 1
|
||||
@ -346,25 +348,27 @@ function Public.evolution_per_second()
|
||||
end
|
||||
|
||||
function Public.evolution_per_nest_kill() --it's important to have evo go up with biter base kills, to provide resistance if you try to plow through all the bases
|
||||
local destination = Common.current_destination()
|
||||
if Common.overworldx() == 0 then return 0 end
|
||||
-- local destination = Common.current_destination()
|
||||
-- if Common.overworldx() == 0 then return 0 end
|
||||
|
||||
if destination and destination.dynamic_data and destination.dynamic_data.timer and destination.dynamic_data.timer > 0 and destination.dynamic_data.initial_spawner_count and destination.dynamic_data.initial_spawner_count > 0 then
|
||||
local initial_spawner_count = destination.dynamic_data.initial_spawner_count
|
||||
local base_evo_jump = 0.04 * (1 / initial_spawner_count) --extra friction to make them hard to mow through, even at late times
|
||||
-- if destination and destination.dynamic_data and destination.dynamic_data.timer and destination.dynamic_data.timer > 0 and destination.dynamic_data.initial_spawner_count and destination.dynamic_data.initial_spawner_count > 0 then
|
||||
-- local initial_spawner_count = destination.dynamic_data.initial_spawner_count
|
||||
-- local base_evo_jump = 0.04 * (1 / initial_spawner_count) --extra friction to make them hard to mow through, even at late times
|
||||
|
||||
local time = destination.dynamic_data.timer
|
||||
-- local time_to_jump_to = Public.expected_time_on_island() * ((1/Public.expected_time_fraction)^(2/3))
|
||||
local time_to_jump_to = Public.max_time_on_island_formula_seconds()
|
||||
if time > time_to_jump_to then
|
||||
return base_evo_jump
|
||||
else
|
||||
-- evo it 'would have' contributed:
|
||||
return (1 / initial_spawner_count) * Public.expected_time_evo() * (time_to_jump_to - time) / time_to_jump_to + base_evo_jump
|
||||
end
|
||||
else
|
||||
return 0
|
||||
end
|
||||
-- local time = destination.dynamic_data.timer
|
||||
-- -- local time_to_jump_to = Public.expected_time_on_island() * ((1/Public.expected_time_fraction)^(2/3))
|
||||
-- local time_to_jump_to = Public.max_time_on_island_formula_seconds()
|
||||
-- if time > time_to_jump_to then
|
||||
-- return base_evo_jump
|
||||
-- else
|
||||
-- -- evo it 'would have' contributed:
|
||||
-- return (1 / initial_spawner_count) * Public.expected_time_evo() * (time_to_jump_to - time) / time_to_jump_to + base_evo_jump
|
||||
-- end
|
||||
-- else
|
||||
-- return 0
|
||||
-- end
|
||||
|
||||
return 0
|
||||
|
||||
-- return 0.003 * Common.difficulty_scale()
|
||||
end
|
||||
|
@ -32,7 +32,7 @@ Public.autodisband_hours = 24 * 5 -- should not be zero (as this messes with sav
|
||||
|
||||
Public.boat_steps_at_a_time = 1
|
||||
|
||||
Public.seconds_after_landing_to_enable_AI = 45
|
||||
Public.grace_period_on_arriving_at_island_seconds = 150
|
||||
|
||||
Public.boat_default_starting_distance_from_shore = 22
|
||||
-- Public.mapedge_distance_from_boat_starting_position = 136
|
||||
|
@ -130,6 +130,7 @@ Public.difficulty_options = {
|
||||
|
||||
{ value = 2, icon = 'item/atomic-bomb', text = { 'pirates.difficulty_nightmare' }, associated_color = { r = 170, g = 60, b = 60 } },
|
||||
}
|
||||
|
||||
function Public.get_difficulty_option_from_value(difficulty_value)
|
||||
-- given a difficulty value, key in to the closesy entry in the above table. (organising things this way allows us to make changes to the 'value' keys in the above table without disrupting e.g. past highscores data)
|
||||
if difficulty_value <= 0.75 then
|
||||
|
Loading…
x
Reference in New Issue
Block a user