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

Dancer Optimalizations #227

Merged
merged 3 commits into from
Sep 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 19 additions & 23 deletions BasicRotations/Ranged/DNC_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,25 @@ 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 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

// 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
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 dance
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;
Expand All @@ -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;
Expand All @@ -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))
{
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down