From a7ac0d1a60178102c8f11cddb8dd424bd629fbde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Sat, 22 Apr 2023 20:20:58 +0800 Subject: [PATCH] fix: format some base files. --- .../Rotations/Basic/MCH_Base.cs | 71 ++++--- .../Rotations/Basic/MNK_Base.cs | 98 +++++----- .../Rotations/Basic/NIN_Base.cs | 178 +++++++++++------- .../Rotations/Basic/PLD_Base.cs | 109 +++++++---- .../Rotations/Basic/RDM_Base.cs | 115 +++++------ .../Rotations/Basic/RPR_Base.cs | 10 - .../Rotations/CustomRotation_Invoke.cs | 3 +- 7 files changed, 343 insertions(+), 241 deletions(-) diff --git a/RotationSolver.Basic/Rotations/Basic/MCH_Base.cs b/RotationSolver.Basic/Rotations/Basic/MCH_Base.cs index 53f35ef8e..e55ea5c93 100644 --- a/RotationSolver.Basic/Rotations/Basic/MCH_Base.cs +++ b/RotationSolver.Basic/Rotations/Basic/MCH_Base.cs @@ -2,35 +2,49 @@ namespace RotationSolver.Basic.Rotations.Basic; public abstract class MCH_Base : CustomRotation { - private static MCHGauge JobGauge => Service.JobGauges.Get(); - public override MedicineType MedicineType => MedicineType.Dexterity; + public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Machinist }; + + #region Job Gauge + static MCHGauge JobGauge => Service.JobGauges.Get(); + protected static bool IsOverheated => JobGauge.IsOverheated; protected static byte Heat => JobGauge.Heat; protected static byte Battery => JobGauge.Battery; + static float OverheatTimeRemaining => JobGauge.OverheatTimeRemaining / 1000f; + protected static bool OverheatedEndAfter(float time) { - return EndAfter(JobGauge.OverheatTimeRemaining / 1000f, time); + return EndAfter(OverheatTimeRemaining, time); } - protected static bool OverheatedEndAfterGCD(uint gctCount = 0, int abilityCount = 0) + protected static bool OverheatedEndAfterGCD(uint gctCount = 0, float offset = 0) { - return EndAfterGCD(JobGauge.OverheatTimeRemaining / 1000f, gctCount, abilityCount); + return EndAfterGCD(OverheatTimeRemaining, gctCount, offset); } + #endregion - public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Machinist }; - + #region Attack Single + /// + /// 1 + /// public static IBaseAction SplitShot { get; } = new BaseAction(ActionID.SplitShot); + /// + /// 2 + /// public static IBaseAction SlugShot { get; } = new BaseAction(ActionID.SlugShot) { ComboIds = new[] { ActionID.HeatedSplitShot }, }; + /// + /// 3 + /// public static IBaseAction CleanShot { get; } = new BaseAction(ActionID.CleanShot) { ComboIds = new[] { ActionID.HeatedSlugShot }, @@ -41,23 +55,43 @@ protected static bool OverheatedEndAfterGCD(uint gctCount = 0, int abilityCount ActionCheck = b => IsOverheated && !OverheatedEndAfterGCD(), }; + public static IBaseAction HotShot { get; } = new BaseAction(ActionID.HotShot); + + public static IBaseAction AirAnchor { get; } = new BaseAction(ActionID.AirAnchor); + + public static IBaseAction Drill { get; } = new BaseAction(ActionID.Drill); + + public static IBaseAction GaussRound { get; } = new BaseAction(ActionID.GaussRound); + + #endregion + + #region Attack Area + /// + /// 1 + /// public static IBaseAction SpreadShot { get; } = new BaseAction(ActionID.SpreadShot); + /// + /// 2 + /// public static IBaseAction AutoCrossbow { get; } = new BaseAction(ActionID.AutoCrossbow) { ActionCheck = HeatBlast.ActionCheck, }; - public static IBaseAction HotShot { get; } = new BaseAction(ActionID.HotShot); - - public static IBaseAction AirAnchor { get; } = new BaseAction(ActionID.AirAnchor); - - public static IBaseAction Drill { get; } = new BaseAction(ActionID.Drill); - public static IBaseAction ChainSaw { get; } = new BaseAction(ActionID.ChainSaw); public static IBaseAction BioBlaster { get; } = new BaseAction(ActionID.BioBlaster, ActionOption.Dot); + public static IBaseAction Ricochet { get; } = new BaseAction(ActionID.Ricochet); + + public static IBaseAction RookAutoturret { get; } = new BaseAction(ActionID.RookAutoturret) + { + ActionCheck = b => JobGauge.Battery >= 50 && !JobGauge.IsRobotActive, + }; + #endregion + + #region Support public static IBaseAction Reassemble { get; } = new BaseAction(ActionID.Reassemble) { StatusProvide = new StatusID[] { StatusID.Reassemble }, @@ -71,20 +105,14 @@ protected static bool OverheatedEndAfterGCD(uint gctCount = 0, int abilityCount public static IBaseAction Wildfire { get; } = new BaseAction(ActionID.Wildfire); - public static IBaseAction GaussRound { get; } = new BaseAction(ActionID.GaussRound); - - public static IBaseAction Ricochet { get; } = new BaseAction(ActionID.Ricochet); - public static IBaseAction BarrelStabilizer { get; } = new BaseAction(ActionID.BarrelStabilizer) { ActionCheck = b => JobGauge.Heat <= 50 && InCombat, }; + #endregion - public static IBaseAction RookAutoturret { get; } = new BaseAction(ActionID.RookAutoturret) - { - ActionCheck = b => JobGauge.Battery >= 50 && !JobGauge.IsRobotActive, - }; + #region Defense public static IBaseAction Tactician { get; } = new BaseAction(ActionID.Tactician, ActionOption.Defense) { ActionCheck = b => !Player.HasStatus(false, StatusID.Troubadour, @@ -94,6 +122,7 @@ protected static bool OverheatedEndAfterGCD(uint gctCount = 0, int abilityCount }; public static IBaseAction Dismantle { get; } = new BaseAction(ActionID.Dismantle, ActionOption.Defense); + #endregion [RotationDesc(ActionID.Tactician, ActionID.Dismantle)] protected sealed override bool DefenseAreaAbility(out IAction act) diff --git a/RotationSolver.Basic/Rotations/Basic/MNK_Base.cs b/RotationSolver.Basic/Rotations/Basic/MNK_Base.cs index 220dadb18..005fdb792 100644 --- a/RotationSolver.Basic/Rotations/Basic/MNK_Base.cs +++ b/RotationSolver.Basic/Rotations/Basic/MNK_Base.cs @@ -2,122 +2,134 @@ namespace RotationSolver.Basic.Rotations.Basic; public abstract class MNK_Base : CustomRotation { - private static MNKGauge JobGauge => Service.JobGauges.Get(); - public override MedicineType MedicineType => MedicineType.Strength; + public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Monk, ClassJobID.Pugilist }; + + #region Job Gauge + static MNKGauge JobGauge => Service.JobGauges.Get(); + protected static BeastChakra[] BeastChakras => JobGauge.BeastChakra; protected static byte Chakra => JobGauge.Chakra; - protected static bool HasSolar => (JobGauge.Nadi & Nadi.SOLAR) != 0; - protected static bool HasLunar => (JobGauge.Nadi & Nadi.LUNAR) != 0; + protected static bool HasSolar => JobGauge.Nadi.HasFlag(Nadi.SOLAR); + protected static bool HasLunar => JobGauge.Nadi.HasFlag(Nadi.LUNAR); + #endregion - public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Monk, ClassJobID.Pugilist }; + #region Attack Single + public static IBaseAction BootShine { get; } = new BaseAction(ActionID.BootShine); public static IBaseAction DragonKick { get; } = new BaseAction(ActionID.DragonKick) { StatusProvide = new[] { StatusID.LeadenFist }, }; - public static IBaseAction BootShine { get; } = new BaseAction(ActionID.BootShine); - - public static IBaseAction ArmOfTheDestroyer { get; } = new BaseAction(ActionID.ArmOfTheDestroyer); - - public static IBaseAction ShadowOfTheDestroyer { get; } = new BaseAction(ActionID.ShadowOfTheDestroyer); - public static IBaseAction TwinSnakes { get; } = new BaseAction(ActionID.TwinSnakes, ActionOption.Dot); - public static IBaseAction TrueStrike { get; } = new BaseAction(ActionID.TrueStrike); - - public static IBaseAction FourPointFury { get; } = new BaseAction(ActionID.FourPointFury); - public static IBaseAction Demolish { get; } = new BaseAction(ActionID.Demolish, ActionOption.Dot) { TargetStatus = new StatusID[] { StatusID.Demolish }, GetDotGcdCount = () => 3, }; - public static IBaseAction SnapPunch { get; } = new BaseAction(ActionID.SnapPunch); - public static IBaseAction RockBreaker { get; } = new BaseAction(ActionID.RockBreaker); - - public static IBaseAction Meditation { get; } = new BaseAction(ActionID.Meditation, ActionOption.Buff); - public static IBaseAction SteelPeak { get; } = new BaseAction(ActionID.SteelPeak) { ActionCheck = b => InCombat && Chakra == 5, }; + #endregion - public static IBaseAction HowlingFist { get; } = new BaseAction(ActionID.HowlingFist) - { - ActionCheck = SteelPeak.ActionCheck, - }; - - public static IBaseAction Brotherhood { get; } = new BaseAction(ActionID.Brotherhood, ActionOption.Buff); + #region Attack Area + public static IBaseAction ArmOfTheDestroyer { get; } = new BaseAction(ActionID.ArmOfTheDestroyer); - public static IBaseAction RiddleOfFire { get; } = new BaseAction(ActionID.RiddleOfFire, ActionOption.Buff); + [Obsolete("Please use ArmOfTheDestroyer instead.")] + public static IBaseAction ShadowOfTheDestroyer { get; } = new BaseAction(ActionID.ShadowOfTheDestroyer); - public static IBaseAction Thunderclap { get; } = new BaseAction(ActionID.Thunderclap, ActionOption.EndSpecial) - { - ChoiceTarget = TargetFilter.FindTargetForMoving, - }; + public static IBaseAction FourPointFury { get; } = new BaseAction(ActionID.FourPointFury); - public static IBaseAction Mantra { get; } = new BaseAction(ActionID.Mantra, ActionOption.Heal); + public static IBaseAction RockBreaker { get; } = new BaseAction(ActionID.RockBreaker); - public static IBaseAction PerfectBalance { get; } = new BaseAction(ActionID.PerfectBalance) + public static IBaseAction HowlingFist { get; } = new BaseAction(ActionID.HowlingFist) { - ActionCheck = b => InCombat, + ActionCheck = SteelPeak.ActionCheck, }; public static IBaseAction ElixirField { get; } = new BaseAction(ActionID.ElixirField); public static IBaseAction FlintStrike { get; } = new BaseAction(ActionID.FlintStrike); + [Obsolete("Please use FlintStrike instead")] + public static IBaseAction RisingPhoenix { get; } = new BaseAction(ActionID.RisingPhoenix); + public static IBaseAction CelestialRevolution { get; } = new BaseAction(ActionID.CelestialRevolution); - public static IBaseAction RisingPhoenix { get; } = new BaseAction(ActionID.RisingPhoenix); public static IBaseAction TornadoKick { get; } = new BaseAction(ActionID.TornadoKick); + + [Obsolete("Please use TornadoKick instead")] public static IBaseAction PhantomRush { get; } = new BaseAction(ActionID.PhantomRush); + #endregion + + + #region Support + public static IBaseAction Mantra { get; } = new BaseAction(ActionID.Mantra, ActionOption.Heal); + + public static IBaseAction RiddleOfEarth { get; } = new BaseAction(ActionID.RiddleOfEarth, ActionOption.Defense) + { + StatusProvide = new[] { StatusID.RiddleOfEarth }, + }; + + public static IBaseAction RiddleOfWind { get; } = new BaseAction(ActionID.RiddleOfWind); + + public static IBaseAction PerfectBalance { get; } = new BaseAction(ActionID.PerfectBalance) + { + ActionCheck = b => InCombat, + }; + + public static IBaseAction Meditation { get; } = new BaseAction(ActionID.Meditation); + public static IBaseAction FormShift { get; } = new BaseAction(ActionID.FormShift, ActionOption.Buff) { StatusProvide = new[] { StatusID.FormlessFist, StatusID.PerfectBalance }, }; - public static IBaseAction RiddleOfEarth { get; } = new BaseAction(ActionID.RiddleOfEarth, ActionOption.Defense) + public static IBaseAction Brotherhood { get; } = new BaseAction(ActionID.Brotherhood, ActionOption.Buff); + + public static IBaseAction RiddleOfFire { get; } = new BaseAction(ActionID.RiddleOfFire); + #endregion + + public static IBaseAction Thunderclap { get; } = new BaseAction(ActionID.Thunderclap, ActionOption.EndSpecial) { - StatusProvide = new[] { StatusID.RiddleOfEarth }, + ChoiceTarget = TargetFilter.FindTargetForMoving, }; - public static IBaseAction RiddleOfWind { get; } = new BaseAction(ActionID.RiddleOfWind, ActionOption.Buff); - [RotationDesc(ActionID.Thunderclap)] protected sealed override bool MoveForwardAbility(out IAction act, CanUseOption option = CanUseOption.None) { if (Thunderclap.CanUse(out act, CanUseOption.EmptyOrSkipCombo | option | CanUseOption.IgnoreClippingCheck)) return true; - return false; + return base.MoveForwardAbility(out act, option); } [RotationDesc(ActionID.Feint)] protected sealed override bool DefenseAreaAbility(out IAction act) { if (Feint.CanUse(out act)) return true; - return false; + return base.DefenseAreaAbility(out act); } [RotationDesc(ActionID.Mantra)] protected sealed override bool HealAreaAbility(out IAction act) { if (Mantra.CanUse(out act)) return true; - return false; + return base.HealAreaAbility(out act); } [RotationDesc(ActionID.RiddleOfEarth)] protected sealed override bool DefenseSingleAbility(out IAction act) { if (RiddleOfEarth.CanUse(out act, CanUseOption.EmptyOrSkipCombo)) return true; - return false; + return base.DefenseSingleAbility(out act); } } diff --git a/RotationSolver.Basic/Rotations/Basic/NIN_Base.cs b/RotationSolver.Basic/Rotations/Basic/NIN_Base.cs index c33bd0eed..07de6c555 100644 --- a/RotationSolver.Basic/Rotations/Basic/NIN_Base.cs +++ b/RotationSolver.Basic/Rotations/Basic/NIN_Base.cs @@ -7,125 +7,133 @@ public interface INinAction : IBaseAction public abstract class NIN_Base : CustomRotation { - private static NINGauge JobGauge => Service.JobGauges.Get(); public override MedicineType MedicineType => MedicineType.Dexterity; + public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Ninja, ClassJobID.Rogue }; + + #region Job Gauge + static NINGauge JobGauge => Service.JobGauges.Get(); - protected static bool InHuton => JobGauge.HutonTimer > 0; + [Obsolete("Better not use this.")] + protected static bool InHuton => HutonTime > 0; protected static byte Ninki => JobGauge.Ninki; - public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Ninja, ClassJobID.Rogue }; + protected static float HutonTime => JobGauge.HutonTimer / 1000f; - public class NinAction : BaseAction, INinAction - { - public IBaseAction[] Ninjutsu { get; } + protected static bool HutonEndAfter(float time) => EndAfter(HutonTime, time); - internal NinAction(ActionID actionID, params IBaseAction[] ninjutsu) - : base(actionID) - { - Ninjutsu = ninjutsu; - } - } + protected static bool HutonEndAfterGCD(uint gctCount = 0, float offset = 0) + => EndAfterGCD(HutonTime, gctCount, offset); + #endregion - public static IBaseAction Hide { get; } = new BaseAction(ActionID.Hide, ActionOption.Buff); - public static IBaseAction SpinningEdge { get; } = new BaseAction(ActionID.SpinningEdge); - public static IBaseAction ShadeShift { get; } = new BaseAction(ActionID.ShadeShift, ActionOption.Buff); + #region Attack Single + /// + /// 1 + /// + public static IBaseAction SpinningEdge { get; } = new BaseAction(ActionID.SpinningEdge); + /// + /// 2 + /// public static IBaseAction GustSlash { get; } = new BaseAction(ActionID.GustSlash); - public static IBaseAction ThrowingDagger { get; } = new BaseAction(ActionID.ThrowingDagger) + /// + /// 3 + /// + public static IBaseAction AeolianEdge { get; } = new BaseAction(ActionID.AeolianEdge); + + /// + /// 4 + /// + public static IBaseAction ArmorCrush { get; } = new BaseAction(ActionID.ArmorCrush) { - FilterForHostiles = TargetFilter.MeleeRangeTargetFilter, - ActionCheck = b => !IsLastAction(IActionHelper.MovingActions), + ActionCheck = b => HutonEndAfter(25) && !HutonEndAfterGCD(), }; - public static IBaseAction Mug { get; } = new BaseAction(ActionID.Mug) + public static IBaseAction Huraijin { get; } = new BaseAction(ActionID.Huraijin) { - ActionCheck = b => JobGauge.Ninki <= 60, + ActionCheck = b => HutonEndAfterGCD(), }; - public static IBaseAction TrickAttack { get; } = new BaseAction(ActionID.TrickAttack) + public static IBaseAction PhantomKamaitachi { get; } = new BaseAction(ActionID.PhantomKamaitachi) { - StatusNeed = new StatusID[] { StatusID.Suiton, StatusID.Hidden }, + StatusNeed = new[] { StatusID.PhantomKamaitachiReady }, }; - public static IBaseAction AeolianEdge { get; } = new BaseAction(ActionID.AeolianEdge); - - public static IBaseAction DeathBlossom { get; } = new BaseAction(ActionID.DeathBlossom); - - public static IBaseAction Ten { get; } = new BaseAction(ActionID.Ten, ActionOption.Buff); - - public static IBaseAction Chi { get; } = new BaseAction(ActionID.Chi, ActionOption.Buff); - - public static IBaseAction Jin { get; } = new BaseAction(ActionID.Jin, ActionOption.Buff); - - public static IBaseAction TenChiJin { get; } = new BaseAction(ActionID.TenChiJin) + public static IBaseAction ThrowingDagger { get; } = new BaseAction(ActionID.ThrowingDagger) { - StatusProvide = new[] { StatusID.Kassatsu, StatusID.TenChiJin }, - ActionCheck = b => JobGauge.HutonTimer > 0, + FilterForHostiles = TargetFilter.MeleeRangeTargetFilter, + ActionCheck = b => !IsLastAction(IActionHelper.MovingActions), }; - public static IBaseAction Shukuchi { get; } = new BaseAction(ActionID.Shukuchi); - public static IBaseAction Assassinate { get; } = new BaseAction(ActionID.Assassinate); + public static IBaseAction DreamWithinADream { get; } = new BaseAction(ActionID.DreamWithInADream); - public static IBaseAction Meisui { get; } = new BaseAction(ActionID.Meisui) + public static IBaseAction Bhavacakra { get; } = new BaseAction(ActionID.Bhavacakra) { - StatusNeed = new[] { StatusID.Suiton }, - ActionCheck = b => JobGauge.Ninki <= 50, + ActionCheck = b => Ninki >= 50, }; - public static IBaseAction Kassatsu { get; } = new BaseAction(ActionID.Kassatsu) - { - StatusProvide = TenChiJin.StatusProvide, - }; + #endregion + + #region Attack Area + /// + /// 1 + /// + public static IBaseAction DeathBlossom { get; } = new BaseAction(ActionID.DeathBlossom); + /// + /// 2 + /// public static IBaseAction HakkeMujinsatsu { get; } = new BaseAction(ActionID.HakkeMujinsatsu); - public static IBaseAction ArmorCrush { get; } = new BaseAction(ActionID.ArmorCrush) + public static IBaseAction HellfrogMedium { get; } = new BaseAction(ActionID.HellFrogMedium) { - ActionCheck = b => EndAfter(JobGauge.HutonTimer / 1000f, 29) && JobGauge.HutonTimer > 0, + ActionCheck = Bhavacakra.ActionCheck, }; + #endregion - public static IBaseAction Bunshin { get; } = new BaseAction(ActionID.Bunshin, ActionOption.Buff) + #region Support + public static IBaseAction Meisui { get; } = new BaseAction(ActionID.Meisui) { - ActionCheck = b => Ninki >= 50, + StatusNeed = new[] { StatusID.Suiton }, + ActionCheck = b => JobGauge.Ninki <= 50, }; + public static IBaseAction Hide { get; } = new BaseAction(ActionID.Hide, ActionOption.Buff); + public static IBaseAction ShadeShift { get; } = new BaseAction(ActionID.ShadeShift, ActionOption.Defense); - public static IBaseAction HellfrogMedium { get; } = new BaseAction(ActionID.HellFrogMedium) + public static IBaseAction Mug { get; } = new BaseAction(ActionID.Mug) { - ActionCheck = Bunshin.ActionCheck, + ActionCheck = b => JobGauge.Ninki <= 60, }; - public static IBaseAction Bhavacakra { get; } = new BaseAction(ActionID.Bhavacakra) + public static IBaseAction TrickAttack { get; } = new BaseAction(ActionID.TrickAttack) { - ActionCheck = Bunshin.ActionCheck, + StatusNeed = new StatusID[] { StatusID.Suiton, StatusID.Hidden }, }; - public static IBaseAction PhantomKamaitachi { get; } = new BaseAction(ActionID.PhantomKamaitachi) + public static IBaseAction Bunshin { get; } = new BaseAction(ActionID.Bunshin) { - StatusNeed = new[] { StatusID.PhantomKamaitachiReady }, + ActionCheck = Bhavacakra.ActionCheck, }; + #endregion - public static IBaseAction FleetingRaiju { get; } = new BaseAction(ActionID.FleetingRaiju) - { - StatusNeed = new[] { StatusID.RaijuReady }, - }; - public static IBaseAction ForkedRaiju { get; } = new BaseAction(ActionID.ForkedRaiju) - { - StatusNeed = FleetingRaiju.StatusNeed, - }; + #region Ninjutsu + public static IBaseAction Ten { get; } = new BaseAction(ActionID.Ten, ActionOption.Buff); - public static IBaseAction Huraijin { get; } = new BaseAction(ActionID.Huraijin) + public static IBaseAction Chi { get; } = new BaseAction(ActionID.Chi, ActionOption.Buff); + + public static IBaseAction Jin { get; } = new BaseAction(ActionID.Jin, ActionOption.Buff); + + public static IBaseAction TenChiJin { get; } = new BaseAction(ActionID.TenChiJin) { - ActionCheck = b => JobGauge.HutonTimer == 0, + StatusProvide = new[] { StatusID.Kassatsu, StatusID.TenChiJin }, + ActionCheck = b => !HutonEndAfterGCD(), }; - public static IBaseAction DreamWithinADream { get; } = new BaseAction(ActionID.DreamWithInADream); - public static IBaseAction FumaShurikenTen { get; } = new BaseAction(ActionID.FumaShurikenTen); public static IBaseAction FumaShurikenJin { get; } = new BaseAction(ActionID.FumaShurikenJin); @@ -138,6 +146,22 @@ internal NinAction(ActionID actionID, params IBaseAction[] ninjutsu) public static IBaseAction SuitonJin { get; } = new BaseAction(ActionID.SuitonJin); + public static IBaseAction Kassatsu { get; } = new BaseAction(ActionID.Kassatsu) + { + StatusProvide = TenChiJin.StatusProvide, + }; + + public class NinAction : BaseAction, INinAction + { + public IBaseAction[] Ninjutsu { get; } + + internal NinAction(ActionID actionID, params IBaseAction[] ninjutsu) + : base(actionID) + { + Ninjutsu = ninjutsu; + } + } + public static INinAction RabbitMedium { get; } = new NinAction(ActionID.RabbitMedium); public static INinAction FumaShuriken { get; } = new NinAction(ActionID.FumaShuriken, Ten); @@ -167,26 +191,38 @@ internal NinAction(ActionID actionID, params IBaseAction[] ninjutsu) public static INinAction HyoshoRanryu { get; } = new NinAction(ActionID.HyoshoRanryu, Ten, Jin); + public static IBaseAction FleetingRaiju { get; } = new BaseAction(ActionID.FleetingRaiju) + { + StatusNeed = new[] { StatusID.RaijuReady }, + }; + + public static IBaseAction ForkedRaiju { get; } = new BaseAction(ActionID.ForkedRaiju) + { + StatusNeed = FleetingRaiju.StatusNeed, + }; + #endregion + + public static IBaseAction Shukuchi { get; } = new BaseAction(ActionID.Shukuchi, ActionOption.EndSpecial); + + [RotationDesc(ActionID.Shukuchi)] protected sealed override bool MoveForwardAbility(out IAction act, CanUseOption option = CanUseOption.None) { if (Shukuchi.CanUse(out act, CanUseOption.EmptyOrSkipCombo | option | CanUseOption.IgnoreClippingCheck)) return true; - - return false; + return base.MoveForwardAbility(out act, option); } [RotationDesc(ActionID.Feint)] protected sealed override bool DefenseAreaAbility(out IAction act) { if (Feint.CanUse(out act)) return true; - return false; + return base.DefenseAreaAbility(out act); } [RotationDesc(ActionID.ShadeShift)] protected override bool DefenseSingleAbility(out IAction act) { if (ShadeShift.CanUse(out act)) return true; - - return false; + return DefenseSingleAbility(out act); } } diff --git a/RotationSolver.Basic/Rotations/Basic/PLD_Base.cs b/RotationSolver.Basic/Rotations/Basic/PLD_Base.cs index efd7c40ee..9352a184d 100644 --- a/RotationSolver.Basic/Rotations/Basic/PLD_Base.cs +++ b/RotationSolver.Basic/Rotations/Basic/PLD_Base.cs @@ -2,36 +2,45 @@ namespace RotationSolver.Basic.Rotations.Basic; public abstract class PLD_Base : CustomRotation { - private static PLDGauge JobGauge => Service.JobGauges.Get(); public override MedicineType MedicineType => MedicineType.Strength; - protected static bool HasDivineMight => !Player.WillStatusEndGCD(0, 0, true, StatusID.DivineMight); + public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Paladin, ClassJobID.Gladiator }; - protected static bool HasFightOrFlight => !Player.WillStatusEndGCD(0, 0, true, StatusID.FightOrFlight); + protected override bool CanHealSingleSpell => DataCenter.PartyMembers.Count() == 1 && base.CanHealSingleSpell; - protected static byte OathGauge => JobGauge.OathGauge; + protected override bool CanHealAreaAbility => false; - public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Paladin, ClassJobID.Gladiator }; + protected static bool HasDivineMight => !Player.WillStatusEndGCD(0, 0, true, StatusID.DivineMight); - private sealed protected override IBaseAction TankStance => IronWill; + protected static bool HasFightOrFlight => !Player.WillStatusEndGCD(0, 0, true, StatusID.FightOrFlight); - protected override bool CanHealSingleSpell => DataCenter.PartyMembers.Count() == 1 && base.CanHealSingleSpell; - protected override bool CanHealAreaAbility => false; + #region Job Gauge + private static PLDGauge JobGauge => Service.JobGauges.Get(); - public static IBaseAction IronWill { get; } = new BaseAction(ActionID.IronWill, ActionOption.Friendly); + protected static byte OathGauge => JobGauge.OathGauge; + #endregion + #region Attack Single + /// + /// 1 + /// public static IBaseAction FastBlade { get; } = new BaseAction(ActionID.FastBlade); + /// + /// 2 + /// public static IBaseAction RiotBlade { get; } = new BaseAction(ActionID.RiotBlade); - public static IBaseAction GoringBlade { get; } = new BaseAction(ActionID.GoringBlade); - + /// + /// 3 + /// public static IBaseAction RageOfHalone { get; } = new BaseAction(ActionID.RageOfHalone); - public static IBaseAction ShieldLob { get; } = new BaseAction(ActionID.ShieldLob) + public static IBaseAction GoringBlade { get; } = new BaseAction(ActionID.GoringBlade); + + public static IBaseAction Atonement { get; } = new BaseAction(ActionID.Atonement) { - FilterForHostiles = TargetFilter.TankRangeTarget, - ActionCheck = b => !IsLastAction(IActionHelper.MovingActions), + StatusNeed = new[] { StatusID.SwordOath }, }; public static IBaseAction ShieldBash { get; } = new BaseAction(ActionID.ShieldBash, ActionOption.Timeline) @@ -41,50 +50,68 @@ public abstract class PLD_Base : CustomRotation StatusProvide = new StatusID[] { StatusID.Stun }, }; - public static IBaseAction FightOrFlight { get; } = new BaseAction(ActionID.FightOrFlight, ActionOption.Buff); - - public static IBaseAction TotalEclipse { get; } = new BaseAction(ActionID.TotalEclipse); + public static IBaseAction ShieldLob { get; } = new BaseAction(ActionID.ShieldLob) + { + FilterForHostiles = TargetFilter.TankRangeTarget, + ActionCheck = b => !IsLastAction(IActionHelper.MovingActions), + }; - public static IBaseAction Prominence { get; } = new BaseAction(ActionID.Prominence); + public static IBaseAction HolySpirit { get; } = new BaseAction(ActionID.HolySpirit); - public static IBaseAction Sentinel { get; } = new BaseAction(ActionID.Sentinel, ActionOption.Defense) + public static IBaseAction Intervene { get; } = new BaseAction(ActionID.Intervene, ActionOption.EndSpecial) { - StatusProvide = Rampart.StatusProvide, - ActionCheck = BaseAction.TankDefenseSelf, + ChoiceTarget = TargetFilter.FindTargetForMoving, }; - public static IBaseAction CircleOfScorn { get; } = new BaseAction(ActionID.CircleOfScorn); - public static IBaseAction SpiritsWithin { get; } = new BaseAction(ActionID.SpiritsWithin); - public static IBaseAction HallowedGround { get; } = new BaseAction(ActionID.HallowedGround, ActionOption.Defense); + [Obsolete("Please use SpiritsWithin instead.")] + public static IBaseAction Expiacion { get; } = new BaseAction(ActionID.Expiacion); - public static IBaseAction DivineVeil { get; } = new BaseAction(ActionID.DivineVeil, ActionOption.Defense); + #endregion - public static IBaseAction Clemency { get; } = new BaseAction(ActionID.Clemency, ActionOption.Defense | ActionOption.EndSpecial); + #region Attack Area + /// + /// 1 + /// + public static IBaseAction TotalEclipse { get; } = new BaseAction(ActionID.TotalEclipse); - public static IBaseAction Intervene { get; } = new BaseAction(ActionID.Intervene, ActionOption.EndSpecial) - { - ChoiceTarget = TargetFilter.FindTargetForMoving, - }; + /// + /// 2 + /// + public static IBaseAction Prominence { get; } = new BaseAction(ActionID.Prominence); - public static IBaseAction Atonement { get; } = new BaseAction(ActionID.Atonement) - { - StatusNeed = new[] { StatusID.SwordOath }, - }; + public static IBaseAction CircleOfScorn { get; } = new BaseAction(ActionID.CircleOfScorn); - public static IBaseAction Expiacion { get; } = new BaseAction(ActionID.Expiacion); + public static IBaseAction HolyCircle { get; } = new BaseAction(ActionID.HolyCircle); + public static IBaseAction Confiteor { get; } = new BaseAction(ActionID.Confiteor); + + #endregion + + #region Heal + private sealed protected override IBaseAction TankStance => IronWill; + public static IBaseAction IronWill { get; } = new BaseAction(ActionID.IronWill, ActionOption.Friendly); + #endregion + + #region Support public static IBaseAction Requiescat { get; } = new BaseAction(ActionID.Requiescat, ActionOption.Buff); - public static IBaseAction Confiteor { get; } = new BaseAction(ActionID.Confiteor); + public static IBaseAction FightOrFlight { get; } = new BaseAction(ActionID.FightOrFlight, ActionOption.Buff); - public static IBaseAction HolyCircle { get; } = new BaseAction(ActionID.HolyCircle); + public static IBaseAction HallowedGround { get; } = new BaseAction(ActionID.HallowedGround, ActionOption.Defense); - public static IBaseAction HolySpirit { get; } = new BaseAction(ActionID.HolySpirit); + public static IBaseAction DivineVeil { get; } = new BaseAction(ActionID.DivineVeil, ActionOption.Defense); + + public static IBaseAction Sentinel { get; } = new BaseAction(ActionID.Sentinel, ActionOption.Defense) + { + StatusProvide = Rampart.StatusProvide, + ActionCheck = BaseAction.TankDefenseSelf, + }; public static IBaseAction PassageOfArms { get; } = new BaseAction(ActionID.PassageOfArms, ActionOption.Defense); + public static IBaseAction Cover { get; } = new BaseAction(ActionID.Cover, ActionOption.Defense) { ChoiceTarget = TargetFilter.FindAttackedTarget, @@ -107,6 +134,8 @@ public abstract class PLD_Base : CustomRotation StatusProvide = Rampart.StatusProvide, ActionCheck = BaseAction.TankDefenseSelf, }; + public static IBaseAction Clemency { get; } = new BaseAction(ActionID.Clemency, ActionOption.Defense | ActionOption.EndSpecial); + #endregion protected override bool EmergencyAbility(IAction nextGCD, out IAction act) { @@ -118,13 +147,13 @@ protected override bool EmergencyAbility(IAction nextGCD, out IAction act) protected sealed override bool MoveForwardAbility(out IAction act, CanUseOption option = CanUseOption.None) { if (Intervene.CanUse(out act, CanUseOption.EmptyOrSkipCombo | option | CanUseOption.IgnoreClippingCheck)) return true; - return false; + return base.MoveForwardAbility(out act, option); } [RotationDesc(ActionID.Clemency)] protected sealed override bool HealSingleGCD(out IAction act) { if (Clemency.CanUse(out act)) return true; - return false; + return base.HealSingleGCD(out act); } } \ No newline at end of file diff --git a/RotationSolver.Basic/Rotations/Basic/RDM_Base.cs b/RotationSolver.Basic/Rotations/Basic/RDM_Base.cs index 730197846..0ba4593e5 100644 --- a/RotationSolver.Basic/Rotations/Basic/RDM_Base.cs +++ b/RotationSolver.Basic/Rotations/Basic/RDM_Base.cs @@ -2,9 +2,12 @@ namespace RotationSolver.Basic.Rotations.Basic; public abstract class RDM_Base : CustomRotation { - private static RDMGauge JobGauge => Service.JobGauges.Get(); - public override MedicineType MedicineType => MedicineType.Intelligence; + public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.RedMage }; + protected override bool CanHealSingleSpell => DataCenter.PartyMembers.Count() == 1 && base.CanHealSingleSpell; + + #region Job Gauge + static RDMGauge JobGauge => Service.JobGauges.Get(); protected static byte WhiteMana => JobGauge.WhiteMana; @@ -12,83 +15,73 @@ public abstract class RDM_Base : CustomRotation protected static byte ManaStacks => JobGauge.ManaStacks; - public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.RedMage }; - protected override bool CanHealSingleSpell => DataCenter.PartyMembers.Count() == 1 && base.CanHealSingleSpell; - - private sealed protected override IBaseAction Raise => Verraise; - - public static IBaseAction Verraise { get; } = new BaseAction(ActionID.Verraise, ActionOption.Friendly); + #endregion + #region Attack Single public static IBaseAction Jolt { get; } = new BaseAction(ActionID.Jolt) { StatusProvide = Swiftcast.StatusProvide.Union(new[] { StatusID.Acceleration }).ToArray(), }; - public static IBaseAction Riposte { get; } = new BaseAction(ActionID.Riposte) + public static IBaseAction Verfire { get; } = new BaseAction(ActionID.Verfire) { - ActionCheck = b => JobGauge.BlackMana >= 20 && JobGauge.WhiteMana >= 20, + StatusNeed = new[] { StatusID.VerfireReady }, + StatusProvide = Jolt.StatusProvide, }; - public static IBaseAction Verthunder { get; } = new BaseAction(ActionID.Verthunder) + public static IBaseAction Verstone { get; } = new BaseAction(ActionID.Verstone) { - StatusNeed = Jolt.StatusProvide, + StatusNeed = new[] { StatusID.VerstoneReady }, + StatusProvide = Jolt.StatusProvide, }; - public static IBaseAction CorpsACorps { get; } = new BaseAction(ActionID.CorpsACorps, ActionOption.EndSpecial) - { - ChoiceTarget = TargetFilter.FindTargetForMoving, - }; - public static IBaseAction Veraero { get; } = new BaseAction(ActionID.Veraero) + public static IBaseAction Verthunder { get; } = new BaseAction(ActionID.Verthunder) { StatusNeed = Jolt.StatusProvide, }; - - public static IBaseAction Scatter { get; } = new BaseAction(ActionID.Scatter) + public static IBaseAction Veraero { get; } = new BaseAction(ActionID.Veraero) { StatusNeed = Jolt.StatusProvide, - AOECount = 2, }; - public static IBaseAction Verthunder2 { get; } = new BaseAction(ActionID.Verthunder2) + public static IBaseAction Riposte { get; } = new BaseAction(ActionID.Riposte) { - StatusProvide = Jolt.StatusProvide, + ActionCheck = b => JobGauge.BlackMana >= 20 && JobGauge.WhiteMana >= 20, }; - - public static IBaseAction Veraero2 { get; } = new BaseAction(ActionID.Veraero2) + public static IBaseAction Zwerchhau { get; } = new BaseAction(ActionID.Zwerchhau) { - StatusProvide = Jolt.StatusProvide, + ActionCheck = b => BlackMana >= 15 && WhiteMana >= 15, }; - public static IBaseAction Verfire { get; } = new BaseAction(ActionID.Verfire) + public static IBaseAction Redoublement { get; } = new BaseAction(ActionID.Redoublement) { - StatusNeed = new[] { StatusID.VerfireReady }, - StatusProvide = Jolt.StatusProvide, + ActionCheck = b => BlackMana >= 15 && WhiteMana >= 15, }; - public static IBaseAction Verstone { get; } = new BaseAction(ActionID.Verstone) + public static IBaseAction Engagement { get; } = new BaseAction(ActionID.Engagement); + public static IBaseAction Fleche { get; } = new BaseAction(ActionID.Fleche); + + public static IBaseAction CorpsACorps { get; } = new BaseAction(ActionID.CorpsACorps, ActionOption.EndSpecial) { - StatusNeed = new[] { StatusID.VerstoneReady }, - StatusProvide = Jolt.StatusProvide, + ChoiceTarget = TargetFilter.FindTargetForMoving, }; + #endregion - public static IBaseAction Zwerchhau { get; } = new BaseAction(ActionID.Zwerchhau) + #region Attack Area + public static IBaseAction Scatter { get; } = new BaseAction(ActionID.Scatter) { - ActionCheck = b => BlackMana >= 15 && WhiteMana >= 15, + StatusNeed = Jolt.StatusProvide, + AOECount = 2, }; - - public static IBaseAction Engagement { get; } = new BaseAction(ActionID.Engagement); - - public static IBaseAction Fleche { get; } = new BaseAction(ActionID.Fleche); - - public static IBaseAction Redoublement { get; } = new BaseAction(ActionID.Redoublement) + public static IBaseAction Verthunder2 { get; } = new BaseAction(ActionID.Verthunder2) { - ActionCheck = b => BlackMana >= 15 && WhiteMana >= 15, + StatusProvide = Jolt.StatusProvide, }; - public static IBaseAction Acceleration { get; } = new BaseAction(ActionID.Acceleration, ActionOption.Buff) + public static IBaseAction Veraero2 { get; } = new BaseAction(ActionID.Veraero2) { - StatusProvide = new[] { StatusID.Acceleration }, + StatusProvide = Jolt.StatusProvide, }; public static IBaseAction Moulinet { get; } = new BaseAction(ActionID.Moulinet) @@ -96,46 +89,60 @@ public abstract class RDM_Base : CustomRotation ActionCheck = b => BlackMana >= 20 && WhiteMana >= 20, }; - public static IBaseAction Vercure { get; } = new BaseAction(ActionID.Vercure, ActionOption.Heal) + public static IBaseAction Verflare { get; } = new BaseAction(ActionID.Verflare); + + public static IBaseAction Verholy { get; } = new BaseAction(ActionID.Verholy); + + public static IBaseAction Scorch { get; } = new BaseAction(ActionID.Scorch) { - StatusProvide = Swiftcast.StatusProvide.Union(Acceleration.StatusProvide).ToArray(), + ComboIds = new[] { ActionID.Verholy }, }; + public static IBaseAction Resolution { get; } = new BaseAction(ActionID.Resolution); + public static IBaseAction ContreSixte { get; } = new BaseAction(ActionID.ContreSixte); - public static IBaseAction Embolden { get; } = new BaseAction(ActionID.Embolden, ActionOption.Buff); + #endregion - public static IBaseAction MagickBarrier { get; } = new BaseAction(ActionID.MagickBarrier, ActionOption.Defense); + #region Support + private sealed protected override IBaseAction Raise => Verraise; + public static IBaseAction Verraise { get; } = new BaseAction(ActionID.Verraise, ActionOption.Friendly); - public static IBaseAction Verflare { get; } = new BaseAction(ActionID.Verflare); + public static IBaseAction Vercure { get; } = new BaseAction(ActionID.Vercure, ActionOption.Heal) + { + StatusProvide = Swiftcast.StatusProvide.Union(Acceleration.StatusProvide).ToArray(), + }; - public static IBaseAction Verholy { get; } = new BaseAction(ActionID.Verholy); + public static IBaseAction MagickBarrier { get; } = new BaseAction(ActionID.MagickBarrier, ActionOption.Defense); - public static IBaseAction Scorch { get; } = new BaseAction(ActionID.Scorch) + public static IBaseAction Acceleration { get; } = new BaseAction(ActionID.Acceleration, ActionOption.Buff) { - ComboIds = new[] { ActionID.Verholy }, + StatusProvide = new[] { StatusID.Acceleration }, }; - public static IBaseAction Resolution { get; } = new BaseAction(ActionID.Resolution); + public static IBaseAction Embolden { get; } = new BaseAction(ActionID.Embolden, ActionOption.Buff); public static IBaseAction Manafication { get; } = new BaseAction(ActionID.Manafication) { ActionCheck = b => WhiteMana <= 50 && BlackMana <= 50 && InCombat && ManaStacks == 0, ComboIdsNot = new[] { ActionID.Riposte, ActionID.Zwerchhau, ActionID.Scorch, ActionID.Verflare, ActionID.Verholy }, }; + #endregion + + [RotationDesc(ActionID.Vercure)] protected sealed override bool HealSingleGCD(out IAction act) { if (Vercure.CanUse(out act, CanUseOption.MustUse)) return true; - return false; + return base.HealSingleGCD(out act); } [RotationDesc(ActionID.CorpsACorps)] protected sealed override bool MoveForwardAbility(out IAction act, CanUseOption option = CanUseOption.None) { if (CorpsACorps.CanUse(out act, CanUseOption.EmptyOrSkipCombo | option | CanUseOption.IgnoreClippingCheck)) return true; - return false; + return base.MoveForwardAbility(out act, option); } [RotationDesc(ActionID.Addle, ActionID.MagickBarrier)] @@ -143,6 +150,6 @@ protected sealed override bool DefenseAreaAbility(out IAction act) { if (Addle.CanUse(out act)) return true; if (MagickBarrier.CanUse(out act, CanUseOption.MustUse)) return true; - return false; + return base.DefenseAreaAbility(out act); } } \ No newline at end of file diff --git a/RotationSolver.Basic/Rotations/Basic/RPR_Base.cs b/RotationSolver.Basic/Rotations/Basic/RPR_Base.cs index 4288d0ec1..2f49605c0 100644 --- a/RotationSolver.Basic/Rotations/Basic/RPR_Base.cs +++ b/RotationSolver.Basic/Rotations/Basic/RPR_Base.cs @@ -20,16 +20,6 @@ public abstract class RPR_Base : CustomRotation public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Reaper }; - //public class PRPAction : BaseAction - //{ - // public override EnemyPositional EnemyPositional => Player.HasStatus(true, StatusID.Enshrouded) - // ? EnemyPositional.None : base.EnemyPositional; - // internal PRPAction(ActionID actionID, bool isFriendly = false, bool shouldEndSpecial = false) - // : base(actionID, isFriendly, shouldEndSpecial) - // { - // } - //} - #region Single public static IBaseAction Slice { get; } = new BaseAction(ActionID.Slice) { diff --git a/RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs b/RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs index 32e7769cc..e8e3db1e5 100644 --- a/RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs +++ b/RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs @@ -117,7 +117,7 @@ private IAction Invoke(out IAction gcdAction) return gcdAction; } - else if (gcdAction == null) + else { BaseAction.OtherOption = CanUseOption.IgnoreClippingCheck; if (Ability(Addle, out IAction ability, helpDefenseAOE, helpDefenseSingle)) return ability; @@ -125,7 +125,6 @@ private IAction Invoke(out IAction gcdAction) return null; } - return gcdAction; } protected virtual IAction CountDownAction(float remainTime) => null;