Fixed sprites and armor
This commit is contained in:
parent
45b45b7fd0
commit
540c6c8f2f
43 changed files with 12 additions and 75 deletions
|
|
@ -28,7 +28,7 @@ public partial class Armor : Node
|
|||
_hp -= damage;
|
||||
if(_hp <= 0)
|
||||
{
|
||||
returnAmount = _hp;
|
||||
returnAmount = -_hp;
|
||||
_hp = 0;
|
||||
EmitSignal(SignalName.ArmorLost);
|
||||
_lost = true;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ public partial class RuntimeZombieData : Node2D, IEntity, ILocalTimescale, IEffe
|
|||
[Signal]
|
||||
public delegate void OnLocalTimescaleChangedEventHandler(int currentTimescale);
|
||||
|
||||
[Export]
|
||||
private int _hp;
|
||||
[Export]
|
||||
private int _maxHP;
|
||||
|
|
@ -70,7 +71,7 @@ public partial class RuntimeZombieData : Node2D, IEntity, ILocalTimescale, IEffe
|
|||
|
||||
public void TakeDamage(int amount, Node origin, Utility.DamageTypes damageType = Utility.DamageTypes.PHYSICAL)
|
||||
{
|
||||
if(_armor != null)
|
||||
if (_armor != null)
|
||||
{
|
||||
_hp -= _armor.RecieveDamage(amount);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue