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

Commit

Permalink
fix: changed the click time by animationLockTime.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 19, 2023
1 parent 8a9e8fc commit 2af2bf2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public static float RatioOfMembersIn2minsBurst
public static Queue<MacroItem> Macros { get; } = new Queue<MacroItem>();

#region Action Record
public static DateTime NextActionMinTime { get; set; }
public static DateTime NextActionTime { get; set; }

const int QUEUECAPACITY = 32;
private static Queue<ActionRec> _actions = new Queue<ActionRec>(QUEUECAPACITY);
Expand Down
19 changes: 10 additions & 9 deletions RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,24 +205,25 @@ internal unsafe static void DoAction()
if (canUseGCD) return;

var ping = 0.06f;
var nextAction = NextAction;
if (nextAction == null) return;

//More then gcd.
if (DataCenter.WeaponRemain < Service.Config.AbilitiesInterval
|| DataCenter.WeaponElapsed < Service.Config.AbilitiesInterval)
{
return;
}
var timeToNext = (DataCenter.NextActionTime - DateTime.Now).TotalSeconds;

//No time to use 0gcd
if (timeToNext + nextAction.AnimationLockTime
> DataCenter.WeaponRemain) return;

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

//The last one.
if (DataCenter.WeaponRemain < 2 * Service.Config.AbilitiesInterval)
if (timeToNext + nextAction.AnimationLockTime +ping + 0.6f > DataCenter.WeaponRemain)
{
if (DataCenter.WeaponRemain > Service.Config.AbilitiesInterval + Service.Config.ActionAhead * 2) return;
if (DataCenter.WeaponRemain > nextAction.AnimationLockTime + Service.Config.ActionAhead) return;
RSCommands.DoAnAction(false);
}
else if ((DataCenter.WeaponElapsed - DataCenter.CastingTotal) % Service.Config.AbilitiesInterval <= Service.Config.ActionAhead)
else if (timeToNext < Service.Config.ActionAhead)
{
RSCommands.DoAnAction(false);
}
Expand Down
3 changes: 1 addition & 2 deletions RotationSolver/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private static void ActionFromSelf(uint sourceId, ActionEffectSet set, uint id)
if (set.Type != ActionType.Spell && set.Type != ActionType.Item) return;
if ((ActionCate)set.Action?.ActionCategory.Value.RowId == ActionCate.AutoAttack) return;

IActionHelper.AnimationLockTime[id] = set.AnimationLock;
DataCenter.NextActionTime = DateTime.Now.AddSeconds(IActionHelper.AnimationLockTime[id] = set.AnimationLock);

if (!set.TargetEffects.Any()) return;
var flag = set.TargetEffects.FirstOrDefault()[0].Param2;
Expand All @@ -89,7 +89,6 @@ private static void ActionFromSelf(uint sourceId, ActionEffectSet set, uint id)

//Record
DataCenter.AddActionRec(set.Action);
DataCenter.NextActionMinTime = DateTime.Now.AddSeconds(set.AnimationLock);
ShowStrSelf = set.ToString();

//Macro
Expand Down

0 comments on commit 2af2bf2

Please sign in to comment.