Skip to content

Commit

Permalink
Merge pull request #578 from Akechi-kun/_-
Browse files Browse the repository at this point in the history
some Utility fixes
  • Loading branch information
awgil authored Feb 2, 2025
2 parents 8e6cb7a + 434efa0 commit c6a8eef
Show file tree
Hide file tree
Showing 31 changed files with 387 additions and 309 deletions.
5 changes: 3 additions & 2 deletions BossMod/ActionQueue/Casters/BLM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ public enum TraitID : uint
public enum SID : uint
{
None = 0,
LucidDreaming = 1204, // applied by Lucid Dreaming to self
Swiftcast = 167, // applied by Swiftcast to self
Manaward = 168, // applied by Manaward to self
Thunder = 161, // applied by Thunder to target
ThunderII = 162, // applied by Thunder II to target
Expand All @@ -101,6 +99,9 @@ public enum SID : uint

//Shared
Addle = ClassShared.SID.Addle, // applied by Addle to target
Surecast = ClassShared.SID.Surecast, // applied by Surecast to self
LucidDreaming = ClassShared.SID.LucidDreaming, // applied by Lucid Dreaming to self
Swiftcast = ClassShared.SID.Swiftcast, // applied by Swiftcast to self
}

public sealed class Definitions : IDisposable
Expand Down
5 changes: 4 additions & 1 deletion BossMod/ActionQueue/Casters/PCT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public enum SID : uint
Aetherhues = 3675, // applied by Fire in Red, Fire II in Red, Blizzard II in Cyan, Blizzard in Cyan to self
AetherhuesII = 3676, // applied by Aero in Green, Aero II in Green, Stone in Yellow to self
TemperaCoat = 3686, // applied by Tempera Coat to self
Swiftcast = 167, // applied by Swiftcast to self
TemperaGrassa = 3687, // applied by Tempera Grassa to self
Smudge = 3684, // applied by Smudge to self
HammerTime = 3680, // applied by Striking Muse to self
SubtractivePalette = 3674, // applied by Subtractive Palette to self
Expand All @@ -103,6 +103,9 @@ public enum SID : uint

//Shared
Addle = ClassShared.SID.Addle, // applied by Addle to target
Surecast = ClassShared.SID.Surecast, // applied by Surecast to self
LucidDreaming = ClassShared.SID.LucidDreaming, // applied by Lucid Dreaming to self
Swiftcast = ClassShared.SID.Swiftcast, // applied by Swiftcast to self
}

public sealed class Definitions : IDisposable
Expand Down
5 changes: 3 additions & 2 deletions BossMod/ActionQueue/Casters/RDM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ public enum TraitID : uint
public enum SID : uint
{
None = 0,
LucidDreaming = 1204, // applied by Lucid Dreaming to self
Swiftcast = 167, // applied by Swiftcast to self
VerfireReady = 1234,
VerstoneReady = 1235,
Acceleration = 1238,
Expand All @@ -101,6 +99,9 @@ public enum SID : uint

//Shared
Addle = ClassShared.SID.Addle, // applied by Addle to target
Surecast = ClassShared.SID.Surecast, // applied by Surecast to self
LucidDreaming = ClassShared.SID.LucidDreaming, // applied by Lucid Dreaming to self
Swiftcast = ClassShared.SID.Swiftcast, // applied by Swiftcast to self
}

public sealed class Definitions : IDisposable
Expand Down
4 changes: 2 additions & 2 deletions BossMod/ActionQueue/Casters/SMN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public enum SID : uint
None = 0,
Sleep = 3, // applied by Sleep to target
FurtherRuin = 2701, // applied by Energy Drain, Energy Siphon to self
LucidDreaming = 1204, // applied by Lucid Dreaming to self
SearingLight = 2703, // applied by Searing Light to self/target
TitansFavor = 2853, // applied by Topaz Rite, Topaz Catastrophe to self
Rekindle = 2704, // applied by Rekindle to self
Expand All @@ -140,8 +139,9 @@ public enum SID : uint

//Shared
Addle = ClassShared.SID.Addle, // applied by Addle to target
Surecast = ClassShared.SID.Surecast, // applied by Surecast to self
LucidDreaming = ClassShared.SID.LucidDreaming, // applied by Lucid Dreaming to self
Swiftcast = ClassShared.SID.Swiftcast, // applied by Swiftcast to self

}

public sealed class Definitions : IDisposable
Expand Down
6 changes: 5 additions & 1 deletion BossMod/ActionQueue/ClassShared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ public enum SID : uint
// PhysRanged
Peloton = 1199, // applied by Peloton to self/party

// Caster/Healer
// Caster
Addle = 1203, // applied by Addle to target

// Magical
LucidDreaming = 1204, // applied by Lucid Dreaming to self
Surecast = 160, // applied by Surecast to self
Swiftcast = 167, // applied by Swiftcast to self
Raise = 148, // applied by Raise to target

Expand Down
39 changes: 32 additions & 7 deletions BossMod/ActionQueue/Healers/AST.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,46 @@ public enum TraitID : uint
public enum SID : uint
{
None = 0,
LucidDreaming = 1204, // applied by Lucid Dreaming to self
Surecast = 160, // applied by Surecast to self
Combust = 838,
AspectedHelios = 836,
AspectedBenefic = 835,
HeliosConjunction = 3894,
Lightspeed = 841,
CombustII = 843,
CombustIII = 1881,
AspectedBenefic = 835,
AspectedHelios = 836,
HeliosConjunction = 3894,
Horoscope = 1890,
HoroscopeHelios = 1891,
NeutralSect = 1892,
NeutralSectShield = 1921,
Divination = 1878,
GiantDominance = 1248,
ClarifyingDraw = 2713,
Macrocosmos = 2718,
Lightspeed = 841,
SelfSynastry = 845,
TargetSynastry = 846,
Divining = 3893,

//Cards
TheBalance = 3887,
TheSpear = 3889,
Divining = 3893,
LordOfCrownsDrawn = 2054,
LadyOfCrownsDrawn = 2055,
BalanceDrawn = 913,
BoleDrawn = 914,
ArrowDrawn = 915,
SpearDrawn = 916,
EwerDrawn = 917,
SpireDrawn = 918,
BalanceBuff = 3887,
BoleBuff = 3890,
ArrowBuff = 3888,
SpearBuff = 3889,
EwerBuff = 3891,
SpireBuff = 3892,

//Shared
Surecast = ClassShared.SID.Surecast, // applied by Surecast to self
LucidDreaming = ClassShared.SID.LucidDreaming, // applied by Lucid Dreaming to self
Swiftcast = ClassShared.SID.Swiftcast, // applied by Swiftcast to self
}

Expand Down
5 changes: 3 additions & 2 deletions BossMod/ActionQueue/Healers/SCH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@ public enum SID : uint
Bio2 = 189, // applied by Bio2 to target, dot
Biolysis = 1895,
Galvanize = 297, // applied by Adloquium to target, shield
LucidDreaming = 1204, // applied by Lucid Dreaming to self
Sleep = 3, // applied by Repose to target
BanefulImpaction = 3883, // applied by Baneful Impaction to target
ImpactImminent = 3882, // applied by Chain Stratagem to self
ChainStratagem = 1221, // applied by Chain Stratagem to target
FeyUnion = 1222, // applied by Aetherpact to target
FeyUnion = 1223, // applied by Aetherpact to target
Seraphism = 3884, // applied by Seraphism to self

//Shared
Surecast = ClassShared.SID.Surecast, // applied by Surecast to self
LucidDreaming = ClassShared.SID.LucidDreaming, // applied by Lucid Dreaming to self
Swiftcast = ClassShared.SID.Swiftcast, // applied by Swiftcast to self
}

Expand Down
4 changes: 2 additions & 2 deletions BossMod/ActionQueue/Healers/SGE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ public enum SID : uint
{
None = 0,
Sprint = 50, // applied by Sprint to self
Surecast = 160, // applied by Surecast to self
Eukrasia = 2606,
Kardion = 2605, // applied by Kardia to self
Kardia = 2604, // applied by Kardia to self
LucidDreaming = 1204, // applied by Lucid Dreaming to self
Haima = 2612, // applied by Haima to self
Haimatinon = 2642, // applied by Haima to self
Panhaima = 2613, // applied by Panhaima to self
Expand All @@ -114,6 +112,8 @@ public enum SID : uint
EukrasianDyskrasia = 3897, // applied by Eukrasian Dyskrasia to target

//Shared
Surecast = ClassShared.SID.Surecast, // applied by Surecast to self
LucidDreaming = ClassShared.SID.LucidDreaming, // applied by Lucid Dreaming to self
Swiftcast = ClassShared.SID.Swiftcast, // applied by Swiftcast to self
}

Expand Down
4 changes: 2 additions & 2 deletions BossMod/ActionQueue/Healers/WHM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,9 @@ public enum SID : uint
Medica2 = 150, // applied by Medica2 to targets, hot
Freecure = 155, // applied by Cure1 to self, next cure2 is free
ThinAir = 1217, // applied by Thin Air to self, next gcd costs no mp
LucidDreaming = 1204, // applied by Lucid Dreaming to self, mp regen
DivineBenison = 1218, // applied by Divine Benison to target, shield
Confession = 1219, // applied by Plenary Indulgence to self, heal buff
Temperance = 1872, // applied by Temperance to self, heal and mitigate buff
Surecast = 160, // applied by Surecast to self, knockback immune
PresenceOfMind = 157, // applied by Presence of Mind to self, damage buff
Regen = 158, // applied by Regen to target, hp regen
Asylum = 1911, // applied by Asylum to target, hp regen
Expand All @@ -109,6 +107,8 @@ public enum SID : uint
DivineCaress = 3903, // applied by Divine Caress to self/target

//Shared
Surecast = ClassShared.SID.Surecast, // applied by Surecast to self
LucidDreaming = ClassShared.SID.LucidDreaming, // applied by Lucid Dreaming to self
Swiftcast = ClassShared.SID.Swiftcast, // applied by Swiftcast to self
}

Expand Down
2 changes: 1 addition & 1 deletion BossMod/ActionQueue/Ranged/MCH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public enum SID : uint
Flamethrower = 1205, // applied by Flamethrower to self
ExcavatorReady = 3865, // applied by Chain Saw to self
FullMetalMachinist = 3866, // applied by Hypercharge to self

Tactician = 1951, // applied by Tactician to self
//Shared
Peloton = ClassShared.SID.Peloton, // applied by Peloton to self/party
}
Expand Down
6 changes: 2 additions & 4 deletions BossMod/Autorotation/Utility/ClassASTUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ public enum StarOption { None, Use, End }
public enum HoroscopeOption { None, Use, End }
public enum MacrocosmosOption { None, Use, End }
public enum HeliosOption { None, Use, UseEx }
public float GetStatusDetail(Actor target, AST.SID sid) => StatusDetails(target, sid, Player.InstanceID).Left; //Checks if Status effect is on target
public bool HasEffect(Actor target, AST.SID sid, float duration) => GetStatusDetail(target, sid) < duration; //Checks if anyone has a status effect
public Actor? TargetChoice(StrategyValues.OptionRef strategy) => ResolveTargetOverride(strategy.Value);

public static readonly ActionID IDLimitBreak3 = ActionID.MakeSpell(AST.AID.AstralStasis);
Expand All @@ -19,7 +17,7 @@ public static RotationModuleDefinition Definition()
DefineShared(res, IDLimitBreak3);

DefineSimpleConfig(res, Track.Helios, "Helios", "", 140, AST.AID.Helios);
DefineSimpleConfig(res, Track.Lightspeed, "Lightspeed", "L.Speed", 140, AST.AID.Lightspeed, 15); //Self oGCD, 60s CD (120s total), 2 charges, 15s effect duration
DefineSimpleConfig(res, Track.Lightspeed, "Lightspeed", "L.speed", 140, AST.AID.Lightspeed, 15); //Self oGCD, 60s CD (120s total), 2 charges, 15s effect duration
DefineSimpleConfig(res, Track.BeneficII, "BeneficII", "Bene2", 100, AST.AID.BeneficII); //ST GCD heal
DefineSimpleConfig(res, Track.EssentialDignity, "EssentialDignity", "E.Dig", 140, AST.AID.EssentialDignity); //ST oGCD heal, 40s CD (120s Total), 3 charges
DefineSimpleConfig(res, Track.AspectedBenefic, "AspectedBenefic", "A.Benefic", 100, AST.AID.AspectedBenefic, 15); //ST GCD regen, 15s effect duration
Expand Down Expand Up @@ -88,7 +86,7 @@ public override void Execute(StrategyValues strategy, ref Actor? primaryTarget,
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 heliosUp = StatusDetails(Player, AST.SID.AspectedHelios, Player.InstanceID).Left > 0.1f || StatusDetails(Player, AST.SID.HeliosConjunction, Player.InstanceID).Left > 0.1f;
var helios = strategy.Option(Track.AspectedHelios);
var heliosAction = helios.As<HeliosOption>() switch
{
Expand Down
18 changes: 10 additions & 8 deletions BossMod/Autorotation/Utility/ClassBLMUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ public override void Execute(StrategyValues strategy, ref Actor? primaryTarget,
ExecuteSimple(strategy.Option(Track.Manaward), BLM.AID.Manaward, Player);

var dash = strategy.Option(Track.AetherialManipulation);
var dashTarget = ResolveTargetOverride(dash.Value) ?? primaryTarget; //Smart-Targeting
var dashStrategy = strategy.Option(Track.AetherialManipulation).As<DashStrategy>();
if (ShouldUseDash(dashStrategy, dashTarget))
var dashTarget = ResolveTargetOverride(dash.Value); //Smart-Targeting: Target needs to be set in autorotation or CDPlanner to prevent unexpected behavior
var distance = Player.DistanceToHitbox(dashTarget);
var cd = World.Client.Cooldowns[ActionDefinitions.Instance.Spell(BLM.AID.AetherialManipulation)!.MainCooldownGroup].Remaining;
var shouldDash = dashStrategy switch
{
DashStrategy.None => false,
DashStrategy.Force => distance <= 25 && cd < 0.6f,
_ => false,
};
if (shouldDash)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(BLM.AID.AetherialManipulation), dashTarget, dash.Priority(), dash.Value.ExpireIn);
}
private bool ShouldUseDash(DashStrategy strategy, Actor? primaryTarget) => strategy switch
{
DashStrategy.None => false,
DashStrategy.Force => true,
_ => false,
};
}
18 changes: 13 additions & 5 deletions BossMod/Autorotation/Utility/ClassBRDUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public enum Track { WardensPaean = SharedTrack.Count, Troubadour, NaturesMinne }

public static readonly ActionID IDLimitBreak3 = ActionID.MakeSpell(BRD.AID.SagittariusArrow);

public enum TroubOption { None, Use87, Use88 }
public enum TroubOption { None, Use87, Use87IfNotActive, Use88, Use88IfNotActive }

public static RotationModuleDefinition Definition()
{
Expand All @@ -17,8 +17,10 @@ public static RotationModuleDefinition Definition()

res.Define(Track.Troubadour).As<TroubOption>("Troubadour", "Troub", 500)
.AddOption(TroubOption.None, "None", "Do not use automatically")
.AddOption(TroubOption.Use87, "Use", "Use Troubadour", 120, 15, ActionTargets.Self, 62, 87)
.AddOption(TroubOption.Use88, "Use88", "Use Troubadour", 90, 15, ActionTargets.Self, 88)
.AddOption(TroubOption.Use87, "Use", "Use Troubadour (120s CD), regardless if equivalent ranged buff is already active", 120, 15, ActionTargets.Self, 62, 87)
.AddOption(TroubOption.Use87IfNotActive, "UseIfNotActive", "Use Troubadour (120s CD), unless equivalent ranged buff is already active", 90, 15, ActionTargets.Self, 62, 87)
.AddOption(TroubOption.Use88, "Use88", "Use Troubadour (90s CD), regardless if equivalent ranged buff is already active", 90, 15, ActionTargets.Self, 88)
.AddOption(TroubOption.Use88IfNotActive, "Use88IfNotActive", "Use Troubadour (90s CD), unless equivalent ranged buff is already active", 90, 15, ActionTargets.Self, 88)
.AddAssociatedActions(BRD.AID.Troubadour);

DefineSimpleConfig(res, Track.NaturesMinne, "NaturesMinne", "Minne", 400, BRD.AID.NaturesMinne, 15);
Expand All @@ -29,11 +31,17 @@ public static RotationModuleDefinition Definition()
public override void Execute(StrategyValues strategy, ref Actor? primaryTarget, float estimatedAnimLockDelay, bool isMoving)
{
ExecuteShared(strategy, IDLimitBreak3, primaryTarget);
ExecuteSimple(strategy.Option(Track.WardensPaean), BRD.AID.WardensPaean, Player);
ExecuteSimple(strategy.Option(Track.WardensPaean), BRD.AID.WardensPaean, ResolveTargetOverride(strategy.Option(Track.WardensPaean).Value) ?? primaryTarget ?? Player);
ExecuteSimple(strategy.Option(Track.NaturesMinne), BRD.AID.NaturesMinne, Player);

var troub = strategy.Option(Track.Troubadour);
var hasDefensive = Player.FindStatus(BRD.SID.Troubadour) != null || Player.FindStatus(MCH.SID.Tactician) != null || Player.FindStatus(DNC.SID.ShieldSamba) != null;
if (troub.As<TroubOption>() != TroubOption.None)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(BRD.AID.Troubadour), Player, troub.Priority(), troub.Value.ExpireIn);
{
if (troub.As<TroubOption>() is TroubOption.Use87 or TroubOption.Use88)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(BRD.AID.Troubadour), Player, troub.Priority(), troub.Value.ExpireIn);
if (troub.As<TroubOption>() is TroubOption.Use87IfNotActive or TroubOption.Use88IfNotActive && !hasDefensive)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(BRD.AID.Troubadour), Player, troub.Priority(), troub.Value.ExpireIn);
}
}
}
16 changes: 12 additions & 4 deletions BossMod/Autorotation/Utility/ClassDNCUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public sealed class ClassDNCUtility(RotationModuleManager manager, Actor player)
{
public enum Track { CuringWaltz = SharedTrack.Count, ShieldSamba, Improvisation }

public enum SambaOption { None, Use87, Use88 }
public enum SambaOption { None, Use87, Use87IfNotActive, Use88, Use88IfNotActive }

public static readonly ActionID IDLimitBreak3 = ActionID.MakeSpell(DNC.AID.CrimsonLotus);

Expand All @@ -17,8 +17,10 @@ public static RotationModuleDefinition Definition()

res.Define(Track.ShieldSamba).As<SambaOption>("Shield Samba", "S.Samba", 500)
.AddOption(SambaOption.None, "None", "Do not use automatically")
.AddOption(SambaOption.Use87, "Use", "Use Shield Samba", 120, 15, ActionTargets.Self, 56, 87)
.AddOption(SambaOption.Use88, "Use88", "Use Shield Samba", 90, 15, ActionTargets.Self, 88)
.AddOption(SambaOption.Use87, "Use", "Use Shield Samba (120s CD), regardless if equivalent ranged buff is already active", 120, 15, ActionTargets.Self, 56, 87)
.AddOption(SambaOption.Use87IfNotActive, "UseIfNotActive", "Use Shield Samba (120s CD), unless equivalent ranged buff is already active", 90, 15, ActionTargets.Self, 56, 87)
.AddOption(SambaOption.Use88, "Use88", "Use Shield Samba (90s CD), regardless if equivalent ranged buff is already active", 90, 15, ActionTargets.Self, 88)
.AddOption(SambaOption.Use88IfNotActive, "Use88IfNotActive", "Use Shield Samba (90s CD), unless equivalent ranged buff is already active", 90, 15, ActionTargets.Self, 88)
.AddAssociatedActions(DNC.AID.ShieldSamba);

DefineSimpleConfig(res, Track.Improvisation, "Improvisation", "Improv", 300, DNC.AID.Improvisation, 15);
Expand All @@ -33,7 +35,13 @@ public override void Execute(StrategyValues strategy, ref Actor? primaryTarget,
ExecuteSimple(strategy.Option(Track.Improvisation), DNC.AID.Improvisation, Player);

var samba = strategy.Option(Track.ShieldSamba);
var hasDefensive = Player.FindStatus(BRD.SID.Troubadour) != null || Player.FindStatus(MCH.SID.Tactician) != null || Player.FindStatus(DNC.SID.ShieldSamba) != null;
if (samba.As<SambaOption>() != SambaOption.None)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(DNC.AID.ShieldSamba), Player, samba.Priority(), samba.Value.ExpireIn);
{
if (samba.As<SambaOption>() is SambaOption.Use87 or SambaOption.Use88)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(DNC.AID.ShieldSamba), Player, samba.Priority(), samba.Value.ExpireIn);
if (samba.As<SambaOption>() is SambaOption.Use87IfNotActive or SambaOption.Use88IfNotActive && !hasDefensive)
Hints.ActionsToExecute.Push(ActionID.MakeSpell(DNC.AID.ShieldSamba), Player, samba.Priority(), samba.Value.ExpireIn);
}
}
}
Loading

0 comments on commit c6a8eef

Please sign in to comment.