From f892451dd2c391d31723bf32d477736f7564000c Mon Sep 17 00:00:00 2001 From: Kage Date: Thu, 17 Oct 2024 11:16:20 +0200 Subject: [PATCH 1/7] update lifesurge pre lvl 30 --- XIVSlothCombo/Combos/PvE/DRG.cs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/DRG.cs b/XIVSlothCombo/Combos/PvE/DRG.cs index 503e4e005..e7578b4a2 100644 --- a/XIVSlothCombo/Combos/PvE/DRG.cs +++ b/XIVSlothCombo/Combos/PvE/DRG.cs @@ -151,11 +151,12 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (ActionReady(LifeSurge) && (GetCooldownRemainingTime(LifeSurge) < 40 || GetCooldownRemainingTime(BattleLitany) > 50) && AnimationLock.CanDRGWeave(LifeSurge) && - HasEffect(Buffs.LanceCharge) && - !HasEffect(Buffs.LifeSurge) && - ((JustUsed(WheelingThrust) && LevelChecked(Drakesbane)) || - (JustUsed(FangAndClaw) && LevelChecked(Drakesbane)) || - (JustUsed(OriginalHook(VorpalThrust)) && LevelChecked(FullThrust)))) + ((HasEffect(Buffs.LanceCharge) && + !HasEffect(Buffs.LifeSurge) && + ((JustUsed(WheelingThrust) && LevelChecked(Drakesbane)) || + (JustUsed(FangAndClaw) && LevelChecked(Drakesbane)) || + (JustUsed(OriginalHook(VorpalThrust)) && LevelChecked(FullThrust)))) || + (!LevelChecked(LanceCharge) && JustUsed(VorpalThrust)))) return LifeSurge; //Geirskogul Feature @@ -330,13 +331,14 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim ActionReady(LifeSurge) && (GetCooldownRemainingTime(LifeSurge) < 40 || GetCooldownRemainingTime(BattleLitany) > 50) && AnimationLock.CanDRGWeave(LifeSurge) && - HasEffect(Buffs.LanceCharge) && - !HasEffect(Buffs.LifeSurge) && - ((JustUsed(WheelingThrust) && LevelChecked(Drakesbane)) || - (JustUsed(FangAndClaw) && LevelChecked(Drakesbane)) || - (JustUsed(OriginalHook(VorpalThrust)) && LevelChecked(FullThrust)))) + ((HasEffect(Buffs.LanceCharge) && + !HasEffect(Buffs.LifeSurge) && + ((JustUsed(WheelingThrust) && LevelChecked(Drakesbane)) || + (JustUsed(FangAndClaw) && LevelChecked(Drakesbane)) || + (JustUsed(OriginalHook(VorpalThrust)) && LevelChecked(FullThrust)))) || + (!LevelChecked(LanceCharge) && JustUsed(VorpalThrust)))) return LifeSurge; - + //Geirskogul Feature if (IsEnabled(CustomComboPreset.DRG_ST_Geirskogul) && ActionReady(Geirskogul) && From 15b97c0e775e04e48bbfce323b7d5c212a628f96 Mon Sep 17 00:00:00 2001 From: Kage Date: Mon, 4 Nov 2024 23:10:04 +0100 Subject: [PATCH 2/7] Add public statics cleanup --- XIVSlothCombo/Combos/JobHelpers/DRG.cs | 374 +++++++++++++------------ XIVSlothCombo/Combos/PvE/DRG.cs | 16 +- 2 files changed, 196 insertions(+), 194 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/DRG.cs b/XIVSlothCombo/Combos/JobHelpers/DRG.cs index 178b642c3..5eb4011f1 100644 --- a/XIVSlothCombo/Combos/JobHelpers/DRG.cs +++ b/XIVSlothCombo/Combos/JobHelpers/DRG.cs @@ -1,270 +1,278 @@ using System.Collections.Generic; using System.Linq; +using Dalamud.Game.ClientState.JobGauge.Types; using ECommons.DalamudServices; using XIVSlothCombo.Combos.JobHelpers.Enums; using XIVSlothCombo.Combos.PvE; using XIVSlothCombo.Combos.PvE.Content; -using XIVSlothCombo.CustomComboNS.Functions; using XIVSlothCombo.Data; +using static XIVSlothCombo.Combos.PvE.DRG; +using static XIVSlothCombo.CustomComboNS.Functions.CustomComboFunctions; namespace XIVSlothCombo.Combos.JobHelpers; -internal class DRGOpenerLogic : DRG +internal class DRG { - private OpenerState currentState = OpenerState.PrePull; + public static DRGGauge Gauge = GetJobGauge(); - public uint OpenerStep = 1; + internal class DRGOpenerLogic + { + private OpenerState currentState = OpenerState.PrePull; - public uint PrePullStep; + public uint OpenerStep = 1; - private static uint OpenerLevel => 100; + public uint PrePullStep; - public static bool LevelChecked => CustomComboFunctions.LocalPlayer.Level >= OpenerLevel; + private static uint OpenerLevel => 100; - private static bool CanOpener => HasCooldowns() && LevelChecked; + public static bool LevelChecked => LocalPlayer.Level >= OpenerLevel; - public OpenerState CurrentState - { - get => currentState; - set + private static bool CanOpener => HasCooldowns() && LevelChecked; + + public OpenerState CurrentState { - if (value != currentState) + get => currentState; + set { - if (value == OpenerState.PrePull) Svc.Log.Debug("Entered PrePull Opener"); - if (value == OpenerState.InOpener) OpenerStep = 1; - - if (value == OpenerState.OpenerFinished || value == OpenerState.FailedOpener) + if (value != currentState) { - if (value == OpenerState.FailedOpener) - Svc.Log.Information($"Opener Failed at step {OpenerStep}"); + if (value == OpenerState.PrePull) Svc.Log.Debug("Entered PrePull Opener"); + if (value == OpenerState.InOpener) OpenerStep = 1; - ResetOpener(); - } - if (value == OpenerState.OpenerFinished) Svc.Log.Information("Opener Finished"); + if (value == OpenerState.OpenerFinished || value == OpenerState.FailedOpener) + { + if (value == OpenerState.FailedOpener) + Svc.Log.Information($"Opener Failed at step {OpenerStep}"); - currentState = value; + ResetOpener(); + } + if (value == OpenerState.OpenerFinished) Svc.Log.Information("Opener Finished"); + + currentState = value; + } } } - } - - private static bool HasCooldowns() - { - if (CustomComboFunctions.GetRemainingCharges(LifeSurge) < 2) - return false; - if (!CustomComboFunctions.ActionReady(BattleLitany)) - return false; + private static bool HasCooldowns() + { + if (GetRemainingCharges(LifeSurge) < 2) + return false; - if (!CustomComboFunctions.ActionReady(DragonfireDive)) - return false; + if (!ActionReady(BattleLitany)) + return false; - if (!CustomComboFunctions.ActionReady(LanceCharge)) - return false; + if (!ActionReady(DragonfireDive)) + return false; - return true; - } + if (!ActionReady(LanceCharge)) + return false; - private bool DoPrePullSteps(ref uint actionID) - { - if (!LevelChecked) return false; + return true; + } - if (CanOpener && PrePullStep == 0) PrePullStep = 1; + private bool DoPrePullSteps(ref uint actionID) + { + if (!LevelChecked) return false; - if (!HasCooldowns()) PrePullStep = 0; + if (CanOpener && PrePullStep == 0) PrePullStep = 1; - if (CurrentState == OpenerState.PrePull && PrePullStep > 0) - { - if (CustomComboFunctions.WasLastAction(TrueThrust) && PrePullStep == 1) CurrentState = OpenerState.InOpener; - else if (PrePullStep == 1) actionID = TrueThrust; + if (!HasCooldowns()) PrePullStep = 0; - if (ActionWatching.CombatActions.Count > 2 && CustomComboFunctions.InCombat()) - CurrentState = OpenerState.FailedOpener; + if (CurrentState == OpenerState.PrePull && PrePullStep > 0) + { + if (WasLastAction(TrueThrust) && PrePullStep == 1) + CurrentState = OpenerState.InOpener; + else if (PrePullStep == 1) actionID = TrueThrust; - return true; - } + if (ActionWatching.CombatActions.Count > 2 && InCombat()) + CurrentState = OpenerState.FailedOpener; - PrePullStep = 0; + return true; + } - return false; - } + PrePullStep = 0; - private bool DoOpener(ref uint actionID) - { - if (!LevelChecked) return false; + return false; + } - if (currentState == OpenerState.InOpener) + private bool DoOpener(ref uint actionID) { - if (CustomComboFunctions.WasLastAction(SpiralBlow) && OpenerStep == 1) OpenerStep++; - else if (OpenerStep == 1) actionID = SpiralBlow; + if (!LevelChecked) return false; - if (CustomComboFunctions.WasLastAction(LanceCharge) && OpenerStep == 2) OpenerStep++; - else if (OpenerStep == 2) actionID = LanceCharge; + if (currentState == OpenerState.InOpener) + { + if (WasLastAction(SpiralBlow) && OpenerStep == 1) OpenerStep++; + else if (OpenerStep == 1) actionID = SpiralBlow; - if (CustomComboFunctions.WasLastAction(ChaoticSpring) && OpenerStep == 3) OpenerStep++; - else if (OpenerStep == 3) actionID = ChaoticSpring; + if (WasLastAction(LanceCharge) && OpenerStep == 2) OpenerStep++; + else if (OpenerStep == 2) actionID = LanceCharge; - if (CustomComboFunctions.WasLastAction(BattleLitany) && OpenerStep == 4) OpenerStep++; - else if (OpenerStep == 4) actionID = BattleLitany; + if (WasLastAction(ChaoticSpring) && OpenerStep == 3) OpenerStep++; + else if (OpenerStep == 3) actionID = ChaoticSpring; - if (CustomComboFunctions.WasLastAction(Geirskogul) && OpenerStep == 5) OpenerStep++; - else if (OpenerStep == 5) actionID = Geirskogul; + if (WasLastAction(BattleLitany) && OpenerStep == 4) OpenerStep++; + else if (OpenerStep == 4) actionID = BattleLitany; - if (CustomComboFunctions.WasLastAction(WheelingThrust) && OpenerStep == 6) OpenerStep++; - else if (OpenerStep == 6) actionID = WheelingThrust; + if (WasLastAction(Geirskogul) && OpenerStep == 5) OpenerStep++; + else if (OpenerStep == 5) actionID = Geirskogul; - if (CustomComboFunctions.WasLastAction(HighJump) && OpenerStep == 7) OpenerStep++; - else if (OpenerStep == 7) actionID = HighJump; + if (WasLastAction(WheelingThrust) && OpenerStep == 6) OpenerStep++; + else if (OpenerStep == 6) actionID = WheelingThrust; - if (CustomComboFunctions.WasLastAction(LifeSurge) && OpenerStep == 8) OpenerStep++; - else if (OpenerStep == 8) actionID = LifeSurge; + if (WasLastAction(HighJump) && OpenerStep == 7) OpenerStep++; + else if (OpenerStep == 7) actionID = HighJump; - if (CustomComboFunctions.WasLastAction(Drakesbane) && OpenerStep == 9) OpenerStep++; - else if (OpenerStep == 9) actionID = Drakesbane; + if (WasLastAction(LifeSurge) && OpenerStep == 8) OpenerStep++; + else if (OpenerStep == 8) actionID = LifeSurge; - if (CustomComboFunctions.WasLastAction(DragonfireDive) && OpenerStep == 10) OpenerStep++; - else if (OpenerStep == 10) actionID = DragonfireDive; + if (WasLastAction(Drakesbane) && OpenerStep == 9) OpenerStep++; + else if (OpenerStep == 9) actionID = Drakesbane; - if (CustomComboFunctions.WasLastAction(Nastrond) && OpenerStep == 11) OpenerStep++; - else if (OpenerStep == 11) actionID = Nastrond; + if (WasLastAction(DragonfireDive) && OpenerStep == 10) OpenerStep++; + else if (OpenerStep == 10) actionID = DragonfireDive; - if (CustomComboFunctions.WasLastAction(RaidenThrust) && OpenerStep == 12) OpenerStep++; - else if (OpenerStep == 12) actionID = RaidenThrust; + if (WasLastAction(Nastrond) && OpenerStep == 11) OpenerStep++; + else if (OpenerStep == 11) actionID = Nastrond; - if (CustomComboFunctions.WasLastAction(Stardiver) && OpenerStep == 13) OpenerStep++; - else if (OpenerStep == 13) actionID = Stardiver; + if (WasLastAction(RaidenThrust) && OpenerStep == 12) OpenerStep++; + else if (OpenerStep == 12) actionID = RaidenThrust; - if (CustomComboFunctions.WasLastAction(LanceBarrage) && OpenerStep == 14) OpenerStep++; - else if (OpenerStep == 14) actionID = LanceBarrage; + if (WasLastAction(Stardiver) && OpenerStep == 13) OpenerStep++; + else if (OpenerStep == 13) actionID = Stardiver; - if (CustomComboFunctions.WasLastAction(Starcross) && OpenerStep == 15) OpenerStep++; - else if (OpenerStep == 15) actionID = Starcross; + if (WasLastAction(LanceBarrage) && OpenerStep == 14) OpenerStep++; + else if (OpenerStep == 14) actionID = LanceBarrage; - if (CustomComboFunctions.WasLastAction(LifeSurge) && OpenerStep == 16) OpenerStep++; - else if (OpenerStep == 16) actionID = LifeSurge; + if (WasLastAction(Starcross) && OpenerStep == 15) OpenerStep++; + else if (OpenerStep == 15) actionID = Starcross; - if (CustomComboFunctions.WasLastAction(HeavensThrust) && OpenerStep == 17) OpenerStep++; - else if (OpenerStep == 17) actionID = HeavensThrust; + if (WasLastAction(LifeSurge) && OpenerStep == 16) OpenerStep++; + else if (OpenerStep == 16) actionID = LifeSurge; - if (CustomComboFunctions.WasLastAction(Nastrond) && OpenerStep == 18) OpenerStep++; - else if (OpenerStep == 18) actionID = Nastrond; + if (WasLastAction(HeavensThrust) && OpenerStep == 17) OpenerStep++; + else if (OpenerStep == 17) actionID = HeavensThrust; - if (CustomComboFunctions.WasLastAction(RiseOfTheDragon) && OpenerStep == 19) OpenerStep++; - else if (OpenerStep == 19) actionID = RiseOfTheDragon; + if (WasLastAction(Nastrond) && OpenerStep == 18) OpenerStep++; + else if (OpenerStep == 18) actionID = Nastrond; - if (CustomComboFunctions.WasLastAction(FangAndClaw) && OpenerStep == 20) OpenerStep++; - else if (OpenerStep == 20) actionID = FangAndClaw; + if (WasLastAction(RiseOfTheDragon) && OpenerStep == 19) OpenerStep++; + else if (OpenerStep == 19) actionID = RiseOfTheDragon; - if (CustomComboFunctions.WasLastAction(Nastrond) && OpenerStep == 21) OpenerStep++; - else if (OpenerStep == 21) actionID = Nastrond; + if (WasLastAction(FangAndClaw) && OpenerStep == 20) OpenerStep++; + else if (OpenerStep == 20) actionID = FangAndClaw; - if (CustomComboFunctions.WasLastAction(MirageDive) && OpenerStep == 22) OpenerStep++; - else if (OpenerStep == 22) actionID = MirageDive; + if (WasLastAction(Nastrond) && OpenerStep == 21) OpenerStep++; + else if (OpenerStep == 21) actionID = Nastrond; - if (CustomComboFunctions.WasLastAction(Drakesbane) && OpenerStep == 23) OpenerStep++; - else if (OpenerStep == 23) actionID = Drakesbane; + if (WasLastAction(MirageDive) && OpenerStep == 22) OpenerStep++; + else if (OpenerStep == 22) actionID = MirageDive; - if (CustomComboFunctions.WasLastAction(RaidenThrust) && OpenerStep == 24) OpenerStep++; - else if (OpenerStep == 24) actionID = RaidenThrust; + if (WasLastAction(Drakesbane) && OpenerStep == 23) OpenerStep++; + else if (OpenerStep == 23) actionID = Drakesbane; - if (CustomComboFunctions.WasLastAction(WyrmwindThrust) && OpenerStep == 25) OpenerStep++; - else if (OpenerStep == 25) actionID = WyrmwindThrust; + if (WasLastAction(RaidenThrust) && OpenerStep == 24) OpenerStep++; + else if (OpenerStep == 24) actionID = RaidenThrust; - if (CustomComboFunctions.WasLastAction(SpiralBlow) && OpenerStep == 26) - CurrentState = OpenerState.OpenerFinished; - else if (OpenerStep == 26) actionID = SpiralBlow; + if (WasLastAction(WyrmwindThrust) && OpenerStep == 25) OpenerStep++; + else if (OpenerStep == 25) actionID = WyrmwindThrust; - if (ActionWatching.TimeSinceLastAction.TotalSeconds >= 5) - CurrentState = OpenerState.FailedOpener; + if (WasLastAction(SpiralBlow) && OpenerStep == 26) + CurrentState = OpenerState.OpenerFinished; + else if (OpenerStep == 26) actionID = SpiralBlow; - if (((actionID == DragonfireDive && CustomComboFunctions.IsOnCooldown(DragonfireDive)) || - (actionID == BattleLitany && CustomComboFunctions.IsOnCooldown(BattleLitany)) || - (actionID == LanceCharge && CustomComboFunctions.IsOnCooldown(LanceCharge)) || - (actionID == LifeSurge && CustomComboFunctions.GetRemainingCharges(LifeSurge) < 2)) && - ActionWatching.TimeSinceLastAction.TotalSeconds >= 3) - { - CurrentState = OpenerState.FailedOpener; + if (ActionWatching.TimeSinceLastAction.TotalSeconds >= 5) + CurrentState = OpenerState.FailedOpener; - return false; + if (((actionID == DragonfireDive && IsOnCooldown(DragonfireDive)) || + (actionID == BattleLitany && IsOnCooldown(BattleLitany)) || + (actionID == LanceCharge && IsOnCooldown(LanceCharge)) || + (actionID == LifeSurge && GetRemainingCharges(LifeSurge) < 2)) && + ActionWatching.TimeSinceLastAction.TotalSeconds >= 3) + { + CurrentState = OpenerState.FailedOpener; + + return false; + } + + return true; } - return true; + return false; } - return false; - } + private void ResetOpener() + { + PrePullStep = 0; + OpenerStep = 0; + } - private void ResetOpener() - { - PrePullStep = 0; - OpenerStep = 0; - } + public bool DoFullOpener(ref uint actionID) + { + if (!LevelChecked) + return false; - public bool DoFullOpener(ref uint actionID) - { - if (!LevelChecked) - return false; + if (CurrentState == OpenerState.PrePull) + if (DoPrePullSteps(ref actionID)) + return true; - if (CurrentState == OpenerState.PrePull) - if (DoPrePullSteps(ref actionID)) - return true; + if (CurrentState == OpenerState.InOpener) + if (DoOpener(ref actionID)) + return true; - if (CurrentState == OpenerState.InOpener) - if (DoOpener(ref actionID)) - return true; + if (!InCombat()) + { + ResetOpener(); + CurrentState = OpenerState.PrePull; + } - if (!CustomComboFunctions.InCombat()) - { - ResetOpener(); - CurrentState = OpenerState.PrePull; + return false; } - - return false; } -} -internal class AnimationLock -{ - internal static readonly List FastLocks = - [ - DRG.BattleLitany, - DRG.LanceCharge, - DRG.LifeSurge, - DRG.Geirskogul, - DRG.Nastrond, - DRG.MirageDive, - DRG.WyrmwindThrust, - DRG.RiseOfTheDragon, - DRG.Starcross, - Variant.VariantRampart, - All.TrueNorth - ]; - - internal static readonly List MidLocks = - [ - DRG.Jump, - DRG.HighJump, - DRG.DragonfireDive - ]; - - internal static uint SlowLock => DRG.Stardiver; - - internal static bool CanDRGWeave(uint oGCD) + internal class AnimationLock { - //GCD Ready - No Weave - if (CustomComboFunctions.IsOffCooldown(DRG.TrueThrust)) - return false; + internal static readonly List FastLocks = + [ + BattleLitany, + LanceCharge, + LifeSurge, + Geirskogul, + Nastrond, + MirageDive, + WyrmwindThrust, + RiseOfTheDragon, + Starcross, + Variant.VariantRampart, + All.TrueNorth + ]; + + internal static readonly List MidLocks = + [ + Jump, + HighJump, + DragonfireDive + ]; + + internal static uint SlowLock => Stardiver; + + internal static bool CanDRGWeave(uint oGCD) + { + float gcdTimer = GetCooldownRemainingTime(TrueThrust); - float gcdTimer = CustomComboFunctions.GetCooldownRemainingTime(DRG.TrueThrust); + //GCD Ready - No Weave + if (IsOffCooldown(TrueThrust)) + return false; - if (FastLocks.Any(x => x == oGCD) && gcdTimer >= 0.6f) - return true; + if (FastLocks.Any(x => x == oGCD) && gcdTimer >= 0.6f) + return true; - if (MidLocks.Any(x => x == oGCD) && gcdTimer >= 0.8f) - return true; + if (MidLocks.Any(x => x == oGCD) && gcdTimer >= 0.8f) + return true; - if (SlowLock == oGCD && gcdTimer >= 1.5f) - return true; + if (SlowLock == oGCD && gcdTimer >= 1.5f) + return true; - return false; + return false; + } } } \ No newline at end of file diff --git a/XIVSlothCombo/Combos/PvE/DRG.cs b/XIVSlothCombo/Combos/PvE/DRG.cs index e7578b4a2..4d60a207b 100644 --- a/XIVSlothCombo/Combos/PvE/DRG.cs +++ b/XIVSlothCombo/Combos/PvE/DRG.cs @@ -1,11 +1,9 @@ -using Dalamud.Game.ClientState.JobGauge.Types; using Dalamud.Game.ClientState.Statuses; -using XIVSlothCombo.Combos.JobHelpers; using XIVSlothCombo.Combos.PvE.Content; using XIVSlothCombo.CustomComboNS; using XIVSlothCombo.CustomComboNS.Functions; using XIVSlothCombo.Extensions; -using static XIVSlothCombo.CustomComboNS.Functions.CustomComboFunctions; +using static XIVSlothCombo.Combos.JobHelpers.DRG; namespace XIVSlothCombo.Combos.PvE; @@ -49,8 +47,6 @@ public const uint SpiralBlow = 36955, Starcross = 36956; - protected static DRGGauge? Gauge = GetJobGauge(); - public static class Buffs { public const ushort @@ -338,7 +334,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (JustUsed(OriginalHook(VorpalThrust)) && LevelChecked(FullThrust)))) || (!LevelChecked(LanceCharge) && JustUsed(VorpalThrust)))) return LifeSurge; - + //Geirskogul Feature if (IsEnabled(CustomComboPreset.DRG_ST_Geirskogul) && ActionReady(Geirskogul) && @@ -772,11 +768,9 @@ internal class DRG_BurstCDFeature : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - if (actionID is LanceCharge) - if (IsOnCooldown(LanceCharge) && ActionReady(BattleLitany)) - return BattleLitany; - - return actionID; + return actionID is LanceCharge && IsOnCooldown(LanceCharge) && ActionReady(BattleLitany) + ? BattleLitany + : actionID; } } } \ No newline at end of file From 7266d18e38630385fdc60cd8ab9308cba33d3ccf Mon Sep 17 00:00:00 2001 From: Kage Date: Wed, 6 Nov 2024 09:38:51 +0100 Subject: [PATCH 3/7] fix gauge --- XIVSlothCombo/Combos/JobHelpers/DRG.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/DRG.cs b/XIVSlothCombo/Combos/JobHelpers/DRG.cs index 5eb4011f1..73df8ada8 100644 --- a/XIVSlothCombo/Combos/JobHelpers/DRG.cs +++ b/XIVSlothCombo/Combos/JobHelpers/DRG.cs @@ -13,7 +13,7 @@ namespace XIVSlothCombo.Combos.JobHelpers; internal class DRG { - public static DRGGauge Gauge = GetJobGauge(); + public static DRGGauge Gauge => GetJobGauge(); internal class DRGOpenerLogic { From 76cdaa849027f738814a42eb5b3034e57dedeb2d Mon Sep 17 00:00:00 2001 From: Kage Date: Tue, 12 Nov 2024 09:42:08 +0100 Subject: [PATCH 4/7] Cleanup --- XIVSlothCombo/Combos/JobHelpers/DRG.cs | 9 ++++++++- XIVSlothCombo/Combos/PvE/DRG.cs | 25 ------------------------- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/DRG.cs b/XIVSlothCombo/Combos/JobHelpers/DRG.cs index 73df8ada8..40e41cfd9 100644 --- a/XIVSlothCombo/Combos/JobHelpers/DRG.cs +++ b/XIVSlothCombo/Combos/JobHelpers/DRG.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using Dalamud.Game.ClientState.JobGauge.Types; +using Dalamud.Game.ClientState.Statuses; using ECommons.DalamudServices; using XIVSlothCombo.Combos.JobHelpers.Enums; using XIVSlothCombo.Combos.PvE; @@ -13,8 +14,14 @@ namespace XIVSlothCombo.Combos.JobHelpers; internal class DRG { + // DRG Gauge & Extensions public static DRGGauge Gauge => GetJobGauge(); - + public static DRGOpenerLogic DRGOpener => new(); + public static Status? ChaosDoTDebuff => FindTargetEffect(LevelChecked(ChaoticSpring) + ? Debuffs.ChaoticSpring + : Debuffs.ChaosThrust); + public static bool trueNorthReady => TargetNeedsPositionals() && ActionReady(All.TrueNorth) && + !HasEffect(All.Buffs.TrueNorth); internal class DRGOpenerLogic { private OpenerState currentState = OpenerState.PrePull; diff --git a/XIVSlothCombo/Combos/PvE/DRG.cs b/XIVSlothCombo/Combos/PvE/DRG.cs index 4d60a207b..d1b8ada78 100644 --- a/XIVSlothCombo/Combos/PvE/DRG.cs +++ b/XIVSlothCombo/Combos/PvE/DRG.cs @@ -1,4 +1,3 @@ -using Dalamud.Game.ClientState.Statuses; using XIVSlothCombo.Combos.PvE.Content; using XIVSlothCombo.CustomComboNS; using XIVSlothCombo.CustomComboNS.Functions; @@ -80,12 +79,10 @@ public static class Config public static UserInt DRG_Variant_Cure = new("DRG_VariantCure"), DRG_ST_LitanyHP = new("DRG_ST_LitanyHP", 2), - DRG_ST_SightHP = new("DRG_ST_SightHP", 2), DRG_ST_LanceChargeHP = new("DRG_ST_LanceChargeHP", 2), DRG_ST_SecondWind_Threshold = new("DRG_STSecondWindThreshold", 25), DRG_ST_Bloodbath_Threshold = new("DRG_STBloodbathThreshold", 40), DRG_AoE_LitanyHP = new("DRG_AoE_LitanyHP", 5), - DRG_AoE_SightHP = new("DRG_AoE_SightHP", 5), DRG_AoE_LanceChargeHP = new("DRG_AoE_LanceChargeHP", 5), DRG_AoE_SecondWind_Threshold = new("DRG_AoE_SecondWindThreshold", 25), DRG_AoE_Bloodbath_Threshold = new("DRG_AoE_BloodbathThreshold", 40); @@ -93,21 +90,10 @@ public static UserInt internal class DRG_ST_SimpleMode : CustomCombo { - internal static DRGOpenerLogic DRGOpener = new(); - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.DRG_ST_SimpleMode; protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - Status? ChaosDoTDebuff; - - bool trueNorthReady = TargetNeedsPositionals() && ActionReady(All.TrueNorth) && - !HasEffect(All.Buffs.TrueNorth); - - if (LevelChecked(ChaoticSpring)) - ChaosDoTDebuff = FindTargetEffect(Debuffs.ChaoticSpring); - else ChaosDoTDebuff = FindTargetEffect(Debuffs.ChaosThrust); - if (actionID is TrueThrust) { if (IsEnabled(CustomComboPreset.DRG_Variant_Cure) && @@ -263,21 +249,10 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim internal class DRG_ST_AdvancedMode : CustomCombo { - internal static DRGOpenerLogic DRGOpener = new(); - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.DRG_ST_AdvancedMode; protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - Status? ChaosDoTDebuff; - - bool trueNorthReady = TargetNeedsPositionals() && ActionReady(All.TrueNorth) && - !HasEffect(All.Buffs.TrueNorth); - - if (LevelChecked(ChaoticSpring)) - ChaosDoTDebuff = FindTargetEffect(Debuffs.ChaoticSpring); - else ChaosDoTDebuff = FindTargetEffect(Debuffs.ChaosThrust); - if (actionID is TrueThrust) { if (IsEnabled(CustomComboPreset.DRG_Variant_Cure) && From 35f51c77a335c2c6b7749e0da688ac27d623ed6c Mon Sep 17 00:00:00 2001 From: Kage Date: Thu, 14 Nov 2024 15:43:24 +0100 Subject: [PATCH 5/7] Update opener to 7.1 --- ECommons | 2 +- XIVSlothCombo/Combos/JobHelpers/DRG.cs | 39 +++++++++++--------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/ECommons b/ECommons index 0e0cc76e4..d77c9db19 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit 0e0cc76e4197e28b2576502f8a059815ce0a3aa4 +Subproject commit d77c9db195056fca9e855c7d142bc6cd8566258f diff --git a/XIVSlothCombo/Combos/JobHelpers/DRG.cs b/XIVSlothCombo/Combos/JobHelpers/DRG.cs index 40e41cfd9..8984a1352 100644 --- a/XIVSlothCombo/Combos/JobHelpers/DRG.cs +++ b/XIVSlothCombo/Combos/JobHelpers/DRG.cs @@ -16,12 +16,16 @@ internal class DRG { // DRG Gauge & Extensions public static DRGGauge Gauge => GetJobGauge(); + public static DRGOpenerLogic DRGOpener => new(); + public static Status? ChaosDoTDebuff => FindTargetEffect(LevelChecked(ChaoticSpring) ? Debuffs.ChaoticSpring : Debuffs.ChaosThrust); + public static bool trueNorthReady => TargetNeedsPositionals() && ActionReady(All.TrueNorth) && !HasEffect(All.Buffs.TrueNorth); + internal class DRGOpenerLogic { private OpenerState currentState = OpenerState.PrePull; @@ -46,7 +50,7 @@ public OpenerState CurrentState if (value == OpenerState.PrePull) Svc.Log.Debug("Entered PrePull Opener"); if (value == OpenerState.InOpener) OpenerStep = 1; - if (value == OpenerState.OpenerFinished || value == OpenerState.FailedOpener) + if (value is OpenerState.OpenerFinished or OpenerState.FailedOpener) { if (value == OpenerState.FailedOpener) Svc.Log.Information($"Opener Failed at step {OpenerStep}"); @@ -87,8 +91,7 @@ private bool DoPrePullSteps(ref uint actionID) if (CurrentState == OpenerState.PrePull && PrePullStep > 0) { - if (WasLastAction(TrueThrust) && PrePullStep == 1) - CurrentState = OpenerState.InOpener; + if (WasLastAction(TrueThrust) && PrePullStep == 1) CurrentState = OpenerState.InOpener; else if (PrePullStep == 1) actionID = TrueThrust; if (ActionWatching.CombatActions.Count > 2 && InCombat()) @@ -159,33 +162,23 @@ private bool DoOpener(ref uint actionID) if (WasLastAction(HeavensThrust) && OpenerStep == 17) OpenerStep++; else if (OpenerStep == 17) actionID = HeavensThrust; - if (WasLastAction(Nastrond) && OpenerStep == 18) OpenerStep++; - else if (OpenerStep == 18) actionID = Nastrond; + if (WasLastAction(RiseOfTheDragon) && OpenerStep == 18) OpenerStep++; + else if (OpenerStep == 18) actionID = RiseOfTheDragon; - if (WasLastAction(RiseOfTheDragon) && OpenerStep == 19) OpenerStep++; - else if (OpenerStep == 19) actionID = RiseOfTheDragon; + if (WasLastAction(MirageDive) && OpenerStep == 19) OpenerStep++; + else if (OpenerStep == 19) actionID = MirageDive; if (WasLastAction(FangAndClaw) && OpenerStep == 20) OpenerStep++; else if (OpenerStep == 20) actionID = FangAndClaw; - if (WasLastAction(Nastrond) && OpenerStep == 21) OpenerStep++; - else if (OpenerStep == 21) actionID = Nastrond; - - if (WasLastAction(MirageDive) && OpenerStep == 22) OpenerStep++; - else if (OpenerStep == 22) actionID = MirageDive; - - if (WasLastAction(Drakesbane) && OpenerStep == 23) OpenerStep++; - else if (OpenerStep == 23) actionID = Drakesbane; - - if (WasLastAction(RaidenThrust) && OpenerStep == 24) OpenerStep++; - else if (OpenerStep == 24) actionID = RaidenThrust; + if (WasLastAction(Drakesbane) && OpenerStep == 21) OpenerStep++; + else if (OpenerStep == 21) actionID = Drakesbane; - if (WasLastAction(WyrmwindThrust) && OpenerStep == 25) OpenerStep++; - else if (OpenerStep == 25) actionID = WyrmwindThrust; + if (WasLastAction(RaidenThrust) && OpenerStep == 22) OpenerStep++; + else if (OpenerStep == 22) actionID = RaidenThrust; - if (WasLastAction(SpiralBlow) && OpenerStep == 26) - CurrentState = OpenerState.OpenerFinished; - else if (OpenerStep == 26) actionID = SpiralBlow; + if (WasLastAction(WyrmwindThrust) && OpenerStep == 23) CurrentState = OpenerState.OpenerFinished; + else if (OpenerStep == 23) actionID = WyrmwindThrust; if (ActionWatching.TimeSinceLastAction.TotalSeconds >= 5) CurrentState = OpenerState.FailedOpener; From f91b105180552c3a41e039ff9e5aea577d0ee077 Mon Sep 17 00:00:00 2001 From: Kage Date: Sat, 16 Nov 2024 23:48:58 +0100 Subject: [PATCH 6/7] fix opener --- XIVSlothCombo/Combos/JobHelpers/DRG.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/DRG.cs b/XIVSlothCombo/Combos/JobHelpers/DRG.cs index 8984a1352..2e92993b3 100644 --- a/XIVSlothCombo/Combos/JobHelpers/DRG.cs +++ b/XIVSlothCombo/Combos/JobHelpers/DRG.cs @@ -16,13 +16,10 @@ internal class DRG { // DRG Gauge & Extensions public static DRGGauge Gauge => GetJobGauge(); - - public static DRGOpenerLogic DRGOpener => new(); - + public static DRGOpenerLogic DRGOpener = new(); public static Status? ChaosDoTDebuff => FindTargetEffect(LevelChecked(ChaoticSpring) ? Debuffs.ChaoticSpring : Debuffs.ChaosThrust); - public static bool trueNorthReady => TargetNeedsPositionals() && ActionReady(All.TrueNorth) && !HasEffect(All.Buffs.TrueNorth); From 5e85cce838567a8132b843a1cd56888720e2b72f Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 17 Nov 2024 00:18:32 +0100 Subject: [PATCH 7/7] some cleanup --- XIVSlothCombo/Combos/JobHelpers/DRG.cs | 10 +- XIVSlothCombo/Combos/PvE/DRG.cs | 136 +++++++++++++------------ 2 files changed, 76 insertions(+), 70 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/DRG.cs b/XIVSlothCombo/Combos/JobHelpers/DRG.cs index 2e92993b3..bfa0fcbea 100644 --- a/XIVSlothCombo/Combos/JobHelpers/DRG.cs +++ b/XIVSlothCombo/Combos/JobHelpers/DRG.cs @@ -15,13 +15,15 @@ namespace XIVSlothCombo.Combos.JobHelpers; internal class DRG { // DRG Gauge & Extensions - public static DRGGauge Gauge => GetJobGauge(); + public static DRGGauge Gauge = GetJobGauge(); public static DRGOpenerLogic DRGOpener = new(); - public static Status? ChaosDoTDebuff => FindTargetEffect(LevelChecked(ChaoticSpring) + + public static Status? ChaosDoTDebuff = FindTargetEffect(LevelChecked(ChaoticSpring) ? Debuffs.ChaoticSpring : Debuffs.ChaosThrust); - public static bool trueNorthReady => TargetNeedsPositionals() && ActionReady(All.TrueNorth) && - !HasEffect(All.Buffs.TrueNorth); + + public static bool trueNorthReady = TargetNeedsPositionals() && ActionReady(All.TrueNorth) && + !HasEffect(All.Buffs.TrueNorth); internal class DRGOpenerLogic { diff --git a/XIVSlothCombo/Combos/PvE/DRG.cs b/XIVSlothCombo/Combos/PvE/DRG.cs index d1b8ada78..e872b4d48 100644 --- a/XIVSlothCombo/Combos/PvE/DRG.cs +++ b/XIVSlothCombo/Combos/PvE/DRG.cs @@ -8,72 +8,6 @@ namespace XIVSlothCombo.Combos.PvE; internal class DRG { - public const byte ClassID = 4; - public const byte JobID = 22; - - public const uint - PiercingTalon = 90, - ElusiveJump = 94, - LanceCharge = 85, - BattleLitany = 3557, - Jump = 92, - LifeSurge = 83, - HighJump = 16478, - MirageDive = 7399, - BloodOfTheDragon = 3553, - Stardiver = 16480, - CoerthanTorment = 16477, - DoomSpike = 86, - SonicThrust = 7397, - ChaosThrust = 88, - RaidenThrust = 16479, - TrueThrust = 75, - Disembowel = 87, - FangAndClaw = 3554, - WheelingThrust = 3556, - FullThrust = 84, - VorpalThrust = 78, - WyrmwindThrust = 25773, - DraconianFury = 25770, - ChaoticSpring = 25772, - DragonfireDive = 96, - Geirskogul = 3555, - Nastrond = 7400, - HeavensThrust = 25771, - Drakesbane = 36952, - RiseOfTheDragon = 36953, - LanceBarrage = 36954, - SpiralBlow = 36955, - Starcross = 36956; - - public static class Buffs - { - public const ushort - LanceCharge = 1864, - BattleLitany = 786, - DiveReady = 1243, - RaidenThrustReady = 1863, - PowerSurge = 2720, - LifeSurge = 116, - DraconianFire = 1863, - NastrondReady = 3844, - StarcrossReady = 3846, - DragonsFlight = 3845; - } - - public static class Debuffs - { - public const ushort - ChaosThrust = 118, - ChaoticSpring = 2719; - } - - public static class Traits - { - public const uint - EnhancedLifeSurge = 438; - } - public static class Config { public static UserInt @@ -748,4 +682,74 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim : actionID; } } + + #region ID's + + public const byte ClassID = 4; + public const byte JobID = 22; + + public const uint + PiercingTalon = 90, + ElusiveJump = 94, + LanceCharge = 85, + BattleLitany = 3557, + Jump = 92, + LifeSurge = 83, + HighJump = 16478, + MirageDive = 7399, + BloodOfTheDragon = 3553, + Stardiver = 16480, + CoerthanTorment = 16477, + DoomSpike = 86, + SonicThrust = 7397, + ChaosThrust = 88, + RaidenThrust = 16479, + TrueThrust = 75, + Disembowel = 87, + FangAndClaw = 3554, + WheelingThrust = 3556, + FullThrust = 84, + VorpalThrust = 78, + WyrmwindThrust = 25773, + DraconianFury = 25770, + ChaoticSpring = 25772, + DragonfireDive = 96, + Geirskogul = 3555, + Nastrond = 7400, + HeavensThrust = 25771, + Drakesbane = 36952, + RiseOfTheDragon = 36953, + LanceBarrage = 36954, + SpiralBlow = 36955, + Starcross = 36956; + + public static class Buffs + { + public const ushort + LanceCharge = 1864, + BattleLitany = 786, + DiveReady = 1243, + RaidenThrustReady = 1863, + PowerSurge = 2720, + LifeSurge = 116, + DraconianFire = 1863, + NastrondReady = 3844, + StarcrossReady = 3846, + DragonsFlight = 3845; + } + + public static class Debuffs + { + public const ushort + ChaosThrust = 118, + ChaoticSpring = 2719; + } + + public static class Traits + { + public const uint + EnhancedLifeSurge = 438; + } + + #endregion } \ No newline at end of file