Skip to content

Commit

Permalink
Merge pull request #438 from kaedys/feature/misc-part-1
Browse files Browse the repository at this point in the history
[FEATURE] Miscellaneous Part 1
  • Loading branch information
MKhayle authored Sep 11, 2024
2 parents 6a365cc + c4ca6c2 commit 8859a06
Show file tree
Hide file tree
Showing 15 changed files with 578 additions and 393 deletions.
13 changes: 9 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ dotnet_style_qualification_for_field=true:silent
dotnet_style_qualification_for_property=true:silent
dotnet_style_qualification_for_method=true:silent

dotnet_diagnostic.CA1822.severity=silent
dotnet_diagnostic.SA1518.severity = none
dotnet_diagnostic.SA1516.severity = none
dotnet_diagnostic.CA1822.severity = none
dotnet_diagnostic.IDE0047.severity = none
dotnet_diagnostic.IDE0130.severity = none
dotnet_diagnostic.SA1005.severity = none
dotnet_diagnostic.SA1117.severity = none
dotnet_diagnostic.SA1119.severity = none
dotnet_diagnostic.IDE0047.severity = none
dotnet_diagnostic.SA1132.severity = none
dotnet_diagnostic.SA1516.severity = none
dotnet_diagnostic.SA1518.severity = none
dotnet_diagnostic.SA1519.severity = none
dotnet_diagnostic.SA1600.severity = none
45 changes: 22 additions & 23 deletions XIVComboExpanded/Attributes/IconsComboAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,6 @@ namespace XIVComboExpandedPlugin.Attributes;
[AttributeUsage(AttributeTargets.Field)]
internal class IconsComboAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="IconsComboAttribute"/> class with a single icon.
/// </summary>
/// <param name="icon">Icon that should be displayed next to the action preset.</param>
internal IconsComboAttribute(uint icon)
{
this.Icons = [icon];
}

/// <summary>
/// Initializes a new instance of the <see cref="IconsComboAttribute"/> class with up to 3 icons.
/// </summary>
/// <param name="icons">Array of icon that should be displayed next to the action preset.</param>
internal IconsComboAttribute(uint[] icons)
{
this.Icons = icons;
}

/// <summary>
/// Gets the icon ID.
/// </summary>
public uint[] Icons { get; }

public const uint
// Combo-Specific
Opo = 70123,
Expand Down Expand Up @@ -64,4 +41,26 @@ public const uint
OutOfBattle = 61822,
Cycle = 66329;

/// <summary>
/// Initializes a new instance of the <see cref="IconsComboAttribute"/> class with a single icon.
/// </summary>
/// <param name="icon">Icon that should be displayed next to the action preset.</param>
internal IconsComboAttribute(uint icon)
{
this.Icons = [icon];
}

/// <summary>
/// Initializes a new instance of the <see cref="IconsComboAttribute"/> class with up to 3 icons.
/// </summary>
/// <param name="icons">Array of icon that should be displayed next to the action preset.</param>
internal IconsComboAttribute(uint[] icons)
{
this.Icons = icons;
}

/// <summary>
/// Gets the icon ID.
/// </summary>
public uint[] Icons { get; }
}
7 changes: 3 additions & 4 deletions XIVComboExpanded/Combos/AST.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ public const uint
Play2 = 37020,
Play3 = 37021,
MinorArcanaDT = 37022,
CombinedHelios = 37030;
CombinedHelios = 37030,
Oracle = 37029;

public static class Buffs
{
public const ushort
ClarifyingDraw = 2713;
Divining = 3893;
}

public static class Debuffs
Expand Down Expand Up @@ -102,9 +103,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
};

if (!combustEffects.Any(effect => effect?.RemainingTime > 2.8))
{
return OriginalHook(AST.Combust);
}
}

if (IsEnabled(CustomComboPreset.AstrologianMaleficArcanaFeature) && gauge.DrawnCrownCard == CardType.LORD && level >= AST.Levels.MinorArcana)
Expand Down
14 changes: 9 additions & 5 deletions XIVComboExpanded/Combos/BLM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
if (((HasEffect(BLM.Buffs.Swiftcast) || HasEffect(BLM.Buffs.Triplecast))
&& gauge.ElementTimeRemaining / 1000.0 < fire4.BaseCooldown * 1.10) || gauge.ElementTimeRemaining / 1000.0 < fire4.CastTime * 1.10)
{
if (level > BLM.Levels.Despair && LocalPlayer?.CurrentMp > 0 && LocalPlayer?.CurrentMp < 2400 && (HasEffect(BLM.Buffs.Swiftcast) || HasEffect(BLM.Buffs.Triplecast)))
if (level >= BLM.Levels.Despair &&
LocalPlayer?.CurrentMp >= 800 && LocalPlayer?.CurrentMp < 2400 &&
(HasEffect(BLM.Buffs.Swiftcast) || HasEffect(BLM.Buffs.Triplecast)))
return BLM.Despair;
if (HasEffect(BLM.Buffs.Firestarter))
return BLM.Fire3;
Expand All @@ -142,7 +144,9 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
if (IsEnabled(CustomComboPreset.BlackEnochianDespairFlareStarFeature))
{
// 2nd and 3rd checks for opener and post-manafont usage
if (level >= BLM.Levels.FlareStar && gauge.AstralSoulStacks >= 6 && (LocalPlayer?.CurrentMp <= 0 || LocalPlayer?.CurrentMp == 8400 || LocalPlayer?.CurrentMp == 10000))
if (level >= BLM.Levels.FlareStar && gauge.AstralSoulStacks >= 6 &&
(LocalPlayer?.CurrentMp <= 0 || LocalPlayer?.CurrentMp == 8400 ||
LocalPlayer?.CurrentMp == 10000))
return BLM.FlareStar;
}

Expand Down Expand Up @@ -179,7 +183,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
if (actionID == BLM.Transpose)
{
var gauge = GetJobGauge<BLMGauge>();
if (level >= BLM.Levels.UmbralSoul && gauge.IsEnochianActive && gauge.InUmbralIce)
if (level >= BLM.Levels.UmbralSoul && gauge.InUmbralIce)
return BLM.UmbralSoul;
}

Expand All @@ -197,7 +201,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
{
var gauge = GetJobGauge<BLMGauge>();

if (level < BLM.Levels.UmbralSoul || (gauge.IsEnochianActive && gauge.InAstralFire))
if (level < BLM.Levels.UmbralSoul || !gauge.InUmbralIce)
return BLM.Transpose;
}

Expand Down Expand Up @@ -280,7 +284,7 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
if (level >= BLM.Levels.Paradox && gauge.IsParadoxActive)
{
if (gauge.InUmbralIce || LocalPlayer?.CurrentMp >= 1600)
return BLM.Paradox;
return BLM.Paradox;
}

if (level >= BLM.Levels.Blizzard3)
Expand Down
88 changes: 77 additions & 11 deletions XIVComboExpanded/Combos/BRD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,16 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
return BRD.BlastArrow;
}

if (IsEnabled(CustomComboPreset.BardShadowbiteFeature))
if (IsEnabled(CustomComboPreset.BardShadowbiteFeature) && level >= BRD.Levels.WideVolley)
{
if (level >= BRD.Levels.WideVolley)
if (IsEnabled(CustomComboPreset.BardShadowbiteBarrageFeature))
{
if (IsEnabled(CustomComboPreset.BardShadowbiteBarrageFeature))
{
if (level >= BRD.Levels.Barrage && IsCooldownUsable(BRD.Barrage))
return BRD.Barrage;
}

if (HasEffect(BRD.Buffs.HawksEye) || HasEffect(BRD.Buffs.Barrage))
return OriginalHook(BRD.WideVolley);
if (level >= BRD.Levels.Barrage && IsCooldownUsable(BRD.Barrage))
return BRD.Barrage;
}

if (HasEffect(BRD.Buffs.HawksEye) || HasEffect(BRD.Buffs.Barrage))
return OriginalHook(BRD.WideVolley);
}
}

Expand Down Expand Up @@ -365,6 +362,40 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
}
}

internal class BardApexArrow : CustomCombo
{
protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BardAutoIronJawsApexFeature;

protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level)
{
if (actionID == BRD.ApexArrow || actionID == BRD.BlastArrow)
{
if (level >= BRD.Levels.IronJaws)
{
// Using 5 seconds instead of 2.8s like the other DoT auto-refresh features, because Bard loses a
// lot more from letting their DoTs drop, since they have to use two GCDs instead of one to
// re-apply them.
var dotTimer = 5.0;

if (IsEnabled(CustomComboPreset.BardShotIronJawsOption)) // option to use 2.8
dotTimer = 2.8;

// have to explicitly check all variants of the dot for some reason else spaghetti code ensues
var venomous = FindTargetEffect(BRD.Debuffs.VenomousBite);
var windbite = FindTargetEffect(BRD.Debuffs.Windbite);
var stormbite = FindTargetEffect(BRD.Debuffs.Stormbite);
var caustic = FindTargetEffect(BRD.Debuffs.CausticBite);

if (venomous?.RemainingTime < dotTimer || windbite?.RemainingTime < dotTimer ||
stormbite?.RemainingTime < dotTimer || caustic?.RemainingTime < dotTimer)
return BRD.IronJaws;
}
}

return actionID;
}
}

internal class BardEmpyrealArrow : CustomCombo
{
protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BardEmpyrealArrowFeature;
Expand All @@ -381,6 +412,42 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
}
}

internal class BardRagingStrikes : CustomCombo
{
protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BardRagingBarrageFeature;

protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level)
{
if (actionID == BRD.RagingStrikes)
{
if (level >= BRD.Levels.Barrage && IsCooldownUsable(BRD.Barrage) && !IsCooldownUsable(BRD.RagingStrikes))
return OriginalHook(BRD.Barrage);
}

return actionID;
}
}

internal class BardBattleVoice : CustomCombo
{
protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BardBattleFinaleFeature;

protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level)
{
if (actionID == BRD.BattleVoice)
{
var finale = IsCooldownUsable(BRD.RadiantFinale);
var voice = GetCooldown(BRD.BattleVoice);

if (level >= BRD.Levels.RadiantFinale && ((GetCooldown(BRD.BattleVoice).CooldownRemaining > 30 &&
IsCooldownUsable(BRD.RadiantFinale)) || HasEffect(BRD.Buffs.RadiantEncoreReady)))
return OriginalHook(BRD.RadiantFinale);
}

return actionID;
}
}

internal class BardRadiantFinale : CustomCombo
{
protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BrdAny;
Expand Down Expand Up @@ -418,7 +485,6 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
}
}


internal class BardMagesBallad : CustomCombo
{
protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BardCyclingSongFeature;
Expand Down
35 changes: 27 additions & 8 deletions XIVComboExpanded/Combos/DNC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public const uint
Bloodshower = 15996,
// Dancing
StandardStep = 15997,
StandardFinish = 16003,
TechnicalStep = 15998,
TechnicalFinish = 16004,
Tillana = 25790,
LastDance = 36983,
FinishingMove = 36984,
Expand Down Expand Up @@ -212,9 +214,6 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
if (gauge.CompletedSteps < 4)
return gauge.NextStep;
}

// Tillana
return OriginalHook(DNC.TechnicalStep);
}

return actionID;
Expand Down Expand Up @@ -257,7 +256,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
{
var gauge = GetJobGauge<DNCGauge>();

if (level >= DNC.Levels.SaberDance && !HasEffect(DNC.Buffs.StandardStep) && !HasEffect(DNC.Buffs.TechnicalStep) && IsEnabled(CustomComboPreset.DancerAutoSaberDance))
if (level >= DNC.Levels.SaberDance && !HasEffect(DNC.Buffs.StandardStep) &&
!HasEffect(DNC.Buffs.TechnicalStep) && IsEnabled(CustomComboPreset.DancerAutoSaberDance))
{
if (IsEnabled(CustomComboPreset.DancerAutoSaberDanceSTDawn) && gauge.Esprit >= 50 &&
HasEffect(DNC.Buffs.DanceOfTheDawnReady))
Expand Down Expand Up @@ -318,18 +318,19 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
{
var gauge = GetJobGauge<DNCGauge>();

if (level >= DNC.Levels.SaberDance && !HasEffect(DNC.Buffs.StandardStep) && !HasEffect(DNC.Buffs.TechnicalStep) && IsEnabled(CustomComboPreset.DancerAutoSaberDance))
if (level >= DNC.Levels.SaberDance && !HasEffect(DNC.Buffs.StandardStep) &&
!HasEffect(DNC.Buffs.TechnicalStep) && IsEnabled(CustomComboPreset.DancerAutoSaberDance))
{
if (IsEnabled(CustomComboPreset.DancerAutoSaberDanceSTDawn) && gauge.Esprit >= 50 &&
if (IsEnabled(CustomComboPreset.DancerAutoSaberDanceAoEDawn) && gauge.Esprit >= 50 &&
HasEffect(DNC.Buffs.DanceOfTheDawnReady))
return OriginalHook(DNC.SaberDance);

if (IsEnabled(CustomComboPreset.DancerAutoSaberDanceSTTech) && gauge.Esprit >= 50 &&
if (IsEnabled(CustomComboPreset.DancerAutoSaberDanceAoETech) && gauge.Esprit >= 50 &&
HasEffect(DNC.Buffs.TechnicalFinish))
return OriginalHook(DNC.SaberDance);

if (gauge.Esprit >= 50 && (gauge.Esprit >= 85 ||
!IsEnabled(CustomComboPreset.DancerAutoSaberDanceST85Esprit)))
!IsEnabled(CustomComboPreset.DancerAutoSaberDanceAoE85Esprit)))
return OriginalHook(DNC.SaberDance);
}

Expand Down Expand Up @@ -396,6 +397,24 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
}
}

internal class DancerTillanaOvercap : CustomCombo
{
protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.DancerTillanaOvercap;

protected override uint Invoke(uint actionID, uint lastComboMove, float comboTime, byte level)
{
if (actionID == DNC.TechnicalStep || actionID == DNC.TechnicalFinish || actionID == DNC.Tillana)
{
var gauge = GetJobGauge<DNCGauge>();

if (gauge.Esprit >= 50 && CanUseAction(DNC.Tillana))
return OriginalHook(DNC.SaberDance);
}

return actionID;
}
}

internal class DancerLastDanceFeature : CustomCombo
{
protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.DancerLastDanceFeature;
Expand Down
Loading

0 comments on commit 8859a06

Please sign in to comment.