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 no using resouces.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Sep 12, 2023
1 parent 29ea7f9 commit 21aff0b
Show file tree
Hide file tree
Showing 24 changed files with 64 additions and 52 deletions.
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO

if (DataCenter.DisabledActionSequencer != null && DataCenter.DisabledActionSequencer.Contains(ID)) return false;

if (!Service.Config.GetValue(PluginConfigBool.UseResourcesAction) && _option.HasFlag(ActionOption.UseResources)) return false;

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

Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ public enum PluginConfigBool : byte
[Default(false)] HideWarning,

[Default(true)] HealWhenNothingTodo,
[Default(true)] UseResourcesAction,
}

public enum PluginConfigFloat : byte
Expand Down
5 changes: 5 additions & 0 deletions RotationSolver.Basic/Data/ActionOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public enum ActionOption : byte
/// </summary>
HealFlag = 1 << 6,

/// <summary>
/// Is the action a resource taken action.
/// </summary>
UseResources = 1 << 7,

/// <summary>
/// Dot action
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/AST_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public abstract class AST_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Astrodyne { get; } = new BaseAction(ActionID.Astrodyne)
public static IBaseAction Astrodyne { get; } = new BaseAction(ActionID.Astrodyne, ActionOption.UseResources)
{
ActionCheck = (b, m) => !Seals.Contains(SealType.NONE) && IsLongerThan(10),
};
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Rotations/Basic/BLM_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public override bool CanUse(out IAction act, CanUseOption option = CanUseOption.
/// <summary>
///
/// </summary>
public static IBaseAction Xenoglossy { get; } = new BaseAction(ActionID.Xenoglossy)
public static IBaseAction Xenoglossy { get; } = new BaseAction(ActionID.Xenoglossy, ActionOption.UseResources)
{
ActionCheck = (b, m) => PolyglotStacks > 0
};
Expand Down Expand Up @@ -295,7 +295,7 @@ public override bool CanUse(out IAction act, CanUseOption option = CanUseOption.
/// <summary>
///
/// </summary>
public static IBaseAction Foul { get; } = new BaseAction(ActionID.Foul)
public static IBaseAction Foul { get; } = new BaseAction(ActionID.Foul, ActionOption.UseResources)
{
ActionCheck = Xenoglossy.ActionCheck,
};
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/BRD_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ protected static bool SongEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction ApexArrow { get; } = new BaseAction(ActionID.ApexArrow)
public static IBaseAction ApexArrow { get; } = new BaseAction(ActionID.ApexArrow, ActionOption.UseResources)
{
ActionCheck = (b, m) => SoulVoice >= 20 && !Player.HasStatus(true, StatusID.BlastArrowReady),
};
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver.Basic/Rotations/Basic/DNC_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public abstract class DNC_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction FanDance { get; } = new BaseAction(ActionID.FanDance)
public static IBaseAction FanDance { get; } = new BaseAction(ActionID.FanDance, ActionOption.UseResources)
{
ActionCheck = (b, m) => Feathers > 0,
StatusProvide = new[] { StatusID.ThreefoldFanDance },
Expand Down Expand Up @@ -122,7 +122,7 @@ public abstract class DNC_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction FanDance2 { get; } = new BaseAction(ActionID.FanDance2)
public static IBaseAction FanDance2 { get; } = new BaseAction(ActionID.FanDance2, ActionOption.UseResources)
{
ActionCheck = (b, m) => Feathers > 0,
StatusProvide = new[] { StatusID.ThreefoldFanDance },
Expand All @@ -147,7 +147,7 @@ public abstract class DNC_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction SaberDance { get; } = new BaseAction(ActionID.SaberDance)
public static IBaseAction SaberDance { get; } = new BaseAction(ActionID.SaberDance, ActionOption.UseResources)
{
ActionCheck = (b, m) => Esprit >= 50,
};
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/DRG_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected static bool LOTDEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction WyrmwindThrust { get; } = new BaseAction(ActionID.WyrmwindThrust)
public static IBaseAction WyrmwindThrust { get; } = new BaseAction(ActionID.WyrmwindThrust, ActionOption.UseResources)
{
ActionCheck = (b, m) => FocusCount == 2,
};
Expand Down
8 changes: 4 additions & 4 deletions RotationSolver.Basic/Rotations/Basic/GNB_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ public abstract class GNB_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction BurstStrike { get; } = new BaseAction(ActionID.BurstStrike)
public static IBaseAction BurstStrike { get; } = new BaseAction(ActionID.BurstStrike, ActionOption.UseResources)
{
ActionCheck = (b, m) => Ammo > 0,
};

/// <summary>
///
/// </summary>
public static IBaseAction GnashingFang { get; } = new BaseAction(ActionID.GnashingFang)
public static IBaseAction GnashingFang { get; } = new BaseAction(ActionID.GnashingFang, ActionOption.UseResources)
{
ActionCheck = (b, m) => AmmoComboStep == 0 && Ammo > 0,
};
Expand Down Expand Up @@ -170,15 +170,15 @@ public abstract class GNB_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction FatedCircle { get; } = new BaseAction(ActionID.FatedCircle)
public static IBaseAction FatedCircle { get; } = new BaseAction(ActionID.FatedCircle, ActionOption.UseResources)
{
ActionCheck = (b, m) => Ammo > 0,
};

/// <summary>
///
/// </summary>
public static IBaseAction DoubleDown { get; } = new BaseAction(ActionID.DoubleDown)
public static IBaseAction DoubleDown { get; } = new BaseAction(ActionID.DoubleDown, ActionOption.UseResources)
{
ActionCheck = (b, m) => Ammo > 1,
};
Expand Down
8 changes: 4 additions & 4 deletions RotationSolver.Basic/Rotations/Basic/MCH_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ protected static bool OverheatedEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction RookAutoturret { get; } = new BaseAction(ActionID.RookAutoturret)
public static IBaseAction RookAutoturret { get; } = new BaseAction(ActionID.RookAutoturret, ActionOption.UseResources)
{
ActionCheck = (b, m) => JobGauge.Battery >= 50 && !JobGauge.IsRobotActive,
ActionCheck = (b, m) => Battery >= 50 && !JobGauge.IsRobotActive,
};
#endregion

Expand All @@ -163,9 +163,9 @@ protected static bool OverheatedEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction Hypercharge { get; } = new BaseAction(ActionID.Hypercharge)
public static IBaseAction Hypercharge { get; } = new BaseAction(ActionID.Hypercharge, ActionOption.UseResources)
{
ActionCheck = (b, m) => !JobGauge.IsOverheated && JobGauge.Heat >= 50
ActionCheck = (b, m) => !IsOverheated && Heat >= 50
&& IsLongerThan(8),
};

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/MNK_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public abstract class MNK_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction SteelPeak { get; } = new BaseAction(ActionID.SteelPeak)
public static IBaseAction SteelPeak { get; } = new BaseAction(ActionID.SteelPeak, ActionOption.UseResources)
{
ActionCheck = (b, m) => InCombat && Chakra == 5,
};
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/NIN_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected static bool HutonEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction Bhavacakra { get; } = new BaseAction(ActionID.Bhavacakra)
public static IBaseAction Bhavacakra { get; } = new BaseAction(ActionID.Bhavacakra, ActionOption.UseResources)
{
ActionCheck = (b, m) => Ninki >= 50,
};
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Rotations/Basic/PLD_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public abstract class PLD_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Cover { get; } = new BaseAction(ActionID.Cover, ActionOption.Defense)
public static IBaseAction Cover { get; } = new BaseAction(ActionID.Cover, ActionOption.Defense | ActionOption.UseResources)
{
ChoiceTarget = TargetFilter.FindAttackedTarget,
ActionCheck = (b, m) => OathGauge >= 50,
Expand All @@ -210,7 +210,7 @@ public abstract class PLD_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Intervention { get; } = new BaseAction(ActionID.Intervention, ActionOption.Defense)
public static IBaseAction Intervention { get; } = new BaseAction(ActionID.Intervention, ActionOption.Defense | ActionOption.UseResources)
{
ActionCheck = Cover.ActionCheck,
ChoiceTarget = TargetFilter.FindAttackedTarget,
Expand Down
10 changes: 5 additions & 5 deletions RotationSolver.Basic/Rotations/Basic/RDM_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,23 @@ public abstract class RDM_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Riposte { get; } = new BaseAction(ActionID.Riposte)
public static IBaseAction Riposte { get; } = new BaseAction(ActionID.Riposte, ActionOption.UseResources)
{
ActionCheck = (b, m) => JobGauge.BlackMana >= 20 && JobGauge.WhiteMana >= 20,
ActionCheck = (b, m) => BlackMana >= 20 && WhiteMana >= 20,
};

/// <summary>
///
/// </summary>
public static IBaseAction Zwerchhau { get; } = new BaseAction(ActionID.Zwerchhau)
public static IBaseAction Zwerchhau { get; } = new BaseAction(ActionID.Zwerchhau, ActionOption.UseResources)
{
ActionCheck = (b, m) => BlackMana >= 15 && WhiteMana >= 15,
};

/// <summary>
///
/// </summary>
public static IBaseAction Redoublement { get; } = new BaseAction(ActionID.Redoublement)
public static IBaseAction Redoublement { get; } = new BaseAction(ActionID.Redoublement, ActionOption.UseResources)
{
ActionCheck = (b, m) => BlackMana >= 15 && WhiteMana >= 15,
};
Expand Down Expand Up @@ -157,7 +157,7 @@ public abstract class RDM_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Moulinet { get; } = new BaseAction(ActionID.Moulinet)
public static IBaseAction Moulinet { get; } = new BaseAction(ActionID.Moulinet, ActionOption.UseResources)
{
ActionCheck = (b, m) => BlackMana >= 20 && WhiteMana >= 20,
};
Expand Down
8 changes: 4 additions & 4 deletions RotationSolver.Basic/Rotations/Basic/RPR_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public abstract class RPR_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction BloodStalk { get; } = new BaseAction(ActionID.BloodStalk)
public static IBaseAction BloodStalk { get; } = new BaseAction(ActionID.BloodStalk, ActionOption.UseResources)
{
StatusProvide = new[] { StatusID.SoulReaver },
ActionCheck = (b, m) => Slice.ActionCheck(b, m) && Soul >= 50
Expand All @@ -170,7 +170,7 @@ public abstract class RPR_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction GrimSwathe { get; } = new BaseAction(ActionID.GrimSwathe)
public static IBaseAction GrimSwathe { get; } = new BaseAction(ActionID.GrimSwathe, ActionOption.UseResources)
{
StatusProvide = new[] { StatusID.SoulReaver },
ActionCheck = BloodStalk.ActionCheck,
Expand All @@ -179,7 +179,7 @@ public abstract class RPR_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Gluttony { get; } = new BaseAction(ActionID.Gluttony)
public static IBaseAction Gluttony { get; } = new BaseAction(ActionID.Gluttony, ActionOption.UseResources)
{
StatusProvide = new[] { StatusID.SoulReaver },
ActionCheck = BloodStalk.ActionCheck,
Expand Down Expand Up @@ -210,7 +210,7 @@ public abstract class RPR_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Enshroud { get; } = new BaseAction(ActionID.Enshroud)
public static IBaseAction Enshroud { get; } = new BaseAction(ActionID.Enshroud, ActionOption.UseResources)
{
StatusProvide = new[] { StatusID.Enshrouded },
ActionCheck = (b, m) => Shroud >= 50 && Slice.ActionCheck(b, m)
Expand Down
8 changes: 4 additions & 4 deletions RotationSolver.Basic/Rotations/Basic/SAM_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static bool IsMoonTimeLessThanFlower
/// <summary>
///
/// </summary>
public static IBaseAction Higanbana { get; } = new BaseAction(ActionID.Higanbana, ActionOption.Dot)
public static IBaseAction Higanbana { get; } = new BaseAction(ActionID.Higanbana, ActionOption.Dot | ActionOption.UseResources)
{
ActionCheck = (b, m) => !IsMoving && SenCount == 1,
TargetStatus = new[] { StatusID.Higanbana },
Expand All @@ -181,15 +181,15 @@ public static bool IsMoonTimeLessThanFlower
/// <summary>
///
/// </summary>
public static IBaseAction TenkaGoken { get; } = new BaseAction(ActionID.TenkaGoken)
public static IBaseAction TenkaGoken { get; } = new BaseAction(ActionID.TenkaGoken, ActionOption.UseResources)
{
ActionCheck = (b, m) => !IsMoving && SenCount == 2,
};

/// <summary>
///
/// </summary>
public static IBaseAction MidareSetsugekka { get; } = new BaseAction(ActionID.MidareSetsugekka)
public static IBaseAction MidareSetsugekka { get; } = new BaseAction(ActionID.MidareSetsugekka , ActionOption.UseResources)
{
ActionCheck = (b, m) => !IsMoving && SenCount == 3,
};
Expand Down Expand Up @@ -243,7 +243,7 @@ public static bool IsMoonTimeLessThanFlower
/// <summary>
///
/// </summary>
public static IBaseAction Hagakure { get; } = new BaseAction(ActionID.Hagakure)
public static IBaseAction Hagakure { get; } = new BaseAction(ActionID.Hagakure, ActionOption.UseResources)
{
ActionCheck = (b, m) => SenCount > 0
};
Expand Down
10 changes: 5 additions & 5 deletions RotationSolver.Basic/Rotations/Basic/SCH_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,31 @@ public abstract class SCH_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Lustrate { get; } = new BaseAction(ActionID.Lustrate, ActionOption.Heal)
public static IBaseAction Lustrate { get; } = new BaseAction(ActionID.Lustrate, ActionOption.Heal | ActionOption.UseResources)
{
ActionCheck = (b, m) => HasAetherflow
};

/// <summary>
///
/// </summary>
public static IBaseAction SacredSoil { get; } = new BaseAction(ActionID.SacredSoil, ActionOption.Heal)
public static IBaseAction SacredSoil { get; } = new BaseAction(ActionID.SacredSoil, ActionOption.Heal | ActionOption.UseResources)
{
ActionCheck = (b, m) => HasAetherflow && !IsMoving,
};

/// <summary>
///
/// </summary>
public static IBaseAction Indomitability { get; } = new BaseAction(ActionID.Indomitability, ActionOption.Heal)
public static IBaseAction Indomitability { get; } = new BaseAction(ActionID.Indomitability, ActionOption.Heal | ActionOption.UseResources)
{
ActionCheck = (b, m) => HasAetherflow
};

/// <summary>
///
/// </summary>
public static IBaseAction Excogitation { get; } = new BaseAction(ActionID.Excogitation, ActionOption.Heal)
public static IBaseAction Excogitation { get; } = new BaseAction(ActionID.Excogitation, ActionOption.Heal | ActionOption.UseResources)
{
ActionCheck = (b, m) => HasAetherflow
};
Expand Down Expand Up @@ -141,7 +141,7 @@ public abstract class SCH_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction EnergyDrain { get; } = new BaseAction(ActionID.EnergyDrain)
public static IBaseAction EnergyDrain { get; } = new BaseAction(ActionID.EnergyDrain, ActionOption.UseResources)
{
ActionCheck = (b, m) => HasAetherflow
};
Expand Down
8 changes: 4 additions & 4 deletions RotationSolver.Basic/Rotations/Basic/SGE_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ protected static bool AddersgallEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction Kerachole { get; } = new BaseAction(ActionID.Kerachole, ActionOption.Heal)
public static IBaseAction Kerachole { get; } = new BaseAction(ActionID.Kerachole, ActionOption.Heal | ActionOption.UseResources)
{
ActionCheck = (b, m) => Addersgall > 0,
};

/// <summary>
///
/// </summary>
public static IBaseAction Ixochole { get; } = new BaseAction(ActionID.Ixochole, ActionOption.Heal)
public static IBaseAction Ixochole { get; } = new BaseAction(ActionID.Ixochole, ActionOption.Heal | ActionOption.UseResources)
{
ActionCheck = (b, m) => Addersgall > 0,
};
Expand All @@ -206,7 +206,7 @@ protected static bool AddersgallEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction Taurochole { get; } = new BaseAction(ActionID.Taurochole, ActionOption.Heal)
public static IBaseAction Taurochole { get; } = new BaseAction(ActionID.Taurochole, ActionOption.Heal | ActionOption.UseResources)
{
ChoiceTarget = TargetFilter.FindAttackedTarget,
ActionCheck = (b, m) => Addersgall > 0,
Expand All @@ -215,7 +215,7 @@ protected static bool AddersgallEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction Druochole { get; } = new BaseAction(ActionID.Druochole, ActionOption.Heal)
public static IBaseAction Druochole { get; } = new BaseAction(ActionID.Druochole, ActionOption.Heal | ActionOption.UseResources)
{
ActionCheck = (b, m) => Addersgall > 0,
};
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/SMN_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public override void DisplayStatus()
/// <summary>
///
/// </summary>
public static IBaseAction Fester { get; } = new BaseAction(ActionID.Fester)
public static IBaseAction Fester { get; } = new BaseAction(ActionID.Fester, ActionOption.UseResources)
{
ActionCheck = (b, m) => HasAetherflowStacks
};
Expand Down
Loading

0 comments on commit 21aff0b

Please sign in to comment.