From ea932a70385fc9a21a4b9e7d6de73c71beada58d Mon Sep 17 00:00:00 2001 From: Four-amer Date: Sat, 14 Sep 2024 18:35:17 +0200 Subject: [PATCH 1/3] Dancer Optimalizations Shouldn't use abilities that their animation lock can drift dancing right before dance and during it, Just like Curing Waltz Sometimes it used FanDance II or FanDance when FanDance III was available, now it doesn't. However it hard to test since it happens rarely but i didn't notice a single instance of it happening for 2 hours so its probably working as intented The overcapping mechanic for feathers now uses feathers before nextGCD that can generate it, instead of instantly when it hits 4, also moved the storing feathers mechanic to when the player hits level anough for devilment instead of tech step. It seems that the code that prevented using standard step when technical step cd is less that time required to do the dance didn't work properly. Fixed that --- BasicRotations/Ranged/DNC_Default.cs | 46 +++++++++++++--------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/BasicRotations/Ranged/DNC_Default.cs b/BasicRotations/Ranged/DNC_Default.cs index a84467e..874715f 100644 --- a/BasicRotations/Ranged/DNC_Default.cs +++ b/BasicRotations/Ranged/DNC_Default.cs @@ -52,21 +52,16 @@ protected override bool EmergencyAbility(IAction nextGCD, out IAction? act) if (DevilmentPvE.CanUse(out act)) return true; } - // If currently dancing, defer to the base class emergency handling - if (IsDancing) - { - return base.EmergencyAbility(nextGCD, out act); - } - // Use burst medicine if cooldown for Technical Step has elapsed sufficiently if (TechnicalStepPvE.Cooldown.ElapsedAfter(115) && UseBurstMedicine(out act)) return true; - // Attempt to use Fan Dance III if available - if (FanDanceIiiPvE.CanUse(out act, skipAoeCheck: true)) return true; + //If dancing or about to dance avoid using abilities to avoid animation lock delaying the GCD, except for Devilment + if(!IsDancing && !StandardStepPvE.Cooldown.WillHaveOneCharge(1f) && !TechnicalStepPvE.Cooldown.WillHaveOneCharge(1f)) + return base.EmergencyAbility(nextGCD, out act); // Fallback to base class method if none of the above conditions are met - // Fallback to base class method if none of the above conditions are met - return base.EmergencyAbility(nextGCD, out act); + act = null; + return false; } // Override the method for handling attack abilities @@ -74,8 +69,8 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act) { act = null; - // If currently in the middle of a dance, no attack ability should be executed - if (IsDancing) return false; + //If dancing or about to dance avoid using abilities to avoid animation lock delaying the GCD + if (IsDancing || StandardStepPvE.Cooldown.WillHaveOneCharge(1f) || TechnicalStepPvE.Cooldown.WillHaveOneCharge(1f)) return false; // Prevent triple weaving by checking if an action was just used if (nextGCD.AnimationLockTime > 0.75f) return false; @@ -93,8 +88,13 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act) } } - //Use all feathers on burst - if ((Player.HasStatus(true, StatusID.Devilment) || Feathers > 3 || !TechnicalStepPvE.EnoughLevel) && !FanDanceIiiPvE.CanUse(out _, skipAoeCheck: true)) + // Attempt to use Fan Dance III if available + if (FanDanceIiiPvE.CanUse(out act, skipAoeCheck: true)) return true; + + IAction[] FeathersGCDs = [ReverseCascadePvE, FountainfallPvE, RisingWindmillPvE, BloodshowerPvE]; + + //Use all feathers on burst or if about to overcap + if ((!DevilmentPvE.EnoughLevel || Player.HasStatus(true, StatusID.Devilment) || (Feathers > 3 && FeathersGCDs.Contains(nextGCD))) && !Player.HasStatus(true, StatusID.ThreefoldFanDance)) { if (FanDanceIiPvE.CanUse(out act)) return true; if (FanDancePvE.CanUse(out act)) return true; @@ -118,10 +118,6 @@ protected override bool GeneralGCD(out IAction? act) return true; } - // Check if Standard Step or Technical Step is about to come off cooldown and hold GCD if necessary - if (StandardStepPvE.Cooldown.WillHaveOneCharge(0.25f) || TechnicalStepPvE.Cooldown.WillHaveOneCharge(0.25f)) - { } - // Try to finish the dance if applicable if (FinishTheDance(out act)) { @@ -166,9 +162,9 @@ protected override bool GeneralGCD(out IAction? act) // Helper method to handle attack actions during GCD based on certain conditions private bool AttackGCD(out IAction? act, bool burst) { - act = null; + act = null; - if (IsDancing || Feathers > 3) return false; + if (IsDancing) return false; if (!DevilmentPvE.CanUse(out _, skipComboCheck: true)) { @@ -203,7 +199,7 @@ private bool AttackGCD(out IAction? act, bool burst) { if (HasHostilesInMaxRange && UseStandardStep(out act)) return true; } - if (!HoldStepForTargets) + else { if (UseStandardStep(out act)) return true; } @@ -215,8 +211,8 @@ private bool AttackGCD(out IAction? act, bool burst) if (StarfallDancePvE.CanUse(out act, skipAoeCheck: true)) return true; - bool standardReady = StandardStepPvE.Cooldown.ElapsedAfter(28); - bool technicalReady = TechnicalStepPvE.Cooldown.ElapsedAfter(118); + bool standardReady = StandardStepPvE.Cooldown.WillHaveOneCharge(2.5f); + bool technicalReady = TechnicalStepPvE.Cooldown.WillHaveOneCharge(2.5f); if (!(standardReady || technicalReady) && (!shouldUseLastDance || !LastDancePvE.CanUse(out act, skipAoeCheck: true))) @@ -238,11 +234,11 @@ private bool UseStandardStep(out IAction act) { // Attempt to use Standard Step if available and certain conditions are met if (!StandardStepPvE.CanUse(out act, skipAoeCheck: true)) return false; - if (Player.WillStatusEndGCD(2, 0, true, StatusID.StandardFinish)) return true; + if (Player.WillStatusEnd(5f, true, StatusID.StandardFinish)) return true; // Check for hostiles in range and technical step conditions if (!HasHostilesInRange) return false; - if (Player.HasStatus(true, StatusID.TechnicalFinish) && Player.WillStatusEndGCD(2, 0, true, StatusID.TechnicalFinish) || TechnicalStepPvE.Cooldown.IsCoolingDown && TechnicalStepPvE.Cooldown.WillHaveOneChargeGCD(2)) return false; + if (Player.HasStatus(true, StatusID.TechnicalFinish) && Player.WillStatusEndGCD(2, 0, true, StatusID.TechnicalFinish) || (TechnicalStepPvE.Cooldown.IsCoolingDown && TechnicalStepPvE.Cooldown.WillHaveOneCharge(5))) return false; return true; } From 53c0a0e7301049e335d8985033582e33c2b293b7 Mon Sep 17 00:00:00 2001 From: Four-amer Date: Sat, 14 Sep 2024 18:52:25 +0200 Subject: [PATCH 2/3] Small fix TIL that WillHaveOneCharge returns true if the ability is not avaible to use --- BasicRotations/Ranged/DNC_Default.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BasicRotations/Ranged/DNC_Default.cs b/BasicRotations/Ranged/DNC_Default.cs index 874715f..44bfb98 100644 --- a/BasicRotations/Ranged/DNC_Default.cs +++ b/BasicRotations/Ranged/DNC_Default.cs @@ -57,7 +57,7 @@ protected override bool EmergencyAbility(IAction nextGCD, out IAction? act) && UseBurstMedicine(out act)) return true; //If dancing or about to dance avoid using abilities to avoid animation lock delaying the GCD, except for Devilment - if(!IsDancing && !StandardStepPvE.Cooldown.WillHaveOneCharge(1f) && !TechnicalStepPvE.Cooldown.WillHaveOneCharge(1f)) + if(!IsDancing && !(StandardStepPvE.Cooldown.ElapsedAfter(28) || TechnicalStepPvE.Cooldown.ElapsedAfter(118))) return base.EmergencyAbility(nextGCD, out act); // Fallback to base class method if none of the above conditions are met act = null; @@ -70,7 +70,7 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act) act = null; //If dancing or about to dance avoid using abilities to avoid animation lock delaying the GCD - if (IsDancing || StandardStepPvE.Cooldown.WillHaveOneCharge(1f) || TechnicalStepPvE.Cooldown.WillHaveOneCharge(1f)) return false; + if (IsDancing || StandardStepPvE.Cooldown.ElapsedAfter(28) || TechnicalStepPvE.Cooldown.ElapsedAfter(118)) return false; // Prevent triple weaving by checking if an action was just used if (nextGCD.AnimationLockTime > 0.75f) return false; @@ -211,8 +211,8 @@ private bool AttackGCD(out IAction? act, bool burst) if (StarfallDancePvE.CanUse(out act, skipAoeCheck: true)) return true; - bool standardReady = StandardStepPvE.Cooldown.WillHaveOneCharge(2.5f); - bool technicalReady = TechnicalStepPvE.Cooldown.WillHaveOneCharge(2.5f); + bool standardReady = StandardStepPvE.Cooldown.ElapsedAfter(28); + bool technicalReady = TechnicalStepPvE.Cooldown.ElapsedAfter(118); if (!(standardReady || technicalReady) && (!shouldUseLastDance || !LastDancePvE.CanUse(out act, skipAoeCheck: true))) From ac83c0eadc92b440d24bcfde311d517a3a462bd6 Mon Sep 17 00:00:00 2001 From: Four-amer Date: Sat, 14 Sep 2024 19:03:12 +0200 Subject: [PATCH 3/3] Typo --- BasicRotations/Ranged/DNC_Default.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BasicRotations/Ranged/DNC_Default.cs b/BasicRotations/Ranged/DNC_Default.cs index 44bfb98..7b794d2 100644 --- a/BasicRotations/Ranged/DNC_Default.cs +++ b/BasicRotations/Ranged/DNC_Default.cs @@ -56,7 +56,7 @@ protected override bool EmergencyAbility(IAction nextGCD, out IAction? act) if (TechnicalStepPvE.Cooldown.ElapsedAfter(115) && UseBurstMedicine(out act)) return true; - //If dancing or about to dance avoid using abilities to avoid animation lock delaying the GCD, except for Devilment + //If dancing or about to dance avoid using abilities to avoid animation lock delaying the dance, except for Devilment if(!IsDancing && !(StandardStepPvE.Cooldown.ElapsedAfter(28) || TechnicalStepPvE.Cooldown.ElapsedAfter(118))) return base.EmergencyAbility(nextGCD, out act); // Fallback to base class method if none of the above conditions are met @@ -69,7 +69,7 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act) { act = null; - //If dancing or about to dance avoid using abilities to avoid animation lock delaying the GCD + //If dancing or about to dance avoid using abilities to avoid animation lock delaying the dance if (IsDancing || StandardStepPvE.Cooldown.ElapsedAfter(28) || TechnicalStepPvE.Cooldown.ElapsedAfter(118)) return false; // Prevent triple weaving by checking if an action was just used