Skip to content

Commit

Permalink
fixed trainer Pokemon modification erros in Emerald
Browse files Browse the repository at this point in the history
Evolution Array had the following incorrect evolutions:

Roselia -> Spheal
Duskull -> Snorunt
Dusclops -> Glalie
  • Loading branch information
ABZB committed Apr 28, 2019
1 parent 4624fb2 commit dd7a569
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ __pycache__/gen_iii_booster.cpython-36.pyc
__pycache__/gen_iii_booster.cpython-36.pyc
*.pyc
*.pyc
*.pyc
Binary file modified Gen III.xlsx
Binary file not shown.
Binary file modified __pycache__/gen_iii_booster.cpython-36.pyc
Binary file not shown.
25 changes: 14 additions & 11 deletions gen_iii_booster.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from first_thing import *
evolve_array_iii = [0,2,3,3,5,6,6,8,9,9,11,12,12,14,15,15,17,18,18,20,20,22,22,24,24,26,26,28,28,30,31,31,33,34,34,36,36,38,38,40,40,42,169,44,45,45,47,47,49,49,51,51,53,53,55,55,57,57,59,59,61,62,62,64,65,65,67,68,68,70,71,71,73,73,75,76,76,78,78,80,80,82,82,83,85,85,87,87,89,89,91,91,93,94,94,208,97,97,99,99,101,101,103,103,105,105,106,107,108,110,110,112,112,242,114,115,117,230,119,119,121,121,122,123,124,125,162,127,128,130,130,131,132,134,134,135,136,137,139,139,141,141,142,143,144,145,146,148,149,149,150,151,153,154,154,156,157,157,159,160,160,162,162,164,164,166,166,168,168,169,171,171,25,35,39,175,176,178,178,180,181,181,182,184,184,185,186,188,189,189,190,192,192,193,195,195,196,197,198,199,200,201,202,203,205,205,206,207,208,210,210,211,212,213,214,215,217,217,219,219,220,221,222,224,224,225,226,227,229,229,230,232,232,233,234,235,237,237,124,125,126,241,242,243,244,245,247,248,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,278,279,279,281,282,282,284,285,285,287,287,289,289,291,292,292,294,294,296,297,297,299,300,300,302,302,303,305,305,307,307,308,310,310,312,312,314,314,316,316,317,319,319,313,321,322,324,324,325,327,327,329,329,331,331,333,334,334,336,336,338,338,340,340,342,343,343,345,345,347,347,348,349,12,352,352,353,354,355,357,357,359,359,202,346,347,341,365,366,366,368,368,369,371,372,372,374,374,375,376,378,378,379,380,381,383,384,384,385,386,387,389,389,391,391,393,394,394,396,397,397,399,400,400]
evolve_array_iii = [0,2,3,3,5,6,6,8,9,9,11,12,12,14,15,15,17,18,18,20,20,22,22,24,24,26,26,28,28,30,31,31,33,34,34,36,36,38,38,40,40,42,169,44,45,45,47,47,49,49,51,51,53,53,55,55,57,57,59,59,61,62,62,64,65,65,67,68,68,70,71,71,73,73,75,76,76,78,78,80,80,82,82,83,85,85,87,87,89,89,91,91,93,94,94,208,97,97,99,99,101,101,103,103,105,105,106,107,108,110,110,112,112,242,114,115,117,230,119,119,121,121,122,123,124,125,162,127,128,130,130,131,132,134,134,135,136,137,139,139,141,141,142,143,144,145,146,148,149,149,150,151,153,154,154,156,157,157,159,160,160,162,162,164,164,166,166,168,168,169,171,171,25,35,39,175,176,178,178,180,181,181,182,184,184,185,186,188,189,189,190,192,192,193,195,195,196,197,198,199,200,201,202,203,205,205,206,207,208,210,210,211,212,213,214,215,217,217,219,219,220,221,222,224,224,225,226,227,229,229,230,232,232,233,234,235,237,237,124,125,126,241,242,243,244,245,247,248,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,278,279,279,281,282,282,284,285,285,287,287,289,289,291,292,292,294,294,296,297,297,299,300,300,302,302,303,305,305,307,307,308,310,310,312,312,314,314,316,316,317,319,319,313,321,322,324,324,325,327,327,329,329,331,331,333,334,334,336,336,338,338,340,340,342,343,343,345,345,347,347,348,349,12,352,352,353,354,355,357,357,359,359,202,362,362,363,365,366,366,368,368,369,371,372,372,374,374,375,376,378,378,379,380,381,383,384,384,385,386,387,389,389,391,391,393,394,394,396,397,397,399,400,400]

evolve_level_barrier_array_iii = [0,16,32,0,16,36,0,16,36,0,7,10,0,7,10,0,18,36,0,20,0,20,0,22,0,100,0,22,0,16,21,0,16,21,0,5,0,50,0,5,0,22,27,21,26,0,24,0,31,0,26,0,28,0,33,0,28,0,5,0,25,30,0,16,21,0,28,33,0,21,26,0,30,0,25,30,0,40,0,37,0,30,35,0,31,0,34,0,38,0,5,0,25,30,0,5,26,0,28,0,30,0,5,0,28,0,0,0,5,35,0,42,47,52,57,0,32,37,33,0,5,0,0,0,0,5,10,0,0,20,0,0,0,0,0,0,0,30,40,0,40,0,0,0,0,0,0,30,55,0,0,0,16,32,0,14,36,0,18,30,0,15,0,20,0,18,0,22,0,0,27,0,10,10,10,10,30,25,0,15,30,0,0,18,0,0,0,18,27,0,40,5,0,5,40,0,0,0,40,0,40,0,0,0,31,0,0,40,0,23,0,0,0,0,0,30,30,0,38,0,33,38,0,25,0,0,0,0,24,0,0,25,0,40,0,0,20,0,30,30,30,0,0,0,0,0,30,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,36,0,16,36,0,16,36,0,18,0,20,0,7,10,0,10,0,14,19,0,14,19,0,20,0,0,22,0,23,0,0,25,0,22,0,40,0,20,0,0,36,0,30,0,0,30,0,0,30,0,5,0,30,0,35,45,0,24,0,26,0,33,0,32,44,0,32,0,42,0,0,0,15,32,0,0,0,0,37,0,35,0,15,37,42,36,18,36,0,26,0,0,20,40,0,5,0,0,0,37,0,0,0,0,32,42,0,0,0,0,40,0,40,0,20,30,0,30,50,0,20,45,0]

Expand Down Expand Up @@ -36,10 +36,12 @@ def calc_iii(em):
else:
print("Trainer data error - incorrect value or incorrect pointer")

#If a trainer has 4 or more pokemon, or is a Gym Leader or E4 member, make it a double battle
#If a trainer has 3 or more pokemon, or is a Gym Leader or E4 member, make it a double battle

if(number_pokemon >= 4 or trainer_number in doubles_set):
em[trainer_pointer + 24] = 1
if(number_pokemon >= 3 or trainer_number in doubles_set):
#don't modify if already set to double battle
if(em[trainer_pointer + 24]%2 != 1):
em[trainer_pointer + 24] += 1


#get the pointer to the trainer's first Pokemon (to check against iterated value)
Expand Down Expand Up @@ -78,43 +80,43 @@ def calc_iii(em):
if(pokemon_length == 14):
#Check the position if length should have been 16
level = em[pokemon_pointer + 2 + 2]
if(level > 4 or level < 79):
if((level > 4 or level < 79) and em[pokemon_pointer + 2 + 2 + 1] == 0):
print("Found a 16 that was encoded as 14")
pokemon_pointer += 2
#check if length 8 works
else:
level = em[pokemon_pointer + 2 - 6]
if(level > 4 or level < 79):
if((level > 4 or level < 79) and em[pokemon_pointer + 2 - 6 + 1] == 0):
print("Found an 8 that was encoded as 14")
pokemon_pointer -= 6

#check for encoded-as-16 that is incorrect
elif(pokemon_length == 16):
#check if 14 works
level = em[pokemon_pointer + 2 - 2]
if(level > 4 or level < 79):
if((level > 4 or level < 79) and em[pokemon_pointer + 2 - 2 + 1] == 0):
print("Found a 14 that was encoded as 16")
pokemon_pointer -= 2

#otherwise check if 8 works
else:
level = em[pokemon_pointer + 2 - 8]
if(level > 4 or level < 79):
if((level > 4 or level < 79) and em[pokemon_pointer + 2 - 8 + 1] == 0):
print("Found an 8 that was encoded as 16")
pokemon_pointer -= 8

#check for encoded-as-8 that is incorrect
else:
#check if 14 works (check this first, in this case, if 14 is also wrong it will be the low EV value, which is rarely if ever in the level range, while if 16 is wrong it will be the low index value, which is often in the level range
level = em[pokemon_pointer + 2 + 6]
if(level > 4 or level < 79):
if((level > 4 or level < 79) and em[pokemon_pointer + 2 + 6 + 1] == 0):
print("Found a 14 that was encoded as 8")
pokemon_pointer += 6

#otherwise check if 16 works
else:
level = em[pokemon_pointer + 2 + 8]
if(level > 4 or level < 79):
if((level > 4 or level < 79) and em[pokemon_pointer + 2 + 8 + 1] == 0):
print("Found a 16 that was encoded as 8")
pokemon_pointer += 8

Expand Down Expand Up @@ -149,7 +151,8 @@ def calc_iii(em):
em[pokemon_pointer + 5] = high_digits



else:
print("No modification")
#move pointer to next Pokemon
pokemon_pointer += pokemon_length
t_pokemon_pointer += pokemon_length
Expand Down

0 comments on commit dd7a569

Please sign in to comment.