From 7c9470d84bb8f0d6fa386a07f96d3f56f8f315a3 Mon Sep 17 00:00:00 2001
From: LTS-FFXIV <127939494+LTS-FFXIV@users.noreply.github.com>
Date: Sun, 22 Sep 2024 04:37:39 -0500
Subject: [PATCH] Enhance cooldown info and update debug displays
Enhanced `ActionCooldownInfo` with `WillHaveXChargesGCD` and `WillHaveXCharges` methods for better charge management. Updated `Configs` class to clarify `_raiseAll` applies to Alliance Raids. Added debug display for `OverheatedStacks` in `MachinistRotation`. Removed redundant debug logs from `StateUpdater` to reduce clutter.
---
.../Actions/ActionCooldownInfo.cs | 27 ++++++++++++-
RotationSolver.Basic/Configuration/Configs.cs | 2 +-
.../Rotations/Basic/MachinistRotation.cs | 1 +
RotationSolver/Updaters/StateUpdater.cs | 40 -------------------
4 files changed, 28 insertions(+), 42 deletions(-)
diff --git a/RotationSolver.Basic/Actions/ActionCooldownInfo.cs b/RotationSolver.Basic/Actions/ActionCooldownInfo.cs
index 1a695d391..38428567f 100644
--- a/RotationSolver.Basic/Actions/ActionCooldownInfo.cs
+++ b/RotationSolver.Basic/Actions/ActionCooldownInfo.cs
@@ -148,6 +148,31 @@ public bool WillHaveOneChargeGCD(uint gcdCount = 0, float offset = 0)
public bool WillHaveOneCharge(float remain)
=> HasOneCharge || RecastTimeRemainOneCharge <= remain;
+ ///
+ /// Determines whether the action will have the specified number of charges after the given GCD count and offset.
+ ///
+ /// The number of charges.
+ /// The GCD count.
+ /// The offset.
+ /// True if the action will have the specified number of charges; otherwise, false.
+ public bool WillHaveXChargesGCD(uint charges, uint gcdCount = 0, float offset = 0)
+ => WillHaveXCharges(charges, DataCenter.GCDTime(gcdCount, offset));
+
+ ///
+ /// Determines whether the action will have the specified number of charges after the given remaining time.
+ ///
+ /// The number of charges.
+ /// The remaining time.
+ /// True if the action will have the specified number of charges; otherwise, false.
+ public bool WillHaveXCharges(uint charges, float remain)
+ {
+ if (charges <= CurrentCharges)
+ return true;
+
+ float requiredTime = (charges - CurrentCharges) * RecastTimeOneChargeRaw;
+ return RecastTimeRemainOneCharge <= remain - requiredTime;
+ }
+
///
/// Determines whether the action was just used after the specified time.
///
@@ -194,4 +219,4 @@ internal bool CooldownCheck(bool isEmpty, byte gcdCountForAbility)
}
return true;
}
-}
\ No newline at end of file
+}
diff --git a/RotationSolver.Basic/Configuration/Configs.cs b/RotationSolver.Basic/Configuration/Configs.cs
index 4ca56bfee..7401eea8d 100644
--- a/RotationSolver.Basic/Configuration/Configs.cs
+++ b/RotationSolver.Basic/Configuration/Configs.cs
@@ -436,7 +436,7 @@ public const string
PvEFilter = JobFilterType.None)]
private static readonly bool _raisePlayerBySwift = true;
- [ConditionBool, UI("Raise any player in range (even if they are not in your party)",
+ [ConditionBool, UI("Raise any player in range in Alliance Raids)",
Filter = HealingActionCondition, Section = 2,
PvEFilter = JobFilterType.Raise, PvPFilter = JobFilterType.NoJob)]
private static readonly bool _raiseAll = false;
diff --git a/RotationSolver.Basic/Rotations/Basic/MachinistRotation.cs b/RotationSolver.Basic/Rotations/Basic/MachinistRotation.cs
index f002c13f9..253fdb854 100644
--- a/RotationSolver.Basic/Rotations/Basic/MachinistRotation.cs
+++ b/RotationSolver.Basic/Rotations/Basic/MachinistRotation.cs
@@ -70,6 +70,7 @@ public override void DisplayStatus()
ImGui.Text("LastSummonBatteryPower: " + LastSummonBatteryPower.ToString());
ImGui.Text("OverheatTimeRemainingRaw: " + OverheatTimeRemainingRaw.ToString());
ImGui.Text("OverheatTime: " + OverheatTime.ToString());
+ ImGui.Text("OverheatedStacks: " + OverheatedStacks.ToString());
}
#endregion
diff --git a/RotationSolver/Updaters/StateUpdater.cs b/RotationSolver/Updaters/StateUpdater.cs
index 0e2ebc4bc..6cf9ae7c0 100644
--- a/RotationSolver/Updaters/StateUpdater.cs
+++ b/RotationSolver/Updaters/StateUpdater.cs
@@ -85,34 +85,18 @@ private static AutoStatus StatusFromAutomatic()
if (_healDelay1.Delay(canHealAreaAbility))
{
- if (Service.Config.InDebug)
- {
- Svc.Log.Information("Triggering HealAreaAbility.");
- }
status |= AutoStatus.HealAreaAbility;
}
if (_healDelay2.Delay(canHealAreaSpell))
{
- if (Service.Config.InDebug)
- {
- Svc.Log.Information("Triggering HealAreaSpell.");
- }
status |= AutoStatus.HealAreaSpell;
}
if (_healDelay3.Delay(canHealSingleAbility))
{
- if (Service.Config.InDebug)
- {
- Svc.Log.Information("Triggering HealSingleAbility.");
- }
status |= AutoStatus.HealSingleAbility;
}
if (_healDelay4.Delay(canHealSingleSpell))
{
- if (Service.Config.InDebug)
- {
- Svc.Log.Information("Triggering HealSingleSpell.");
- }
status |= AutoStatus.HealSingleSpell;
}
}
@@ -123,19 +107,11 @@ private static AutoStatus StatusFromAutomatic()
{
if (DataCenter.IsHostileCastingAOE)
{
- if (Service.Config.InDebug)
- {
- Svc.Log.Information("Triggering DefenseArea.");
- }
status |= AutoStatus.DefenseArea;
}
if (DataCenter.AreHostilesCastingKnockback && Service.Config.UseKnockback)
{
- if (Service.Config.InDebug)
- {
- Svc.Log.Information("Triggering AntiKnockback.");
- }
status |= AutoStatus.AntiKnockback;
}
@@ -150,10 +126,6 @@ private static AutoStatus StatusFromAutomatic()
return DataCenter.IsHostileCastingToTank;
}))
{
- if (Service.Config.InDebug)
- {
- Svc.Log.Information("Triggering DefenseSingle for Healer/PLD.");
- }
status |= AutoStatus.DefenseSingle;
}
}
@@ -173,20 +145,12 @@ private static AutoStatus StatusFromAutomatic()
&& Player.Object.GetHealthRatio() <= Service.Config.HealthForAutoDefense
&& movingHere && attacked)
{
- if (Service.Config.InDebug)
- {
- Svc.Log.Information("Triggering DefenseSingle for Tank.");
- }
status |= AutoStatus.DefenseSingle;
}
//Big damage casting action.
if (DataCenter.IsHostileCastingToTank)
{
- if (Service.Config.InDebug)
- {
- Svc.Log.Information("Triggering DefenseSingle for Tank (Hostile Casting).");
- }
status |= AutoStatus.DefenseSingle;
}
}
@@ -197,10 +161,6 @@ private static AutoStatus StatusFromAutomatic()
|| DataCenter.AllianceMembers.Count(o => o.IsJobCategory(JobRole.Tank)) < 2)
&& DataCenter.ProvokeTarget != null)
{
- if (Service.Config.InDebug)
- {
- Svc.Log.Information("Provoke");
- }
status |= AutoStatus.Provoke;
}
}