diff options
author | KDLPro <38602758+KDLPro@users.noreply.github.com> | 2021-05-03 19:17:07 +0800 |
---|---|---|
committer | KDLPro <38602758+KDLPro@users.noreply.github.com> | 2021-05-03 19:17:07 +0800 |
commit | d874e31324d5fa36dfb891b55c1c2a7a4208871b (patch) | |
tree | ad0d170e3970fc5b3d231c8f2a18200454d909d2 | |
parent | 654655f40b2ab5b9e91a65fb88a107ccfa2989cd (diff) |
Revert d4f8a29984c2b1ec4c40295507dd906b8ae8c18b...654655f40b2ab5b9e91a65fb88a107ccfa2989cd on Replace stat experience with EVs
-rw-r--r-- | Replace-stat-experience-with-EVs.md | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/Replace-stat-experience-with-EVs.md b/Replace-stat-experience-with-EVs.md index 2439032..26b4386 100644 --- a/Replace-stat-experience-with-EVs.md +++ b/Replace-stat-experience-with-EVs.md @@ -16,13 +16,12 @@ Gen 3 replaced stat experience with EVs, which are different in a number of ways 9. [Remove unused square root code](#9-remove-unused-square-root-code) 10. [Add Zinc to boost Special Defense EVs](#10-add-zinc-to-boost-special-defense-evs) 11. [Limit total EVs to 510](#11-limit-total-evs-to-510) -12. [Fix bug that shares EVs among battle participants](#12-fix-bug-that-shares-evs-among-battle-participants) -13. [Replace stat experience with EVs in the Debug Room](#13-replace-stat-experience-with-evs-in-the-debug-room) +12. [Replace stat experience with EVs in the Debug Room](#12-replace-stat-experience-with-evs-in-the-debug-room) ## 1. Replace stat experience with EVs in the Pokémon data structure -Stat experience for each stat is a two-byte quantity from 0 to 65,535, with a single Special stat experience shared between Special Attack and Special Defense. EVs for each stat is one byte, from 0 to 255 (actually 252), with independent Special Attack and Special Defense quantities. +Stat experience for each stat is a two-byte quantity from 0 to 65,535, with a single Special stat experience shared between Special Attack and Special Defense. EVs for each stat are one byte, from 0 to 255 (actually 252), with independent Special Attack and Special Defense quantities. Edit [macros/wram.asm](../blob/master/macros/wram.asm): @@ -100,7 +99,7 @@ And edit [constants/pokemon_data_constants.asm](../blob/master/constants/pokemon +MAX_EV EQU 252 ``` -By replacing the 10 stat experience bytes with 6 EV bytes, we've freed up 4 bytes in `box_struct`. That's valuable space since it gets saved when Pokémon are deposited in the PC. Making use of it is beyond the scope of this tutorial, so we'll leave it as padding for now. +By replacing the 10 stat experience bytes with 6 EV bytes, we've freed up 4 bytes in `box_struct`. That's valuable space, since it gets saved when Pokémon are deposited in the PC. Making use of it is beyond the scope of this tutorial, so we'll leave it as padding for now. ## 2. Replace stat experience with EVs in base data @@ -853,34 +852,7 @@ Edit `VitaminEffect` in [engine/items/item_effects.asm](../blob/master/engine/it This way, not only the limit of 510 EVs be implemented, but will display a message if EVs can't be changed if the total EVs reached the max limit. -## 12. Fix bug that shares EVs among battle participants - -In Generation 2, there is a bug with the Exp. Share in which the item shares the Stat Exp. gained is shared among battle participants and Exp. Share holders. While this is not technically a bug with the Stat Exp. system, it is considered a bug since any Pokémon that gains experience also gains all EVs awarded from that battle. We can fix this by editing `GiveExperiencePoints` in [engine/battle/core.asm](../blob/master/engine/battle/core.asm) again: - -```diff - - ld [wTempByteValue], a -- ld hl, wEnemyMonBaseStats -- ld c, wEnemyMonEnd - wEnemyMonBaseStats -+ ld hl, wEnemyMonBaseExp --.base_stat_division_loop - xor a - ldh [hDividend + 0], a - ld a, [hl] - ldh [hDividend + 1], a - ld a, [wTempByteValue] - ldh [hDivisor], a - ld b, 2 - call Divide - ldh a, [hQuotient + 3] -- ld [hli], a -+ ld [hl], a -- dec c -- jr nz, .base_stat_division_loop -``` - - -## 13. Replace stat experience with EVs in the Debug Room +## 12. Replace stat experience with EVs in the Debug Room This is only relevant if you're building a debug ROM. If you're not, you can skip this step. |