From 84d713a50f01061e019a4b27d3d04401ad646908 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Thu, 14 Apr 2022 18:44:20 -0400 Subject: [PATCH 1/3] Legendary and Mythical flags --- include/constants/pokemon.h | 8 ++ include/constants/species.h | 6 -- src/data/pokemon/base_stats.h | 148 +++++++++++++++++++++++++++++++++- 3 files changed, 153 insertions(+), 9 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index f0a4ef6490..224a3f892a 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -387,4 +387,12 @@ #define NUM_NORMAL_ABILITY_SLOTS 2 #define NUM_HIDDEN_ABILITY_SLOTS 1 +// Species Flags +#define FLAG_LEGENDARY (1 << 0) +#define FLAG_MYTHICAL (1 << 1) +#define FLAG_ULTRA_BEAST (1 << 2) +#define FLAG_ALOLAN_FORM (1 << 3) +#define FLAG_GALARIAN_FORM (1 << 4) +#define FLAG_GENDER_DIFFERENCE (1 << 5) + #endif // GUARD_CONSTANTS_POKEMON_H diff --git a/include/constants/species.h b/include/constants/species.h index b3ba54c466..b8689a32af 100644 --- a/include/constants/species.h +++ b/include/constants/species.h @@ -1344,10 +1344,4 @@ #define SPECIES_EGG SPECIES_CALYREX_SHADOW_RIDER + 1 #define NUM_SPECIES SPECIES_EGG -// Species Flags -#define FLAG_ULTRA_BEAST (1 << 0) -#define FLAG_ALOLAN_FORM (1 << 1) -#define FLAG_GALARIAN_FORM (1 << 2) -#define FLAG_GENDER_DIFFERENCE (1 << 3) - #endif // GUARD_CONSTANTS_SPECIES_H diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index 8295f12ee1..636e8c8f49 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -4097,6 +4097,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ZAPDOS] = @@ -4125,6 +4126,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MOLTRES] = @@ -4149,6 +4151,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_FLAME_BODY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_DRATINI] = @@ -4256,6 +4259,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MEW] = @@ -4282,6 +4286,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SYNCHRONIZE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_CHIKORITA] = @@ -6902,6 +6907,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ENTEI] = @@ -6931,6 +6937,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SUICUNE] = @@ -6960,6 +6967,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LARVITAR] = @@ -7064,6 +7072,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_HO_OH] = @@ -7094,6 +7103,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_CELEBI] = @@ -7120,6 +7130,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_NATURAL_CURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_TREECKO] = @@ -10692,6 +10703,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_STURDY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_REGICE] = @@ -10720,6 +10732,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_REGISTEEL] = @@ -10749,6 +10762,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LATIAS] = @@ -10773,6 +10787,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LATIOS] = @@ -10797,6 +10812,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KYOGRE] = @@ -10821,6 +10837,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DRIZZLE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_GROUDON] = @@ -10845,6 +10862,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DROUGHT, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_RAYQUAZA] = @@ -10870,6 +10888,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_AIR_LOCK, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_JIRACHI] = @@ -10896,6 +10915,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SERENE_GRACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_DEOXYS] = @@ -10922,6 +10942,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_TURTWIG] = @@ -13568,6 +13589,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MESPRIT] = @@ -13594,6 +13616,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_AZELF] = @@ -13619,6 +13642,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_DIALGA] = @@ -13647,6 +13671,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_PALKIA] = @@ -13675,6 +13700,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_HEATRAN] = @@ -13699,6 +13725,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_FLASH_FIRE, ABILITY_NONE, ABILITY_FLAME_BODY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_REGIGIGAS] = @@ -13727,6 +13754,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_GIRATINA] = @@ -13755,6 +13783,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_CRESSELIA] = @@ -13779,6 +13808,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_PHIONE] = @@ -13807,6 +13837,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MANAPHY] = @@ -13835,6 +13866,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_DARKRAI] = @@ -13864,6 +13896,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_SHAYMIN] = @@ -13890,6 +13923,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_NATURAL_CURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS] = @@ -13918,6 +13952,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_VICTINI] = @@ -13946,6 +13981,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_SNIVY] = @@ -18050,6 +18086,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_TERRAKION] = @@ -18078,6 +18115,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_VIRIZION] = @@ -18106,6 +18144,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_TORNADUS] = @@ -18134,6 +18173,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_THUNDURUS] = @@ -18162,6 +18202,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_RESHIRAM] = @@ -18190,6 +18231,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ZEKROM] = @@ -18218,6 +18260,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LANDORUS] = @@ -18246,6 +18289,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KYUREM] = @@ -18272,6 +18316,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KELDEO] = @@ -18300,6 +18345,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MELOETTA] = @@ -18328,6 +18374,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SERENE_GRACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, + .flags = FLAG_MYTHICAL, }, [SPECIES_GENESECT] = @@ -18358,6 +18405,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_CHESPIN] = @@ -20270,6 +20318,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_YVELTAL] = @@ -20298,6 +20347,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ZYGARDE] = @@ -20326,6 +20376,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_DIANCIE] = @@ -20351,6 +20402,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_HOOPA] = @@ -20379,6 +20431,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_VOLCANION] = @@ -20403,6 +20456,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_WATER_ABSORB, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ROWLET] = @@ -21850,6 +21904,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY] = @@ -21878,6 +21933,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MINIOR] = @@ -22230,6 +22286,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_TAPU_LELE] = @@ -22258,6 +22315,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_TAPU_BULU] = @@ -22286,6 +22344,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_TAPU_FINI] = @@ -22314,6 +22373,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_COSMOG] = @@ -22342,6 +22402,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_COSMOEM] = @@ -22367,6 +22428,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_STURDY, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SOLGALEO] = @@ -22395,6 +22457,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LUNALA] = @@ -22423,6 +22486,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_NIHILEGO] = @@ -22658,6 +22722,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MAGEARNA] = @@ -22686,6 +22751,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MARSHADOW] = @@ -22715,6 +22781,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, + .flags = FLAG_MYTHICAL, }, [SPECIES_POIPOLE] = @@ -22855,6 +22922,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_VOLT_ABSORB, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MELTAN] = @@ -22879,6 +22947,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGNET_PULL, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MELMETAL] = @@ -22907,6 +22976,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_GROOKEY] = @@ -25131,6 +25201,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ZAMAZENTA] = @@ -25159,6 +25230,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ETERNATUS] = @@ -25183,6 +25255,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KUBFU] = @@ -25207,6 +25280,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_URSHIFU] = @@ -25235,6 +25309,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ZARUDE] = @@ -25263,6 +25338,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_REGIELEKI] = @@ -25291,6 +25367,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_REGIDRAGO] = @@ -25319,6 +25396,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_GLASTRIER] = @@ -25347,6 +25425,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SPECTRIER] = @@ -25375,6 +25454,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_CALYREX] = @@ -25403,6 +25483,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_VENUSAUR_MEGA] = @@ -25784,6 +25865,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MEWTWO_MEGA_Y] = @@ -25808,6 +25890,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INSOMNIA, ABILITY_INSOMNIA}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_AMPHAROS_MEGA] = @@ -26457,6 +26540,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_LEVITATE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LATIOS_MEGA] = @@ -26481,6 +26565,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_LEVITATE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LOPUNNY_MEGA] = @@ -26679,6 +26764,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_RAYQUAZA_MEGA] = @@ -26708,6 +26794,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KYOGRE_PRIMAL] = @@ -26736,6 +26823,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_GROUDON_PRIMAL] = @@ -26764,6 +26852,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_RATTATA_ALOLAN] = @@ -27573,7 +27662,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = FLAG_LEGENDARY | FLAG_GALARIAN_FORM, }, [SPECIES_ZAPDOS_GALARIAN] = @@ -27602,7 +27691,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = FLAG_LEGENDARY | FLAG_GALARIAN_FORM, }, [SPECIES_MOLTRES_GALARIAN] = @@ -27631,7 +27720,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = FLAG_LEGENDARY | FLAG_GALARIAN_FORM, }, [SPECIES_SLOWKING_GALARIAN] = @@ -29456,6 +29545,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_FLYING] = @@ -29484,6 +29574,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_POISON] = @@ -29512,6 +29603,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_GROUND] = @@ -29540,6 +29632,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_ROCK] = @@ -29568,6 +29661,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_BUG] = @@ -29596,6 +29690,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_GHOST] = @@ -29624,6 +29719,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_STEEL] = @@ -29652,6 +29748,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_FIRE] = @@ -29680,6 +29777,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_WATER] = @@ -29708,6 +29806,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_GRASS] = @@ -29736,6 +29835,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_ELECTRIC] = @@ -29764,6 +29864,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_PSYCHIC] = @@ -29792,6 +29893,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_ICE] = @@ -29820,6 +29922,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_DRAGON] = @@ -29848,6 +29951,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_DARK] = @@ -29876,6 +29980,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS_FAIRY] = @@ -29904,6 +30009,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_BASCULIN_BLUE_STRIPED] = @@ -30186,6 +30292,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_THUNDURUS_THERIAN] = @@ -30210,6 +30317,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_VOLT_ABSORB, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LANDORUS_THERIAN] = @@ -30234,6 +30342,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KYUREM_WHITE] = @@ -30262,6 +30371,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KYUREM_BLACK] = @@ -30290,6 +30400,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KELDEO_RESOLUTE] = @@ -30318,6 +30429,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = TRUE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MELOETTA_PIROUETTE] = @@ -30346,6 +30458,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SERENE_GRACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, + .flags = FLAG_MYTHICAL, }, [SPECIES_GENESECT_DOUSE_DRIVE] = @@ -30376,6 +30489,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_GENESECT_SHOCK_DRIVE] = @@ -30406,6 +30520,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_GENESECT_BURN_DRIVE] = @@ -30436,6 +30551,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_GENESECT_CHILL_DRIVE] = @@ -30466,6 +30582,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_GRENINJA_BATTLE_BOND] = @@ -32106,6 +32223,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ORICORIO_POM_POM] = @@ -32335,6 +32453,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_FLYING] = @@ -32363,6 +32482,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_POISON] = @@ -32391,6 +32511,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_GROUND] = @@ -32419,6 +32540,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_ROCK] = @@ -32447,6 +32569,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_BUG] = @@ -32475,6 +32598,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_GHOST] = @@ -32503,6 +32627,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_STEEL] = @@ -32531,6 +32656,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_FIRE] = @@ -32559,6 +32685,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_WATER] = @@ -32587,6 +32714,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_GRASS] = @@ -32615,6 +32743,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_ELECTRIC] = @@ -32643,6 +32772,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_PSYCHIC] = @@ -32671,6 +32801,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_ICE] = @@ -32699,6 +32830,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_DRAGON] = @@ -32727,6 +32859,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_DARK] = @@ -32755,6 +32888,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SILVALLY_FAIRY] = @@ -32783,6 +32917,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MINIOR_METEOR_ORANGE] = @@ -33229,6 +33364,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_NECROZMA_DAWN_WINGS] = @@ -33257,6 +33393,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_NECROZMA_ULTRA] = @@ -33287,6 +33424,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MAGEARNA_ORIGINAL_COLOR] = @@ -33315,6 +33453,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_CRAMORANT_GULPING] = @@ -33791,6 +33930,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ZAMAZENTA_CROWNED_SHIELD] = @@ -33819,6 +33959,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ETERNATUS_ETERNAMAX] = @@ -33843,6 +33984,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_URSHIFU_RAPID_STRIKE_STYLE] = From a6175d262219e68848d6d02fd234a2314b8cb639 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 16 Apr 2022 12:51:02 -0400 Subject: [PATCH 2/3] Config for Legendaries, Mythicals and Ultra Beasts to have at least 3 perfect IVs --- include/constants/pokemon.h | 2 + include/constants/pokemon_config.h | 1 + src/pokemon.c | 69 ++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 224a3f892a..ba9495158a 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -395,4 +395,6 @@ #define FLAG_GALARIAN_FORM (1 << 4) #define FLAG_GENDER_DIFFERENCE (1 << 5) +#define LEGENDARY_PERFECT_IV_COUNT 3 + #endif // GUARD_CONSTANTS_POKEMON_H diff --git a/include/constants/pokemon_config.h b/include/constants/pokemon_config.h index 257c06b7c0..aafa898d90 100644 --- a/include/constants/pokemon_config.h +++ b/include/constants/pokemon_config.h @@ -17,6 +17,7 @@ #define P_UPDATED_ABILITIES GEN_8 // Since Gen 6, certain Pokémon have their abilities changed. Requires BATTLE_ENGINE for Gen4+ abilities. #define P_UPDATED_EGG_GROUPS GEN_8 // Since Gen 8, certain Pokémon have gained new egg groups. #define P_SHEDINJA_BALL GEN_8 // Since Gen 4, Shedinja requires a Poké Ball for its evolution. In Gen 3, Shedinja inherits Nincada's Ball. +#define P_LEGENDARY_PERFECT_IVS GEN_8 // Since Gen 6, Legendaries, Mythicals and Ultra Beasts found in the wild or given through gifts have at least 3 perfect IVs. #define P_ENABLE_DEBUG TRUE // Enables a debug menu for pokemon sprites and icons, accessed by pressing SELECT in the summary screen. diff --git a/src/pokemon.c b/src/pokemon.c index f654dcf52a..5af93106a0 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -65,6 +65,7 @@ static bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId); static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move); static bool8 ShouldSkipFriendshipChange(void); static u8 SendMonToPC(struct Pokemon* mon); +static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv); EWRAM_DATA static u8 sLearningMoveTableID = 0; EWRAM_DATA u8 gPlayerPartyCount = 0; @@ -3204,6 +3205,9 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, u32 personality; u32 value; u16 checksum; + u8 i; + u8 availableIVs[NUM_STATS]; + u8 selectedIvs[LEGENDARY_PERFECT_IV_COUNT]; ZeroBoxMonData(boxMon); @@ -3286,6 +3290,52 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv); iv = (value & (MAX_IV_MASK << 10)) >> 10; SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); + + #if P_LEGENDARY_PERFECT_IVS >= GEN_6 + if (gBaseStats[species].flags & (FLAG_LEGENDARY | FLAG_MYTHICAL | FLAG_ULTRA_BEAST)) + { + // Initialize a list of IV indices. + for (i = 0; i < NUM_STATS; i++) + { + availableIVs[i] = i; + } + + // Select the 3 IVs that will be perfected. + for (i = 0; i < LEGENDARY_PERFECT_IV_COUNT; i++) + { + u8 index = Random() % (NUM_STATS - i); + selectedIvs[i] = availableIVs[index]; + RemoveIVIndexFromList(availableIVs, index); + } + for (i = 0; i < LEGENDARY_PERFECT_IV_COUNT; i++) + { + switch (selectedIvs[i]) + { + case STAT_HP: + SetBoxMonData(boxMon, MON_DATA_HP_IV, MAX_PER_STAT_IVS); + //iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_HP_IV); + //SetMonData(egg, MON_DATA_HP_IV, &iv); + break; + case STAT_ATK: + SetBoxMonData(boxMon, MON_DATA_ATK_IV, MAX_PER_STAT_IVS); + break; + case STAT_DEF: + SetBoxMonData(boxMon, MON_DATA_DEF_IV, MAX_PER_STAT_IVS); + break; + case STAT_SPEED: + SetBoxMonData(boxMon, MON_DATA_SPEED_IV, MAX_PER_STAT_IVS); + break; + case STAT_SPATK: + SetBoxMonData(boxMon, MON_DATA_SPATK_IV, MAX_PER_STAT_IVS); + break; + case STAT_SPDEF: + SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, MAX_PER_STAT_IVS); + break; + } + } + } + #endif + } if (gBaseStats[species].abilities[1]) @@ -8341,3 +8391,22 @@ u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove) } return 0; } + +static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv) +{ + s32 i, j; + u8 temp[NUM_STATS]; + + ivs[selectedIv] = 0xFF; + for (i = 0; i < NUM_STATS; i++) + { + temp[i] = ivs[i]; + } + + j = 0; + for (i = 0; i < NUM_STATS; i++) + { + if (temp[i] != 0xFF) + ivs[j++] = temp[i]; + } +} From 16283b47c799c0968fbd21afbf0542b338c98286 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 16 Apr 2022 15:57:38 -0400 Subject: [PATCH 3/3] Fixed compile. I had these changes in a testing branch but forgot to add them back here. --- src/pokemon.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 5af93106a0..f136fb03a7 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3294,6 +3294,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, #if P_LEGENDARY_PERFECT_IVS >= GEN_6 if (gBaseStats[species].flags & (FLAG_LEGENDARY | FLAG_MYTHICAL | FLAG_ULTRA_BEAST)) { + iv = MAX_PER_STAT_IVS; // Initialize a list of IV indices. for (i = 0; i < NUM_STATS; i++) { @@ -3312,24 +3313,22 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, switch (selectedIvs[i]) { case STAT_HP: - SetBoxMonData(boxMon, MON_DATA_HP_IV, MAX_PER_STAT_IVS); - //iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_HP_IV); - //SetMonData(egg, MON_DATA_HP_IV, &iv); + SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv); break; case STAT_ATK: - SetBoxMonData(boxMon, MON_DATA_ATK_IV, MAX_PER_STAT_IVS); + SetBoxMonData(boxMon, MON_DATA_ATK_IV, &iv); break; case STAT_DEF: - SetBoxMonData(boxMon, MON_DATA_DEF_IV, MAX_PER_STAT_IVS); + SetBoxMonData(boxMon, MON_DATA_DEF_IV, &iv); break; case STAT_SPEED: - SetBoxMonData(boxMon, MON_DATA_SPEED_IV, MAX_PER_STAT_IVS); + SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &iv); break; case STAT_SPATK: - SetBoxMonData(boxMon, MON_DATA_SPATK_IV, MAX_PER_STAT_IVS); + SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv); break; case STAT_SPDEF: - SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, MAX_PER_STAT_IVS); + SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); break; } }