Anonymous user
Substitute drain move not missing glitch: Difference between revisions
Substitute drain move not missing glitch (view source)
Revision as of 17:38, 11 September 2019
, 4 years agoThe cleanup I promised.
>ISSOtm (Created the page for the glitch.) |
>Bbbbbbbbba (The cleanup I promised.) |
||
Line 1:
{{Misc R/B/Y}}
The '''Substitute drain move not missing''' is a minor battle glitch in English {{RBY}}, where HP draining moves don't miss against a
Furthermore, this glitch makes it possible to "drain HP" from a substitute.
== How to perform ==
When a Pokémon
Note that this glitch does not exist in any of the Japanese games.
Line 12 ⟶ 14:
== Involved code ==
Source : [https://github.com/pret/pokered/blob/77c3e22a4ecd3dc81918f00c548cef7c634f3419/engine/battle/core.asm#L5459 Pokéred], [https://github.com/pret/pokeyellow/blob/707ba908f780d42e1f26af85bef0bf0eb478b877/engine/battle/core.asm#L5624 Pokéyellow]
ld a, [de] ; [de] contains the effect of the move
cp a, SWIFT_EFFECT
ret z ; If the move is Swift, bypass the accuracy check altogether
call CheckTargetSubstitute ; * Does the opponent have a substitute?
jr z, .checkForDigOrFlyStatus ; * If not, skip the two checks below
cp a, DRAIN_HP_EFFECT
jp z, .moveMissed ; Draining moves should miss unconditionally against substitutes
cp a, DREAM_EATER_EFFECT
jp z, .moveMissed ; Same for Dream Eater
.checkForDigOrFlyStatus
In the Japanese versions, the two lines marked with "*" are above <code>ld a, [de]</code> instead. As a result, they skip all ''three'' checks shown here, causing the [[Swift miss glitch]].
In the English versions, those lines are moved down, fixing the Swift miss glitch. However, the function CheckTargetSubstitute overwrites register <code>a</code> with either 0 or 1, so the two checks below will always fail, making drain moves able to hit substitutes.
== Video demonstration ==
{{youtube|Rrn4rtQXYQ0|ChickasaurusGL}}
== References ==
* [https://forums.glitchcity.info/index.php?topic=7522.msg200679#msg200679 IceFlame's analysis of the code involved] (see the [https://pastebin.com/nJzRK337 linked pastebin])
|