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

Commit

Permalink
Merge commit 'refs/pull/1560/head' of https://github.com/Nik-Potokar/…
Browse files Browse the repository at this point in the history
  • Loading branch information
Taurenkey committed Jul 23, 2024
2 parents 52facf5 + ccb57a4 commit 6e0cab7
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 115 deletions.
81 changes: 58 additions & 23 deletions XIVSlothCombo/Combos/JobHelpers/RDM.cs
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -14,17 +16,35 @@ 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;
internal bool useThunder;
internal bool useAero;
internal bool useThunder2;
internal bool useAero2;

internal void CheckBalance()
private static RDMGauge Gauge => CustomComboFunctions.GetJobGauge<RDMGauge>();
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;
}

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 @@ -40,15 +60,15 @@ 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;
//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 @@ -84,17 +104,19 @@ internal void CheckBalance()
else useAero2 = true;
}
//END_SYSTEM_MANA_BALANCING_MACHINE

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

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))
{
Expand Down Expand Up @@ -154,6 +176,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;
Expand All @@ -175,12 +199,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;
Expand Down Expand Up @@ -221,7 +256,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
Expand Down
Loading

0 comments on commit 6e0cab7

Please sign in to comment.