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

Commit

Permalink
fix: add an option for bad status check in BaseAction.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 1, 2023
1 parent cf33a39 commit f5bcbe9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public partial class BaseAction

public Func<BattleChara, bool> ActionCheck { get; set; } = null;

protected virtual bool CheckBadStatus => true;

private bool WillCooldown
{
get
Expand Down Expand Up @@ -56,7 +58,7 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO

if (!option.HasFlag(CanUseOption.SkipDisable) && !IsEnabled) return false;

if (ConfigurationHelper.BadStatus.Contains(ActionManager.Instance()->GetActionStatus(ActionType.Spell, AdjustedID)))
if (CheckBadStatus && ConfigurationHelper.BadStatus.Contains(ActionManager.Instance()->GetActionStatus(ActionType.Spell, AdjustedID)))
return false;

if (!EnoughLevel) return false;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class PluginConfiguration : IPluginConfiguration
public Vector3 MovingTargetColor = new(0f, 1f, 0.8f);
public Vector3 TargetColor = new(1f, 0.2f, 0f);
public Vector3 SubTargetColor = new(1f, 0.9f, 0f);
public bool KeyBoardNoise = true;
public bool KeyBoardNoise = false;
public bool UseGroundBeneficialAbility = true;
public bool MoveAreaActionFarthest = true;
public bool StartOnCountdown = true;
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 @@ -1848,6 +1848,8 @@ public enum ActionID : uint
/// </summary>
Ten = 2259,

Ninjutsu = 2260,

/// <summary>
/// 地之印
/// </summary>
Expand Down
11 changes: 5 additions & 6 deletions RotationSolver.Basic/Rotations/Basic/NIN_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
using RotationSolver.Basic.Data;
using RotationSolver.Basic.Helpers;
using RotationSolver.Rotations.CustomRotation;
using static FFXIVClientStructs.FFXIV.Client.UI.Misc.ConfigModule;

namespace RotationSolver.Basic.Rotations.Basic;

public interface INinAction : IBaseAction
{
IBaseAction[] Ninjutsus { get; }
IBaseAction[] Ninjutsu { get; }
}


Expand All @@ -36,11 +35,12 @@ public abstract class NIN_Base : CustomRotation

public class NinAction : BaseAction, INinAction
{
public IBaseAction[] Ninjutsus { get; }
internal NinAction(ActionID actionID, params IBaseAction[] ninjutsus)
protected override bool CheckBadStatus => false;
public IBaseAction[] Ninjutsu { get; }
internal NinAction(ActionID actionID, params IBaseAction[] ninjutsu)
: base(actionID, false, false)
{
Ninjutsus = ninjutsus;
Ninjutsu = ninjutsu;
}
}

Expand Down Expand Up @@ -302,7 +302,6 @@ internal NinAction(ActionID actionID, params IBaseAction[] ninjutsus)
public static INinAction Suiton { get; } = new NinAction(ActionID.Suiton, Ten, Chi, Jin)
{
StatusProvide = new[] { StatusID.Suiton },
ActionCheck = b => TrickAttack.WillHaveOneChargeGCD(1, 1),
};

/// <summary>
Expand Down

0 comments on commit f5bcbe9

Please sign in to comment.