From 1d0b32b96c6bf736d77d9bd62d64e570f8492275 Mon Sep 17 00:00:00 2001 From: Tartarga <109563717+Tartarga@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:33:53 -0500 Subject: [PATCH 1/2] RDM Dawntrail 2 JobHelpers/RDM.cs - Class RDM changed to RDMHelper for clarity - ManaBalancer changed to RDMMana, as it's role is expanded - Acts as a pseudogauge - Takes Gauge Mana and adds fake mana from MagickedSwordPlay buff. - Includes Min/Max mathematics - OGCDHelper - Vice of Thorns and Prefulgence added to oGCD Feature PvE/RDM.cs - Removed Gauge, replaced with RDMMana class - Vice of Thorns, Prefulgence, and Grand Impact Added. Status.cs - GetBuffStacks return value changed from float to byte to match FindEffect.StackCount's return. --- XIVSlothCombo/Combos/JobHelpers/RDM.cs | 60 +++++- XIVSlothCombo/Combos/PvE/RDM.cs | 196 ++++++++++-------- XIVSlothCombo/CustomCombo/Functions/Status.cs | 2 +- XIVSlothCombo/Window/Functions/UserConfig.cs | 4 + 4 files changed, 165 insertions(+), 97 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/RDM.cs b/XIVSlothCombo/Combos/JobHelpers/RDM.cs index fd47b8978..bd7d58cf9 100644 --- a/XIVSlothCombo/Combos/JobHelpers/RDM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/RDM.cs @@ -1,9 +1,11 @@ -using XIVSlothCombo.Combos.PvE; +using Dalamud.Game.ClientState.JobGauge.Types; +using System; +using XIVSlothCombo.Combos.PvE; using XIVSlothCombo.CustomComboNS.Functions; namespace XIVSlothCombo.Combos.JobHelpers { - internal class RDM + internal class RDMHelper { static bool HasEffect(ushort id) => CustomComboFunctions.HasEffect(id); static float GetBuffRemainingTime(ushort effectid) => CustomComboFunctions.GetBuffRemainingTime(effectid); @@ -14,8 +16,10 @@ internal class RDM static bool ActionReady(uint id) => CustomComboFunctions.ActionReady(id); static bool CanSpellWeave(uint id) => CustomComboFunctions.CanSpellWeave(id); static bool HasCharges(uint id) => CustomComboFunctions.HasCharges(id); + static bool TraitLevelChecked(uint id) => CustomComboFunctions.TraitLevelChecked(id); + static byte GetBuffStacks(ushort id) => CustomComboFunctions.GetBuffStacks(id); - internal class ManaBalancer : PvE.RDM + internal class RDMMana : PvE.RDM { internal bool useFire; internal bool useStone; @@ -24,6 +28,29 @@ internal class ManaBalancer : PvE.RDM internal bool useThunder2; internal bool useAero2; + private static RDMGauge Gauge => CustomComboFunctions.GetJobGauge(); + internal static int ManaStacks => Gauge.ManaStacks; + internal static int Black => AdjustMana(Gauge.BlackMana); + internal static int White => AdjustMana(Gauge.WhiteMana); + internal static int Min => AdjustMana(Math.Min(Gauge.BlackMana, Gauge.WhiteMana)); + internal static int Max => AdjustMana(Math.Max(Gauge.BlackMana, Gauge.WhiteMana)); + private static int AdjustMana(byte mana) + { + if (LevelChecked(Manafication)) + { + byte magickedSword = GetBuffStacks(Buffs.MagickedSwordPlay); + byte magickedSwordMana = magickedSword switch + { + 3 => 50, + 2 => 30, + 1 => 15, + _ => 0 + }; + return (mana + magickedSwordMana); + } + else return mana; + } + internal void CheckBalance() { //SYSTEM_MANA_BALANCING_MACHINE @@ -40,8 +67,10 @@ internal void CheckBalance() // - Resolution adds 4/4 mana //2.Stay within difference limit [DONE] //3.Strive to achieve correct mana for double melee combo burst [DONE] - int blackmana = Gauge.BlackMana; - int whitemana = Gauge.WhiteMana; + int blackmana = Black; + int whitemana = White; + //int blackmana = Gauge.BlackMana; + //int whitemana = Gauge.WhiteMana; //Reset outputs useFire = false; useStone = false; @@ -91,10 +120,10 @@ internal class MeleeFinisher : PvE.RDM { internal static bool CanUse(in uint lastComboMove, out uint actionID) { - int blackmana = Gauge.BlackMana; - int whitemana = Gauge.WhiteMana; + int blackmana = RDMMana.Black; + int whitemana = RDMMana.White; - if (Gauge.ManaStacks >= 3) + if (RDMMana.ManaStacks >= 3) { if (blackmana >= whitemana && LevelChecked(Verholy)) { @@ -154,6 +183,8 @@ internal static bool CanUse(in uint actionID, in bool SingleTarget, out uint new bool fleche = SingleTarget ? Config.RDM_ST_oGCD_Fleche : Config.RDM_AoE_oGCD_Fleche; bool contra = SingleTarget ? Config.RDM_ST_oGCD_ContraSixte : Config.RDM_AoE_oGCD_ContraSixte; bool engagement = SingleTarget ? Config.RDM_ST_oGCD_Engagement : Config.RDM_AoE_oGCD_Engagement; + bool vice = SingleTarget ? Config.RDM_ST_oGCD_ViceOfThorns : Config.RDM_AoE_oGCD_ViceOfThorns; + bool prefulg = SingleTarget ? Config.RDM_ST_oGCD_Prefulgence : Config.RDM_AoE_oGCD_Prefulgence; int engagementPool = (SingleTarget && Config.RDM_ST_oGCD_Engagement_Pooling) || (!SingleTarget && Config.RDM_AoE_oGCD_Engagement_Pooling) ? 1 : 0; bool corpacorps = SingleTarget ? Config.RDM_ST_oGCD_CorpACorps : Config.RDM_AoE_oGCD_CorpACorps; @@ -175,12 +206,23 @@ internal static bool CanUse(in uint actionID, in bool SingleTarget, out uint new && LevelChecked(Corpsacorps) && distance <= corpacorpsRange) placeOGCD = Corpsacorps; + if (contra && ActionReady(ContreSixte)) placeOGCD = ContreSixte; if (fleche && ActionReady(Fleche)) placeOGCD = Fleche; + if (vice && + TraitLevelChecked(Traits.EnhancedEmbolden) && + HasEffect(Buffs.ThornedFlourish)) + placeOGCD = ViceOfThorns; + + if (prefulg && + TraitLevelChecked(Traits.EnhancedManaficationIII) && + HasEffect(Buffs.PrefulugenceReady)) + placeOGCD = Prefulgence; + if (CanSpellWeave(actionID) && placeOGCD != 0) { newActionID = placeOGCD; @@ -221,7 +263,7 @@ internal class RDMLucid : PvE.RDM internal static bool SafetoUse(in uint lastComboMove) { return - !CustomComboFunctions.HasEffect(Buffs.Dualcast) + !HasEffect(Buffs.Dualcast) && lastComboMove != EnchantedRiposte && lastComboMove != EnchantedZwerchhau && lastComboMove != EnchantedRedoublement diff --git a/XIVSlothCombo/Combos/PvE/RDM.cs b/XIVSlothCombo/Combos/PvE/RDM.cs index 87d1ff8bf..abf920121 100644 --- a/XIVSlothCombo/Combos/PvE/RDM.cs +++ b/XIVSlothCombo/Combos/PvE/RDM.cs @@ -1,15 +1,15 @@ using Dalamud.Game.ClientState.Conditions; -using Dalamud.Game.ClientState.JobGauge.Types; -using System; using XIVSlothCombo.Combos.PvE.Content; using XIVSlothCombo.CustomComboNS; using XIVSlothCombo.CustomComboNS.Functions; -using static XIVSlothCombo.Combos.JobHelpers.RDM; +using static XIVSlothCombo.Combos.JobHelpers.RDMHelper; namespace XIVSlothCombo.Combos.PvE { internal class RDM { + //7.0 Note + //Gauge information is available via RDMMana public const byte JobID = 35; public const uint @@ -48,12 +48,15 @@ public const uint Corpsacorps = 7506, Displacement = 7515, Reprise = 16529, - MagickBarrier = 25857, + ViceOfThorns = 37005, + GrandImpact = 37006, + Prefulgence = 37007, //Buffs Acceleration = 7518, Manafication = 7521, - Embolden = 7520; + Embolden = 7520, + MagickBarrier = 25857; public static class Buffs { @@ -66,7 +69,11 @@ public const ushort Embolden = 1239, EmboldenOthers = 1297, Manafication = 1971, - MagickBarrier = 2707; + MagickBarrier = 2707, + MagickedSwordPlay = 3875, + ThornedFlourish = 3876, + GrandImpactReady = 3877, + PrefulugenceReady = 3878; } public static class Debuffs @@ -74,7 +81,16 @@ public static class Debuffs // public const short placeholder = 0; } - public static RDMGauge Gauge => CustomComboFunctions.GetJobGauge(); + + + public static class Traits + { + public const uint + EnhancedEmbolden = 620, + EnhancedManaficationII = 622, + EnhancedManaficationIII = 622, + EnhancedAccelerationII = 624; + } public static class Config { @@ -92,6 +108,8 @@ public static UserBool RDM_ST_oGCD_CorpACorps = new("RDM_ST_oGCD_CorpACorps"), RDM_ST_oGCD_CorpACorps_Melee = new("RDM_ST_oGCD_CorpACorps_Melee"), RDM_ST_oGCD_CorpACorps_Pooling = new("RDM_ST_oGCD_CorpACorps_Pooling"), + RDM_ST_oGCD_ViceOfThorns = new("RDM_ST_oGCD_ViceOfThorns"), + RDM_ST_oGCD_Prefulgence = new("RDM_ST_oGCD_Prefulgence"), RDM_ST_MeleeCombo_Adv = new("RDM_ST_MeleeCombo_Adv"), RDM_ST_MeleeFinisher_Adv = new("RDM_ST_MeleeFinisher_Adv"), RDM_ST_MeleeEnforced = new("RDM_ST_MeleeEnforced"), @@ -104,6 +122,8 @@ public static UserBool RDM_AoE_oGCD_CorpACorps = new("RDM_AoE_oGCD_CorpACorps"), RDM_AoE_oGCD_CorpACorps_Melee = new("RDM_AoE_oGCD_CorpACorps_Melee"), RDM_AoE_oGCD_CorpACorps_Pooling = new("RDM_AoE_oGCD_CorpACorps_Pooling"), + RDM_AoE_oGCD_ViceOfThorns = new("RDM_AoE_oGCD_ViceOfThorns"), + RDM_AoE_oGCD_Prefulgence = new("RDM_AoE_oGCD_Prefulgence"), RDM_AoE_MeleeCombo_Adv = new("RDM_AoE_MeleeCombo_Adv"), RDM_AoE_MeleeFinisher_Adv = new("RDM_AoE_MeleeFinisher_Adv"); public static UserBoolArray @@ -129,7 +149,7 @@ internal class RDM_ST_DPS : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.RDM_ST_DPS; - protected internal ManaBalancer manaState = new(); + internal RDMMana mana = new(); internal static bool inOpener = false; internal static bool readyOpener = false; internal static bool openerStarted = false; @@ -138,8 +158,9 @@ internal class RDM_ST_DPS : CustomCombo protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { //MAIN_COMBO_VARIABLES - int blackmana = Gauge.BlackMana; - int whitemana = Gauge.WhiteMana; + + int blackmana = RDMMana.Black;//Gauge.BlackMana; + int whitemana = RDMMana.White;//Gauge.WhiteMana; //END_MAIN_COMBO_VARIABLES if (actionID is Jolt or Jolt2 or Jolt3) @@ -276,7 +297,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (step == 11) { - if (lastComboMove == Redoublement || Gauge.ManaStacks == 3) step++; + if (lastComboMove == Redoublement || RDMMana.ManaStacks == 3) step++; else return EnchantedRedoublement; } @@ -395,14 +416,14 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim //Situation 1: Manafication first if (IsEnabled(CustomComboPreset.RDM_ST_MeleeCombo_ManaEmbolden_DoubleCombo) && level >= 90 - && Gauge.ManaStacks == 0 + && RDMMana.ManaStacks == 0 && lastComboMove is not Verflare && lastComboMove is not Verholy && lastComboMove is not Scorch - && Math.Max(blackmana, whitemana) <= 50 - && (Math.Max(blackmana, whitemana) >= 42 + && RDMMana.Max <= 50 + && (RDMMana.Max >= 42 || (IsEnabled(CustomComboPreset.RDM_ST_MeleeCombo_UnbalanceMana) && blackmana == whitemana && blackmana >= 38 && HasCharges(Acceleration))) - && Math.Min(blackmana, whitemana) >= 31 + && RDMMana.Min >= 31 && IsOffCooldown(Manafication) && (IsOffCooldown(Embolden) || GetCooldownRemainingTime(Embolden) <= 3)) { @@ -418,8 +439,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.RDM_ST_MeleeCombo_ManaEmbolden_DoubleCombo) && level >= 90 && lastComboMove is Zwerchhau or EnchantedZwerchhau - && Math.Max(blackmana, whitemana) >= 57 - && Math.Min(blackmana, whitemana) >= 46 + && RDMMana.Max >= 57 + && RDMMana.Min >= 46 && GetCooldownRemainingTime(Manafication) >= 100 && IsOffCooldown(Embolden)) { @@ -430,8 +451,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.RDM_ST_MeleeCombo_ManaEmbolden_DoubleCombo) && level >= 90 && lastComboMove is Zwerchhau or EnchantedZwerchhau - && Math.Max(blackmana, whitemana) <= 57 - && Math.Min(blackmana, whitemana) <= 46 + && RDMMana.Max <= 57 + && RDMMana.Min <= 46 && (GetCooldownRemainingTime(Manafication) <= 7 || IsOffCooldown(Manafication)) && IsOffCooldown(Embolden)) { @@ -439,11 +460,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim } if (IsEnabled(CustomComboPreset.RDM_ST_MeleeCombo_ManaEmbolden_DoubleCombo) && level >= 90 - && (Gauge.ManaStacks == 0 || Gauge.ManaStacks == 3) + && (RDMMana.ManaStacks == 0 || RDMMana.ManaStacks == 3) && lastComboMove is not Verflare && lastComboMove is not Verholy && lastComboMove is not Scorch - && Math.Max(blackmana, whitemana) <= 50 + && RDMMana.Max <= 50 && (HasEffect(Buffs.Embolden) || WasLastAction(Embolden)) && IsOffCooldown(Manafication)) { @@ -453,8 +474,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim //Situation 3: Just use them together if ((IsNotEnabled(CustomComboPreset.RDM_ST_MeleeCombo_ManaEmbolden_DoubleCombo) || level < 90) && ActionReady(Embolden) - && Gauge.ManaStacks == 0 - && Math.Max(blackmana, whitemana) <= 50 + && RDMMana.ManaStacks == 0 + && RDMMana.Max <= 50 && (IsOffCooldown(Manafication) || !LevelChecked(Manafication))) { if (IsEnabled(CustomComboPreset.RDM_ST_MeleeCombo_UnbalanceMana) @@ -467,11 +488,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim } if ((IsNotEnabled(CustomComboPreset.RDM_ST_MeleeCombo_ManaEmbolden_DoubleCombo) || level < 90) && ActionReady(Manafication) - && (Gauge.ManaStacks == 0 || Gauge.ManaStacks == 3) + && (RDMMana.ManaStacks == 0 || RDMMana.ManaStacks == 3) && lastComboMove is not Verflare && lastComboMove is not Verholy && lastComboMove is not Scorch - && Math.Max(blackmana, whitemana) <= 50 + && RDMMana.Max <= 50 && (HasEffect(Buffs.Embolden) || WasLastAction(Embolden))) { return Manafication; @@ -480,7 +501,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim //Situation 4: Level 58 or 59 if (!LevelChecked(Manafication) && ActionReady(Embolden) && - Math.Min(blackmana, whitemana) >= 50) + RDMMana.Min >= 50) { return Embolden; } @@ -501,17 +522,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim return OriginalHook(Redoublement); } - //7.0 Manification Magic Mana - int Mana = Math.Min(Gauge.WhiteMana, Gauge.BlackMana); - if (LevelChecked(Manafication)) - { - int ManaBuff = (int)GetBuffStacks(Buffs.Manafication); - if (ManaBuff > 0) Mana = 50; //ITS FREE REAL ESTATE - } - - if (((Mana >= 50 && LevelChecked(Redoublement)) - || (Mana >= 35 && !LevelChecked(Redoublement)) - || (Mana >= 20 && !LevelChecked(Zwerchhau))) + if (((RDMMana.Min >= 50 && LevelChecked(Redoublement)) + || (RDMMana.Min >= 35 && !LevelChecked(Redoublement)) + || (RDMMana.Min >= 20 && !LevelChecked(Zwerchhau))) && !HasEffect(Buffs.Dualcast)) { if (IsEnabled(CustomComboPreset.RDM_ST_MeleeCombo_CorpsGapCloser) @@ -528,9 +541,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (HasEffect(Buffs.Acceleration) || WasLastAction(Buffs.Acceleration)) { //Run the Mana Balance Computer - manaState.CheckBalance(); - if (manaState.useAero && LevelChecked(OriginalHook(Veraero))) return OriginalHook(Veraero); - if (manaState.useThunder && LevelChecked(OriginalHook(Verthunder))) return OriginalHook(Verthunder); + mana.CheckBalance(); + if (mana.useAero && LevelChecked(OriginalHook(Veraero))) return OriginalHook(Veraero); + if (mana.useThunder && LevelChecked(OriginalHook(Verthunder))) return OriginalHook(Verthunder); } if (HasCharges(Acceleration)) return Acceleration; @@ -548,7 +561,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim && actionID is Jolt or Jolt2 or Jolt3 && HasCondition(ConditionFlag.InCombat) && LocalPlayer.IsCasting == false - && Gauge.ManaStacks == 0 + && RDMMana.ManaStacks == 0 && lastComboMove is not Verflare && lastComboMove is not Verholy && lastComboMove is not Scorch @@ -568,29 +581,36 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim } //END_RDM_ST_ACCELERATION - //RDM_VERFIREVERSTONE - if (IsEnabled(CustomComboPreset.RDM_ST_FireStone) - && actionID is Jolt or Jolt2 or Jolt3 - && !HasEffect(Buffs.Acceleration) - && !HasEffect(Buffs.Dualcast)) - { - //Run the Mana Balance Computer - manaState.CheckBalance(); - if (manaState.useFire) return Verfire; - if (manaState.useStone) return Verstone; - } - //END_RDM_VERFIREVERSTONE - //RDM_VERTHUNDERVERAERO - if (IsEnabled(CustomComboPreset.RDM_ST_ThunderAero) - && actionID is Jolt or Jolt2 or Jolt3) + if (actionID is Jolt or Jolt2 or Jolt3) { - //Run the Mana Balance Computer - manaState.CheckBalance(); - if (manaState.useThunder) return OriginalHook(Verthunder); - if (manaState.useAero) return OriginalHook(Veraero); + if (TraitLevelChecked(Traits.EnhancedAccelerationII) + && HasEffect(Buffs.GrandImpactReady)) + return GrandImpact; + + //RDM_VERFIREVERSTONE + if (IsEnabled(CustomComboPreset.RDM_ST_FireStone) + && !HasEffect(Buffs.Acceleration) + && !HasEffect(Buffs.Dualcast)) + { + //Run the Mana Balance Computer + mana.CheckBalance(); + if (mana.useFire) return Verfire; + if (mana.useStone) return Verstone; + } + //END_RDM_VERFIREVERSTONE + + //RDM_VERTHUNDERVERAERO + if (IsEnabled(CustomComboPreset.RDM_ST_ThunderAero)) + { + //Run the Mana Balance Computer + mana.CheckBalance(); + if (mana.useThunder) return OriginalHook(Verthunder); + if (mana.useAero) return OriginalHook(Veraero); + } + //END_RDM_VERTHUNDERVERAERO + } - //END_RDM_VERTHUNDERVERAERO //NO_CONDITIONS_MET return actionID; @@ -599,14 +619,11 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim internal class RDM_AoE_DPS : CustomCombo { - protected internal ManaBalancer manaState = new(); + protected internal RDMMana manaState = new(); protected internal MeleeFinisher meleeFinisher = new(); protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.RDM_AoE_DPS; protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { - int black = Gauge.BlackMana; - int white = Gauge.WhiteMana; - //VARIANTS if (IsEnabled(CustomComboPreset.RDM_Variant_Cure) && IsEnabled(Variant.VariantCure) && @@ -674,44 +691,44 @@ actionID is Scatter or Impact && && !HasEffect(Buffs.Dualcast) && !HasEffect(All.Buffs.Swiftcast) && !HasEffect(Buffs.Acceleration) - && ((GetTargetDistance() <= Config.RDM_AoE_MoulinetRange && Gauge.ManaStacks == 0) || Gauge.ManaStacks > 0)) + && ((GetTargetDistance() <= Config.RDM_AoE_MoulinetRange && RDMMana.ManaStacks == 0) || RDMMana.ManaStacks > 0)) { if (ActionReady(Manafication)) { //Situation 1: Embolden First (Double) - if (Gauge.ManaStacks == 2 - && Math.Min(black, white) >= 22 + if (RDMMana.ManaStacks == 2 + && RDMMana.Min >= 22 && IsOffCooldown(Embolden)) { return Embolden; } - if (((Gauge.ManaStacks == 3 && Math.Min(black, white) >= 2) || (Gauge.ManaStacks == 0 && Math.Min(black, white) >= 10)) + if (((RDMMana.ManaStacks == 3 && RDMMana.Min >= 2) || (RDMMana.ManaStacks == 0 && RDMMana.Min >= 10)) && lastComboMove is not Verflare && lastComboMove is not Verholy && lastComboMove is not Scorch - && Math.Max(black, white) <= 50 + && RDMMana.Max <= 50 && (HasEffect(Buffs.Embolden) || WasLastAction(Embolden))) { return Manafication; } //Situation 2: Embolden First (Single) - if (Gauge.ManaStacks == 0 + if (RDMMana.ManaStacks == 0 && lastComboMove is not Verflare && lastComboMove is not Verholy && lastComboMove is not Scorch - && Math.Max(black, white) <= 50 - && Math.Min(black, white) >= 10 + && RDMMana.Max <= 50 + && RDMMana.Min >= 10 && IsOffCooldown(Embolden)) { return Embolden; } - if (Gauge.ManaStacks == 0 + if (RDMMana.ManaStacks == 0 && lastComboMove is not Verflare && lastComboMove is not Verholy && lastComboMove is not Scorch - && Math.Max(black, white) <= 50 - && Math.Min(black, white) >= 10 + && RDMMana.Max <= 50 + && RDMMana.Min >= 10 && (HasEffect(Buffs.Embolden) || WasLastAction(Embolden))) { return Manafication; @@ -720,7 +737,7 @@ actionID is Scatter or Impact && //Below Manafication Level if (ActionReady(Embolden) && !LevelChecked(Manafication) - && Math.Min(black, white) >= 20) + && RDMMana.Min >= 20) { return Embolden; } @@ -729,26 +746,26 @@ actionID is Scatter or Impact && } //7.0 Manification Magic Mana - //The Math.Min after level check is GaugeStack * 16.67 >= 50 to validate Molinet - //Really needs some higher level autism to figure out if there is a better way - int ManaBuff = (int)GetBuffStacks(Buffs.Manafication); - if (ManaBuff > 3) ManaBuff = 3; //Only need 3 to use the combo (low level 60 get 3) - int ManaStacks = Math.Max(Gauge.ManaStacks, ManaBuff); - + //int Mana = Math.Min(Gauge.WhiteMana, Gauge.BlackMana); + //if (LevelChecked(Manafication)) + //{ + // int ManaBuff = GetBuffStacks(Buffs.MagickedSwordPlay); + // if (ManaBuff > 0) Mana = 50; //ITS FREE REAL ESTATE + //} + if (LevelChecked(Moulinet) && LocalPlayer.IsCasting == false && !HasEffect(Buffs.Dualcast) && !HasEffect(All.Buffs.Swiftcast) && !HasEffect(Buffs.Acceleration) - && ((Math.Min(Gauge.BlackMana, Gauge.WhiteMana) + (ManaStacks * 16.67) >= 50) || - (!LevelChecked(Verflare) && Math.Min(Gauge.BlackMana, Gauge.WhiteMana) >= 20))) + && RDMMana.Min >= 50) { if (IsEnabled(CustomComboPreset.RDM_AoE_MeleeCombo_CorpsGapCloser) && ActionReady(Corpsacorps) && GetTargetDistance() > Config.RDM_AoE_MoulinetRange) return Corpsacorps; - if ((GetTargetDistance() <= Config.RDM_AoE_MoulinetRange && ManaStacks == 0) || ManaStacks >= 1) + if ((GetTargetDistance() <= Config.RDM_AoE_MoulinetRange && RDMMana.ManaStacks == 0) || RDMMana.ManaStacks >= 1) return OriginalHook(Moulinet); } } @@ -759,7 +776,7 @@ actionID is Scatter or Impact && if (IsEnabled(CustomComboPreset.RDM_AoE_Accel) && actionID is Scatter or Impact && LocalPlayer.IsCasting == false - && Gauge.ManaStacks == 0 + && RDMMana.ManaStacks == 0 && lastComboMove is not Verflare && lastComboMove is not Verholy && lastComboMove is not Scorch @@ -786,6 +803,11 @@ actionID is Scatter or Impact && //RDM_VERTHUNDERIIVERAEROII if (actionID is Scatter or Impact) { + + if (TraitLevelChecked(Traits.EnhancedAccelerationII) + && HasEffect(Buffs.GrandImpactReady)) + return GrandImpact; + manaState.CheckBalance(); if (manaState.useThunder2) return OriginalHook(Verthunder2); if (manaState.useAero2) return OriginalHook(Veraero2); diff --git a/XIVSlothCombo/CustomCombo/Functions/Status.cs b/XIVSlothCombo/CustomCombo/Functions/Status.cs index 4a7e31afb..c80a849db 100644 --- a/XIVSlothCombo/CustomCombo/Functions/Status.cs +++ b/XIVSlothCombo/CustomCombo/Functions/Status.cs @@ -12,7 +12,7 @@ internal abstract partial class CustomComboFunctions /// A value indicating if the effect exists. public static bool HasEffect(ushort effectID) => FindEffect(effectID) is not null; - public static float GetBuffStacks(ushort effectId) + public static byte GetBuffStacks(ushort effectId) { Status? eff = FindEffect(effectId); return eff?.StackCount ?? 0; diff --git a/XIVSlothCombo/Window/Functions/UserConfig.cs b/XIVSlothCombo/Window/Functions/UserConfig.cs index 47cce6015..9d303552b 100644 --- a/XIVSlothCombo/Window/Functions/UserConfig.cs +++ b/XIVSlothCombo/Window/Functions/UserConfig.cs @@ -1881,6 +1881,8 @@ internal static void Draw(CustomComboPreset preset, bool enabled) UserConfig.DrawAdditionalBoolChoice(RDM.Config.RDM_ST_oGCD_CorpACorps_Pooling, "Pool one charge for manual use.", ""); ImGui.Unindent(); } + UserConfig.DrawAdditionalBoolChoice(RDM.Config.RDM_ST_oGCD_ViceOfThorns, "Vice of Thorns", ""); + UserConfig.DrawAdditionalBoolChoice(RDM.Config.RDM_ST_oGCD_Prefulgence, "Prefulgence", ""); } if (preset is CustomComboPreset.RDM_ST_MeleeCombo) @@ -1931,6 +1933,8 @@ internal static void Draw(CustomComboPreset preset, bool enabled) UserConfig.DrawAdditionalBoolChoice(RDM.Config.RDM_AoE_oGCD_CorpACorps_Pooling, "Pool one charge for manual use.", ""); ImGui.Unindent(); } + UserConfig.DrawAdditionalBoolChoice(RDM.Config.RDM_AoE_oGCD_ViceOfThorns, "Vice of Thorns", ""); + UserConfig.DrawAdditionalBoolChoice(RDM.Config.RDM_AoE_oGCD_Prefulgence, "Prefulgence", ""); } if (preset is CustomComboPreset.RDM_AoE_MeleeCombo) From ccb57a42f92b8cb1c6e85c372d887aab52d2df7c Mon Sep 17 00:00:00 2001 From: Tartarga <109563717+Tartarga@users.noreply.github.com> Date: Fri, 19 Jul 2024 22:13:45 -0500 Subject: [PATCH 2/2] JobHelpers/RDM.cs RDMMana CheckBalance now a static function. No need to declare a new class object in RDM.cs --- XIVSlothCombo/Combos/JobHelpers/RDM.cs | 25 +++++++++-------------- XIVSlothCombo/Combos/PvE/RDM.cs | 28 ++++++++++++-------------- 2 files changed, 22 insertions(+), 31 deletions(-) diff --git a/XIVSlothCombo/Combos/JobHelpers/RDM.cs b/XIVSlothCombo/Combos/JobHelpers/RDM.cs index bd7d58cf9..d93ee893b 100644 --- a/XIVSlothCombo/Combos/JobHelpers/RDM.cs +++ b/XIVSlothCombo/Combos/JobHelpers/RDM.cs @@ -21,13 +21,6 @@ internal class RDMHelper internal class RDMMana : PvE.RDM { - internal bool useFire; - internal bool useStone; - internal bool useThunder; - internal bool useAero; - internal bool useThunder2; - internal bool useAero2; - private static RDMGauge Gauge => CustomComboFunctions.GetJobGauge(); internal static int ManaStacks => Gauge.ManaStacks; internal static int Black => AdjustMana(Gauge.BlackMana); @@ -51,7 +44,7 @@ private static int AdjustMana(byte mana) else return mana; } - internal void CheckBalance() + public static (bool useFire, bool useStone, bool useThunder, bool useAero, bool useThunder2, bool useAero2) CheckBalance() { //SYSTEM_MANA_BALANCING_MACHINE //Machine to decide which ver spell should be used. @@ -69,15 +62,13 @@ internal void CheckBalance() //3.Strive to achieve correct mana for double melee combo burst [DONE] int blackmana = Black; int whitemana = White; - //int blackmana = Gauge.BlackMana; - //int whitemana = Gauge.WhiteMana; //Reset outputs - useFire = false; - useStone = false; - useThunder = false; - useAero = false; - useThunder2 = false; - useAero2 = false; + bool useFire = false; + bool useStone = false; + bool useThunder = false; + bool useAero = false; + bool useThunder2 = false; + bool useAero2 = false; //ST if (LevelChecked(Verthunder) @@ -113,6 +104,8 @@ internal void CheckBalance() else useAero2 = true; } //END_SYSTEM_MANA_BALANCING_MACHINE + + return (useFire, useStone, useThunder, useAero, useThunder2, useAero2); } } diff --git a/XIVSlothCombo/Combos/PvE/RDM.cs b/XIVSlothCombo/Combos/PvE/RDM.cs index abf920121..2a93d51df 100644 --- a/XIVSlothCombo/Combos/PvE/RDM.cs +++ b/XIVSlothCombo/Combos/PvE/RDM.cs @@ -149,7 +149,6 @@ internal class RDM_ST_DPS : CustomCombo { protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.RDM_ST_DPS; - internal RDMMana mana = new(); internal static bool inOpener = false; internal static bool readyOpener = false; internal static bool openerStarted = false; @@ -541,9 +540,10 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (HasEffect(Buffs.Acceleration) || WasLastAction(Buffs.Acceleration)) { //Run the Mana Balance Computer - mana.CheckBalance(); - if (mana.useAero && LevelChecked(OriginalHook(Veraero))) return OriginalHook(Veraero); - if (mana.useThunder && LevelChecked(OriginalHook(Verthunder))) return OriginalHook(Verthunder); + var actions = RDMMana.CheckBalance(); + + if (actions.useAero && LevelChecked(OriginalHook(Veraero))) return OriginalHook(Veraero); + if (actions.useThunder && LevelChecked(OriginalHook(Verthunder))) return OriginalHook(Verthunder); } if (HasCharges(Acceleration)) return Acceleration; @@ -594,9 +594,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim && !HasEffect(Buffs.Dualcast)) { //Run the Mana Balance Computer - mana.CheckBalance(); - if (mana.useFire) return Verfire; - if (mana.useStone) return Verstone; + var actions = RDMMana.CheckBalance(); + if (actions.useFire) return Verfire; + if (actions.useStone) return Verstone; } //END_RDM_VERFIREVERSTONE @@ -604,9 +604,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim if (IsEnabled(CustomComboPreset.RDM_ST_ThunderAero)) { //Run the Mana Balance Computer - mana.CheckBalance(); - if (mana.useThunder) return OriginalHook(Verthunder); - if (mana.useAero) return OriginalHook(Veraero); + var actions = RDMMana.CheckBalance(); + if (actions.useThunder) return OriginalHook(Verthunder); + if (actions.useAero) return OriginalHook(Veraero); } //END_RDM_VERTHUNDERVERAERO @@ -619,8 +619,6 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim internal class RDM_AoE_DPS : CustomCombo { - protected internal RDMMana manaState = new(); - protected internal MeleeFinisher meleeFinisher = new(); protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.RDM_AoE_DPS; protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level) { @@ -808,9 +806,9 @@ actionID is Scatter or Impact && && HasEffect(Buffs.GrandImpactReady)) return GrandImpact; - manaState.CheckBalance(); - if (manaState.useThunder2) return OriginalHook(Verthunder2); - if (manaState.useAero2) return OriginalHook(Veraero2); + var actions = RDMMana.CheckBalance(); + if (actions.useThunder2) return OriginalHook(Verthunder2); + if (actions.useAero2) return OriginalHook(Veraero2); } //END_RDM_VERTHUNDERIIVERAEROII