file refactor
This commit is contained in:
parent
da5a3e874b
commit
bffb012a26
175 changed files with 1086 additions and 1107 deletions
|
|
@ -1,48 +0,0 @@
|
|||
using Godot;
|
||||
|
||||
namespace Newlon.Components.Zombies;
|
||||
|
||||
public partial class RuntimeZombieData : Entity
|
||||
{
|
||||
[Export]
|
||||
private Armor _armor;
|
||||
[Export]
|
||||
private AudioStream garlicSound;
|
||||
[Export]
|
||||
private AudioStream freezeSound;
|
||||
public bool AbleToEat = true;
|
||||
|
||||
public override void Heal(float amount, Node origin)
|
||||
{
|
||||
if (_armor != null)
|
||||
{
|
||||
HP += _armor.Heal(amount);
|
||||
}
|
||||
else
|
||||
HP += amount;
|
||||
EmitSignal(SignalName.OnHPChanged, amount, origin);
|
||||
|
||||
if (HP > MaxHP)
|
||||
{
|
||||
HP = MaxHP;
|
||||
}
|
||||
}
|
||||
|
||||
public override void TakeDamage(float amount, Node origin)
|
||||
{
|
||||
if (_armor != null)
|
||||
{
|
||||
HP -= _armor.RecieveDamage(amount);
|
||||
}
|
||||
else
|
||||
HP -= amount;
|
||||
EmitSignal(SignalName.OnHPChanged, -amount, origin);
|
||||
EmitSignal(SignalName.OnDamaged);
|
||||
|
||||
if (HP <= 0)
|
||||
{
|
||||
KillByDamage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue