Added cultist chase states

This commit is contained in:
2026-02-09 21:48:52 +03:00
parent b0e497172f
commit b62b24dbbc
19 changed files with 147 additions and 275 deletions
@@ -0,0 +1,20 @@
@abstract
class_name CultistWalkState
extends CultistMoveState
@export var chase_state: CultistState
@export var another_direction_walk_state: CultistState
func physics_process(delta: float) -> void:
if not cultist.is_on_floor():
switch_state.emit(fall_state)
else:
if not _chase_if_player_in_ray_cast(_player_ray_cast, chase_state):
if _wall_ray_cast.is_colliding():
var stream := SoundManager.sfx_stream_player_lost
SoundManager.play_sfx_stream(stream, cultist.global_position)
switch_state.emit(another_direction_walk_state)
else:
cultist.update_x_velocity(_direction, cultist.MAX_WALK_SPEED, delta)