summaryrefslogtreecommitdiff
path: root/scripts/Magic
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-09-14 12:39:21 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-09-14 12:39:21 -0300
commitbd88d4f04555a0619d06b2fc4e5ec9a0114716c1 (patch)
treeb99400b8e634a45ab7f98b09de6d5e19c50a6bf8 /scripts/Magic
parent1e17a31e3eeed8ccf76982534002513cee6593f1 (diff)
Corrigido mesagem de log com dano negativo.
Diffstat (limited to 'scripts/Magic')
-rw-r--r--scripts/Magic/DamageEffect.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/Magic/DamageEffect.cs b/scripts/Magic/DamageEffect.cs
index 0b2b3d6..c0d8d4e 100644
--- a/scripts/Magic/DamageEffect.cs
+++ b/scripts/Magic/DamageEffect.cs
@@ -14,7 +14,17 @@ public partial class DamageEffect : SpellEffect
{
int damageDealt = Damage - target.Men;
- MessageLogData.Instance.AddMessage($"{caster.DisplayName} aplica {damageDealt} de dano mágico em {target.DisplayName}");
+ if (damageDealt < 0)
+ {
+ damageDealt = 0;
+ }
+
+ if (damageDealt <= 0) {
+ MessageLogData.Instance.AddMessage($"{target.DisplayName} resite o ataque mágico de {caster.DisplayName}");
+ }
+ else {
+ MessageLogData.Instance.AddMessage($"{caster.DisplayName} aplica {damageDealt} de dano mágico em {target.DisplayName}");
+ }
target.Hp -= damageDealt;
}