Jump to content

Focus Energy glitch: Difference between revisions

no edit summary
>Torchickens
>Torchickens
No edit summary
Line 1:
{{Misc R/B}}
The '''Focus Energy Glitchglitch''' is a [[glitch]] in Pokémon Red and, Blue Versions involving the effect of the move Focusand EnergyYellow.
 
Focus Energy is a move that, ever since [[bp:Generation II|Generation II]], increased the user's critical hit rate. This glitch, causing it to sometimes do the opposite, was fixed in [[bp:Pokémon Stadium|Pokémon Stadium]].
==Focus Energy's original effect==
After Focus Energy is used, any move that does not have an increased critical hit rate (Razor Leaf, Slash, Crabhammer, Karate Chop) will have one quarter of the normal chance to land a critical hit.
 
In Generation I, due to a bug, Focus Energy will always effectively quarter the player's chances of getting a critical hit.
As for moves with increased critical hit rates, the reduction is dependent on the user's speed. If the user is faster than the opponent, no reduction occurs. If the user is somewhat slower than the opponent (exact numbers still need to be found,) then its critical hit rate will lower by 50%. If the user is significantly slower than the opponent, then it will become impossible for the user to land a critical hit.
 
This glitch was fixed in [[bp:Pokémon Stadium|Pokémon Stadium]], where Focus Energy quadruples the critical hit rate instead.
 
==Further analysis==
The relevant block of code for Focus Energy's effect is this, beginning at offset 3E055 in Pokémon Red and Blue (view 0F:6055 in a debugger). Thanks Wack0 for walking through this.
 
bit 2, a ; test for focus energy<br/>
jr nz, .focusEnergyUsed (6061)<br>
sla b ; b=b*2<br>
jr nc, .noFocusEnergyUsed ; if b was below 128, skip...<br>
ld b, $ff ; a cap at 255/256<br>
jr .noFocusEnergyUsed<br>
.focusEnergyUsed<br>
srl b ; whoops! b=b/2, and if you look, the jump to here is before the b=b*2, so b is effectively 1/4 of what it should be<br>
.noFocusEnergyUsed ; no cap at 255/256 for focus energy. I wonder if, if done properly, this would have caused bugs related to integer wraparound..<br>
; ... (check for high critical hit move here)<br>
 
The relative jump to '.focusEnergyUsed' that happens when Focus Energy is used makes the game skip a 'sla b' (double b), and then a 'srl b' (half b) at '.focusEnergyUsed' halves the value in register 'b'.
 
If Focus Energy is not used, the value in 'b' is doubled and if it was used, the value in 'b' is halved. 2.0/0.5=4.0, meaning critical hits land four times less likely.
[[Category:Generation I glitches]]
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.