summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdain <luiscarlosholguinperez@outlook.com>2021-06-14 21:32:36 -0400
committerIdain <luiscarlosholguinperez@outlook.com>2021-06-14 21:32:36 -0400
commitd8f9094099afecbd9c51eb1db1ab9dee455f1eb6 (patch)
tree0462bb37a5ffbd79ce1def892c2b97f74bae70fe
parent61ecbbe13860c70dd7786e34adfdd713484502ce (diff)
Adding new necessary step.
-rw-r--r--Replace-stat-experience-with-EVs.md70
1 files changed, 48 insertions, 22 deletions
diff --git a/Replace-stat-experience-with-EVs.md b/Replace-stat-experience-with-EVs.md
index 0cdbf09..099128c 100644
--- a/Replace-stat-experience-with-EVs.md
+++ b/Replace-stat-experience-with-EVs.md
@@ -7,16 +7,17 @@ Gen 3 replaced stat experience with EVs, which are different in a number of ways
1. [Replace stat experience with EVs in the Pokémon data structure](#1-replace-stat-experience-with-evs-in-the-pokémon-data-structure)
2. [Replace stat experience with EVs in base data](#2-replace-stat-experience-with-evs-in-base-data)
-3. [Gain EVs from winning battles](#3-gain-evs-from-winning-battles)
-4. [Calculate stats based on EVs](#4-calculate-stats-based-on-evs)
-5. [Vitamins give EVs, not stat experience](#5-vitamins-give-evs-not-stat-experience)
-6. [Replace Odd Egg and Battle Tower stat experience with EVs](#6-replace-odd-egg-and-battle-tower-stat-experience-with-evs)
-7. [Replace `MON_STAT_EXP` with `MON_EVS` everywhere](#7-replace-mon_stat_exp-with-mon_evs-everywhere)
-8. [Replace some more labels](#8-replace-some-more-labels)
-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. [Replace stat experience with EVs in the Debug Room](#12-replace-stat-experience-with-evs-in-the-debug-room)
+3. [Clear EVs when caught Pokémon is sent into a box](#3-clear-evs-when-caught-pok%C3%A9mon-is-sent-into-a-box)
+4. [Gain EVs from winning battles](#4-gain-evs-from-winning-battles)
+5. [Calculate stats based on EVs](#5-calculate-stats-based-on-evs)
+6. [Vitamins give EVs, not stat experience](#6-vitamins-give-evs-not-stat-experience)
+7. [Replace Odd Egg and Battle Tower stat experience with EVs](#7-replace-odd-egg-and-battle-tower-stat-experience-with-evs)
+8. [Replace `MON_STAT_EXP` with `MON_EVS` everywhere](#8-replace-mon_stat_exp-with-mon_evs-everywhere)
+9. [Replace some more labels](#9-replace-some-more-labels)
+10. [Remove unused square root code](#10-remove-unused-square-root-code)
+11. [Add Zinc to boost Special Defense EVs](#11-add-zinc-to-boost-special-defense-evs)
+12. [Limit total EVs to 510](#12-limit-total-evs-to-510)
+13. [Replace stat experience with EVs in the Debug Room](#13-replace-stat-experience-with-evs-in-the-debug-room)
## 1. Replace stat experience with EVs in the Pokémon data structure
@@ -262,8 +263,33 @@ Update data/pokemon/base_stats/zubat.asm
That will format all the base data files correctly, but with zero EV yields. You'll have to fill in the correct values yourself.
+## 3. Clear EVs when caught Pokémon is sent into a box
-## 3. Gain EVs from winning battles
+Edit [engine/pokemon/move_mon.asm](../blob/master/engine/pokemon/move_mon.asm):
+
+```diff
+ SendMonIntoBox:
+ ; Sends the mon into one of Bills Boxes
+ ; the data comes mainly from 'wEnemyMon:'
+
+- ; Set all 5 Experience Values to 0
++ ; Set all 6 EVs to 0
+ xor a
+- ld b, 2 * 5
++ ld b, NUM_STATS
+ .loop2
+ ld [de], a
+ inc de
+ dec b
+ jr nz, .loop2
+
+ ld hl, wEnemyMonDVs
+ ld b, 2 + NUM_MOVES ; DVs and PP ; wEnemyMonHappiness - wEnemyMonDVs
+ ...
+```
+
+
+## 4. Gain EVs from winning battles
Edit [engine/battle/core.asm](../blob/master/engine/battle/core.asm):
@@ -404,7 +430,7 @@ Now instead of gaining the enemy's base stats toward your stat experience, you'l
Also, since we're not using stat experience, we no longer need to divide the enemy's base stats among the battle participants.
-## 4. Calculate stats based on EVs
+## 5. Calculate stats based on EVs
Edit [engine/pokemon/move_mon.asm](../blob/master/engine/pokemon/move_mon.asm):
@@ -503,7 +529,7 @@ For example, 50 EVs are equivalent to 50² = 2,500 stat exp, and 100 EVs are e
Eventually this won't matter, since the maximum 252 EVs or 65,535 stat exp both result in the same stats (252 / 4 = √65,535 / 4 = 63). But you may notice your Pokémon stats growing more slowly at first, and more quickly later on than you're used to.
-## 5. Vitamins give EVs, not stat experience
+## 6. Vitamins give EVs, not stat experience
Edit [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.asm):
@@ -597,7 +623,7 @@ Edit [data/items/descriptions.asm](../blob/master/data/items/descriptions.asm):
```
-## 6. Replace Odd Egg and Battle Tower stat experience with EVs
+## 7. Replace Odd Egg and Battle Tower stat experience with EVs
First, edit [data/events/odd_eggs.asm](../blob/master/data/events/odd_eggs.asm). Make this same replacement 14 times, once for each hard-coded Odd Egg Pokémon structure:
@@ -688,7 +714,7 @@ Done!
```
-## 7. Replace `MON_STAT_EXP` with `MON_EVS` everywhere
+## 8. Replace `MON_STAT_EXP` with `MON_EVS` everywhere
Replace every occurrence of `MON_STAT_EXP` with `MON_EVS` in these files:
@@ -705,7 +731,7 @@ Replace every occurrence of `MON_STAT_EXP` with `MON_EVS` in these files:
Most of the `MON_STAT_EXP` occurrences are part of an argument passed to `CalcMonStats`.
-## 8. Replace some more labels
+## 9. Replace some more labels
Edit [engine/events/daycare.asm](../blob/master/engine/events/daycare.asm):
@@ -726,7 +752,7 @@ Edit [engine/events/daycare.asm](../blob/master/engine/events/daycare.asm):
We're technically done now; EVs will work behind the scenes just like stat experience did. But there's room for more improvement.
-## 9. Remove unused square root code
+## 10. Remove unused square root code
The only place `GetSquareRoot` was used was in `CalcMonStatC`. Without that, we can safely remove it.
@@ -739,7 +765,7 @@ Then edit [main.asm](../blob/master/main.asm):
```
-## 10. Add Zinc to boost Special Defense EVs
+## 11. Add Zinc to boost Special Defense EVs
Now that Calcium only boosts Special Attack EVs, we need Zinc for Special Defense. Follow [this tutorial](Add-a-new-item) to add a new item.
@@ -779,7 +805,7 @@ That's all!
![Screenshot](screenshots/zinc.png)
-## 11. Limit total EVs to 510
+## 12. Limit total EVs to 510
This section allows you to limit total EVs of each Pokémon to 510.
@@ -840,7 +866,7 @@ Next edit `GiveExperiencePoints` in [engine/battle/core.asm](../blob/master/engi
add [hl]
cp MAX_EV
-...
+ ...
ldh a, [hQuotient + 3]
ld [hli], a
@@ -865,7 +891,7 @@ But this change doesn't affect vitamins, thus, we need to do another edit.
Edit `VitaminEffect` in [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.asm) again:
```diff
-VitaminEffect:
+ VitaminEffect:
...
ld a, MON_EVS
call GetPartyParamLocation
@@ -920,7 +946,7 @@ VitaminEffect:
This way, not only the limit of 510 EVs is implemented, but it will also display a message if the total EVs has reached the max limit.
-## 12. Replace stat experience with EVs in the Debug Room
+## 13. 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.