egrading armor and universal veil

This commit is contained in:
Rendo 2025-07-01 14:53:12 +05:00
commit 29254dbda0
22 changed files with 142 additions and 30 deletions

View file

@ -11,13 +11,13 @@ public partial class Armor : Node
public delegate void ArmorLostEventHandler();
[Export]
private int _maxHP;
public int MaxHP { get; private set; }
private int _hp;
private bool _lost = false;
public override void _Ready()
{
_hp = _maxHP;
_hp = MaxHP;
}
public int RecieveDamage(int damage)
@ -43,10 +43,10 @@ public partial class Armor : Node
return amount;
int returnAmount = 0;
_hp += amount;
if (_hp >= _maxHP)
if (_hp >= MaxHP)
{
returnAmount = _hp-_maxHP;
_hp = _maxHP;
returnAmount = _hp-MaxHP;
_hp = MaxHP;
}
EmitSignal(SignalName.ArmorDamaged,_hp);
return returnAmount;