Add classic HUD, auto reload, furniture pathfinding and death flatline

This commit is contained in:
enne2
2026-10-11 00:58:28 +02:00
parent d6d25fabaa
commit 8a0c441af6
14 changed files with 438 additions and 19 deletions
+7
View File
@@ -100,6 +100,8 @@ func _unhandled_input(event: InputEvent) -> void:
## Ricarica: tempi invariati, riusata da tastiera (R) e dal pulsante on-screen.
func start_reload() -> void:
if reloading or death_started or hp <= 0 or ammo >= 30:
return
reloading = true
weapon_anim.play("reload")
Audio.play(self, "items/cliprelease1.wav")
@@ -140,6 +142,8 @@ func _physics_process(dt: float) -> void:
get_tree().reload_current_scene() # R o pulsante Ricarica a partita finita
return
_regenerate_health(dt)
if ammo <= 0 and not reloading:
start_reload()
_handle_actions()
# Deadzone esplicita piccola (0.2): con la 0.5 delle azioni la corsa utile del
# joystick touch si dimezzerebbe, mentre per tastiera/joypad nulla cambia.
@@ -176,6 +180,8 @@ func shoot() -> void:
if hit and hit.collider.has_method("take_damage"):
Blood.impact(get_parent(), hit.position, -camera.global_basis.z)
hit.collider.take_damage(35, hit.position.y)
if ammo <= 0:
start_reload()
func throw_grenade() -> RigidBody3D:
if death_started or hp <= 0 or grenade_cooldown > 0:
@@ -219,6 +225,7 @@ func _die() -> void:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
# Original Half-Life player pain sample used as the death event vocal.
Audio.play(self, "player/pl_pain7.wav", false, -8)
Audio.play(self, "fvox/flatline.wav", false, -9)
var layer := CanvasLayer.new()
layer.layer = 5
add_child(layer)