Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
level check and formatting
Browse files Browse the repository at this point in the history
added check and fixed formatting to correctly create arrays for method calls, tested sub 50, 70, 80, and 90
  • Loading branch information
LTS-FFXIV authored Apr 25, 2024
1 parent 7b31c8d commit dfedb79
Showing 1 changed file with 41 additions and 39 deletions.
80 changes: 41 additions & 39 deletions BasicRotations/Ranged/MCH_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,49 @@ public sealed class MCH_Default : MachinistRotation

#region oGCD Logic
// Determines emergency actions to take based on the next planned GCD action.
protected override bool EmergencyAbility(IAction nextGCD, out IAction? act)
protected override bool EmergencyAbility(IAction nextGCD, out IAction? act)
{
// Reassemble Logic
// Check next GCD action and conditions for Reassemble.
bool isReassembleUsable =
//Reassemble current # of charges and double proc protection
ReassemblePvE.Cooldown.CurrentCharges > 0 && !Player.HasStatus(true, StatusID.Reassembled) &&
//Chainsaw Level Check and NextGCD Check
((ChainSawPvE.EnoughLevel && nextGCD.IsTheSameTo(true, ChainSawPvE)) ||
//AirAnchor Logic
(AirAnchorPvE.EnoughLevel && nextGCD.IsTheSameTo(true, AirAnchorPvE)) ||
//Drill Logic
(DrillPvE.EnoughLevel && !ChainSawPvE.EnoughLevel && nextGCD.IsTheSameTo(true, DrillPvE)) ||
//Cleanshot Logic
(!DrillPvE.EnoughLevel && CleanShotPvE.EnoughLevel && nextGCD.IsTheSameTo(true, CleanShotPvE)) ||
//HotShot Logic
(!CleanShotPvE.EnoughLevel && nextGCD.IsTheSameTo(true, HotShotPvE)));

// Keeps Ricochet and Gauss cannon Even
bool isRicochetMore = RicochetPvE.EnoughLevel && GaussRoundPvE.Cooldown.CurrentCharges <= RicochetPvE.Cooldown.CurrentCharges;
bool isGaussMore = !RicochetPvE.EnoughLevel || GaussRoundPvE.Cooldown.CurrentCharges > RicochetPvE.Cooldown.CurrentCharges;

// Attempt to use Reassemble if it's ready
if (isReassembleUsable)
{
// Reassemble Logic
// Check next GCD action and conditions for Reassemble.
bool isReassembleUsable =
//Reassemble current # of charges and double proc protection
ReassemblePvE.Cooldown.CurrentCharges > 0 && !Player.HasStatus(true, StatusID.Reassembled) &&
//Chainsaw Level Check and NextGCD Check
((ChainSawPvE.EnoughLevel && nextGCD.IsTheSameTo(true, ChainSawPvE)) ||
//AirAnchor Logic
(AirAnchorPvE.EnoughLevel && nextGCD.IsTheSameTo(true, AirAnchorPvE)) ||
//Drill Logic
(DrillPvE.EnoughLevel && !ChainSawPvE.EnoughLevel && nextGCD.IsTheSameTo(true, DrillPvE)) ||
//Cleanshot Logic
(!DrillPvE.EnoughLevel && CleanShotPvE.EnoughLevel && nextGCD.IsTheSameTo(true, CleanShotPvE)) ||
//HotShot Logic
(!CleanShotPvE.EnoughLevel && nextGCD.IsTheSameTo(true, HotShotPvE)));

// Keeps Ricochet and Gauss cannon Even
bool isRicochetMore = (GaussRoundPvE.Cooldown.CurrentCharges <= RicochetPvE.Cooldown.CurrentCharges);
bool isGaussMore = (!RicochetPvE.EnoughLevel /*Check to use Gauss below lvl50 */ ||
(GaussRoundPvE.Cooldown.CurrentCharges > RicochetPvE.Cooldown.CurrentCharges));

// Attempt to use Reassemble if it's ready
if (isReassembleUsable)
{
if (ReassemblePvE.CanUse(out act, onLastAbility: true, skipClippingCheck: true, skipComboCheck: true, usedUp: true)) return true;
}
// Use Ricochet
if (isRicochetMore && ((!IsLastAction(true, [GaussRoundPvE, RicochetPvE]) && IsLastGCD(true, HeatBlastPvE)) || !IsLastGCD(true, HeatBlastPvE)))
if (ReassemblePvE.CanUse(out act, onLastAbility: true, skipClippingCheck: true, skipComboCheck: true, usedUp: true)) return true;
}

{
return RicochetPvE.CanUse(out act, skipAoeCheck: true, usedUp: true);
}
// Use Gause
if (isGaussMore && ((!IsLastAction(true, [GaussRoundPvE, RicochetPvE]) && IsLastGCD(true, HeatBlastPvE)) || !IsLastGCD(true, HeatBlastPvE)))
{
return GaussRoundPvE.CanUse(out act, usedUp: true);
}
return base.EmergencyAbility(nextGCD, out act);
// Use Ricochet
if (isRicochetMore && ((!IsLastAction(true, new[] { GaussRoundPvE, RicochetPvE }) && IsLastGCD(true, HeatBlastPvE)) || !IsLastGCD(true, HeatBlastPvE)))
{
if (RicochetPvE.CanUse(out act, skipAoeCheck: true, usedUp: true))
return true;
}

// Use Gauss
if (isGaussMore && ((!IsLastAction(true, new[] { GaussRoundPvE, RicochetPvE }) && IsLastGCD(true, HeatBlastPvE)) || !IsLastGCD(true, HeatBlastPvE)))
{
if (GaussRoundPvE.CanUse(out act, usedUp: true))
return true;
}
return base.EmergencyAbility(nextGCD, out act);
}

// Logic for using attack abilities outside of GCD, focusing on burst windows and cooldown management.
protected override bool AttackAbility(IAction nextGCD, out IAction? act)
Expand Down Expand Up @@ -193,4 +195,4 @@ private bool CanUseHyperchargePvE(out IAction? act)
}
}
#endregion
}
}

0 comments on commit dfedb79

Please sign in to comment.