Skip to content

Commit c4a3b6d

Browse files
authored
Merge pull request #820 from FFXIV-CombatReborn/serpens
Optimizations for VPR and hotfix for AST
2 parents 3104a49 + f9914ea commit c4a3b6d

File tree

6 files changed

+136
-78
lines changed

6 files changed

+136
-78
lines changed

BasicRotations/Healer/AST_Default.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ protected override bool GeneralAbility(IAction nextGCD, out IAction? act)
333333
return false;
334334
}
335335

336-
if (Player.WillStatusEndGCD(2, 0, true, StatusID.Suntouched))
336+
if (Player.WillStatusEnd(5, true, StatusID.Suntouched))
337337
{
338338
if (SunSignPvE.CanUse(out act))
339339
{

BasicRotations/Melee/VPR_Default.cs

Lines changed: 99 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ protected override bool GeneralGCD(out IAction? act)
275275
}
276276
}
277277

278-
if ((PreserveCombo && LiveComboTime > GCDTime(1)) || !PreserveCombo)
278+
if (((PreserveCombo && LiveComboTime > GCDTime(1)) || !PreserveCombo) && !WillSwiftEnd && !WillHunterEnd)
279279
{
280280
// Uncoiled Fury Overcap protection
281281
bool isTargetBoss = CurrentTarget?.IsBossFromTTK() ?? false;
@@ -300,9 +300,7 @@ protected override bool GeneralGCD(out IAction? act)
300300
|| !BurstUncoiledFuryHold)
301301
&& SerpentsIrePvE.Cooldown.JustUsedAfter(30)
302302
&& !HasReadyToReawaken
303-
&& NoAbilityReady
304-
&& !WillSwiftEnd
305-
&& !WillHunterEnd)
303+
&& NoAbilityReady)
306304
{
307305
if (UncoiledFuryPvE.CanUse(out act, usedUp: true))
308306
{
@@ -314,35 +312,52 @@ protected override bool GeneralGCD(out IAction? act)
314312
////AOE Dread Combo
315313
if (PitActive)
316314
{
317-
if (WillSwiftEnd)
315+
if (HasHunterAndSwift)
318316
{
319-
if (SwiftskinsDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
320-
return true;
321-
}
322-
323-
if (WillHunterEnd)
324-
{
325-
if (HuntersDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
326-
return true;
327-
}
317+
if (WillSwiftEnd)
318+
{
319+
if (SwiftskinsDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
320+
return true;
321+
}
328322

329-
switch (HunterOrSwiftEndsFirst)
330-
{
331-
case "Hunter":
323+
if (WillHunterEnd)
324+
{
332325
if (HuntersDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
333326
return true;
334-
break;
335-
case "Swift":
327+
}
328+
329+
switch (HunterOrSwiftEndsFirst)
330+
{
331+
case "Hunter":
332+
if (HuntersDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
333+
return true;
334+
break;
335+
case "Swift":
336+
if (SwiftskinsDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
337+
return true;
338+
break;
339+
case "Equal":
340+
case null:
341+
if (HuntersDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
342+
return true;
343+
if (SwiftskinsDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
344+
return true;
345+
break;
346+
}
347+
}
348+
if (!HasHunterAndSwift)
349+
{
350+
if (!IsSwift)
351+
{
336352
if (SwiftskinsDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
337353
return true;
338-
break;
339-
case "Equal":
340-
case null:
354+
}
355+
356+
if (!IsHunter)
357+
{
341358
if (HuntersDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
342359
return true;
343-
if (SwiftskinsDenPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
344-
return true;
345-
break;
360+
}
346361
}
347362
}
348363

@@ -380,45 +395,76 @@ protected override bool GeneralGCD(out IAction? act)
380395
// then try using Coil that will end first
381396
if (DreadActive)
382397
{
383-
if (IsSwift && Player.WillStatusEndGCD(2, 0, true, StatusID.Swiftscaled))
398+
if (HasHunterAndSwift)
384399
{
385-
if (SwiftskinsCoilPvE.CanUse(out act, skipComboCheck: true))
386-
return true;
387-
}
400+
if (WillSwiftEnd)
401+
{
402+
if (SwiftskinsCoilPvE.CanUse(out act, skipComboCheck: true))
403+
return true;
404+
}
388405

389-
if (IsHunter && Player.WillStatusEndGCD(2, 0, true, StatusID.HuntersInstinct))
390-
{
391-
if (HuntersCoilPvE.CanUse(out act, skipComboCheck: true))
406+
if (WillHunterEnd)
407+
{
408+
if (HuntersCoilPvE.CanUse(out act, skipComboCheck: true))
409+
return true;
410+
}
411+
412+
if (HuntersCoilPvE.CanUse(out act, skipComboCheck: true) && HuntersCoilPvE.Target.Target != null && CanHitPositional(EnemyPositional.Flank, HuntersCoilPvE.Target.Target))
413+
{
392414
return true;
393-
}
415+
}
394416

395-
if (HuntersCoilPvE.CanUse(out act, skipComboCheck: true) && HuntersCoilPvE.Target.Target != null && CanHitPositional(EnemyPositional.Flank, HuntersCoilPvE.Target.Target))
396-
{
397-
return true;
398-
}
417+
if (SwiftskinsCoilPvE.CanUse(out act, skipComboCheck: true) && SwiftskinsCoilPvE.Target.Target != null && CanHitPositional(EnemyPositional.Rear, SwiftskinsCoilPvE.Target.Target))
418+
{
419+
return true;
420+
}
399421

400-
if (SwiftskinsCoilPvE.CanUse(out act, skipComboCheck: true) && SwiftskinsCoilPvE.Target.Target != null && CanHitPositional(EnemyPositional.Rear, SwiftskinsCoilPvE.Target.Target))
401-
{
402-
return true;
422+
switch (HunterOrSwiftEndsFirst)
423+
{
424+
case "Hunter":
425+
if (HuntersCoilPvE.CanUse(out act, skipComboCheck: true))
426+
return true;
427+
break;
428+
case "Swift":
429+
if (SwiftskinsCoilPvE.CanUse(out act, skipComboCheck: true))
430+
return true;
431+
break;
432+
case "Equal":
433+
case null:
434+
if (HuntersCoilPvE.CanUse(out act, skipComboCheck: true))
435+
return true;
436+
if (SwiftskinsCoilPvE.CanUse(out act, skipComboCheck: true))
437+
return true;
438+
break;
439+
}
403440
}
404441

405-
switch (HunterOrSwiftEndsFirst)
442+
if (!HasHunterAndSwift)
406443
{
407-
case "Hunter":
408-
if (HuntersCoilPvE.CanUse(out act, skipComboCheck: true))
444+
if (!IsHunter && !IsSwift)
445+
{
446+
if (HuntersCoilPvE.CanUse(out act, skipComboCheck: true) && HuntersCoilPvE.Target.Target != null && CanHitPositional(EnemyPositional.Flank, HuntersCoilPvE.Target.Target))
447+
{
409448
return true;
410-
break;
411-
case "Swift":
412-
if (SwiftskinsCoilPvE.CanUse(out act, skipComboCheck: true))
449+
}
450+
451+
if (SwiftskinsCoilPvE.CanUse(out act, skipComboCheck: true) && SwiftskinsCoilPvE.Target.Target != null && CanHitPositional(EnemyPositional.Rear, SwiftskinsCoilPvE.Target.Target))
452+
{
413453
return true;
414-
break;
415-
case "Equal":
416-
case null:
417-
if (HuntersCoilPvE.CanUse(out act, skipComboCheck: true))
454+
}
455+
}
456+
457+
if (!IsSwift)
458+
{
459+
if (SwiftskinsCoilPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
418460
return true;
419-
if (SwiftskinsCoilPvE.CanUse(out act, skipComboCheck: true))
461+
}
462+
463+
if (!IsHunter)
464+
{
465+
if (HuntersCoilPvE.CanUse(out act, skipComboCheck: true, skipAoeCheck: true))
420466
return true;
421-
break;
467+
}
422468
}
423469
}
424470

@@ -456,7 +502,7 @@ protected override bool GeneralGCD(out IAction? act)
456502
if (JaggedMawPvE.CanUse(out act, skipAoeCheck: true))
457503
return true;
458504
break;
459-
case (false, true):
505+
case (_, true):
460506
if (BloodiedMawPvE.CanUse(out act, skipAoeCheck: true))
461507
return true;
462508
break;

RotationSolver.Basic/Helpers/ActionManagerHelper.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ namespace RotationSolver.Basic.Helpers
88
/// </summary>
99
internal static class ActionManagerHelper
1010
{
11-
private const uint DefaultActionId = 11;
12-
1311
/// <summary>
1412
/// Gets the instance of the ActionManager.
1513
/// </summary>
@@ -39,7 +37,7 @@ public static unsafe float GetRecastTime(ActionType type, uint id)
3937
/// <returns>The default recast time.</returns>
4038
public static unsafe float GetDefaultRecastTime()
4139
{
42-
return GetRecastTime(ActionType.Action, DefaultActionId);
40+
return GetRecastTime(ActionType.Action, (uint)ActionID.HeatedSplitShotPvE);
4341
}
4442

4543
/// <summary>
@@ -60,7 +58,7 @@ public static unsafe float GetRecastTimeElapsed(ActionType type, uint id)
6058
/// <returns>The elapsed recast time for the default action.</returns>
6159
public static unsafe float GetDefaultRecastTimeElapsed()
6260
{
63-
return GetRecastTimeElapsed(ActionType.Action, DefaultActionId);
61+
return GetRecastTimeElapsed(ActionType.Action, (uint)ActionID.HeatedSplitShotPvE);
6462
}
6563
}
6664
}

RotationSolver.Basic/Helpers/StatusHelper.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,19 @@ public static bool HasStatus(this IBattleChara battleChara, bool isFromSelf, par
371371
/// </returns>
372372
public static bool HasApplyStatus(this IBattleChara battleChara, StatusID[] statusIDs)
373373
{
374+
try
375+
{
376+
if (battleChara.StatusList == null)
377+
{
378+
return false;
379+
}
380+
}
381+
catch
382+
{
383+
// StatusList threw, treat as unavailable
384+
return false;
385+
}
386+
374387
if (DataCenter.InEffectTime && DataCenter.ApplyStatus.TryGetValue(battleChara.GameObjectId, out uint statusId))
375388
{
376389
foreach (StatusID s in statusIDs)

RotationSolver.Basic/Rotations/Basic/AstrologianRotation.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ static partial void ModifyHeliosConjunctionPvE(ref ActionSetting setting)
479479
static partial void ModifySunSignPvE(ref ActionSetting setting)
480480
{
481481
setting.StatusNeed = [StatusID.Suntouched];
482+
setting.MPOverride = () => 0;
482483
setting.IsFriendly = true;
483484
setting.CreateConfig = () => new ActionConfig()
484485
{

0 commit comments

Comments
 (0)