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

Commit

Permalink
fix: fixed the case of no gcd.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 29, 2023
1 parent 04b9fac commit 4fa7f26
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 70 deletions.
6 changes: 3 additions & 3 deletions RotationSolver.Basic/Actions/BaseAction_Cooldown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public bool WillHaveOneCharge(float remain)

unsafe RecastDetail* CoolDownDetail => ActionManager.Instance()->GetRecastGroupDetail(CoolDownGroup - 1);

private unsafe float RecastTime => CoolDownDetail->Total;
private unsafe float RecastTime => CoolDownDetail == null ? 0 : CoolDownDetail->Total;

/// <summary>
///
Expand All @@ -69,12 +69,12 @@ public bool WillHaveOneCharge(float remain)
///
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public unsafe float RecastTimeElapsedRaw => CoolDownDetail->Elapsed;
public unsafe float RecastTimeElapsedRaw => CoolDownDetail == null ? 0 : CoolDownDetail->Elapsed;

/// <summary>
///
/// </summary>
public unsafe bool IsCoolingDown => CoolDownDetail->IsActive != 0;
public unsafe bool IsCoolingDown => CoolDownDetail == null ? false : CoolDownDetail->IsActive != 0;

private float RecastTimeRemain => RecastTime - RecastTimeElapsedRaw;

Expand Down
37 changes: 22 additions & 15 deletions RotationSolver.Basic/Data/ActionID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,6 @@ public enum ActionID : uint
Spire = 4406,
#endregion


#region VariantActions

VariantRaise = 29731,

VariantCure = 29729,

VariantSpiritDart = 29732,

VariantRampart = 29733

#endregion



#region BlackMage
/// <summary>
///
Expand Down Expand Up @@ -3576,4 +3561,26 @@ public enum ActionID : uint
/// </summary>
Sprint = 3,
#endregion

#region VariantActions
/// <summary>
///
/// </summary>
VariantRaise = 29731,

/// <summary>
///
/// </summary>
VariantCure = 29729,

/// <summary>
///
/// </summary>
VariantSpiritDart = 29732,

/// <summary>
///
/// </summary>
VariantRampart = 29733,
#endregion
}
80 changes: 29 additions & 51 deletions RotationSolver.Basic/Rotations/CustomRotation_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,6 @@ internal RoleAction(ActionID actionID, JobRole[] roles, ActionOption option = Ac
internal bool InRole(JobRole role) => _roles.Contains(role);
}

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

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

/// <summary>
///
/// </summary>
public static IBaseAction VariantSpiritDart {
get;
} = new RoleAction(ActionID.VariantSpiritDart, new JobRole[] {
JobRole.Healer,
JobRole.Tank
},
ActionOption.Dot) {
TargetStatus = new StatusID[] {
StatusID.VariantSpiritDart
}
};

/// <summary>
///
/// </summary>
public static IBaseAction VariantRampart {
get;
} = new RoleAction(ActionID.VariantRampart, new JobRole[] {
JobRole.Melee,
JobRole.Healer,
JobRole.Ranged
},
ActionOption.Buff);

/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -265,6 +214,35 @@ public static IBaseAction VariantRampart {
private protected virtual IBaseAction Raise => null;
private protected virtual IBaseAction TankStance => null;

#region Duty Action
/// <summary>
///
/// </summary>
public static IBaseAction VariantRaise { get; } = new RoleAction(ActionID.VariantRaise,
new JobRole[] { JobRole.Melee, JobRole.Tank, JobRole.Ranged }, ActionOption.Friendly);

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

/// <summary>
///
/// </summary>
public static IBaseAction VariantSpiritDart { get; } = new RoleAction(ActionID.VariantSpiritDart,
new JobRole[] { JobRole.Healer, JobRole.Tank }, ActionOption.Dot)
{
TargetStatus = new StatusID[] { StatusID.VariantSpiritDart },
};

/// <summary>
///
/// </summary>
public static IBaseAction VariantRampart { get; } = new RoleAction(ActionID.VariantRampart,
new JobRole[] { JobRole.Melee, JobRole.Healer, JobRole.Ranged }, ActionOption.Buff);
#endregion

IBaseAction[] _allBaseActions;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/UI/RotationConfigWindowNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private void DrawHeader(float wholeWidth)
var size = MathF.Max(_scale * MathF.Min(wholeWidth, _scale * 150), 100);

var logo = IconSet.GetTexture("https://raw.githubusercontent.com/ArchiDog1998/RotationSolver/main/docs/RotationSolverIcon_128.png");
logo = IconSet.GetTexture("https://raw.githubusercontent.com/ArchiDog1998/RotationSolver/main/docs/assets/HowAndWhenToClick.svg");


if (logo != null)
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/UI/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ private void DrawLastAction()

private unsafe void DrawIcon()
{
//ImGui.Text( ActionManager.Instance()->GetActionStatus(ActionType.Spell, 29733).ToString());
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

0 comments on commit 4fa7f26

Please sign in to comment.