Zombie death and damage indicators

This commit is contained in:
Rendo 2025-07-12 00:15:17 +05:00
commit b524f97e7f
14 changed files with 324 additions and 117 deletions

View file

@ -10,6 +10,7 @@ public partial class RuntimeZombieData : Entity
private AudioStream garlicSound;
[Export]
private AudioStream freezeSound;
[Signal] public delegate void HasBeenKilledEventHandler(RuntimeZombieData who);
public bool AbleToEat = true;
public override void Heal(float amount, Node origin)
@ -44,9 +45,13 @@ public partial class RuntimeZombieData : Entity
}
}
#region Death sequence
private bool _killed = false;
public override void KillByDamage()
{
if (_killed) return;
_killed = true;
AbleToEat = false;
EmitSignal(SignalName.HasBeenKilled,this);
}
#endregion