You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Document Special Defense badge boost glitch (#651)
Document Special Defense badge boost glitch
This commit is contained in:
@@ -18,6 +18,7 @@ Some fixes are mentioned as breaking compatibility with link battles. This can b
|
|||||||
- [Thick Club and Light Ball can make (Special) Attack wrap around above 1024](#thick-club-and-light-ball-can-make-special-attack-wrap-around-above-1024)
|
- [Thick Club and Light Ball can make (Special) Attack wrap around above 1024](#thick-club-and-light-ball-can-make-special-attack-wrap-around-above-1024)
|
||||||
- [Metal Powder can increase damage taken with boosted (Special) Defense](#metal-powder-can-increase-damage-taken-with-boosted-special-defense)
|
- [Metal Powder can increase damage taken with boosted (Special) Defense](#metal-powder-can-increase-damage-taken-with-boosted-special-defense)
|
||||||
- [Reflect and Light Screen can make (Special) Defense wrap around above 1024](#reflect-and-light-screen-can-make-special-defense-wrap-around-above-1024)
|
- [Reflect and Light Screen can make (Special) Defense wrap around above 1024](#reflect-and-light-screen-can-make-special-defense-wrap-around-above-1024)
|
||||||
|
- [Glacier Badge may not boost Special Defense depending on the value of Special Attack](#glacier-badge-may-not-boost-special-defense-depending-on-the-value-of-special-attack)
|
||||||
- [Moves with a 100% secondary effect chance will not trigger it in 1/256 uses](#moves-with-a-100-secondary-effect-chance-will-not-trigger-it-in-1256-uses)
|
- [Moves with a 100% secondary effect chance will not trigger it in 1/256 uses](#moves-with-a-100-secondary-effect-chance-will-not-trigger-it-in-1256-uses)
|
||||||
- [Belly Drum sharply boosts Attack even with under 50% HP](#belly-drum-sharply-boosts-attack-even-with-under-50-hp)
|
- [Belly Drum sharply boosts Attack even with under 50% HP](#belly-drum-sharply-boosts-attack-even-with-under-50-hp)
|
||||||
- [Confusion damage is affected by type-boosting items and Explosion/Self-Destruct doubling](#confusion-damage-is-affected-by-type-boosting-items-and-explosionself-destruct-doubling)
|
- [Confusion damage is affected by type-boosting items and Explosion/Self-Destruct doubling](#confusion-damage-is-affected-by-type-boosting-items-and-explosionself-destruct-doubling)
|
||||||
@@ -167,6 +168,34 @@ This bug existed for all battles in Gold and Silver, and was only fixed for sing
|
|||||||
(This fix also affects Thick Club, Light Ball, and Metal Powder, as described above, but their specific fixes in the above bugs allow more accurate damage calculations.)
|
(This fix also affects Thick Club, Light Ball, and Metal Powder, as described above, but their specific fixes in the above bugs allow more accurate damage calculations.)
|
||||||
|
|
||||||
|
|
||||||
|
## Glacier Badge may not boost Special Defense depending on the value of Special Attack
|
||||||
|
|
||||||
|
As Pryce's dialog ("That BADGE will raise the SPECIAL stats of POKéMON.") implies, Glacier Badge is intended to boost both Special Attack and Special Defense. However, due to BoostStat overwriting `a` when boosting Special Attack, the Special Defense boost will not happen if the unboosted Special Attack stat is either 0-205 or 433-660.
|
||||||
|
|
||||||
|
**Fix:** Edit `BadgeStatBoosts.CheckBadge` in [engine/battle/core.asm](https://github.com/pret/pokecrystal/blob/master/engine/battle/core.asm):
|
||||||
|
|
||||||
|
```diff
|
||||||
|
.CheckBadge:
|
||||||
|
ld a, b
|
||||||
|
srl b
|
||||||
|
+ push af
|
||||||
|
call c, BoostStat
|
||||||
|
+ pop af
|
||||||
|
inc hl
|
||||||
|
inc hl
|
||||||
|
; Check every other badge.
|
||||||
|
srl b
|
||||||
|
dec c
|
||||||
|
jr nz, .CheckBadge
|
||||||
|
; Check GlacierBadge again for Special Defense.
|
||||||
|
-; This check is buggy because it assumes that a is set by the "ld a, b" in the above loop,
|
||||||
|
-; but it can actually be overwritten by the call to BoostStat.
|
||||||
|
srl a
|
||||||
|
call c, BoostStat
|
||||||
|
ret
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Moves with a 100% secondary effect chance will not trigger it in 1/256 uses
|
## Moves with a 100% secondary effect chance will not trigger it in 1/256 uses
|
||||||
|
|
||||||
*Fixing this bug **may** break compatibility with standard Pokémon Crystal for link battles.*
|
*Fixing this bug **may** break compatibility with standard Pokémon Crystal for link battles.*
|
||||||
|
@@ -6758,12 +6758,12 @@ BadgeStatBoosts:
|
|||||||
; depending on which badges have been obtained.
|
; depending on which badges have been obtained.
|
||||||
|
|
||||||
; Every other badge boosts a stat, starting from the first.
|
; Every other badge boosts a stat, starting from the first.
|
||||||
|
; GlacierBadge also boosts Special Defense, although the relevant code is buggy (see below).
|
||||||
|
|
||||||
; ZephyrBadge: Attack
|
; ZephyrBadge: Attack
|
||||||
; PlainBadge: Speed
|
; PlainBadge: Speed
|
||||||
; MineralBadge: Defense
|
; MineralBadge: Defense
|
||||||
; GlacierBadge: Special Attack
|
; GlacierBadge: Special Attack and Special Defense
|
||||||
; RisingBadge: Special Defense
|
|
||||||
|
|
||||||
; The boosted stats are in order, except PlainBadge and MineralBadge's boosts are swapped.
|
; The boosted stats are in order, except PlainBadge and MineralBadge's boosts are swapped.
|
||||||
|
|
||||||
@@ -6806,7 +6806,9 @@ BadgeStatBoosts:
|
|||||||
srl b
|
srl b
|
||||||
dec c
|
dec c
|
||||||
jr nz, .CheckBadge
|
jr nz, .CheckBadge
|
||||||
; And the last one (RisingBadge) too.
|
; Check GlacierBadge again for Special Defense.
|
||||||
|
; This check is buggy because it assumes that a is set by the "ld a, b" in the above loop,
|
||||||
|
; but it can actually be overwritten by the call to BoostStat.
|
||||||
srl a
|
srl a
|
||||||
call c, BoostStat
|
call c, BoostStat
|
||||||
ret
|
ret
|
||||||
|
Reference in New Issue
Block a user