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

Commit

Permalink
improved PLD logic
Browse files Browse the repository at this point in the history
  • Loading branch information
LTS-FFXIV committed Apr 8, 2024
1 parent 5ed879d commit 20742d2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27 deletions.
2 changes: 1 addition & 1 deletion BasicRotations/Tank/GNB_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected override bool DefenseSingleAbility(out IAction? act)
{
//10
if (CamouflagePvE.CanUse(out act, onLastAbility: true)) return true;
//10
//15
if (HeartOfStonePvE.CanUse(out act, onLastAbility: true)) return true;

//30
Expand Down
58 changes: 32 additions & 26 deletions BasicRotations/Tank/PLD_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ public class PLD_Default : PaladinRotation
return base.CountDownAction(remainTime);
}

protected override bool EmergencyAbility(IAction nextGCD, out IAction? act)
{
if (InCombat)
{
if (HasTankStance && OathGauge == 100 && UseOath(out act)) return true;
}

if (Player.HasStatus(true, StatusID.Cover) && HallowedGroundPvE.CanUse(out act, onLastAbility: true)) return true;

if ((Player.HasStatus(true, StatusID.Rampart) || Player.HasStatus(true, StatusID.Sentinel)) && InterventionPvE.CanUse(out act) &&
InterventionPvE.Target.Target?.GetHealthRatio() < 0.6) return true;

if (CoverPvE.CanUse(out act) && CoverPvE.Target.Target?.DistanceToPlayer() < 10 && CoverPvE.Target.Target?.GetHealthRatio() < 0.3) return true;

return base.EmergencyAbility(nextGCD, out act);
}

protected override bool AttackAbility(out IAction? act)
{
act = null;
Expand All @@ -43,8 +60,6 @@ protected override bool AttackAbility(out IAction? act)

if (!IsMoving && IntervenePvE.CanUse(out act, skipAoeCheck: true, usedUp: HasFightOrFlight)) return true;

if (HasTankStance && OathGauge == 100 && UseOath(out act)) return true;

return base.AttackAbility(out act);
}

Expand Down Expand Up @@ -96,54 +111,45 @@ protected override bool GeneralGCD(out IAction? act)
[RotationDesc(ActionID.ReprisalPvE, ActionID.DivineVeilPvE)]
protected override bool DefenseAreaAbility(out IAction? act)
{
act = null;

if (DivineVeilPvE.CanUse(out act)) return true;

if (PassageOfArmsPvE.CanUse(out act)) return true;
return base.DefenseAreaAbility(out act);
}

[RotationDesc(ActionID.PassageOfArmsPvE)]
protected override bool HealAreaAbility(out IAction? act)
{
act = null;

//if (PassageOfArmsPvE.CanUse(out act)) return true;
return base.HealAreaAbility(out act);
}

[RotationDesc(ActionID.SentinelPvE, ActionID.RampartPvE, ActionID.BulwarkPvE, ActionID.SheltronPvE, ActionID.ReprisalPvE)]
protected override bool DefenseSingleAbility(out IAction? act)
{
act = null;

// If the player has the Hallowed Ground status, don't use any abilities.
if (Player.HasStatus(true, StatusID.HallowedGround)) return false;
if (!Player.HasStatus(true, StatusID.HallowedGround))
{
// If Bulwark can be used and there are more than 2 hostiles in range, use it and return true.
if (BulwarkPvE.CanUse(out act, true) && NumberOfHostilesInRange > 2) return true;

// If Bulwark can be used and there are more than 2 hostiles in range, use it and return true.
if (BulwarkPvE.CanUse(out act, true) && NumberOfHostilesInRange > 2) return true;
// If Oath can be used, use it and return true.
//if (UseOath(out act, true)) return true;

// If Oath can be used, use it and return true.
if (UseOath(out act, true)) return true;
// If Rampart is not cooling down or has been cooling down for more than 60 seconds, and Sentinel can be used, use Sentinel and return true.
if ((!RampartPvE.Cooldown.IsCoolingDown || RampartPvE.Cooldown.ElapsedAfter(60)) && SentinelPvE.CanUse(out act)) return true;

// If Rampart is not cooling down or has been cooling down for more than 60 seconds, and Sentinel can be used, use Sentinel and return true.
if ((!RampartPvE.Cooldown.IsCoolingDown || RampartPvE.Cooldown.ElapsedAfter(60)) && SentinelPvE.CanUse(out act)) return true;
// If Sentinel is at an enough level and is cooling down for more than 60 seconds, or if Sentinel is not at an enough level, and Rampart can be used, use Rampart and return true.
if ((SentinelPvE.EnoughLevel && SentinelPvE.Cooldown.IsCoolingDown && SentinelPvE.Cooldown.ElapsedAfter(60) || !SentinelPvE.EnoughLevel) && RampartPvE.CanUse(out act)) return true;

// If Sentinel is at an enough level and is cooling down for more than 60 seconds, or if Sentinel is not at an enough level, and Rampart can be used, use Rampart and return true.
if ((SentinelPvE.EnoughLevel && SentinelPvE.Cooldown.IsCoolingDown && SentinelPvE.Cooldown.ElapsedAfter(60) || !SentinelPvE.EnoughLevel) && RampartPvE.CanUse(out act)) return true;
// If Reprisal can be used, use it and return true.
if (ReprisalPvE.CanUse(out act, skipAoeCheck: true, skipStatusProvideCheck: true)) return true;

// If Reprisal can be used, use it and return true.
if (ReprisalPvE.CanUse(out act, skipAoeCheck: true)) return true;
}

return base.DefenseSingleAbility(out act);
}

private bool UseOath(out IAction act, bool onLast = false)
{
{
if (SheltronPvE.CanUse(out act, onLastAbility: onLast)) return true;
if (InterventionPvE.CanUse(out act, onLastAbility: onLast)) return true;

return false;
}
}
}

0 comments on commit 20742d2

Please sign in to comment.