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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user