2025-07-01 13:40:13 +02:00
|
|
|
|
using Cirno.Scripts.Components.Actors;
|
|
|
|
|
|
using Cirno.Scripts.Enums;
|
2025-06-21 15:41:29 +02:00
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Cirno.Scripts.Components.FSM.Enemy._3D;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class Init : EnemyStateBase3D
|
|
|
|
|
|
{
|
|
|
|
|
|
public override EnemyState StateId => EnemyState.Init;
|
|
|
|
|
|
[Export] public EnemyStorage3D Storage {get; private set;}
|
|
|
|
|
|
|
|
|
|
|
|
[Export] public PlayerDetection3D DetectionProvider { get; private set; }
|
|
|
|
|
|
|
2025-07-01 13:40:13 +02:00
|
|
|
|
[Export] public ActorResourceProvider HealthProvider { get; private set; }
|
|
|
|
|
|
|
2025-06-21 15:41:29 +02:00
|
|
|
|
public override void EnterState()
|
|
|
|
|
|
{
|
|
|
|
|
|
//DamageReceiver.HealthProvider.MaxResource = StorageModule.Root.EnemyResource.MaxHealth;
|
|
|
|
|
|
DetectionProvider.Initialize(MainObject);
|
|
|
|
|
|
Storage.AiState = Storage.Root.StartingAiState;
|
2025-06-29 18:09:13 +02:00
|
|
|
|
|
2025-06-21 15:41:29 +02:00
|
|
|
|
Storage.HomePosition = MainObject.GlobalPosition;
|
|
|
|
|
|
// TODO: Hide wings
|
|
|
|
|
|
// TODO: Hide aiming reticule
|
2025-07-01 13:40:13 +02:00
|
|
|
|
|
|
|
|
|
|
HealthProvider.MaxResource = Storage.Root.EnemyResource.MaxHealth;
|
|
|
|
|
|
|
|
|
|
|
|
HealthProvider.FillResource();
|
2025-06-21 15:41:29 +02:00
|
|
|
|
|
|
|
|
|
|
StateMachine.SetState(EnemyState.Idle);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|