Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: format some base files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 22, 2023
1 parent bc9b86d commit a7ac0d1
Show file tree
Hide file tree
Showing 7 changed files with 343 additions and 241 deletions.
71 changes: 50 additions & 21 deletions RotationSolver.Basic/Rotations/Basic/MCH_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,49 @@ namespace RotationSolver.Basic.Rotations.Basic;

public abstract class MCH_Base : CustomRotation
{
private static MCHGauge JobGauge => Service.JobGauges.Get<MCHGauge>();

public override MedicineType MedicineType => MedicineType.Dexterity;

public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Machinist };

#region Job Gauge
static MCHGauge JobGauge => Service.JobGauges.Get<MCHGauge>();

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
/// <summary>
/// 1
/// </summary>
public static IBaseAction SplitShot { get; } = new BaseAction(ActionID.SplitShot);

/// <summary>
/// 2
/// </summary>
public static IBaseAction SlugShot { get; } = new BaseAction(ActionID.SlugShot)
{
ComboIds = new[] { ActionID.HeatedSplitShot },
};

/// <summary>
/// 3
/// </summary>
public static IBaseAction CleanShot { get; } = new BaseAction(ActionID.CleanShot)
{
ComboIds = new[] { ActionID.HeatedSlugShot },
Expand All @@ -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
/// <summary>
/// 1
/// </summary>
public static IBaseAction SpreadShot { get; } = new BaseAction(ActionID.SpreadShot);

/// <summary>
/// 2
/// </summary>
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 },
Expand All @@ -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,
Expand All @@ -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)
Expand Down
98 changes: 55 additions & 43 deletions RotationSolver.Basic/Rotations/Basic/MNK_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,122 +2,134 @@ namespace RotationSolver.Basic.Rotations.Basic;

public abstract class MNK_Base : CustomRotation
{
private static MNKGauge JobGauge => Service.JobGauges.Get<MNKGauge>();

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<MNKGauge>();

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);
}
}
Loading

0 comments on commit a7ac0d1

Please sign in to comment.