2025-02-18 22:14:42 +01:00
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
public partial class EnemyPossessionMovement : ActorFreeMovement
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private ActorAi _actorAi;
|
2025-02-23 18:08:57 +01:00
|
|
|
public bool IsDestroyed => _parent.IsDestroyed;
|
2025-02-18 22:14:42 +01:00
|
|
|
// State accessor
|
|
|
|
|
|
|
|
|
|
public override void Init(Actor parent)
|
|
|
|
|
{
|
|
|
|
|
base.Init(parent);
|
|
|
|
|
|
|
|
|
|
_actorAi = parent.GetNode<ActorAi>("ActorAi");
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-20 18:26:53 +01:00
|
|
|
public override void PhysicsUpdate(double delta)
|
2025-02-18 22:14:42 +01:00
|
|
|
{
|
2025-02-23 18:08:57 +01:00
|
|
|
if (IsDestroyed) return;
|
2025-02-18 22:14:42 +01:00
|
|
|
if (_actorAi.Ai is AiState.Controlled)
|
2025-02-20 18:26:53 +01:00
|
|
|
base.PhysicsUpdate(delta);
|
2025-02-18 22:14:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|