The badge boost glitch and the stat change bug in Pokemon Red, Blue and Yellow
In Gen 1, a stat change is never just one stat. Burns and paralysis hit again, badge boosts pile up, and your own Agility can wash your paralysis away.
The short answer. In Pokemon Red, Blue and Yellow, every move that raises or lowers a stat applies the burn and paralysis penalties again to the other Pokemon: a burned foe's Attack is halved again each time you use Swords Dance or Leer, and a paralyzed foe's Speed is quartered again. Your own stat change also wipes your own burn or paralysis drop on that stat. And outside link battles, the badge boost (x 1.125 per badge) is applied again to all four of your stats every time you raise one, or the foe lowers one.
- A burned Machamp's Attack went 358, 179, then 89 after a Leer, 44 and 22 after two Agilities, in my test, none of which touched its Attack.
- A paralyzed Starmie's own Agility took its Speed from 82 to 656, as if it were not paralyzed; the other side's Agility then quartered it to 164.
- With all eight badges, one Swords Dance and one Growl from the foe took a Nidoking's Defense from 283 to 357, though nothing aimed at its Defense.
- Tested in the game's own code in an emulator, in Red and Yellow. How I checked it.
The rules, exactly
When a move raises or lowers a stat, the game does four things, in this order:
- It moves the stage (from -6 to +6), or says "Nothing happened!" if it cannot.
- It works the changed stat out again from the Pokemon's plain stat and the new stage, capped at 999 and at least 1. This leaves out any burn, paralysis or badge boost on that stat.
- If your Pokemon raised a stat, or the foe lowered one of your Pokemon's stats, and this is not a link battle, it applies your badge boosts again to all four of your stats.
- It applies the burn (Attack / 2) and paralysis (Speed / 4) penalties to the Pokemon whose turn it is not, if it is burned or paralyzed. After a raise, that is the other Pokemon. After a lower, it is the target.
Steps 3 and 4 run every time, whatever stat changed. That is the whole glitch.
Stat simulator
Both Pokemon at level 100 with the battler's stats. Every button does what the game's routines do, step by step; changed numbers are marked.
The code
; the end of StatModifierUpEffect, pret pokered engine/battle/effects.asm ldh a, [hWhoseTurn] and a call z, ApplyBadgeStatBoosts ; whenever the player uses a stat-up move, badge boosts get reapplied again to every stat, ; even to those not affected by the stat-up move (will be boosted further) ld hl, MonsStatsRoseText call PrintText ; these shouldn't be here call QuarterSpeedDueToParalysis ; apply speed penalty to the player whose turn is not, if it's paralyzed jp HalveAttackDueToBurn ; apply attack penalty to the player whose turn is not, if it's burned
The comments are pret's. StatModifierDownEffect ends the same way, with call nz, ApplyBadgeStatBoosts (on the foe's turn, when your stat was lowered) and the same two penalty calls; pret notes they "are always called regardless of the stat affected by the stat-down move". The recalculation that drops your own penalty is a few lines up: "paralysis and burn penalties, as well as badge boosts are ignored".
The badge boosts
ApplyBadgeStatBoosts (engine/battle/core.asm) reads wObtainedBadges two bits at a time: Boulder Badge raises Attack, Thunder Badge Defense, Soul Badge Speed and Volcano Badge Special, each by an eighth (stat + stat / 8, rounded down, capped at 999). It returns at once in a link battle. It runs when your Pokemon comes out, and again in the two places above. In my test a Nidoking with all eight badges came out with 317, 283, 301 and 279, and after its own Swords Dance and the foe's Growl it had 475, 357, 380 and 352.
The battler plays free battles by link rules, so it has no badges: its Try it battle shows the burn half of this page.
How I checked it
- Read:
StatModifierUpEffect,StatModifierDownEffect,ApplyBadgeStatBoosts,QuarterSpeedDueToParalysis,HalveAttackDueToBurnandLoadBattleMonFromPartyin pret's pokered and pokeyellow. - Run in the game: Red and Yellow under the PyBoy emulator, with the battler's battle oracle: an Arcanine burned a Machamp with Fire Blast and then used Leer and Agility twice; a Jolteon paralyzed a Starmie that used Agility and Recover; a Nidoking with all eight badges (written into the save) used Swords Dance and Growl in a trainer battle while a Pidgey used Growl. Every stat after every move matched the battler's engine.
- The simulator runs the same steps, and a test replays those three battles through it and compares every stat with the battler's engine.
- Not tested: X items (they run the same stat-up routine; read from the code only) and anything on a real Game Boy.
Questions
What is the badge boost glitch in Pokemon Red and Blue?
Outside link battles, your Pokemon's stats get a badge boost (x 1.125 for the Boulder, Thunder, Soul and Volcano Badges) when it comes out. Red, Blue and Yellow apply those boosts again, to all four stats, every time your Pokemon uses a move that raises a stat and every time the other side lowers one of its stats. So the boosts stack: after a Swords Dance, your Defense, Speed and Special are 1.125 times higher too.
Does Swords Dance remove the burn's Attack drop in Gen 1?
Yes. A stat change works the stat out again from the Pokemon's plain stat and the new stage, which leaves out the burn's halving (or paralysis's quartering of Speed). So a burned Pokemon that uses Swords Dance gets its full Attack back, times the stage, and a paralyzed Pokemon that uses Agility gets its full Speed back.
Why does a burned Pokemon's Attack keep dropping in Gen 1?
Because the routines for moves that raise or lower stats end by applying the burn and paralysis penalties to the Pokemon whose turn it is not. When you raise your own stat, that is the other Pokemon; when you lower the other Pokemon's stat, that is the target. A burned foe's Attack is halved again each time, and a paralyzed foe's Speed is quartered again, down to 1.
Do badge boosts work in link battles?
No. ApplyBadgeStatBoosts returns at once in a link battle, so neither the boosts nor the glitch happen there. The burn and paralysis part happens in every battle.
Was this fixed in Gold and Silver?
This page only covers Red, Blue and Yellow; Gold, Silver and Crystal were rewritten and are not covered here.
Was this tested on a real Game Boy?
No. I read the routines in pret's disassembly and ran the game's own code in the PyBoy emulator, in Red and in Yellow, with the battler's battle oracle: a burned Machamp, a paralyzed Starmie and a Nidoking with all eight badges. The battler's engine matched the game on every stat after every move.