mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:55:35 +00:00
health station
This commit is contained in:
parent
cc1fa2cdc6
commit
f7cbd7d171
8 changed files with 268 additions and 11 deletions
|
|
@ -88,11 +88,16 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
|
|||
if (_currentHealth != value)
|
||||
{
|
||||
_currentHealth = value;
|
||||
|
||||
if (_currentHealth > MaxHealth) {
|
||||
_currentHealth = MaxHealth;
|
||||
}
|
||||
|
||||
EmitSignal(nameof(HealthChanged), _currentHealth, MaxHealth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public float CurrentShield
|
||||
{
|
||||
get => _currentShield;
|
||||
|
|
@ -101,11 +106,17 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
|
|||
if (_currentShield != value)
|
||||
{
|
||||
_currentShield = value;
|
||||
|
||||
if (_currentShield > MaxShield)
|
||||
{
|
||||
_currentShield = MaxShield;
|
||||
}
|
||||
|
||||
EmitSignal(nameof(ShieldChanged), _currentShield, MaxShield);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//private InventoryManager _inventoryManager;
|
||||
|
||||
public override void _Ready()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue