mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-05 13:15:03 +02:00
mtn v3 - make health on respawn more random
This commit is contained in:
parent
ff951394bb
commit
d32606323a
@ -40,6 +40,23 @@ local random_respawn_messages = {
|
||||
'Adrenalin is kicking in, but your body is damaged.'
|
||||
}
|
||||
|
||||
local health_values = {
|
||||
'0.35',
|
||||
'0.40',
|
||||
'0.45',
|
||||
'0.50',
|
||||
'0.55',
|
||||
'0.60',
|
||||
'0.65',
|
||||
'0.70',
|
||||
'0.75',
|
||||
'0.80',
|
||||
'0.85',
|
||||
'0.90',
|
||||
'0.95',
|
||||
'1'
|
||||
}
|
||||
|
||||
Global.register(
|
||||
this,
|
||||
function(t)
|
||||
@ -1350,7 +1367,7 @@ function Public.on_player_respawned(event)
|
||||
end
|
||||
if player.character and player.character.valid then
|
||||
Task.set_timeout_in_ticks(15, boost_movement_speed_on_respawn, {player = player})
|
||||
player.character.health = round(player.character.health * 0.25)
|
||||
player.character.health = round(player.character.health * health_values[random(1, #health_values)])
|
||||
player.print(random_respawn_messages[random(1, #random_respawn_messages)])
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user