Skip to content

Commit

Permalink
Added Incremental Respawn time to CrashSite (Refactorio#957)
Browse files Browse the repository at this point in the history
"Respawn timer shouldn't be as long or maybe timer starts off small and increases per death or maybe based off evolution"
-- Implementation is based off evolution
  • Loading branch information
HySpeed committed Sep 14, 2019
1 parent ef89b1f commit f4acacf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 11 additions & 2 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,18 @@ 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
-- respawn time is determined by biter progression:
-- min_time + (increment_amount * biter_progression )
-- min_time default is 10 seconds
-- increment_amount default of 3000 will add ~5 seconds per 10% evolution and max at 60 seconds
player_respawn_time = {
min_time = 600,
increment_amount = 3000
},
-- spawns more units when one dies
hail_hydra = {
enabled = false,
Expand Down
4 changes: 3 additions & 1 deletion map_gen/maps/crash_site/entity_died_events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local math = require 'utils.math'
local table = require 'utils.table'

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 +174,8 @@ local spawn_player =
Token.register(
function(player)
if player and player.valid then
player.ticks_to_respawn = 3600
local increment = round(game.forces.enemy.evolution_factor * global.config.player_respawn_time.increment_amount)
player.ticks_to_respawn = global.config.player_respawn_time.min_time + increment
end
end
)
Expand Down

0 comments on commit f4acacf

Please sign in to comment.