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/1772/head' of https://github.com/Nik-Potokar/…
Browse files Browse the repository at this point in the history
  • Loading branch information
Taurenkey committed Sep 14, 2024
2 parents 17b446d + c6fb3d1 commit cfa3789
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 30 deletions.
8 changes: 5 additions & 3 deletions XIVSlothCombo/Combos/CustomComboPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2188,6 +2188,7 @@ public enum CustomComboPreset
NIN_ST_AdvancedMode_TrueNorth = 10030,

[ParentCombo(NIN_ST_AdvancedMode_TrueNorth)]
[ConflictingCombos(NIN_ST_AdvancedMode_Dynamic)]
[CustomComboInfo("Use Before Armor Crush Only Option", "Only triggers the use of True North before Armor Crush.", NIN.JobID)]
NIN_ST_AdvancedMode_TrueNorth_ArmorCrush = 10031,

Expand Down Expand Up @@ -2321,9 +2322,10 @@ public enum CustomComboPreset
[CustomComboInfo("Suiton Uptime Option", "Adds Suiton as an uptime feature.", NIN.JobID)]
NIN_ST_AdvancedMode_Suiton_Uptime = 10067,

[ParentCombo(NIN_ST_AdvancedMode_TrueNorth_ArmorCrush)]
[CustomComboInfo("Dynamic True North Option", "Adds True North before Armor Crush when you are not in the correct position for the enhanced potency bonus.", NIN.JobID)]
NIN_ST_AdvancedMode_TrueNorth_ArmorCrush_Dynamic = 10068,
[ParentCombo(NIN_ST_AdvancedMode_TrueNorth)]
[ConflictingCombos(NIN_ST_AdvancedMode_TrueNorth_ArmorCrush)]
[CustomComboInfo("Dynamic Ninja Positional Option", "Dynamic choice of Armor crush/Aeolian Edge based on position and available charges.\nGo to Flank to build charges, Rear to spend them. \nPrevents overcap or waste and will use true north as needed." , NIN.JobID)]
NIN_ST_AdvancedMode_Dynamic = 10068,

[Variant]
[VariantParent(NIN_ST_SimpleMode, NIN_ST_AdvancedMode, NIN_AoE_SimpleMode, NIN_AoE_AdvancedMode)]
Expand Down
163 changes: 136 additions & 27 deletions XIVSlothCombo/Combos/PvE/NIN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public const string
Advanced_Trick_Cooldown = "Advanced_Trick_Cooldown",
Advanced_DotonTimer = "Advanced_DotonTimer",
Advanced_DotonHP = "Advanced_DotonHP",
BurnKazematoi = "BurnKazematoi",
Advanced_TCJEnderAoE = "Advanced_TCJEnderAoe",
Advanced_ChargePool = "Advanced_ChargePool",
SecondWindThresholdST = "SecondWindThresholdST",
Expand Down Expand Up @@ -163,21 +164,37 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
bool suitonUptime = IsEnabled(CustomComboPreset.NIN_ST_AdvancedMode_Suiton_Uptime);
int bhavaPool = GetOptionValue(Config.Ninki_BhavaPooling);
int bunshinPool = GetOptionValue(Config.Ninki_BunshinPoolingST);
int burnKazematoi = GetOptionValue(NIN.Config.BurnKazematoi);
int SecondWindThreshold = PluginConfiguration.GetCustomIntValue(Config.SecondWindThresholdST);
int ShadeShiftThreshold = PluginConfiguration.GetCustomIntValue(Config.ShadeShiftThresholdST);
int BloodbathThreshold = PluginConfiguration.GetCustomIntValue(Config.BloodbathThresholdST);
double playerHP = PlayerHealthPercentageHp();
bool phantomUptime = IsEnabled(CustomComboPreset.NIN_ST_AdvancedMode_Phantom_Uptime);
var comboLength = GetCooldown(GustSlash).CooldownTotal * 3;
bool trueNorthArmor = IsEnabled(CustomComboPreset.NIN_ST_AdvancedMode_TrueNorth) && TargetNeedsPositionals() && !OnTargetsFlank() && GetRemainingCharges(All.TrueNorth) > 0 && All.TrueNorth.LevelChecked() && !HasEffect(All.Buffs.TrueNorth) && canDelayedWeave;
bool trueNorthEdge = IsEnabled(CustomComboPreset.NIN_ST_AdvancedMode_TrueNorth) && TargetNeedsPositionals() && IsNotEnabled(CustomComboPreset.NIN_ST_AdvancedMode_TrueNorth_ArmorCrush) && !OnTargetsRear() && GetRemainingCharges(All.TrueNorth) > 0 && All.TrueNorth.LevelChecked() && !HasEffect(All.Buffs.TrueNorth) && canDelayedWeave;
bool dynamic = IsEnabled(CustomComboPreset.NIN_ST_AdvancedMode_Dynamic);


if (IsNotEnabled(CustomComboPreset.NIN_ST_AdvancedMode_Ninjitsus) || (ActionWatching.TimeSinceLastAction.TotalSeconds >= 5 && !InCombat()))
mudraState.CurrentMudra = MudraCasting.MudraState.None;

if (IsEnabled(CustomComboPreset.NIN_ST_AdvancedMode_Ninjitsus_Suiton) && IsOnCooldown(TrickAttack) && mudraState.CurrentMudra == MudraCasting.MudraState.CastingSuiton && !setupSuitonWindow)
mudraState.CurrentMudra = MudraCasting.MudraState.None;

if (IsEnabled(CustomComboPreset.NIN_ST_AdvancedMode_Ninjitsus_Suiton) && IsOnCooldown(TrickAttack) && mudraState.CurrentMudra != MudraCasting.MudraState.CastingSuiton && setupSuitonWindow)
mudraState.CurrentMudra = MudraCasting.MudraState.CastingSuiton;

if (!Suiton.LevelChecked()) //For low level
{
if (Raiton.LevelChecked() && IsEnabled(CustomComboPreset.NIN_ST_AdvancedMode_Ninjitsus_Raiton)) //under 45 will only use Raiton
{
if (mudraState.CastRaiton(ref actionID))
return actionID;
}
else if (!Raiton.LevelChecked() && mudraState.CastFumaShuriken(ref actionID) && IsEnabled(CustomComboPreset.NIN_ST_AdvancedMode_Ninjitsus_FumaShuriken)) // 30-35 will use only fuma
return actionID;
}

if (OriginalHook(Ninjutsu) is Rabbit)
return OriginalHook(Ninjutsu);
Expand Down Expand Up @@ -375,27 +392,82 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
{
if (lastComboMove == SpinningEdge && GustSlash.LevelChecked())
return OriginalHook(GustSlash);

if (IsEnabled(CustomComboPreset.NIN_ST_AdvancedMode_TrueNorth) && TargetNeedsPositionals() &&
IsNotEnabled(CustomComboPreset.NIN_ST_AdvancedMode_TrueNorth_ArmorCrush) &&
lastComboMove == GustSlash && GetRemainingCharges(All.TrueNorth) > 0 &&
All.TrueNorth.LevelChecked() && !HasEffect(All.Buffs.TrueNorth) &&
canWeave)
return OriginalHook(All.TrueNorth);


if (lastComboMove == GustSlash && ArmorCrush.LevelChecked())
{
if ((!NINHelper.MugDebuff) || (NINHelper.MugDebuff && gauge.Kazematoi == 0))
if (dynamic)
{
if (gauge.Kazematoi > 3)
{
if (trueNorthEdge)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(AeolianEdge);
}

if (gauge.Kazematoi == 0)
{
if (trueNorthArmor)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(ArmorCrush);
}
if ((gauge.Kazematoi > 0) && (gauge.Kazematoi < 4))
{
if (OnTargetsFlank())
return OriginalHook(ArmorCrush);
else
return OriginalHook(AeolianEdge);
}


}
if (!dynamic)
{
if (gauge.Kazematoi < 4)
return OriginalHook(ArmorCrush);
if (!NINHelper.MugDebuff && GetTargetHPPercent() > burnKazematoi)
{
if (gauge.Kazematoi < 4)
{
if (trueNorthArmor)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(ArmorCrush);
}
else
{
if (trueNorthEdge)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(AeolianEdge);
}
}
if (NINHelper.MugDebuff || GetTargetHPPercent() <= burnKazematoi)
{
if (gauge.Kazematoi == 0)
{
if (trueNorthArmor)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(ArmorCrush);
}
else
{
if (trueNorthEdge)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(AeolianEdge);
}
}
}
}

if (lastComboMove == GustSlash && AeolianEdge.LevelChecked() && (gauge.Kazematoi > 0 || !ArmorCrush.LevelChecked()))
return OriginalHook(AeolianEdge);
if (lastComboMove == GustSlash && !ArmorCrush.LevelChecked() && AeolianEdge.LevelChecked())
{
if (trueNorthEdge)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(AeolianEdge);
}
}

return OriginalHook(SpinningEdge);
}
return actionID;
Expand Down Expand Up @@ -592,6 +664,10 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
bool canWeave = CanWeave(SpinningEdge);
bool inTrickBurstSaveWindow = GetCooldownRemainingTime(TrickAttack) <= 15 && Suiton.LevelChecked();
bool useBhakaBeforeTrickWindow = GetCooldownRemainingTime(TrickAttack) >= 3;
var canDelayedWeave = CanDelayedWeave(SpinningEdge);
bool trueNorthArmor = TargetNeedsPositionals() && !OnTargetsFlank() && GetRemainingCharges(All.TrueNorth) > 0 && All.TrueNorth.LevelChecked() && !HasEffect(All.Buffs.TrueNorth) && canDelayedWeave;
bool trueNorthEdge = TargetNeedsPositionals() && !OnTargetsRear() && GetRemainingCharges(All.TrueNorth) > 0 && All.TrueNorth.LevelChecked() && !HasEffect(All.Buffs.TrueNorth) && canDelayedWeave;


if (OriginalHook(Ninjutsu) is Rabbit)
return OriginalHook(Ninjutsu);
Expand Down Expand Up @@ -685,18 +761,51 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
if (lastComboMove == SpinningEdge && GustSlash.LevelChecked())
return OriginalHook(GustSlash);

if (lastComboMove == GustSlash && TargetNeedsPositionals() && GetRemainingCharges(All.TrueNorth) > 0 && All.TrueNorth.LevelChecked() && !HasEffect(All.Buffs.TrueNorth) && canWeave)
return OriginalHook(All.TrueNorth);

if (lastComboMove == GustSlash && AeolianEdge.LevelChecked() && (gauge.Kazematoi > 0 || !ArmorCrush.LevelChecked()))
return OriginalHook(AeolianEdge);

if (lastComboMove == GustSlash && ArmorCrush.LevelChecked() && gauge.Kazematoi < 5)
return OriginalHook(ArmorCrush);


if (lastComboMove == GustSlash && ArmorCrush.LevelChecked())
{
if (!NINHelper.MugDebuff)
{
if (gauge.Kazematoi < 4)
{
if (trueNorthArmor)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(ArmorCrush);
}
else
{
if (trueNorthEdge)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(AeolianEdge);
}
}
if (NINHelper.MugDebuff)
{
if (gauge.Kazematoi == 0)
{
if (trueNorthArmor)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(ArmorCrush);
}
else
{
if (trueNorthEdge)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(AeolianEdge);
}
}
}
if (lastComboMove == GustSlash && !ArmorCrush.LevelChecked() && AeolianEdge.LevelChecked())
{
if (trueNorthEdge)
return OriginalHook(All.TrueNorth);
else
return OriginalHook(AeolianEdge);
}
}

return OriginalHook(SpinningEdge);
}
return actionID;
Expand Down
2 changes: 2 additions & 0 deletions XIVSlothCombo/Window/Functions/UserConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,8 @@ internal static void Draw(CustomComboPreset preset, bool enabled)
UserConfig.DrawRadioButton(NIN.Config.NIN_SimpleMudra_Choice, "Mudra Path Set 1", $"1. Ten Mudras -> Fuma Shuriken, Raiton/Hyosho Ranryu, Suiton (Doton under Kassatsu).\nChi Mudras -> Fuma Shuriken, Hyoton, Huton.\nJin Mudras -> Fuma Shuriken, Katon/Goka Mekkyaku, Doton", 1);
UserConfig.DrawRadioButton(NIN.Config.NIN_SimpleMudra_Choice, "Mudra Path Set 2", $"2. Ten Mudras -> Fuma Shuriken, Hyoton/Hyosho Ranryu, Doton.\nChi Mudras -> Fuma Shuriken, Katon, Suiton.\nJin Mudras -> Fuma Shuriken, Raiton/Goka Mekkyaku, Huton (Doton under Kassatsu).", 2);
}
if (preset == CustomComboPreset.NIN_ST_AdvancedMode)
UserConfig.DrawSliderInt(0, 10, NIN.Config.BurnKazematoi, "Target HP% to dump all pooled Kazematoi below");

if (preset == CustomComboPreset.NIN_ST_AdvancedMode_Bhavacakra)
UserConfig.DrawSliderInt(50, 100, NIN.Config.Ninki_BhavaPooling, "Set the minimal amount of Ninki required to have before spending on Bhavacakra.");
Expand Down

0 comments on commit cfa3789

Please sign in to comment.