From ca88eef6004d0921bc903f4d75f79e42c7029cdf Mon Sep 17 00:00:00 2001 From: dingo Date: Wed, 11 Feb 2026 07:49:47 -0500 Subject: [PATCH] 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 --- Game/Dungeon/DungeonSimulation.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Game/Dungeon/DungeonSimulation.cs b/Game/Dungeon/DungeonSimulation.cs index 68700f0..8decbff 100644 --- a/Game/Dungeon/DungeonSimulation.cs +++ b/Game/Dungeon/DungeonSimulation.cs @@ -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;