summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-07-24 21:30:16 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-07-24 21:30:16 -0400
commit20e88770d3af481cde1816eea8c9cbf3ae17792a (patch)
treeecda9f23274a675fe4d81354e9c577b932539543
parent2d206be3d85de87eeb856397067ef14ba9bb780c (diff)
base-evs.py
-rw-r--r--Replace-stat-experience-with-EVs.md41
1 files changed, 38 insertions, 3 deletions
diff --git a/Replace-stat-experience-with-EVs.md b/Replace-stat-experience-with-EVs.md
index c14e16c..c98374b 100644
--- a/Replace-stat-experience-with-EVs.md
+++ b/Replace-stat-experience-with-EVs.md
@@ -154,11 +154,9 @@ Finally, edit all 251 [data/pokemon/base_stats/\*.asm](../tree/master/data/pokem
db CHIKORITA ; 152
db 45, 49, 65, 45, 49, 65
++ evs 0, 0, 0, 0, 0, 1
; hp atk def spd sat sdf
-+ evs 0, 0, 0, 0, 0, 1
-+ ; hp atk def spd sat sdf
-+
db GRASS, GRASS ; type
db 45 ; catch rate
db 64 ; base exp
@@ -176,6 +174,43 @@ Finally, edit all 251 [data/pokemon/base_stats/\*.asm](../tree/master/data/pokem
...
```
+You can do this automatically with a Python script. Save this as **base-evs.py** in the same directory as main.asm:
+
+```python
+import glob
+
+filenames = glob.glob('data/pokemon/base_stats/*.asm')
+
+for filename in filenames:
+
+ print('Update', filename)
+
+ with open(filename, 'r', encoding='utf8') as file:
+ lines = file.readlines()
+
+ with open(filename, 'w', encoding='utf8') as file:
+ for line in lines:
+ if line in ['\tdb 100 ; unknown 1\n', '\tdb 5 ; unknown 2\n']:
+ continue
+ if line == '\t; hp atk def spd sat sdf\n':
+ file.write('\tevs 0, 0, 0, 0, 0, 0\n')
+ file.write(line)
+```
+
+Then run `python3 base-evs.py`, just like running `make`. It should output:
+
+```
+$ python3 base-evs.py
+Update data/pokemon/base_stats/abra.asm
+...
+Update data/pokemon/base_stats/zubat.asm
+```
+
+(If it gives an error "`python3: command not found`", you need to install Python 3. It's available as the `python3` package in Cygwin.)
+
+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. Gain EVs from winning battles
Edit [engine/battle/core.asm](../blob/master/engine/battle/core.asm):