2018-02-08 10:17:41 +00:00
# ifndef GUARD_CONSTANTS_POKEMON_H
# define GUARD_CONSTANTS_POKEMON_H
2023-12-12 18:02:36 +00:00
// Pokémon types
2024-06-01 06:38:22 +01:00
# define TYPE_NONE 0
# define TYPE_NORMAL 1
# define TYPE_FIGHTING 2
# define TYPE_FLYING 3
# define TYPE_POISON 4
# define TYPE_GROUND 5
# define TYPE_ROCK 6
# define TYPE_BUG 7
# define TYPE_GHOST 8
# define TYPE_STEEL 9
# define TYPE_MYSTERY 10
# define TYPE_FIRE 11
# define TYPE_WATER 12
# define TYPE_GRASS 13
# define TYPE_ELECTRIC 14
# define TYPE_PSYCHIC 15
# define TYPE_ICE 16
# define TYPE_DRAGON 17
# define TYPE_DARK 18
# define TYPE_FAIRY 19
# define TYPE_STELLAR 20
# define NUMBER_OF_MON_TYPES 21
2018-12-05 15:09:19 +00:00
2023-12-12 18:02:36 +00:00
// Pokémon egg groups
2023-10-28 15:32:55 +01:00
# define EGG_GROUP_NONE 0
# define EGG_GROUP_MONSTER 1
# define EGG_GROUP_WATER_1 2
# define EGG_GROUP_BUG 3
# define EGG_GROUP_FLYING 4
# define EGG_GROUP_FIELD 5
# define EGG_GROUP_FAIRY 6
# define EGG_GROUP_GRASS 7
# define EGG_GROUP_HUMAN_LIKE 8
# define EGG_GROUP_WATER_3 9
# define EGG_GROUP_MINERAL 10
# define EGG_GROUP_AMORPHOUS 11
# define EGG_GROUP_WATER_2 12
# define EGG_GROUP_DITTO 13
# define EGG_GROUP_DRAGON 14
# define EGG_GROUP_NO_EGGS_DISCOVERED 15
2018-02-08 10:17:41 +00:00
2023-10-28 15:32:55 +01:00
# define EGG_GROUPS_PER_MON 2
2018-02-08 10:17:41 +00:00
2023-12-12 18:02:36 +00:00
// Pokémon natures
2019-09-17 20:24:44 +01:00
# define NATURE_HARDY 0
# define NATURE_LONELY 1
# define NATURE_BRAVE 2
# define NATURE_ADAMANT 3
# define NATURE_NAUGHTY 4
# define NATURE_BOLD 5
# define NATURE_DOCILE 6
# define NATURE_RELAXED 7
# define NATURE_IMPISH 8
# define NATURE_LAX 9
# define NATURE_TIMID 10
# define NATURE_HASTY 11
# define NATURE_SERIOUS 12
# define NATURE_JOLLY 13
# define NATURE_NAIVE 14
# define NATURE_MODEST 15
# define NATURE_MILD 16
# define NATURE_QUIET 17
# define NATURE_BASHFUL 18
# define NATURE_RASH 19
# define NATURE_CALM 20
# define NATURE_GENTLE 21
# define NATURE_SASSY 22
# define NATURE_CAREFUL 23
# define NATURE_QUIRKY 24
2020-07-17 01:12:12 +01:00
# define NUM_NATURES 25
2018-02-08 10:17:41 +00:00
2023-12-12 18:02:36 +00:00
// Pokémon Stats
2019-09-17 20:24:44 +01:00
# define STAT_HP 0
# define STAT_ATK 1
# define STAT_DEF 2
# define STAT_SPEED 3
# define STAT_SPATK 4
# define STAT_SPDEF 5
2021-12-28 23:07:41 +00:00
# define NUM_STATS 6
2019-09-17 20:24:44 +01:00
# define STAT_ACC 6 // Only in battles.
2018-11-18 19:00:36 +00:00
# define STAT_EVASION 7 // Only in battles.
2021-12-28 23:07:41 +00:00
# define NUM_NATURE_STATS (NUM_STATS - 1) // excludes HP
# define NUM_BATTLE_STATS (NUM_STATS + 2) // includes Accuracy and Evasion
2018-02-08 10:17:41 +00:00
2020-08-05 01:33:05 +01:00
# define MIN_STAT_STAGE 0
# define DEFAULT_STAT_STAGE 6
# define MAX_STAT_STAGE 12
2019-07-11 19:16:39 +01:00
// Shiny odds
# define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536
2021-02-18 14:59:24 +00:00
// Ribbon IDs used by TV and Pokénav
# define CHAMPION_RIBBON 0
# define COOL_RIBBON_NORMAL 1
# define COOL_RIBBON_SUPER 2
# define COOL_RIBBON_HYPER 3
# define COOL_RIBBON_MASTER 4
# define BEAUTY_RIBBON_NORMAL 5
# define BEAUTY_RIBBON_SUPER 6
# define BEAUTY_RIBBON_HYPER 7
# define BEAUTY_RIBBON_MASTER 8
# define CUTE_RIBBON_NORMAL 9
# define CUTE_RIBBON_SUPER 10
# define CUTE_RIBBON_HYPER 11
# define CUTE_RIBBON_MASTER 12
# define SMART_RIBBON_NORMAL 13
# define SMART_RIBBON_SUPER 14
# define SMART_RIBBON_HYPER 15
# define SMART_RIBBON_MASTER 16
# define TOUGH_RIBBON_NORMAL 17
# define TOUGH_RIBBON_SUPER 18
# define TOUGH_RIBBON_HYPER 19
# define TOUGH_RIBBON_MASTER 20
# define WINNING_RIBBON 21
# define VICTORY_RIBBON 22
# define ARTIST_RIBBON 23
# define EFFORT_RIBBON 24
# define MARINE_RIBBON 25
# define LAND_RIBBON 26
# define SKY_RIBBON 27
# define COUNTRY_RIBBON 28
# define NATIONAL_RIBBON 29
# define EARTH_RIBBON 30
# define WORLD_RIBBON 31
# define FIRST_GIFT_RIBBON MARINE_RIBBON
# define LAST_GIFT_RIBBON WORLD_RIBBON
# define NUM_GIFT_RIBBONS (1 + LAST_GIFT_RIBBON - FIRST_GIFT_RIBBON)
// The above gift ribbons (Marine - World) are
// special distribution ribbons that correspond to
// 1 bit each in the Pokémon struct. Gen 4 hard-codes
// each of these to the given name. In Gen 3 they're
// used to get an index into giftRibbons in the save block,
2021-08-24 23:59:32 +01:00
// which can have a value 0-64 (0 is 'no ribbon') that
2021-02-18 14:59:24 +00:00
// corresponds to one of the special ribbons listed
// in gGiftRibbonDescriptionPointers. Most of these were
// never distributed
# define MAX_GIFT_RIBBON 64
2019-09-30 23:14:35 +01:00
# define MIN_LEVEL 1
2019-09-17 20:24:44 +01:00
# define MAX_LEVEL 100
2023-12-27 16:48:17 +00:00
# define MAX_DYNAMAX_LEVEL 10
2019-09-17 20:24:44 +01:00
# define OT_ID_PLAYER_ID 0
# define OT_ID_PRESET 1
# define OT_ID_RANDOM_NO_SHINY 2
# define MON_GIVEN_TO_PARTY 0
# define MON_GIVEN_TO_PC 1
# define MON_CANT_GIVE 2
# define PLAYER_HAS_TWO_USABLE_MONS 0
# define PLAYER_HAS_ONE_MON 1
# define PLAYER_HAS_ONE_USABLE_MON 2
2019-10-18 00:22:03 +01:00
# define MON_ALREADY_KNOWS_MOVE 0xFFFE
# define MON_HAS_MAX_MOVES 0xFFFF
2019-11-14 23:56:18 +00:00
# define LEVEL_UP_MOVE_ID 0x01FF
# define LEVEL_UP_MOVE_LV 0xFE00
2023-10-13 17:39:35 +01:00
# define LEVEL_UP_MOVE_END 0xFFFF
2019-11-14 23:56:18 +00:00
2020-08-28 19:36:07 +01:00
# define MAX_LEVEL_UP_MOVES 20
2019-09-17 20:24:44 +01:00
# define MON_MALE 0x00
# define MON_FEMALE 0xFE
# define MON_GENDERLESS 0xFF
2020-02-02 18:28:54 +00:00
// Constants for AdjustFriendship
# define FRIENDSHIP_EVENT_GROW_LEVEL 0
# define FRIENDSHIP_EVENT_VITAMIN 1 // unused, handled by PokemonUseItemEffects
# define FRIENDSHIP_EVENT_BATTLE_ITEM 2 // unused, handled by PokemonUseItemEffects
# define FRIENDSHIP_EVENT_LEAGUE_BATTLE 3
# define FRIENDSHIP_EVENT_LEARN_TMHM 4
# define FRIENDSHIP_EVENT_WALKING 5
# define FRIENDSHIP_EVENT_FAINT_SMALL 6
# define FRIENDSHIP_EVENT_FAINT_FIELD_PSN 7
# define FRIENDSHIP_EVENT_FAINT_LARGE 8 // If opponent was >= 30 levels higher. See AdjustFriendshipOnBattleFaint
2019-09-17 20:24:44 +01:00
2022-08-25 13:37:42 +01:00
// Constants for GetLeadMonFriendshipScore
2022-08-25 21:10:11 +01:00
# define FRIENDSHIP_NONE 0
# define FRIENDSHIP_1_TO_49 1
# define FRIENDSHIP_50_TO_99 2
# define FRIENDSHIP_100_TO_149 3
# define FRIENDSHIP_150_TO_199 4
# define FRIENDSHIP_200_TO_254 5
# define FRIENDSHIP_MAX 6
2022-08-25 13:37:42 +01:00
2023-11-14 20:29:38 +00:00
// Constants for GetBattlerAffectionHearts (based on friendship value)
# define AFFECTION_NO_HEARTS 0 // 0-79 friendship
# define AFFECTION_ONE_HEART 1 // 80-129 friendship
# define AFFECTION_TWO_HEARTS 2 // 130-179 friendship
# define AFFECTION_THREE_HEARTS 3 // 180-219 friendship
# define AFFECTION_FOUR_HEARTS 4 // 220-254 friendship
# define AFFECTION_FIVE_HEARTS 5 // Max friendship
2023-10-30 19:45:52 +00:00
// Friendship value that the majority of species use.
2024-01-26 17:15:45 +00:00
# define STANDARD_FRIENDSHIP ((P_UPDATED_FRIENDSHIP >= GEN_8) ? 50 : 70)
2023-03-14 11:54:49 +00:00
2021-11-10 01:02:12 +00:00
# define MAX_FRIENDSHIP 255
# define MAX_SHEEN 255
# define MAX_CONDITION 255
2019-12-18 07:32:52 +00:00
2021-01-07 22:13:14 +00:00
# define MAX_PER_STAT_IVS 31
# define MAX_IV_MASK 31
# define USE_RANDOM_IVS (MAX_PER_STAT_IVS + 1)
2024-01-26 17:15:45 +00:00
# define MAX_PER_STAT_EVS ((P_EV_CAP >= GEN_6) ? 252 : 255)
2019-09-17 20:24:44 +01:00
# define MAX_TOTAL_EVS 510
2024-01-26 17:15:45 +00:00
# define EV_ITEM_RAISE_LIMIT ((I_VITAMIN_EV_CAP >= GEN_8) ? MAX_PER_STAT_EVS : 100)
2019-09-17 20:24:44 +01:00
2023-12-20 09:08:26 +00:00
// Move category defines.
2024-01-29 11:51:32 +00:00
# define DAMAGE_CATEGORY_PHYSICAL 0
# define DAMAGE_CATEGORY_SPECIAL 1
# define DAMAGE_CATEGORY_STATUS 2
2019-09-17 20:53:30 +01:00
// Growth rates
# define GROWTH_MEDIUM_FAST 0
# define GROWTH_ERRATIC 1
# define GROWTH_FLUCTUATING 2
# define GROWTH_MEDIUM_SLOW 3
# define GROWTH_FAST 4
# define GROWTH_SLOW 5
2023-12-12 18:02:36 +00:00
// Body colors for Pokédex search
2019-09-17 20:53:30 +01:00
# define BODY_COLOR_RED 0
# define BODY_COLOR_BLUE 1
# define BODY_COLOR_YELLOW 2
# define BODY_COLOR_GREEN 3
# define BODY_COLOR_BLACK 4
# define BODY_COLOR_BROWN 5
# define BODY_COLOR_PURPLE 6
# define BODY_COLOR_GRAY 7
# define BODY_COLOR_WHITE 8
# define BODY_COLOR_PINK 9
# define F_SUMMARY_SCREEN_FLIP_SPRITE 0x80
2020-10-05 23:48:51 +01:00
// Evolution types
2023-12-11 16:54:34 +00:00
# define EVOLUTIONS_END 0xFFFF // Not an actual evolution, used to mark the end of an evolution array.
2024-10-21 11:33:21 +01:00
# define EVO_NONE 0 // Not an actual evolution, used to generate offspring that can't evolve into the specified species, like regional forms.
2020-10-11 06:10:12 +01:00
# define EVO_FRIENDSHIP 1 // Pokémon levels up with friendship ≥ 220
# define EVO_FRIENDSHIP_DAY 2 // Pokémon levels up during the day with friendship ≥ 220
# define EVO_FRIENDSHIP_NIGHT 3 // Pokémon levels up at night with friendship ≥ 220
# define EVO_LEVEL 4 // Pokémon reaches the specified level
# define EVO_TRADE 5 // Pokémon is traded
# define EVO_TRADE_ITEM 6 // Pokémon is traded while it's holding the specified item
# define EVO_ITEM 7 // specified item is used on Pokémon
# define EVO_LEVEL_ATK_GT_DEF 8 // Pokémon reaches the specified level with attack > defense
# define EVO_LEVEL_ATK_EQ_DEF 9 // Pokémon reaches the specified level with attack = defense
# define EVO_LEVEL_ATK_LT_DEF 10 // Pokémon reaches the specified level with attack < defense
# define EVO_LEVEL_SILCOON 11 // Pokémon reaches the specified level with a Silcoon personality value
# define EVO_LEVEL_CASCOON 12 // Pokémon reaches the specified level with a Cascoon personality value
# define EVO_LEVEL_NINJASK 13 // Pokémon reaches the specified level (special value for Ninjask)
# define EVO_LEVEL_SHEDINJA 14 // Pokémon reaches the specified level (special value for Shedinja)
# define EVO_BEAUTY 15 // Pokémon levels up with beauty ≥ specified value
2020-10-13 01:11:41 +01:00
# define EVO_LEVEL_FEMALE 16 // Pokémon reaches the specified level, is female
# define EVO_LEVEL_MALE 17 // Pokémon reaches the specified level, is male
# define EVO_LEVEL_NIGHT 18 // Pokémon reaches the specified level, is night
# define EVO_LEVEL_DAY 19 // Pokémon reaches the specified level, is day
# define EVO_LEVEL_DUSK 20 // Pokémon reaches the specified level, is dusk (5-6 P.M)
# define EVO_ITEM_HOLD_DAY 21 // Pokémon levels up, holds specified item at day
# define EVO_ITEM_HOLD_NIGHT 22 // Pokémon levels up, holds specified item at night
# define EVO_MOVE 23 // Pokémon levels up, knows specified move
2023-06-19 21:17:51 +01:00
# define EVO_FRIENDSHIP_MOVE_TYPE 24 // Pokémon levels up with friendship ≥ 220, knows move with specified type
2020-11-25 03:53:53 +00:00
# define EVO_MAPSEC 25 // Pokémon levels up on specified mapsec
2020-10-13 01:11:41 +01:00
# define EVO_ITEM_MALE 26 // specified item is used on a male Pokémon
# define EVO_ITEM_FEMALE 27 // specified item is used on a female Pokémon
2023-09-26 21:05:44 +01:00
# define EVO_LEVEL_RAIN 28 // Pokémon reaches the specified level during rain in the overworld
2020-10-13 01:11:41 +01:00
# define EVO_SPECIFIC_MON_IN_PARTY 29 // Pokémon levels up with a specified Pokémon in party
# define EVO_LEVEL_DARK_TYPE_MON_IN_PARTY 30 // Pokémon reaches the specified level with a Dark Type Pokémon in party
2020-10-15 00:16:18 +01:00
# define EVO_TRADE_SPECIFIC_MON 31 // Pokémon is traded for a specified Pokémon
2020-11-25 03:53:53 +00:00
# define EVO_SPECIFIC_MAP 32 // Pokémon levels up on specified map
2021-11-27 23:46:19 +00:00
# define EVO_LEVEL_NATURE_AMPED 33 // Pokémon reaches the specified level, it has a Hardy, Brave, Adamant, Naughty, Docile, Impish, Lax, Hasty, Jolly, Naive, Rash, Sassy, or Quirky nature.
# define EVO_LEVEL_NATURE_LOW_KEY 34 // Pokémon reaches the specified level, it has a Lonely, Bold, Relaxed, Timid, Serious, Modest, Mild, Quiet, Bashful, Calm, Gentle, or Careful nature.
2022-05-07 17:36:03 +01:00
# define EVO_CRITICAL_HITS 35 // Pokémon performs specified number of critical hits in one battle
2022-05-05 23:46:53 +01:00
# define EVO_SCRIPT_TRIGGER_DMG 36 // Pokémon has specified HP below max, then player interacts trigger
# define EVO_DARK_SCROLL 37 // interacts with Scroll of Darkness
# define EVO_WATER_SCROLL 38 // interacts with Scroll of Waters
2023-05-18 11:39:14 +01:00
# define EVO_ITEM_NIGHT 39 // specified item is used on Pokémon, is night
# define EVO_ITEM_DAY 40 // specified item is used on Pokémon, is day
# define EVO_ITEM_HOLD 41 // Pokémon levels up, holds specified item
2023-09-26 21:05:44 +01:00
# define EVO_LEVEL_FOG 42 // Pokémon reaches the specified level during fog in the overworld
2023-11-09 22:29:22 +00:00
# define EVO_MOVE_TWO_SEGMENT 43 // Pokémon levels up, knows specified move, has a personality value with a modulus of 0
2023-11-09 23:11:29 +00:00
# define EVO_MOVE_THREE_SEGMENT 44 // Pokémon levels up, knows specified move, has a personality value with a modulus of 1-99
2024-06-12 07:43:51 +01:00
# define EVO_LEVEL_FAMILY_OF_THREE 45 // Pokémon reaches the specified level in battle with a personality value with a modulus of 0
# define EVO_LEVEL_FAMILY_OF_FOUR 46 // Pokémon reaches the specified level in battle with a personality value with a modulus of 1-99
2024-05-22 10:06:24 +01:00
# define EVO_USE_MOVE_TWENTY_TIMES 47 // Pokémon levels up after having used a move for at least 20 times
# define EVO_RECOIL_DAMAGE_MALE 48 // Pokémon levels up after having suffered specified amount of non-fainting recoil damage as a male
# define EVO_RECOIL_DAMAGE_FEMALE 49 // Pokémon levels up after having suffered specified amount of non-fainting recoil damage as a female
# define EVO_ITEM_COUNT_999 50 // Pokémon levels up after trainer has collected 999 of a specific item
2024-07-27 20:41:05 +01:00
# define EVO_DEFEAT_THREE_WITH_ITEM 51 // Pokémon levels up after having defeat 3 Pokémon of the same species holding the specified item
2024-07-27 19:48:59 +01:00
# define EVO_OVERWORLD_STEPS 52 // Pokémon levels up after having taken a specific amount of steps in the overworld (or as the party lead if OW_FOLLOWERS_ENABLED is FALSE) without switching
2019-09-17 20:53:30 +01:00
2021-02-12 19:54:11 +00:00
// Evolution 'modes,' for GetEvolutionTargetSpecies
2022-05-05 19:55:31 +01:00
# define EVO_MODE_NORMAL 0
2024-03-17 21:03:40 +00:00
# define EVO_MODE_CANT_STOP 1
# define EVO_MODE_TRADE 2
# define EVO_MODE_ITEM_USE 3
# define EVO_MODE_ITEM_CHECK 4 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve
# define EVO_MODE_BATTLE_SPECIAL 5
# define EVO_MODE_OVERWORLD_SPECIAL 6
2024-06-13 16:44:28 +01:00
# define EVO_MODE_BATTLE_ONLY 7 // This mode is only used in battles to support Tandemaus' unique requirement
2021-02-12 19:54:11 +00:00
2021-11-01 16:02:08 +00:00
# define MON_PIC_WIDTH 64
# define MON_PIC_HEIGHT 64
# define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2)
2021-03-29 14:38:19 +01:00
2023-12-12 18:02:36 +00:00
// Most Pokémon have 2 frames (a default and an alternate for their animation).
2022-10-11 03:07:34 +01:00
// There are 4 exceptions:
// - Deoxys has 2 frames, 1 for each form
// - Spinda has 1 frame, presumably to avoid the work of animating its spots
// - Unown has 1 frame, presumably to avoid the work of animating all 28 of its forms
2023-06-30 08:58:07 +01:00
# define MAX_MON_PIC_FRAMES 2
2022-10-11 03:07:34 +01:00
2023-08-30 10:21:10 +01:00
# define BATTLE_ALIVE_EXCEPT_BATTLER 0
2023-08-30 11:46:22 +01:00
# define BATTLE_ALIVE_SIDE 1
2021-10-03 04:48:12 +01:00
# define SKIP_FRONT_ANIM (1 << 7)
2021-05-23 21:17:43 +01:00
# define NUM_ABILITY_SLOTS (NUM_NORMAL_ABILITY_SLOTS + NUM_HIDDEN_ABILITY_SLOTS)
# define NUM_NORMAL_ABILITY_SLOTS 2
# define NUM_HIDDEN_ABILITY_SLOTS 1
2021-04-17 02:36:45 +01:00
2024-02-15 14:22:25 +00:00
// Used as a signal for givemon to generate a default ability by personality.
# define NUM_ABILITY_PERSONALITY 0xFF
2024-02-15 07:01:34 +00:00
2022-04-16 17:51:02 +01:00
# define LEGENDARY_PERFECT_IV_COUNT 3
2018-02-08 10:17:41 +00:00
# endif // GUARD_CONSTANTS_POKEMON_H