Skip to content

Commit

Permalink
Merge pull request #385 from xanunderscore/dtmachine
Browse files Browse the repository at this point in the history
machinist 100
  • Loading branch information
awgil authored Jul 16, 2024
2 parents 9b5832a + b9407a3 commit 72ced0d
Show file tree
Hide file tree
Showing 7 changed files with 435 additions and 79 deletions.
132 changes: 82 additions & 50 deletions BossMod/ActionQueue/Ranged/MCH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,51 @@ public enum AID : uint
None = 0,
Sprint = ClassShared.AID.Sprint,

SatelliteBeam = 4245, // LB3, 4.5s cast, range 30, AOE 30+R width 8 rect, targets=hostile, animLock=???, castAnimLock=3.700
SplitShot = 2866, // L1, instant, GCD, range 25, single-target, targets=hostile, animLock=???
SlugShot = 2868, // L2, instant, GCD, range 25, single-target, targets=hostile, animLock=???
HotShot = 2872, // L4, instant, 40.0s CD (group 7/57), range 25, single-target, targets=hostile
Reassemble = 2876, // L10, instant, 55.0s CD (group 21/72), range 0, single-target, targets=self
GaussRound = 2874, // L15, instant, 30.0s CD (group 9/70) (2? charges), range 25, single-target, targets=hostile
SpreadShot = 2870, // L18, instant, GCD, range 12, AOE 12+R ?-degree cone, targets=hostile, animLock=???
CleanShot = 2873, // L26, instant, GCD, range 25, single-target, targets=hostile, animLock=???
Hypercharge = 17209, // L30, instant, 10.0s CD (group 4), range 0, single-target, targets=self
HeatBlast = 7410, // L35, instant, GCD, range 25, single-target, targets=hostile
RookAutoturret = 2864, // L40, instant, 6.0s CD (group 3), range 0, single-target, targets=self
RookOverdrive = 7415, // L40, instant, 15.0s CD (group 3), range 25, single-target, targets=self, animLock=???
Detonator = 16766, // L45, instant, 1.0s CD (group 0), range 25, single-target, targets=self
Wildfire = 2878, // L45, instant, 120.0s CD (group 19), range 25, single-target, targets=hostile
Ricochet = 2890, // L50, instant, 30.0s CD (group 10/71) (2? charges), range 25, AOE 5 circle, targets=hostile
AutoCrossbow = 16497, // L52, instant, GCD, range 12, AOE 12+R ?-degree cone, targets=hostile
HeatedSplitShot = 7411, // L54, instant, GCD, range 25, single-target, targets=hostile
Tactician = 16889, // L56, instant, 120.0s CD (group 23), range 0, AOE 30 circle, targets=self
Drill = 16498, // L58, instant, 20.0s CD (group 6/57), range 25, single-target, targets=hostile
HeatedSlugShot = 7412, // L60, instant, GCD, range 25, single-target, targets=hostile
Dismantle = 2887, // L62, instant, 120.0s CD (group 18), range 25, single-target, targets=hostile
HeatedCleanShot = 7413, // L64, instant, GCD, range 25, single-target, targets=hostile
BarrelStabilizer = 7414, // L66, instant, 120.0s CD (group 20), range 0, single-target, targets=self
Flamethrower = 7418, // L70, instant, 60.0s CD (group 12/57), range 0, single-target, targets=self
Bioblaster = 16499, // L72, instant, 20.0s CD (group 6/57), range 12, AOE 12+R ?-degree cone, targets=hostile
AirAnchor = 16500, // L76, instant, 40.0s CD (group 8/57), range 25, single-target, targets=hostile
QueenOverdrive = 16502, // L80, instant, 15.0s CD (group 1), range 30, single-target, targets=self
AutomatonQueen = 16501, // L80, instant, 6.0s CD (group 1), range 0, single-target, targets=self
Scattergun = 25786, // L82, instant, GCD, range 12, AOE 12+R ?-degree cone, targets=hostile
ChainSaw = 25788, // L90, instant, 60.0s CD (group 11/57), range 25, AOE 25+R width 4 rect, targets=hostile
SatelliteBeam = 4245, // LB3, 4.5s cast, range 30, AOE 30+R width 8 rect, targets=Hostile, animLock=3.700s?
SplitShot = 2866, // L1, instant, GCD, range 25, single-target, targets=Hostile
SlugShot = 2868, // L2, instant, GCD, range 25, single-target, targets=Hostile
HotShot = 2872, // L4, instant, 40.0s CD (group 7/57), range 25, single-target, targets=Hostile
Reassemble = 2876, // L10, instant, 55.0s CD (group 17/72), range 0, single-target, targets=Self
GaussRound = 2874, // L15, instant, 30.0s CD (group 14/70) (2 charges), range 25, single-target, targets=Hostile
SpreadShot = 2870, // L18, instant, GCD, range 12, AOE 12+R ?-degree cone, targets=Hostile
CleanShot = 2873, // L26, instant, GCD, range 25, single-target, targets=Hostile
Hypercharge = 17209, // L30, instant, 10.0s CD (group 1), range 0, single-target, targets=Self
HeatBlast = 7410, // L35, instant, GCD, range 25, single-target, targets=Hostile
RookAutoturret = 2864, // L40, instant, 6.0s CD (group 2), range 0, single-target, targets=Self
RookOverdrive = 7415, // L40, instant, 15.0s CD (group 3), range 25, single-target, targets=Self
Detonator = 16766, // L45, instant, 1.0s CD (group 0), range 25, single-target, targets=Self
Wildfire = 2878, // L45, instant, 120.0s CD (group 19), range 25, single-target, targets=Hostile
Ricochet = 2890, // L50, instant, 30.0s CD (group 15/71) (2 charges), range 25, AOE 5 circle, targets=Hostile
AutoCrossbow = 16497, // L52, instant, GCD, range 12, AOE 12+R ?-degree cone, targets=Hostile
HeatedSplitShot = 7411, // L54, instant, GCD, range 25, single-target, targets=Hostile
Tactician = 16889, // L56, instant, 120.0s CD (group 21), range 0, AOE 30 circle, targets=Self
Drill = 16498, // L58, instant, 20.0s CD (group 4/57), range 25, single-target, targets=Hostile
HeatedSlugShot = 7412, // L60, instant, GCD, range 25, single-target, targets=Hostile
Dismantle = 2887, // L62, instant, 120.0s CD (group 18), range 25, single-target, targets=Hostile
HeatedCleanShot = 7413, // L64, instant, GCD, range 25, single-target, targets=Hostile
BarrelStabilizer = 7414, // L66, instant, 120.0s CD (group 20), range 0, single-target, targets=Self
BlazingShot = 36978, // L68, instant, GCD, range 25, single-target, targets=Hostile
Flamethrower = 7418, // L70, instant, 60.0s CD (group 12/57), range 0, single-target, targets=Self
Bioblaster = 16499, // L72, instant, 20.0s CD (group 4/57), range 12, AOE 12+R ?-degree cone, targets=Hostile
AirAnchor = 16500, // L76, instant, 40.0s CD (group 8/57), range 25, single-target, targets=Hostile
AutomatonQueen = 16501, // L80, instant, 6.0s CD (group 2), range 0, single-target, targets=Self
QueenOverdrive = 16502, // L80, instant, 15.0s CD (group 3), range 30, single-target, targets=Self
Scattergun = 25786, // L82, instant, GCD, range 12, AOE 12+R ?-degree cone, targets=Hostile
ChainSaw = 25788, // L90, instant, 60.0s CD (group 11/57), range 25, AOE 25+R width 4 rect, targets=Hostile
DoubleCheck = 36979, // L92, instant, 30.0s CD (group 14/70) (3? charges), range 25, AOE 5 circle, targets=Hostile, animLock=???
Checkmate = 36980, // L92, instant, 30.0s CD (group 15/71) (3? charges), range 25, AOE 5 circle, targets=Hostile, animLock=???
Excavator = 36981, // L96, instant, GCD, range 25, AOE 5 circle, targets=Hostile, animLock=???
FullMetalField = 36982, // L100, instant, GCD, range 25, AOE 5 circle, targets=Hostile, animLock=???

// Shared
BigShot = ClassShared.AID.BigShot, // LB1, 2.0s cast, range 30, AOE 30+R width 4 rect, targets=hostile, castAnimLock=3.100
Desperado = ClassShared.AID.Desperado, // LB2, 3.0s cast, range 30, AOE 30+R width 5 rect, targets=hostile, castAnimLock=3.100
LegGraze = ClassShared.AID.LegGraze, // L6, instant, 30.0s CD (group 42), range 25, single-target, targets=hostile
SecondWind = ClassShared.AID.SecondWind, // L8, instant, 120.0s CD (group 49), range 0, single-target, targets=self
FootGraze = ClassShared.AID.FootGraze, // L10, instant, 30.0s CD (group 41), range 25, single-target, targets=hostile
Peloton = ClassShared.AID.Peloton, // L20, instant, 5.0s CD (group 40), range 0, AOE 30 circle, targets=self
HeadGraze = ClassShared.AID.HeadGraze, // L24, instant, 30.0s CD (group 43), range 25, single-target, targets=hostile
ArmsLength = ClassShared.AID.ArmsLength, // L32, instant, 120.0s CD (group 48), range 0, single-target, targets=self
BigShot = ClassShared.AID.BigShot, // LB1, 2.0s cast, range 30, AOE 30+R width 4 rect, targets=Hostile, animLock=3.100s?
Desperado = ClassShared.AID.Desperado, // LB2, 3.0s cast, range 30, AOE 30+R width 5 rect, targets=Hostile, animLock=3.100s?
LegGraze = ClassShared.AID.LegGraze, // L6, instant, 30.0s CD (group 42), range 25, single-target, targets=Hostile
SecondWind = ClassShared.AID.SecondWind, // L8, instant, 120.0s CD (group 49), range 0, single-target, targets=Self
FootGraze = ClassShared.AID.FootGraze, // L10, instant, 30.0s CD (group 41), range 25, single-target, targets=Hostile
Peloton = ClassShared.AID.Peloton, // L20, instant, 5.0s CD (group 40), range 0, AOE 30 circle, targets=Self
HeadGraze = ClassShared.AID.HeadGraze, // L24, instant, 30.0s CD (group 43), range 25, single-target, targets=Hostile
ArmsLength = ClassShared.AID.ArmsLength, // L32, instant, 120.0s CD (group 48), range 0, single-target, targets=Self
}

public enum TraitID : uint
Expand All @@ -55,51 +60,78 @@ public enum TraitID : uint
SplitShotMastery = 288, // L54
SlugShotMastery = 289, // L60
CleanShotMastery = 290, // L64
HeatBlastMastery = 603, // L68
ChargedActionMastery = 292, // L74
HotShotMastery = 291, // L76
EnhancedWildfire = 293, // L78
Promotion = 294, // L80
SpreadShotMastery = 449, // L82
EnhancedReassemble = 450, // L84
MarksmansMastery = 517, // L84
EnhancedReassemble = 450, // L84
QueensGambit = 451, // L86
EnhancedTactician = 452, // L88
DoubleBarrelMastery = 604, // L92
EnhancedSecondWind = 642, // L94
EnhancedMultiweapon = 605, // L94
MarksmansMasteryII = 658, // L94
EnhancedMultiweaponII = 606, // L96
EnhancedTacticianII = 607, // L98
EnhancedBarrelStabilizer = 608, // L100
}

public enum SID : uint
{
None = 0,
Reassembled = 851, // applied by Reassemble to self
Overheated = 2688, // applied by Hypercharge to self
WildfirePlayer = 1946, // applied by Wildfire to self
WildfireTarget = 861, // applied by Wildfire to target
Dismantled = 860, // applied by Dismantle to target
Hypercharged = 3864, // applied by Barrel Stabilizer to self
Flamethrower = 1205, // applied by Flamethrower to self
ExcavatorReady = 3865, // applied by Chain Saw to self
FullMetalMachinist = 3866, // applied by Hypercharge to self
}

public sealed class Definitions : IDisposable
{
public Definitions(ActionDefinitions d)
{
d.RegisterSpell(AID.SatelliteBeam, true, castAnimLock: 3.70f); // animLock=???, castAnimLock=3.700
d.RegisterSpell(AID.SplitShot, true); // animLock=???
d.RegisterSpell(AID.SlugShot, true); // animLock=???
d.RegisterSpell(AID.SatelliteBeam, true, castAnimLock: 3.70f); // animLock=3.700s?
d.RegisterSpell(AID.SplitShot, true);
d.RegisterSpell(AID.SlugShot, true);
d.RegisterSpell(AID.HotShot, true);
d.RegisterSpell(AID.Reassemble, true);
d.RegisterSpell(AID.GaussRound, true, maxCharges: 2);
d.RegisterSpell(AID.SpreadShot, true); // animLock=???
d.RegisterSpell(AID.CleanShot, true); // animLock=???
d.RegisterSpell(AID.GaussRound, true, maxCharges: 3);
d.RegisterSpell(AID.SpreadShot, true);
d.RegisterSpell(AID.CleanShot, true);
d.RegisterSpell(AID.Hypercharge, true);
d.RegisterSpell(AID.HeatBlast, true);
d.RegisterSpell(AID.RookAutoturret, true);
d.RegisterSpell(AID.RookOverdrive, true); // animLock=???
d.RegisterSpell(AID.RookOverdrive, true);
d.RegisterSpell(AID.Detonator, true);
d.RegisterSpell(AID.Wildfire, true);
d.RegisterSpell(AID.Ricochet, true, maxCharges: 2);
d.RegisterSpell(AID.Ricochet, true, maxCharges: 3);
d.RegisterSpell(AID.AutoCrossbow, true);
d.RegisterSpell(AID.HeatedSplitShot, true);
d.RegisterSpell(AID.Tactician, true);
d.RegisterSpell(AID.Drill, true);
d.RegisterSpell(AID.Drill, true, maxCharges: 2);
d.RegisterSpell(AID.HeatedSlugShot, true);
d.RegisterSpell(AID.Dismantle, true);
d.RegisterSpell(AID.HeatedCleanShot, true);
d.RegisterSpell(AID.BarrelStabilizer, true);
d.RegisterSpell(AID.BlazingShot, true);
d.RegisterSpell(AID.Flamethrower, true);
d.RegisterSpell(AID.Bioblaster, true);
d.RegisterSpell(AID.Bioblaster, true, maxCharges: 2);
d.RegisterSpell(AID.AirAnchor, true);
d.RegisterSpell(AID.QueenOverdrive, true);
d.RegisterSpell(AID.AutomatonQueen, true);
d.RegisterSpell(AID.QueenOverdrive, true);
d.RegisterSpell(AID.Scattergun, true);
d.RegisterSpell(AID.ChainSaw, true);
d.RegisterSpell(AID.DoubleCheck, true, maxCharges: 3); // animLock=???
d.RegisterSpell(AID.Checkmate, true, maxCharges: 3); // animLock=???
d.RegisterSpell(AID.Excavator, true); // animLock=???
d.RegisterSpell(AID.FullMetalField, true); // animLock=???

Customize(d);
}
Expand Down
8 changes: 8 additions & 0 deletions BossMod/ActionTweaks/ClassActions/MCHConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace BossMod;

[ConfigDisplay(Parent = typeof(ActionTweaksConfig))]
class MCHConfig : ConfigNode
{
[PropertyDisplay("Pause autorotation while channeling Flamethrower")]
public bool PauseForFlamethrower = false;
}
6 changes: 4 additions & 2 deletions BossMod/Autorotation/RotationModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ public bool ActionUnlocked(ActionID action)

public bool TraitUnlocked(uint id)
{
var unlock = Service.LuminaRow<Lumina.Excel.GeneratedSheets.Trait>(id)?.Quest.Row ?? 0;
return ActionDefinitions.Instance.UnlockCheck?.Invoke(unlock) ?? true;
var trait = Service.LuminaRow<Lumina.Excel.GeneratedSheets.Trait>(id);
var unlock = trait?.Quest.Row ?? 0;
var level = trait?.Level ?? 0;
return Player.Level >= level && (ActionDefinitions.Instance.UnlockCheck?.Invoke(unlock) ?? true);
}

// utility to resolve the target overrides; returns null on failure - in this case module is expected to run smart-targeting logic
Expand Down
6 changes: 3 additions & 3 deletions BossMod/Autorotation/xan/DNC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private bool ShouldSpendFeathers(StrategyValues strategy)

public override void Exec(StrategyValues strategy, Actor? primaryTarget)
{
var targeting = strategy.Option(Track.Targeting);
var targeting = strategy.Option(Track.Targeting).As<Targeting>();
SelectPrimaryTarget(targeting, ref primaryTarget, range: 25);
_state.UpdateCommon(primaryTarget);

Expand Down Expand Up @@ -324,10 +324,10 @@ public override void Exec(StrategyValues strategy, Actor? primaryTarget)
PushGCD(AID.ClosedPosition, partner);

CalcNextBestGCD(strategy, primaryTarget);
QueueOGCD((deadline, _) => CalcNextBestOGCD(strategy, primaryTarget, deadline));
QueueOGCD(deadline => CalcNextBestOGCD(strategy, primaryTarget, deadline));
}

private bool IsFan4Target(Actor primary, Actor other) => Hints.TargetInAOECone(other, Player.Position, 15, (primary.Position - Player.Position).Normalized(), 60.Degrees());
private bool IsFan4Target(Actor primary, Actor other) => Hints.TargetInAOECone(other, Player.Position, 15, Player.DirectionTo(primary), 60.Degrees());

private Actor? FindDancePartner() => World.Party.WithoutSlot().Exclude(Player).MaxBy(p => p.Class switch
{
Expand Down
Loading

0 comments on commit 72ced0d

Please sign in to comment.