Skip to content

Commit 20f7b7a

Browse files
authored
Merge pull request #808 from FFXIV-CombatReborn/SilverCannonHotfix2
Hotfix for SIlver Cannon to ensure debuff refresh is prioritized
2 parents e75933b + 86ddcc0 commit 20f7b7a

File tree

3 files changed

+38
-46
lines changed

3 files changed

+38
-46
lines changed

BasicRotations/Duty/PhantomDefault.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,15 @@ public override bool GeneralGCD(out IAction? act)
604604
return true;
605605
}
606606

607-
if (SilverCannonPvE.CanUse(out act))
607+
if (SilverCannonPvE.CanUse(out act, skipStatusProvideCheck: true))
608608
{
609-
return true;
609+
if (SilverCannonPvE.Target.Target?.WillStatusEnd(15, true, SilverCannonPvE.Setting.TargetStatusProvide ?? []) ?? false)
610+
{
611+
if (SilverCannonPvE.Target.Target?.WillStatusEnd(15, false, SilverCannonPvE.Setting.TargetStatusProvide ?? []) ?? false)
612+
{
613+
return true;
614+
}
615+
}
610616
}
611617

612618
if (HolyCannonPvE.CanUse(out act))

RotationSolver.Basic/Actions/ActionBasicInfo.cs

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -172,41 +172,36 @@ public ActionBasicInfo(IBaseAction action, bool isDutyAction)
172172
/// <returns>True if the action passes the basic check; otherwise, false.</returns>
173173
internal readonly bool BasicCheck(bool skipStatusProvideCheck, bool skipComboCheck, bool skipCastingCheck, bool checkActionManager = false)
174174
{
175-
if (Player.Object.StatusList == null)
176-
{
177-
return false;
178-
}
179175

180-
if (NeedsCasting(!skipCastingCheck) && DataCenter.IsMoving && Service.Config.BmrLock)
176+
// 1. Player and action slot checks
177+
if (Player.Object.StatusList == null)
181178
{
182179
return false;
183180
}
184-
185181
if (!IsActionEnabled() || !IsOnSlot)
186182
{
187183
return false;
188184
}
189185

190-
if (IsLimitBreak && !DataCenter.IsPvP)
191-
{
192-
return true;
193-
}
194-
186+
// 2. Basic requirements: not disabled, enough level, enough MP, spell unlocked
195187
if (IsActionDisabled() || !EnoughLevel || !HasEnoughMP() || !SpellUnlocked)
196188
{
197189
return false;
198190
}
199191

192+
// 3. Status checks: need or provide
200193
if (IsStatusNeeded() || IsStatusProvided(skipStatusProvideCheck))
201194
{
202195
return false;
203196
}
204197

205-
if (IsLimitBreakLevelLow() || !IsComboValid(skipComboCheck) || !IsRoleActionValid())
198+
// 4. Combo and role checks
199+
if (!IsComboValid(skipComboCheck) || !IsRoleActionValid())
206200
{
207201
return false;
208202
}
209203

204+
// 5. Optional: ask the game directly if the action is usable
210205
// In terms of "whether we can cast something" this check functionally negates everything else as we're asking the game directly if this is usable
211206
// That *said* there is a lot of logic elsewhere here for prioritizing things, so we're simply going to add this as an optional check for handling abilities we want to verify are usable
212207
if (checkActionManager && !ActionManagerStatusValid())
@@ -217,6 +212,29 @@ internal readonly bool BasicCheck(bool skipStatusProvideCheck, bool skipComboChe
217212
return !NeedsCasting(skipCastingCheck) && (!IsGeneralGCD || !IsStatusProvidedDuringGCD()) && IsActionCheckValid() && IsRotationCheckValid();
218213
}
219214

215+
private bool NeedsCasting(bool skipCastingCheck)
216+
{
217+
// Must have a cast time
218+
if (CastTime <= 0f)
219+
return false;
220+
221+
// Must not have a instant cast status
222+
if (!Player.Object.WillStatusEnd(0, true, StatusHelper.SwiftcastStatus))
223+
return false;
224+
225+
// Must not be in the no-cast list
226+
if (ActionsNoNeedCasting.Contains(ID))
227+
return false;
228+
229+
// Must be in a state where casting is not possible
230+
if (DataCenter.SpecialType == SpecialCommandType.NoCasting ||
231+
(DateTime.Now > DataCenter.KnockbackStart && DateTime.Now < DataCenter.KnockbackFinished) ||
232+
(DataCenter.NoPoslock && DataCenter.IsMoving && !skipCastingCheck))
233+
return true;
234+
235+
return false;
236+
}
237+
220238
/// <summary>
221239
/// Determines whether the spell is unlocked for the player.
222240
/// </summary>
@@ -247,11 +265,6 @@ private bool IsStatusProvided(bool skipStatusProvideCheck)
247265
return Player.Object.StatusList != null && !skipStatusProvideCheck && _action.Setting.StatusProvide != null && !Player.Object.WillStatusEndGCD(_action.Config.StatusGcdCount, 0, _action.Setting.StatusFromSelf, _action.Setting.StatusProvide);
248266
}
249267

250-
private bool IsLimitBreakLevelLow()
251-
{
252-
return _action.Action.ActionCategory.RowId == 15 && CustomRotation.LimitBreakLevel <= 1;
253-
}
254-
255268
private bool IsComboValid(bool skipComboCheck)
256269
{
257270
return skipComboCheck || !IsGeneralGCD || CheckForCombo();
@@ -267,29 +280,6 @@ private bool IsRotationCheckValid()
267280
return IBaseAction.ForceEnable || (_action.Setting.RotationCheck?.Invoke() ?? true);
268281
}
269282

270-
private bool NeedsCasting(bool skipCastingCheck)
271-
{
272-
// Must have a cast time
273-
if (CastTime <= 0)
274-
return false;
275-
276-
// Must not have a instant cast status
277-
if (!Player.Object.WillStatusEnd(0, true, StatusHelper.SwiftcastStatus))
278-
return false;
279-
280-
// Must not be in the no-cast list
281-
if (ActionsNoNeedCasting.Contains(ID))
282-
return false;
283-
284-
// Must be in a state where casting is not possible
285-
if (DataCenter.SpecialType == SpecialCommandType.NoCasting ||
286-
(DateTime.Now > DataCenter.KnockbackStart && DateTime.Now < DataCenter.KnockbackFinished) ||
287-
(DataCenter.NoPoslock && DataCenter.IsMoving && !skipCastingCheck))
288-
return true;
289-
290-
return false;
291-
}
292-
293283
private bool IsStatusProvidedDuringGCD()
294284
{
295285
return _action.Setting.StatusProvide?.Length > 0 && _action.Setting.IsFriendly && IActionHelper.IsLastGCD(true, _action) && DataCenter.TimeSinceLastAction.TotalSeconds < 3;

RotationSolver.Basic/Configuration/Configs.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ public const string
103103
Filter = Extra)]
104104
private static readonly bool _poslockCasting = false;
105105

106-
[ConditionBool, UI("(Experimental) Attempt to mitigate cast cancelling with movement tech in BMR).",
107-
Filter = Extra)]
108-
private static readonly bool _bmrLock = false;
109-
110106
[UI("", Action = ActionID.PassageOfArmsPvE, Parent = nameof(PoslockCasting))]
111107
public bool PosPassageOfArms { get; set; } = false;
112108

0 commit comments

Comments
 (0)