mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-13 21:55:55 +00:00
Enemy state machine
This commit is contained in:
parent
b9b8834bc2
commit
ef6c240e8e
37 changed files with 545 additions and 36 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Cirno.Scripts.Components.Actors;
|
||||
using Cirno.Scripts.Enums;
|
||||
using Godot;
|
||||
|
||||
public partial class ActorAi : ActorModule
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Cirno.Scripts.Components;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cirno.Scripts.Components.Actors;
|
||||
using Cirno.Scripts.Enums;
|
||||
|
||||
public partial class EnemyNavigationMovement : MovementHandler
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Godot;
|
||||
using Cirno.Scripts.Enums;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.Actors;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ public partial class GenericDamageReceiver : Area2D, IHittable
|
|||
[Export] public PackedScene Debris { get; set; }
|
||||
|
||||
[Export] public Array<DamageResistance> DamageResistances { get; set; } = [];
|
||||
|
||||
[Export] public bool DeleteParentOnDeath { get; private set; } = true;
|
||||
|
||||
//[Signal] public delegate void DeathEventHandler();
|
||||
|
||||
private Node2D _parent;
|
||||
|
||||
|
|
@ -69,6 +73,12 @@ public partial class GenericDamageReceiver : Area2D, IHittable
|
|||
_parent.CreateSibling<Node2D>(Debris);
|
||||
}
|
||||
|
||||
_parent.QueueFree();
|
||||
// Not needed because the health provider is accessible
|
||||
//EmitSignal(SignalName.Death);
|
||||
|
||||
if (DeleteParentOnDeath)
|
||||
{
|
||||
_parent.QueueFree();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue