The Focus Energy bug in Pokemon Red, Blue and Yellow
Focus Energy and Dire Hit cut your critical hit chance to about a quarter instead of raising it.
The battle engine of Pokemon Red, Blue and Yellow is full of bugs that every player has run into. Here is each one, with the routine that causes it, the exact numbers, and a battle you can try it in.
The short answer. The battle engine of Pokemon Red, Blue and Yellow has a set of famous bugs: Focus Energy cuts your critical hit chance to about a quarter, 100% accurate moves miss 1 time in 256, Hyper Beam needs no recharge after a knockout, critical hits ignore stat changes, a frozen Pokemon never thaws on its own, Explosion does not faint its user when it breaks a Substitute, Fly and Dig can leave a Pokemon invulnerable, and every stat change re-applies burn, paralysis and badge boosts. GardenFlouer tested each one in the game's own code, in an emulator, and each page below names the routine behind it.
Most asked about first. Pick what happened in your battle to narrow the list.
Focus Energy and Dire Hit cut your critical hit chance to about a quarter instead of raising it.
Moves with 100% accuracy hit only 255 times in 256, and every other accuracy is a little lower than it says.
Hyper Beam needs no recharge after a knockout, a miss or a broken Substitute, and some moves take the recharge away.
A critical hit ignores every stat change, Reflect and burns, so after Swords Dance a crit can do less damage.
A frozen Pokemon never thaws on its own, and one frozen while it must recharge loses its whole battle menu.
Explosion that breaks a Substitute does not faint its user, and sleep, paralysis and Leech Seed go straight through one.
Fully paralyzed on its Fly or Dig turn, a Pokemon stays invulnerable: moves that roll to hit always miss it.
Every stat change re-applies burn and paralysis drops to the other Pokemon and badge boosts to all your stats.
HandlePoisonBurnLeechSeed_DecreaseOwnHP).HealEffect_).StatModifierDownEffect). See the 1 in 256 miss.SleepEffect). See Hyper Beam.HazeEffect_).ApplyAttackToEnemyPokemon).HandleCounterMove; pret's notes call it "Unexpected Counter damage").AdjustDamageForMoveType; read in pret's disassembly). Every case is on the type calculator's Gen 1 chart.MoveHitTest). Read in pret's disassembly, not run.The battler on this site, /lab/battle, runs a routine by routine copy of Red and Yellow's battle engine, and it has been held to the real game in about 11,900 battles: the same battle played in the game under the PyBoy emulator and in the battler, compared random number by random number, message by message. For these pages I added 34 battles, each built to make one bug happen with the deciding random numbers set on purpose (a critical hit roll one under the threshold and one at it, a hit roll of 254 and 255, a freeze in exactly the turn of a Hyper Beam), and ran them in Red and in Yellow. All of them matched the game but one, a Transform in the middle of the Fly glitch, which the battler lets through and the game does not; the Fly page says so.
The numbers on every page come from the same arithmetic as the battler's engine, and a test compares the two, so a page cannot drift from the code. Nothing here was run on a real Game Boy.
Focus Energy lowering your critical hit chance instead of raising it, 100% accurate moves missing 1 time in 256, Hyper Beam needing no recharge after a knockout, critical hits ignoring stat changes, freeze never wearing off, Explosion not fainting its user when it breaks a Substitute, the Fly and Dig invulnerability glitch, and stat changes re-applying burn, paralysis and badge boosts.
Yes, all of the ones on this page. Yellow's battle routines are almost the same as Red and Blue's; the one difference here is that in a Yellow link battle, any hit by a move that can make the target flinch also cancels Hyper Beam's recharge.
Among the ones checked here: Focus Energy raises the critical hit stage in Gold, Silver and Crystal; moves with 100% accuracy no longer roll to miss; Hyper Beam recharges even after a knockout; and a frozen Pokemon thaws 25 times in 256 at the end of each turn. I read those in pret's Gold and Crystal disassemblies; I did not run them.
Yes. The battler at /lab/battle runs a routine by routine copy of Red and Yellow's battle engine, bugs included, and its Try it links set up a battle that shows each one. In the 34 test battles for these pages, the battler and the game agree in Red and in Yellow.
Each one was read in pret's disassembly of Red, Blue and Yellow, then played in the game's own code under the PyBoy emulator, with the random numbers set to make the bug happen, and compared with the battler's engine move by move. Nothing was run on a real Game Boy.