mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-17 01:33:47 +00:00
3D Boss scripts implementation
This commit is contained in:
parent
b0d0161ab0
commit
dbf7f1a963
29 changed files with 1805 additions and 1188 deletions
59
Scripts/Components/FSM/Boss/3D/Idle.cs
Normal file
59
Scripts/Components/FSM/Boss/3D/Idle.cs
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue