Skip to content

Commit

Permalink
Merge branch 'merge'
Browse files Browse the repository at this point in the history
  • Loading branch information
CarnifexOptimus committed Dec 4, 2024
2 parents 756f957 + e2d28b3 commit 1db5ec5
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 9 deletions.
67 changes: 67 additions & 0 deletions BossMod/Autorotation/MiscAI/StayWithinLeylines.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using static BossMod.ActionQueue;

namespace BossMod.Autorotation.MiscAI;

public sealed class StayWithinLeylines(RotationModuleManager manager, Actor player) : RotationModule(manager, player)
{
public enum Tracks
{
UseRetrace,
UseBetweenTheLines
}

public enum RetraceDefinition
{
No = 0,
Yes = 1,
}

public enum BetweenTheLinesDefinition
{
No = 0,
Yes = 1,
}

public static RotationModuleDefinition Definition()
{
RotationModuleDefinition def = new("Misc AI: Stay within leylines when active", "Black Mage utility module.", "Misc", "Taurenkey", RotationModuleQuality.Basic, BitMask.Build(Class.BLM), 1000);

var retrace = def.Define(Tracks.UseRetrace).As<RetraceDefinition>("Use Retrace", "Use Retrace");
retrace.AddOption(RetraceDefinition.No, "No");
retrace.AddOption(RetraceDefinition.Yes, "Yes");

var btl = def.Define(Tracks.UseBetweenTheLines).As<BetweenTheLinesDefinition>("Use Between The Lines", "Use Between The Lines");
btl.AddOption(BetweenTheLinesDefinition.No, "No");
btl.AddOption(BetweenTheLinesDefinition.Yes, "Yes");

return def;
}

public override void Execute(StrategyValues strategy, Actor? primaryTarget, float estimatedAnimLockDelay, bool isMoving)
{
bool InLeyLines = Player.FindStatus(BLM.SID.CircleOfPower) != null;

if (!InLeyLines)
{
var zone = World.Actors.FirstOrDefault(x => x.OID == 0x179 && x.OwnerID == Player.InstanceID);
if (zone != null)
{
var retrace = ActionID.MakeSpell(BLM.AID.Retrace);
var btl = ActionID.MakeSpell(BLM.AID.BetweenTheLines);
var retraceCd = ActionDefinitions.Instance.Spell(BLM.AID.Retrace)?.MainCooldownGroup;
var btlCd = ActionDefinitions.Instance.Spell(BLM.AID.BetweenTheLines)?.MainCooldownGroup;
var retraceStrat = strategy.Option(Tracks.UseRetrace).As<RetraceDefinition>();
var btlStrat = strategy.Option(Tracks.UseBetweenTheLines).As<BetweenTheLinesDefinition>();

//BTL first, followed by retrace, then walk
if (btlStrat == BetweenTheLinesDefinition.Yes && ActionUnlocked(btl) && btlCd.HasValue && World.Client.Cooldowns[btlCd.Value].Elapsed <= 2f && !isMoving)
Hints.ActionsToExecute.Push(btl, Player, Priority.Low, targetPos: zone.PosRot.XYZ());
else if (retraceStrat == RetraceDefinition.Yes && ActionUnlocked(retrace) && retraceCd.HasValue && World.Client.Cooldowns[retraceCd.Value].Elapsed <= 2f && !isMoving)
Hints.ActionsToExecute.Push(retrace, null, Priority.Low, targetPos: Player.PosRot.XYZ());
else
Hints.GoalZones.Add(Hints.GoalSingleTarget(zone.Position, 1f));
}
}

}
}
18 changes: 9 additions & 9 deletions BossMod/Autorotation/akechi/AkechiGNB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa
#region Minimal Requirements
//Ammo-relative
canBS = Unlocked(GNB.AID.BurstStrike) && Ammo > 0; //BurstStrike conditions; -1 Ammo ST
canGF = Unlocked(GNB.AID.GnashingFang) && ActionReady(GNB.AID.GnashingFang) && Ammo >= 1; //GnashingFang conditions; -1 Ammo ST
canGF = Unlocked(GNB.AID.GnashingFang) && ActionReady(GNB.AID.GnashingFang) && Ammo > 0; //GnashingFang conditions; -1 Ammo ST
canFC = Unlocked(GNB.AID.FatedCircle) && Ammo > 0; //FatedCircle conditions; -1 Ammo AOE
canDD = Unlocked(GNB.AID.DoubleDown) && ActionReady(GNB.AID.DoubleDown) && Ammo >= 2; //DoubleDown conditions; -2 Ammo AOE
canDD = Unlocked(GNB.AID.DoubleDown) && ActionReady(GNB.AID.DoubleDown) && Ammo > 0; //DoubleDown conditions; -1 Ammo AOE
canBF = Unlocked(GNB.AID.Bloodfest) && ActionReady(GNB.AID.Bloodfest); //Bloodfest conditions; +all Ammo (must have target)
//Cooldown-relative
canZone = Unlocked(GNB.AID.DangerZone) && ActionReady(GNB.AID.DangerZone); //Zone conditions
Expand Down Expand Up @@ -513,7 +513,7 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa
//Double Down execution
var ddStrat = strategy.Option(Track.DoubleDown).As<OffensiveStrategy>();
if (ShouldUseDoubleDown(ddStrat, primaryTarget))
QueueGCD(GNB.AID.DoubleDown, primaryTarget, ((ddStrat == OffensiveStrategy.Force) || Ammo == 2) ? GCDPriority.ForcedGCD : GCDPriority.DoubleDown);
QueueGCD(GNB.AID.DoubleDown, primaryTarget, ((ddStrat == OffensiveStrategy.Force) || Ammo == 1) ? GCDPriority.ForcedGCD : GCDPriority.DoubleDown);

//Gnashing Fang Combo execution
if (GunComboStep == 1)
Expand All @@ -537,7 +537,7 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa
//Burst Strike execution
var strikeStrat = strategy.Option(Track.BurstStrike).As<OffensiveStrategy>();
if (Unlocked(GNB.AID.BurstStrike) && Unlocked(GNB.AID.Bloodfest) && ShouldUseBurstStrike(strikeStrat, primaryTarget))
QueueGCD(GNB.AID.BurstStrike, primaryTarget, strikeStrat == OffensiveStrategy.Force ? GCDPriority.ForcedGCD : GCDPriority.BurstStrike);
QueueGCD(GNB.AID.BurstStrike, primaryTarget, strikeStrat == OffensiveStrategy.Force ? GCDPriority.ForcedGCD : nmCD < 1 ? GCDPriority.ForcedGCD : GCDPriority.BurstStrike);

//Fated Circle execution
var fcStrat = strategy.Option(Track.FatedCircle).As<OffensiveStrategy>();
Expand Down Expand Up @@ -691,10 +691,9 @@ private void QueueOGCD(GNB.AID aid, Actor? target, OGCDPriority prio, float base
{
NoMercyStrategy.Automatic =>
Player.InCombat && target != null && ActionReady(GNB.AID.NoMercy) && GCD < 0.9f &&
((Ammo == 1 && bfCD == 0 && Unlocked(GNB.AID.Bloodfest) && Unlocked(GNB.AID.DoubleDown)) || //Lv90+ Opener
((Ammo < 3) || //Lv90+ Opener
(Ammo >= 1 && bfCD == 0 && Unlocked(GNB.AID.Bloodfest) && !Unlocked(GNB.AID.DoubleDown)) || //Lv80+ Opener
(!Unlocked(GNB.AID.Bloodfest) && Ammo >= 1 && ActionReady(GNB.AID.GnashingFang)) || //Lv70 & below
Ammo == MaxCartridges), //60s & 120s burst windows
(!Unlocked(GNB.AID.Bloodfest) && Ammo >= 1 && ActionReady(GNB.AID.GnashingFang))), //Lv70 & below
NoMercyStrategy.Force => true,
NoMercyStrategy.ForceLW => Player.InCombat && GCD < 0.9f,
NoMercyStrategy.Force2 => Ammo >= 2,
Expand All @@ -710,7 +709,7 @@ private void QueueOGCD(GNB.AID aid, Actor? target, OGCDPriority prio, float base
{
BloodfestStrategy.Automatic =>
Player.InCombat && target != null &&
canBF && Ammo == 0 && hasNM,
canBF && Ammo == 0,
BloodfestStrategy.Force => canBF,
BloodfestStrategy.Force0 => canBF && Ammo == 0,
BloodfestStrategy.Delay => false,
Expand Down Expand Up @@ -779,7 +778,8 @@ private void QueueOGCD(GNB.AID aid, Actor? target, OGCDPriority prio, float base
{
OffensiveStrategy.Automatic =>
Player.InCombat && target != null && In3y(target) && canBS &&
((Unlocked(GNB.AID.DoubleDown) && hasNM && !ActionReady(GNB.AID.DoubleDown) && GunComboStep == 0 && !hasReign) || //Lv90+
((nmCD < 1.5f) ||
(Unlocked(GNB.AID.DoubleDown) && hasNM && !ActionReady(GNB.AID.DoubleDown) && GunComboStep == 0 && !hasReign) || //Lv90+
(!Unlocked(GNB.AID.DoubleDown) && !ActionReady(GNB.AID.GnashingFang) && hasNM && GunComboStep == 0) || //Lv80 & Below
(ComboLastMove == GNB.AID.BrutalShell && Ammo == MaxCartridges)), //Overcap protection
OffensiveStrategy.Force => canBS,
Expand Down

0 comments on commit 1db5ec5

Please sign in to comment.