add attacks and death

This commit is contained in:
2025-02-26 16:17:14 +09:00
parent 151a757e3e
commit 3f1f4b1811
9 changed files with 83 additions and 14 deletions
+4 -3
View File
@@ -4,10 +4,11 @@ func process_physics(delta: float) -> State:
if not Main.is_server_or_predicting(subject.player_id, subject.client_prediction): return
var input_direction = %Input.direction
if input_direction.length() < 0.05: return %Idle
subject.apply_input_velocity(delta, input_direction, subject.walk_speed, subject.acceleration)
if not %Input.walk: return %Run
if not subject.is_on_floor(): return %Fall
if has_node("%Dead") and subject.dead: return %Dead
if has_node("%Lunge") and %Input.primary_interact and (not has_node("%AttackCooldown") or %AttackCooldown.time_left == 0): return %Lunge
if input_direction.length() < 0.05: return %Idle
if not %Input.walk: return %Run
return