summaryrefslogtreecommitdiff
path: root/include/pokemon.h
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-07-05 17:48:21 -0400
committerGitHub <noreply@github.com>2017-07-05 17:48:21 -0400
commit124e2eb02c4adc46265e5b34b47ac0c625a24ec3 (patch)
tree5c0af98d9e49a767f455fff1ceec5d07cb8539b8 /include/pokemon.h
parent123d5cc8b26d2a93fa3981beaccb84377c6ae20f (diff)
parent813c1846c94fa14b55bf75cf4c14465f1fb26635 (diff)
Merge branch 'master' into master
Diffstat (limited to 'include/pokemon.h')
-rwxr-xr-x[-rw-r--r--]include/pokemon.h338
1 files changed, 201 insertions, 137 deletions
diff --git a/include/pokemon.h b/include/pokemon.h
index 47990073b..2f8a57d38 100644..100755
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -122,6 +122,25 @@
#define UNOWN_FORM_COUNT 28
enum {
+ EGG_GROUP_NONE,
+ EGG_GROUP_MONSTER,
+ EGG_GROUP_WATER_1,
+ EGG_GROUP_BUG,
+ EGG_GROUP_FLYING,
+ EGG_GROUP_FIELD,
+ EGG_GROUP_FAIRY,
+ EGG_GROUP_GRASS,
+ EGG_GROUP_HUMAN_LIKE,
+ EGG_GROUP_WATER_3,
+ EGG_GROUP_MINERAL,
+ EGG_GROUP_AMORPHOUS,
+ EGG_GROUP_WATER_2,
+ EGG_GROUP_DITTO,
+ EGG_GROUP_DRAGON,
+ EGG_GROUP_UNDISCOVERED
+};
+
+enum {
NATURE_HARDY,
NATURE_LONELY,
NATURE_BRAVE,
@@ -182,41 +201,41 @@ struct PokemonSubstruct2
struct PokemonSubstruct3
{
- /* 0x00 */ u8 pokerus;
- /* 0x01 */ u8 metLocation;
-
- /* 0x02 */ u16 metLevel:7;
- /* 0x02 */ u16 metGame:4;
- /* 0x03 */ u16 pokeball:4;
- /* 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;
- /* 0x07 */ u32 altAbility:1;
-
- /* 0x08 */ u32 coolRibbon:3;
- /* 0x08 */ u32 beautyRibbon:3;
- /* 0x08 */ u32 cuteRibbon:3;
- /* 0x09 */ u32 smartRibbon:3;
- /* 0x09 */ u32 toughRibbon:3;
- /* 0x09 */ u32 championRibbon:1;
- /* 0x0A */ u32 winningRibbon:1;
- /* 0x0A */ u32 victoryRibbon:1;
- /* 0x0A */ u32 artistRibbon:1;
- /* 0x0A */ u32 effortRibbon:1;
- /* 0x0A */ u32 giftRibbon1:1;
- /* 0x0A */ u32 giftRibbon2:1;
- /* 0x0A */ u32 giftRibbon3:1;
- /* 0x0A */ u32 giftRibbon4:1;
- /* 0x0B */ u32 giftRibbon5:1;
- /* 0x0B */ u32 giftRibbon6:1;
- /* 0x0B */ u32 giftRibbon7:1;
- /* 0x0B */ u32 fatefulEncounter:5; // unused in Ruby/Sapphire, but the high bit must be set for Mew/Deoxys to obey in FR/LG/Emerald
+ /*0x00*/ u8 pokerus;
+ /*0x01*/ u8 metLocation;
+
+ /*0x02*/ u16 metLevel:7;
+ /*0x02*/ u16 metGame:4;
+ /*0x03*/ u16 pokeball:4;
+ /*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;
+ /*0x07*/ u32 altAbility:1;
+
+ /*0x08*/ u32 coolRibbon:3;
+ /*0x08*/ u32 beautyRibbon:3;
+ /*0x08*/ u32 cuteRibbon:3;
+ /*0x09*/ u32 smartRibbon:3;
+ /*0x09*/ u32 toughRibbon:3;
+ /*0x09*/ u32 championRibbon:1;
+ /*0x0A*/ u32 winningRibbon:1;
+ /*0x0A*/ u32 victoryRibbon:1;
+ /*0x0A*/ u32 artistRibbon:1;
+ /*0x0A*/ u32 effortRibbon:1;
+ /*0x0A*/ u32 giftRibbon1:1;
+ /*0x0A*/ u32 giftRibbon2:1;
+ /*0x0A*/ u32 giftRibbon3:1;
+ /*0x0A*/ u32 giftRibbon4:1;
+ /*0x0B*/ u32 giftRibbon5:1;
+ /*0x0B*/ u32 giftRibbon6:1;
+ /*0x0B*/ u32 giftRibbon7:1;
+ /*0x0B*/ u32 fatefulEncounter:5; // unused in Ruby/Sapphire, but the high bit must be set for Mew/Deoxys to obey in FR/LG/Emerald
};
union PokemonSubstruct
@@ -230,39 +249,39 @@ union PokemonSubstruct
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;
- u8 otName[OT_NAME_LENGTH];
- u8 markings;
- u16 checksum;
- u16 unknown;
+ /*0x00*/ u32 personality;
+ /*0x04*/ u32 otId;
+ /*0x08*/ u8 nickname[POKEMON_NAME_LENGTH];
+ /*0x12*/ u8 language;
+ /*0x13*/ u8 isBadEgg:1;
+ u8 hasSpecies:1;
+ u8 isEgg:1;
+ u8 unused:5;
+ /*0x14*/ u8 otName[OT_NAME_LENGTH];
+ /*0x1B*/ u8 markings;
+ /*0x1C*/ u16 checksum;
+ /*0x1E*/ u16 unknown;
union
{
u32 raw[12];
union PokemonSubstruct substructs[4];
} secure;
-};
+}; /*size = 0x50*/
struct Pokemon
{
- struct BoxPokemon box;
- u32 status;
- u8 level;
- u8 mail;
- u16 hp;
- u16 maxHP;
- u16 attack;
- u16 defense;
- u16 speed;
- u16 spAttack;
- u16 spDefense;
+ /*0x00*/ struct BoxPokemon box;
+ /*0x50*/ u32 status;
+ /*0x54*/ u8 level;
+ /*0x55*/ u8 mail;
+ /*0x56*/ u16 hp;
+ /*0x58*/ u16 maxHP;
+ /*0x5A*/ u16 attack;
+ /*0x5C*/ u16 defense;
+ /*0x5E*/ u16 speed;
+ /*0x60*/ u16 spAttack;
+ /*0x62*/ u16 spDefense;
};
struct UnknownPokemonStruct
@@ -294,73 +313,73 @@ struct UnknownPokemonStruct
struct BattlePokemon
{
- /* 0x00 */ u16 species;
- /* 0x02 */ u16 attack;
- /* 0x04 */ u16 defense;
- /* 0x06 */ u16 speed;
- /* 0x08 */ u16 spAttack;
- /* 0x0A */ u16 spDefense;
- /* 0x0C */ u16 moves[4];
- /* 0x14 */ u32 hpIV:5;
- /* 0x14 */ u32 attackIV:5;
- /* 0x15 */ u32 defenseIV:5;
- /* 0x15 */ u32 speedIV:5;
- /* 0x16 */ u32 spAttackIV:5;
- /* 0x17 */ u32 spDefenseIV:5;
- /* 0x17 */ u32 isEgg:1;
- /* 0x17 */ u32 altAbility:1;
- /* 0x18 */ s8 statStages[8];
- /* 0x20 */ u8 ability;
- /* 0x21 */ u8 type1;
- /* 0x22 */ u8 type2;
- /* 0x23 */ u8 unknown;
- /* 0x24 */ u8 pp[4];
- /* 0x28 */ u16 hp;
- /* 0x2A */ u8 level;
- /* 0x2B */ u8 friendship;
- /* 0x2C */ u16 maxHP;
- /* 0x2E */ u16 item;
- /* 0x30 */ u8 nickname[POKEMON_NAME_LENGTH + 1];
- /* 0x3B */ u8 ppBonuses;
- /* 0x3C */ u8 otName[8];
- /* 0x44 */ u32 experience;
- /* 0x48 */ u32 personality;
- /* 0x4C */ u32 status1;
- /* 0x50 */ u32 status2;
- /* 0x54 */ u32 otId;
+ /*0x00*/ u16 species;
+ /*0x02*/ u16 attack;
+ /*0x04*/ u16 defense;
+ /*0x06*/ u16 speed;
+ /*0x08*/ u16 spAttack;
+ /*0x0A*/ u16 spDefense;
+ /*0x0C*/ u16 moves[4];
+ /*0x14*/ u32 hpIV:5;
+ /*0x14*/ u32 attackIV:5;
+ /*0x15*/ u32 defenseIV:5;
+ /*0x15*/ u32 speedIV:5;
+ /*0x16*/ u32 spAttackIV:5;
+ /*0x17*/ u32 spDefenseIV:5;
+ /*0x17*/ u32 isEgg:1;
+ /*0x17*/ u32 altAbility:1;
+ /*0x18*/ s8 statStages[8];
+ /*0x20*/ u8 ability;
+ /*0x21*/ u8 type1;
+ /*0x22*/ u8 type2;
+ /*0x23*/ u8 unknown;
+ /*0x24*/ u8 pp[4];
+ /*0x28*/ u16 hp;
+ /*0x2A*/ u8 level;
+ /*0x2B*/ u8 friendship;
+ /*0x2C*/ u16 maxHP;
+ /*0x2E*/ u16 item;
+ /*0x30*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
+ /*0x3B*/ u8 ppBonuses;
+ /*0x3C*/ u8 otName[8];
+ /*0x44*/ u32 experience;
+ /*0x48*/ u32 personality;
+ /*0x4C*/ u32 status1;
+ /*0x50*/ u32 status2;
+ /*0x54*/ u32 otId;
};
struct BaseStats
{
- /* 0x00 */ u8 baseHP;
- /* 0x01 */ u8 baseAttack;
- /* 0x02 */ u8 baseDefense;
- /* 0x03 */ u8 baseSpeed;
- /* 0x04 */ u8 baseSpAttack;
- /* 0x05 */ u8 baseSpDefense;
- /* 0x06 */ u8 type1;
- /* 0x07 */ u8 type2;
- /* 0x08 */ u8 catchRate;
- /* 0x09 */ u8 expYield;
- /* 0x0A */ u16 evYield_HP:2;
- /* 0x0A */ u16 evYield_Attack:2;
- /* 0x0A */ u16 evYield_Defense:2;
- /* 0x0A */ u16 evYield_Speed:2;
- /* 0x0B */ u16 evYield_SpAttack:2;
- /* 0x0B */ u16 evYield_SpDefense:2;
- /* 0x0C */ u16 item1;
- /* 0x0E */ u16 item2;
- /* 0x10 */ u8 genderRatio;
- /* 0x11 */ u8 eggCycles;
- /* 0x12 */ u8 friendship;
- /* 0x13 */ u8 growthRate;
- /* 0x14 */ u8 eggGroup1;
- /* 0x15 */ u8 eggGroup2;
- /* 0x16 */ u8 ability1;
- /* 0x17 */ u8 ability2;
- /* 0x18 */ u8 safariZoneFleeRate;
- /* 0x19 */ u8 bodyColor:7;
- u8 unk19_7:1;
+ /*0x00*/ u8 baseHP;
+ /*0x01*/ u8 baseAttack;
+ /*0x02*/ u8 baseDefense;
+ /*0x03*/ u8 baseSpeed;
+ /*0x04*/ u8 baseSpAttack;
+ /*0x05*/ u8 baseSpDefense;
+ /*0x06*/ u8 type1;
+ /*0x07*/ u8 type2;
+ /*0x08*/ u8 catchRate;
+ /*0x09*/ u8 expYield;
+ /*0x0A*/ u16 evYield_HP:2;
+ /*0x0A*/ u16 evYield_Attack:2;
+ /*0x0A*/ u16 evYield_Defense:2;
+ /*0x0A*/ u16 evYield_Speed:2;
+ /*0x0B*/ u16 evYield_SpAttack:2;
+ /*0x0B*/ u16 evYield_SpDefense:2;
+ /*0x0C*/ u16 item1;
+ /*0x0E*/ u16 item2;
+ /*0x10*/ u8 genderRatio;
+ /*0x11*/ u8 eggCycles;
+ /*0x12*/ u8 friendship;
+ /*0x13*/ u8 growthRate;
+ /*0x14*/ u8 eggGroup1;
+ /*0x15*/ u8 eggGroup2;
+ /*0x16*/ u8 ability1;
+ /*0x17*/ u8 ability2;
+ /*0x18*/ u8 safariZoneFleeRate;
+ /*0x19*/ u8 bodyColor:7;
+ u8 unk19_7:1;
};
struct BattleMove
@@ -378,12 +397,61 @@ struct BattleMove
struct PokemonStorage
{
- /* 0x00 */ u8 currentBox;
- /* 0x01 */ struct BoxPokemon boxes[14][30];
- u8 boxNames[14][9];
- u8 unkArray[14];
+ /*0x00*/ u8 currentBox;
+ /*0x01*/ struct BoxPokemon boxes[14][30];
+ u8 boxNames[14][9];
+ u8 unkArray[14];
+};
+
+struct SpindaSpot
+{
+ u8 x, y;
+ u16 image[16];
+};
+
+struct __attribute__((packed)) LevelUpMove {
+ u16 move:9;
+ u16 level:7;
};
+enum {
+ GROWTH_MEDIUM_FAST,
+ GROWTH_ERRATIC,
+ GROWTH_FLUCTUATING,
+ GROWTH_MEDIUM_SLOW,
+ GROWTH_FAST,
+ GROWTH_SLOW
+};
+
+enum {
+ BODY_COLOR_RED,
+ BODY_COLOR_BLUE,
+ BODY_COLOR_YELLOW,
+ BODY_COLOR_GREEN,
+ BODY_COLOR_BLACK,
+ BODY_COLOR_BROWN,
+ BODY_COLOR_PURPLE,
+ BODY_COLOR_GRAY,
+ BODY_COLOR_WHITE,
+ BODY_COLOR_PINK
+};
+
+#define EVO_FRIENDSHIP 0x0001 // Pokémon levels up with friendship ≥ 220
+#define EVO_FRIENDSHIP_DAY 0x0002 // Pokémon levels up during the day with friendship ≥ 220
+#define EVO_FRIENDSHIP_NIGHT 0x0003 // Pokémon levels up at night with friendship ≥ 220
+#define EVO_LEVEL 0x0004 // Pokémon reaches the specified level
+#define EVO_TRADE 0x0005 // Pokémon is traded
+#define EVO_TRADE_ITEM 0x0006 // Pokémon is traded while it's holding the specified item
+#define EVO_ITEM 0x0007 // specified item is used on Pokémon
+#define EVO_LEVEL_ATK_GT_DEF 0x0008 // Pokémon reaches the specified level with attack > defense
+#define EVO_LEVEL_ATK_EQ_DEF 0x0009 // Pokémon reaches the specified level with attack = defense
+#define EVO_LEVEL_ATK_LT_DEF 0x000a // Pokémon reaches the specified level with attack < defense
+#define EVO_LEVEL_SILCOON 0x000b // Pokémon reaches the specified level with a Silcoon personality value
+#define EVO_LEVEL_CASCOON 0x000c // Pokémon reaches the specified level with a Cascoon personality value
+#define EVO_LEVEL_NINJASK 0x000d // Pokémon reaches the specified level (special value for Ninjask)
+#define EVO_LEVEL_SHEDINJA 0x000e // Pokémon reaches the specified level (special value for Shedinja)
+#define EVO_BEAUTY 0x000f // Pokémon levels up with beauty ≥ specified value
+
struct Evolution
{
u16 method;
@@ -396,19 +464,14 @@ struct EvolutionData
struct Evolution evolutions[5];
};
-extern const u8 *const gItemEffectTable[];
-extern u8 gTrainerClassToPicIndex[];
-extern u8 gTrainerClassToNameIndex[];
-extern const u32 gExperienceTables[8][101];
-extern const struct BaseStats gBaseStats[];
-extern struct EvolutionData gEvolutionTable[];
-extern const u16 *gLevelUpLearnsets[];
-extern u8 gUnknown_08208238[];
-extern u8 gUnknown_0820823C[];
-extern u8 gStatStageRatios[][2];
-
extern struct Pokemon gPlayerParty[PARTY_SIZE];
extern struct Pokemon gEnemyParty[PARTY_SIZE];
+extern const u8 *const gItemEffectTable[];
+extern const struct BaseStats gBaseStats[];
+extern const u32 gExperienceTables[][101];
+extern const u16 *const gLevelUpLearnsets[];
+extern const struct EvolutionData gEvolutionTable[];
+extern struct PokemonStorage gPokemonStorage;
void ZeroBoxMonData(struct BoxPokemon *boxMon);
void ZeroMonData(struct Pokemon *mon);
@@ -511,5 +574,6 @@ void sub_8040B8C(void);
void SetWildMonHeldItem(void);
u8 *sub_8040D08();
bool32 sub_8040D3C(u16 species, u8 *name, u8 language);
+u16 GetMonEVCount(struct Pokemon *);
#endif // GUARD_POKEMON_H