Skip to content

Commit

Permalink
moar
Browse files Browse the repository at this point in the history
  • Loading branch information
Akechi-kun committed Feb 1, 2025
1 parent f0106fd commit 522ebfe
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
17 changes: 12 additions & 5 deletions BossMod/Autorotation/Standard/akechi/AkechiDRK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ public enum OGCDPriority
public Enemy? BestTargetMPRectLow;
#endregion

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

#region Gauge
var gauge = World.Client.GetGauge<DarkKnightGauge>(); //Retrieve DRK gauge
Blood = gauge.Blood;
Expand All @@ -162,6 +163,7 @@ public override void Execution(StrategyValues strategy, Enemy? primaryTarget) //
ComboLastMove is AID.SyphonStrike or AID.Unleash && Blood >= 80 || Delirium.CD <= 3 && Blood >= 70; //Checks if we are risking Blood
RiskingMP = MP >= 9800 || Darkside.NeedsRefresh;
#endregion

#region Cooldowns
SaltedEarth.Left = StatusRemaining(Player, SID.SaltedEarth, 15); //Retrieve current Salted Earth time left
SaltedEarth.CD = TotalCD(AID.SaltedEarth); //Retrieve current Salted Earth cooldown
Expand Down Expand Up @@ -189,6 +191,7 @@ public override void Execution(StrategyValues strategy, Enemy? primaryTarget) //
Shadowbringer.HasCharges = TotalCD(AID.Shadowbringer) <= 60; //Checks if Shadowbringer has charges
Shadowbringer.IsReady = Unlocked(AID.Shadowbringer) && Shadowbringer.HasCharges; //Shadowbringer ability
#endregion

#region Strategy Definitions
var mp = strategy.Option(Track.MP);
var mpStrat = mp.As<MPStrategy>(); //Retrieve MP strategy
Expand All @@ -211,17 +214,21 @@ public override void Execution(StrategyValues strategy, Enemy? primaryTarget) //
var unmend = strategy.Option(Track.Unmend);
var unmendStrat = unmend.As<UnmendStrategy>(); //Retrieve Unmend strategy
#endregion

#region Misc
ShouldUseAOE = ShouldUseAOECircle(5).OnThreeOrMore;
(BestAOERectTargets, NumAOERectTargets) = GetBestTarget(PlayerTarget, 10, (primary, other) => Hints.TargetInAOERect(other, Player.Position, Player.DirectionTo(primary), 10, 3.5f));
BestTargetAOERect = Unlocked(AID.Shadowbringer) && NumAOERectTargets >= 2
? BestAOERectTargets
: primaryTarget;
BestTargetMPRectHigh = Unlocked(AID.FloodOfShadow) && NumAOERectTargets >= 3
? BestAOERectTargets // Use AoE rectangle targets if there are at least 3
: primaryTarget; // Fallback to primaryTarget or PlayerTarget if no AoE targets
? BestAOERectTargets
: primaryTarget;
BestTargetMPRectLow = !Unlocked(AID.FloodOfShadow) && NumAOERectTargets >= 4
? BestAOERectTargets // Use AoE rectangle targets if there are at least 4
: primaryTarget; // Fallback to primaryTarget or PlayerTarget if no AoE targets
? BestAOERectTargets
: primaryTarget;
#endregion

#endregion

#region Full Rotation Execution
Expand Down
35 changes: 24 additions & 11 deletions BossMod/Autorotation/Standard/akechi/AkechiTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ protected bool CanWeave(AID aid, int extraGCDs = 0, float extraFixedDelay = 0)
/// This function attempts to pick a suitable primary target automatically, even if a target is not already picked.
/// </summary>
/// <param name="strategy">The user's picked <b>Strategy</b></param>
/// <param name="primaryTarget">The user's current <b>picked Target</b>.</param>
/// <param name="primaryTarget">The user's current <b>specified Target</b>.</param>
/// <param name="range"></param>
protected void GetPrimaryTarget(StrategyValues strategy, ref Enemy? primaryTarget, float range)
{
Expand Down Expand Up @@ -969,11 +969,6 @@ P targetPrio(Actor potentialTarget)

//TODO: implement this soon
protected Actor? AnyTarget { get; private set; }

/// <summary>
/// Checks if target is valid. (e.g. not forbidden or a party member)
/// </summary>
protected static bool IsValidEnemy(Actor? actor) => actor != null && !actor.IsAlly;
#endregion

#region Positionals
Expand Down Expand Up @@ -1002,20 +997,30 @@ P targetPrio(Actor potentialTarget)
/// <param name="target">The user's specified <b>Target</b>.</param>
/// <returns></returns>
protected bool IsOnFlank(Actor target) => GetCurrentPositional(target) == Positional.Flank;

/// <summary>
/// Finds the <b>best Positional</b> automatically.
/// </summary>
///
#endregion

#region AI
/// <summary>
/// Establishes a goal-zone for a single target within a specified range.<br/>
/// Primarily utilized by <b>caster-DPS</b> jobs that lack a dedicated maximize-AOE function.
/// </summary>
/// <param name="range">The range within which the goal zone is applied.</param>
protected void GoalZoneSingle(float range)
{
if (PlayerTarget != null)
Hints.GoalZones.Add(Hints.GoalSingleTarget(PlayerTarget.Actor, range));
}

/// <summary>
/// Defines a goal-zone using a combined strategy, factoring in AOE considerations.
/// </summary>
/// <param name="strategy">The strategy values that influence the goal zone logic.</param>
/// <param name="range">The base range for the goal zone.</param>
/// <param name="fAoe">A function determining the area of effect.</param>
/// <param name="firstUnlockedAoeAction">The first available AOE action.</param>
/// <param name="minAoe">The minimum number of targets required to trigger AOE.</param>
/// <param name="positional">The positional requirement for the goal zone (default: any).</param>
/// <param name="maximumActionRange">An optional parameter specifying the maximum action range.</param>
protected void GoalZoneCombined(StrategyValues strategy, float range, Func<WPos, float> fAoe, AID firstUnlockedAoeAction, int minAoe, Positional positional = Positional.Any, float? maximumActionRange = null)
{
if (!strategy.ForceAOE() && !Unlocked(firstUnlockedAoeAction))
Expand Down Expand Up @@ -1049,6 +1054,7 @@ protected void GoalZoneCombined(StrategyValues strategy, float range, Func<WPos,
/// <summary>Time remaining on pre-pull (or any) <b>Countdown Timer</b>.</summary>
protected float? CountdownRemaining { get; private set; }

/// <summary>Checks if player is currently <b>moving</b>.</summary>
protected bool IsMoving { get; private set; }
#endregion

Expand Down Expand Up @@ -1107,6 +1113,13 @@ public sealed override void Execute(StrategyValues strategy, ref Actor? primaryT
if (Player.MountId is not (103 or 117 or 128))
Execution(strategy, PlayerTarget);
}

/// <summary>
/// The core function responsible for orchestrating the execution of all abilities and strategies.<br/>
/// </summary>
/// <param name="strategy">The user's specified <b>Strategy</b>.</param>
/// <param name="primaryTarget">The user's specified <b>Enemy</b>.</param>
/// <returns>- <b>Primary execution</b> of user's rotation module.</returns>
public abstract void Execution(StrategyValues strategy, Enemy? primaryTarget);
}

Expand Down

0 comments on commit 522ebfe

Please sign in to comment.