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

Commit

Permalink
JobHelpers/RDM.cs
Browse files Browse the repository at this point in the history
RDMMana CheckBalance now a static function. No need to declare a new class object in RDM.cs
  • Loading branch information
Tartarga committed Jul 20, 2024
1 parent 1d0b32b commit ccb57a4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 31 deletions.
25 changes: 9 additions & 16 deletions XIVSlothCombo/Combos/JobHelpers/RDM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RDMGauge>();
internal static int ManaStacks => Gauge.ManaStacks;
internal static int Black => AdjustMana(Gauge.BlackMana);
Expand All @@ -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.
Expand All @@ -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)
Expand Down Expand Up @@ -113,6 +104,8 @@ internal void CheckBalance()
else useAero2 = true;
}
//END_SYSTEM_MANA_BALANCING_MACHINE

return (useFire, useStone, useThunder, useAero, useThunder2, useAero2);
}
}

Expand Down
28 changes: 13 additions & 15 deletions XIVSlothCombo/Combos/PvE/RDM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -594,19 +594,19 @@ 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

//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);
var actions = RDMMana.CheckBalance();
if (actions.useThunder) return OriginalHook(Verthunder);
if (actions.useAero) return OriginalHook(Veraero);
}
//END_RDM_VERTHUNDERVERAERO

Expand All @@ -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)
{
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit ccb57a4

Please sign in to comment.