Fix #769: document the Heavy Ball weight bank bug

This commit is contained in:
Rangi 2020-09-27 12:39:27 -04:00
parent e9767dcfa8
commit 1357e0d674
2 changed files with 40 additions and 1 deletions

View File

@ -46,6 +46,7 @@ Fixes in the [multi-player battle engine](#multi-player-battle-engine) category
- [Moon Ball does not boost catch rate](#moon-ball-does-not-boost-catch-rate) - [Moon Ball does not boost catch rate](#moon-ball-does-not-boost-catch-rate)
- [Love Ball boosts catch rate for the wrong gender](#love-ball-boosts-catch-rate-for-the-wrong-gender) - [Love Ball boosts catch rate for the wrong gender](#love-ball-boosts-catch-rate-for-the-wrong-gender)
- [Fast Ball only boosts catch rate for three Pokémon](#fast-ball-only-boosts-catch-rate-for-three-pokémon) - [Fast Ball only boosts catch rate for three Pokémon](#fast-ball-only-boosts-catch-rate-for-three-pokémon)
- [Heavy Ball uses wrong weight value for three Pokémon](#heavy-ball-uses-wrong-weight-value-for-three-pokémon)
- [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) - [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)
- ["Smart" AI encourages Mean Look if its own Pokémon is badly poisoned](#smart-ai-encourages-mean-look-if-its-own-pokémon-is-badly-poisoned) - ["Smart" AI encourages Mean Look if its own Pokémon is badly poisoned](#smart-ai-encourages-mean-look-if-its-own-pokémon-is-badly-poisoned)
- [AI makes a false assumption about `CheckTypeMatchup`](#ai-makes-a-false-assumption-about-checktypematchup) - [AI makes a false assumption about `CheckTypeMatchup`](#ai-makes-a-false-assumption-about-checktypematchup)
@ -974,6 +975,40 @@ This can occur if your party and current PC box are both full when you start the
``` ```
### Heavy Ball uses wrong weight value for three Pokémon
**Fix:** Edit `GetPokedexEntryBank` in [engine/items/item_effects.asm](https://github.com/pret/pokecrystal/blob/master/engine/items/item_effects.asm):
```diff
GetPokedexEntryBank:
-; This function is buggy.
-; It gets the wrong bank for Kadabra (64), Tauros (128), and Sunflora (192).
-; Uncomment the line below to fix this.
push hl
push de
ld a, [wEnemyMonSpecies]
-; dec a
+ dec a
rlca
rlca
maskbits NUM_DEX_ENTRY_BANKS
ld hl, .PokedexEntryBanks
ld d, 0
ld e, a
add hl, de
ld a, [hl]
pop de
pop hl
ret
.PokedexEntryBanks:
db BANK("Pokedex Entries 001-064")
db BANK("Pokedex Entries 065-128")
db BANK("Pokedex Entries 129-192")
db BANK("Pokedex Entries 193-251")
```
### 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
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 0205 or 433660. 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 0205 or 433660.
@ -2222,7 +2257,7 @@ Then create two new routines, `InvalidateSave` and `InvalidateBackupSave`:
jr z, .skip jr z, .skip
- ; jr c, .skip - ; jr c, .skip
+ jr c, .skip + jr c, .skip
; could have done "inc hl" instead ; could have done "inc hl" instead
ld bc, 1 ld bc, 1
add hl, bc add hl, bc

View File

@ -745,9 +745,13 @@ ParkBallMultiplier:
ret ret
GetPokedexEntryBank: GetPokedexEntryBank:
; This function is buggy.
; It gets the wrong bank for Kadabra (64), Tauros (128), and Sunflora (192).
; Uncomment the line below to fix this.
push hl push hl
push de push de
ld a, [wEnemyMonSpecies] ld a, [wEnemyMonSpecies]
; dec a
rlca rlca
rlca rlca
maskbits NUM_DEX_ENTRY_BANKS maskbits NUM_DEX_ENTRY_BANKS