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

Commit

Permalink
fix: add a feature for casting ahead when count down..
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 19, 2023
1 parent 8ba99fd commit 1429a01
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
3 changes: 2 additions & 1 deletion RotationSolver/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class PluginConfiguration : IPluginConfiguration
public bool InterruptibleMoreCheck = true;
public float SpecialDuration = 3;
public float WeaponInterval = 0.67f;
public float WeaponFaster = 0.08f;
public float WeaponAhead = 0.08f;

public float WeaponDelayMin = 0;
public float WeaponDelayMax = 0;
Expand Down Expand Up @@ -129,6 +129,7 @@ public class PluginConfiguration : IPluginConfiguration
public bool OnlyAttackInView = false;

public string PositionalErrorText = string.Empty;
public float CountDownAhead = 0.6f;

public int MoveTargetAngle = 24;
public List<TargetingType> TargetingTypes { get; set; } = new List<TargetingType>();
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Localization/Strings_Major.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ internal partial class Strings
public string Configwindow_Param_UseOverlayWindowDesc { get; set; } = "This window is currently used to cue the body position in advance.";
public string Configwindow_Param_Basic { get; set; } = "Basic";

public string Configwindow_Param_WeaponFaster { get; set; } = "Set the time advance of use actions";
public string Configwindow_Param_WeaponAhead { get; set; } = "Set the time advance of use actions";
public string Configwindow_Param_WeaponInterval { get; set; } = "Set the interval between abilities using";
public string Configwindow_Param_CountDownAhead { get; set; } = "Set the time advance of use casting actions on counting down.";
public string Configwindow_Param_SpecialDuration { get; set; } = "Set the duration of special windows set by commands";
public string Configwindow_Param_AddDotGCDCount { get; set; } = "Set GCD advance of DOT refresh";
public string Configwindow_Param_AutoOffBetweenArea { get; set; } = "Turn off when player is between area.";
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Rotations/RangedMagicial/BLM/BLM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private protected override IRotationConfigSet CreateConfiguration()
private protected override IAction CountDownAction(float remainTime)
{
IAction act;
if(remainTime < Fire3.CastTime + Service.Configuration.WeaponInterval)
if(remainTime < Fire3.CastTime + Service.Configuration.CountDownAhead)
{
if (Fire3.CanUse(out act)) return act;
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Rotations/RangedMagicial/RDM/RDM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private protected override IRotationConfigSet CreateConfiguration()

private protected override IAction CountDownAction(float remainTime)
{
if (remainTime < Verthunder.CastTime + Service.Configuration.WeaponInterval
if (remainTime < Verthunder.CastTime + Service.Configuration.CountDownAhead
&& Verthunder.CanUse(out var act)) return act;

//Remove Swift
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Rotations/RangedMagicial/SMN/SMN_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ private protected override IAction CountDownAction(float remainTime)
{
if (remainTime <= 30 && SummonCarbuncle.CanUse(out _)) return SummonCarbuncle;
//1.5s预读毁3
if (remainTime <= 1.5f && Ruin.CanUse(out _)) return Ruin;
if (remainTime <= Ruin.CastTime + Service.Configuration.CountDownAhead
&& Ruin.CanUse(out _)) return Ruin;
return base.CountDownAction(remainTime);
}

Expand Down
6 changes: 3 additions & 3 deletions RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ internal unsafe static void DoAction()
|| ActionManager.Instance()->ActionQueued) return;

//GCD
var canUseGCD = WeaponRemain <= Service.Configuration.WeaponFaster;
var canUseGCD = WeaponRemain <= Service.Configuration.WeaponAhead;
if (_GCDDelay.Delay(canUseGCD)) RSCommands.DoAnAction(true);
if (canUseGCD) return;

Expand All @@ -203,12 +203,12 @@ internal unsafe static void DoAction()
//只剩下最后一个能力技了,然后卡最后!
if (WeaponRemain < 2 * Service.Configuration.WeaponInterval)
{
if (WeaponRemain > Service.Configuration.WeaponInterval + Service.Configuration.WeaponFaster) return;
if (WeaponRemain > Service.Configuration.WeaponInterval + Service.Configuration.WeaponAhead) return;
RSCommands.DoAnAction(false);

return;
}
else if ((WeaponElapsed - _lastCastingTotal) % Service.Configuration.WeaponInterval <= Service.Configuration.WeaponFaster)
else if ((WeaponElapsed - _lastCastingTotal) % Service.Configuration.WeaponInterval <= Service.Configuration.WeaponAhead)
{
RSCommands.DoAnAction(false);
}
Expand Down
7 changes: 5 additions & 2 deletions RotationSolver/Windows/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ private void DrawParamBasic()
ref Service.Configuration.UseOverlayWindow,
LocalizationManager.RightLang.Configwindow_Param_UseOverlayWindowDesc);

DrawFloatNumber(LocalizationManager.RightLang.Configwindow_Param_WeaponFaster,
ref Service.Configuration.WeaponFaster, max: 0.1f);
DrawFloatNumber(LocalizationManager.RightLang.Configwindow_Param_WeaponAhead,
ref Service.Configuration.WeaponAhead, max: 0.1f);

DrawFloatNumber(LocalizationManager.RightLang.Configwindow_Param_WeaponInterval,
ref Service.Configuration.WeaponInterval, min: 0.5f, max: 0.7f);

DrawFloatNumber(LocalizationManager.RightLang.Configwindow_Param_CountDownAhead,
ref Service.Configuration.CountDownAhead, min: 0.5f, max: 0.7f);

DrawFloatNumber(LocalizationManager.RightLang.Configwindow_Param_SpecialDuration,
ref Service.Configuration.SpecialDuration, speed: 0.02f, min: 1, max: 20);

Expand Down

0 comments on commit 1429a01

Please sign in to comment.