Controllable enemies

This commit is contained in:
Marco 2025-03-21 17:52:01 +01:00
commit 0aad79a0f8
18 changed files with 893 additions and 23 deletions

View file

@ -47,6 +47,7 @@ public partial class Idle : EnemyStateBase
private void HealthProviderOnResourceDecreased(float oldvalue, float newvalue, float maxvalue)
{
StorageModule.AiState = AiState.Enabled;
ChangeState(EnemyState.Alert);
}
@ -85,7 +86,7 @@ public partial class Idle : EnemyStateBase
public override void PhysicsProcessState(double delta)
{
base.PhysicsProcessState(delta);
if (_isPlayerInRange)
if (StorageModule.AiState is AiState.Enabled && _isPlayerInRange)
{
if (PlayerDetection.IsPlayerInSight())
{