diff options
| author | Gustavoeklund01 <eklundgu@gmail.com> | 2025-11-10 17:25:59 -0300 |
|---|---|---|
| committer | Gustavoeklund01 <eklundgu@gmail.com> | 2025-11-10 17:25:59 -0300 |
| commit | 1a042d7303081e8bc72e9e3c341db3e528c8d998 (patch) | |
| tree | cb56eafbd73ab8c7f8ba231fd512ae246b4dd64b /scripts/Entities/Actors | |
| parent | de99779d19b77d174c561cb3795538412f53bcbc (diff) | |
| parent | f46d058571d453ccf7ddf884ccb5d8694f970d7c (diff) | |
Diffstat (limited to 'scripts/Entities/Actors')
| -rw-r--r-- | scripts/Entities/Actors/Actor.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/Entities/Actors/Actor.cs b/scripts/Entities/Actors/Actor.cs index c68cc2b..e6b8867 100644 --- a/scripts/Entities/Actors/Actor.cs +++ b/scripts/Entities/Actors/Actor.cs @@ -101,6 +101,9 @@ public partial class Actor : Entity, ISaveable get => hp; set { + if (MapData != null && MapData.Player == this && hp > value) { + Stats.Instance.DamageTaken += (hp - value); + } // Esta propriedade impede que o HP seja maior que o máximo. hp = int.Clamp(value, 0, MaxHp); EmitSignal(SignalName.HealthChanged, Hp, MaxHp); @@ -280,6 +283,9 @@ public partial class Actor : Entity, ISaveable else { deathMessage = $"{DisplayName} morreu!"; + if (!inLoading) { + Stats.Instance.EnemiesKilled++; + } } |
