Small overhaul
This commit is contained in:
@@ -207,7 +207,8 @@ func _die() -> void:
|
||||
if RunManager.run_active:
|
||||
RunManager.end_run(false)
|
||||
else:
|
||||
# In hub/practice — just heal to full instead of dying
|
||||
# In hub/practice — signal for practice room handling, then heal
|
||||
EventBus.practice_player_died.emit()
|
||||
stats.heal(stats.max_health)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@@ -143,4 +143,10 @@ func heal(amount: float) -> void:
|
||||
current_health = minf(current_health + amount, max_health)
|
||||
|
||||
func _on_part_equipped(_part: Resource, _slot: String) -> void:
|
||||
recalculate()
|
||||
var old_max := max_health
|
||||
recalculate()
|
||||
# If max_health increased, grant the extra HP immediately
|
||||
if max_health > old_max:
|
||||
current_health += (max_health - old_max)
|
||||
# Update UI
|
||||
EventBus.player_health_changed.emit(current_health, max_health)
|
||||
Reference in New Issue
Block a user