Atrocities
This commit is contained in:
parent
8e0f90ae3d
commit
9680b21792
90 changed files with 324 additions and 69 deletions
|
|
@ -16,14 +16,13 @@ public partial class RuntimeZombieData : Node2D, IEntity, ILocalTimescale, IEffe
|
|||
[Export]
|
||||
private int _maxHP;
|
||||
[Export]
|
||||
private int _line;
|
||||
private Armor _armor;
|
||||
|
||||
|
||||
private float _localTimescale = 1.0f;
|
||||
public int Hp => _hp;
|
||||
|
||||
public int MaxHp => _maxHP;
|
||||
|
||||
public int Line => _line;
|
||||
public int MaxHp => _maxHP;
|
||||
|
||||
public bool AbleToEat = true;
|
||||
|
||||
|
|
@ -54,8 +53,14 @@ public partial class RuntimeZombieData : Node2D, IEntity, ILocalTimescale, IEffe
|
|||
|
||||
public void Heal(int amount,Node origin)
|
||||
{
|
||||
_hp += amount;
|
||||
if(_armor != null)
|
||||
{
|
||||
_hp += _armor.Heal(amount);
|
||||
}
|
||||
else
|
||||
_hp += amount;
|
||||
EmitSignal(SignalName.OnHPChanged,amount,origin);
|
||||
|
||||
|
||||
if (MaxHp > 0)
|
||||
{
|
||||
|
|
@ -65,7 +70,12 @@ public partial class RuntimeZombieData : Node2D, IEntity, ILocalTimescale, IEffe
|
|||
|
||||
public void TakeDamage(int amount, Node origin, Utility.DamageTypes damageType = Utility.DamageTypes.PHYSICAL)
|
||||
{
|
||||
_hp -= amount;
|
||||
if(_armor != null)
|
||||
{
|
||||
_hp -= _armor.RecieveDamage(amount);
|
||||
}
|
||||
else
|
||||
_hp -= amount;
|
||||
EmitSignal(SignalName.OnHPChanged,-amount, origin);
|
||||
|
||||
if (_hp <= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue