diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2019-10-22 11:24:09 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2019-10-22 11:24:09 -0400 |
commit | 949a4c3b5ddeecd1ad6ba22414fab632eb118280 (patch) | |
tree | e12107188457553479636809cdbca20d5f0b3290 /src | |
parent | aabb95139d236b57b52f17dac962cce2a694f162 (diff) |
Document unk_8159F40 (pokedude battle party info)
Diffstat (limited to 'src')
-rw-r--r-- | src/teachy_tv.c | 2 | ||||
-rw-r--r-- | src/unk_8159F40.c | 129 |
2 files changed, 115 insertions, 16 deletions
diff --git a/src/teachy_tv.c b/src/teachy_tv.c index aa273073b..c1d6dc6c8 100644 --- a/src/teachy_tv.c +++ b/src/teachy_tv.c @@ -1192,7 +1192,7 @@ static void TeachyTvPrepBattle(u8 taskId) gSpecialVar_0x8004 = sStaticResources.whichScript; gMain.savedCallback = TeachyTvRestorePlayerPartyCallback; SavePlayerParty(); - sub_8159F40(); + InitPokedudePartyAndOpponent(); PlayMapChosenOrBattleBGM(MUS_DUMMY); if (sStaticResources.whichScript == TTVSCR_BATTLE) data[6] = 9; diff --git a/src/unk_8159F40.c b/src/unk_8159F40.c index ab27cea63..b6881f292 100644 --- a/src/unk_8159F40.c +++ b/src/unk_8159F40.c @@ -7,36 +7,133 @@ #include "metatile_behavior.h" #include "link.h" #include "link_rfu.h" +#include "constants/species.h" +#include "constants/moves.h" +#include "constants/pokemon.h" -struct UnkStruct_84792D0 +struct PokedudeBattlePartyInfo { - u8 field_0; - u8 field_1; - u16 field_2; - u16 field_4[4]; - u8 field_C; - u8 field_D; + u8 side; + u8 level; + u16 species; + u16 moves[4]; + u8 nature; + u8 gender; +}; + +static const struct PokedudeBattlePartyInfo sParties_Battle[] = { + { + .side = 0, + .level = 15, + .species = SPECIES_RATTATA, + .moves = {MOVE_TACKLE, MOVE_TAIL_WHIP, MOVE_HYPER_FANG, MOVE_QUICK_ATTACK}, + .nature = NATURE_LONELY, + .gender = MALE + }, + { + .side = 1, + .level = 18, + .species = SPECIES_PIDGEY, + .moves = {MOVE_TACKLE, MOVE_SAND_ATTACK, MOVE_GUST, MOVE_QUICK_ATTACK}, + .nature = NATURE_NAUGHTY, + .gender = MALE + }, + {0xFF} +}; + +static const struct PokedudeBattlePartyInfo sParties_Status[] = { + { + .side = 0, + .level = 15, + .species = SPECIES_RATTATA, + .moves = {MOVE_TACKLE, MOVE_TAIL_WHIP, MOVE_HYPER_FANG, MOVE_QUICK_ATTACK}, + .nature = NATURE_LONELY, + .gender = MALE + }, + { + .side = 1, + .level = 14, + .species = SPECIES_ODDISH, + .moves = {MOVE_ABSORB, MOVE_SWEET_SCENT, MOVE_POISON_POWDER}, + .nature = NATURE_RASH, + .gender = MALE + }, + {0xFF} +}; + +static const struct PokedudeBattlePartyInfo sParties_Matchups[] = { + { + .side = 0, + .level = 15, + .species = SPECIES_POLIWAG, + .moves = {MOVE_WATER_GUN, MOVE_HYPNOSIS, MOVE_BUBBLE}, + .nature = NATURE_RASH, + .gender = MALE + }, + { + .side = 0, + .level = 15, + .species = SPECIES_BUTTERFREE, + .moves = {MOVE_CONFUSION, MOVE_POISON_POWDER, MOVE_STUN_SPORE, MOVE_SLEEP_POWDER}, + .nature = NATURE_RASH, + .gender = MALE + }, + { + .side = 1, + .level = 14, + .species = SPECIES_ODDISH, + .moves = {MOVE_ABSORB, MOVE_SWEET_SCENT, MOVE_POISON_POWDER}, + .nature = NATURE_RASH, + .gender = MALE + }, + {0xFF} +}; + +static const struct PokedudeBattlePartyInfo sParties_Catching[] = { + { + .side = 0, + .level = 15, + .species = SPECIES_BUTTERFREE, + .moves = {MOVE_CONFUSION, MOVE_POISON_POWDER, MOVE_SLEEP_POWDER, MOVE_STUN_SPORE}, + .nature = NATURE_RASH, + .gender = MALE + }, + { + .side = 1, + .level = 11, + .species = SPECIES_JIGGLYPUFF, + .moves = {MOVE_SING, MOVE_DEFENSE_CURL, MOVE_POUND}, + .nature = NATURE_CAREFUL, + .gender = MALE + }, + {0xFF} }; -extern const struct UnkStruct_84792D0 *const gUnknown_84792D0[]; -void sub_8159F40(void) +static const struct PokedudeBattlePartyInfo *const sPokedudeBattlePartyPointers[] = { + sParties_Battle, + sParties_Status, + sParties_Matchups, + sParties_Catching +}; + +void InitPokedudePartyAndOpponent(void) { s32 i, j; struct Pokemon *mon; s32 myIdx = 0; s32 opIdx = 0; - const struct UnkStruct_84792D0 * data; + const struct PokedudeBattlePartyInfo * data; gBattleTypeFlags = BATTLE_TYPE_POKEDUDE; ZeroPlayerPartyMons(); ZeroEnemyPartyMons(); - data = gUnknown_84792D0[gSpecialVar_0x8004]; + data = sPokedudeBattlePartyPointers[gSpecialVar_0x8004]; i = 0; do { - if (data[i].field_0 == 0) + if (data[i].side == 0) { mon = &gPlayerParty[myIdx]; myIdx++; @@ -46,15 +143,17 @@ void sub_8159F40(void) mon = &gEnemyParty[opIdx]; opIdx++; } - CreateMonWithGenderNatureLetter(mon, data[i].field_2, data[i].field_1, 0, data[i].field_D, data[i].field_C, 0); + CreateMonWithGenderNatureLetter(mon, data[i].species, data[i].level, 0, data[i].gender, data[i].nature, 0); for (j = 0; j < 4; j++) { - SetMonMoveSlot(mon, data[i].field_4[j], j); + SetMonMoveSlot(mon, data[i].moves[j], j); } i++; - } while (data[i].field_0 != 0xFF); + } while (data[i].side != 0xFF); } +// file boundary? + void sub_815A008(struct QuestLog * questLog) { u32 i; |