mirror of
https://github.com/pret/pmd-red.git
synced 2026-03-21 17:46:39 -05:00
Merge pull request #465 from AsparagusEduardo/_pret/pr/doc1
Some checks are pending
GithubCI / build (push) Waiting to run
Some checks are pending
GithubCI / build (push) Waiting to run
Slight documentation
This commit is contained in:
commit
f62d4d90d5
|
|
@ -37,14 +37,14 @@ extern RecruitedMon *gRecruitedPokemonRef;
|
|||
void LoadMonsterParameters(void);
|
||||
RecruitedMon *GetRecruitedPokemon(void);
|
||||
void InitializeRecruitedPokemon(void);
|
||||
void sub_808CE74(s16 _species, bool32 _isLeader, u8* name);
|
||||
void CreateLeaderPartnerData(s16 _species, bool32 _isLeader, u8* name);
|
||||
void CreateLevel1Pokemon(Pokemon *pokemon, s16 _species, u8* name, u32 _itemID, const DungeonLocation *location, u16 *moves);
|
||||
void sub_808D0D8(Pokemon *pokemon);
|
||||
void ConvertStoryMonToPokemon(Pokemon *dst, const struct StoryMonData *src);
|
||||
Pokemon *TryAddPokemonToRecruited(Pokemon*);
|
||||
Pokemon *sub_808D278(s32 species);
|
||||
Pokemon *TryAddLevel1PokemonToRecruited(s32 species, u8 *name, u32 _itemID, const DungeonLocation *location, u16 *moveID);
|
||||
void sub_808D31C(Pokemon *param_1);
|
||||
void TryResetPokemonFlags(Pokemon *pokemon);
|
||||
Pokemon *GetLeaderMon1(void);
|
||||
Pokemon *GetPartnerMon(void);
|
||||
Pokemon *GetLeaderMon2(void);
|
||||
|
|
@ -113,7 +113,7 @@ bool8 CanMonLearnMove(u16 moveID, s16 _species);
|
|||
s32 sub_808E218(unkStruct_808E218_arg* a1, Pokemon* pokemon);
|
||||
s32 GetEvolutionSequence(Pokemon* pokemon, EvolveStage* a2);
|
||||
s32 sub_808E400(s32 _species, s16* _a2, bool32 _bodySizeCheck, bool32 _shedinjaCheck);
|
||||
void sub_808E490(Move* a1, s32 species);
|
||||
void InitializeLevel1MovesBySpecies(Move* moves, s32 species);
|
||||
char* sub_808E4FC(s32 a1);
|
||||
char* sub_808E51C(s32 a1);
|
||||
void InitShadowSprites(s32 param_1, s32 param_2);
|
||||
|
|
@ -129,12 +129,12 @@ static inline bool8 DungeonMonExists(DungeonMon *mon)
|
|||
return (mon->flags & POKEMON_FLAG_EXISTS) != 0;
|
||||
}
|
||||
|
||||
static inline bool8 PokemonFlag2(Pokemon *mon)
|
||||
static inline bool8 PokemonIsOnTeam(Pokemon *mon)
|
||||
{
|
||||
return (mon->flags & POKEMON_FLAG_ON_TEAM) != 0;
|
||||
}
|
||||
|
||||
static inline bool8 PokemonFlag2Struct2(DungeonMon *mon)
|
||||
static inline bool8 DungeonMonIsOnTeam(DungeonMon *mon)
|
||||
{
|
||||
return (mon->flags & POKEMON_FLAG_ON_TEAM) != 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ UNUSED static bool8 sub_801B374(u8 id)
|
|||
moveID = GetItemMoveID(id);
|
||||
|
||||
for (i = 0; i < NUM_MONSTERS; i++, pokeStruct++) {
|
||||
if (PokemonFlag2(pokeStruct))
|
||||
if (PokemonIsOnTeam(pokeStruct))
|
||||
if (CanMonLearnMove(moveID, pokeStruct->speciesNum))
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ u32 sub_801D178(void)
|
|||
if ((s16) sub_80A7AE8(7) < 0)
|
||||
return 0;
|
||||
|
||||
if (PokemonFlag2(GetPartnerMon2()))
|
||||
if (PokemonIsOnTeam(GetPartnerMon2()))
|
||||
return 0;
|
||||
|
||||
return 4;
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ static bool8 sub_803ABC8(void)
|
|||
Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
|
||||
|
||||
if (PokemonExists(mon)
|
||||
&& PokemonFlag2(mon)
|
||||
&& PokemonIsOnTeam(mon)
|
||||
&& sUnknown_203B3F4->friendArea == GetFriendArea(mon->speciesNum))
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -2563,7 +2563,7 @@ u32 BufferDungeonRequirementsText(u8 dungeonIndex, s32 speciesId_, u8 *buffer, b
|
|||
|
||||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
struct Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
|
||||
if (PokemonExists(mon) && PokemonFlag2(mon)) {
|
||||
if (PokemonExists(mon) && PokemonIsOnTeam(mon)) {
|
||||
if (mon->heldItem.id != 0) {
|
||||
sp_0xf0++;
|
||||
}
|
||||
|
|
@ -2608,7 +2608,7 @@ u32 BufferDungeonRequirementsText(u8 dungeonIndex, s32 speciesId_, u8 *buffer, b
|
|||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
struct Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
|
||||
|
||||
if (PokemonExists(mon) && PokemonFlag2(mon)){
|
||||
if (PokemonExists(mon) && PokemonIsOnTeam(mon)){
|
||||
bodySize += GetBodySize(mon->speciesNum);
|
||||
}
|
||||
}
|
||||
|
|
@ -2652,7 +2652,7 @@ u32 BufferDungeonRequirementsText(u8 dungeonIndex, s32 speciesId_, u8 *buffer, b
|
|||
for (otherSpeciesId = 0; otherSpeciesId < NUM_MONSTERS; otherSpeciesId++) {
|
||||
struct Pokemon *mon = &gRecruitedPokemonRef->pokemon[otherSpeciesId];
|
||||
|
||||
if (PokemonExists(mon) && PokemonFlag2(mon)
|
||||
if (PokemonExists(mon) && PokemonIsOnTeam(mon)
|
||||
&& (GetPokemonType(mon->speciesNum,0) == TYPE_WATER || GetPokemonType(mon->speciesNum,1) == TYPE_WATER))
|
||||
{
|
||||
break;
|
||||
|
|
@ -2722,7 +2722,7 @@ static bool8 TeamMonWithMove(u16 moveID)
|
|||
|
||||
for (speciesId = 0; speciesId < NUM_MONSTERS; speciesId++) {
|
||||
Pokemon *pokeStruct = &gRecruitedPokemonRef->pokemon[speciesId];
|
||||
if (PokemonExists(pokeStruct) && PokemonFlag2(pokeStruct)) {
|
||||
if (PokemonExists(pokeStruct) && PokemonIsOnTeam(pokeStruct)) {
|
||||
for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) {
|
||||
Move *move = &pokeStruct->moves[moveIndex];
|
||||
if (MoveFlagExists(move) && move->id == moveID) {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ void LoadDungeonPokemonSprites(void)
|
|||
{
|
||||
DungeonMon *ptr = &gRecruitedPokemonRef->dungeonTeam[index];
|
||||
if(DungeonMonExists(ptr))
|
||||
if(PokemonFlag2Struct2(ptr))
|
||||
if(DungeonMonIsOnTeam(ptr))
|
||||
LoadPokemonSprite(ptr->speciesNum, FALSE);
|
||||
}
|
||||
if(gDungeon->fixedRoomNumber == FIXED_ROOM_RESCUE_TEAM_MAZE_BOSS)
|
||||
|
|
@ -191,7 +191,7 @@ void SetDungeonMonsFromTeam(void)
|
|||
for (recruitedId = 0; recruitedId < NUM_MONSTERS; recruitedId++) {
|
||||
Pokemon lvl1Mon;
|
||||
Pokemon *pokeStruct = &gRecruitedPokemonRef->pokemon[recruitedId];
|
||||
if (PokemonExists(pokeStruct) && PokemonFlag2(pokeStruct)) {
|
||||
if (PokemonExists(pokeStruct) && PokemonIsOnTeam(pokeStruct)) {
|
||||
RecruitedPokemonToDungeonMon(&gRecruitedPokemonRef->dungeonTeam[index],recruitedId);
|
||||
if (IsLevelResetDungeon(gDungeon->unk644.dungeonLocation.id)) {
|
||||
struct DungeonLocation dungeonLoc = {.id = DUNGEON_TINY_WOODS, .floor = 1};
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ UNUSED static s32 sub_806B09C(SpawnPokemonData *unkPtr, bool8 a1)
|
|||
for (i = 0, unk2Field = unkPtr->randNum, loopPtr = unkPtr; i < MAX_TEAM_MEMBERS; i++) {
|
||||
DungeonMon *monStructPtr = &gRecruitedPokemonRef->dungeonTeam[i];
|
||||
|
||||
if (DungeonMonExists(monStructPtr) && PokemonFlag2Struct2(monStructPtr))
|
||||
if (DungeonMonExists(monStructPtr) && DungeonMonIsOnTeam(monStructPtr))
|
||||
{
|
||||
for (j = 0; j < count; j++) {
|
||||
if (ExtractSpeciesIndex(&unkPtr[j]) == monStructPtr->speciesNum)
|
||||
|
|
@ -237,7 +237,7 @@ void sub_806B168(void)
|
|||
count = 0;
|
||||
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
|
||||
DungeonMon *currMonPtr = &gRecruitedPokemonRef->dungeonTeam[i];
|
||||
if (DungeonMonExists(currMonPtr) && PokemonFlag2Struct2(currMonPtr)) {
|
||||
if (DungeonMonExists(currMonPtr) && DungeonMonIsOnTeam(currMonPtr)) {
|
||||
monPtrs[count++] = currMonPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -339,7 +339,7 @@ void sub_806B404(void)
|
|||
|
||||
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
|
||||
DungeonMon *currMonPtr = &gRecruitedPokemonRef->dungeonTeam[i];
|
||||
if (DungeonMonExists(currMonPtr) && PokemonFlag2Struct2(currMonPtr) && currMonPtr->recruitedPokemonId == UNK_RECRUITED_POKEMON_ID_55AA) {
|
||||
if (DungeonMonExists(currMonPtr) && DungeonMonIsOnTeam(currMonPtr) && currMonPtr->recruitedPokemonId == UNK_RECRUITED_POKEMON_ID_55AA) {
|
||||
monPtrs[count++] = currMonPtr;
|
||||
break;
|
||||
}
|
||||
|
|
@ -367,7 +367,7 @@ void sub_806B404(void)
|
|||
s32 j;
|
||||
DungeonMon *currMonPtr = monPtrs[i];
|
||||
|
||||
if (currMonPtr != NULL && DungeonMonExists(currMonPtr) && PokemonFlag2Struct2(currMonPtr) && currMonPtr->recruitedPokemonId == UNK_RECRUITED_POKEMON_ID_55AA) {
|
||||
if (currMonPtr != NULL && DungeonMonExists(currMonPtr) && DungeonMonIsOnTeam(currMonPtr) && currMonPtr->recruitedPokemonId == UNK_RECRUITED_POKEMON_ID_55AA) {
|
||||
currMonPtr->recruitedPokemonId = UNK_RECRUITED_POKEMON_ID_5AA5;
|
||||
skipNextLoop = FALSE;
|
||||
j = 0;
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ void CreateFriendActionMenu(void)
|
|||
pokeStruct = &gRecruitedPokemonRef->pokemon[sUnknown_203B2BC->targetPoke];
|
||||
MemoryFill16(sUnknown_203B2BC->unk16C,0,sizeof(sUnknown_203B2BC->unk16C));
|
||||
|
||||
if (PokemonFlag2(pokeStruct)) {
|
||||
if (PokemonIsOnTeam(pokeStruct)) {
|
||||
sUnknown_203B2BC->menuItems[loopMax].text = sStandBy;
|
||||
sUnknown_203B2BC->menuItems[loopMax].menuAction = FRIEND_AREA_ACTION_MENU_ACTION_STANDBY;
|
||||
if(!sub_8027D9C(pokeStruct))
|
||||
|
|
@ -530,7 +530,7 @@ void sub_8027A78(void)
|
|||
else
|
||||
{
|
||||
sub_8027EB8();
|
||||
sub_808D31C(sUnknown_203B2BC->pokeStruct);
|
||||
TryResetPokemonFlags(sUnknown_203B2BC->pokeStruct);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -550,7 +550,7 @@ void sub_8027AE4(void)
|
|||
break;
|
||||
case FRIEND_AREA_ACTION_MENU_ACTION_YES:
|
||||
sub_8027EB8();
|
||||
sub_808D31C(sUnknown_203B2BC->pokeStruct);
|
||||
TryResetPokemonFlags(sUnknown_203B2BC->pokeStruct);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ void FriendList_ShowWindow(void)
|
|||
Pokemon *pokePtr = &gRecruitedPokemonRef->pokemon[id];
|
||||
u8 color = 7;
|
||||
|
||||
if (PokemonFlag2(pokePtr)) {
|
||||
if (PokemonIsOnTeam(pokePtr)) {
|
||||
if (IsMonPartner(pokePtr)) {
|
||||
color = 6;
|
||||
}
|
||||
|
|
@ -316,7 +316,7 @@ static s32 sub_8023F8C(void)
|
|||
if (!sFriendList->unk16) {
|
||||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
pokeStruct = &gRecruitedPokemonRef->pokemon[i];
|
||||
if (IsMonPartner(pokeStruct) && !pokeStruct->isTeamLeader && PokemonFlag2(pokeStruct) && PokemonExists(pokeStruct)) {
|
||||
if (IsMonPartner(pokeStruct) && !pokeStruct->isTeamLeader && PokemonIsOnTeam(pokeStruct) && PokemonExists(pokeStruct)) {
|
||||
sFriendList->unk1A[sFriendList->unk8++] = i;
|
||||
break;
|
||||
}
|
||||
|
|
@ -327,7 +327,7 @@ static s32 sub_8023F8C(void)
|
|||
if (!sFriendList->unk17) {
|
||||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
pokeStruct = &gRecruitedPokemonRef->pokemon[i];
|
||||
if (PokemonFlag2(pokeStruct) && PokemonExists(pokeStruct) && !pokeStruct->isTeamLeader && !IsMonPartner(pokeStruct)) {
|
||||
if (PokemonIsOnTeam(pokeStruct) && PokemonExists(pokeStruct) && !pokeStruct->isTeamLeader && !IsMonPartner(pokeStruct)) {
|
||||
sFriendList->unk1A[sFriendList->unk8++] = i;
|
||||
if (sFriendList->unk8 >= 4) {
|
||||
break;
|
||||
|
|
@ -340,7 +340,7 @@ static s32 sub_8023F8C(void)
|
|||
if (!sFriendList->unk14) {
|
||||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
pokeStruct = &gRecruitedPokemonRef->pokemon[i];
|
||||
if (PokemonExists(pokeStruct) && !PokemonFlag2(&gRecruitedPokemonRef->pokemon[i])) {
|
||||
if (PokemonExists(pokeStruct) && !PokemonIsOnTeam(&gRecruitedPokemonRef->pokemon[i])) {
|
||||
sFriendList->unk1A[sFriendList->unk8++] = i;
|
||||
}
|
||||
}
|
||||
|
|
@ -358,16 +358,16 @@ bool8 sub_8024108(s32 param_1)
|
|||
Pokemon *pokeStruct = &gRecruitedPokemonRef->pokemon[i];
|
||||
if (PokemonExists(pokeStruct)) {
|
||||
if (param_1 == 2) {
|
||||
if (!PokemonFlag2(pokeStruct)) continue;
|
||||
if (!PokemonIsOnTeam(pokeStruct)) continue;
|
||||
}
|
||||
else if (param_1 == 3) {
|
||||
if (PokemonFlag2(pokeStruct)) continue;
|
||||
if (PokemonIsOnTeam(pokeStruct)) continue;
|
||||
}
|
||||
else if (param_1 == 4) {
|
||||
if (pokeStruct->isTeamLeader) continue;
|
||||
if (!CheckQuest(QUEST_CAN_DEPOSIT_PARTNER)) {
|
||||
if (!IsMonPartner(pokeStruct)) return FALSE;
|
||||
if (PokemonFlag2(pokeStruct)) continue;
|
||||
if (PokemonIsOnTeam(pokeStruct)) continue;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -3432,7 +3432,7 @@ static s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
|||
{
|
||||
Pokemon *ptr = sub_80A8D54((s16) r2);
|
||||
if (ptr)
|
||||
return PokemonFlag2(ptr);
|
||||
return PokemonIsOnTeam(ptr);
|
||||
}
|
||||
return 0;
|
||||
case 0x14:
|
||||
|
|
|
|||
|
|
@ -587,7 +587,7 @@ s32 GetItemPossessionCount(u8 id)
|
|||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
|
||||
if (PokemonExists(mon)
|
||||
&& PokemonFlag2(mon)
|
||||
&& PokemonIsOnTeam(mon)
|
||||
&& (mon->heldItem.id != ITEM_NOTHING)
|
||||
&& (mon->heldItem.id == id))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -746,7 +746,7 @@ static bool8 LuminousCave_HasOnly1Member(void)
|
|||
mon = &gRecruitedPokemonRef->pokemon[0];
|
||||
memberCount = 0;
|
||||
for (i = 0; i < NUM_MONSTERS; i++, mon++) {
|
||||
if (PokemonFlag2(mon))
|
||||
if (PokemonIsOnTeam(mon))
|
||||
memberCount++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -962,20 +962,20 @@ void sub_8001064(void)
|
|||
if (sTeamBasicInfo_203B040.StarterName[0] == '\0') {
|
||||
CopyMonsterNameToBuffer(buffer1, sTeamBasicInfo_203B040.StarterID);
|
||||
CopyStringtoBuffer(buffer2, buffer1);
|
||||
sub_808CE74(sTeamBasicInfo_203B040.StarterID, TRUE, buffer2);
|
||||
CreateLeaderPartnerData(sTeamBasicInfo_203B040.StarterID, TRUE, buffer2);
|
||||
}
|
||||
else
|
||||
sub_808CE74(sTeamBasicInfo_203B040.StarterID, TRUE, sTeamBasicInfo_203B040.StarterName);
|
||||
CreateLeaderPartnerData(sTeamBasicInfo_203B040.StarterID, TRUE, sTeamBasicInfo_203B040.StarterName);
|
||||
}
|
||||
|
||||
if (GetPartnerMon() == NULL) {
|
||||
if (sTeamBasicInfo_203B040.PartnerNick[0] == '\0') {
|
||||
CopyMonsterNameToBuffer(buffer1, sTeamBasicInfo_203B040.PartnerID);
|
||||
CopyStringtoBuffer(buffer2, buffer1);
|
||||
sub_808CE74(sTeamBasicInfo_203B040.PartnerID, FALSE, buffer2);
|
||||
CreateLeaderPartnerData(sTeamBasicInfo_203B040.PartnerID, FALSE, buffer2);
|
||||
}
|
||||
else
|
||||
sub_808CE74(sTeamBasicInfo_203B040.PartnerID, FALSE, sTeamBasicInfo_203B040.PartnerNick);
|
||||
CreateLeaderPartnerData(sTeamBasicInfo_203B040.PartnerID, FALSE, sTeamBasicInfo_203B040.PartnerNick);
|
||||
}
|
||||
|
||||
if (sTeamBasicInfo_203B040.StarterID != MONSTER_NONE) {
|
||||
|
|
@ -1054,7 +1054,7 @@ static void RemoveMoneyAndRandomItems(void)
|
|||
|
||||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
|
||||
if (PokemonExists(mon) && PokemonFlag2(mon))
|
||||
if (PokemonExists(mon) && PokemonIsOnTeam(mon))
|
||||
mon->heldItem.id = ITEM_NOTHING;
|
||||
}
|
||||
|
||||
|
|
@ -1074,7 +1074,7 @@ static void RemoveAllMoneyAndItems(void)
|
|||
|
||||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
|
||||
if (PokemonExists(mon) && PokemonFlag2(mon))
|
||||
if (PokemonExists(mon) && PokemonIsOnTeam(mon))
|
||||
mon->heldItem.id = ITEM_NOTHING;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ static void HandlePartyListMenuCallback(void)
|
|||
break;
|
||||
case 9:
|
||||
sub_8026FA4();
|
||||
sub_808D31C(sUnknown_203B2B8->pokeStruct);
|
||||
TryResetPokemonFlags(sUnknown_203B2B8->pokeStruct);
|
||||
sUnknown_203B2B8->unk8 = TRUE;
|
||||
break;
|
||||
case PARTY_LIST_STATE_GIVEN_ITEM:
|
||||
|
|
@ -383,7 +383,7 @@ static void PartyListMenu_CreateMenu1(void)
|
|||
|
||||
PeekPokemonItem(sUnknown_203B2B8->pokeSpecies, &sUnknown_203B2B8->item2);
|
||||
|
||||
if (PokemonFlag2(pokeStruct))
|
||||
if (PokemonIsOnTeam(pokeStruct))
|
||||
{
|
||||
sUnknown_203B2B8->unk16C[loopMax].text = sPartyMenuStandBy;
|
||||
sUnknown_203B2B8->unk16C[loopMax].menuAction = PARTY_LIST_MENU_STANDBY;
|
||||
|
|
@ -435,7 +435,7 @@ static void PartyListMenu_CreateMenu1(void)
|
|||
}
|
||||
loopMax += 1;
|
||||
|
||||
if (!PokemonFlag2(pokeStruct))
|
||||
if (!PokemonIsOnTeam(pokeStruct))
|
||||
{
|
||||
sUnknown_203B2B8->unk16C[loopMax].text = sPartyMenuSayFarewell;
|
||||
sUnknown_203B2B8->unk16C[loopMax].menuAction = PARTY_LIST_MENU_SAY_FAREWELL;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ void InitializeRecruitedPokemon(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_808CE74(s16 _species, bool32 _isLeader, u8* name)
|
||||
void CreateLeaderPartnerData(s16 _species, bool32 _isLeader, u8* name)
|
||||
{
|
||||
struct Pokemon pokemon;
|
||||
u8 name_buffer[20];
|
||||
|
|
@ -102,7 +102,7 @@ void sub_808CE74(s16 _species, bool32 _isLeader, u8* name)
|
|||
pokemon.currExp = 0;
|
||||
pokemon.tacticIndex = TACTIC_LETS_GO_TOGETHER;
|
||||
pokemon.dungeonLocation.floor = 0;
|
||||
sub_808E490(pokemon.moves, species);
|
||||
InitializeLevel1MovesBySpecies(pokemon.moves, species);
|
||||
|
||||
if (name == NULL) {
|
||||
CopyMonsterNameToBuffer(name_buffer, species);
|
||||
|
|
@ -165,7 +165,7 @@ void CreateLevel1Pokemon(Pokemon *pokemon, s16 _species, u8* name, u32 _itemID,
|
|||
}
|
||||
}
|
||||
else {
|
||||
sub_808E490(pokemon->moves, species);
|
||||
InitializeLevel1MovesBySpecies(pokemon->moves, species);
|
||||
}
|
||||
|
||||
if (name == NULL) {
|
||||
|
|
@ -192,7 +192,7 @@ void sub_808D0D8(Pokemon *pokemon)
|
|||
pokemon->tacticIndex = TACTIC_LETS_GO_TOGETHER;
|
||||
pokemon->IQ = 1;
|
||||
SetDefaultIQSkills(&pokemon->IQSkills, FALSE);
|
||||
sub_808E490(pokemon->moves, pokemon->speciesNum);
|
||||
InitializeLevel1MovesBySpecies(pokemon->moves, pokemon->speciesNum);
|
||||
}
|
||||
|
||||
void ConvertStoryMonToPokemon(Pokemon *dst, const struct StoryMonData *src)
|
||||
|
|
@ -281,10 +281,10 @@ Pokemon *TryAddLevel1PokemonToRecruited(s32 species, u8 *name, u32 _itemID, cons
|
|||
return TryAddPokemonToRecruited(&pokemon);
|
||||
}
|
||||
|
||||
void sub_808D31C(Pokemon *param_1)
|
||||
void TryResetPokemonFlags(Pokemon *pokemon)
|
||||
{
|
||||
if (!IsMonTeamLeader(param_1) && !IsMonPartner(param_1))
|
||||
param_1->flags = 0;
|
||||
if (!IsMonTeamLeader(pokemon) && !IsMonPartner(pokemon))
|
||||
pokemon->flags = 0;
|
||||
}
|
||||
|
||||
Pokemon *GetLeaderMon1(void)
|
||||
|
|
@ -391,7 +391,7 @@ bool8 sub_808D4B0(void)
|
|||
flag = FALSE;
|
||||
for(index = 0; index < NUM_MONSTERS; index++, pokeStruct++)
|
||||
{
|
||||
if(PokemonFlag2(pokeStruct) && !IsMonTeamLeader(pokeStruct) && !IsMonPartner(pokeStruct)){
|
||||
if(PokemonIsOnTeam(pokeStruct) && !IsMonTeamLeader(pokeStruct) && !IsMonPartner(pokeStruct)){
|
||||
flag = TRUE;
|
||||
pokeStruct->flags &= 0xFFFD;
|
||||
}
|
||||
|
|
@ -409,7 +409,7 @@ bool8 sub_808D500(void)
|
|||
flag = FALSE;
|
||||
for(index = 0; index < NUM_MONSTERS; index++, pokeStruct++)
|
||||
{
|
||||
if(PokemonFlag2(pokeStruct) && !IsMonTeamLeader(pokeStruct)){
|
||||
if(PokemonIsOnTeam(pokeStruct) && !IsMonTeamLeader(pokeStruct)){
|
||||
flag = TRUE;
|
||||
pokeStruct->flags &= 0xFFFD;
|
||||
}
|
||||
|
|
@ -424,7 +424,7 @@ s32 GetUnitSum_808D544(s32 *team)
|
|||
|
||||
count = 0;
|
||||
for (i = 0; i < NUM_MONSTERS; i++, mon++) {
|
||||
if (PokemonFlag2(mon)) {
|
||||
if (PokemonIsOnTeam(mon)) {
|
||||
if (team != NULL) {
|
||||
team[count] = i;
|
||||
}
|
||||
|
|
@ -455,7 +455,7 @@ s32 sub_808D580(s32 *team)
|
|||
|
||||
for(mon = gRecruitedPokemonRef->pokemon, index = 0; index < NUM_MONSTERS; index++, mon++)
|
||||
{
|
||||
if (((IsMonPartner(mon) && !IsMonTeamLeader(mon) && PokemonFlag2(mon)) && (PokemonExists(mon))) &&
|
||||
if (((IsMonPartner(mon) && !IsMonTeamLeader(mon) && PokemonIsOnTeam(mon)) && (PokemonExists(mon))) &&
|
||||
((((team != NULL)))))
|
||||
{
|
||||
team[counter] = index;
|
||||
|
|
@ -467,7 +467,7 @@ s32 sub_808D580(s32 *team)
|
|||
|
||||
for(mon = gRecruitedPokemonRef->pokemon, index = 0; index < NUM_MONSTERS; index++, mon++)
|
||||
{
|
||||
if ((((PokemonFlag2(mon)) && (PokemonExists(mon))) &&
|
||||
if ((((PokemonIsOnTeam(mon)) && (PokemonExists(mon))) &&
|
||||
(!IsMonTeamLeader(mon))) &&
|
||||
(((!IsMonPartner(mon) && (team != NULL))))) {
|
||||
team[counter] = index;
|
||||
|
|
@ -485,7 +485,7 @@ s32 sub_808D654(s32 *ptr)
|
|||
s32 *ptr2;
|
||||
|
||||
for (i = 0, ptr2 = ptr; i < NUM_MONSTERS; i++, mon++) {
|
||||
if (PokemonFlag2(mon) && !IsMonTeamLeader(mon) && !IsMonPartner(mon)) {
|
||||
if (PokemonIsOnTeam(mon) && !IsMonTeamLeader(mon) && !IsMonPartner(mon)) {
|
||||
if (ptr != NULL) {
|
||||
*ptr2 = i;
|
||||
}
|
||||
|
|
@ -506,7 +506,7 @@ s32 sub_808D6A4(s32 *ptr)
|
|||
s32 *ptr2;
|
||||
|
||||
for (i = 0, ptr2 = ptr; i < NUM_MONSTERS; i++, mon++) {
|
||||
if (PokemonFlag2(mon) && !IsMonTeamLeader(mon)) {
|
||||
if (PokemonIsOnTeam(mon) && !IsMonTeamLeader(mon)) {
|
||||
if (ptr != NULL) {
|
||||
*ptr2 = i;
|
||||
}
|
||||
|
|
@ -525,7 +525,7 @@ UNUSED static bool8 sub_808D6E8(void)
|
|||
s32 size_count = 0;
|
||||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
Pokemon* pokemon = &gRecruitedPokemonRef->pokemon[i];
|
||||
if (PokemonExists(pokemon) && PokemonFlag2(pokemon)) {
|
||||
if (PokemonExists(pokemon) && PokemonIsOnTeam(pokemon)) {
|
||||
size_count += GetBodySize(pokemon->speciesNum);
|
||||
count++;
|
||||
}
|
||||
|
|
@ -546,7 +546,7 @@ bool8 sub_808D750(s32 index_)
|
|||
|
||||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
pokemon = &gRecruitedPokemonRef->pokemon[i];
|
||||
if (PokemonExists(pokemon) && PokemonFlag2(pokemon)) {
|
||||
if (PokemonExists(pokemon) && PokemonIsOnTeam(pokemon)) {
|
||||
size_count += GetBodySize(pokemon->speciesNum);
|
||||
count++;
|
||||
}
|
||||
|
|
@ -1251,13 +1251,13 @@ s32 sub_808E400(s32 _species, s16* _a2, bool32 _bodySizeCheck, bool32 _shedinjaC
|
|||
return count;
|
||||
}
|
||||
|
||||
void sub_808E490(Move* a1, s32 species)
|
||||
void InitializeLevel1MovesBySpecies(Move* moves, s32 _species)
|
||||
{
|
||||
u16 buffer[0x10]; // of moveIDs
|
||||
s32 i;
|
||||
s16 index_s32 = species;
|
||||
s16 species = _species;
|
||||
|
||||
s32 count = GetMovesLearnedAtLevel(buffer, index_s32, 1, 999);
|
||||
s32 count = GetMovesLearnedAtLevel(buffer, species, 1, 999);
|
||||
if (count == 0) {
|
||||
count = 1;
|
||||
buffer[0] = MOVE_ITEM_TOSS;
|
||||
|
|
@ -1266,13 +1266,13 @@ void sub_808E490(Move* a1, s32 species)
|
|||
i = 0;
|
||||
if (i < count) {
|
||||
while (i < count) {
|
||||
InitZeroedPPPokemonMove(&a1[i], buffer[i]);
|
||||
InitZeroedPPPokemonMove(&moves[i], buffer[i]);
|
||||
i++;
|
||||
}
|
||||
i = count;
|
||||
}
|
||||
while (i < MAX_MON_MOVES) {
|
||||
a1[i].moveFlags = 0;
|
||||
moves[i].moveFlags = 0;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -817,7 +817,7 @@ static void sub_8043FD0(void)
|
|||
s32 i, monId, movesCount;
|
||||
for (monId = 0; monId < NUM_MONSTERS; monId++) {
|
||||
Pokemon *monStruct = &gRecruitedPokemonRef->pokemon[monId];
|
||||
if (PokemonExists(monStruct) && PokemonFlag2(monStruct)) {
|
||||
if (PokemonExists(monStruct) && PokemonIsOnTeam(monStruct)) {
|
||||
u16 learnedMoves[16];
|
||||
LevelData levelData;
|
||||
// I have to make the variables volatile to get matching code. I'm sure there's a solution for this, but keeping it like that for now.
|
||||
|
|
@ -884,7 +884,7 @@ void EnforceMaxItemsAndMoney(void)
|
|||
}
|
||||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
Pokemon *mon = (&gRecruitedPokemonRef->pokemon[i]);
|
||||
if (PokemonExists(mon) && PokemonFlag2(mon)) {
|
||||
if (PokemonExists(mon) && PokemonIsOnTeam(mon)) {
|
||||
mon->heldItem.id = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user