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

Commit

Permalink
fix: fixed the knockback casting.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 23, 2023
1 parent 065d8a7 commit b69f6df
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
3 changes: 2 additions & 1 deletion Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
"8166": 2.1,
"8341": 0.1,
"8570": 0.1,
"8701": 2.1,
"9483": 0.6,
"9793": 0.1,
"10079": 2.1,
Expand Down Expand Up @@ -456,7 +457,7 @@
"24297": 0.6,
"24298": 0.6,
"24299": 0.6,
"24300": 0.6,
"24300": 2.1,
"24301": 0.6,
"24302": 0.6,
"24303": 0.6,
Expand Down
6 changes: 5 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,9 @@
1761,
1554,
1384,
8230
8230,
20428,
21004,
21000,
20996
]
14 changes: 1 addition & 13 deletions Resources/InputConfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
"KeyState": {
"Cancel": {
"Key": 82,
"Control": false,
"Alt": false,
"Shift": false
}
},
"KeyState": {},
"KeySpecial": {
"EsunaStanceNorth": {
"Key": 191,
Expand All @@ -26,11 +19,6 @@
"Button": 16,
"L2": false,
"R2": true
},
"Cancel": {
"Button": 32,
"L2": false,
"R2": true
}
},
"ButtonSpecial": {
Expand Down
11 changes: 8 additions & 3 deletions RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,14 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO
}
}

if (DataCenter.NoPoslock && DataCenter.IsMoving && DateTime.Now > DataCenter.KnockbackFinished
&& !option.HasFlag(CanUseOption.IgnoreCastCheck) && CastTime > 0
&& !player.HasStatus(true, CustomRotation.Swiftcast.StatusProvide)) return false;
//Need casting.
if (CastTime > 0 && !player.HasStatus(true, CustomRotation.Swiftcast.StatusProvide))
{
//Is knocking back.
if (DateTime.Now > DataCenter.KnockbackStart && DateTime.Now < DataCenter.KnockbackFinished) return false;

if (DataCenter.NoPoslock && DataCenter.IsMoving && !option.HasFlag(CanUseOption.IgnoreCastCheck)) return false;
}

if (IsGeneralGCD && IsEot && IsFriendly && IActionHelper.IsLastGCD(true, this)
&& DataCenter.TimeSinceLastAction.TotalSeconds < 3) return false;
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,5 +414,6 @@ internal static void AddDamageRec(float damageRatio)
}

internal static DateTime KnockbackFinished { get; set; } = DateTime.MinValue;
internal static DateTime KnockbackStart { get; set; } = DateTime.MinValue;
#endregion
}
4 changes: 4 additions & 0 deletions RotationSolver/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ private static void ActionFromEnemy(ActionEffectSet set)
var knock = Svc.Data.GetExcelSheet<Knockback>()?.GetRow(entry.value);
if(knock != null)
{
DataCenter.KnockbackStart = DateTime.Now;
DataCenter.KnockbackFinished = DateTime.Now + TimeSpan.FromSeconds(knock.Distance / (float)knock.Speed);
#if DEBUG
Svc.Chat.Print($"Knock back: {DataCenter.KnockbackStart} - {DataCenter.KnockbackFinished}");
#endif
}
break;
}
Expand Down

0 comments on commit b69f6df

Please sign in to comment.