Skip to content

Commit

Permalink
we're gaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Akechi-kun committed Feb 5, 2025
1 parent baf0901 commit 2c316fb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
7 changes: 2 additions & 5 deletions BossMod/Autorotation/Utility/ClassASTUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static RotationModuleDefinition Definition()

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.Party | ActionTargets.Self | ActionTargets.Hostile, 62) // TODO: should use ActionTargets.Area, but the Point options do not work outside of AI yet
.AddOption(StarOption.Use, "Earthly Star", "Use Earthly Star", 60, 10, ActionTargets.Area, 62) // TODO: should use ActionTargets.Area, but the Point options do not work outside of AI yet
.AddOption(StarOption.End, "Stellar Detonation", "Use Stellar Detonation", 0, 1, ActionTargets.Self, 62)
.AddAssociatedActions(AST.AID.EarthlyStar, AST.AID.StellarDetonation);

Expand Down Expand Up @@ -75,18 +75,15 @@ public override void Execute(StrategyValues strategy, ref Actor? primaryTarget,
ExecuteSimple(strategy.Option(Track.Exaltation), AST.AID.Exaltation, Player);
ExecuteSimple(strategy.Option(Track.SunSign), AST.AID.SunSign, Player);

//TODO: These should work with all Area targeting options? Able to target Waymarks, Center, AbsolutePoint, etc.
//Figure out how to make compatible with WPos
var star = strategy.Option(Track.EarthlyStar);
var starTarget = ResolveTargetOverride(star.Value) ?? primaryTarget ?? Player;
var starAction = star.As<StarOption>() switch
{
StarOption.Use => AST.AID.EarthlyStar,
StarOption.End => AST.AID.StellarDetonation,
_ => default
};
if (starAction != default)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(starAction), starTarget, star.Priority(), star.Value.ExpireIn, targetPos: starTarget.PosRot.XYZ());
Hints.ActionsToExecute.Push(ActionID.MakeSpell(starAction), null, star.Priority(), star.Value.ExpireIn, targetPos: ResolveTargetLocation(star.Value).ToVec3());

//Aspected Helios full execution
var heliosUp = StatusDetails(Player, AST.SID.AspectedHelios, Player.InstanceID).Left > 0.1f || StatusDetails(Player, AST.SID.HeliosConjunction, Player.InstanceID).Left > 0.1f;
Expand Down
13 changes: 5 additions & 8 deletions BossMod/Autorotation/Utility/ClassNINUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public static RotationModuleDefinition Definition()

res.Define(Track.Shukuchi).As<DashStrategy>("Shukuchi", "Dash", 20)
.AddOption(DashStrategy.None, "Automatic", "No use.")
.AddOption(DashStrategy.GapClose, "GapClose", "Use as gapcloser if outside melee range", 60, 0, ActionTargets.Party | ActionTargets.Hostile, 45) // TODO: should use ActionTargets.Area, but the Point options do not work outside of AI yet
.AddOption(DashStrategy.GapCloseHold1, "GapCloseHold1", "Use as gapcloser if outside melee range; conserves 1 charge for manual usage", 60, 0, ActionTargets.Party | ActionTargets.Hostile, 74)
.AddOption(DashStrategy.GapClose, "GapClose", "Use as gapcloser if outside melee range", 60, 0, ActionTargets.Area, 45)
.AddOption(DashStrategy.GapCloseHold1, "GapCloseHold1", "Use as gapcloser if outside melee range; conserves 1 charge for manual usage", 60, 0, ActionTargets.Area, 74)
.AddAssociatedActions(NIN.AID.Shukuchi);

return res;
Expand All @@ -29,12 +29,9 @@ public override void Execute(StrategyValues strategy, ref Actor? primaryTarget,
ExecuteSimple(strategy.Option(Track.ShadeShift), NIN.AID.ShadeShift, Player);

// TODO: revise, this doesn't look correct (shukuchi is area targeted, so it should use that; probably should expose options to use regardless of melee distance...)
//These should work with all Area targeting options? Able to target Waymarks, Center, AbsolutePoint, etc.
//Figure out how to make compatible with WPos
var dash = strategy.Option(Track.Shukuchi);
var dashStrategy = strategy.Option(Track.Shukuchi).As<DashStrategy>();
var dashTarget = ResolveTargetOverride(dash.Value) ?? primaryTarget; //Smart-Targeting
var distance = Player.DistanceToHitbox(dashTarget);
var distance = Player.DistanceToPoint(ResolveTargetLocation(dash.Value));
var cd = World.Client.Cooldowns[ActionDefinitions.Instance.Spell(NIN.AID.Shukuchi)!.MainCooldownGroup].Remaining;
var shouldDash = dashStrategy switch
{
Expand All @@ -43,7 +40,7 @@ public override void Execute(StrategyValues strategy, ref Actor? primaryTarget,
DashStrategy.GapCloseHold1 => distance is > 3f and <= 20f && cd < 0.6f,
_ => false,
};
if (shouldDash && dashTarget != null)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(NIN.AID.Shukuchi), null, dash.Priority(), dash.Value.ExpireIn, targetPos: dashTarget.PosRot.XYZ());
if (shouldDash)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(NIN.AID.Shukuchi), null, dash.Priority(), dash.Value.ExpireIn, targetPos: ResolveTargetLocation(dash.Value).ToVec3());
}
}
5 changes: 2 additions & 3 deletions BossMod/Autorotation/Utility/ClassSCHUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static RotationModuleDefinition Definition()

res.Define(Track.SacredSoil).As<SacredSoilOption>("Sacred Soil", "S.Soil", 200)
.AddOption(SacredSoilOption.None, "None", "Do not use automatically")
.AddOption(SacredSoilOption.Use, "Use", "Use Sacred Soil", 30, 15, ActionTargets.Party | ActionTargets.Self | ActionTargets.Hostile, 50, 77) // TODO: should use ActionTargets.Area, but the Point options do not work outside of AI yet
.AddOption(SacredSoilOption.Use, "Use", "Use Sacred Soil", 30, 15, ActionTargets.Area, 50, 77)
.AddOption(SacredSoilOption.UseEx, "UseEx", "Use Enhanced Sacred Soil", 30, 15, ActionTargets.Area, 78)
.AddAssociatedActions(SCH.AID.SacredSoil);

Expand Down Expand Up @@ -98,14 +98,13 @@ public override void Execute(StrategyValues strategy, ref Actor? primaryTarget,
Hints.ActionsToExecute.Push(ActionID.MakeSpell(succAction), Player, succ.Priority(), succ.Value.ExpireIn, castTime: 2); // TODO[cast-time]: adjustment (swiftcast etc)

var soil = strategy.Option(Track.SacredSoil);
var soilTarget = ResolveTargetOverride(soil.Value) ?? primaryTarget ?? Player;
var soilAction = soil.As<SacredSoilOption>() switch
{
SacredSoilOption.Use or SacredSoilOption.UseEx => SCH.AID.SacredSoil,
_ => default
};
if (soilAction != default)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(soilAction), soilTarget, soil.Priority(), soil.Value.ExpireIn, targetPos: soilTarget.PosRot.XYZ());
Hints.ActionsToExecute.Push(ActionID.MakeSpell(soilAction), null, soil.Priority(), soil.Value.ExpireIn, targetPos: ResolveTargetLocation(soil.Value).ToVec3());

var deploy = strategy.Option(Track.DeploymentTactics);
if (deploy.As<DeployOption>() != DeployOption.None)
Expand Down
1 change: 1 addition & 0 deletions BossMod/Data/Actor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public sealed class Actor(ulong instanceID, uint oid, int spawnIndex, string nam
public Angle AngleTo(Actor other) => Angle.FromDirection(other.Position - Position);

public float DistanceToHitbox(Actor? other) => other == null ? float.MaxValue : (other.Position - Position).Length() - other.HitboxRadius - HitboxRadius;
public float DistanceToPoint(WPos pos) => (pos - Position).Length();

public override string ToString() => $"{OID:X} '{Name}' <{InstanceID:X}>";
}

0 comments on commit 2c316fb

Please sign in to comment.