summaryrefslogtreecommitdiff
path: root/scripts/Entities/Actors/Actor.cs
diff options
context:
space:
mode:
authorGustavoeklund01 <eklundgu@gmail.com>2025-11-10 17:25:59 -0300
committerGustavoeklund01 <eklundgu@gmail.com>2025-11-10 17:25:59 -0300
commit1a042d7303081e8bc72e9e3c341db3e528c8d998 (patch)
treecb56eafbd73ab8c7f8ba231fd512ae246b4dd64b /scripts/Entities/Actors/Actor.cs
parentde99779d19b77d174c561cb3795538412f53bcbc (diff)
parentf46d058571d453ccf7ddf884ccb5d8694f970d7c (diff)
Merge branch 'master' of https://github.com/Simplesmente-O-Grupo/projeto-fantasiaHEADmaster
Diffstat (limited to 'scripts/Entities/Actors/Actor.cs')
-rw-r--r--scripts/Entities/Actors/Actor.cs6
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++;
+ }
}