mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-17 02:53:48 +00:00
Controllable enemies
This commit is contained in:
parent
cf4b11d157
commit
0aad79a0f8
18 changed files with 893 additions and 23 deletions
|
|
@ -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())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue