Lagging tail was missing an inc d like .set_priority has to properly do the +1/-1 based on battle turn, instead doing +0/-2, which meant lagging tail did not work for enemy trainers. Further, a player with lagging tail and an enemy with quick claw could create -3, which is not considered part of the valid range for d in this routine. .set_priority was changed to be used for both increasing and decreasing priority called from the nicely named .go_first and .go_last labels.
I initially discovered this when implementing the Stall ability, the .go_first.go_last labels make that slightly more reasonable, and it makes the code here more readable, so I decided to bundle it with the lagging tail fix.
I've also noticed that quick draw does not use battle random and quick claw compared against the c register which had... arbitrary content based on the random call, so I fixed those bugs as well.
Lagging tail was missing an
inc d
like.set_priority
has to properly do the +1/-1 based on battle turn, instead doing +0/-2, which meant lagging tail did not work for enemy trainers. Further, a player with lagging tail and an enemy with quick claw could create -3, which is not considered part of the valid range ford
in this routine..set_priority
was changed to be used for both increasing and decreasing priority called from the nicely named.go_first
and.go_last
labels.I initially discovered this when implementing the Stall ability, the
.go_first
.go_last
labels make that slightly more reasonable, and it makes the code here more readable, so I decided to bundle it with the lagging tail fix.