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

Commit

Permalink
fix: change the delay to Not In Combat Delay. For something need to d…
Browse files Browse the repository at this point in the history
…o Not In Combat.
  • Loading branch information
ArchiDog1998 committed Feb 8, 2023
1 parent a64db9c commit ffc2c43
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions RotationSolver/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public class PluginConfiguration : IPluginConfiguration
public float InterruptDelayMin = 0.5f;
public float InterruptDelayMax = 1;

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

public bool UseWorkTask = true;
public int WorkTaskDelay = 10;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Helpers/TargetFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ internal static IEnumerable<BattleChara> GetJobCategory(this IEnumerable<BattleC
});
}

private static bool IsJobCategory(this BattleChara obj, JobRole role)
internal static bool IsJobCategory(this BattleChara obj, JobRole role)
{
SortedSet<byte> validJobs = new(Service.DataManager.GetExcelSheet<ClassJob>()
.Where(job => role == job.GetJobRole())
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"Configwindow_Param_UseItemDesc": "Use poison, WIP",
"Configwindow_Param_Conditon": "Condition",
"Configwindow_Param_StartOnCountdown": "Turn on auto-rotation on countdown",
"Configwindow_Param_EsunaAll": "Esuna All Statuses.",
"Configwindow_Param_InterruptibleMoreCheck": "Interrupt the action with action type check.",
"Configwindow_Param_HealOutOfCombat": "Heal party members outside of combat.",
"Configwindow_Param_HealthDifference": "Set the HP standard deviation threshold for using AOE heal (ability & spell)",
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Localization/Strings_Major.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +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_NotInCombatDelay { get; set; } = "Set the range of random delay for Not In Combat 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
1 change: 1 addition & 0 deletions RotationSolver/Rotations/Basic/AST_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ internal abstract class AST_Base : CustomRotation.CustomRotation
/// </summary>
public static IBaseAction AspectedHelios { get; } = new BaseAction(ActionID.AspectedHelios, true, isEot: true, isTimeline: true)
{
ActionCheck = b => !IsLastGCD(ActionID.AspectedHelios),
StatusProvide = new StatusID[] { StatusID.AspectedHelios },
};

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

static 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 => _pelotonDelay.Delay(!InCombat) && TargetUpdater.PartyMembers.GetObjectInRadius(20)
ActionCheck = b => NotInCombatDelay && TargetUpdater.PartyMembers.GetObjectInRadius(20)
.Any(p => p.WillStatusEnd(3, false, StatusID.Peloton)),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ internal abstract partial class CustomRotation
/// </summary>
protected static bool InBurst => RSCommands.SpecialType == SpecialCommandType.Burst || Service.Configuration.AutoBurst;

static RandomDelay _notInCombatDelay = new RandomDelay(() =>
(Service.Configuration.NotInCombatDelayMin, Service.Configuration.NotInCombatDelayMax));
/// <summary>
/// Is in combat.
/// </summary>
protected static bool InCombat => ActionUpdater.InCombat;

protected static bool NotInCombatDelay => _notInCombatDelay.Delay(!InCombat);

/// <summary>
/// The player's target.
/// </summary>
Expand Down
7 changes: 5 additions & 2 deletions RotationSolver/Rotations/Healer/AST/AST_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using RotationSolver.Rotations.CustomRotation;
using RotationSolver.Updaters;
using System.Collections.Generic;
using System.Data;
using System.Linq;

namespace RotationSolver.Rotations.Healer.AST;
Expand All @@ -30,6 +31,7 @@ internal sealed class AST_Default : AST_Base
private static IBaseAction AspectedBeneficDefense { get; } = new BaseAction(ActionID.AspectedBenefic, true, isEot: true)
{
ChoiceTarget = TargetFilter.FindAttackedTarget,
ActionCheck = b => b.IsJobCategory(JobRole.Tank),
TargetStatus = new StatusID[] { StatusID.AspectedBenefic },
};

Expand All @@ -54,8 +56,7 @@ private protected override bool DefenceAreaAbility(byte abilitiesRemaining, out
private protected override bool GeneralGCD(out IAction act)
{
//Add AspectedBeneficwhen not in combat.
if (!InCombat && TargetUpdater.PartyTanks.Any(t => !t.HasStatus(true, StatusID.AspectedBenefic))
&& AspectedBeneficDefense.CanUse(out act)) return true;
if (NotInCombatDelay && AspectedBeneficDefense.CanUse(out act)) return true;

//群体输出
if (Gravity.CanUse(out act)) return true;
Expand Down Expand Up @@ -85,6 +86,8 @@ private protected override bool EmergencyAbility(byte abilityRemain, IAction nex
{
if (base.EmergencyAbility(abilityRemain, nextGCD, out act)) return true;

if (!InCombat) return false;

//如果要群奶了,先上个天宫图!
if (nextGCD.IsTheSameTo(true, AspectedHelios, Helios))
{
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Windows/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ 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);
DrawRangedFloat(LocalizationManager.RightLang.Configwindow_Param_NotInCombatDelay,
ref Service.Configuration.NotInCombatDelayMin, ref Service.Configuration.NotInCombatDelayMax);

//if (Service.Configuration.UseStopCasting)
//{
Expand Down

0 comments on commit ffc2c43

Please sign in to comment.