Skip to content

Commit

Permalink
Merge pull request #399 from FFXIV-CombatReborn/newchargetrack
Browse files Browse the repository at this point in the history
Enhance cooldown info and update debug displays
  • Loading branch information
LTS-FFXIV authored Sep 22, 2024
2 parents 760381c + 7c9470d commit 6974f2b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 42 deletions.
27 changes: 26 additions & 1 deletion RotationSolver.Basic/Actions/ActionCooldownInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,31 @@ public bool WillHaveOneChargeGCD(uint gcdCount = 0, float offset = 0)
public bool WillHaveOneCharge(float remain)
=> HasOneCharge || RecastTimeRemainOneCharge <= remain;

/// <summary>
/// Determines whether the action will have the specified number of charges after the given GCD count and offset.
/// </summary>
/// <param name="charges">The number of charges.</param>
/// <param name="gcdCount">The GCD count.</param>
/// <param name="offset">The offset.</param>
/// <returns>True if the action will have the specified number of charges; otherwise, false.</returns>
public bool WillHaveXChargesGCD(uint charges, uint gcdCount = 0, float offset = 0)
=> WillHaveXCharges(charges, DataCenter.GCDTime(gcdCount, offset));

/// <summary>
/// Determines whether the action will have the specified number of charges after the given remaining time.
/// </summary>
/// <param name="charges">The number of charges.</param>
/// <param name="remain">The remaining time.</param>
/// <returns>True if the action will have the specified number of charges; otherwise, false.</returns>
public bool WillHaveXCharges(uint charges, float remain)
{
if (charges <= CurrentCharges)
return true;

float requiredTime = (charges - CurrentCharges) * RecastTimeOneChargeRaw;
return RecastTimeRemainOneCharge <= remain - requiredTime;
}

/// <summary>
/// Determines whether the action was just used after the specified time.
/// </summary>
Expand Down Expand Up @@ -194,4 +219,4 @@ internal bool CooldownCheck(bool isEmpty, byte gcdCountForAbility)
}
return true;
}
}
}
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/Rotations/Basic/MachinistRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
40 changes: 0 additions & 40 deletions RotationSolver/Updaters/StateUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
}

Expand All @@ -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;
}
}
Expand All @@ -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;
}
}
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 6974f2b

Please sign in to comment.