From 18e21cb9ce5b30f4785612e86e548efdb8cdaf8f Mon Sep 17 00:00:00 2001 From: Akechi-kun <167795370+Akechi-kun@users.noreply.github.com> Date: Tue, 24 Dec 2024 18:17:04 -0800 Subject: [PATCH] AST Earthly Star addition --- .../Autorotation/Utility/ClassASTUtility.cs | 85 ++++++++++++++++++- .../Autorotation/Utility/ClassSCHUtility.cs | 2 +- 2 files changed, 82 insertions(+), 5 deletions(-) diff --git a/BossMod/Autorotation/Utility/ClassASTUtility.cs b/BossMod/Autorotation/Utility/ClassASTUtility.cs index 9a1ba0f5c..f5015f18b 100644 --- a/BossMod/Autorotation/Utility/ClassASTUtility.cs +++ b/BossMod/Autorotation/Utility/ClassASTUtility.cs @@ -2,7 +2,8 @@ public sealed class ClassASTUtility(RotationModuleManager manager, Actor player) : RoleHealerUtility(manager, player) { - public enum Track { Helios = SharedTrack.Count, Lightspeed, BeneficII, EssentialDignity, AspectedBenefic, AspectedHelios, Synastry, CollectiveUnconscious, CelestialOpposition, CelestialIntersection, Horoscope, NeutralSect, Exaltation, Macrocosmos, SunSign } + public enum Track { Helios = SharedTrack.Count, Lightspeed, BeneficII, EssentialDignity, AspectedBenefic, AspectedHelios, Synastry, CollectiveUnconscious, CelestialOpposition, EarthlyStar, CelestialIntersection, Horoscope, NeutralSect, Exaltation, Macrocosmos, SunSign } + public enum StarOption { None, Use, End } public enum HoroscopeOption { None, Use, End } public enum MacrocosmosOption { None, Use, End } public enum HeliosOption { None, Use, UseEx } @@ -32,6 +33,13 @@ public static RotationModuleDefinition Definition() DefineSimpleConfig(res, Track.Synastry, "Synastry", "", 200, AST.AID.Synastry, 20); //ST oGCD "kardia"-like heal, 120s CD, 20s effect duration DefineSimpleConfig(res, Track.CollectiveUnconscious, "CollectiveUnconscious", "C.Uncon", 100, AST.AID.CollectiveUnconscious, 5); //AoE oGCD mit/regen, 60s CD, 5s mitigation / 15s regen effect durations DefineSimpleConfig(res, Track.CelestialOpposition, "CelestialOpposition", "C.Oppo", 100, AST.AID.CelestialOpposition, 15); //AoE oGCD heal/regen, 60s CD, 15s effect duration + + res.Define(Track.EarthlyStar).As("EarthlyStar", "E.Star", 200) //AoE GCD heal, 60s CD, 10s + 10s effect duration + .AddOption(StarOption.None, "None", "Do not use automatically") + .AddOption(StarOption.Use, "Earthly Star", "Use Earthly Star", 60, 10, ActionTargets.Hostile, 62) + .AddOption(StarOption.End, "Stellar Detonation", "Use Stellar Detonation", 0, 1, ActionTargets.Hostile, 62) + .AddAssociatedActions(AST.AID.EarthlyStar, AST.AID.StellarDetonation); + DefineSimpleConfig(res, Track.CelestialIntersection, "CelestialIntersection", "C.Inter", 100, AST.AID.CelestialIntersection, 30); //ST oGCD heal/shield, 30s CD (60s Total), 2 charges res.Define(Track.Horoscope).As("Horoscope", "Horo", 130) //Conditional AoE heal, 60s CD, 30s effect duration @@ -69,6 +77,16 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa ExecuteSimple(strategy.Option(Track.Exaltation), AST.AID.Exaltation, TargetChoice(strategy.Option(Track.Exaltation)) ?? Player); ExecuteSimple(strategy.Option(Track.SunSign), AST.AID.SunSign, Player); + var star = strategy.Option(Track.EarthlyStar); + var starAction = star.As() switch + { + StarOption.Use => AST.AID.EarthlyStar, + StarOption.End => AST.AID.StellarDetonation, + _ => default + }; + if (starAction != default) + QueueOGCD(starAction, TargetChoice(star) ?? primaryTarget ?? Player); + //Aspected Helios full execution var heliosUp = HasEffect(Player, AST.SID.AspectedHelios, 15) || HasEffect(Player, AST.SID.HeliosConjunction, 15); var helios = strategy.Option(Track.AspectedHelios); @@ -79,7 +97,7 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa _ => default }; if (heliosAction != default && !heliosUp) - Hints.ActionsToExecute.Push(ActionID.MakeSpell(heliosAction), Player, helios.Priority(), helios.Value.ExpireIn); + QueueGCD(heliosAction, Player); //Horoscope full execution var horo = strategy.Option(Track.Horoscope); @@ -90,7 +108,7 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa _ => default }; if (horoAction != default) - Hints.ActionsToExecute.Push(ActionID.MakeSpell(horoAction), Player, horo.Priority(), horo.Value.ExpireIn); + QueueOGCD(horoAction, Player); var cosmos = strategy.Option(Track.Macrocosmos); var cosmosAction = cosmos.As() switch @@ -100,7 +118,66 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa _ => default }; if (cosmosAction != default) - Hints.ActionsToExecute.Push(ActionID.MakeSpell(cosmosAction), Player, cosmos.Priority(), cosmos.Value.ExpireIn); + QueueOGCD(cosmosAction, primaryTarget); + } + + #region Core Execution Helpers + + public AST.AID NextGCD; //Next global cooldown action to be used + public void QueueGCD

(AST.AID aid, Actor? target, P priority, float delay = 0) where P : Enum + => QueueGCD(aid, target, (int)(object)priority, delay); + + public void QueueGCD(AST.AID aid, Actor? target, int priority = 8, float delay = 0) + { + var NextGCDPrio = 0; + + if (priority == 0) + return; + + if (QueueAction(aid, target, ActionQueue.Priority.High, delay) && priority > NextGCDPrio) + { + NextGCD = aid; + } + } + + public void QueueOGCD

(AST.AID aid, Actor? target, P priority, float delay = 0) where P : Enum + => QueueOGCD(aid, target, (int)(object)priority, delay); + + public void QueueOGCD(AST.AID aid, Actor? target, int priority = 4, float delay = 0) + { + if (priority == 0) + return; + + QueueAction(aid, target, ActionQueue.Priority.Medium + priority, delay); + } + + public bool QueueAction(AST.AID aid, Actor? target, float priority, float delay) + { + if ((uint)(object)aid == 0) + return false; + + var def = ActionDefinitions.Instance.Spell(aid); + if (def == null) + return false; + + if (def.Range != 0 && target == null) + { + return false; + } + Vector3 targetPos = default; + + if (def.AllowedTargets.HasFlag(ActionTargets.Area)) + { + if (def.Range == 0) + targetPos = Player.PosRot.XYZ(); + else if (target != null) + targetPos = target.PosRot.XYZ(); + } + + Hints.ActionsToExecute.Push(ActionID.MakeSpell(aid), target, priority, delay: delay, targetPos: targetPos); + return true; } + #endregion + } diff --git a/BossMod/Autorotation/Utility/ClassSCHUtility.cs b/BossMod/Autorotation/Utility/ClassSCHUtility.cs index ebf46a930..4439158c1 100644 --- a/BossMod/Autorotation/Utility/ClassSCHUtility.cs +++ b/BossMod/Autorotation/Utility/ClassSCHUtility.cs @@ -114,7 +114,7 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa _ => default }; if (soilAction != default) - QueueOGCD(soilAction, TargetChoice(soil) ?? primaryTarget); + QueueOGCD(soilAction, TargetChoice(soil) ?? primaryTarget ?? Player); var deploy = strategy.Option(Track.DeploymentTactics); if (deploy.As() != DeployOption.None)