Merge branch 'master' of https://github.com/pret/pokeemerald into decompile_main_menu

This commit is contained in:
golem galvanize
2018-02-09 17:47:01 -05:00
71 changed files with 36869 additions and 26976 deletions

View File

@@ -12,6 +12,7 @@
#include "util.h"
#include "main.h"
#include "constants/songs.h"
#include "constants/trainers.h"
#include "sound.h"
#include "window.h"
#include "m4a.h"
@@ -58,7 +59,7 @@ extern u16 gTrainerBattleOpponent_B;
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
extern const struct BattleMove gBattleMoves[];
extern const u8 gUnknown_0831F578[];
extern const u8 gFacilityClassToPicIndex[];
extern void sub_8172EF0(u8 bank, struct Pokemon *mon);
extern void sub_806A068(u16, u8);
@@ -1280,17 +1281,17 @@ static void LinkOpponentHandleDrawTrainerPic(void)
|| (gLinkPlayers[GetBattlerMultiplayerId(gActiveBattler)].version & 0xFF) == VERSION_LEAF_GREEN)
{
if (gLinkPlayers[GetBattlerMultiplayerId(gActiveBattler)].gender != 0)
trainerPicId = gUnknown_0831F578[0x4F];
trainerPicId = gFacilityClassToPicIndex[FACILITY_CLASS_PKMN_TRAINER_10];
else
trainerPicId = gUnknown_0831F578[0x4E];
trainerPicId = gFacilityClassToPicIndex[FACILITY_CLASS_PKMN_TRAINER_9];
}
else if ((gLinkPlayers[GetBattlerMultiplayerId(gActiveBattler)].version & 0xFF) == VERSION_RUBY
|| (gLinkPlayers[GetBattlerMultiplayerId(gActiveBattler)].version & 0xFF) == VERSION_SAPPHIRE)
{
if (gLinkPlayers[GetBattlerMultiplayerId(gActiveBattler)].gender != 0)
trainerPicId = gUnknown_0831F578[0x51];
trainerPicId = gFacilityClassToPicIndex[FACILITY_CLASS_PKMN_TRAINER_12];
else
trainerPicId = gUnknown_0831F578[0x50];
trainerPicId = gFacilityClassToPicIndex[FACILITY_CLASS_PKMN_TRAINER_11];
}
else
{
@@ -1309,17 +1310,17 @@ static void LinkOpponentHandleDrawTrainerPic(void)
|| (gLinkPlayers[GetMultiplayerId() ^ BIT_SIDE].version & 0xFF) == VERSION_LEAF_GREEN)
{
if (gLinkPlayers[GetMultiplayerId() ^ BIT_SIDE].gender != 0)
trainerPicId = gUnknown_0831F578[0x4F];
trainerPicId = gFacilityClassToPicIndex[FACILITY_CLASS_PKMN_TRAINER_10];
else
trainerPicId = gUnknown_0831F578[0x4E];
trainerPicId = gFacilityClassToPicIndex[FACILITY_CLASS_PKMN_TRAINER_9];
}
else if ((gLinkPlayers[GetMultiplayerId() ^ BIT_SIDE].version & 0xFF) == VERSION_RUBY
|| (gLinkPlayers[GetMultiplayerId() ^ BIT_SIDE].version & 0xFF) == VERSION_SAPPHIRE)
{
if (gLinkPlayers[GetMultiplayerId() ^ BIT_SIDE].gender != 0)
trainerPicId = gUnknown_0831F578[0x51];
trainerPicId = gFacilityClassToPicIndex[FACILITY_CLASS_PKMN_TRAINER_12];
else
trainerPicId = gUnknown_0831F578[0x50];
trainerPicId = gFacilityClassToPicIndex[FACILITY_CLASS_PKMN_TRAINER_11];
}
else
{

View File

@@ -19,7 +19,7 @@ extern const union AffineAnimCmd *const gUnknown_082FF694[];
extern const union AnimCmd *const gUnknown_082FF70C[];
extern const union AnimCmd *const *const gMonAnimationsSpriteAnimsPtrTable[NUM_SPECIES];
extern const union AnimCmd *const *const gUnknown_0830536C[];
extern const u8 gUnknown_0831F578[];
extern const u8 gFacilityClassToPicIndex[];
// Static type declarations
@@ -421,9 +421,9 @@ u8 sub_818D97C(u8 a0, u8 a1)
switch (a0)
{
default:
return gUnknown_0831F578[0x3F];
return gFacilityClassToPicIndex[0x3F];
case 0:
return gUnknown_0831F578[0x3C];
return gFacilityClassToPicIndex[0x3C];
}
}
return a0;

View File

@@ -950,11 +950,11 @@ static const u16 sRarePickupItems[] =
ITEM_FULL_RESTORE,
ITEM_ETHER,
ITEM_WHITE_HERB,
ITEM_TM44,
ITEM_TM44_REST,
ITEM_ELIXIR,
ITEM_TM01,
ITEM_TM01_FOCUS_PUNCH,
ITEM_LEFTOVERS,
ITEM_TM26,
ITEM_TM26_EARTHQUAKE,
};
static const u8 sPickupProbabilities[] =

View File

@@ -413,7 +413,7 @@ static u16 GetEggSpecies(u16 species)
{
for (k = 0; k < EVOS_PER_MON; k++)
{
if (gEvolutionTable[j].evolutions[k].targetSpecies == species)
if (gEvolutionTable[j][k].targetSpecies == species)
{
species = j;
found = TRUE;
@@ -694,7 +694,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru
{
for (j = 0; j < NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES; j++)
{
if (sHatchedEggFatherMoves[i] == ItemIdToBattleMoveId(ITEM_TM01 + j) && CanMonLearnTMHM(egg, j))
if (sHatchedEggFatherMoves[i] == ItemIdToBattleMoveId(ITEM_TM01_FOCUS_PUNCH + j) && CanMonLearnTMHM(egg, j))
{
if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == 0xffff)
DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFatherMoves[i]);

View File

@@ -113,7 +113,7 @@ static const u16 sUnknown_085B5884[] = INCBIN_U16("graphics/evolution_scene/tran
static const u8 Text_ShedinjaJapaneseName[] = _("ヌケニン");
static const u8 sUnknown_085B58C9[][4] =
static const u8 sUnknown_085B58C9[][4] =
{
{ 0x00, 0x0C, 0x01, 0x06 },
{ 0x0D, 0x24, 0x05, 0x02 },
@@ -575,16 +575,16 @@ static void CB2_TradeEvolutionSceneUpdate(void)
static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
{
u32 data = 0;
if (gEvolutionTable[preEvoSpecies].evolutions[0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < 6)
if (gEvolutionTable[preEvoSpecies][0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < 6)
{
s32 i;
struct Pokemon* Shedinja = &gPlayerParty[gPlayerPartyCount];
const struct EvolutionData* evoTable;
const struct EvolutionData* evos;
struct Pokemon* shedinja = &gPlayerParty[gPlayerPartyCount];
const struct Evolution *evos;
const struct Evolution *evos2;
CopyMon(&gPlayerParty[gPlayerPartyCount], mon, sizeof(struct Pokemon));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, (&gEvolutionTable[preEvoSpecies].evolutions[1].targetSpecies));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, (gSpeciesNames[gEvolutionTable[preEvoSpecies].evolutions[1].targetSpecies]));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, (&gEvolutionTable[preEvoSpecies][1].targetSpecies));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, (gSpeciesNames[gEvolutionTable[preEvoSpecies][1].targetSpecies]));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_10, (&data));
@@ -602,15 +602,16 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
CalculatePlayerPartyCount();
// can't match it otherwise, ehh
evoTable = gEvolutionTable;
evos = evoTable + preEvoSpecies;
GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos->evolutions[1].targetSpecies), FLAG_SET_SEEN);
GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos->evolutions[1].targetSpecies), FLAG_SET_CAUGHT);
evos2 = gEvolutionTable[0];
evos = evos2 + EVOS_PER_MON * preEvoSpecies;
if (GetMonData(Shedinja, MON_DATA_SPECIES) == SPECIES_SHEDINJA
&& GetMonData(Shedinja, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE
GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos[1].targetSpecies), FLAG_SET_SEEN);
GetSetPokedexFlag(SpeciesToNationalPokedexNum(evos[1].targetSpecies), FLAG_SET_CAUGHT);
if (GetMonData(shedinja, MON_DATA_SPECIES) == SPECIES_SHEDINJA
&& GetMonData(shedinja, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE
&& GetMonData(mon, MON_DATA_SPECIES) == SPECIES_NINJASK)
SetMonData(Shedinja, MON_DATA_NICKNAME, Text_ShedinjaJapaneseName);
SetMonData(shedinja, MON_DATA_NICKNAME, Text_ShedinjaJapaneseName);
}
}

View File

@@ -782,7 +782,7 @@ void ItemUseOutOfBattle_RareCandy(u8 taskId)
void ItemUseOutOfBattle_TMHM(u8 taskId)
{
if (gSpecialVar_ItemId >= ITEM_HM01)
if (gSpecialVar_ItemId >= ITEM_HM01_CUT)
DisplayItemMessage(taskId, 1, gText_BootedUpHM, sub_80FDF90); // HM
else
DisplayItemMessage(taskId, 1, gText_BootedUpTM, sub_80FDF90); // TM

View File

@@ -2,7 +2,11 @@
#include "pokemon.h"
#include "random.h"
#include "main.h"
#include "constants/species.h"
#include "constants/abilities.h"
#include "constants/items.h"
#include "constants/trainers.h"
#include "constants/moves.h"
#include "string_util.h"
#include "text.h"
@@ -14,6 +18,68 @@
extern u8 sav1_map_get_name(void);
// EWRAM vars
EWRAM_DATA u8 sLearningMoveTableID = 0;
EWRAM_DATA u8 gPlayerPartyCount = 0;
EWRAM_DATA u8 gEnemyPartyCount = 0;
EWRAM_DATA struct Pokemon gPlayerParty[PARTY_SIZE] = {0};
EWRAM_DATA struct Pokemon gEnemyParty[PARTY_SIZE] = {0};
// const rom data
const u16 gSpeciesToHoennPokedexNum[] = {203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 156, 157, 112, 113, 227, 228, 229, 230, 231, 232, 233, 234, 153, 154, 138, 139, 63, 64, 88, 89, 90, 235, 236, 237, 238, 239, 240, 241, 242, 158, 159, 243, 244, 245, 246, 247, 248, 249, 39, 40, 41, 73, 74, 75, 250, 251, 252, 66, 67, 57, 58, 59, 253, 254, 255, 256, 82, 83, 257, 92, 93, 258, 259, 106, 107, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 84, 85, 270, 271, 272, 273, 274, 275, 276, 108, 109, 169, 170, 277, 278, 279, 184, 185, 50, 51, 143, 144, 280, 281, 282, 283, 284, 167, 285, 52, 53, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 65, 181, 182, 155, 324, 137, 325, 326, 162, 163, 327, 328, 329, 91, 55, 56, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 161, 164, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 168, 357, 358, 359, 103, 104, 360, 361, 180, 362, 363, 364, 365, 115, 366, 367, 186, 165, 166, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 42, 43, 44, 25, 26, 34, 35, 114, 27, 28, 32, 33, 99, 100, 61, 62, 145, 131, 132, 60, 105, 68, 127, 128, 183, 129, 130, 140, 141, 97, 98, 116, 117, 118, 48, 49, 78, 79, 101, 102, 173, 174, 175, 119, 120, 171, 172, 125, 126, 54, 110, 111, 80, 81, 69, 76, 77, 121, 122, 160, 148, 149, 94, 36, 37, 38, 95, 96, 150, 45, 46, 47, 176, 177, 178, 152, 146, 147, 124, 123, 179, 70, 71, 72, 142, 86, 87, 133, 134, 135, 136, 29, 30, 31, 187, 188, 189, 190, 191, 192, 193, 194, 195, 198, 199, 200, 196, 197, 201, 202, 151};
const u16 gSpeciesToNationalPokedexNum[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 290, 291, 292, 276, 277, 285, 286, 327, 278, 279, 283, 284, 320, 321, 300, 301, 352, 343, 344, 299, 324, 302, 339, 340, 370, 341, 342, 349, 350, 318, 319, 328, 329, 330, 296, 297, 309, 310, 322, 323, 363, 364, 365, 331, 332, 361, 362, 337, 338, 298, 325, 326, 311, 312, 303, 307, 308, 333, 334, 360, 355, 356, 315, 287, 288, 289, 316, 317, 357, 293, 294, 295, 366, 367, 368, 359, 353, 354, 336, 335, 369, 304, 305, 306, 351, 313, 314, 345, 346, 347, 348, 280, 281, 282, 371, 372, 373, 374, 375, 376, 377, 378, 379, 382, 383, 384, 380, 381, 385, 386, 358};
const u16 gHoennToNationalOrder[] = {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, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 63, 64, 65, 290, 291, 292, 293, 294, 295, 296, 297, 118, 119, 129, 130, 298, 183, 184, 74, 75, 76, 299, 300, 301, 41, 42, 169, 72, 73, 302, 303, 304, 305, 306, 66, 67, 68, 307, 308, 309, 310, 311, 312, 81, 82, 100, 101, 313, 314, 43, 44, 45, 182, 84, 85, 315, 316, 317, 318, 319, 320, 321, 322, 323, 218, 219, 324, 88, 89, 109, 110, 325, 326, 27, 28, 327, 227, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 174, 39, 40, 349, 350, 351, 120, 121, 352, 353, 354, 355, 356, 357, 358, 359, 37, 38, 172, 25, 26, 54, 55, 360, 202, 177, 178, 203, 231, 232, 127, 214, 111, 112, 361, 362, 363, 364, 365, 366, 367, 368, 369, 222, 170, 171, 370, 116, 117, 230, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 29, 30, 31, 32, 33, 34, 35, 36, 46, 47, 48, 49, 50, 51, 52, 53, 56, 57, 58, 59, 60, 61, 62, 69, 70, 71, 77, 78, 79, 80, 83, 86, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 102, 103, 104, 105, 106, 107, 108, 113, 114, 115, 122, 123, 124, 125, 126, 128, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 173, 175, 176, 179, 180, 181, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 215, 216, 217, 220, 221, 223, 224, 225, 226, 228, 229, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411};
const struct SpindaSpot gSpindaSpotGraphics[] =
{
{16, 7, INCBIN_U16("graphics/spinda_spots/spot_0.bin")},
{40, 8, INCBIN_U16("graphics/spinda_spots/spot_1.bin")},
{22, 25, INCBIN_U16("graphics/spinda_spots/spot_2.bin")},
{34, 26, INCBIN_U16("graphics/spinda_spots/spot_3.bin")}
};
#include "data/pokemon/item_effects.h"
const s8 gNatureStatTable[][5] =
{
// Atk Def Spd Sp.Atk Sp.Def
{ 0, 0, 0, 0, 0}, // Hardy
{ +1, -1, 0, 0, 0}, // Lonely
{ +1, 0, -1, 0, 0}, // Brave
{ +1, 0, 0, -1, 0}, // Adamant
{ +1, 0, 0, 0, -1}, // Naughty
{ -1, +1, 0, 0, 0}, // Bold
{ 0, 0, 0, 0, 0}, // Docile
{ 0, +1, -1, 0, 0}, // Relaxed
{ 0, +1, 0, -1, 0}, // Impish
{ 0, +1, 0, 0, -1}, // Lax
{ -1, 0, +1, 0, 0}, // Timid
{ 0, -1, +1, 0, 0}, // Hasty
{ 0, 0, 0, 0, 0}, // Serious
{ 0, 0, +1, -1, 0}, // Jolly
{ 0, 0, +1, 0, -1}, // Naive
{ -1, 0, 0, +1, 0}, // Modest
{ 0, -1, 0, +1, 0}, // Mild
{ 0, 0, -1, +1, 0}, // Quiet
{ 0, 0, 0, 0, 0}, // Bashful
{ 0, 0, 0, +1, -1}, // Rash
{ -1, 0, 0, 0, +1}, // Calm
{ 0, -1, 0, 0, +1}, // Gentle
{ 0, 0, -1, 0, +1}, // Sassy
{ 0, 0, 0, -1, +1}, // Careful
{ 0, 0, 0, 0, 0}, // Quirky
};
#include "data/pokemon/tmhm_learnsets.h"
#include "data/pokemon/trainer_class_lookups.h"
#include "data/pokemon/cry_ids.h"
#include "data/pokemon/experience_tables.h"
#include "data/pokemon/base_stats.h"
#include "data/pokemon/level_up_learnsets.h"
#include "data/pokemon/evolution.h"
#include "data/pokemon/level_up_learnset_pointers.h"
// code
void ZeroBoxMonData(struct BoxPokemon *boxMon)
{
u8 *raw = (u8 *)boxMon;
@@ -43,14 +109,14 @@ void ZeroMonData(struct Pokemon *mon)
void ZeroPlayerPartyMons(void)
{
s32 i;
for (i = 0; i < 6; i++)
for (i = 0; i < PARTY_SIZE; i++)
ZeroMonData(&gPlayerParty[i]);
}
void ZeroEnemyPartyMons(void)
{
s32 i;
for (i = 0; i < 6; i++)
for (i = 0; i < PARTY_SIZE; i++)
ZeroMonData(&gEnemyParty[i]);
}

View File

@@ -1222,20 +1222,20 @@ void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord)
}
}
extern const u8 gUnknown_0831F578[];
extern const u8 gTrainerClassToNameIndex[];
extern const u8 gFacilityClassToPicIndex[];
extern const u8 gFacilityClassToTrainerClass[];
extern const u8 gSecretBaseTrainerClasses[][5];
u8 GetSecretBaseTrainerPicIndex(void)
{
u8 trainerClass = gSecretBaseTrainerClasses[gBattleResources->secretBase->gender][gBattleResources->secretBase->trainerId[0] % 5];
return gUnknown_0831F578[trainerClass];
return gFacilityClassToPicIndex[trainerClass];
}
u8 GetSecretBaseTrainerNameIndex(void)
{
u8 trainerClass = gSecretBaseTrainerClasses[gBattleResources->secretBase->gender][gBattleResources->secretBase->trainerId[0] % 5];
return gTrainerClassToNameIndex[trainerClass];
return gFacilityClassToTrainerClass[trainerClass];
}
bool8 IsPlayerPartyAndPokemonStorageFull(void)

View File

@@ -301,56 +301,56 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
for (i = 0; i < 5; i++)
{
switch (gEvolutionTable[species].evolutions[i].method)
switch (gEvolutionTable[species][i].method)
{
case EVO_FRIENDSHIP:
if (friendship >= 220)
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_FRIENDSHIP_DAY:
RtcCalcLocalTime();
if (gLocalTime.hours >= 12 && gLocalTime.hours < 24 && friendship >= 220)
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_FRIENDSHIP_NIGHT:
RtcCalcLocalTime();
if (gLocalTime.hours >= 0 && gLocalTime.hours < 12 && friendship >= 220)
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL:
if (gEvolutionTable[species].evolutions[i].param <= level)
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
if (gEvolutionTable[species][i].param <= level)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_ATK_GT_DEF:
if (gEvolutionTable[species].evolutions[i].param <= level)
if (gEvolutionTable[species][i].param <= level)
if (GetMonData(mon, MON_DATA_ATK, 0) > GetMonData(mon, MON_DATA_DEF, 0))
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_ATK_EQ_DEF:
if (gEvolutionTable[species].evolutions[i].param <= level)
if (gEvolutionTable[species][i].param <= level)
if (GetMonData(mon, MON_DATA_ATK, 0) == GetMonData(mon, MON_DATA_DEF, 0))
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_ATK_LT_DEF:
if (gEvolutionTable[species].evolutions[i].param <= level)
if (gEvolutionTable[species][i].param <= level)
if (GetMonData(mon, MON_DATA_ATK, 0) < GetMonData(mon, MON_DATA_DEF, 0))
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_SILCOON:
if (gEvolutionTable[species].evolutions[i].param <= level && (upperPersonality % 10) <= 4)
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
if (gEvolutionTable[species][i].param <= level && (upperPersonality % 10) <= 4)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_CASCOON:
if (gEvolutionTable[species].evolutions[i].param <= level && (upperPersonality % 10) > 4)
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
if (gEvolutionTable[species][i].param <= level && (upperPersonality % 10) > 4)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_NINJASK:
if (gEvolutionTable[species].evolutions[i].param <= level)
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
if (gEvolutionTable[species][i].param <= level)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_BEAUTY:
if (gEvolutionTable[species].evolutions[i].param <= beauty)
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
if (gEvolutionTable[species][i].param <= beauty)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
}
}
@@ -358,17 +358,17 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
case 1:
for (i = 0; i < 5; i++)
{
switch (gEvolutionTable[species].evolutions[i].method)
switch (gEvolutionTable[species][i].method)
{
case EVO_TRADE:
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_TRADE_ITEM:
if (gEvolutionTable[species].evolutions[i].param == heldItem)
if (gEvolutionTable[species][i].param == heldItem)
{
heldItem = 0;
SetMonData(mon, MON_DATA_HELD_ITEM, (u8 *)&heldItem);
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
targetSpecies = gEvolutionTable[species][i].targetSpecies;
}
break;
}
@@ -378,10 +378,10 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
case 3:
for (i = 0; i < 5; i++)
{
if (gEvolutionTable[species].evolutions[i].method == EVO_ITEM
&& gEvolutionTable[species].evolutions[i].param == evolutionItem)
if (gEvolutionTable[species][i].method == EVO_ITEM
&& gEvolutionTable[species][i].param == evolutionItem)
{
targetSpecies = gEvolutionTable[species].evolutions[i].targetSpecies;
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
}
}
@@ -1652,11 +1652,11 @@ u8 sub_806EF84(u8 arg0, u8 arg1)
return i;
}
extern const u8 gUnknown_0831F578[];
extern const u8 gFacilityClassToPicIndex[];
u16 sub_806EFF0(u16 arg0)
{
return gUnknown_0831F578[arg0];
return gFacilityClassToPicIndex[arg0];
}
u16 PlayerGenderToFrontTrainerPicId(u8 playerGender)

File diff suppressed because it is too large Load Diff