Buff chain: no fast-path buff right after a movement call
With FastBuffChain on, a buff went out 50 ms after a nav StopCompletelyBy: the fast path skips the animation gate, and the motion the stop starts was still playing on the client. MoveAudit now counts every movement call routed through it that reaches the client (MovementSends: a start, a stop, a turn, or a held stop sent by FlushPendingStops). Jumps and movement other plugins send on their own (RynthNav, RynthLua) do not go through MoveAudit and are not counted. BuffCastChain records the count when a buff goes out, and Eligible refuses the fast path when it has changed since. While a held stop is still waiting to be sent (MoveAudit.HasPendingStop) the fast path is refused too: CastSpellFor would flush that stop inside the fast-path cast itself, after the count the chain compares. The next buff then takes the normal path, which waits on the animation gate (GestureHolds) as every buff did before the chain. Nothing else reads the count, so no other MayStart caller changes. MovementWaits (counted once per buff) is in the chain's Describe line. Tests: 50 ms after a nav stop, and after a nav turn, the next buff waits for the animation and goes once it is over, not on the fast path; stops held while the buff was unanswered keep the next buff off the fast path; the same sequence with no movement takes the fast path (control). The stop, turn and held-stop checks fail with their guard disabled. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
88502d4efa
commit
bbc000f10b
4 changed files with 99 additions and 15 deletions
|
|
@ -29,8 +29,64 @@ internal static class BuffChainTests
|
|||
r.Add("buff chain: a refused fast-path cast turns it off for the rest of the pass; refusals counted and summed up", RefusalFallsBack);
|
||||
r.Add("buff chain: FastBuffChain defaults on, loads on from an old profile and copies", SettingDefaults);
|
||||
r.Add("buff chain: no Stamina to Mana for the mana reserve on the fast path; it waits for the animation, then goes", ManaReserveWaitsForAnimation);
|
||||
r.Add("buff chain: a stop or turn after the last buff sends the next one through the animation gate (no buff 50 ms after a nav stop); no movement = fast path", MovementWaitsForAnimation);
|
||||
}
|
||||
|
||||
// A buff went out 50 ms after StopCompletelyBy("Nav"): the stop starts a motion the client
|
||||
// still has to play, so a movement call after the last buff turns the fast path off for the
|
||||
// next buff, which then waits on the animation gate like any other.
|
||||
private static void MovementWaitsForAnimation() => Paced(() =>
|
||||
{
|
||||
// Control: the same sequence with no movement in between takes the fast path.
|
||||
var c = FirstBuffOut();
|
||||
c.ServerRuns(0);
|
||||
c.Tick(1.55);
|
||||
Check.Eq(FakeHost.Casts.Count, 2, "no movement: the next buff goes on the UseDone(0)");
|
||||
Check.Eq(c.B.Chain.FastCasts, 1, "no movement: on the fast path");
|
||||
Check.Eq(c.B.Chain.MovementWaits, 0, "no movement: no movement wait");
|
||||
|
||||
var r = FirstBuffOut();
|
||||
r.ServerRuns(0);
|
||||
r.At(1.5);
|
||||
Check.True(r.Host.StopCompletelyBy("Nav"), "nav's stop goes out");
|
||||
r.Tick(1.55);
|
||||
Check.Eq(FakeHost.Casts.Count, 1, "50 ms after the stop: the next buff waits for the animation");
|
||||
Check.Eq(r.B.Chain.FastCasts, 0, "not on the fast path");
|
||||
Check.Eq(r.B.Chain.MovementWaits, 1, "one movement wait counted");
|
||||
Check.True(Logged("[Pace] Buff waits: the character is still animating"), "held by the animation gate");
|
||||
r.Tick(1.65);
|
||||
Check.Eq(r.B.Chain.MovementWaits, 1, "counted once per buff, not per tick");
|
||||
FakeHost.CastBusy = 0;
|
||||
r.Tick(1.75);
|
||||
Check.Eq(FakeHost.Casts.Count, 2, "the animation over: the buff goes through the normal gate");
|
||||
Check.Eq(r.B.Chain.FastCasts, 0, "still nothing on the fast path");
|
||||
|
||||
// A turn counts the same as a stop.
|
||||
var t = FirstBuffOut();
|
||||
t.ServerRuns(0);
|
||||
t.At(1.5);
|
||||
Check.True(t.Host.TurnToHeadingBy("Nav", 90f), "nav's turn goes out");
|
||||
t.Tick(1.55);
|
||||
Check.Eq(FakeHost.Casts.Count, 1, "50 ms after a turn: the next buff waits for the animation");
|
||||
Check.Eq(t.B.Chain.MovementWaits, 1, "a movement wait");
|
||||
|
||||
// Stops sent while the buff is still unanswered are held (MoveAudit pending stops), not sent:
|
||||
// no movement is counted yet, and the next cast would flush them inside itself. A held stop
|
||||
// keeps the fast path off; the buff waits for the animation.
|
||||
var h = FirstBuffOut();
|
||||
h.At(0.5);
|
||||
for (int i = 0; i < 5; i++) h.Host.StopCompletelyBy("Nav");
|
||||
Check.True(MoveAudit.HasPendingStop, "the stops are held while the buff is unanswered");
|
||||
h.ServerRuns(0);
|
||||
h.Tick(1.55);
|
||||
Check.Eq(FakeHost.Casts.Count, 1, "a held stop: the next buff waits for the animation");
|
||||
Check.Eq(h.B.Chain.FastCasts, 0, "a held stop: not on the fast path");
|
||||
FakeHost.CastBusy = 0;
|
||||
h.Tick(1.75);
|
||||
Check.Eq(FakeHost.Casts.Count, 2, "the animation over: the buff goes");
|
||||
Check.Eq(h.B.Chain.FastCasts, 0, "and not on the fast path");
|
||||
});
|
||||
|
||||
// The fast path skips the animation gate, so only the buff may ride it. Mana spent by the last
|
||||
// buff can leave the next one under the mana reserve (BuffWaitsForMana): Stamina to Mana is then
|
||||
// cast first, and it must wait for the recoil like any vital cast.
|
||||
|
|
|
|||
Loading…
Reference in a new issue