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

Commit

Permalink
Merge pull request #83 from FFXIV-CombatReborn/DT-MCH-Optimize
Browse files Browse the repository at this point in the history
Dt mch optimize
  • Loading branch information
Tykku authored Jul 15, 2024
2 parents 48aecff + 3c5a2eb commit 201a5cf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 101 deletions.
76 changes: 0 additions & 76 deletions BasicRotations/Magical/PTM_Default.cs

This file was deleted.

6 changes: 3 additions & 3 deletions BasicRotations/Melee/RPR_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public sealed class RPR_Default : ReaperRotation
[RotationConfig(CombatType.PvE, Name = "[Beta Option] Pool Shroud for Arcane Circle.")]
public bool EnshroudPooling { get; set; } = false;

public static bool HasExecutioner => Player.HasStatus(true, StatusID.Executioner);
public static bool ExecutionerReady => Player.HasStatus(true, StatusID.Executioner);
#endregion

#region Countdown Logic
Expand Down Expand Up @@ -88,7 +88,7 @@ protected override bool GeneralGCD(out IAction? act)

if (SoulsowPvE.CanUse(out act)) return true;

if (!HasExecutioner && !HasSoulReaver )
if (!ExecutionerReady && !HasSoulReaver )
{
if (PerfectioPvE.CanUse(out act, skipAoeCheck: true)) return true;
}
Expand Down Expand Up @@ -181,7 +181,7 @@ private bool Reaping(out IAction? act)

private bool ItsGluttonyTime(out IAction? act)
{
if (HasExecutioner)
if (ExecutionerReady)
{
if (ExecutionersGuillotinePvE.CanUse(out act)) return true;
if (Player.HasStatus(true, StatusID.EnhancedGallows))
Expand Down
42 changes: 20 additions & 22 deletions BasicRotations/Ranged/MCH_Default.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using FFXIVClientStructs.FFXIV.Client.Game.UI;

namespace DefaultRotations.Ranged;

[Rotation("Default", CombatType.PvE, GameVersion = "7.00", Description = "")]
Expand All @@ -7,7 +9,7 @@ public sealed class MCH_Default : MachinistRotation
{
#region Config Options
[RotationConfig(CombatType.PvE, Name = "Skip Queen Logic and uses Rook Autoturret/Automaton Queen immediately whenever you get 50 battery")]
public bool SkipQueenLogic { get; set; } = false;
private bool SkipQueenLogic { get; set; } = false;
#endregion

#region Countdown logic
Expand Down Expand Up @@ -35,16 +37,10 @@ protected override bool EmergencyAbility(IAction nextGCD, out IAction? act)
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)));
(nextGCD.IsTheSameTo(true, [ChainSawPvE, ExcavatorPvE, AirAnchorPvE]) ||
(!ChainSawPvE.EnoughLevel && nextGCD.IsTheSameTo(true, DrillPvE)) ||
(!DrillPvE.EnoughLevel && nextGCD.IsTheSameTo(true, CleanShotPvE)) ||
(!CleanShotPvE.EnoughLevel && nextGCD.IsTheSameTo(true, HotShotPvE)));

// Keeps Ricochet and Gauss cannon Even
bool isRicochetMore = RicochetPvE.EnoughLevel && GaussRoundPvE.Cooldown.CurrentCharges <= RicochetPvE.Cooldown.CurrentCharges;
Expand Down Expand Up @@ -97,21 +93,20 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act)
if (UseBurstMedicine(out act)) return true;

{
if ((IsLastAbility(false, HyperchargePvE) || Heat >= 50 || Player.HasStatus(true, StatusID.Hypercharged)) && !CombatElapsedLess(10) && CanUseHyperchargePvE(out _)
&& !LowLevelHyperCheck && WildfirePvE.CanUse(out act)) return true;
if ((IsLastAbility(false, HyperchargePvE) || Heat >= 50 || Player.HasStatus(true, StatusID.Hypercharged)) && !CombatElapsedLessGCD(5) &&
(CombatElapsedLess(20) || ToolChargeSoon(out _)) && !LowLevelHyperCheck && WildfirePvE.CanUse(out act)) return true;
}
}
// Use Hypercharge if at least 12 seconds of combat and (if wildfire will not be up in 30 seconds or if you hit 100 heat)
if (!LowLevelHyperCheck && !CombatElapsedLess(12) && !Player.HasStatus(true, StatusID.Reassembled) && (!WildfirePvE.Cooldown.WillHaveOneCharge(30) || (Heat == 100)))
{
if (CanUseHyperchargePvE(out act)) return true;
if (ToolChargeSoon(out act)) return true;
}
// Rook Autoturret/Queen Logic
if (NoQueenLogic || OpenerQueen || CombatTimeQueen || WildfireCooldownQueen || BatteryCheckQueen || LastGCDCheckQueen)
{
if (RookAutoturretPvE.CanUse(out act)) return true;
}
// Use Barrel Stabilizer on CD if won't cap
if (BarrelStabilizerPvE.CanUse(out act)) return true;

return base.AttackAbility(nextGCD, out act);
Expand All @@ -138,21 +133,25 @@ protected override bool GeneralGCD(out IAction? act)
if (!AirAnchorPvE.EnoughLevel && HotShotPvE.CanUse(out act)) return true;

// Check if Drill can be used
if (DrillPvE.CanUse(out act, usedUp: true)) return true;
if (DrillPvE.CanUse(out act, usedUp: false)) return true;
}

// Special condition for using ChainSaw outside of AoE checks if no action is chosen within 4 GCDs.
if (!CombatElapsedLessGCD(4) && ChainSawPvE.CanUse(out act, skipAoeCheck: true)) return true;
if (!CombatElapsedLessGCD(4) && ExcavatorPvE.CanUse(out act, skipAoeCheck: true)) return true;
if (!CombatElapsedLessGCD(1) && ChainSawPvE.CanUse(out act, skipAoeCheck: true)) return true;
if (ExcavatorPvE.CanUse(out act, skipAoeCheck: true)) return true;
if (!ChainSawPvE.Cooldown.WillHaveOneCharge(6f) && !CombatElapsedLessGCD(6))
{
if (DrillPvE.CanUse(out act, usedUp: true)) return true;
}

// AoE actions: ChainSaw and SpreadShot based on their usability.
if (SpreadShotPvE.CanUse(out _))
{
if (ChainSawPvE.CanUse(out act)) return true;
if (ExcavatorPvE.CanUse(out act)) return true;
}
if (SpreadShotPvE.CanUse(out act)) return true;
if (FullMetalFieldPvE.CanUse(out act)) return true;
if (SpreadShotPvE.CanUse(out act)) return true;
// Single target actions: CleanShot, SlugShot, and SplitShot based on their usability.
if (CleanShotPvE.CanUse(out act)) return true;
if (SlugShotPvE.CanUse(out act)) return true;
Expand All @@ -166,12 +165,12 @@ protected override bool GeneralGCD(out IAction? act)
// Extra private helper methods for determining the usability of specific abilities under certain conditions.
// These methods simplify the main logic by encapsulating specific checks related to abilities' cooldowns and prerequisites.
// Logic for Hypercharge
private bool CanUseHyperchargePvE(out IAction? act)
private bool ToolChargeSoon(out IAction? act)
{
float REST_TIME = 6f;
if
//Cannot AOE
((!SpreadShotPvE.CanUse(out _))
(!SpreadShotPvE.CanUse(out _)
&&
// AirAnchor Enough Level % AirAnchor
((AirAnchorPvE.EnoughLevel && AirAnchorPvE.Cooldown.WillHaveOneCharge(REST_TIME))
Expand All @@ -190,7 +189,6 @@ private bool CanUseHyperchargePvE(out IAction? act)
}
else
{
// Use Hypercharge
return HyperchargePvE.CanUse(out act);
}
}
Expand Down

0 comments on commit 201a5cf

Please sign in to comment.