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

DT Dancer #381

Merged
merged 5 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BossMod/AI/AIBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public void Execute(Actor player, Actor master)
if (!forbidActions)
{
autorot.Preset = target.Target != null ? AIPreset : null;
autorot.Hints.ForceMovementIn = _maxCastTime;
}

UpdateMovement(player, master, target, !forbidActions ? autorot.Hints.ActionsToExecute : null);
Expand Down
19 changes: 19 additions & 0 deletions BossMod/ActionQueue/Ranged/DNC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public enum AID : uint
Tillana = 25790, // L82, instant, GCD, range 0, AOE 15 circle, targets=self
FanDanceIV = 25791, // L86, instant, 1.0s CD (group 4), range 15, AOE 15+R ?-degree cone, targets=hostile
StarfallDance = 25792, // L90, instant, GCD, range 25, AOE 25+R width 4 rect, targets=hostile
LastDance = 36983,
FinishingMove = 36984,
DanceOfTheDawn = 36985,

// Shared
BigShot = ClassShared.AID.BigShot, // LB1, 2.0s cast, range 30, AOE 30+R width 4 rect, targets=hostile, castAnimLock=3.100
Expand All @@ -74,6 +77,12 @@ public enum TraitID : uint
EnhancedFlourish = 455, // L86
EnhancedShieldSamba = 456, // L88
EnhancedDevilment = 457, // L90
EnhancedStandardFinish = 609, // L92
EnhancedSecondWind = 642, // L94
DynamicDancer = 662, // L94
EnhancedFlourishII = 610, // L96
EnhancedShieldSambaII = 611, // L98
EnhancedTechnicalFinishII = 612, // L100
}

// TODO: regenerate
Expand Down Expand Up @@ -104,10 +113,14 @@ public enum SID : uint
Peloton = 1199, // applied by Peloton to self
DancePartner = 1824, // applied by Closed Position to target
ClosedPosition = 1823, // applied by Closed Position to self
LastDanceReady = 3867,
FinishingMoveReady = 3868,
DanceOfTheDawnReady = 3869,
}

public sealed class Definitions : IDisposable
{
private readonly DNCConfig _config = Service.Config.Get<DNCConfig>();
public Definitions(ActionDefinitions d)
{
d.RegisterSpell(AID.CrimsonLotus, true, castAnimLock: 3.70f); // animLock=???, castAnimLock=3.700
Expand Down Expand Up @@ -153,6 +166,9 @@ public Definitions(ActionDefinitions d)
d.RegisterSpell(AID.Tillana, true);
d.RegisterSpell(AID.FanDanceIV, true);
d.RegisterSpell(AID.StarfallDance, true);
d.RegisterSpell(AID.LastDance, true);
d.RegisterSpell(AID.FinishingMove, true);
d.RegisterSpell(AID.DanceOfTheDawn, true);

Customize(d);
}
Expand All @@ -161,6 +177,9 @@ public void Dispose() { }

private void Customize(ActionDefinitions d)
{
d.Spell(AID.EnAvant)!.TransformAngle = (_, _, _, _) => _config.AlignDashToCamera
? Camera.Instance!.CameraAzimuth.Radians() + 180.Degrees()
: null;
// upgrades/button replacement (TODO: don't think we actually care...)
//d.Spell(AID.StandardStep)!.TransformAction = () => ActionID.MakeSpell(_state.BestStandardStep);
//d.Spell(AID.TechnicalStep)!.TransformAction = () => ActionID.MakeSpell(_state.BestTechStep);
Expand Down
8 changes: 8 additions & 0 deletions BossMod/ActionTweaks/ClassActions/DNCConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace BossMod;

[ConfigDisplay(Parent = typeof(ActionTweaksConfig))]
class DNCConfig : ConfigNode
{
[PropertyDisplay("Align En Avant with camera direction")]
public bool AlignDashToCamera = false;
}
6 changes: 3 additions & 3 deletions BossMod/Autorotation/Legacy/LegacyModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ protected void PushResult(ActionID action, Actor? target)
}
protected void PushResult<AID>(AID aid, Actor? target) where AID : Enum => PushResult(ActionID.MakeSpell(aid), target);

protected (Actor? Target, int Priority) FindBetterTargetBy(Actor? initial, float maxDistanceFromPlayer, Func<Actor, int> prioFunc)
protected (Actor? Target, P Priority) FindBetterTargetBy<P>(Actor? initial, float maxDistanceFromPlayer, Func<Actor, P> prioFunc) where P : struct, IComparable
{
var bestTarget = initial;
var bestPrio = initial != null ? prioFunc(initial) : -1;
var bestPrio = initial != null ? prioFunc(initial) : default;
foreach (var enemy in Hints.PriorityTargets.Where(x => x.Actor != initial && x.Actor.Position.InCircle(Player.Position, maxDistanceFromPlayer + x.Actor.HitboxRadius)))
{
var newPrio = prioFunc(enemy.Actor);
if (newPrio > bestPrio)
if (newPrio.CompareTo(bestPrio) > 0)
{
bestPrio = newPrio;
bestTarget = enemy.Actor;
Expand Down
Loading
Loading