Fix HealSelf magnitude handling for negative base damage

- Use absolute BaseDamage for HealSelf so test abilities using negative damage values heal correctly

- Preserve minimum heal of 1 and max-health cap
This commit is contained in:
dingo
2026-02-11 07:49:47 -05:00
parent b6e3227f29
commit ca88eef600
+3 -3
View File
@@ -575,9 +575,9 @@ public partial class DungeonSimulation
{
if (!mob.IsAlive || mob.MaxHealth <= 0) return;
// For test coverage and predictable behavior, HealSelf restores BaseDamage HP.
// It is capped to MaxHealth.
int healAmount = Math.Max(1, ability.BaseDamage);
// HealSelf uses the magnitude of BaseDamage so test rows can use negative
// values (for "negative damage = heal" semantics) without being clamped to 1.
int healAmount = Math.Max(1, Math.Abs(ability.BaseDamage));
int oldHealth = mob.Health;
mob.Health = Math.Min(mob.MaxHealth, mob.Health + healAmount);
int actualHealed = mob.Health - oldHealth;