mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
59 lines
No EOL
1.4 KiB
C#
59 lines
No EOL
1.4 KiB
C#
using System.Threading.Tasks;
|
|
using Cirno.Scripts.Components.FSM.Enemy._3D;
|
|
using Cirno.Scripts.Enums;
|
|
using Godot;
|
|
|
|
namespace Cirno.Scripts.Components.FSM.Boss._3D;
|
|
|
|
public partial class Idle : EnemyStateBase3D
|
|
{
|
|
public override EnemyState StateId => EnemyState.Idle;
|
|
|
|
[Export] public EnemyStorage3D Storage { get; private set; }
|
|
|
|
[Export] public GravityProvider GravityProvider { get; private set; }
|
|
|
|
[Export] public bool DebugEnabled { get; set; } = false;
|
|
|
|
|
|
|
|
public override void EnterState()
|
|
{
|
|
base.EnterState();
|
|
|
|
// player detection
|
|
// damage receiver will be a module
|
|
GD.Print("Entered Idle");
|
|
|
|
_ = DelayStart();
|
|
}
|
|
|
|
public override void ExitState()
|
|
{
|
|
base.ExitState();
|
|
|
|
// Disable DamageReceiver
|
|
|
|
|
|
}
|
|
|
|
private async Task DelayStart()
|
|
{
|
|
await Task.Delay(1000);
|
|
ChangeState(EnemyState.Shooting);
|
|
}
|
|
|
|
public override void PhysicsProcessState(double delta)
|
|
{
|
|
base.PhysicsProcessState(delta);
|
|
|
|
MainObject.Velocity = new Vector3(MainObject.Velocity.X, GravityProvider.CalculateGravityVelocity(MainObject.Velocity.Y, delta), MainObject.Velocity.Z);
|
|
|
|
MainObject.MoveAndSlide();
|
|
}
|
|
|
|
public override void ProcessState(double delta)
|
|
{
|
|
base.ProcessState(delta);
|
|
}
|
|
} |