death now cancels effects
This commit is contained in:
parent
9be6a3a169
commit
5c33aacf7f
5 changed files with 66 additions and 34 deletions
|
|
@ -6,7 +6,6 @@ public partial class RuntimeZombieData : Entity
|
|||
{
|
||||
[Export]
|
||||
private Armor _armor;
|
||||
[Signal] public delegate void HasBeenKilledEventHandler(RuntimeZombieData who);
|
||||
[Signal] public delegate void HPChangedMixedEventHandler(EntitySignalContext context);
|
||||
public bool AbleToEat = true;
|
||||
|
||||
|
|
@ -102,12 +101,12 @@ public partial class RuntimeZombieData : Entity
|
|||
return HP;
|
||||
}
|
||||
#region Death sequence
|
||||
private bool _killed = false;
|
||||
public override void KillByDamage()
|
||||
{
|
||||
if (_killed) return;
|
||||
_killed = true;
|
||||
if (Killed) return;
|
||||
Killed = true;
|
||||
AbleToEat = false;
|
||||
ClearEffects();
|
||||
EmitSignal(SignalName.HasBeenKilled,this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue