Skip to content

Commit

Permalink
Merge pull request #437 from Karaha-Baruha/main
Browse files Browse the repository at this point in the history
Add ability to target by HP percentage
  • Loading branch information
LTS-FFXIV authored Oct 23, 2024
2 parents 94b3f69 + 14deb2b commit fee5ea2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Actions/ActionTargetInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,8 @@ private readonly bool CanGetTarget(IGameObject target, IGameObject subTarget)
TargetingType.Small => IGameObjects.OrderBy<IGameObject, float>(p => p.HitboxRadius),
TargetingType.HighHP => IGameObjects.OrderByDescending<IGameObject, uint>(p => p is IBattleChara b ? b.CurrentHp : 0),
TargetingType.LowHP => IGameObjects.OrderBy<IGameObject, uint>(p => p is IBattleChara b ? b.CurrentHp : 0),
TargetingType.HighHPPercent => IGameObjects.OrderByDescending<IGameObject, float>(p => p is IBattleChara b ? b.CurrentHp / b.MaxHp : 0),
TargetingType.LowHPPercent => IGameObjects.OrderBy<IGameObject, float>(p => p is IBattleChara b ? b.CurrentHp / b.MaxHp : 0),
TargetingType.HighMaxHP => IGameObjects.OrderByDescending<IGameObject, uint>(p => p is IBattleChara b ? b.MaxHp : 0),
TargetingType.LowMaxHP => IGameObjects.OrderBy<IGameObject, uint>(p => p is IBattleChara b ? b.MaxHp : 0),
TargetingType.Nearest => IGameObjects.OrderBy<IGameObject, float>(p => p.DistanceToPlayer()),
Expand Down
12 changes: 12 additions & 0 deletions RotationSolver.Basic/Data/TargetType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ public enum TargetingType
[Description("Low HP")]
LowHP,

/// <summary>
/// Find the target whose HP percentage is highest.
/// </summary>
[Description("High HP%")]
HighHPPercent,

/// <summary>
/// Find the target whose HP percentage is lowest.
/// </summary>
[Description("Low HP%")]
LowHPPercent,

/// <summary>
/// Find the target whose max HP is highest.
/// </summary>
Expand Down

0 comments on commit fee5ea2

Please sign in to comment.