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

Commit

Permalink
Merge pull request #1434 from Kagekazu/VariousFixes
Browse files Browse the repository at this point in the history
Various Fixes MCH + VPR
  • Loading branch information
Taurenkey authored Jul 11, 2024
2 parents a087d86 + 47f1001 commit eecdf09
Show file tree
Hide file tree
Showing 7 changed files with 487 additions and 412 deletions.
26 changes: 13 additions & 13 deletions XIVSlothCombo/Combos/CustomComboPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ public enum CustomComboPreset

#region Simple ST

[ReplaceSkill(MCH.SplitShot)]
[ReplaceSkill(MCH.SplitShot, MCH.HeatedSplitShot)]
[ConflictingCombos(MCH_ST_AdvancedMode)]
[CustomComboInfo("Simple Mode - Single Target", "Replaces Split Shot with a one-button full single target rotation.\nThis is ideal for newcomers to the job.", MCH.JobID)]
MCH_ST_SimpleMode = 8001,
Expand Down Expand Up @@ -1711,7 +1711,7 @@ public enum CustomComboPreset
MCH_AoE_Adv_Queen = 8304,

[ParentCombo(MCH_AoE_AdvancedMode)]
[CustomComboInfo("Flamethrower Option", "Adds Flamethrower to the rotation.", MCH.JobID)]
[CustomComboInfo("Flamethrower Option", "Adds Flamethrower to the rotation.\n Changes to Savage blade when in use to prevent cancelling.", MCH.JobID)]
MCH_AoE_Adv_FlameThrower = 8305,

[ParentCombo(MCH_AoE_AdvancedMode)]
Expand Down Expand Up @@ -1763,20 +1763,20 @@ public enum CustomComboPreset
[CustomComboInfo("Gauss Round / Ricochet \nDouble Check / Checkmate Feature", "Replace Gauss Round and Ricochet or Double Check and Checkmate with one or the other depending on which has more charges.", MCH.JobID)]
MCH_GaussRoundRicochet = 8003,

[ReplaceSkill(MCH.Drill, MCH.AirAnchor, MCH.HotShot)]
[CustomComboInfo("Drill/Air Anchor (Hot Shot) Feature", "Replace Drill and Air Anchor (Hot Shot) with one or the other (or Chain Saw) depending on which is on cooldown.", MCH.JobID)]
MCH_HotShotDrillChainsaw = 8004,
[ReplaceSkill(MCH.Drill, MCH.AirAnchor, MCH.HotShot,MCH.Chainsaw)]
[CustomComboInfo("Big Hitter Feature", "Replace Hot Shot, Drill, Air Anchor, Chainsaw and Excavator depending on which is on cooldown.", MCH.JobID)]
MCH_HotShotDrillChainsawExcavator = 8004,

[ReplaceSkill(MCH.Heatblast)]
[CustomComboInfo("Single Button Heat Blast Feature", "Turns Heat Blast into Hypercharge when at or above 50 heat.", MCH.JobID)]
[CustomComboInfo("Single Button Heat Blast Feature", "Turns Heat Blast into Hypercharge \nwhen u have 50 or more heat or when u got Hypercharged buff.", MCH.JobID)]
MCH_Heatblast = 8006,

[ParentCombo(MCH_Heatblast)]
[CustomComboInfo("Barrel Option", "Adds Barrel Stabilizer to the feature when below 50 Heat Gauge.", MCH.JobID)]
[CustomComboInfo("Barrel Option", "Adds Barrel Stabilizer to the feature when off cooldown.", MCH.JobID)]
MCH_Heatblast_AutoBarrel = 8052,

[ParentCombo(MCH_Heatblast)]
[CustomComboInfo("Wildfire Option", "Adds Wildfire to the feature when at or above 50 heat.", MCH.JobID)]
[CustomComboInfo("Wildfire Option", "Adds Wildfire to the feature when off cooldown and overheated.", MCH.JobID)]
MCH_Heatblast_Wildfire = 8015,

[ParentCombo(MCH_Heatblast)]
Expand Down Expand Up @@ -3635,7 +3635,7 @@ The three digets after RDM.JobID can be used to reorder items in the list
VPR_ST_AdvancedMode = 30001,

[ParentCombo(VPR_ST_AdvancedMode)]
[CustomComboInfo("Level 100 Opener", "Adds the Balance opener to the rotation.", VPR.JobID)]
[CustomComboInfo("Level 100 Opener", "Adds the Balance opener to the rotation.\n Does not check positional choice.\n Always does Hunter's Coil first ( FLANK )", VPR.JobID)]
VPR_ST_Opener = 30002,

[ParentCombo(VPR_ST_AdvancedMode)]
Expand All @@ -3656,7 +3656,7 @@ The three digets after RDM.JobID can be used to reorder items in the list
[CustomComboInfo("Dreadwinder", "Adds Dreadwinder to the rotation.", VPR.JobID)]
VPR_ST_Dreadwinder = 30006,

[ParentCombo(VPR_ST_Dreadwinder)]
[ParentCombo(VPR_ST_CDs)]
[CustomComboInfo("Dreadwinder Combo", "Adds Swiftskin's Coil and Hunter's Coil to the rotation.", VPR.JobID)]
VPR_ST_DreadwinderCombo = 30007,

Expand All @@ -3670,7 +3670,7 @@ The three digets after RDM.JobID can be used to reorder items in the list
[CustomComboInfo("Uncoiled Fury", "Adds Uncoiled Fury to the rotation.", VPR.JobID)]
VPR_ST_UncoiledFury = 30009,

[ParentCombo(VPR_ST_UncoiledFury)]
[ParentCombo(VPR_ST_AdvancedMode)]
[CustomComboInfo("Uncoiled Fury Combo", "Adds Uncoiled Twinfang and Uncoiled Twinblood to the rotation.", VPR.JobID)]
VPR_ST_UncoiledFuryCombo = 30010,

Expand Down Expand Up @@ -3730,7 +3730,7 @@ The three digets after RDM.JobID can be used to reorder items in the list
[CustomComboInfo("Pit Of Dread", "Adds Pit Of Dread to the rotation.", VPR.JobID)]
VPR_AoE_PitOfDread = 30105,

[ParentCombo(VPR_AoE_PitOfDread)]
[ParentCombo(VPR_AoE_CDs)]
[CustomComboInfo("Pit Of Dread Combo", "Adds Swiftskin's Den and Hunter's Den to the rotation.", VPR.JobID)]
VPR_AoE_PitOfDreadCombo = 30106,

Expand All @@ -3744,7 +3744,7 @@ The three digets after RDM.JobID can be used to reorder items in the list
[CustomComboInfo("Uncoiled Fury", "Adds Uncoiled Fury to the rotation.", VPR.JobID)]
VPR_AoE_UncoiledFury = 30108,

[ParentCombo(VPR_AoE_UncoiledFury)]
[ParentCombo(VPR_AoE_AdvancedMode)]
[CustomComboInfo("Uncoiled Fury Combo", "Adds Uncoiled Twinfang and Uncoiled Twinblood to the rotation.", VPR.JobID)]
VPR_AoE_UncoiledFuryCombo = 30109,

Expand Down
197 changes: 120 additions & 77 deletions XIVSlothCombo/Combos/JobHelpers/MCH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,79 +8,43 @@

namespace XIVSlothCombo.Combos.JobHelpers
{
internal class MCHOpenerLogic : PvE.MCH
internal class MCHOpenerLogic : MCH
{
private static bool HasCooldowns()
{
if (CustomComboFunctions.GetRemainingCharges(CheckMate) < 3)
return false;

if (CustomComboFunctions.GetRemainingCharges(DoubleCheck) < 3)
return false;

if (!CustomComboFunctions.ActionReady(Chainsaw))
return false;

if (!CustomComboFunctions.ActionReady(Wildfire))
return false;

if (!CustomComboFunctions.ActionReady(BarrelStabilizer))
return false;

if (!CustomComboFunctions.ActionReady(Excavator))
return false;

if (!CustomComboFunctions.ActionReady(FullMetalField))
return false;

return true;
}

public static bool HasPrePullCooldowns()
{
if (CustomComboFunctions.GetRemainingCharges(Reassemble) < 2) return false;

return true;
}


private static uint OpenerLevel => 100;

public uint PrePullStep = 0;

public uint OpenerStep = 0;

private static uint[] StandardOpener = [
AirAnchor,
CheckMate,
DoubleCheck,
Drill,
BarrelStabilizer,
Chainsaw,
Excavator,
AutomatonQueen,
Reassemble,
Drill,
CheckMate,
Wildfire,
FullMetalField,
DoubleCheck,
Hypercharge,
BlazingShot,
CheckMate,
BlazingShot,
DoubleCheck,
BlazingShot,
CheckMate,
BlazingShot,
DoubleCheck,
BlazingShot,
CheckMate,
Drill,
DoubleCheck,
CheckMate,
HeatedSplitShot,
DoubleCheck,
HeatedSlugShot,
HeatedCleanShot];

public static bool LevelChecked => CustomComboFunctions.LocalPlayer.Level >= OpenerLevel;

private static bool CanOpener => HasCooldowns() && HasPrePullCooldowns() && LevelChecked;
private static bool CanOpener => HasCooldowns() && LevelChecked;

private OpenerState currentState = OpenerState.PrePull;

Expand All @@ -98,7 +62,7 @@ public OpenerState CurrentState
{
Svc.Log.Debug($"Entered PrePull Opener");
}
if (value == OpenerState.InOpener) OpenerStep = 0;
if (value == OpenerState.InOpener) OpenerStep = 1;
if (value == OpenerState.OpenerFinished || value == OpenerState.FailedOpener)
{
if (value == OpenerState.FailedOpener)
Expand All @@ -119,53 +83,142 @@ private bool DoPrePullSteps(ref uint actionID)
return false;

if (CanOpener && PrePullStep == 0)
{
PrePullStep = 1;
}

if (!HasCooldowns())
{
PrePullStep = 0;
}

if (CurrentState == OpenerState.PrePull && PrePullStep > 0)
{

if (CustomComboFunctions.HasEffect(Buffs.Reassembled) && PrePullStep == 1) CurrentState = OpenerState.InOpener;
else if (PrePullStep == 1) actionID = Reassemble;


if (ActionWatching.CombatActions.Count > 2 && CustomComboFunctions.InCombat())
CurrentState = OpenerState.FailedOpener;

return true;
}

PrePullStep = 0;
return false;
}

private bool DoOpener(uint[] OpenerActions, ref uint actionID)
private bool DoOpener(ref uint actionID)
{
if (!LevelChecked)
return false;

if (currentState == OpenerState.InOpener)
{
if (CustomComboFunctions.WasLastAction(OpenerActions[OpenerStep]))
OpenerStep++;
if (CustomComboFunctions.WasLastAction(AirAnchor) && OpenerStep == 1) OpenerStep++;
else if (OpenerStep == 1) actionID = AirAnchor;

if (CustomComboFunctions.WasLastAction(CheckMate) && OpenerStep == 2) OpenerStep++;
else if (OpenerStep == 2) actionID = CheckMate;

if (CustomComboFunctions.WasLastAction(DoubleCheck) && OpenerStep == 3) OpenerStep++;
else if (OpenerStep == 3) actionID = DoubleCheck;

if (CustomComboFunctions.WasLastAction(Drill) && OpenerStep == 4) OpenerStep++;
else if (OpenerStep == 4) actionID = Drill;

if (CustomComboFunctions.WasLastAction(BarrelStabilizer) && OpenerStep == 5) OpenerStep++;
else if (OpenerStep == 5) actionID = BarrelStabilizer;

if (CustomComboFunctions.WasLastAction(Chainsaw) && OpenerStep == 6) OpenerStep++;
else if (OpenerStep == 6) actionID = Chainsaw;

if (CustomComboFunctions.WasLastAction(Excavator) && OpenerStep == 7) OpenerStep++;
else if (OpenerStep == 7) actionID = Excavator;

if (CustomComboFunctions.WasLastAction(AutomatonQueen) && OpenerStep == 8) OpenerStep++;
else if (OpenerStep == 8) actionID = AutomatonQueen;

if (CustomComboFunctions.WasLastAction(Reassemble) && OpenerStep == 9) OpenerStep++;
else if (OpenerStep == 9) actionID = Reassemble;

if (CustomComboFunctions.WasLastAction(Drill) && OpenerStep == 10) OpenerStep++;
else if (OpenerStep == 10) actionID = Drill;

if (CustomComboFunctions.WasLastAction(CheckMate) && OpenerStep == 11) OpenerStep++;
else if (OpenerStep == 11) actionID = CheckMate;

if (OpenerStep == OpenerActions.Length)
CurrentState = OpenerState.OpenerFinished;
if (CustomComboFunctions.WasLastAction(Wildfire) && OpenerStep == 12) OpenerStep++;
else if (OpenerStep == 12) actionID = Wildfire;

else actionID = OpenerActions[OpenerStep];
if (CustomComboFunctions.WasLastAction(FullMetalField) && OpenerStep == 13) OpenerStep++;
else if (OpenerStep == 13) actionID = FullMetalField;

if (CustomComboFunctions.InCombat() && ActionWatching.TimeSinceLastAction.TotalSeconds >= 5)
if (CustomComboFunctions.WasLastAction(DoubleCheck) && OpenerStep == 14) OpenerStep++;
else if (OpenerStep == 14) actionID = DoubleCheck;

if (CustomComboFunctions.WasLastAction(Hypercharge) && OpenerStep == 15) OpenerStep++;
else if (OpenerStep == 15) actionID = Hypercharge;

if (CustomComboFunctions.WasLastAction(BlazingShot) && OpenerStep == 16) OpenerStep++;
else if (OpenerStep == 16) actionID = BlazingShot;

if (CustomComboFunctions.WasLastAction(CheckMate) && OpenerStep == 17) OpenerStep++;
else if (OpenerStep == 17) actionID = CheckMate;

if (CustomComboFunctions.WasLastAction(BlazingShot) && OpenerStep == 18) OpenerStep++;
else if (OpenerStep == 18) actionID = BlazingShot;

if (CustomComboFunctions.WasLastAction(DoubleCheck) && OpenerStep == 19) OpenerStep++;
else if (OpenerStep == 19) actionID = DoubleCheck;

if (CustomComboFunctions.WasLastAction(BlazingShot) && OpenerStep == 20) OpenerStep++;
else if (OpenerStep == 20) actionID = BlazingShot;

if (CustomComboFunctions.WasLastAction(CheckMate) && OpenerStep == 21) OpenerStep++;
else if (OpenerStep == 21) actionID = CheckMate;

if (CustomComboFunctions.WasLastAction(BlazingShot) && OpenerStep == 22) OpenerStep++;
else if (OpenerStep == 22) actionID = BlazingShot;

if (CustomComboFunctions.WasLastAction(DoubleCheck) && OpenerStep == 23) OpenerStep++;
else if (OpenerStep == 23) actionID = DoubleCheck;

if (CustomComboFunctions.WasLastAction(BlazingShot) && OpenerStep == 24) OpenerStep++;
else if (OpenerStep == 24) actionID = BlazingShot;

if (CustomComboFunctions.WasLastAction(CheckMate) && OpenerStep == 25) OpenerStep++;
else if (OpenerStep == 25) actionID = CheckMate;

if (CustomComboFunctions.WasLastAction(Drill) && OpenerStep == 26) OpenerStep++;
else if (OpenerStep == 26) actionID = Drill;

if (CustomComboFunctions.WasLastAction(DoubleCheck) && OpenerStep == 27) OpenerStep++;
else if (OpenerStep == 27) actionID = DoubleCheck;

if (CustomComboFunctions.WasLastAction(CheckMate) && OpenerStep == 28) OpenerStep++;
else if (OpenerStep == 28) actionID = CheckMate;

if (CustomComboFunctions.WasLastAction(HeatedSplitShot) && OpenerStep == 29) OpenerStep++;
else if (OpenerStep == 29) actionID = HeatedSplitShot;

if (CustomComboFunctions.WasLastAction(DoubleCheck) && OpenerStep == 30) OpenerStep++;
else if (OpenerStep == 30) actionID = DoubleCheck;

if (CustomComboFunctions.WasLastAction(HeatedSlugShot) && OpenerStep == 31) OpenerStep++;
else if (OpenerStep == 31) actionID = HeatedSlugShot;

if (CustomComboFunctions.WasLastAction(HeatedCleanShot) && OpenerStep == 32) CurrentState = OpenerState.OpenerFinished;
else if (OpenerStep == 32) actionID = HeatedCleanShot;

if (ActionWatching.TimeSinceLastAction.TotalSeconds >= 5)
CurrentState = OpenerState.FailedOpener;

if (((actionID == Ricochet && CustomComboFunctions.GetRemainingCharges(CheckMate) < 3) ||
(actionID == Chainsaw && CustomComboFunctions.IsOnCooldown(Chainsaw)) ||
(actionID == Wildfire && CustomComboFunctions.IsOnCooldown(Wildfire)) ||
(actionID == BarrelStabilizer && CustomComboFunctions.IsOnCooldown(BarrelStabilizer)) ||
(actionID == BarrelStabilizer && CustomComboFunctions.IsOnCooldown(Excavator)) ||
(actionID == BarrelStabilizer && CustomComboFunctions.IsOnCooldown(FullMetalField)) ||
(actionID == GaussRound && CustomComboFunctions.GetRemainingCharges(DoubleCheck) < 3)) && ActionWatching.TimeSinceLastAction.TotalSeconds >= 3)
if (((actionID == CheckMate && CustomComboFunctions.GetRemainingCharges(CheckMate) < 3) ||
(actionID == Chainsaw && CustomComboFunctions.IsOnCooldown(Chainsaw)) ||
(actionID == Wildfire && CustomComboFunctions.IsOnCooldown(Wildfire)) ||
(actionID == BarrelStabilizer && CustomComboFunctions.IsOnCooldown(BarrelStabilizer)) ||
(actionID == BarrelStabilizer && CustomComboFunctions.IsOnCooldown(Excavator)) ||
(actionID == BarrelStabilizer && CustomComboFunctions.IsOnCooldown(FullMetalField)) ||
(actionID == DoubleCheck && CustomComboFunctions.GetRemainingCharges(DoubleCheck) < 3)) && ActionWatching.TimeSinceLastAction.TotalSeconds >= 3)
{
CurrentState = OpenerState.FailedOpener;
return false;
Expand All @@ -181,39 +234,29 @@ private void ResetOpener()
OpenerStep = 0;
}

public bool DoFullOpener(ref uint actionID, bool simpleMode)
public bool DoFullOpener(ref uint actionID)
{
if (!LevelChecked) return false;
if (!LevelChecked)
return false;

if (CurrentState == OpenerState.PrePull)
if (DoPrePullSteps(ref actionID))
return true;

if (CurrentState == OpenerState.InOpener)
{
if (simpleMode)
{
if (DoOpener(StandardOpener, ref actionID))
return true;
}
else
{
if (DoOpener(StandardOpener, ref actionID))
return true;

}
if (DoOpener(ref actionID))
return true;
}

if (!CustomComboFunctions.InCombat())
{
ResetOpener();
CurrentState = OpenerState.PrePull;
}

return false;
}
}

internal static class MCHExtensions
{
private static uint lastBattery = 0;
Expand Down
Loading

0 comments on commit eecdf09

Please sign in to comment.