Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: fix for healing area when only one player in the party. Now need…
Browse files Browse the repository at this point in the history
…s there.
  • Loading branch information
ArchiDog1998 committed Jan 22, 2023
1 parent d2505b3 commit 38932a2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
32 changes: 19 additions & 13 deletions RotationSolver/Updaters/TargetUpdater_Friends.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ internal unsafe static void UpdateFriends()
#endregion

#region Health
var members = PartyMembers;

PartyMembersHP = TargetFilter.GetObjectInRadius(members, 30).Where(r => r.CurrentHp > 0).Select(p => (float)p.CurrentHp / p.MaxHp);
PartyMembersHP = TargetFilter.GetObjectInRadius(PartyMembers, 30).Where(r => r.CurrentHp > 0).Select(p => (float)p.CurrentHp / p.MaxHp);

float averHP = 0;
foreach (var hp in PartyMembersHP)
Expand All @@ -164,25 +162,33 @@ internal unsafe static void UpdateFriends()

var job = (ClassJobID)Service.ClientState.LocalPlayer.ClassJob.Id;

var hotSubArea = Service.Configuration.HealingOfTimeSubtractAreas.TryGetValue(job, out var value) ? value : 0.3f;

var areaHots = new StatusID[]
float value;
if(PartyMembers.Count() > 2)
{
var hotSubArea = Service.Configuration.HealingOfTimeSubtractAreas.TryGetValue(job, out value) ? value : 0.3f;

var areaHots = new StatusID[]
{
StatusID.AspectedHelios,
StatusID.Medica2,
StatusID.TrueMedica2,
};
};

//TODO:少了所有罩子类技能
var ratio = GetHealingOfTimeRatio(Service.ClientState.LocalPlayer, areaHots) * hotSubArea;
//TODO:少了所有罩子类技能
var ratio = GetHealingOfTimeRatio(Service.ClientState.LocalPlayer, areaHots) * hotSubArea;

var healAreability = ConfigurationHelper.GetHealAreaAbility(job);
var healAreability = ConfigurationHelper.GetHealAreaAbility(job);

var healAreaspell = ConfigurationHelper.GetHealAreafSpell(job);
var healAreaspell = ConfigurationHelper.GetHealAreafSpell(job);

CanHealAreaAbility = PartyMembersDifferHP < Service.Configuration.HealthDifference && PartyMembersAverHP < healAreability - ratio;
CanHealAreaAbility = PartyMembersDifferHP < Service.Configuration.HealthDifference && PartyMembersAverHP < healAreability - ratio;

CanHealAreaSpell = PartyMembersDifferHP < Service.Configuration.HealthDifference && PartyMembersAverHP < healAreaspell - ratio;
CanHealAreaSpell = PartyMembersDifferHP < Service.Configuration.HealthDifference && PartyMembersAverHP < healAreaspell - ratio;
}
else
{
CanHealAreaAbility = CanHealAreaSpell = false;
}

var hotSubSingle = Service.Configuration.HealingOfTimeSubtractSingles.TryGetValue(job, out value) ? value : 0.3f;

Expand Down
6 changes: 5 additions & 1 deletion RotationSolver/Windows/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Linq;
using RotationSolver.Actions.BaseAction;
using FFXIVClientStructs.FFXIV.Client.Game.Fate;
using System;

namespace RotationSolver.Windows.RotationConfigWindow;
#if DEBUG
Expand All @@ -22,7 +23,10 @@ private unsafe void DrawDebugTab()
ImGui.Text("All: " + TargetUpdater.AllTargets.Count().ToString());
ImGui.Text("Hostile: " + TargetUpdater.HostileTargets.Count().ToString());
ImGui.Text("Friends: " + TargetUpdater.PartyMembers.Count().ToString());
ImGui.Text("Fate: " + FateManager.Instance()->FateJoined.ToString());
if ((IntPtr)FateManager.Instance() != IntPtr.Zero)
{
ImGui.Text("Fate: " + FateManager.Instance()->FateJoined.ToString());
}

if (ImGui.CollapsingHeader("Status from self."))
{
Expand Down
2 changes: 1 addition & 1 deletion docs/RotationDev/rotation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rotation Part

We just started a simple 123 rotation. Obviously, it doesn't solve the complex combats. In this part, lets see how many methods can we override, and how to use them.
We just started a simple 123 rotation. Obviously, it doesn't solve the complex combats. In this part, lets see how many methods can we override, and how to use them. That is the major work for the rotation developers.

## GCD

Expand Down

0 comments on commit 38932a2

Please sign in to comment.