Skip to content

Commit

Permalink
Merge commit 'refs/pull/1779/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 77587f3 + 4dd0069 commit 60d4362
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 60 deletions.
40 changes: 24 additions & 16 deletions XIVSlothCombo/Combos/CustomComboPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3846,25 +3846,33 @@ The three digets after RDM.JobID can be used to reorder items in the list
[CustomComboInfo("Single Target Heal Feature", "Change Physick into Adloquium, Lustrate, then Physick with below options:", SCH.JobID, 4)]
SCH_ST_Heal = 16023,

[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Lucid Dreaming Weave Option", "Adds Lucid Dreaming when MP drops below slider value:", SCH.JobID, 1)]
SCH_ST_Heal_Lucid = 16024,
[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Lucid Dreaming Weave Option", "Adds Lucid Dreaming when MP drops below slider value:", SCH.JobID, 1)]
SCH_ST_Heal_Lucid = 16024,

[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Aetherflow Weave Option", "Use Aetherflow when out of Aetherflow stacks.", SCH.JobID, 2)]
SCH_ST_Heal_Aetherflow = 16025,
[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Aetherflow Weave Option", "Use Aetherflow when out of Aetherflow stacks.", SCH.JobID, 2)]
SCH_ST_Heal_Aetherflow = 16025,

[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Esuna Option", "Applies Esuna to your target if there is a cleansable debuff.", SGE.JobID, 3)]
SCH_ST_Heal_Esuna = 16026,
[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Esuna Option", "Applies Esuna to your target if there is a cleansable debuff.", SGE.JobID, 3)]
SCH_ST_Heal_Esuna = 16026,

[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Adloquium Option", "Use Adloquium when missing Galvanize or target HP%% below:", SCH.JobID, 4)]
SCH_ST_Heal_Adloquium = 16027,
[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Adloquium Option", "Use Adloquium when missing Galvanize or target HP%% below:", SCH.JobID, 4)]
SCH_ST_Heal_Adloquium = 16027,

[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Lustrate Option", "Use Lustrate when target HP%% below:", SCH.JobID, 5)]
SCH_ST_Heal_Lustrate = 16028,
[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Lustrate Option", "Use Lustrate when target HP%% below:", SCH.JobID, 5)]
SCH_ST_Heal_Lustrate = 16028,

[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Excogitation Option", "Use Excogitation when target HP%% below:", SCH.JobID, 6)]
SCH_ST_Heal_Excogitation = 16038,

[ParentCombo(SCH_ST_Heal)]
[CustomComboInfo("Protraction Option", "Use Protraction when target HP%% below:", SCH.JobID, 7)]
SCH_ST_Heal_Protraction = 16039,


#endregion
Expand Down Expand Up @@ -3911,7 +3919,7 @@ The three digets after RDM.JobID can be used to reorder items in the list

#endregion

// Last value = 16037
// Last value = 16039

#endregion

Expand Down
72 changes: 72 additions & 0 deletions XIVSlothCombo/Combos/JobHelpers/SCH.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using static XIVSlothCombo.Combos.PvE.SCH;
using static XIVSlothCombo.CustomComboNS.Functions.CustomComboFunctions;

namespace XIVSlothCombo.Combos.JobHelpers
{
internal class SCHHelper
{
public static int GetMatchingConfigST(int i, out uint action, out bool enabled)
{
var healTarget = GetHealTarget(Config.SCH_ST_Heal_Adv && Config.SCH_ST_Heal_UIMouseOver);

switch (i)
{
case 0:
action = Lustrate;
enabled = IsEnabled(CustomComboPreset.SCH_ST_Heal_Lustrate) && Gauge.HasAetherflow();
return Config.SCH_ST_Heal_LustrateOption;
case 1:
action = Excogitation;
enabled = IsEnabled(CustomComboPreset.SCH_ST_Heal_Excogitation) && (Gauge.HasAetherflow() || HasEffect(Buffs.Recitation));
return Config.SCH_ST_Heal_ExcogitationOption;
case 2:
action = Protraction;
enabled = IsEnabled(CustomComboPreset.SCH_ST_Heal_Protraction);
return Config.SCH_ST_Heal_ProtractionOption;
}

enabled = false;
action = 0;
return 0;
}

//public static int GetMatchingConfigAoE(int i, out uint action, out bool enabled)
//{
// switch (i)
// {
// case 0:
// action = PvE.SGE.Kerachole;
// enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Kerachole) && (!PvE.SGE.Config.SGE_AoE_Heal_KeracholeTrait || (PvE.SGE.Config.SGE_AoE_Heal_KeracholeTrait && TraitLevelChecked(PvE.SGE.Traits.EnhancedKerachole))) && PvE.SGE.Gauge.HasAddersgall();
// return 0;
// case 1:
// action = PvE.SGE.Ixochole;
// enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Ixochole) && PvE.SGE.Gauge.HasAddersgall();
// return 0;
// case 2:
// action = OriginalHook(PvE.SGE.Physis);
// enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Physis);
// return 0;
// case 3:
// action = PvE.SGE.Holos;
// enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Holos);
// return 0;
// case 4:
// action = PvE.SGE.Panhaima;
// enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Panhaima);
// return 0;
// case 5:
// action = PvE.SGE.Pepsis;
// enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Pepsis) && FindEffect(PvE.SGE.Buffs.EukrasianPrognosis) is not null;
// return 0;
// case 6:
// action = PvE.SGE.Philosophia;
// enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Philosophia);
// return 0;
// }

// enabled = false;
// action = 0;
// return 0;
//}
}
}
62 changes: 31 additions & 31 deletions XIVSlothCombo/Combos/JobHelpers/SGE.cs
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
using XIVSlothCombo.Combos.PvE;
using XIVSlothCombo.CustomComboNS.Functions;
using static XIVSlothCombo.Combos.PvE.SGE;
using static XIVSlothCombo.CustomComboNS.Functions.CustomComboFunctions;

namespace XIVSlothCombo.Combos.JobHelpers
{
internal class SGE : CustomComboFunctions
internal class SGEHelper
{
public static int GetMatchingConfigST(int i, out uint action, out bool enabled)
{
var healTarget = GetHealTarget(PvE.SGE.Config.SGE_ST_Heal_Adv && PvE.SGE.Config.SGE_ST_Heal_UIMouseOver);
var healTarget = GetHealTarget(Config.SGE_ST_Heal_Adv && Config.SGE_ST_Heal_UIMouseOver);

switch (i)
{
case 0:
action = PvE.SGE.Soteria;
action = Soteria;
enabled = IsEnabled(CustomComboPreset.SGE_ST_Heal_Soteria);
return PvE.SGE.Config.SGE_ST_Heal_Soteria;
return Config.SGE_ST_Heal_Soteria;
case 1:
action = PvE.SGE.Zoe;
action = Zoe;
enabled = IsEnabled(CustomComboPreset.SGE_ST_Heal_Zoe);
return PvE.SGE.Config.SGE_ST_Heal_Zoe;
return Config.SGE_ST_Heal_Zoe;
case 2:
action = PvE.SGE.Pepsis;
enabled = IsEnabled(CustomComboPreset.SGE_ST_Heal_Pepsis) && FindEffect(PvE.SGE.Buffs.EukrasianDiagnosis, healTarget, LocalPlayer?.GameObjectId) is not null;
return PvE.SGE.Config.SGE_ST_Heal_Pepsis;
action = Pepsis;
enabled = IsEnabled(CustomComboPreset.SGE_ST_Heal_Pepsis) && FindEffect(Buffs.EukrasianDiagnosis, healTarget, LocalPlayer?.GameObjectId) is not null;
return Config.SGE_ST_Heal_Pepsis;
case 3:
action = PvE.SGE.Taurochole;
enabled = IsEnabled(CustomComboPreset.SGE_ST_Heal_Taurochole) && PvE.SGE.Gauge.HasAddersgall();
return PvE.SGE.Config.SGE_ST_Heal_Taurochole;
action = Taurochole;
enabled = IsEnabled(CustomComboPreset.SGE_ST_Heal_Taurochole) && Gauge.HasAddersgall();
return Config.SGE_ST_Heal_Taurochole;
case 4:
action = PvE.SGE.Haima;
action = Haima;
enabled = IsEnabled(CustomComboPreset.SGE_ST_Heal_Haima);
return PvE.SGE.Config.SGE_ST_Heal_Haima;
return Config.SGE_ST_Heal_Haima;
case 5:
action = PvE.SGE.Krasis;
action = Krasis;
enabled = IsEnabled(CustomComboPreset.SGE_ST_Heal_Krasis);
return PvE.SGE.Config.SGE_ST_Heal_Krasis;
return Config.SGE_ST_Heal_Krasis;
case 6:
action = PvE.SGE.Druochole;
enabled = IsEnabled(CustomComboPreset.SGE_ST_Heal_Druochole) && PvE.SGE.Gauge.HasAddersgall();
return PvE.SGE.Config.SGE_ST_Heal_Druochole;
action = Druochole;
enabled = IsEnabled(CustomComboPreset.SGE_ST_Heal_Druochole) && Gauge.HasAddersgall();
return Config.SGE_ST_Heal_Druochole;
}

enabled = false;
Expand All @@ -51,31 +51,31 @@ public static int GetMatchingConfigAoE(int i, out uint action, out bool enabled)
switch (i)
{
case 0:
action = PvE.SGE.Kerachole;
enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Kerachole) && (!PvE.SGE.Config.SGE_AoE_Heal_KeracholeTrait || (PvE.SGE.Config.SGE_AoE_Heal_KeracholeTrait && TraitLevelChecked(PvE.SGE.Traits.EnhancedKerachole))) && PvE.SGE.Gauge.HasAddersgall();
action = Kerachole;
enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Kerachole) && (!Config.SGE_AoE_Heal_KeracholeTrait || (Config.SGE_AoE_Heal_KeracholeTrait && TraitLevelChecked(Traits.EnhancedKerachole))) && Gauge.HasAddersgall();
return 0;
case 1:
action = PvE.SGE.Ixochole;
enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Ixochole) && PvE.SGE.Gauge.HasAddersgall();
action = Ixochole;
enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Ixochole) && Gauge.HasAddersgall();
return 0;
case 2:
action = OriginalHook(PvE.SGE.Physis);
action = OriginalHook(Physis);
enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Physis);
return 0;
case 3:
action = PvE.SGE.Holos;
action = Holos;
enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Holos);
return 0;
case 4:
action = PvE.SGE.Panhaima;
action = Panhaima;
enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Panhaima);
return 0;
case 5:
action = PvE.SGE.Pepsis;
enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Pepsis) && FindEffect(PvE.SGE.Buffs.EukrasianPrognosis) is not null;
action = Pepsis;
enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Pepsis) && FindEffect(Buffs.EukrasianPrognosis) is not null;
return 0;
case 6:
action = PvE.SGE.Philosophia;
action = Philosophia;
enabled = IsEnabled(CustomComboPreset.SGE_AoE_Heal_Philosophia);
return 0;
}
Expand Down
32 changes: 21 additions & 11 deletions XIVSlothCombo/Combos/PvE/SCH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Dalamud.Game.ClientState.Statuses;
using System.Collections.Generic;
using XIVSlothCombo.Combos.PvE.Content;
using static XIVSlothCombo.Combos.JobHelpers.SCHHelper;
using XIVSlothCombo.CustomComboNS;
using XIVSlothCombo.CustomComboNS.Functions;
using XIVSlothCombo.Data;
Expand All @@ -28,6 +29,7 @@ internal const uint
Excogitation = 7434,
Consolation = 16546,
Resurrection = 173,
Protraction = 25867,

// Offense
Bio = 17864,
Expand Down Expand Up @@ -93,9 +95,9 @@ internal static readonly Dictionary<uint, ushort>

// Class Gauge

private static SCHGauge Gauge => CustomComboFunctions.GetJobGauge<SCHGauge>();
internal static SCHGauge Gauge => CustomComboFunctions.GetJobGauge<SCHGauge>();

private static bool HasAetherflow(this SCHGauge gauge) => (gauge.Aetherflow > 0);
internal static bool HasAetherflow(this SCHGauge gauge) => (gauge.Aetherflow > 0);

internal enum OpenerState
{
Expand Down Expand Up @@ -130,7 +132,11 @@ public static UserInt
SCH_ST_Heal_LucidOption = new("SCH_ST_Heal_LucidOption", 6500),
SCH_ST_Heal_AdloquiumOption = new("SCH_ST_Heal_AdloquiumOption"),
SCH_ST_Heal_LustrateOption = new("SCH_ST_Heal_LustrateOption"),
SCH_ST_Heal_ExcogitationOption = new("SCH_ST_Heal_ExcogitationOption"),
SCH_ST_Heal_ProtractionOption = new("SCH_ST_Heal_ProtractionOption"),
SCH_ST_Heal_EsunaOption = new("SCH_ST_Heal_EsunaOption");
public static UserIntArray
SCH_ST_Heals_Priority = new("SCH_ST_Heals_Priority");
public static UserBool
SCH_ST_Heal_Adv = new("SCH_ST_Heal_Adv"),
SCH_ST_Heal_UIMouseOver = new("SCH_ST_Heal_UIMouseOver"),
Expand Down Expand Up @@ -572,22 +578,26 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
HasCleansableDebuff(healTarget))
return All.Esuna;

foreach (var prio in Config.SCH_ST_Heals_Priority.Items.OrderBy(x => x))
{
var index = Config.SCH_ST_Heals_Priority.IndexOf(prio);
var config = GetMatchingConfigST(index, out var spell, out bool enabled);

if (enabled)
{
if (GetTargetHPPercent(healTarget) <= config &&
ActionReady(spell))
return spell;
}
}

//Check for the Galvanize shield buff. Start applying if it doesn't exist or Target HP is below %
if (IsEnabled(CustomComboPreset.SCH_ST_Heal_Adloquium) &&
ActionReady(Adloquium) &&
(FindEffectOnMember(Buffs.Galvanize, healTarget) is null || GetTargetHPPercent(healTarget) <= Config.SCH_ST_Heal_AdloquiumOption))
{
return OriginalHook(Adloquium);
}

//Cast Lustrate if you have Aetherflow and Target HP is below %
if (IsEnabled(CustomComboPreset.SCH_ST_Heal_Lustrate) &&
ActionReady(Lustrate) &&
Gauge.HasAetherflow() &&
GetTargetHPPercent(healTarget) <= Config.SCH_ST_Heal_LustrateOption)
{
return Lustrate;
}
}
return actionID;
}
Expand Down
6 changes: 4 additions & 2 deletions XIVSlothCombo/Combos/PvE/SGE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
using XIVSlothCombo.Combos.PvE.Content;
using XIVSlothCombo.CustomComboNS;
using XIVSlothCombo.CustomComboNS.Functions;
using static XIVSlothCombo.Combos.JobHelpers.SGEHelper;
using XIVSlothCombo.Data;
using XIVSlothCombo.Combos.JobHelpers;

namespace XIVSlothCombo.Combos.PvE
{
Expand Down Expand Up @@ -517,7 +519,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
foreach (var prio in Config.SGE_ST_Heals_Priority.Items.OrderBy(x => x))
{
var index = Config.SGE_ST_Heals_Priority.IndexOf(prio);
var config = JobHelpers.SGE.GetMatchingConfigST(index, out var spell, out bool enabled);
var config = GetMatchingConfigST(index, out var spell, out bool enabled);

if (enabled)
{
Expand Down Expand Up @@ -561,7 +563,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
foreach (var prio in Config.SGE_AoE_Heals_Priority.Items.OrderBy(x => x))
{
var index = Config.SGE_AoE_Heals_Priority.IndexOf(prio);
var config = JobHelpers.SGE.GetMatchingConfigAoE(index, out var spell, out bool enabled);
var config = GetMatchingConfigAoE(index, out var spell, out bool enabled);

if (enabled)
{
Expand Down
15 changes: 15 additions & 0 deletions XIVSlothCombo/Window/Functions/UserConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2249,7 +2249,22 @@ internal static void Draw(CustomComboPreset preset, bool enabled)
UserConfig.DrawSliderInt(0, 100, SCH.Config.SCH_ST_Heal_AdloquiumOption, "Use Adloquium on targets at or below HP % even if they have Galvanize\n0 = Only ever use Adloquium on targets without Galvanize\n100 = Always use Adloquium");

if (preset is CustomComboPreset.SCH_ST_Heal_Lustrate)
{
UserConfig.DrawSliderInt(0, 100, SCH.Config.SCH_ST_Heal_LustrateOption, "Start using when below HP %. Set to 100 to disable this check");
UserConfig.DrawPriorityInput(SCH.Config.SCH_ST_Heals_Priority, 3, 0, $"{SCH.Lustrate.ActionName()} Priority: ");
}

if (preset is CustomComboPreset.SCH_ST_Heal_Excogitation)
{
UserConfig.DrawSliderInt(0, 100, SCH.Config.SCH_ST_Heal_ExcogitationOption, "Start using when below HP %. Set to 100 to disable this check");
UserConfig.DrawPriorityInput(SCH.Config.SCH_ST_Heals_Priority, 3, 1, $"{SCH.Excogitation.ActionName()} Priority: ");
}

if (preset is CustomComboPreset.SCH_ST_Heal_Protraction)
{
UserConfig.DrawSliderInt(0, 100, SCH.Config.SCH_ST_Heal_ProtractionOption, "Start using when below HP %. Set to 100 to disable this check");
UserConfig.DrawPriorityInput(SCH.Config.SCH_ST_Heals_Priority, 3, 2, $"{SCH.Protraction.ActionName()} Priority: ");
}

if (preset is CustomComboPreset.SCH_ST_Heal_Esuna)
UserConfig.DrawSliderInt(0, 100, SCH.Config.SCH_ST_Heal_EsunaOption, "Stop using when below HP %. Set to Zero to disable this check");
Expand Down

0 comments on commit 60d4362

Please sign in to comment.