Fixed sprites and armor

This commit is contained in:
Rendo 2025-06-17 02:10:45 +05:00
commit 540c6c8f2f
43 changed files with 12 additions and 75 deletions

View file

@ -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;

View file

@ -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);
}