Skip to content

Commit

Permalink
Merge pull request #490 from FFXIV-CombatReborn/prioUI
Browse files Browse the repository at this point in the history
Prioritization system, BRD emergency esuna logic, MNK cleanup
  • Loading branch information
LTS-FFXIV authored Dec 25, 2024
2 parents aaab732 + 653a50c commit 34ce44a
Show file tree
Hide file tree
Showing 11 changed files with 421 additions and 156 deletions.
3 changes: 1 addition & 2 deletions BasicRotations/Melee/MNK_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ protected override bool AttackAbility(IAction nextGCD, out IAction? act)
// 'Use on cooldown, unless you know your killtime. You should aim to get as many casts of RoW as you can, and then shift those usages to align with burst as much as possible without losing a use.'
if (!CombatElapsedLessGCD(3) && RiddleOfWindPvE.CanUse(out act)) return true; // Riddle Of Wind

// i'm clever and i can do kame hame ha, so i won't stand still and keep refreshing form shift
if (EnlightenmentPvE.CanUse(out act, skipAoeCheck: HowlingSingle)) return true; // Enlightment
if (HowlingFistPvE.CanUse(out act, skipAoeCheck: HowlingSingle)) return true; // Howling Fist

Expand Down Expand Up @@ -267,7 +266,7 @@ protected override bool GeneralGCD(out IAction? act)
if (OpoOpoForm(out act)) return true;

// out of range or nothing to do, recharge chakra first
if (Chakra < 5 && (ForbiddenMeditationPvE.CanUse(out act) || SteeledMeditationPvE.CanUse(out act))) return true;
if (Chakra < 5 && (EnlightenedMeditationPvE.CanUse(out act) || ForbiddenMeditationPvE.CanUse(out act))) return true;

// out of range or nothing to do, refresh buff second, but dont keep refreshing or it draws too much attention
if (AutoFormShift && !Player.HasStatus(true, StatusID.PerfectBalance) && !Player.HasStatus(true, StatusID.FormlessFist) && FormShiftPvE.CanUse(out act)) return true; // Form Shift GCD use
Expand Down
5 changes: 5 additions & 0 deletions BasicRotations/Ranged/BRD_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public sealed class BRD_Default : BardRotation
#region oGCD Logic
protected override bool EmergencyAbility(IAction nextGCD, out IAction? act)
{
if (Player.HasStatus(true, StatusID.Doom))
{
if (TheWardensPaeanPvE.CanUse(out act)) return true;
}

if (nextGCD.IsTheSameTo(true, StraightShotPvE, VenomousBitePvE, WindbitePvE, IronJawsPvE))
{
return base.EmergencyAbility(nextGCD, out act);
Expand Down
11 changes: 7 additions & 4 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"273": 0.6,
"290": 0.6,
"295": 0.6,
"1533": 3.1,
"1694": 0.1,
"1695": 2.1,
"2240": 0.6,
Expand Down Expand Up @@ -362,6 +363,7 @@
"7910": 0.6,
"7911": 0.6,
"8166": 2.1,
"8324": 0.6,
"8341": 0.1,
"8570": 0.1,
"8701": 2.1,
Expand Down Expand Up @@ -503,6 +505,7 @@
"16555": 0.6,
"16556": 0.6,
"16557": 0.6,
"16558": 0.6,
"16559": 0.6,
"16766": 0.6,
"16889": 0.6,
Expand Down Expand Up @@ -753,8 +756,8 @@
"28901": 2.1,
"28917": 2.1,
"28924": 2.1,
"29054": 0.46499997,
"29056": 0.24499997,
"29054": 0.46599996,
"29056": 0.24599996,
"29223": 0.1,
"29224": 0.1,
"29226": 0.6,
Expand Down Expand Up @@ -787,7 +790,7 @@
"29484": 0.24099997,
"29485": 0.4190002,
"29709": 0.1,
"29711": 0.37399998,
"29711": 0.37699994,
"29716": 0.1,
"29731": 0.1,
"29732": 0.6,
Expand Down Expand Up @@ -898,7 +901,7 @@
"40109": 2.6,
"40110": 2.6,
"40111": 2.6,
"41467": 0.112999976,
"41467": 0.556,
"41494": 0.1,
"41496": 0.1,
"41498": 0.15499976,
Expand Down
19 changes: 18 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -700,5 +700,22 @@
37846,
14334,
14349,
22096
22096,
36608,
36607,
33243,
21845,
4863,
37339,
22214,
21937,
9407,
35990,
6092,
6190,
4198,
4205,
40516,
40522,
40509
]
5 changes: 5 additions & 0 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public const string
List2 = "List2",
Debug = "Debug";

public List<AutoStatus> AutoStatusOrder { get; set; } = Enum.GetValues(typeof(AutoStatus))
.Cast<AutoStatus>()
.Where(status => status != AutoStatus.None)
.ToList();

public const int CurrentVersion = 12;
public int Version { get; set; } = CurrentVersion;

Expand Down
24 changes: 12 additions & 12 deletions RotationSolver.Basic/Data/AutoStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,45 +26,45 @@ public enum AutoStatus : uint
/// </summary>
Provoke = 1 << 2,

/// <summary>
/// We should dispel.
/// </summary>
Dispel = 1 << 3,

/// <summary>
/// We should use defense single.
/// </summary>
DefenseSingle = 1 << 3,
DefenseSingle = 1 << 4,

/// <summary>
/// We should use defense area.
/// </summary>
DefenseArea = 1 << 4,
DefenseArea = 1 << 5,

/// <summary>
/// We should heal single by ability.
/// </summary>
HealSingleAbility = 1 << 5,
HealSingleAbility = 1 << 6,

/// <summary>
/// We should heal single by spell.
/// </summary>
HealSingleSpell = 1 << 6,
HealSingleSpell = 1 << 7,

/// <summary>
/// We should heal area by ability.
/// </summary>
HealAreaAbility = 1 << 7,
HealAreaAbility = 1 << 8,

/// <summary>
/// We should heal area by spell.
/// </summary>
HealAreaSpell = 1 << 8,
HealAreaSpell = 1 << 9,

/// <summary>
/// We should raise.
/// </summary>
Raise = 1 << 9,

/// <summary>
/// We should dispel.
/// </summary>
Dispel = 1 << 10,
Raise = 1 << 10,

/// <summary>
/// We should use positional abilities.
Expand Down
24 changes: 14 additions & 10 deletions RotationSolver.Basic/Rotations/Basic/MonkRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ static partial void ModifySnapPunchPvE(ref ActionSetting setting)

static partial void ModifySteeledMeditationPvE(ref ActionSetting setting)
{

setting.ActionCheck = () => Chakra < 5;
}

static partial void ModifySteelPeakPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => InCombat && Chakra >= 5;
setting.ActionCheck = () => InCombat && Chakra == 5;
setting.UnlockedByQuestID = 66094;
}

Expand Down Expand Up @@ -129,12 +129,12 @@ static partial void ModifyThunderclapPvE(ref ActionSetting setting)

static partial void ModifyInspiritedMeditationPvE(ref ActionSetting setting)
{

setting.ActionCheck = () => Chakra < 5;
}

static partial void ModifyHowlingFistPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => InCombat && Chakra >= 5;
setting.ActionCheck = () => InCombat && Chakra == 5;
setting.UnlockedByQuestID = 66599;
setting.CreateConfig = () => new ActionConfig()
{
Expand Down Expand Up @@ -183,12 +183,12 @@ static partial void ModifyFormShiftPvE(ref ActionSetting setting)

static partial void ModifyForbiddenMeditationPvE(ref ActionSetting setting)
{

setting.ActionCheck = () => Chakra < 5;
}

static partial void ModifyTheForbiddenChakraPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => InCombat && Chakra >= 5;
setting.ActionCheck = () => InCombat && Chakra == 5;
setting.UnlockedByQuestID = 67564;
}

Expand Down Expand Up @@ -245,6 +245,10 @@ static partial void ModifyRiddleOfEarthPvE(ref ActionSetting setting)
static partial void ModifyEarthsReplyPvE(ref ActionSetting setting)
{
setting.StatusNeed = [StatusID.EarthsRumination];
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
};
}

static partial void ModifyRiddleOfFirePvE(ref ActionSetting setting)
Expand Down Expand Up @@ -277,21 +281,21 @@ static partial void ModifyRiddleOfWindPvE(ref ActionSetting setting)

static partial void ModifyEnlightenedMeditationPvE(ref ActionSetting setting)
{

setting.ActionCheck = () => Chakra < 5;
}

static partial void ModifyEnlightenmentPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => InCombat && Chakra >= 5;
setting.ActionCheck = () => InCombat && Chakra == 5;
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
AoeCount = 3,
};
}

static partial void ModifySixsidedStarPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => InCombat && Chakra >= 5;
setting.ActionCheck = () => InCombat && Chakra >= 1;
setting.StatusProvide = [StatusID.SixsidedStar];
}

Expand Down
8 changes: 4 additions & 4 deletions RotationSolver.Basic/Rotations/CustomRotation_GCD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ partial class CustomRotation
if (MyInterruptGCD(out act)) return act;
}

IBaseAction.TargetOverride = TargetType.Dispel;
if (DataCenter.MergedStatus.HasFlag(AutoStatus.Dispel)
&& DispelGCD(out act)) return act;

IBaseAction.TargetOverride = TargetType.Death;

if (Service.Config.RaisePlayerFirst)
Expand Down Expand Up @@ -81,10 +85,6 @@ partial class CustomRotation
if (DataCenter.MergedStatus.HasFlag(AutoStatus.DefenseSingle)
&& DefenseSingleGCD(out act)) return act;

IBaseAction.TargetOverride = TargetType.Dispel;
if (DataCenter.MergedStatus.HasFlag(AutoStatus.Dispel)
&& DispelGCD(out act)) return act;

IBaseAction.TargetOverride = TargetType.Death;

if (!Service.Config.RaisePlayerFirst)
Expand Down
71 changes: 71 additions & 0 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,77 @@ private static void DrawAbout()
_aboutHeaders.Draw();
}

private void DrawAutoStatusOrderConfig()
{
ImGui.Text("Reorder AutoStatus Priorities:");
ImGui.Spacing();

if (ImGui.Button("Reset to Default"))
{
Service.Config.AutoStatusOrder = Enum.GetValues(typeof(AutoStatus))
.Cast<AutoStatus>()
.Where(status => status != AutoStatus.None)
.ToList();
Service.Config.Save();
}
ImGui.Spacing();

var autoStatusOrder = Service.Config.AutoStatusOrder;
bool orderChanged = false;

// Begin a child window to contain the list
ImGui.BeginChild("AutoStatusOrderList", new Vector2(0, 200 * Scale), true);

int itemCount = autoStatusOrder.Count;

for (int i = 0; i < itemCount; i++)
{
var item = autoStatusOrder[i];

// Draw up button
if (ImGuiEx.IconButton(FontAwesomeIcon.ArrowUp, $"##Up{i}") && i > 0)
{
// Swap with the previous item
var temp = autoStatusOrder[i - 1];
autoStatusOrder[i - 1] = autoStatusOrder[i];
autoStatusOrder[i] = temp;
orderChanged = true;
}

ImGui.SameLine();

// Draw down button
if (ImGuiEx.IconButton(FontAwesomeIcon.ArrowDown, $"##Down{i}") && i < itemCount - 1)
{
// Swap with the next item
var temp = autoStatusOrder[i + 1];
autoStatusOrder[i + 1] = autoStatusOrder[i];
autoStatusOrder[i] = temp;
orderChanged = true;
}

ImGui.SameLine();

// Draw the item
ImGui.Text(item.ToString());

// Optionally, add tooltips or additional information
if (ImGui.IsItemHovered())
{
ImGui.BeginTooltip();
ImGui.Text($"Priority: {i + 1}");
ImGui.EndTooltip();
}
}

ImGui.EndChild();

if (orderChanged)
{
Service.Config.Save();
}
}

private static readonly CollapsingHeaderGroup _aboutHeaders = new(new()
{
{ UiString.ConfigWindow_About_Macros.GetDescription, DrawAboutMacros },
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/UI/RotationConfigWindow_Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,10 @@ private static void DrawUI()
/// <summary>
/// Draws the auto section of the configuration window.
/// </summary>
private static void DrawAuto()
private void DrawAuto()
{
ImGui.TextWrapped(UiString.ConfigWindow_Auto_Description.GetDescription());
DrawAutoStatusOrderConfig();
_autoHeader?.Draw();
}

Expand Down
Loading

0 comments on commit 34ce44a

Please sign in to comment.