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

Add configuration to control usage of the last thin air charge #272

Merged
merged 1 commit into from
Oct 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
20 changes: 19 additions & 1 deletion BasicRotations/Healer/WHM_Default.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.ComponentModel;

namespace DefaultRotations.Healer;

[Rotation("Default", CombatType.PvE, GameVersion = "7.05")]
Expand Down Expand Up @@ -39,6 +41,21 @@ public sealed class WHM_Default : WhiteMageRotation
[RotationConfig(CombatType.PvE, Name = "Casting cost requirement for Thin Air to be used")]

public float ThinAirNeed { get; set; } = 1000;

[RotationConfig(CombatType.PvE, Name = "How to manage the last thin air charge")]
public ThinAirUsageStrategy ThinAirLastChargeUsage { get; set; } = ThinAirUsageStrategy.ReserveLastChargeForRaise;

public enum ThinAirUsageStrategy : byte
{
[Description("Use all thin air charges on expensive spells")]
UseAllCharges,

[Description("Reserve the last charge for raise")]
ReserveLastChargeForRaise,

[Description("Reserve the last charge")]
ReserveLastCharge,
}
#endregion

#region Countdown Logic
Expand All @@ -61,8 +78,9 @@ protected override bool EmergencyAbility(IAction nextGCD, out IAction? act)
{
if (Player.WillStatusEndGCD(0, 3, true, StatusID.DivineGrace) && DivineCaressPvE.CanUse(out act)) return true;

bool useLastThinAirCharge = ThinAirLastChargeUsage == ThinAirUsageStrategy.UseAllCharges || (ThinAirLastChargeUsage == ThinAirUsageStrategy.ReserveLastChargeForRaise && nextGCD == RaisePvE);
if (nextGCD is IBaseAction action && action.Info.MPNeed >= ThinAirNeed &&
ThinAirPvE.CanUse(out act)) return true;
ThinAirPvE.CanUse(out act, usedUp: useLastThinAirCharge)) return true;

if (nextGCD.IsTheSameTo(true, AfflatusRapturePvE, MedicaPvE, MedicaIiPvE, CureIiiPvE)
&& (MergedStatus.HasFlag(AutoStatus.HealAreaSpell) || MergedStatus.HasFlag(AutoStatus.HealSingleSpell)))
Expand Down