Skip to content

Commit

Permalink
Merge pull request #480 from FFXIV-CombatReborn/PLD-passage-option
Browse files Browse the repository at this point in the history
Added PLD option to prevent actions if you are currently using passage of arms
  • Loading branch information
LTS-FFXIV authored Dec 18, 2024
2 parents 9f17b61 + e121774 commit 8a751a1
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions BasicRotations/Tank/PLD_Default.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
namespace DefaultRotations.Tank;

[Rotation("Default", CombatType.PvE, GameVersion = "7.05")]
[Rotation("Default", CombatType.PvE, GameVersion = "7.15")]
[SourceCode(Path = "main/BasicRotations/Tank/PLD_Default.cs")]
[Api(4)]
public class PLD_Default : PaladinRotation
{
#region Config Options

[RotationConfig(CombatType.PvE, Name = "Prevent actions while you have Passage of Prms up")]
public bool PassageProtec { get; set; } = false;

[RotationConfig(CombatType.PvE, Name = "Use Hallowed Ground with Cover")]
private bool HallowedWithCover { get; set; } = true;

Expand Down Expand Up @@ -80,32 +83,38 @@ private bool HolySpiritFirst(out IAction? act)
#region oGCD Logic
protected override bool EmergencyAbility(IAction nextGCD, out IAction? act)
{
{
if (Player.HasStatus(true, StatusID.Cover) && HallowedWithCover && HallowedGroundPvE.CanUse(out act)) return true;
act = null;
if (PassageProtec && Player.HasStatus(true, StatusID.PassageOfArms)) return false;

if (HallowedGroundPvE.CanUse(out act)
&& Player.GetHealthRatio() <= HealthForDyingTanks) return true;
if (Player.HasStatus(true, StatusID.Cover) && HallowedWithCover && HallowedGroundPvE.CanUse(out act)) 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 (HallowedGroundPvE.CanUse(out act)
&& Player.GetHealthRatio() <= HealthForDyingTanks) 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() < CoverRatio) return true;

if (CoverPvE.CanUse(out act) && CoverPvE.Target.Target?.DistanceToPlayer() < 10 &&
CoverPvE.Target.Target?.GetHealthRatio() < CoverRatio) return true;
}
return base.EmergencyAbility(nextGCD, out act);
}

[RotationDesc(ActionID.IntervenePvE)]
protected override bool MoveForwardAbility(IAction nextGCD, out IAction? act)
{
act = null;
if (PassageProtec && Player.HasStatus(true, StatusID.PassageOfArms)) return false;
if (IntervenePvE.CanUse(out act)) return true;
return base.MoveForwardAbility(nextGCD, out act);
}

[RotationDesc(ActionID.SentinelPvE, ActionID.RampartPvE, ActionID.BulwarkPvE, ActionID.SheltronPvE, ActionID.ReprisalPvE)]
protected override bool DefenseSingleAbility(IAction nextGCD, out IAction? act)
{
act = null;
if (PassageProtec && Player.HasStatus(true, StatusID.PassageOfArms)) return false;

// If the player has the Hallowed Ground status, don't use any abilities.
if (!Player.HasStatus(true, StatusID.HallowedGround))
Expand All @@ -132,6 +141,9 @@ protected override bool DefenseSingleAbility(IAction nextGCD, out IAction? act)
[RotationDesc(ActionID.DivineVeilPvE, ActionID.PassageOfArmsPvE)]
protected override bool DefenseAreaAbility(IAction nextGCD, out IAction? act)
{
act = null;
if (PassageProtec && Player.HasStatus(true, StatusID.PassageOfArms)) return false;

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

if (PassageOfArmsPvE.CanUse(out act)) return true;
Expand All @@ -141,6 +153,9 @@ protected override bool DefenseAreaAbility(IAction nextGCD, out IAction? act)

protected override bool AttackAbility(IAction nextGCD, out IAction? act)
{
act = null;
if (PassageProtec && Player.HasStatus(true, StatusID.PassageOfArms)) return false;

if (WeaponRemain > 0.42f)
{
act = null;
Expand Down Expand Up @@ -173,6 +188,9 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act)
#region GCD Logic
protected override bool GeneralGCD(out IAction? act)
{
act = null;
if (PassageProtec && Player.HasStatus(true, StatusID.PassageOfArms)) return false;

//Minimizes Accidents in EX and Savage Hopefully
if (IsInHighEndDuty && !InCombat) { act = null; return false; }

Expand Down Expand Up @@ -232,6 +250,8 @@ protected override bool GeneralGCD(out IAction? act)
[RotationDesc(ActionID.ClemencyPvE)]
protected override bool HealSingleGCD(out IAction? act)
{
act = null;
if (PassageProtec && Player.HasStatus(true, StatusID.PassageOfArms)) return false;
if (ClemencyPvE.CanUse(out act)) return true;
return base.HealSingleGCD(out act);
}
Expand Down

0 comments on commit 8a751a1

Please sign in to comment.