Some flags clean-up

This commit is contained in:
DizzyEggg 2025-06-15 18:47:45 +02:00
parent 1dd50d5202
commit cf06a42eb2
80 changed files with 531 additions and 569 deletions

View File

@ -16,7 +16,7 @@ typedef struct unkStruct_203B22C
/* 0x4C */ s32 monsAbleToLearnMove; // number of party members able to learn move /* 0x4C */ s32 monsAbleToLearnMove; // number of party members able to learn move
/* 0x50 */ s16 unk50[MAX_TEAM_MEMBERS]; // species IDs of each member able to learn move /* 0x50 */ s16 unk50[MAX_TEAM_MEMBERS]; // species IDs of each member able to learn move
/* 0x58 */ s16 chosenPokemon; // species of pokemon that will learn move /* 0x58 */ s16 chosenPokemon; // species of pokemon that will learn move
/* 0x5C */ PokemonStruct1 *pokeStruct; // PokemonStruct of said pokemon /* 0x5C */ Pokemon *pokeStruct; // PokemonStruct of said pokemon
u32 unk60; u32 unk60;
/* 0x64 */ MenuItem menuItems[8]; /* 0x64 */ MenuItem menuItems[8];
} unkStruct_203B22C; } unkStruct_203B22C;

View File

@ -9,13 +9,13 @@
// size: 0x118 // size: 0x118
struct unk_203B250 struct unk_203B250
{ {
/* 0x0 */ PokemonStruct1 *pokeStruct; /* 0x0 */ Pokemon *pokeStruct;
/* 0x4 */ s16 index; /* 0x4 */ s16 index;
/* 0x6 */ u8 currFriendAreaLocation; // 0 when not in a friend area /* 0x6 */ u8 currFriendAreaLocation; // 0 when not in a friend area
u8 unk7; u8 unk7;
u8 unk8; u8 unk8;
u8 unk9; u8 unk9;
PokemonStruct1 *unkC; Pokemon *unkC;
/* 0x10 */ u32 state; /* 0x10 */ u32 state;
/* 0x14 */ u32 menuAction; /* 0x14 */ u32 menuAction;
MenuStruct unk18; MenuStruct unk18;
@ -31,7 +31,7 @@ struct TeamBadgeData
/* 0x4 */ RGB *palette; // Pics share common palette /* 0x4 */ RGB *palette; // Pics share common palette
}; };
bool8 sub_801D014(PokemonStruct1 *); bool8 sub_801D014(Pokemon *);
u32 sub_801D0DC(void); u32 sub_801D0DC(void);
u32 sub_801D178(void); u32 sub_801D178(void);
u8 sub_801D1D4(void); u8 sub_801D1D4(void);

View File

@ -14,7 +14,7 @@ typedef struct unkStruct_203B270
u8 unk5; u8 unk5;
u8 unk6; u8 unk6;
u8 unk7; u8 unk7;
/* 0x8 */ PokemonStruct1 *pokeStruct; /* 0x8 */ Pokemon *pokeStruct;
/* 0xC */ u8 isTeamLeader; /* 0xC */ u8 isTeamLeader;
/* 0x10 */ Move *moves; /* 0x10 */ Move *moves;
u8 fill14[0x1C - 0x14]; u8 fill14[0x1C - 0x14];

View File

@ -18,7 +18,7 @@ typedef struct unkStruct_203B294
/* 0x3C */ s32 availIQSkillPostGummi; /* 0x3C */ s32 availIQSkillPostGummi;
s32 unk40; // Gummi eaten flag? s32 unk40; // Gummi eaten flag?
/* 0x44 */ Gummi gummi; /* 0x44 */ Gummi gummi;
/* 0x48 */ PokemonStruct1 *pokeStruct; /* 0x48 */ Pokemon *pokeStruct;
/* 0x4C */ u32 itemIndex; /* 0x4C */ u32 itemIndex;
/* 0x50 */ Item item; /* 0x50 */ Item item;
MenuStruct unk54; MenuStruct unk54;
@ -29,7 +29,7 @@ typedef struct unkStruct_203B294
WindowTemplates windows; WindowTemplates windows;
} unkStruct_203B294; } unkStruct_203B294;
bool8 sub_80227B8(PokemonStruct1 *pkmn); bool8 sub_80227B8(Pokemon *pkmn);
u32 sub_8022860(void); u32 sub_8022860(void);
void sub_8022908(void); void sub_8022908(void);

View File

@ -11,7 +11,7 @@
typedef struct unkStruct_203B484 typedef struct unkStruct_203B484
{ {
/* 0x0 */ u32 unk0; /* 0x0 */ u32 unk0;
/* 0x4 */ PokemonStruct1 unk4; /* 0x4 */ Pokemon unk4;
} unkStruct_203B484; } unkStruct_203B484;
// size: 0x84 // size: 0x84

View File

@ -11,7 +11,7 @@ typedef struct unkStruct_203B3F8
/* 0x0 */ u32 state; /* 0x0 */ u32 state;
s16 unk4; s16 unk4;
u16 unk6; u16 unk6;
/* 0x8 */ PokemonStruct1 *pokemon; /* 0x8 */ Pokemon *pokemon;
/* 0xC */ u32 menuAction; /* 0xC */ u32 menuAction;
MenuStruct unk10; MenuStruct unk10;
unkStructFor8013AA0 unk60; unkStructFor8013AA0 unk60;

View File

@ -31,7 +31,7 @@ OpenedFile *GetSpriteData(s32 _species);
void LoadPokemonSprite(s32 _id, bool32 _ignoreDeoxys); void LoadPokemonSprite(s32 _id, bool32 _ignoreDeoxys);
void CloseAllSpriteFiles(void); void CloseAllSpriteFiles(void);
void sub_806890C(void); void sub_806890C(void);
void sub_8068A84(PokemonStruct1 *pokemon); void sub_8068A84(Pokemon *pokemon);
void sub_8068BDC(bool8 a0); void sub_8068BDC(bool8 a0);
void sub_8068F28(void); void sub_8068F28(void);
void sub_8068F80(void); void sub_8068F80(void);

View File

@ -49,7 +49,7 @@ struct unkStruct_203B2BC
u32 id; u32 id;
BulkItem itemToGive; BulkItem itemToGive;
BulkItem item2; BulkItem item2;
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
bool8 isTeamLeader; bool8 isTeamLeader;
u32 moveIndex; // some sort of move index u32 moveIndex; // some sort of move index
u16 moveID; u16 moveID;

View File

@ -21,7 +21,7 @@ typedef struct unkStruct_203B2B4
u32 itemIndex; u32 itemIndex;
BulkItem item1; BulkItem item1;
BulkItem item2; BulkItem item2;
/* 0x1C */ PokemonStruct1 *pokeStruct; /* 0x1C */ Pokemon *pokeStruct;
u32 moveIndex; // some sort of move index u32 moveIndex; // some sort of move index
u16 moveID; u16 moveID;
Move moves[8]; Move moves[8];

View File

@ -14,7 +14,7 @@ typedef struct unkStruct_203B27C
/* 0x4 */ s32 state; /* 0x4 */ s32 state;
/* 0x8 */ u32 fallbackState; /* 0x8 */ u32 fallbackState;
/* 0xC */ s16 speciesNum; /* 0xC */ s16 speciesNum;
/* 0x10 */ PokemonStruct1 *pokeStruct; /* 0x10 */ Pokemon *pokeStruct;
/* 0x14 */ bool8 isNextMoveLinked; /* 0x14 */ bool8 isNextMoveLinked;
bool8 unk15; bool8 unk15;
/* 0x16 */ bool8 isTeamLeader; /* 0x16 */ bool8 isTeamLeader;

View File

@ -11,7 +11,7 @@
struct IQSkillListMenu struct IQSkillListMenu
{ {
/* 0x0 */ s16 species; /* 0x0 */ s16 species;
/* 0x4 */ PokemonStruct1 *pokeStruct; /* 0x4 */ Pokemon *pokeStruct;
/* 0x8 */ u8 iqSkills[NUM_IQ_SKILLS]; /* 0x8 */ u8 iqSkills[NUM_IQ_SKILLS];
/* 0x20 */ s32 numIQSkills; /* 0x20 */ s32 numIQSkills;
/* 0x24 */ MenuHeaderWindow s24; /* 0x24 */ MenuHeaderWindow s24;

View File

@ -11,7 +11,7 @@ struct IQSkillMenu
{ {
/* 0x0 */ u32 state; /* 0x0 */ u32 state;
/* 0x4 */ s16 species; /* 0x4 */ s16 species;
/* 0x8 */ PokemonStruct1 *pokeStruct; /* 0x8 */ Pokemon *pokeStruct;
/* 0xC */ u8 iqSkills[NUM_IQ_SKILLS]; /* 0xC */ u8 iqSkills[NUM_IQ_SKILLS];
/* 0x24 */ u32 menuIndex; /* 0x24 */ u32 menuIndex;
/* 0x28 */ u8 iqSkillIndex; /* 0x28 */ u8 iqSkillIndex;

View File

@ -97,7 +97,7 @@ bool8 IsEdibleItem(u8 id);
u8 xxx_bit_lut_lookup_8091E50(u8 i0, u8 i1); u8 xxx_bit_lut_lookup_8091E50(u8 i0, u8 i1);
bool8 IsInvalidItemReward(u8 itemID); bool8 IsInvalidItemReward(u8 itemID);
bool8 HasGummiItem(void); bool8 HasGummiItem(void);
void GetGummiItemStatBoost(PokemonStruct1* pokemon, u8 id, bool8 checkBoostFlags, Gummi *gummi); void GetGummiItemStatBoost(Pokemon* pokemon, u8 id, bool8 checkBoostFlags, Gummi *gummi);
void ReadHeldItemBits(DataSerializer *, BulkItem *); void ReadHeldItemBits(DataSerializer *, BulkItem *);
void WriteHeldItemBits(DataSerializer *, BulkItem *); void WriteHeldItemBits(DataSerializer *, BulkItem *);
@ -143,4 +143,9 @@ static inline bool8 ItemInShop(Item *item)
return (item->flags & ITEM_FLAG_IN_SHOP); return (item->flags & ITEM_FLAG_IN_SHOP);
} }
static inline bool8 BulkItemExists(BulkItem *item)
{
return item->id != 0;
}
#endif // GUARD_ITEMS_H #endif // GUARD_ITEMS_H

View File

@ -12,7 +12,7 @@ typedef struct LuminousCaveWork
{ {
/* 0x0 */ bool8 evolutionComplete; /* 0x0 */ bool8 evolutionComplete;
/* 0x4 */ EvolveStatus evolveStatus; /* 0x4 */ EvolveStatus evolveStatus;
/* 0xC */ PokemonStruct1 *pokeStruct; /* 0xC */ Pokemon *pokeStruct;
/* 0x10 */ bool8 pokeRenamed; /* 0x10 */ bool8 pokeRenamed;
/* 0x14 */ u32 evoItem1_InvIndex; // inventory index of item /* 0x14 */ u32 evoItem1_InvIndex; // inventory index of item
/* 0x18 */ u32 evoItem2_InvIndex; // inventory index of item /* 0x18 */ u32 evoItem2_InvIndex; // inventory index of item

View File

@ -107,6 +107,11 @@ void sub_8094060(Move *srcMoves, Move *destMoves);
void WritePoke2MovesBits(DataSerializer *, struct Moves *); void WritePoke2MovesBits(DataSerializer *, struct Moves *);
void ReadPoke2MovesBits(DataSerializer *, struct Moves *); void ReadPoke2MovesBits(DataSerializer *, struct Moves *);
// Note: The reason for both macros and static inlines is that some functions require the '!= 0', while others don't.
#define MOVE_FLAG_LINK_CHAIN(move)((move)->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)
#define MOVE_FLAG_SET_LINK_CHAIN(move)((move)->moveFlags |= MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)
#define MOVE_FLAG_CLEAR_LINK_CHAIN(move)((move)->moveFlags &= ~(MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
static inline void ResetMoveFlags(Move *move) static inline void ResetMoveFlags(Move *move)
{ {
move->moveFlags = 0; move->moveFlags = 0;
@ -129,7 +134,7 @@ static inline bool8 MoveFlagLastUsed(Move *move)
static inline bool8 MoveFlagLinkChain(Move *move) static inline bool8 MoveFlagLinkChain(Move *move)
{ {
return (move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN); return MOVE_FLAG_LINK_CHAIN(move) != 0;
} }
static inline bool8 MoveFlagDisabled(Move *move) static inline bool8 MoveFlagDisabled(Move *move)

View File

@ -25,9 +25,9 @@ typedef struct unkStruct_203B35C
unkStruct_203B480 unk22C; unkStruct_203B480 unk22C;
unkStruct_203B480 unk25C; unkStruct_203B480 unk25C;
unkStruct_203B480 unk28C; unkStruct_203B480 unk28C;
PokemonStruct1 unk2BC; Pokemon unk2BC;
unkStruct_203B480 unk314; unkStruct_203B480 unk314;
PokemonStruct1 unk344; Pokemon unk344;
u8 unk39C[0xB4]; // unkStruct_803B344? u8 unk39C[0xB4]; // unkStruct_803B344?
u8 unk450[0xB4]; // unkStruct_803B344? u8 unk450[0xB4]; // unkStruct_803B344?
} unkStruct_203B35C; } unkStruct_203B35C;

View File

@ -17,7 +17,7 @@ typedef struct unkStruct_203B2B8
/* 0xC */ u32 id; /* 0xC */ u32 id;
/* 0x10 */ BulkItem item1; /* 0x10 */ BulkItem item1;
/* 0x14 */ BulkItem item2; /* 0x14 */ BulkItem item2;
/* 0x18 */ PokemonStruct1 *pokeStruct; /* 0x18 */ Pokemon *pokeStruct;
/* 0x1C */ bool8 isTeamLeader; /* 0x1C */ bool8 isTeamLeader;
/* 0x20 */ u32 moveIndex; /* 0x20 */ u32 moveIndex;
/* 0x24 */ u16 moveID; /* 0x24 */ u16 moveID;
@ -35,7 +35,7 @@ typedef struct unkStruct_203B2B8
WindowTemplates unk220; WindowTemplates unk220;
} unkStruct_203B2B8; } unkStruct_203B2B8;
bool8 CreatePartyListMenu(PokemonStruct1 *pokeStruct); bool8 CreatePartyListMenu(Pokemon *pokeStruct);
u32 sub_8025F68(void); u32 sub_8025F68(void);
bool8 sub_802604C(void); bool8 sub_802604C(void);
void CleanPartyListMenu(void); void CleanPartyListMenu(void);

View File

@ -43,13 +43,13 @@ u8 GetBodySize(s32 index);
void CopyMonsterNameToBuffer(u8 * buffer, s32 index); void CopyMonsterNameToBuffer(u8 * buffer, s32 index);
void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index); void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index);
void CopyCyanMonsterNametoBuffer(u8 *buffer, s32 index_); void CopyCyanMonsterNametoBuffer(u8 *buffer, s32 index_);
void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum); void PrintColoredPokeNameToBuffer(u8 *buffer, Pokemon *pokemon, s32 colorNum);
void sub_808D930(u8 *buffer, s32 index); void sub_808D930(u8 *buffer, s32 index);
void sub_808D9DC(u8 *buffer, PokemonStruct2 *, s32 colorNum); void sub_808D9DC(u8 *buffer, DungeonMon *, s32 colorNum);
void sub_808DA0C(u8 *buffer, PokemonStruct2 *); void sub_808DA0C(u8 *buffer, DungeonMon *);
void PeekPokemonItem(s16 index_, BulkItem* item); void PeekPokemonItem(s16 index_, BulkItem* item);
void GivePokemonItem(s16 index_, BulkItem* item); void GivePokemonItem(s16 index_, BulkItem* item);
bool8 IsPokemonRenamed(PokemonStruct1* pokemon); bool8 IsPokemonRenamed(Pokemon* pokemon);
bool8 CanMonLearnMove(u16 moveID, s16 _species); bool8 CanMonLearnMove(u16 moveID, s16 _species);
u8 *GetCategoryString(s16 index); u8 *GetCategoryString(s16 index);
@ -83,73 +83,75 @@ OpenedFile *OpenPokemonDialogueSpriteFile(s16 index);
OpenedFile *GetDialogueSpriteDataPtr(s32 index); OpenedFile *GetDialogueSpriteDataPtr(s32 index);
s32 GetUnownIndex(s16 index); s32 GetUnownIndex(s16 index);
void GenerateHiddenPower(HiddenPower *); void GenerateHiddenPower(HiddenPower *);
s32 GetEvolutionSequence(PokemonStruct1 *pokemon, EvolveStage *); s32 GetEvolutionSequence(Pokemon *pokemon, EvolveStage *);
s32 sub_808E400(s32 _species, s16* _a2, bool32 _bodySizeCheck, bool32 _shedinjaCheck); s32 sub_808E400(s32 _species, s16* _a2, bool32 _bodySizeCheck, bool32 _shedinjaCheck);
void sub_808E490(Move* a1, s32 species); void sub_808E490(Move* a1, s32 species);
void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 *, PokemonStruct1 *, s32); void PokemonToDungeonMon(DungeonMon *, Pokemon *, s32);
void WritePoke1Bits(DataSerializer *, PokemonStruct1 *pokemon); void DungeonMonToRecruitedPokemon(s32 id, DungeonMon* src);
void ReadPoke1Bits(DataSerializer *, PokemonStruct1 *); void DungeonMonToPokemon(Pokemon* dst, DungeonMon* src);
s32 sub_808E218(unkStruct_808E218_arg *, PokemonStruct1 *pokemon); void WritePoke1Bits(DataSerializer *, Pokemon *pokemon);
void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID); void ReadPoke1Bits(DataSerializer *, Pokemon *);
void sub_808D0D8(PokemonStruct1 *pokemon); s32 sub_808E218(unkStruct_808E218_arg *, Pokemon *pokemon);
PokemonStruct1 *GetPlayerPokemonStruct(void); void sub_808CFD0(Pokemon *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID);
PokemonStruct1 *sub_808D1DC(PokemonStruct1*); void sub_808D0D8(Pokemon *pokemon);
PokemonStruct1 *sub_808D378(void); Pokemon *GetPlayerPokemonStruct(void);
PokemonStruct1 *sub_808D3BC(void); Pokemon *sub_808D1DC(Pokemon*);
PokemonStruct1 *sub_808D3F8(void); Pokemon *sub_808D378(void);
PokemonStruct1 * sub_808D434(s16 species, s32 param_2); Pokemon *sub_808D3BC(void);
Pokemon *sub_808D3F8(void);
Pokemon * sub_808D434(s16 species, s32 param_2);
s32 GetFriendSum_808D480(void); s32 GetFriendSum_808D480(void);
bool8 sub_808D4B0(void); bool8 sub_808D4B0(void);
bool8 sub_808D500(void); bool8 sub_808D500(void);
s32 GetUnitSum_808D544(s32 *); s32 GetUnitSum_808D544(s32 *);
s32 sub_808D580(s32 *); s32 sub_808D580(s32 *);
bool8 ComparePokemonNames(s16, s16); bool8 ComparePokemonNames(s16, s16);
void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon); void PrintPokeNameToBuffer(u8 *buffer, Pokemon *pokemon);
void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level);
const u8* DecompressMoveID(const u8* a1, u16* moveID); const u8* DecompressMoveID(const u8* a1, u16* moveID);
bool8 sub_808DA44(s32, u32); bool8 sub_808DA44(s32, u32);
void ConvertStoryMonToPokemon(PokemonStruct1 *dst, struct StoryMonData *src); void ConvertStoryMonToPokemon(Pokemon *dst, struct StoryMonData *src);
void sub_808CE74(s16 _species, bool32 _isLeader, u8* name); void sub_808CE74(s16 _species, bool32 _isLeader, u8* name);
PokemonStruct1 *sub_808D278(s32 species); Pokemon *sub_808D278(s32 species);
static inline bool8 PokemonExists(PokemonStruct1 *mon) static inline bool8 PokemonExists(Pokemon *mon)
{ {
return (mon->flags & POKEMON_FLAG_EXISTS) != 0; return (mon->flags & POKEMON_FLAG_EXISTS) != 0;
} }
static inline bool8 PokemonFlag1Struct2(PokemonStruct2 *mon) static inline bool8 DungeonMonExists(DungeonMon *mon)
{ {
return (mon->flags & POKEMON_FLAG_EXISTS) != 0; return (mon->flags & POKEMON_FLAG_EXISTS) != 0;
} }
static inline bool8 PokemonFlag2(PokemonStruct1 *mon) static inline bool8 PokemonFlag2(Pokemon *mon)
{ {
return (mon->flags & POKEMON_FLAG_ON_TEAM) != 0; return (mon->flags & POKEMON_FLAG_ON_TEAM) != 0;
} }
static inline bool8 PokemonFlag2Struct2(PokemonStruct2 *mon) static inline bool8 PokemonFlag2Struct2(DungeonMon *mon)
{ {
return (mon->flags & POKEMON_FLAG_ON_TEAM) != 0; return (mon->flags & POKEMON_FLAG_ON_TEAM) != 0;
} }
static inline void SetPokemonFlag2(PokemonStruct1 *mon) static inline void SetPokemonFlag2(Pokemon *mon)
{ {
mon->flags |= POKEMON_FLAG_ON_TEAM; mon->flags |= POKEMON_FLAG_ON_TEAM;
} }
static inline bool8 IsMonTeamLeader(PokemonStruct1 *pokemon) static inline bool8 IsMonTeamLeader(Pokemon *pokemon)
{ {
return pokemon->isTeamLeader != FALSE; return pokemon->isTeamLeader != FALSE;
} }
#include "constants/dungeon.h" #include "constants/dungeon.h"
static inline bool8 IsMonPartner(PokemonStruct1 *mon) static inline bool8 IsMonPartner(Pokemon *mon)
{ {
return (mon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_PARTNER); return (mon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_PARTNER);
} }
static inline bool8 IsMonLeader(PokemonStruct1 *mon) static inline bool8 IsMonLeader(Pokemon *mon)
{ {
return (mon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_LEADER); return (mon->dungeonLocation.id == DUNGEON_JOIN_LOCATION_LEADER);
} }

View File

@ -23,9 +23,9 @@ typedef struct EvolveStatus
/* 0x6 */ s16 targetEvolveSpecies; /* 0x6 */ s16 targetEvolveSpecies;
} EvolveStatus; } EvolveStatus;
void SetMonEvolveStatus(struct PokemonStruct1 *pokemon, EvolveStatus *evolveStatus,bool8 param_3); void SetMonEvolveStatus(struct Pokemon *pokemon, EvolveStatus *evolveStatus,bool8 param_3);
s32 GetMonSummaryScreenEvoStringId(PokemonStruct1 *pokemon); s32 GetMonSummaryScreenEvoStringId(Pokemon *pokemon);
PokemonStruct1 *sub_808F734(PokemonStruct1 *pokemon, s16 _species); Pokemon *sub_808F734(Pokemon *pokemon, s16 _species);
PokemonStruct1 *sub_808F798(PokemonStruct1 *pokemon, s16 _species); Pokemon *sub_808F798(Pokemon *pokemon, s16 _species);
#endif // GUARD_POKEMON_EVOLUTION_H #endif // GUARD_POKEMON_EVOLUTION_H

View File

@ -55,6 +55,6 @@ struct UnkInfoTabStruct
}; };
void ShowPokemonSummaryWindow(s32 which, s32 currSubWindowId, struct MonSummaryInfo *monInfo, struct UnkInfoTabStruct *param_4, u32 windowId); void ShowPokemonSummaryWindow(s32 which, s32 currSubWindowId, struct MonSummaryInfo *monInfo, struct UnkInfoTabStruct *param_4, u32 windowId);
void SetMonSummaryInfo(struct MonSummaryInfo *dst, struct PokemonStruct1 *pokemon, bool8 param_3); void SetMonSummaryInfo(struct MonSummaryInfo *dst, struct Pokemon *pokemon, bool8 param_3);
#endif // GUARD_POKEMON_SUMMARY_WINDOW_H #endif // GUARD_POKEMON_SUMMARY_WINDOW_H

View File

@ -27,7 +27,7 @@ typedef struct DungeonSetupInfo
{ {
DungeonSetupSubstruct sub0; // TODO: find a better name DungeonSetupSubstruct sub0; // TODO: find a better name
DungeonMailSeed dungeonSeed; DungeonMailSeed dungeonSeed;
PokemonStruct1 mon; Pokemon mon;
u8 *unk74; u8 *unk74;
Dungeon *dungeon; Dungeon *dungeon;
s16 unk7C; // Set to 5 if the dungeon was skipped (quicksave read failed) s16 unk7C; // Set to 5 if the dungeon was skipped (quicksave read failed)

View File

@ -21,7 +21,7 @@ typedef struct unkPokeSubStruct_C
} unkPokeSubStruct_C; } unkPokeSubStruct_C;
// size: R=0x58 | B=0x40 // size: R=0x58 | B=0x40
typedef struct PokemonStruct1 typedef struct Pokemon
{ {
/* R=0x0 | B=0x0 */ u16 flags; /* R=0x0 | B=0x0 */ u16 flags;
/* R=0x2 | B=0x2 */ bool8 isTeamLeader; /* R=0x2 | B=0x2 */ bool8 isTeamLeader;
@ -38,7 +38,7 @@ typedef struct PokemonStruct1
/* R=0x28 | B=0x1C */ BulkItem heldItem; /* R=0x28 | B=0x1C */ BulkItem heldItem;
/* R=0x2C | B=0x1E */ Move moves[MAX_MON_MOVES]; /* R=0x2C | B=0x1E */ Move moves[MAX_MON_MOVES];
/* R=0x4C | B=0x36 */ u8 name[POKEMON_NAME_LENGTH]; /* R=0x4C | B=0x36 */ u8 name[POKEMON_NAME_LENGTH];
} PokemonStruct1; } Pokemon;
// size: 0x4 // size: 0x4
typedef struct EvolveStage typedef struct EvolveStage
@ -47,15 +47,18 @@ typedef struct EvolveStage
/* 0x2 */ u8 level; /* 0x2 */ u8 level;
} EvolveStage; } EvolveStage;
#define UNK_RECRUITED_POKEMON_ID_55AA 0x55AA
#define UNK_RECRUITED_POKEMON_ID_5AA5 0x5AA5
// size: R=0x64 | B=0x54 // size: R=0x64 | B=0x54
typedef struct PokemonStruct2 typedef struct DungeonMon
{ {
/* R=0x0 | B=0x0 */ u16 flags; // corresponds to flags in PokemonStruct. /* R=0x0 | B=0x0 */ u16 flags; // corresponds to flags in PokemonStruct.
/* R=0x2 | B=0x2 */ bool8 isTeamLeader; /* R=0x2 | B=0x2 */ bool8 isTeamLeader;
/* R=0x3 | B=0x3 */ u8 level; /* R=0x3 | B=0x3 */ u8 level;
/* R=0x4 | B=0x4 */ DungeonLocation dungeonLocation; /* R=0x4 | B=0x4 */ DungeonLocation dungeonLocation;
/* R=0x8 | B=0x6 */ s16 IQ; /* R=0x8 | B=0x6 */ s16 IQ;
/* R=0xA | B=0x8 */ s16 unkA; /* R=0xA | B=0x8 */ s16 recruitedPokemonId; // id of corresponding gRecruitedPokemonRef->pokemon[]
/* R=0xC | B=0xA */ u16 unkC; /* R=0xC | B=0xA */ u16 unkC;
/* R=0xE | B=0xC */ s16 speciesNum; /* R=0xE | B=0xC */ s16 speciesNum;
/* R=0x10 | B=0xE */ u16 unk10; // pokeHP /* R=0x10 | B=0xE */ u16 unk10; // pokeHP
@ -70,14 +73,14 @@ typedef struct PokemonStruct2
/* R=0x50 | B=0x45 */ u8 tacticIndex; /* R=0x50 | B=0x45 */ u8 tacticIndex;
/* R=0x54 | B=0x46 */ HiddenPower hiddenPower; /* R=0x54 | B=0x46 */ HiddenPower hiddenPower;
/* R=0x58 | B=0x4A */ u8 name[POKEMON_NAME_LENGTH]; // name (other offset) /* R=0x58 | B=0x4A */ u8 name[POKEMON_NAME_LENGTH]; // name (other offset)
} PokemonStruct2; } DungeonMon;
// size: R=0x90E8 | B=0x6990 // size: R=0x90E8 | B=0x6990
typedef struct RecruitedMon typedef struct RecruitedMon
{ {
/* R=0x0 | B=0x0 */ PokemonStruct1 pokemon[NUM_MONSTERS]; /* R=0x0 | B=0x0 */ Pokemon pokemon[NUM_MONSTERS];
/* R=0x8DF8 | B=0x6740 */ PokemonStruct2 pokemon2[4]; /* R=0x8DF8 | B=0x6740 */ DungeonMon dungeonTeam[MAX_TEAM_MEMBERS];
/* R=0x8F88 | B=0x6890 */ PokemonStruct1 team[MAX_TEAM_MEMBERS]; /* R=0x8F88 | B=0x6890 */ Pokemon team[MAX_TEAM_MEMBERS];
} RecruitedMon; } RecruitedMon;
// size: 0x4 // size: 0x4

View File

@ -70,7 +70,7 @@ typedef struct unkStruct_203B480
typedef struct WonderMailStruct_203B2C0_sub typedef struct WonderMailStruct_203B2C0_sub
{ {
/* 0x0 */ unkStruct_203B480 mail; /* 0x0 */ unkStruct_203B480 mail;
/* 0x30 */ PokemonStruct1 pokemon; /* 0x30 */ Pokemon pokemon;
} WonderMailStruct_203B2C0_sub; } WonderMailStruct_203B2C0_sub;
#endif // GUARD_STR_WONDER_MAIL_H #endif // GUARD_STR_WONDER_MAIL_H

View File

@ -42,7 +42,7 @@ struct WorldMapInfo
{ {
DungeonLocation startLocation; DungeonLocation startLocation;
DungeonSetupSubstruct unk4; DungeonSetupSubstruct unk4;
PokemonStruct1 mon; Pokemon mon;
u8 unk6C; u8 unk6C;
u8 unk6D[WORLD_MAP_UNK_6D_COUNT]; u8 unk6D[WORLD_MAP_UNK_6D_COUNT];
}; };

View File

@ -192,7 +192,7 @@ static s32 GetNumMonsAbleToLearnItemMove(void)
s32 numMons; s32 numMons;
s32 i; s32 i;
s32 team[MAX_TEAM_MEMBERS]; s32 team[MAX_TEAM_MEMBERS];
PokemonStruct1 *preload; Pokemon *preload;
length = sub_808D580(team); length = sub_808D580(team);
sUnknown_203B22C->monsAbleToLearnMove = 0; sUnknown_203B22C->monsAbleToLearnMove = 0;
@ -214,7 +214,7 @@ static s32 GetNumMonsAbleToLearnItemMove(void)
UNUSED static bool8 sub_801B374(u8 id) UNUSED static bool8 sub_801B374(u8 id)
{ {
u16 moveID; u16 moveID;
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
s32 i; s32 i;
pokeStruct = &gRecruitedPokemonRef->pokemon[0]; pokeStruct = &gRecruitedPokemonRef->pokemon[0];

View File

@ -55,10 +55,10 @@ static void sub_801D85C(void);
static void sub_801D878(void); static void sub_801D878(void);
static void sub_801D894(void); static void sub_801D894(void);
bool8 sub_801D014(PokemonStruct1 *a0) bool8 sub_801D014(Pokemon *a0)
{ {
s32 index; s32 index;
PokemonStruct1 *pokemon; Pokemon *pokemon;
struct unk_203B250 *preload; struct unk_203B250 *preload;
ResetUnusedInputStruct(); ResetUnusedInputStruct();
@ -139,8 +139,6 @@ u32 sub_801D0DC(void)
u32 sub_801D178(void) u32 sub_801D178(void)
{ {
PokemonStruct1 *pokeStruct;
if (sUnknown_203B250->unk9 != 0) if (sUnknown_203B250->unk9 != 0)
return 2; return 2;
@ -151,17 +149,15 @@ u32 sub_801D178(void)
return 1; return 1;
if (sUnknown_203B250->unkC != GetPlayerPokemonStruct()) if (sUnknown_203B250->unkC != GetPlayerPokemonStruct())
goto _ret4; return 4;
if ((s16) sub_80A7AE8(7) < 0) if ((s16) sub_80A7AE8(7) < 0)
return 0; return 0;
pokeStruct = sub_808D3F8(); if (PokemonFlag2(sub_808D3F8()))
if (!(pokeStruct->flags >> 1 & 1)) return 0;
_ret4:
return 4;
return 0; return 4;
} }
u8 sub_801D1D4(void) u8 sub_801D1D4(void)

View File

@ -215,7 +215,7 @@ _134:
{ {
move = &gUnknown_203B270->moves[index2]; move = &gUnknown_203B270->moves[index2];
if ((move->moveFlags & MOVE_FLAG_EXISTS)) { if ((move->moveFlags & MOVE_FLAG_EXISTS)) {
if ((move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) { if (MOVE_FLAG_LINK_CHAIN(move)) {
gUnknown_203B270->fill14[index2] = 1; gUnknown_203B270->fill14[index2] = 1;
} }
else { else {
@ -318,7 +318,7 @@ void sub_801F280(bool8 param_1)
BufferDefaultMoveName(gFormatBuffer_Items[0],move,&uStack_30); BufferDefaultMoveName(gFormatBuffer_Items[0],move,&uStack_30);
y = GetMenuEntryYCoord(&gUnknown_203B270->input,i); y = GetMenuEntryYCoord(&gUnknown_203B270->input,i);
linkChain = MoveFlagLinkChain(move); linkChain = MOVE_FLAG_LINK_CHAIN(move);
x = !linkChain ? 0x8 : 0xD; x = !linkChain ? 0x8 : 0xD;
if (!linkChain && i != 0) { if (!linkChain && i != 0) {
AddUnderScoreHighlight(gUnknown_203B270->unk50,0xc,y - 2,0x78,7); AddUnderScoreHighlight(gUnknown_203B270->unk50,0xc,y - 2,0x78,7);

View File

@ -14,7 +14,7 @@
struct unkStruct_203B274 struct unkStruct_203B274
{ {
// size: 0x3e8 // size: 0x3e8
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
unkStruct_808E218_arg *unk4; unkStruct_808E218_arg *unk4;
unkStruct_808E218_arg unk8; unkStruct_808E218_arg unk8;
MenuHeaderWindow s348; MenuHeaderWindow s348;

View File

@ -31,7 +31,7 @@ static void sub_80230E8(void);
static void sub_8023104(void); static void sub_8023104(void);
static void sub_8023120(void); static void sub_8023120(void);
bool8 sub_80227B8(PokemonStruct1 *pkmn) bool8 sub_80227B8(Pokemon *pkmn)
{ {
ResetUnusedInputStruct(); ResetUnusedInputStruct();
ShowWindows(NULL, TRUE, TRUE); ShowWindows(NULL, TRUE, TRUE);

View File

@ -88,7 +88,7 @@ static void sub_80245D0(void)
static void sub_8024604(void) static void sub_8024604(void)
{ {
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
struct MonSummaryInfo *iVar3; struct MonSummaryInfo *iVar3;
sUnknown_203B2AC->unk34[0] = 2; sUnknown_203B2AC->unk34[0] = 2;

View File

@ -730,12 +730,12 @@ void sub_8067794(Entity *entity, Entity *targetEntity, s32 a2)
stringPtr2 = gUnknown_80F913C; stringPtr2 = gUnknown_80F913C;
teamIndex = info2->teamIndex; teamIndex = info2->teamIndex;
if (teamIndex >= 0) { if (teamIndex >= 0) {
PokemonStruct2 *pokeStruct = &gRecruitedPokemonRef->pokemon2[teamIndex]; DungeonMon *pokeStruct = &gRecruitedPokemonRef->dungeonTeam[teamIndex];
if (sub_806A564(pokeStruct->unkA)) { if (sub_806A564(pokeStruct->recruitedPokemonId)) {
stringPtr1 = gUnknown_80F9114; stringPtr1 = gUnknown_80F9114;
stringPtr2 = gMonDisappointedAndLeft; stringPtr2 = gMonDisappointedAndLeft;
} }
else if (sub_806A58C(pokeStruct->unkA)) { else if (sub_806A58C(pokeStruct->recruitedPokemonId)) {
if (IsMakuhitaTrainingMaze()) { if (IsMakuhitaTrainingMaze()) {
stringPtr1 = gSendMonBackQ; stringPtr1 = gSendMonBackQ;
} }

View File

@ -68,7 +68,7 @@ extern void sub_806A6E8(Entity *entity);
s32 sub_806C444(s32 species, s32 level); s32 sub_806C444(s32 species, s32 level);
s32 sub_806C488(s32 species, s32 level, s32 categoryIndex); s32 sub_806C488(s32 species, s32 level, s32 categoryIndex);
s32 sub_806C4D4(s32 species, s32 level, s32 categoryIndex); s32 sub_806C4D4(s32 species, s32 level, s32 categoryIndex);
bool8 sub_806B8CC(s16 _species, s32 x, s32 y, PokemonStruct2 *monPtr, Entity **a4, bool32 _a5, u32 _a6); bool8 sub_806B8CC(s16 _species, s32 x, s32 y, DungeonMon *monPtr, Entity **a4, bool32 _a5, u32 _a6);
void sub_806BC68(bool8 a0, Entity *entity, struct unkStruct_806B7F8 *structPtr, DungeonPos *pos); void sub_806BC68(bool8 a0, Entity *entity, struct unkStruct_806B7F8 *structPtr, DungeonPos *pos);
void ResetMonEntityData(EntityInfo *, bool8 a1); void ResetMonEntityData(EntityInfo *, bool8 a1);
void sub_806C264(s32 teamIndex, EntityInfo *entInfo); void sub_806C264(s32 teamIndex, EntityInfo *entInfo);
@ -217,9 +217,9 @@ UNUSED static s32 sub_806B09C(SpawnPokemonData *unkPtr, bool8 a1)
SpawnPokemonData *loopPtr; SpawnPokemonData *loopPtr;
for (i = 0, unk2Field = unkPtr->randNum, loopPtr = unkPtr; i < MAX_TEAM_MEMBERS; i++) { for (i = 0, unk2Field = unkPtr->randNum, loopPtr = unkPtr; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *monStructPtr = &gRecruitedPokemonRef->pokemon2[i]; DungeonMon *monStructPtr = &gRecruitedPokemonRef->dungeonTeam[i];
if (PokemonFlag1Struct2(monStructPtr) && PokemonFlag2Struct2(monStructPtr)) if (DungeonMonExists(monStructPtr) && PokemonFlag2Struct2(monStructPtr))
{ {
for (j = 0; j < count; j++) { for (j = 0; j < count; j++) {
if (ExtractSpeciesIndex(&unkPtr[j]) == monStructPtr->speciesNum) if (ExtractSpeciesIndex(&unkPtr[j]) == monStructPtr->speciesNum)
@ -253,21 +253,21 @@ extern const DungeonPos gUnknown_80F4598[];
void sub_806B168(void) void sub_806B168(void)
{ {
s32 count; s32 count;
PokemonStruct2 *monPtrs[MAX_TEAM_MEMBERS]; DungeonMon *monPtrs[MAX_TEAM_MEMBERS];
PokemonStruct2 *monPtrs2[MAX_TEAM_MEMBERS]; // Leader and partner? DungeonMon *monPtrs2[MAX_TEAM_MEMBERS]; // Leader and partner?
u8 playerSpawnRoomId = GetTile(gDungeon->playerSpawn.x, gDungeon->playerSpawn.y)->room; u8 playerSpawnRoomId = GetTile(gDungeon->playerSpawn.x, gDungeon->playerSpawn.y)->room;
s32 i; s32 i;
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *currMonPtr = &gRecruitedPokemonRef->pokemon2[i]; DungeonMon *currMonPtr = &gRecruitedPokemonRef->dungeonTeam[i];
currMonPtr->unkC = i; currMonPtr->unkC = i;
} }
// Populate monPtrs // Populate monPtrs
count = 0; count = 0;
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *currMonPtr = &gRecruitedPokemonRef->pokemon2[i]; DungeonMon *currMonPtr = &gRecruitedPokemonRef->dungeonTeam[i];
if (PokemonFlag1Struct2(currMonPtr) && PokemonFlag2Struct2(currMonPtr)) { if (DungeonMonExists(currMonPtr) && PokemonFlag2Struct2(currMonPtr)) {
monPtrs[count++] = currMonPtr; monPtrs[count++] = currMonPtr;
} }
} }
@ -278,7 +278,7 @@ void sub_806B168(void)
// Populate monPtrs2 // Populate monPtrs2
count = 0; count = 0;
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *currMonPtr = monPtrs[i]; DungeonMon *currMonPtr = monPtrs[i];
if (currMonPtr != NULL && currMonPtr->isTeamLeader) { if (currMonPtr != NULL && currMonPtr->isTeamLeader) {
monPtrs[i] = NULL; monPtrs[i] = NULL;
monPtrs2[count++] = currMonPtr; monPtrs2[count++] = currMonPtr;
@ -287,7 +287,7 @@ void sub_806B168(void)
if (gDungeon->unk644.unk18 == 0) { if (gDungeon->unk644.unk18 == 0) {
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *currMonPtr = monPtrs[i]; DungeonMon *currMonPtr = monPtrs[i];
if (currMonPtr != NULL && currMonPtr->dungeonLocation.id == DUNGEON_JOIN_LOCATION_PARTNER) { if (currMonPtr != NULL && currMonPtr->dungeonLocation.id == DUNGEON_JOIN_LOCATION_PARTNER) {
monPtrs[i] = NULL; monPtrs[i] = NULL;
monPtrs2[count++] = currMonPtr; monPtrs2[count++] = currMonPtr;
@ -296,7 +296,7 @@ void sub_806B168(void)
} }
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *currMonPtr = monPtrs[i]; DungeonMon *currMonPtr = monPtrs[i];
if (monPtrs[i] != NULL) { if (monPtrs[i] != NULL) {
monPtrs[i] = NULL; monPtrs[i] = NULL;
monPtrs2[count++] = currMonPtr; monPtrs2[count++] = currMonPtr;
@ -308,7 +308,7 @@ void sub_806B168(void)
// Do something else // Do something else
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *currMonPtr = monPtrs2[i]; DungeonMon *currMonPtr = monPtrs2[i];
if (currMonPtr != NULL) { if (currMonPtr != NULL) {
DungeonPos unkPosition; DungeonPos unkPosition;
@ -362,14 +362,14 @@ void sub_806B404(void)
{ {
Entity *leader; Entity *leader;
s32 i; s32 i;
PokemonStruct2 *monPtrs[MAX_TEAM_MEMBERS]; DungeonMon *monPtrs[MAX_TEAM_MEMBERS];
u8 roomId; u8 roomId;
DungeonPos pos; DungeonPos pos;
s32 count = 0; s32 count = 0;
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *currMonPtr = &gRecruitedPokemonRef->pokemon2[i]; DungeonMon *currMonPtr = &gRecruitedPokemonRef->dungeonTeam[i];
if (PokemonFlag1Struct2(currMonPtr) && PokemonFlag2Struct2(currMonPtr) && currMonPtr->unkA == 0x55AA) { if (DungeonMonExists(currMonPtr) && PokemonFlag2Struct2(currMonPtr) && currMonPtr->recruitedPokemonId == UNK_RECRUITED_POKEMON_ID_55AA) {
monPtrs[count++] = currMonPtr; monPtrs[count++] = currMonPtr;
break; break;
} }
@ -395,10 +395,10 @@ void sub_806B404(void)
bool8 skipNextLoop; bool8 skipNextLoop;
const Tile *tile; const Tile *tile;
s32 j; s32 j;
PokemonStruct2 *currMonPtr = monPtrs[i]; DungeonMon *currMonPtr = monPtrs[i];
if (currMonPtr != NULL && PokemonFlag1Struct2(currMonPtr) && PokemonFlag2Struct2(currMonPtr) && currMonPtr->unkA == 0x55AA) { if (currMonPtr != NULL && DungeonMonExists(currMonPtr) && PokemonFlag2Struct2(currMonPtr) && currMonPtr->recruitedPokemonId == UNK_RECRUITED_POKEMON_ID_55AA) {
currMonPtr->unkA = 0x5AA5; currMonPtr->recruitedPokemonId = UNK_RECRUITED_POKEMON_ID_5AA5;
skipNextLoop = FALSE; skipNextLoop = FALSE;
j = 0; j = 0;
while (1) { while (1) {
@ -561,7 +561,7 @@ Entity* sub_806B7F8(struct unkStruct_806B7F8 *structPtr, bool8 a1)
return entity; return entity;
} }
bool8 sub_806B8CC(s16 _species, s32 x, s32 y, PokemonStruct2 *monPtr, Entity **a4, bool32 _a5, u32 _a6) bool8 sub_806B8CC(s16 _species, s32 x, s32 y, DungeonMon *monPtr, Entity **a4, bool32 _a5, u32 _a6)
{ {
s32 i; s32 i;
DungeonPos unkPosition; DungeonPos unkPosition;
@ -964,7 +964,7 @@ void sub_806C1D8(void)
void sub_806C264(s32 teamIndex, EntityInfo *entInfo) void sub_806C264(s32 teamIndex, EntityInfo *entInfo)
{ {
s32 i; s32 i;
PokemonStruct2 *monPtr = &gRecruitedPokemonRef->pokemon2[teamIndex]; DungeonMon *monPtr = &gRecruitedPokemonRef->dungeonTeam[teamIndex];
monPtr->unk10 = entInfo->HP; monPtr->unk10 = entInfo->HP;
monPtr->unk12 = entInfo->maxHPStat; monPtr->unk12 = entInfo->maxHPStat;
@ -987,8 +987,8 @@ void sub_806C264(s32 teamIndex, EntityInfo *entInfo)
monPtr->belly = entInfo->belly; monPtr->belly = entInfo->belly;
monPtr->maxBelly = entInfo->maxBelly; monPtr->maxBelly = entInfo->maxBelly;
monPtr->itemSlot = entInfo->heldItem; monPtr->itemSlot = entInfo->heldItem;
if (monPtr->unkA == 0x55AA) { if (monPtr->recruitedPokemonId == UNK_RECRUITED_POKEMON_ID_55AA) {
monPtr->unkA = 0x5AA5; monPtr->recruitedPokemonId = UNK_RECRUITED_POKEMON_ID_5AA5;
} }
} }

View File

@ -127,7 +127,7 @@ bool8 sub_806F660(Entity *pokemon, Entity *target)
} }
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (!PokemonFlag1Struct2(&gRecruitedPokemonRef->pokemon2[i])) if (!DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[i]))
break; break;
} }
if (i == 4) { if (i == 4) {
@ -236,7 +236,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa
u8 friendArea; u8 friendArea;
bool8 flag; bool8 flag;
Entity *leader; Entity *leader;
PokemonStruct2 *pokeStruct2; DungeonMon *pokeStruct2;
int pokeIndex; int pokeIndex;
Entity *local_2c; Entity *local_2c;
s32 iVar2; s32 iVar2;
@ -261,7 +261,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa
{ {
for(pokeIndex = 0; pokeIndex < MAX_TEAM_MEMBERS; pokeIndex++) for(pokeIndex = 0; pokeIndex < MAX_TEAM_MEMBERS; pokeIndex++)
{ {
if (!(PokemonFlag1Struct2(&gRecruitedPokemonRef->pokemon2[pokeIndex]))) if (!(DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[pokeIndex])))
break; break;
} }
@ -275,7 +275,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa
flag = TRUE; flag = TRUE;
} }
sub_8068FE0(entity2,500,entity1); sub_8068FE0(entity2,500,entity1);
pokeStruct2 = &gRecruitedPokemonRef->pokemon2[pokeIndex]; pokeStruct2 = &gRecruitedPokemonRef->dungeonTeam[pokeIndex];
pokeStruct2->flags = 3; pokeStruct2->flags = 3;
pokeStruct2->isTeamLeader = FALSE; pokeStruct2->isTeamLeader = FALSE;
pokeStruct2->level = param_3->level; pokeStruct2->level = param_3->level;
@ -283,7 +283,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa
SetDefaultIQSkills(&pokeStruct2->IQSkills,FALSE); SetDefaultIQSkills(&pokeStruct2->IQSkills,FALSE);
pokeStruct2->hiddenPower = param_3->hiddenPower; pokeStruct2->hiddenPower = param_3->hiddenPower;
pokeStruct2->tacticIndex = 0; pokeStruct2->tacticIndex = 0;
pokeStruct2->unkA = -1; pokeStruct2->recruitedPokemonId = -1;
pokeStruct2->unkC = pokeIndex; pokeStruct2->unkC = pokeIndex;
pokeStruct2->speciesNum = param_3->id; pokeStruct2->speciesNum = param_3->id;
(pokeStruct2->dungeonLocation) = gDungeon->unk644.dungeonLocation; (pokeStruct2->dungeonLocation) = gDungeon->unk644.dungeonLocation;
@ -363,7 +363,7 @@ bool8 sub_806FD18(Entity *param_1)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (!(PokemonFlag1Struct2(&gRecruitedPokemonRef->pokemon2[i]))) if (!(DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[i])))
break; break;
} }
@ -385,7 +385,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr)
u8 friendArea; u8 friendArea;
bool8 flag; bool8 flag;
Entity *leader; Entity *leader;
PokemonStruct2 *pokeStruct2; DungeonMon *pokeStruct2;
int index; int index;
struct unkStruct_8069D4C local_74; struct unkStruct_8069D4C local_74;
Entity *local_2c; Entity *local_2c;
@ -399,7 +399,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr)
for(index = 0; index < MAX_TEAM_MEMBERS; index++) for(index = 0; index < MAX_TEAM_MEMBERS; index++)
{ {
if (((u8)(index[gRecruitedPokemonRef->pokemon2].flags) & 1) == 0) break; if (!DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[index])) break;
} }
if (index == MAX_TEAM_MEMBERS) { if (index == MAX_TEAM_MEMBERS) {
@ -407,7 +407,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr)
} }
else { else {
friendArea = GetFriendArea(local_74.id); friendArea = GetFriendArea(local_74.id);
pokeStruct2 = &gRecruitedPokemonRef->pokemon2[index]; pokeStruct2 = &gRecruitedPokemonRef->dungeonTeam[index];
pokeStruct2->flags = 3; pokeStruct2->flags = 3;
pokeStruct2->isTeamLeader = FALSE; pokeStruct2->isTeamLeader = FALSE;
pokeStruct2->level = local_74.level; pokeStruct2->level = local_74.level;
@ -415,7 +415,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr)
SetDefaultIQSkills(&pokeStruct2->IQSkills,FALSE); SetDefaultIQSkills(&pokeStruct2->IQSkills,FALSE);
pokeStruct2->hiddenPower = local_74.hiddenPower; pokeStruct2->hiddenPower = local_74.hiddenPower;
pokeStruct2->tacticIndex = 0; pokeStruct2->tacticIndex = 0;
pokeStruct2->unkA = -1; pokeStruct2->recruitedPokemonId = -1;
pokeStruct2->unkC = index; pokeStruct2->unkC = index;
pokeStruct2->speciesNum = local_74.id; pokeStruct2->speciesNum = local_74.id;
pokeStruct2->dungeonLocation = gDungeon->unk644.dungeonLocation; pokeStruct2->dungeonLocation = gDungeon->unk644.dungeonLocation;

View File

@ -327,7 +327,7 @@ u32 sub_80954B4(void)
u32 sub_80954CC(u8 *buffer, u32 size) u32 sub_80954CC(u8 *buffer, u32 size)
{ {
DataSerializer backup; DataSerializer backup;
PokemonStruct1 *mon; Pokemon *mon;
s32 i; s32 i;
InitBitReader(&backup, buffer, size); InitBitReader(&backup, buffer, size);
@ -339,7 +339,7 @@ u32 sub_80954CC(u8 *buffer, u32 size)
ReadBits(&backup, &gUnknown_203B484->unk0, 32); ReadBits(&backup, &gUnknown_203B484->unk0, 32);
mon = &gUnknown_203B484->unk4; mon = &gUnknown_203B484->unk4;
memset(mon, 0, sizeof(PokemonStruct1)); memset(mon, 0, sizeof(Pokemon));
ReadBits(&backup, &mon->flags, 2); ReadBits(&backup, &mon->flags, 2);
ReadBits(&backup, &mon->isTeamLeader, 1); ReadBits(&backup, &mon->isTeamLeader, 1);
@ -373,7 +373,7 @@ u32 sub_80954CC(u8 *buffer, u32 size)
u32 sub_8095624(u8 *buffer, u32 b) u32 sub_8095624(u8 *buffer, u32 b)
{ {
DataSerializer backup; DataSerializer backup;
PokemonStruct1 *mon; Pokemon *mon;
s32 i; s32 i;
InitBitWriter(&backup, buffer, b); InitBitWriter(&backup, buffer, b);

View File

@ -1007,7 +1007,7 @@ s32 CountJobsinDungeon(u8 dungeon)
return count; return count;
} }
bool8 sub_8096A08(u8 dungeon, PokemonStruct1 *pokemon) bool8 sub_8096A08(u8 dungeon, Pokemon *pokemon)
{ {
WonderMail *mail; WonderMail *mail;
s32 index; s32 index;

View File

@ -48,9 +48,9 @@ void sub_809A62C(void);
void sub_809A7EC(void); void sub_809A7EC(void);
void sub_809A83C(s16 index); void sub_809A83C(s16 index);
extern void sub_80A8EC0(u8 *, u32); extern void sub_80A8EC0(u8 *, u32);
PokemonStruct1 *sub_808D3BC(void); Pokemon *sub_808D3BC(void);
PokemonStruct1 *sub_808D3F8(void); Pokemon *sub_808D3F8(void);
PokemonStruct1 *sub_80A8D54(s16); Pokemon *sub_80A8D54(s16);
void sub_80A7DDC(s16 *, s16*); void sub_80A7DDC(s16 *, s16*);
u8 IsStarterMonster(s16); u8 IsStarterMonster(s16);
s16 sub_80A8BFC(s32); s16 sub_80A8BFC(s32);
@ -333,7 +333,7 @@ bool8 sub_809A8B8(s32 param_1, s32 param_2)
sub_80A7DDC(&local_28,&local_26); sub_80A7DDC(&local_28,&local_26);
if (local_28 >= 10 && local_28 <= 29) { if (local_28 >= 10 && local_28 <= 29) {
PokemonStruct1 *pPVar6 = sub_80A8D54(local_28); Pokemon *pPVar6 = sub_80A8D54(local_28);
if (pPVar6 == NULL) { if (pPVar6 == NULL) {
uVar9 = '\0'; uVar9 = '\0';
} }

View File

@ -139,7 +139,7 @@ static void sub_803A3BC(void)
item = ITEM_CHERI_BERRY; item = ITEM_CHERI_BERRY;
for (i = 0; i < 300; i++) { for (i = 0; i < 300; i++) {
PokemonStruct1 pokemon; Pokemon pokemon;
u16 moves[MAX_MON_MOVES]; u16 moves[MAX_MON_MOVES];
u8 buffer[20]; u8 buffer[20];
DungeonLocation dungeonLoc = {.id = DUNGEON_MT_THUNDER_PEAK, .floor = 16}; DungeonLocation dungeonLoc = {.id = DUNGEON_MT_THUNDER_PEAK, .floor = 16};

View File

@ -213,20 +213,13 @@ static void sub_803ABAC(void)
static bool8 sub_803ABC8(void) static bool8 sub_803ABC8(void)
{ {
PokemonStruct1 *mon;
s32 i; s32 i;
s32 mask;
for (i = 0, mask = 1; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
// Some check was optimized out. Needed for matching. Thanks kaz Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
if (i) {
u8 unk = -unk;
}
mon = &gRecruitedPokemonRef->pokemon[i]; if (PokemonExists(mon)
&& PokemonFlag2(mon)
if ((mask & mon->flags) != 0
&& ((mon->flags >> 1) & mask) != 0
&& sUnknown_203B3F4->friendArea == GetFriendArea(mon->speciesNum)) && sUnknown_203B3F4->friendArea == GetFriendArea(mon->speciesNum))
return FALSE; return FALSE;

View File

@ -41,12 +41,12 @@ extern void sub_80684C4(void);
void sub_8045064(void); void sub_8045064(void);
extern void sub_8068344(void); extern void sub_8068344(void);
bool8 CanSubMenuItemBeChosen(s32 param_1); bool8 CanSubMenuItemBeChosen(s32 param_1);
void sub_8068310(s32 n, PokemonStruct1 **monPtrs); void sub_8068310(s32 n, Pokemon **monPtrs);
void sub_8067F00(u8 a0, PokemonStruct1 **a1, s32 a2, s32 a3, s32 a4); void sub_8067F00(u8 a0, Pokemon **a1, s32 a2, s32 a3, s32 a4);
void sub_8083D1C(void); void sub_8083D1C(void);
void PlayDungeonConfirmationSE(void); void PlayDungeonConfirmationSE(void);
void PlayDungeonCancelSE(void); void PlayDungeonCancelSE(void);
void sub_806806C(PokemonStruct1 *a0); void sub_806806C(Pokemon *a0);
void CreateDungeonMenuSubWindow(WindowTemplates *a0, s32 a1); void CreateDungeonMenuSubWindow(WindowTemplates *a0, s32 a1);
extern const s32 gUnknown_8106E80[]; extern const s32 gUnknown_8106E80[];
@ -92,7 +92,7 @@ static const WindowTemplates gUnknown_8106DC8 = {
} }
}; };
void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) void sub_8067A80(u8 a0, s32 a1, s32 a2, Pokemon **a3)
{ {
s32 i; s32 i;
s32 r10; s32 r10;
@ -331,7 +331,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3)
} }
} }
void sub_8067F00(u8 a0, PokemonStruct1 **a1, s32 a2_, s32 a3, s32 a4) void sub_8067F00(u8 a0, Pokemon **a1, s32 a2_, s32 a3, s32 a4)
{ {
s32 i, y; s32 i, y;
s32 a2; s32 a2;
@ -385,7 +385,7 @@ void sub_8067F00(u8 a0, PokemonStruct1 **a1, s32 a2_, s32 a3, s32 a4)
sub_80073E0(1); sub_80073E0(1);
} }
void sub_806806C(PokemonStruct1 *a0) void sub_806806C(Pokemon *a0)
{ {
struct MonSummaryInfo unkStruct; struct MonSummaryInfo unkStruct;
struct UnkInfoTabStruct var_C8; struct UnkInfoTabStruct var_C8;
@ -516,7 +516,7 @@ void sub_806806C(PokemonStruct1 *a0)
sub_803EAF0(0, NULL); sub_803EAF0(0, NULL);
} }
void sub_8068310(s32 n, PokemonStruct1 **monPtrs) void sub_8068310(s32 n, Pokemon **monPtrs)
{ {
s32 i; s32 i;
s32 counter = 0; s32 counter = 0;

View File

@ -153,7 +153,7 @@ void ChooseAIMove(Entity *pokemon)
{ {
break; break;
} }
if (i != 0 && !(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) if (i != 0 && !MOVE_FLAG_LINK_CHAIN(move))
{ {
if (linkedMoveStartIndex + 1 < i && minPP <= 1 && linkedMoveStartIndex + 1 <= i) if (linkedMoveStartIndex + 1 < i && minPP <= 1 && linkedMoveStartIndex + 1 <= i)
{ {

View File

@ -13,8 +13,8 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla
{ {
EntityInfo *pokemonInfo = GetEntInfo(targetPokemon); EntityInfo *pokemonInfo = GetEntInfo(targetPokemon);
s32 itemWeight = 0; s32 itemWeight = 0;
bool8 targetOther = itemTargetFlags & 1; bool8 targetOther = (itemTargetFlags & 1) != 0;
u16 targetAlly = (itemTargetFlags >> 1) & 1; u16 targetAlly = (itemTargetFlags & 2) != 0;
s32 i; s32 i;
Move *move; Move *move;
Move *move2; Move *move2;

View File

@ -513,7 +513,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
} }
} }
else { else {
PokemonStruct2 *recruitedMon = &gRecruitedPokemonRef->pokemon2[targetData->teamIndex]; DungeonMon *recruitedMon = &gRecruitedPokemonRef->dungeonTeam[targetData->teamIndex];
if (targetData->isTeamLeader || (targetData->joinedAt.id == DUNGEON_JOIN_LOCATION_PARTNER && gDungeon->unk644.unk18 == 0)) { if (targetData->isTeamLeader || (targetData->joinedAt.id == DUNGEON_JOIN_LOCATION_PARTNER && gDungeon->unk644.unk18 == 0)) {
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9CEC[r8]); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9CEC[r8]);
} }
@ -523,7 +523,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
else if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { else if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) {
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]);
} }
else if (sub_806A58C(recruitedMon->unkA)) { else if (sub_806A58C(recruitedMon->recruitedPokemonId)) {
if (gDungeon->unk644.unk19 != 0) { if (gDungeon->unk644.unk19 != 0) {
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D8C[r8]); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D8C[r8]);
} }

View File

@ -1059,7 +1059,7 @@ void sub_8051E7C(Entity *pokemon)
} }
} }
static inline bool8 MonHasItem(PokemonStruct1 *mon) static inline bool8 MonHasItem(Pokemon *mon)
{ {
return (mon->heldItem.id != 0); return (mon->heldItem.id != 0);
} }
@ -1076,8 +1076,8 @@ static bool8 sub_805210C(u8 itemId)
} }
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
if (PokemonFlag1Struct2(&gRecruitedPokemonRef->pokemon2[i]) && ItemExists(&gRecruitedPokemonRef->pokemon2[i].itemSlot)) { if (DungeonMonExists(&gRecruitedPokemonRef->dungeonTeam[i]) && ItemExists(&gRecruitedPokemonRef->dungeonTeam[i].itemSlot)) {
if (gRecruitedPokemonRef->pokemon2[i].itemSlot.id == itemId) if (gRecruitedPokemonRef->dungeonTeam[i].itemSlot.id == itemId)
return TRUE; return TRUE;
} }
} }

View File

@ -2566,7 +2566,7 @@ u32 sub_809034C(u8 dungeonIndex, s32 speciesId_, u8 *buffer, bool32 requireHm_,
sp_0xf0 = 0; sp_0xf0 = 0;
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
struct PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[i]; struct Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
if (PokemonExists(mon) && PokemonFlag2(mon)) { if (PokemonExists(mon) && PokemonFlag2(mon)) {
if (mon->heldItem.id != 0) { if (mon->heldItem.id != 0) {
sp_0xf0++; sp_0xf0++;
@ -2610,7 +2610,7 @@ u32 sub_809034C(u8 dungeonIndex, s32 speciesId_, u8 *buffer, bool32 requireHm_,
} }
bodySize = GetBodySize(speciesId); bodySize = GetBodySize(speciesId);
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
struct PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[i]; struct Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
if (PokemonExists(mon) && PokemonFlag2(mon)){ if (PokemonExists(mon) && PokemonFlag2(mon)){
bodySize += GetBodySize(mon->speciesNum); bodySize += GetBodySize(mon->speciesNum);
@ -2654,7 +2654,7 @@ u32 sub_809034C(u8 dungeonIndex, s32 speciesId_, u8 *buffer, bool32 requireHm_,
if (otherSpeciesId == NUM_MONSTERS) { if (otherSpeciesId == NUM_MONSTERS) {
for (otherSpeciesId = 0; otherSpeciesId < NUM_MONSTERS; otherSpeciesId++) { for (otherSpeciesId = 0; otherSpeciesId < NUM_MONSTERS; otherSpeciesId++) {
struct PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[otherSpeciesId]; struct Pokemon *mon = &gRecruitedPokemonRef->pokemon[otherSpeciesId];
if (PokemonExists(mon) && PokemonFlag2(mon) if (PokemonExists(mon) && PokemonFlag2(mon)
&& (GetPokemonType(mon->speciesNum,0) == TYPE_WATER || GetPokemonType(mon->speciesNum,1) == TYPE_WATER)) && (GetPokemonType(mon->speciesNum,0) == TYPE_WATER || GetPokemonType(mon->speciesNum,1) == TYPE_WATER))
@ -2725,7 +2725,7 @@ static bool8 TeamMonWithMove(u16 moveID)
s32 speciesId, moveIndex; s32 speciesId, moveIndex;
for (speciesId = 0; speciesId < NUM_MONSTERS; speciesId++) { for (speciesId = 0; speciesId < NUM_MONSTERS; speciesId++) {
PokemonStruct1 *pokeStruct = &gRecruitedPokemonRef->pokemon[speciesId]; Pokemon *pokeStruct = &gRecruitedPokemonRef->pokemon[speciesId];
if (PokemonExists(pokeStruct) && PokemonFlag2(pokeStruct)) { if (PokemonExists(pokeStruct) && PokemonFlag2(pokeStruct)) {
for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) { for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) {
Move *move = &pokeStruct->moves[moveIndex]; Move *move = &pokeStruct->moves[moveIndex];

View File

@ -797,7 +797,7 @@ bool8 sub_8048A68(Entity *param_1,Item *item)
Entity *entity; Entity *entity;
EntityInfo *pEVar6; EntityInfo *pEVar6;
s32 index; s32 index;
PokemonStruct2 *pokemon; DungeonMon *pokemon;
if ((item->flags & ITEM_FLAG_STICKY)) { if ((item->flags & ITEM_FLAG_STICKY)) {
DisplayDungeonMessage(0,*gItemStickyDoesntWorkText,1); DisplayDungeonMessage(0,*gItemStickyDoesntWorkText,1);
@ -821,8 +821,8 @@ bool8 sub_8048A68(Entity *param_1,Item *item)
flag = FALSE; flag = FALSE;
else else
{ {
pokemon = &gRecruitedPokemonRef->pokemon2[pEVar6->teamIndex]; pokemon = &gRecruitedPokemonRef->dungeonTeam[pEVar6->teamIndex];
if (sub_806A538(pokemon->unkA)) if (sub_806A538(pokemon->recruitedPokemonId))
flag = FALSE; flag = FALSE;
} }

View File

@ -418,7 +418,7 @@ void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum)
} }
else else
{ {
sub_808D9DC(buffer, &gRecruitedPokemonRef->pokemon2[param_2->teamIndex],colorNum); sub_808D9DC(buffer, &gRecruitedPokemonRef->dungeonTeam[param_2->teamIndex],colorNum);
} }
} }
} }
@ -433,7 +433,7 @@ void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum)
CopyCyanMonsterNametoBuffer(buffer, entityInfo->apparentID); CopyCyanMonsterNametoBuffer(buffer, entityInfo->apparentID);
} }
else { else {
sub_808D9DC(buffer, &gRecruitedPokemonRef->pokemon2[entityInfo->teamIndex], colorNum); sub_808D9DC(buffer, &gRecruitedPokemonRef->dungeonTeam[entityInfo->teamIndex], colorNum);
} }
} }
@ -458,7 +458,7 @@ void sub_80709C8(u8 *buffer, EntityInfo *entityInfo)
} }
else else
{ {
sub_808DA0C(buffer, &gRecruitedPokemonRef->pokemon2[entityInfo->teamIndex]); sub_808DA0C(buffer, &gRecruitedPokemonRef->dungeonTeam[entityInfo->teamIndex]);
} }
} }
} }

View File

@ -1111,12 +1111,12 @@ void sub_805F02C(void)
r8->isTeamLeader = TRUE; r8->isTeamLeader = TRUE;
leaderInfo->isTeamLeader = FALSE; leaderInfo->isTeamLeader = FALSE;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
PokemonStruct2 *mon = &gRecruitedPokemonRef->pokemon2[i]; DungeonMon *mon = &gRecruitedPokemonRef->dungeonTeam[i];
PokemonStruct1 *r5 = NULL; Pokemon *r5 = NULL;
if ((u8)mon->flags & 1) { if ((u8)mon->flags & 1) {
if (!sub_806A538(mon->unkA)) { if (!sub_806A538(mon->recruitedPokemonId)) {
r5 = &gRecruitedPokemonRef->pokemon[mon->unkA]; r5 = &gRecruitedPokemonRef->pokemon[mon->recruitedPokemonId];
} }
if (i == r8->teamIndex) { if (i == r8->teamIndex) {
mon->isTeamLeader = TRUE; mon->isTeamLeader = TRUE;

View File

@ -468,7 +468,7 @@ static void ShowMovesMenuWindows(Entity *entity, EntityInfo *entInfo, bool8 redC
gDungeonMenu.menuIndex = 0; gDungeonMenu.menuIndex = 0;
} }
} }
else if (MoveFlagLinkChain(move)) { else if MOVE_FLAG_LINK_CHAIN(move) {
arg5[i] = 1; arg5[i] = 1;
} }
} }
@ -503,7 +503,7 @@ static void PrintMoveNamesOnWindow(s32 count, Entity *entity, Move *moves, s32 w
movStruct.redColor = (CanMonsterUseMove(entity, move, TRUE) == FALSE); movStruct.redColor = (CanMonsterUseMove(entity, move, TRUE) == FALSE);
BufferMoveName(gFormatBuffer_Items[0], move, &movStruct); BufferMoveName(gFormatBuffer_Items[0], move, &movStruct);
y = GetMenuEntryYCoord(&gDungeonMenu, i); y = GetMenuEntryYCoord(&gDungeonMenu, i);
if (MoveFlagLinkChain(move)) { if MOVE_FLAG_LINK_CHAIN(move) {
x = 13; x = 13;
} }
else { else {
@ -611,7 +611,7 @@ static void ShowMovesInfoWindow(Move *moves, s32 firstMoveId, s32 movesCount)
for (i = firstMoveId + 1; i < movesCount; i++) { for (i = firstMoveId + 1; i < movesCount; i++) {
if (!MoveFlagExists(&moves[i])) if (!MoveFlagExists(&moves[i]))
break; break;
if (!MoveFlagLinkChain(&moves[i])) if (!MOVE_FLAG_LINK_CHAIN(&moves[i]))
break; break;
count++; count++;
} }
@ -787,7 +787,7 @@ void ActionLinkMoves(ActionContainer *a0)
for (id++; id < MAX_MON_MOVES; id++) { for (id++; id < MAX_MON_MOVES; id++) {
if (!MoveFlagExists(&entInfo->moves.moves[id])) if (!MoveFlagExists(&entInfo->moves.moves[id]))
break; break;
if (!MoveFlagLinkChain(&entInfo->moves.moves[id])) if (!MOVE_FLAG_LINK_CHAIN(&entInfo->moves.moves[id]))
break; break;
if (++linkedCount >= MAX_MON_MOVES) if (++linkedCount >= MAX_MON_MOVES)
break; break;
@ -823,7 +823,7 @@ static bool8 IsMoveLinkedAndNotCharging(EntityInfo *entInfo, s32 moveId_)
if (!MoveFlagExists(move)) if (!MoveFlagExists(move))
break; break;
if (!MoveFlagLinkChain(move)) { if (!MOVE_FLAG_LINK_CHAIN(move)) {
ret = TRUE; ret = TRUE;
break; break;
} }
@ -848,7 +848,7 @@ void ActionDelinkMoves(ActionContainer *a0, bool8 showMsg)
id++; id++;
for (linkedCount = 0; linkedCount < MAX_MON_MOVES && id < MAX_MON_MOVES; id++, linkedCount++) { for (linkedCount = 0; linkedCount < MAX_MON_MOVES && id < MAX_MON_MOVES; id++, linkedCount++) {
Move *move = &entInfo->moves.moves[id]; Move *move = &entInfo->moves.moves[id];
if (MoveFlagLinkChain(move)) { if MOVE_FLAG_LINK_CHAIN(move) {
move->moveFlags &= ~(MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN); move->moveFlags &= ~(MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN);
unlInked = TRUE; unlInked = TRUE;
} }
@ -879,7 +879,7 @@ static bool8 IsMoveLinked(EntityInfo *entInfo, s32 id)
for (linkedCount = 0; linkedCount < MAX_MON_MOVES && id < MAX_MON_MOVES; linkedCount++) { for (linkedCount = 0; linkedCount < MAX_MON_MOVES && id < MAX_MON_MOVES; linkedCount++) {
Move *move = &entInfo->moves.moves[id]; Move *move = &entInfo->moves.moves[id];
if (MoveFlagLinkChain(move)) { if MOVE_FLAG_LINK_CHAIN(move) {
linkFound = TRUE; linkFound = TRUE;
id++; id++;
} }
@ -899,7 +899,7 @@ static void sub_8063E30(Move *moves, s32 id)
id++; id++;
for (i = 0; i < 8 && id < 8; id++, i++) { for (i = 0; i < 8 && id < 8; id++, i++) {
if (MoveFlagLinkChain(&moves[id])) { if (MOVE_FLAG_LINK_CHAIN(&moves[id])) {
moves[id].moveFlags &= ~(MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN); moves[id].moveFlags &= ~(MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN);
} }
else { else {
@ -1050,8 +1050,8 @@ bool8 sub_8063E70(Entity *entity, Move *moves, bool8 showYesNoBox, bool8 allowBP
Move *move = &moves[sChosenMoveSlotId]; Move *move = &moves[sChosenMoveSlotId];
s32 nextMoveId = sChosenMoveSlotId + 1; s32 nextMoveId = sChosenMoveSlotId + 1;
if (nextMoveId < 8 && MoveFlagExists(&moves[nextMoveId])) { if (nextMoveId < 8 && MoveFlagExists(&moves[nextMoveId]) && MOVE_FLAG_LINK_CHAIN(&moves[nextMoveId])) {
linked = MoveFlagLinkChain(&moves[nextMoveId]) != 0; linked = TRUE;
} }
BufferMoveName(gFormatBuffer_Items[0], move, NULL); BufferMoveName(gFormatBuffer_Items[0], move, NULL);
yesNoAnswer = DisplayDungeonYesNoMessage(NULL, (!linked) ? gUnknown_80FDF70 : gUnknown_80FDF00, FALSE); yesNoAnswer = DisplayDungeonYesNoMessage(NULL, (!linked) ? gUnknown_80FDF70 : gUnknown_80FDF00, FALSE);
@ -1066,7 +1066,7 @@ bool8 sub_8063E70(Entity *entity, Move *moves, bool8 showYesNoBox, bool8 allowBP
Move *move = &moves[i]; Move *move = &moves[i];
if (!MoveFlagExists(move)) if (!MoveFlagExists(move))
break; break;
if (!(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) if (!MOVE_FLAG_LINK_CHAIN(move))
break; break;
ResetMoveFlags(move); ResetMoveFlags(move);
@ -1156,7 +1156,7 @@ static bool8 sub_8064358(Move *moves, s32 id)
for (linkedCount = 0; linkedCount < 8 && id < 8; linkedCount++) { for (linkedCount = 0; linkedCount < 8 && id < 8; linkedCount++) {
Move *move = &moves[id]; Move *move = &moves[id];
if (MoveFlagLinkChain(move)) { if MOVE_FLAG_LINK_CHAIN(move) {
linkFound = TRUE; linkFound = TRUE;
id++; id++;
} }

View File

@ -351,12 +351,12 @@ static void SetRecruitableMons(struct MonRecruitList *tabsData)
} }
if (!monIsRecruited) { if (!monIsRecruited) {
for (k = 0; k < 4; k++) { for (k = 0; k < MAX_TEAM_MEMBERS; k++) {
PokemonStruct2 *mon = &gRecruitedPokemonRef->pokemon2[k]; DungeonMon *mon = &gRecruitedPokemonRef->dungeonTeam[k];
if (PokemonFlag1Struct2(mon) && !sub_806A564(mon->unkA) && mon->speciesNum == speciesId) if (DungeonMonExists(mon) && !sub_806A564(mon->recruitedPokemonId) && mon->speciesNum == speciesId)
break; break;
} }
if (k != 4) { if (k != MAX_TEAM_MEMBERS) {
monIsRecruited = TRUE; monIsRecruited = TRUE;
monNameColor = 6; monNameColor = 6;
} }

View File

@ -385,7 +385,7 @@ static void PrintOnDungeonTeamMenu(struct UnkFieldTeamMenuStruct *a0, WindowTemp
s32 color = (a0->unk14[i] != 0) ? 6 : 2; s32 color = (a0->unk14[i] != 0) ? 6 : 2;
sub_8070968(gFormatBuffer_Monsters[0], monInfo, color); sub_8070968(gFormatBuffer_Monsters[0], monInfo, color);
if (sub_806A538(gRecruitedPokemonRef->pokemon2[monInfo->teamIndex].unkA)) { if (sub_806A538(gRecruitedPokemonRef->dungeonTeam[monInfo->teamIndex].recruitedPokemonId)) {
if (monInfo->HP <= monInfo->maxHPStat / 4) { if (monInfo->HP <= monInfo->maxHPStat / 4) {
InlineStrcpy(gFormatBuffer_Monsters[1], _("{HEART_RED_TINY}")); InlineStrcpy(gFormatBuffer_Monsters[1], _("{HEART_RED_TINY}"));
} }
@ -459,8 +459,8 @@ static void AddTeamSubMenuOptions(struct UnkFieldTeamMenuStruct *a0)
r5 = FALSE; r5 = FALSE;
} }
else { else {
PokemonStruct2 *mon = &gRecruitedPokemonRef->pokemon2[monInfo->teamIndex]; DungeonMon *mon = &gRecruitedPokemonRef->dungeonTeam[monInfo->teamIndex];
if (sub_806A538(mon->unkA)) { if (sub_806A538(mon->recruitedPokemonId)) {
r5 = FALSE; r5 = FALSE;
} }
} }
@ -1581,7 +1581,7 @@ static void PrintMoveNamesOnBottomWindow(Entity *entity)
movStruct.redColor = (CanMonsterUseMove(entity, move, TRUE) == FALSE); movStruct.redColor = (CanMonsterUseMove(entity, move, TRUE) == FALSE);
BufferMoveName(gFormatBuffer_Items[0], move, &movStruct); BufferMoveName(gFormatBuffer_Items[0], move, &movStruct);
if (MoveFlagLinkChain(move)) { if MOVE_FLAG_LINK_CHAIN(move) {
x = 13; x = 13;
} }
else { else {

View File

@ -393,7 +393,7 @@ void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo)
if (leader != NULL) { if (leader != NULL) {
EntityInfo *leaderInfo = GetEntInfo(leader); EntityInfo *leaderInfo = GetEntInfo(leader);
PokemonStruct2 *monStruct2 = &gRecruitedPokemonRef->pokemon2[leaderInfo->teamIndex]; DungeonMon *monStruct2 = &gRecruitedPokemonRef->dungeonTeam[leaderInfo->teamIndex];
sub_808DA0C(gFormatBuffer_Monsters[0], monStruct2); sub_808DA0C(gFormatBuffer_Monsters[0], monStruct2);
leaderId = leaderInfo->apparentID; leaderId = leaderInfo->apparentID;
@ -405,7 +405,7 @@ void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo)
if (partner != NULL) { if (partner != NULL) {
EntityInfo *partnerInfo = GetEntInfo(partner); EntityInfo *partnerInfo = GetEntInfo(partner);
PokemonStruct2 *monStruct2 = &gRecruitedPokemonRef->pokemon2[partnerInfo->teamIndex]; DungeonMon *monStruct2 = &gRecruitedPokemonRef->dungeonTeam[partnerInfo->teamIndex];
sub_808DA0C(gFormatBuffer_Monsters[1], monStruct2); sub_808DA0C(gFormatBuffer_Monsters[1], monStruct2);
partnerId = partnerInfo->apparentID; partnerId = partnerInfo->apparentID;

View File

@ -53,10 +53,8 @@ extern void sub_806C264(s32 teamIndex, EntityInfo *entInfo);
extern bool8 sub_806A58C(s16 r0); extern bool8 sub_806A58C(s16 r0);
extern void sub_8084E00(Entity *entity, u8 param_2, u8 param_3); extern void sub_8084E00(Entity *entity, u8 param_2, u8 param_3);
extern void sub_8078084(Entity * pokemon); extern void sub_8078084(Entity * pokemon);
extern void xxx_pokemon2_to_pokemonstruct_index_808DF2C(s32 a1, PokemonStruct2* a2); extern void sub_808DFDC(s32 a1, DungeonMon* a2);
extern void sub_808DFDC(s32 a1, PokemonStruct2* a2); extern void sub_8067A80(u8 a0, s32 a1, s32 a2, Pokemon **a3);
extern void xxx_pokemon2_to_pokemonstruct_808DF44(PokemonStruct1*, PokemonStruct2*);
extern void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3);
extern bool8 sub_8070F80(Entity * pokemon, s32 direction); extern bool8 sub_8070F80(Entity * pokemon, s32 direction);
extern s32 sub_806A4DC(EntityInfo *info); extern s32 sub_806A4DC(EntityInfo *info);
extern void sub_8042900(Entity *r0); extern void sub_8042900(Entity *r0);
@ -133,8 +131,8 @@ void LoadDungeonPokemonSprites(void)
} }
for(index = 0; index < 4; index++) for(index = 0; index < 4; index++)
{ {
PokemonStruct2 *ptr = &gRecruitedPokemonRef->pokemon2[index]; DungeonMon *ptr = &gRecruitedPokemonRef->dungeonTeam[index];
if(PokemonFlag1Struct2(ptr)) if(DungeonMonExists(ptr))
if(PokemonFlag2Struct2(ptr)) if(PokemonFlag2Struct2(ptr))
LoadPokemonSprite(ptr->speciesNum, FALSE); LoadPokemonSprite(ptr->speciesNum, FALSE);
} }
@ -142,7 +140,7 @@ void LoadDungeonPokemonSprites(void)
{ {
for(index = 0; index < MAX_TEAM_MEMBERS; index++) for(index = 0; index < MAX_TEAM_MEMBERS; index++)
{ {
PokemonStruct1 *ptr = &gRecruitedPokemonRef->team[index]; Pokemon *ptr = &gRecruitedPokemonRef->team[index];
if(PokemonExists(ptr)) if(PokemonExists(ptr))
LoadPokemonSprite(ptr->speciesNum, TRUE); LoadPokemonSprite(ptr->speciesNum, TRUE);
} }
@ -232,45 +230,45 @@ void sub_806890C(void)
index = 0; index = 0;
for (speciesId = 0; speciesId < NUM_MONSTERS; speciesId++) { for (speciesId = 0; speciesId < NUM_MONSTERS; speciesId++) {
PokemonStruct1 stack; Pokemon stack;
PokemonStruct1 *pokeStruct = &gRecruitedPokemonRef->pokemon[speciesId]; Pokemon *pokeStruct = &gRecruitedPokemonRef->pokemon[speciesId];
if (PokemonExists(pokeStruct) && PokemonFlag2(pokeStruct)) { if (PokemonExists(pokeStruct) && PokemonFlag2(pokeStruct)) {
xxx_pokemonstruct_index_to_pokemon2_808DE30(&gRecruitedPokemonRef->pokemon2[index],speciesId); xxx_pokemonstruct_index_to_pokemon2_808DE30(&gRecruitedPokemonRef->dungeonTeam[index],speciesId);
if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id)) { if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id)) {
struct DungeonLocation dungeonLoc = {.id = DUNGEON_TINY_WOODS, .floor = 1}; struct DungeonLocation dungeonLoc = {.id = DUNGEON_TINY_WOODS, .floor = 1};
sub_808CFD0(&stack,pokeStruct->speciesNum,0,0,&dungeonLoc,0); sub_808CFD0(&stack,pokeStruct->speciesNum,0,0,&dungeonLoc,0);
gRecruitedPokemonRef->pokemon2[index].level = stack.level; gRecruitedPokemonRef->dungeonTeam[index].level = stack.level;
gRecruitedPokemonRef->pokemon2[index].IQ = stack.IQ; gRecruitedPokemonRef->dungeonTeam[index].IQ = stack.IQ;
gRecruitedPokemonRef->pokemon2[index].unk10 = stack.pokeHP; gRecruitedPokemonRef->dungeonTeam[index].unk10 = stack.pokeHP;
gRecruitedPokemonRef->pokemon2[index].unk12 = stack.pokeHP; gRecruitedPokemonRef->dungeonTeam[index].unk12 = stack.pokeHP;
gRecruitedPokemonRef->pokemon2[index].offense.att[0] = stack.offense.att[0]; gRecruitedPokemonRef->dungeonTeam[index].offense.att[0] = stack.offense.att[0];
gRecruitedPokemonRef->pokemon2[index].offense.att[1] = stack.offense.att[1]; gRecruitedPokemonRef->dungeonTeam[index].offense.att[1] = stack.offense.att[1];
gRecruitedPokemonRef->pokemon2[index].offense.def[0] = stack.offense.def[0]; gRecruitedPokemonRef->dungeonTeam[index].offense.def[0] = stack.offense.def[0];
gRecruitedPokemonRef->pokemon2[index].offense.def[1] = stack.offense.def[1]; gRecruitedPokemonRef->dungeonTeam[index].offense.def[1] = stack.offense.def[1];
gRecruitedPokemonRef->pokemon2[index].currExp = stack.currExp; gRecruitedPokemonRef->dungeonTeam[index].currExp = stack.currExp;
gRecruitedPokemonRef->pokemon2[index].IQSkills = stack.IQSkills; gRecruitedPokemonRef->dungeonTeam[index].IQSkills = stack.IQSkills;
gRecruitedPokemonRef->pokemon2[index].tacticIndex = stack.tacticIndex; gRecruitedPokemonRef->dungeonTeam[index].tacticIndex = stack.tacticIndex;
CopyAndResetMoves(&gRecruitedPokemonRef->pokemon2[index].moves, stack.moves); CopyAndResetMoves(&gRecruitedPokemonRef->dungeonTeam[index].moves, stack.moves);
} }
gRecruitedPokemonRef->pokemon2[index].unkC = index; gRecruitedPokemonRef->dungeonTeam[index].unkC = index;
index++; index++;
if (index == 4) if (index == 4)
break; break;
} }
} }
for (; index < 4; index++) { for (; index < 4; index++) {
gRecruitedPokemonRef->pokemon2[index].flags = 0; gRecruitedPokemonRef->dungeonTeam[index].flags = 0;
} }
} }
void sub_8068A84(PokemonStruct1 *pokemon) void sub_8068A84(Pokemon *pokemon)
{ {
s32 i, totalBodySize; s32 i, totalBodySize;
totalBodySize = 0; totalBodySize = 0;
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *ptr = &gRecruitedPokemonRef->pokemon2[i]; DungeonMon *ptr = &gRecruitedPokemonRef->dungeonTeam[i];
if (PokemonFlag1Struct2(ptr)) { if (DungeonMonExists(ptr)) {
totalBodySize += GetBodySize(ptr->speciesNum); totalBodySize += GetBodySize(ptr->speciesNum);
} }
} }
@ -290,9 +288,9 @@ void sub_8068A84(PokemonStruct1 *pokemon)
} }
else { else {
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *monPtr = &gRecruitedPokemonRef->pokemon2[i]; DungeonMon *monPtr = &gRecruitedPokemonRef->dungeonTeam[i];
if (!PokemonFlag1Struct2(monPtr)) { if (!DungeonMonExists(monPtr)) {
xxx_pokemonstruct_to_pokemon2_808DE50(monPtr,pokemon,0x55aa); PokemonToDungeonMon(monPtr,pokemon,0x55aa);
monPtr->flags |= POKEMON_FLAG_EXISTS; monPtr->flags |= POKEMON_FLAG_EXISTS;
if (monPtr->IQ < 0x1a) { if (monPtr->IQ < 0x1a) {
monPtr->IQ = 0x1a; monPtr->IQ = 0x1a;
@ -337,8 +335,8 @@ static inline bool8 IsUnkDungeon(u8 joinedDungeon)
void sub_8068BDC(bool8 a0) void sub_8068BDC(bool8 a0)
{ {
bool8 spArr[NUM_FRIEND_AREAS]; bool8 spArr[NUM_FRIEND_AREAS];
PokemonStruct1 *monPointers[21]; Pokemon *monPointers[21];
PokemonStruct1 mon1Structs[MAX_TEAM_MEMBERS]; Pokemon mon1Structs[MAX_TEAM_MEMBERS];
u16 arr2[18]; u16 arr2[18];
FriendAreaCapacity areaCapacity; FriendAreaCapacity areaCapacity;
s32 i, j, id; s32 i, j, id;
@ -348,8 +346,8 @@ void sub_8068BDC(bool8 a0)
} }
for (id = 0; id < MAX_TEAM_MEMBERS; id++) { for (id = 0; id < MAX_TEAM_MEMBERS; id++) {
PokemonStruct2 *monPtr = &gRecruitedPokemonRef->pokemon2[id]; DungeonMon *monPtr = &gRecruitedPokemonRef->dungeonTeam[id];
if (PokemonFlag1Struct2(monPtr) && !sub_806A564(monPtr->unkA)) { if (DungeonMonExists(monPtr) && !sub_806A564(monPtr->recruitedPokemonId)) {
Item *monItem = &monPtr->itemSlot; Item *monItem = &monPtr->itemSlot;
if (ItemExists(monItem) && monItem->id == ITEM_POKE) { if (ItemExists(monItem) && monItem->id == ITEM_POKE) {
AddToTeamMoney(GetMoneyValue(monItem)); AddToTeamMoney(GetMoneyValue(monItem));
@ -359,18 +357,18 @@ void sub_8068BDC(bool8 a0)
} }
for (id = 0; id < MAX_TEAM_MEMBERS; id++) { for (id = 0; id < MAX_TEAM_MEMBERS; id++) {
PokemonStruct2 *monPtr = &gRecruitedPokemonRef->pokemon2[id]; DungeonMon *monPtr = &gRecruitedPokemonRef->dungeonTeam[id];
if (PokemonFlag1Struct2(monPtr) && !sub_806A564(monPtr->unkA)) { if (DungeonMonExists(monPtr) && !sub_806A564(monPtr->recruitedPokemonId)) {
if (IS_CASTFORM_FORM_MONSTER(monPtr->speciesNum)) { if (IS_CASTFORM_FORM_MONSTER(monPtr->speciesNum)) {
monPtr->speciesNum = MONSTER_CASTFORM; monPtr->speciesNum = MONSTER_CASTFORM;
} }
if (sub_806A58C(monPtr->unkA)) { if (sub_806A58C(monPtr->recruitedPokemonId)) {
if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id)) { if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id)) {
sub_808DFDC(monPtr->unkA, monPtr); sub_808DFDC(monPtr->recruitedPokemonId, monPtr);
} }
else { else {
xxx_pokemon2_to_pokemonstruct_index_808DF2C(monPtr->unkA, monPtr); DungeonMonToRecruitedPokemon(monPtr->recruitedPokemonId, monPtr);
} }
} }
else { else {
@ -393,10 +391,10 @@ void sub_8068BDC(bool8 a0)
} }
for (id = 0; id < MAX_TEAM_MEMBERS; id++) { for (id = 0; id < MAX_TEAM_MEMBERS; id++) {
PokemonStruct2 *monPtr = &gRecruitedPokemonRef->pokemon2[id]; DungeonMon *monPtr = &gRecruitedPokemonRef->dungeonTeam[id];
if (PokemonFlag1Struct2(monPtr) && sub_806A5A4(monPtr->unkA) && GetFriendArea(monPtr->speciesNum) == friendAreaId && a0) { if (DungeonMonExists(monPtr) && sub_806A5A4(monPtr->recruitedPokemonId) && GetFriendArea(monPtr->speciesNum) == friendAreaId && a0) {
monPointers[j] = &mon1Structs[id]; monPointers[j] = &mon1Structs[id];
xxx_pokemon2_to_pokemonstruct_808DF44(monPointers[j], monPtr); DungeonMonToPokemon(monPointers[j], monPtr);
monPointers[j]->flags |= POKEMON_FLAG_x4000; monPointers[j]->flags |= POKEMON_FLAG_x4000;
monPointers[j]->unkC[0].level = 0; monPointers[j]->unkC[0].level = 0;
monPointers[j]->unkC[1].level = 0; monPointers[j]->unkC[1].level = 0;
@ -418,7 +416,7 @@ void sub_8068BDC(bool8 a0)
while (1) { while (1) {
sub_8067A80(friendAreaId, j - areaCapacity.maxPokemon, j, monPointers); sub_8067A80(friendAreaId, j - areaCapacity.maxPokemon, j, monPointers);
for (id = 0; id < j; id++) { for (id = 0; id < j; id++) {
PokemonStruct1 *monPtr = monPointers[id]; Pokemon *monPtr = monPointers[id];
if (PokemonExists(monPtr) && (monPtr->flags & POKEMON_FLAG_x8000)) { if (PokemonExists(monPtr) && (monPtr->flags & POKEMON_FLAG_x8000)) {
if (IsUnkDungeon(monPtr->dungeonLocation.id)) { if (IsUnkDungeon(monPtr->dungeonLocation.id)) {
break; break;
@ -452,12 +450,12 @@ void sub_8068F28(void)
s32 i; s32 i;
for (i = 0; i < MAX_TEAM_MEMBERS; i++) { for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
PokemonStruct2 *monStruct2Ptr = &gRecruitedPokemonRef->pokemon2[i]; DungeonMon *monStruct2Ptr = &gRecruitedPokemonRef->dungeonTeam[i];
if (PokemonFlag1Struct2(monStruct2Ptr)) { if (DungeonMonExists(monStruct2Ptr)) {
if (sub_806A564(monStruct2Ptr->unkA)) { if (sub_806A564(monStruct2Ptr->recruitedPokemonId)) {
monStruct2Ptr->flags = 0; monStruct2Ptr->flags = 0;
} }
else if (sub_806A538(monStruct2Ptr->unkA)) { else if (sub_806A538(monStruct2Ptr->recruitedPokemonId)) {
monStruct2Ptr->flags = 0; monStruct2Ptr->flags = 0;
} }
} }
@ -481,12 +479,12 @@ void sub_8068F80(void)
} }
} }
static inline void ClearOnTeamFlag(PokemonStruct1 *mon) static inline void ClearOnTeamFlag(Pokemon *mon)
{ {
mon->flags &= ~(POKEMON_FLAG_ON_TEAM); mon->flags &= ~(POKEMON_FLAG_ON_TEAM);
} }
static inline void ClearMonItemId(PokemonStruct1 *mon) static inline void ClearMonItemId(Pokemon *mon)
{ {
mon->heldItem.id = ITEM_NOTHING; mon->heldItem.id = ITEM_NOTHING;
} }
@ -587,14 +585,14 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3)
} }
} }
if (partnerInfo != NULL) { if (partnerInfo != NULL) {
PokemonStruct2 *partnerStruct = &gRecruitedPokemonRef->pokemon2[partnerInfo->teamIndex]; DungeonMon *partnerStruct = &gRecruitedPokemonRef->dungeonTeam[partnerInfo->teamIndex];
sub_806C264(partnerInfo->teamIndex,partnerInfo); sub_806C264(partnerInfo->teamIndex,partnerInfo);
if (sub_806A58C(partnerStruct->unkA) != 0) { if (sub_806A58C(partnerStruct->recruitedPokemonId) != 0) {
if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id) == 0) { if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id) == 0) {
xxx_pokemon2_to_pokemonstruct_index_808DF2C(partnerStruct->unkA, partnerStruct); DungeonMonToRecruitedPokemon(partnerStruct->recruitedPokemonId, partnerStruct);
} }
if (!IsMakuhitaTrainingMaze()) { if (!IsMakuhitaTrainingMaze()) {
ClearMonItemId(&gRecruitedPokemonRef->pokemon[partnerStruct->unkA]); ClearMonItemId(&gRecruitedPokemonRef->pokemon[partnerStruct->recruitedPokemonId]);
} }
} }
partnerStruct->flags = 0; partnerStruct->flags = 0;
@ -633,16 +631,16 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3)
} }
if (!entInfo->isNotTeamMember) { if (!entInfo->isNotTeamMember) {
PokemonStruct2 *mon2Ptr = &gRecruitedPokemonRef->pokemon2[entInfo->teamIndex]; DungeonMon *mon2Ptr = &gRecruitedPokemonRef->dungeonTeam[entInfo->teamIndex];
sub_806C264(entInfo->teamIndex,entInfo); sub_806C264(entInfo->teamIndex,entInfo);
if (sub_806A58C(mon2Ptr->unkA) != 0) { if (sub_806A58C(mon2Ptr->recruitedPokemonId) != 0) {
bool8 uVar10; bool8 uVar10;
if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id) == 0) { if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id) == 0) {
xxx_pokemon2_to_pokemonstruct_index_808DF2C(mon2Ptr->unkA, mon2Ptr); DungeonMonToRecruitedPokemon(mon2Ptr->recruitedPokemonId, mon2Ptr);
} }
if (!IsMakuhitaTrainingMaze()) { if (!IsMakuhitaTrainingMaze()) {
ClearMonItemId(&gRecruitedPokemonRef->pokemon[mon2Ptr->unkA]); ClearMonItemId(&gRecruitedPokemonRef->pokemon[mon2Ptr->recruitedPokemonId]);
} }
uVar10 = FALSE; uVar10 = FALSE;
@ -654,7 +652,7 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3)
} }
if (!uVar10) { if (!uVar10) {
ClearOnTeamFlag(&gRecruitedPokemonRef->pokemon[mon2Ptr->unkA]); ClearOnTeamFlag(&gRecruitedPokemonRef->pokemon[mon2Ptr->recruitedPokemonId]);
} }
} }
mon2Ptr->flags = 0; mon2Ptr->flags = 0;
@ -1398,7 +1396,7 @@ bool8 sub_806A458(Entity *pokemon)
s32 sub_806A4DC(EntityInfo *info) s32 sub_806A4DC(EntityInfo *info)
{ {
PokemonStruct1 pokemon; Pokemon pokemon;
DungeonLocation loc; DungeonLocation loc;
loc.id = 0; loc.id = 0;
@ -1418,9 +1416,9 @@ s32 sub_806A4DC(EntityInfo *info)
bool8 sub_806A538(s16 r0) bool8 sub_806A538(s16 r0)
{ {
s32 r0_1 = Self_s16(r0); s32 r0_1 = Self_s16(r0);
if (r0 == 0x55AA) if (r0 == UNK_RECRUITED_POKEMON_ID_55AA)
return TRUE; return TRUE;
if (r0 == 0x5AA5) if (r0 == UNK_RECRUITED_POKEMON_ID_5AA5)
return TRUE; return TRUE;
if (r0_1 >= 0) if (r0_1 >= 0)
@ -1431,9 +1429,9 @@ bool8 sub_806A538(s16 r0)
bool8 sub_806A564(s16 r0) bool8 sub_806A564(s16 r0)
{ {
if (r0 == 0x55AA) if (r0 == UNK_RECRUITED_POKEMON_ID_55AA)
return TRUE; return TRUE;
if (r0 == 0x5AA5) if (r0 == UNK_RECRUITED_POKEMON_ID_5AA5)
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -1702,13 +1700,13 @@ void sub_806AA70(void)
else { else {
if (teamIndex >= 0) { if (teamIndex >= 0) {
bool8 unkBool = FALSE; bool8 unkBool = FALSE;
PokemonStruct2 *monStruct2Ptr = &gRecruitedPokemonRef->pokemon2[teamIndex]; DungeonMon *monStruct2Ptr = &gRecruitedPokemonRef->dungeonTeam[teamIndex];
if (gDungeon->unk11) if (gDungeon->unk11)
unkBool = TRUE; unkBool = TRUE;
else if (sub_806A564(monStruct2Ptr->unkA)) else if (sub_806A564(monStruct2Ptr->recruitedPokemonId))
unkBool = TRUE; unkBool = TRUE;
else if (sub_806A58C(monStruct2Ptr->unkA)) else if (sub_806A58C(monStruct2Ptr->recruitedPokemonId))
unkBool = TRUE; unkBool = TRUE;
if (unkBool) { if (unkBool) {

View File

@ -200,7 +200,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3
break; break;
if (++moveId >= MAX_MON_MOVES) if (++moveId >= MAX_MON_MOVES)
break; break;
if (!MoveFlagLinkChain(&attackerInfo->moves.moves[moveId])) if (!MOVE_FLAG_LINK_CHAIN(&attackerInfo->moves.moves[moveId]))
break; break;
} }
@ -1253,7 +1253,7 @@ bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker)
Move *move = &pokemonInfo->moves.moves[moveIndex]; Move *move = &pokemonInfo->moves.moves[moveIndex];
if (!MoveFlagExists(move)) if (!MoveFlagExists(move))
return FALSE; return FALSE;
if (MoveFlagLinkChain(move) || MoveFlagDisabled(move) || MoveFlagSealed(move)) if (MOVE_FLAG_LINK_CHAIN(move) || MoveFlagDisabled(move) || MoveFlagSealed(move))
return FALSE; return FALSE;
for (i = 0; i < MAX_MON_MOVES; i++) { for (i = 0; i < MAX_MON_MOVES; i++) {
@ -1262,7 +1262,7 @@ bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker)
move++; move++;
if (move >= &pokemonInfo->moves.moves[MAX_MON_MOVES]) if (move >= &pokemonInfo->moves.moves[MAX_MON_MOVES])
break; break;
if (!(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) if (!MOVE_FLAG_LINK_CHAIN(move))
break; break;
} }

View File

@ -76,7 +76,7 @@ void sub_809249C(u8 friendArea, bool8 clear)
return; return;
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
PokemonStruct1 *pokemon = &gRecruitedPokemonRef->pokemon[i]; Pokemon *pokemon = &gRecruitedPokemonRef->pokemon[i];
if (PokemonExists(pokemon) && sub_80923D4(i) == friendArea) { if (PokemonExists(pokemon) && sub_80923D4(i) == friendArea) {
if (IsMonPartner(pokemon) || IsMonTeamLeader(pokemon)) if (IsMonPartner(pokemon) || IsMonTeamLeader(pokemon))
@ -152,7 +152,7 @@ bool8 HasAllFriendAreas(void)
void GetFriendAreaCapacity2(u8 friendArea, FriendAreaCapacity *dst, bool8 checkLeader, bool8 checkPartner) void GetFriendAreaCapacity2(u8 friendArea, FriendAreaCapacity *dst, bool8 checkLeader, bool8 checkPartner)
{ {
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
s32 i; s32 i;
s32 iVar4; s32 iVar4;
@ -186,7 +186,7 @@ void GetFriendAreaCapacity2(u8 friendArea, FriendAreaCapacity *dst, bool8 checkL
void GetFriendAreaCapacity(u8 areaId, FriendAreaCapacity *dst, bool8 checkPartner) void GetFriendAreaCapacity(u8 areaId, FriendAreaCapacity *dst, bool8 checkPartner)
{ {
PokemonStruct1 *mon; Pokemon *mon;
s32 r5; s32 r5;
s32 i; s32 i;
s32 max; s32 max;

View File

@ -46,15 +46,15 @@ extern void sub_8027CA0();
extern void sub_8027D00(); extern void sub_8027D00();
extern void CreateFriendActionMenu(); extern void CreateFriendActionMenu();
extern void sub_80276A8(); extern void sub_80276A8();
bool8 sub_8027D9C(PokemonStruct1 *pokeStruct); bool8 sub_8027D9C(Pokemon *pokeStruct);
extern u8 sub_8027DCC(PokemonStruct1 *); extern u8 sub_8027DCC(Pokemon *);
extern void SetFriendAreaActionMenuState(u32); extern void SetFriendAreaActionMenuState(u32);
extern void PlaySound(u32); extern void PlaySound(u32);
extern void sub_808D31C(PokemonStruct1 *); extern void sub_808D31C(Pokemon *);
extern bool8 sub_808D750(s16 index_); extern bool8 sub_808D750(s16 index_);
u32 sub_8027E18(PokemonStruct1 *); u32 sub_8027E18(Pokemon *);
u8 sub_8027E4C(PokemonStruct1 *r0); u8 sub_8027E4C(Pokemon *r0);
void sub_8027EB8(void); void sub_8027EB8(void);
#include "data/friend_area_action_menu.h" #include "data/friend_area_action_menu.h"
@ -239,14 +239,13 @@ void CreateFriendActionMenu(void)
{ {
int index; int index;
s32 loopMax; s32 loopMax;
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
loopMax = 0; loopMax = 0;
pokeStruct = &gRecruitedPokemonRef->pokemon[sUnknown_203B2BC->targetPoke]; pokeStruct = &gRecruitedPokemonRef->pokemon[sUnknown_203B2BC->targetPoke];
MemoryFill16(sUnknown_203B2BC->unk16C,0,sizeof(sUnknown_203B2BC->unk16C)); MemoryFill16(sUnknown_203B2BC->unk16C,0,sizeof(sUnknown_203B2BC->unk16C));
if((pokeStruct->flags >> 1) % 2) if (PokemonFlag2(pokeStruct)) {
{
sUnknown_203B2BC->menuItems[loopMax].text = sStandBy; sUnknown_203B2BC->menuItems[loopMax].text = sStandBy;
sUnknown_203B2BC->menuItems[loopMax].menuAction = FRIEND_AREA_ACTION_MENU_ACTION_STANDBY; sUnknown_203B2BC->menuItems[loopMax].menuAction = FRIEND_AREA_ACTION_MENU_ACTION_STANDBY;
if(!sub_8027D9C(pokeStruct)) if(!sub_8027D9C(pokeStruct))
@ -381,7 +380,7 @@ void sub_8027794(void)
void sub_80277FC(void) void sub_80277FC(void)
{ {
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
switch(FriendList_HandleInput(TRUE)) { switch(FriendList_HandleInput(TRUE)) {
case 0: case 0:
@ -412,8 +411,8 @@ void sub_80277FC(void)
void sub_80278B4(void) void sub_80278B4(void)
{ {
PokemonStruct1 *playerStruct; Pokemon *playerStruct;
PokemonStruct1 *newLeader; Pokemon *newLeader;
u32 menuAction; u32 menuAction;
menuAction = 0; menuAction = 0;
@ -696,7 +695,7 @@ void sub_8027D40(u32 r0, BulkItem *heldItem)
sub_80073E0(r0); sub_80073E0(r0);
} }
bool8 sub_8027D9C(PokemonStruct1 *pokeStruct) bool8 sub_8027D9C(Pokemon *pokeStruct)
{ {
u32 var1; u32 var1;
if(!pokeStruct->isTeamLeader) if(!pokeStruct->isTeamLeader)
@ -715,7 +714,7 @@ bool8 sub_8027D9C(PokemonStruct1 *pokeStruct)
return TRUE; return TRUE;
} }
bool8 sub_8027DCC(PokemonStruct1 *pokeStruct) bool8 sub_8027DCC(Pokemon *pokeStruct)
{ {
u32 var1; u32 var1;
if(sub_808D3BC() != pokeStruct) if(sub_808D3BC() != pokeStruct)
@ -740,7 +739,7 @@ bool8 sub_8027DCC(PokemonStruct1 *pokeStruct)
return FALSE; return FALSE;
} }
u32 sub_8027E18(PokemonStruct1 *pokeStruct) u32 sub_8027E18(Pokemon *pokeStruct)
{ {
if(pokeStruct->heldItem.id == ITEM_NOTHING) if(pokeStruct->heldItem.id == ITEM_NOTHING)
return 0; return 0;
@ -752,7 +751,7 @@ u32 sub_8027E18(PokemonStruct1 *pokeStruct)
return 3; return 3;
} }
bool8 sub_8027E4C(PokemonStruct1 *pokeStruct) bool8 sub_8027E4C(Pokemon *pokeStruct)
{ {
if(!IsNotMoneyOrUsedTMItem(pokeStruct->heldItem.id)) if(!IsNotMoneyOrUsedTMItem(pokeStruct->heldItem.id))
return FALSE; return FALSE;

View File

@ -60,7 +60,7 @@ void FriendAreasMap_InitGfx(void)
u8 filename[12]; u8 filename[12];
s32 i, size; s32 i, size;
PokemonStruct1 *pokeStruct = GetPlayerPokemonStruct(); Pokemon *pokeStruct = GetPlayerPokemonStruct();
OpenedFile *file = OpenFileAndGetFileDataPtr(gUnknown_80D408C[0], &gTitleMenuFileArchive); OpenedFile *file = OpenFileAndGetFileDataPtr(gUnknown_80D408C[0], &gTitleMenuFileArchive);
OpenedFile *file2 = OpenFileAndGetFileDataPtr(gUnknown_80D408C[1], &gTitleMenuFileArchive); OpenedFile *file2 = OpenFileAndGetFileDataPtr(gUnknown_80D408C[1], &gTitleMenuFileArchive);

View File

@ -24,7 +24,7 @@ static IWRAM_INIT struct unkStruct_3001B60 *sFriendList = {NULL};
static void SortbyAlphabetNo(s32, s32); static void SortbyAlphabetNo(s32, s32);
static void SortbyInternalNo(s32, s32); static void SortbyInternalNo(s32, s32);
static void SortbyName(s32, s32); static void SortbyName(s32, s32);
static bool8 MonHasFriendArea(PokemonStruct1 *pokemon, u8 area); static bool8 MonHasFriendArea(Pokemon *pokemon, u8 area);
static void SortNames(void); static void SortNames(void);
static void SetUpWindowHeader(void); static void SetUpWindowHeader(void);
static s32 sub_8023BD8(void); static s32 sub_8023BD8(void);
@ -260,7 +260,7 @@ void FriendList_ShowWindow(void)
for (i = 0; i < sFriendList->unk358.m.input.currPageEntries; i++) { for (i = 0; i < sFriendList->unk358.m.input.currPageEntries; i++) {
s32 id = sFriendList->unk1A[(sFriendList->unk358.m.input.currPage * sFriendList->unk358.m.input.entriesPerPage) + i]; s32 id = sFriendList->unk1A[(sFriendList->unk358.m.input.currPage * sFriendList->unk358.m.input.entriesPerPage) + i];
PokemonStruct1 *pokePtr = &gRecruitedPokemonRef->pokemon[id]; Pokemon *pokePtr = &gRecruitedPokemonRef->pokemon[id];
u8 color = 7; u8 color = 7;
if (PokemonFlag2(pokePtr)) { if (PokemonFlag2(pokePtr)) {
@ -302,7 +302,7 @@ void FriendList_ShowWindow(void)
static s32 sub_8023F8C(void) static s32 sub_8023F8C(void)
{ {
s32 i; s32 i;
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
sFriendList->unk8 = 0; sFriendList->unk8 = 0;
if (!sFriendList->unk15) { if (!sFriendList->unk15) {
@ -357,7 +357,7 @@ bool8 sub_8024108(s32 param_1)
s32 i; s32 i;
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
PokemonStruct1 *pokeStruct = &gRecruitedPokemonRef->pokemon[i]; Pokemon *pokeStruct = &gRecruitedPokemonRef->pokemon[i];
if (PokemonExists(pokeStruct)) { if (PokemonExists(pokeStruct)) {
if (param_1 == 2) { if (param_1 == 2) {
if (!PokemonFlag2(pokeStruct)) continue; if (!PokemonFlag2(pokeStruct)) continue;
@ -378,7 +378,7 @@ bool8 sub_8024108(s32 param_1)
return TRUE; return TRUE;
} }
static bool8 MonHasFriendArea(PokemonStruct1 *pokemon, u8 area) static bool8 MonHasFriendArea(Pokemon *pokemon, u8 area)
{ {
if (area == GetFriendArea(pokemon->speciesNum)) if (area == GetFriendArea(pokemon->speciesNum))
return TRUE; return TRUE;
@ -464,11 +464,11 @@ static void SortbyName(s32 startId, s32 arrId)
} }
} }
UNUSED static PokemonStruct1 *sub_80243E8(void) UNUSED static Pokemon *sub_80243E8(void)
{ {
u8 buffer[40]; u8 buffer[40];
u8 nameBuffer[20]; u8 nameBuffer[20];
PokemonStruct1 *pokeStruct = &gRecruitedPokemonRef->pokemon[sFriendList->unk1A[GET_CURRENT_MENU_ENTRY(sFriendList->unk358.m.input)]]; Pokemon *pokeStruct = &gRecruitedPokemonRef->pokemon[sFriendList->unk1A[GET_CURRENT_MENU_ENTRY(sFriendList->unk358.m.input)]];
StrncpyCustom(nameBuffer, pokeStruct->name, POKEMON_NAME_LENGTH); StrncpyCustom(nameBuffer, pokeStruct->name, POKEMON_NAME_LENGTH);
sprintfStatic(buffer, "%s", nameBuffer); sprintfStatic(buffer, "%s", nameBuffer);

View File

@ -51,7 +51,7 @@ void sub_8025E08(void);
void sub_8025E24(void); void sub_8025E24(void);
void FriendListMenu_GotoFallbackState(void); void FriendListMenu_GotoFallbackState(void);
void sub_8025E68(u32 , BulkItem *); void sub_8025E68(u32 , BulkItem *);
bool8 FriendListMenu_isOnTeam(PokemonStruct1 *); bool8 FriendListMenu_isOnTeam(Pokemon *);
bool8 CreateFriendListMenu(s32 param_1) bool8 CreateFriendListMenu(s32 param_1)
@ -261,7 +261,7 @@ void sub_8025518(void)
void sub_8025728(void) void sub_8025728(void)
{ {
int index; int index;
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
s32 loopMax = 0; s32 loopMax = 0;
pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_203B2B4->species]; pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_203B2B4->species];
@ -644,7 +644,7 @@ void sub_8025E68(u32 r0, BulkItem *heldItem)
sub_80073E0(r0); sub_80073E0(r0);
} }
bool8 FriendListMenu_isOnTeam(PokemonStruct1 *pokeStruct) bool8 FriendListMenu_isOnTeam(Pokemon *pokeStruct)
{ {
bool32 flag; bool32 flag;
if (pokeStruct->isTeamLeader) if (pokeStruct->isTeamLeader)

View File

@ -121,7 +121,7 @@ extern bool8 CheckMapCollision_80A585C(PixelPos *, PixelPos *);
extern bool8 sub_80A58C8(PixelPos *, PixelPos *); extern bool8 sub_80A58C8(PixelPos *, PixelPos *);
extern s32 sub_80AC4C8(u32 a0, PixelPos *, PixelPos *); extern s32 sub_80AC4C8(u32 a0, PixelPos *, PixelPos *);
extern void sub_809CD8C(struct Struct3001B84_sub120 *dst, s32 a1); extern void sub_809CD8C(struct Struct3001B84_sub120 *dst, s32 a1);
extern bool8 sub_809B1C0(s32 a0, u32 kind, PokemonStruct1 *a2); extern bool8 sub_809B1C0(s32 a0, u32 kind, Pokemon *a2);
extern bool8 GetPredefinedScript(Action *param_1, ScriptInfoSmall *script, s32 _index); extern bool8 GetPredefinedScript(Action *param_1, ScriptInfoSmall *script, s32 _index);
extern bool8 sub_809D678(Action *action); extern bool8 sub_809D678(Action *action);
extern bool8 sub_80AC274(s32 a0, ScriptInfoSmall *scriptInfo, s32 a2); extern bool8 sub_80AC274(s32 a0, ScriptInfoSmall *scriptInfo, s32 a2);
@ -129,7 +129,7 @@ extern void GroundObject_ExecuteScript(s32, void *, ScriptInfoSmall *);
extern bool8 sub_80ADC64(s32 id, ScriptInfoSmall *dst); extern bool8 sub_80ADC64(s32 id, ScriptInfoSmall *dst);
extern bool8 GroundScriptNotify(Action *param_1, s32 param_2); extern bool8 GroundScriptNotify(Action *param_1, s32 param_2);
extern bool8 GroundScript_Cancel(Action *r0); extern bool8 GroundScript_Cancel(Action *r0);
extern PokemonStruct1 *sub_80A8D54(s32); extern Pokemon *sub_80A8D54(s32);
extern s32 sub_809CDB8(struct Struct3001B84_sub120 *dst); extern s32 sub_809CDB8(struct Struct3001B84_sub120 *dst);
extern void sub_80A6688(struct UnkGroundSpriteStruct *ptr, s32 a0); extern void sub_80A6688(struct UnkGroundSpriteStruct *ptr, s32 a0);
extern s32 sub_808D6A4(s32 *ptr); extern s32 sub_808D6A4(s32 *ptr);
@ -425,7 +425,7 @@ s32 sub_80A7B94(s16 *a0)
*a0 = 2; *a0 = 2;
break; break;
case 2: { case 2: {
PokemonStruct1 *playerMonStruct = GetPlayerPokemonStruct(); Pokemon *playerMonStruct = GetPlayerPokemonStruct();
if (sub_808D3BC() == playerMonStruct) { if (sub_808D3BC() == playerMonStruct) {
*a0 = 1; *a0 = 1;
} }
@ -471,7 +471,7 @@ s32 sub_80A7B94(s16 *a0)
*a0 = 7; *a0 = 7;
break; break;
case 3: { case 3: {
PokemonStruct1 *playerMonStruct = GetPlayerPokemonStruct(); Pokemon *playerMonStruct = GetPlayerPokemonStruct();
if (sub_808D3BC() == playerMonStruct) { if (sub_808D3BC() == playerMonStruct) {
*a0 = 6; *a0 = 6;
} }
@ -539,7 +539,7 @@ s32 sub_80A7B94(s16 *a0)
s32 id = *a0 - 14; s32 id = *a0 - 14;
GetFriendAreaCapacity2(map, &fAreaCapacity, FALSE, FALSE); GetFriendAreaCapacity2(map, &fAreaCapacity, FALSE, FALSE);
if (id < fAreaCapacity.maxPokemon) { if (id < fAreaCapacity.maxPokemon) {
PokemonStruct1 *monStrPtr = &gRecruitedPokemonRef->pokemon[fAreaCapacity.unk8 + id]; Pokemon *monStrPtr = &gRecruitedPokemonRef->pokemon[fAreaCapacity.unk8 + id];
if (sub_80023E4(9)) { if (sub_80023E4(9)) {
if (PokemonExists(monStrPtr) && !monStrPtr->isTeamLeader) { if (PokemonExists(monStrPtr) && !monStrPtr->isTeamLeader) {
return -1; return -1;
@ -557,7 +557,7 @@ s32 sub_80A7B94(s16 *a0)
return -1; return -1;
} }
else if (id == 0x23) { else if (id == 0x23) {
PokemonStruct1 *playerMonStruct = GetPlayerPokemonStruct(); Pokemon *playerMonStruct = GetPlayerPokemonStruct();
if (sub_808D3BC() == playerMonStruct) { if (sub_808D3BC() == playerMonStruct) {
*a0 = 0x21; *a0 = 0x21;
} }
@ -604,7 +604,7 @@ s32 sub_80A7DDC(s16 *a0, s16 *speciesDst)
} }
if (id < val) { if (id < val) {
PokemonStruct1 *monStrPtr = &gRecruitedPokemonRef->pokemon[sp[id]]; Pokemon *monStrPtr = &gRecruitedPokemonRef->pokemon[sp[id]];
*speciesDst = monStrPtr->speciesNum; *speciesDst = monStrPtr->speciesNum;
return -1; return -1;
} }
@ -617,7 +617,7 @@ s32 sub_80A7DDC(s16 *a0, s16 *speciesDst)
s32 id = *a0 - 14; s32 id = *a0 - 14;
GetFriendAreaCapacity2(map, &fAreaCapacity, FALSE, FALSE); GetFriendAreaCapacity2(map, &fAreaCapacity, FALSE, FALSE);
if (id < fAreaCapacity.maxPokemon) { if (id < fAreaCapacity.maxPokemon) {
PokemonStruct1 *monStrPtr = &gRecruitedPokemonRef->pokemon[fAreaCapacity.unk8 + id]; Pokemon *monStrPtr = &gRecruitedPokemonRef->pokemon[fAreaCapacity.unk8 + id];
if (sub_80023E4(9)) { if (sub_80023E4(9)) {
if (PokemonExists(monStrPtr) && !monStrPtr->isTeamLeader) { if (PokemonExists(monStrPtr) && !monStrPtr->isTeamLeader) {
*speciesDst = monStrPtr->speciesNum; *speciesDst = monStrPtr->speciesNum;
@ -1014,7 +1014,7 @@ void sub_80A87AC(s32 id_, s32 a1)
} }
} }
bool8 sub_80A87E0(s32 id_, PokemonStruct1 *a1) bool8 sub_80A87E0(s32 id_, Pokemon *a1)
{ {
s32 id = (s16) id_; s32 id = (s16) id_;
struct GroundLive *livesPtr = &gGroundLives->array[id]; struct GroundLive *livesPtr = &gGroundLives->array[id];
@ -1240,7 +1240,7 @@ s32 sub_80A8C4C(s32 id_, DungeonLocation *dungLoc)
struct GroundLive *livesPtr = &gGroundLives->array[id]; struct GroundLive *livesPtr = &gGroundLives->array[id];
if (livesPtr->unk2 != -1) { if (livesPtr->unk2 != -1) {
PokemonStruct1 *monStrPtr = sub_80A8D54(livesPtr->unk2); Pokemon *monStrPtr = sub_80A8D54(livesPtr->unk2);
if (monStrPtr != NULL) { if (monStrPtr != NULL) {
*dungLoc = monStrPtr->dungeonLocation; *dungLoc = monStrPtr->dungeonLocation;
} }
@ -1295,7 +1295,7 @@ bool8 sub_80A8D20(void)
return (val == 1); return (val == 1);
} }
PokemonStruct1 *sub_80A8D54(s32 a0) Pokemon *sub_80A8D54(s32 a0)
{ {
s16 sp = a0; s16 sp = a0;
@ -1331,7 +1331,7 @@ PokemonStruct1 *sub_80A8D54(s32 a0)
return &gRecruitedPokemonRef->pokemon[spArray[id]]; return &gRecruitedPokemonRef->pokemon[spArray[id]];
} }
else if (sp >= 14 && sp <= 29) { else if (sp >= 14 && sp <= 29) {
PokemonStruct1 *monPtr; Pokemon *monPtr;
s32 id; s32 id;
FriendAreaCapacity fAreaCapacity; FriendAreaCapacity fAreaCapacity;
u8 map = sub_8002658(GetScriptVarValue(NULL, GROUND_MAP)); u8 map = sub_8002658(GetScriptVarValue(NULL, GROUND_MAP));
@ -1360,7 +1360,7 @@ PokemonStruct1 *sub_80A8D54(s32 a0)
return NULL; return NULL;
} }
PokemonStruct1 *sub_80A8E9C(s32 id_) Pokemon *sub_80A8E9C(s32 id_)
{ {
s32 id = (s16) id_; s32 id = (s16) id_;
struct GroundLive *livesPtr = &gGroundLives->array[id]; struct GroundLive *livesPtr = &gGroundLives->array[id];
@ -1372,7 +1372,7 @@ void sub_80A8EC0(u8 *buffer,s32 a1)
{ {
s16 sp = a1; s16 sp = a1;
s16 species; s16 species;
PokemonStruct1 *monStruct; Pokemon *monStruct;
sub_80A7DDC(&sp, &species); sub_80A7DDC(&sp, &species);
monStruct = sub_80A8D54(sp); monStruct = sub_80A8D54(sp);

View File

@ -115,7 +115,7 @@ void sub_80A87AC(s32, s32);
void sub_80A8BD8(s16, s32*); void sub_80A8BD8(s16, s32*);
u32 sub_80A8C2C(); u32 sub_80A8C2C();
u32 GroundLives_IsStarterMon(); u32 GroundLives_IsStarterMon();
PokemonStruct1 *sub_80A8D54(s16); Pokemon *sub_80A8D54(s16);
s16 sub_80A8F9C(s32, PixelPos*); s16 sub_80A8F9C(s32, PixelPos*);
u32 sub_80A9050(); u32 sub_80A9050();
u32 sub_80A9090(); u32 sub_80A9090();
@ -172,7 +172,7 @@ u8 sub_80A8D20();
bool8 sub_80A87E0(); bool8 sub_80A87E0();
s16 sub_80A8BFC(s16); s16 sub_80A8BFC(s16);
void sub_80A8F50(const u8 *buffer, s32, s32 size); void sub_80A8F50(const u8 *buffer, s32, s32 size);
PokemonStruct1 *sub_808D2E8(s32 species, u8 *name, u32 _itemID, DungeonLocation *location, u16 *moveID); Pokemon *sub_808D2E8(s32 species, u8 *name, u32 _itemID, DungeonLocation *location, u16 *moveID);
bool8 HasRecruitedMon(s32 species); bool8 HasRecruitedMon(s32 species);
extern Item gUnknown_8116844; extern Item gUnknown_8116844;
extern Item gUnknown_81167E4; extern Item gUnknown_81167E4;
@ -1162,7 +1162,7 @@ s16 HandleAction(Action *action, DebugLocation *debug)
if (val == 1) { if (val == 1) {
s32 id = (s16)cmd.arg1; s32 id = (s16)cmd.arg1;
if (id != -1) { if (id != -1) {
PokemonStruct1 *mon = sub_80A8D54(id); Pokemon *mon = sub_80A8D54(id);
s32 i; s32 i;
for (i = 0; i < POKEMON_NAME_LENGTH; i++) { for (i = 0; i < POKEMON_NAME_LENGTH; i++) {
mon->name[i] = gUnknown_2039D98[i]; mon->name[i] = gUnknown_2039D98[i];
@ -1975,7 +1975,7 @@ s32 ExecuteScriptCommand(Action *action)
case 0x3d: { case 0x3d: {
int i; int i;
if ((s16)curCmd.arg1 != -1) { if ((s16)curCmd.arg1 != -1) {
PokemonStruct1 *mon = sub_80A8D54(curCmd.arg1); Pokemon *mon = sub_80A8D54(curCmd.arg1);
if (mon != NULL) { if (mon != NULL) {
for (i = 0; i < POKEMON_NAME_LENGTH; i++) { for (i = 0; i < POKEMON_NAME_LENGTH; i++) {
gUnknown_2039D98[i] = mon->name[i]; gUnknown_2039D98[i] = mon->name[i];
@ -3200,7 +3200,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
case 0x13: case 0x13:
{ {
PokemonStruct1 *ptr; Pokemon *ptr;
ptr = sub_80A8D54(r2); ptr = sub_80A8D54(r2);
if(ptr) if(ptr)
@ -3237,7 +3237,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
case 0x16: case 0x16:
{ {
s32 index; s32 index;
PokemonStruct1 *ptr; ptr = sub_80A8D54(1); Pokemon *ptr; ptr = sub_80A8D54(1);
if(ptr) if(ptr)
{ {
for(index = 0; index < POKEMON_NAME_LENGTH; index++) for(index = 0; index < POKEMON_NAME_LENGTH; index++)
@ -3271,8 +3271,8 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
.offenseDef = {20, 18}, .offenseDef = {20, 18},
.currExp = 4560, .currExp = 4560,
}; };
PokemonStruct1 sp_2c; Pokemon sp_2c;
PokemonStruct1 *ptr; Pokemon *ptr;
s32 index; s32 index;
ConvertStoryMonToPokemon(&sp_2c, &sp_4); ConvertStoryMonToPokemon(&sp_2c, &sp_4);
@ -3292,9 +3292,9 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
return 0; return 0;
case 0x1B: case 0x1B:
{ {
PokemonStruct1 *pokemon; Pokemon *pokemon;
struct StoryMonData sp_84; struct StoryMonData sp_84;
PokemonStruct1 sp_ac; Pokemon sp_ac;
UnlockFriendArea(GetFriendArea(MONSTER_ABSOL)); UnlockFriendArea(GetFriendArea(MONSTER_ABSOL));
sp_84 = gUnknown_8116738; sp_84 = gUnknown_8116738;
@ -3307,7 +3307,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
} }
case 0x1C: case 0x1C:
{ {
PokemonStruct1 *pokemon = sub_808D434(MONSTER_ABSOL, 0); Pokemon *pokemon = sub_808D434(MONSTER_ABSOL, 0);
if(pokemon == NULL) return 1; if(pokemon == NULL) return 1;
pokemon->flags |= POKEMON_FLAG_ON_TEAM; pokemon->flags |= POKEMON_FLAG_ON_TEAM;
return 0; return 0;
@ -3325,10 +3325,10 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
case 0x1F: case 0x1F:
{ {
PokemonStruct1 *pokemon; Pokemon *pokemon;
s32 index; s32 index;
struct StoryMonData sp_108; struct StoryMonData sp_108;
PokemonStruct1 sp_130; Pokemon sp_130;
sp_108 = gUnknown_8116760; sp_108 = gUnknown_8116760;
ConvertStoryMonToPokemon(&sp_130, &sp_108); ConvertStoryMonToPokemon(&sp_130, &sp_108);
@ -3376,7 +3376,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
return 0; return 0;
case 0x22: case 0x22:
{ {
PokemonStruct1 *pokemon = GetPlayerPokemonStruct(); Pokemon *pokemon = GetPlayerPokemonStruct();
if(pokemon->speciesNum != MONSTER_ARTICUNO && pokemon->speciesNum != MONSTER_ZAPDOS && pokemon->speciesNum != MONSTER_MOLTRES) if(pokemon->speciesNum != MONSTER_ARTICUNO && pokemon->speciesNum != MONSTER_ZAPDOS && pokemon->speciesNum != MONSTER_MOLTRES)
return 1; return 1;
@ -3384,7 +3384,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
return 0; return 0;
case 0x23: case 0x23:
{ {
PokemonStruct1 *pokemon; Pokemon *pokemon;
pokemon = GetPlayerPokemonStruct(); pokemon = GetPlayerPokemonStruct();
if (pokemon != NULL && pokemon->speciesNum == MONSTER_HO_OH) if (pokemon != NULL && pokemon->speciesNum == MONSTER_HO_OH)
return 2; return 2;
@ -3398,10 +3398,10 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
case 0x25: case 0x25:
{ {
PokemonStruct1 *pokemon; Pokemon *pokemon;
s32 index; s32 index;
struct StoryMonData sp_188; struct StoryMonData sp_188;
PokemonStruct1 sp_1b0; Pokemon sp_1b0;
if(!GetFriendAreaStatus(GetFriendArea(MONSTER_LATIOS))) if(!GetFriendAreaStatus(GetFriendArea(MONSTER_LATIOS)))
UnlockFriendArea(GetFriendArea(MONSTER_LATIOS)); UnlockFriendArea(GetFriendArea(MONSTER_LATIOS));
@ -3423,10 +3423,10 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
return 0; return 0;
case 0x27: case 0x27:
{ {
PokemonStruct1 *pokemon; Pokemon *pokemon;
s32 index; s32 index;
struct StoryMonData sp_208; struct StoryMonData sp_208;
PokemonStruct1 sp_230; Pokemon sp_230;
sp_208 = gUnknown_81167BC; sp_208 = gUnknown_81167BC;
ConvertStoryMonToPokemon(&sp_230, &sp_208); ConvertStoryMonToPokemon(&sp_230, &sp_208);
@ -3552,7 +3552,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
return 0; return 0;
case 0x2C: case 0x2C:
{ {
PokemonStruct1 *pokemon; Pokemon *pokemon;
s32 index; s32 index;
if(r2 != 0) if(r2 != 0)
{ {
@ -3621,7 +3621,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
case 0x32: case 0x32:
{ {
struct StoryMonData sp_288; struct StoryMonData sp_288;
PokemonStruct1 sp_2b0; Pokemon sp_2b0;
sp_288 = gUnknown_811681C; sp_288 = gUnknown_811681C;
ConvertStoryMonToPokemon(&sp_2b0, &sp_288); ConvertStoryMonToPokemon(&sp_2b0, &sp_288);
if(sub_808D1DC(&sp_2b0) == 0) { if(sub_808D1DC(&sp_2b0) == 0) {
@ -3676,7 +3676,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
return 0; return 0;
case 0x35: case 0x35:
{ {
PokemonStruct1 *pokemon = GetPlayerPokemonStruct(); Pokemon *pokemon = GetPlayerPokemonStruct();
if(pokemon != NULL && pokemon->speciesNum == MONSTER_CHANSEY) if(pokemon != NULL && pokemon->speciesNum == MONSTER_CHANSEY)
return 2; return 2;
else else

View File

@ -151,7 +151,7 @@ bool8 HasNoAvailIQSkills(s16 species)
{ {
s32 species_s32; s32 species_s32;
u8 iqSkillBuffer[NUM_IQ_SKILLS]; u8 iqSkillBuffer[NUM_IQ_SKILLS];
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
species_s32 = species; species_s32 = species;
pokeStruct = &gRecruitedPokemonRef->pokemon[species_s32]; pokeStruct = &gRecruitedPokemonRef->pokemon[species_s32];

View File

@ -595,7 +595,7 @@ s32 GetItemPossessionCount(u8 id)
s32 i = 0; s32 i = 0;
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[i]; Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
if (PokemonExists(mon) if (PokemonExists(mon)
&& PokemonFlag2(mon) && PokemonFlag2(mon)
&& (mon->heldItem.id != ITEM_NOTHING) && (mon->heldItem.id != ITEM_NOTHING)
@ -860,7 +860,7 @@ u32 GetMoneyValueHeld(BulkItem* slot)
static const u16 sGummiStatBoostsFlags[] = {1, 2, 4, 8}; static const u16 sGummiStatBoostsFlags[] = {1, 2, 4, 8};
// arm9.bin::0205FC30 // arm9.bin::0205FC30
void GetGummiItemStatBoost(PokemonStruct1* pokemon, u8 id, bool8 checkBoostFlags, Gummi *gummi) void GetGummiItemStatBoost(Pokemon* pokemon, u8 id, bool8 checkBoostFlags, Gummi *gummi)
{ {
// item stat buff? // item stat buff?
s8 result; s8 result;
@ -1401,7 +1401,7 @@ void ClearAllItems_8091FB4(void)
FillInventoryGaps(); FillInventoryGaps();
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
if (PokemonExists(&gRecruitedPokemonRef->pokemon[i])) { if (PokemonExists(&gRecruitedPokemonRef->pokemon[i])) {
PokemonStruct1 *pokemon = &gRecruitedPokemonRef->pokemon[i]; Pokemon *pokemon = &gRecruitedPokemonRef->pokemon[i];
if (pokemon->heldItem.id) { if (pokemon->heldItem.id) {
if (pokemon->heldItem.id == ITEM_POKE) { if (pokemon->heldItem.id == ITEM_POKE) {
AddToTeamMoney(GetMoneyValueHeld(&pokemon->heldItem)); AddToTeamMoney(GetMoneyValueHeld(&pokemon->heldItem));

View File

@ -270,7 +270,7 @@ void DrawLoadScreenText(void)
u32 hours; u32 hours;
u32 minutes; u32 minutes;
u32 seconds; u32 seconds;
PokemonStruct1 *playerInfo; Pokemon *playerInfo;
unkStruct_203B484 *temp2; unkStruct_203B484 *temp2;
u8 *r2; u8 *r2;

View File

@ -740,18 +740,17 @@ static void sub_8025254(void)
static bool8 LuminousCave_HasOnly1Member(void) static bool8 LuminousCave_HasOnly1Member(void)
{ {
s32 memberCount; s32 memberCount;
s32 index; s32 i;
PokemonStruct1 *preload; Pokemon *mon;
preload = &gRecruitedPokemonRef->pokemon[0]; mon = &gRecruitedPokemonRef->pokemon[0];
memberCount = 0; memberCount = 0;
for(index = 0; index < NUM_MONSTERS; index++, preload++) for (i = 0; i < NUM_MONSTERS; i++, mon++) {
{ if (PokemonFlag2(mon))
if((preload->flags >> 1) & 1)
memberCount++; memberCount++;
} }
if(memberCount == 1) if (memberCount == 1)
return TRUE; return TRUE;
else else
return FALSE; return FALSE;

View File

@ -84,7 +84,7 @@ static u32 xxx_script_related_8001334(u32 r0);
static void MainLoops_RunFrameActions(u32 unused); static void MainLoops_RunFrameActions(u32 unused);
extern u8 sub_80990EC(DungeonSetupInfo *param_1, s32 param_2); extern u8 sub_80990EC(DungeonSetupInfo *param_1, s32 param_2);
extern bool8 sub_8096A08(u8 dungeon, PokemonStruct1 *pokemon); extern bool8 sub_8096A08(u8 dungeon, Pokemon *pokemon);
extern u8 sub_80991E0(DungeonSetupInfo *param_1,short *param_2); extern u8 sub_80991E0(DungeonSetupInfo *param_1,short *param_2);
extern u32 xxx_script_related_8098468(u32); extern u32 xxx_script_related_8098468(u32);
extern void IncrementNumAdventures(void); extern void IncrementNumAdventures(void);
@ -1073,7 +1073,7 @@ static void RemoveMoneyAndRandomItems(void)
FillInventoryGaps(); FillInventoryGaps();
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[i]; Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
if (PokemonExists(mon) && PokemonFlag2(mon)) if (PokemonExists(mon) && PokemonFlag2(mon))
mon->heldItem.id = ITEM_NOTHING; mon->heldItem.id = ITEM_NOTHING;
} }
@ -1093,7 +1093,7 @@ static void RemoveAllMoneyAndItems(void)
FillInventoryGaps(); FillInventoryGaps();
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[i]; Pokemon *mon = &gRecruitedPokemonRef->pokemon[i];
if (PokemonExists(mon) && PokemonFlag2(mon)) if (PokemonExists(mon) && PokemonFlag2(mon))
mon->heldItem.id = ITEM_NOTHING; mon->heldItem.id = ITEM_NOTHING;
} }

View File

@ -281,17 +281,13 @@ s32 unk_FindMoveEnabledForAIAfter4(Move *moves, s32 index)
s32 i; s32 i;
for (i = 0; i < MAX_MON_MOVES; i++) { for (i = 0; i < MAX_MON_MOVES; i++) {
u8 flag;
if (++index == MAX_MON_MOVES) if (++index == MAX_MON_MOVES)
return 0; return 0;
if (!(moves[index].moveFlags & MOVE_FLAG_EXISTS)) if (!MoveFlagExists(&moves[index]))
return 0; return 0;
// checks MOVE_FLAG_ENABLED_FOR_AI if (!MoveFlagLinkChain(&moves[index]))
flag = (moves[index].moveFlags >> 1);
if (!(flag & 1))
return index; return index;
} }
@ -303,8 +299,6 @@ s32 sub_8092DB8(Move *moves, s32 index)
s32 i, j; s32 i, j;
for (i = 0; i < MAX_MON_MOVES; i++) { for (i = 0; i < MAX_MON_MOVES; i++) {
u8 flag;
if (--index < 0) { if (--index < 0) {
for (j = MAX_MON_MOVES - 1; j >= 0; j--) { for (j = MAX_MON_MOVES - 1; j >= 0; j--) {
if (!(moves[j].moveFlags & MOVE_FLAG_EXISTS)) { if (!(moves[j].moveFlags & MOVE_FLAG_EXISTS)) {
@ -320,12 +314,10 @@ s32 sub_8092DB8(Move *moves, s32 index)
return 0; return 0;
} }
if (!(moves[index].moveFlags & MOVE_FLAG_EXISTS)) if (!MoveFlagExists(&moves[index]))
return 0; return 0;
// checks MOVE_FLAG_ENABLED_FOR_AI if (!(MoveFlagLinkChain(&moves[index])))
flag = (moves[index].moveFlags >> 1);
if (!(flag & 1))
return index; return index;
} }
@ -337,17 +329,13 @@ s32 unk_FindMoveEnabledForAIAfter8(Move *moves, s32 index)
s32 i; s32 i;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
u8 flag;
if (++index == 8) if (++index == 8)
return 0; return 0;
if (!(moves[index].moveFlags & 1)) if (!MoveFlagExists(&moves[index]))
return 0; return 0;
// checks MOVE_FLAG_ENABLED_FOR_AI if (!(MoveFlagLinkChain(&moves[index])))
flag = (moves[index].moveFlags >> 1);
if (!(flag & 1))
return index; return index;
} }
@ -359,17 +347,13 @@ s32 unk_FindMoveEnabledForAIAfter8_v2(Move *moves, s32 index)
s32 i; s32 i;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
u8 flag;
if (++index == 8) if (++index == 8)
return 0; return 0;
if (!(moves[index].moveFlags & 1)) if (!MoveFlagExists(&moves[index]))
return 0; return 0;
// checks MOVE_FLAG_ENABLED_FOR_AI if (!(MoveFlagLinkChain(&moves[index])))
flag = (moves[index].moveFlags >> 1);
if (!(flag & 1))
return index; return index;
} }
@ -383,27 +367,21 @@ s32 unk_FindMoveEnabledForAIBefore8(Move *moves, s32 index)
s32 i, j; s32 i, j;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
u8 flag;
if (--index < 0) { if (--index < 0) {
for (j = 7; j > 0; j--) { for (j = 7; j > 0; j--) {
if (!(moves[j].moveFlags & MOVE_FLAG_EXISTS)) if (!MoveFlagExists(&moves[j]))
continue; continue;
// checks MOVE_FLAG_ENABLED_FOR_AI if (!(MoveFlagLinkChain(&moves[j])))
flag = (moves[j].moveFlags >> 1);
if (!(flag & 1))
return j; return j;
} }
return 0; return 0;
} }
if (!(moves[index].moveFlags & MOVE_FLAG_EXISTS)) if (!MoveFlagExists(&moves[index]))
return 0; return 0;
// checks MOVE_FLAG_ENABLED_FOR_AI if (!(MoveFlagLinkChain(&moves[index])))
flag = (moves[index].moveFlags >> 1);
if (!(flag & 1))
return index; return index;
} }
@ -415,27 +393,21 @@ s32 unk_FindMoveEnabledForAIBefore8_v2(Move *moves, s32 index)
s32 i, j; s32 i, j;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
u8 flag;
if (--index < 0) { if (--index < 0) {
for (j = 7; j > 0; j--) { for (j = 7; j > 0; j--) {
if (!(moves[j].moveFlags & MOVE_FLAG_EXISTS)) if (!MoveFlagExists(&moves[j]))
continue; continue;
// checks MOVE_FLAG_ENABLED_FOR_AI if (!(MoveFlagLinkChain(&moves[j])))
flag = (moves[j].moveFlags >> 1);
if (!(flag & 1))
return j; return j;
} }
return 0; return 0;
} }
if (!(moves[index].moveFlags & MOVE_FLAG_EXISTS)) if (!MoveFlagExists(&moves[index]))
return 0; return 0;
// checks MOVE_FLAG_ENABLED_FOR_AI if (!(MoveFlagLinkChain(&moves[index])))
flag = (moves[index].moveFlags >> 1);
if (!(flag & 1))
return index; return index;
} }
@ -448,14 +420,11 @@ s32 sub_8092F4C(Move *moves, s32 index)
for (i = index; i > 0; i--) { for (i = index; i > 0; i--) {
Move* move = &moves[i]; Move* move = &moves[i];
u8 flag;
if (!(move->moveFlags & MOVE_FLAG_EXISTS)) if (!MoveFlagExists(move))
return 0; return 0;
// checks MOVE_FLAG_ENABLED_FOR_AI if (!(MoveFlagLinkChain(move)))
flag = (move->moveFlags >> 1);
if (!(flag & 1))
return i; return i;
} }
@ -729,7 +698,7 @@ bool8 IsAnyMoveLinked(s32 unused, Move *moves)
counter = 0; counter = 0;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if ((moves[i].moveFlags & MOVE_FLAG_EXISTS) && !(moves[i].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) if ((moves[i].moveFlags & MOVE_FLAG_EXISTS) && !(MOVE_FLAG_LINK_CHAIN(&moves[i])))
counter++; counter++;
} }
@ -755,13 +724,13 @@ bool8 TryLinkMovesAfter(s32 index, Move *moves)
return FALSE; return FALSE;
for (i = index + 1; i < 8; i++) { for (i = index + 1; i < 8; i++) {
if (!(moves[i].moveFlags & MOVE_FLAG_EXISTS)) if (!MoveFlagExists(&moves[i]))
return FALSE; return FALSE;
if (DoesMoveCharge(moves[i].id)) if (DoesMoveCharge(moves[i].id))
return FALSE; return FALSE;
if (!(moves[i].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) { if (!(MOVE_FLAG_LINK_CHAIN(&moves[i]))) {
moves[i].moveFlags |= MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN; moves[i].moveFlags |= MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN;
unk_FixLinkedMovesSetEnabled8_v2(moves); unk_FixLinkedMovesSetEnabled8_v2(moves);
return TRUE; return TRUE;
@ -778,13 +747,15 @@ bool8 UnlinkMovesAfter(s32 index, Move *moves)
s32 r4; s32 r4;
for (i = index + 1, r4 = 0; r4 < 8 && i < 8; i++, r4++) { for (i = index + 1, r4 = 0; r4 < 8 && i < 8; i++, r4++) {
if (!(moves[i].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) if (MOVE_FLAG_LINK_CHAIN(&moves[i])) {
goto label; // for some reason we can't use break here MOVE_FLAG_CLEAR_LINK_CHAIN(&moves[i]);
result = TRUE;
moves[i].moveFlags &= ~MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN; }
result = TRUE; else {
break;
}
} }
label:
unk_FixLinkedMovesSetEnabled8_v2(moves); unk_FixLinkedMovesSetEnabled8_v2(moves);
return result; return result;
} }
@ -801,7 +772,7 @@ bool8 IsNextMoveLinked(s32 index, Move *moves)
if (!(move->moveFlags & MOVE_FLAG_EXISTS)) if (!(move->moveFlags & MOVE_FLAG_EXISTS))
return FALSE; return FALSE;
if (move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN) if MOVE_FLAG_LINK_CHAIN(move)
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -862,7 +833,7 @@ s32 GetLinkedSequence(s32 index, Move *moves, u16 *sequenceMoveIDs)
for (index++, sequenceMoveIDs++; index < 8 && linkedSequenceLength <= 3; index++) { for (index++, sequenceMoveIDs++; index < 8 && linkedSequenceLength <= 3; index++) {
move = &moves[index]; move = &moves[index];
if (!(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) if (!MOVE_FLAG_LINK_CHAIN(move))
return linkedSequenceLength; return linkedSequenceLength;
*sequenceMoveIDs++ = move->id; *sequenceMoveIDs++ = move->id;
@ -889,7 +860,7 @@ s32 sub_80935B8(Move *moves, s32 index)
while (linkSequenceStart >= 0) { while (linkSequenceStart >= 0) {
Move *move = &moves[linkSequenceStart]; Move *move = &moves[linkSequenceStart];
if (!((move->moveFlags & MOVE_FLAG_EXISTS) && (move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))) if (!((move->moveFlags & MOVE_FLAG_EXISTS) && MOVE_FLAG_LINK_CHAIN(move)))
break; break;
linkSequenceStart--; linkSequenceStart--;
@ -901,7 +872,7 @@ s32 sub_80935B8(Move *moves, s32 index)
for (i = linkSequenceStart + 1; i < MAX_MON_MOVES; i++) { for (i = linkSequenceStart + 1; i < MAX_MON_MOVES; i++) {
Move *move = &moves[i]; Move *move = &moves[i];
if (!((move->moveFlags & MOVE_FLAG_EXISTS) && (move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))) if (!((move->moveFlags & MOVE_FLAG_EXISTS) && MOVE_FLAG_LINK_CHAIN(move)))
break; break;
isNonTrivialLinkSequence = TRUE; isNonTrivialLinkSequence = TRUE;
@ -915,7 +886,7 @@ s32 sub_80935B8(Move *moves, s32 index)
while (--i >= linkSequenceStart) { while (--i >= linkSequenceStart) {
Move* move = &moves[i]; Move* move = &moves[i];
if (!(move->moveFlags & MOVE_FLAG_EXISTS)) if (!MoveFlagExists(move))
break; break;
if (pp > move->PP) if (pp > move->PP)
@ -930,12 +901,12 @@ s32 sub_80935B8(Move *moves, s32 index)
return pp; return pp;
for (i = linkSequenceStart + 1; i < MAX_MON_MOVES; i++) { for (i = linkSequenceStart + 1; i < MAX_MON_MOVES; i++) {
Move* move = &moves[i]; Move *move = &moves[i];
if (!(moves[i].moveFlags & MOVE_FLAG_EXISTS)) if (!MoveFlagExists(move))
break; break;
if (move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN) { if MOVE_FLAG_LINK_CHAIN(move) {
move->moveFlags &= ~MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN; move->moveFlags &= ~MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN;
any_move_linked = TRUE; any_move_linked = TRUE;
} }
@ -1125,7 +1096,7 @@ static void unk_GetLinkedSequences8(Move *moves, Move linkedSequences[8][8])
for (j = 0, k = 0; k < 8; j++, k++) { for (j = 0, k = 0; k < 8; j++, k++) {
Move* move = &moves[k]; Move* move = &moves[k];
if (k == 0 || !(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) { if (k == 0 || !MOVE_FLAG_LINK_CHAIN(move)) {
moveSetIndex++; moveSetIndex++;
j = 0; j = 0;
} }
@ -1291,7 +1262,7 @@ UNUSED static void RemoveLinkSequenceFromMoves8_v2(Move *moves, s32 index)
for (i = index + 1; i < 8; i++) { for (i = index + 1; i < 8; i++) {
Move* move = &moves[i]; Move* move = &moves[i];
if (!MoveFlagExists(move) || !(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) if (!MoveFlagExists(move) || !MOVE_FLAG_LINK_CHAIN(move))
break; break;
move->moveFlags = 0; move->moveFlags = 0;
@ -1322,7 +1293,7 @@ void RemoveLinkSequenceFromMoves8(Move *moves, s32 index)
for (i = index + 1; i < 8; i++) { for (i = index + 1; i < 8; i++) {
Move* move = &moves[i]; Move* move = &moves[i];
if (!MoveFlagExists(move) || !(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) if (!MoveFlagExists(move) || !MOVE_FLAG_LINK_CHAIN(move))
break; break;
move->moveFlags = 0; move->moveFlags = 0;

View File

@ -397,8 +397,8 @@ static void sub_8037810(void)
MemoryFill8(&sUnknown_203B35C->unk25C, 0, sizeof(unkStruct_203B480)); MemoryFill8(&sUnknown_203B35C->unk25C, 0, sizeof(unkStruct_203B480));
MemoryFill8(&sUnknown_203B35C->unk28C, 0, sizeof(unkStruct_203B480)); MemoryFill8(&sUnknown_203B35C->unk28C, 0, sizeof(unkStruct_203B480));
MemoryFill8(&sUnknown_203B35C->unk314, 0, sizeof(unkStruct_203B480)); MemoryFill8(&sUnknown_203B35C->unk314, 0, sizeof(unkStruct_203B480));
MemoryFill8(&sUnknown_203B35C->unk2BC, 0, sizeof(PokemonStruct1)); MemoryFill8(&sUnknown_203B35C->unk2BC, 0, sizeof(Pokemon));
MemoryFill8(&sUnknown_203B35C->unk344, 0, sizeof(PokemonStruct1)); MemoryFill8(&sUnknown_203B35C->unk344, 0, sizeof(Pokemon));
MemoryFill8(sUnknown_203B35C->unk39C, 0, 0xb4); // unkStruct_803B344? MemoryFill8(sUnknown_203B35C->unk39C, 0, 0xb4); // unkStruct_803B344?
MemoryFill8(sUnknown_203B35C->unk450, 0, 0xb4); // unkStruct_803B344? MemoryFill8(sUnknown_203B35C->unk450, 0, 0xb4); // unkStruct_803B344?

View File

@ -32,16 +32,16 @@ static EWRAM_INIT unkStruct_203B2B8 *sUnknown_203B2B8 = {NULL};
#include "data/party_list_menu.h" #include "data/party_list_menu.h"
extern u32 sub_8026F04(PokemonStruct1 *); extern u32 sub_8026F04(Pokemon *);
bool8 CanTakePokemonHeldItem(PokemonStruct1 *r0); bool8 CanTakePokemonHeldItem(Pokemon *r0);
extern bool8 sub_808D750(s16 index_); extern bool8 sub_808D750(s16 index_);
bool8 sub_8026E88(PokemonStruct1 *r0); bool8 sub_8026E88(Pokemon *r0);
bool8 sub_8026EB8(PokemonStruct1 *r0); bool8 sub_8026EB8(Pokemon *r0);
void sub_8026E08(u32 r0); void sub_8026E08(u32 r0);
void sub_8026DAC(u32 r0, BulkItem *item); void sub_8026DAC(u32 r0, BulkItem *item);
void sub_8026FA4(void); void sub_8026FA4(void);
void PartyListMenu_BuildYesNoMenu(void); void PartyListMenu_BuildYesNoMenu(void);
extern void sub_808D31C(PokemonStruct1 *); extern void sub_808D31C(Pokemon *);
void PartyListMenu_CreateMenu2(void); void PartyListMenu_CreateMenu2(void);
void PartyListMenu_CreateMenu1(void); void PartyListMenu_CreateMenu1(void);
@ -63,7 +63,7 @@ void PartyListMenu_GotoFallbackState(void);
static void SetPartyListMenuState(s32 newState); static void SetPartyListMenuState(s32 newState);
static void sub_802608C(void); static void sub_802608C(void);
bool8 CreatePartyListMenu(PokemonStruct1 *pokeStruct) bool8 CreatePartyListMenu(Pokemon *pokeStruct)
{ {
s32 i; s32 i;
@ -304,10 +304,8 @@ void HandlePartyListMenuCallback(void)
} }
void PartyListMenu_CreateMenu1(void) { void PartyListMenu_CreateMenu1(void) {
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
s32 index; s32 index;
s32 one;
u16 temp;
s32 loopMax = 0; s32 loopMax = 0;
pokeStruct = &gRecruitedPokemonRef->pokemon[sUnknown_203B2B8->pokeSpecies]; pokeStruct = &gRecruitedPokemonRef->pokemon[sUnknown_203B2B8->pokeSpecies];
MemoryFill16(sUnknown_203B2B8->unk20C, 0, sizeof(sUnknown_203B2B8->unk20C)); MemoryFill16(sUnknown_203B2B8->unk20C, 0, sizeof(sUnknown_203B2B8->unk20C));
@ -315,7 +313,7 @@ void PartyListMenu_CreateMenu1(void) {
PeekPokemonItem(sUnknown_203B2B8->pokeSpecies, &sUnknown_203B2B8->item2); PeekPokemonItem(sUnknown_203B2B8->pokeSpecies, &sUnknown_203B2B8->item2);
if(temp = pokeStruct->flags >> 1, one = 1, temp & one) if (PokemonFlag2(pokeStruct))
{ {
sUnknown_203B2B8->unk16C[loopMax].text = sPartyMenuStandBy; sUnknown_203B2B8->unk16C[loopMax].text = sPartyMenuStandBy;
sUnknown_203B2B8->unk16C[loopMax].menuAction = PARTY_LIST_MENU_STANDBY; sUnknown_203B2B8->unk16C[loopMax].menuAction = PARTY_LIST_MENU_STANDBY;
@ -367,7 +365,7 @@ void PartyListMenu_CreateMenu1(void) {
} }
loopMax += 1; loopMax += 1;
if((temp = pokeStruct->flags >> 1, one = 1, temp & one) == 0) if (!PokemonFlag2(pokeStruct))
{ {
sUnknown_203B2B8->unk16C[loopMax].text = sPartyMenuSayFarewell; sUnknown_203B2B8->unk16C[loopMax].text = sPartyMenuSayFarewell;
sUnknown_203B2B8->unk16C[loopMax].menuAction = PARTY_LIST_MENU_SAY_FAREWELL; sUnknown_203B2B8->unk16C[loopMax].menuAction = PARTY_LIST_MENU_SAY_FAREWELL;
@ -458,8 +456,8 @@ void PartyListMenu_BuildYesNoMenu(void) {
void PartyListMenu_HandleMenu1(void) void PartyListMenu_HandleMenu1(void)
{ {
PokemonStruct1 *playerPokemon; Pokemon *playerPokemon;
PokemonStruct1 *newLeader; Pokemon *newLeader;
s32 choice; s32 choice;
choice = 0; choice = 0;
@ -788,7 +786,7 @@ void sub_8026E08(u32 r0)
sub_80073E0(r0); sub_80073E0(r0);
} }
bool8 sub_8026E88(PokemonStruct1 *r0) bool8 sub_8026E88(Pokemon *r0)
{ {
bool8 flag; bool8 flag;
if(!r0->isTeamLeader) if(!r0->isTeamLeader)
@ -803,7 +801,7 @@ bool8 sub_8026E88(PokemonStruct1 *r0)
return TRUE; return TRUE;
} }
bool8 sub_8026EB8(PokemonStruct1 *r0) bool8 sub_8026EB8(Pokemon *r0)
{ {
bool8 flag; bool8 flag;
if(sub_808D3BC() != r0) if(sub_808D3BC() != r0)
@ -825,7 +823,7 @@ bool8 sub_8026EB8(PokemonStruct1 *r0)
} }
u32 sub_8026F04(PokemonStruct1 *r0) u32 sub_8026F04(Pokemon *r0)
{ {
if(r0->heldItem.id == ITEM_NOTHING) if(r0->heldItem.id == ITEM_NOTHING)
return 0; return 0;
@ -837,7 +835,7 @@ u32 sub_8026F04(PokemonStruct1 *r0)
return 3; return 3;
} }
bool8 CanTakePokemonHeldItem(PokemonStruct1 *r0) bool8 CanTakePokemonHeldItem(Pokemon *r0)
{ {
if(IsNotMoneyOrUsedTMItem(r0->heldItem.id)) if(IsNotMoneyOrUsedTMItem(r0->heldItem.id))
{ {

View File

@ -39,7 +39,7 @@ extern s16 gBlastBurnIQReq; // 0x14d
extern s16 gVoltTackleIQReq; // 0x14d extern s16 gVoltTackleIQReq; // 0x14d
extern char* gFormattedStatusNames[]; extern char* gFormattedStatusNames[];
extern void xxx_pokemon2_to_pokemonstruct_808DF44(PokemonStruct1*, PokemonStruct2*); extern void DungeonMonToPokemon(Pokemon*, DungeonMon*);
// arm9.bin::0205C34C // arm9.bin::0205C34C
void LoadMonsterParameters(void) void LoadMonsterParameters(void)
@ -66,7 +66,7 @@ void InitializeRecruitedPokemon(void)
gRecruitedPokemonRef->pokemon[index].flags = 0; gRecruitedPokemonRef->pokemon[index].flags = 0;
for (index = 0; index < 4; index++) for (index = 0; index < 4; index++)
gRecruitedPokemonRef->pokemon2[index].flags = 0; gRecruitedPokemonRef->dungeonTeam[index].flags = 0;
for (index = 0; index < MAX_TEAM_MEMBERS; index++) { for (index = 0; index < MAX_TEAM_MEMBERS; index++) {
gRecruitedPokemonRef->team[index].speciesNum = 0; gRecruitedPokemonRef->team[index].speciesNum = 0;
@ -76,7 +76,7 @@ void InitializeRecruitedPokemon(void)
void sub_808CE74(s16 _species, bool32 _isLeader, u8* name) void sub_808CE74(s16 _species, bool32 _isLeader, u8* name)
{ {
struct PokemonStruct1 pokemon; struct Pokemon pokemon;
u8 name_buffer[20]; u8 name_buffer[20];
u32 friendArea; u32 friendArea;
s32 i; s32 i;
@ -134,7 +134,7 @@ void sub_808CE74(s16 _species, bool32 _isLeader, u8* name)
} }
} }
void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID) void sub_808CFD0(Pokemon *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID)
{ {
u8 name_buffer[20]; u8 name_buffer[20];
s32 i; s32 i;
@ -191,7 +191,7 @@ void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, D
} }
} }
void sub_808D0D8(PokemonStruct1 *pokemon) void sub_808D0D8(Pokemon *pokemon)
{ {
pokemon->level = 1; pokemon->level = 1;
pokemon->pokeHP = GetBaseHP(pokemon->speciesNum); pokemon->pokeHP = GetBaseHP(pokemon->speciesNum);
@ -206,7 +206,7 @@ void sub_808D0D8(PokemonStruct1 *pokemon)
sub_808E490(pokemon->moves, pokemon->speciesNum); sub_808E490(pokemon->moves, pokemon->speciesNum);
} }
void ConvertStoryMonToPokemon(PokemonStruct1 *dst, struct StoryMonData *src) void ConvertStoryMonToPokemon(Pokemon *dst, struct StoryMonData *src)
{ {
s32 i; s32 i;
@ -242,7 +242,7 @@ void ConvertStoryMonToPokemon(PokemonStruct1 *dst, struct StoryMonData *src)
} }
} }
PokemonStruct1 *sub_808D1DC(PokemonStruct1 *pokemon) Pokemon *sub_808D1DC(Pokemon *pokemon)
{ {
u32 friendArea; u32 friendArea;
s32 i; s32 i;
@ -256,7 +256,7 @@ PokemonStruct1 *sub_808D1DC(PokemonStruct1 *pokemon)
u8 speciesFriendArea = sub_80923D4(i); u8 speciesFriendArea = sub_80923D4(i);
if (speciesFriendArea == friendArea) { if (speciesFriendArea == friendArea) {
gRecruitedPokemonRef->pokemon[i] = *pokemon; gRecruitedPokemonRef->pokemon[i] = *pokemon;
gRecruitedPokemonRef->pokemon[i].flags &= 0xbfff; gRecruitedPokemonRef->pokemon[i].flags &= ~(POKEMON_FLAG_x4000);
sub_80980B4(pokemon->speciesNum); sub_80980B4(pokemon->speciesNum);
return &gRecruitedPokemonRef->pokemon[i]; return &gRecruitedPokemonRef->pokemon[i];
} }
@ -265,7 +265,7 @@ PokemonStruct1 *sub_808D1DC(PokemonStruct1 *pokemon)
return NULL; return NULL;
} }
PokemonStruct1 *sub_808D278(s32 species) Pokemon *sub_808D278(s32 species)
{ {
u32 friendArea; u32 friendArea;
s32 i; s32 i;
@ -286,21 +286,21 @@ PokemonStruct1 *sub_808D278(s32 species)
return NULL; return NULL;
} }
PokemonStruct1 *sub_808D2E8(s32 species, u8 *name, u32 _itemID, DungeonLocation *location, u16 *moveID) Pokemon *sub_808D2E8(s32 species, u8 *name, u32 _itemID, DungeonLocation *location, u16 *moveID)
{ {
PokemonStruct1 pokemon; Pokemon pokemon;
sub_808CFD0(&pokemon, species, name, (u8)_itemID, location, moveID); sub_808CFD0(&pokemon, species, name, (u8)_itemID, location, moveID);
return sub_808D1DC(&pokemon); return sub_808D1DC(&pokemon);
} }
void sub_808D31C(PokemonStruct1 *param_1) void sub_808D31C(Pokemon *param_1)
{ {
if ((!IsMonTeamLeader(param_1)) && !IsMonPartner(param_1)) if ((!IsMonTeamLeader(param_1)) && !IsMonPartner(param_1))
param_1->flags = 0; param_1->flags = 0;
} }
PokemonStruct1 * GetPlayerPokemonStruct(void) Pokemon * GetPlayerPokemonStruct(void)
{ {
s32 index; s32 index;
@ -315,7 +315,7 @@ PokemonStruct1 * GetPlayerPokemonStruct(void)
return NULL; return NULL;
} }
PokemonStruct1 * sub_808D378(void) Pokemon * sub_808D378(void)
{ {
s32 index; s32 index;
@ -330,7 +330,7 @@ PokemonStruct1 * sub_808D378(void)
return NULL; return NULL;
} }
PokemonStruct1 * sub_808D3BC(void) Pokemon * sub_808D3BC(void)
{ {
s32 index; s32 index;
for (index = 0; index < NUM_MONSTERS; index++) { for (index = 0; index < NUM_MONSTERS; index++) {
@ -343,7 +343,7 @@ PokemonStruct1 * sub_808D3BC(void)
return NULL; return NULL;
} }
PokemonStruct1 * sub_808D3F8(void) Pokemon * sub_808D3F8(void)
{ {
s32 index; s32 index;
for (index = 0; index < NUM_MONSTERS; index++) { for (index = 0; index < NUM_MONSTERS; index++) {
@ -356,9 +356,9 @@ PokemonStruct1 * sub_808D3F8(void)
return NULL; return NULL;
} }
PokemonStruct1 * sub_808D434(s16 species, s32 param_2) Pokemon * sub_808D434(s16 species, s32 param_2)
{ {
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
s32 index; s32 index;
s32 counter; s32 counter;
s32 species_s32 = species; s32 species_s32 = species;
@ -380,7 +380,7 @@ s32 GetFriendSum_808D480(void)
{ {
s32 index; s32 index;
s32 count; s32 count;
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
pokeStruct = gRecruitedPokemonRef->pokemon; pokeStruct = gRecruitedPokemonRef->pokemon;
count = 0; count = 0;
@ -396,7 +396,7 @@ s32 GetFriendSum_808D480(void)
bool8 sub_808D4B0(void) bool8 sub_808D4B0(void)
{ {
s32 index; s32 index;
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
bool8 flag; bool8 flag;
pokeStruct = gRecruitedPokemonRef->pokemon; pokeStruct = gRecruitedPokemonRef->pokemon;
@ -414,7 +414,7 @@ bool8 sub_808D4B0(void)
bool8 sub_808D500(void) bool8 sub_808D500(void)
{ {
s32 index; s32 index;
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
bool8 flag; bool8 flag;
pokeStruct = gRecruitedPokemonRef->pokemon; pokeStruct = gRecruitedPokemonRef->pokemon;
@ -432,7 +432,7 @@ bool8 sub_808D500(void)
s32 GetUnitSum_808D544(s32 *team) s32 GetUnitSum_808D544(s32 *team)
{ {
s32 count, i; s32 count, i;
PokemonStruct1 *mon = gRecruitedPokemonRef->pokemon; Pokemon *mon = gRecruitedPokemonRef->pokemon;
count = 0; count = 0;
for (i = 0; i < NUM_MONSTERS; i++, mon++) { for (i = 0; i < NUM_MONSTERS; i++, mon++) {
@ -449,7 +449,7 @@ s32 GetUnitSum_808D544(s32 *team)
s32 sub_808D580(s32 *team) s32 sub_808D580(s32 *team)
{ {
PokemonStruct1 *mon; Pokemon *mon;
s32 index; s32 index;
s32 counter; s32 counter;
@ -492,7 +492,7 @@ s32 sub_808D580(s32 *team)
s32 sub_808D654(s32 *ptr) s32 sub_808D654(s32 *ptr)
{ {
s32 i; s32 i;
PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[0]; Pokemon *mon = &gRecruitedPokemonRef->pokemon[0];
s32 count = 0; s32 count = 0;
s32 *ptr2; s32 *ptr2;
@ -513,7 +513,7 @@ s32 sub_808D654(s32 *ptr)
s32 sub_808D6A4(s32 *ptr) s32 sub_808D6A4(s32 *ptr)
{ {
s32 i; s32 i;
PokemonStruct1 *mon = &gRecruitedPokemonRef->pokemon[0]; Pokemon *mon = &gRecruitedPokemonRef->pokemon[0];
s32 count = 0; s32 count = 0;
s32 *ptr2; s32 *ptr2;
@ -536,7 +536,7 @@ bool8 sub_808D6E8()
s32 count = 0; s32 count = 0;
s32 size_count = 0; s32 size_count = 0;
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[i]; Pokemon* pokemon = &gRecruitedPokemonRef->pokemon[i];
if (PokemonExists(pokemon) && PokemonFlag2(pokemon)) { if (PokemonExists(pokemon) && PokemonFlag2(pokemon)) {
size_count += GetBodySize(pokemon->speciesNum); size_count += GetBodySize(pokemon->speciesNum);
count++; count++;
@ -550,7 +550,7 @@ bool8 sub_808D6E8()
bool8 sub_808D750(s32 index_) bool8 sub_808D750(s32 index_)
{ {
PokemonStruct1* pokemon; Pokemon* pokemon;
s32 i; s32 i;
s32 index = (s16) index_; s32 index = (s16) index_;
s32 count = 0; s32 count = 0;
@ -577,19 +577,19 @@ bool8 sub_808D6E8()
void PeekPokemonItem(s16 index_, BulkItem* item) { void PeekPokemonItem(s16 index_, BulkItem* item) {
s32 index = index_; s32 index = index_;
PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[index]; Pokemon* pokemon = &gRecruitedPokemonRef->pokemon[index];
item->id = pokemon->heldItem.id; item->id = pokemon->heldItem.id;
item->quantity = pokemon->heldItem.quantity; item->quantity = pokemon->heldItem.quantity;
} }
void GivePokemonItem(s16 index_, BulkItem* item) { void GivePokemonItem(s16 index_, BulkItem* item) {
s32 index = index_; s32 index = index_;
PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[index]; Pokemon* pokemon = &gRecruitedPokemonRef->pokemon[index];
pokemon->heldItem.id = item->id; pokemon->heldItem.id = item->id;
pokemon->heldItem.quantity = item->quantity; pokemon->heldItem.quantity = item->quantity;
} }
bool8 IsPokemonRenamed(PokemonStruct1* pokemon) { bool8 IsPokemonRenamed(Pokemon* pokemon) {
char species_name[20]; char species_name[20];
char* species = GetMonSpecies(pokemon->speciesNum); char* species = GetMonSpecies(pokemon->speciesNum);
s32 i; s32 i;
@ -665,7 +665,7 @@ char * GetMonSpecies(s16 index)
return gMonsterParameters[index].species; return gMonsterParameters[index].species;
} }
void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum) void PrintColoredPokeNameToBuffer(u8 *buffer, Pokemon *pokemon, s32 colorNum)
{ {
u8 nameBuffer [20]; u8 nameBuffer [20];
@ -676,7 +676,7 @@ void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 color
sprintfStatic(buffer,_("{color}%c%s{reset}"),colorNum,nameBuffer); sprintfStatic(buffer,_("{color}%c%s{reset}"),colorNum,nameBuffer);
} }
void sub_808D9DC(u8 *buffer, PokemonStruct2 *param_2, s32 colorNum) void sub_808D9DC(u8 *buffer, DungeonMon *param_2, s32 colorNum)
{ {
u8 nameBuffer [20]; u8 nameBuffer [20];
@ -687,7 +687,7 @@ void sub_808D9DC(u8 *buffer, PokemonStruct2 *param_2, s32 colorNum)
sprintfStatic(buffer,_("{color}%c%s{reset}"),colorNum,nameBuffer); sprintfStatic(buffer,_("{color}%c%s{reset}"),colorNum,nameBuffer);
} }
void sub_808DA0C(u8 *buffer, PokemonStruct2 *param_2) void sub_808DA0C(u8 *buffer, DungeonMon *param_2)
{ {
u8 nameBuffer [20]; u8 nameBuffer [20];
@ -695,7 +695,7 @@ void sub_808DA0C(u8 *buffer, PokemonStruct2 *param_2)
sprintfStatic(buffer,"%s",nameBuffer); sprintfStatic(buffer,"%s",nameBuffer);
} }
void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon) void PrintPokeNameToBuffer(u8 *buffer, Pokemon *pokemon)
{ {
StrncpyCustom(buffer, pokemon->name, POKEMON_NAME_LENGTH); StrncpyCustom(buffer, pokemon->name, POKEMON_NAME_LENGTH);
} }
@ -921,102 +921,94 @@ bool8 IsPokemonDialogueSpriteAvail(s16 index, s32 spriteId)
return (gMonsterParameters[index].dialogueSprites >> spriteId) & 1; return (gMonsterParameters[index].dialogueSprites >> spriteId) & 1;
} }
void xxx_pokemonstruct_index_to_pokemon2_808DE30(void* r0, u32 r1) void xxx_pokemonstruct_index_to_pokemon2_808DE30(void* r0, u32 recruitedPokemonId)
{ {
xxx_pokemonstruct_to_pokemon2_808DE50(r0, &gRecruitedPokemonRef->pokemon[r1], r1); PokemonToDungeonMon(r0, &gRecruitedPokemonRef->pokemon[recruitedPokemonId], recruitedPokemonId);
} }
void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 * a1, PokemonStruct1 *pokemon, s32 a3) void PokemonToDungeonMon(DungeonMon *dst, Pokemon *src, s32 recruitedPokemonId)
{
s32 i;
BulkItem* held;
Item* slot;
a1->flags = pokemon->flags;
a1->level = pokemon->level;
a1->IQ = pokemon->IQ;
a1->IQSkills = pokemon->IQSkills;
GenerateHiddenPower(&a1->hiddenPower);
a1->dungeonLocation = pokemon->dungeonLocation;
a1->isTeamLeader = pokemon->isTeamLeader;
a1->unkA = a3;
a1->speciesNum = pokemon->speciesNum;
a1->tacticIndex = pokemon->tacticIndex;
a1->unk12 = pokemon->pokeHP;
a1->unk10 = pokemon->pokeHP;
for (i = 0; i < 2; i++) {
a1->offense.att[i] = pokemon->offense.att[i];
a1->offense.def[i] = pokemon->offense.def[i];
}
a1->currExp = pokemon->currExp;
CopyAndResetMoves(&a1->moves, pokemon->moves);
for (i = 0; i < POKEMON_NAME_LENGTH; i++) {
a1->name[i] = pokemon->name[i];
}
held = &pokemon->heldItem;
slot = &a1->itemSlot;
if ((u32)(-held->id | held->id) >> 31) {
HeldItemToSlot(slot, held);
}
else {
slot->id = ITEM_NOTHING;
slot->quantity = 0;
slot->flags = 0;
}
a1->belly = IntToFixedPoint(100);
a1->maxBelly = IntToFixedPoint(100);
}
void xxx_pokemon2_to_pokemonstruct_index_808DF2C(s32 a1, PokemonStruct2* a2)
{
xxx_pokemon2_to_pokemonstruct_808DF44(&a1[gRecruitedPokemonRef->pokemon], a2);
}
void xxx_pokemon2_to_pokemonstruct_808DF44(PokemonStruct1* pokemon, PokemonStruct2* a2)
{ {
s32 i; s32 i;
pokemon->flags = a2->flags; dst->flags = src->flags;
pokemon->level = a2->level; dst->level = src->level;
pokemon->IQ = a2->IQ; dst->IQ = src->IQ;
pokemon->IQSkills = a2->IQSkills; dst->IQSkills = src->IQSkills;
pokemon->dungeonLocation = a2->dungeonLocation; GenerateHiddenPower(&dst->hiddenPower);
pokemon->isTeamLeader = a2->isTeamLeader; dst->dungeonLocation = src->dungeonLocation;
pokemon->speciesNum = a2->speciesNum; dst->isTeamLeader = src->isTeamLeader;
pokemon->tacticIndex = a2->tacticIndex; dst->recruitedPokemonId = recruitedPokemonId;
pokemon->pokeHP = a2->unk12; dst->speciesNum = src->speciesNum;
dst->tacticIndex = src->tacticIndex;
dst->unk12 = src->pokeHP;
dst->unk10 = src->pokeHP;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
pokemon->offense.att[i] = a2->offense.att[i]; dst->offense.att[i] = src->offense.att[i];
pokemon->offense.def[i] = a2->offense.def[i]; dst->offense.def[i] = src->offense.def[i];
} }
pokemon->currExp = a2->currExp; dst->currExp = src->currExp;
CopyBareMoveData(pokemon->moves, a2->moves.moves); CopyAndResetMoves(&dst->moves, src->moves);
for (i = 0; i < POKEMON_NAME_LENGTH; i++) { for (i = 0; i < POKEMON_NAME_LENGTH; i++) {
pokemon->name[i] = a2->name[i]; dst->name[i] = src->name[i];
} }
if (a2->itemSlot.flags & ITEM_FLAG_EXISTS) { if (BulkItemExists(&src->heldItem)) {
SlotToHeldItem(&pokemon->heldItem, &a2->itemSlot); HeldItemToSlot(&dst->itemSlot, &src->heldItem);
} }
else { else {
pokemon->heldItem.id = ITEM_NOTHING; ZeroOutItem(&dst->itemSlot);
}
dst->belly = IntToFixedPoint(100);
dst->maxBelly = IntToFixedPoint(100);
}
void DungeonMonToRecruitedPokemon(s32 id, DungeonMon* src)
{
DungeonMonToPokemon(&gRecruitedPokemonRef->pokemon[id], src);
}
void DungeonMonToPokemon(Pokemon* dst, DungeonMon* src)
{
s32 i;
dst->flags = src->flags;
dst->level = src->level;
dst->IQ = src->IQ;
dst->IQSkills = src->IQSkills;
dst->dungeonLocation = src->dungeonLocation;
dst->isTeamLeader = src->isTeamLeader;
dst->speciesNum = src->speciesNum;
dst->tacticIndex = src->tacticIndex;
dst->pokeHP = src->unk12;
for (i = 0; i < 2; i++) {
dst->offense.att[i] = src->offense.att[i];
dst->offense.def[i] = src->offense.def[i];
}
dst->currExp = src->currExp;
CopyBareMoveData(dst->moves, src->moves.moves);
for (i = 0; i < POKEMON_NAME_LENGTH; i++) {
dst->name[i] = src->name[i];
}
if (src->itemSlot.flags & ITEM_FLAG_EXISTS) {
SlotToHeldItem(&dst->heldItem, &src->itemSlot);
}
else {
dst->heldItem.id = ITEM_NOTHING;
} }
} }
void sub_808DFDC(s32 a1, PokemonStruct2* a2) void sub_808DFDC(s32 a1, DungeonMon* a2)
{ {
// transfer item from unk to pokemon at index // transfer item from unk to pokemon at index
PokemonStruct1* pokemon = &gRecruitedPokemonRef->pokemon[a1]; Pokemon* pokemon = &gRecruitedPokemonRef->pokemon[a1];
if (a2->itemSlot.flags & ITEM_FLAG_EXISTS) { if (a2->itemSlot.flags & ITEM_FLAG_EXISTS) {
SlotToHeldItem(&pokemon->heldItem, &a2->itemSlot); SlotToHeldItem(&pokemon->heldItem, &a2->itemSlot);
} }
@ -1142,7 +1134,7 @@ bool8 CanMonLearnMove(u16 moveID, s16 _species)
} }
s32 sub_808E218(unkStruct_808E218_arg* a1, PokemonStruct1* pokemon) s32 sub_808E218(unkStruct_808E218_arg* a1, Pokemon* pokemon)
{ {
s32 i; s32 i;
s32 count; s32 count;
@ -1201,7 +1193,7 @@ s32 sub_808E218(unkStruct_808E218_arg* a1, PokemonStruct1* pokemon)
return count; return count;
} }
s32 GetEvolutionSequence(PokemonStruct1* pokemon, struct EvolveStage* a2) s32 GetEvolutionSequence(Pokemon* pokemon, struct EvolveStage* a2)
{ {
s32 count; s32 count;
s32 species; s32 species;

View File

@ -64,7 +64,7 @@ bool8 HasRecruitedMon(s16 species)
{ {
s32 species_s32 = species; s32 species_s32 = species;
s32 i = 0; s32 i = 0;
PokemonStruct1 *pokemon = gRecruitedPokemonRef->pokemon; Pokemon *pokemon = gRecruitedPokemonRef->pokemon;
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
if (((u8)pokemon->flags & 1)) { if (((u8)pokemon->flags & 1)) {
@ -268,7 +268,7 @@ s32 ExtractLevel(SpawnPokemonData *data)
return (data->bits >> PACKED_BITS_LEVEL_SHIFT) & PACKED_BITS_LEVEL; return (data->bits >> PACKED_BITS_LEVEL_SHIFT) & PACKED_BITS_LEVEL;
} }
UNUSED static void GetMonOffenseStats(PokemonStruct1 *mon, struct UnusedOffenseStruct *dst) UNUSED static void GetMonOffenseStats(Pokemon *mon, struct UnusedOffenseStruct *dst)
{ {
dst->att[0] = mon->offense.att[0]; dst->att[0] = mon->offense.att[0];
dst->att[1] = mon->offense.att[1]; dst->att[1] = mon->offense.att[1];
@ -543,7 +543,7 @@ s32 SaveRecruitedPokemon(u8 *a1, s32 a2)
count = 0; count = 0;
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
PokemonStruct1 *pokemon = &gRecruitedPokemonRef->pokemon[i]; Pokemon *pokemon = &gRecruitedPokemonRef->pokemon[i];
if (PokemonExists(pokemon)) { if (PokemonExists(pokemon)) {
if (pokemon->flags & POKEMON_FLAG_ON_TEAM) if (pokemon->flags & POKEMON_FLAG_ON_TEAM)
@ -622,7 +622,7 @@ s32 RestoreRecruitedPokemon(u8 *a1, s32 a2)
} }
// arm9.bin::0205C9D4 // arm9.bin::0205C9D4
void WritePoke1Bits(DataSerializer* a1, PokemonStruct1* pokemon) void WritePoke1Bits(DataSerializer* a1, Pokemon* pokemon)
{ {
WriteBits(a1, &pokemon->level, 7); WriteBits(a1, &pokemon->level, 7);
WriteBits(a1, &pokemon->speciesNum, 9); WriteBits(a1, &pokemon->speciesNum, 9);
@ -644,9 +644,9 @@ void WritePoke1Bits(DataSerializer* a1, PokemonStruct1* pokemon)
} }
// arm9.bin::0205C890 // arm9.bin::0205C890
void ReadPoke1Bits(DataSerializer* a1, PokemonStruct1* pokemon) void ReadPoke1Bits(DataSerializer* a1, Pokemon* pokemon)
{ {
memset(pokemon, 0, sizeof(PokemonStruct1)); memset(pokemon, 0, sizeof(Pokemon));
pokemon->flags = POKEMON_FLAG_NONE; pokemon->flags = POKEMON_FLAG_NONE;
pokemon->isTeamLeader = FALSE; pokemon->isTeamLeader = FALSE;
@ -686,7 +686,7 @@ s32 SavePoke2s(u8* buffer, s32 size)
data_u8_zero = 0; data_u8_zero = 0;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
PokemonStruct2* pokemon2 = &gRecruitedPokemonRef->pokemon2[i]; DungeonMon* pokemon2 = &gRecruitedPokemonRef->dungeonTeam[i];
WriteBits(&backup, &pokemon2->flags, 2); WriteBits(&backup, &pokemon2->flags, 2);
WriteBits(&backup, pokemon2->isTeamLeader ? &data_u8_neg1 : &data_u8_zero, 1); WriteBits(&backup, pokemon2->isTeamLeader ? &data_u8_neg1 : &data_u8_zero, 1);
@ -694,7 +694,7 @@ s32 SavePoke2s(u8* buffer, s32 size)
WriteDungeonLocationBits(&backup, &pokemon2->dungeonLocation); WriteDungeonLocationBits(&backup, &pokemon2->dungeonLocation);
WriteBits(&backup, &pokemon2->IQ, 10); WriteBits(&backup, &pokemon2->IQ, 10);
WriteBits(&backup, &pokemon2->unkA, 16); WriteBits(&backup, &pokemon2->recruitedPokemonId, 16);
WriteBits(&backup, &pokemon2->unkC, 16); WriteBits(&backup, &pokemon2->unkC, 16);
WriteBits(&backup, &pokemon2->speciesNum, 9); WriteBits(&backup, &pokemon2->speciesNum, 9);
WriteBits(&backup, &pokemon2->unk10, 10); WriteBits(&backup, &pokemon2->unk10, 10);
@ -727,10 +727,10 @@ s32 RestorePoke2s(u8* a1, s32 size)
InitBitReader(&backup, a1, size); InitBitReader(&backup, a1, size);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
PokemonStruct2* pokemon2 = &gRecruitedPokemonRef->pokemon2[i]; DungeonMon* pokemon2 = &gRecruitedPokemonRef->dungeonTeam[i];
u8 unk2; u8 unk2;
memset(pokemon2, 0, sizeof(PokemonStruct2)); memset(pokemon2, 0, sizeof(DungeonMon));
ReadBits(&backup, &pokemon2->flags, 2); ReadBits(&backup, &pokemon2->flags, 2);
@ -745,7 +745,7 @@ s32 RestorePoke2s(u8* a1, s32 size)
ReadDungeonLocationBits(&backup, &pokemon2->dungeonLocation); ReadDungeonLocationBits(&backup, &pokemon2->dungeonLocation);
ReadBits(&backup, &pokemon2->IQ, 10); ReadBits(&backup, &pokemon2->IQ, 10);
ReadBits(&backup, &pokemon2->unkA, 16); ReadBits(&backup, &pokemon2->recruitedPokemonId, 16);
ReadBits(&backup, &pokemon2->unkC, 16); ReadBits(&backup, &pokemon2->unkC, 16);
ReadBits(&backup, &pokemon2->speciesNum, 9); ReadBits(&backup, &pokemon2->speciesNum, 9);
ReadBits(&backup, &pokemon2->unk10, 10); ReadBits(&backup, &pokemon2->unk10, 10);

View File

@ -9,7 +9,7 @@
#include "constants/evolve_type.h" #include "constants/evolve_type.h"
#include "constants/evolution_status.h" #include "constants/evolution_status.h"
void SetMonEvolveStatus(PokemonStruct1 *pokemon, EvolveStatus *evolveStatus, bool8 param_3) void SetMonEvolveStatus(Pokemon *pokemon, EvolveStatus *evolveStatus, bool8 param_3)
{ {
struct FriendAreaCapacity friendAreaCapacity; struct FriendAreaCapacity friendAreaCapacity;
struct unkEvolve evolveConditions; struct unkEvolve evolveConditions;
@ -170,7 +170,7 @@ void SetMonEvolveStatus(PokemonStruct1 *pokemon, EvolveStatus *evolveStatus, boo
} }
} }
s32 GetMonSummaryScreenEvoStringId(PokemonStruct1 *pokemon) s32 GetMonSummaryScreenEvoStringId(Pokemon *pokemon)
{ {
EvolveStatus evolveStatus; EvolveStatus evolveStatus;
@ -186,11 +186,11 @@ s32 GetMonSummaryScreenEvoStringId(PokemonStruct1 *pokemon)
} }
} }
PokemonStruct1 *sub_808F734(PokemonStruct1 *pokemon, s16 _species) Pokemon *sub_808F734(Pokemon *pokemon, s16 _species)
{ {
PokemonStruct1 *uVar1; Pokemon *uVar1;
PokemonStruct1 *iVar3; Pokemon *iVar3;
PokemonStruct1 pokeStruct; Pokemon pokeStruct;
s32 species = _species; s32 species = _species;
iVar3 = NULL; iVar3 = NULL;
@ -208,11 +208,11 @@ PokemonStruct1 *sub_808F734(PokemonStruct1 *pokemon, s16 _species)
return uVar1; return uVar1;
} }
PokemonStruct1 *sub_808F798(PokemonStruct1 *pokemon, s16 _species) Pokemon *sub_808F798(Pokemon *pokemon, s16 _species)
{ {
s32 r6; s32 r6;
s32 i; s32 i;
PokemonStruct1 pokeStruct; Pokemon pokeStruct;
LevelData levelData; LevelData levelData;
u8 buffer [64]; u8 buffer [64];
s32 species = _species; s32 species = _species;
@ -248,7 +248,7 @@ PokemonStruct1 *sub_808F798(PokemonStruct1 *pokemon, s16 _species)
return sub_808D1DC(&pokeStruct); return sub_808D1DC(&pokeStruct);
} }
UNUSED static void sub_808F83C(PokemonStruct1 *pokemon, s16 species, u8 *r2) UNUSED static void sub_808F83C(Pokemon *pokemon, s16 species, u8 *r2)
{ {
*r2 = 0; *r2 = 0;
} }

View File

@ -406,7 +406,7 @@ bool8 sub_803C0DC(s16 species)
bool8 sub_803C110(s16 index) bool8 sub_803C110(s16 index)
{ {
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
const s16 *psVar5; const s16 *psVar5;
const s16 *psVar6; const s16 *psVar6;
s32 species_s32; s32 species_s32;

View File

@ -234,7 +234,7 @@ void ShowPokemonSummaryWindow(s32 which, s32 currSubWindowId, struct MonSummaryI
sub_80073E0(windowId); sub_80073E0(windowId);
} }
void SetMonSummaryInfo(struct MonSummaryInfo *dst, struct PokemonStruct1 *pokemon, bool8 param_3) void SetMonSummaryInfo(struct MonSummaryInfo *dst, struct Pokemon *pokemon, bool8 param_3)
{ {
s32 index; s32 index;

View File

@ -92,7 +92,7 @@ extern void sub_80521D0(void);
extern void sub_803F27C(u8); extern void sub_803F27C(u8);
extern void sub_807E7FC(u8); extern void sub_807E7FC(u8);
extern bool8 IsLevelResetTo1(u8 dungeon); extern bool8 IsLevelResetTo1(u8 dungeon);
extern void sub_8068A84(PokemonStruct1 *pokemon); extern void sub_8068A84(Pokemon *pokemon);
extern void sub_807EAA0(u32, u32); extern void sub_807EAA0(u32, u32);
extern void SetFloorItemMonsterSpawns(void); extern void SetFloorItemMonsterSpawns(void);
extern void sub_80842F0(void); extern void sub_80842F0(void);
@ -857,7 +857,7 @@ static void sub_8043FD0(void)
for (level = 2; level <= 5; level++) { for (level = 2; level <= 5; level++) {
s32 i, monId, movesCount; s32 i, monId, movesCount;
for (monId = 0; monId < NUM_MONSTERS; monId++) { for (monId = 0; monId < NUM_MONSTERS; monId++) {
PokemonStruct1 *monStruct = &gRecruitedPokemonRef->pokemon[monId]; Pokemon *monStruct = &gRecruitedPokemonRef->pokemon[monId];
if (PokemonExists(monStruct) && PokemonFlag2(monStruct)) { if (PokemonExists(monStruct) && PokemonFlag2(monStruct)) {
u16 learnedMoves[16]; u16 learnedMoves[16];
LevelData levelData; LevelData levelData;
@ -924,7 +924,7 @@ void EnforceMaxItemsAndMoney(void)
ZeroOutItem(&gTeamInventoryRef->teamItems[i]); ZeroOutItem(&gTeamInventoryRef->teamItems[i]);
} }
for (i = 0; i < NUM_MONSTERS; i++) { for (i = 0; i < NUM_MONSTERS; i++) {
PokemonStruct1 *mon = (&gRecruitedPokemonRef->pokemon[i]); Pokemon *mon = (&gRecruitedPokemonRef->pokemon[i]);
if (PokemonExists(mon) && PokemonFlag2(mon)) { if (PokemonExists(mon) && PokemonFlag2(mon)) {
mon->heldItem.id = 0; mon->heldItem.id = 0;
} }

View File

@ -12,6 +12,7 @@
#include "dungeon_ai_attack.h" #include "dungeon_ai_attack.h"
#include "dungeon_random.h" #include "dungeon_random.h"
#include "dungeon_logic.h" #include "dungeon_logic.h"
#include "moves.h"
extern const char *gPtrFrozenMessage[]; extern const char *gPtrFrozenMessage[];
extern const char *gPtrWrappedAroundMessage[]; extern const char *gPtrWrappedAroundMessage[];
@ -172,7 +173,7 @@ bool8 sub_80701A4(Entity *pokemon)
SetMonsterActionFields(&pokemonInfo->action, ACTION_USE_MOVE_PLAYER); SetMonsterActionFields(&pokemonInfo->action, ACTION_USE_MOVE_PLAYER);
index_1 = index; index_1 = index;
r7 = &pokemonInfo->action.actionParameters[1].actionUseIndex; r7 = &pokemonInfo->action.actionParameters[1].actionUseIndex;
if((index > 0) && (move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)) if((index > 0) && MOVE_FLAG_LINK_CHAIN(move))
{ {
do { do {
move2 = &pokemonInfo->moves.moves[index_1 + 1]; move2 = &pokemonInfo->moves.moves[index_1 + 1];

View File

@ -683,7 +683,7 @@ const u8 *FormatString(const u8 *str, u8 *dst, u8 *dstMax, u16 flags)
case 'm': case 'm':
str++; str++;
if (*str == 'm') { if (*str == 'm') {
PokemonStruct1 *monStruct = sub_808D3BC(); Pokemon *monStruct = sub_808D3BC();
txtPtr = sFormatBuffer_UnknownMonster; txtPtr = sFormatBuffer_UnknownMonster;
PrintColoredPokeNameToBuffer(sFormatBuffer_UnknownMonster, monStruct, 0); PrintColoredPokeNameToBuffer(sFormatBuffer_UnknownMonster, monStruct, 0);
} }

View File

@ -65,7 +65,7 @@ u32 DrawCharOnWindowInternal(Window *windows, s32 x, s32 y, u32 chr, u32 color,
sp8 = sp0->unk0 - 3; sp8 = sp0->unk0 - 3;
if (gDrawTextShadow != 0) { if (gDrawTextShadow != 0) {
var_2C = (sp0->unkA >> 1) & 1; var_2C = (sp0->unkA & 2) != 0;
} }
else { else {
var_2C = 0; var_2C = 0;

View File

@ -1238,8 +1238,8 @@ void UpdateThankYouMailText(void)
u8 buffer1 [80]; u8 buffer1 [80];
u8 buffer2 [80]; u8 buffer2 [80];
u8 mailIndex; u8 mailIndex;
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
PokemonStruct1 *pokeStruct2; Pokemon *pokeStruct2;
s32 linkStatus; s32 linkStatus;
unkStruct_203B480 *mail; unkStruct_203B480 *mail;

View File

@ -136,7 +136,7 @@ static void sub_8021A60(void)
s32 areaIndex; s32 areaIndex;
s32 iVar6; s32 iVar6;
s32 index; s32 index;
PokemonStruct1 *pokeStruct; Pokemon *pokeStruct;
sWigglytuffShop2Work->numPokemoninFriendArea = 0; sWigglytuffShop2Work->numPokemoninFriendArea = 0;

View File

@ -276,7 +276,7 @@ static void sub_801059C(void)
u8 filename[0xC]; u8 filename[0xC];
s32 i, size; s32 i, size;
PokemonStruct1 *pokeStruct = GetPlayerPokemonStruct(); Pokemon *pokeStruct = GetPlayerPokemonStruct();
OpenedFile *file = OpenFileAndGetFileDataPtr(gUnknown_80D4014[0], &gTitleMenuFileArchive); OpenedFile *file = OpenFileAndGetFileDataPtr(gUnknown_80D4014[0], &gTitleMenuFileArchive);
OpenedFile *file2 = OpenFileAndGetFileDataPtr(gUnknown_80D4014[1], &gTitleMenuFileArchive); OpenedFile *file2 = OpenFileAndGetFileDataPtr(gUnknown_80D4014[1], &gTitleMenuFileArchive);