mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
39 lines
No EOL
972 B
C#
39 lines
No EOL
972 B
C#
using Cirno.Scripts.Enums;
|
|
using Godot;
|
|
|
|
namespace Cirno.Scripts.Components.FSM.Enemy;
|
|
|
|
public partial class Dead : EnemyStateBase
|
|
{
|
|
public override EnemyState StateId => EnemyState.Dead;
|
|
|
|
[Export]
|
|
public EnemyStorageModule StorageModule { get; private set; }
|
|
|
|
[Export]
|
|
public EnemyDropsProvider DropsProvider { get; private set; }
|
|
|
|
// public override void Init(IStateMachine<EnemyState, CharacterBody2D> machine)
|
|
// {
|
|
// base.Init(machine);
|
|
//
|
|
//
|
|
// }
|
|
|
|
public override void EnterState()
|
|
{
|
|
base.EnterState();
|
|
|
|
// Play death script
|
|
if (StorageModule.Root.DefeatScript is IActivable activatable)
|
|
{
|
|
activatable.Activate(StorageModule.Root.ActivationType);
|
|
}
|
|
|
|
DropsProvider.DropLoot();
|
|
|
|
GameManager.Instance.AddMotivation(StorageModule.EnemyData.MotivationReward);
|
|
|
|
StorageModule.Root.QueueFree();
|
|
}
|
|
} |