Skip to content

Commit 72da1f7

Browse files
authored
Merge pull request #952 from FFXIV-CombatReborn/InterceptUpdate
Refactor action interception and cooldown properties
2 parents 7893c24 + 05ad9c4 commit 72da1f7

File tree

14 files changed

+94
-36
lines changed

14 files changed

+94
-36
lines changed

RotationSolver.Basic/Actions/ActionConfig.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ public bool IsEnabled
1616
set => _isEnable = value;
1717
}
1818

19+
private bool _isIntercepted = true;
20+
21+
/// <summary>
22+
///
23+
/// </summary>
24+
public bool IsIntercepted
25+
{
26+
get => _isIntercepted;
27+
set => _isIntercepted = value;
28+
}
29+
1930
/// <summary>
2031
/// Should check the status for this action.
2132
/// </summary>
@@ -81,5 +92,5 @@ public bool IsEnabled
8192
/// <summary>
8293
/// Is this action in the cd window.
8394
/// </summary>
84-
public bool IsInCooldown { get; set; } = true;
95+
public bool IsOnCooldownWindow { get; set; } = true;
8596
}

RotationSolver.Basic/Actions/BaseAction.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,17 @@ public bool IsEnabled
7474
}
7575

7676
/// <inheritdoc/>
77-
public bool IsInCooldown
77+
public bool IsIntercepted
7878
{
79-
get => Config.IsInCooldown;
80-
set => Config.IsInCooldown = value;
79+
get => Config.IsIntercepted;
80+
set => Config.IsIntercepted = value;
81+
}
82+
83+
/// <inheritdoc/>
84+
public bool IsOnCooldownWindow
85+
{
86+
get => Config.IsOnCooldownWindow;
87+
set => Config.IsOnCooldownWindow = value;
8188
}
8289

8390
/// <inheritdoc/>

RotationSolver.Basic/Actions/BaseItem.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,28 @@ public ItemConfig Config
7474
/// <summary>
7575
/// Is item enabled.
7676
/// </summary>
77-
7877
public bool IsEnabled
7978
{
8079
get => Config.IsEnabled;
8180
set => Config.IsEnabled = value;
8281
}
8382

8483
/// <summary>
85-
/// Is the item in the cd window.
84+
///
8685
/// </summary>
86+
public bool IsIntercepted
87+
{
88+
get => Config.IsIntercepted;
89+
set => Config.IsIntercepted = value;
90+
}
8791

88-
public bool IsInCooldown
92+
/// <summary>
93+
/// Is the item in the cd window.
94+
/// </summary>
95+
public bool IsOnCooldownWindow
8996
{
90-
get => Config.IsInCooldown;
91-
set => Config.IsInCooldown = value;
97+
get => Config.IsOnCooldownWindow;
98+
set => Config.IsOnCooldownWindow = value;
9299
}
93100

94101
/// <summary>

RotationSolver.Basic/Actions/IAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public interface IAction : ITexture, IEnoughLevel
2323
/// <summary>
2424
/// Gets or sets a value indicating whether this action is in the cooldown UI window.
2525
/// </summary>
26-
bool IsInCooldown { get; set; }
26+
bool IsOnCooldownWindow { get; set; }
2727

2828
/// <summary>
2929
/// Gets the cooldown information for this action.

RotationSolver.Basic/Actions/ItemConfig.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ public class ItemConfig
88
/// <summary>
99
/// Is in the cooldown window.
1010
/// </summary>
11-
public bool IsInCooldown { get; set; }
11+
public bool IsOnCooldownWindow { get; set; }
1212

1313
/// <summary>
1414
/// Is this action enabled.
1515
/// </summary>
1616
public bool IsEnabled { get; set; }
17+
18+
/// <summary>
19+
///
20+
/// </summary>
21+
public bool IsIntercepted { get; set; }
1722
}

RotationSolver.Basic/ITexture.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@ public interface ITexture
2727
/// Enable or disable the usage of a skill. Turning this option off prevents RSR from using it completely.
2828
/// </markdown>
2929
bool IsEnabled { get; set; }
30+
31+
/// <summary>
32+
///
33+
/// </summary>
34+
bool IsIntercepted { get; set; }
3035
}

RotationSolver.Basic/Rotations/CustomRotation_BasicInfo.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using ECommons.DalamudServices;
22
using ECommons.ExcelServices;
33
using Lumina.Excel.Sheets;
4-
using static FFXIVClientStructs.FFXIV.Client.UI.Agent.HudStatus;
54

65
namespace RotationSolver.Basic.Rotations;
76

@@ -52,6 +51,9 @@ public bool IsEnabled
5251
get => !Service.Config.DisabledJobs.Contains(Job); set => _ = value ? Service.Config.DisabledJobs.Remove(Job) : Service.Config.DisabledJobs.Add(Job);
5352
}
5453

54+
/// <inheritdoc/>
55+
public bool IsIntercepted { get; set; }
56+
5557
/// <inheritdoc/>
5658
public uint IconID { get; }
5759

RotationSolver.Basic/Traits/BaseTrait.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,17 @@ public class BaseTrait : IBaseTrait
3434
/// Gets the description of this trait.
3535
/// </summary>
3636
public string Description => Name;
37-
37+
3838
/// <summary>
3939
/// Gets or sets a value indicating whether this trait is enabled.
4040
/// </summary>
4141
public bool IsEnabled { get; set; }
4242

43+
/// <summary>
44+
///
45+
/// </summary>
46+
public bool IsIntercepted { get; set; }
47+
4348
/// <summary>
4449
/// Gets the ID of this trait.
4550
/// </summary>

RotationSolver/Data/UiString.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,22 +124,25 @@ internal enum UiString
124124
[Description("Show on CD window")]
125125
ConfigWindow_Actions_ShowOnCDWindow,
126126

127+
[Description("Allow action to be intercepted by the intercept system")]
128+
ConfigWindow_Actions_IsIntercepted,
129+
127130
[Description("Time-to-kill threshold required for this action to be used")]
128131
ConfigWindow_Actions_TTK,
129132

130133
[Description("Number of targets needed to use this action")]
131134
ConfigWindow_Actions_AoeCount,
132135

133-
[Description("Should this action check status effects")]
136+
[Description("Should this action check needed status effects")]
134137
ConfigWindow_Actions_CheckStatus,
135138

136-
[Description("Should this action check targets status effects")]
139+
[Description("Should this action check targets needed status effects")]
137140
ConfigWindow_Actions_CheckTargetStatus,
138141

139-
[Description("Number of GCDs before the DoT is reapplied")]
142+
[Description("Number of GCDs before the DOT/Status effect is reapplied")]
140143
ConfigWindow_Actions_GcdCount,
141144

142-
[Description("HP ratio for automatic healing")]
145+
[Description("HP ratio for automatic healing (only applies to healing actions)")]
143146
ConfigWindow_Actions_HealRatio,
144147

145148
[Description("Forced Conditions have higher priority. If Forced Conditions are met, Disabled Conditions will be ignored.")]

RotationSolver/ExtraRotations/Magical/Rabbs_BLM.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ protected override bool GeneralGCD(out IAction? act)
792792
if (DespairPvE.CanUse(out act)) return true;
793793
}
794794

795-
if (ManafontPvE.IsInCooldown && ManafontPvE.Cooldown.RecastTimeElapsed > 6 && AstralSoulStacks == 4)
795+
if (ManafontPvE.Cooldown.IsCoolingDown && ManafontPvE.Cooldown.RecastTimeElapsed > 6 && AstralSoulStacks == 4)
796796
{
797797
if (ParadoxPvE.CanUse(out act, skipStatusProvideCheck: true)) return true;
798798
if (AltFlareOpenerPvE.CanUse(out act, skipAoeCheck: true)) return true;

0 commit comments

Comments
 (0)