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

Commit

Permalink
fix: add Shield Bash for PLD.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 20, 2023
1 parent 9fd333d commit 3aab72c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>ArchiTed</Authors>
<Version>2.3.3</Version>
<Version>2.3.3.1</Version>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private get
init => _choiceTarget = value;
}

public Func<IEnumerable<BattleChara>, IEnumerable<BattleChara>> FilterForHostiles { private get; init; } = null;
public Func<IEnumerable<BattleChara>, IEnumerable<BattleChara>> FilterForHostiles { get; init; } = null;

public StatusID[] TargetStatus { get; init; } = null;

Expand Down
5 changes: 5 additions & 0 deletions RotationSolver.Basic/Actions/IBaseAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public interface IBaseAction : IAction
/// </summary>
bool IsGeneralGCD { get; }

/// <summary>
/// The filter for hostiles.
/// </summary>
Func<IEnumerable<BattleChara>, IEnumerable<BattleChara>> FilterForHostiles { get; }

/// <summary>
/// Can I use this action at this time. It will check a lot of things.
/// Level, Enabled, Action Status, MP, Player Status, Coll down, Combo, Moving (for casting), Charges, Target, etc.
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Data/ActionID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,8 @@ public enum ActionID : uint

ShieldLob = 24,

ShieldBash = 16,

FightOrFlight = 20,

TotalEclipse = 7381,
Expand Down
6 changes: 6 additions & 0 deletions RotationSolver.Basic/Rotations/Basic/PLD_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public abstract class PLD_Base : CustomRotation
ActionCheck = b => !IsLastAction(IActionHelper.MovingActions),
};

public static IBaseAction ShieldBash { get; } = new BaseAction(ActionID.ShieldBash, ActionOption.Timeline)
{
FilterForHostiles = LowBlow.FilterForHostiles,
ActionCheck = b => LowBlow.IsCoolingDown,
};

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

public static IBaseAction TotalEclipse { get; } = new BaseAction(ActionID.TotalEclipse);
Expand Down
21 changes: 0 additions & 21 deletions RotationSolver.Basic/Rotations/CustomRotation_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,54 +107,33 @@ internal RoleAction(ActionID actionID, JobRole[] roles, ActionOption option = Ac
ActionCheck = BaseAction.TankDefenseSelf,
};

/// <summary>
/// 挑衅
/// </summary>
public static IBaseAction Provoke { get; } = new RoleAction(ActionID.Provoke, new JobRole[] { JobRole.Tank }, ActionOption.Timeline)
{
FilterForHostiles = b => TargetFilter.ProvokeTarget(b),
};

/// <summary>
/// 雪仇
/// </summary>
public static IBaseAction Reprisal { get; } = new RoleAction(ActionID.Reprisal, new JobRole[] { JobRole.Tank }, ActionOption.Defense);

/// <summary>
/// 退避
/// </summary>
public static IBaseAction Shirk { get; } = new RoleAction(ActionID.Shirk, new JobRole[] { JobRole.Tank }, ActionOption.Friendly | ActionOption.Timeline)
{
ChoiceTarget = (friends, mustUse) => TargetFilter.GetJobCategory(friends, JobRole.Tank)?.FirstOrDefault(),
};

/// <summary>
/// 浴血
/// </summary>
public static IBaseAction Bloodbath { get; } = new RoleAction(ActionID.Bloodbath, new JobRole[] { JobRole.Melee }, ActionOption.Heal)
{
ActionCheck = SecondWind.ActionCheck,
};

/// <summary>
/// 牵制
/// </summary>
public static IBaseAction Feint { get; } = new RoleAction(ActionID.Feint, new JobRole[] { JobRole.Melee }, ActionOption.Defense)
{
ActionCheck = b => !b.HasStatus(false, StatusID.Feint),
};

/// <summary>
/// 插言
/// </summary>
public static IBaseAction Interject { get; } = new RoleAction(ActionID.Interject, new JobRole[] { JobRole.Tank })
{
FilterForHostiles = b => b.Where(ObjectHelper.CanInterrupt),
};

/// <summary>
/// 下踢
/// </summary>
public static IBaseAction LowBlow { get; } = new RoleAction(ActionID.LowBlow, new JobRole[] { JobRole.Tank })
{
FilterForHostiles = bs => bs.Where(b =>
Expand Down

0 comments on commit 3aab72c

Please sign in to comment.