From dfedb79ac0bc4832d6349d18dceebd61b7bb2c07 Mon Sep 17 00:00:00 2001 From: Ehl'tee Es <127939494+LTS-FFXIV@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:02:56 -0500 Subject: [PATCH 1/2] level check and formatting added check and fixed formatting to correctly create arrays for method calls, tested sub 50, 70, 80, and 90 --- BasicRotations/Ranged/MCH_Default.cs | 80 ++++++++++++++-------------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/BasicRotations/Ranged/MCH_Default.cs b/BasicRotations/Ranged/MCH_Default.cs index fc35dec..0c791a9 100644 --- a/BasicRotations/Ranged/MCH_Default.cs +++ b/BasicRotations/Ranged/MCH_Default.cs @@ -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) @@ -193,4 +195,4 @@ private bool CanUseHyperchargePvE(out IAction? act) } } #endregion -} \ No newline at end of file +} From 06d060601ce123f311753e211a459262b5baab5b Mon Sep 17 00:00:00 2001 From: Ehl'tee Es <127939494+LTS-FFXIV@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:04:16 -0500 Subject: [PATCH 2/2] re: fix indent --- BasicRotations/Ranged/MCH_Default.cs | 82 ++++++++++++++-------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/BasicRotations/Ranged/MCH_Default.cs b/BasicRotations/Ranged/MCH_Default.cs index 0c791a9..f795372 100644 --- a/BasicRotations/Ranged/MCH_Default.cs +++ b/BasicRotations/Ranged/MCH_Default.cs @@ -28,49 +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) -{ - // 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) - { - if (ReassemblePvE.CanUse(out act, onLastAbility: true, skipClippingCheck: true, skipComboCheck: true, usedUp: true)) return true; - } - - // 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))) + protected override bool EmergencyAbility(IAction nextGCD, out IAction? act) { - if (GaussRoundPvE.CanUse(out act, usedUp: true)) - return true; + // 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) + { + if (ReassemblePvE.CanUse(out act, onLastAbility: true, skipClippingCheck: true, skipComboCheck: true, usedUp: true)) return true; + } + + // 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); } - 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)