diff --git a/BasicRotations/Tank/PLD_Default.cs b/BasicRotations/Tank/PLD_Default.cs index c0fcb453a..dad6a4484 100644 --- a/BasicRotations/Tank/PLD_Default.cs +++ b/BasicRotations/Tank/PLD_Default.cs @@ -226,7 +226,7 @@ protected override bool GeneralGCD(out IAction? act) (HasAtonementReady && !HasDivineMight)) && !Player.HasStatus(true, StatusID.Medicated) && !HasFightOrFlight && !RageOfHalonePvE.CanUse(out act, skipComboCheck: false)) { - if (RiotBladePvE.CanUse(out act) || FastBladePvE.CanUse(out act)) return true; + if (!TotalEclipsePvE.CanUse(out _) && (RiotBladePvE.CanUse(out act) || FastBladePvE.CanUse(out act))) return true; } if ((RageOfHalonePvE.CanUse(out _, skipComboCheck: false) || HasFightOrFlight || Player.WillStatusEndGCD(1, 0, true, StatusID.SupplicationReady)) && SupplicationPvE.CanUse(out act)) return true; if (RequiescatStacks > 0 && IsLastGCD(true, SupplicationPvE) && !HasFightOrFlight && HolySpiritPvE.CanUse(out act, skipCastingCheck: true)) return true; diff --git a/ECommons b/ECommons index c28878a30..3d56bab99 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit c28878a30d62d3cd4b0928bd21aa382d420871b1 +Subproject commit 3d56bab99a34e0af322015c74600a6e95fd68766 diff --git a/RotationSolver.Basic/Actions/ActionTargetInfo.cs b/RotationSolver.Basic/Actions/ActionTargetInfo.cs index f70ee4361..d38d92a95 100644 --- a/RotationSolver.Basic/Actions/ActionTargetInfo.cs +++ b/RotationSolver.Basic/Actions/ActionTargetInfo.cs @@ -316,7 +316,7 @@ private bool CheckResistance(IGameObject gameObject) private bool CheckTimeToKill(IGameObject gameObject) { if (gameObject is not IBattleChara b) return false; - var time = b.GetTimeToKill(); + var time = b.GetTTK(); return float.IsNaN(time) || time >= action.Config.TimeToKill; } diff --git a/RotationSolver.Basic/Actions/BaseAction.cs b/RotationSolver.Basic/Actions/BaseAction.cs index 257c0a007..3de4a6b41 100644 --- a/RotationSolver.Basic/Actions/BaseAction.cs +++ b/RotationSolver.Basic/Actions/BaseAction.cs @@ -172,7 +172,7 @@ public bool CanUse(out IAction act, bool isLastAbility = false, bool isFirstAbil private bool IsTimeToKillValid() { - return DataCenter.AverageTimeToKill >= Config.TimeToKill && DataCenter.AverageTimeToKill >= Config.TimeToUntargetable; + return DataCenter.AverageTTK >= Config.TimeToKill && DataCenter.AverageTTK >= Config.TimeToUntargetable; } diff --git a/RotationSolver.Basic/Configuration/Conditions/TargetCondition.cs b/RotationSolver.Basic/Configuration/Conditions/TargetCondition.cs index 21e6cd0ad..2d83e11e3 100644 --- a/RotationSolver.Basic/Configuration/Conditions/TargetCondition.cs +++ b/RotationSolver.Basic/Configuration/Conditions/TargetCondition.cs @@ -86,9 +86,9 @@ private bool CheckTimeToKill(IBattleChara tar) { return Param2 switch { - 0 => tar.GetTimeToKill() > DistanceOrTime, - 1 => tar.GetTimeToKill() < DistanceOrTime, - 2 => tar.GetTimeToKill() == DistanceOrTime, + 0 => tar.GetTTK() > DistanceOrTime, + 1 => tar.GetTTK() < DistanceOrTime, + 2 => tar.GetTTK() == DistanceOrTime, _ => false, }; } diff --git a/RotationSolver.Basic/DataCenter.cs b/RotationSolver.Basic/DataCenter.cs index b4c66ef06..5e132cd86 100644 --- a/RotationSolver.Basic/DataCenter.cs +++ b/RotationSolver.Basic/DataCenter.cs @@ -467,7 +467,7 @@ public static float JobRange } } - public static float AverageTimeToKill + public static float AverageTTK { get { @@ -475,10 +475,10 @@ public static float AverageTimeToKill int count = 0; foreach (var b in AllHostileTargets) { - var timeToKill = b.GetTimeToKill(); - if (!float.IsNaN(timeToKill)) + var tTK = b.GetTTK(); + if (!float.IsNaN(tTK)) { - total += timeToKill; + total += tTK; count++; } } @@ -841,14 +841,17 @@ public static bool IsCastingAreaVfx() public static bool IsCastingVfx(List vfxDataQueueCopy, Func isVfx) { + // Create a copy of the list to avoid modification during enumeration + var vfxDataQueueSnapshot = new List(vfxDataQueueCopy); + // Ensure the list is not empty - if (vfxDataQueueCopy.Count == 0) + if (vfxDataQueueSnapshot.Count == 0) { return false; } // Iterate over the copied list - foreach (var vfx in vfxDataQueueCopy) + foreach (var vfx in vfxDataQueueSnapshot) { if (isVfx(vfx)) { diff --git a/RotationSolver.Basic/Helpers/ObjectHelper.cs b/RotationSolver.Basic/Helpers/ObjectHelper.cs index ee037a7b1..d73467b8e 100644 --- a/RotationSolver.Basic/Helpers/ObjectHelper.cs +++ b/RotationSolver.Basic/Helpers/ObjectHelper.cs @@ -592,7 +592,7 @@ public static bool IsBossFromTTK(this IBattleChara obj) if (obj.IsDummy()) return true; //Fate - return obj.GetTimeToKill(true) >= Service.Config.BossTimeToKill; + return obj.GetTTK(true) >= Service.Config.BossTimeToKill; } /// @@ -619,7 +619,7 @@ public static bool IsBossFromIcon(this IBattleChara obj) public static bool IsDying(this IBattleChara b) { if (b == null || b.IsDummy()) return false; - return b.GetTimeToKill() <= Service.Config.DyingTimeToKill || b.GetHealthRatio() < Service.Config.IsDyingConfig; + return b.GetTTK() <= Service.Config.DyingTimeToKill || b.GetHealthRatio() < Service.Config.IsDyingConfig; } /// @@ -645,7 +645,7 @@ internal static unsafe bool InCombat(this IBattleChara obj) /// /// The estimated time to kill the battle character in seconds, or if the calculation cannot be performed. /// - internal static float GetTimeToKill(this IBattleChara b, bool wholeTime = false) + internal static float GetTTK(this IBattleChara b, bool wholeTime = false) { if (b == null) return float.NaN; if (b.IsDummy()) return 999.99f; diff --git a/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs b/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs index 238ff255c..049703c5b 100644 --- a/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs +++ b/RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs @@ -191,7 +191,7 @@ public static bool CanHitPositional(EnemyPositional positional, IBattleChara ene /// Average time to kill for all targets. /// [Description("Average time to kill")] - public static float AverageTimeToKill => DataCenter.AverageTimeToKill; + public static float AverageTTK => DataCenter.AverageTTK; /// /// The level of the LB. @@ -209,14 +209,14 @@ public unsafe static byte LimitBreakLevel } /// - /// Is the larger than . + /// Is the larger than . /// /// Time /// Is Longer. public static bool IsLongerThan(float time) { if (IsInHighEndDuty) return true; - return AverageTimeToKill > time; + return AverageTTK > time; } /// diff --git a/RotationSolver/UI/RotationConfigWindow.cs b/RotationSolver/UI/RotationConfigWindow.cs index f193b0eb4..bc3843860 100644 --- a/RotationSolver/UI/RotationConfigWindow.cs +++ b/RotationSolver/UI/RotationConfigWindow.cs @@ -2855,7 +2855,7 @@ private static unsafe void DrawTargetData() { ImGui.Text($"HP: {battleChara.CurrentHp} / {battleChara.MaxHp}"); ImGui.Text($"Is Current Focus Target: {battleChara.IsFocusTarget()}"); - ImGui.Text($"TTK: {battleChara.GetTimeToKill()}"); + ImGui.Text($"TTK: {battleChara.GetTTK()}"); ImGui.Text($"Is Boss TTK: {battleChara.IsBossFromTTK()}"); ImGui.Text($"Is Boss Icon: {battleChara.IsBossFromIcon()}"); ImGui.Text($"Rank: {battleChara.GetObjectNPC()?.Rank.ToString() ?? string.Empty}");