Advertisement

**Not a member of Pastebin yet?**

**, it unlocks many cool features!**

__Sign Up__- Proof that it is mathematically impossible to demonstrate on cartridge that Speed modifiers are chained
- Stats are represented in Pokemon with 16 bits. As a result, the maximum possible stat capable of being stored is 0xFFFF (65535 in decimal). Of course, you can't get this high without hacking.
- When non-HP stats have modifiers applied to them, they start off with boosts/drops (+6 to -6). When applying these boosts/drops, the game multiplies using a 16-bit context. That is, if the initial Speed stat times the numerator of the multiplier is greater than 65535, it will only consider the 16 least significant bits in its calculation, as a result effectively doing a modulo 65536. Here are the Speed modifiers:
- +6 - 8/2
- +5 - 7/2
- +4 - 6/2
- +3 - 5/2
- +2 - 4/2
- +1 - 3/2
- +0 - 2/2
- -1 - 2/3
- -2 - 2/4
- -3 - 2/5
- -4 - 2/6
- -5 - 2/7
- -6 - 2/8
- So a Pokemon with 32768 Speed with +0 Speed boost/drop will multiply 32768 times 2, reach 65536, overflow to 0, and divide by 2 to become 0. Therefore, the largest Speed stat possible because of this 16-bit context is going to be initially 32767 (32767 * 2 = 65534, divided by 2 = 32767).
- It is also known that the following Speed modifiers are applied together, then pokeRounded.
- Tailwind (2x)
- Chlorophyll / Swift Swim / Sand Rush / Slush Rush (2x)
- Surge Surfer (2x)
- Unburden (2x)
- Quick Feet (ignores para Speed drop) (1.5x)
- Slow Start (0.5x)
- Iron Ball / Power Items (0.5x)
- Choice Scarf (1.5x)
- Quick Powder (2x if Ditto and not Transformed)
- Pledge swamp (0.25x)
- We also know the the context for multiplying Speed modifiers during the pokeRound is not a 16-bit context. Otherwise, something like Tailwind with 100 Speed would become 8 Speed, which is surely wrong. In fact, even if no Speed modifiers were present, the game would still implicitly apply a modifier of 4096/4096, so ANY Speed stat greater than 15 would undergo 16-bit overflow, which is definitely wrong.
- The most Speed modifiers applicable at once are Tailwind, a 2x Speed ability like Surge Surfer, and Quick Powder. If these were chained together, the final modifier would be 32768. But doing pokeRound (32767 * 32768 / 4096) won't overflow in a 32-bit context even with just the multiplication alone.
- Moreover, you can't prove modifiers are chained because of rounding within the Speed modifiers, because if you represent Speed modifiers as properly being scaled to /4096, you will NEVER encounter any situations where rounding is needed.
- As a result, though it is highly likely the game follows the pattern of how Attack/Defense modifiers are applied, nevertheless it is not proveable.

Advertisement

Add Comment

Please,

**to add comment**__Sign In__Advertisement