mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 15:35:53 +00:00
Enemy FSM death
This commit is contained in:
parent
e7c1814d98
commit
cc85cd4b54
4 changed files with 34 additions and 3 deletions
|
|
@ -1,8 +1,33 @@
|
|||
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; }
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
StorageModule.Root.QueueFree();
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue