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

Commit

Permalink
Merge branch 'Nik-Potokar:main' into VariousFixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagekazu authored Jul 11, 2024
2 parents c36ebb0 + 2e1c580 commit 8748ecb
Show file tree
Hide file tree
Showing 14 changed files with 1,800 additions and 1,490 deletions.
686 changes: 374 additions & 312 deletions XIVSlothCombo/Combos/CustomComboPreset.cs

Large diffs are not rendered by default.

400 changes: 112 additions & 288 deletions XIVSlothCombo/Combos/JobHelpers/DRG.cs

Large diffs are not rendered by default.

217 changes: 217 additions & 0 deletions XIVSlothCombo/Combos/JobHelpers/RPR.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
using ECommons.DalamudServices;
using XIVSlothCombo.Combos.JobHelpers.Enums;
using XIVSlothCombo.Combos.PvE;
using XIVSlothCombo.CustomComboNS.Functions;
using XIVSlothCombo.Data;

namespace XIVSlothCombo.Combos.JobHelpers
{
internal class RPROpenerLogic : RPR
{
private static bool HasCooldowns()
{
if (CustomComboFunctions.GetRemainingCharges(SoulSlice) < 2)
return false;

if (!CustomComboFunctions.ActionReady(ArcaneCircle))
return false;

if (!CustomComboFunctions.ActionReady(Gluttony))
return false;

return true;
}

private static uint OpenerLevel => 100;

public uint PrePullStep = 0;

public uint OpenerStep = 1;

public static bool LevelChecked => CustomComboFunctions.LocalPlayer.Level >= OpenerLevel;

private static bool CanOpener => HasCooldowns() && LevelChecked;

private OpenerState currentState = OpenerState.PrePull;

public OpenerState CurrentState
{
get
{
return currentState;
}
set
{
if (value != currentState)
{
if (value == OpenerState.PrePull)
{
Svc.Log.Debug($"Entered PrePull Opener");
}
if (value == OpenerState.InOpener) OpenerStep = 1;
if (value == OpenerState.OpenerFinished || value == OpenerState.FailedOpener)
{
if (value == OpenerState.FailedOpener)
Svc.Log.Information($"Opener Failed at step {OpenerStep}");

ResetOpener();
}
if (value == OpenerState.OpenerFinished) Svc.Log.Information("Opener Finished");

currentState = value;
}
}
}

private bool DoPrePullSteps(ref uint actionID)
{
if (!LevelChecked) return false;

if (CanOpener && PrePullStep == 0)
{
PrePullStep = 1;
}

if (!HasCooldowns())
{
PrePullStep = 0;
}

if (CurrentState == OpenerState.PrePull && PrePullStep > 0)
{
if (CustomComboFunctions.HasEffect(Buffs.Soulsow) && PrePullStep == 1) PrePullStep++;
else if (PrePullStep == 1) actionID = Soulsow;

if (CustomComboFunctions.LocalPlayer.CastActionId == Harpe && CustomComboFunctions.HasEffect(Buffs.Soulsow) && PrePullStep == 2) CurrentState = OpenerState.InOpener;
else if (PrePullStep == 2) actionID = Harpe;

if (PrePullStep == 2 && !CustomComboFunctions.HasEffect(Buffs.Soulsow))
CurrentState = OpenerState.FailedOpener;

if (ActionWatching.CombatActions.Count > 2 && CustomComboFunctions.InCombat())
CurrentState = OpenerState.FailedOpener;

return true;
}

PrePullStep = 0;
return false;
}

private bool DoOpener(ref uint actionID)
{
if (!LevelChecked) return false;

if (currentState == OpenerState.InOpener)
{
if (CustomComboFunctions.WasLastAction(ShadowOfDeath) && OpenerStep == 1) OpenerStep++;
else if (OpenerStep == 1) actionID = ShadowOfDeath;

if (CustomComboFunctions.WasLastAction(SoulSlice) && OpenerStep == 2) OpenerStep++;
else if (OpenerStep == 2) actionID = SoulSlice;

if (CustomComboFunctions.WasLastAction(ArcaneCircle) && OpenerStep == 3) OpenerStep++;
else if (OpenerStep == 3) actionID = ArcaneCircle;

if (CustomComboFunctions.WasLastAction(Gluttony) && OpenerStep == 4) OpenerStep++;
else if (OpenerStep == 4) actionID = Gluttony;

if (CustomComboFunctions.WasLastAction(ExecutionersGibbet) && OpenerStep == 5) OpenerStep++;
else if (OpenerStep == 5) actionID = ExecutionersGibbet;

if (CustomComboFunctions.WasLastAction(ExecutionersGallows) && OpenerStep == 6) OpenerStep++;
else if (OpenerStep == 6) actionID = ExecutionersGallows;

if (CustomComboFunctions.WasLastAction(PlentifulHarvest) && OpenerStep == 7) OpenerStep++;
else if (OpenerStep == 7) actionID = PlentifulHarvest;

if (CustomComboFunctions.WasLastAction(Enshroud) && OpenerStep == 8) OpenerStep++;
else if (OpenerStep == 8) actionID = Enshroud;

if (CustomComboFunctions.WasLastAction(VoidReaping) && OpenerStep == 9) OpenerStep++;
else if (OpenerStep == 9) actionID = VoidReaping;

if (CustomComboFunctions.WasLastAction(Sacrificium) && OpenerStep == 10) OpenerStep++;
else if (OpenerStep == 10) actionID = Sacrificium;

if (CustomComboFunctions.WasLastAction(CrossReaping) && OpenerStep == 11) OpenerStep++;
else if (OpenerStep == 11) actionID = CrossReaping;

if (CustomComboFunctions.WasLastAction(LemuresSlice) && OpenerStep == 12) OpenerStep++;
else if (OpenerStep == 12) actionID = LemuresSlice;

if (CustomComboFunctions.WasLastAction(VoidReaping) && OpenerStep == 13) OpenerStep++;
else if (OpenerStep == 13) actionID = VoidReaping;

if (CustomComboFunctions.WasLastAction(CrossReaping) && OpenerStep == 14) OpenerStep++;
else if (OpenerStep == 14) actionID = CrossReaping;

if (CustomComboFunctions.WasLastAction(LemuresSlice) && OpenerStep == 15) OpenerStep++;
else if (OpenerStep == 15) actionID = LemuresSlice;

if (CustomComboFunctions.WasLastAction(Communio) && OpenerStep == 16) OpenerStep++;
else if (OpenerStep == 16) actionID = Communio;

if (CustomComboFunctions.WasLastAction(Perfectio) && OpenerStep == 17) OpenerStep++;
else if (OpenerStep == 17) actionID = Perfectio;

if (CustomComboFunctions.WasLastAction(SoulSlice) && OpenerStep == 18) OpenerStep++;
else if (OpenerStep == 18) actionID = SoulSlice;

if (CustomComboFunctions.WasLastAction(UnveiledGibbet) && OpenerStep == 19) OpenerStep++;
else if (OpenerStep == 19) actionID = UnveiledGibbet;

if (CustomComboFunctions.WasLastAction(Gibbet) && OpenerStep == 20) OpenerStep++;
else if (OpenerStep == 20) actionID = Gibbet;

if (CustomComboFunctions.WasLastAction(ShadowOfDeath) && OpenerStep == 21) OpenerStep++;
else if (OpenerStep == 21) actionID = ShadowOfDeath;

if (CustomComboFunctions.WasLastAction(Slice) && OpenerStep == 22) CurrentState = OpenerState.OpenerFinished;
else if (OpenerStep == 22) actionID = Slice;

if (ActionWatching.TimeSinceLastAction.TotalSeconds >= 5)
CurrentState = OpenerState.FailedOpener;

if (((actionID == SoulSlice && CustomComboFunctions.GetRemainingCharges(SoulSlice) == 0) ||
(actionID == ArcaneCircle && CustomComboFunctions.IsOnCooldown(ArcaneCircle)) ||
(actionID == Gluttony && CustomComboFunctions.IsOnCooldown(Gluttony))) && ActionWatching.TimeSinceLastAction.TotalSeconds >= 3)
{
CurrentState = OpenerState.FailedOpener;
return false;
}
return true;
}
return false;
}

private void ResetOpener()
{
PrePullStep = 0;
OpenerStep = 0;
}

public bool DoFullOpener(ref uint actionID)
{
if (!LevelChecked)
return false;

if (CurrentState == OpenerState.PrePull)
if (DoPrePullSteps(ref actionID))
return true;

if (CurrentState == OpenerState.InOpener)
{
if (DoOpener(ref actionID))
return true;
}

if (!CustomComboFunctions.InCombat())
{
ResetOpener();
CurrentState = OpenerState.PrePull;
}
return false;
}
}
}
22 changes: 12 additions & 10 deletions XIVSlothCombo/Combos/PvE/BLU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public const uint
BasicInstinct = 23276,
HydroPull = 23282,
MustardBomb = 23279,
WingedRepropbation = 34576,
WingedReprobation = 34576,
SeaShanty = 34580,
BeingMortal = 34582,
BreathOfMagic = 34567,
Expand Down Expand Up @@ -277,8 +277,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim

if (!HasEffect(Buffs.PhantomFlurry))
{
if (IsEnabled(CustomComboPreset.BLU_PrimalCombo_WingedReprobation) && FindEffect(Buffs.WingedReprobation)?.StackCount > 1 && IsOffCooldown(WingedRepropbation))
return OriginalHook(WingedRepropbation);
if (IsEnabled(CustomComboPreset.BLU_PrimalCombo_WingedReprobation) && FindEffect(Buffs.WingedReprobation)?.StackCount > 1 && IsOffCooldown(WingedReprobation))
return OriginalHook(WingedReprobation);

if (IsOffCooldown(FeatherRain) && IsSpellActive(FeatherRain) &&
(IsNotEnabled(CustomComboPreset.BLU_PrimalCombo_Pool) || (IsEnabled(CustomComboPreset.BLU_PrimalCombo_Pool) && (GetCooldownRemainingTime(Nightbloom) > 30 || IsOffCooldown(Nightbloom)))))
Expand Down Expand Up @@ -309,8 +309,8 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
if (GetRemainingCharges(Surpanakha) == 0) surpanakhaReady = false;
}

if (IsEnabled(CustomComboPreset.BLU_PrimalCombo_WingedReprobation) && IsSpellActive(WingedRepropbation) && IsOffCooldown(WingedRepropbation))
return OriginalHook(WingedRepropbation);
if (IsEnabled(CustomComboPreset.BLU_PrimalCombo_WingedReprobation) && IsSpellActive(WingedReprobation) && IsOffCooldown(WingedReprobation))
return OriginalHook(WingedReprobation);

if (IsEnabled(CustomComboPreset.BLU_PrimalCombo_SeaShanty) && IsSpellActive(SeaShanty) && IsOffCooldown(SeaShanty))
return SeaShanty;
Expand Down Expand Up @@ -398,7 +398,7 @@ protected override uint Invoke(uint actionID, uint lastComboActionID, float comb
internal class BLU_NewMoonFluteOpener : CustomCombo
{
protected internal override CustomComboPreset Preset { get; } = CustomComboPreset.BLU_NewMoonFluteOpener;

protected override uint Invoke(uint actionID, uint lastComboActionID, float comboTime, byte level)
{
if (actionID is MoonFlute)
Expand Down Expand Up @@ -448,17 +448,19 @@ protected override uint Invoke(uint actionID, uint lastComboActionID, float comb
}
else
{
if (IsSpellActive(WingedRepropbation) && (!HasEffect(Buffs.WingedReprobation) || FindEffect(Buffs.WingedReprobation).StackCount < 2) && IsOffCooldown(WingedRepropbation) && !WasLastAbility(WingedRepropbation) && !WasLastAbility(FeatherRain))
return OriginalHook(WingedRepropbation);
if (IsSpellActive(WingedReprobation) && IsOffCooldown(WingedReprobation) && !WasLastSpell(WingedReprobation) && !WasLastAbility(FeatherRain) && (!HasEffect(Buffs.WingedReprobation) || FindEffect(Buffs.WingedReprobation).StackCount < 2))
return WingedReprobation;

if (IsSpellActive(FeatherRain) && IsOffCooldown(FeatherRain))
return FeatherRain;

if (IsSpellActive(SeaShanty) && IsOffCooldown(SeaShanty))
return SeaShanty;

}

if (IsSpellActive(WingedReprobation) && IsOffCooldown(WingedReprobation) && !WasLastAbility(ShockStrike) && FindEffect(Buffs.WingedReprobation).StackCount < 2)
return WingedReprobation;

if (IsSpellActive(ShockStrike) && IsOffCooldown(ShockStrike))
return ShockStrike;

Expand All @@ -479,7 +481,7 @@ protected override uint Invoke(uint actionID, uint lastComboActionID, float comb
if (IsSpellActive(MatraMagic) && HasEffect(All.Buffs.Swiftcast))
return MatraMagic;

if (IsSpellActive(BeingMortal) && IsOffCooldown(BeingMortal))
if (IsSpellActive(BeingMortal) && IsOffCooldown(BeingMortal) && IsEnabled(CustomComboPreset.BLU_NewMoonFluteOpener_DoTOpener))
return BeingMortal;

if (IsSpellActive(PhantomFlurry) && IsOffCooldown(PhantomFlurry))
Expand Down
Loading

0 comments on commit 8748ecb

Please sign in to comment.