From fcbf21298ea7b8448528a2c17a102e79fb7ebde0 Mon Sep 17 00:00:00 2001 From: xanunderscore <149614526+xanunderscore@users.noreply.github.com> Date: Sat, 1 Feb 2025 16:12:01 -0500 Subject: [PATCH] prevent preemptive use of potion for % based damage --- BossMod/Autorotation/Standard/xan/AI/DeepDungeon.cs | 2 +- BossMod/Data/Actor.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BossMod/Autorotation/Standard/xan/AI/DeepDungeon.cs b/BossMod/Autorotation/Standard/xan/AI/DeepDungeon.cs index eb3c7a231a..41e0cffb61 100644 --- a/BossMod/Autorotation/Standard/xan/AI/DeepDungeon.cs +++ b/BossMod/Autorotation/Standard/xan/AI/DeepDungeon.cs @@ -78,7 +78,7 @@ public override void Execute(StrategyValues strategy, ref Actor? primaryTarget, if (regenAction != default && ShouldPotion(strategy)) Hints.ActionsToExecute.Push(regenAction, Player, ActionQueue.Priority.Medium); - if (potAction != default && Player.PredictedHPRatio <= 0.3f) + if (potAction != default && Player.HPRatio <= 0.3f) Hints.ActionsToExecute.Push(potAction, Player, ActionQueue.Priority.VeryHigh); } diff --git a/BossMod/Data/Actor.cs b/BossMod/Data/Actor.cs index c01f99c11b..8304564acc 100644 --- a/BossMod/Data/Actor.cs +++ b/BossMod/Data/Actor.cs @@ -126,6 +126,7 @@ public sealed class Actor(ulong instanceID, uint oid, int spawnIndex, string nam public bool IsFriendlyNPC => Type == ActorType.Enemy && IsAlly && IsTargetable; public bool IsStrikingDummy => NameID == 541; // this is a hack, but striking dummies are special in some ways public int CharacterSpawnIndex => SpawnIndex < 200 && (SpawnIndex & 1) == 0 ? (SpawnIndex >> 1) : -1; // [0,100) for 'real' characters, -1 otherwise + public float HPRatio => (float)HPMP.CurHP / HPMP.MaxHP; public int PendingHPDiffence => PendingHPDifferences.Sum(p => p.Value); public int PendingMPDiffence => PendingMPDifferences.Sum(p => p.Value); public int PredictedHPRaw => (int)HPMP.CurHP + PendingHPDiffence;