2017-09-02 23:28:44 +02:00
# ifndef GUARD_POKEMON_H
# define GUARD_POKEMON_H
2018-02-11 17:35:01 +01:00
# include "sprite.h"
2023-03-23 10:02:32 +01:00
# include "constants/items.h"
2020-10-15 11:18:35 +02:00
# include "constants/region_map_sections.h"
2020-11-25 04:53:53 +01:00
# include "constants/map_groups.h"
2018-02-11 17:35:01 +01:00
2020-12-25 01:46:39 +01:00
# define GET_BASE_SPECIES_ID(speciesId) (GetFormSpeciesId(speciesId, 0))
2021-12-03 23:32:31 +01:00
# define FORM_SPECIES_END (0xffff)
2020-12-25 01:46:39 +01:00
2022-08-15 23:36:55 +02:00
// Property labels for Get(Box)MonData / Set(Box)MonData
2022-08-09 00:40:47 +02:00
enum {
MON_DATA_PERSONALITY ,
MON_DATA_OT_ID ,
MON_DATA_NICKNAME ,
MON_DATA_LANGUAGE ,
MON_DATA_SANITY_IS_BAD_EGG ,
MON_DATA_SANITY_HAS_SPECIES ,
MON_DATA_SANITY_IS_EGG ,
MON_DATA_OT_NAME ,
MON_DATA_MARKINGS ,
MON_DATA_CHECKSUM ,
MON_DATA_ENCRYPT_SEPARATOR ,
MON_DATA_SPECIES ,
MON_DATA_HELD_ITEM ,
MON_DATA_MOVE1 ,
MON_DATA_MOVE2 ,
MON_DATA_MOVE3 ,
MON_DATA_MOVE4 ,
MON_DATA_PP1 ,
MON_DATA_PP2 ,
MON_DATA_PP3 ,
MON_DATA_PP4 ,
MON_DATA_PP_BONUSES ,
MON_DATA_COOL ,
MON_DATA_BEAUTY ,
MON_DATA_CUTE ,
MON_DATA_EXP ,
MON_DATA_HP_EV ,
MON_DATA_ATK_EV ,
MON_DATA_DEF_EV ,
MON_DATA_SPEED_EV ,
MON_DATA_SPATK_EV ,
MON_DATA_SPDEF_EV ,
MON_DATA_FRIENDSHIP ,
MON_DATA_SMART ,
MON_DATA_POKERUS ,
MON_DATA_MET_LOCATION ,
MON_DATA_MET_LEVEL ,
MON_DATA_MET_GAME ,
MON_DATA_POKEBALL ,
MON_DATA_HP_IV ,
MON_DATA_ATK_IV ,
MON_DATA_DEF_IV ,
MON_DATA_SPEED_IV ,
MON_DATA_SPATK_IV ,
MON_DATA_SPDEF_IV ,
MON_DATA_IS_EGG ,
MON_DATA_ABILITY_NUM ,
MON_DATA_TOUGH ,
MON_DATA_SHEEN ,
MON_DATA_OT_GENDER ,
MON_DATA_COOL_RIBBON ,
MON_DATA_BEAUTY_RIBBON ,
MON_DATA_CUTE_RIBBON ,
MON_DATA_SMART_RIBBON ,
MON_DATA_TOUGH_RIBBON ,
MON_DATA_STATUS ,
MON_DATA_LEVEL ,
MON_DATA_HP ,
MON_DATA_MAX_HP ,
MON_DATA_ATK ,
MON_DATA_DEF ,
MON_DATA_SPEED ,
MON_DATA_SPATK ,
MON_DATA_SPDEF ,
MON_DATA_MAIL ,
2023-02-24 11:53:02 +01:00
MON_DATA_SPECIES_OR_EGG ,
2022-08-09 00:40:47 +02:00
MON_DATA_IVS ,
MON_DATA_CHAMPION_RIBBON ,
MON_DATA_WINNING_RIBBON ,
MON_DATA_VICTORY_RIBBON ,
MON_DATA_ARTIST_RIBBON ,
MON_DATA_EFFORT_RIBBON ,
MON_DATA_MARINE_RIBBON ,
MON_DATA_LAND_RIBBON ,
MON_DATA_SKY_RIBBON ,
MON_DATA_COUNTRY_RIBBON ,
MON_DATA_NATIONAL_RIBBON ,
MON_DATA_EARTH_RIBBON ,
MON_DATA_WORLD_RIBBON ,
MON_DATA_UNUSED_RIBBONS ,
2023-02-15 17:56:11 +01:00
MON_DATA_MODERN_FATEFUL_ENCOUNTER ,
2022-08-09 00:40:47 +02:00
MON_DATA_KNOWN_MOVES ,
MON_DATA_RIBBON_COUNT ,
MON_DATA_RIBBONS ,
MON_DATA_ATK2 ,
MON_DATA_DEF2 ,
MON_DATA_SPEED2 ,
MON_DATA_SPATK2 ,
MON_DATA_SPDEF2 ,
} ;
2017-02-04 03:34:56 +01:00
struct PokemonSubstruct0
{
2020-07-16 09:10:21 +02:00
/*0x00*/ u16 species ;
/*0x02*/ u16 heldItem ;
/*0x04*/ u32 experience ;
/*0x08*/ u8 ppBonuses ;
/*0x09*/ u8 friendship ;
2021-01-30 02:08:34 +01:00
/*0x0A*/ u16 pokeball : 5 ; //31 balls
u16 filler : 11 ;
2020-07-16 09:10:21 +02:00
} ; /* size = 12 */
2017-02-04 03:34:56 +01:00
struct PokemonSubstruct1
{
2020-07-16 09:10:21 +02:00
/*0x00*/ u16 moves [ MAX_MON_MOVES ] ;
/*0x08*/ u8 pp [ MAX_MON_MOVES ] ;
} ; /* size = 12 */
2017-02-04 03:34:56 +01:00
struct PokemonSubstruct2
{
2020-07-16 09:10:21 +02:00
/*0x00*/ u8 hpEV ;
/*0x01*/ u8 attackEV ;
/*0x02*/ u8 defenseEV ;
/*0x03*/ u8 speedEV ;
/*0x04*/ u8 spAttackEV ;
/*0x05*/ u8 spDefenseEV ;
/*0x06*/ u8 cool ;
/*0x07*/ u8 beauty ;
/*0x08*/ u8 cute ;
/*0x09*/ u8 smart ;
/*0x0A*/ u8 tough ;
/*0x0B*/ u8 sheen ;
} ; /* size = 12 */
2017-02-04 03:34:56 +01:00
struct PokemonSubstruct3
{
/* 0x00 */ u8 pokerus ;
/* 0x01 */ u8 metLocation ;
/* 0x02 */ u16 metLevel : 7 ;
/* 0x02 */ u16 metGame : 4 ;
2022-08-27 09:05:06 +02:00
/* 0x03 */ u16 unused1 : 4 ;
2017-02-04 03:34:56 +01:00
/* 0x03 */ u16 otGender : 1 ;
/* 0x04 */ u32 hpIV : 5 ;
/* 0x04 */ u32 attackIV : 5 ;
/* 0x05 */ u32 defenseIV : 5 ;
/* 0x05 */ u32 speedIV : 5 ;
/* 0x05 */ u32 spAttackIV : 5 ;
/* 0x06 */ u32 spDefenseIV : 5 ;
/* 0x07 */ u32 isEgg : 1 ;
2022-08-27 09:05:06 +02:00
/* 0x07 */ u32 unused2 : 1 ;
2017-02-04 03:34:56 +01:00
2023-02-12 03:16:24 +01:00
/* 0x08 */ u32 coolRibbon : 3 ; // Stores the highest contest rank achieved in the Cool category.
/* 0x08 */ u32 beautyRibbon : 3 ; // Stores the highest contest rank achieved in the Beauty category.
/* 0x08 */ u32 cuteRibbon : 3 ; // Stores the highest contest rank achieved in the Cute category.
/* 0x09 */ u32 smartRibbon : 3 ; // Stores the highest contest rank achieved in the Smart category.
/* 0x09 */ u32 toughRibbon : 3 ; // Stores the highest contest rank achieved in the Tough category.
2023-02-15 18:06:42 +01:00
/* 0x09 */ u32 championRibbon : 1 ; // Given when defeating the Champion. Because both RSE and FRLG use it, later generations don't specify from which region it comes from.
2023-02-12 03:16:24 +01:00
/* 0x0A */ u32 winningRibbon : 1 ; // Given at the Battle Tower's Level 50 challenge by winning a set of seven battles that extends the current streak to 56 or more.
/* 0x0A */ u32 victoryRibbon : 1 ; // Given at the Battle Tower's Level 100 challenge by winning a set of seven battles that extends the current streak to 56 or more.
/* 0x0A */ u32 artistRibbon : 1 ; // Given at the Contest Hall by winning a Master Rank contest with at least 800 points, and agreeing to have the Pokémon's portrait placed in the museum after being offered.
/* 0x0A */ u32 effortRibbon : 1 ; // Given at Slateport's market to Pokémon with maximum EVs.
2023-02-12 02:36:42 +01:00
/* 0x0A */ u32 marineRibbon : 1 ; // Never distributed.
/* 0x0A */ u32 landRibbon : 1 ; // Never distributed.
/* 0x0A */ u32 skyRibbon : 1 ; // Never distributed.
/* 0x0A */ u32 countryRibbon : 1 ; // Distributed during Pokémon Festa '04 and '05 to tournament winners.
2023-02-12 03:16:24 +01:00
/* 0x0B */ u32 nationalRibbon : 1 ; // Given to purified Shadow Pokémon in Colosseum/XD.
/* 0x0B */ u32 earthRibbon : 1 ; // Given to teams that have beaten Mt. Battle's 100-battle challenge in Colosseum/XD.
2023-02-12 02:36:42 +01:00
/* 0x0B */ u32 worldRibbon : 1 ; // Distributed during Pokémon Festa '04 and '05 to tournament winners.
2023-03-03 15:00:50 +01:00
/* 0x0B */ u32 unusedRibbons : 2 ; // Discarded in Gen 4.
2019-08-25 13:08:58 +02:00
/* 0x0B */ u32 abilityNum : 2 ;
2023-02-12 02:36:42 +01:00
// The functionality of this bit changed in FRLG:
// In RS, this bit does nothing, is never set, & is accidentally unset when hatching Eggs.
// In FRLG & Emerald, this controls Mew & Deoxys obedience and whether they can be traded.
// If set, a Pokémon is a fateful encounter in FRLG's summary screen if hatched & for all Pokémon in Gen 4+ summary screens.
// Set for in-game event island legendaries, events distributed after a certain date, & Pokémon from XD: Gale of Darkness.
// Not to be confused with METLOC_FATEFUL_ENCOUNTER.
/* 0x0B */ u32 modernFatefulEncounter : 1 ;
2017-02-04 03:34:56 +01:00
} ;
2021-10-11 16:35:53 +02:00
// Number of bytes in the largest Pokémon substruct.
// They are assumed to be the same size, and will be padded to
// the largest size by the union.
// By default they are all 12 bytes.
# define NUM_SUBSTRUCT_BYTES (max(sizeof(struct PokemonSubstruct0), \
max ( sizeof ( struct PokemonSubstruct1 ) , \
max ( sizeof ( struct PokemonSubstruct2 ) , \
sizeof ( struct PokemonSubstruct3 ) ) ) ) )
2017-02-04 03:34:56 +01:00
union PokemonSubstruct
{
struct PokemonSubstruct0 type0 ;
struct PokemonSubstruct1 type1 ;
struct PokemonSubstruct2 type2 ;
struct PokemonSubstruct3 type3 ;
2021-10-11 16:35:53 +02:00
u16 raw [ NUM_SUBSTRUCT_BYTES / 2 ] ; // /2 because it's u16, not u8
2017-02-04 03:34:56 +01:00
} ;
struct BoxPokemon
{
u32 personality ;
u32 otId ;
u8 nickname [ POKEMON_NAME_LENGTH ] ;
u8 language ;
u8 isBadEgg : 1 ;
u8 hasSpecies : 1 ;
u8 isEgg : 1 ;
u8 unused : 5 ;
2018-09-01 22:03:21 +02:00
u8 otName [ PLAYER_NAME_LENGTH ] ;
2017-02-04 03:34:56 +01:00
u8 markings ;
u16 checksum ;
u16 unknown ;
union
{
2021-10-11 16:35:53 +02:00
u32 raw [ ( NUM_SUBSTRUCT_BYTES * 4 ) / 4 ] ; // *4 because there are 4 substructs, /4 because it's u32, not u8
2017-02-04 03:34:56 +01:00
union PokemonSubstruct substructs [ 4 ] ;
} secure ;
} ;
struct Pokemon
{
struct BoxPokemon box ;
u32 status ;
u8 level ;
2017-09-11 18:27:54 +02:00
u8 mail ;
2017-02-04 03:34:56 +01:00
u16 hp ;
u16 maxHP ;
u16 attack ;
u16 defense ;
u16 speed ;
u16 spAttack ;
u16 spDefense ;
} ;
2021-10-03 05:47:59 +02:00
struct MonSpritesGfxManager
2018-02-11 17:35:01 +01:00
{
2021-10-03 05:47:59 +02:00
u32 numSprites : 4 ;
u32 numSprites2 : 4 ; // Never read
u32 numFrames : 8 ;
u32 active : 8 ;
u32 dataSize : 4 ;
u32 mode : 4 ; // MON_SPR_GFX_MODE_*
void * spriteBuffer ;
u8 * * spritePointers ;
2018-02-11 17:35:01 +01:00
struct SpriteTemplate * templates ;
struct SpriteFrameImage * frameImages ;
} ;
2021-10-03 05:47:59 +02:00
enum {
MON_SPR_GFX_MODE_NORMAL ,
MON_SPR_GFX_MODE_BATTLE ,
MON_SPR_GFX_MODE_FULL_PARTY ,
} ;
enum {
MON_SPR_GFX_MANAGER_A ,
MON_SPR_GFX_MANAGER_B , // Nothing ever sets up this manager.
MON_SPR_GFX_MANAGERS_COUNT
} ;
2017-09-04 21:43:13 +02:00
struct BattlePokemon
{
/*0x00*/ u16 species ;
/*0x02*/ u16 attack ;
/*0x04*/ u16 defense ;
/*0x06*/ u16 speed ;
/*0x08*/ u16 spAttack ;
/*0x0A*/ u16 spDefense ;
2019-09-08 17:53:48 +02:00
/*0x0C*/ u16 moves [ MAX_MON_MOVES ] ;
2017-09-04 21:43:13 +02:00
/*0x14*/ u32 hpIV : 5 ;
/*0x14*/ u32 attackIV : 5 ;
/*0x15*/ u32 defenseIV : 5 ;
/*0x15*/ u32 speedIV : 5 ;
/*0x16*/ u32 spAttackIV : 5 ;
/*0x17*/ u32 spDefenseIV : 5 ;
2019-08-21 11:56:49 +02:00
/*0x17*/ u32 abilityNum : 2 ;
2018-11-18 20:00:36 +01:00
/*0x18*/ s8 statStages [ NUM_BATTLE_STATS ] ;
2020-05-18 23:54:12 +02:00
/*0x20*/ u16 ability ;
/*0x22*/ u8 type1 ;
/*0x23*/ u8 type2 ;
/*0x24*/ u8 type3 ;
/*0x25*/ u8 pp [ MAX_MON_MOVES ] ;
/*0x29*/ u16 hp ;
/*0x2B*/ u8 level ;
/*0x2C*/ u8 friendship ;
/*0x2D*/ u16 maxHP ;
/*0x2F*/ u16 item ;
/*0x31*/ u8 nickname [ POKEMON_NAME_LENGTH + 1 ] ;
/*0x3C*/ u8 ppBonuses ;
/*0x3D*/ u8 otName [ PLAYER_NAME_LENGTH + 1 ] ;
/*0x45*/ u32 experience ;
/*0x49*/ u32 personality ;
/*0x4D*/ u32 status1 ;
/*0x51*/ u32 status2 ;
/*0x55*/ u32 otId ;
2023-01-11 08:15:57 +01:00
/*0x59*/ u8 metLevel ;
2017-09-04 21:43:13 +02:00
} ;
2023-02-08 22:08:12 +01:00
struct SpeciesInfo /*0x24*/
2017-02-04 03:34:56 +01:00
{
/* 0x00 */ u8 baseHP ;
/* 0x01 */ u8 baseAttack ;
/* 0x02 */ u8 baseDefense ;
/* 0x03 */ u8 baseSpeed ;
/* 0x04 */ u8 baseSpAttack ;
/* 0x05 */ u8 baseSpDefense ;
2023-01-04 12:14:34 +01:00
/* 0x06 */ u8 types [ 2 ] ;
2017-02-04 03:34:56 +01:00
/* 0x08 */ u8 catchRate ;
2023-02-08 22:08:12 +01:00
/* 0x09 padding */
/* 0x0A */ u16 expYield ; // expYield was changed from u8 to u16 for the new Exp System.
/* 0x0C */ u16 evYield_HP : 2 ;
u16 evYield_Attack : 2 ;
u16 evYield_Defense : 2 ;
u16 evYield_Speed : 2 ;
/* 0x0D */ u16 evYield_SpAttack : 2 ;
u16 evYield_SpDefense : 2 ;
/* 0x0E */ u16 itemCommon ;
/* 0x10 */ u16 itemRare ;
/* 0x12 */ u8 genderRatio ;
/* 0x13 */ u8 eggCycles ;
/* 0x14 */ u8 friendship ;
/* 0x15 */ u8 growthRate ;
/* 0x16 */ u8 eggGroups [ 2 ] ;
/* 0x18 */ u16 abilities [ NUM_ABILITY_SLOTS ] ; // 3 abilities, no longer u8 because we have over 255 abilities now.
/* 0x1E */ u8 safariZoneFleeRate ;
/* 0x1F */ u8 bodyColor : 7 ;
2017-09-06 17:19:08 +02:00
u8 noFlip : 1 ;
2023-02-08 22:08:12 +01:00
/* 0x20 */ u16 flags ;
2017-02-04 03:34:56 +01:00
} ;
struct BattleMove
{
2019-03-31 15:24:46 +02:00
u16 effect ;
2020-11-26 21:56:18 +01:00
u16 power ; //higher than 255 for z moves
2017-02-04 03:34:56 +01:00
u8 type ;
u8 accuracy ;
u8 pp ;
u8 secondaryEffectChance ;
2021-10-16 22:23:17 +02:00
u16 target ;
2017-10-04 19:25:14 +02:00
s8 priority ;
2018-07-14 22:56:03 +02:00
u32 flags ;
2018-07-14 10:11:38 +02:00
u8 split ;
2023-04-22 23:14:49 +02:00
u16 argument ;
2020-11-26 21:56:18 +01:00
u8 zMoveEffect ;
2017-02-04 03:34:56 +01:00
} ;
2022-04-02 23:09:51 +02:00
# define SPINDA_SPOT_WIDTH 16
# define SPINDA_SPOT_HEIGHT 16
2017-09-11 11:35:41 +02:00
struct SpindaSpot
{
u8 x , y ;
2022-04-02 23:09:51 +02:00
u16 image [ SPINDA_SPOT_HEIGHT ] ;
2017-09-11 11:35:41 +02:00
} ;
2018-09-22 13:52:38 +02:00
struct LevelUpMove
2017-09-06 17:19:08 +02:00
{
2018-09-22 13:52:38 +02:00
u16 move ;
u16 level ;
2017-09-06 17:19:08 +02:00
} ;
struct Evolution
{
u16 method ;
u16 param ;
u16 targetSpecies ;
} ;
2022-09-01 19:57:58 +02:00
struct FormChange
{
2021-01-27 23:26:18 +01:00
u16 method ;
u16 targetSpecies ;
u16 param1 ;
u16 param2 ;
2022-09-01 19:57:58 +02:00
u16 param3 ;
2021-01-27 23:26:18 +01:00
} ;
2021-03-02 21:25:15 +01:00
2021-01-19 10:03:16 +01:00
# define NUM_UNOWN_FORMS 28
2021-01-19 18:36:36 +01:00
# define GET_UNOWN_LETTER(personality) (( \
( ( ( personality ) & 0x03000000 ) > > 18 ) \
| ( ( ( personality ) & 0x00030000 ) > > 12 ) \
| ( ( ( personality ) & 0x00000300 ) > > 6 ) \
| ( ( ( personality ) & 0x00000003 ) > > 0 ) \
2021-01-19 10:03:16 +01:00
) % NUM_UNOWN_FORMS )
2022-09-11 19:35:58 +02:00
# define GET_SHINY_VALUE(otId, personality) (HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality))
2021-10-03 05:48:12 +02:00
2017-09-06 17:19:08 +02:00
extern u8 gPlayerPartyCount ;
extern struct Pokemon gPlayerParty [ PARTY_SIZE ] ;
extern u8 gEnemyPartyCount ;
extern struct Pokemon gEnemyParty [ PARTY_SIZE ] ;
2018-07-01 15:28:57 +02:00
extern struct SpriteTemplate gMultiuseSpriteTemplate ;
2018-02-11 23:46:50 +01:00
2018-02-26 13:24:46 +01:00
extern const struct BattleMove gBattleMoves [ ] ;
2018-02-12 00:11:10 +01:00
extern const u8 gFacilityClassToPicIndex [ ] ;
extern const u8 gFacilityClassToTrainerClass [ ] ;
2022-10-24 22:01:48 +02:00
extern const struct SpeciesInfo gSpeciesInfo [ ] ;
2023-03-23 10:02:32 +01:00
extern const u8 * const gItemEffectTable [ ITEMS_COUNT ] ;
2018-10-17 04:47:08 +02:00
extern const u32 gExperienceTables [ ] [ MAX_LEVEL + 1 ] ;
2018-09-22 13:52:38 +02:00
extern const struct LevelUpMove * const gLevelUpLearnsets [ ] ;
2022-08-26 20:48:06 +02:00
extern const u16 * const gTeachableLearnsets [ ] ;
2019-02-19 10:09:42 +01:00
extern const u8 gPPUpGetMask [ ] ;
2021-10-03 05:48:12 +02:00
extern const u8 gPPUpClearMask [ ] ;
extern const u8 gPPUpAddValues [ ] ;
2020-08-05 02:33:05 +02:00
extern const u8 gStatStageRatios [ MAX_STAT_STAGE + 1 ] [ 2 ] ;
2022-08-23 18:39:24 +02:00
extern const u16 gUnionRoomFacilityClasses [ ] ;
2021-01-23 05:22:37 +01:00
extern const struct SpriteTemplate gBattlerSpriteTemplates [ ] ;
2018-08-19 17:13:05 +02:00
extern const s8 gNatureStatTable [ ] [ 5 ] ;
2021-12-03 23:32:31 +01:00
extern const u16 * const gFormSpeciesIdTables [ NUM_SPECIES ] ;
2022-10-21 07:08:37 +02:00
extern const struct FormChange * const gFormChangeTablePointers [ NUM_SPECIES ] ;
2022-08-31 15:05:51 +02:00
extern const u32 sExpCandyExperienceTable [ ] ;
2017-09-11 18:27:54 +02:00
2017-09-06 17:19:08 +02:00
void ZeroBoxMonData ( struct BoxPokemon * boxMon ) ;
void ZeroMonData ( struct Pokemon * mon ) ;
void ZeroPlayerPartyMons ( void ) ;
void ZeroEnemyPartyMons ( void ) ;
void CreateMon ( struct Pokemon * mon , u16 species , u8 level , u8 fixedIV , u8 hasFixedPersonality , u32 fixedPersonality , u8 otIdType , u32 fixedOtId ) ;
void CreateBoxMon ( struct BoxPokemon * boxMon , u16 species , u8 level , u8 fixedIV , u8 hasFixedPersonality , u32 fixedPersonality , u8 otIdType , u32 fixedOtId ) ;
void CreateMonWithNature ( struct Pokemon * mon , u16 species , u8 level , u8 fixedIV , u8 nature ) ;
void CreateMonWithGenderNatureLetter ( struct Pokemon * mon , u16 species , u8 level , u8 fixedIV , u8 gender , u8 nature , u8 unownLetter ) ;
void CreateMaleMon ( struct Pokemon * mon , u16 species , u8 level ) ;
void CreateMonWithIVsPersonality ( struct Pokemon * mon , u16 species , u8 level , u32 ivs , u32 personality ) ;
void CreateMonWithIVsOTID ( struct Pokemon * mon , u16 species , u8 level , u8 * ivs , u32 otId ) ;
void CreateMonWithEVSpread ( struct Pokemon * mon , u16 species , u8 level , u8 fixedIV , u8 evSpread ) ;
2019-01-13 12:12:27 +01:00
void CreateBattleTowerMon ( struct Pokemon * mon , struct BattleTowerPokemon * src ) ;
2021-10-03 05:48:12 +02:00
void CreateBattleTowerMon_HandleLevel ( struct Pokemon * mon , struct BattleTowerPokemon * src , bool8 lvl50 ) ;
2018-10-13 20:38:46 +02:00
void CreateApprenticeMon ( struct Pokemon * mon , const struct Apprentice * src , u8 monId ) ;
2018-11-11 16:44:27 +01:00
void CreateMonWithEVSpreadNatureOTID ( struct Pokemon * mon , u16 species , u8 level , u8 nature , u8 fixedIV , u8 evSpread , u32 otId ) ;
2020-12-24 22:18:47 +01:00
void ConvertPokemonToBattleTowerPokemon ( struct Pokemon * mon , struct BattleTowerPokemon * dest ) ;
2021-01-23 05:22:37 +01:00
bool8 ShouldIgnoreDeoxysForm ( u8 caseId , u8 battlerId ) ;
2020-06-03 21:28:29 +02:00
u16 GetUnionRoomTrainerPic ( void ) ;
u16 GetUnionRoomTrainerClass ( void ) ;
2023-02-15 17:56:11 +01:00
void CreateEnemyEventMon ( void ) ;
2017-09-06 17:19:08 +02:00
void CalculateMonStats ( struct Pokemon * mon ) ;
2018-02-11 17:35:01 +01:00
void BoxMonToMon ( const struct BoxPokemon * src , struct Pokemon * dest ) ;
2017-09-06 17:19:08 +02:00
u8 GetLevelFromMonExp ( struct Pokemon * mon ) ;
u8 GetLevelFromBoxMonExp ( struct BoxPokemon * boxMon ) ;
u16 GiveMoveToMon ( struct Pokemon * mon , u16 move ) ;
u16 GiveMoveToBattleMon ( struct BattlePokemon * mon , u16 move ) ;
void SetMonMoveSlot ( struct Pokemon * mon , u16 move , u8 slot ) ;
void SetBattleMonMoveSlot ( struct BattlePokemon * mon , u16 move , u8 slot ) ;
void GiveMonInitialMoveset ( struct Pokemon * mon ) ;
void GiveBoxMonInitialMoveset ( struct BoxPokemon * boxMon ) ;
2018-02-11 17:35:01 +01:00
u16 MonTryLearningNewMove ( struct Pokemon * mon , bool8 firstMove ) ;
2017-09-06 17:19:08 +02:00
void DeleteFirstMoveAndGiveMoveToMon ( struct Pokemon * mon , u16 move ) ;
void DeleteFirstMoveAndGiveMoveToBoxMon ( struct BoxPokemon * boxMon , u16 move ) ;
2018-02-11 17:35:01 +01:00
u8 CountAliveMonsInBattle ( u8 caseId ) ;
u8 GetDefaultMoveTarget ( u8 battlerId ) ;
2017-09-06 17:19:08 +02:00
u8 GetMonGender ( struct Pokemon * mon ) ;
u8 GetBoxMonGender ( struct BoxPokemon * boxMon ) ;
u8 GetGenderFromSpeciesAndPersonality ( u16 species , u32 personality ) ;
2019-04-07 12:40:18 +02:00
u32 GetUnownSpeciesId ( u32 personality ) ;
2019-04-05 00:07:39 +02:00
void SetMultiuseSpriteTemplateToPokemon ( u16 speciesTag , u8 battlerPosition ) ;
2018-07-01 15:28:57 +02:00
void SetMultiuseSpriteTemplateToTrainerBack ( u16 trainerSpriteId , u8 battlerPosition ) ;
2022-05-21 21:21:50 +02:00
void SetMultiuseSpriteTemplateToTrainerFront ( u16 trainerPicId , u8 battlerPosition ) ;
2017-09-06 17:19:08 +02:00
2017-02-04 03:34:56 +01:00
// These are full type signatures for GetMonData() and GetBoxMonData(),
// but they are not used since some code erroneously omits the third arg.
// u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data);
2017-09-06 17:19:08 +02:00
// u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data);
2017-02-04 03:34:56 +01:00
u32 GetMonData ( ) ;
2017-09-06 17:19:08 +02:00
u32 GetBoxMonData ( ) ;
2017-02-04 03:34:56 +01:00
2018-02-11 17:35:01 +01:00
void SetMonData ( struct Pokemon * mon , s32 field , const void * dataArg ) ;
void SetBoxMonData ( struct BoxPokemon * boxMon , s32 field , const void * dataArg ) ;
2017-09-06 17:19:08 +02:00
void CopyMon ( void * dest , void * src , size_t size ) ;
u8 GiveMonToPlayer ( struct Pokemon * mon ) ;
2021-11-28 20:28:54 +01:00
u8 SendMonToPC ( struct Pokemon * mon ) ;
2017-09-06 17:19:08 +02:00
u8 CalculatePlayerPartyCount ( void ) ;
u8 CalculateEnemyPartyCount ( void ) ;
2018-02-11 17:35:01 +01:00
u8 GetMonsStateToDoubles ( void ) ;
u8 GetMonsStateToDoubles_2 ( void ) ;
2020-05-18 23:54:12 +02:00
u16 GetAbilityBySpecies ( u16 species , u8 abilityNum ) ;
u16 GetMonAbility ( struct Pokemon * mon ) ;
2019-04-05 23:11:24 +02:00
void CreateSecretBaseEnemyParty ( struct SecretBase * secretBaseRecord ) ;
2017-09-06 17:19:08 +02:00
u8 GetSecretBaseTrainerPicIndex ( void ) ;
2018-02-11 17:35:01 +01:00
u8 GetSecretBaseTrainerClass ( void ) ;
2017-09-12 00:01:12 +02:00
bool8 IsPlayerPartyAndPokemonStorageFull ( void ) ;
bool8 IsPokemonStorageFull ( void ) ;
2017-09-06 17:19:08 +02:00
void GetSpeciesName ( u8 * name , u16 species ) ;
u8 CalculatePPWithBonus ( u16 move , u8 ppBonuses , u8 moveIndex ) ;
void RemoveMonPPBonus ( struct Pokemon * mon , u8 moveIndex ) ;
void RemoveBattleMonPPBonus ( struct BattlePokemon * mon , u8 moveIndex ) ;
2018-07-15 18:07:01 +02:00
void PokemonToBattleMon ( struct Pokemon * src , struct BattlePokemon * dst ) ;
2018-02-11 17:35:01 +01:00
void CopyPlayerPartyMonToBattleData ( u8 battlerId , u8 partyIndex ) ;
bool8 ExecuteTableBasedItemEffect ( struct Pokemon * mon , u16 item , u8 partyIndex , u8 moveIndex ) ;
bool8 PokemonUseItemEffects ( struct Pokemon * mon , u16 item , u8 partyIndex , u8 moveIndex , u8 e ) ;
bool8 HealStatusConditions ( struct Pokemon * mon , u32 battlePartyId , u32 healMask , u8 battlerId ) ;
u8 GetItemEffectParamOffset ( u16 itemId , u8 effectByte , u8 effectBit ) ;
2019-12-22 01:01:38 +01:00
u8 * UseStatIncreaseItem ( u16 itemId ) ;
2017-09-06 17:19:08 +02:00
u8 GetNature ( struct Pokemon * mon ) ;
u8 GetNatureFromPersonality ( u32 personality ) ;
2022-02-27 01:40:20 +01:00
u16 GetEvolutionTargetSpecies ( struct Pokemon * mon , u8 type , u16 evolutionItem , struct Pokemon * tradePartner ) ;
2018-02-11 17:35:01 +01:00
u16 HoennPokedexNumToSpecies ( u16 hoennNum ) ;
2017-09-11 11:35:41 +02:00
u16 NationalPokedexNumToSpecies ( u16 nationalNum ) ;
2018-02-11 17:35:01 +01:00
u16 NationalToHoennOrder ( u16 nationalNum ) ;
u16 SpeciesToNationalPokedexNum ( u16 species ) ;
u16 SpeciesToHoennPokedexNum ( u16 species ) ;
u16 HoennToNationalOrder ( u16 hoennNum ) ;
2022-06-01 18:41:57 +02:00
void DrawSpindaSpots ( u16 species , u32 personality , u8 * dest , bool8 isFrontPic ) ;
2018-02-11 17:35:01 +01:00
void EvolutionRenameMon ( struct Pokemon * mon , u16 oldSpecies , u16 newSpecies ) ;
2019-10-31 19:11:55 +01:00
u8 GetPlayerFlankId ( void ) ;
u16 GetLinkTrainerFlankId ( u8 id ) ;
2022-06-01 18:41:57 +02:00
s32 GetBattlerMultiplayerId ( u16 id ) ;
2018-02-11 17:35:01 +01:00
u8 GetTrainerEncounterMusicId ( u16 trainerOpponentId ) ;
u16 ModifyStatByNature ( u8 nature , u16 n , u8 statIndex ) ;
void AdjustFriendship ( struct Pokemon * mon , u8 event ) ;
void MonGainEVs ( struct Pokemon * mon , u16 defeatedSpecies ) ;
u16 GetMonEVCount ( struct Pokemon * mon ) ;
2017-10-06 00:12:01 +02:00
void RandomlyGivePartyPokerus ( struct Pokemon * party ) ;
u8 CheckPartyPokerus ( struct Pokemon * party , u8 selection ) ;
u8 CheckPartyHasHadPokerus ( struct Pokemon * party , u8 selection ) ;
void UpdatePartyPokerusTime ( u16 days ) ;
void PartySpreadPokerus ( struct Pokemon * party ) ;
2017-11-14 20:23:25 +01:00
bool8 TryIncrementMonLevel ( struct Pokemon * mon ) ;
2022-08-26 20:48:06 +02:00
u8 CanLearnTeachableMove ( u16 species , u16 move ) ;
2018-02-11 17:35:01 +01:00
u8 GetMoveRelearnerMoves ( struct Pokemon * mon , u16 * moves ) ;
2017-11-14 21:43:23 +01:00
u8 GetLevelUpMovesBySpecies ( u16 species , u16 * moves ) ;
2018-02-11 17:35:01 +01:00
u8 GetNumberOfRelearnableMoves ( struct Pokemon * mon ) ;
u16 SpeciesToPokedexNum ( u16 species ) ;
2018-12-15 21:12:28 +01:00
bool32 IsSpeciesInHoennDex ( u16 species ) ;
2018-02-11 17:35:01 +01:00
void ClearBattleMonForms ( void ) ;
u16 GetBattleBGM ( void ) ;
void PlayBattleBGM ( void ) ;
void PlayMapChosenOrBattleBGM ( u16 songId ) ;
2020-12-24 22:18:47 +01:00
void CreateTask_PlayMapChosenOrBattleBGM ( u16 songId ) ;
2018-10-21 09:24:57 +02:00
const u32 * GetMonFrontSpritePal ( struct Pokemon * mon ) ;
2019-07-25 18:56:08 +02:00
const u32 * GetMonSpritePalFromSpeciesAndPersonality ( u16 species , u32 otId , u32 personality ) ;
2018-02-11 17:35:01 +01:00
const struct CompressedSpritePalette * GetMonSpritePalStruct ( struct Pokemon * mon ) ;
const struct CompressedSpritePalette * GetMonSpritePalStructFromOtIdPersonality ( u16 species , u32 otId , u32 personality ) ;
bool32 IsHMMove2 ( u16 move ) ;
bool8 IsMonSpriteNotFlipped ( u16 species ) ;
s8 GetMonFlavorRelation ( struct Pokemon * mon , u8 flavor ) ;
s8 GetFlavorRelationByPersonality ( u32 personality , u8 flavor ) ;
bool8 IsTradedMon ( struct Pokemon * mon ) ;
bool8 IsOtherTrainer ( u32 otId , u8 * otName ) ;
void MonRestorePP ( struct Pokemon * mon ) ;
void BoxMonRestorePP ( struct BoxPokemon * boxMon ) ;
2018-07-07 19:57:09 +02:00
void SetMonPreventsSwitchingString ( void ) ;
2018-02-11 17:35:01 +01:00
void SetWildMonHeldItem ( void ) ;
bool8 IsMonShiny ( struct Pokemon * mon ) ;
bool8 IsShinyOtIdPersonality ( u32 otId , u32 personality ) ;
const u8 * GetTrainerPartnerName ( void ) ;
2022-07-29 17:15:33 +02:00
void BattleAnimateFrontSprite ( struct Sprite * sprite , u16 species , bool8 noCry , u8 panMode ) ;
void DoMonFrontSpriteAnimation ( struct Sprite * sprite , u16 species , bool8 noCry , u8 panModeAnimFlag ) ;
void PokemonSummaryDoMonAnimation ( struct Sprite * sprite , u16 species , bool8 oneFrame ) ;
2019-02-19 10:09:42 +01:00
void StopPokemonAnimationDelayTask ( void ) ;
2022-07-29 17:15:33 +02:00
void BattleAnimateBackSprite ( struct Sprite * sprite , u16 species ) ;
2021-10-03 05:48:12 +02:00
u8 GetOpposingLinkMultiBattlerId ( bool8 rightSide , u8 multiplayerId ) ;
2018-02-11 17:35:01 +01:00
u16 FacilityClassToPicIndex ( u16 facilityClass ) ;
u16 PlayerGenderToFrontTrainerPicId ( u8 playerGender ) ;
void HandleSetPokedexFlag ( u16 nationalNum , u8 caseId , u32 personality ) ;
const u8 * GetTrainerClassNameFromId ( u16 trainerId ) ;
const u8 * GetTrainerNameFromId ( u16 trainerId ) ;
bool8 HasTwoFramesAnimation ( u16 species ) ;
2021-10-03 05:47:59 +02:00
struct MonSpritesGfxManager * CreateMonSpritesGfxManager ( u8 managerId , u8 mode ) ;
void DestroyMonSpritesGfxManager ( u8 managerId ) ;
u8 * MonSpritesGfxManager_GetSpritePtr ( u8 managerId , u8 spriteNum ) ;
2020-12-25 01:46:39 +01:00
u16 GetFormSpeciesId ( u16 speciesId , u8 formId ) ;
u8 GetFormIdFromFormSpeciesId ( u16 formSpeciesId ) ;
2021-03-03 20:07:50 +01:00
u16 GetFormChangeTargetSpecies ( struct Pokemon * mon , u16 method , u32 arg ) ;
2022-11-06 00:00:12 +01:00
u16 GetFormChangeTargetSpeciesBoxMon ( struct BoxPokemon * boxMon , u16 method , u32 arg ) ;
bool32 DoesSpeciesHaveFormChangeMethod ( u16 species , u16 method ) ;
2020-07-16 15:02:06 +02:00
u16 MonTryLearningNewMoveEvolution ( struct Pokemon * mon , bool8 firstMove ) ;
2022-08-25 09:42:41 +02:00
bool32 ShouldShowFemaleDifferences ( u16 species , u32 personality ) ;
2022-11-02 03:50:26 +01:00
bool32 TryFormChange ( u32 monId , u32 side , u16 method ) ;
2022-10-20 18:14:32 +02:00
void TryToSetBattleFormChangeMoves ( struct Pokemon * mon , u16 method ) ;
2022-08-26 22:47:07 +02:00
u32 GetMonFriendshipScore ( struct Pokemon * pokemon ) ;
2022-12-24 06:13:42 +01:00
void UpdateMonPersonality ( struct BoxPokemon * boxMon , u32 personality ) ;
2017-09-18 23:48:47 +02:00
2017-09-02 23:28:44 +02:00
# endif // GUARD_POKEMON_H