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

Commit

Permalink
fix: add duty action.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 29, 2023
1 parent 4fa7f26 commit 47d35f6
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 7 deletions.
10 changes: 10 additions & 0 deletions RotationSolver.Basic/Actions/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ public partial class BaseAction : IBaseAction
/// </summary>
public bool IsRealGCD => _option.HasFlag(ActionOption.RealGCD);

/// <summary>
/// Is this action a duty action.
/// </summary>
public bool IsDutyAction => _option.HasFlag(ActionOption.DutyAction);

/// <summary>
/// Is this duty action on the slot.
/// </summary>
public bool IsDutyActionOnSlot => ActionManager.GetDutyActionId(0) == AdjustedID || ActionManager.GetDutyActionId(1) == AdjustedID;

/// <summary>
/// How many gcd left to add the dot.
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions RotationSolver.Basic/Actions/IBaseAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ public interface IBaseAction : IAction
/// </summary>
Func<IEnumerable<BattleChara>, IEnumerable<BattleChara>> FilterForHostiles { get; }

/// <summary>
/// Is this action a duty action.
/// </summary>
bool IsDutyAction { get; }

/// <summary>
/// Is this duty action on the slot.
/// </summary>
bool IsDutyActionOnSlot { 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
5 changes: 5 additions & 0 deletions RotationSolver.Basic/Data/ActionOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public enum ActionOption : byte
/// </summary>
RealGCD = 1 << 4,

/// <summary>
/// The duty action
/// </summary>
DutyAction = 1 << 5,

/// <summary>
/// Dot action
/// </summary>
Expand Down
8 changes: 4 additions & 4 deletions RotationSolver.Basic/Rotations/CustomRotation_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,19 @@ internal RoleAction(ActionID actionID, JobRole[] roles, ActionOption option = Ac
///
/// </summary>
public static IBaseAction VariantRaise { get; } = new RoleAction(ActionID.VariantRaise,
new JobRole[] { JobRole.Melee, JobRole.Tank, JobRole.Ranged }, ActionOption.Friendly);
new JobRole[] { JobRole.Melee, JobRole.Tank, JobRole.Ranged }, ActionOption.Friendly | ActionOption.DutyAction);

/// <summary>
///
/// </summary>
public static IBaseAction VariantCure { get; } = new RoleAction(ActionID.VariantCure,
new JobRole[] { JobRole.Melee, JobRole.Tank, JobRole.Ranged }, ActionOption.Heal);
new JobRole[] { JobRole.Melee, JobRole.Tank, JobRole.Ranged }, ActionOption.Heal | ActionOption.DutyAction);

/// <summary>
///
/// </summary>
public static IBaseAction VariantSpiritDart { get; } = new RoleAction(ActionID.VariantSpiritDart,
new JobRole[] { JobRole.Healer, JobRole.Tank }, ActionOption.Dot)
new JobRole[] { JobRole.Healer, JobRole.Tank }, ActionOption.Dot | ActionOption.DutyAction)
{
TargetStatus = new StatusID[] { StatusID.VariantSpiritDart },
};
Expand All @@ -240,7 +240,7 @@ internal RoleAction(ActionID actionID, JobRole[] roles, ActionOption option = Ac
///
/// </summary>
public static IBaseAction VariantRampart { get; } = new RoleAction(ActionID.VariantRampart,
new JobRole[] { JobRole.Melee, JobRole.Healer, JobRole.Ranged }, ActionOption.Buff);
new JobRole[] { JobRole.Melee, JobRole.Healer, JobRole.Ranged }, ActionOption.Buff | ActionOption.DutyAction);
#endregion

IBaseAction[] _allBaseActions;
Expand Down
2 changes: 0 additions & 2 deletions RotationSolver/UI/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ private void DrawLastAction()

private unsafe void DrawIcon()
{
ImGui.Text(ActionManager.GetDutyActionId(0).ToString());
ImGui.Text(ActionManager.GetDutyActionId(1).ToString());
//if(ImGui.BeginTable("BLUAction", 4, ImGuiTableFlags.Borders | ImGuiTableFlags.Resizable | ImGuiTableFlags.SizingFixedFit))
//{
// foreach (var item in Svc.Data.GetExcelSheet<Lumina.Excel.GeneratedSheets.Action>())
Expand Down
11 changes: 10 additions & 1 deletion RotationSolver/Updaters/RotationUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,15 @@ public static IEnumerable<IGrouping<string, IAction>> AllGroupedActions
{
string result;

if (act.IsDutyAction)
{
#if DEBUG
return "Duty Action";
#else
return act.IsDutyActionOnSlot ? "Duty Action" : string.Empty;
#endif
}

if (act.IsRealGCD)
{
result = "GCD";
Expand Down Expand Up @@ -396,7 +405,7 @@ public static IEnumerable<IGrouping<string, IAction>> AllGroupedActions
}
return string.Empty;

}).OrderBy(g => g.Key);
}).Where(g => !string.IsNullOrEmpty(g.Key)).OrderBy(g => g.Key);

public static void UpdateRotation()
{
Expand Down

0 comments on commit 47d35f6

Please sign in to comment.