mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 08:55:35 +00:00
Working rotating turrets
This commit is contained in:
parent
8889a2cdac
commit
1e5075eeb2
12 changed files with 278 additions and 66 deletions
|
|
@ -25,7 +25,6 @@ public partial class Alert : EnemyStateBase
|
|||
public override void EnterState()
|
||||
{
|
||||
base.EnterState();
|
||||
GD.Print($"Entered {Name}");
|
||||
NavigationModule.Init(MainObject);
|
||||
|
||||
PlayerDetection.SetRange(StorageModule.Root.EnemyResource.PlayerDetectionRange);
|
||||
|
|
@ -50,13 +49,11 @@ public partial class Alert : EnemyStateBase
|
|||
private void PlayerDetectionOnPlayerOutOfRange()
|
||||
{
|
||||
_isPlayerInRange = false;
|
||||
GD.Print("Player out of range");
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
base.ExitState();
|
||||
GD.Print($"Exited {Name}");
|
||||
PlayerDetection.PlayerInRange -= PlayerDetectionOnPlayerInRange;
|
||||
|
||||
PlayerDetection.PlayerOutOfRange -= PlayerDetectionOnPlayerOutOfRange;
|
||||
|
|
@ -69,7 +66,6 @@ public partial class Alert : EnemyStateBase
|
|||
private void PlayerDetectionOnPlayerInRange()
|
||||
{
|
||||
//_isPlayerInRange = true;
|
||||
GD.Print("Player In Range");
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
|
|
@ -77,7 +73,6 @@ public partial class Alert : EnemyStateBase
|
|||
base.PhysicsProcessState(delta);
|
||||
if (PlayerDetection.IsPlayerInRange(StorageModule.Root.EnemyResource.ViewRange) && PlayerDetection.IsPlayerInSight())
|
||||
{
|
||||
GD.Print("Player is in sight, shooting");
|
||||
StateMachine.SetState(EnemyState.Shooting);
|
||||
return;
|
||||
}
|
||||
|
|
@ -86,7 +81,6 @@ public partial class Alert : EnemyStateBase
|
|||
if (this.GlobalPosition.DistanceTo(GameManager.Instance.PlayerPosition.Value) >=
|
||||
StorageModule.Root.EnemyResource.PlayerDisengageRange)
|
||||
{
|
||||
GD.Print("Player is out of sight, idling");
|
||||
StateMachine.SetState(EnemyState.Idle);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue