Skip to content

Commit

Permalink
Casting while Moving options
Browse files Browse the repository at this point in the history
  • Loading branch information
Akechi-kun committed Jan 18, 2025
1 parent 4e342da commit ecc268f
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions BossMod/Autorotation/akechi/AkechiBLM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public enum Track
LeyLines, //Ley Lines tracking
Potion, //Potion item tracking
TPUS, //Transpose&UmbralSoul combo tracking
Casting, //Cast while Moving option tracking
Transpose, //Transpose tracking
Amplifier, //Amplifier tracking
Retrace, //Retrace tracking
Expand Down Expand Up @@ -106,6 +107,11 @@ public enum TPUSStrategy
OOConly, //Only use Transpose & Umbral Soul combo when fully out of combat
Forbid //Forbid Transpose & Umbral Soul combo
}
public enum CastingOption
{
Allow, //Allow casting while moving
Forbid //Forbid casting while moving
}
public enum OffensiveStrategy
{
Automatic, //Automatically decide when to use off-global offensive abilities
Expand Down Expand Up @@ -198,6 +204,9 @@ public static RotationModuleDefinition Definition()
.AddOption(TPUSStrategy.OOConly, "OOConly", "Only use Transpose & Umbral Soul combo when fully out of combat", 0, 0, ActionTargets.Self, 35)
.AddOption(TPUSStrategy.Forbid, "Forbid", "Forbid Transpose & Umbral Soul combo", 0, 0, ActionTargets.Self, 35)
.AddAssociatedActions(AID.Transpose, AID.UmbralSoul);
res.Define(Track.Casting).As<CastingOption>("Casting", uiPriority: 155)
.AddOption(CastingOption.Allow, "Allow", "Allow casting while Casting")
.AddOption(CastingOption.Forbid, "Forbid", "Forbid casting while moving");
#endregion

#region Offensive Strategies
Expand Down Expand Up @@ -271,6 +280,7 @@ public static RotationModuleDefinition Definition()
Moving2 = 710, //Moving (2nd priority)
Moving1 = 720, //Moving (1st priority)
ForcedGCD = 900, //Forced GCDs
BlockAll = 2000, //Block all GCDs
}
public enum OGCDPriority //priorities for oGCDs (higher number = higher priority)
{
Expand Down Expand Up @@ -505,19 +515,30 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa
var btlStrat = btl.As<OffensiveStrategy>(); //Between the Lines strategy
var potionStrat = strategy.Option(Track.Potion).As<PotionStrategy>(); //Potion strategy
var tpusStrat = strategy.Option(Track.TPUS).As<TPUSStrategy>(); //Transpose/Umbral Soul strategy
var movingOption = strategy.Option(Track.Casting).As<CastingOption>(); //Casting while moving strategy
#endregion

#endregion

#region Rotation Execution

#region ST / AOE
if (AOEStrategy is AOEStrategy.Auto)
BestRotation(TargetChoice(AOE) ?? BestAOETarget ?? primaryTarget);
if (AOEStrategy is AOEStrategy.ForceST)
BestST(TargetChoice(AOE) ?? primaryTarget);
if (AOEStrategy is AOEStrategy.ForceAOE)
BestAOE(TargetChoice(AOE) ?? BestAOETarget ?? primaryTarget);
if (movingOption is CastingOption.Allow ||
movingOption is CastingOption.Forbid &&
(!isMoving || //if not moving
(PlayerHasEffect(SID.Swiftcast, 10) || //or has Swiftcast
PlayerHasEffect(SID.Triplecast, 15) || //or has Triplecast
(canParadox && ElementTimer < (SpS * 3) && MP >= 1600 || canParadox && JustUsed(AID.Blizzard4, 5)) || //or can use Paradox
SelfStatusLeft(SID.Firestarter, 30) is < 25 and not 0 || //or can use F3P
(Unlocked(TraitID.EnhancedAstralFire) && MP is < 1600 and not 0)))) //instant cast Despair
{
if (AOEStrategy is AOEStrategy.Auto)
BestRotation(TargetChoice(AOE) ?? BestAOETarget ?? primaryTarget);
if (AOEStrategy is AOEStrategy.ForceST)
BestST(TargetChoice(AOE) ?? primaryTarget);
if (AOEStrategy is AOEStrategy.ForceAOE)
BestAOE(TargetChoice(AOE) ?? BestAOETarget ?? primaryTarget);
}
#endregion

#region Movement
Expand Down Expand Up @@ -578,7 +599,8 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa
}
if (movementStrat is MovementStrategy.OnlyScathe)
{
QueueGCD(AID.Scathe, primaryTarget, GCDPriority.Moving1);
if (MP >= 800)
QueueGCD(AID.Scathe, primaryTarget, GCDPriority.Moving1);
}
}
#endregion
Expand Down

0 comments on commit ecc268f

Please sign in to comment.