From 672381433bcdb25d8111a91656f070a3a64cf148 Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 20 Oct 2024 17:53:37 +0200 Subject: [PATCH 01/46] Add Advanced ST --- XIVSlothCombo/Combos/CustomComboPreset.cs | 58 +- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 593 +++++-------- XIVSlothCombo/Combos/PvE/BLM.cs | 983 +++++++++++++--------- 3 files changed, 846 insertions(+), 788 deletions(-) diff --git a/XIVSlothCombo/Combos/CustomComboPreset.cs b/XIVSlothCombo/Combos/CustomComboPreset.cs index 6f27ee6b3..b6f809cf2 100644 --- a/XIVSlothCombo/Combos/CustomComboPreset.cs +++ b/XIVSlothCombo/Combos/CustomComboPreset.cs @@ -363,15 +363,63 @@ public enum CustomComboPreset #endregion #region BLACK MAGE - + [ReplaceSkill(BLM.Fire)] - [CustomComboInfo("Simple Mode - Single Target", "Replaces Fire with a full one-button single target rotation.\nThis is the ideal option for newcomers to the job.", BLM.JobID, -10, "", "")] + [CustomComboInfo("Simple Mode - Single Target", "Replaces Fire with a full one-button single target rotation.\nThis is the ideal option for newcomers to the job.", BLM.JobID, -10)] BLM_ST_SimpleMode = 2012, - + [ReplaceSkill(BLM.Blizzard2, BLM.HighBlizzard2)] - [CustomComboInfo("Simple Mode - AoE", "Replaces Blizzard II with a full one-button AoE rotation.\nThis is the ideal option for newcomers to the job.", BLM.JobID, -8, "", "")] + [CustomComboInfo("Simple Mode - AoE", "Replaces Blizzard II with a full one-button AoE rotation.\nThis is the ideal option for newcomers to the job.", BLM.JobID, -8)] BLM_AoE_SimpleMode = 2008, + + [ReplaceSkill(BLM.Fire)] + [CustomComboInfo("Advanced Mode - Single Target", "Replaces Fire with a full one-button single target rotation.\nThese features are ideal if you want to customize the rotation.", BLM.JobID, -10)] + BLM_ST_AdvancedMode = 2058, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Level 100 Opener", "Adds the Balance opener to the rotation.", BLM.JobID)] + BLM_ST_Opener = 2059, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Foul / Xenoglossy", "Add Foul / Xenoglossy to the rotation.", BLM.JobID)] + BLM_ST_UsePolyglot = 2060, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Foul / Xenoglossy for movement", "Add Foul / Xenoglossy to the rotation as movement option.", BLM.JobID)] + BLM_ST_UsePolyglotMoving = 2061, + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Amplifier", "Add Amplifier to the rotation.", BLM.JobID)] + BLM_ST_Amplifier = 2062, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Leylines", "Add Leylines to the rotation.", BLM.JobID)] + BLM_ST_LeyLines = 2063, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Despair", "Add Despair to the rotation.", BLM.JobID)] + BLM_ST_Despair = 2064, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Swiftcast", "Add Swiftcast to the rotation.", BLM.JobID)] + BLM_ST_Swiftcast = 2065, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Triplecast", "Add Triplecast to the rotation.", BLM.JobID)] + BLM_ST_Triplecast = 2066, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Flarestar", "Add Flarestar to the rotation.", BLM.JobID)] + BLM_ST_Flarestar = 2067, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Manafont", "Add Manafont to the rotation.", BLM.JobID)] + BLM_ST_Manafont = 2068, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Transpose", "Add Transpose to the rotation.", BLM.JobID)] + BLM_ST_Transpose = 2069, + #region Variant [Variant] @@ -417,7 +465,7 @@ public enum CustomComboPreset BLM_Aetherial_Manipulation = 2046, #endregion - // Last value = 2057 + // Last value = 2069 #endregion diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index 89e3a0dc9..996155fda 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -1,492 +1,285 @@ -using Dalamud.Game.ClientState.JobGauge.Types; -using ECommons.DalamudServices; -using System; +using System; +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.CustomComboNS.Functions; using XIVSlothCombo.Data; +using static XIVSlothCombo.CustomComboNS.Functions.CustomComboFunctions; -namespace XIVSlothCombo.Combos.JobHelpers -{ - internal class BLMOpenerLogic : PvE.BLM - { - private static bool HasCooldowns() - { - if (CustomComboFunctions.GetRemainingCharges(Triplecast) < 2) - return false; - if (!CustomComboFunctions.ActionReady(Manafont)) - return false; - if (!CustomComboFunctions.ActionReady(All.Swiftcast)) - return false; - if (!CustomComboFunctions.ActionReady(Amplifier)) - return false; - if (!CustomComboFunctions.ActionReady(All.LucidDreaming) && - Config.BLM_Advanced_OpenerSelection == 1) - return false; - if (!CustomComboFunctions.ActionReady(LeyLines)) - return false; - - return true; - } - - public static bool HasPrePullCooldowns() - { - if (CustomComboFunctions.GetRemainingCharges(Sharpcast) < 2) - return false; - - if (CustomComboFunctions.LocalPlayer.CurrentMp < 10000) - return false; - - return true; - } +namespace XIVSlothCombo.Combos.JobHelpers; - private static uint OpenerLevel => 90; +internal class BLMOpenerLogic : BLM +{ + public static int Fire4Count = ActionWatching.CombatActions.Count(x => x == Fire4); + private OpenerState currentState = OpenerState.PrePull; - public uint PrePullStep = 0; + public uint OpenerStep = 1; - public uint OpenerStep = 1; + public uint PrePullStep; - public static bool LevelChecked => CustomComboFunctions.LocalPlayer.Level >= OpenerLevel; + private static uint OpenerLevel => 100; - private static bool CanOpener => HasCooldowns() && HasPrePullCooldowns() && LevelChecked; + public static bool LevelChecked => LocalPlayer.Level >= OpenerLevel; - private OpenerState currentState = OpenerState.PrePull; + private static bool CanOpener => HasCooldowns() && LevelChecked; - public OpenerState CurrentState - { - get - { - return currentState; - } - set - { - if (value != 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 == OpenerState.FailedOpener) - Svc.Log.Information($"Opener Failed at step {OpenerStep}"); - - ResetOpener(); - } - if (value == OpenerState.OpenerFinished) Svc.Log.Information("Opener Finished"); - - currentState = value; - } - } - } - - private bool DoPrePullSteps(ref uint actionID) + public OpenerState CurrentState + { + get => currentState; + set { - if (!LevelChecked) return false; - - if (CanOpener && PrePullStep == 0) - { - PrePullStep = 1; - } - - if (!HasCooldowns()) - { - PrePullStep = 0; - } - - if (CurrentState == OpenerState.PrePull && PrePullStep > 0) + if (value != currentState) { - if (CustomComboFunctions.HasEffect(Buffs.Sharpcast) && PrePullStep == 1) PrePullStep++; - else if (PrePullStep == 1) actionID = Sharpcast; - - if (CustomComboFunctions.LocalPlayer.CastActionId == Fire3 && PrePullStep == 2) CurrentState = OpenerState.InOpener; - else if (PrePullStep == 2) actionID = Fire3; + if (value == OpenerState.PrePull) Svc.Log.Debug("Entered PrePull Opener"); + if (value == OpenerState.InOpener) OpenerStep = 1; - if (PrePullStep == 2 && !CustomComboFunctions.HasEffect(Buffs.Sharpcast)) - CurrentState = OpenerState.FailedOpener; - - if (PrePullStep > 1 && CustomComboFunctions.GetResourceCost(actionID) > CustomComboFunctions.LocalPlayer.CurrentMp && ActionWatching.TimeSinceLastAction.TotalSeconds >= 2) - CurrentState = OpenerState.FailedOpener; + if (value == OpenerState.OpenerFinished || value == OpenerState.FailedOpener) + { + if (value == OpenerState.FailedOpener) + Svc.Log.Information($"Opener Failed at step {OpenerStep}"); - if (ActionWatching.CombatActions.Count > 2 && CustomComboFunctions.InCombat()) - CurrentState = OpenerState.FailedOpener; + ResetOpener(); + } + if (value == OpenerState.OpenerFinished) Svc.Log.Information("Opener Finished"); - return true; + currentState = value; } - - PrePullStep = 0; - return false; } + } - private bool DoOpener(ref uint actionID) - { - if (!LevelChecked) return false; - - if (currentState == OpenerState.InOpener) - { - if (Config.BLM_Advanced_OpenerSelection == 0) - { - if (CustomComboFunctions.LocalPlayer.CastActionId == Thunder3 && OpenerStep == 1) OpenerStep++; - else if (OpenerStep == 1) actionID = Thunder3; - - if (CustomComboFunctions.WasLastAction(Triplecast) && OpenerStep == 2) OpenerStep++; - else if (OpenerStep == 2) actionID = Triplecast; - - if (CustomComboFunctions.WasLastAction(Fire4) && CustomComboFunctions.GetBuffStacks(Buffs.Triplecast) == 2 && OpenerStep == 3) OpenerStep++; - else if (OpenerStep == 3) actionID = Fire4; - - if (CustomComboFunctions.WasLastAction(Fire4) && CustomComboFunctions.GetBuffStacks(Buffs.Triplecast) == 1 && OpenerStep == 4) OpenerStep++; - else if (OpenerStep == 4) actionID = Fire4; - - if (CustomComboFunctions.WasLastAction(Amplifier) && OpenerStep == 5) OpenerStep++; - else if (OpenerStep == 5) actionID = Amplifier; - - if (CustomComboFunctions.WasLastAction(LeyLines) && OpenerStep == 6) OpenerStep++; - else if (OpenerStep == 6) actionID = LeyLines; - - if (CustomComboFunctions.WasLastAction(Fire4) && CustomComboFunctions.GetBuffStacks(Buffs.Triplecast) == 0 && OpenerStep == 7) OpenerStep++; - else if (OpenerStep == 7) actionID = Fire4; - - if (CustomComboFunctions.WasLastAction(All.Swiftcast) && OpenerStep == 8) OpenerStep++; - else if (OpenerStep == 8) actionID = All.Swiftcast; - - if (CustomComboFunctions.WasLastAction(Fire4) && OpenerStep == 9) OpenerStep++; - else if (OpenerStep == 9) actionID = Fire4; - - if (CustomComboFunctions.WasLastAction(Triplecast) && OpenerStep == 10) OpenerStep++; - else if (OpenerStep == 10) actionID = Triplecast; - - if (CustomComboFunctions.WasLastAction(Despair) && OpenerStep == 11) OpenerStep++; - else if (OpenerStep == 11) actionID = Despair; - - if (CustomComboFunctions.WasLastAction(Manafont) && OpenerStep == 12) OpenerStep++; - else if (OpenerStep == 12) actionID = Manafont; - - if (CustomComboFunctions.WasLastAction(Fire4) && OpenerStep == 13) OpenerStep++; - else if (OpenerStep == 13) actionID = Fire4; + private static bool HasCooldowns() + { + if (!ActionReady(Manafont)) + return false; - if (CustomComboFunctions.WasLastAction(Sharpcast) && OpenerStep == 14) OpenerStep++; - else if (OpenerStep == 14) actionID = Sharpcast; + if (!ActionReady(All.Swiftcast)) + return false; - if (CustomComboFunctions.WasLastAction(Despair) && OpenerStep == 15) OpenerStep++; - else if (OpenerStep == 15) actionID = Despair; + if (!ActionReady(Amplifier)) + return false; - if (CustomComboFunctions.WasLastAction(Blizzard3) && OpenerStep == 16) OpenerStep++; - else if (OpenerStep == 16) actionID = Blizzard3; + if (!ActionReady(All.LucidDreaming) && + Config.BLM_Advanced_OpenerSelection == 1) + return false; - if (CustomComboFunctions.WasLastAction(Xenoglossy) && OpenerStep == 17) OpenerStep++; - else if (OpenerStep == 17) actionID = Xenoglossy; + if (!ActionReady(LeyLines)) + return false; - if (CustomComboFunctions.WasLastAction(Paradox) && OpenerStep == 18) OpenerStep++; - else if (OpenerStep == 18) actionID = Paradox; + return true; + } - if (CustomComboFunctions.LocalPlayer.CastActionId == Blizzard4 && OpenerStep == 19) OpenerStep++; - else if (OpenerStep == 19) actionID = Blizzard4; + private bool DoPrePullSteps(ref uint actionID) + { + if (!LevelChecked) return false; - if (CustomComboFunctions.WasLastAction(Thunder3) && OpenerStep == 20) CurrentState = OpenerState.OpenerFinished; - else if (OpenerStep == 20) actionID = Thunder3; + if (CanOpener && PrePullStep == 0) PrePullStep = 1; - if (((actionID == Triplecast && CustomComboFunctions.GetRemainingCharges(Triplecast) < 2) || - (actionID == Amplifier && CustomComboFunctions.IsOnCooldown(Amplifier)) || - (actionID == LeyLines && CustomComboFunctions.IsOnCooldown(LeyLines)) || - (actionID == All.LucidDreaming && CustomComboFunctions.IsOnCooldown(All.LucidDreaming)) || - (actionID == Manafont && CustomComboFunctions.IsOnCooldown(Manafont)) || - (actionID == Sharpcast && CustomComboFunctions.GetRemainingCharges(Sharpcast) < 1) || - (actionID == All.Swiftcast && CustomComboFunctions.IsOnCooldown(All.Swiftcast)) || - (actionID == Xenoglossy && Svc.Gauges.Get().PolyglotStacks < 1)) && ActionWatching.TimeSinceLastAction.TotalSeconds >= 3) - { - CurrentState = OpenerState.FailedOpener; - return false; - } - } + if (!HasCooldowns()) PrePullStep = 0; - else - { + if (CurrentState == OpenerState.PrePull && PrePullStep > 0) + { + if (LocalPlayer.CastActionId == Fire3 && PrePullStep == 1) CurrentState = OpenerState.InOpener; + else if (PrePullStep == 1) actionID = Fire3; - if (CustomComboFunctions.LocalPlayer.CastActionId == Thunder3 && OpenerStep == 1) OpenerStep++; - else if (OpenerStep == 1) actionID = Thunder3; + if (PrePullStep > 1 && + GetResourceCost(actionID) > LocalPlayer.CurrentMp && + ActionWatching.TimeSinceLastAction.TotalSeconds >= 2) + CurrentState = OpenerState.FailedOpener; - if (CustomComboFunctions.LocalPlayer.CastActionId == Fire4 && OpenerStep == 2) OpenerStep++; - else if (OpenerStep == 2) actionID = Fire4; + if (ActionWatching.CombatActions.Count > 2 && InCombat()) + CurrentState = OpenerState.FailedOpener; - if (CustomComboFunctions.WasLastAction(Triplecast) && OpenerStep == 3) OpenerStep++; - else if (OpenerStep == 3) actionID = Triplecast; + return true; + } - if (CustomComboFunctions.WasLastAction(Fire4) && CustomComboFunctions.GetBuffStacks(Buffs.Triplecast) == 2 && OpenerStep == 4) OpenerStep++; - else if (OpenerStep == 4) actionID = Fire4; + PrePullStep = 0; - if (CustomComboFunctions.WasLastAction(Fire4) && CustomComboFunctions.GetBuffStacks(Buffs.Triplecast) == 1 && OpenerStep == 5) OpenerStep++; - else if (OpenerStep == 5) actionID = Fire4; + return false; + } - if (CustomComboFunctions.WasLastAction(Amplifier) && OpenerStep == 6) OpenerStep++; - else if (OpenerStep == 6) actionID = Amplifier; + private bool DoOpener(ref uint actionID) + { + if (!LevelChecked) return false; - if (CustomComboFunctions.WasLastAction(LeyLines) && OpenerStep == 7) OpenerStep++; - else if (OpenerStep == 7) actionID = LeyLines; + if (currentState == OpenerState.InOpener) + { + if (LocalPlayer.CastActionId == HighThunder && OpenerStep == 1) OpenerStep++; + else if (OpenerStep == 1) actionID = HighThunder; - if (CustomComboFunctions.WasLastAction(Fire4) && CustomComboFunctions.GetBuffStacks(Buffs.Triplecast) == 0 && OpenerStep == 8) OpenerStep++; - else if (OpenerStep == 8) actionID = Fire4; + if (WasLastAction(All.Swiftcast) && OpenerStep == 2) OpenerStep++; + else if (OpenerStep == 2) actionID = All.Swiftcast; - if (CustomComboFunctions.WasLastAction(Triplecast) && OpenerStep == 9) OpenerStep++; - else if (OpenerStep == 9) actionID = Triplecast; + if (WasLastAction(Amplifier) && OpenerStep == 3) OpenerStep++; + else if (OpenerStep == 3) actionID = Amplifier; - if (CustomComboFunctions.WasLastAction(All.LucidDreaming) && OpenerStep == 10) OpenerStep++; - else if (OpenerStep == 10) actionID = All.LucidDreaming; + if (WasLastAction(Fire4) && Fire4Count is 1 && OpenerStep == 4) OpenerStep++; + else if (OpenerStep == 4) actionID = Fire4; - if (CustomComboFunctions.WasLastAction(Despair) && OpenerStep == 11) OpenerStep++; - else if (OpenerStep == 11) actionID = Despair; + if (WasLastAction(Fire4) && Fire4Count is 2 && OpenerStep == 5) OpenerStep++; + else if (OpenerStep == 5) actionID = Fire4; - if (CustomComboFunctions.WasLastAction(Manafont) && OpenerStep == 12) OpenerStep++; - else if (OpenerStep == 12) actionID = Manafont; + if (WasLastAction(Xenoglossy) && OpenerStep == 6) OpenerStep++; + else if (OpenerStep == 6) actionID = Xenoglossy; - if (CustomComboFunctions.WasLastAction(Fire4) && OpenerStep == 13) OpenerStep++; - else if (OpenerStep == 13) actionID = Fire4; + if (WasLastAction(Triplecast) && OpenerStep == 7) OpenerStep++; + else if (OpenerStep == 7) actionID = Triplecast; - if (CustomComboFunctions.WasLastAction(Sharpcast) && OpenerStep == 14) OpenerStep++; - else if (OpenerStep == 14) actionID = Sharpcast; + if (WasLastAction(LeyLines) && OpenerStep == 8) OpenerStep++; + else if (OpenerStep == 8) actionID = LeyLines; - if (CustomComboFunctions.WasLastAction(Despair) && OpenerStep == 15) OpenerStep++; - else if (OpenerStep == 15) actionID = Despair; + if (WasLastAction(Fire4) && Fire4Count is 3 && OpenerStep == 9) OpenerStep++; + else if (OpenerStep == 9) actionID = Fire4; - if (CustomComboFunctions.WasLastAction(Transpose) && OpenerStep == 16) OpenerStep++; - else if (OpenerStep == 16) actionID = Transpose; + if (WasLastAction(Fire4) && Fire4Count is 4 && OpenerStep == 10) OpenerStep++; + else if (OpenerStep == 10) actionID = Fire4; - if (CustomComboFunctions.WasLastAction(Paradox) && OpenerStep == 17) OpenerStep++; - else if (OpenerStep == 17) actionID = Paradox; + if (WasLastAction(Despair) && OpenerStep == 11) OpenerStep++; + else if (OpenerStep == 11) actionID = Despair; - if (CustomComboFunctions.WasLastAction(All.Swiftcast) && OpenerStep == 18) OpenerStep++; - else if (OpenerStep == 18) actionID = All.Swiftcast; + if (WasLastAction(Manafont) && OpenerStep == 12) OpenerStep++; + else if (OpenerStep == 12) actionID = Manafont; - if (CustomComboFunctions.WasLastAction(Xenoglossy) && OpenerStep == 19) OpenerStep++; - else if (OpenerStep == 19) actionID = Xenoglossy; + if (WasLastAction(Triplecast) && OpenerStep == 13) OpenerStep++; + else if (OpenerStep == 13) actionID = Triplecast; - if ((CustomComboFunctions.LocalPlayer.CastActionId == Thunder3 || CustomComboFunctions.WasLastAction(Thunder3)) && OpenerStep == 20) OpenerStep++; - else if (OpenerStep == 20) actionID = Thunder3; + if (WasLastAction(Fire4) && Fire4Count is 5 && OpenerStep == 14) OpenerStep++; + else if (OpenerStep == 14) actionID = Fire4; - if (CustomComboFunctions.LocalPlayer.CurrentMp == CustomComboFunctions.LocalPlayer.MaxMp && OpenerStep == 21) OpenerStep++; - else if (OpenerStep == 21) actionID = Blizzard3; + if (WasLastAction(Fire4) && Fire4Count is 6 && OpenerStep == 15) OpenerStep++; + else if (OpenerStep == 15) actionID = Fire4; - if (CustomComboFunctions.WasLastAction(Transpose) && OpenerStep == 22) OpenerStep++; - else if (OpenerStep == 22) actionID = Transpose; + if (WasLastAction(FlareStar) && OpenerStep == 16) OpenerStep++; + else if (OpenerStep == 16) actionID = FlareStar; - if ((CustomComboFunctions.LocalPlayer.CastActionId == Fire3 || CustomComboFunctions.WasLastAction(Fire3)) && OpenerStep == 23) OpenerStep++; - else if (OpenerStep == 23) actionID = Fire3; + if (WasLastAction(Fire4) && Fire4Count is 7 && OpenerStep == 17) OpenerStep++; + else if (OpenerStep == 17) actionID = Fire4; - if ((CustomComboFunctions.LocalPlayer.CastActionId == Fire4 || CustomComboFunctions.WasLastAction(Fire4)) && OpenerStep == 24 && ActionWatching.CombatActions.Count == 24) OpenerStep++; - else if (OpenerStep == 24) actionID = Fire4; + if (WasLastAction(HighThunder) && OpenerStep == 18) OpenerStep++; + else if (OpenerStep == 18) actionID = HighThunder; - if ((CustomComboFunctions.LocalPlayer.CastActionId == Fire4 || CustomComboFunctions.WasLastAction(Fire4)) && OpenerStep == 25 && ActionWatching.CombatActions.Count == 25) OpenerStep++; - else if (OpenerStep == 25) actionID = Fire4; + if (WasLastAction(Paradox) && OpenerStep == 19) OpenerStep++; + else if (OpenerStep == 19) actionID = Paradox; - if ((CustomComboFunctions.LocalPlayer.CastActionId == Fire4 || CustomComboFunctions.WasLastAction(Fire4)) && OpenerStep == 26 && ActionWatching.CombatActions.Count == 26) OpenerStep++; - else if (OpenerStep == 26) actionID = Fire4; + if (WasLastAction(Fire4) && Fire4Count is 8 && OpenerStep == 20) OpenerStep++; + else if (OpenerStep == 20) actionID = Fire4; - if (CustomComboFunctions.WasLastAction(Despair) && OpenerStep == 27) CurrentState = OpenerState.OpenerFinished; - else if (OpenerStep == 27) actionID = Despair; - } + if (WasLastAction(Fire4) && Fire4Count is 9 && OpenerStep == 21) OpenerStep++; + else if (OpenerStep == 21) actionID = Fire4; - if (ActionWatching.TimeSinceLastAction.TotalSeconds >= 5) - CurrentState = OpenerState.FailedOpener; + if (WasLastAction(Fire4) && Fire4Count is 10 && OpenerStep == 22) OpenerStep++; + else if (OpenerStep == 22) actionID = Fire4; - if (CustomComboFunctions.GetResourceCost(actionID) > CustomComboFunctions.LocalPlayer.CurrentMp && ActionWatching.TimeSinceLastAction.TotalSeconds >= 2) - CurrentState = OpenerState.FailedOpener; + if (WasLastAction(Despair) && OpenerStep == 23) CurrentState = OpenerState.OpenerFinished; + else if (OpenerStep == 23) actionID = Despair; - if (((actionID == Triplecast && CustomComboFunctions.GetRemainingCharges(Triplecast) < 2) || - (actionID == Amplifier && CustomComboFunctions.IsOnCooldown(Amplifier)) || - (actionID == LeyLines && CustomComboFunctions.IsOnCooldown(LeyLines)) || - (actionID == All.LucidDreaming && CustomComboFunctions.IsOnCooldown(All.LucidDreaming)) || - (actionID == Manafont && CustomComboFunctions.IsOnCooldown(Manafont)) || - (actionID == Sharpcast && CustomComboFunctions.GetRemainingCharges(Sharpcast) < 1) || - (actionID == All.Swiftcast && CustomComboFunctions.IsOnCooldown(All.Swiftcast)) || - (actionID == Xenoglossy && Svc.Gauges.Get().PolyglotStacks < 1)) && ActionWatching.TimeSinceLastAction.TotalSeconds >= 3) - { - CurrentState = OpenerState.FailedOpener; - return false; - } + if (((actionID == Triplecast && GetRemainingCharges(Triplecast) < 2) || + (actionID == Amplifier && IsOnCooldown(Amplifier)) || + (actionID == LeyLines && IsOnCooldown(LeyLines)) || + (actionID == All.LucidDreaming && IsOnCooldown(All.LucidDreaming)) || + (actionID == Manafont && IsOnCooldown(Manafont)) || + (actionID == All.Swiftcast && IsOnCooldown(All.Swiftcast)) || + (actionID == Xenoglossy && Svc.Gauges.Get().PolyglotStacks < 1)) && + ActionWatching.TimeSinceLastAction.TotalSeconds >= 3) + { + CurrentState = OpenerState.FailedOpener; - return true; + return false; } - return false; + return true; } - private bool DoOpenerSimple(ref uint actionID) - { - if (!LevelChecked) return false; - - if (currentState == OpenerState.InOpener) - { - if (CustomComboFunctions.LocalPlayer.CastActionId == Thunder3 && OpenerStep == 1) OpenerStep++; - else if (OpenerStep == 1) actionID = Thunder3; - - if (CustomComboFunctions.WasLastAction(Triplecast) && OpenerStep == 2) OpenerStep++; - else if (OpenerStep == 2) actionID = Triplecast; - - if (CustomComboFunctions.WasLastAction(Fire4) && CustomComboFunctions.GetBuffStacks(Buffs.Triplecast) == 2 && OpenerStep == 3) OpenerStep++; - else if (OpenerStep == 3) actionID = Fire4; - - if (CustomComboFunctions.WasLastAction(Fire4) && CustomComboFunctions.GetBuffStacks(Buffs.Triplecast) == 1 && OpenerStep == 4) OpenerStep++; - else if (OpenerStep == 4) actionID = Fire4; - - if (CustomComboFunctions.WasLastAction(Amplifier) && OpenerStep == 5) OpenerStep++; - else if (OpenerStep == 5) actionID = Amplifier; - - if (CustomComboFunctions.WasLastAction(LeyLines) && OpenerStep == 6) OpenerStep++; - else if (OpenerStep == 6) actionID = LeyLines; - - if (CustomComboFunctions.WasLastAction(Fire4) && CustomComboFunctions.GetBuffStacks(Buffs.Triplecast) == 0 && OpenerStep == 7) OpenerStep++; - else if (OpenerStep == 7) actionID = Fire4; - - if (CustomComboFunctions.WasLastAction(All.Swiftcast) && OpenerStep == 8) OpenerStep++; - else if (OpenerStep == 8) actionID = All.Swiftcast; - - if (CustomComboFunctions.WasLastAction(Fire4) && OpenerStep == 9) OpenerStep++; - else if (OpenerStep == 9) actionID = Fire4; - - if (CustomComboFunctions.WasLastAction(Triplecast) && OpenerStep == 10) OpenerStep++; - else if (OpenerStep == 10) actionID = Triplecast; - - if (CustomComboFunctions.WasLastAction(Despair) && OpenerStep == 11) OpenerStep++; - else if (OpenerStep == 11) actionID = Despair; - - if (CustomComboFunctions.WasLastAction(Manafont) && OpenerStep == 12) OpenerStep++; - else if (OpenerStep == 12) actionID = Manafont; - - if (CustomComboFunctions.WasLastAction(Fire4) && OpenerStep == 13) OpenerStep++; - else if (OpenerStep == 13) actionID = Fire4; - - if (CustomComboFunctions.WasLastAction(Sharpcast) && OpenerStep == 14) OpenerStep++; - else if (OpenerStep == 14) actionID = Sharpcast; - - if (CustomComboFunctions.WasLastAction(Despair) && OpenerStep == 15) OpenerStep++; - else if (OpenerStep == 15) actionID = Despair; - - if (CustomComboFunctions.WasLastAction(Blizzard3) && OpenerStep == 16) OpenerStep++; - else if (OpenerStep == 16) actionID = Blizzard3; - - if (CustomComboFunctions.WasLastAction(Xenoglossy) && OpenerStep == 17) OpenerStep++; - else if (OpenerStep == 17) actionID = Xenoglossy; - - if (CustomComboFunctions.WasLastAction(Paradox) && OpenerStep == 18) OpenerStep++; - else if (OpenerStep == 18) actionID = Paradox; - - if (CustomComboFunctions.LocalPlayer.CastActionId == Blizzard4 && OpenerStep == 19) OpenerStep++; - else if (OpenerStep == 19) actionID = Blizzard4; - - if (CustomComboFunctions.WasLastAction(Thunder3) && OpenerStep == 20) CurrentState = OpenerState.OpenerFinished; - else if (OpenerStep == 20) actionID = Thunder3; - - if (ActionWatching.TimeSinceLastAction.TotalSeconds >= 5) - CurrentState = OpenerState.FailedOpener; + return false; + } - if (CustomComboFunctions.GetResourceCost(actionID) > CustomComboFunctions.LocalPlayer.CurrentMp && ActionWatching.TimeSinceLastAction.TotalSeconds >= 2) - CurrentState = OpenerState.FailedOpener; + private void ResetOpener() + { + PrePullStep = 0; + OpenerStep = 0; + } - if (((actionID == Triplecast && CustomComboFunctions.GetRemainingCharges(Triplecast) < 2) || - (actionID == Amplifier && CustomComboFunctions.IsOnCooldown(Amplifier)) || - (actionID == LeyLines && CustomComboFunctions.IsOnCooldown(LeyLines)) || - (actionID == All.LucidDreaming && CustomComboFunctions.IsOnCooldown(All.LucidDreaming)) || - (actionID == Manafont && CustomComboFunctions.IsOnCooldown(Manafont)) || - (actionID == Sharpcast && CustomComboFunctions.GetRemainingCharges(Sharpcast) < 1) || - (actionID == All.Swiftcast && CustomComboFunctions.IsOnCooldown(All.Swiftcast)) || - (actionID == Xenoglossy && Svc.Gauges.Get().PolyglotStacks < 1)) && ActionWatching.TimeSinceLastAction.TotalSeconds >= 3) - { - CurrentState = OpenerState.FailedOpener; - return false; - } + public bool DoFullOpener(ref uint actionID) + { + if (!LevelChecked) return false; + if (CurrentState == OpenerState.PrePull) + if (DoPrePullSteps(ref actionID)) return true; - } - return false; - } + if (CurrentState == OpenerState.InOpener) + if (DoOpener(ref actionID)) + return true; - private void ResetOpener() + if (!InCombat()) { - PrePullStep = 0; - OpenerStep = 0; + ResetOpener(); + CurrentState = OpenerState.PrePull; } - public bool DoFullOpener(ref uint actionID, bool simpleMode) - { - if (!LevelChecked) return false; - - if (CurrentState == OpenerState.PrePull) - if (DoPrePullSteps(ref actionID)) return true; - - if (CurrentState == OpenerState.InOpener) - { - if (simpleMode) - { - if (DoOpenerSimple(ref actionID)) return true; - } - else - { - if (DoOpener(ref actionID)) return true; - } - } - - if (!CustomComboFunctions.InCombat()) - { - ResetOpener(); - CurrentState = OpenerState.PrePull; - } - - - return false; - } + return false; } +} - internal static class BLMExtensions +internal static class BLMExtensions +{ + public static bool HasPolyglotStacks(this BLMGauge gauge) { - public static bool HasPolyglotStacks(this BLMGauge gauge) => gauge.PolyglotStacks > 0; + return gauge.PolyglotStacks > 0; } +} - internal class BLMHelper : BLM +internal class BLMHelper : BLM +{ + public static float MPAfterCast() { - public static float MPAfterCast() + uint castedSpell = LocalPlayer.CastActionId; + BLMGauge gauge = Svc.Gauges.Get(); + + int nextMpGain = gauge.UmbralIceStacks switch { - var castedSpell = CustomComboFunctions.LocalPlayer.CastActionId; - var gauge = Svc.Gauges.Get(); - int nextMpGain = gauge.UmbralIceStacks switch - { - 0 => 0, - 1 => 2500, - 2 => 5000, - 3 => 10000, - _ => 0 - }; - if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) - return Math.Max(CustomComboFunctions.LocalPlayer.MaxMp, CustomComboFunctions.LocalPlayer.CurrentMp + nextMpGain); + 0 => 0, + 1 => 2500, + 2 => 5000, + 3 => 10000, + _ => 0 + }; + + if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) + return Math.Max(LocalPlayer.MaxMp, + LocalPlayer.CurrentMp + nextMpGain); + + return Math.Max(0, + LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); + } - return Math.Max(0, CustomComboFunctions.LocalPlayer.CurrentMp - CustomComboFunctions.GetResourceCost(castedSpell)); + public static bool DoubleBlizz() + { + List spells = ActionWatching.CombatActions.Where(x => + ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && + x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)) + .ToList(); - } + if (spells.Count < 1) return false; + + uint firstSpell = spells[^1]; - public static bool DoubleBlizz() + if (firstSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) { - var spells = ActionWatching.CombatActions.Where(x => ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && x != CustomComboFunctions.OriginalHook(Thunder) && x != CustomComboFunctions.OriginalHook(Thunder2)).ToList(); - if (spells.Count < 1) return false; + uint castedSpell = LocalPlayer.CastActionId; - var firstSpell = spells[^1]; + if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) return true; - if (firstSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) + if (spells.Count >= 2) { - var castedSpell = CustomComboFunctions.LocalPlayer.CastActionId; - if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) return true; + uint secondSpell = spells[^2]; - if (spells.Count >= 2) - { - var secondSpell = spells[^2]; - if (secondSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) - return true; - } + if (secondSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) + return true; } - - return false; - } + + return false; } } \ No newline at end of file diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 11a120d4d..a5ad5e49a 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -1,515 +1,732 @@ -using Dalamud.Game.ClientState.JobGauge.Types; -using ECommons.DalamudServices; using System; using System.Collections.Generic; +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.Data; using XIVSlothCombo.Extensions; +using static XIVSlothCombo.CustomComboNS.Functions.CustomComboFunctions; -namespace XIVSlothCombo.Combos.PvE +namespace XIVSlothCombo.Combos.PvE; + +internal class BLM { - internal class BLM + public const byte ClassID = 7; + public const byte JobID = 25; + + public const uint + Fire = 141, + Blizzard = 142, + Thunder = 144, + Fire2 = 147, + Transpose = 149, + Fire3 = 152, + Thunder3 = 153, + Blizzard3 = 154, + AetherialManipulation = 155, + Scathe = 156, + Manafont = 158, + Freeze = 159, + Flare = 162, + LeyLines = 3573, + Blizzard4 = 3576, + Fire4 = 3577, + BetweenTheLines = 7419, + Thunder4 = 7420, + Triplecast = 7421, + Foul = 7422, + Thunder2 = 7447, + Despair = 16505, + UmbralSoul = 16506, + Xenoglossy = 16507, + Blizzard2 = 25793, + HighFire2 = 25794, + HighBlizzard2 = 25795, + Amplifier = 25796, + Paradox = 25797, + HighThunder = 36986, + HighThunder2 = 36987, + FlareStar = 36989; + + // Debuff Pairs of Actions and Debuff + public static readonly Dictionary + ThunderList = new() + { + { Thunder, Debuffs.Thunder }, + { Thunder2, Debuffs.Thunder2 }, + { Thunder3, Debuffs.Thunder3 }, + { Thunder4, Debuffs.Thunder4 }, + { HighThunder, Debuffs.HighThunder }, + { HighThunder2, Debuffs.HighThunder2 } + }; + + protected static BLMGauge gauge = GetJobGauge(); + + public static class Buffs { - public const byte ClassID = 7; - public const byte JobID = 25; + public const ushort + Thundercloud = 164, + Firestarter = 165, + LeyLines = 737, + CircleOfPower = 738, + Sharpcast = 867, + Triplecast = 1211, + Thunderhead = 3870; + } + public static class Debuffs + { + public const ushort + Thunder = 161, + Thunder2 = 162, + Thunder3 = 163, + Thunder4 = 1210, + HighThunder = 3871, + HighThunder2 = 3872; + } + + public static class Traits + { public const uint - Fire = 141, - Blizzard = 142, - Thunder = 144, - Fire2 = 147, - Transpose = 149, - Fire3 = 152, - Thunder3 = 153, - Blizzard3 = 154, - AetherialManipulation = 155, - Scathe = 156, - Manafont = 158, - Freeze = 159, - Flare = 162, - LeyLines = 3573, - Sharpcast = 3574, - Blizzard4 = 3576, - Fire4 = 3577, - BetweenTheLines = 7419, - Thunder4 = 7420, - Triplecast = 7421, - Foul = 7422, - Thunder2 = 7447, - Despair = 16505, - UmbralSoul = 16506, - Xenoglossy = 16507, - Blizzard2 = 25793, - HighFire2 = 25794, - HighBlizzard2 = 25795, - Amplifier = 25796, - Paradox = 25797, - HighThunder = 36986, - HighThunder2 = 36987, - FlareStar = 36989; - - public static class Buffs - { - public const ushort - Thundercloud = 164, - Firestarter = 165, - LeyLines = 737, - CircleOfPower = 738, - Sharpcast = 867, - Triplecast = 1211, - Thunderhead = 3870; - } + UmbralHeart = 295, + EnhancedPolyglot = 297, + AspectMasteryIII = 459, + EnhancedFoul = 461, + EnhancedManafont = 463, + Enochian = 460, + EnhancedPolyglotII = 615; + } - public static class Debuffs - { - public const ushort - Thunder = 161, - Thunder2 = 162, - Thunder3 = 163, - Thunder4 = 1210, - HighThunder = 3871, - HighThunder2 = 3872; - } + public static class MP + { + public const int MaxMP = 10000; - public static class Traits - { - public const uint - UmbralHeart = 295, - EnhancedPolyglot = 297, - AspectMasteryIII = 459, - EnhancedFoul = 461, - EnhancedManafont = 463, - Enochian = 460, - EnhancedPolyglotII = 615; - } + public const int AllMPSpells = 800; //"ALL MP" spell. Only caring about the absolute minimum. + + public static int FireI => GetResourceCost(OriginalHook(Fire)); + + public static int FlareAoE => GetResourceCost(OriginalHook(Flare)); + + public static int FireAoE => GetResourceCost(OriginalHook(Fire2)); + + public static int FireIII => GetResourceCost(OriginalHook(Fire3)); + + public static int BlizzardAoE => + GetResourceCost(OriginalHook(Blizzard2)); + + public static int BlizzardI => + GetResourceCost(OriginalHook(Blizzard)); - public static class MP + public static int Freeze => GetResourceCost(OriginalHook(BLM.Freeze)); + + public static int Despair => + GetResourceCost(OriginalHook(BLM.Despair)); + } + + public static class Config + { + public static UserBool + BLM_Adv_Xeno_Burst = new("BLM_Adv_Xeno_Burst"); + + public static UserBoolArray + BLM_Adv_Cooldowns_Choice = new("BLM_Adv_Cooldowns_Choice"), + BLM_AoE_Adv_Cooldowns_Choice = new("BLM_AoE_Adv_Cooldowns_Choice"), + BLM_Adv_Movement_Choice = new("BLM_Adv_Movement_Choice"); + + public static UserInt + BLM_VariantCure = new("BLM_VariantCure"), + BLM_Adv_Cooldowns = new("BLM_Adv_Cooldowns"), + BLM_Adv_Thunder = new("BLM_Adv_Thunder"), + BLM_Adv_Rotation_Options = new("BLM_Adv_Rotation_Options"), + BLM_Advanced_OpenerSelection = new("BLM_Advanced_OpenerSelection"), + BLM_ST_Adv_ThunderHP = new("BLM_ST_Adv_ThunderHP"), + BLM_AoE_Adv_ThunderHP = new("BLM_AoE_Adv_ThunderHP"), + BLM_AoE_Adv_ThunderUptime = new("BLM_AoE_Adv_ThunderUptime"), + BLM_Adv_ThunderCloud = new("BLM_Adv_ThunderCloud"), + BLM_Adv_InitialCast = new("BLM_Adv_InitialCast"); + + public static UserFloat + BLM_AstralFire_Refresh = new("BLM_AstralFire_Refresh"); + } + + internal class BLM_ST_SimpleMode : CustomCombo + { + internal static BLMOpenerLogic BLMOpener = new(); + + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_SimpleMode; + + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - public const int MaxMP = 10000; - - public const int AllMPSpells = 800; //"ALL MP" spell. Only caring about the absolute minimum. - public static int FireI => CustomComboFunctions.GetResourceCost(CustomComboFunctions.OriginalHook(Fire)); - public static int FlareAoE => CustomComboFunctions.GetResourceCost(CustomComboFunctions.OriginalHook(Flare)); - public static int FireAoE => CustomComboFunctions.GetResourceCost(CustomComboFunctions.OriginalHook(Fire2)); - public static int FireIII => CustomComboFunctions.GetResourceCost(CustomComboFunctions.OriginalHook(Fire3)); - public static int BlizzardAoE => CustomComboFunctions.GetResourceCost(CustomComboFunctions.OriginalHook(Blizzard2)); - public static int BlizzardI => CustomComboFunctions.GetResourceCost(CustomComboFunctions.OriginalHook(Blizzard)); - public static int Freeze => CustomComboFunctions.GetResourceCost(CustomComboFunctions.OriginalHook(BLM.Freeze)); - public static int Despair => CustomComboFunctions.GetResourceCost(CustomComboFunctions.OriginalHook(BLM.Despair)); - } + if (actionID != Fire) return actionID; - // Debuff Pairs of Actions and Debuff - public static readonly Dictionary - ThunderList = new() + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : + TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + int maxPolyglotCD = maxPolyglot * 30000; + + int remainingPolyglotCD = Math.Max(0, + (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); + uint curMp = LocalPlayer.CurrentMp; + + int nextMpGain = gauge.UmbralIceStacks switch { - { Thunder, Debuffs.Thunder }, - { Thunder2, Debuffs.Thunder2 }, - { Thunder3, Debuffs.Thunder3 }, - { Thunder4, Debuffs.Thunder4 }, - { HighThunder, Debuffs.HighThunder }, - { HighThunder2, Debuffs.HighThunder2 } + 0 => 0, + 1 => 2500, + 2 => 5000, + 3 => 10000, + _ => 0 }; - public static class Config - { - public static UserBool - BLM_Adv_Xeno_Burst = new("BLM_Adv_Xeno_Burst"); - - public static UserBoolArray - BLM_Adv_Cooldowns_Choice = new("BLM_Adv_Cooldowns_Choice"), - BLM_AoE_Adv_Cooldowns_Choice = new("BLM_AoE_Adv_Cooldowns_Choice"), - BLM_Adv_Movement_Choice = new("BLM_Adv_Movement_Choice"); - - public static UserInt - BLM_VariantCure = new("BLM_VariantCure"), - BLM_Adv_Cooldowns = new("BLM_Adv_Cooldowns"), - BLM_Adv_Thunder = new("BLM_Adv_Thunder"), - BLM_Adv_Rotation_Options = new("BLM_Adv_Rotation_Options"), - BLM_Advanced_OpenerSelection = new("BLM_Advanced_OpenerSelection"), - BLM_ST_Adv_ThunderHP = new("BLM_ST_Adv_ThunderHP"), - BLM_AoE_Adv_ThunderHP = new("BLM_AoE_Adv_ThunderHP"), - BLM_AoE_Adv_ThunderUptime = new("BLM_AoE_Adv_ThunderUptime"), - BLM_Adv_ThunderCloud = new("BLM_Adv_ThunderCloud"), - BLM_Adv_InitialCast = new("BLM_Adv_InitialCast"); - - public static UserFloat - BLM_AstralFire_Refresh = new("BLM_AstralFire_Refresh"); - } + Status? thunderDebuff = + FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + float elementTimer = gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); - internal class BLM_ST_SimpleMode : CustomCombo - { - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_SimpleMode; - protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) + bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || + GetBuffStacks(Buffs.Triplecast) > 0; + + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && + IsEnabled(Variant.VariantCure) && + PlayerHealthPercentageHp() <= Config.BLM_VariantCure) + return Variant.VariantCure; + + if (IsEnabled(CustomComboPreset.BLM_Variant_Rampart) && + IsEnabled(Variant.VariantRampart) && + IsOffCooldown(Variant.VariantRampart) && + CanSpellWeave(actionID)) + return Variant.VariantRampart; + + if (BLMOpener.DoFullOpener(ref actionID)) + return actionID; + + if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1) + if (thunderDebuff is null || thunderDebuff.RemainingTime < 3) + return OriginalHook(Thunder); + + if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) + return Amplifier; + + if (remainingPolyglotCD < 6000 && gcdsInTimer > 2 && gauge.HasPolyglotStacks()) + return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; + + if (IsMoving) { - if (actionID != Fire) return actionID; - - var gauge = GetJobGauge(); - var maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - var maxPolyglotCD = maxPolyglot * 30000; - var remainingPolyglotCD = Math.Max(0, (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); - var curMp = LocalPlayer.CurrentMp; - int nextMpGain = gauge.UmbralIceStacks switch + if (ActionReady(Amplifier) && gauge.PolyglotStacks < maxPolyglot) + return Amplifier; + + if (gauge.HasPolyglotStacks()) + return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; + } + + if (CanSpellWeave(actionID) && ActionReady(LeyLines)) + return LeyLines; + + if (gauge.InAstralFire) + { + if (gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) + return Paradox; + + if (HasEffect(Buffs.Firestarter)) + if (gcdsInTimer < 2 || curMp < MP.FireI || WasLastAbility(Transpose)) + return Fire3; + + if (curMp < MP.FireI && Despair.LevelChecked() && curMp >= MP.Despair) { - 0 => 0, - 1 => 2500, - 2 => 5000, - 3 => 10000, - _ => 0 - }; - var thunderDebuff = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - var elementTimer = gauge.ElementTimeRemaining / 1000f; - var gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); - var canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0; - - if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && - IsEnabled(Variant.VariantCure) && - PlayerHealthPercentageHp() <= Config.BLM_VariantCure) - return Variant.VariantCure; - - if (IsEnabled(CustomComboPreset.BLM_Variant_Rampart) && - IsEnabled(Variant.VariantRampart) && - IsOffCooldown(Variant.VariantRampart) && - CanSpellWeave(actionID)) - return Variant.VariantRampart; - - if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1) + if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) + return Triplecast; + + return Despair; + } + + if (curMp == 0 && FlareStar.LevelChecked() && gauge.AstralSoulStacks == 6) + return FlareStar; + + if (Fire4.LevelChecked()) + if (gcdsInTimer > 1 && curMp >= MP.FireI) + return Fire4; + + if (curMp >= MP.FireI) + return Fire; + + if (ActionReady(Manafont)) + return Manafont; + + if (ActionReady(Blizzard3) && !canSwiftB3) + return Blizzard3; + + if (ActionReady(Transpose)) + return Transpose; + } + + if (gauge.InUmbralIce) + { + if (ActionReady(Blizzard3) && gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.UmbralHeart)) { - if (thunderDebuff is null || thunderDebuff.RemainingTime < 3) - return OriginalHook(Thunder); + if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) + return Triplecast; + + if (GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast)) + return All.Swiftcast; + + if (HasEffect(All.Buffs.Swiftcast) || GetBuffStacks(Buffs.Triplecast) > 0) + return Blizzard3; } - if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) - return Amplifier; + if (Blizzard4.LevelChecked() && gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + return Blizzard4; + + if (gauge.IsParadoxActive) + return Paradox; - if (remainingPolyglotCD < 6000 && gcdsInTimer > 2 && gauge.HasPolyglotStacks()) + if (gauge.HasPolyglotStacks()) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; - if (IsMoving) + if (curMp + nextMpGain >= 7500 && (LocalPlayer.CastActionId == Blizzard || WasLastSpell(Blizzard) || + WasLastSpell(Blizzard4))) { - if (ActionReady(Amplifier) && gauge.PolyglotStacks < maxPolyglot) - return Amplifier; + if (Fire3.LevelChecked()) + return Fire3; - if (gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; + return Fire; } - if (CanSpellWeave(actionID) && ActionReady(LeyLines)) - return LeyLines; + if (curMp + nextMpGain <= 10000 || curMp < 7500) + return Blizzard; - if (gauge.InAstralFire) - { + if (ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell)) + return Transpose; - if (gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) - return Paradox; + if (Fire3.LevelChecked()) + return Fire3; + } - if (HasEffect(Buffs.Firestarter)) - { - if (gcdsInTimer < 2 || curMp < MP.FireI || WasLastAbility(Transpose)) - return Fire3; - } + if (Blizzard3.LevelChecked()) + return Blizzard3; - if (curMp < MP.FireI && Despair.LevelChecked() && curMp >= MP.Despair) - { - if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) - return Triplecast; + return actionID; + } + } - return Despair; - } + internal class BLM_ST_AdvancedMode : CustomCombo + { + internal static BLMOpenerLogic BLMOpener = new(); - if (curMp == 0 && FlareStar.LevelChecked() && gauge.AstralSoulStacks == 6) - return FlareStar; + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_AdvancedMode; - if (Fire4.LevelChecked()) - { - if (gcdsInTimer > 1 && curMp >= MP.FireI) - return Fire4; - } + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) + { + if (actionID != Fire) return actionID; - if (curMp >= MP.FireI) - return Fire; + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : + TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + int maxPolyglotCD = maxPolyglot * 30000; - if (ActionReady(Manafont)) - return Manafont; + int remainingPolyglotCD = Math.Max(0, + (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); + uint curMp = LocalPlayer.CurrentMp; - if (ActionReady(Blizzard3) && !canSwiftB3) - return Blizzard3; + int nextMpGain = gauge.UmbralIceStacks switch + { + 0 => 0, + 1 => 2500, + 2 => 5000, + 3 => 10000, + _ => 0 + }; - if (ActionReady(Transpose)) - return Transpose; + Status? thunderDebuff = + FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + float elementTimer = gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); - } - if (gauge.InUmbralIce) - { - if (ActionReady(Blizzard3) && gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.UmbralHeart)) - { - if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) - return Triplecast; + bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || + GetBuffStacks(Buffs.Triplecast) > 0; - if (GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast)) - return All.Swiftcast; + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && + IsEnabled(Variant.VariantCure) && + PlayerHealthPercentageHp() <= Config.BLM_VariantCure) + return Variant.VariantCure; - if (HasEffect(All.Buffs.Swiftcast) || GetBuffStacks(Buffs.Triplecast) > 0) - return Blizzard3; - } + if (IsEnabled(CustomComboPreset.BLM_Variant_Rampart) && + IsEnabled(Variant.VariantRampart) && + IsOffCooldown(Variant.VariantRampart) && + CanSpellWeave(actionID)) + return Variant.VariantRampart; - if (Blizzard4.LevelChecked() && gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) - return Blizzard4; + if (IsEnabled(CustomComboPreset.BLM_ST_Opener)) + if (BLMOpener.DoFullOpener(ref actionID)) + return actionID; - if (gauge.IsParadoxActive) - return Paradox; + if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1) + if (thunderDebuff is null || thunderDebuff.RemainingTime < 3) + return OriginalHook(Thunder); - if (gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; + if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) + return Amplifier; - if (curMp + nextMpGain >= 7500 && (LocalPlayer.CastActionId == Blizzard || WasLastSpell(Blizzard) || WasLastSpell(Blizzard4))) - { - if (Fire3.LevelChecked()) - return Fire3; + if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && + remainingPolyglotCD < 6000 && gcdsInTimer > 2 && gauge.HasPolyglotStacks()) + return Xenoglossy.LevelChecked() + ? Xenoglossy + : Foul; - return Fire; - } + if (IsMoving) + { + if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && + ActionReady(Amplifier) && gauge.PolyglotStacks < maxPolyglot) + return Amplifier; - if ((curMp + nextMpGain <= 10000 || curMp < 7500)) - return Blizzard; + if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglotMoving) && + gauge.HasPolyglotStacks()) + return Xenoglossy.LevelChecked() + ? Xenoglossy + : Foul; + } - if (ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell)) - return Transpose; + if (IsEnabled(CustomComboPreset.BLM_ST_LeyLines) && + CanSpellWeave(actionID) && ActionReady(LeyLines)) + return LeyLines; - if (Fire3.LevelChecked()) + if (gauge.InAstralFire) + { + if (gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) + return Paradox; + + if (HasEffect(Buffs.Firestarter)) + if (gcdsInTimer < 2 || curMp < MP.FireI || WasLastAbility(Transpose)) return Fire3; + + if (IsEnabled(CustomComboPreset.BLM_ST_Despair) && + curMp < MP.FireI && Despair.LevelChecked() && curMp >= MP.Despair) + { + if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && + ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) + return Triplecast; + + return Despair; } - if (Blizzard3.LevelChecked()) + if (IsEnabled(CustomComboPreset.BLM_ST_Flarestar) && + curMp == 0 && FlareStar.LevelChecked() && gauge.AstralSoulStacks == 6) + return FlareStar; + + if (Fire4.LevelChecked()) + if (gcdsInTimer > 1 && curMp >= MP.FireI) + return Fire4; + + if (curMp >= MP.FireI) + return Fire; + + if (IsEnabled(CustomComboPreset.BLM_ST_Manafont) && + ActionReady(Manafont)) + return Manafont; + + if (ActionReady(Blizzard3) && !canSwiftB3) return Blizzard3; - return actionID; + + if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && + ActionReady(Transpose)) + return Transpose; } + + if (gauge.InUmbralIce) + { + if (ActionReady(Blizzard3) && gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.UmbralHeart)) + { + if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && + ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) + return Triplecast; + + if (IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && + GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast)) + return All.Swiftcast; + + if (HasEffect(All.Buffs.Swiftcast) || GetBuffStacks(Buffs.Triplecast) > 0) + return Blizzard3; + } + + if (Blizzard4.LevelChecked() && gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + return Blizzard4; + + if (gauge.IsParadoxActive) + return Paradox; + + if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && + gauge.HasPolyglotStacks()) + return Xenoglossy.LevelChecked() + ? Xenoglossy + : Foul; + + if (curMp + nextMpGain >= 7500 && + (LocalPlayer.CastActionId == Blizzard || + WasLastSpell(Blizzard) || + WasLastSpell(Blizzard4))) + return Fire3.LevelChecked() + ? Fire3 + : Fire; + + if (curMp + nextMpGain <= 10000 || curMp < 7500) + return Blizzard; + + if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && + ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell)) + return Transpose; + + if (Fire3.LevelChecked()) + return Fire3; + } + + if (Blizzard3.LevelChecked()) + return Blizzard3; + + return actionID; } + } + + internal class BLM_AoE_SimpleMode : CustomCombo + { + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_AoE_SimpleMode; - internal class BLM_AoE_SimpleMode : CustomCombo + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_AoE_SimpleMode; + if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; + + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : + TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + int maxPolyglotCD = maxPolyglot * 30000; - protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) + int remainingPolyglotCD = Math.Max(0, + (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); + uint curMp = LocalPlayer.CurrentMp; + + int nextMpGain = gauge.UmbralIceStacks switch { - if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; - - var gauge = GetJobGauge(); - var maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - var maxPolyglotCD = maxPolyglot * 30000; - var remainingPolyglotCD = Math.Max(0, (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); - var curMp = LocalPlayer.CurrentMp; - int nextMpGain = gauge.UmbralIceStacks switch - { - 0 => 0, - 1 => 2500, - 2 => 5000, - 3 => 10000, - _ => 0 - }; - var thunderDebuff = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - var elementTimer = gauge.ElementTimeRemaining / 1000f; - var gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - var canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); - var canWeave = CanSpellWeave(ActionWatching.LastSpell); - - if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && - IsEnabled(Variant.VariantCure) && - PlayerHealthPercentageHp() <= Config.BLM_VariantCure) - return Variant.VariantCure; - - if (IsEnabled(CustomComboPreset.BLM_Variant_Rampart) && - IsEnabled(Variant.VariantRampart) && - IsOffCooldown(Variant.VariantRampart) && - canWeave) - return Variant.VariantRampart; - - if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked()) - { - if (thunderDebuff is null || thunderDebuff.RemainingTime < 3) - return OriginalHook(Thunder2); - } + 0 => 0, + 1 => 2500, + 2 => 5000, + 3 => 10000, + _ => 0 + }; - if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && canWeave) - return Amplifier; + Status? thunderDebuff = + FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + float elementTimer = gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - if (IsMoving) - { - if (ActionReady(Amplifier) && gauge.PolyglotStacks < maxPolyglot) - return Amplifier; + bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || + ActionReady(Triplecast) || + GetBuffStacks(Buffs.Triplecast) > 0); + bool canWeave = CanSpellWeave(ActionWatching.LastSpell); - if (gauge.HasPolyglotStacks()) - return Foul; - } + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && + IsEnabled(Variant.VariantCure) && + PlayerHealthPercentageHp() <= Config.BLM_VariantCure) + return Variant.VariantCure; - if (canWeave && ActionReady(LeyLines)) - return LeyLines; + if (IsEnabled(CustomComboPreset.BLM_Variant_Rampart) && + IsEnabled(Variant.VariantRampart) && + IsOffCooldown(Variant.VariantRampart) && + canWeave) + return Variant.VariantRampart; - if (gauge.InAstralFire) - { - if (curMp == 0 && FlareStar.LevelChecked() && gauge.AstralSoulStacks == 6) - return FlareStar; + if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked()) + if (thunderDebuff is null || thunderDebuff.RemainingTime < 3) + return OriginalHook(Thunder2); - if (!FlareStar.LevelChecked() && Fire2.LevelChecked() && curMp >= MP.FireAoE && (gauge.UmbralHearts > 1 || !TraitLevelChecked(Traits.UmbralHeart))) - return OriginalHook(Fire2); + if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && canWeave) + return Amplifier; - if (Flare.LevelChecked() && curMp >= MP.FlareAoE) - { - if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) - return Triplecast; + if (IsMoving) + { + if (ActionReady(Amplifier) && gauge.PolyglotStacks < maxPolyglot) + return Amplifier; - return Flare; - } + if (gauge.HasPolyglotStacks()) + return Foul; + } - if (Fire2.LevelChecked()) - { - if (gcdsInTimer > 1 && curMp >= MP.FireAoE) - return OriginalHook(Fire2); - } + if (canWeave && ActionReady(LeyLines)) + return LeyLines; - if (ActionReady(Manafont)) - return Manafont; + if (gauge.InAstralFire) + { + if (curMp == 0 && FlareStar.LevelChecked() && gauge.AstralSoulStacks == 6) + return FlareStar; - if (ActionReady(Transpose) && (!TraitLevelChecked(Traits.AspectMasteryIII) || canSwiftF)) - return Transpose; + if (!FlareStar.LevelChecked() && Fire2.LevelChecked() && curMp >= MP.FireAoE && + (gauge.UmbralHearts > 1 || !TraitLevelChecked(Traits.UmbralHeart))) + return OriginalHook(Fire2); - if (ActionReady(Blizzard2) && TraitLevelChecked(Traits.AspectMasteryIII)) - return OriginalHook(Blizzard2); + if (Flare.LevelChecked() && curMp >= MP.FlareAoE) + { + if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) + return Triplecast; + return Flare; } - if (gauge.InUmbralIce) - { - if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && FlareStar.LevelChecked()) - { - if (ActionReady(Transpose) && canWeave) - return Transpose; + if (Fire2.LevelChecked()) + if (gcdsInTimer > 1 && curMp >= MP.FireAoE) return OriginalHook(Fire2); - } - if (ActionReady(OriginalHook(Blizzard2)) && gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.AspectMasteryIII)) - { - if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) - return Triplecast; + if (ActionReady(Manafont)) + return Manafont; - if (GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && canWeave) - return All.Swiftcast; + if (ActionReady(Transpose) && (!TraitLevelChecked(Traits.AspectMasteryIII) || canSwiftF)) + return Transpose; - if (HasEffect(All.Buffs.Swiftcast) || GetBuffStacks(Buffs.Triplecast) > 0) - return OriginalHook(Blizzard2); - } + if (ActionReady(Blizzard2) && TraitLevelChecked(Traits.AspectMasteryIII)) + return OriginalHook(Blizzard2); + } - if (gauge.UmbralIceStacks < 3 && ActionReady(OriginalHook(Blizzard2))) - return OriginalHook(Blizzard2); + if (gauge.InUmbralIce) + { + if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), + OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && + FlareStar.LevelChecked()) + { + if (ActionReady(Transpose) && canWeave) + return Transpose; - if (Freeze.LevelChecked() && gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) - return Freeze; + return OriginalHook(Fire2); + } - if (gauge.HasPolyglotStacks()) - return Foul; + if (ActionReady(OriginalHook(Blizzard2)) && gauge.UmbralIceStacks < 3 && + TraitLevelChecked(Traits.AspectMasteryIII)) + { + if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) + return Triplecast; - if (BLMHelper.DoubleBlizz()) - { - if (Fire2.LevelChecked()) - return OriginalHook(Fire2); - } + if (GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && canWeave) + return All.Swiftcast; - if (curMp < LocalPlayer.MaxMp) - return Freeze.LevelChecked() ? OriginalHook(Freeze) : OriginalHook(Blizzard2); + if (HasEffect(All.Buffs.Swiftcast) || GetBuffStacks(Buffs.Triplecast) > 0) + return OriginalHook(Blizzard2); + } - if (ActionReady(Transpose) && ((canWeave && Flare.LevelChecked()) || !TraitLevelChecked(Traits.AspectMasteryIII))) - return Transpose; + if (gauge.UmbralIceStacks < 3 && ActionReady(OriginalHook(Blizzard2))) + return OriginalHook(Blizzard2); + + if (Freeze.LevelChecked() && gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + return Freeze; + + if (gauge.HasPolyglotStacks()) + return Foul; - if (Fire2.LevelChecked() && TraitLevelChecked(Traits.AspectMasteryIII)) + if (BLMHelper.DoubleBlizz()) + if (Fire2.LevelChecked()) return OriginalHook(Fire2); - } - if (Blizzard2.LevelChecked()) - return OriginalHook(Blizzard2); - return actionID; + if (curMp < LocalPlayer.MaxMp) + return Freeze.LevelChecked() ? OriginalHook(Freeze) : OriginalHook(Blizzard2); + + if (ActionReady(Transpose) && + ((canWeave && Flare.LevelChecked()) || !TraitLevelChecked(Traits.AspectMasteryIII))) + return Transpose; + + if (Fire2.LevelChecked() && TraitLevelChecked(Traits.AspectMasteryIII)) + return OriginalHook(Fire2); } + + if (Blizzard2.LevelChecked()) + return OriginalHook(Blizzard2); + + return actionID; } + } - internal class BLM_Variant_Raise : CustomCombo - { - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Variant_Raise; + internal class BLM_Variant_Raise : CustomCombo + { + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Variant_Raise; - protected override uint Invoke(uint actionID, uint lastComboActionID, float comboTime, byte level) => - (actionID is All.Swiftcast && HasEffect(All.Buffs.Swiftcast) && IsEnabled(Variant.VariantRaise)) + protected override uint Invoke(uint actionID, uint lastComboActionID, float comboTime, byte level) + { + return actionID is All.Swiftcast && HasEffect(All.Buffs.Swiftcast) && IsEnabled(Variant.VariantRaise) ? Variant.VariantRaise : actionID; } + } - internal class BLM_Scathe_Xeno : CustomCombo - { - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Scathe_Xeno; + internal class BLM_Scathe_Xeno : CustomCombo + { + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Scathe_Xeno; - protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) => - (actionID is Scathe && LevelChecked(Xenoglossy) && GetJobGauge().HasPolyglotStacks()) + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) + { + return actionID is Scathe && LevelChecked(Xenoglossy) && GetJobGauge().HasPolyglotStacks() ? Xenoglossy : actionID; } + } - internal class BLM_Blizzard_1to3 : CustomCombo - { - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Blizzard_1to3; + internal class BLM_Blizzard_1to3 : CustomCombo + { + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Blizzard_1to3; - protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) - { - if (actionID is Blizzard && LevelChecked(Freeze) && !GetJobGauge().InUmbralIce) - return Blizzard3; + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) + { + if (actionID is Blizzard && LevelChecked(Freeze) && !GetJobGauge().InUmbralIce) + return Blizzard3; - if (actionID is Freeze && !LevelChecked(Freeze)) - return Blizzard2; + if (actionID is Freeze && !LevelChecked(Freeze)) + return Blizzard2; - return actionID; - } + return actionID; } + } - internal class BLM_Fire_1to3 : CustomCombo - { - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Fire_1to3; + internal class BLM_Fire_1to3 : CustomCombo + { + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Fire_1to3; - protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) => - (actionID is Fire && ((LevelChecked(Fire3) && !GetJobGauge().InAstralFire) || HasEffect(Buffs.Firestarter))) + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) + { + return actionID is Fire && ((LevelChecked(Fire3) && !GetJobGauge().InAstralFire) || + HasEffect(Buffs.Firestarter)) ? Fire3 : actionID; } + } - internal class BLM_Between_The_LeyLines : CustomCombo - { - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Between_The_LeyLines; + internal class BLM_Between_The_LeyLines : CustomCombo + { + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Between_The_LeyLines; - protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) => - actionID is LeyLines && HasEffect(Buffs.LeyLines) && LevelChecked(BetweenTheLines) + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) + { + return actionID is LeyLines && HasEffect(Buffs.LeyLines) && LevelChecked(BetweenTheLines) ? BetweenTheLines : actionID; } + } - internal class BLM_Aetherial_Manipulation : CustomCombo + internal class BLM_Aetherial_Manipulation : CustomCombo + { + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Aetherial_Manipulation; + + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_Aetherial_Manipulation; - - protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) => - actionID is AetherialManipulation && - ActionReady(BetweenTheLines) && - HasEffect(Buffs.LeyLines) && - !HasEffect(Buffs.CircleOfPower) && - !IsMoving + return actionID is AetherialManipulation && + ActionReady(BetweenTheLines) && + HasEffect(Buffs.LeyLines) && + !HasEffect(Buffs.CircleOfPower) && + !IsMoving ? BetweenTheLines : actionID; } + } - internal class BLM_UmbralSoul : CustomCombo - { - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_UmbralSoul; + internal class BLM_UmbralSoul : CustomCombo + { + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_UmbralSoul; - protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) => - actionID is Transpose && GetJobGauge().InUmbralIce && LevelChecked(UmbralSoul) + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) + { + return actionID is Transpose && GetJobGauge().InUmbralIce && LevelChecked(UmbralSoul) ? UmbralSoul : actionID; } } -} +} \ No newline at end of file From 9cc6a050745af567e7056f238898fe1d524a861e Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 27 Oct 2024 11:12:49 +0100 Subject: [PATCH 02/46] cleanup opener reformatting --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 386 +++++++++++++------------ XIVSlothCombo/Combos/PvE/BLM.cs | 2 +- 2 files changed, 196 insertions(+), 192 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index 996155fda..c27b6e4f3 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -6,280 +6,284 @@ using XIVSlothCombo.Combos.JobHelpers.Enums; using XIVSlothCombo.Combos.PvE; using XIVSlothCombo.Data; +using static XIVSlothCombo.Combos.PvE.BLM; using static XIVSlothCombo.CustomComboNS.Functions.CustomComboFunctions; namespace XIVSlothCombo.Combos.JobHelpers; -internal class BLMOpenerLogic : BLM +internal static class BLM { + // BLM Gauge & Extensions public static int Fire4Count = ActionWatching.CombatActions.Count(x => x == Fire4); - private OpenerState currentState = OpenerState.PrePull; - public uint OpenerStep = 1; + public static BLMGauge Gauge => GetJobGauge(); - public uint PrePullStep; + public static bool HasPolyglotStacks(this BLMGauge gauge) + { + return gauge.PolyglotStacks > 0; + } - private static uint OpenerLevel => 100; + internal class BLMOpenerLogic + { + private OpenerState currentState = OpenerState.PrePull; - public static bool LevelChecked => LocalPlayer.Level >= OpenerLevel; + public uint OpenerStep = 1; - private static bool CanOpener => HasCooldowns() && LevelChecked; + public uint PrePullStep; - public OpenerState CurrentState - { - get => currentState; - set + private static uint OpenerLevel => 100; + + public static bool LevelChecked => LocalPlayer.Level >= OpenerLevel; + + 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}"); + + ResetOpener(); + } + if (value == OpenerState.OpenerFinished) Svc.Log.Information("Opener Finished"); - currentState = value; + currentState = value; + } } } - } - - private static bool HasCooldowns() - { - if (!ActionReady(Manafont)) - return false; - if (!ActionReady(All.Swiftcast)) - return false; - - if (!ActionReady(Amplifier)) - return false; - - if (!ActionReady(All.LucidDreaming) && - Config.BLM_Advanced_OpenerSelection == 1) - return false; + private static bool HasCooldowns() + { + if (!ActionReady(Manafont)) + return false; - if (!ActionReady(LeyLines)) - return false; + if (GetRemainingCharges(Triplecast) < 2) + return false; - return true; - } + if (!ActionReady(All.Swiftcast)) + return false; - private bool DoPrePullSteps(ref uint actionID) - { - if (!LevelChecked) return false; + if (!ActionReady(Amplifier)) + return false; - if (CanOpener && PrePullStep == 0) PrePullStep = 1; + if (!ActionReady(LeyLines)) + return false; - if (!HasCooldowns()) PrePullStep = 0; + return true; + } - if (CurrentState == OpenerState.PrePull && PrePullStep > 0) + private bool DoPrePullSteps(ref uint actionID) { - if (LocalPlayer.CastActionId == Fire3 && PrePullStep == 1) CurrentState = OpenerState.InOpener; - else if (PrePullStep == 1) actionID = Fire3; + if (!LevelChecked) return false; - if (PrePullStep > 1 && - GetResourceCost(actionID) > LocalPlayer.CurrentMp && - ActionWatching.TimeSinceLastAction.TotalSeconds >= 2) - CurrentState = OpenerState.FailedOpener; + if (CanOpener && PrePullStep == 0) PrePullStep = 1; - if (ActionWatching.CombatActions.Count > 2 && InCombat()) - CurrentState = OpenerState.FailedOpener; + if (!HasCooldowns()) PrePullStep = 0; - return true; - } - - PrePullStep = 0; + if (CurrentState == OpenerState.PrePull && PrePullStep > 0) + { + if (LocalPlayer.CastActionId == Fire3 && PrePullStep == 1) CurrentState = OpenerState.InOpener; + else if (PrePullStep == 1) actionID = Fire3; - return false; - } + if (PrePullStep > 1 && + GetResourceCost(actionID) > LocalPlayer.CurrentMp && + ActionWatching.TimeSinceLastAction.TotalSeconds >= 2) + CurrentState = OpenerState.FailedOpener; - private bool DoOpener(ref uint actionID) - { - if (!LevelChecked) return false; + if (ActionWatching.CombatActions.Count > 2 && InCombat()) + CurrentState = OpenerState.FailedOpener; - if (currentState == OpenerState.InOpener) - { - if (LocalPlayer.CastActionId == HighThunder && OpenerStep == 1) OpenerStep++; - else if (OpenerStep == 1) actionID = HighThunder; + return true; + } - if (WasLastAction(All.Swiftcast) && OpenerStep == 2) OpenerStep++; - else if (OpenerStep == 2) actionID = All.Swiftcast; + PrePullStep = 0; - if (WasLastAction(Amplifier) && OpenerStep == 3) OpenerStep++; - else if (OpenerStep == 3) actionID = Amplifier; + return false; + } - if (WasLastAction(Fire4) && Fire4Count is 1 && OpenerStep == 4) OpenerStep++; - else if (OpenerStep == 4) actionID = Fire4; + private bool DoOpener(ref uint actionID) + { + if (!LevelChecked) return false; - if (WasLastAction(Fire4) && Fire4Count is 2 && OpenerStep == 5) OpenerStep++; - else if (OpenerStep == 5) actionID = Fire4; + if (currentState == OpenerState.InOpener) + { + if (WasLastAction(HighThunder) && OpenerStep == 1) OpenerStep++; + else if (OpenerStep == 1) actionID = HighThunder; - if (WasLastAction(Xenoglossy) && OpenerStep == 6) OpenerStep++; - else if (OpenerStep == 6) actionID = Xenoglossy; + if (WasLastAction(All.Swiftcast) && OpenerStep == 2) OpenerStep++; + else if (OpenerStep == 2) actionID = All.Swiftcast; - if (WasLastAction(Triplecast) && OpenerStep == 7) OpenerStep++; - else if (OpenerStep == 7) actionID = Triplecast; + if (WasLastAction(Amplifier) && OpenerStep == 3) OpenerStep++; + else if (OpenerStep == 3) actionID = Amplifier; - if (WasLastAction(LeyLines) && OpenerStep == 8) OpenerStep++; - else if (OpenerStep == 8) actionID = LeyLines; + if (WasLastAction(Fire4) && Fire4Count is 1 && OpenerStep == 4) OpenerStep++; + else if (OpenerStep == 4) actionID = Fire4; - if (WasLastAction(Fire4) && Fire4Count is 3 && OpenerStep == 9) OpenerStep++; - else if (OpenerStep == 9) actionID = Fire4; + if (WasLastAction(Fire4) && Fire4Count is 2 && OpenerStep == 5) OpenerStep++; + else if (OpenerStep == 5) actionID = Fire4; - if (WasLastAction(Fire4) && Fire4Count is 4 && OpenerStep == 10) OpenerStep++; - else if (OpenerStep == 10) actionID = Fire4; + if (WasLastAction(Xenoglossy) && OpenerStep == 6) OpenerStep++; + else if (OpenerStep == 6) actionID = Xenoglossy; - if (WasLastAction(Despair) && OpenerStep == 11) OpenerStep++; - else if (OpenerStep == 11) actionID = Despair; + if (WasLastAction(Triplecast) && OpenerStep == 7) OpenerStep++; + else if (OpenerStep == 7) actionID = Triplecast; - if (WasLastAction(Manafont) && OpenerStep == 12) OpenerStep++; - else if (OpenerStep == 12) actionID = Manafont; + if (WasLastAction(LeyLines) && OpenerStep == 8) OpenerStep++; + else if (OpenerStep == 8) actionID = LeyLines; - if (WasLastAction(Triplecast) && OpenerStep == 13) OpenerStep++; - else if (OpenerStep == 13) actionID = Triplecast; + if (WasLastAction(Fire4) && Fire4Count is 3 && OpenerStep == 9) OpenerStep++; + else if (OpenerStep == 9) actionID = Fire4; - if (WasLastAction(Fire4) && Fire4Count is 5 && OpenerStep == 14) OpenerStep++; - else if (OpenerStep == 14) actionID = Fire4; + if (WasLastAction(Fire4) && Fire4Count is 4 && OpenerStep == 10) OpenerStep++; + else if (OpenerStep == 10) actionID = Fire4; - if (WasLastAction(Fire4) && Fire4Count is 6 && OpenerStep == 15) OpenerStep++; - else if (OpenerStep == 15) actionID = Fire4; + if (WasLastAction(Despair) && OpenerStep == 11) OpenerStep++; + else if (OpenerStep == 11) actionID = Despair; - if (WasLastAction(FlareStar) && OpenerStep == 16) OpenerStep++; - else if (OpenerStep == 16) actionID = FlareStar; + if (WasLastAction(Manafont) && OpenerStep == 12) OpenerStep++; + else if (OpenerStep == 12) actionID = Manafont; - if (WasLastAction(Fire4) && Fire4Count is 7 && OpenerStep == 17) OpenerStep++; - else if (OpenerStep == 17) actionID = Fire4; + if (WasLastAction(Triplecast) && OpenerStep == 13) OpenerStep++; + else if (OpenerStep == 13) actionID = Triplecast; - if (WasLastAction(HighThunder) && OpenerStep == 18) OpenerStep++; - else if (OpenerStep == 18) actionID = HighThunder; + if (WasLastAction(Fire4) && Fire4Count is 5 && OpenerStep == 14) OpenerStep++; + else if (OpenerStep == 14) actionID = Fire4; - if (WasLastAction(Paradox) && OpenerStep == 19) OpenerStep++; - else if (OpenerStep == 19) actionID = Paradox; + if (WasLastAction(Fire4) && Fire4Count is 6 && OpenerStep == 15) OpenerStep++; + else if (OpenerStep == 15) actionID = Fire4; - if (WasLastAction(Fire4) && Fire4Count is 8 && OpenerStep == 20) OpenerStep++; - else if (OpenerStep == 20) actionID = Fire4; + if (WasLastAction(FlareStar) && OpenerStep == 16) OpenerStep++; + else if (OpenerStep == 16) actionID = FlareStar; - if (WasLastAction(Fire4) && Fire4Count is 9 && OpenerStep == 21) OpenerStep++; - else if (OpenerStep == 21) actionID = Fire4; + if (WasLastAction(Fire4) && Fire4Count is 7 && OpenerStep == 17) OpenerStep++; + else if (OpenerStep == 17) actionID = Fire4; - if (WasLastAction(Fire4) && Fire4Count is 10 && OpenerStep == 22) OpenerStep++; - else if (OpenerStep == 22) actionID = Fire4; + if (WasLastAction(HighThunder) && OpenerStep == 18) OpenerStep++; + else if (OpenerStep == 18) actionID = HighThunder; - if (WasLastAction(Despair) && OpenerStep == 23) CurrentState = OpenerState.OpenerFinished; - else if (OpenerStep == 23) actionID = Despair; + if (WasLastAction(Paradox) && OpenerStep == 19) OpenerStep++; + else if (OpenerStep == 19) actionID = Paradox; - if (((actionID == Triplecast && GetRemainingCharges(Triplecast) < 2) || - (actionID == Amplifier && IsOnCooldown(Amplifier)) || - (actionID == LeyLines && IsOnCooldown(LeyLines)) || - (actionID == All.LucidDreaming && IsOnCooldown(All.LucidDreaming)) || - (actionID == Manafont && IsOnCooldown(Manafont)) || - (actionID == All.Swiftcast && IsOnCooldown(All.Swiftcast)) || - (actionID == Xenoglossy && Svc.Gauges.Get().PolyglotStacks < 1)) && - ActionWatching.TimeSinceLastAction.TotalSeconds >= 3) - { - CurrentState = OpenerState.FailedOpener; + if (WasLastAction(Fire4) && Fire4Count is 8 && OpenerStep == 20) OpenerStep++; + else if (OpenerStep == 20) actionID = Fire4; - return false; - } + if (WasLastAction(Fire4) && Fire4Count is 9 && OpenerStep == 21) OpenerStep++; + else if (OpenerStep == 21) actionID = Fire4; - return true; - } + if (WasLastAction(Fire4) && Fire4Count is 10 && OpenerStep == 22) OpenerStep++; + else if (OpenerStep == 22) actionID = Fire4; - return false; - } + if (WasLastAction(Despair) && OpenerStep == 23) CurrentState = OpenerState.OpenerFinished; + else if (OpenerStep == 23) actionID = Despair; - private void ResetOpener() - { - PrePullStep = 0; - OpenerStep = 0; - } + if (((actionID == Triplecast && GetRemainingCharges(Triplecast) == 0) || + (actionID == Amplifier && IsOnCooldown(Amplifier)) || + (actionID == LeyLines && IsOnCooldown(LeyLines)) || + (actionID == Manafont && IsOnCooldown(Manafont)) || + (actionID == All.Swiftcast && IsOnCooldown(All.Swiftcast)) || + (actionID == Xenoglossy && !Gauge.HasPolyglotStacks())) && + ActionWatching.TimeSinceLastAction.TotalSeconds >= 3) + { + CurrentState = OpenerState.FailedOpener; - public bool DoFullOpener(ref uint actionID) - { - if (!LevelChecked) return false; + return false; + } - if (CurrentState == OpenerState.PrePull) - if (DoPrePullSteps(ref actionID)) return true; + } - if (CurrentState == OpenerState.InOpener) - if (DoOpener(ref actionID)) - return true; + return false; + } - if (!InCombat()) + private void ResetOpener() { - ResetOpener(); - CurrentState = OpenerState.PrePull; + PrePullStep = 0; + OpenerStep = 0; } - return false; - } -} + public bool DoFullOpener(ref uint actionID) + { + if (!LevelChecked) return false; -internal static class BLMExtensions -{ - public static bool HasPolyglotStacks(this BLMGauge gauge) - { - return gauge.PolyglotStacks > 0; - } -} + if (CurrentState == OpenerState.PrePull) + if (DoPrePullSteps(ref actionID)) + return true; -internal class BLMHelper : BLM -{ - public static float MPAfterCast() - { - uint castedSpell = LocalPlayer.CastActionId; - BLMGauge gauge = Svc.Gauges.Get(); + if (CurrentState == OpenerState.InOpener) + if (DoOpener(ref actionID)) + return true; - int nextMpGain = gauge.UmbralIceStacks switch - { - 0 => 0, - 1 => 2500, - 2 => 5000, - 3 => 10000, - _ => 0 - }; - - if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) - return Math.Max(LocalPlayer.MaxMp, - LocalPlayer.CurrentMp + nextMpGain); - - return Math.Max(0, - LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); + if (!InCombat()) + { + ResetOpener(); + CurrentState = OpenerState.PrePull; + } + + return false; + } } - public static bool DoubleBlizz() + internal class BLMHelper { - List spells = ActionWatching.CombatActions.Where(x => - ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && - x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)) - .ToList(); - - if (spells.Count < 1) return false; + public static float MPAfterCast() + { + uint castedSpell = LocalPlayer.CastActionId; + BLMGauge gauge = Svc.Gauges.Get(); - uint firstSpell = spells[^1]; + int nextMpGain = gauge.UmbralIceStacks switch + { + 0 => 0, + 1 => 2500, + 2 => 5000, + 3 => 10000, + _ => 0 + }; + + if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) + return Math.Max(LocalPlayer.MaxMp, + LocalPlayer.CurrentMp + nextMpGain); + + return Math.Max(0, + LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); + } - if (firstSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) + public static bool DoubleBlizz() { - uint castedSpell = LocalPlayer.CastActionId; + List spells = ActionWatching.CombatActions.Where(x => + ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && + x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)) + .ToList(); - if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) return true; + if (spells.Count < 1) return false; - if (spells.Count >= 2) + uint firstSpell = spells[^1]; + + if (firstSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) { - uint secondSpell = spells[^2]; + uint castedSpell = LocalPlayer.CastActionId; - if (secondSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) + if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) return true; + + if (spells.Count >= 2) + { + uint secondSpell = spells[^2]; + + if (secondSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) + return true; + } } - } - return false; + return false; + } } } \ No newline at end of file diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index a5ad5e49a..40d110fba 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -2,13 +2,13 @@ using System.Collections.Generic; 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.Data; using XIVSlothCombo.Extensions; using static XIVSlothCombo.CustomComboNS.Functions.CustomComboFunctions; +using static XIVSlothCombo.Combos.JobHelpers.BLM; namespace XIVSlothCombo.Combos.PvE; From 44f35b692b5e91b8bc11b86f1c1b84ecf2d63c1b Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 27 Oct 2024 11:29:13 +0100 Subject: [PATCH 03/46] add better transpose logic ( Thanks to @Blossom and @Ignoral ) --- XIVSlothCombo/Combos/PvE/BLM.cs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 40d110fba..1b8b2fb3c 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -228,9 +228,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) return Paradox; - if (HasEffect(Buffs.Firestarter)) - if (gcdsInTimer < 2 || curMp < MP.FireI || WasLastAbility(Transpose)) - return Fire3; + if (HasEffect(Buffs.Firestarter) && curMp > 0 && + (gcdsInTimer < 2 || curMp < MP.FireI || WasLastAbility(Transpose))) + return Fire3; if (curMp < MP.FireI && Despair.LevelChecked() && curMp >= MP.Despair) { @@ -283,7 +283,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (gauge.HasPolyglotStacks()) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; - if (curMp + nextMpGain >= 7500 && (LocalPlayer.CastActionId == Blizzard || WasLastSpell(Blizzard) || + if (curMp + nextMpGain >= 7500 && (LocalPlayer.CastActionId == Blizzard || + WasLastSpell(Blizzard) || WasLastSpell(Blizzard4))) { if (Fire3.LevelChecked()) @@ -295,7 +296,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (curMp + nextMpGain <= 10000 || curMp < 7500) return Blizzard; - if (ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell)) + if (ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell) && + curMp is MP.MaxMP && HasEffect(Buffs.Firestarter)) return Transpose; if (Fire3.LevelChecked()) @@ -394,9 +396,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) return Paradox; - if (HasEffect(Buffs.Firestarter)) - if (gcdsInTimer < 2 || curMp < MP.FireI || WasLastAbility(Transpose)) - return Fire3; + if (HasEffect(Buffs.Firestarter) && curMp > 0 && + (gcdsInTimer < 2 || curMp < MP.FireI || WasLastAbility(Transpose))) + return Fire3; if (IsEnabled(CustomComboPreset.BLM_ST_Despair) && curMp < MP.FireI && Despair.LevelChecked() && curMp >= MP.Despair) @@ -471,7 +473,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Blizzard; if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && - ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell)) + ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell) && + curMp is MP.MaxMP && HasEffect(Buffs.Firestarter)) return Transpose; if (Fire3.LevelChecked()) From c434b2024291b8b1fbf67432f1c399cfdec0be81 Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 27 Oct 2024 14:10:06 +0100 Subject: [PATCH 04/46] fix opener count --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index c27b6e4f3..d5ee20c3d 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -14,7 +14,7 @@ namespace XIVSlothCombo.Combos.JobHelpers; internal static class BLM { // BLM Gauge & Extensions - public static int Fire4Count = ActionWatching.CombatActions.Count(x => x == Fire4); + public static int Fire4Count => ActionWatching.CombatActions.Count(x => x == Fire4); public static BLMGauge Gauge => GetJobGauge(); From f6f679eae1d11a8ac5b270c055f28ec54b019479 Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 27 Oct 2024 18:16:47 +0100 Subject: [PATCH 05/46] add advanced AoE reordering --- XIVSlothCombo/Combos/CustomComboPreset.cs | 116 ++++++++--- XIVSlothCombo/Combos/PvE/BLM.cs | 225 +++++++++++++++++----- 2 files changed, 268 insertions(+), 73 deletions(-) diff --git a/XIVSlothCombo/Combos/CustomComboPreset.cs b/XIVSlothCombo/Combos/CustomComboPreset.cs index b6f809cf2..aa44f4d95 100644 --- a/XIVSlothCombo/Combos/CustomComboPreset.cs +++ b/XIVSlothCombo/Combos/CustomComboPreset.cs @@ -365,60 +365,119 @@ public enum CustomComboPreset #region BLACK MAGE [ReplaceSkill(BLM.Fire)] - [CustomComboInfo("Simple Mode - Single Target", "Replaces Fire with a full one-button single target rotation.\nThis is the ideal option for newcomers to the job.", BLM.JobID, -10)] - BLM_ST_SimpleMode = 2012, + [CustomComboInfo("Simple Mode - Single Target", "Replaces Fire with a full one-button single target rotation.\nThis is the ideal option for newcomers to the job.", BLM.JobID)] + BLM_ST_SimpleMode = 2001, [ReplaceSkill(BLM.Blizzard2, BLM.HighBlizzard2)] - [CustomComboInfo("Simple Mode - AoE", "Replaces Blizzard II with a full one-button AoE rotation.\nThis is the ideal option for newcomers to the job.", BLM.JobID, -8)] - BLM_AoE_SimpleMode = 2008, + [CustomComboInfo("Simple Mode - AoE", "Replaces Blizzard II with a full one-button AoE rotation.\nThis is the ideal option for newcomers to the job.", BLM.JobID)] + BLM_AoE_SimpleMode = 2002, + + #region Single Target - Advanced [ReplaceSkill(BLM.Fire)] - [CustomComboInfo("Advanced Mode - Single Target", "Replaces Fire with a full one-button single target rotation.\nThese features are ideal if you want to customize the rotation.", BLM.JobID, -10)] - BLM_ST_AdvancedMode = 2058, + [CustomComboInfo("Advanced Mode - Single Target", "Replaces Fire with a full one-button single target rotation.\nThese features are ideal if you want to customize the rotation.", BLM.JobID)] + BLM_ST_AdvancedMode = 2100, [ParentCombo(BLM_ST_AdvancedMode)] [CustomComboInfo("Level 100 Opener", "Adds the Balance opener to the rotation.", BLM.JobID)] - BLM_ST_Opener = 2059, + BLM_ST_Opener = 2101, [ParentCombo(BLM_ST_AdvancedMode)] - [CustomComboInfo("Use Foul / Xenoglossy", "Add Foul / Xenoglossy to the rotation.", BLM.JobID)] - BLM_ST_UsePolyglot = 2060, + [CustomComboInfo("Use Amplifier", "Add Amplifier to the rotation.", BLM.JobID)] + BLM_ST_Amplifier = 2102, - [ParentCombo(BLM_ST_AdvancedMode)] - [CustomComboInfo("Use Foul / Xenoglossy for movement", "Add Foul / Xenoglossy to the rotation as movement option.", BLM.JobID)] - BLM_ST_UsePolyglotMoving = 2061, + [ParentCombo(BLM_ST_AdvancedMode)] [CustomComboInfo("Use Leylines", "Add Leylines to the rotation.", BLM.JobID)] + BLM_ST_LeyLines = 2103, [ParentCombo(BLM_ST_AdvancedMode)] - [CustomComboInfo("Use Amplifier", "Add Amplifier to the rotation.", BLM.JobID)] - BLM_ST_Amplifier = 2062, - - [ParentCombo(BLM_ST_AdvancedMode)] - [CustomComboInfo("Use Leylines", "Add Leylines to the rotation.", BLM.JobID)] - BLM_ST_LeyLines = 2063, + [CustomComboInfo("Use Foul / Xenoglossy", "Add Foul / Xenoglossy to the rotation.", BLM.JobID)] + BLM_ST_UsePolyglot = 2104, [ParentCombo(BLM_ST_AdvancedMode)] - [CustomComboInfo("Use Despair", "Add Despair to the rotation.", BLM.JobID)] - BLM_ST_Despair = 2064, + [CustomComboInfo("Use Foul / Xenoglossy for movement", "Add Foul / Xenoglossy to the rotation as movement option.", BLM.JobID)] + BLM_ST_UsePolyglotMoving = 2105, [ParentCombo(BLM_ST_AdvancedMode)] [CustomComboInfo("Use Swiftcast", "Add Swiftcast to the rotation.", BLM.JobID)] - BLM_ST_Swiftcast = 2065, + BLM_ST_Swiftcast = 2106, [ParentCombo(BLM_ST_AdvancedMode)] [CustomComboInfo("Use Triplecast", "Add Triplecast to the rotation.", BLM.JobID)] - BLM_ST_Triplecast = 2066, + BLM_ST_Triplecast = 2107, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Manafont", "Add Manafont to the rotation.", BLM.JobID)] + BLM_ST_Manafont = 2108, [ParentCombo(BLM_ST_AdvancedMode)] - [CustomComboInfo("Use Flarestar", "Add Flarestar to the rotation.", BLM.JobID)] - BLM_ST_Flarestar = 2067, + [CustomComboInfo("Use Transpose", "Add Transpose to the rotation.", BLM.JobID)] + BLM_ST_Transpose = 2109, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Thunder", "Add Thunder to the rotation.", BLM.JobID)] + BLM_ST_Thunder = 2110, [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Despair", "Add Despair to the rotation.", BLM.JobID)] + BLM_ST_Despair = 2111, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Flarestar", "Add Flarestar to the rotation.", BLM.JobID)] + BLM_ST_Flarestar = 2112, + + #endregion + + #region AoE - Advanced + + [ReplaceSkill(BLM.Fire)] + [CustomComboInfo("Advanced Mode - AoE", "Replaces Blizzard II with a full one-button AoE rotation.\nThese features are ideal if you want to customize the rotation.", BLM.JobID)] + BLM_AoE_AdvancedMode = 2200, + + [ParentCombo(BLM_AoE_AdvancedMode)] + [CustomComboInfo("Use Amplifier", "Add Amplifier to the rotation.", BLM.JobID)] + BLM_AoE_Amplifier = 2201, + + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Leylines", "Add Leylines to the rotation.", BLM.JobID)] + BLM_AoE_LeyLines = 2202, + + [ParentCombo(BLM_AoE_AdvancedMode)] + [CustomComboInfo("Use Foul / Xenoglossy", "Add Foul / Xenoglossy to the rotation.", BLM.JobID)] + BLM_AoE_UsePolyglot = 2203, + + [ParentCombo(BLM_AoE_AdvancedMode)] + [CustomComboInfo("Use Foul / Xenoglossy for movement", "Add Foul / Xenoglossy to the rotation as movement option.", BLM.JobID)] + BLM_AoE_UsePolyglotMoving = 2204, + + [ParentCombo(BLM_AoE_AdvancedMode)] + [CustomComboInfo("Use Swiftcast", "Add Swiftcast to the rotation.", BLM.JobID)] + BLM_AoE_Swiftcast = 2205, + + [ParentCombo(BLM_AoE_AdvancedMode)] + [CustomComboInfo("Use Triplecast", "Add Triplecast to the rotation.", BLM.JobID)] + BLM_AoE_Triplecast = 2206, + + [ParentCombo(BLM_AoE_AdvancedMode)] [CustomComboInfo("Use Manafont", "Add Manafont to the rotation.", BLM.JobID)] - BLM_ST_Manafont = 2068, + BLM_AoE_Manafont = 2207, - [ParentCombo(BLM_ST_AdvancedMode)] + [ParentCombo(BLM_AoE_AdvancedMode)] [CustomComboInfo("Use Transpose", "Add Transpose to the rotation.", BLM.JobID)] - BLM_ST_Transpose = 2069, + BLM_AoE_Transpose = 2208, + + [ParentCombo(BLM_AoE_AdvancedMode)] + [CustomComboInfo("Use Thunder", "Add Thunder to the rotation.", BLM.JobID)] + BLM_AoE_Thunder = 2209, + + [ParentCombo(BLM_AoE_AdvancedMode)] + [CustomComboInfo("Use Flare", "Add Flare to the rotation.", BLM.JobID)] + BLM_AoE_Flare = 2210, + + [ParentCombo(BLM_AoE_AdvancedMode)] + [CustomComboInfo("Use Flarestar", "Add Flarestar to the rotation.", BLM.JobID)] + BLM_AoE_Flarestar = 2211, + + #endregion #region Variant @@ -465,7 +524,8 @@ public enum CustomComboPreset BLM_Aetherial_Manipulation = 2046, #endregion - // Last value = 2069 + // Last value ST = 2112 + //Last Value AoE = 2211 #endregion diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 1b8b2fb3c..1f76efa12 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -65,6 +65,15 @@ public static readonly Dictionary protected static BLMGauge gauge = GetJobGauge(); + protected static int nextMpGain = gauge.UmbralIceStacks switch + { + 0 => 0, + 1 => 2500, + 2 => 5000, + 3 => 10000, + _ => 0 + }; + public static class Buffs { public const ushort @@ -170,15 +179,6 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; - int nextMpGain = gauge.UmbralIceStacks switch - { - 0 => 0, - 1 => 2500, - 2 => 5000, - 3 => 10000, - _ => 0 - }; - Status? thunderDebuff = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = gauge.ElementTimeRemaining / 1000f; @@ -324,25 +324,13 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; int maxPolyglotCD = maxPolyglot * 30000; - int remainingPolyglotCD = Math.Max(0, (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; - - int nextMpGain = gauge.UmbralIceStacks switch - { - 0 => 0, - 1 => 2500, - 2 => 5000, - 3 => 10000, - _ => 0 - }; - Status? thunderDebuff = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); - bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0; @@ -361,11 +349,14 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (BLMOpener.DoFullOpener(ref actionID)) return actionID; - if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1) - if (thunderDebuff is null || thunderDebuff.RemainingTime < 3) - return OriginalHook(Thunder); + if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && + HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && + (thunderDebuff is null || thunderDebuff.RemainingTime < 3)) + return OriginalHook(Thunder); - if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) + if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && + ActionReady(Amplifier) && + remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) return Amplifier; if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && @@ -499,28 +490,15 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; int maxPolyglotCD = maxPolyglot * 30000; - int remainingPolyglotCD = Math.Max(0, (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; - - int nextMpGain = gauge.UmbralIceStacks switch - { - 0 => 0, - 1 => 2500, - 2 => 5000, - 3 => 10000, - _ => 0 - }; - Status? thunderDebuff = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - - bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || - ActionReady(Triplecast) || - GetBuffStacks(Buffs.Triplecast) > 0); + bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && + (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); bool canWeave = CanSpellWeave(ActionWatching.LastSpell); if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && @@ -534,9 +512,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim canWeave) return Variant.VariantRampart; - if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked()) - if (thunderDebuff is null || thunderDebuff.RemainingTime < 3) - return OriginalHook(Thunder2); + if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && + thunderDebuff is null || thunderDebuff.RemainingTime < 3) + return OriginalHook(Thunder2); if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && canWeave) return Amplifier; @@ -577,10 +555,12 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (ActionReady(Manafont)) return Manafont; - if (ActionReady(Transpose) && (!TraitLevelChecked(Traits.AspectMasteryIII) || canSwiftF)) + if (ActionReady(Transpose) && + (!TraitLevelChecked(Traits.AspectMasteryIII) || canSwiftF)) return Transpose; - if (ActionReady(Blizzard2) && TraitLevelChecked(Traits.AspectMasteryIII)) + if (ActionReady(Blizzard2) && + TraitLevelChecked(Traits.AspectMasteryIII)) return OriginalHook(Blizzard2); } @@ -639,6 +619,161 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return actionID; } } + + internal class BLM_AoE_AdvancedMode : CustomCombo + { + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_AoE_AdvancedMode; + + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) + { + if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; + + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : + TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + int maxPolyglotCD = maxPolyglot * 30000; + int remainingPolyglotCD = Math.Max(0, + (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); + uint curMp = LocalPlayer.CurrentMp; + Status? thunderDebuff = + FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + float elementTimer = gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && + (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); + bool canWeave = CanSpellWeave(ActionWatching.LastSpell); + + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && + IsEnabled(Variant.VariantCure) && + PlayerHealthPercentageHp() <= Config.BLM_VariantCure) + return Variant.VariantCure; + + if (IsEnabled(CustomComboPreset.BLM_Variant_Rampart) && + IsEnabled(Variant.VariantRampart) && + IsOffCooldown(Variant.VariantRampart) && + canWeave) + return Variant.VariantRampart; + + if (IsEnabled(CustomComboPreset.BLM_AoE_Thunder) && + HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && + thunderDebuff is null || thunderDebuff.RemainingTime < 3) + return OriginalHook(Thunder2); + + if (IsEnabled(CustomComboPreset.BLM_AoE_Amplifier) && + ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && canWeave) + return Amplifier; + + if (IsMoving) + { + if (IsEnabled(CustomComboPreset.BLM_AoE_Amplifier) && + ActionReady(Amplifier) && gauge.PolyglotStacks < maxPolyglot) + return Amplifier; + + if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglotMoving) && + gauge.HasPolyglotStacks()) + return Foul; + } + + if (IsEnabled(CustomComboPreset.BLM_AoE_LeyLines) && + canWeave && ActionReady(LeyLines)) + return LeyLines; + + if (gauge.InAstralFire) + { + if (IsEnabled(CustomComboPreset.BLM_AoE_Flarestar) && + curMp == 0 && FlareStar.LevelChecked() && gauge.AstralSoulStacks == 6) + return FlareStar; + + if (!FlareStar.LevelChecked() && Fire2.LevelChecked() && curMp >= MP.FireAoE && + (gauge.UmbralHearts > 1 || !TraitLevelChecked(Traits.UmbralHeart))) + return OriginalHook(Fire2); + + if (IsEnabled(CustomComboPreset.BLM_AoE_Flare) && + Flare.LevelChecked() && curMp >= MP.FlareAoE) + { + if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) + return Triplecast; + + return Flare; + } + + if (Fire2.LevelChecked()) + if (gcdsInTimer > 1 && curMp >= MP.FireAoE) + return OriginalHook(Fire2); + + if (IsEnabled(CustomComboPreset.BLM_AoE_Manafont) && + ActionReady(Manafont)) + return Manafont; + + if (IsEnabled(CustomComboPreset.BLM_AoE_Transpose) && + ActionReady(Transpose) && (!TraitLevelChecked(Traits.AspectMasteryIII) || canSwiftF)) + return Transpose; + + if (ActionReady(Blizzard2) && TraitLevelChecked(Traits.AspectMasteryIII)) + return OriginalHook(Blizzard2); + } + + if (gauge.InUmbralIce) + { + if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), + OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && + FlareStar.LevelChecked()) + { + if (IsEnabled(CustomComboPreset.BLM_AoE_Transpose) && + ActionReady(Transpose) && canWeave) + return Transpose; + + return OriginalHook(Fire2); + } + + if (ActionReady(OriginalHook(Blizzard2)) && gauge.UmbralIceStacks < 3 && + TraitLevelChecked(Traits.AspectMasteryIII)) + { + if (IsEnabled(CustomComboPreset.BLM_AoE_Triplecast) && + ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) + return Triplecast; + + if (IsEnabled(CustomComboPreset.BLM_AoE_Swiftcast) && + GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && canWeave) + return All.Swiftcast; + + if (HasEffect(All.Buffs.Swiftcast) || GetBuffStacks(Buffs.Triplecast) > 0) + return OriginalHook(Blizzard2); + } + + if (gauge.UmbralIceStacks < 3 && ActionReady(OriginalHook(Blizzard2))) + return OriginalHook(Blizzard2); + + if (Freeze.LevelChecked() && gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + return Freeze; + + if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglot) && + gauge.HasPolyglotStacks()) + return Foul; + + if (BLMHelper.DoubleBlizz()) + if (Fire2.LevelChecked()) + return OriginalHook(Fire2); + + if (curMp < LocalPlayer.MaxMp) + return Freeze.LevelChecked() + ? OriginalHook(Freeze) + : OriginalHook(Blizzard2); + + if (IsEnabled(CustomComboPreset.BLM_AoE_Transpose) && + ActionReady(Transpose) && + ((canWeave && Flare.LevelChecked()) || !TraitLevelChecked(Traits.AspectMasteryIII))) + return Transpose; + + if (Fire2.LevelChecked() && TraitLevelChecked(Traits.AspectMasteryIII)) + return OriginalHook(Fire2); + } + + if (Blizzard2.LevelChecked()) + return OriginalHook(Blizzard2); + + return actionID; + } + } internal class BLM_Variant_Raise : CustomCombo { From 455478db38d73555d1e332cbaead044beba4bd44 Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 27 Oct 2024 18:26:01 +0100 Subject: [PATCH 06/46] fix numbering --- XIVSlothCombo/Combos/CustomComboPreset.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/XIVSlothCombo/Combos/CustomComboPreset.cs b/XIVSlothCombo/Combos/CustomComboPreset.cs index aa44f4d95..787df8c68 100644 --- a/XIVSlothCombo/Combos/CustomComboPreset.cs +++ b/XIVSlothCombo/Combos/CustomComboPreset.cs @@ -500,28 +500,28 @@ public enum CustomComboPreset #region Miscellaneous [ReplaceSkill(BLM.Transpose)] [CustomComboInfo("Umbral Soul/Transpose Feature", "Replaces Transpose with Umbral Soul when Umbral Soul is available.", BLM.JobID)] - BLM_UmbralSoul = 2001, + BLM_UmbralSoul = 2050, [ReplaceSkill(BLM.LeyLines)] [CustomComboInfo("Between the Ley Lines Feature", "Replaces Ley Lines with Between the Lines when Ley Lines is active.", BLM.JobID)] - BLM_Between_The_LeyLines = 2002, + BLM_Between_The_LeyLines = 2051, [ReplaceSkill(BLM.Blizzard, BLM.Freeze)] [CustomComboInfo("Blizzard I/III Feature", "Replaces Blizzard I with Blizzard III when out of Umbral Ice." + "\nReplaces Freeze with Blizzard II when synced below Lv.40.", BLM.JobID)] - BLM_Blizzard_1to3 = 2003, + BLM_Blizzard_1to3 = 2052, [ReplaceSkill(BLM.Scathe)] [CustomComboInfo("Xenoglossy Feature", "Replaces Scathe with Xenoglossy when available.", BLM.JobID)] - BLM_Scathe_Xeno = 2004, + BLM_Scathe_Xeno = 2053, [ReplaceSkill(BLM.Fire)] [CustomComboInfo("Fire I/III Feature", "Replaces Fire I with Fire III outside of Astral Fire or when Firestarter is up.", BLM.JobID)] - BLM_Fire_1to3 = 2005, + BLM_Fire_1to3 = 2054, [ReplaceSkill(BLM.AetherialManipulation)] [CustomComboInfo("Aetherial Manipulation Feature", "Replaces Aetherial Manipulation with Between the Lines when you are out of active Ley Lines and standing still.", BLM.JobID)] - BLM_Aetherial_Manipulation = 2046, + BLM_Aetherial_Manipulation = 2055, #endregion // Last value ST = 2112 From 269a45743678b95c8ef252937593b4d1a8a05419 Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 27 Oct 2024 18:30:12 +0100 Subject: [PATCH 07/46] little word cleanup --- XIVSlothCombo/Combos/CustomComboPreset.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XIVSlothCombo/Combos/CustomComboPreset.cs b/XIVSlothCombo/Combos/CustomComboPreset.cs index 787df8c68..5ba90cf08 100644 --- a/XIVSlothCombo/Combos/CustomComboPreset.cs +++ b/XIVSlothCombo/Combos/CustomComboPreset.cs @@ -442,11 +442,11 @@ public enum CustomComboPreset BLM_AoE_LeyLines = 2202, [ParentCombo(BLM_AoE_AdvancedMode)] - [CustomComboInfo("Use Foul / Xenoglossy", "Add Foul / Xenoglossy to the rotation.", BLM.JobID)] + [CustomComboInfo("Use Foul", "Add Foul to the rotation.", BLM.JobID)] BLM_AoE_UsePolyglot = 2203, [ParentCombo(BLM_AoE_AdvancedMode)] - [CustomComboInfo("Use Foul / Xenoglossy for movement", "Add Foul / Xenoglossy to the rotation as movement option.", BLM.JobID)] + [CustomComboInfo("Use Foul for movement", "Add Foul to the rotation as movement option.", BLM.JobID)] BLM_AoE_UsePolyglotMoving = 2204, [ParentCombo(BLM_AoE_AdvancedMode)] From 0a85eae3b5f770762617275181d54c25b8b3ede1 Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 27 Oct 2024 19:30:23 +0100 Subject: [PATCH 08/46] add conflicts --- XIVSlothCombo/Combos/CustomComboPreset.cs | 7 ++++++- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 5 +---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/XIVSlothCombo/Combos/CustomComboPreset.cs b/XIVSlothCombo/Combos/CustomComboPreset.cs index 5ba90cf08..a51fe0f58 100644 --- a/XIVSlothCombo/Combos/CustomComboPreset.cs +++ b/XIVSlothCombo/Combos/CustomComboPreset.cs @@ -365,16 +365,20 @@ public enum CustomComboPreset #region BLACK MAGE [ReplaceSkill(BLM.Fire)] + [ConflictingCombos(BLM_ST_AdvancedMode)] [CustomComboInfo("Simple Mode - Single Target", "Replaces Fire with a full one-button single target rotation.\nThis is the ideal option for newcomers to the job.", BLM.JobID)] BLM_ST_SimpleMode = 2001, - + + [ReplaceSkill(BLM.Blizzard2, BLM.HighBlizzard2)] + [ConflictingCombos(BLM_AoE_AdvancedMode)] [CustomComboInfo("Simple Mode - AoE", "Replaces Blizzard II with a full one-button AoE rotation.\nThis is the ideal option for newcomers to the job.", BLM.JobID)] BLM_AoE_SimpleMode = 2002, #region Single Target - Advanced [ReplaceSkill(BLM.Fire)] + [ConflictingCombos(BLM_ST_SimpleMode)] [CustomComboInfo("Advanced Mode - Single Target", "Replaces Fire with a full one-button single target rotation.\nThese features are ideal if you want to customize the rotation.", BLM.JobID)] BLM_ST_AdvancedMode = 2100, @@ -430,6 +434,7 @@ public enum CustomComboPreset #region AoE - Advanced [ReplaceSkill(BLM.Fire)] + [ConflictingCombos(BLM_AoE_SimpleMode)] [CustomComboInfo("Advanced Mode - AoE", "Replaces Blizzard II with a full one-button AoE rotation.\nThese features are ideal if you want to customize the rotation.", BLM.JobID)] BLM_AoE_AdvancedMode = 2200, diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index d5ee20c3d..a38e622f4 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -18,10 +18,7 @@ internal static class BLM public static BLMGauge Gauge => GetJobGauge(); - public static bool HasPolyglotStacks(this BLMGauge gauge) - { - return gauge.PolyglotStacks > 0; - } + public static bool HasPolyglotStacks(this BLMGauge gauge) => gauge.PolyglotStacks > 0; internal class BLMOpenerLogic { From c1016fb82a48779dd0116fe30c29afcf3e10dfed Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 27 Oct 2024 19:34:28 +0100 Subject: [PATCH 09/46] add leylines to aoe --- XIVSlothCombo/Combos/CustomComboPreset.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XIVSlothCombo/Combos/CustomComboPreset.cs b/XIVSlothCombo/Combos/CustomComboPreset.cs index a51fe0f58..8cfe19563 100644 --- a/XIVSlothCombo/Combos/CustomComboPreset.cs +++ b/XIVSlothCombo/Combos/CustomComboPreset.cs @@ -442,7 +442,7 @@ public enum CustomComboPreset [CustomComboInfo("Use Amplifier", "Add Amplifier to the rotation.", BLM.JobID)] BLM_AoE_Amplifier = 2201, - [ParentCombo(BLM_ST_AdvancedMode)] + [ParentCombo(BLM_AoE_AdvancedMode)] [CustomComboInfo("Use Leylines", "Add Leylines to the rotation.", BLM.JobID)] BLM_AoE_LeyLines = 2202, From 94e19d04c40d9be6b7829d929b6fe60bc84a3779 Mon Sep 17 00:00:00 2001 From: Kage Date: Mon, 28 Oct 2024 15:22:50 +0100 Subject: [PATCH 10/46] add some opener changes --- XIVSlothCombo/Combos/CustomComboPreset.cs | 3 ++- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/XIVSlothCombo/Combos/CustomComboPreset.cs b/XIVSlothCombo/Combos/CustomComboPreset.cs index 8cfe19563..cf1e60cda 100644 --- a/XIVSlothCombo/Combos/CustomComboPreset.cs +++ b/XIVSlothCombo/Combos/CustomComboPreset.cs @@ -390,7 +390,8 @@ public enum CustomComboPreset [CustomComboInfo("Use Amplifier", "Add Amplifier to the rotation.", BLM.JobID)] BLM_ST_Amplifier = 2102, - [ParentCombo(BLM_ST_AdvancedMode)] [CustomComboInfo("Use Leylines", "Add Leylines to the rotation.", BLM.JobID)] + [ParentCombo(BLM_ST_AdvancedMode)] + [CustomComboInfo("Use Leylines", "Add Leylines to the rotation.", BLM.JobID)] BLM_ST_LeyLines = 2103, [ParentCombo(BLM_ST_AdvancedMode)] diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index a38e622f4..210957bfd 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -88,14 +88,9 @@ private bool DoPrePullSteps(ref uint actionID) if (CurrentState == OpenerState.PrePull && PrePullStep > 0) { - if (LocalPlayer.CastActionId == Fire3 && PrePullStep == 1) CurrentState = OpenerState.InOpener; + if (WasLastAction(Fire3) && HasEffect(Buffs.Thunderhead) && PrePullStep == 1) CurrentState = OpenerState.InOpener; else if (PrePullStep == 1) actionID = Fire3; - - if (PrePullStep > 1 && - GetResourceCost(actionID) > LocalPlayer.CurrentMp && - ActionWatching.TimeSinceLastAction.TotalSeconds >= 2) - CurrentState = OpenerState.FailedOpener; - + if (ActionWatching.CombatActions.Count > 2 && InCombat()) CurrentState = OpenerState.FailedOpener; @@ -182,6 +177,9 @@ private bool DoOpener(ref uint actionID) if (WasLastAction(Despair) && OpenerStep == 23) CurrentState = OpenerState.OpenerFinished; else if (OpenerStep == 23) actionID = Despair; + if (ActionWatching.TimeSinceLastAction.TotalSeconds >= 5) + CurrentState = OpenerState.FailedOpener; + if (((actionID == Triplecast && GetRemainingCharges(Triplecast) == 0) || (actionID == Amplifier && IsOnCooldown(Amplifier)) || (actionID == LeyLines && IsOnCooldown(LeyLines)) || From 8056bf43e4c8536b27c946c88471045fd7f76fae Mon Sep 17 00:00:00 2001 From: Kage Date: Mon, 28 Oct 2024 16:05:54 +0100 Subject: [PATCH 11/46] use blmhelper mp mathing --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 22 ++--- XIVSlothCombo/Combos/PvE/BLM.cs | 121 +++++++++++-------------- 2 files changed, 66 insertions(+), 77 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index 210957bfd..45e3828ee 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -18,7 +18,10 @@ internal static class BLM public static BLMGauge Gauge => GetJobGauge(); - public static bool HasPolyglotStacks(this BLMGauge gauge) => gauge.PolyglotStacks > 0; + public static bool HasPolyglotStacks(this BLMGauge gauge) + { + return gauge.PolyglotStacks > 0; + } internal class BLMOpenerLogic { @@ -88,9 +91,10 @@ private bool DoPrePullSteps(ref uint actionID) if (CurrentState == OpenerState.PrePull && PrePullStep > 0) { - if (WasLastAction(Fire3) && HasEffect(Buffs.Thunderhead) && PrePullStep == 1) CurrentState = OpenerState.InOpener; + if (WasLastAction(Fire3) && HasEffect(Buffs.Thunderhead) && PrePullStep == 1) + CurrentState = OpenerState.InOpener; else if (PrePullStep == 1) actionID = Fire3; - + if (ActionWatching.CombatActions.Count > 2 && InCombat()) CurrentState = OpenerState.FailedOpener; @@ -243,20 +247,16 @@ public static float MPAfterCast() _ => 0 }; - if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) - return Math.Max(LocalPlayer.MaxMp, - LocalPlayer.CurrentMp + nextMpGain); - - return Math.Max(0, - LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); + return castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2 + ? Math.Max(LocalPlayer.MaxMp, LocalPlayer.CurrentMp + nextMpGain) + : Math.Max(0, LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); } public static bool DoubleBlizz() { List spells = ActionWatching.CombatActions.Where(x => ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && - x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)) - .ToList(); + x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)).ToList(); if (spells.Count < 1) return false; diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 1f76efa12..fa21a6103 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -62,18 +62,7 @@ public static readonly Dictionary { HighThunder, Debuffs.HighThunder }, { HighThunder2, Debuffs.HighThunder2 } }; - - protected static BLMGauge gauge = GetJobGauge(); - - protected static int nextMpGain = gauge.UmbralIceStacks switch - { - 0 => 0, - 1 => 2500, - 2 => 5000, - 3 => 10000, - _ => 0 - }; - + public static class Buffs { public const ushort @@ -176,12 +165,12 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim int maxPolyglotCD = maxPolyglot * 30000; int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); + (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; Status? thunderDebuff = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = gauge.ElementTimeRemaining / 1000f; + float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || @@ -208,24 +197,24 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) return Amplifier; - if (remainingPolyglotCD < 6000 && gcdsInTimer > 2 && gauge.HasPolyglotStacks()) + if (remainingPolyglotCD < 6000 && gcdsInTimer > 2 && Gauge.HasPolyglotStacks()) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; if (IsMoving) { - if (ActionReady(Amplifier) && gauge.PolyglotStacks < maxPolyglot) + if (ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) return Amplifier; - if (gauge.HasPolyglotStacks()) + if (Gauge.HasPolyglotStacks()) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; } if (CanSpellWeave(actionID) && ActionReady(LeyLines)) return LeyLines; - if (gauge.InAstralFire) + if (Gauge.InAstralFire) { - if (gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) + if (Gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) return Paradox; if (HasEffect(Buffs.Firestarter) && curMp > 0 && @@ -240,7 +229,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Despair; } - if (curMp == 0 && FlareStar.LevelChecked() && gauge.AstralSoulStacks == 6) + if (curMp == 0 && FlareStar.LevelChecked() && Gauge.AstralSoulStacks == 6) return FlareStar; if (Fire4.LevelChecked()) @@ -260,9 +249,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Transpose; } - if (gauge.InUmbralIce) + if (Gauge.InUmbralIce) { - if (ActionReady(Blizzard3) && gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.UmbralHeart)) + if (ActionReady(Blizzard3) && Gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.UmbralHeart)) { if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) return Triplecast; @@ -274,16 +263,16 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Blizzard3; } - if (Blizzard4.LevelChecked() && gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + if (Blizzard4.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Blizzard4; - if (gauge.IsParadoxActive) + if (Gauge.IsParadoxActive) return Paradox; - if (gauge.HasPolyglotStacks()) + if (Gauge.HasPolyglotStacks()) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; - if (curMp + nextMpGain >= 7500 && (LocalPlayer.CastActionId == Blizzard || + if (BLMHelper.MPAfterCast() >= 7500 && (LocalPlayer.CastActionId == Blizzard || WasLastSpell(Blizzard) || WasLastSpell(Blizzard4))) { @@ -293,7 +282,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Fire; } - if (curMp + nextMpGain <= 10000 || curMp < 7500) + if (BLMHelper.MPAfterCast() <= 10000 || curMp < 7500) return Blizzard; if (ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell) && @@ -325,11 +314,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; int maxPolyglotCD = maxPolyglot * 30000; int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); + (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; Status? thunderDebuff = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = gauge.ElementTimeRemaining / 1000f; + float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0; @@ -360,7 +349,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Amplifier; if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && - remainingPolyglotCD < 6000 && gcdsInTimer > 2 && gauge.HasPolyglotStacks()) + remainingPolyglotCD < 6000 && gcdsInTimer > 2 && Gauge.HasPolyglotStacks()) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; @@ -368,11 +357,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsMoving) { if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && - ActionReady(Amplifier) && gauge.PolyglotStacks < maxPolyglot) + ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) return Amplifier; if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglotMoving) && - gauge.HasPolyglotStacks()) + Gauge.HasPolyglotStacks()) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; @@ -382,9 +371,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim CanSpellWeave(actionID) && ActionReady(LeyLines)) return LeyLines; - if (gauge.InAstralFire) + if (Gauge.InAstralFire) { - if (gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) + if (Gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) return Paradox; if (HasEffect(Buffs.Firestarter) && curMp > 0 && @@ -402,7 +391,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim } if (IsEnabled(CustomComboPreset.BLM_ST_Flarestar) && - curMp == 0 && FlareStar.LevelChecked() && gauge.AstralSoulStacks == 6) + curMp == 0 && FlareStar.LevelChecked() && Gauge.AstralSoulStacks == 6) return FlareStar; if (Fire4.LevelChecked()) @@ -424,9 +413,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Transpose; } - if (gauge.InUmbralIce) + if (Gauge.InUmbralIce) { - if (ActionReady(Blizzard3) && gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.UmbralHeart)) + if (ActionReady(Blizzard3) && Gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.UmbralHeart)) { if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) @@ -440,19 +429,19 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Blizzard3; } - if (Blizzard4.LevelChecked() && gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + if (Blizzard4.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Blizzard4; - if (gauge.IsParadoxActive) + if (Gauge.IsParadoxActive) return Paradox; if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && - gauge.HasPolyglotStacks()) + Gauge.HasPolyglotStacks()) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; - if (curMp + nextMpGain >= 7500 && + if (BLMHelper.MPAfterCast() >= 7500 && (LocalPlayer.CastActionId == Blizzard || WasLastSpell(Blizzard) || WasLastSpell(Blizzard4))) @@ -460,7 +449,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim ? Fire3 : Fire; - if (curMp + nextMpGain <= 10000 || curMp < 7500) + if (BLMHelper.MPAfterCast() <= 10000 || curMp < 7500) return Blizzard; if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && @@ -491,11 +480,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; int maxPolyglotCD = maxPolyglot * 30000; int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); + (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; Status? thunderDebuff = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = gauge.ElementTimeRemaining / 1000f; + float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); @@ -521,23 +510,23 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsMoving) { - if (ActionReady(Amplifier) && gauge.PolyglotStacks < maxPolyglot) + if (ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) return Amplifier; - if (gauge.HasPolyglotStacks()) + if (Gauge.HasPolyglotStacks()) return Foul; } if (canWeave && ActionReady(LeyLines)) return LeyLines; - if (gauge.InAstralFire) + if (Gauge.InAstralFire) { - if (curMp == 0 && FlareStar.LevelChecked() && gauge.AstralSoulStacks == 6) + if (curMp == 0 && FlareStar.LevelChecked() && Gauge.AstralSoulStacks == 6) return FlareStar; if (!FlareStar.LevelChecked() && Fire2.LevelChecked() && curMp >= MP.FireAoE && - (gauge.UmbralHearts > 1 || !TraitLevelChecked(Traits.UmbralHeart))) + (Gauge.UmbralHearts > 1 || !TraitLevelChecked(Traits.UmbralHeart))) return OriginalHook(Fire2); if (Flare.LevelChecked() && curMp >= MP.FlareAoE) @@ -564,7 +553,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Blizzard2); } - if (gauge.InUmbralIce) + if (Gauge.InUmbralIce) { if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && @@ -576,7 +565,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Fire2); } - if (ActionReady(OriginalHook(Blizzard2)) && gauge.UmbralIceStacks < 3 && + if (ActionReady(OriginalHook(Blizzard2)) && Gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.AspectMasteryIII)) { if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) @@ -589,13 +578,13 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Blizzard2); } - if (gauge.UmbralIceStacks < 3 && ActionReady(OriginalHook(Blizzard2))) + if (Gauge.UmbralIceStacks < 3 && ActionReady(OriginalHook(Blizzard2))) return OriginalHook(Blizzard2); - if (Freeze.LevelChecked() && gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + if (Freeze.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Freeze; - if (gauge.HasPolyglotStacks()) + if (Gauge.HasPolyglotStacks()) return Foul; if (BLMHelper.DoubleBlizz()) @@ -632,11 +621,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; int maxPolyglotCD = maxPolyglot * 30000; int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - gauge.PolyglotStacks) * 30000 + (gauge.EnochianTimer - 30000)); + (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; Status? thunderDebuff = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = gauge.ElementTimeRemaining / 1000f; + float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); @@ -665,11 +654,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsMoving) { if (IsEnabled(CustomComboPreset.BLM_AoE_Amplifier) && - ActionReady(Amplifier) && gauge.PolyglotStacks < maxPolyglot) + ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) return Amplifier; if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglotMoving) && - gauge.HasPolyglotStacks()) + Gauge.HasPolyglotStacks()) return Foul; } @@ -677,14 +666,14 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim canWeave && ActionReady(LeyLines)) return LeyLines; - if (gauge.InAstralFire) + if (Gauge.InAstralFire) { if (IsEnabled(CustomComboPreset.BLM_AoE_Flarestar) && - curMp == 0 && FlareStar.LevelChecked() && gauge.AstralSoulStacks == 6) + curMp == 0 && FlareStar.LevelChecked() && Gauge.AstralSoulStacks == 6) return FlareStar; if (!FlareStar.LevelChecked() && Fire2.LevelChecked() && curMp >= MP.FireAoE && - (gauge.UmbralHearts > 1 || !TraitLevelChecked(Traits.UmbralHeart))) + (Gauge.UmbralHearts > 1 || !TraitLevelChecked(Traits.UmbralHeart))) return OriginalHook(Fire2); if (IsEnabled(CustomComboPreset.BLM_AoE_Flare) && @@ -712,7 +701,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Blizzard2); } - if (gauge.InUmbralIce) + if (Gauge.InUmbralIce) { if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && @@ -725,7 +714,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Fire2); } - if (ActionReady(OriginalHook(Blizzard2)) && gauge.UmbralIceStacks < 3 && + if (ActionReady(OriginalHook(Blizzard2)) && Gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.AspectMasteryIII)) { if (IsEnabled(CustomComboPreset.BLM_AoE_Triplecast) && @@ -740,14 +729,14 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Blizzard2); } - if (gauge.UmbralIceStacks < 3 && ActionReady(OriginalHook(Blizzard2))) + if (Gauge.UmbralIceStacks < 3 && ActionReady(OriginalHook(Blizzard2))) return OriginalHook(Blizzard2); - if (Freeze.LevelChecked() && gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + if (Freeze.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Freeze; if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglot) && - gauge.HasPolyglotStacks()) + Gauge.HasPolyglotStacks()) return Foul; if (BLMHelper.DoubleBlizz()) From 73b68993fe4ab170fd433c73b120fa2e65823c7f Mon Sep 17 00:00:00 2001 From: Kage Date: Mon, 28 Oct 2024 16:35:24 +0100 Subject: [PATCH 12/46] cleanup --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 32 +++- XIVSlothCombo/Combos/PvE/BLM.cs | 220 +++++++++---------------- 2 files changed, 104 insertions(+), 148 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index 45e3828ee..f3b3de246 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -2,6 +2,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; @@ -14,14 +15,29 @@ namespace XIVSlothCombo.Combos.JobHelpers; internal static class BLM { // BLM Gauge & Extensions + public static uint curMp = LocalPlayer.CurrentMp; + + public static int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + + public static int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + + public static Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + + public static Status? thunderDebuffAoE = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + + public static float elementTimer = Gauge.ElementTimeRemaining / 1000f; + + public static double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + + public static bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0; + + public static bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); + public static int Fire4Count => ActionWatching.CombatActions.Count(x => x == Fire4); public static BLMGauge Gauge => GetJobGauge(); - public static bool HasPolyglotStacks(this BLMGauge gauge) - { - return gauge.PolyglotStacks > 0; - } + public static bool HasPolyglotStacks(this BLMGauge gauge) => gauge.PolyglotStacks > 0; internal class BLMOpenerLogic { @@ -247,16 +263,16 @@ public static float MPAfterCast() _ => 0 }; - return castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2 - ? Math.Max(LocalPlayer.MaxMp, LocalPlayer.CurrentMp + nextMpGain) + return castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2 + ? Math.Max(LocalPlayer.MaxMp, LocalPlayer.CurrentMp + nextMpGain) : Math.Max(0, LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); } public static bool DoubleBlizz() { List spells = ActionWatching.CombatActions.Where(x => - ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && - x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)).ToList(); + ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && + x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)).ToList(); if (spells.Count < 1) return false; diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index fa21a6103..f4706e467 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -1,7 +1,4 @@ -using System; using System.Collections.Generic; -using Dalamud.Game.ClientState.JobGauge.Types; -using Dalamud.Game.ClientState.Statuses; using XIVSlothCombo.Combos.PvE.Content; using XIVSlothCombo.CustomComboNS; using XIVSlothCombo.CustomComboNS.Functions; @@ -51,6 +48,8 @@ public const uint HighThunder2 = 36987, FlareStar = 36989; + internal static BLMOpenerLogic BLMOpener = new(); + // Debuff Pairs of Actions and Debuff public static readonly Dictionary ThunderList = new() @@ -62,7 +61,7 @@ public static readonly Dictionary { HighThunder, Debuffs.HighThunder }, { HighThunder2, Debuffs.HighThunder2 } }; - + public static class Buffs { public const ushort @@ -112,23 +111,17 @@ public static class MP public static int FireIII => GetResourceCost(OriginalHook(Fire3)); - public static int BlizzardAoE => - GetResourceCost(OriginalHook(Blizzard2)); + public static int BlizzardAoE => GetResourceCost(OriginalHook(Blizzard2)); - public static int BlizzardI => - GetResourceCost(OriginalHook(Blizzard)); + public static int BlizzardI => GetResourceCost(OriginalHook(Blizzard)); public static int Freeze => GetResourceCost(OriginalHook(BLM.Freeze)); - public static int Despair => - GetResourceCost(OriginalHook(BLM.Despair)); + public static int Despair => GetResourceCost(OriginalHook(BLM.Despair)); } public static class Config { - public static UserBool - BLM_Adv_Xeno_Burst = new("BLM_Adv_Xeno_Burst"); - public static UserBoolArray BLM_Adv_Cooldowns_Choice = new("BLM_Adv_Cooldowns_Choice"), BLM_AoE_Adv_Cooldowns_Choice = new("BLM_AoE_Adv_Cooldowns_Choice"), @@ -137,9 +130,6 @@ public static UserBoolArray public static UserInt BLM_VariantCure = new("BLM_VariantCure"), BLM_Adv_Cooldowns = new("BLM_Adv_Cooldowns"), - BLM_Adv_Thunder = new("BLM_Adv_Thunder"), - BLM_Adv_Rotation_Options = new("BLM_Adv_Rotation_Options"), - BLM_Advanced_OpenerSelection = new("BLM_Advanced_OpenerSelection"), BLM_ST_Adv_ThunderHP = new("BLM_ST_Adv_ThunderHP"), BLM_AoE_Adv_ThunderHP = new("BLM_AoE_Adv_ThunderHP"), BLM_AoE_Adv_ThunderUptime = new("BLM_AoE_Adv_ThunderUptime"), @@ -152,29 +142,12 @@ public static UserFloat internal class BLM_ST_SimpleMode : CustomCombo { - internal static BLMOpenerLogic BLMOpener = new(); - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_SimpleMode; protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - if (actionID != Fire) return actionID; - - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : - TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - int maxPolyglotCD = maxPolyglot * 30000; - - int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - uint curMp = LocalPlayer.CurrentMp; - - Status? thunderDebuff = - FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); - - bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || - GetBuffStacks(Buffs.Triplecast) > 0; + if (actionID is not Fire) + return actionID; if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && @@ -191,7 +164,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return actionID; if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1) - if (thunderDebuff is null || thunderDebuff.RemainingTime < 3) + if (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3) return OriginalHook(Thunder); if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) @@ -272,15 +245,13 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Gauge.HasPolyglotStacks()) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; - if (BLMHelper.MPAfterCast() >= 7500 && (LocalPlayer.CastActionId == Blizzard || - WasLastSpell(Blizzard) || - WasLastSpell(Blizzard4))) - { - if (Fire3.LevelChecked()) - return Fire3; - - return Fire; - } + if (BLMHelper.MPAfterCast() >= 7500 && + (LocalPlayer.CastActionId == Blizzard || + WasLastSpell(Blizzard) || + WasLastSpell(Blizzard4))) + return Fire3.LevelChecked() + ? Fire3 + : Fire; if (BLMHelper.MPAfterCast() <= 10000 || curMp < 7500) return Blizzard; @@ -302,26 +273,12 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim internal class BLM_ST_AdvancedMode : CustomCombo { - internal static BLMOpenerLogic BLMOpener = new(); - protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_AdvancedMode; protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - if (actionID != Fire) return actionID; - - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : - TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - int maxPolyglotCD = maxPolyglot * 30000; - int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuff = - FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); - bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || - GetBuffStacks(Buffs.Triplecast) > 0; + if (actionID is not Fire) + return actionID; if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && @@ -338,13 +295,13 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (BLMOpener.DoFullOpener(ref actionID)) return actionID; - if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && - HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && - (thunderDebuff is null || thunderDebuff.RemainingTime < 3)) + if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && + HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && + (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) return OriginalHook(Thunder); - if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && - ActionReady(Amplifier) && + if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && + ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) return Amplifier; @@ -474,21 +431,8 @@ internal class BLM_AoE_SimpleMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; - - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : - TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - int maxPolyglotCD = maxPolyglot * 30000; - int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuff = - FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && - (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); - bool canWeave = CanSpellWeave(ActionWatching.LastSpell); + if (actionID is not (Blizzard2 or HighBlizzard2)) + return actionID; if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && @@ -498,14 +442,14 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_Variant_Rampart) && IsEnabled(Variant.VariantRampart) && IsOffCooldown(Variant.VariantRampart) && - canWeave) + CanSpellWeave(ActionWatching.LastSpell)) return Variant.VariantRampart; - if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && - thunderDebuff is null || thunderDebuff.RemainingTime < 3) + if ((HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && + thunderDebuffAoE is null) || thunderDebuffAoE.RemainingTime < 3) return OriginalHook(Thunder2); - if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && canWeave) + if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) return Amplifier; if (IsMoving) @@ -517,7 +461,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Foul; } - if (canWeave && ActionReady(LeyLines)) + if (CanSpellWeave(ActionWatching.LastSpell) && ActionReady(LeyLines)) return LeyLines; if (Gauge.InAstralFire) @@ -531,7 +475,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Flare.LevelChecked() && curMp >= MP.FlareAoE) { - if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) + if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && + CanSpellWeave(ActionWatching.LastSpell)) return Triplecast; return Flare; @@ -544,11 +489,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (ActionReady(Manafont)) return Manafont; - if (ActionReady(Transpose) && + if (ActionReady(Transpose) && (!TraitLevelChecked(Traits.AspectMasteryIII) || canSwiftF)) return Transpose; - if (ActionReady(Blizzard2) && + if (ActionReady(Blizzard2) && TraitLevelChecked(Traits.AspectMasteryIII)) return OriginalHook(Blizzard2); } @@ -559,7 +504,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && FlareStar.LevelChecked()) { - if (ActionReady(Transpose) && canWeave) + if (ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell)) return Transpose; return OriginalHook(Fire2); @@ -568,10 +513,12 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (ActionReady(OriginalHook(Blizzard2)) && Gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.AspectMasteryIII)) { - if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) + if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && + CanSpellWeave(ActionWatching.LastSpell)) return Triplecast; - if (GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && canWeave) + if (GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && + CanSpellWeave(ActionWatching.LastSpell)) return All.Swiftcast; if (HasEffect(All.Buffs.Swiftcast) || GetBuffStacks(Buffs.Triplecast) > 0) @@ -595,7 +542,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Freeze.LevelChecked() ? OriginalHook(Freeze) : OriginalHook(Blizzard2); if (ActionReady(Transpose) && - ((canWeave && Flare.LevelChecked()) || !TraitLevelChecked(Traits.AspectMasteryIII))) + ((CanSpellWeave(ActionWatching.LastSpell) && Flare.LevelChecked()) || + !TraitLevelChecked(Traits.AspectMasteryIII))) return Transpose; if (Fire2.LevelChecked() && TraitLevelChecked(Traits.AspectMasteryIII)) @@ -608,28 +556,15 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return actionID; } } - + internal class BLM_AoE_AdvancedMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_AoE_AdvancedMode; protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; - - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : - TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - int maxPolyglotCD = maxPolyglot * 30000; - int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuff = - FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && - (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); - bool canWeave = CanSpellWeave(ActionWatching.LastSpell); + if (actionID is not (Blizzard2 or HighBlizzard2)) + return actionID; if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && @@ -639,36 +574,36 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_Variant_Rampart) && IsEnabled(Variant.VariantRampart) && IsOffCooldown(Variant.VariantRampart) && - canWeave) + CanSpellWeave(ActionWatching.LastSpell)) return Variant.VariantRampart; - if (IsEnabled(CustomComboPreset.BLM_AoE_Thunder) && - HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && - thunderDebuff is null || thunderDebuff.RemainingTime < 3) + if ((IsEnabled(CustomComboPreset.BLM_AoE_Thunder) && + HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && + thunderDebuffAoE is null) || thunderDebuffAoE.RemainingTime < 3) return OriginalHook(Thunder2); - if (IsEnabled(CustomComboPreset.BLM_AoE_Amplifier) && - ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && canWeave) + if (IsEnabled(CustomComboPreset.BLM_AoE_Amplifier) && + ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) return Amplifier; if (IsMoving) { - if (IsEnabled(CustomComboPreset.BLM_AoE_Amplifier) && + if (IsEnabled(CustomComboPreset.BLM_AoE_Amplifier) && ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) return Amplifier; - if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglotMoving) && + if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglotMoving) && Gauge.HasPolyglotStacks()) return Foul; } - if (IsEnabled(CustomComboPreset.BLM_AoE_LeyLines) && - canWeave && ActionReady(LeyLines)) + if (IsEnabled(CustomComboPreset.BLM_AoE_LeyLines) && + CanSpellWeave(ActionWatching.LastSpell) && ActionReady(LeyLines)) return LeyLines; if (Gauge.InAstralFire) { - if (IsEnabled(CustomComboPreset.BLM_AoE_Flarestar) && + if (IsEnabled(CustomComboPreset.BLM_AoE_Flarestar) && curMp == 0 && FlareStar.LevelChecked() && Gauge.AstralSoulStacks == 6) return FlareStar; @@ -676,10 +611,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (Gauge.UmbralHearts > 1 || !TraitLevelChecked(Traits.UmbralHeart))) return OriginalHook(Fire2); - if (IsEnabled(CustomComboPreset.BLM_AoE_Flare) && + if (IsEnabled(CustomComboPreset.BLM_AoE_Flare) && Flare.LevelChecked() && curMp >= MP.FlareAoE) { - if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) + if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && + CanSpellWeave(ActionWatching.LastSpell)) return Triplecast; return Flare; @@ -689,11 +625,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (gcdsInTimer > 1 && curMp >= MP.FireAoE) return OriginalHook(Fire2); - if (IsEnabled(CustomComboPreset.BLM_AoE_Manafont) && + if (IsEnabled(CustomComboPreset.BLM_AoE_Manafont) && ActionReady(Manafont)) return Manafont; - if (IsEnabled(CustomComboPreset.BLM_AoE_Transpose) && + if (IsEnabled(CustomComboPreset.BLM_AoE_Transpose) && ActionReady(Transpose) && (!TraitLevelChecked(Traits.AspectMasteryIII) || canSwiftF)) return Transpose; @@ -707,8 +643,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && FlareStar.LevelChecked()) { - if (IsEnabled(CustomComboPreset.BLM_AoE_Transpose) && - ActionReady(Transpose) && canWeave) + if (IsEnabled(CustomComboPreset.BLM_AoE_Transpose) && + ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell)) return Transpose; return OriginalHook(Fire2); @@ -717,12 +653,14 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (ActionReady(OriginalHook(Blizzard2)) && Gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.AspectMasteryIII)) { - if (IsEnabled(CustomComboPreset.BLM_AoE_Triplecast) && - ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && canWeave) + if (IsEnabled(CustomComboPreset.BLM_AoE_Triplecast) && + ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && + CanSpellWeave(ActionWatching.LastSpell)) return Triplecast; - if (IsEnabled(CustomComboPreset.BLM_AoE_Swiftcast) && - GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && canWeave) + if (IsEnabled(CustomComboPreset.BLM_AoE_Swiftcast) && + GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && + CanSpellWeave(ActionWatching.LastSpell)) return All.Swiftcast; if (HasEffect(All.Buffs.Swiftcast) || GetBuffStacks(Buffs.Triplecast) > 0) @@ -735,7 +673,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Freeze.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Freeze; - if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglot) && + if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglot) && Gauge.HasPolyglotStacks()) return Foul; @@ -744,13 +682,14 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Fire2); if (curMp < LocalPlayer.MaxMp) - return Freeze.LevelChecked() - ? OriginalHook(Freeze) + return Freeze.LevelChecked() + ? OriginalHook(Freeze) : OriginalHook(Blizzard2); - if (IsEnabled(CustomComboPreset.BLM_AoE_Transpose) && + if (IsEnabled(CustomComboPreset.BLM_AoE_Transpose) && ActionReady(Transpose) && - ((canWeave && Flare.LevelChecked()) || !TraitLevelChecked(Traits.AspectMasteryIII))) + ((CanSpellWeave(ActionWatching.LastSpell) && Flare.LevelChecked()) || + !TraitLevelChecked(Traits.AspectMasteryIII))) return Transpose; if (Fire2.LevelChecked() && TraitLevelChecked(Traits.AspectMasteryIII)) @@ -782,7 +721,7 @@ internal class BLM_Scathe_Xeno : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - return actionID is Scathe && LevelChecked(Xenoglossy) && GetJobGauge().HasPolyglotStacks() + return actionID is Scathe && LevelChecked(Xenoglossy) && Gauge.HasPolyglotStacks() ? Xenoglossy : actionID; } @@ -794,7 +733,7 @@ internal class BLM_Blizzard_1to3 : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - if (actionID is Blizzard && LevelChecked(Freeze) && !GetJobGauge().InUmbralIce) + if (actionID is Blizzard && LevelChecked(Freeze) && !Gauge.InUmbralIce) return Blizzard3; if (actionID is Freeze && !LevelChecked(Freeze)) @@ -810,8 +749,9 @@ internal class BLM_Fire_1to3 : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - return actionID is Fire && ((LevelChecked(Fire3) && !GetJobGauge().InAstralFire) || - HasEffect(Buffs.Firestarter)) + return actionID is Fire && + ((LevelChecked(Fire3) && !Gauge.InAstralFire) || + HasEffect(Buffs.Firestarter)) ? Fire3 : actionID; } @@ -851,7 +791,7 @@ internal class BLM_UmbralSoul : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - return actionID is Transpose && GetJobGauge().InUmbralIce && LevelChecked(UmbralSoul) + return actionID is Transpose && Gauge.InUmbralIce && LevelChecked(UmbralSoul) ? UmbralSoul : actionID; } From 2cd67ee806d2608327975318acb3465855bda261 Mon Sep 17 00:00:00 2001 From: Kage Date: Mon, 28 Oct 2024 17:02:22 +0100 Subject: [PATCH 13/46] revert last change - broke something --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 18 -------- XIVSlothCombo/Combos/PvE/BLM.cs | 58 ++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 25 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index f3b3de246..ab234a89a 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -15,24 +15,6 @@ namespace XIVSlothCombo.Combos.JobHelpers; internal static class BLM { // BLM Gauge & Extensions - public static uint curMp = LocalPlayer.CurrentMp; - - public static int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - - public static int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - - public static Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - - public static Status? thunderDebuffAoE = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - - public static float elementTimer = Gauge.ElementTimeRemaining / 1000f; - - public static double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - - public static bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0; - - public static bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); - public static int Fire4Count => ActionWatching.CombatActions.Count(x => x == Fire4); public static BLMGauge Gauge => GetJobGauge(); diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index f4706e467..370d208e8 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -1,4 +1,6 @@ +using System; using System.Collections.Generic; +using Dalamud.Game.ClientState.Statuses; using XIVSlothCombo.Combos.PvE.Content; using XIVSlothCombo.CustomComboNS; using XIVSlothCombo.CustomComboNS.Functions; @@ -48,7 +50,7 @@ public const uint HighThunder2 = 36987, FlareStar = 36989; - internal static BLMOpenerLogic BLMOpener = new(); + // Debuff Pairs of Actions and Debuff public static readonly Dictionary @@ -62,6 +64,8 @@ public static readonly Dictionary { HighThunder2, Debuffs.HighThunder2 } }; + + public static class Buffs { public const ushort @@ -143,12 +147,22 @@ public static UserFloat internal class BLM_ST_SimpleMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_SimpleMode; - + internal static BLMOpenerLogic BLMOpener = new(); + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { + uint curMp = LocalPlayer.CurrentMp; + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + float elementTimer = Gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || + GetBuffStacks(Buffs.Triplecast) > 0; + if (actionID is not Fire) return actionID; - + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && PlayerHealthPercentageHp() <= Config.BLM_VariantCure) @@ -274,10 +288,19 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim internal class BLM_ST_AdvancedMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_AdvancedMode; - + internal static BLMOpenerLogic BLMOpener = new(); protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - if (actionID is not Fire) + uint curMp = LocalPlayer.CurrentMp; + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + float elementTimer = Gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || + GetBuffStacks(Buffs.Triplecast) > 0; + + if (actionID is not Fire) return actionID; if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && @@ -431,9 +454,19 @@ internal class BLM_AoE_SimpleMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { + uint curMp = LocalPlayer.CurrentMp; + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + Status? thunderDebuffAoE = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + float elementTimer = Gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && + (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || + GetBuffStacks(Buffs.Triplecast) > 0); + if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; - + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && PlayerHealthPercentageHp() <= Config.BLM_VariantCure) @@ -563,9 +596,20 @@ internal class BLM_AoE_AdvancedMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { + uint curMp = LocalPlayer.CurrentMp; + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + Status? thunderDebuffAoE = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + float elementTimer = Gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + + bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && + (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || + GetBuffStacks(Buffs.Triplecast) > 0); + if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; - + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && PlayerHealthPercentageHp() <= Config.BLM_VariantCure) From 8050142fc227b03af49c9951656d45fc0899beda Mon Sep 17 00:00:00 2001 From: Kage Date: Mon, 28 Oct 2024 17:17:19 +0100 Subject: [PATCH 14/46] revert cleanup commit --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 1 - XIVSlothCombo/Combos/PvE/BLM.cs | 28 +++++++++++++------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index ab234a89a..d8c33ec98 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -2,7 +2,6 @@ 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; diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 370d208e8..588fea216 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -151,12 +151,12 @@ internal class BLM_ST_SimpleMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - uint curMp = LocalPlayer.CurrentMp; int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + uint curMp = LocalPlayer.CurrentMp; Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0; @@ -289,20 +289,21 @@ internal class BLM_ST_AdvancedMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_AdvancedMode; internal static BLMOpenerLogic BLMOpener = new(); + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - uint curMp = LocalPlayer.CurrentMp; int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + uint curMp = LocalPlayer.CurrentMp; Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0; - - if (actionID is not Fire) + + if (actionID is not Fire) return actionID; - + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && PlayerHealthPercentageHp() <= Config.BLM_VariantCure) @@ -454,17 +455,17 @@ internal class BLM_AoE_SimpleMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - uint curMp = LocalPlayer.CurrentMp; int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + uint curMp = LocalPlayer.CurrentMp; Status? thunderDebuffAoE = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); - - if (actionID is not (Blizzard2 or HighBlizzard2)) + + if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && @@ -596,18 +597,17 @@ internal class BLM_AoE_AdvancedMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - uint curMp = LocalPlayer.CurrentMp; int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + uint curMp = LocalPlayer.CurrentMp; Status? thunderDebuffAoE = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); - - if (actionID is not (Blizzard2 or HighBlizzard2)) + + if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && From a5137651df295d4659e9733cfad2648ff0ab8bbb Mon Sep 17 00:00:00 2001 From: Kage Date: Mon, 28 Oct 2024 17:30:24 +0100 Subject: [PATCH 15/46] revert blmhelper - need to do math --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 11 +++++------ XIVSlothCombo/Combos/PvE/BLM.cs | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index d8c33ec98..b33bbbe0c 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -233,9 +233,7 @@ internal class BLMHelper public static float MPAfterCast() { uint castedSpell = LocalPlayer.CastActionId; - BLMGauge gauge = Svc.Gauges.Get(); - - int nextMpGain = gauge.UmbralIceStacks switch + int nextMpGain = Gauge.UmbralIceStacks switch { 0 => 0, 1 => 2500, @@ -244,9 +242,10 @@ public static float MPAfterCast() _ => 0 }; - return castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2 - ? Math.Max(LocalPlayer.MaxMp, LocalPlayer.CurrentMp + nextMpGain) - : Math.Max(0, LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); + if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) + return Math.Max(LocalPlayer.MaxMp, LocalPlayer.CurrentMp + nextMpGain); + + return Math.Max(0, LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); } public static bool DoubleBlizz() diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 588fea216..61d50ed12 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -50,7 +50,14 @@ public const uint HighThunder2 = 36987, FlareStar = 36989; - + internal static int nextMpGain => Gauge.UmbralIceStacks switch + { + 0 => 0, + 1 => 2500, + 2 => 5000, + 3 => 10000, + _ => 0 + }; // Debuff Pairs of Actions and Debuff public static readonly Dictionary @@ -259,7 +266,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Gauge.HasPolyglotStacks()) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; - if (BLMHelper.MPAfterCast() >= 7500 && + if (curMp + nextMpGain >= 7500 && (LocalPlayer.CastActionId == Blizzard || WasLastSpell(Blizzard) || WasLastSpell(Blizzard4))) @@ -267,7 +274,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim ? Fire3 : Fire; - if (BLMHelper.MPAfterCast() <= 10000 || curMp < 7500) + if (curMp + nextMpGain <= 10000 || curMp < 7500) return Blizzard; if (ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell) && @@ -422,7 +429,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim ? Xenoglossy : Foul; - if (BLMHelper.MPAfterCast() >= 7500 && + if (curMp + nextMpGain >= 7500 && (LocalPlayer.CastActionId == Blizzard || WasLastSpell(Blizzard) || WasLastSpell(Blizzard4))) @@ -430,7 +437,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim ? Fire3 : Fire; - if (BLMHelper.MPAfterCast() <= 10000 || curMp < 7500) + if (curMp + nextMpGain <= 10000 || curMp < 7500) return Blizzard; if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && From 25638ad124abf553835d6d0d48d1ff10137b5451 Mon Sep 17 00:00:00 2001 From: Kage Date: Mon, 28 Oct 2024 17:43:35 +0100 Subject: [PATCH 16/46] move gauge to non helper --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 2 +- XIVSlothCombo/Combos/PvE/BLM.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index b33bbbe0c..e97af3c07 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -16,7 +16,7 @@ internal static class BLM // BLM Gauge & Extensions public static int Fire4Count => ActionWatching.CombatActions.Count(x => x == Fire4); - public static BLMGauge Gauge => GetJobGauge(); + public static bool HasPolyglotStacks(this BLMGauge gauge) => gauge.PolyglotStacks > 0; diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 61d50ed12..6a8186feb 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Dalamud.Game.ClientState.JobGauge.Types; using Dalamud.Game.ClientState.Statuses; using XIVSlothCombo.Combos.PvE.Content; using XIVSlothCombo.CustomComboNS; @@ -50,7 +51,9 @@ public const uint HighThunder2 = 36987, FlareStar = 36989; - internal static int nextMpGain => Gauge.UmbralIceStacks switch + public static BLMGauge Gauge = GetJobGauge(); + + public static int nextMpGain => Gauge.UmbralIceStacks switch { 0 => 0, 1 => 2500, From 13caf03b740ba72327423a7d53b68b8fc800dae0 Mon Sep 17 00:00:00 2001 From: Kage Date: Mon, 28 Oct 2024 18:01:41 +0100 Subject: [PATCH 17/46] wondering why transpose fails --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 4 +--- XIVSlothCombo/Combos/PvE/BLM.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index e97af3c07..61e9ec9be 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -250,9 +250,7 @@ public static float MPAfterCast() public static bool DoubleBlizz() { - List spells = ActionWatching.CombatActions.Where(x => - ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && - x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)).ToList(); + List spells = ActionWatching.CombatActions.Where(x => ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)).ToList(); if (spells.Count < 1) return false; diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 6a8186feb..85d247972 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -53,7 +53,7 @@ public const uint public static BLMGauge Gauge = GetJobGauge(); - public static int nextMpGain => Gauge.UmbralIceStacks switch + protected static int nextMpGain => Gauge.UmbralIceStacks switch { 0 => 0, 1 => 2500, From 9c5ec33ccbd3448e6749486f0d4b4267730fdafe Mon Sep 17 00:00:00 2001 From: Kage Date: Tue, 29 Oct 2024 09:19:21 +0100 Subject: [PATCH 18/46] firestarter update transpose update --- XIVSlothCombo/Combos/PvE/BLM.cs | 49 +++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 85d247972..952c221ce 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -52,6 +52,7 @@ public const uint FlareStar = 36989; public static BLMGauge Gauge = GetJobGauge(); + internal static BLMOpenerLogic BLMOpener = new(); protected static int nextMpGain => Gauge.UmbralIceStacks switch { @@ -157,7 +158,6 @@ public static UserFloat internal class BLM_ST_SimpleMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_SimpleMode; - internal static BLMOpenerLogic BLMOpener = new(); protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { @@ -167,8 +167,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); - bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || - GetBuffStacks(Buffs.Triplecast) > 0; + bool canSwiftB3 = IsOffCooldown(All.Swiftcast); if (actionID is not Fire) return actionID; @@ -183,19 +182,22 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim IsOffCooldown(Variant.VariantRampart) && CanSpellWeave(actionID)) return Variant.VariantRampart; - + if (BLMOpener.DoFullOpener(ref actionID)) - return actionID; + return actionID; - if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1) - if (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3) - return OriginalHook(Thunder); + if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && + (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) + return OriginalHook(Thunder); - if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) + if (ActionReady(Amplifier) && + remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) return Amplifier; if (remainingPolyglotCD < 6000 && gcdsInTimer > 2 && Gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; + return Xenoglossy.LevelChecked() + ? Xenoglossy + : Foul; if (IsMoving) { @@ -203,7 +205,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Amplifier; if (Gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; + return Xenoglossy.LevelChecked() + ? Xenoglossy + : Foul; } if (CanSpellWeave(actionID) && ActionReady(LeyLines)) @@ -214,9 +218,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) return Paradox; - if (HasEffect(Buffs.Firestarter) && curMp > 0 && - (gcdsInTimer < 2 || curMp < MP.FireI || WasLastAbility(Transpose))) - return Fire3; + if ((HasEffect(Buffs.Firestarter) && gcdsInTimer < 2 && + curMp >= MP.Despair) || (HasEffect(Buffs.Firestarter) && Gauge.AstralFireStacks < 3)) + return Fire3; if (curMp < MP.FireI && Despair.LevelChecked() && curMp >= MP.Despair) { @@ -267,7 +271,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Paradox; if (Gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; + return Xenoglossy.LevelChecked() + ? Xenoglossy + : Foul; if (curMp + nextMpGain >= 7500 && (LocalPlayer.CastActionId == Blizzard || @@ -295,10 +301,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim } } + internal class BLM_ST_AdvancedMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_AdvancedMode; - internal static BLMOpenerLogic BLMOpener = new(); + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { @@ -308,8 +315,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); - bool canSwiftB3 = IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || - GetBuffStacks(Buffs.Triplecast) > 0; + bool canSwiftB3 = IsOffCooldown(All.Swiftcast); if (actionID is not Fire) return actionID; @@ -367,9 +373,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) return Paradox; - if (HasEffect(Buffs.Firestarter) && curMp > 0 && - (gcdsInTimer < 2 || curMp < MP.FireI || WasLastAbility(Transpose))) - return Fire3; + if ((HasEffect(Buffs.Firestarter) && gcdsInTimer < 2 && + curMp >= MP.Despair) || (HasEffect(Buffs.Firestarter) && Gauge.AstralFireStacks < 3)) + return Fire3; if (IsEnabled(CustomComboPreset.BLM_ST_Despair) && curMp < MP.FireI && Despair.LevelChecked() && curMp >= MP.Despair) @@ -400,6 +406,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Blizzard3; if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && + IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && ActionReady(Transpose)) return Transpose; } From 5f9215f7e24d2ea0ec5f6060ea4a1d8a179d9d26 Mon Sep 17 00:00:00 2001 From: Kage Date: Tue, 29 Oct 2024 15:26:51 +0100 Subject: [PATCH 19/46] manafont firestarter fix tweaked firestarter proc --- XIVSlothCombo/Combos/PvE/BLM.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 952c221ce..2aa9cb510 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -219,7 +219,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Paradox; if ((HasEffect(Buffs.Firestarter) && gcdsInTimer < 2 && - curMp >= MP.Despair) || (HasEffect(Buffs.Firestarter) && Gauge.AstralFireStacks < 3)) + curMp >= MP.FireI) || (HasEffect(Buffs.Firestarter) && Gauge.AstralFireStacks < 3)) return Fire3; if (curMp < MP.FireI && Despair.LevelChecked() && curMp >= MP.Despair) @@ -241,7 +241,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Fire; if (ActionReady(Manafont)) - return Manafont; + return HasEffect(Buffs.Firestarter) + ? Fire3 + : Manafont; if (ActionReady(Blizzard3) && !canSwiftB3) return Blizzard3; @@ -374,7 +376,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Paradox; if ((HasEffect(Buffs.Firestarter) && gcdsInTimer < 2 && - curMp >= MP.Despair) || (HasEffect(Buffs.Firestarter) && Gauge.AstralFireStacks < 3)) + curMp >= MP.FireI) || (HasEffect(Buffs.Firestarter) && Gauge.AstralFireStacks < 3)) return Fire3; if (IsEnabled(CustomComboPreset.BLM_ST_Despair) && @@ -400,7 +402,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_Manafont) && ActionReady(Manafont)) - return Manafont; + return HasEffect(Buffs.Firestarter) + ? Fire3 + : Manafont; if (ActionReady(Blizzard3) && !canSwiftB3) return Blizzard3; From 0c0f487dba3e01d7a2a7ed924d757a6b599b174d Mon Sep 17 00:00:00 2001 From: Kage Date: Wed, 30 Oct 2024 13:07:05 +0100 Subject: [PATCH 20/46] update transpose weaves cleanup --- XIVSlothCombo/Combos/PvE/BLM.cs | 266 +++++++++++++++++++------------- 1 file changed, 159 insertions(+), 107 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 2aa9cb510..9e8766cfd 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -53,15 +53,6 @@ public const uint public static BLMGauge Gauge = GetJobGauge(); internal static BLMOpenerLogic BLMOpener = new(); - - protected static int nextMpGain => Gauge.UmbralIceStacks switch - { - 0 => 0, - 1 => 2500, - 2 => 5000, - 3 => 10000, - _ => 0 - }; // Debuff Pairs of Actions and Debuff public static readonly Dictionary @@ -75,8 +66,15 @@ public static readonly Dictionary { HighThunder2, Debuffs.HighThunder2 } }; - - + protected static int nextMpGain => Gauge.UmbralIceStacks switch + { + 0 => 0, + 1 => 2500, + 2 => 5000, + 3 => 10000, + _ => 0 + }; + public static class Buffs { public const ushort @@ -158,20 +156,25 @@ public static UserFloat internal class BLM_ST_SimpleMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_SimpleMode; - + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : + TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + bool canWeave = CanSpellWeave(ActionWatching.LastSpell); + + int remainingPolyglotCD = Math.Max(0, + (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + + Status? thunderDebuffST = + FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); - bool canSwiftB3 = IsOffCooldown(All.Swiftcast); - - if (actionID is not Fire) + + if (actionID is not Fire) return actionID; - + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && PlayerHealthPercentageHp() <= Config.BLM_VariantCure) @@ -179,40 +182,44 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_Variant_Rampart) && IsEnabled(Variant.VariantRampart) && - IsOffCooldown(Variant.VariantRampart) && - CanSpellWeave(actionID)) + IsOffCooldown(Variant.VariantRampart) && canWeave) return Variant.VariantRampart; - - if (BLMOpener.DoFullOpener(ref actionID)) + + if (IsEnabled(CustomComboPreset.BLM_ST_Opener)) + if (BLMOpener.DoFullOpener(ref actionID)) return actionID; - if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && - (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) - return OriginalHook(Thunder); + //Weaves + if (canWeave) + { + if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && + ActionReady(Amplifier) && + remainingPolyglotCD >= 20000) + return Amplifier; - if (ActionReady(Amplifier) && - remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) - return Amplifier; + if (IsEnabled(CustomComboPreset.BLM_ST_LeyLines) && + ActionReady(LeyLines)) + return LeyLines; + } - if (remainingPolyglotCD < 6000 && gcdsInTimer > 2 && Gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() - ? Xenoglossy - : Foul; + if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && + HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && + (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) + return OriginalHook(Thunder); if (IsMoving) { - if (ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) + if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && + ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) return Amplifier; - if (Gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() + if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglotMoving) && + Gauge.HasPolyglotStacks()) + return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; } - if (CanSpellWeave(actionID) && ActionReady(LeyLines)) - return LeyLines; - if (Gauge.InAstralFire) { if (Gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) @@ -220,36 +227,54 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if ((HasEffect(Buffs.Firestarter) && gcdsInTimer < 2 && curMp >= MP.FireI) || (HasEffect(Buffs.Firestarter) && Gauge.AstralFireStacks < 3)) - return Fire3; + return Fire3; - if (curMp < MP.FireI && Despair.LevelChecked() && curMp >= MP.Despair) + if (IsEnabled(CustomComboPreset.BLM_ST_Despair) && + curMp < MP.FireI && LevelChecked(Despair) && curMp >= MP.Despair) { - if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) + if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && + ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) return Triplecast; return Despair; } - if (curMp == 0 && FlareStar.LevelChecked() && Gauge.AstralSoulStacks == 6) + if (curMp == 0 && LevelChecked(FlareStar) && Gauge.AstralSoulStacks == 6) return FlareStar; - if (Fire4.LevelChecked()) + if (LevelChecked(Fire4)) if (gcdsInTimer > 1 && curMp >= MP.FireI) return Fire4; if (curMp >= MP.FireI) return Fire; - if (ActionReady(Manafont)) + if (IsEnabled(CustomComboPreset.BLM_ST_Manafont) && + ActionReady(Manafont)) return HasEffect(Buffs.Firestarter) ? Fire3 : Manafont; - if (ActionReady(Blizzard3) && !canSwiftB3) - return Blizzard3; + if (ActionReady(Blizzard3) && + (ActionReady(All.Swiftcast) || + HasEffect(Buffs.Triplecast))) + { + if (canWeave && + ActionReady(Transpose)) + return Transpose; - if (ActionReady(Transpose)) - return Transpose; + if (HasEffect(Buffs.Thunderhead) && + (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) + return OriginalHook(Thunder); + + if (Gauge.HasPolyglotStacks()) + return LevelChecked(Xenoglossy) + ? Xenoglossy + : Foul; + } + + if (ActionReady(Blizzard3)) + return Blizzard3; } if (Gauge.InUmbralIce) @@ -266,14 +291,14 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Blizzard3; } - if (Blizzard4.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + if (LevelChecked(Blizzard4) && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Blizzard4; if (Gauge.IsParadoxActive) return Paradox; if (Gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() + return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; @@ -281,47 +306,50 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (LocalPlayer.CastActionId == Blizzard || WasLastSpell(Blizzard) || WasLastSpell(Blizzard4))) - return Fire3.LevelChecked() + return LevelChecked(Fire3) ? Fire3 : Fire; if (curMp + nextMpGain <= 10000 || curMp < 7500) return Blizzard; - if (ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell) && + if (ActionReady(Transpose) && canWeave && curMp is MP.MaxMP && HasEffect(Buffs.Firestarter)) return Transpose; - if (Fire3.LevelChecked()) + if (LevelChecked(Fire3)) return Fire3; } - if (Blizzard3.LevelChecked()) + if (LevelChecked(Blizzard3)) return Blizzard3; return actionID; } } - internal class BLM_ST_AdvancedMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_ST_AdvancedMode; - protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : + TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + bool canWeave = CanSpellWeave(ActionWatching.LastSpell); + + int remainingPolyglotCD = Math.Max(0, + (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + + Status? thunderDebuffST = + FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); - bool canSwiftB3 = IsOffCooldown(All.Swiftcast); - - if (actionID is not Fire) + + if (actionID is not Fire) return actionID; - + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && PlayerHealthPercentageHp() <= Config.BLM_VariantCure) @@ -330,29 +358,30 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_Variant_Rampart) && IsEnabled(Variant.VariantRampart) && IsOffCooldown(Variant.VariantRampart) && - CanSpellWeave(actionID)) + canWeave) return Variant.VariantRampart; if (IsEnabled(CustomComboPreset.BLM_ST_Opener)) if (BLMOpener.DoFullOpener(ref actionID)) return actionID; + //Weaves + if (canWeave) + { + if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && + ActionReady(Amplifier) && remainingPolyglotCD >= 20000) + return Amplifier; + + if (IsEnabled(CustomComboPreset.BLM_ST_LeyLines) && + ActionReady(LeyLines)) + return LeyLines; + } + if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) return OriginalHook(Thunder); - if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && - ActionReady(Amplifier) && - remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) - return Amplifier; - - if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && - remainingPolyglotCD < 6000 && gcdsInTimer > 2 && Gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() - ? Xenoglossy - : Foul; - if (IsMoving) { if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && @@ -361,15 +390,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglotMoving) && Gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() + return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; } - if (IsEnabled(CustomComboPreset.BLM_ST_LeyLines) && - CanSpellWeave(actionID) && ActionReady(LeyLines)) - return LeyLines; - if (Gauge.InAstralFire) { if (Gauge.IsParadoxActive && gcdsInTimer < 2 && curMp >= MP.FireI) @@ -377,10 +402,10 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if ((HasEffect(Buffs.Firestarter) && gcdsInTimer < 2 && curMp >= MP.FireI) || (HasEffect(Buffs.Firestarter) && Gauge.AstralFireStacks < 3)) - return Fire3; + return Fire3; if (IsEnabled(CustomComboPreset.BLM_ST_Despair) && - curMp < MP.FireI && Despair.LevelChecked() && curMp >= MP.Despair) + curMp < MP.FireI && LevelChecked(Despair) && curMp >= MP.Despair) { if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) @@ -390,10 +415,10 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim } if (IsEnabled(CustomComboPreset.BLM_ST_Flarestar) && - curMp == 0 && FlareStar.LevelChecked() && Gauge.AstralSoulStacks == 6) + curMp == 0 && LevelChecked(FlareStar) && Gauge.AstralSoulStacks == 6) return FlareStar; - if (Fire4.LevelChecked()) + if (LevelChecked(Fire4)) if (gcdsInTimer > 1 && curMp >= MP.FireI) return Fire4; @@ -406,13 +431,28 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim ? Fire3 : Manafont; - if (ActionReady(Blizzard3) && !canSwiftB3) - return Blizzard3; + if (ActionReady(Blizzard3) && + ((IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && ActionReady(All.Swiftcast)) || + HasEffect(Buffs.Triplecast))) + { + if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && + canWeave && ActionReady(Transpose)) + return Transpose; - if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && - IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && - ActionReady(Transpose)) - return Transpose; + if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && + HasEffect(Buffs.Thunderhead) && + (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) + return OriginalHook(Thunder); + + if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && + Gauge.HasPolyglotStacks()) + return LevelChecked(Xenoglossy) + ? Xenoglossy + : Foul; + } + + if (ActionReady(Blizzard3)) + return Blizzard3; } if (Gauge.InUmbralIce) @@ -431,7 +471,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Blizzard3; } - if (Blizzard4.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + if (LevelChecked(Blizzard4) && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Blizzard4; if (Gauge.IsParadoxActive) @@ -439,7 +479,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && Gauge.HasPolyglotStacks()) - return Xenoglossy.LevelChecked() + return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; @@ -447,7 +487,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (LocalPlayer.CastActionId == Blizzard || WasLastSpell(Blizzard) || WasLastSpell(Blizzard4))) - return Fire3.LevelChecked() + return LevelChecked(Fire3) ? Fire3 : Fire; @@ -455,15 +495,15 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Blizzard; if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && - ActionReady(Transpose) && CanSpellWeave(ActionWatching.LastSpell) && + ActionReady(Transpose) && canWeave && curMp is MP.MaxMP && HasEffect(Buffs.Firestarter)) return Transpose; - if (Fire3.LevelChecked()) + if (LevelChecked(Fire3)) return Fire3; } - if (Blizzard3.LevelChecked()) + if (LevelChecked(Blizzard3)) return Blizzard3; return actionID; @@ -476,19 +516,25 @@ internal class BLM_AoE_SimpleMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : + TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + + int remainingPolyglotCD = Math.Max(0, + (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuffAoE = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + + Status? thunderDebuffAoE = + FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); - - if (actionID is not (Blizzard2 or HighBlizzard2)) + + if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; - + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && PlayerHealthPercentageHp() <= Config.BLM_VariantCure) @@ -618,19 +664,25 @@ internal class BLM_AoE_AdvancedMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : + TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + + int remainingPolyglotCD = Math.Max(0, + (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuffAoE = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + + Status? thunderDebuffAoE = + FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || GetBuffStacks(Buffs.Triplecast) > 0); if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; - + if (IsEnabled(CustomComboPreset.BLM_Variant_Cure) && IsEnabled(Variant.VariantCure) && PlayerHealthPercentageHp() <= Config.BLM_VariantCure) From 34107ae7f08d57bedd27fd8b5cd8da83923e0aee Mon Sep 17 00:00:00 2001 From: Kage Date: Wed, 30 Oct 2024 15:02:27 +0100 Subject: [PATCH 21/46] despair update --- XIVSlothCombo/Combos/PvE/BLM.cs | 71 ++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 9e8766cfd..4d8b76aee 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -185,15 +185,13 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim IsOffCooldown(Variant.VariantRampart) && canWeave) return Variant.VariantRampart; - if (IsEnabled(CustomComboPreset.BLM_ST_Opener)) - if (BLMOpener.DoFullOpener(ref actionID)) - return actionID; + if (BLMOpener.DoFullOpener(ref actionID)) + return actionID; //Weaves if (canWeave) { - if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && - ActionReady(Amplifier) && + if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000) return Amplifier; @@ -202,19 +200,16 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return LeyLines; } - if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && - HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && + if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) return OriginalHook(Thunder); if (IsMoving) { - if (IsEnabled(CustomComboPreset.BLM_ST_Amplifier) && - ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) + if (ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) return Amplifier; - if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglotMoving) && - Gauge.HasPolyglotStacks()) + if (Gauge.HasPolyglotStacks()) return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; @@ -229,13 +224,29 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim curMp >= MP.FireI) || (HasEffect(Buffs.Firestarter) && Gauge.AstralFireStacks < 3)) return Fire3; - if (IsEnabled(CustomComboPreset.BLM_ST_Despair) && - curMp < MP.FireI && LevelChecked(Despair) && curMp >= MP.Despair) + if (curMp < MP.FireI && LevelChecked(Despair) && curMp >= MP.Despair) { - if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && - ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) + if (canWeave && ActionReady(All.Swiftcast)) + return All.Swiftcast; + + if (canWeave && ActionReady(Triplecast) && + GetBuffStacks(Buffs.Triplecast) == 0 && + GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)) return Triplecast; + if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && + (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) + return OriginalHook(Thunder); + + if (Gauge.HasPolyglotStacks() && gcdsInTimer >= 1 && + (ActionReady(All.Swiftcast) || + (ActionReady(Triplecast) && + GetBuffStacks(Buffs.Triplecast) == 0 && + GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)))) + return Xenoglossy.LevelChecked() + ? Xenoglossy + : Foul; + return Despair; } @@ -291,7 +302,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Blizzard3; } - if (LevelChecked(Blizzard4) && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) + if (LevelChecked(Blizzard4) && + Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Blizzard4; if (Gauge.IsParadoxActive) @@ -407,10 +419,33 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_Despair) && curMp < MP.FireI && LevelChecked(Despair) && curMp >= MP.Despair) { + if (IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && + canWeave && ActionReady(All.Swiftcast)) + return All.Swiftcast; + if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && - ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) + canWeave && ActionReady(Triplecast) && + GetBuffStacks(Buffs.Triplecast) == 0 && + GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)) return Triplecast; + if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && + HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && + (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) + return OriginalHook(Thunder); + + if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && + (IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) || + IsEnabled(CustomComboPreset.BLM_ST_Triplecast)) && + Gauge.HasPolyglotStacks() && gcdsInTimer >= 1 && + (ActionReady(All.Swiftcast) || + (ActionReady(Triplecast) && + GetBuffStacks(Buffs.Triplecast) == 0 && + GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)))) + return Xenoglossy.LevelChecked() + ? Xenoglossy + : Foul; + return Despair; } @@ -435,7 +470,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim ((IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && ActionReady(All.Swiftcast)) || HasEffect(Buffs.Triplecast))) { - if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && + if (IsEnabled(CustomComboPreset.BLM_ST_Transpose) && canWeave && ActionReady(Transpose)) return Transpose; From e02ad7a0788a61069acd48c237a15831bfba37aa Mon Sep 17 00:00:00 2001 From: Kage Date: Thu, 31 Oct 2024 10:09:40 +0100 Subject: [PATCH 22/46] - update triple/swiftcast logic - update umbral ice issue - fix aoe stuck on b2 + no foul usage --- XIVSlothCombo/Combos/PvE/BLM.cs | 64 ++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 4d8b76aee..2dfa0ffa7 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -419,16 +419,17 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_Despair) && curMp < MP.FireI && LevelChecked(Despair) && curMp >= MP.Despair) { - if (IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && - canWeave && ActionReady(All.Swiftcast)) - return All.Swiftcast; - if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && canWeave && ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)) return Triplecast; + if (IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && + canWeave && ActionReady(All.Swiftcast) && + GetBuffStacks(Buffs.Triplecast) == 0) + return All.Swiftcast; + if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) @@ -494,16 +495,16 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim { if (ActionReady(Blizzard3) && Gauge.UmbralIceStacks < 3 && TraitLevelChecked(Traits.UmbralHeart)) { - if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && - ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) - return Triplecast; + if (HasEffect(All.Buffs.Swiftcast) || HasEffect(Buffs.Triplecast)) + return Blizzard3; if (IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast)) return All.Swiftcast; - if (HasEffect(All.Buffs.Swiftcast) || GetBuffStacks(Buffs.Triplecast) > 0) - return Blizzard3; + if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && + ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) + return Triplecast; } if (LevelChecked(Blizzard4) && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) @@ -564,8 +565,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && - (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || - GetBuffStacks(Buffs.Triplecast) > 0); + IsOffCooldown(All.Swiftcast); if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; @@ -581,8 +581,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim CanSpellWeave(ActionWatching.LastSpell)) return Variant.VariantRampart; + if (WasLastSpell(UmbralSoul)) + return OriginalHook(Fire2); + if ((HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && - thunderDebuffAoE is null) || thunderDebuffAoE.RemainingTime < 3) + thunderDebuffAoE is null) || thunderDebuffAoE.RemainingTime < 3) return OriginalHook(Thunder2); if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) @@ -625,17 +628,18 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (ActionReady(Manafont)) return Manafont; - if (ActionReady(Transpose) && - (!TraitLevelChecked(Traits.AspectMasteryIII) || canSwiftF)) + if (ActionReady(Transpose) && (!TraitLevelChecked(Traits.AspectMasteryIII) || canSwiftF)) return Transpose; - if (ActionReady(Blizzard2) && - TraitLevelChecked(Traits.AspectMasteryIII)) + if (ActionReady(Blizzard2) && TraitLevelChecked(Traits.AspectMasteryIII)) return OriginalHook(Blizzard2); } if (Gauge.InUmbralIce) { + if (Gauge.HasPolyglotStacks()) + return Foul; + if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && FlareStar.LevelChecked()) @@ -653,7 +657,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim CanSpellWeave(ActionWatching.LastSpell)) return Triplecast; - if (GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && + if ( GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && CanSpellWeave(ActionWatching.LastSpell)) return All.Swiftcast; @@ -667,17 +671,17 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Freeze.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Freeze; - if (Gauge.HasPolyglotStacks()) - return Foul; - if (BLMHelper.DoubleBlizz()) - if (Fire2.LevelChecked()) + if (BLMHelper.DoubleBlizz() && Fire2.LevelChecked()) return OriginalHook(Fire2); if (curMp < LocalPlayer.MaxMp) - return Freeze.LevelChecked() ? OriginalHook(Freeze) : OriginalHook(Blizzard2); + return Freeze.LevelChecked() + ? OriginalHook(Freeze) + : OriginalHook(Blizzard2); - if (ActionReady(Transpose) && + if (IsEnabled(CustomComboPreset.BLM_AoE_Transpose) && + ActionReady(Transpose) && ((CanSpellWeave(ActionWatching.LastSpell) && Flare.LevelChecked()) || !TraitLevelChecked(Traits.AspectMasteryIII))) return Transpose; @@ -692,7 +696,6 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return actionID; } } - internal class BLM_AoE_AdvancedMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_AoE_AdvancedMode; @@ -729,6 +732,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim CanSpellWeave(ActionWatching.LastSpell)) return Variant.VariantRampart; + if (WasLastSpell(UmbralSoul)) + return OriginalHook(Fire2); + if ((IsEnabled(CustomComboPreset.BLM_AoE_Thunder) && HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && thunderDebuffAoE is null) || thunderDebuffAoE.RemainingTime < 3) @@ -791,6 +797,10 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Gauge.InUmbralIce) { + if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglot) && + Gauge.HasPolyglotStacks()) + return Foul; + if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && FlareStar.LevelChecked()) @@ -825,12 +835,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Freeze.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Freeze; - if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglot) && - Gauge.HasPolyglotStacks()) - return Foul; - if (BLMHelper.DoubleBlizz()) - if (Fire2.LevelChecked()) + if (BLMHelper.DoubleBlizz() && Fire2.LevelChecked()) return OriginalHook(Fire2); if (curMp < LocalPlayer.MaxMp) From 481b0dfaaeabd11a075945c5168499465d491856 Mon Sep 17 00:00:00 2001 From: Kage Date: Thu, 31 Oct 2024 10:39:52 +0100 Subject: [PATCH 23/46] add pooling polyglot/triplecast --- XIVSlothCombo/Combos/PvE/BLM.cs | 54 ++++++++++---------- XIVSlothCombo/Window/Functions/UserConfig.cs | 28 ++++++---- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 2dfa0ffa7..b87dbb671 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -3,6 +3,7 @@ using Dalamud.Game.ClientState.JobGauge.Types; using Dalamud.Game.ClientState.Statuses; using XIVSlothCombo.Combos.PvE.Content; +using XIVSlothCombo.Combos.PvP; using XIVSlothCombo.CustomComboNS; using XIVSlothCombo.CustomComboNS.Functions; using XIVSlothCombo.Data; @@ -135,22 +136,14 @@ public static class MP public static class Config { - public static UserBoolArray - BLM_Adv_Cooldowns_Choice = new("BLM_Adv_Cooldowns_Choice"), - BLM_AoE_Adv_Cooldowns_Choice = new("BLM_AoE_Adv_Cooldowns_Choice"), - BLM_Adv_Movement_Choice = new("BLM_Adv_Movement_Choice"); - public static UserInt BLM_VariantCure = new("BLM_VariantCure"), - BLM_Adv_Cooldowns = new("BLM_Adv_Cooldowns"), - BLM_ST_Adv_ThunderHP = new("BLM_ST_Adv_ThunderHP"), - BLM_AoE_Adv_ThunderHP = new("BLM_AoE_Adv_ThunderHP"), - BLM_AoE_Adv_ThunderUptime = new("BLM_AoE_Adv_ThunderUptime"), - BLM_Adv_ThunderCloud = new("BLM_Adv_ThunderCloud"), - BLM_Adv_InitialCast = new("BLM_Adv_InitialCast"); - - public static UserFloat - BLM_AstralFire_Refresh = new("BLM_AstralFire_Refresh"); + BLM_ST_Triplecast_HoldCharges = new("BLM_ST_Triplecast_HoldCharges"), + BLM_ST_UsePolyglot_HoldCharges = new("BLM_ST_UsePolyglot_HoldCharges"), + BLM_ST_UsePolyglotMoving_HoldCharges = new("BLM_ST_UsePolyglotMoving_HoldCharges"), + BLM_AoE_Triplecast_HoldCharges = new("BLM_AoE_Triplecast_HoldCharges"), + BLM_AoE_UsePolyglot_HoldCharges = new("BLM_AoE_UsePolyglot_HoldCharges"), + BLM_AoE_UsePolyglotMoving_HoldCharges = new("BLM_AoE_UsePolyglotMoving_HoldCharges"); } internal class BLM_ST_SimpleMode : CustomCombo @@ -358,6 +351,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); + int PolyglotStacks = Gauge.PolyglotStacks; if (actionID is not Fire) return actionID; @@ -401,7 +395,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Amplifier; if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglotMoving) && - Gauge.HasPolyglotStacks()) + PolyglotStacks > Config.BLM_ST_UsePolyglotMoving_HoldCharges) return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; @@ -422,7 +416,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && canWeave && ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && - GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)) + GetRemainingCharges(Triplecast) >= Config.BLM_ST_Triplecast_HoldCharges) return Triplecast; if (IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && @@ -438,11 +432,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && (IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) || IsEnabled(CustomComboPreset.BLM_ST_Triplecast)) && - Gauge.HasPolyglotStacks() && gcdsInTimer >= 1 && + PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && gcdsInTimer >= 1 && (ActionReady(All.Swiftcast) || - (ActionReady(Triplecast) && + (LevelChecked(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && - GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)))) + GetRemainingCharges(Triplecast) >= Config.BLM_ST_Triplecast_HoldCharges))) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; @@ -503,7 +497,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return All.Swiftcast; if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && - ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0) + LevelChecked(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && + GetRemainingCharges(Triplecast) >= Config.BLM_ST_Triplecast_HoldCharges) return Triplecast; } @@ -696,6 +691,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return actionID; } } + internal class BLM_AoE_AdvancedMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_AoE_AdvancedMode; @@ -715,8 +711,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && - (IsOffCooldown(All.Swiftcast) || ActionReady(Triplecast) || - GetBuffStacks(Buffs.Triplecast) > 0); + IsOffCooldown(All.Swiftcast); + int PolyglotStacks = Gauge.PolyglotStacks; if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; @@ -751,7 +747,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Amplifier; if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglotMoving) && - Gauge.HasPolyglotStacks()) + PolyglotStacks >= Config.BLM_AoE_UsePolyglotMoving_HoldCharges) return Foul; } @@ -772,8 +768,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_AoE_Flare) && Flare.LevelChecked() && curMp >= MP.FlareAoE) { - if (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && - CanSpellWeave(ActionWatching.LastSpell)) + if (LevelChecked(Triplecast) && CanSpellWeave(ActionWatching.LastSpell) && + GetBuffStacks(Buffs.Triplecast) == 0 && + GetRemainingCharges(Triplecast) >= Config.BLM_AoE_Triplecast_HoldCharges) return Triplecast; return Flare; @@ -798,7 +795,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Gauge.InUmbralIce) { if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglot) && - Gauge.HasPolyglotStacks()) + PolyglotStacks >= Config.BLM_AoE_UsePolyglot_HoldCharges) return Foul; if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), @@ -816,8 +813,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim TraitLevelChecked(Traits.AspectMasteryIII)) { if (IsEnabled(CustomComboPreset.BLM_AoE_Triplecast) && - ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && - CanSpellWeave(ActionWatching.LastSpell)) + LevelChecked(Triplecast) && CanSpellWeave(ActionWatching.LastSpell) && + GetBuffStacks(Buffs.Triplecast) == 0 && + GetRemainingCharges(Triplecast) >= Config.BLM_AoE_Triplecast_HoldCharges) return Triplecast; if (IsEnabled(CustomComboPreset.BLM_AoE_Swiftcast) && diff --git a/XIVSlothCombo/Window/Functions/UserConfig.cs b/XIVSlothCombo/Window/Functions/UserConfig.cs index 1d25524fc..74819bcbd 100644 --- a/XIVSlothCombo/Window/Functions/UserConfig.cs +++ b/XIVSlothCombo/Window/Functions/UserConfig.cs @@ -1338,6 +1338,24 @@ internal static void Draw(CustomComboPreset preset, bool enabled) if (preset is CustomComboPreset.BLM_Variant_Cure) UserConfig.DrawSliderInt(1, 100, BLM.Config.BLM_VariantCure, "HP% to be at or under", 200); + if (preset == CustomComboPreset.BLM_ST_Triplecast && enabled) + UserConfig.DrawSliderInt(0, 1, BLM.Config.BLM_ST_Triplecast_HoldCharges, "How many charges to keep ready? (0 = Use all)"); + + if (preset == CustomComboPreset.BLM_ST_UsePolyglot && enabled) + UserConfig.DrawSliderInt(0, 2, BLM.Config.BLM_ST_UsePolyglot_HoldCharges, "How many charges to keep ready? (0 = Use all)"); + + if (preset == CustomComboPreset.BLM_ST_UsePolyglotMoving && enabled) + UserConfig.DrawSliderInt(0, 2, BLM.Config.BLM_ST_UsePolyglotMoving_HoldCharges, "How many charges to keep ready? (0 = Use all)"); + + if (preset == CustomComboPreset.BLM_AoE_Triplecast && enabled) + UserConfig.DrawSliderInt(0, 1, BLM.Config.BLM_AoE_Triplecast_HoldCharges, "How many charges to keep ready? (0 = Use all)"); + + if (preset == CustomComboPreset.BLM_AoE_UsePolyglot && enabled) + UserConfig.DrawSliderInt(0, 2, BLM.Config.BLM_AoE_UsePolyglot_HoldCharges, "How many charges to keep ready? (0 = Use all)"); + + if (preset == CustomComboPreset.BLM_AoE_UsePolyglotMoving && enabled) + UserConfig.DrawSliderInt(0, 2, BLM.Config.BLM_AoE_UsePolyglotMoving_HoldCharges, "How many charges to keep ready? (0 = Use all)"); + #endregion // ==================================================================================== #region BLUE MAGE @@ -1580,7 +1598,6 @@ internal static void Draw(CustomComboPreset preset, bool enabled) #endregion // ==================================================================================== - #region MONK if (preset == CustomComboPreset.MNK_ST_ComboHeals) @@ -2415,13 +2432,7 @@ internal static void Draw(CustomComboPreset preset, bool enabled) #endregion // ==================================================================================== #region VIPER - - /* if ((preset == CustomComboPreset.VPR_ST_AdvancedMode && enabled) || (preset == CustomComboPreset.VPR_VicewinderCoils && enabled)) - { - UserConfig.DrawHorizontalRadioButton(VPR.Config.VPR_Positional, "Rear First", "First positional: Swiftskin's Coil.", 0); - UserConfig.DrawHorizontalRadioButton(VPR.Config.VPR_Positional, "Flank First", "First positional: Hunter's Coil.", 1); - }*/ - + if (preset == CustomComboPreset.VPR_ST_UncoiledFury && enabled) { UserConfig.DrawSliderInt(0, 3, VPR.Config.VPR_ST_UncoiledFury_HoldCharges, "How many charges to keep ready? (0 = Use all)"); @@ -2434,7 +2445,6 @@ internal static void Draw(CustomComboPreset preset, bool enabled) UserConfig.DrawSliderInt(0, 5, VPR.Config.VPR_AoE_UncoiledFury_Threshold, "Set a HP% Threshold to use all charges."); } - if (preset is CustomComboPreset.VPR_ST_Reawaken) { UserConfig.DrawRoundedSliderFloat(0, 10, VPR.Config.VPR_ST_Reawaken_Usage, "Stop using at Enemy HP %. Set to Zero to disable this check.", digits: 1); From bded47809247cc0522ae4e476f659dcf55707fba Mon Sep 17 00:00:00 2001 From: Kage Date: Thu, 31 Oct 2024 16:21:49 +0100 Subject: [PATCH 24/46] add charges ice phase --- XIVSlothCombo/Combos/PvE/BLM.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index b87dbb671..e05bf6db8 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -475,7 +475,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Thunder); if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && - Gauge.HasPolyglotStacks()) + PolyglotStacks >= Config.BLM_ST_UsePolyglot_HoldCharges) return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; From 50c0bbd60c7d95ef95bb652ff6131fff485079ea Mon Sep 17 00:00:00 2001 From: Kage Date: Thu, 31 Oct 2024 16:55:37 +0100 Subject: [PATCH 25/46] add triplecast stuff add missing poly pooling --- XIVSlothCombo/Combos/PvE/BLM.cs | 46 +++++++++++--------- XIVSlothCombo/Window/Functions/UserConfig.cs | 6 +++ 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index e05bf6db8..5505f76a3 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -3,7 +3,6 @@ using Dalamud.Game.ClientState.JobGauge.Types; using Dalamud.Game.ClientState.Statuses; using XIVSlothCombo.Combos.PvE.Content; -using XIVSlothCombo.Combos.PvP; using XIVSlothCombo.CustomComboNS; using XIVSlothCombo.CustomComboNS.Functions; using XIVSlothCombo.Data; @@ -144,6 +143,10 @@ public static UserInt BLM_AoE_Triplecast_HoldCharges = new("BLM_AoE_Triplecast_HoldCharges"), BLM_AoE_UsePolyglot_HoldCharges = new("BLM_AoE_UsePolyglot_HoldCharges"), BLM_AoE_UsePolyglotMoving_HoldCharges = new("BLM_AoE_UsePolyglotMoving_HoldCharges"); + + public static UserFloat + BLM_ST_Triplecast_ChargeTime = new("BLM_ST_Triplecast_ChargeTime"), + BLM_AoE_Triplecast_ChargeTime = new("BLM_AoE_Triplecast_ChargeTime"); } internal class BLM_ST_SimpleMode : CustomCombo @@ -352,6 +355,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim float elementTimer = Gauge.ElementTimeRemaining / 1000f; double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); int PolyglotStacks = Gauge.PolyglotStacks; + float TriplecastChargetime = GetCooldownChargeRemainingTime(Triplecast); if (actionID is not Fire) return actionID; @@ -416,7 +420,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && canWeave && ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && - GetRemainingCharges(Triplecast) >= Config.BLM_ST_Triplecast_HoldCharges) + (GetRemainingCharges(Triplecast) > Config.BLM_ST_Triplecast_HoldCharges || + TriplecastChargetime <= Config.BLM_ST_Triplecast_ChargeTime)) return Triplecast; if (IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) && @@ -434,9 +439,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim IsEnabled(CustomComboPreset.BLM_ST_Triplecast)) && PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && gcdsInTimer >= 1 && (ActionReady(All.Swiftcast) || - (LevelChecked(Triplecast) && - GetBuffStacks(Buffs.Triplecast) == 0 && - GetRemainingCharges(Triplecast) >= Config.BLM_ST_Triplecast_HoldCharges))) + (ActionReady(Triplecast) && + GetBuffStacks(Buffs.Triplecast) == 0))) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; @@ -498,7 +502,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && LevelChecked(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && - GetRemainingCharges(Triplecast) >= Config.BLM_ST_Triplecast_HoldCharges) + (GetRemainingCharges(Triplecast) > Config.BLM_ST_Triplecast_HoldCharges || + TriplecastChargetime <= Config.BLM_ST_Triplecast_ChargeTime)) return Triplecast; } @@ -509,7 +514,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Paradox; if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && - Gauge.HasPolyglotStacks()) + PolyglotStacks >= Config.BLM_ST_UsePolyglot_HoldCharges) return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; @@ -578,9 +583,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (WasLastSpell(UmbralSoul)) return OriginalHook(Fire2); - + if ((HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && - thunderDebuffAoE is null) || thunderDebuffAoE.RemainingTime < 3) + thunderDebuffAoE is null) || thunderDebuffAoE.RemainingTime < 3) return OriginalHook(Thunder2); if (ActionReady(Amplifier) && remainingPolyglotCD >= 20000 && CanSpellWeave(ActionWatching.LastSpell)) @@ -634,7 +639,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim { if (Gauge.HasPolyglotStacks()) return Foul; - + if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && FlareStar.LevelChecked()) @@ -652,7 +657,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim CanSpellWeave(ActionWatching.LastSpell)) return Triplecast; - if ( GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && + if (GetBuffStacks(Buffs.Triplecast) == 0 && IsOffCooldown(All.Swiftcast) && CanSpellWeave(ActionWatching.LastSpell)) return All.Swiftcast; @@ -666,9 +671,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Freeze.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Freeze; - if (BLMHelper.DoubleBlizz() && Fire2.LevelChecked()) - return OriginalHook(Fire2); + return OriginalHook(Fire2); if (curMp < LocalPlayer.MaxMp) return Freeze.LevelChecked() @@ -691,7 +695,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return actionID; } } - + internal class BLM_AoE_AdvancedMode : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_AoE_AdvancedMode; @@ -713,6 +717,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && IsOffCooldown(All.Swiftcast); int PolyglotStacks = Gauge.PolyglotStacks; + float TriplecastChargetime = GetCooldownChargeRemainingTime(Triplecast); if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; @@ -730,7 +735,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (WasLastSpell(UmbralSoul)) return OriginalHook(Fire2); - + if ((IsEnabled(CustomComboPreset.BLM_AoE_Thunder) && HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && thunderDebuffAoE is null) || thunderDebuffAoE.RemainingTime < 3) @@ -770,7 +775,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim { if (LevelChecked(Triplecast) && CanSpellWeave(ActionWatching.LastSpell) && GetBuffStacks(Buffs.Triplecast) == 0 && - GetRemainingCharges(Triplecast) >= Config.BLM_AoE_Triplecast_HoldCharges) + (GetRemainingCharges(Triplecast) > Config.BLM_AoE_Triplecast_HoldCharges || + TriplecastChargetime <= Config.BLM_AoE_Triplecast_ChargeTime)) return Triplecast; return Flare; @@ -797,7 +803,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglot) && PolyglotStacks >= Config.BLM_AoE_UsePolyglot_HoldCharges) return Foul; - + if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), OriginalHook(Flare), OriginalHook(FlareStar)) == OriginalHook(Freeze) && FlareStar.LevelChecked()) @@ -815,7 +821,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_AoE_Triplecast) && LevelChecked(Triplecast) && CanSpellWeave(ActionWatching.LastSpell) && GetBuffStacks(Buffs.Triplecast) == 0 && - GetRemainingCharges(Triplecast) >= Config.BLM_AoE_Triplecast_HoldCharges) + (GetRemainingCharges(Triplecast) > Config.BLM_AoE_Triplecast_HoldCharges || + TriplecastChargetime <= Config.BLM_AoE_Triplecast_ChargeTime)) return Triplecast; if (IsEnabled(CustomComboPreset.BLM_AoE_Swiftcast) && @@ -833,9 +840,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Freeze.LevelChecked() && Gauge.UmbralHearts < 3 && TraitLevelChecked(Traits.UmbralHeart)) return Freeze; - if (BLMHelper.DoubleBlizz() && Fire2.LevelChecked()) - return OriginalHook(Fire2); + return OriginalHook(Fire2); if (curMp < LocalPlayer.MaxMp) return Freeze.LevelChecked() diff --git a/XIVSlothCombo/Window/Functions/UserConfig.cs b/XIVSlothCombo/Window/Functions/UserConfig.cs index 74819bcbd..0c9d61225 100644 --- a/XIVSlothCombo/Window/Functions/UserConfig.cs +++ b/XIVSlothCombo/Window/Functions/UserConfig.cs @@ -1341,6 +1341,9 @@ internal static void Draw(CustomComboPreset preset, bool enabled) if (preset == CustomComboPreset.BLM_ST_Triplecast && enabled) UserConfig.DrawSliderInt(0, 1, BLM.Config.BLM_ST_Triplecast_HoldCharges, "How many charges to keep ready? (0 = Use all)"); + if (preset == CustomComboPreset.BLM_ST_Triplecast && enabled) + UserConfig.DrawSliderInt(10, 20, BLM.Config.BLM_ST_Triplecast_ChargeTime, "Set the amount of time remaining on Triplecast charge before using.(Only when at threshold)"); + if (preset == CustomComboPreset.BLM_ST_UsePolyglot && enabled) UserConfig.DrawSliderInt(0, 2, BLM.Config.BLM_ST_UsePolyglot_HoldCharges, "How many charges to keep ready? (0 = Use all)"); @@ -1349,6 +1352,9 @@ internal static void Draw(CustomComboPreset preset, bool enabled) if (preset == CustomComboPreset.BLM_AoE_Triplecast && enabled) UserConfig.DrawSliderInt(0, 1, BLM.Config.BLM_AoE_Triplecast_HoldCharges, "How many charges to keep ready? (0 = Use all)"); + + if (preset == CustomComboPreset.BLM_AoE_Triplecast && enabled) + UserConfig.DrawSliderInt(10, 20, BLM.Config.BLM_AoE_Triplecast_ChargeTime, "Set the amount of time remaining on Triplecast charge before using.(Only when at threshold)"); if (preset == CustomComboPreset.BLM_AoE_UsePolyglot && enabled) UserConfig.DrawSliderInt(0, 2, BLM.Config.BLM_AoE_UsePolyglot_HoldCharges, "How many charges to keep ready? (0 = Use all)"); From 5ff7b947d6f5acee42d14f56ab7eff44753ac70f Mon Sep 17 00:00:00 2001 From: Kage Date: Thu, 31 Oct 2024 17:21:17 +0100 Subject: [PATCH 26/46] little cleanup --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 11 +++++++---- XIVSlothCombo/Combos/PvE/BLM.cs | 2 -- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index 61e9ec9be..906621238 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -14,11 +14,11 @@ namespace XIVSlothCombo.Combos.JobHelpers; internal static class BLM { // BLM Gauge & Extensions + public static BLMGauge Gauge = GetJobGauge(); + public static int Fire4Count => ActionWatching.CombatActions.Count(x => x == Fire4); - - - public static bool HasPolyglotStacks(this BLMGauge gauge) => gauge.PolyglotStacks > 0; + public static bool HasPolyglotStacks(this BLMGauge gauge) =>gauge.PolyglotStacks > 0; internal class BLMOpenerLogic { @@ -233,6 +233,7 @@ internal class BLMHelper public static float MPAfterCast() { uint castedSpell = LocalPlayer.CastActionId; + int nextMpGain = Gauge.UmbralIceStacks switch { 0 => 0, @@ -250,7 +251,9 @@ public static float MPAfterCast() public static bool DoubleBlizz() { - List spells = ActionWatching.CombatActions.Where(x => ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)).ToList(); + List spells = ActionWatching.CombatActions.Where(x => + ActionWatching.GetAttackType(x) == ActionWatching.ActionAttackType.Spell && + x != OriginalHook(Thunder) && x != OriginalHook(Thunder2)).ToList(); if (spells.Count < 1) return false; diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 5505f76a3..26e54fcf8 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Dalamud.Game.ClientState.JobGauge.Types; using Dalamud.Game.ClientState.Statuses; using XIVSlothCombo.Combos.PvE.Content; using XIVSlothCombo.CustomComboNS; @@ -51,7 +50,6 @@ public const uint HighThunder2 = 36987, FlareStar = 36989; - public static BLMGauge Gauge = GetJobGauge(); internal static BLMOpenerLogic BLMOpener = new(); // Debuff Pairs of Actions and Debuff From 76dcdeef58cdb1ec21df67fd14872da4d2341b6e Mon Sep 17 00:00:00 2001 From: Kage Date: Fri, 1 Nov 2024 11:59:52 +0100 Subject: [PATCH 27/46] fix xeno usage add thunderhp slider --- XIVSlothCombo/Combos/PvE/BLM.cs | 31 +++++++++++--------- XIVSlothCombo/Window/Functions/UserConfig.cs | 6 ++++ 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 26e54fcf8..ee75d2846 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -135,16 +135,18 @@ public static class Config { public static UserInt BLM_VariantCure = new("BLM_VariantCure"), - BLM_ST_Triplecast_HoldCharges = new("BLM_ST_Triplecast_HoldCharges"), - BLM_ST_UsePolyglot_HoldCharges = new("BLM_ST_UsePolyglot_HoldCharges"), - BLM_ST_UsePolyglotMoving_HoldCharges = new("BLM_ST_UsePolyglotMoving_HoldCharges"), - BLM_AoE_Triplecast_HoldCharges = new("BLM_AoE_Triplecast_HoldCharges"), - BLM_AoE_UsePolyglot_HoldCharges = new("BLM_AoE_UsePolyglot_HoldCharges"), - BLM_AoE_UsePolyglotMoving_HoldCharges = new("BLM_AoE_UsePolyglotMoving_HoldCharges"); + BLM_ST_Triplecast_HoldCharges = new("BLM_ST_Triplecast_HoldCharges",0), + BLM_ST_UsePolyglot_HoldCharges = new("BLM_ST_UsePolyglot_HoldCharges",1), + BLM_ST_UsePolyglotMoving_HoldCharges = new("BLM_ST_UsePolyglotMoving_HoldCharges",0), + BLM_ST_ThunderHP = new("BHP", 0), + BLM_AoE_Triplecast_HoldCharges = new("BLM_AoE_Triplecast_HoldCharges",0), + BLM_AoE_UsePolyglot_HoldCharges = new("BLM_AoE_UsePolyglot_HoldCharges",1), + BLM_AoE_UsePolyglotMoving_HoldCharges = new("BLM_AoE_UsePolyglotMoving_HoldCharges",0), + BLM_AoE_ThunderHP = new("BLM_AoE_ThunderHP", 5); public static UserFloat - BLM_ST_Triplecast_ChargeTime = new("BLM_ST_Triplecast_ChargeTime"), - BLM_AoE_Triplecast_ChargeTime = new("BLM_AoE_Triplecast_ChargeTime"); + BLM_ST_Triplecast_ChargeTime = new("BLM_ST_Triplecast_ChargeTime",20), + BLM_AoE_Triplecast_ChargeTime = new("BLM_AoE_Triplecast_ChargeTime",20); } internal class BLM_ST_SimpleMode : CustomCombo @@ -386,7 +388,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim } if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && - HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && + HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && LevelChecked(Thunder) && + GetTargetHPPercent() >= Config.BLM_ST_ThunderHP && (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) return OriginalHook(Thunder); @@ -437,8 +440,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim IsEnabled(CustomComboPreset.BLM_ST_Triplecast)) && PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && gcdsInTimer >= 1 && (ActionReady(All.Swiftcast) || - (ActionReady(Triplecast) && - GetBuffStacks(Buffs.Triplecast) == 0))) + (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0))) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; @@ -477,7 +479,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Thunder); if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && - PolyglotStacks >= Config.BLM_ST_UsePolyglot_HoldCharges) + PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges) return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; @@ -512,7 +514,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Paradox; if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && - PolyglotStacks >= Config.BLM_ST_UsePolyglot_HoldCharges) + PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges) return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; @@ -735,7 +737,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Fire2); if ((IsEnabled(CustomComboPreset.BLM_AoE_Thunder) && - HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && Thunder2.LevelChecked() && + HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && LevelChecked(Thunder2) && + GetTargetHPPercent() >= Config.BLM_AoE_ThunderHP && thunderDebuffAoE is null) || thunderDebuffAoE.RemainingTime < 3) return OriginalHook(Thunder2); diff --git a/XIVSlothCombo/Window/Functions/UserConfig.cs b/XIVSlothCombo/Window/Functions/UserConfig.cs index 0c9d61225..e0e6ee6e4 100644 --- a/XIVSlothCombo/Window/Functions/UserConfig.cs +++ b/XIVSlothCombo/Window/Functions/UserConfig.cs @@ -1350,6 +1350,9 @@ internal static void Draw(CustomComboPreset preset, bool enabled) if (preset == CustomComboPreset.BLM_ST_UsePolyglotMoving && enabled) UserConfig.DrawSliderInt(0, 2, BLM.Config.BLM_ST_UsePolyglotMoving_HoldCharges, "How many charges to keep ready? (0 = Use all)"); + if (preset == CustomComboPreset.BLM_ST_Thunder) + UserConfig.DrawSliderInt(0, 10, BLM.Config.BLM_ST_ThunderHP, "Stop Using When Target HP% is at or Below (Set to 0 to Disable This Check)"); + if (preset == CustomComboPreset.BLM_AoE_Triplecast && enabled) UserConfig.DrawSliderInt(0, 1, BLM.Config.BLM_AoE_Triplecast_HoldCharges, "How many charges to keep ready? (0 = Use all)"); @@ -1361,6 +1364,9 @@ internal static void Draw(CustomComboPreset preset, bool enabled) if (preset == CustomComboPreset.BLM_AoE_UsePolyglotMoving && enabled) UserConfig.DrawSliderInt(0, 2, BLM.Config.BLM_AoE_UsePolyglotMoving_HoldCharges, "How many charges to keep ready? (0 = Use all)"); + + if (preset == CustomComboPreset.BLM_AoE_Thunder && enabled) + UserConfig.DrawSliderInt(0, 10, BLM.Config.BLM_AoE_ThunderHP, "Stop Using When Target HP% is at or Below (Set to 0 to Disable This Check)"); #endregion // ==================================================================================== From 2343d5db27c5319fb8536417e425afeb91f926ed Mon Sep 17 00:00:00 2001 From: Kage Date: Fri, 1 Nov 2024 12:01:00 +0100 Subject: [PATCH 28/46] fix poly usage aoe --- XIVSlothCombo/Combos/PvE/BLM.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index ee75d2846..051c766bc 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -753,7 +753,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Amplifier; if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglotMoving) && - PolyglotStacks >= Config.BLM_AoE_UsePolyglotMoving_HoldCharges) + PolyglotStacks > Config.BLM_AoE_UsePolyglotMoving_HoldCharges) return Foul; } @@ -802,7 +802,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Gauge.InUmbralIce) { if (IsEnabled(CustomComboPreset.BLM_AoE_UsePolyglot) && - PolyglotStacks >= Config.BLM_AoE_UsePolyglot_HoldCharges) + PolyglotStacks > Config.BLM_AoE_UsePolyglot_HoldCharges) return Foul; if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), From ad48c1c0515c9be21ecdbccd1f1639c4019b7e82 Mon Sep 17 00:00:00 2001 From: Kage Date: Sat, 2 Nov 2024 00:38:18 +0100 Subject: [PATCH 29/46] add triplecast protection --- XIVSlothCombo/Combos/CustomComboPreset.cs | 5 +++++ XIVSlothCombo/Combos/PvE/BLM.cs | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/XIVSlothCombo/Combos/CustomComboPreset.cs b/XIVSlothCombo/Combos/CustomComboPreset.cs index cf1e60cda..8938f6336 100644 --- a/XIVSlothCombo/Combos/CustomComboPreset.cs +++ b/XIVSlothCombo/Combos/CustomComboPreset.cs @@ -528,6 +528,11 @@ public enum CustomComboPreset [ReplaceSkill(BLM.AetherialManipulation)] [CustomComboInfo("Aetherial Manipulation Feature", "Replaces Aetherial Manipulation with Between the Lines when you are out of active Ley Lines and standing still.", BLM.JobID)] BLM_Aetherial_Manipulation = 2055, + + [ReplaceSkill(BLM.Triplecast)] + [CustomComboInfo("Triplecast Protection", "Replaces Triplecast with Savage Blade when u already have triplecast active.", BLM.JobID)] + BLM_TriplecastProtection = 2056, + #endregion // Last value ST = 2112 diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 051c766bc..d0e9e52ee 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -959,4 +959,17 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim : actionID; } } + + internal class BLM_TriplecastProtection : CustomCombo + { + protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLM_TriplecastProtection; + + protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) + { + if (actionID is Triplecast && HasEffect(Buffs.Triplecast)) + return OriginalHook(11); + + return actionID; + } + } } \ No newline at end of file From 23738b36cefee65ee78b27b1ee5fe1780028c9ff Mon Sep 17 00:00:00 2001 From: Kage Date: Sat, 2 Nov 2024 00:49:31 +0100 Subject: [PATCH 30/46] cleanup 1.0 --- XIVSlothCombo/Combos/PvE/BLM.cs | 36 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index d0e9e52ee..971674426 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -135,18 +135,18 @@ public static class Config { public static UserInt BLM_VariantCure = new("BLM_VariantCure"), - BLM_ST_Triplecast_HoldCharges = new("BLM_ST_Triplecast_HoldCharges",0), - BLM_ST_UsePolyglot_HoldCharges = new("BLM_ST_UsePolyglot_HoldCharges",1), - BLM_ST_UsePolyglotMoving_HoldCharges = new("BLM_ST_UsePolyglotMoving_HoldCharges",0), + BLM_ST_Triplecast_HoldCharges = new("BLM_ST_Triplecast_HoldCharges", 0), + BLM_ST_UsePolyglot_HoldCharges = new("BLM_ST_UsePolyglot_HoldCharges", 1), + BLM_ST_UsePolyglotMoving_HoldCharges = new("BLM_ST_UsePolyglotMoving_HoldCharges", 0), BLM_ST_ThunderHP = new("BHP", 0), - BLM_AoE_Triplecast_HoldCharges = new("BLM_AoE_Triplecast_HoldCharges",0), - BLM_AoE_UsePolyglot_HoldCharges = new("BLM_AoE_UsePolyglot_HoldCharges",1), - BLM_AoE_UsePolyglotMoving_HoldCharges = new("BLM_AoE_UsePolyglotMoving_HoldCharges",0), + BLM_AoE_Triplecast_HoldCharges = new("BLM_AoE_Triplecast_HoldCharges", 0), + BLM_AoE_UsePolyglot_HoldCharges = new("BLM_AoE_UsePolyglot_HoldCharges", 1), + BLM_AoE_UsePolyglotMoving_HoldCharges = new("BLM_AoE_UsePolyglotMoving_HoldCharges", 0), BLM_AoE_ThunderHP = new("BLM_AoE_ThunderHP", 5); public static UserFloat - BLM_ST_Triplecast_ChargeTime = new("BLM_ST_Triplecast_ChargeTime",20), - BLM_AoE_Triplecast_ChargeTime = new("BLM_AoE_Triplecast_ChargeTime",20); + BLM_ST_Triplecast_ChargeTime = new("BLM_ST_Triplecast_ChargeTime", 20), + BLM_AoE_Triplecast_ChargeTime = new("BLM_AoE_Triplecast_ChargeTime", 20); } internal class BLM_ST_SimpleMode : CustomCombo @@ -896,13 +896,12 @@ internal class BLM_Blizzard_1to3 : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - if (actionID is Blizzard && LevelChecked(Freeze) && !Gauge.InUmbralIce) - return Blizzard3; - - if (actionID is Freeze && !LevelChecked(Freeze)) - return Blizzard2; - - return actionID; + return actionID switch + { + Blizzard when LevelChecked(Freeze) && !Gauge.InUmbralIce => Blizzard3, + Freeze when !LevelChecked(Freeze) => Blizzard2, + var _ => actionID + }; } } @@ -966,10 +965,9 @@ internal class BLM_TriplecastProtection : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - if (actionID is Triplecast && HasEffect(Buffs.Triplecast)) - return OriginalHook(11); - - return actionID; + return actionID is Triplecast && HasEffect(Buffs.Triplecast) && LevelChecked(Triplecast) + ? OriginalHook(11) + : actionID; } } } \ No newline at end of file From a526272aeff329b2e4e0866fccec4e5cd16d8eff Mon Sep 17 00:00:00 2001 From: Kage Date: Mon, 4 Nov 2024 23:18:39 +0100 Subject: [PATCH 31/46] add public statics cleanup --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 18 +++++++++--- XIVSlothCombo/Combos/PvE/BLM.cs | 38 +++++++------------------- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index 906621238..01ba353be 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -2,6 +2,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; @@ -11,14 +12,23 @@ namespace XIVSlothCombo.Combos.JobHelpers; -internal static class BLM +internal class BLM { // BLM Gauge & Extensions public static BLMGauge Gauge = GetJobGauge(); - + + public static Status? thunderDebuffST = + FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + + public static Status? thunderDebuffAoE = + FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + + public static float elementTimer = Gauge.ElementTimeRemaining / 1000f; + public static double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + public static int Fire4Count => ActionWatching.CombatActions.Count(x => x == Fire4); - public static bool HasPolyglotStacks(this BLMGauge gauge) =>gauge.PolyglotStacks > 0; + public static bool HasPolyglotStacks(BLMGauge Gauge) => Gauge.PolyglotStacks > 0; internal class BLMOpenerLogic { @@ -186,7 +196,7 @@ private bool DoOpener(ref uint actionID) (actionID == LeyLines && IsOnCooldown(LeyLines)) || (actionID == Manafont && IsOnCooldown(Manafont)) || (actionID == All.Swiftcast && IsOnCooldown(All.Swiftcast)) || - (actionID == Xenoglossy && !Gauge.HasPolyglotStacks())) && + (actionID == Xenoglossy && Gauge.PolyglotStacks == 0)) && ActionWatching.TimeSinceLastAction.TotalSeconds >= 3) { CurrentState = OpenerState.FailedOpener; diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 971674426..bed5be136 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Dalamud.Game.ClientState.Statuses; using XIVSlothCombo.Combos.PvE.Content; using XIVSlothCombo.CustomComboNS; using XIVSlothCombo.CustomComboNS.Functions; @@ -70,7 +69,7 @@ public static readonly Dictionary 1 => 2500, 2 => 5000, 3 => 10000, - _ => 0 + var _ => 0 }; public static class Buffs @@ -161,12 +160,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuffST = - FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); + uint curMp = LocalPlayer.CurrentMp; if (actionID is not Fire) return actionID; @@ -205,7 +200,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) return Amplifier; - if (Gauge.HasPolyglotStacks()) + if (HasPolyglotStacks(Gauge)) return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; @@ -234,7 +229,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) return OriginalHook(Thunder); - if (Gauge.HasPolyglotStacks() && gcdsInTimer >= 1 && + if (HasPolyglotStacks(Gauge) && gcdsInTimer >= 1 && (ActionReady(All.Swiftcast) || (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && @@ -274,7 +269,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) return OriginalHook(Thunder); - if (Gauge.HasPolyglotStacks()) + if (HasPolyglotStacks(Gauge)) return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; @@ -305,7 +300,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Gauge.IsParadoxActive) return Paradox; - if (Gauge.HasPolyglotStacks()) + if (HasPolyglotStacks(Gauge)) return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; @@ -350,10 +345,6 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuffST = - FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(Fire)); int PolyglotStacks = Gauge.PolyglotStacks; float TriplecastChargetime = GetCooldownChargeRemainingTime(Triplecast); @@ -559,11 +550,6 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuffAoE = - FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && IsOffCooldown(All.Swiftcast); @@ -596,7 +582,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (ActionReady(Amplifier) && Gauge.PolyglotStacks < maxPolyglot) return Amplifier; - if (Gauge.HasPolyglotStacks()) + if (HasPolyglotStacks(Gauge)) return Foul; } @@ -637,7 +623,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (Gauge.InUmbralIce) { - if (Gauge.HasPolyglotStacks()) + if (HasPolyglotStacks(Gauge)) return Foul; if (ActionWatching.WhichOfTheseActionsWasLast(OriginalHook(Fire2), OriginalHook(Freeze), @@ -709,13 +695,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; - Status? thunderDebuffAoE = - FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && IsOffCooldown(All.Swiftcast); + int PolyglotStacks = Gauge.PolyglotStacks; float TriplecastChargetime = GetCooldownChargeRemainingTime(Triplecast); @@ -884,7 +866,7 @@ internal class BLM_Scathe_Xeno : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - return actionID is Scathe && LevelChecked(Xenoglossy) && Gauge.HasPolyglotStacks() + return actionID is Scathe && LevelChecked(Xenoglossy) && HasPolyglotStacks(Gauge) ? Xenoglossy : actionID; } From 2e554ece46b4b320c4053bc975ff0c7131814a17 Mon Sep 17 00:00:00 2001 From: Kage Date: Wed, 6 Nov 2024 09:33:10 +0100 Subject: [PATCH 32/46] fix gauge --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index 01ba353be..c81fe229b 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -15,7 +15,7 @@ namespace XIVSlothCombo.Combos.JobHelpers; internal class BLM { // BLM Gauge & Extensions - public static BLMGauge Gauge = GetJobGauge(); + public static BLMGauge Gauge => GetJobGauge(); public static Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); @@ -28,7 +28,7 @@ internal class BLM public static int Fire4Count => ActionWatching.CombatActions.Count(x => x == Fire4); - public static bool HasPolyglotStacks(BLMGauge Gauge) => Gauge.PolyglotStacks > 0; + public static bool HasPolyglotStacks(BLMGauge gauge) => gauge.PolyglotStacks > 0; internal class BLMOpenerLogic { From 03c8e75a71d9abcbc99e1caa0a270e20076fed7a Mon Sep 17 00:00:00 2001 From: Kage Date: Thu, 7 Nov 2024 10:04:46 +0100 Subject: [PATCH 33/46] add leylines opener changes --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index c81fe229b..0a51cee48 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -82,9 +82,6 @@ private static bool HasCooldowns() if (!ActionReady(Amplifier)) return false; - if (!ActionReady(LeyLines)) - return false; - return true; } @@ -140,7 +137,7 @@ private bool DoOpener(ref uint actionID) if (WasLastAction(Triplecast) && OpenerStep == 7) OpenerStep++; else if (OpenerStep == 7) actionID = Triplecast; - if (WasLastAction(LeyLines) && OpenerStep == 8) OpenerStep++; + if ((WasLastAction(LeyLines) || IsOnCooldown(LeyLines)) && OpenerStep == 8) OpenerStep++; else if (OpenerStep == 8) actionID = LeyLines; if (WasLastAction(Fire4) && Fire4Count is 3 && OpenerStep == 9) OpenerStep++; From f71f2d3ee0e9de0ddcdde8d95e98ee2044b69be1 Mon Sep 17 00:00:00 2001 From: Kage Date: Fri, 8 Nov 2024 16:29:26 +0100 Subject: [PATCH 34/46] cleanup --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 11 +---------- XIVSlothCombo/Combos/PvE/BLM.cs | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index 0a51cee48..853a1c088 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -16,16 +16,7 @@ internal class BLM { // BLM Gauge & Extensions public static BLMGauge Gauge => GetJobGauge(); - - public static Status? thunderDebuffST = - FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - - public static Status? thunderDebuffAoE = - FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - - public static float elementTimer = Gauge.ElementTimeRemaining / 1000f; - public static double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - + public static int Fire4Count => ActionWatching.CombatActions.Count(x => x == Fire4); public static bool HasPolyglotStacks(BLMGauge gauge) => gauge.PolyglotStacks > 0; diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index bed5be136..65f118ee2 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Dalamud.Game.ClientState.Statuses; using XIVSlothCombo.Combos.PvE.Content; using XIVSlothCombo.CustomComboNS; using XIVSlothCombo.CustomComboNS.Functions; @@ -158,9 +159,15 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; bool canWeave = CanSpellWeave(ActionWatching.LastSpell); + float elementTimer = Gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + Status? thunderDebuffST = + FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + uint curMp = LocalPlayer.CurrentMp; if (actionID is not Fire) @@ -341,10 +348,16 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; bool canWeave = CanSpellWeave(ActionWatching.LastSpell); + float elementTimer = Gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; + Status? thunderDebuffST = + FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + int PolyglotStacks = Gauge.PolyglotStacks; float TriplecastChargetime = GetCooldownChargeRemainingTime(Triplecast); @@ -546,10 +559,16 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + float elementTimer = Gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; + Status? thunderDebuffAoE = + FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && IsOffCooldown(All.Swiftcast); @@ -691,6 +710,12 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + float elementTimer = Gauge.ElementTimeRemaining / 1000f; + double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + + Status? thunderDebuffAoE = + FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); uint curMp = LocalPlayer.CurrentMp; From 7253387cac4b287f9f6e995f2d021b50c6edcfdd Mon Sep 17 00:00:00 2001 From: Kage Date: Tue, 12 Nov 2024 09:28:43 +0100 Subject: [PATCH 35/46] static updates --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 16 ++++++- XIVSlothCombo/Combos/PvE/BLM.cs | 61 -------------------------- 2 files changed, 14 insertions(+), 63 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index 853a1c088..8127e20bd 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -16,9 +16,21 @@ internal class BLM { // BLM Gauge & Extensions public static BLMGauge Gauge => GetJobGauge(); - public static int Fire4Count => ActionWatching.CombatActions.Count(x => x == Fire4); - + public static int maxPolyglot => TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : + TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; + public static bool canWeave => CanSpellWeave(ActionWatching.LastSpell); + public static float elementTimer => Gauge.ElementTimeRemaining / 1000f; + public static double gcdsInTimer => Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + public static int remainingPolyglotCD => Math.Max(0, + (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); + public static Status? thunderDebuffST => + FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); + public static Status? thunderDebuffAoE => + FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); + public static bool canSwiftF => TraitLevelChecked(Traits.AspectMasteryIII) && + IsOffCooldown(All.Swiftcast); + public static uint curMp => LocalPlayer.CurrentMp; public static bool HasPolyglotStacks(BLMGauge gauge) => gauge.PolyglotStacks > 0; internal class BLMOpenerLogic diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 65f118ee2..8bc4609ae 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -155,21 +155,6 @@ internal class BLM_ST_SimpleMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : - TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - bool canWeave = CanSpellWeave(ActionWatching.LastSpell); - - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - - int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - - Status? thunderDebuffST = - FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - - uint curMp = LocalPlayer.CurrentMp; - if (actionID is not Fire) return actionID; @@ -344,20 +329,6 @@ internal class BLM_ST_AdvancedMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : - TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - bool canWeave = CanSpellWeave(ActionWatching.LastSpell); - - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - - int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - uint curMp = LocalPlayer.CurrentMp; - - Status? thunderDebuffST = - FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - int PolyglotStacks = Gauge.PolyglotStacks; float TriplecastChargetime = GetCooldownChargeRemainingTime(Triplecast); @@ -556,22 +527,6 @@ internal class BLM_AoE_SimpleMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : - TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - - int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - uint curMp = LocalPlayer.CurrentMp; - - Status? thunderDebuffAoE = - FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - - bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && - IsOffCooldown(All.Swiftcast); - if (actionID is not (Blizzard2 or HighBlizzard2)) return actionID; @@ -707,22 +662,6 @@ internal class BLM_AoE_AdvancedMode : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : - TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - - float elementTimer = Gauge.ElementTimeRemaining / 1000f; - double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - - Status? thunderDebuffAoE = - FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - - int remainingPolyglotCD = Math.Max(0, - (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - uint curMp = LocalPlayer.CurrentMp; - - bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && - IsOffCooldown(All.Swiftcast); - int PolyglotStacks = Gauge.PolyglotStacks; float TriplecastChargetime = GetCooldownChargeRemainingTime(Triplecast); From 075226f9d109e647fcbb68fcd73c8e09ce101430 Mon Sep 17 00:00:00 2001 From: Kage Date: Tue, 12 Nov 2024 13:42:57 +0100 Subject: [PATCH 36/46] leylines update --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 2 +- XIVSlothCombo/Combos/PvE/BLM.cs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index 8127e20bd..ff02e8a1c 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -140,7 +140,7 @@ private bool DoOpener(ref uint actionID) if (WasLastAction(Triplecast) && OpenerStep == 7) OpenerStep++; else if (OpenerStep == 7) actionID = Triplecast; - if ((WasLastAction(LeyLines) || IsOnCooldown(LeyLines)) && OpenerStep == 8) OpenerStep++; + if (HasEffect(Buffs.LeyLines) && OpenerStep == 8) OpenerStep++; else if (OpenerStep == 8) actionID = LeyLines; if (WasLastAction(Fire4) && Fire4Count is 3 && OpenerStep == 9) OpenerStep++; diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 8bc4609ae..8cd9b1391 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Generic; -using Dalamud.Game.ClientState.Statuses; using XIVSlothCombo.Combos.PvE.Content; using XIVSlothCombo.CustomComboNS; using XIVSlothCombo.CustomComboNS.Functions; @@ -178,8 +176,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim remainingPolyglotCD >= 20000) return Amplifier; - if (IsEnabled(CustomComboPreset.BLM_ST_LeyLines) && - ActionReady(LeyLines)) + if (ActionReady(LeyLines) && + !HasEffect(Buffs.LeyLines)) return LeyLines; } @@ -358,7 +356,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Amplifier; if (IsEnabled(CustomComboPreset.BLM_ST_LeyLines) && - ActionReady(LeyLines)) + ActionReady(LeyLines) && !HasEffect(Buffs.LeyLines)) return LeyLines; } @@ -560,7 +558,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Foul; } - if (CanSpellWeave(ActionWatching.LastSpell) && ActionReady(LeyLines)) + if (CanSpellWeave(ActionWatching.LastSpell) && + ActionReady(LeyLines) && !HasEffect(Buffs.LeyLines)) return LeyLines; if (Gauge.InAstralFire) @@ -704,7 +703,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim } if (IsEnabled(CustomComboPreset.BLM_AoE_LeyLines) && - CanSpellWeave(ActionWatching.LastSpell) && ActionReady(LeyLines)) + CanSpellWeave(ActionWatching.LastSpell) && + ActionReady(LeyLines) && !HasEffect(Buffs.LeyLines)) return LeyLines; if (Gauge.InAstralFire) From 47bcfe2f70578f3ec9ebad40c57de1c5eafc92c5 Mon Sep 17 00:00:00 2001 From: Kage Date: Tue, 12 Nov 2024 13:56:05 +0100 Subject: [PATCH 37/46] little tweaks --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 37 +++++++++++++++----------- XIVSlothCombo/Combos/PvE/BLM.cs | 4 +-- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index ff02e8a1c..aee9125fc 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -32,7 +32,7 @@ internal class BLM IsOffCooldown(All.Swiftcast); public static uint curMp => LocalPlayer.CurrentMp; public static bool HasPolyglotStacks(BLMGauge gauge) => gauge.PolyglotStacks > 0; - + internal class BLMOpenerLogic { private OpenerState currentState = OpenerState.PrePull; @@ -196,7 +196,7 @@ private bool DoOpener(ref uint actionID) (actionID == LeyLines && IsOnCooldown(LeyLines)) || (actionID == Manafont && IsOnCooldown(Manafont)) || (actionID == All.Swiftcast && IsOnCooldown(All.Swiftcast)) || - (actionID == Xenoglossy && Gauge.PolyglotStacks == 0)) && + (actionID == Xenoglossy && !HasPolyglotStacks(Gauge))) && ActionWatching.TimeSinceLastAction.TotalSeconds >= 3) { CurrentState = OpenerState.FailedOpener; @@ -253,10 +253,9 @@ public static float MPAfterCast() _ => 0 }; - if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) - return Math.Max(LocalPlayer.MaxMp, LocalPlayer.CurrentMp + nextMpGain); - - return Math.Max(0, LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); + return castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2 + ? Math.Max(LocalPlayer.MaxMp, LocalPlayer.CurrentMp + nextMpGain) + : Math.Max(0, LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); } public static bool DoubleBlizz() @@ -269,19 +268,27 @@ public static bool DoubleBlizz() uint firstSpell = spells[^1]; - if (firstSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) + switch (firstSpell) { - uint castedSpell = LocalPlayer.CastActionId; - - if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) - return true; - - if (spells.Count >= 2) + case Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2: { - uint secondSpell = spells[^2]; + uint castedSpell = LocalPlayer.CastActionId; - if (secondSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) + if (castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2) return true; + + if (spells.Count >= 2) + { + uint secondSpell = spells[^2]; + + switch (secondSpell) + { + case Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2: + return true; + } + } + + break; } } diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 8cd9b1391..546042637 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -176,7 +176,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim remainingPolyglotCD >= 20000) return Amplifier; - if (ActionReady(LeyLines) && + if (ActionReady(LeyLines) && !HasEffect(Buffs.LeyLines)) return LeyLines; } @@ -558,7 +558,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Foul; } - if (CanSpellWeave(ActionWatching.LastSpell) && + if (CanSpellWeave(ActionWatching.LastSpell) && ActionReady(LeyLines) && !HasEffect(Buffs.LeyLines)) return LeyLines; From 83cb39fc10d81d4f1a15a6213cf24e40ad41d1e2 Mon Sep 17 00:00:00 2001 From: nativepapaya Date: Tue, 12 Nov 2024 09:16:12 -0500 Subject: [PATCH 38/46] Updated flare star logic --- XIVSlothCombo/Combos/PvE/BLM.cs | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 546042637..121ae708b 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -390,6 +390,10 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_Despair) && curMp < MP.FireI && LevelChecked(Despair) && curMp >= MP.Despair) + return Despair; + + if (IsEnabled(CustomComboPreset.BLM_ST_Flarestar) && + curMp == 0 && LevelChecked(FlareStar) && Gauge.AstralSoulStacks == 6) { if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && canWeave && ActionReady(Triplecast) && @@ -402,28 +406,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim canWeave && ActionReady(All.Swiftcast) && GetBuffStacks(Buffs.Triplecast) == 0) return All.Swiftcast; - - if (IsEnabled(CustomComboPreset.BLM_ST_Thunder) && - HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && - (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) - return OriginalHook(Thunder); - - if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && - (IsEnabled(CustomComboPreset.BLM_ST_Swiftcast) || - IsEnabled(CustomComboPreset.BLM_ST_Triplecast)) && - PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && gcdsInTimer >= 1 && - (ActionReady(All.Swiftcast) || - (ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0))) - return Xenoglossy.LevelChecked() - ? Xenoglossy - : Foul; - - return Despair; - } - - if (IsEnabled(CustomComboPreset.BLM_ST_Flarestar) && - curMp == 0 && LevelChecked(FlareStar) && Gauge.AstralSoulStacks == 6) + return FlareStar; + } if (LevelChecked(Fire4)) if (gcdsInTimer > 1 && curMp >= MP.FireI) From df61b4643c8f9c683a7d46211bcba5fb168d28a5 Mon Sep 17 00:00:00 2001 From: nativepapaya Date: Tue, 12 Nov 2024 09:20:07 -0500 Subject: [PATCH 39/46] Added triplecast logic to fire iv --- XIVSlothCombo/Combos/PvE/BLM.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 121ae708b..26a556982 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -412,8 +412,30 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (LevelChecked(Fire4)) if (gcdsInTimer > 1 && curMp >= MP.FireI) + { + if (IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && + canWeave && ActionReady(Triplecast) && + GetBuffStacks(Buffs.Triplecast) == 0 && + (GetRemainingCharges(Triplecast) > Config.BLM_ST_Triplecast_HoldCharges || + TriplecastChargetime <= Config.BLM_ST_Triplecast_ChargeTime)) + return Triplecast; + + if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && + (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) + return OriginalHook(Thunder); + + if (HasPolyglotStacks(Gauge) && gcdsInTimer >= 1 && + (ActionReady(All.Swiftcast) || + (ActionReady(Triplecast) && + GetBuffStacks(Buffs.Triplecast) == 0 && + GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)))) + return Xenoglossy.LevelChecked() + ? Xenoglossy + : Foul; + return Fire4; - + } + if (curMp >= MP.FireI) return Fire; From 1315920f97d55b41786ef6f7e3b29d7332fe9172 Mon Sep 17 00:00:00 2001 From: nativepapaya Date: Tue, 12 Nov 2024 11:46:34 -0500 Subject: [PATCH 40/46] Moved the second triple in the opener one GCD further down --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index aee9125fc..efe1d1f0a 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -154,12 +154,12 @@ private bool DoOpener(ref uint actionID) if (WasLastAction(Manafont) && OpenerStep == 12) OpenerStep++; else if (OpenerStep == 12) actionID = Manafont; + + if (WasLastAction(Fire4) && Fire4Count is 5 && OpenerStep == 13) OpenerStep++; + else if (OpenerStep == 13) actionID = Fire4; - if (WasLastAction(Triplecast) && OpenerStep == 13) OpenerStep++; - else if (OpenerStep == 13) actionID = Triplecast; - - if (WasLastAction(Fire4) && Fire4Count is 5 && OpenerStep == 14) OpenerStep++; - else if (OpenerStep == 14) actionID = Fire4; + if (WasLastAction(Triplecast) && OpenerStep == 14) OpenerStep++; + else if (OpenerStep == 14) actionID = Triplecast; if (WasLastAction(Fire4) && Fire4Count is 6 && OpenerStep == 15) OpenerStep++; else if (OpenerStep == 15) actionID = Fire4; From bad487ffd2f70c3fa981b16cf3f9cd6fb78f805d Mon Sep 17 00:00:00 2001 From: Kage Date: Wed, 13 Nov 2024 00:51:26 +0100 Subject: [PATCH 41/46] prelim fixes --- XIVSlothCombo/Combos/JobHelpers/AST.cs | 18 +++++++++--------- XIVSlothCombo/Combos/PvE/ALL.cs | 6 +++--- XIVSlothCombo/Core/IconReplacer.cs | 8 ++++---- XIVSlothCombo/CustomCombo/CustomCombo.cs | 2 +- .../CustomCombo/Functions/PlayerCharacter.cs | 2 +- XIVSlothCombo/Data/ActionWatching.cs | 8 ++++---- XIVSlothCombo/Window/Tabs/Debug.cs | 7 +++---- XIVSlothCombo/XIVSlothCombo.cs | 8 ++++---- 8 files changed, 29 insertions(+), 30 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/AST.cs b/XIVSlothCombo/Combos/JobHelpers/AST.cs index d5b7ea2b8..34360304c 100644 --- a/XIVSlothCombo/Combos/JobHelpers/AST.cs +++ b/XIVSlothCombo/Combos/JobHelpers/AST.cs @@ -1,4 +1,4 @@ - using Dalamud.Game.ClientState.JobGauge.Enums; +using Dalamud.Game.ClientState.JobGauge.Enums; using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Plugin.Services; using ECommons.DalamudServices; @@ -21,7 +21,7 @@ internal static void Init() private static void CheckCards(IFramework framework) { - if (Svc.ClientState.LocalPlayer is null || Svc.ClientState.LocalPlayer.ClassJob.Id != 33) + if (Svc.ClientState.LocalPlayer is null || Svc.ClientState.LocalPlayer.ClassJob.RowId != 33) return; if (Svc.Condition[Dalamud.Game.ClientState.Conditions.ConditionFlag.BetweenAreas] || Svc.Condition[Dalamud.Game.ClientState.Conditions.ConditionFlag.Unconscious]) @@ -55,8 +55,8 @@ private static bool BetterTargetAvailable() return true; var m = AST_QuickTargetCards.SelectedRandomMember as IBattleChara; - if ((DrawnCard is CardType.BALANCE && CustomComboFunctions.JobIDs.Melee.Any(x => x == m.ClassJob.Id)) || - (DrawnCard is CardType.SPEAR && CustomComboFunctions.JobIDs.Ranged.Any(x => x == m.ClassJob.Id))) + if ((DrawnCard is CardType.BALANCE && CustomComboFunctions.JobIDs.Melee.Any(x => x == m.ClassJob.RowId)) || + (DrawnCard is CardType.SPEAR && CustomComboFunctions.JobIDs.Ranged.Any(x => x == m.ClassJob.RowId))) return false; var targets = new List(); @@ -80,8 +80,8 @@ private static bool BetterTargetAvailable() } if (targets.Count == 0) return false; - if ((DrawnCard is CardType.BALANCE && targets.Any(x => CustomComboFunctions.JobIDs.Melee.Any(y => y == x.ClassJob.Id))) || - (DrawnCard is CardType.SPEAR && targets.Any(x => CustomComboFunctions.JobIDs.Ranged.Any(y => y == x.ClassJob.Id)))) + if ((DrawnCard is CardType.BALANCE && targets.Any(x => CustomComboFunctions.JobIDs.Melee.Any(y => y == x.ClassJob.RowId))) || + (DrawnCard is CardType.SPEAR && targets.Any(x => CustomComboFunctions.JobIDs.Ranged.Any(y => y == x.ClassJob.RowId)))) { AST_QuickTargetCards.SelectedRandomMember = null; return true; @@ -172,7 +172,7 @@ private static bool SetTarget() //Give card to DPS first for (int i = 0; i <= PartyTargets.Count - 1; i++) { - byte job = PartyTargets[i] is IBattleChara ? (byte)(PartyTargets[i] as IBattleChara).ClassJob.Id : (byte)0; + byte job = PartyTargets[i] is IBattleChara ? (byte)(PartyTargets[i] as IBattleChara).ClassJob.RowId : (byte)0; if (((cardDrawn is CardType.BALANCE) && JobIDs.Melee.Contains(job)) || ((cardDrawn is CardType.SPEAR) && JobIDs.Ranged.Contains(job))) { @@ -184,7 +184,7 @@ private static bool SetTarget() //Give card to unsuitable DPS next for (int i = 0; i <= PartyTargets.Count - 1; i++) { - byte job = PartyTargets[i] is IBattleChara ? (byte)(PartyTargets[i] as IBattleChara).ClassJob.Id : (byte)0; + byte job = PartyTargets[i] is IBattleChara ? (byte)(PartyTargets[i] as IBattleChara).ClassJob.RowId : (byte)0; if (((cardDrawn is CardType.BALANCE) && JobIDs.Ranged.Contains(job)) || ((cardDrawn is CardType.SPEAR) && JobIDs.Melee.Contains(job))) { @@ -199,7 +199,7 @@ private static bool SetTarget() { for (int i = 0; i <= PartyTargets.Count - 1; i++) { - byte job = PartyTargets[i] is IBattleChara ? (byte)(PartyTargets[i] as IBattleChara).ClassJob.Id : (byte)0; + byte job = PartyTargets[i] is IBattleChara ? (byte)(PartyTargets[i] as IBattleChara).ClassJob.RowId : (byte)0; if ((cardDrawn is CardType.BALANCE && JobIDs.Tank.Contains(job)) || (cardDrawn is CardType.SPEAR && JobIDs.Healer.Contains(job))) { diff --git a/XIVSlothCombo/Combos/PvE/ALL.cs b/XIVSlothCombo/Combos/PvE/ALL.cs index f6d049e16..f885cab02 100644 --- a/XIVSlothCombo/Combos/PvE/ALL.cs +++ b/XIVSlothCombo/Combos/PvE/ALL.cs @@ -134,7 +134,7 @@ internal class ALL_Healer_Raise : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { if ((actionID is WHM.Raise or AST.Ascend or SGE.Egeiro) - || (actionID is SCH.Resurrection && LocalPlayer.ClassJob.Id is SCH.JobID)) + || (actionID is SCH.Resurrection && LocalPlayer.ClassJob.RowId is SCH.JobID)) { if (ActionReady(Swiftcast)) return Swiftcast; @@ -173,13 +173,13 @@ internal class ALL_Caster_Raise : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { if ((actionID is BLU.AngelWhisper or RDM.Verraise) - || (actionID is SMN.Resurrection && LocalPlayer.ClassJob.Id is SMN.JobID)) + || (actionID is SMN.Resurrection && LocalPlayer.ClassJob.RowId is SMN.JobID)) { if (HasEffect(Buffs.Swiftcast) || HasEffect(RDM.Buffs.Dualcast)) return actionID; if (IsOffCooldown(Swiftcast)) return Swiftcast; - if (LocalPlayer.ClassJob.Id is RDM.JobID && + if (LocalPlayer.ClassJob.RowId is RDM.JobID && ActionReady(RDM.Vercure)) return RDM.Vercure; } diff --git a/XIVSlothCombo/Core/IconReplacer.cs b/XIVSlothCombo/Core/IconReplacer.cs index 8f0c46496..2df9bf302 100644 --- a/XIVSlothCombo/Core/IconReplacer.cs +++ b/XIVSlothCombo/Core/IconReplacer.cs @@ -64,8 +64,8 @@ private unsafe uint GetIconDetour(IntPtr actionManager, uint actionID) return OriginalHook(actionID); if (ClassLocked() || - (DisabledJobsPVE.Any(x => x == Svc.ClientState.LocalPlayer.ClassJob.Id) && !Svc.ClientState.IsPvP) || - (DisabledJobsPVP.Any(x => x == Svc.ClientState.LocalPlayer.ClassJob.Id) && Svc.ClientState.IsPvP)) + (DisabledJobsPVE.Any(x => x == Svc.ClientState.LocalPlayer.ClassJob.RowId) && !Svc.ClientState.IsPvP) || + (DisabledJobsPVP.Any(x => x == Svc.ClientState.LocalPlayer.ClassJob.RowId) && Svc.ClientState.IsPvP)) return OriginalHook(actionID); uint lastComboMove = ActionManager.Instance()->Combo.Action; @@ -95,14 +95,14 @@ public unsafe static bool ClassLocked() if (Svc.ClientState.LocalPlayer.Level <= 35) return false; - if (Svc.ClientState.LocalPlayer.ClassJob.Id is + if (Svc.ClientState.LocalPlayer.ClassJob.RowId is (>= 8 and <= 25) or 27 or 28 or >= 30) return false; if (!UIState.Instance()->IsUnlockLinkUnlockedOrQuestCompleted(66049)) return false; - if ((Svc.ClientState.LocalPlayer.ClassJob.Id is 1 or 2 or 3 or 4 or 5 or 6 or 7 or 26 or 29) && + if ((Svc.ClientState.LocalPlayer.ClassJob.RowId is 1 or 2 or 3 or 4 or 5 or 6 or 7 or 26 or 29) && Svc.Condition[Dalamud.Game.ClientState.Conditions.ConditionFlag.BoundByDuty] && Svc.ClientState.LocalPlayer.Level > 35) return true; diff --git a/XIVSlothCombo/CustomCombo/CustomCombo.cs b/XIVSlothCombo/CustomCombo/CustomCombo.cs index 9767aae47..31e74b21a 100644 --- a/XIVSlothCombo/CustomCombo/CustomCombo.cs +++ b/XIVSlothCombo/CustomCombo/CustomCombo.cs @@ -49,7 +49,7 @@ public unsafe bool TryInvoke(uint actionID, byte level, uint lastComboMove, floa if (!IsEnabled(Preset)) return false; - uint classJobID = LocalPlayer!.ClassJob.Id; + uint classJobID = LocalPlayer!.ClassJob.RowId; if (classJobID is >= 8 and <= 15) classJobID = DOH.JobID; diff --git a/XIVSlothCombo/CustomCombo/Functions/PlayerCharacter.cs b/XIVSlothCombo/CustomCombo/Functions/PlayerCharacter.cs index b11fd5660..509ab116f 100644 --- a/XIVSlothCombo/CustomCombo/Functions/PlayerCharacter.cs +++ b/XIVSlothCombo/CustomCombo/Functions/PlayerCharacter.cs @@ -2,7 +2,7 @@ using Dalamud.Game.ClientState.Objects.SubKinds; using ECommons.DalamudServices; using FFXIVClientStructs.FFXIV.Client.Game.UI; -using Lumina.Excel.GeneratedSheets; +using Lumina.Excel.Sheets; using GameMain = FFXIVClientStructs.FFXIV.Client.Game.GameMain; namespace XIVSlothCombo.CustomComboNS.Functions diff --git a/XIVSlothCombo/Data/ActionWatching.cs b/XIVSlothCombo/Data/ActionWatching.cs index a00b8ae56..7bfb957b3 100644 --- a/XIVSlothCombo/Data/ActionWatching.cs +++ b/XIVSlothCombo/Data/ActionWatching.cs @@ -4,7 +4,7 @@ using ECommons.DalamudServices; using ECommons.GameFunctions; using FFXIVClientStructs.FFXIV.Client.Game; -using Lumina.Excel.GeneratedSheets; +using Lumina.Excel.Sheets; using System; using System.Collections.Generic; using System.Linq; @@ -18,11 +18,11 @@ namespace XIVSlothCombo.Data { public static class ActionWatching { - internal static Dictionary ActionSheet = Svc.Data.GetExcelSheet()! + internal static Dictionary ActionSheet = Svc.Data.GetExcelSheet()! .Where(i => i.RowId is not 7) .ToDictionary(i => i.RowId, i => i); - internal static Dictionary StatusSheet = Svc.Data.GetExcelSheet()! + internal static Dictionary StatusSheet = Svc.Data.GetExcelSheet()! .ToDictionary(i => i.RowId, i => i); internal static Dictionary TraitSheet = Svc.Data.GetExcelSheet()! @@ -302,7 +302,7 @@ public static ActionAttackType GetAttackType(uint id) { if (!ActionSheet.TryGetValue(id, out var action)) return ActionAttackType.Unknown; - return action.ActionCategory.Row switch + return action.ActionCategory.RowId switch { 2 => ActionAttackType.Spell, 3 => ActionAttackType.Weaponskill, diff --git a/XIVSlothCombo/Window/Tabs/Debug.cs b/XIVSlothCombo/Window/Tabs/Debug.cs index 06df7e63b..2847987e9 100644 --- a/XIVSlothCombo/Window/Tabs/Debug.cs +++ b/XIVSlothCombo/Window/Tabs/Debug.cs @@ -7,7 +7,7 @@ using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game.UI; using ImGuiNET; -using Lumina.Excel.GeneratedSheets; +using Lumina.Excel.Sheets; using System; using System.Linq; using XIVSlothCombo.Combos; @@ -15,8 +15,7 @@ using XIVSlothCombo.CustomComboNS.Functions; using XIVSlothCombo.Data; using XIVSlothCombo.Services; -using static XIVSlothCombo.Combos.JobHelpers.NIN; -using Action = Lumina.Excel.GeneratedSheets.Action; +using Action = Lumina.Excel.Sheets.Action; using Status = Dalamud.Game.ClientState.Statuses.Status; namespace XIVSlothCombo.Window.Tabs @@ -176,7 +175,7 @@ static void CustomStyleText(string label, object? value) ImGui.Spacing(); ImGui.Text("Player Info"); ImGui.Separator(); - CustomStyleText("Job:", $"{LocalPlayer.ClassJob.GameData.NameEnglish} (ID: {LocalPlayer.ClassJob.Id})"); + CustomStyleText("Job:", $"{LocalPlayer.ClassJob.GameData.NameEnglish} (ID: {LocalPlayer.ClassJob.RowId})"); CustomStyleText("Zone:", $"{Svc.Data.GetExcelSheet()?.FirstOrDefault(x => x.RowId == Svc.ClientState.TerritoryType).PlaceName.Value.Name} (ID: {Svc.ClientState.TerritoryType})"); CustomStyleText("In PvP:", CustomComboFunctions.InPvP()); CustomStyleText("In Combat:", CustomComboFunctions.InCombat()); diff --git a/XIVSlothCombo/XIVSlothCombo.cs b/XIVSlothCombo/XIVSlothCombo.cs index 8e21ca3a3..d125b87ac 100644 --- a/XIVSlothCombo/XIVSlothCombo.cs +++ b/XIVSlothCombo/XIVSlothCombo.cs @@ -160,7 +160,7 @@ private static void HandleConflictedCombos() private void OnFrameworkUpdate(IFramework framework) { if (Svc.ClientState.LocalPlayer is not null) - JobID = Svc.ClientState.LocalPlayer?.ClassJob?.Id; + JobID = Svc.ClientState.LocalPlayer?.ClassJob.RowId; BlueMageService.PopulateBLUSpells(); TargetHelper.Draw(); @@ -434,10 +434,10 @@ private void OnCommand(string command, string arguments) $"{Svc.ClientState.LocalPlayer.ClassJob.GameData.Name} / " + // - Client Name $"{Svc.ClientState.LocalPlayer.ClassJob.GameData.NameEnglish} / " + // - EN Name $"{Svc.ClientState.LocalPlayer.ClassJob.GameData.Abbreviation}"); // - Abbreviation - file.WriteLine($"Current Job Index: {Svc.ClientState.LocalPlayer.ClassJob.Id}"); // Job Index + file.WriteLine($"Current Job Index: {Svc.ClientState.LocalPlayer.ClassJob.RowId}"); // Job Index file.WriteLine($"Current Job Level: {Svc.ClientState.LocalPlayer.Level}"); // Job Level file.WriteLine(""); - file.WriteLine($"Current Zone: {Svc.Data.GetExcelSheet()?.FirstOrDefault(x => x.RowId == Svc.ClientState.TerritoryType).PlaceName.Value.Name}"); // Current zone location + file.WriteLine($"Current Zone: {Svc.Data.GetExcelSheet()?.FirstOrDefault(x => x.RowId == Svc.ClientState.TerritoryType).PlaceName.Value.Name}"); // Current zone location file.WriteLine($"Current Party Size: {Svc.Party.Length}"); // Current party size file.WriteLine(""); file.WriteLine($"START ENABLED FEATURES"); @@ -500,7 +500,7 @@ private void OnCommand(string command, string arguments) else { var jobname = ConfigWindow.groupedPresets.Where(x => x.Value.Any(y => y.Info.JobShorthand.Equals(specificJob.ToLower(), StringComparison.CurrentCultureIgnoreCase))).FirstOrDefault().Key; - var jobID = Svc.Data.GetExcelSheet()? + var jobID = Svc.Data.GetExcelSheet()? .Where(x => x.Name.RawString.Equals(jobname, StringComparison.CurrentCultureIgnoreCase)) .First() .RowId; From 6d810d892af1ac6afbb8def572e580adb89be091 Mon Sep 17 00:00:00 2001 From: nativepapaya Date: Sat, 16 Nov 2024 16:34:26 -0500 Subject: [PATCH 42/46] Simplified triplecast fire iv dump logic --- XIVSlothCombo/Combos/PvE/BLM.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 161d93486..6c9248291 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -424,11 +424,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) return OriginalHook(Thunder); - if (HasPolyglotStacks(Gauge) && gcdsInTimer >= 1 && - (ActionReady(All.Swiftcast) || - (ActionReady(Triplecast) && - GetBuffStacks(Buffs.Triplecast) == 0 && - GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)))) + if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && + PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && + GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; From b8298118db8473d0d5005b352f6b3c7fb81986be Mon Sep 17 00:00:00 2001 From: nativepapaya Date: Sat, 16 Nov 2024 16:49:40 -0500 Subject: [PATCH 43/46] Added a check for umbral xeno to prevent firestarter from expiring --- ECommons | 2 +- XIVSlothCombo/Combos/PvE/BLM.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ECommons b/ECommons index d77c9db19..0e0cc76e4 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit d77c9db195056fca9e855c7d142bc6cd8566258f +Subproject commit 0e0cc76e4197e28b2576502f8a059815ce0a3aa4 diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index 6c9248291..e1bd2dcd3 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -426,7 +426,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && - GetRemainingCharges(Triplecast) == GetMaxCharges(Triplecast)) + IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && + canWeave && ActionReady(Triplecast) && + GetBuffStacks(Buffs.Triplecast) == 0 && + (GetRemainingCharges(Triplecast) > Config.BLM_ST_Triplecast_HoldCharges || + TriplecastChargetime <= Config.BLM_ST_Triplecast_ChargeTime)) return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; @@ -492,7 +496,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Paradox; if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && - PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges) + PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && + GetBuffRemainingTime(Buffs.Firestarter) > 3) return LevelChecked(Xenoglossy) ? Xenoglossy : Foul; From dd01a3f781a4b4f229b3a7251a5240cbe8a1315f Mon Sep 17 00:00:00 2001 From: nativepapaya Date: Sat, 16 Nov 2024 16:51:25 -0500 Subject: [PATCH 44/46] Added extra check for firestarter --- XIVSlothCombo/Combos/PvE/BLM.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index e1bd2dcd3..bdd2f7fcb 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -497,6 +497,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && + HasEffect(Buffs.Firestarter) && GetBuffRemainingTime(Buffs.Firestarter) > 3) return LevelChecked(Xenoglossy) ? Xenoglossy From 36bceac4927e580a6ef521f717274817ce9a3658 Mon Sep 17 00:00:00 2001 From: Kage Date: Sat, 16 Nov 2024 23:39:32 +0100 Subject: [PATCH 45/46] merge? --- ECommons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ECommons b/ECommons index 0e0cc76e4..d77c9db19 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit 0e0cc76e4197e28b2576502f8a059815ce0a3aa4 +Subproject commit d77c9db195056fca9e855c7d142bc6cd8566258f From 09062b6f8b6c05f926e58792ff29dacff9adc2a5 Mon Sep 17 00:00:00 2001 From: Kage Date: Sun, 17 Nov 2024 00:16:55 +0100 Subject: [PATCH 46/46] some cleanup --- XIVSlothCombo/Combos/JobHelpers/BLM.cs | 43 ++-- XIVSlothCombo/Combos/PvE/BLM.cs | 259 +++++++++++++------------ 2 files changed, 157 insertions(+), 145 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/BLM.cs b/XIVSlothCombo/Combos/JobHelpers/BLM.cs index efe1d1f0a..5dd5166d6 100644 --- a/XIVSlothCombo/Combos/JobHelpers/BLM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/BLM.cs @@ -15,24 +15,33 @@ namespace XIVSlothCombo.Combos.JobHelpers; internal class BLM { // BLM Gauge & Extensions - public static BLMGauge Gauge => GetJobGauge(); - public static int Fire4Count => ActionWatching.CombatActions.Count(x => x == Fire4); - public static int maxPolyglot => TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : + public static BLMGauge Gauge = GetJobGauge(); + public static int Fire4Count = ActionWatching.CombatActions.Count(x => x == Fire4); + + public static int maxPolyglot = TraitLevelChecked(Traits.EnhancedPolyglotII) ? 3 : TraitLevelChecked(Traits.EnhancedPolyglot) ? 2 : 1; - public static bool canWeave => CanSpellWeave(ActionWatching.LastSpell); - public static float elementTimer => Gauge.ElementTimeRemaining / 1000f; - public static double gcdsInTimer => Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); - public static int remainingPolyglotCD => Math.Max(0, + + public static bool canWeave = CanSpellWeave(ActionWatching.LastSpell); + public static float elementTimer = Gauge.ElementTimeRemaining / 1000f; + public static double gcdsInTimer = Math.Floor(elementTimer / GetActionCastTime(ActionWatching.LastSpell)); + + public static int remainingPolyglotCD = Math.Max(0, (maxPolyglot - Gauge.PolyglotStacks) * 30000 + (Gauge.EnochianTimer - 30000)); - public static Status? thunderDebuffST => + + public static Status? thunderDebuffST = FindEffect(ThunderList[OriginalHook(Thunder)], CurrentTarget, LocalPlayer.GameObjectId); - public static Status? thunderDebuffAoE => + + public static Status? thunderDebuffAoE = FindEffect(ThunderList[OriginalHook(Thunder2)], CurrentTarget, LocalPlayer.GameObjectId); - public static bool canSwiftF => TraitLevelChecked(Traits.AspectMasteryIII) && - IsOffCooldown(All.Swiftcast); - public static uint curMp => LocalPlayer.CurrentMp; + + public static bool canSwiftF = TraitLevelChecked(Traits.AspectMasteryIII) && + IsOffCooldown(All.Swiftcast); + + public static uint curMp = LocalPlayer.CurrentMp; + public static BLMOpenerLogic BLMOpener = new(); + public static bool HasPolyglotStacks(BLMGauge gauge) => gauge.PolyglotStacks > 0; - + internal class BLMOpenerLogic { private OpenerState currentState = OpenerState.PrePull; @@ -154,7 +163,7 @@ private bool DoOpener(ref uint actionID) if (WasLastAction(Manafont) && OpenerStep == 12) OpenerStep++; else if (OpenerStep == 12) actionID = Manafont; - + if (WasLastAction(Fire4) && Fire4Count is 5 && OpenerStep == 13) OpenerStep++; else if (OpenerStep == 13) actionID = Fire4; @@ -250,11 +259,11 @@ public static float MPAfterCast() 1 => 2500, 2 => 5000, 3 => 10000, - _ => 0 + var _ => 0 }; - return castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2 - ? Math.Max(LocalPlayer.MaxMp, LocalPlayer.CurrentMp + nextMpGain) + return castedSpell is Blizzard or Blizzard2 or Blizzard3 or Blizzard4 or Freeze or HighBlizzard2 + ? Math.Max(LocalPlayer.MaxMp, LocalPlayer.CurrentMp + nextMpGain) : Math.Max(0, LocalPlayer.CurrentMp - GetResourceCost(castedSpell)); } diff --git a/XIVSlothCombo/Combos/PvE/BLM.cs b/XIVSlothCombo/Combos/PvE/BLM.cs index bdd2f7fcb..8362fccf7 100644 --- a/XIVSlothCombo/Combos/PvE/BLM.cs +++ b/XIVSlothCombo/Combos/PvE/BLM.cs @@ -11,124 +11,6 @@ namespace XIVSlothCombo.Combos.PvE; internal class BLM { - public const byte ClassID = 7; - public const byte JobID = 25; - - public const uint - Fire = 141, - Blizzard = 142, - Thunder = 144, - Fire2 = 147, - Transpose = 149, - Fire3 = 152, - Thunder3 = 153, - Blizzard3 = 154, - AetherialManipulation = 155, - Scathe = 156, - Manafont = 158, - Freeze = 159, - Flare = 162, - LeyLines = 3573, - Blizzard4 = 3576, - Fire4 = 3577, - BetweenTheLines = 7419, - Thunder4 = 7420, - Triplecast = 7421, - Foul = 7422, - Thunder2 = 7447, - Despair = 16505, - UmbralSoul = 16506, - Xenoglossy = 16507, - Blizzard2 = 25793, - HighFire2 = 25794, - HighBlizzard2 = 25795, - Amplifier = 25796, - Paradox = 25797, - HighThunder = 36986, - HighThunder2 = 36987, - FlareStar = 36989; - - internal static BLMOpenerLogic BLMOpener = new(); - - // Debuff Pairs of Actions and Debuff - public static readonly Dictionary - ThunderList = new() - { - { Thunder, Debuffs.Thunder }, - { Thunder2, Debuffs.Thunder2 }, - { Thunder3, Debuffs.Thunder3 }, - { Thunder4, Debuffs.Thunder4 }, - { HighThunder, Debuffs.HighThunder }, - { HighThunder2, Debuffs.HighThunder2 } - }; - - protected static int nextMpGain => Gauge.UmbralIceStacks switch - { - 0 => 0, - 1 => 2500, - 2 => 5000, - 3 => 10000, - var _ => 0 - }; - - public static class Buffs - { - public const ushort - Thundercloud = 164, - Firestarter = 165, - LeyLines = 737, - CircleOfPower = 738, - Sharpcast = 867, - Triplecast = 1211, - Thunderhead = 3870; - } - - public static class Debuffs - { - public const ushort - Thunder = 161, - Thunder2 = 162, - Thunder3 = 163, - Thunder4 = 1210, - HighThunder = 3871, - HighThunder2 = 3872; - } - - public static class Traits - { - public const uint - UmbralHeart = 295, - EnhancedPolyglot = 297, - AspectMasteryIII = 459, - EnhancedFoul = 461, - EnhancedManafont = 463, - Enochian = 460, - EnhancedPolyglotII = 615; - } - - public static class MP - { - public const int MaxMP = 10000; - - public const int AllMPSpells = 800; //"ALL MP" spell. Only caring about the absolute minimum. - - public static int FireI => GetResourceCost(OriginalHook(Fire)); - - public static int FlareAoE => GetResourceCost(OriginalHook(Flare)); - - public static int FireAoE => GetResourceCost(OriginalHook(Fire2)); - - public static int FireIII => GetResourceCost(OriginalHook(Fire3)); - - public static int BlizzardAoE => GetResourceCost(OriginalHook(Blizzard2)); - - public static int BlizzardI => GetResourceCost(OriginalHook(Blizzard)); - - public static int Freeze => GetResourceCost(OriginalHook(BLM.Freeze)); - - public static int Despair => GetResourceCost(OriginalHook(BLM.Despair)); - } - public static class Config { public static UserInt @@ -406,7 +288,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim canWeave && ActionReady(All.Swiftcast) && GetBuffStacks(Buffs.Triplecast) == 0) return All.Swiftcast; - + return FlareStar; } @@ -419,13 +301,13 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim (GetRemainingCharges(Triplecast) > Config.BLM_ST_Triplecast_HoldCharges || TriplecastChargetime <= Config.BLM_ST_Triplecast_ChargeTime)) return Triplecast; - + if (HasEffect(Buffs.Thunderhead) && gcdsInTimer > 1 && (thunderDebuffST is null || thunderDebuffST.RemainingTime < 3)) return OriginalHook(Thunder); if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && - PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && + PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && IsEnabled(CustomComboPreset.BLM_ST_Triplecast) && canWeave && ActionReady(Triplecast) && GetBuffStacks(Buffs.Triplecast) == 0 && @@ -434,10 +316,10 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Xenoglossy.LevelChecked() ? Xenoglossy : Foul; - + return Fire4; } - + if (curMp >= MP.FireI) return Fire; @@ -497,7 +379,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.BLM_ST_UsePolyglot) && PolyglotStacks > Config.BLM_ST_UsePolyglot_HoldCharges && - HasEffect(Buffs.Firestarter) && + HasEffect(Buffs.Firestarter) && GetBuffRemainingTime(Buffs.Firestarter) > 3) return LevelChecked(Xenoglossy) ? Xenoglossy @@ -523,11 +405,12 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return Fire3; } - if (Blizzard3.LevelChecked()) - return Blizzard3; - return actionID; - } + if (Blizzard3.LevelChecked()) + return Blizzard3; + + return actionID; } + } internal class BLM_AoE_SimpleMode : CustomCombo { @@ -926,4 +809,124 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim : actionID; } } + + #region ID's + + public const byte ClassID = 7; + public const byte JobID = 25; + + public const uint + Fire = 141, + Blizzard = 142, + Thunder = 144, + Fire2 = 147, + Transpose = 149, + Fire3 = 152, + Thunder3 = 153, + Blizzard3 = 154, + AetherialManipulation = 155, + Scathe = 156, + Manafont = 158, + Freeze = 159, + Flare = 162, + LeyLines = 3573, + Blizzard4 = 3576, + Fire4 = 3577, + BetweenTheLines = 7419, + Thunder4 = 7420, + Triplecast = 7421, + Foul = 7422, + Thunder2 = 7447, + Despair = 16505, + UmbralSoul = 16506, + Xenoglossy = 16507, + Blizzard2 = 25793, + HighFire2 = 25794, + HighBlizzard2 = 25795, + Amplifier = 25796, + Paradox = 25797, + HighThunder = 36986, + HighThunder2 = 36987, + FlareStar = 36989; + + // Debuff Pairs of Actions and Debuff + public static readonly Dictionary + ThunderList = new() + { + { Thunder, Debuffs.Thunder }, + { Thunder2, Debuffs.Thunder2 }, + { Thunder3, Debuffs.Thunder3 }, + { Thunder4, Debuffs.Thunder4 }, + { HighThunder, Debuffs.HighThunder }, + { HighThunder2, Debuffs.HighThunder2 } + }; + + protected static int nextMpGain => Gauge.UmbralIceStacks switch + { + 0 => 0, + 1 => 2500, + 2 => 5000, + 3 => 10000, + var _ => 0 + }; + + public static class Buffs + { + public const ushort + Thundercloud = 164, + Firestarter = 165, + LeyLines = 737, + CircleOfPower = 738, + Sharpcast = 867, + Triplecast = 1211, + Thunderhead = 3870; + } + + public static class Debuffs + { + public const ushort + Thunder = 161, + Thunder2 = 162, + Thunder3 = 163, + Thunder4 = 1210, + HighThunder = 3871, + HighThunder2 = 3872; + } + + public static class Traits + { + public const uint + UmbralHeart = 295, + EnhancedPolyglot = 297, + AspectMasteryIII = 459, + EnhancedFoul = 461, + EnhancedManafont = 463, + Enochian = 460, + EnhancedPolyglotII = 615; + } + + public static class MP + { + public const int MaxMP = 10000; + + public const int AllMPSpells = 800; //"ALL MP" spell. Only caring about the absolute minimum. + + public static int FireI => GetResourceCost(OriginalHook(Fire)); + + public static int FlareAoE => GetResourceCost(OriginalHook(Flare)); + + public static int FireAoE => GetResourceCost(OriginalHook(Fire2)); + + public static int FireIII => GetResourceCost(OriginalHook(Fire3)); + + public static int BlizzardAoE => GetResourceCost(OriginalHook(Blizzard2)); + + public static int BlizzardI => GetResourceCost(OriginalHook(Blizzard)); + + public static int Freeze => GetResourceCost(OriginalHook(BLM.Freeze)); + + public static int Despair => GetResourceCost(OriginalHook(BLM.Despair)); + } + + #endregion } \ No newline at end of file