Skip to content

Commit

Permalink
AST Earthly Star addition
Browse files Browse the repository at this point in the history
  • Loading branch information
Akechi-kun committed Dec 25, 2024
1 parent 351750d commit 18e21cb
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 5 deletions.
85 changes: 81 additions & 4 deletions BossMod/Autorotation/Utility/ClassASTUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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<StarOption>("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<HoroscopeOption>("Horoscope", "Horo", 130) //Conditional AoE heal, 60s CD, 30s effect duration
Expand Down Expand Up @@ -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<StarOption>() 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);
Expand All @@ -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);
Expand All @@ -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<MacrocosmosOption>() switch
Expand All @@ -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<P>(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<P>(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

}
2 changes: 1 addition & 1 deletion BossMod/Autorotation/Utility/ClassSCHUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>() != DeployOption.None)
Expand Down

0 comments on commit 18e21cb

Please sign in to comment.