Rangi42 / polishedcrystal

An upgrade to Pokémon Crystal. Brings features and content up to date, and adds some original content.
https://hax.iimarckus.org/topic/6874/
1.03k stars 197 forks source link

Fix lagging tail, quick claw, and quick draw #896

Closed emilyploszaj closed 10 months ago

emilyploszaj commented 10 months ago

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.

emilyploszaj commented 10 months ago

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.