Skip to content

Commit

Permalink
ST stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Akechi-kun committed Feb 2, 2025
1 parent bd6677b commit 2a1d69e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 45 deletions.
4 changes: 2 additions & 2 deletions BossMod/Autorotation/Standard/akechi/AkechiTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace BossMod.Autorotation.akechi;
/// <summary>
/// The <b>SharedTrack</b> enum used for <b>AOE</b> and <b>Hold</b> strategies, typically for modules featuring damage rotations.
/// <br>This enum defines tracks that can be used for all PvE-related abilities, such as strategies containing standard rotations or holding abilities.</br>
/// <br>This enum defines tracks that can be used for all PvE classes and jobs, such as strategies containing executing standard rotations or explicitly holding abilities.</br>
/// <para><b>Example Given:</b>
/// <br>- <c>public enum Track { NoMercy = SharedTrack.Count }</c></br></para>
/// <para><b>Explanation:</b>
Expand Down Expand Up @@ -1124,7 +1124,7 @@ public sealed override void Execute(StrategyValues strategy, ref Actor? primaryT
CanSwiftcast = ActionUnlocked(ActionID.MakeSpell(ClassShared.AID.Swiftcast)) && World.Client.Cooldowns[ActionDefinitions.Instance.Spell(ClassShared.AID.Swiftcast)!.MainCooldownGroup].Remaining < 0.6f;
HasSwiftcast = StatusRemaining(Player, ClassShared.SID.Swiftcast, 10) > 0.1f;
CanPeloton = !Player.InCombat && ActionUnlocked(ActionID.MakeSpell(ClassShared.AID.Peloton)) && World.Client.Cooldowns[ActionDefinitions.Instance.Spell(ClassShared.AID.Peloton)!.MainCooldownGroup].Remaining < 0.6f;
HasPeloton = StatusRemaining(Player, ClassShared.SID.Peloton, 30) > 0.1f;
HasPeloton = PlayerHasAnyEffect(BRD.SID.Peloton);

if (Player.MountId is not (103 or 117 or 128))
Execution(strategy, PlayerTarget);
Expand Down
106 changes: 63 additions & 43 deletions BossMod/Autorotation/Standard/akechi/Tank/AkechiWAR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public sealed class AkechiWAR(RotationModuleManager manager, Actor player) : Ake
#region Enums: Abilities / Strategies
public enum Track { Gauge = SharedTrack.Count, SurgingTempest, Infuriate, PrimalRend, Upheaval, Onslaught, Tomahawk, Potion, InnerRelease, PrimalWrath, PrimalRuination }
public enum GaugeStrategy { Automatic, OnlyST, OnlyAOE, ForceST, ForceAOE, Conserve }
public enum SurgingTempestStrategy { Automatic, At30s, LastSecond, ForceEye, ForcePath, Delay }
public enum SurgingTempestStrategy { Automatic, At30s, ForceEye, ForcePath, Delay }
public enum InfuriateStrategy { Automatic, Force, ForceOvercap, Delay }
public enum PrimalRendStrategy { Automatic, ASAP, ASAPNotMoving, AfterBF, LastSecond, GapClose, Force, Delay }
public enum UpheavalStrategy { Automatic, OnlyUpheaval, OnlyOrogeny, ForceUpheaval, ForceOrogeny, Delay }
Expand All @@ -35,9 +35,8 @@ public static RotationModuleDefinition Definition()
.AddOption(GaugeStrategy.Conserve, "Conserve", "Conserves all Gauge-related abilities as much as possible", 0, 0, ActionTargets.None, 35)
.AddAssociatedActions(AID.InnerBeast, AID.FellCleave, AID.InnerChaos, AID.Decimate, AID.ChaoticCyclone);
res.Define(Track.SurgingTempest).As<SurgingTempestStrategy>("Surging Tempest", "S.Tempest", uiPriority: 200)
.AddOption(SurgingTempestStrategy.Automatic, "Auto", "Automatically refreshes Surging Tempest when 8s or less on its duration", minLevel: 50)
.AddOption(SurgingTempestStrategy.Automatic, "Auto", "Automatically refreshes Surging Tempest when 10s or less on its duration", minLevel: 50)
.AddOption(SurgingTempestStrategy.At30s, "At 30s", "Refresh Surging Tempest at less than or equal to 30s", 0, 10, ActionTargets.Hostile, 50)
.AddOption(SurgingTempestStrategy.LastSecond, "Last Second", "Refresh Surging Tempest at last possible second without dropping it", 0, 10, ActionTargets.Hostile, 50)
.AddOption(SurgingTempestStrategy.ForceEye, "Force Eye", "Force use Storm's Eye as combo ender", 0, 10, ActionTargets.Hostile, 50)
.AddOption(SurgingTempestStrategy.ForcePath, "Force Path", "Force use Storm's Path as combo ender, essentially delaying Surging Tempest ", 0, 10, ActionTargets.Hostile, 26)
.AddAssociatedActions(AID.StormEye, AID.StormPath);
Expand Down Expand Up @@ -95,7 +94,7 @@ public static RotationModuleDefinition Definition()
#endregion

#region Priorities
private GCDPriority FCprio()
private GCDPriority FellCleave()
{
var ncActive = CanFitSkSGCD(NascentChaos.Left);
if (ncActive)
Expand All @@ -122,18 +121,18 @@ private GCDPriority FCprio()
if (needFCBeforeInf && !CanFitSkSGCD(InnerRelease.CD, 1) && !CanFitSkSGCD(Infuriate.TotalCD - (Unlocked(TraitID.EnhancedInfuriate) ? 5 : 0) * imminentIRStacks - SkSGCDLength, imminentIRStacks))
return GCDPriority.AvoidOvercapInfuriateIR;

if (CanFitSkSGCD(OddMinuteLeft))
if (CanFitSkSGCD(BurstWindowLeft))
return irActive ? GCDPriority.BuffedIR : GCDPriority.BuffedFC;

if (irActive)
{
var maxFillers = (int)((InnerRelease.Left - GCD) / SkSGCDLength) + 1 - effectiveIRStacks;
var canDelayFC = maxFillers > 0 && !CanFitSkSGCD(OddMinuteIn, maxFillers);
var canDelayFC = maxFillers > 0 && !CanFitSkSGCD(BurstWindowIn, maxFillers);
return canDelayFC ? GCDPriority.DelayFC : GCDPriority.FlexibleIR;
}
else if (ncActive)
{
return NascentChaos.Left > OddMinuteIn ? GCDPriority.DelayFC : GCDPriority.FlexibleFC;
return NascentChaos.Left > BurstWindowIn ? GCDPriority.DelayFC : GCDPriority.FlexibleFC;
}
else
{
Expand Down Expand Up @@ -192,12 +191,13 @@ public enum OGCDPriority
#endregion

#region Module Variables
public float EvenMinuteLeft;
public float EvenMinuteIn;
public float OddMinuteLeft;
public float OddMinuteIn;
public float TwoMinuteLeft;
public float TwoMinuteIn;
public float BurstWindowLeft;
public float BurstWindowIn;
public bool ForceEye;
public bool ForcePath;
public bool KeepAt30s;
public byte BeastGauge;
public bool ShouldUseAOE;
public int NumSplashTargets;
Expand All @@ -211,7 +211,7 @@ public enum OGCDPriority
public (float Left, bool IsActive, bool IsReady) PrimalRend;
public (float Left, bool IsActive, bool IsReady) PrimalWrath;
public (float Left, bool IsActive, bool IsReady) PrimalRuination;
public (float Left, bool IsActive, bool NeedsRefresh) SurgingTempest;
public (float Left, bool IsActive, bool NeedsRefresh, bool KeepAt30s) SurgingTempest;
public (float TotalCD, float ChargeCD, bool HasCharges, bool IsReady) Infuriate;
public (float Left, int Stacks, float CD, bool IsActive, bool IsReady) InnerRelease;
#endregion
Expand All @@ -231,13 +231,36 @@ public bool IsRiskingGauge()

return false;
}
public bool DumpGauge(Enemy? target) => BeastGauge >= 50 &&
(TargetHPP(target?.Actor) <= 3 || InnerRelease.CD <= (SkSGCDLength * 2) + 0.5f && !NascentChaos.IsActive);

public override void Execution(StrategyValues strategy, Enemy? primaryTarget) //Executes our actions
{
#region Variables

#region Strategy Definitions
var bg = strategy.Option(Track.Gauge);
var bgStrat = bg.As<GaugeStrategy>(); //Retrieve Gauge strategy
var st = strategy.Option(Track.SurgingTempest);
var stStrat = st.As<SurgingTempestStrategy>(); //Retrieve SurgingTempest strategy
var uo = strategy.Option(Track.Upheaval);
var uoStrat = uo.As<UpheavalStrategy>(); //Retrieve Upheaval strategy
var ir = strategy.Option(Track.InnerRelease);
var irStrat = ir.As<OGCDStrategy>(); //Retrieve InnerRelease strategy
var inf = strategy.Option(Track.Infuriate);
var infStrat = inf.As<InfuriateStrategy>(); //Retrieve Infuriate strategy
var prend = strategy.Option(Track.PrimalRend);
var prendStrat = prend.As<PrimalRendStrategy>(); //Retrieve InnerRelease combo strategy
var pwrath = strategy.Option(Track.PrimalWrath);
var pwrathStrat = pwrath.As<OGCDStrategy>(); //Retrieve PrimalWrath strategy
var pruin = strategy.Option(Track.PrimalRuination);
var pruinStrat = pruin.As<GCDStrategy>(); //Retrieve PrimalRuination strategy
var ons = strategy.Option(Track.Onslaught);
var onsStrat = ons.As<OnslaughtStrategy>(); //Retrieve Onslaught strategy
var Tomahawk = strategy.Option(Track.Tomahawk);
var TomahawkStrat = Tomahawk.As<TomahawkStrategy>(); //Retrieve Tomahawk strategy
ForceEye = stStrat is SurgingTempestStrategy.ForceEye;
ForcePath = stStrat is SurgingTempestStrategy.ForcePath;
KeepAt30s = stStrat is SurgingTempestStrategy.At30s;
#endregion

#region Gauge
var gauge = World.Client.GetGauge<WarriorGauge>(); //Retrieve WAR gauge
BeastGauge = gauge.BeastGauge;
Expand All @@ -246,7 +269,9 @@ public override void Execution(StrategyValues strategy, Enemy? primaryTarget) //
#region Cooldowns
SurgingTempest.Left = StatusRemaining(Player, SID.SurgingTempest, 60); //Retrieve current SurgingTempest time left
SurgingTempest.IsActive = SurgingTempest.Left > 0.1f; //Checks if SurgingTempest is active
SurgingTempest.NeedsRefresh = SurgingTempest.Left <= ((SkSGCDLength * 3) + 0.5f); //Checks if SurgingTempest needs to be refreshed
SurgingTempest.KeepAt30s = SurgingTempest.Left <= 30; //Checks if SurgingTempest needs to be refreshed once less than 30s
//TODO: optimize
SurgingTempest.NeedsRefresh = ShouldRefreshTempest(stStrat); //Checks if SurgingTempest needs to be refreshed, roughly 4 GCDs to refresh it

Upheaval.CD = TotalCD(AID.Upheaval); //Retrieve current Upheaval cooldown
Upheaval.IsReady = Unlocked(AID.Upheaval) && Upheaval.CD < 0.6f; //Upheaval ability
Expand Down Expand Up @@ -298,34 +323,10 @@ public override void Execution(StrategyValues strategy, Enemy? primaryTarget) //
}
#endregion

#region Strategy Definitions
var bg = strategy.Option(Track.Gauge);
var bgStrat = bg.As<GaugeStrategy>(); //Retrieve Gauge strategy
var st = strategy.Option(Track.SurgingTempest);
var stStrat = st.As<SurgingTempestStrategy>(); //Retrieve SurgingTempest strategy
var uo = strategy.Option(Track.Upheaval);
var uoStrat = uo.As<UpheavalStrategy>(); //Retrieve Upheaval strategy
var ir = strategy.Option(Track.InnerRelease);
var irStrat = ir.As<OGCDStrategy>(); //Retrieve InnerRelease strategy
var inf = strategy.Option(Track.Infuriate);
var infStrat = inf.As<InfuriateStrategy>(); //Retrieve Infuriate strategy
var prend = strategy.Option(Track.PrimalRend);
var prendStrat = prend.As<PrimalRendStrategy>(); //Retrieve InnerRelease combo strategy
var pwrath = strategy.Option(Track.PrimalWrath);
var pwrathStrat = pwrath.As<OGCDStrategy>(); //Retrieve PrimalWrath strategy
var pruin = strategy.Option(Track.PrimalRuination);
var pruinStrat = pruin.As<GCDStrategy>(); //Retrieve PrimalRuination strategy
var ons = strategy.Option(Track.Onslaught);
var onsStrat = ons.As<OnslaughtStrategy>(); //Retrieve Onslaught strategy
var Tomahawk = strategy.Option(Track.Tomahawk);
var TomahawkStrat = Tomahawk.As<TomahawkStrategy>(); //Retrieve Tomahawk strategy
ForceEye = stStrat is SurgingTempestStrategy.ForceEye;
ForcePath = stStrat is SurgingTempestStrategy.ForcePath;
#endregion
ShouldUseAOE = ShouldUseAOECircle(5).OnThreeOrMore;
(BestSplashTargets, NumSplashTargets) = GetBestTarget(primaryTarget, 20, IsSplashTarget);
BestSplashTarget = Unlocked(AID.PrimalRend) && NumSplashTargets >= 2 ? BestSplashTargets : primaryTarget;
(EvenMinuteLeft, EvenMinuteIn) = EstimateRaidBuffTimings(primaryTarget?.Actor);
(TwoMinuteLeft, TwoMinuteIn) = EstimateRaidBuffTimings(primaryTarget?.Actor);
#endregion

#region Full Rotation Execution
Expand Down Expand Up @@ -443,7 +444,7 @@ or OnslaughtStrategy.GapClose
bgStrat is GaugeStrategy.ForceST
or GaugeStrategy.ForceAOE
? GCDPriority.ForcedGCD
: FCprio());
: FellCleave());
if (bgStrat is GaugeStrategy.OnlyST)
QueueGCD(AID.FellCleave,
TargetChoice(bg) ?? primaryTarget?.Actor,
Expand Down Expand Up @@ -528,6 +529,25 @@ bgStrat is GaugeStrategy.ForceAOE
GaugeStrategy.Automatic => Player.InCombat && target != null && In3y(target?.Actor) && Unlocked(BestFellCleave) && SurgingTempest.IsActive && (BeastGauge >= 50 || InnerRelease.Stacks > 0),
_ => false
};
public bool ShouldDumpGauge(Enemy? target) => BeastGauge >= 50 &&
(TargetHPP(target?.Actor) <= 3 || InnerRelease.CD <= (SkSGCDLength * 2) + 0.5f && !NascentChaos.IsActive);

public bool ShouldRefreshTempest(SurgingTempestStrategy strategy)
{
if (!Unlocked(AID.StormEye) || strategy is SurgingTempestStrategy.Delay || strategy is SurgingTempestStrategy.ForcePath)
return false;

if (strategy is SurgingTempestStrategy.Automatic)
return SurgingTempest.Left <= 10;

if (strategy is SurgingTempestStrategy.At30s)
return SurgingTempest.Left <= 30;

if (strategy is SurgingTempestStrategy.ForceEye)
return SurgingTempest.Left >= 0;

return false;
}
private bool ShouldUseUpheavalOrOrogeny(UpheavalStrategy strategy, Enemy? target) => strategy switch
{
UpheavalStrategy.Automatic => ShouldSpendUpheavalOrOrogeny(UpheavalStrategy.Automatic, target),
Expand Down Expand Up @@ -616,7 +636,7 @@ private bool ShouldUseInfuriate(InfuriateStrategy strategy, Enemy? target)
if (BeastGauge + gaugeGained + 50 > 100 && !CanFitSkSGCD(SurgingTempest.Left, costedGCDs))
return false;

return CanFitSkSGCD(OddMinuteLeft);
return CanFitSkSGCD(BurstWindowLeft);
}
private bool ShouldUsePrimalRend(PrimalRendStrategy strategy, Enemy? target) => strategy switch
{
Expand Down

0 comments on commit 2a1d69e

Please sign in to comment.