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

Commit

Permalink
fix: format all base files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 22, 2023
1 parent 6625e29 commit 051b4b2
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 150 deletions.
7 changes: 7 additions & 0 deletions RotationSolver.Basic/Helpers/StatusHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ public static bool WillStatusEnd(this BattleChara obj, float time, bool isFromSe
return CooldownHelper.RecastAfter(remain, time);
}

/// <summary>
/// Please Do NOT use it!
/// </summary>
/// <param name="obj"></param>
/// <param name="isFromSelf"></param>
/// <param name="statusIDs"></param>
/// <returns></returns>
[EditorBrowsable(EditorBrowsableState.Never)]
public static float StatusTime(this BattleChara obj, bool isFromSelf, params StatusID[] statusIDs)
{
Expand Down
54 changes: 30 additions & 24 deletions RotationSolver.Basic/Rotations/Basic/RPR_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

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

public override MedicineType MedicineType => MedicineType.Strength;
public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Reaper };
protected static bool Enshrouded => Player.HasStatus(true, StatusID.Enshrouded);

protected static bool SoulReaver => Player.HasStatus(true, StatusID.SoulReaver);

#region JobGauge
static RPRGauge JobGauge => Service.JobGauges.Get<RPRGauge>();

protected static byte Soul => JobGauge.Soul;

Expand All @@ -13,30 +18,34 @@ public abstract class RPR_Base : CustomRotation
protected static byte LemureShroud => JobGauge.LemureShroud;

protected static byte VoidShroud => JobGauge.VoidShroud;
#endregion

protected static bool Enshrouded => Player.HasStatus(true, StatusID.Enshrouded);

protected static bool SoulReaver => Player.HasStatus(true, StatusID.SoulReaver);

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

#region Single
#region Attack Single
/// <summary>
/// 1
/// </summary>
public static IBaseAction Slice { get; } = new BaseAction(ActionID.Slice)
{
ActionCheck = b => !Enshrouded && !SoulReaver,
};

/// <summary>
/// 2
/// </summary>
public static IBaseAction WaxingSlice { get; } = new BaseAction(ActionID.WaxingSlice)
{
ActionCheck = Slice.ActionCheck,
};

/// <summary>
/// 3
/// </summary>
public static IBaseAction InfernalSlice { get; } = new BaseAction(ActionID.InfernalSlice)
{
ActionCheck = Slice.ActionCheck,
};

public static IBaseAction ShadowOfDeath { get; } = new BaseAction(ActionID.ShadowOfDeath, ActionOption.Dot)
public static IBaseAction ShadowOfDeath { get; } = new BaseAction(ActionID.ShadowOfDeath, ActionOption.Dot)
{
TargetStatus = new[] { StatusID.DeathsDesign },
ActionCheck = b => !SoulReaver,
Expand All @@ -48,12 +57,18 @@ public abstract class RPR_Base : CustomRotation
};
#endregion

#region AoE
#region Attack Area
/// <summary>
/// 1
/// </summary>
public static IBaseAction SpinningScythe { get; } = new BaseAction(ActionID.SpinningScythe)
{
ActionCheck = Slice.ActionCheck,
};

/// <summary>
/// 2
/// </summary>
public static IBaseAction NightmareScythe { get; } = new BaseAction(ActionID.NightmareScythe)
{
ActionCheck = Slice.ActionCheck,
Expand Down Expand Up @@ -199,29 +214,20 @@ public abstract class RPR_Base : CustomRotation
protected sealed override bool MoveForwardAbility(out IAction act)
{
if (HellsIngress.CanUse(out act)) return true;
return false;
return base.MoveForwardAbility(out act);
}

[RotationDesc(ActionID.Feint)]
protected sealed override bool DefenseAreaAbility(out IAction act)
{
if (!SoulReaver && !Enshrouded)
{
if (Feint.CanUse(out act)) return true;
}

act = null;
return false;
if (!SoulReaver && !Enshrouded && Feint.CanUse(out act)) return true;
return base.DefenseAreaAbility(out act);
}

[RotationDesc(ActionID.ArcaneCrest)]
protected override bool DefenseSingleAbility(out IAction act)
{
if (!SoulReaver && !Enshrouded)
{
if (ArcaneCrest.CanUse(out act)) return true;
}

if (!SoulReaver && !Enshrouded && ArcaneCrest.CanUse(out act)) return true;
return base.DefenseSingleAbility(out act);
}
}
30 changes: 18 additions & 12 deletions RotationSolver.Basic/Rotations/Basic/SAM_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@ namespace RotationSolver.Basic.Rotations.Basic;

public abstract class SAM_Base : CustomRotation
{
private static SAMGauge JobGauge => Service.JobGauges.Get<SAMGauge>();
public override MedicineType MedicineType => MedicineType.Strength;
public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Samurai };

[Obsolete("Please use HasMoon", true)]
protected static bool HaveMoon => HasMoon;
protected static bool HasMoon => Player.HasStatus(true, StatusID.Fugetsu);

[Obsolete("Please use HasFlower", true)]
protected static bool HaveFlower => HasFlower;
protected static bool HasFlower => Player.HasStatus(true, StatusID.Fuka);

#region JobGauge
static SAMGauge JobGauge => Service.JobGauges.Get<SAMGauge>();

protected static bool HasSetsu => JobGauge.HasSetsu;

Expand All @@ -15,16 +26,11 @@ public abstract class SAM_Base : CustomRotation

protected static byte MeditationStacks => JobGauge.MeditationStacks;

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

protected static byte SenCount => (byte)((HasGetsu ? 1 : 0) + (HasSetsu ? 1 : 0) + (HasKa ? 1 : 0));
#endregion

protected static bool HaveMoon => Player.HasStatus(true, StatusID.Fugetsu);
protected static float MoonTime => Player.StatusTime(true, StatusID.Fugetsu);
protected static bool HaveFlower => Player.HasStatus(true, StatusID.Fuka);
protected static float FlowerTime => Player.StatusTime(true, StatusID.Fuka);

#region Single
#region Attack Single
public static IBaseAction Hakaze { get; } = new BaseAction(ActionID.Hakaze);

public static IBaseAction Jinpu { get; } = new BaseAction(ActionID.Jinpu);
Expand All @@ -43,7 +49,7 @@ public abstract class SAM_Base : CustomRotation
};
#endregion

#region AoE
#region Attack Area
public static IBaseAction Fuga { get; } = new BaseAction(ActionID.Fuga);

public static IBaseAction Fuko { get; } = new BaseAction(ActionID.Fuko);
Expand Down Expand Up @@ -172,20 +178,20 @@ public abstract class SAM_Base : CustomRotation
protected sealed override bool MoveForwardAbility(out IAction act)
{
if (HissatsuGyoten.CanUse(out act)) return true;
return false;
return base.MoveForwardAbility(out act);
}

[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.ThirdEye)]
protected override bool DefenseSingleAbility(out IAction act)
{
if (ThirdEye.CanUse(out act)) return true;
return false;
return base.DefenseSingleAbility(out act);
}
}
13 changes: 7 additions & 6 deletions RotationSolver.Basic/Rotations/Basic/SCH_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ namespace RotationSolver.Basic.Rotations.Basic;

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

public override MedicineType MedicineType => MedicineType.Mind;

protected static byte FairyGauge => JobGauge.FairyGauge;

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

private sealed protected override IBaseAction Raise => Resurrection;
#region Job Gauge
static SCHGauge JobGauge => Service.JobGauges.Get<SCHGauge>();

protected static byte FairyGauge => JobGauge.FairyGauge;

protected static bool HasAetherflow => JobGauge.Aetherflow > 0;

protected static bool HasSeraph => JobGauge.SeraphTimer > 0;
#endregion

#region Heal
private sealed protected override IBaseAction Raise => Resurrection;

public static IBaseAction Physick { get; } = new BaseAction(ActionID.Physick, ActionOption.Heal);

public static IBaseAction Adloquium { get; } = new BaseAction(ActionID.Adloquium, ActionOption.Heal)
Expand Down
Loading

0 comments on commit 051b4b2

Please sign in to comment.