Skip to content

Commit

Permalink
update VPR
Browse files Browse the repository at this point in the history
  • Loading branch information
xhabit committed Aug 11, 2024
1 parent 9558de6 commit 82bdcfe
Show file tree
Hide file tree
Showing 3 changed files with 367 additions and 319 deletions.
135 changes: 67 additions & 68 deletions XIVSlothComboX/Combos/JobHelpers/VPROpenerLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
using ECommons.DalamudServices;
using FFXIVClientStructs.FFXIV.Client.Game;
using XIVSlothComboX.Combos.JobHelpers.Enums;
using XIVSlothComboX.Combos.PvE;
using XIVSlothComboX.CustomComboNS.Functions;
using XIVSlothComboX.Data;

using static XIVSlothComboX.Combos.PvE.VPR;
using static XIVSlothComboX.CustomComboNS.Functions.CustomComboFunctions;
namespace XIVSlothCombo.Combos.JobHelpers
{
internal class VPRHelpers : VPR
internal class VPRHelpers
{
internal class VPROpenerLogic
{
private static bool HasCooldowns()
{
if (CustomComboFunctions.GetRemainingCharges(Vicewinder) < 2)
if (GetRemainingCharges(Vicewinder) < 2)
return false;

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

return true;
Expand All @@ -29,7 +28,7 @@ private static bool HasCooldowns()

public uint OpenerStep = 0;

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

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

Expand Down Expand Up @@ -81,10 +80,10 @@ private bool DoPrePullSteps(ref uint actionID)

if (CurrentState == OpenerState.PrePull && PrePullStep > 0)
{
if (CustomComboFunctions.WasLastAction(ReavingFangs) && PrePullStep == 1) CurrentState = OpenerState.InOpener;
if (WasLastAction(ReavingFangs) && PrePullStep == 1) CurrentState = OpenerState.InOpener;
else if (PrePullStep == 1) actionID = ReavingFangs;

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

return true;
Expand All @@ -100,122 +99,122 @@ private bool DoOpener(ref uint actionID)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

if (CustomComboFunctions.WasLastAction(UncoiledFury) && OpenerStep == 22) OpenerStep++;
else if (OpenerStep == 22) actionID = UncoiledFury;
if (WasLastAction(UncoiledTwinblood) && OpenerStep == 22) OpenerStep++;
else if (OpenerStep == 22) actionID = UncoiledTwinblood;

if (CustomComboFunctions.WasLastAction(UncoiledTwinfang) && OpenerStep == 23) OpenerStep++;
else if (OpenerStep == 23) actionID = UncoiledTwinfang;
if (WasLastAction(UncoiledFury) && OpenerStep == 23) OpenerStep++;
else if (OpenerStep == 23) actionID = UncoiledFury;

if (CustomComboFunctions.WasLastAction(UncoiledTwinblood) && OpenerStep == 24) OpenerStep++;
else if (OpenerStep == 24) actionID = UncoiledTwinblood;
if (WasLastAction(UncoiledTwinfang) && OpenerStep == 24) OpenerStep++;
else if (OpenerStep == 24) actionID = UncoiledTwinfang;

if (CustomComboFunctions.WasLastAction(UncoiledFury) && OpenerStep == 25) OpenerStep++;
else if (OpenerStep == 25) actionID = UncoiledFury;
if (WasLastAction(UncoiledTwinblood) && OpenerStep == 25) OpenerStep++;
else if (OpenerStep == 25) actionID = UncoiledTwinblood;

if (CustomComboFunctions.WasLastAction(UncoiledTwinfang) && OpenerStep == 26) OpenerStep++;
else if (OpenerStep == 26) actionID = UncoiledTwinfang;
if (WasLastAction(HindstingStrike) && OpenerStep == 26) OpenerStep++;
else if (OpenerStep == 26) actionID = HindstingStrike;

if (CustomComboFunctions.WasLastAction(UncoiledTwinblood) && OpenerStep == 27) OpenerStep++;
else if (OpenerStep == 27) actionID = UncoiledTwinblood;
if (WasLastAction(DeathRattle) && OpenerStep == 27) OpenerStep++;
else if (OpenerStep == 27) actionID = DeathRattle;

if (CustomComboFunctions.WasLastAction(Vicewinder) && OpenerStep == 28) OpenerStep++;
if (WasLastAction(Vicewinder) && OpenerStep == 28) OpenerStep++;
else if (OpenerStep == 28) actionID = Vicewinder;

if (CustomComboFunctions.WasLastAction(UncoiledFury) && OpenerStep == 29) OpenerStep++;
if (WasLastAction(UncoiledFury) && OpenerStep == 29) OpenerStep++;
else if (OpenerStep == 29) actionID = UncoiledFury;

if (CustomComboFunctions.WasLastAction(UncoiledTwinfang) && OpenerStep == 30) OpenerStep++;
if (WasLastAction(UncoiledTwinfang) && OpenerStep == 30) OpenerStep++;
else if (OpenerStep == 30) actionID = UncoiledTwinfang;

if (CustomComboFunctions.WasLastAction(UncoiledTwinblood) && OpenerStep == 31) OpenerStep++;
if (WasLastAction(UncoiledTwinblood) && OpenerStep == 31) OpenerStep++;
else if (OpenerStep == 31) actionID = UncoiledTwinblood;

if (CustomComboFunctions.WasLastAction(HuntersCoil) && OpenerStep == 32) OpenerStep++;
if (WasLastAction(HuntersCoil) && OpenerStep == 32) OpenerStep++;
else if (OpenerStep == 32) actionID = HuntersCoil;

if (CustomComboFunctions.WasLastAction(TwinfangBite) && OpenerStep == 33) OpenerStep++;
if (WasLastAction(TwinfangBite) && OpenerStep == 33) OpenerStep++;
else if (OpenerStep == 33) actionID = TwinfangBite;

if (CustomComboFunctions.WasLastAction(TwinbloodBite) && OpenerStep == 34) OpenerStep++;
if (WasLastAction(TwinbloodBite) && OpenerStep == 34) OpenerStep++;
else if (OpenerStep == 34) actionID = TwinbloodBite;

if (CustomComboFunctions.WasLastAction(SwiftskinsCoil) && OpenerStep == 35) OpenerStep++;
if (WasLastAction(SwiftskinsCoil) && OpenerStep == 35) OpenerStep++;
else if (OpenerStep == 35) actionID = SwiftskinsCoil;

if (CustomComboFunctions.WasLastAction(TwinbloodBite) && OpenerStep == 36) OpenerStep++;
if (WasLastAction(TwinbloodBite) && OpenerStep == 36) OpenerStep++;
else if (OpenerStep == 36) actionID = TwinbloodBite;

if (CustomComboFunctions.WasLastAction(TwinfangBite) && OpenerStep == 37) CurrentState = OpenerState.OpenerFinished;
if (WasLastAction(TwinfangBite) && OpenerStep == 37) CurrentState = OpenerState.OpenerFinished;
else if (OpenerStep == 37) actionID = TwinfangBite;

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

if (((actionID == SerpentsIre && CustomComboFunctions.IsOnCooldown(SerpentsIre)) ||
(actionID == Vicewinder && CustomComboFunctions.GetRemainingCharges(Vicewinder) < 2)) && ActionWatching.TimeSinceLastAction.TotalSeconds >= 3)
if (((actionID == SerpentsIre && IsOnCooldown(SerpentsIre)) ||
(actionID == Vicewinder && GetRemainingCharges(Vicewinder) < 2)) && ActionWatching.TimeSinceLastAction.TotalSeconds >= 3)
{
CurrentState = OpenerState.FailedOpener;
return false;
Expand Down Expand Up @@ -246,7 +245,7 @@ public bool DoFullOpener(ref uint actionID)
return true;
}

if (!CustomComboFunctions.InCombat())
if (!InCombat())
{
ResetOpener();
CurrentState = OpenerState.PrePull;
Expand All @@ -270,41 +269,41 @@ internal class VPRCheckTimers
{
public static bool IsHoningExpiring(float Times)
{
float GCD = CustomComboFunctions.GetCooldown(SteelFangs).CooldownTotal * Times;
float GCD = GetCooldown(SteelFangs).CooldownTotal * Times;

if ((CustomComboFunctions.HasEffect(Buffs.HonedSteel) && CustomComboFunctions.GetBuffRemainingTime(Buffs.HonedSteel) < GCD) ||
(CustomComboFunctions.HasEffect(Buffs.HonedReavers) && CustomComboFunctions.GetBuffRemainingTime(Buffs.HonedReavers) < GCD))
if ((HasEffect(Buffs.HonedSteel) && GetBuffRemainingTime(Buffs.HonedSteel) < GCD) ||
(HasEffect(Buffs.HonedReavers) && GetBuffRemainingTime(Buffs.HonedReavers) < GCD))
return true;

else return false;
}

public static bool IsVenomExpiring(float Times)
{
float GCD = CustomComboFunctions.GetCooldown(SteelFangs).CooldownTotal * Times;
float GCD = GetCooldown(SteelFangs).CooldownTotal * Times;

if ((CustomComboFunctions.HasEffect(Buffs.FlankstungVenom) && CustomComboFunctions.GetBuffRemainingTime(Buffs.FlankstungVenom) < GCD) ||
(CustomComboFunctions.HasEffect(Buffs.FlanksbaneVenom) && CustomComboFunctions.GetBuffRemainingTime(Buffs.FlanksbaneVenom) < GCD) ||
(CustomComboFunctions.HasEffect(Buffs.HindstungVenom) && CustomComboFunctions.GetBuffRemainingTime(Buffs.HindstungVenom) < GCD) ||
(CustomComboFunctions.HasEffect(Buffs.HindsbaneVenom) && CustomComboFunctions.GetBuffRemainingTime(Buffs.HindsbaneVenom) < GCD))
if ((HasEffect(Buffs.FlankstungVenom) && GetBuffRemainingTime(Buffs.FlankstungVenom) < GCD) ||
(HasEffect(Buffs.FlanksbaneVenom) && GetBuffRemainingTime(Buffs.FlanksbaneVenom) < GCD) ||
(HasEffect(Buffs.HindstungVenom) && GetBuffRemainingTime(Buffs.HindstungVenom) < GCD) ||
(HasEffect(Buffs.HindsbaneVenom) && GetBuffRemainingTime(Buffs.HindsbaneVenom) < GCD))
return true;

else return false;
}

public static bool IsEmpowermentExpiring(float Times)
{
float GCD = CustomComboFunctions.GetCooldown(SteelFangs).CooldownTotal * Times;
float GCD = GetCooldown(SteelFangs).CooldownTotal * Times;

if (CustomComboFunctions.GetBuffRemainingTime(Buffs.Swiftscaled) < GCD || CustomComboFunctions.GetBuffRemainingTime(Buffs.HuntersInstinct) < GCD)
if (GetBuffRemainingTime(Buffs.Swiftscaled) < GCD || GetBuffRemainingTime(Buffs.HuntersInstinct) < GCD)
return true;

else return false;
}

public unsafe static bool IsComboExpiring(float Times)
{
float GCD = CustomComboFunctions.GetCooldown(SteelFangs).CooldownTotal * Times;
float GCD = GetCooldown(SteelFangs).CooldownTotal * Times;

if (ActionManager.Instance()->Combo.Timer != 0 && ActionManager.Instance()->Combo.Timer < GCD)
return true;
Expand Down
Loading

0 comments on commit 82bdcfe

Please sign in to comment.