Bug: PRZ and BRN stat reductions don't apply to switched Pokémon (#1021)

Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
This commit is contained in:
vulcandth 2022-12-01 15:54:01 -06:00 committed by GitHub
parent c4e3f2bbc2
commit b232b4be5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -50,6 +50,7 @@ Fixes in the [multi-player battle engine](#multi-player-battle-engine) category
- [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%C3%A9mon)
- [Heavy Ball uses wrong weight value for three Pokémon](#heavy-ball-uses-wrong-weight-value-for-three-pok%C3%A9mon)
- [PRZ and BRN stat reductions don't apply to switched Pokémon](#prz-and-brn-stat-reductions-dont-apply-to-switched-pok%C3%A9mon)
- [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%C3%A9mon-is-badly-poisoned)
- ["Smart" AI discourages Conversion2 after the first turn](#smart-ai-discourages-conversion2-after-the-first-turn)
@ -1251,6 +1252,24 @@ This can occur if your party and current PC box are both full when you start the
```
### PRZ and BRN stat reductions don't apply to switched Pokémon
This does not affect link battles or Battle Tower battles because those jump from `LoadEnemyMon` to `InitEnemyMon`, which already calls `ApplyStatusEffectOnEnemyStats`.
**Fix:** Edit `LoadEnemyMon` in [engine/battle/core.asm](https://github.com/pret/pokecrystal/blob/master/engine/battle/core.asm):
```diff
ld hl, wEnemyMonStats
ld de, wEnemyStats
ld bc, NUM_EXP_STATS * 2
call CopyBytes
-; BUG: PRZ and BRN stat reductions don't apply to switched Pokémon (see docs/bugs_and_glitches.md)
+ call ApplyStatusEffectOnEnemyStats
ret
```
### Glacier Badge may not boost Special Defense depending on the value of Special Attack
Pryce's dialog ("That BADGE will raise the SPECIAL stats of POKéMON.") implies that Glacier Badge is intended to boost both Special Attack and Special Defense, but the Special Defense boost will not happen unless the unboosted Special Attack stat is 206432, or 661 or above.

View File

@ -6407,6 +6407,7 @@ LoadEnemyMon:
ld bc, NUM_EXP_STATS * 2
call CopyBytes
; BUG: PRZ and BRN stat reductions don't apply to switched Pokémon (see docs/bugs_and_glitches.md)
ret
CheckSleepingTreeMon: