Skip to content

Commit 9b25d4e

Browse files
authored
Merge pull request #856 from FFXIV-CombatReborn/esunastuffidk
Fix for raise delay, add esuna delay option, various other enhancements
2 parents 5d282a4 + 15614ab commit 9b25d4e

File tree

9 files changed

+68
-72
lines changed

9 files changed

+68
-72
lines changed

BasicRotations/Healer/AST_Default.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -650,28 +650,30 @@ public override bool CanHealSingleSpell
650650
{
651651
get
652652
{
653-
int healerCount = 0;
653+
int aliveHealerCount = 0;
654654
IEnumerable<IBattleChara> healers = PartyMembers.GetJobCategory(JobRole.Healer);
655655
foreach (IBattleChara h in healers)
656656
{
657-
healerCount++;
657+
if (!h.IsDead)
658+
aliveHealerCount++;
658659
}
659660

660-
return base.CanHealSingleSpell && (GCDHeal || healerCount < 2);
661+
return base.CanHealSingleSpell && (GCDHeal || aliveHealerCount == 1);
661662
}
662663
}
663664
public override bool CanHealAreaSpell
664665
{
665666
get
666667
{
667-
int healerCount = 0;
668+
int aliveHealerCount = 0;
668669
IEnumerable<IBattleChara> healers = PartyMembers.GetJobCategory(JobRole.Healer);
669670
foreach (IBattleChara h in healers)
670671
{
671-
healerCount++;
672+
if (!h.IsDead)
673+
aliveHealerCount++;
672674
}
673675

674-
return base.CanHealAreaSpell && (GCDHeal || healerCount < 2);
676+
return base.CanHealAreaSpell && (GCDHeal || aliveHealerCount == 1);
675677
}
676678
}
677679
#endregion

BasicRotations/Healer/SCH_Default.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -862,28 +862,30 @@ public override bool CanHealSingleSpell
862862
{
863863
get
864864
{
865-
int healerCount = 0;
865+
int aliveHealerCount = 0;
866866
IEnumerable<IBattleChara> healers = PartyMembers.GetJobCategory(JobRole.Healer);
867867
foreach (IBattleChara h in healers)
868868
{
869-
healerCount++;
869+
if (!h.IsDead)
870+
aliveHealerCount++;
870871
}
871872

872-
return base.CanHealSingleSpell && (GCDHeal || healerCount < 2);
873+
return base.CanHealSingleSpell && (GCDHeal || aliveHealerCount == 1);
873874
}
874875
}
875876
public override bool CanHealAreaSpell
876877
{
877878
get
878879
{
879-
int healerCount = 0;
880+
int aliveHealerCount = 0;
880881
IEnumerable<IBattleChara> healers = PartyMembers.GetJobCategory(JobRole.Healer);
881882
foreach (IBattleChara h in healers)
882883
{
883-
healerCount++;
884+
if (!h.IsDead)
885+
aliveHealerCount++;
884886
}
885887

886-
return base.CanHealAreaSpell && (GCDHeal || healerCount < 2);
888+
return base.CanHealAreaSpell && (GCDHeal || aliveHealerCount == 1);
887889
}
888890
}
889891
#endregion

BasicRotations/Healer/SGE_Default.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -724,28 +724,30 @@ public override bool CanHealSingleSpell
724724
{
725725
get
726726
{
727-
int healerCount = 0;
727+
int aliveHealerCount = 0;
728728
IEnumerable<IBattleChara> healers = PartyMembers.GetJobCategory(JobRole.Healer);
729729
foreach (IBattleChara h in healers)
730730
{
731-
healerCount++;
731+
if (!h.IsDead)
732+
aliveHealerCount++;
732733
}
733734

734-
return base.CanHealSingleSpell && (GCDHeal || healerCount < 2);
735+
return base.CanHealSingleSpell && (GCDHeal || aliveHealerCount == 1);
735736
}
736737
}
737738
public override bool CanHealAreaSpell
738739
{
739740
get
740741
{
741-
int healerCount = 0;
742+
int aliveHealerCount = 0;
742743
IEnumerable<IBattleChara> healers = PartyMembers.GetJobCategory(JobRole.Healer);
743744
foreach (IBattleChara h in healers)
744745
{
745-
healerCount++;
746+
if (!h.IsDead)
747+
aliveHealerCount++;
746748
}
747749

748-
return base.CanHealAreaSpell && (GCDHeal || healerCount < 2);
750+
return base.CanHealAreaSpell && (GCDHeal || aliveHealerCount == 1);
749751
}
750752
}
751753
#endregion

BasicRotations/Healer/WHM_Default.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,33 +402,34 @@ protected override bool GeneralGCD(out IAction? act)
402402
#endregion
403403

404404
#region Extra Methods
405-
406405
public override bool CanHealSingleSpell
407406
{
408407
get
409408
{
410-
int healerCount = 0;
409+
int aliveHealerCount = 0;
411410
IEnumerable<IBattleChara> healers = PartyMembers.GetJobCategory(JobRole.Healer);
412411
foreach (IBattleChara h in healers)
413412
{
414-
healerCount++;
413+
if (!h.IsDead)
414+
aliveHealerCount++;
415415
}
416416

417-
return base.CanHealSingleSpell && (GCDHeal || healerCount < 2);
417+
return base.CanHealSingleSpell && (GCDHeal || aliveHealerCount == 1);
418418
}
419419
}
420420
public override bool CanHealAreaSpell
421421
{
422422
get
423423
{
424-
int healerCount = 0;
424+
int aliveHealerCount = 0;
425425
IEnumerable<IBattleChara> healers = PartyMembers.GetJobCategory(JobRole.Healer);
426426
foreach (IBattleChara h in healers)
427427
{
428-
healerCount++;
428+
if (!h.IsDead)
429+
aliveHealerCount++;
429430
}
430431

431-
return base.CanHealAreaSpell && (GCDHeal || healerCount < 2);
432+
return base.CanHealAreaSpell && (GCDHeal || aliveHealerCount == 1);
432433
}
433434
}
434435

BasicRotations/Melee/RPR_Reborn.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
public sealed class RPR_Reborn : ReaperRotation
77
{
88
#region Config Options
9-
[RotationConfig(CombatType.PvE, Name = "[Beta Option] Pool Shroud for Arcane Circle.")]
9+
[RotationConfig(CombatType.PvE, Name = "Pool Shroud for Arcane Circle.")]
1010
public bool EnshroudPooling { get; set; } = false;
1111

12-
[RotationConfig(CombatType.PvE, Name = "Use custom timing to refresh Death's Design")]
12+
[RotationConfig(CombatType.PvE, Name = "Use custom timing (below) to refresh Death's Design")]
1313
public bool UseCustomDDTiming { get; set; } = false;
1414

1515
[RotationConfig(CombatType.PvE, Name = "Refresh Death's Design with this many seconds remaining")]

BasicRotations/Ranged/Queen Timings

Lines changed: 0 additions & 30 deletions
This file was deleted.

RotationSolver.Basic/Configuration/Configs.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public const string
5757
Filter = AutoActionUsage, Section = 3)]
5858
private static readonly bool _statuscap2 = true;
5959

60-
[ConditionBool, UI("Don't attack new mobs by AoE. (Dangerous)", Description = "Never use any AoE action when this may attack mobs that are not hostile targets.",
60+
[ConditionBool, UI("Don't attack new mobs by AoE.", Description = "Never use any AoE action when this may attack mobs that are not hostile targets.",
6161
Filter = AutoActionUsage, Section = 3)]
6262
private static readonly bool _noNewHostiles = false;
6363

@@ -541,7 +541,13 @@ public const string
541541
Filter = HealingActionCondition, Section = 2,
542542
PvEFilter = JobFilterType.Raise, PvPFilter = JobFilterType.NoJob)]
543543
[Range(0, 10, ConfigUnitType.Seconds, 0.002f)]
544-
public Vector2 RaiseDelay { get; set; } = new(.25f, .75f);
544+
public Vector2 RaiseDelay { get; set; } = new(0f, 0f);
545+
546+
[UI("Random delay range for dispelling statuses.",
547+
Filter = HealingActionCondition, Section = 2,
548+
PvEFilter = JobFilterType.Dispel, PvPFilter = JobFilterType.NoJob)]
549+
[Range(0, 10, ConfigUnitType.Seconds, 0.002f)]
550+
public Vector2 EsunaDelay { get; set; } = new(0f, 0f);
545551

546552
[Range(0, 10000, ConfigUnitType.None, 200)]
547553
[UI("Never raise player if MP is less than this",

RotationSolver.Basic/Helpers/ReflectionHelper.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal static PropertyInfo[] GetStaticProperties<T>(this Type? type)
1515
{
1616
if (type == null)
1717
{
18-
return Array.Empty<PropertyInfo>();
18+
return [];
1919
}
2020

2121
PropertyInfo[] allProperties = type.GetProperties(BindingFlags.Static | BindingFlags.Public);
@@ -29,7 +29,7 @@ internal static PropertyInfo[] GetStaticProperties<T>(this Type? type)
2929
}
3030
}
3131

32-
PropertyInfo[] baseProperties = type.BaseType?.GetStaticProperties<T>() ?? Array.Empty<PropertyInfo>();
32+
PropertyInfo[] baseProperties = type.BaseType?.GetStaticProperties<T>() ?? [];
3333

3434
// Combine filteredProperties and baseProperties
3535
PropertyInfo[] result = new PropertyInfo[filteredProperties.Count + baseProperties.Length];
@@ -51,7 +51,7 @@ internal static IEnumerable<MethodInfo> GetAllMethodInfo(this Type? type)
5151
{
5252
if (type == null)
5353
{
54-
return Array.Empty<MethodInfo>();
54+
return [];
5555
}
5656

5757
MethodInfo[] allMethods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
@@ -64,7 +64,7 @@ internal static IEnumerable<MethodInfo> GetAllMethodInfo(this Type? type)
6464
}
6565
}
6666

67-
IEnumerable<MethodInfo> baseMethods = type.BaseType?.GetAllMethodInfo() ?? Array.Empty<MethodInfo>();
67+
IEnumerable<MethodInfo> baseMethods = type.BaseType?.GetAllMethodInfo() ?? [];
6868

6969
// Combine filteredMethods and baseMethods
7070
MethodInfo[] result = new MethodInfo[filteredMethods.Count + baseMethods.Count()];
@@ -85,10 +85,7 @@ internal static IEnumerable<MethodInfo> GetAllMethodInfo(this Type? type)
8585
/// <returns>The property information if found, otherwise null.</returns>
8686
internal static PropertyInfo? GetPropertyInfo(this Type type, string name)
8787
{
88-
if (type == null)
89-
{
90-
throw new ArgumentNullException(nameof(type));
91-
}
88+
ArgumentNullException.ThrowIfNull(type);
9289

9390
if (string.IsNullOrEmpty(name))
9491
{

RotationSolver/Updaters/TargetUpdater.cs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ internal static partial class TargetUpdater
1111
{
1212
private static readonly ObjectListDelay<IBattleChara>
1313
_raisePartyTargets = new(() => Service.Config.RaiseDelay),
14-
_raiseAllTargets = new(() => Service.Config.RaiseDelay);
14+
_raiseAllTargets = new(() => Service.Config.RaiseDelay),
15+
_dispelPartyTargets = new(() => Service.Config.EsunaDelay);
1516

1617
private static DateTime _lastUpdateTimeToKill = DateTime.MinValue;
1718
private static readonly TimeSpan TimeToKillUpdateInterval = TimeSpan.FromSeconds(1);
@@ -197,6 +198,18 @@ private static List<IBattleChara> GetAllHostileTargets()
197198
}
198199
}
199200

201+
// Apply raise delay
202+
if (raisetype == RaiseType.PartyOnly)
203+
{
204+
_raisePartyTargets.Delay(validRaiseTargets);
205+
validRaiseTargets = [.. _raisePartyTargets];
206+
}
207+
else
208+
{
209+
_raiseAllTargets.Delay(validRaiseTargets);
210+
validRaiseTargets = [.. _raiseAllTargets];
211+
}
212+
200213
// Only use the current RaiseType
201214
return GetPriorityDeathTarget(validRaiseTargets, raisetype);
202215
}
@@ -267,15 +280,18 @@ private static List<IBattleChara> GetAllHostileTargets()
267280

268281
private static IBattleChara? GetDispelTarget()
269282
{
270-
if (Player.Job is Job.WHM or Job.SCH or Job.AST or Job.SGE or
271-
Job.BRD)
283+
if (Player.Job is Job.WHM or Job.SCH or Job.AST or Job.SGE or Job.BRD)
272284
{
273285
List<IBattleChara> weakenPeople = [];
274286
List<IBattleChara> dyingPeople = [];
275287

276288
AddDispelTargets(DataCenter.PartyMembers, weakenPeople);
277289

278-
foreach (IBattleChara person in weakenPeople)
290+
// Apply dispel delay
291+
_dispelPartyTargets.Delay(weakenPeople);
292+
var delayedWeakenPeople = _dispelPartyTargets.ToList();
293+
294+
foreach (IBattleChara person in delayedWeakenPeople)
279295
{
280296
bool hasDangerous = false;
281297
if (person.StatusList != null)
@@ -296,7 +312,7 @@ private static List<IBattleChara> GetAllHostileTargets()
296312
}
297313
}
298314

299-
return GetClosestTarget(dyingPeople) ?? GetClosestTarget(weakenPeople);
315+
return GetClosestTarget(dyingPeople) ?? GetClosestTarget(delayedWeakenPeople);
300316
}
301317
return null;
302318
}

0 commit comments

Comments
 (0)