Skip to content

Commit

Permalink
optimal DOT targeting
Browse files Browse the repository at this point in the history
  • Loading branch information
Akechi-kun committed Feb 8, 2025
1 parent 80d9a12 commit 1c02eae
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 114 deletions.
6 changes: 6 additions & 0 deletions BossMod/Autorotation/Standard/akechi/AkechiTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,12 @@ public static float TargetHPP(Actor? target = null)
/// - <c><b>FALSE</b></c> if otherwise or last action was not a combo action.</returns>
protected AID ComboLastMove => (AID)(object)World.Client.ComboState.Action;

/// <summary>
/// Checks the <b>time left remaining</b> inside current combo before expiration.<para/>
/// <c><b>NOTE</b></c>: This does <c><b>NOT</b></c> check all actions, only combo actions.<para/>
/// </summary>
protected float ComboTimer => (float)(object)World.Client.ComboState.Remaining;

/// <summary>
/// Retrieves <b>actual cast time</b> of a specified action.<para/>
/// Example:<br/>
Expand Down
35 changes: 23 additions & 12 deletions BossMod/Autorotation/Standard/akechi/DPS/AkechiBLM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,15 @@ private AID BestXenoglossy
private bool canRetrace; //Can use Retrace
private bool canBTL; //Can use Between the Lines
private bool hasThunderhead; //Has Thunderhead buff
private float ThunderLeft; //Time left on DOT effect (30s base)
public bool canOpen; //Can use opener
private float thunderLeft; //Time left on DOT effect (30s base)
private bool canOpen; //Can use opener
private bool ShouldUseAOE;
private int NumSplashTargets;
private Enemy? BestSplashTargets;
private Enemy? BestDOTTargets;
private Enemy? BestSplashTarget;
private Enemy? BestDOTTarget;

#endregion

#region Module Helpers
Expand Down Expand Up @@ -264,16 +267,18 @@ public override void Execution(StrategyValues strategy, Enemy? primaryTarget)
canRetrace = ActionReady(AID.Retrace) && PlayerHasEffect(SID.LeyLines, 30); //Can use Retrace
canBTL = ActionReady(AID.BetweenTheLines) && PlayerHasEffect(SID.LeyLines, 30); //Can use Between the Lines
hasThunderhead = PlayerHasEffect(SID.Thunderhead, 30); //Has Thunderhead buff
ThunderLeft = Utils.MaxAll( //Time left on DOT effect
thunderLeft = Utils.MaxAll( //Time left on DOT effect
StatusDetails(BestSplashTarget?.Actor, SID.Thunder, Player.InstanceID, 24).Left,
StatusDetails(BestSplashTarget?.Actor, SID.ThunderII, Player.InstanceID, 18).Left,
StatusDetails(BestSplashTarget?.Actor, SID.ThunderIII, Player.InstanceID, 27).Left,
StatusDetails(BestSplashTarget?.Actor, SID.ThunderIV, Player.InstanceID, 21).Left,
StatusDetails(BestSplashTarget?.Actor, SID.HighThunder, Player.InstanceID, 30).Left,
StatusDetails(BestSplashTarget?.Actor, SID.HighThunderII, Player.InstanceID, 24).Left);
ShouldUseAOE = Unlocked(AID.Blizzard2) && NumSplashTargets > 2;
(BestSplashTargets, NumSplashTargets) = GetBestTarget(BestSplashTarget, 25, IsSplashTarget);
(BestSplashTargets, NumSplashTargets) = GetBestTarget(primaryTarget, 25, IsSplashTarget);
(BestDOTTargets, thunderLeft) = GetDOTTarget(strategy, primaryTarget, ThunderLeft, 2);
BestSplashTarget = ShouldUseAOE ? BestSplashTargets : primaryTarget;
BestDOTTarget = Unlocked(AID.Thunder1) ? BestDOTTargets : primaryTarget;
canOpen = TotalCD(AID.LeyLines) <= 120
&& TotalCD(AID.Triplecast) <= 0.1f
&& TotalCD(AID.Manafont) <= 0.1f
Expand Down Expand Up @@ -406,18 +411,18 @@ movingOption is CastingOption.Forbid &&
{
if (strategy.Automatic())
QueueGCD(BestThunder,
TargetChoice(thunder),
ThunderLeft <= 3 ? GCDPriority.NeedDOT :
TargetChoice(thunder) ?? (ShouldUseAOE ? BestSplashTargets?.Actor : BestDOTTarget?.Actor),
thunderLeft <= 3 ? GCDPriority.NeedDOT :
GCDPriority.DOT);
if (strategy.ForceST())
QueueGCD(BestThunderST,
TargetChoice(thunder) ?? BestSplashTarget?.Actor,
ThunderLeft <= 3 ? GCDPriority.NeedDOT :
thunderLeft <= 3 ? GCDPriority.NeedDOT :
GCDPriority.DOT);
if (strategy.ForceAOE())
QueueGCD(BestThunderAOE,
TargetChoice(thunder) ?? BestSplashTarget?.Actor,
ThunderLeft <= 3 ? GCDPriority.NeedDOT :
thunderLeft <= 3 ? GCDPriority.NeedDOT :
GCDPriority.DOT);
}
//Polyglots
Expand Down Expand Up @@ -1004,16 +1009,22 @@ private void BestAOE(Actor? target) //AOE rotation based on level
#endregion

#region Cooldown Helpers

#region DOT
private static SID[] GetDotStatus() => [SID.Thunder, SID.ThunderII, SID.ThunderIII, SID.ThunderIV, SID.HighThunder, SID.HighThunderII];
private float ThunderLeft(Actor? target) => target == null ? float.MaxValue : GetDotStatus().Select(stat => StatusDetails(target, (uint)stat, Player.InstanceID).Left).FirstOrDefault(dur => dur > 0);
private bool ShouldUseThunder(Actor? target, ThunderStrategy strategy) => strategy switch
{
ThunderStrategy.Thunder3 => Player.InCombat && target != null && hasThunderhead && ThunderLeft <= 3 && In25y(target),
ThunderStrategy.Thunder6 => Player.InCombat && target != null && hasThunderhead && ThunderLeft <= 6 && In25y(target),
ThunderStrategy.Thunder9 => Player.InCombat && target != null && hasThunderhead && ThunderLeft <= 9 && In25y(target),
ThunderStrategy.Thunder0 => Player.InCombat && target != null && hasThunderhead && ThunderLeft is 0 && In25y(target),
ThunderStrategy.Thunder3 => Player.InCombat && target != null && hasThunderhead && thunderLeft <= 3 && In25y(target),
ThunderStrategy.Thunder6 => Player.InCombat && target != null && hasThunderhead && thunderLeft <= 6 && In25y(target),
ThunderStrategy.Thunder9 => Player.InCombat && target != null && hasThunderhead && thunderLeft <= 9 && In25y(target),
ThunderStrategy.Thunder0 => Player.InCombat && target != null && hasThunderhead && thunderLeft is 0 && In25y(target),
ThunderStrategy.Force => hasThunderhead,
ThunderStrategy.Delay => false,
_ => false
};
#endregion

private bool ShouldSpendPolyglot(Actor? target, PolyglotStrategy strategy) => strategy switch
{
PolyglotStrategy.AutoSpendAll => target != null && UsePolyglots(),
Expand Down
Loading

0 comments on commit 1c02eae

Please sign in to comment.