Zombie now eat when can
This commit is contained in:
parent
f351e53a03
commit
0592751a25
7 changed files with 76 additions and 81 deletions
|
|
@ -9,6 +9,8 @@ public partial class EatBox : Area2D
|
|||
// Rewrite this class completely when field system will be introduced.
|
||||
|
||||
[Export] public FloatModifiers _damage;
|
||||
[Export]
|
||||
private AudioStream biteSound = ResourceLoader.Load<AudioStream>("uid://dyid55nhflwyn");
|
||||
private RuntimePlantData plant;
|
||||
|
||||
public bool isEating = false;
|
||||
|
|
@ -18,6 +20,7 @@ public partial class EatBox : Area2D
|
|||
if (GetParent<RuntimeZombieData>().AbleToEat)
|
||||
{
|
||||
plant?.TakeDamage((int)_damage.GetValue(), GetParent());
|
||||
AudioSequencer.Play("bite", biteSound);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,6 @@ public partial class RuntimeZombieData : Entity
|
|||
{
|
||||
[Export]
|
||||
private Armor _armor;
|
||||
[Export]
|
||||
private AudioStream garlicSound;
|
||||
[Export]
|
||||
private AudioStream freezeSound;
|
||||
[Signal] public delegate void HasBeenKilledEventHandler(RuntimeZombieData who);
|
||||
public bool AbleToEat = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue