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

Commit

Permalink
fix: add poleton delay.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 6, 2023
1 parent 63c0f4f commit 7a34239
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions RotationSolver/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ public class PluginConfiguration : IPluginConfiguration
public float InterruptDelayMin = 0.5f;
public float InterruptDelayMax = 1;

public float PelotonDelayMin = 1f;
public float PelotonDelayMax = 2;

public bool UseWorkTask = true;
public int WorkTaskDelay = 10;
public bool ShowWorkTaskFPS = true;
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"Configwindow_Param_InterruptDelay": "Set the range of random delay for interrupting hostile targets in second.",
"Configwindow_Param_WeakenDelay": "Set the range of random delay for esuna weakens in second.",
"Configwindow_Param_HealDelay": "Set the range of random delay for healing people in second.",
"Configwindow_Param_PelotonDelay": "Set the range of random delay for peloton usage in second.",
"Configwindow_Param_StopCastingDelay": "Set the range of random delay for stoping casting when target is dead in second.",
"Configwindow_Param_WorkTaskDelay": "Set the work task delay in millisecond. Smaller, more precise, more resource-intensive",
"Configwindow_Param_Display": "Display",
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/Strings_Major.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ internal partial class Strings

public string Configwindow_Param_HealDelay { get; set; } = "Set the range of random delay for healing people in second.";

public string Configwindow_Param_PelotonDelay { get; set; } = "Set the range of random delay for peloton usage in second.";
public string Configwindow_Param_StopCastingDelay { get; set; } = "Set the range of random delay for stoping casting when target is dead in second.";
public string Configwindow_Param_WorkTaskDelay { get; set; } = "Set the work task delay in millisecond. Smaller, more precise, more resource-intensive";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,15 @@ internal RoleAction(ActionID actionID, JobRole[] roles, bool isFriendly = false,
StatusProvide = new StatusID[] { StatusID.TrueNorth },
};

static readonly RandomDelay _pelotonDelay = new RandomDelay(() =>
(Service.Configuration.PelotonDelayMin, Service.Configuration.PelotonDelayMax));
/// <summary>
/// 速行
/// </summary>
public static IBaseAction Peloton { get; } = new RoleAction(ActionID.Peloton, new JobRole[] { JobRole.RangedPhysical }, true)
{
ActionCheck = b => !InCombat && TargetUpdater.PartyMembers.GetObjectInRadius(20).Any(p =>
p.WillStatusEnd(2, false, StatusID.Peloton)),
ActionCheck = b => !InCombat && _pelotonDelay.Delay(TargetUpdater.PartyMembers.GetObjectInRadius(20)
.Any(p => p.WillStatusEnd(4, false, StatusID.Peloton))),
};

private protected virtual IBaseAction Raise => null;
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Windows/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ private void DrawParty()
ImGui.Text("CanHealAreaSpell: " + TargetUpdater.CanHealAreaSpell.ToString());
}

private void DrawTargetData()
private unsafe void DrawTargetData()
{
if (Service.TargetManager.Target is BattleChara b)
{
ImGui.Text("Is Boss: " + b.IsBoss().ToString());
ImGui.Text("Has Positional: " + b.HasPositional().ToString());
ImGui.Text("Is Dying: " + b.IsDying().ToString());
ImGui.Text("NamePlate: " + ((FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)(void*)b.Address)->NamePlateIconId.ToString());

foreach (var status in b.StatusList)
{
Expand Down
3 changes: 3 additions & 0 deletions RotationSolver/Windows/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ private void DrawParamDelay()
DrawRangedFloat(LocalizationManager.RightLang.Configwindow_Param_HealDelay,
ref Service.Configuration.HealDelayMin, ref Service.Configuration.HealDelayMax);

DrawRangedFloat(LocalizationManager.RightLang.Configwindow_Param_PelotonDelay,
ref Service.Configuration.PelotonDelayMin, ref Service.Configuration.PelotonDelayMax);

//if (Service.Configuration.UseStopCasting)
//{
// DrawRangedFloat(LocalizationManager.RightLang.Configwindow_Param_StopCastingDelay,
Expand Down

0 comments on commit 7a34239

Please sign in to comment.