From f7400ff673a73f21f39730387edcb35406af4251 Mon Sep 17 00:00:00 2001 From: Karaha-Baruha Date: Tue, 22 Oct 2024 23:37:38 -0500 Subject: [PATCH 1/2] Add ability to target by HP percentage --- RotationSolver.Basic/Actions/ActionTargetInfo.cs | 2 ++ RotationSolver.Basic/Data/TargetType.cs | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/RotationSolver.Basic/Actions/ActionTargetInfo.cs b/RotationSolver.Basic/Actions/ActionTargetInfo.cs index 2052df350..abea85dc6 100644 --- a/RotationSolver.Basic/Actions/ActionTargetInfo.cs +++ b/RotationSolver.Basic/Actions/ActionTargetInfo.cs @@ -988,6 +988,8 @@ private readonly bool CanGetTarget(IGameObject target, IGameObject subTarget) TargetingType.Small => IGameObjects.OrderBy(p => p.HitboxRadius), TargetingType.HighHP => IGameObjects.OrderByDescending(p => p is IBattleChara b ? b.CurrentHp : 0), TargetingType.LowHP => IGameObjects.OrderBy(p => p is IBattleChara b ? b.CurrentHp : 0), + TargetingType.HighHPPercent => IGameObjects.OrderByDescending(p => p is IBattleChara b ? b.CurrentHp / b.MaxHp : 0), + TargetingType.LowHPPercent => IGameObjects.OrderBy(p => p is IBattleChara b ? b.CurrentHp / b.MaxHp : 0), TargetingType.HighMaxHP => IGameObjects.OrderByDescending(p => p is IBattleChara b ? b.MaxHp : 0), TargetingType.LowMaxHP => IGameObjects.OrderBy(p => p is IBattleChara b ? b.MaxHp : 0), TargetingType.Nearest => IGameObjects.OrderBy(p => p.DistanceToPlayer()), diff --git a/RotationSolver.Basic/Data/TargetType.cs b/RotationSolver.Basic/Data/TargetType.cs index 0e898dd85..6e1a32140 100644 --- a/RotationSolver.Basic/Data/TargetType.cs +++ b/RotationSolver.Basic/Data/TargetType.cs @@ -29,6 +29,18 @@ public enum TargetingType [Description("Low HP")] LowHP, + /// + /// Find the target whose max HP is highest. + /// + [Description("High HP%")] + HighHPPercent, + + /// + /// Find the target whose max HP is highest. + /// + [Description("Low HP%")] + LowHPPercent, + /// /// Find the target whose max HP is highest. /// From 14deb2b758173f546dd3055784ce7f1a51863dd7 Mon Sep 17 00:00:00 2001 From: Karaha-Baruha Date: Wed, 23 Oct 2024 00:42:31 -0500 Subject: [PATCH 2/2] change the descriptions when you copy paste kids --- RotationSolver.Basic/Data/TargetType.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RotationSolver.Basic/Data/TargetType.cs b/RotationSolver.Basic/Data/TargetType.cs index 6e1a32140..226c673c7 100644 --- a/RotationSolver.Basic/Data/TargetType.cs +++ b/RotationSolver.Basic/Data/TargetType.cs @@ -30,13 +30,13 @@ public enum TargetingType LowHP, /// - /// Find the target whose max HP is highest. + /// Find the target whose HP percentage is highest. /// [Description("High HP%")] HighHPPercent, /// - /// Find the target whose max HP is highest. + /// Find the target whose HP percentage is lowest. /// [Description("Low HP%")] LowHPPercent,