feat: shared creature root, enemy definitions, defend duty, and player downing
This commit is contained in:
@@ -25,6 +25,11 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if _is_player_downed():
|
||||
velocity.x = move_toward(velocity.x, 0.0, acceleration * delta)
|
||||
velocity.z = move_toward(velocity.z, 0.0, acceleration * delta)
|
||||
move_and_slide()
|
||||
return
|
||||
var input := Input.get_vector("move_left", "move_right", "move_forward", "move_backward")
|
||||
|
||||
var forward := -camera_rig.global_transform.basis.z
|
||||
@@ -55,6 +60,14 @@ func _physics_process(delta: float) -> void:
|
||||
rotation.y = lerp_angle(rotation.y, target_angle, rotation_speed * delta)
|
||||
|
||||
|
||||
func _is_player_downed() -> bool:
|
||||
return (
|
||||
simulation_manager != null
|
||||
and simulation_manager.has_method("player_is_downed")
|
||||
and simulation_manager.player_is_downed()
|
||||
)
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("interact"):
|
||||
try_interact()
|
||||
|
||||
Reference in New Issue
Block a user