Skip to content

Commit

Permalink
Merge pull request #421 from FFXIV-CombatReborn/minor-update
Browse files Browse the repository at this point in the history
Update JSON entries and enhance DataCenter.cs logic
  • Loading branch information
LTS-FFXIV authored Sep 29, 2024
2 parents 6ee9f32 + 8216e16 commit caa5f2a
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 49 deletions.
21 changes: 20 additions & 1 deletion Resources/BeneficialPositions.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,24 @@
"1186": [],
"816": [],
"1198": [],
"957": []
"957": [],
"751": [
{
"X": 0.015657552,
"Y": 0.0,
"Z": -0.0062397607
}
],
"132": [],
"1048": [],
"1169": [
{
"X": 100.05093,
"Y": 0.0,
"Z": 100.0046
}
],
"981": [],
"1064": [],
"1062": []
}
6 changes: 5 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,9 @@
13085,
13074,
26050,
26049
26049,
28718,
28720,
29379,
3338
]
3 changes: 2 additions & 1 deletion Resources/HostileCastingKnockback.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
29000,
28981,
29003,
37662
37662,
10535
]
3 changes: 2 additions & 1 deletion Resources/HostileCastingTank.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
29023,
10542,
26040,
26041
26041,
28717
]
2 changes: 1 addition & 1 deletion Resources/InvincibleStatus.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
3039,
3052,
3054
]
]
18 changes: 18 additions & 0 deletions Resources/NoHostileNames.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,23 @@
],
"957": [
""
],
"132": [
""
],
"1048": [
""
],
"1169": [
""
],
"981": [
""
],
"1064": [
""
],
"1062": [
""
]
}
18 changes: 18 additions & 0 deletions Resources/NoProvokeNames.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,23 @@
],
"957": [
""
],
"132": [
""
],
"1048": [
""
],
"1169": [
""
],
"981": [
""
],
"1064": [
""
],
"1062": [
""
]
}
19 changes: 19 additions & 0 deletions Resources/PrioTargetNames.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,24 @@
"1046": [
"Granite Gaol",
""
],
"132": [
""
],
"1048": [
""
],
"1169": [
""
],
"981": [
""
],
"1064": [
"Drakespur",
""
],
"1062": [
""
]
}
2 changes: 1 addition & 1 deletion Resources/PriorityStatus.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
2655,
1290,
861
]
]
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Data/RaiseType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public enum RaiseType : byte
/// <summary>
/// Raise party and alliance members.
/// </summary>
[Description("Raise party and alliance members.")]
[Description("Raise all.")]
PartyAndAlliance,

/// <summary>
/// Raise party members and alliance healers.
/// </summary>
[Description("Raise party members and alliance healers.")]
[Description("Raise party members and non-party healers.")]
PartyAndAllianceHealers,
}
90 changes: 49 additions & 41 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using RotationSolver.Basic.Configuration;
using RotationSolver.Basic.Configuration.Conditions;
using RotationSolver.Basic.Rotations.Duties;
using Svg.FilterEffects;
using Action = Lumina.Excel.GeneratedSheets.Action;
using CharacterManager = FFXIVClientStructs.FFXIV.Client.Game.Character.CharacterManager;

Expand Down Expand Up @@ -313,7 +314,7 @@ internal static float RaidTimeRaw
public unsafe static IBattleChara[] AllianceMembers => AllTargets.Where(ObjectHelper.IsAlliance)
.Where(b => b.Character()->CharacterData.OnlineStatus != 15 && b.IsTargetable).ToArray();

public static unsafe IBattleChara[] FriendlyNPCMembers
public unsafe static IBattleChara[] FriendlyNPCMembers
{
get
{
Expand Down Expand Up @@ -374,60 +375,67 @@ public static IBattleChara? DeathTarget
{
get
{
// Ensure AllianceMembers and PartyMembers are not null
if (AllianceMembers == null || PartyMembers == null) return null;
// Added so it only tracks deathtarget if you are on a raise job
var rotation = DataCenter.RightNowRotation;
if (Player.Job == Job.WHM || Player.Job == Job.SCH || Player.Job == Job.AST || Player.Job == Job.SGE ||
Player.Job == Job.SMN || Player.Job == Job.RDM)
{
// Ensure AllianceMembers and PartyMembers are not null
if (AllianceMembers == null || PartyMembers == null) return null;

var deathAll = AllianceMembers.GetDeath();
var deathParty = PartyMembers.GetDeath();
var deathNPC = FriendlyNPCMembers.GetDeath();
var deathAll = AllianceMembers.GetDeath();
var deathParty = PartyMembers.GetDeath();
var deathNPC = FriendlyNPCMembers.GetDeath();

// Check death in party members
if (deathParty.Any())
{
var deathT = deathParty.GetJobCategory(JobRole.Tank).ToList();
var deathH = deathParty.GetJobCategory(JobRole.Healer).ToList();
// Check death in party members
if (deathParty.Any())
{
var deathT = deathParty.GetJobCategory(JobRole.Tank).ToList();
var deathH = deathParty.GetJobCategory(JobRole.Healer).ToList();

if (deathT.Count > 1) return deathT.FirstOrDefault();
if (deathH.Any()) return deathH.FirstOrDefault();
if (deathT.Any()) return deathT.FirstOrDefault();
if (deathT.Count > 1) return deathT.FirstOrDefault();
if (deathH.Any()) return deathH.FirstOrDefault();
if (deathT.Any()) return deathT.FirstOrDefault();

return deathParty.FirstOrDefault();
}
return deathParty.FirstOrDefault();
}

// Check death in alliance members
if (deathAll.Any())
{
if (Service.Config.RaiseType == RaiseType.PartyAndAllianceHealers)
// Check death in alliance members
if (deathAll.Any())
{
var deathAllH = deathAll.GetJobCategory(JobRole.Healer).ToList();
if (deathAllH.Any()) return deathAllH.FirstOrDefault();
if (Service.Config.RaiseType == RaiseType.PartyAndAllianceHealers)
{
var deathAllH = deathAll.GetJobCategory(JobRole.Healer).ToList();
if (deathAllH.Any()) return deathAllH.FirstOrDefault();
}

if (Service.Config.RaiseType == RaiseType.PartyAndAlliance)
{
var deathAllH = deathAll.GetJobCategory(JobRole.Healer).ToList();
var deathAllT = deathAll.GetJobCategory(JobRole.Tank).ToList();

if (deathAllH.Any()) return deathAllH.FirstOrDefault();
if (deathAllT.Any()) return deathAllT.FirstOrDefault();

return deathAll.FirstOrDefault();
}
}

if (Service.Config.RaiseType == RaiseType.PartyAndAlliance)
// Check death in friendly NPC members
if (deathNPC.Any() && Service.Config.FriendlyPartyNpcHealRaise)
{
var deathAllH = deathAll.GetJobCategory(JobRole.Healer).ToList();
var deathAllT = deathAll.GetJobCategory(JobRole.Tank).ToList();
var deathNPCT = deathNPC.GetJobCategory(JobRole.Tank).ToList();
var deathNPCH = deathNPC.GetJobCategory(JobRole.Healer).ToList();

if (deathAllH.Any()) return deathAllH.FirstOrDefault();
if (deathAllT.Any()) return deathAllT.FirstOrDefault();
if (deathNPCT.Count > 1) return deathNPCT.FirstOrDefault();
if (deathNPCH.Any()) return deathNPCH.FirstOrDefault();
if (deathNPCT.Any()) return deathNPCT.FirstOrDefault();

return deathAll.FirstOrDefault();
return deathNPC.FirstOrDefault();
}
}

// Check death in friendly NPC members
if (deathNPC.Any() && Service.Config.FriendlyPartyNpcHealRaise)
{
var deathNPCT = deathNPC.GetJobCategory(JobRole.Tank).ToList();
var deathNPCH = deathNPC.GetJobCategory(JobRole.Healer).ToList();

if (deathNPCT.Count > 1) return deathNPCT.FirstOrDefault();
if (deathNPCH.Any()) return deathNPCH.FirstOrDefault();
if (deathNPCT.Any()) return deathNPCT.FirstOrDefault();

return deathNPC.FirstOrDefault();
return null;
}

return null;
}
}
Expand Down

0 comments on commit caa5f2a

Please sign in to comment.