From 5afe2dfe23e2d63888f1202d5d5752c6917a561a Mon Sep 17 00:00:00 2001 From: LTS-FFXIV <127939494+LTS-FFXIV@users.noreply.github.com> Date: Thu, 27 Feb 2025 14:13:51 -0600 Subject: [PATCH 1/2] Improve Hypercharge logic and optimize target updates Enhanced Hypercharge usage in MCH_Default and MCH_HighEnd to allow activation when Wildfire is unavailable. Commented out non-functional TargetHostileType conditions in ObjectHelper. Reduced TimeToKillUpdateInterval in TargetUpdater for more frequent updates and streamlined death list handling by using empty arrays. --- BasicRotations/Ranged/MCH_Default.cs | 3 +++ BasicRotations/Ranged/MCH_HighEnd.cs | 3 +++ RotationSolver.Basic/Helpers/ObjectHelper.cs | 8 ++++---- RotationSolver/Updaters/TargetUpdater.cs | 10 +++++----- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/BasicRotations/Ranged/MCH_Default.cs b/BasicRotations/Ranged/MCH_Default.cs index f221afdb..8ea26864 100644 --- a/BasicRotations/Ranged/MCH_Default.cs +++ b/BasicRotations/Ranged/MCH_Default.cs @@ -85,6 +85,9 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act) // If Wildfire is active, use Hypercharge.....Period if (Player.HasStatus(true, StatusID.Wildfire_1946) && HyperchargePvE.CanUse(out act)) return true; + // If you cant use Wildfire, use Hypercharge freely + if (!WildfirePvE.EnoughLevel && HyperchargePvE.CanUse(out act)) return true; + // Start Ricochet/Gauss cooldowns rolling if (!RicochetPvE.Cooldown.IsCoolingDown && RicochetPvE.CanUse(out act)) return true; if (!GaussRoundPvE.Cooldown.IsCoolingDown && GaussRoundPvE.CanUse(out act)) return true; diff --git a/BasicRotations/Ranged/MCH_HighEnd.cs b/BasicRotations/Ranged/MCH_HighEnd.cs index db5e3e62..ab29c10f 100644 --- a/BasicRotations/Ranged/MCH_HighEnd.cs +++ b/BasicRotations/Ranged/MCH_HighEnd.cs @@ -88,6 +88,9 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act) // If Wildfire is active, use Hypercharge.....Period if (Player.HasStatus(true, StatusID.Wildfire_1946) && HyperchargePvE.CanUse(out act)) return true; + // If you cant use Wildfire, use Hypercharge freely + if (!WildfirePvE.EnoughLevel && HyperchargePvE.CanUse(out act)) return true; + // don't do anything that might fuck with burst timings at 100 if (nextGCD.IsTheSameTo(true, FullMetalFieldPvE) || IsLastGCD(true, FullMetalFieldPvE)) { diff --git a/RotationSolver.Basic/Helpers/ObjectHelper.cs b/RotationSolver.Basic/Helpers/ObjectHelper.cs index d73467b8..34346f6d 100644 --- a/RotationSolver.Basic/Helpers/ObjectHelper.cs +++ b/RotationSolver.Basic/Helpers/ObjectHelper.cs @@ -141,9 +141,10 @@ internal static bool IsAttackable(this IBattleChara battleChara) TargetHostileType.AllTargetsWhenSolo => DataCenter.PartyMembers.Count == 1 || battleChara.TargetObject is IBattleChara, TargetHostileType.AllTargetsWhenSoloInDuty => (DataCenter.PartyMembers.Count == 1 && (Svc.Condition[ConditionFlag.BoundByDuty] || Svc.Condition[ConditionFlag.BoundByDuty56])) || battleChara.TargetObject is IBattleChara, - TargetHostileType.TargetIsInEnemiesList => battleChara.TargetObject is IBattleChara target && target.IsInEnemiesList(), - TargetHostileType.AllTargetsWhenSoloTargetIsInEnemiesList => (DataCenter.PartyMembers.Count == 1 && (Svc.Condition[ConditionFlag.BoundByDuty] || Svc.Condition[ConditionFlag.BoundByDuty56])) || battleChara.TargetObject is IBattleChara target && target.IsInEnemiesList(), - TargetHostileType.AllTargetsWhenSoloInDutyTargetIsInEnemiesList => DataCenter.PartyMembers.Count == 1 || battleChara.TargetObject is IBattleChara target && target.IsInEnemiesList(), + //Below options do not work while in party, isAttackable will always return false + //TargetHostileType.TargetIsInEnemiesList => battleChara.TargetObject is IBattleChara target && target.IsInEnemiesList(), + //TargetHostileType.AllTargetsWhenSoloTargetIsInEnemiesList => (DataCenter.PartyMembers.Count == 1 && (Svc.Condition[ConditionFlag.BoundByDuty] || Svc.Condition[ConditionFlag.BoundByDuty56])) || battleChara.TargetObject is IBattleChara target && target.IsInEnemiesList(), + //TargetHostileType.AllTargetsWhenSoloInDutyTargetIsInEnemiesList => DataCenter.PartyMembers.Count == 1 || battleChara.TargetObject is IBattleChara target && target.IsInEnemiesList(), _ => true, }; } @@ -166,7 +167,6 @@ private static string RemoveControlCharacters(string input) return output.ToString(); } - //Below never returns true internal static unsafe bool IsInEnemiesList(this IBattleChara battleChara) { var addons = Service.GetAddons(); diff --git a/RotationSolver/Updaters/TargetUpdater.cs b/RotationSolver/Updaters/TargetUpdater.cs index 1b92b77e..8d16d518 100644 --- a/RotationSolver/Updaters/TargetUpdater.cs +++ b/RotationSolver/Updaters/TargetUpdater.cs @@ -13,7 +13,7 @@ private static readonly ObjectListDelay _raiseAllTargets = new(() => Service.Config.RaiseDelay); private static DateTime _lastUpdateTimeToKill = DateTime.MinValue; - private static readonly TimeSpan TimeToKillUpdateInterval = TimeSpan.FromSeconds(0.5); + private static readonly TimeSpan TimeToKillUpdateInterval = TimeSpan.FromSeconds(0.1); internal static void UpdateTargets() { @@ -187,10 +187,10 @@ private static List GetAllHostileTargets() { try { - var deathParty = DataCenter.PartyMembers?.GetDeath().ToList() ?? new List(); - var deathAll = DataCenter.AllTargets?.GetDeath().ToList() ?? new List(); - var deathNPC = DataCenter.FriendlyNPCMembers?.GetDeath().ToList() ?? new List(); - var deathAllianceMembers = DataCenter.AllianceMembers?.GetDeath().ToList() ?? new List(); + var deathParty = DataCenter.PartyMembers?.GetDeath().ToList() ?? []; + var deathAll = DataCenter.AllTargets?.GetDeath().ToList() ?? []; + var deathNPC = DataCenter.FriendlyNPCMembers?.GetDeath().ToList() ?? []; + var deathAllianceMembers = DataCenter.AllianceMembers?.GetDeath().ToList() ?? []; var deathAllianceHealers = new List(deathParty); var deathAllianceSupports = new List(deathParty); From 5f1a0661713e7c494a51343269a3248df6b6f43a Mon Sep 17 00:00:00 2001 From: LTS-FFXIV <127939494+LTS-FFXIV@users.noreply.github.com> Date: Thu, 27 Feb 2025 14:14:46 -0600 Subject: [PATCH 2/2] Update ECommons subproject commit reference The subproject commit for ECommons has been updated from commit `a1df6434ddac33eab306b3f4f605f59f0d0a7279` to commit `77a7d9af3253928ec18ece2e302f3e640b0a8f0b`. This update points the main project to the latest version of the ECommons subproject, incorporating any recent changes or improvements. --- ECommons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ECommons b/ECommons index a1df6434..77a7d9af 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit a1df6434ddac33eab306b3f4f605f59f0d0a7279 +Subproject commit 77a7d9af3253928ec18ece2e302f3e640b0a8f0b