Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,21 @@ global.config = {
{name = 'compilatron-chest', count = 5},
{name = 'compilatron-chest', count = 5},
{name = 'selection-tool', count = 1}
}
}
}
},
},
-- settings for controlling length of delay before player respawn - the delay goes *down* over time
-- respawn time is determined by biter progression:
-- respawn_delay = max_time - (decrement_amount * biter_progression)
-- respawn_time = max( min_time, respawn_delay )
-- min_time default is 10 seconds
-- decrement_amount default of 3000 will remove ~5 seconds per 10% evolution
player_respawn_time = {
enabled = false,
min_time = 600,
max_time = 3600,
decrement_amount = 3000
},
-- spawns more units when one dies
hail_hydra = {
enabled = false,
Expand Down
12 changes: 11 additions & 1 deletion map_gen/maps/crash_site/entity_died_events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ local Global = require 'utils.global'
local math = require 'utils.math'
local table = require 'utils.table'

local max = math.max
local random = math.random
local round = math.round
local set_timeout_in_ticks = Task.set_timeout_in_ticks
local ceil = math.ceil
local draw_arc = rendering.draw_arc
Expand Down Expand Up @@ -173,7 +175,15 @@ local spawn_player =
Token.register(
function(player)
if player and player.valid then
player.ticks_to_respawn = 3600
local respawn_delay
if global.config.player_respawn_time.enabled then
local decrement_amount = round(game.forces.enemy.evolution_factor * global.config.player_respawn_time.decrement_amount)
local adjusted_respawn = global.config.player_respawn_time.max_time - decrement_amount
respawn_delay = max(global.config.player_respawn_time.min_time, adjusted_respawn) -- limit smallest delay to min_time, if evolution goes above 100%
else
respawn_delay = global.config.player_respawn_time.max_time
end
player.ticks_to_respawn = respawn_delay
end
end
)
Expand Down