Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AkechiDRG final cleanup + two target improvements .. module is fully complete for the most part #596

Closed
wants to merge 9 commits into from
12 changes: 6 additions & 6 deletions BossMod/Autorotation/Standard/akechi/AkechiTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,9 @@ P targetPrio(Actor potentialTarget)
/// <param name="initial">The <b>initial</b> target to consider for applying the <b>DoT</b> effect.</param>
/// <param name="getTimer">A function that retrieves the <b>timer</b> value associated with a given <b>actor</b>.</param>
/// <param name="maxAllowedTargets">The maximum number of valid targets to evaluate.</param>
protected (Enemy? Best, P Timer) GetDOTTarget<P>(Enemy? initial, Func<Actor?, P> getTimer, int maxAllowedTargets) where P : struct, IComparable
protected (Enemy? Best, P Timer) GetDOTTarget<P>(Enemy? initial, Func<Actor?, P> getTimer, int maxAllowedTargets, float range = 30) where P : struct, IComparable
{
if (initial == null || maxAllowedTargets <= 0)
if (initial == null || maxAllowedTargets <= 0 || Player.DistanceToHitbox(initial.Actor) > range)
{
return (null, getTimer(null));
}
Expand All @@ -624,7 +624,7 @@ P targetPrio(Actor potentialTarget)

foreach (var dotTarget in Hints.PriorityTargets)
{
if (dotTarget.ForbidDOTs)
if (dotTarget.ForbidDOTs || Player.DistanceToHitbox(dotTarget.Actor) > range)
continue;

if (++numTargets > maxAllowedTargets)
Expand Down Expand Up @@ -770,12 +770,12 @@ public sealed override void Execute(StrategyValues strategy, ref Actor? primaryT
DowntimeIn = Manager.Planner?.EstimateTimeToNextDowntime().Item2 ?? float.MaxValue;
CombatTimer = (float)(World.CurrentTime - Manager.CombatStart).TotalSeconds;
CountdownRemaining = World.Client.CountdownRemaining;
CanTrueNorth = ActionUnlocked(ActionID.MakeSpell(ClassShared.AID.TrueNorth)) && World.Client.Cooldowns[ActionDefinitions.Instance.Spell(ClassShared.AID.TrueNorth)!.MainCooldownGroup].Remaining < 45.6f;
HasTrueNorth = StatusRemaining(Player, ClassShared.SID.TrueNorth, 15) > 0.1f;
CanSwiftcast = ActionUnlocked(ActionID.MakeSpell(ClassShared.AID.Swiftcast)) && World.Client.Cooldowns[ActionDefinitions.Instance.Spell(ClassShared.AID.Swiftcast)!.MainCooldownGroup].Remaining < 0.6f;
CanTrueNorth = !HasTrueNorth && ActionUnlocked(ActionID.MakeSpell(ClassShared.AID.TrueNorth)) && World.Client.Cooldowns[ActionDefinitions.Instance.Spell(ClassShared.AID.TrueNorth)!.MainCooldownGroup].Remaining < 45.6f;
HasSwiftcast = StatusRemaining(Player, ClassShared.SID.Swiftcast, 10) > 0.1f;
CanPeloton = !Player.InCombat && ActionUnlocked(ActionID.MakeSpell(ClassShared.AID.Peloton)) && World.Client.Cooldowns[ActionDefinitions.Instance.Spell(ClassShared.AID.Peloton)!.MainCooldownGroup].Remaining < 0.6f;
CanSwiftcast = ActionUnlocked(ActionID.MakeSpell(ClassShared.AID.Swiftcast)) && World.Client.Cooldowns[ActionDefinitions.Instance.Spell(ClassShared.AID.Swiftcast)!.MainCooldownGroup].Remaining < 0.6f;
HasPeloton = PlayerHasAnyEffect(ClassShared.SID.Peloton);
CanPeloton = !Player.InCombat && !HasPeloton && ActionUnlocked(ActionID.MakeSpell(ClassShared.AID.Peloton)) && World.Client.Cooldowns[ActionDefinitions.Instance.Spell(ClassShared.AID.Peloton)!.MainCooldownGroup].Remaining < 0.6f;

if (Player.MountId is not (103 or 117 or 128))
Execution(strategy, PlayerTarget);
Expand Down
Loading