Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.1f actionahdead and various text fixes #84

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public const string
private static readonly bool _useAOEAction = true;

[ConditionBool, UI("Use single target AoE actions in manual mode.", Parent = nameof(UseAoeAction))]
private static readonly bool _useAOEWhenManual = false;
private static readonly bool _useAOEWhenManual = true;

[ConditionBool, UI("Automatically trigger dps burst phase.", Filter = AutoActionCondition)]
private static readonly bool _autoBurst = true;
Expand Down Expand Up @@ -491,7 +491,7 @@ public const string
[Range(0, 3, ConfigUnitType.Seconds)]
public Vector2 TargetDelay { get; set; } = new(1, 2);

[UI("Action Execution Delay.\n(RSR will not take actions during window).",
[UI("Action Execution Delay. (RSR will not take actions during window).",
Filter = BasicTimer)]
[Range(0, 1, ConfigUnitType.Seconds, 0.002f)]
public Vector2 WeaponDelay { get; set; } = new(0, 0);
Expand Down Expand Up @@ -708,9 +708,9 @@ public const string
PvEFilter = JobFilterType.Tank)]
private readonly float _healthForAutoDefense = 1;

[JobConfig, Range(0, 0.5f, ConfigUnitType.Seconds)]
[UI("Action Ahead (How far ahead of a oGCD/GCD use does RSR decide which oGCD/GCD to use)", Filter = BasicTimer)]
private readonly float _action4head = 0.08f;
[JobConfig, Range(0, 0.1f, ConfigUnitType.Seconds)]
[UI("Action Ahead (How far ahead of a GCD use does RSR starts to try to use the GCD)", Filter = BasicTimer)]
private readonly float _actionAhead = 0.10f;

[JobConfig, UI("Engage settings", Filter = TargetConfig, PvPFilter = JobFilterType.NoJob)]
private readonly TargetHostileType _hostileType = TargetHostileType.AllTargetsWhenSolo;
Expand Down
8 changes: 4 additions & 4 deletions RotationSolver/Data/UiString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,16 @@ internal enum UiString
[Description("No Casting debuffs")]
ConfigWindow_List_NoCastingStatus,

[Description("Ignores target if it has one of this statuses")]
[Description("Ignores target if it has one of these statuses")]
ConfigWindow_List_InvincibilityDesc,

[Description("Attacks the target first if it has one of this statuses")]
[Description("Attacks the target first if it has one of these statuses")]
ConfigWindow_List_PriorityDesc,

[Description("Dispellable debuffs list")]
ConfigWindow_List_DangerousStatusDesc,

[Description("No Casting debuffs List")]
[Description("Do no action if you have one of these debuffs")]
ConfigWindow_List_NoCastingStatusDesc,

[Description("Copy to Clipboard")]
Expand Down Expand Up @@ -429,7 +429,7 @@ internal enum UiString
[Description("Hostile")]
ConfigWindow_List_Hostile,

[Description("Enemy targetting logic. Adding more options cycles them when using /rotation Auto.")]
[Description("Enemy targeting logic. Adding more options cycles them when using /rotation Auto.")]
ConfigWindow_Param_HostileDesc,

[Description("Move Up")]
Expand Down
16 changes: 13 additions & 3 deletions RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,11 @@ internal unsafe static bool CanDoAction()
&& ActionManager.Instance()->QueuedActionId != NextAction.AdjustedID
|| Player.Object.CurrentHp == 0) return false;

var maxAhead = ActionManagerHelper.GetCurrentAnimationLock();
var maxAhead = Math.Max(ActionManagerHelper.GetCurrentAnimationLock() - DataCenter.Ping, 0.1f);
var ahead = Math.Min(maxAhead, Service.Config.ActionAhead);

//GCD
var canUseGCD = DataCenter.WeaponRemain <= maxAhead;
var canUseGCD = DataCenter.WeaponRemain <= ahead;
if (_GCDDelay.Delay(canUseGCD))
{
return RSCommands.CanDoAnAction(true);
Expand All @@ -292,11 +293,20 @@ internal unsafe static bool CanDoAction()
var nextAction = NextAction;
if (nextAction == null) return false;

var timeToNext = DataCenter.ActionRemain;

//Skip when casting
if (DataCenter.WeaponElapsed <= DataCenter.CastingTotal) return false;

//The last one.
if (maxAhead <= DataCenter.WeaponRemain)
if (timeToNext + nextAction.AnimationLockTime + DataCenter.Ping > DataCenter.WeaponRemain)
{
if (DataCenter.WeaponRemain > nextAction.AnimationLockTime + DataCenter.Ping +
maxAhead) return false;

return RSCommands.CanDoAnAction(false);
}
else if (timeToNext < ahead)
{
return RSCommands.CanDoAnAction(false);
}
Expand Down