mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 21:45:53 +00:00
Enemy state machine
This commit is contained in:
parent
b9b8834bc2
commit
ef6c240e8e
37 changed files with 545 additions and 36 deletions
|
|
@ -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