pokeemerald/src/pokemon.c

8051 lines
290 KiB
C
Raw Normal View History

2017-09-06 17:19:08 +02:00
#include "global.h"
#include "malloc.h"
2018-11-14 01:01:50 +01:00
#include "apprentice.h"
2018-02-09 15:55:12 +01:00
#include "battle.h"
#include "battle_anim.h"
2018-02-09 18:46:00 +01:00
#include "battle_controllers.h"
2018-02-10 02:06:32 +01:00
#include "battle_message.h"
2018-11-14 01:01:50 +01:00
#include "battle_pike.h"
2018-11-18 17:52:22 +01:00
#include "battle_pyramid.h"
2018-11-14 01:01:50 +01:00
#include "battle_setup.h"
#include "battle_tower.h"
2019-04-04 23:53:06 +02:00
#include "data.h"
2018-11-14 01:01:50 +01:00
#include "event_data.h"
2018-02-09 18:46:00 +01:00
#include "evolution_scene.h"
2019-03-02 08:44:02 +01:00
#include "field_specials.h"
2019-04-03 22:19:18 +02:00
#include "field_weather.h"
2018-11-14 01:01:50 +01:00
#include "item.h"
#include "link.h"
#include "main.h"
2018-12-24 00:02:29 +01:00
#include "overworld.h"
2018-11-14 01:01:50 +01:00
#include "m4a.h"
2018-12-24 00:02:29 +01:00
#include "party_menu.h"
2018-02-10 02:06:32 +01:00
#include "pokedex.h"
#include "pokeblock.h"
2018-11-14 01:01:50 +01:00
#include "pokemon.h"
#include "pokemon_animation.h"
2019-04-07 12:40:18 +02:00
#include "pokemon_icon.h"
2018-12-24 00:02:29 +01:00
#include "pokemon_summary_screen.h"
2018-11-14 01:01:50 +01:00
#include "pokemon_storage_system.h"
#include "random.h"
#include "recorded_battle.h"
#include "rtc.h"
2018-02-10 02:06:32 +01:00
#include "sound.h"
2018-11-14 01:01:50 +01:00
#include "string_util.h"
#include "strings.h"
2018-02-10 02:06:32 +01:00
#include "task.h"
2018-11-14 01:01:50 +01:00
#include "text.h"
2019-01-13 20:50:08 +01:00
#include "trainer_hill.h"
2018-02-10 13:24:03 +01:00
#include "util.h"
2018-11-14 01:01:50 +01:00
#include "constants/abilities.h"
#include "constants/battle_frontier.h"
#include "constants/battle_move_effects.h"
#include "constants/hold_effects.h"
2019-04-14 17:20:26 +02:00
#include "constants/item_effects.h"
2018-11-14 01:01:50 +01:00
#include "constants/items.h"
2019-01-31 22:51:20 +01:00
#include "constants/layouts.h"
2018-11-14 01:01:50 +01:00
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/trainers.h"
2019-04-03 22:19:18 +02:00
#include "constants/weather.h"
struct SpeciesItem
{
u16 species;
u16 item;
};
2017-09-06 17:19:08 +02:00
2018-02-09 15:55:12 +01:00
// this file's functions
2018-02-11 17:35:01 +01:00
static u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon);
static union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u8 substructType);
static void EncryptBoxMon(struct BoxPokemon *boxMon);
static void DecryptBoxMon(struct BoxPokemon *boxMon);
2020-12-24 22:18:47 +01:00
static void Task_PlayMapChosenOrBattleBGM(u8 taskId);
2018-02-11 17:35:01 +01:00
static bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId);
2019-10-18 01:22:03 +02:00
static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
2020-02-02 19:28:54 +01:00
static bool8 ShouldSkipFriendshipChange(void);
2017-09-06 17:19:08 +02:00
2018-02-05 17:56:28 +01:00
// EWRAM vars
EWRAM_DATA static u8 sLearningMoveTableID = 0;
2018-02-05 17:56:28 +01:00
EWRAM_DATA u8 gPlayerPartyCount = 0;
EWRAM_DATA u8 gEnemyPartyCount = 0;
EWRAM_DATA struct Pokemon gPlayerParty[PARTY_SIZE] = {0};
EWRAM_DATA struct Pokemon gEnemyParty[PARTY_SIZE] = {0};
EWRAM_DATA struct SpriteTemplate gMultiuseSpriteTemplate = {0};
EWRAM_DATA struct Unknown_806F160_Struct *gUnknown_020249B4[2] = {NULL};
2018-02-05 17:56:28 +01:00
2018-02-05 17:39:26 +01:00
// const rom data
2018-02-26 12:59:52 +01:00
#include "data/battle_moves.h"
2020-02-01 18:04:51 +01:00
// Used in an unreferenced function in RS.
// Unreferenced here and in FRLG.
struct CombinedMove
{
u16 move1;
u16 move2;
u16 newMove;
};
static const struct CombinedMove sCombinedMoves[2] =
{
{MOVE_EMBER, MOVE_GUST, MOVE_HEAT_WAVE},
{0xFFFF, 0xFFFF, 0xFFFF}
};
2018-02-26 12:59:52 +01:00
2018-12-03 14:49:16 +01:00
#define SPECIES_TO_HOENN(name) [SPECIES_##name - 1] = HOENN_DEX_##name
#define SPECIES_TO_NATIONAL(name) [SPECIES_##name - 1] = NATIONAL_DEX_##name
#define HOENN_TO_NATIONAL(name) [HOENN_DEX_##name - 1] = NATIONAL_DEX_##name
2019-04-02 21:22:16 +02:00
const u16 gSpeciesToHoennPokedexNum[NUM_SPECIES] = // Assigns all species to the Hoenn Dex Index (Summary No. for Hoenn Dex)
{
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(TREECKO),
SPECIES_TO_HOENN(GROVYLE),
SPECIES_TO_HOENN(SCEPTILE),
SPECIES_TO_HOENN(TORCHIC),
SPECIES_TO_HOENN(COMBUSKEN),
SPECIES_TO_HOENN(BLAZIKEN),
SPECIES_TO_HOENN(MUDKIP),
SPECIES_TO_HOENN(MARSHTOMP),
SPECIES_TO_HOENN(SWAMPERT),
SPECIES_TO_HOENN(POOCHYENA),
SPECIES_TO_HOENN(MIGHTYENA),
SPECIES_TO_HOENN(ZIGZAGOON),
SPECIES_TO_HOENN(LINOONE),
SPECIES_TO_HOENN(WURMPLE),
SPECIES_TO_HOENN(SILCOON),
SPECIES_TO_HOENN(BEAUTIFLY),
SPECIES_TO_HOENN(CASCOON),
SPECIES_TO_HOENN(DUSTOX),
SPECIES_TO_HOENN(LOTAD),
SPECIES_TO_HOENN(LOMBRE),
SPECIES_TO_HOENN(LUDICOLO),
SPECIES_TO_HOENN(SEEDOT),
SPECIES_TO_HOENN(NUZLEAF),
SPECIES_TO_HOENN(SHIFTRY),
SPECIES_TO_HOENN(TAILLOW),
SPECIES_TO_HOENN(SWELLOW),
SPECIES_TO_HOENN(WINGULL),
SPECIES_TO_HOENN(PELIPPER),
2019-04-02 21:22:16 +02:00
SPECIES_TO_HOENN(RALTS),
SPECIES_TO_HOENN(KIRLIA),
SPECIES_TO_HOENN(GARDEVOIR),
SPECIES_TO_HOENN(GALLADE),
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(SURSKIT),
SPECIES_TO_HOENN(MASQUERAIN),
2019-04-02 21:22:16 +02:00
SPECIES_TO_HOENN(SHROOMISH),
SPECIES_TO_HOENN(BRELOOM),
SPECIES_TO_HOENN(SLAKOTH),
SPECIES_TO_HOENN(VIGOROTH),
SPECIES_TO_HOENN(SLAKING),
SPECIES_TO_HOENN(ABRA),
SPECIES_TO_HOENN(KADABRA),
SPECIES_TO_HOENN(ALAKAZAM),
SPECIES_TO_HOENN(NINCADA),
SPECIES_TO_HOENN(NINJASK),
SPECIES_TO_HOENN(SHEDINJA),
SPECIES_TO_HOENN(WHISMUR),
SPECIES_TO_HOENN(LOUDRED),
SPECIES_TO_HOENN(EXPLOUD),
SPECIES_TO_HOENN(MAKUHITA),
SPECIES_TO_HOENN(HARIYAMA),
SPECIES_TO_HOENN(GOLDEEN),
SPECIES_TO_HOENN(SEAKING),
SPECIES_TO_HOENN(MAGIKARP),
SPECIES_TO_HOENN(GYARADOS),
SPECIES_TO_HOENN(AZURILL),
SPECIES_TO_HOENN(MARILL),
SPECIES_TO_HOENN(AZUMARILL),
SPECIES_TO_HOENN(GEODUDE),
SPECIES_TO_HOENN(GRAVELER),
SPECIES_TO_HOENN(GOLEM),
SPECIES_TO_HOENN(NOSEPASS),
SPECIES_TO_HOENN(PROBOPASS),
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(SKITTY),
SPECIES_TO_HOENN(DELCATTY),
2019-04-02 21:22:16 +02:00
SPECIES_TO_HOENN(ZUBAT),
SPECIES_TO_HOENN(GOLBAT),
SPECIES_TO_HOENN(CROBAT),
SPECIES_TO_HOENN(TENTACOOL),
SPECIES_TO_HOENN(TENTACRUEL),
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(SABLEYE),
2019-04-02 21:22:16 +02:00
SPECIES_TO_HOENN(MAWILE),
SPECIES_TO_HOENN(ARON),
SPECIES_TO_HOENN(LAIRON),
SPECIES_TO_HOENN(AGGRON),
SPECIES_TO_HOENN(MACHOP),
SPECIES_TO_HOENN(MACHOKE),
SPECIES_TO_HOENN(MACHAMP),
SPECIES_TO_HOENN(MEDITITE),
SPECIES_TO_HOENN(MEDICHAM),
SPECIES_TO_HOENN(ELECTRIKE),
SPECIES_TO_HOENN(MANECTRIC),
SPECIES_TO_HOENN(PLUSLE),
SPECIES_TO_HOENN(MINUN),
SPECIES_TO_HOENN(MAGNEMITE),
SPECIES_TO_HOENN(MAGNETON),
SPECIES_TO_HOENN(MAGNEZONE),
SPECIES_TO_HOENN(VOLTORB),
SPECIES_TO_HOENN(ELECTRODE),
SPECIES_TO_HOENN(VOLBEAT),
SPECIES_TO_HOENN(ILLUMISE),
SPECIES_TO_HOENN(ODDISH),
SPECIES_TO_HOENN(GLOOM),
SPECIES_TO_HOENN(VILEPLUME),
SPECIES_TO_HOENN(BELLOSSOM),
SPECIES_TO_HOENN(DODUO),
SPECIES_TO_HOENN(DODRIO),
SPECIES_TO_HOENN(BUDEW),
SPECIES_TO_HOENN(ROSELIA),
SPECIES_TO_HOENN(ROSERADE),
SPECIES_TO_HOENN(GULPIN),
SPECIES_TO_HOENN(SWALOT),
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(CARVANHA),
SPECIES_TO_HOENN(SHARPEDO),
2019-04-02 21:22:16 +02:00
SPECIES_TO_HOENN(WAILMER),
SPECIES_TO_HOENN(WAILORD),
SPECIES_TO_HOENN(NUMEL),
SPECIES_TO_HOENN(CAMERUPT),
SPECIES_TO_HOENN(SLUGMA),
SPECIES_TO_HOENN(MAGCARGO),
SPECIES_TO_HOENN(TORKOAL),
SPECIES_TO_HOENN(GRIMER),
SPECIES_TO_HOENN(MUK),
SPECIES_TO_HOENN(KOFFING),
SPECIES_TO_HOENN(WEEZING),
SPECIES_TO_HOENN(SPOINK),
SPECIES_TO_HOENN(GRUMPIG),
SPECIES_TO_HOENN(SANDSHREW),
SPECIES_TO_HOENN(SANDSLASH),
SPECIES_TO_HOENN(SPINDA),
SPECIES_TO_HOENN(SKARMORY),
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(TRAPINCH),
SPECIES_TO_HOENN(VIBRAVA),
SPECIES_TO_HOENN(FLYGON),
SPECIES_TO_HOENN(CACNEA),
SPECIES_TO_HOENN(CACTURNE),
SPECIES_TO_HOENN(SWABLU),
SPECIES_TO_HOENN(ALTARIA),
2019-04-02 21:22:16 +02:00
SPECIES_TO_HOENN(ZANGOOSE),
SPECIES_TO_HOENN(SEVIPER),
SPECIES_TO_HOENN(LUNATONE),
SPECIES_TO_HOENN(SOLROCK),
SPECIES_TO_HOENN(BARBOACH),
SPECIES_TO_HOENN(WHISCASH),
SPECIES_TO_HOENN(CORPHISH),
SPECIES_TO_HOENN(CRAWDAUNT),
SPECIES_TO_HOENN(BALTOY),
SPECIES_TO_HOENN(CLAYDOL),
SPECIES_TO_HOENN(LILEEP),
SPECIES_TO_HOENN(CRADILY),
SPECIES_TO_HOENN(ANORITH),
SPECIES_TO_HOENN(ARMALDO),
SPECIES_TO_HOENN(IGGLYBUFF),
SPECIES_TO_HOENN(JIGGLYPUFF),
SPECIES_TO_HOENN(WIGGLYTUFF),
SPECIES_TO_HOENN(FEEBAS),
SPECIES_TO_HOENN(MILOTIC),
SPECIES_TO_HOENN(CASTFORM),
SPECIES_TO_HOENN(STARYU),
SPECIES_TO_HOENN(STARMIE),
SPECIES_TO_HOENN(KECLEON),
SPECIES_TO_HOENN(SHUPPET),
SPECIES_TO_HOENN(BANETTE),
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(DUSKULL),
SPECIES_TO_HOENN(DUSCLOPS),
2019-04-02 21:22:16 +02:00
SPECIES_TO_HOENN(DUSKNOIR),
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(TROPIUS),
2019-04-02 21:22:16 +02:00
SPECIES_TO_HOENN(CHINGLING),
SPECIES_TO_HOENN(CHIMECHO),
SPECIES_TO_HOENN(ABSOL),
SPECIES_TO_HOENN(VULPIX),
SPECIES_TO_HOENN(NINETALES),
SPECIES_TO_HOENN(PICHU),
SPECIES_TO_HOENN(PIKACHU),
SPECIES_TO_HOENN(RAICHU),
SPECIES_TO_HOENN(PSYDUCK),
SPECIES_TO_HOENN(GOLDUCK),
SPECIES_TO_HOENN(WYNAUT),
SPECIES_TO_HOENN(WOBBUFFET),
SPECIES_TO_HOENN(NATU),
SPECIES_TO_HOENN(XATU),
SPECIES_TO_HOENN(GIRAFARIG),
SPECIES_TO_HOENN(PHANPY),
SPECIES_TO_HOENN(DONPHAN),
SPECIES_TO_HOENN(PINSIR),
SPECIES_TO_HOENN(HERACROSS),
SPECIES_TO_HOENN(RHYHORN),
SPECIES_TO_HOENN(RHYDON),
SPECIES_TO_HOENN(RHYPERIOR),
SPECIES_TO_HOENN(SNORUNT),
SPECIES_TO_HOENN(GLALIE),
SPECIES_TO_HOENN(FROSLASS),
SPECIES_TO_HOENN(SPHEAL),
SPECIES_TO_HOENN(SEALEO),
SPECIES_TO_HOENN(WALREIN),
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(CLAMPERL),
SPECIES_TO_HOENN(HUNTAIL),
SPECIES_TO_HOENN(GOREBYSS),
SPECIES_TO_HOENN(RELICANTH),
2019-04-02 21:22:16 +02:00
SPECIES_TO_HOENN(CORSOLA),
SPECIES_TO_HOENN(CHINCHOU),
SPECIES_TO_HOENN(LANTURN),
SPECIES_TO_HOENN(LUVDISC),
SPECIES_TO_HOENN(HORSEA),
SPECIES_TO_HOENN(SEADRA),
SPECIES_TO_HOENN(KINGDRA),
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(BAGON),
SPECIES_TO_HOENN(SHELGON),
SPECIES_TO_HOENN(SALAMENCE),
SPECIES_TO_HOENN(BELDUM),
SPECIES_TO_HOENN(METANG),
SPECIES_TO_HOENN(METAGROSS),
SPECIES_TO_HOENN(REGIROCK),
SPECIES_TO_HOENN(REGICE),
SPECIES_TO_HOENN(REGISTEEL),
2019-04-02 21:22:16 +02:00
SPECIES_TO_HOENN(LATIAS),
SPECIES_TO_HOENN(LATIOS),
2018-12-03 14:49:16 +01:00
SPECIES_TO_HOENN(KYOGRE),
SPECIES_TO_HOENN(GROUDON),
SPECIES_TO_HOENN(RAYQUAZA),
SPECIES_TO_HOENN(JIRACHI),
SPECIES_TO_HOENN(DEOXYS),
};
2019-04-02 21:22:16 +02:00
const u16 gSpeciesToNationalPokedexNum[NUM_SPECIES] = // Assigns all species to the National Dex Index (Summary No. for National Dex)
{
2020-11-13 20:13:13 +01:00
SPECIES_TO_NATIONAL(BULBASAUR),
SPECIES_TO_NATIONAL(IVYSAUR),
SPECIES_TO_NATIONAL(VENUSAUR),
SPECIES_TO_NATIONAL(CHARMANDER),
SPECIES_TO_NATIONAL(CHARMELEON),
SPECIES_TO_NATIONAL(CHARIZARD),
SPECIES_TO_NATIONAL(SQUIRTLE),
SPECIES_TO_NATIONAL(WARTORTLE),
SPECIES_TO_NATIONAL(BLASTOISE),
SPECIES_TO_NATIONAL(CATERPIE),
SPECIES_TO_NATIONAL(METAPOD),
SPECIES_TO_NATIONAL(BUTTERFREE),
SPECIES_TO_NATIONAL(WEEDLE),
SPECIES_TO_NATIONAL(KAKUNA),
SPECIES_TO_NATIONAL(BEEDRILL),
SPECIES_TO_NATIONAL(PIDGEY),
SPECIES_TO_NATIONAL(PIDGEOTTO),
SPECIES_TO_NATIONAL(PIDGEOT),
SPECIES_TO_NATIONAL(RATTATA),
SPECIES_TO_NATIONAL(RATICATE),
SPECIES_TO_NATIONAL(SPEAROW),
SPECIES_TO_NATIONAL(FEAROW),
SPECIES_TO_NATIONAL(EKANS),
SPECIES_TO_NATIONAL(ARBOK),
SPECIES_TO_NATIONAL(PIKACHU),
SPECIES_TO_NATIONAL(RAICHU),
SPECIES_TO_NATIONAL(SANDSHREW),
SPECIES_TO_NATIONAL(SANDSLASH),
SPECIES_TO_NATIONAL(NIDORAN_F),
SPECIES_TO_NATIONAL(NIDORINA),
SPECIES_TO_NATIONAL(NIDOQUEEN),
SPECIES_TO_NATIONAL(NIDORAN_M),
SPECIES_TO_NATIONAL(NIDORINO),
SPECIES_TO_NATIONAL(NIDOKING),
SPECIES_TO_NATIONAL(CLEFAIRY),
SPECIES_TO_NATIONAL(CLEFABLE),
SPECIES_TO_NATIONAL(VULPIX),
SPECIES_TO_NATIONAL(NINETALES),
SPECIES_TO_NATIONAL(JIGGLYPUFF),
SPECIES_TO_NATIONAL(WIGGLYTUFF),
SPECIES_TO_NATIONAL(ZUBAT),
SPECIES_TO_NATIONAL(GOLBAT),
SPECIES_TO_NATIONAL(ODDISH),
SPECIES_TO_NATIONAL(GLOOM),
SPECIES_TO_NATIONAL(VILEPLUME),
SPECIES_TO_NATIONAL(PARAS),
SPECIES_TO_NATIONAL(PARASECT),
SPECIES_TO_NATIONAL(VENONAT),
SPECIES_TO_NATIONAL(VENOMOTH),
SPECIES_TO_NATIONAL(DIGLETT),
SPECIES_TO_NATIONAL(DUGTRIO),
SPECIES_TO_NATIONAL(MEOWTH),
SPECIES_TO_NATIONAL(PERSIAN),
SPECIES_TO_NATIONAL(PSYDUCK),
SPECIES_TO_NATIONAL(GOLDUCK),
SPECIES_TO_NATIONAL(MANKEY),
SPECIES_TO_NATIONAL(PRIMEAPE),
SPECIES_TO_NATIONAL(GROWLITHE),
SPECIES_TO_NATIONAL(ARCANINE),
SPECIES_TO_NATIONAL(POLIWAG),
SPECIES_TO_NATIONAL(POLIWHIRL),
SPECIES_TO_NATIONAL(POLIWRATH),
SPECIES_TO_NATIONAL(ABRA),
SPECIES_TO_NATIONAL(KADABRA),
SPECIES_TO_NATIONAL(ALAKAZAM),
SPECIES_TO_NATIONAL(MACHOP),
SPECIES_TO_NATIONAL(MACHOKE),
SPECIES_TO_NATIONAL(MACHAMP),
SPECIES_TO_NATIONAL(BELLSPROUT),
SPECIES_TO_NATIONAL(WEEPINBELL),
SPECIES_TO_NATIONAL(VICTREEBEL),
SPECIES_TO_NATIONAL(TENTACOOL),
SPECIES_TO_NATIONAL(TENTACRUEL),
SPECIES_TO_NATIONAL(GEODUDE),
SPECIES_TO_NATIONAL(GRAVELER),
SPECIES_TO_NATIONAL(GOLEM),
SPECIES_TO_NATIONAL(PONYTA),
SPECIES_TO_NATIONAL(RAPIDASH),
SPECIES_TO_NATIONAL(SLOWPOKE),
SPECIES_TO_NATIONAL(SLOWBRO),
SPECIES_TO_NATIONAL(MAGNEMITE),
SPECIES_TO_NATIONAL(MAGNETON),
SPECIES_TO_NATIONAL(FARFETCHD),
SPECIES_TO_NATIONAL(DODUO),
SPECIES_TO_NATIONAL(DODRIO),
SPECIES_TO_NATIONAL(SEEL),
SPECIES_TO_NATIONAL(DEWGONG),
SPECIES_TO_NATIONAL(GRIMER),
SPECIES_TO_NATIONAL(MUK),
SPECIES_TO_NATIONAL(SHELLDER),
SPECIES_TO_NATIONAL(CLOYSTER),
SPECIES_TO_NATIONAL(GASTLY),
SPECIES_TO_NATIONAL(HAUNTER),
SPECIES_TO_NATIONAL(GENGAR),
SPECIES_TO_NATIONAL(ONIX),
SPECIES_TO_NATIONAL(DROWZEE),
SPECIES_TO_NATIONAL(HYPNO),
SPECIES_TO_NATIONAL(KRABBY),
SPECIES_TO_NATIONAL(KINGLER),
SPECIES_TO_NATIONAL(VOLTORB),
SPECIES_TO_NATIONAL(ELECTRODE),
SPECIES_TO_NATIONAL(EXEGGCUTE),
SPECIES_TO_NATIONAL(EXEGGUTOR),
SPECIES_TO_NATIONAL(CUBONE),
SPECIES_TO_NATIONAL(MAROWAK),
SPECIES_TO_NATIONAL(HITMONLEE),
SPECIES_TO_NATIONAL(HITMONCHAN),
SPECIES_TO_NATIONAL(LICKITUNG),
SPECIES_TO_NATIONAL(KOFFING),
SPECIES_TO_NATIONAL(WEEZING),
SPECIES_TO_NATIONAL(RHYHORN),
SPECIES_TO_NATIONAL(RHYDON),
SPECIES_TO_NATIONAL(CHANSEY),
SPECIES_TO_NATIONAL(TANGELA),
SPECIES_TO_NATIONAL(KANGASKHAN),
SPECIES_TO_NATIONAL(HORSEA),
SPECIES_TO_NATIONAL(SEADRA),
SPECIES_TO_NATIONAL(GOLDEEN),
SPECIES_TO_NATIONAL(SEAKING),
SPECIES_TO_NATIONAL(STARYU),
SPECIES_TO_NATIONAL(STARMIE),
SPECIES_TO_NATIONAL(MR_MIME),
SPECIES_TO_NATIONAL(SCYTHER),
SPECIES_TO_NATIONAL(JYNX),
SPECIES_TO_NATIONAL(ELECTABUZZ),
SPECIES_TO_NATIONAL(MAGMAR),
SPECIES_TO_NATIONAL(PINSIR),
SPECIES_TO_NATIONAL(TAUROS),
SPECIES_TO_NATIONAL(MAGIKARP),
SPECIES_TO_NATIONAL(GYARADOS),
SPECIES_TO_NATIONAL(LAPRAS),
SPECIES_TO_NATIONAL(DITTO),
SPECIES_TO_NATIONAL(EEVEE),
SPECIES_TO_NATIONAL(VAPOREON),
SPECIES_TO_NATIONAL(JOLTEON),
SPECIES_TO_NATIONAL(FLAREON),
SPECIES_TO_NATIONAL(PORYGON),
SPECIES_TO_NATIONAL(OMANYTE),
SPECIES_TO_NATIONAL(OMASTAR),
SPECIES_TO_NATIONAL(KABUTO),
SPECIES_TO_NATIONAL(KABUTOPS),
SPECIES_TO_NATIONAL(AERODACTYL),
SPECIES_TO_NATIONAL(SNORLAX),
SPECIES_TO_NATIONAL(ARTICUNO),
SPECIES_TO_NATIONAL(ZAPDOS),
SPECIES_TO_NATIONAL(MOLTRES),
SPECIES_TO_NATIONAL(DRATINI),
SPECIES_TO_NATIONAL(DRAGONAIR),
SPECIES_TO_NATIONAL(DRAGONITE),
SPECIES_TO_NATIONAL(MEWTWO),
SPECIES_TO_NATIONAL(MEW),
SPECIES_TO_NATIONAL(CHIKORITA),
SPECIES_TO_NATIONAL(BAYLEEF),
SPECIES_TO_NATIONAL(MEGANIUM),
SPECIES_TO_NATIONAL(CYNDAQUIL),
SPECIES_TO_NATIONAL(QUILAVA),
SPECIES_TO_NATIONAL(TYPHLOSION),
SPECIES_TO_NATIONAL(TOTODILE),
SPECIES_TO_NATIONAL(CROCONAW),
SPECIES_TO_NATIONAL(FERALIGATR),
SPECIES_TO_NATIONAL(SENTRET),
SPECIES_TO_NATIONAL(FURRET),
SPECIES_TO_NATIONAL(HOOTHOOT),
SPECIES_TO_NATIONAL(NOCTOWL),
SPECIES_TO_NATIONAL(LEDYBA),
SPECIES_TO_NATIONAL(LEDIAN),
SPECIES_TO_NATIONAL(SPINARAK),
SPECIES_TO_NATIONAL(ARIADOS),
SPECIES_TO_NATIONAL(CROBAT),
SPECIES_TO_NATIONAL(CHINCHOU),
SPECIES_TO_NATIONAL(LANTURN),
SPECIES_TO_NATIONAL(PICHU),
SPECIES_TO_NATIONAL(CLEFFA),
SPECIES_TO_NATIONAL(IGGLYBUFF),
SPECIES_TO_NATIONAL(TOGEPI),
SPECIES_TO_NATIONAL(TOGETIC),
SPECIES_TO_NATIONAL(NATU),
SPECIES_TO_NATIONAL(XATU),
SPECIES_TO_NATIONAL(MAREEP),
SPECIES_TO_NATIONAL(FLAAFFY),
SPECIES_TO_NATIONAL(AMPHAROS),
SPECIES_TO_NATIONAL(BELLOSSOM),
SPECIES_TO_NATIONAL(MARILL),
SPECIES_TO_NATIONAL(AZUMARILL),
SPECIES_TO_NATIONAL(SUDOWOODO),
SPECIES_TO_NATIONAL(POLITOED),
SPECIES_TO_NATIONAL(HOPPIP),
SPECIES_TO_NATIONAL(SKIPLOOM),
SPECIES_TO_NATIONAL(JUMPLUFF),
SPECIES_TO_NATIONAL(AIPOM),
SPECIES_TO_NATIONAL(SUNKERN),
SPECIES_TO_NATIONAL(SUNFLORA),
SPECIES_TO_NATIONAL(YANMA),
SPECIES_TO_NATIONAL(WOOPER),
SPECIES_TO_NATIONAL(QUAGSIRE),
SPECIES_TO_NATIONAL(ESPEON),
SPECIES_TO_NATIONAL(UMBREON),
SPECIES_TO_NATIONAL(MURKROW),
SPECIES_TO_NATIONAL(SLOWKING),
SPECIES_TO_NATIONAL(MISDREAVUS),
SPECIES_TO_NATIONAL(UNOWN),
SPECIES_TO_NATIONAL(WOBBUFFET),
SPECIES_TO_NATIONAL(GIRAFARIG),
SPECIES_TO_NATIONAL(PINECO),
SPECIES_TO_NATIONAL(FORRETRESS),
SPECIES_TO_NATIONAL(DUNSPARCE),
SPECIES_TO_NATIONAL(GLIGAR),
SPECIES_TO_NATIONAL(STEELIX),
SPECIES_TO_NATIONAL(SNUBBULL),
SPECIES_TO_NATIONAL(GRANBULL),
SPECIES_TO_NATIONAL(QWILFISH),
SPECIES_TO_NATIONAL(SCIZOR),
SPECIES_TO_NATIONAL(SHUCKLE),
SPECIES_TO_NATIONAL(HERACROSS),
SPECIES_TO_NATIONAL(SNEASEL),
SPECIES_TO_NATIONAL(TEDDIURSA),
SPECIES_TO_NATIONAL(URSARING),
SPECIES_TO_NATIONAL(SLUGMA),
SPECIES_TO_NATIONAL(MAGCARGO),
SPECIES_TO_NATIONAL(SWINUB),
SPECIES_TO_NATIONAL(PILOSWINE),
SPECIES_TO_NATIONAL(CORSOLA),
SPECIES_TO_NATIONAL(REMORAID),
SPECIES_TO_NATIONAL(OCTILLERY),
SPECIES_TO_NATIONAL(DELIBIRD),
SPECIES_TO_NATIONAL(MANTINE),
SPECIES_TO_NATIONAL(SKARMORY),
SPECIES_TO_NATIONAL(HOUNDOUR),
SPECIES_TO_NATIONAL(HOUNDOOM),
SPECIES_TO_NATIONAL(KINGDRA),
SPECIES_TO_NATIONAL(PHANPY),
SPECIES_TO_NATIONAL(DONPHAN),
SPECIES_TO_NATIONAL(PORYGON2),
SPECIES_TO_NATIONAL(STANTLER),
SPECIES_TO_NATIONAL(SMEARGLE),
SPECIES_TO_NATIONAL(TYROGUE),
SPECIES_TO_NATIONAL(HITMONTOP),
SPECIES_TO_NATIONAL(SMOOCHUM),
SPECIES_TO_NATIONAL(ELEKID),
SPECIES_TO_NATIONAL(MAGBY),
SPECIES_TO_NATIONAL(MILTANK),
SPECIES_TO_NATIONAL(BLISSEY),
SPECIES_TO_NATIONAL(RAIKOU),
SPECIES_TO_NATIONAL(ENTEI),
SPECIES_TO_NATIONAL(SUICUNE),
SPECIES_TO_NATIONAL(LARVITAR),
SPECIES_TO_NATIONAL(PUPITAR),
SPECIES_TO_NATIONAL(TYRANITAR),
SPECIES_TO_NATIONAL(LUGIA),
SPECIES_TO_NATIONAL(HO_OH),
SPECIES_TO_NATIONAL(CELEBI),
SPECIES_TO_NATIONAL(TREECKO),
SPECIES_TO_NATIONAL(GROVYLE),
SPECIES_TO_NATIONAL(SCEPTILE),
SPECIES_TO_NATIONAL(TORCHIC),
SPECIES_TO_NATIONAL(COMBUSKEN),
SPECIES_TO_NATIONAL(BLAZIKEN),
SPECIES_TO_NATIONAL(MUDKIP),
SPECIES_TO_NATIONAL(MARSHTOMP),
SPECIES_TO_NATIONAL(SWAMPERT),
SPECIES_TO_NATIONAL(POOCHYENA),
SPECIES_TO_NATIONAL(MIGHTYENA),
SPECIES_TO_NATIONAL(ZIGZAGOON),
SPECIES_TO_NATIONAL(LINOONE),
SPECIES_TO_NATIONAL(WURMPLE),
SPECIES_TO_NATIONAL(SILCOON),
SPECIES_TO_NATIONAL(BEAUTIFLY),
SPECIES_TO_NATIONAL(CASCOON),
SPECIES_TO_NATIONAL(DUSTOX),
SPECIES_TO_NATIONAL(LOTAD),
SPECIES_TO_NATIONAL(LOMBRE),
SPECIES_TO_NATIONAL(LUDICOLO),
SPECIES_TO_NATIONAL(SEEDOT),
SPECIES_TO_NATIONAL(NUZLEAF),
SPECIES_TO_NATIONAL(SHIFTRY),
SPECIES_TO_NATIONAL(TAILLOW),
SPECIES_TO_NATIONAL(SWELLOW),
SPECIES_TO_NATIONAL(WINGULL),
SPECIES_TO_NATIONAL(PELIPPER),
SPECIES_TO_NATIONAL(RALTS),
SPECIES_TO_NATIONAL(KIRLIA),
SPECIES_TO_NATIONAL(GARDEVOIR),
SPECIES_TO_NATIONAL(SURSKIT),
SPECIES_TO_NATIONAL(MASQUERAIN),
SPECIES_TO_NATIONAL(SHROOMISH),
SPECIES_TO_NATIONAL(BRELOOM),
SPECIES_TO_NATIONAL(SLAKOTH),
SPECIES_TO_NATIONAL(VIGOROTH),
SPECIES_TO_NATIONAL(SLAKING),
SPECIES_TO_NATIONAL(NINCADA),
SPECIES_TO_NATIONAL(NINJASK),
SPECIES_TO_NATIONAL(SHEDINJA),
SPECIES_TO_NATIONAL(WHISMUR),
SPECIES_TO_NATIONAL(LOUDRED),
SPECIES_TO_NATIONAL(EXPLOUD),
SPECIES_TO_NATIONAL(MAKUHITA),
SPECIES_TO_NATIONAL(HARIYAMA),
SPECIES_TO_NATIONAL(AZURILL),
SPECIES_TO_NATIONAL(NOSEPASS),
SPECIES_TO_NATIONAL(SKITTY),
SPECIES_TO_NATIONAL(DELCATTY),
SPECIES_TO_NATIONAL(SABLEYE),
SPECIES_TO_NATIONAL(MAWILE),
SPECIES_TO_NATIONAL(ARON),
SPECIES_TO_NATIONAL(LAIRON),
SPECIES_TO_NATIONAL(AGGRON),
SPECIES_TO_NATIONAL(MEDITITE),
SPECIES_TO_NATIONAL(MEDICHAM),
SPECIES_TO_NATIONAL(ELECTRIKE),
SPECIES_TO_NATIONAL(MANECTRIC),
SPECIES_TO_NATIONAL(PLUSLE),
SPECIES_TO_NATIONAL(MINUN),
SPECIES_TO_NATIONAL(VOLBEAT),
SPECIES_TO_NATIONAL(ILLUMISE),
SPECIES_TO_NATIONAL(ROSELIA),
SPECIES_TO_NATIONAL(GULPIN),
SPECIES_TO_NATIONAL(SWALOT),
SPECIES_TO_NATIONAL(CARVANHA),
SPECIES_TO_NATIONAL(SHARPEDO),
SPECIES_TO_NATIONAL(WAILMER),
SPECIES_TO_NATIONAL(WAILORD),
SPECIES_TO_NATIONAL(NUMEL),
SPECIES_TO_NATIONAL(CAMERUPT),
SPECIES_TO_NATIONAL(TORKOAL),
SPECIES_TO_NATIONAL(SPOINK),
SPECIES_TO_NATIONAL(GRUMPIG),
SPECIES_TO_NATIONAL(SPINDA),
SPECIES_TO_NATIONAL(TRAPINCH),
SPECIES_TO_NATIONAL(VIBRAVA),
SPECIES_TO_NATIONAL(FLYGON),
SPECIES_TO_NATIONAL(CACNEA),
SPECIES_TO_NATIONAL(CACTURNE),
SPECIES_TO_NATIONAL(SWABLU),
SPECIES_TO_NATIONAL(ALTARIA),
SPECIES_TO_NATIONAL(ZANGOOSE),
SPECIES_TO_NATIONAL(SEVIPER),
SPECIES_TO_NATIONAL(LUNATONE),
SPECIES_TO_NATIONAL(SOLROCK),
SPECIES_TO_NATIONAL(BARBOACH),
SPECIES_TO_NATIONAL(WHISCASH),
SPECIES_TO_NATIONAL(CORPHISH),
SPECIES_TO_NATIONAL(CRAWDAUNT),
SPECIES_TO_NATIONAL(BALTOY),
SPECIES_TO_NATIONAL(CLAYDOL),
SPECIES_TO_NATIONAL(LILEEP),
SPECIES_TO_NATIONAL(CRADILY),
SPECIES_TO_NATIONAL(ANORITH),
SPECIES_TO_NATIONAL(ARMALDO),
SPECIES_TO_NATIONAL(FEEBAS),
SPECIES_TO_NATIONAL(MILOTIC),
SPECIES_TO_NATIONAL(CASTFORM),
SPECIES_TO_NATIONAL(KECLEON),
SPECIES_TO_NATIONAL(SHUPPET),
SPECIES_TO_NATIONAL(BANETTE),
SPECIES_TO_NATIONAL(DUSKULL),
SPECIES_TO_NATIONAL(DUSCLOPS),
SPECIES_TO_NATIONAL(TROPIUS),
SPECIES_TO_NATIONAL(CHIMECHO),
SPECIES_TO_NATIONAL(ABSOL),
SPECIES_TO_NATIONAL(WYNAUT),
SPECIES_TO_NATIONAL(SNORUNT),
SPECIES_TO_NATIONAL(GLALIE),
SPECIES_TO_NATIONAL(SPHEAL),
SPECIES_TO_NATIONAL(SEALEO),
SPECIES_TO_NATIONAL(WALREIN),
SPECIES_TO_NATIONAL(CLAMPERL),
SPECIES_TO_NATIONAL(HUNTAIL),
SPECIES_TO_NATIONAL(GOREBYSS),
SPECIES_TO_NATIONAL(RELICANTH),
SPECIES_TO_NATIONAL(LUVDISC),
SPECIES_TO_NATIONAL(BAGON),
SPECIES_TO_NATIONAL(SHELGON),
SPECIES_TO_NATIONAL(SALAMENCE),
SPECIES_TO_NATIONAL(BELDUM),
SPECIES_TO_NATIONAL(METANG),
SPECIES_TO_NATIONAL(METAGROSS),
SPECIES_TO_NATIONAL(REGIROCK),
SPECIES_TO_NATIONAL(REGICE),
SPECIES_TO_NATIONAL(REGISTEEL),
SPECIES_TO_NATIONAL(LATIAS),
SPECIES_TO_NATIONAL(LATIOS),
SPECIES_TO_NATIONAL(KYOGRE),
SPECIES_TO_NATIONAL(GROUDON),
SPECIES_TO_NATIONAL(RAYQUAZA),
SPECIES_TO_NATIONAL(JIRACHI),
SPECIES_TO_NATIONAL(DEOXYS),
SPECIES_TO_NATIONAL(TURTWIG),
SPECIES_TO_NATIONAL(GROTLE),
SPECIES_TO_NATIONAL(TORTERRA),
SPECIES_TO_NATIONAL(CHIMCHAR),
SPECIES_TO_NATIONAL(MONFERNO),
SPECIES_TO_NATIONAL(INFERNAPE),
SPECIES_TO_NATIONAL(PIPLUP),
SPECIES_TO_NATIONAL(PRINPLUP),
SPECIES_TO_NATIONAL(EMPOLEON),
SPECIES_TO_NATIONAL(STARLY),
SPECIES_TO_NATIONAL(STARAVIA),
SPECIES_TO_NATIONAL(STARAPTOR),
SPECIES_TO_NATIONAL(BIDOOF),
SPECIES_TO_NATIONAL(BIBAREL),
SPECIES_TO_NATIONAL(KRICKETOT),
SPECIES_TO_NATIONAL(KRICKETUNE),
SPECIES_TO_NATIONAL(SHINX),
SPECIES_TO_NATIONAL(LUXIO),
SPECIES_TO_NATIONAL(LUXRAY),
SPECIES_TO_NATIONAL(BUDEW),
SPECIES_TO_NATIONAL(ROSERADE),
SPECIES_TO_NATIONAL(CRANIDOS),
SPECIES_TO_NATIONAL(RAMPARDOS),
SPECIES_TO_NATIONAL(SHIELDON),
SPECIES_TO_NATIONAL(BASTIODON),
SPECIES_TO_NATIONAL(BURMY),
SPECIES_TO_NATIONAL(WORMADAM),
SPECIES_TO_NATIONAL(MOTHIM),
SPECIES_TO_NATIONAL(COMBEE),
SPECIES_TO_NATIONAL(VESPIQUEN),
SPECIES_TO_NATIONAL(PACHIRISU),
SPECIES_TO_NATIONAL(BUIZEL),
SPECIES_TO_NATIONAL(FLOATZEL),
SPECIES_TO_NATIONAL(CHERUBI),
SPECIES_TO_NATIONAL(CHERRIM),
SPECIES_TO_NATIONAL(SHELLOS),
SPECIES_TO_NATIONAL(GASTRODON),
SPECIES_TO_NATIONAL(AMBIPOM),
SPECIES_TO_NATIONAL(DRIFLOON),
SPECIES_TO_NATIONAL(DRIFBLIM),
SPECIES_TO_NATIONAL(BUNEARY),
SPECIES_TO_NATIONAL(LOPUNNY),
SPECIES_TO_NATIONAL(MISMAGIUS),
SPECIES_TO_NATIONAL(HONCHKROW),
SPECIES_TO_NATIONAL(GLAMEOW),
SPECIES_TO_NATIONAL(PURUGLY),
SPECIES_TO_NATIONAL(CHINGLING),
SPECIES_TO_NATIONAL(STUNKY),
SPECIES_TO_NATIONAL(SKUNTANK),
SPECIES_TO_NATIONAL(BRONZOR),
SPECIES_TO_NATIONAL(BRONZONG),
SPECIES_TO_NATIONAL(BONSLY),
2021-02-02 18:36:05 +01:00
SPECIES_TO_NATIONAL(MIME_JR),
2020-11-13 20:13:13 +01:00
SPECIES_TO_NATIONAL(HAPPINY),
SPECIES_TO_NATIONAL(CHATOT),
SPECIES_TO_NATIONAL(SPIRITOMB),
SPECIES_TO_NATIONAL(GIBLE),
SPECIES_TO_NATIONAL(GABITE),
SPECIES_TO_NATIONAL(GARCHOMP),
SPECIES_TO_NATIONAL(MUNCHLAX),
SPECIES_TO_NATIONAL(RIOLU),
SPECIES_TO_NATIONAL(LUCARIO),
SPECIES_TO_NATIONAL(HIPPOPOTAS),
SPECIES_TO_NATIONAL(HIPPOWDON),
SPECIES_TO_NATIONAL(SKORUPI),
SPECIES_TO_NATIONAL(DRAPION),
SPECIES_TO_NATIONAL(CROAGUNK),
SPECIES_TO_NATIONAL(TOXICROAK),
SPECIES_TO_NATIONAL(CARNIVINE),
SPECIES_TO_NATIONAL(FINNEON),
SPECIES_TO_NATIONAL(LUMINEON),
SPECIES_TO_NATIONAL(MANTYKE),
SPECIES_TO_NATIONAL(SNOVER),
SPECIES_TO_NATIONAL(ABOMASNOW),
SPECIES_TO_NATIONAL(WEAVILE),
SPECIES_TO_NATIONAL(MAGNEZONE),
SPECIES_TO_NATIONAL(LICKILICKY),
SPECIES_TO_NATIONAL(RHYPERIOR),
SPECIES_TO_NATIONAL(TANGROWTH),
SPECIES_TO_NATIONAL(ELECTIVIRE),
SPECIES_TO_NATIONAL(MAGMORTAR),
SPECIES_TO_NATIONAL(TOGEKISS),
SPECIES_TO_NATIONAL(YANMEGA),
SPECIES_TO_NATIONAL(LEAFEON),
SPECIES_TO_NATIONAL(GLACEON),
SPECIES_TO_NATIONAL(GLISCOR),
SPECIES_TO_NATIONAL(MAMOSWINE),
SPECIES_TO_NATIONAL(PORYGON_Z),
SPECIES_TO_NATIONAL(GALLADE),
SPECIES_TO_NATIONAL(PROBOPASS),
SPECIES_TO_NATIONAL(DUSKNOIR),
SPECIES_TO_NATIONAL(FROSLASS),
SPECIES_TO_NATIONAL(ROTOM),
SPECIES_TO_NATIONAL(UXIE),
SPECIES_TO_NATIONAL(MESPRIT),
SPECIES_TO_NATIONAL(AZELF),
SPECIES_TO_NATIONAL(DIALGA),
SPECIES_TO_NATIONAL(PALKIA),
SPECIES_TO_NATIONAL(HEATRAN),
SPECIES_TO_NATIONAL(REGIGIGAS),
SPECIES_TO_NATIONAL(GIRATINA),
SPECIES_TO_NATIONAL(CRESSELIA),
SPECIES_TO_NATIONAL(PHIONE),
SPECIES_TO_NATIONAL(MANAPHY),
SPECIES_TO_NATIONAL(DARKRAI),
SPECIES_TO_NATIONAL(SHAYMIN),
SPECIES_TO_NATIONAL(ARCEUS),
SPECIES_TO_NATIONAL(VICTINI),
SPECIES_TO_NATIONAL(SNIVY),
SPECIES_TO_NATIONAL(SERVINE),
SPECIES_TO_NATIONAL(SERPERIOR),
SPECIES_TO_NATIONAL(TEPIG),
SPECIES_TO_NATIONAL(PIGNITE),
SPECIES_TO_NATIONAL(EMBOAR),
SPECIES_TO_NATIONAL(OSHAWOTT),
SPECIES_TO_NATIONAL(DEWOTT),
SPECIES_TO_NATIONAL(SAMUROTT),
SPECIES_TO_NATIONAL(PATRAT),
SPECIES_TO_NATIONAL(WATCHOG),
SPECIES_TO_NATIONAL(LILLIPUP),
SPECIES_TO_NATIONAL(HERDIER),
SPECIES_TO_NATIONAL(STOUTLAND),
SPECIES_TO_NATIONAL(PURRLOIN),
SPECIES_TO_NATIONAL(LIEPARD),
SPECIES_TO_NATIONAL(PANSAGE),
SPECIES_TO_NATIONAL(SIMISAGE),
SPECIES_TO_NATIONAL(PANSEAR),
SPECIES_TO_NATIONAL(SIMISEAR),
SPECIES_TO_NATIONAL(PANPOUR),
SPECIES_TO_NATIONAL(SIMIPOUR),
SPECIES_TO_NATIONAL(MUNNA),
SPECIES_TO_NATIONAL(MUSHARNA),
SPECIES_TO_NATIONAL(PIDOVE),
SPECIES_TO_NATIONAL(TRANQUILL),
SPECIES_TO_NATIONAL(UNFEZANT),
SPECIES_TO_NATIONAL(BLITZLE),
SPECIES_TO_NATIONAL(ZEBSTRIKA),
SPECIES_TO_NATIONAL(ROGGENROLA),
SPECIES_TO_NATIONAL(BOLDORE),
SPECIES_TO_NATIONAL(GIGALITH),
SPECIES_TO_NATIONAL(WOOBAT),
SPECIES_TO_NATIONAL(SWOOBAT),
SPECIES_TO_NATIONAL(DRILBUR),
SPECIES_TO_NATIONAL(EXCADRILL),
SPECIES_TO_NATIONAL(AUDINO),
SPECIES_TO_NATIONAL(TIMBURR),
SPECIES_TO_NATIONAL(GURDURR),
SPECIES_TO_NATIONAL(CONKELDURR),
SPECIES_TO_NATIONAL(TYMPOLE),
SPECIES_TO_NATIONAL(PALPITOAD),
SPECIES_TO_NATIONAL(SEISMITOAD),
SPECIES_TO_NATIONAL(THROH),
SPECIES_TO_NATIONAL(SAWK),
SPECIES_TO_NATIONAL(SEWADDLE),
SPECIES_TO_NATIONAL(SWADLOON),
SPECIES_TO_NATIONAL(LEAVANNY),
SPECIES_TO_NATIONAL(VENIPEDE),
SPECIES_TO_NATIONAL(WHIRLIPEDE),
SPECIES_TO_NATIONAL(SCOLIPEDE),
SPECIES_TO_NATIONAL(COTTONEE),
SPECIES_TO_NATIONAL(WHIMSICOTT),
SPECIES_TO_NATIONAL(PETILIL),
SPECIES_TO_NATIONAL(LILLIGANT),
SPECIES_TO_NATIONAL(BASCULIN),
SPECIES_TO_NATIONAL(SANDILE),
SPECIES_TO_NATIONAL(KROKOROK),
SPECIES_TO_NATIONAL(KROOKODILE),
SPECIES_TO_NATIONAL(DARUMAKA),
SPECIES_TO_NATIONAL(DARMANITAN),
SPECIES_TO_NATIONAL(MARACTUS),
SPECIES_TO_NATIONAL(DWEBBLE),
SPECIES_TO_NATIONAL(CRUSTLE),
SPECIES_TO_NATIONAL(SCRAGGY),
SPECIES_TO_NATIONAL(SCRAFTY),
SPECIES_TO_NATIONAL(SIGILYPH),
SPECIES_TO_NATIONAL(YAMASK),
SPECIES_TO_NATIONAL(COFAGRIGUS),
SPECIES_TO_NATIONAL(TIRTOUGA),
SPECIES_TO_NATIONAL(CARRACOSTA),
SPECIES_TO_NATIONAL(ARCHEN),
SPECIES_TO_NATIONAL(ARCHEOPS),
SPECIES_TO_NATIONAL(TRUBBISH),
SPECIES_TO_NATIONAL(GARBODOR),
SPECIES_TO_NATIONAL(ZORUA),
SPECIES_TO_NATIONAL(ZOROARK),
SPECIES_TO_NATIONAL(MINCCINO),
SPECIES_TO_NATIONAL(CINCCINO),
SPECIES_TO_NATIONAL(GOTHITA),
SPECIES_TO_NATIONAL(GOTHORITA),
SPECIES_TO_NATIONAL(GOTHITELLE),
SPECIES_TO_NATIONAL(SOLOSIS),
SPECIES_TO_NATIONAL(DUOSION),
SPECIES_TO_NATIONAL(REUNICLUS),
SPECIES_TO_NATIONAL(DUCKLETT),
SPECIES_TO_NATIONAL(SWANNA),
SPECIES_TO_NATIONAL(VANILLITE),
SPECIES_TO_NATIONAL(VANILLISH),
SPECIES_TO_NATIONAL(VANILLUXE),
SPECIES_TO_NATIONAL(DEERLING),
SPECIES_TO_NATIONAL(SAWSBUCK),
SPECIES_TO_NATIONAL(EMOLGA),
SPECIES_TO_NATIONAL(KARRABLAST),
SPECIES_TO_NATIONAL(ESCAVALIER),
SPECIES_TO_NATIONAL(FOONGUS),
SPECIES_TO_NATIONAL(AMOONGUSS),
SPECIES_TO_NATIONAL(FRILLISH),
SPECIES_TO_NATIONAL(JELLICENT),
SPECIES_TO_NATIONAL(ALOMOMOLA),
SPECIES_TO_NATIONAL(JOLTIK),
SPECIES_TO_NATIONAL(GALVANTULA),
SPECIES_TO_NATIONAL(FERROSEED),
SPECIES_TO_NATIONAL(FERROTHORN),
SPECIES_TO_NATIONAL(KLINK),
SPECIES_TO_NATIONAL(KLANG),
SPECIES_TO_NATIONAL(KLINKLANG),
SPECIES_TO_NATIONAL(TYNAMO),
SPECIES_TO_NATIONAL(EELEKTRIK),
SPECIES_TO_NATIONAL(EELEKTROSS),
SPECIES_TO_NATIONAL(ELGYEM),
SPECIES_TO_NATIONAL(BEHEEYEM),
SPECIES_TO_NATIONAL(LITWICK),
SPECIES_TO_NATIONAL(LAMPENT),
SPECIES_TO_NATIONAL(CHANDELURE),
SPECIES_TO_NATIONAL(AXEW),
SPECIES_TO_NATIONAL(FRAXURE),
SPECIES_TO_NATIONAL(HAXORUS),
SPECIES_TO_NATIONAL(CUBCHOO),
SPECIES_TO_NATIONAL(BEARTIC),
SPECIES_TO_NATIONAL(CRYOGONAL),
SPECIES_TO_NATIONAL(SHELMET),
SPECIES_TO_NATIONAL(ACCELGOR),
SPECIES_TO_NATIONAL(STUNFISK),
SPECIES_TO_NATIONAL(MIENFOO),
SPECIES_TO_NATIONAL(MIENSHAO),
SPECIES_TO_NATIONAL(DRUDDIGON),
SPECIES_TO_NATIONAL(GOLETT),
SPECIES_TO_NATIONAL(GOLURK),
SPECIES_TO_NATIONAL(PAWNIARD),
SPECIES_TO_NATIONAL(BISHARP),
SPECIES_TO_NATIONAL(BOUFFALANT),
SPECIES_TO_NATIONAL(RUFFLET),
SPECIES_TO_NATIONAL(BRAVIARY),
SPECIES_TO_NATIONAL(VULLABY),
SPECIES_TO_NATIONAL(MANDIBUZZ),
SPECIES_TO_NATIONAL(HEATMOR),
SPECIES_TO_NATIONAL(DURANT),
SPECIES_TO_NATIONAL(DEINO),
SPECIES_TO_NATIONAL(ZWEILOUS),
SPECIES_TO_NATIONAL(HYDREIGON),
SPECIES_TO_NATIONAL(LARVESTA),
SPECIES_TO_NATIONAL(VOLCARONA),
SPECIES_TO_NATIONAL(COBALION),
SPECIES_TO_NATIONAL(TERRAKION),
SPECIES_TO_NATIONAL(VIRIZION),
SPECIES_TO_NATIONAL(TORNADUS),
SPECIES_TO_NATIONAL(THUNDURUS),
SPECIES_TO_NATIONAL(RESHIRAM),
SPECIES_TO_NATIONAL(ZEKROM),
SPECIES_TO_NATIONAL(LANDORUS),
SPECIES_TO_NATIONAL(KYUREM),
SPECIES_TO_NATIONAL(KELDEO),
SPECIES_TO_NATIONAL(MELOETTA),
SPECIES_TO_NATIONAL(GENESECT),
SPECIES_TO_NATIONAL(CHESPIN),
SPECIES_TO_NATIONAL(QUILLADIN),
SPECIES_TO_NATIONAL(CHESNAUGHT),
SPECIES_TO_NATIONAL(FENNEKIN),
SPECIES_TO_NATIONAL(BRAIXEN),
SPECIES_TO_NATIONAL(DELPHOX),
SPECIES_TO_NATIONAL(FROAKIE),
SPECIES_TO_NATIONAL(FROGADIER),
SPECIES_TO_NATIONAL(GRENINJA),
SPECIES_TO_NATIONAL(BUNNELBY),
SPECIES_TO_NATIONAL(DIGGERSBY),
SPECIES_TO_NATIONAL(FLETCHLING),
SPECIES_TO_NATIONAL(FLETCHINDER),
SPECIES_TO_NATIONAL(TALONFLAME),
SPECIES_TO_NATIONAL(SCATTERBUG),
SPECIES_TO_NATIONAL(SPEWPA),
SPECIES_TO_NATIONAL(VIVILLON),
SPECIES_TO_NATIONAL(LITLEO),
SPECIES_TO_NATIONAL(PYROAR),
SPECIES_TO_NATIONAL(FLABEBE),
SPECIES_TO_NATIONAL(FLOETTE),
SPECIES_TO_NATIONAL(FLORGES),
SPECIES_TO_NATIONAL(SKIDDO),
SPECIES_TO_NATIONAL(GOGOAT),
SPECIES_TO_NATIONAL(PANCHAM),
SPECIES_TO_NATIONAL(PANGORO),
SPECIES_TO_NATIONAL(FURFROU),
SPECIES_TO_NATIONAL(ESPURR),
SPECIES_TO_NATIONAL(MEOWSTIC),
SPECIES_TO_NATIONAL(HONEDGE),
SPECIES_TO_NATIONAL(DOUBLADE),
SPECIES_TO_NATIONAL(AEGISLASH),
SPECIES_TO_NATIONAL(SPRITZEE),
SPECIES_TO_NATIONAL(AROMATISSE),
SPECIES_TO_NATIONAL(SWIRLIX),
SPECIES_TO_NATIONAL(SLURPUFF),
SPECIES_TO_NATIONAL(INKAY),
SPECIES_TO_NATIONAL(MALAMAR),
SPECIES_TO_NATIONAL(BINACLE),
SPECIES_TO_NATIONAL(BARBARACLE),
SPECIES_TO_NATIONAL(SKRELP),
SPECIES_TO_NATIONAL(DRAGALGE),
SPECIES_TO_NATIONAL(CLAUNCHER),
SPECIES_TO_NATIONAL(CLAWITZER),
SPECIES_TO_NATIONAL(HELIOPTILE),
SPECIES_TO_NATIONAL(HELIOLISK),
SPECIES_TO_NATIONAL(TYRUNT),
SPECIES_TO_NATIONAL(TYRANTRUM),
SPECIES_TO_NATIONAL(AMAURA),
SPECIES_TO_NATIONAL(AURORUS),
SPECIES_TO_NATIONAL(SYLVEON),
SPECIES_TO_NATIONAL(HAWLUCHA),
SPECIES_TO_NATIONAL(DEDENNE),
SPECIES_TO_NATIONAL(CARBINK),
SPECIES_TO_NATIONAL(GOOMY),
SPECIES_TO_NATIONAL(SLIGGOO),
SPECIES_TO_NATIONAL(GOODRA),
SPECIES_TO_NATIONAL(KLEFKI),
SPECIES_TO_NATIONAL(PHANTUMP),
SPECIES_TO_NATIONAL(TREVENANT),
SPECIES_TO_NATIONAL(PUMPKABOO),
SPECIES_TO_NATIONAL(GOURGEIST),
SPECIES_TO_NATIONAL(BERGMITE),
SPECIES_TO_NATIONAL(AVALUGG),
SPECIES_TO_NATIONAL(NOIBAT),
SPECIES_TO_NATIONAL(NOIVERN),
SPECIES_TO_NATIONAL(XERNEAS),
SPECIES_TO_NATIONAL(YVELTAL),
SPECIES_TO_NATIONAL(ZYGARDE),
SPECIES_TO_NATIONAL(DIANCIE),
SPECIES_TO_NATIONAL(HOOPA),
SPECIES_TO_NATIONAL(VOLCANION),
SPECIES_TO_NATIONAL(ROWLET),
SPECIES_TO_NATIONAL(DARTRIX),
SPECIES_TO_NATIONAL(DECIDUEYE),
SPECIES_TO_NATIONAL(LITTEN),
SPECIES_TO_NATIONAL(TORRACAT),
SPECIES_TO_NATIONAL(INCINEROAR),
SPECIES_TO_NATIONAL(POPPLIO),
SPECIES_TO_NATIONAL(BRIONNE),
SPECIES_TO_NATIONAL(PRIMARINA),
SPECIES_TO_NATIONAL(PIKIPEK),
SPECIES_TO_NATIONAL(TRUMBEAK),
SPECIES_TO_NATIONAL(TOUCANNON),
SPECIES_TO_NATIONAL(YUNGOOS),
SPECIES_TO_NATIONAL(GUMSHOOS),
SPECIES_TO_NATIONAL(GRUBBIN),
SPECIES_TO_NATIONAL(CHARJABUG),
SPECIES_TO_NATIONAL(VIKAVOLT),
SPECIES_TO_NATIONAL(CRABRAWLER),
SPECIES_TO_NATIONAL(CRABOMINABLE),
SPECIES_TO_NATIONAL(ORICORIO),
SPECIES_TO_NATIONAL(CUTIEFLY),
SPECIES_TO_NATIONAL(RIBOMBEE),
SPECIES_TO_NATIONAL(ROCKRUFF),
SPECIES_TO_NATIONAL(LYCANROC),
SPECIES_TO_NATIONAL(WISHIWASHI),
SPECIES_TO_NATIONAL(MAREANIE),
SPECIES_TO_NATIONAL(TOXAPEX),
SPECIES_TO_NATIONAL(MUDBRAY),
SPECIES_TO_NATIONAL(MUDSDALE),
SPECIES_TO_NATIONAL(DEWPIDER),
SPECIES_TO_NATIONAL(ARAQUANID),
SPECIES_TO_NATIONAL(FOMANTIS),
SPECIES_TO_NATIONAL(LURANTIS),
SPECIES_TO_NATIONAL(MORELULL),
SPECIES_TO_NATIONAL(SHIINOTIC),
SPECIES_TO_NATIONAL(SALANDIT),
SPECIES_TO_NATIONAL(SALAZZLE),
SPECIES_TO_NATIONAL(STUFFUL),
SPECIES_TO_NATIONAL(BEWEAR),
SPECIES_TO_NATIONAL(BOUNSWEET),
SPECIES_TO_NATIONAL(STEENEE),
SPECIES_TO_NATIONAL(TSAREENA),
SPECIES_TO_NATIONAL(COMFEY),
SPECIES_TO_NATIONAL(ORANGURU),
SPECIES_TO_NATIONAL(PASSIMIAN),
SPECIES_TO_NATIONAL(WIMPOD),
SPECIES_TO_NATIONAL(GOLISOPOD),
SPECIES_TO_NATIONAL(SANDYGAST),
SPECIES_TO_NATIONAL(PALOSSAND),
SPECIES_TO_NATIONAL(PYUKUMUKU),
SPECIES_TO_NATIONAL(TYPE_NULL),
SPECIES_TO_NATIONAL(SILVALLY),
SPECIES_TO_NATIONAL(MINIOR),
SPECIES_TO_NATIONAL(KOMALA),
SPECIES_TO_NATIONAL(TURTONATOR),
SPECIES_TO_NATIONAL(TOGEDEMARU),
SPECIES_TO_NATIONAL(MIMIKYU),
SPECIES_TO_NATIONAL(BRUXISH),
SPECIES_TO_NATIONAL(DRAMPA),
SPECIES_TO_NATIONAL(DHELMISE),
SPECIES_TO_NATIONAL(JANGMO_O),
SPECIES_TO_NATIONAL(HAKAMO_O),
SPECIES_TO_NATIONAL(KOMMO_O),
SPECIES_TO_NATIONAL(TAPU_KOKO),
SPECIES_TO_NATIONAL(TAPU_LELE),
SPECIES_TO_NATIONAL(TAPU_BULU),
SPECIES_TO_NATIONAL(TAPU_FINI),
SPECIES_TO_NATIONAL(COSMOG),
SPECIES_TO_NATIONAL(COSMOEM),
SPECIES_TO_NATIONAL(SOLGALEO),
SPECIES_TO_NATIONAL(LUNALA),
SPECIES_TO_NATIONAL(NIHILEGO),
SPECIES_TO_NATIONAL(BUZZWOLE),
SPECIES_TO_NATIONAL(PHEROMOSA),
SPECIES_TO_NATIONAL(XURKITREE),
SPECIES_TO_NATIONAL(CELESTEELA),
SPECIES_TO_NATIONAL(KARTANA),
SPECIES_TO_NATIONAL(GUZZLORD),
SPECIES_TO_NATIONAL(NECROZMA),
SPECIES_TO_NATIONAL(MAGEARNA),
SPECIES_TO_NATIONAL(MARSHADOW),
SPECIES_TO_NATIONAL(POIPOLE),
SPECIES_TO_NATIONAL(NAGANADEL),
SPECIES_TO_NATIONAL(STAKATAKA),
SPECIES_TO_NATIONAL(BLACEPHALON),
SPECIES_TO_NATIONAL(ZERAORA),
SPECIES_TO_NATIONAL(MELTAN),
SPECIES_TO_NATIONAL(MELMETAL),
2020-12-16 21:57:36 +01:00
SPECIES_TO_NATIONAL(GROOKEY),
SPECIES_TO_NATIONAL(THWACKEY),
SPECIES_TO_NATIONAL(RILLABOOM),
SPECIES_TO_NATIONAL(SCORBUNNY),
SPECIES_TO_NATIONAL(RABOOT),
SPECIES_TO_NATIONAL(CINDERACE),
SPECIES_TO_NATIONAL(SOBBLE),
SPECIES_TO_NATIONAL(DRIZZILE),
SPECIES_TO_NATIONAL(INTELEON),
SPECIES_TO_NATIONAL(SKWOVET),
SPECIES_TO_NATIONAL(GREEDENT),
SPECIES_TO_NATIONAL(ROOKIDEE),
SPECIES_TO_NATIONAL(CORVISQUIRE),
SPECIES_TO_NATIONAL(CORVIKNIGHT),
SPECIES_TO_NATIONAL(BLIPBUG),
SPECIES_TO_NATIONAL(DOTTLER),
SPECIES_TO_NATIONAL(ORBEETLE),
SPECIES_TO_NATIONAL(NICKIT),
SPECIES_TO_NATIONAL(THIEVUL),
SPECIES_TO_NATIONAL(GOSSIFLEUR),
SPECIES_TO_NATIONAL(ELDEGOSS),
SPECIES_TO_NATIONAL(WOOLOO),
SPECIES_TO_NATIONAL(DUBWOOL),
SPECIES_TO_NATIONAL(CHEWTLE),
SPECIES_TO_NATIONAL(DREDNAW),
SPECIES_TO_NATIONAL(YAMPER),
SPECIES_TO_NATIONAL(BOLTUND),
SPECIES_TO_NATIONAL(ROLYCOLY),
SPECIES_TO_NATIONAL(CARKOL),
SPECIES_TO_NATIONAL(COALOSSAL),
SPECIES_TO_NATIONAL(APPLIN),
SPECIES_TO_NATIONAL(FLAPPLE),
SPECIES_TO_NATIONAL(APPLETUN),
SPECIES_TO_NATIONAL(SILICOBRA),
SPECIES_TO_NATIONAL(SANDACONDA),
SPECIES_TO_NATIONAL(CRAMORANT),
SPECIES_TO_NATIONAL(ARROKUDA),
SPECIES_TO_NATIONAL(BARRASKEWDA),
SPECIES_TO_NATIONAL(TOXEL),
SPECIES_TO_NATIONAL(TOXTRICITY),
SPECIES_TO_NATIONAL(SIZZLIPEDE),
SPECIES_TO_NATIONAL(CENTISKORCH),
SPECIES_TO_NATIONAL(CLOBBOPUS),
SPECIES_TO_NATIONAL(GRAPPLOCT),
SPECIES_TO_NATIONAL(SINISTEA),
SPECIES_TO_NATIONAL(POLTEAGEIST),
SPECIES_TO_NATIONAL(HATENNA),
SPECIES_TO_NATIONAL(HATTREM),
SPECIES_TO_NATIONAL(HATTERENE),
SPECIES_TO_NATIONAL(IMPIDIMP),
SPECIES_TO_NATIONAL(MORGREM),
SPECIES_TO_NATIONAL(GRIMMSNARL),
SPECIES_TO_NATIONAL(OBSTAGOON),
SPECIES_TO_NATIONAL(PERRSERKER),
SPECIES_TO_NATIONAL(CURSOLA),
SPECIES_TO_NATIONAL(SIRFETCHD),
SPECIES_TO_NATIONAL(MR_RIME),
SPECIES_TO_NATIONAL(RUNERIGUS),
SPECIES_TO_NATIONAL(MILCERY),
SPECIES_TO_NATIONAL(ALCREMIE),
SPECIES_TO_NATIONAL(FALINKS),
SPECIES_TO_NATIONAL(PINCURCHIN),
SPECIES_TO_NATIONAL(SNOM),
SPECIES_TO_NATIONAL(FROSMOTH),
SPECIES_TO_NATIONAL(STONJOURNER),
SPECIES_TO_NATIONAL(EISCUE),
SPECIES_TO_NATIONAL(INDEEDEE),
SPECIES_TO_NATIONAL(MORPEKO),
SPECIES_TO_NATIONAL(CUFANT),
SPECIES_TO_NATIONAL(COPPERAJAH),
SPECIES_TO_NATIONAL(DRACOZOLT),
SPECIES_TO_NATIONAL(ARCTOZOLT),
SPECIES_TO_NATIONAL(DRACOVISH),
SPECIES_TO_NATIONAL(ARCTOVISH),
SPECIES_TO_NATIONAL(DURALUDON),
SPECIES_TO_NATIONAL(DREEPY),
SPECIES_TO_NATIONAL(DRAKLOAK),
SPECIES_TO_NATIONAL(DRAGAPULT),
SPECIES_TO_NATIONAL(ZACIAN),
SPECIES_TO_NATIONAL(ZAMAZENTA),
SPECIES_TO_NATIONAL(ETERNATUS),
SPECIES_TO_NATIONAL(KUBFU),
SPECIES_TO_NATIONAL(URSHIFU),
SPECIES_TO_NATIONAL(ZARUDE),
SPECIES_TO_NATIONAL(REGIELEKI),
SPECIES_TO_NATIONAL(REGIDRAGO),
SPECIES_TO_NATIONAL(GLASTRIER),
SPECIES_TO_NATIONAL(SPECTRIER),
SPECIES_TO_NATIONAL(CALYREX),
// Megas
2020-11-13 20:13:13 +01:00
[SPECIES_VENUSAUR_MEGA - 1] = NATIONAL_DEX_VENUSAUR,
[SPECIES_CHARIZARD_MEGA_X - 1] = NATIONAL_DEX_CHARIZARD,
[SPECIES_CHARIZARD_MEGA_Y - 1] = NATIONAL_DEX_CHARIZARD,
[SPECIES_BLASTOISE_MEGA - 1] = NATIONAL_DEX_BLASTOISE,
[SPECIES_BEEDRILL_MEGA - 1] = NATIONAL_DEX_BEEDRILL,
[SPECIES_PIDGEOT_MEGA - 1] = NATIONAL_DEX_PIDGEOT,
[SPECIES_ALAKAZAM_MEGA - 1] = NATIONAL_DEX_ALAKAZAM,
[SPECIES_SLOWBRO_MEGA - 1] = NATIONAL_DEX_SLOWBRO,
[SPECIES_GENGAR_MEGA - 1] = NATIONAL_DEX_GENGAR,
[SPECIES_KANGASKHAN_MEGA - 1] = NATIONAL_DEX_KANGASKHAN,
[SPECIES_PINSIR_MEGA - 1] = NATIONAL_DEX_PINSIR,
[SPECIES_GYARADOS_MEGA - 1] = NATIONAL_DEX_GYARADOS,
[SPECIES_AERODACTYL_MEGA - 1] = NATIONAL_DEX_AERODACTYL,
[SPECIES_MEWTWO_MEGA_X - 1] = NATIONAL_DEX_MEWTWO,
[SPECIES_MEWTWO_MEGA_Y - 1] = NATIONAL_DEX_MEWTWO,
[SPECIES_AMPHAROS_MEGA - 1] = NATIONAL_DEX_AMPHAROS,
[SPECIES_STEELIX_MEGA - 1] = NATIONAL_DEX_STEELIX,
[SPECIES_SCIZOR_MEGA - 1] = NATIONAL_DEX_SCIZOR,
[SPECIES_HERACROSS_MEGA - 1] = NATIONAL_DEX_HERACROSS,
[SPECIES_HOUNDOOM_MEGA - 1] = NATIONAL_DEX_HOUNDOOM,
[SPECIES_TYRANITAR_MEGA - 1] = NATIONAL_DEX_TYRANITAR,
[SPECIES_SCEPTILE_MEGA - 1] = NATIONAL_DEX_SCEPTILE,
[SPECIES_BLAZIKEN_MEGA - 1] = NATIONAL_DEX_BLAZIKEN,
[SPECIES_SWAMPERT_MEGA - 1] = NATIONAL_DEX_SWAMPERT,
[SPECIES_GARDEVOIR_MEGA - 1] = NATIONAL_DEX_GARDEVOIR,
[SPECIES_SABLEYE_MEGA - 1] = NATIONAL_DEX_SABLEYE,
[SPECIES_MAWILE_MEGA - 1] = NATIONAL_DEX_MAWILE,
[SPECIES_AGGRON_MEGA - 1] = NATIONAL_DEX_AGGRON,
[SPECIES_MEDICHAM_MEGA - 1] = NATIONAL_DEX_MEDICHAM,
[SPECIES_MANECTRIC_MEGA - 1] = NATIONAL_DEX_MANECTRIC,
[SPECIES_SHARPEDO_MEGA - 1] = NATIONAL_DEX_SHARPEDO,
[SPECIES_CAMERUPT_MEGA - 1] = NATIONAL_DEX_CAMERUPT,
[SPECIES_ALTARIA_MEGA - 1] = NATIONAL_DEX_ALTARIA,
[SPECIES_BANETTE_MEGA - 1] = NATIONAL_DEX_BANETTE,
[SPECIES_ABSOL_MEGA - 1] = NATIONAL_DEX_ABSOL,
[SPECIES_GLALIE_MEGA - 1] = NATIONAL_DEX_GLALIE,
[SPECIES_SALAMENCE_MEGA - 1] = NATIONAL_DEX_SALAMENCE,
[SPECIES_METAGROSS_MEGA - 1] = NATIONAL_DEX_METAGROSS,
[SPECIES_LATIAS_MEGA - 1] = NATIONAL_DEX_LATIAS,
[SPECIES_LATIOS_MEGA - 1] = NATIONAL_DEX_LATIOS,
[SPECIES_LOPUNNY_MEGA - 1] = NATIONAL_DEX_LOPUNNY,
[SPECIES_GARCHOMP_MEGA - 1] = NATIONAL_DEX_GARCHOMP,
[SPECIES_LUCARIO_MEGA - 1] = NATIONAL_DEX_LUCARIO,
[SPECIES_ABOMASNOW_MEGA - 1] = NATIONAL_DEX_ABOMASNOW,
[SPECIES_GALLADE_MEGA - 1] = NATIONAL_DEX_GALLADE,
[SPECIES_AUDINO_MEGA - 1] = NATIONAL_DEX_AUDINO,
[SPECIES_DIANCIE_MEGA - 1] = NATIONAL_DEX_DIANCIE,
// Special Mega + Primals
2020-11-13 20:13:13 +01:00
[SPECIES_RAYQUAZA_MEGA - 1] = NATIONAL_DEX_RAYQUAZA,
[SPECIES_KYOGRE_PRIMAL - 1] = NATIONAL_DEX_KYOGRE,
[SPECIES_GROUDON_PRIMAL - 1] = NATIONAL_DEX_GROUDON,
// Alolan Forms
2020-11-13 20:13:13 +01:00
[SPECIES_RATTATA_ALOLAN - 1] = NATIONAL_DEX_RATTATA,
[SPECIES_RATICATE_ALOLAN - 1] = NATIONAL_DEX_RATICATE,
[SPECIES_RAICHU_ALOLAN - 1] = NATIONAL_DEX_RAICHU,
[SPECIES_SANDSHREW_ALOLAN - 1] = NATIONAL_DEX_SANDSHREW,
[SPECIES_SANDSLASH_ALOLAN - 1] = NATIONAL_DEX_SANDSLASH,
2020-11-13 20:13:13 +01:00
[SPECIES_VULPIX_ALOLAN - 1] = NATIONAL_DEX_VULPIX,
[SPECIES_NINETALES_ALOLAN - 1] = NATIONAL_DEX_NINETALES,
[SPECIES_DIGLETT_ALOLAN - 1] = NATIONAL_DEX_DIGLETT,
[SPECIES_DUGTRIO_ALOLAN - 1] = NATIONAL_DEX_DUGTRIO,
[SPECIES_MEOWTH_ALOLAN - 1] = NATIONAL_DEX_MEOWTH,
[SPECIES_PERSIAN_ALOLAN - 1] = NATIONAL_DEX_PERSIAN,
[SPECIES_GEODUDE_ALOLAN - 1] = NATIONAL_DEX_GEODUDE,
[SPECIES_GRAVELER_ALOLAN - 1] = NATIONAL_DEX_GRAVELER,
[SPECIES_GOLEM_ALOLAN - 1] = NATIONAL_DEX_GOLEM,
[SPECIES_GRIMER_ALOLAN - 1] = NATIONAL_DEX_GRIMER,
[SPECIES_MUK_ALOLAN - 1] = NATIONAL_DEX_MUK,
[SPECIES_EXEGGUTOR_ALOLAN - 1] = NATIONAL_DEX_EXEGGUTOR,
[SPECIES_MAROWAK_ALOLAN - 1] = NATIONAL_DEX_MAROWAK,
2020-12-16 21:57:36 +01:00
// Galarian Forms
[SPECIES_MEOWTH_GALARIAN - 1] = NATIONAL_DEX_MEOWTH,
[SPECIES_PONYTA_GALARIAN - 1] = NATIONAL_DEX_PONYTA,
[SPECIES_RAPIDASH_GALARIAN - 1] = NATIONAL_DEX_RAPIDASH,
[SPECIES_SLOWPOKE_GALARIAN - 1] = NATIONAL_DEX_SLOWPOKE,
[SPECIES_SLOWBRO_GALARIAN - 1] = NATIONAL_DEX_SLOWBRO,
[SPECIES_FARFETCHD_GALARIAN - 1] = NATIONAL_DEX_FARFETCHD,
[SPECIES_WEEZING_GALARIAN - 1] = NATIONAL_DEX_WEEZING,
[SPECIES_MR_MIME_GALARIAN - 1] = NATIONAL_DEX_MR_MIME,
[SPECIES_ARTICUNO_GALARIAN - 1] = NATIONAL_DEX_ARTICUNO,
[SPECIES_ZAPDOS_GALARIAN - 1] = NATIONAL_DEX_ZAPDOS,
[SPECIES_MOLTRES_GALARIAN - 1] = NATIONAL_DEX_MOLTRES,
[SPECIES_SLOWKING_GALARIAN - 1] = NATIONAL_DEX_SLOWKING,
[SPECIES_CORSOLA_GALARIAN - 1] = NATIONAL_DEX_CORSOLA,
[SPECIES_ZIGZAGOON_GALARIAN - 1] = NATIONAL_DEX_ZIGZAGOON,
[SPECIES_LINOONE_GALARIAN - 1] = NATIONAL_DEX_LINOONE,
[SPECIES_DARUMAKA_GALARIAN - 1] = NATIONAL_DEX_DARUMAKA,
[SPECIES_DARMANITAN_GALARIAN - 1] = NATIONAL_DEX_DARMANITAN,
[SPECIES_YAMASK_GALARIAN - 1] = NATIONAL_DEX_YAMASK,
[SPECIES_STUNFISK_GALARIAN - 1] = NATIONAL_DEX_STUNFISK,
// Cosplay Pikachu
2020-11-13 20:13:13 +01:00
[SPECIES_PIKACHU_COSPLAY - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_ROCK_STAR - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_BELLE - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_POP_STAR - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_PH_D - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_LIBRE - 1] = NATIONAL_DEX_PIKACHU,
// Cap Pikachu
2020-11-13 20:13:13 +01:00
[SPECIES_PIKACHU_ORIGINAL_CAP - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_HOENN_CAP - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_SINNOH_CAP - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_UNOVA_CAP - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_KALOS_CAP - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_ALOLA_CAP - 1] = NATIONAL_DEX_PIKACHU,
[SPECIES_PIKACHU_PARTNER_CAP - 1] = NATIONAL_DEX_PIKACHU,
2020-12-16 21:57:36 +01:00
[SPECIES_PIKACHU_WORLD_CAP - 1] = NATIONAL_DEX_PIKACHU,
// Pichu
2020-11-13 20:13:13 +01:00
[SPECIES_PICHU_SPIKY_EARED - 1] = NATIONAL_DEX_PICHU,
// Unown
2020-11-13 20:13:13 +01:00
[SPECIES_UNOWN_B - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_C - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_D - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_E - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_F - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_G - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_H - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_I - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_J - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_K - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_L - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_M - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_N - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_O - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_P - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_Q - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_R - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_S - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_T - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_U - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_V - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_W - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_X - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_Y - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_Z - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_QMARK - 1] = NATIONAL_DEX_UNOWN,
[SPECIES_UNOWN_EMARK - 1] = NATIONAL_DEX_UNOWN,
// Castform
2020-11-13 20:13:13 +01:00
[SPECIES_CASTFORM_SUNNY - 1] = NATIONAL_DEX_CASTFORM,
[SPECIES_CASTFORM_RAINY - 1] = NATIONAL_DEX_CASTFORM,
[SPECIES_CASTFORM_SNOWY - 1] = NATIONAL_DEX_CASTFORM,
// Deoxys
2020-11-13 20:13:13 +01:00
[SPECIES_DEOXYS_ATTACK - 1] = NATIONAL_DEX_DEOXYS,
[SPECIES_DEOXYS_DEFENSE - 1] = NATIONAL_DEX_DEOXYS,
[SPECIES_DEOXYS_SPEED - 1] = NATIONAL_DEX_DEOXYS,
// Burmy
2020-11-13 20:13:13 +01:00
[SPECIES_BURMY_SANDY_CLOAK - 1] = NATIONAL_DEX_BURMY,
[SPECIES_BURMY_TRASH_CLOAK - 1] = NATIONAL_DEX_BURMY,
// Wormadam
2020-11-13 20:13:13 +01:00
[SPECIES_WORMADAM_SANDY_CLOAK - 1] = NATIONAL_DEX_WORMADAM,
[SPECIES_WORMADAM_TRASH_CLOAK - 1] = NATIONAL_DEX_WORMADAM,
// Cherrim
2020-11-13 20:13:13 +01:00
[SPECIES_CHERRIM_SUNSHINE - 1] = NATIONAL_DEX_CHERRIM,
// Shellos
2020-11-13 20:13:13 +01:00
[SPECIES_SHELLOS_EAST_SEA - 1] = NATIONAL_DEX_SHELLOS,
// Gastrodon
2020-11-13 20:13:13 +01:00
[SPECIES_GASTRODON_EAST_SEA - 1] = NATIONAL_DEX_GASTRODON,
// Rotom
2020-11-13 20:13:13 +01:00
[SPECIES_ROTOM_HEAT - 1] = NATIONAL_DEX_ROTOM,
[SPECIES_ROTOM_WASH - 1] = NATIONAL_DEX_ROTOM,
[SPECIES_ROTOM_FROST - 1] = NATIONAL_DEX_ROTOM,
[SPECIES_ROTOM_FAN - 1] = NATIONAL_DEX_ROTOM,
[SPECIES_ROTOM_MOW - 1] = NATIONAL_DEX_ROTOM,
// Giratina
2020-11-13 20:13:13 +01:00
[SPECIES_GIRATINA_ORIGIN - 1] = NATIONAL_DEX_GIRATINA,
// Shaymin
2020-11-13 20:13:13 +01:00
[SPECIES_SHAYMIN_SKY - 1] = NATIONAL_DEX_SHAYMIN,
// Arceus
2020-11-13 20:13:13 +01:00
[SPECIES_ARCEUS_FIGHTING - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_FLYING - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_POISON - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_GROUND - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_ROCK - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_BUG - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_GHOST - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_STEEL - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_FIRE - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_WATER - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_GRASS - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_ELECTRIC - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_PSYCHIC - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_ICE - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_DRAGON - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_DARK - 1] = NATIONAL_DEX_ARCEUS,
[SPECIES_ARCEUS_FAIRY - 1] = NATIONAL_DEX_ARCEUS,
// Basculin
2020-11-13 20:13:13 +01:00
[SPECIES_BASCULIN_BLUE_STRIPED - 1] = NATIONAL_DEX_BASCULIN,
// Darmanitan
2020-11-13 20:13:13 +01:00
[SPECIES_DARMANITAN_ZEN_MODE - 1] = NATIONAL_DEX_DARMANITAN,
2020-12-16 21:57:36 +01:00
[SPECIES_DARMANITAN_ZEN_MODE_GALARIAN - 1] = NATIONAL_DEX_DARMANITAN,
// Deerling
2020-11-13 20:13:13 +01:00
[SPECIES_DEERLING_SUMMER - 1] = NATIONAL_DEX_DEERLING,
[SPECIES_DEERLING_AUTUMN - 1] = NATIONAL_DEX_DEERLING,
[SPECIES_DEERLING_WINTER - 1] = NATIONAL_DEX_DEERLING,
// Sawsbuck
2020-11-13 20:13:13 +01:00
[SPECIES_SAWSBUCK_SUMMER - 1] = NATIONAL_DEX_SAWSBUCK,
[SPECIES_SAWSBUCK_AUTUMN - 1] = NATIONAL_DEX_SAWSBUCK,
[SPECIES_SAWSBUCK_WINTER - 1] = NATIONAL_DEX_SAWSBUCK,
// Therian Forms
2020-11-13 20:13:13 +01:00
[SPECIES_TORNADUS_THERIAN - 1] = NATIONAL_DEX_TORNADUS,
[SPECIES_THUNDURUS_THERIAN - 1] = NATIONAL_DEX_THUNDURUS,
[SPECIES_LANDORUS_THERIAN - 1] = NATIONAL_DEX_LANDORUS,
// Kyurem
2020-11-13 20:13:13 +01:00
[SPECIES_KYUREM_BLACK - 1] = NATIONAL_DEX_KYUREM,
[SPECIES_KYUREM_WHITE - 1] = NATIONAL_DEX_KYUREM,
// Keldeo
2020-11-13 20:13:13 +01:00
[SPECIES_KELDEO_RESOLUTE - 1] = NATIONAL_DEX_KELDEO,
// Meloetta
2020-11-13 20:13:13 +01:00
[SPECIES_MELOETTA_PIROUETTE - 1] = NATIONAL_DEX_MELOETTA,
// Genesect
2020-11-13 20:13:13 +01:00
[SPECIES_GENESECT_DOUSE_DRIVE - 1] = NATIONAL_DEX_GENESECT,
[SPECIES_GENESECT_SHOCK_DRIVE - 1] = NATIONAL_DEX_GENESECT,
[SPECIES_GENESECT_BURN_DRIVE - 1] = NATIONAL_DEX_GENESECT,
[SPECIES_GENESECT_CHILL_DRIVE - 1] = NATIONAL_DEX_GENESECT,
// Greninja
2020-11-13 20:13:13 +01:00
[SPECIES_GRENINJA_BATTLE_BOND - 1] = NATIONAL_DEX_GRENINJA,
[SPECIES_GRENINJA_ASH - 1] = NATIONAL_DEX_GRENINJA,
// Vivillon
2020-11-13 20:13:13 +01:00
[SPECIES_VIVILLON_POLAR - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_TUNDRA - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_CONTINENTAL - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_GARDEN - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_ELEGANT - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_MEADOW - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_MODERN - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_MARINE - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_ARCHIPELAGO - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_HIGH_PLAINS - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_SANDSTORM - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_RIVER - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_MONSOON - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_SAVANNA - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_SUN - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_OCEAN - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_JUNGLE - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_FANCY - 1] = NATIONAL_DEX_VIVILLON,
[SPECIES_VIVILLON_POKE_BALL - 1] = NATIONAL_DEX_VIVILLON,
// Flabébé
2020-11-13 20:13:13 +01:00
[SPECIES_FLABEBE_YELLOW_FLOWER - 1] = NATIONAL_DEX_FLABEBE,
[SPECIES_FLABEBE_ORANGE_FLOWER - 1] = NATIONAL_DEX_FLABEBE,
[SPECIES_FLABEBE_BLUE_FLOWER - 1] = NATIONAL_DEX_FLABEBE,
[SPECIES_FLABEBE_WHITE_FLOWER - 1] = NATIONAL_DEX_FLABEBE,
// Floette
2020-11-13 20:13:13 +01:00
[SPECIES_FLOETTE_YELLOW_FLOWER - 1] = NATIONAL_DEX_FLOETTE,
[SPECIES_FLOETTE_ORANGE_FLOWER - 1] = NATIONAL_DEX_FLOETTE,
[SPECIES_FLOETTE_BLUE_FLOWER - 1] = NATIONAL_DEX_FLOETTE,
[SPECIES_FLOETTE_WHITE_FLOWER - 1] = NATIONAL_DEX_FLOETTE,
[SPECIES_FLOETTE_ETERNAL_FLOWER - 1] = NATIONAL_DEX_FLOETTE,
// Florges
2020-11-13 20:13:13 +01:00
[SPECIES_FLORGES_YELLOW_FLOWER - 1] = NATIONAL_DEX_FLORGES,
[SPECIES_FLORGES_ORANGE_FLOWER - 1] = NATIONAL_DEX_FLORGES,
[SPECIES_FLORGES_BLUE_FLOWER - 1] = NATIONAL_DEX_FLORGES,
[SPECIES_FLORGES_WHITE_FLOWER - 1] = NATIONAL_DEX_FLORGES,
// Furfrou
2020-11-13 20:13:13 +01:00
[SPECIES_FURFROU_HEART_TRIM - 1] = NATIONAL_DEX_FURFROU,
[SPECIES_FURFROU_STAR_TRIM - 1] = NATIONAL_DEX_FURFROU,
[SPECIES_FURFROU_DIAMOND_TRIM - 1] = NATIONAL_DEX_FURFROU,
[SPECIES_FURFROU_DEBUTANTE_TRIM - 1] = NATIONAL_DEX_FURFROU,
[SPECIES_FURFROU_MATRON_TRIM - 1] = NATIONAL_DEX_FURFROU,
[SPECIES_FURFROU_DANDY_TRIM - 1] = NATIONAL_DEX_FURFROU,
[SPECIES_FURFROU_LA_REINE_TRIM - 1] = NATIONAL_DEX_FURFROU,
[SPECIES_FURFROU_KABUKI_TRIM - 1] = NATIONAL_DEX_FURFROU,
[SPECIES_FURFROU_PHARAOH_TRIM - 1] = NATIONAL_DEX_FURFROU,
// Meowstic
2020-11-13 20:13:13 +01:00
[SPECIES_MEOWSTIC_FEMALE - 1] = NATIONAL_DEX_MEOWSTIC,
// Aegislash
2020-11-13 20:13:13 +01:00
[SPECIES_AEGISLASH_BLADE - 1] = NATIONAL_DEX_AEGISLASH,
// Pumpkaboo
2020-11-13 20:13:13 +01:00
[SPECIES_PUMPKABOO_SMALL - 1] = NATIONAL_DEX_PUMPKABOO,
[SPECIES_PUMPKABOO_LARGE - 1] = NATIONAL_DEX_PUMPKABOO,
[SPECIES_PUMPKABOO_SUPER - 1] = NATIONAL_DEX_PUMPKABOO,
// Gourgeist
2020-11-13 20:13:13 +01:00
[SPECIES_GOURGEIST_SMALL - 1] = NATIONAL_DEX_GOURGEIST,
[SPECIES_GOURGEIST_LARGE - 1] = NATIONAL_DEX_GOURGEIST,
[SPECIES_GOURGEIST_SUPER - 1] = NATIONAL_DEX_GOURGEIST,
// Xerneas
2020-11-13 20:13:13 +01:00
[SPECIES_XERNEAS_ACTIVE - 1] = NATIONAL_DEX_XERNEAS,
// Zygarde
2020-11-13 20:13:13 +01:00
[SPECIES_ZYGARDE_10 - 1] = NATIONAL_DEX_ZYGARDE,
[SPECIES_ZYGARDE_10_POWER_CONSTRUCT - 1] = NATIONAL_DEX_ZYGARDE,
[SPECIES_ZYGARDE_50_POWER_CONSTRUCT - 1] = NATIONAL_DEX_ZYGARDE,
[SPECIES_ZYGARDE_COMPLETE - 1] = NATIONAL_DEX_ZYGARDE,
// Hoopa
2020-11-13 20:13:13 +01:00
[SPECIES_HOOPA_UNBOUND - 1] = NATIONAL_DEX_HOOPA,
// Oricorio
2020-11-13 20:13:13 +01:00
[SPECIES_ORICORIO_POM_POM - 1] = NATIONAL_DEX_ORICORIO,
2021-02-02 20:49:01 +01:00
[SPECIES_ORICORIO_PAU - 1] = NATIONAL_DEX_ORICORIO,
2020-11-13 20:13:13 +01:00
[SPECIES_ORICORIO_SENSU - 1] = NATIONAL_DEX_ORICORIO,
// Rockruff
2020-11-13 20:13:13 +01:00
[SPECIES_ROCKRUFF_OWN_TEMPO - 1] = NATIONAL_DEX_ROCKRUFF,
// Lycanroc
2020-11-13 20:13:13 +01:00
[SPECIES_LYCANROC_MIDNIGHT - 1] = NATIONAL_DEX_LYCANROC,
[SPECIES_LYCANROC_DUSK - 1] = NATIONAL_DEX_LYCANROC,
// Wishiwashi
2020-11-13 20:13:13 +01:00
[SPECIES_WISHIWASHI_SCHOOL - 1] = NATIONAL_DEX_WISHIWASHI,
// Silvally
2020-11-13 20:13:13 +01:00
[SPECIES_SILVALLY_FIGHTING - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_FLYING - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_POISON - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_GROUND - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_ROCK - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_BUG - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_GHOST - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_STEEL - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_FIRE - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_WATER - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_GRASS - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_ELECTRIC - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_PSYCHIC - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_ICE - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_DRAGON - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_DARK - 1] = NATIONAL_DEX_SILVALLY,
[SPECIES_SILVALLY_FAIRY - 1] = NATIONAL_DEX_SILVALLY,
// Minior
2020-11-13 20:13:13 +01:00
[SPECIES_MINIOR_METEOR_ORANGE - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_METEOR_YELLOW - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_METEOR_GREEN - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_METEOR_BLUE - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_METEOR_INDIGO - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_METEOR_VIOLET - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_CORE_RED - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_CORE_ORANGE - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_CORE_YELLOW - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_CORE_GREEN - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_CORE_BLUE - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_CORE_INDIGO - 1] = NATIONAL_DEX_MINIOR,
[SPECIES_MINIOR_CORE_VIOLET - 1] = NATIONAL_DEX_MINIOR,
// Mimikyu
2020-11-13 20:13:13 +01:00
[SPECIES_MIMIKYU_BUSTED - 1] = NATIONAL_DEX_MIMIKYU,
// Necrozma
2020-11-13 20:13:13 +01:00
[SPECIES_NECROZMA_DUSK_MANE - 1] = NATIONAL_DEX_NECROZMA,
[SPECIES_NECROZMA_DAWN_WINGS - 1] = NATIONAL_DEX_NECROZMA,
[SPECIES_NECROZMA_ULTRA - 1] = NATIONAL_DEX_NECROZMA,
// Magearna
2020-11-13 20:13:13 +01:00
[SPECIES_MAGEARNA_ORIGINAL_COLOR - 1] = NATIONAL_DEX_MAGEARNA,
2020-12-16 21:57:36 +01:00
// Cramorant
[SPECIES_CRAMORANT_GULPING - 1] = NATIONAL_DEX_CRAMORANT,
[SPECIES_CRAMORANT_GORGING - 1] = NATIONAL_DEX_CRAMORANT,
// Toxtricity
[SPECIES_TOXTRICITY_LOW_KEY - 1] = NATIONAL_DEX_TOXTRICITY,
// Sinistea
[SPECIES_SINISTEA_ANTIQUE - 1] = NATIONAL_DEX_SINISTEA,
// Polteageist
[SPECIES_POLTEAGEIST_ANTIQUE - 1] = NATIONAL_DEX_POLTEAGEIST,
// Alcremie
[SPECIES_ALCREMIE_RUBY_CREAM - 1] = NATIONAL_DEX_ALCREMIE,
[SPECIES_ALCREMIE_MATCHA_CREAM - 1] = NATIONAL_DEX_ALCREMIE,
[SPECIES_ALCREMIE_MINT_CREAM - 1] = NATIONAL_DEX_ALCREMIE,
[SPECIES_ALCREMIE_LEMON_CREAM - 1] = NATIONAL_DEX_ALCREMIE,
[SPECIES_ALCREMIE_SALTED_CREAM - 1] = NATIONAL_DEX_ALCREMIE,
[SPECIES_ALCREMIE_RUBY_SWIRL - 1] = NATIONAL_DEX_ALCREMIE,
[SPECIES_ALCREMIE_CARAMEL_SWIRL - 1] = NATIONAL_DEX_ALCREMIE,
[SPECIES_ALCREMIE_RAINBOW_SWIRL - 1] = NATIONAL_DEX_ALCREMIE,
// Eiscue
[SPECIES_EISCUE_NOICE_FACE - 1] = NATIONAL_DEX_EISCUE,
// Indeedee
[SPECIES_INDEEDEE_FEMALE - 1] = NATIONAL_DEX_INDEEDEE,
// Morpeko
[SPECIES_MORPEKO_HANGRY - 1] = NATIONAL_DEX_MORPEKO,
// Zacian
[SPECIES_ZACIAN_CROWNED_SWORD - 1] = NATIONAL_DEX_ZACIAN,
// Zamazenta
[SPECIES_ZAMAZENTA_CROWNED_SHIELD - 1] = NATIONAL_DEX_ZAMAZENTA,
// Eternatus
[SPECIES_ETERNATUS_ETERNAMAX - 1] = NATIONAL_DEX_ETERNATUS,
// Urshifu
[SPECIES_URSHIFU_RAPID_STRIKE_STYLE - 1] = NATIONAL_DEX_URSHIFU,
// Zarude
[SPECIES_ZARUDE_DADA - 1] = NATIONAL_DEX_ZARUDE,
// Calyrex
[SPECIES_CALYREX_ICE_RIDER - 1] = NATIONAL_DEX_CALYREX,
[SPECIES_CALYREX_SHADOW_RIDER - 1] = NATIONAL_DEX_CALYREX,
};
2019-04-02 21:22:16 +02:00
const u16 gHoennToNationalOrder[HOENN_DEX_COUNT] = // Assigns Hoenn Dex Pokémon (Using National Dex Index)
{
2018-12-03 14:49:16 +01:00
HOENN_TO_NATIONAL(TREECKO),
HOENN_TO_NATIONAL(GROVYLE),
HOENN_TO_NATIONAL(SCEPTILE),
HOENN_TO_NATIONAL(TORCHIC),
HOENN_TO_NATIONAL(COMBUSKEN),
HOENN_TO_NATIONAL(BLAZIKEN),
HOENN_TO_NATIONAL(MUDKIP),
HOENN_TO_NATIONAL(MARSHTOMP),
HOENN_TO_NATIONAL(SWAMPERT),
HOENN_TO_NATIONAL(POOCHYENA),
HOENN_TO_NATIONAL(MIGHTYENA),
HOENN_TO_NATIONAL(ZIGZAGOON),
HOENN_TO_NATIONAL(LINOONE),
HOENN_TO_NATIONAL(WURMPLE),
HOENN_TO_NATIONAL(SILCOON),
HOENN_TO_NATIONAL(BEAUTIFLY),
HOENN_TO_NATIONAL(CASCOON),
HOENN_TO_NATIONAL(DUSTOX),
HOENN_TO_NATIONAL(LOTAD),
HOENN_TO_NATIONAL(LOMBRE),
HOENN_TO_NATIONAL(LUDICOLO),
HOENN_TO_NATIONAL(SEEDOT),
HOENN_TO_NATIONAL(NUZLEAF),
HOENN_TO_NATIONAL(SHIFTRY),
HOENN_TO_NATIONAL(TAILLOW),
HOENN_TO_NATIONAL(SWELLOW),
HOENN_TO_NATIONAL(WINGULL),
HOENN_TO_NATIONAL(PELIPPER),
HOENN_TO_NATIONAL(RALTS),
HOENN_TO_NATIONAL(KIRLIA),
HOENN_TO_NATIONAL(GARDEVOIR),
2019-04-02 21:22:16 +02:00
HOENN_TO_NATIONAL(GALLADE),
2018-12-03 14:49:16 +01:00
HOENN_TO_NATIONAL(SURSKIT),
HOENN_TO_NATIONAL(MASQUERAIN),
HOENN_TO_NATIONAL(SHROOMISH),
HOENN_TO_NATIONAL(BRELOOM),
HOENN_TO_NATIONAL(SLAKOTH),
HOENN_TO_NATIONAL(VIGOROTH),
HOENN_TO_NATIONAL(SLAKING),
HOENN_TO_NATIONAL(ABRA),
HOENN_TO_NATIONAL(KADABRA),
HOENN_TO_NATIONAL(ALAKAZAM),
HOENN_TO_NATIONAL(NINCADA),
HOENN_TO_NATIONAL(NINJASK),
HOENN_TO_NATIONAL(SHEDINJA),
HOENN_TO_NATIONAL(WHISMUR),
HOENN_TO_NATIONAL(LOUDRED),
HOENN_TO_NATIONAL(EXPLOUD),
HOENN_TO_NATIONAL(MAKUHITA),
HOENN_TO_NATIONAL(HARIYAMA),
HOENN_TO_NATIONAL(GOLDEEN),
HOENN_TO_NATIONAL(SEAKING),
HOENN_TO_NATIONAL(MAGIKARP),
HOENN_TO_NATIONAL(GYARADOS),
HOENN_TO_NATIONAL(AZURILL),
HOENN_TO_NATIONAL(MARILL),
HOENN_TO_NATIONAL(AZUMARILL),
HOENN_TO_NATIONAL(GEODUDE),
HOENN_TO_NATIONAL(GRAVELER),
HOENN_TO_NATIONAL(GOLEM),
HOENN_TO_NATIONAL(NOSEPASS),
2019-04-02 21:22:16 +02:00
HOENN_TO_NATIONAL(PROBOPASS),
2018-12-03 14:49:16 +01:00
HOENN_TO_NATIONAL(SKITTY),
HOENN_TO_NATIONAL(DELCATTY),
HOENN_TO_NATIONAL(ZUBAT),
HOENN_TO_NATIONAL(GOLBAT),
HOENN_TO_NATIONAL(CROBAT),
HOENN_TO_NATIONAL(TENTACOOL),
HOENN_TO_NATIONAL(TENTACRUEL),
HOENN_TO_NATIONAL(SABLEYE),
HOENN_TO_NATIONAL(MAWILE),
HOENN_TO_NATIONAL(ARON),
HOENN_TO_NATIONAL(LAIRON),
HOENN_TO_NATIONAL(AGGRON),
HOENN_TO_NATIONAL(MACHOP),
HOENN_TO_NATIONAL(MACHOKE),
HOENN_TO_NATIONAL(MACHAMP),
HOENN_TO_NATIONAL(MEDITITE),
HOENN_TO_NATIONAL(MEDICHAM),
HOENN_TO_NATIONAL(ELECTRIKE),
HOENN_TO_NATIONAL(MANECTRIC),
HOENN_TO_NATIONAL(PLUSLE),
HOENN_TO_NATIONAL(MINUN),
HOENN_TO_NATIONAL(MAGNEMITE),
HOENN_TO_NATIONAL(MAGNETON),
2019-04-02 21:22:16 +02:00
HOENN_TO_NATIONAL(MAGNEZONE),
2018-12-03 14:49:16 +01:00
HOENN_TO_NATIONAL(VOLTORB),
HOENN_TO_NATIONAL(ELECTRODE),
HOENN_TO_NATIONAL(VOLBEAT),
HOENN_TO_NATIONAL(ILLUMISE),
HOENN_TO_NATIONAL(ODDISH),
HOENN_TO_NATIONAL(GLOOM),
HOENN_TO_NATIONAL(VILEPLUME),
HOENN_TO_NATIONAL(BELLOSSOM),
HOENN_TO_NATIONAL(DODUO),
HOENN_TO_NATIONAL(DODRIO),
2019-04-02 21:22:16 +02:00
HOENN_TO_NATIONAL(BUDEW),
2018-12-03 14:49:16 +01:00
HOENN_TO_NATIONAL(ROSELIA),
2019-04-02 21:22:16 +02:00
HOENN_TO_NATIONAL(ROSERADE),
2018-12-03 14:49:16 +01:00
HOENN_TO_NATIONAL(GULPIN),
HOENN_TO_NATIONAL(SWALOT),
HOENN_TO_NATIONAL(CARVANHA),
HOENN_TO_NATIONAL(SHARPEDO),
HOENN_TO_NATIONAL(WAILMER),
HOENN_TO_NATIONAL(WAILORD),
HOENN_TO_NATIONAL(NUMEL),
HOENN_TO_NATIONAL(CAMERUPT),
HOENN_TO_NATIONAL(SLUGMA),
HOENN_TO_NATIONAL(MAGCARGO),
HOENN_TO_NATIONAL(TORKOAL),
HOENN_TO_NATIONAL(GRIMER),
HOENN_TO_NATIONAL(MUK),
HOENN_TO_NATIONAL(KOFFING),
HOENN_TO_NATIONAL(WEEZING),
HOENN_TO_NATIONAL(SPOINK),
HOENN_TO_NATIONAL(GRUMPIG),
HOENN_TO_NATIONAL(SANDSHREW),
HOENN_TO_NATIONAL(SANDSLASH),
HOENN_TO_NATIONAL(SPINDA),
HOENN_TO_NATIONAL(SKARMORY),
HOENN_TO_NATIONAL(TRAPINCH),
HOENN_TO_NATIONAL(VIBRAVA),
HOENN_TO_NATIONAL(FLYGON),
HOENN_TO_NATIONAL(CACNEA),
HOENN_TO_NATIONAL(CACTURNE),
HOENN_TO_NATIONAL(SWABLU),
HOENN_TO_NATIONAL(ALTARIA),
HOENN_TO_NATIONAL(ZANGOOSE),
HOENN_TO_NATIONAL(SEVIPER),
HOENN_TO_NATIONAL(LUNATONE),
HOENN_TO_NATIONAL(SOLROCK),
HOENN_TO_NATIONAL(BARBOACH),
HOENN_TO_NATIONAL(WHISCASH),
HOENN_TO_NATIONAL(CORPHISH),
HOENN_TO_NATIONAL(CRAWDAUNT),
HOENN_TO_NATIONAL(BALTOY),
HOENN_TO_NATIONAL(CLAYDOL),
HOENN_TO_NATIONAL(LILEEP),
HOENN_TO_NATIONAL(CRADILY),
HOENN_TO_NATIONAL(ANORITH),
HOENN_TO_NATIONAL(ARMALDO),
HOENN_TO_NATIONAL(IGGLYBUFF),
HOENN_TO_NATIONAL(JIGGLYPUFF),
HOENN_TO_NATIONAL(WIGGLYTUFF),
HOENN_TO_NATIONAL(FEEBAS),
HOENN_TO_NATIONAL(MILOTIC),
HOENN_TO_NATIONAL(CASTFORM),
HOENN_TO_NATIONAL(STARYU),
HOENN_TO_NATIONAL(STARMIE),
HOENN_TO_NATIONAL(KECLEON),
HOENN_TO_NATIONAL(SHUPPET),
HOENN_TO_NATIONAL(BANETTE),
HOENN_TO_NATIONAL(DUSKULL),
HOENN_TO_NATIONAL(DUSCLOPS),
2019-04-02 21:22:16 +02:00
HOENN_TO_NATIONAL(DUSKNOIR),
2018-12-03 14:49:16 +01:00
HOENN_TO_NATIONAL(TROPIUS),
2019-04-02 21:22:16 +02:00
HOENN_TO_NATIONAL(CHINGLING),
2018-12-03 14:49:16 +01:00
HOENN_TO_NATIONAL(CHIMECHO),
HOENN_TO_NATIONAL(ABSOL),
HOENN_TO_NATIONAL(VULPIX),
HOENN_TO_NATIONAL(NINETALES),
HOENN_TO_NATIONAL(PICHU),
HOENN_TO_NATIONAL(PIKACHU),
HOENN_TO_NATIONAL(RAICHU),
HOENN_TO_NATIONAL(PSYDUCK),
HOENN_TO_NATIONAL(GOLDUCK),
HOENN_TO_NATIONAL(WYNAUT),
HOENN_TO_NATIONAL(WOBBUFFET),
HOENN_TO_NATIONAL(NATU),
HOENN_TO_NATIONAL(XATU),
HOENN_TO_NATIONAL(GIRAFARIG),
HOENN_TO_NATIONAL(PHANPY),
HOENN_TO_NATIONAL(DONPHAN),
HOENN_TO_NATIONAL(PINSIR),
HOENN_TO_NATIONAL(HERACROSS),
HOENN_TO_NATIONAL(RHYHORN),
HOENN_TO_NATIONAL(RHYDON),
2019-04-02 21:22:16 +02:00
HOENN_TO_NATIONAL(RHYPERIOR),
2018-12-03 14:49:16 +01:00
HOENN_TO_NATIONAL(SNORUNT),
HOENN_TO_NATIONAL(GLALIE),
2019-04-02 21:22:16 +02:00
HOENN_TO_NATIONAL(FROSLASS),
2018-12-03 14:49:16 +01:00
HOENN_TO_NATIONAL(SPHEAL),
HOENN_TO_NATIONAL(SEALEO),
HOENN_TO_NATIONAL(WALREIN),
HOENN_TO_NATIONAL(CLAMPERL),
HOENN_TO_NATIONAL(HUNTAIL),
HOENN_TO_NATIONAL(GOREBYSS),
HOENN_TO_NATIONAL(RELICANTH),
HOENN_TO_NATIONAL(CORSOLA),
HOENN_TO_NATIONAL(CHINCHOU),
HOENN_TO_NATIONAL(LANTURN),
HOENN_TO_NATIONAL(LUVDISC),
HOENN_TO_NATIONAL(HORSEA),
HOENN_TO_NATIONAL(SEADRA),
HOENN_TO_NATIONAL(KINGDRA),
HOENN_TO_NATIONAL(BAGON),
HOENN_TO_NATIONAL(SHELGON),
HOENN_TO_NATIONAL(SALAMENCE),
HOENN_TO_NATIONAL(BELDUM),
HOENN_TO_NATIONAL(METANG),
HOENN_TO_NATIONAL(METAGROSS),
HOENN_TO_NATIONAL(REGIROCK),
HOENN_TO_NATIONAL(REGICE),
HOENN_TO_NATIONAL(REGISTEEL),
HOENN_TO_NATIONAL(LATIAS),
HOENN_TO_NATIONAL(LATIOS),
HOENN_TO_NATIONAL(KYOGRE),
HOENN_TO_NATIONAL(GROUDON),
HOENN_TO_NATIONAL(RAYQUAZA),
HOENN_TO_NATIONAL(JIRACHI),
HOENN_TO_NATIONAL(DEOXYS),
};
2018-02-05 17:56:28 +01:00
2018-02-05 17:39:26 +01:00
const struct SpindaSpot gSpindaSpotGraphics[] =
{
{16, 7, INCBIN_U16("graphics/spinda_spots/spot_0.bin")},
{40, 8, INCBIN_U16("graphics/spinda_spots/spot_1.bin")},
{22, 25, INCBIN_U16("graphics/spinda_spots/spot_2.bin")},
{34, 26, INCBIN_U16("graphics/spinda_spots/spot_3.bin")}
};
#include "data/pokemon/item_effects.h"
2020-07-17 02:12:12 +02:00
const s8 gNatureStatTable[NUM_NATURES][NUM_NATURE_STATS] =
2018-02-05 17:39:26 +01:00
{
2021-01-23 05:22:37 +01:00
// Atk Def Spd Sp.Atk Sp.Def
[NATURE_HARDY] = { 0, 0, 0, 0, 0},
[NATURE_LONELY] = { +1, -1, 0, 0, 0},
[NATURE_BRAVE] = { +1, 0, -1, 0, 0},
[NATURE_ADAMANT] = { +1, 0, 0, -1, 0},
[NATURE_NAUGHTY] = { +1, 0, 0, 0, -1},
[NATURE_BOLD] = { -1, +1, 0, 0, 0},
[NATURE_DOCILE] = { 0, 0, 0, 0, 0},
[NATURE_RELAXED] = { 0, +1, -1, 0, 0},
[NATURE_IMPISH] = { 0, +1, 0, -1, 0},
[NATURE_LAX] = { 0, +1, 0, 0, -1},
[NATURE_TIMID] = { -1, 0, +1, 0, 0},
[NATURE_HASTY] = { 0, -1, +1, 0, 0},
[NATURE_SERIOUS] = { 0, 0, 0, 0, 0},
[NATURE_JOLLY] = { 0, 0, +1, -1, 0},
[NATURE_NAIVE] = { 0, 0, +1, 0, -1},
[NATURE_MODEST] = { -1, 0, 0, +1, 0},
[NATURE_MILD] = { 0, -1, 0, +1, 0},
[NATURE_QUIET] = { 0, 0, -1, +1, 0},
[NATURE_BASHFUL] = { 0, 0, 0, 0, 0},
[NATURE_RASH] = { 0, 0, 0, +1, -1},
[NATURE_CALM] = { -1, 0, 0, 0, +1},
[NATURE_GENTLE] = { 0, -1, 0, 0, +1},
[NATURE_SASSY] = { 0, 0, -1, 0, +1},
[NATURE_CAREFUL] = { 0, 0, 0, -1, +1},
[NATURE_QUIRKY] = { 0, 0, 0, 0, 0},
2018-02-05 17:39:26 +01:00
};
#include "data/pokemon/tmhm_learnsets.h"
#include "data/pokemon/trainer_class_lookups.h"
#include "data/pokemon/experience_tables.h"
#include "data/pokemon/base_stats.h"
#include "data/pokemon/level_up_learnsets.h"
#include "data/pokemon/evolution.h"
#include "data/pokemon/level_up_learnset_pointers.h"
#include "data/pokemon/form_species_tables.h"
#include "data/pokemon/form_species_table_pointers.h"
2018-02-05 17:39:26 +01:00
2018-12-08 04:39:35 +01:00
// SPECIES_NONE are ignored in the following two tables, so decrement before accessing these arrays to get the right result
2019-04-03 17:39:08 +02:00
static const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1] =
{
[SPECIES_BULBASAUR - 1] = ANIM_V_JUMPS_H_JUMPS,
[SPECIES_IVYSAUR - 1] = ANIM_V_STRETCH,
[SPECIES_VENUSAUR - 1] = ANIM_ROTATE_UP_SLAM_DOWN,
[SPECIES_CHARMANDER - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_CHARMELEON - 1] = ANIM_BACK_AND_LUNGE,
[SPECIES_CHARIZARD - 1] = ANIM_V_SHAKE,
[SPECIES_SQUIRTLE - 1] = ANIM_SWING_CONCAVE,
[SPECIES_WARTORTLE - 1] = ANIM_SHRINK_GROW,
[SPECIES_BLASTOISE - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_CATERPIE - 1] = ANIM_SWING_CONCAVE,
[SPECIES_METAPOD - 1] = ANIM_SWING_CONCAVE,
[SPECIES_BUTTERFREE - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_WEEDLE - 1] = ANIM_H_SLIDE_SLOW,
[SPECIES_KAKUNA - 1] = ANIM_GLOW_ORANGE,
[SPECIES_BEEDRILL - 1] = ANIM_H_VIBRATE,
[SPECIES_PIDGEY - 1] = ANIM_V_STRETCH,
[SPECIES_PIDGEOTTO - 1] = ANIM_V_STRETCH,
[SPECIES_PIDGEOT - 1] = ANIM_FRONT_FLIP,
[SPECIES_RATTATA - 1] = ANIM_RAPID_H_HOPS,
[SPECIES_RATICATE - 1] = ANIM_FIGURE_8,
[SPECIES_SPEAROW - 1] = ANIM_RISING_WOBBLE,
[SPECIES_FEAROW - 1] = ANIM_FIGURE_8,
[SPECIES_EKANS - 1] = ANIM_H_STRETCH,
[SPECIES_ARBOK - 1] = ANIM_V_STRETCH,
[SPECIES_PIKACHU - 1] = ANIM_FLASH_YELLOW,
[SPECIES_RAICHU - 1] = ANIM_V_STRETCH,
[SPECIES_SANDSHREW - 1] = ANIM_SWING_CONCAVE_FAST_SHORT,
[SPECIES_SANDSLASH - 1] = ANIM_V_STRETCH,
[SPECIES_NIDORAN_F - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_NIDORINA - 1] = ANIM_V_STRETCH,
[SPECIES_NIDOQUEEN - 1] = ANIM_H_SHAKE,
[SPECIES_NIDORAN_M - 1] = ANIM_GROW_VIBRATE,
[SPECIES_NIDORINO - 1] = ANIM_SHRINK_GROW,
[SPECIES_NIDOKING - 1] = ANIM_H_SHAKE,
[SPECIES_CLEFAIRY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CLEFABLE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW,
[SPECIES_VULPIX - 1] = ANIM_V_STRETCH,
[SPECIES_NINETALES - 1] = ANIM_V_SHAKE,
[SPECIES_JIGGLYPUFF - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL,
[SPECIES_WIGGLYTUFF - 1] = ANIM_H_JUMPS,
[SPECIES_ZUBAT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GOLBAT - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_ODDISH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GLOOM - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_VILEPLUME - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW,
[SPECIES_PARAS - 1] = ANIM_H_SLIDE_SLOW,
[SPECIES_PARASECT - 1] = ANIM_H_SHAKE,
[SPECIES_VENONAT - 1] = ANIM_V_JUMPS_H_JUMPS,
[SPECIES_VENOMOTH - 1] = ANIM_ZIGZAG_SLOW,
[SPECIES_DIGLETT - 1] = ANIM_V_SHAKE,
[SPECIES_DUGTRIO - 1] = ANIM_H_SHAKE_SLOW,
[SPECIES_MEOWTH - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_PERSIAN - 1] = ANIM_V_STRETCH,
[SPECIES_PSYDUCK - 1] = ANIM_V_JUMPS_H_JUMPS,
[SPECIES_GOLDUCK - 1] = ANIM_H_SHAKE_SLOW,
[SPECIES_MANKEY - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_PRIMEAPE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL,
[SPECIES_GROWLITHE - 1] = ANIM_BACK_AND_LUNGE,
[SPECIES_ARCANINE - 1] = ANIM_H_VIBRATE,
[SPECIES_POLIWAG - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_POLIWHIRL - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_POLIWRATH - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_ABRA - 1] = ANIM_H_JUMPS,
[SPECIES_KADABRA - 1] = ANIM_GROW_VIBRATE,
[SPECIES_ALAKAZAM - 1] = ANIM_V_STRETCH,
[SPECIES_MACHOP - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MACHOKE - 1] = ANIM_V_SHAKE,
[SPECIES_MACHAMP - 1] = ANIM_H_JUMPS,
[SPECIES_BELLSPROUT - 1] = ANIM_V_STRETCH,
[SPECIES_WEEPINBELL - 1] = ANIM_SWING_CONVEX,
[SPECIES_VICTREEBEL - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_TENTACOOL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TENTACRUEL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GEODUDE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL,
[SPECIES_GRAVELER - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL,
[SPECIES_GOLEM - 1] = ANIM_ROTATE_UP_SLAM_DOWN,
[SPECIES_PONYTA - 1] = ANIM_GLOW_ORANGE,
[SPECIES_RAPIDASH - 1] = ANIM_CIRCULAR_VIBRATE,
[SPECIES_SLOWPOKE - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_SLOWBRO - 1] = ANIM_SWING_CONCAVE,
[SPECIES_MAGNEMITE - 1] = ANIM_TUMBLING_FRONT_FLIP_TWICE,
[SPECIES_MAGNETON - 1] = ANIM_FLASH_YELLOW,
[SPECIES_FARFETCHD - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL,
[SPECIES_DODUO - 1] = ANIM_H_SHAKE_SLOW,
[SPECIES_DODRIO - 1] = ANIM_LUNGE_GROW,
[SPECIES_SEEL - 1] = ANIM_SWING_CONCAVE,
[SPECIES_DEWGONG - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_GRIMER - 1] = ANIM_H_SLIDE_SLOW,
[SPECIES_MUK - 1] = ANIM_DEEP_V_SQUISH_AND_BOUNCE,
[SPECIES_SHELLDER - 1] = ANIM_TWIST,
[SPECIES_CLOYSTER - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_GASTLY - 1] = ANIM_GLOW_BLACK,
[SPECIES_HAUNTER - 1] = ANIM_FLICKER_INCREASING,
[SPECIES_GENGAR - 1] = ANIM_GROW_IN_STAGES,
[SPECIES_ONIX - 1] = ANIM_RAPID_H_HOPS,
[SPECIES_DROWZEE - 1] = ANIM_CIRCLE_C_CLOCKWISE_SLOW,
[SPECIES_HYPNO - 1] = ANIM_GROW_VIBRATE,
[SPECIES_KRABBY - 1] = ANIM_H_SLIDE,
[SPECIES_KINGLER - 1] = ANIM_ZIGZAG_SLOW,
[SPECIES_VOLTORB - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ELECTRODE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_EXEGGCUTE - 1] = ANIM_H_SLIDE_SLOW,
[SPECIES_EXEGGUTOR - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_CUBONE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL,
[SPECIES_MAROWAK - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES,
[SPECIES_HITMONLEE - 1] = ANIM_H_STRETCH,
[SPECIES_HITMONCHAN - 1] = ANIM_GROW_VIBRATE,
[SPECIES_LICKITUNG - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_KOFFING - 1] = ANIM_SHRINK_GROW,
[SPECIES_WEEZING - 1] = ANIM_V_SLIDE,
[SPECIES_RHYHORN - 1] = ANIM_V_SHAKE,
[SPECIES_RHYDON - 1] = ANIM_SHRINK_GROW,
[SPECIES_CHANSEY - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_TANGELA - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL,
[SPECIES_KANGASKHAN - 1] = ANIM_V_STRETCH,
[SPECIES_HORSEA - 1] = ANIM_TWIST,
[SPECIES_SEADRA - 1] = ANIM_V_SLIDE,
[SPECIES_GOLDEEN - 1] = ANIM_SWING_CONVEX,
[SPECIES_SEAKING - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_STARYU - 1] = ANIM_TWIST_TWICE,
[SPECIES_STARMIE - 1] = ANIM_TWIST,
[SPECIES_MR_MIME - 1] = ANIM_H_SLIDE_SLOW,
[SPECIES_SCYTHER - 1] = ANIM_H_VIBRATE,
[SPECIES_JYNX - 1] = ANIM_V_STRETCH,
[SPECIES_ELECTABUZZ - 1] = ANIM_FLASH_YELLOW,
[SPECIES_MAGMAR - 1] = ANIM_H_SHAKE,
[SPECIES_PINSIR - 1] = ANIM_GROW_VIBRATE,
[SPECIES_TAUROS - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_MAGIKARP - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES,
[SPECIES_GYARADOS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL,
[SPECIES_LAPRAS - 1] = ANIM_V_STRETCH,
[SPECIES_DITTO - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_EEVEE - 1] = ANIM_V_STRETCH,
[SPECIES_VAPOREON - 1] = ANIM_V_STRETCH,
[SPECIES_JOLTEON - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FLAREON - 1] = ANIM_V_STRETCH,
[SPECIES_PORYGON - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_OMANYTE - 1] = ANIM_V_SLIDE_WOBBLE_SMALL,
[SPECIES_OMASTAR - 1] = ANIM_GROW_VIBRATE,
[SPECIES_KABUTO - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_KABUTOPS - 1] = ANIM_H_SHAKE,
[SPECIES_AERODACTYL - 1] = ANIM_V_SLIDE_SLOW,
[SPECIES_SNORLAX - 1] = ANIM_SWING_CONCAVE,
[SPECIES_ARTICUNO - 1] = ANIM_GROW_VIBRATE,
[SPECIES_ZAPDOS - 1] = ANIM_FLASH_YELLOW,
[SPECIES_MOLTRES - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_DRATINI - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DRAGONAIR - 1] = ANIM_V_SHAKE,
[SPECIES_DRAGONITE - 1] = ANIM_V_SLIDE_SLOW,
[SPECIES_MEWTWO - 1] = ANIM_GROW_VIBRATE,
[SPECIES_MEW - 1] = ANIM_SWING_CONVEX,
[SPECIES_CHIKORITA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BAYLEEF - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MEGANIUM - 1] = ANIM_V_STRETCH,
[SPECIES_CYNDAQUIL - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_QUILAVA - 1] = ANIM_V_STRETCH,
[SPECIES_TYPHLOSION - 1] = ANIM_V_SHAKE,
[SPECIES_TOTODILE - 1] = ANIM_H_JUMPS,
[SPECIES_CROCONAW - 1] = ANIM_H_SHAKE,
[SPECIES_FERALIGATR - 1] = ANIM_H_SHAKE,
[SPECIES_SENTRET - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FURRET - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_HOOTHOOT - 1] = ANIM_V_SLIDE_SLOW,
[SPECIES_NOCTOWL - 1] = ANIM_V_STRETCH,
[SPECIES_LEDYBA - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_LEDIAN - 1] = ANIM_V_SLIDE_SLOW,
[SPECIES_SPINARAK - 1] = ANIM_CIRCLE_C_CLOCKWISE_SLOW,
[SPECIES_ARIADOS - 1] = ANIM_H_SHAKE,
[SPECIES_CROBAT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CHINCHOU - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_LANTURN - 1] = ANIM_V_SLIDE_WOBBLE_SMALL,
[SPECIES_PICHU - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_CLEFFA - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_IGGLYBUFF - 1] = ANIM_SWING_CONCAVE_FAST,
[SPECIES_TOGEPI - 1] = ANIM_SWING_CONCAVE,
[SPECIES_TOGETIC - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_NATU - 1] = ANIM_H_JUMPS,
[SPECIES_XATU - 1] = ANIM_GROW_VIBRATE,
[SPECIES_MAREEP - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FLAAFFY - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_AMPHAROS - 1] = ANIM_FLASH_YELLOW,
[SPECIES_BELLOSSOM - 1] = ANIM_SWING_CONCAVE,
[SPECIES_MARILL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_AZUMARILL - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW,
[SPECIES_SUDOWOODO - 1] = ANIM_H_SLIDE_SLOW,
[SPECIES_POLITOED - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_HOPPIP - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_SKIPLOOM - 1] = ANIM_RISING_WOBBLE,
[SPECIES_JUMPLUFF - 1] = ANIM_V_SLIDE_WOBBLE_SMALL,
[SPECIES_AIPOM - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_SUNKERN - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_SUNFLORA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_YANMA - 1] = ANIM_FIGURE_8,
[SPECIES_WOOPER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_QUAGSIRE - 1] = ANIM_H_STRETCH,
[SPECIES_ESPEON - 1] = ANIM_GROW_VIBRATE,
[SPECIES_UMBREON - 1] = ANIM_V_SHAKE,
[SPECIES_MURKROW - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SLOWKING - 1] = ANIM_SHRINK_GROW,
[SPECIES_MISDREAVUS - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_UNOWN - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_WOBBUFFET - 1] = ANIM_DEEP_V_SQUISH_AND_BOUNCE,
[SPECIES_GIRAFARIG - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_PINECO - 1] = ANIM_SWING_CONCAVE,
[SPECIES_FORRETRESS - 1] = ANIM_V_SHAKE,
[SPECIES_DUNSPARCE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GLIGAR - 1] = ANIM_SHRINK_GROW,
[SPECIES_STEELIX - 1] = ANIM_H_SHAKE,
[SPECIES_SNUBBULL - 1] = ANIM_V_STRETCH,
[SPECIES_GRANBULL - 1] = ANIM_V_SHAKE,
[SPECIES_QWILFISH - 1] = ANIM_GROW_IN_STAGES,
[SPECIES_SCIZOR - 1] = ANIM_H_VIBRATE,
[SPECIES_SHUCKLE - 1] = ANIM_SWING_CONCAVE,
[SPECIES_HERACROSS - 1] = ANIM_LUNGE_GROW,
[SPECIES_SNEASEL - 1] = ANIM_H_STRETCH,
[SPECIES_TEDDIURSA - 1] = ANIM_V_STRETCH,
[SPECIES_URSARING - 1] = ANIM_V_SHAKE,
[SPECIES_SLUGMA - 1] = ANIM_V_STRETCH,
[SPECIES_MAGCARGO - 1] = ANIM_V_STRETCH,
[SPECIES_SWINUB - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PILOSWINE - 1] = ANIM_H_SHAKE,
[SPECIES_CORSOLA - 1] = ANIM_H_SLIDE,
[SPECIES_REMORAID - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_OCTILLERY - 1] = ANIM_V_STRETCH,
[SPECIES_DELIBIRD - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_MANTINE - 1] = ANIM_SWING_CONVEX,
[SPECIES_SKARMORY - 1] = ANIM_V_STRETCH,
[SPECIES_HOUNDOUR - 1] = ANIM_V_STRETCH,
[SPECIES_HOUNDOOM - 1] = ANIM_V_SHAKE,
[SPECIES_KINGDRA - 1] = ANIM_CIRCLE_INTO_BG,
[SPECIES_PHANPY - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_DONPHAN - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_PORYGON2 - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_STANTLER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SMEARGLE - 1] = ANIM_H_JUMPS,
[SPECIES_TYROGUE - 1] = ANIM_H_STRETCH,
[SPECIES_HITMONTOP - 1] = ANIM_H_VIBRATE,
[SPECIES_SMOOCHUM - 1] = ANIM_GROW_VIBRATE,
[SPECIES_ELEKID - 1] = ANIM_FLASH_YELLOW,
[SPECIES_MAGBY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MILTANK - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_BLISSEY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_RAIKOU - 1] = ANIM_FLASH_YELLOW,
[SPECIES_ENTEI - 1] = ANIM_GROW_VIBRATE,
[SPECIES_SUICUNE - 1] = ANIM_V_SHAKE,
[SPECIES_LARVITAR - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_PUPITAR - 1] = ANIM_V_SHAKE,
[SPECIES_TYRANITAR - 1] = ANIM_H_SHAKE,
[SPECIES_LUGIA - 1] = ANIM_GROW_IN_STAGES,
[SPECIES_HO_OH - 1] = ANIM_GROW_VIBRATE,
[SPECIES_CELEBI - 1] = ANIM_RISING_WOBBLE,
[SPECIES_TREECKO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GROVYLE - 1] = ANIM_V_STRETCH,
[SPECIES_SCEPTILE - 1] = ANIM_V_SHAKE,
[SPECIES_TORCHIC - 1] = ANIM_H_STRETCH,
[SPECIES_COMBUSKEN - 1] = ANIM_V_JUMPS_H_JUMPS,
[SPECIES_BLAZIKEN - 1] = ANIM_H_SHAKE,
[SPECIES_MUDKIP - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_MARSHTOMP - 1] = ANIM_V_SLIDE,
[SPECIES_SWAMPERT - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_POOCHYENA - 1] = ANIM_V_SHAKE,
[SPECIES_MIGHTYENA - 1] = ANIM_V_SHAKE,
[SPECIES_ZIGZAGOON - 1] = ANIM_H_SLIDE,
[SPECIES_LINOONE - 1] = ANIM_GROW_VIBRATE,
[SPECIES_WURMPLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SILCOON - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BEAUTIFLY - 1] = ANIM_V_SLIDE,
[SPECIES_CASCOON - 1] = ANIM_V_SLIDE,
[SPECIES_DUSTOX - 1] = ANIM_V_JUMPS_H_JUMPS,
[SPECIES_LOTAD - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_LOMBRE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_LUDICOLO - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW,
[SPECIES_SEEDOT - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES,
[SPECIES_NUZLEAF - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SHIFTRY - 1] = ANIM_H_VIBRATE,
[SPECIES_TAILLOW - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_SWELLOW - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_WINGULL - 1] = ANIM_H_PIVOT,
[SPECIES_PELIPPER - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_RALTS - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_KIRLIA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GARDEVOIR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SURSKIT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MASQUERAIN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SHROOMISH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BRELOOM - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SLAKOTH - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_VIGOROTH - 1] = ANIM_H_JUMPS,
[SPECIES_SLAKING - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_NINCADA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_NINJASK - 1] = ANIM_H_SLIDE_SLOW,
[SPECIES_SHEDINJA - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_WHISMUR - 1] = ANIM_H_SLIDE,
[SPECIES_LOUDRED - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW,
[SPECIES_EXPLOUD - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_MAKUHITA - 1] = ANIM_SWING_CONCAVE,
[SPECIES_HARIYAMA - 1] = ANIM_ROTATE_UP_TO_SIDES,
[SPECIES_AZURILL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_NOSEPASS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW,
[SPECIES_SKITTY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DELCATTY - 1] = ANIM_V_STRETCH,
[SPECIES_SABLEYE - 1] = ANIM_GLOW_BLACK,
[SPECIES_MAWILE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ARON - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_LAIRON - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_AGGRON - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_MEDITITE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES,
[SPECIES_MEDICHAM - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_ELECTRIKE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MANECTRIC - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PLUSLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MINUN - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_VOLBEAT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ILLUMISE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES,
[SPECIES_ROSELIA - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_GULPIN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SWALOT - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_CARVANHA - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW,
[SPECIES_SHARPEDO - 1] = ANIM_H_JUMPS_V_STRETCH_TWICE,
[SPECIES_WAILMER - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_WAILORD - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_NUMEL - 1] = ANIM_V_SLIDE,
[SPECIES_CAMERUPT - 1] = ANIM_V_SHAKE,
[SPECIES_TORKOAL - 1] = ANIM_V_STRETCH,
[SPECIES_SPOINK - 1] = ANIM_H_JUMPS_V_STRETCH_TWICE,
[SPECIES_GRUMPIG - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_SPINDA - 1] = ANIM_H_JUMPS,
[SPECIES_TRAPINCH - 1] = ANIM_V_SHAKE,
[SPECIES_VIBRAVA - 1] = ANIM_H_SHAKE,
[SPECIES_FLYGON - 1] = ANIM_ZIGZAG_SLOW,
[SPECIES_CACNEA - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW,
[SPECIES_CACTURNE - 1] = ANIM_V_SLIDE,
[SPECIES_SWABLU - 1] = ANIM_V_SLIDE,
[SPECIES_ALTARIA - 1] = ANIM_H_STRETCH,
[SPECIES_ZANGOOSE - 1] = ANIM_GROW_VIBRATE,
[SPECIES_SEVIPER - 1] = ANIM_V_STRETCH,
[SPECIES_LUNATONE - 1] = ANIM_SWING_CONVEX_FAST,
[SPECIES_SOLROCK - 1] = ANIM_ROTATE_TO_SIDES_TWICE,
[SPECIES_BARBOACH - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW,
[SPECIES_WHISCASH - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW,
[SPECIES_CORPHISH - 1] = ANIM_V_SHAKE,
[SPECIES_CRAWDAUNT - 1] = ANIM_GROW_VIBRATE,
[SPECIES_BALTOY - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_CLAYDOL - 1] = ANIM_V_SLIDE_WOBBLE_SMALL,
[SPECIES_LILEEP - 1] = ANIM_V_STRETCH,
[SPECIES_CRADILY - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_ANORITH - 1] = ANIM_TWIST,
[SPECIES_ARMALDO - 1] = ANIM_V_SHAKE,
[SPECIES_FEEBAS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW,
[SPECIES_MILOTIC - 1] = ANIM_GLOW_BLUE,
[SPECIES_CASTFORM - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_KECLEON - 1] = ANIM_FLICKER_INCREASING,
[SPECIES_SHUPPET - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_BANETTE - 1] = ANIM_SWING_CONVEX,
[SPECIES_DUSKULL - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_DUSCLOPS - 1] = ANIM_H_VIBRATE,
[SPECIES_TROPIUS - 1] = ANIM_V_SHAKE,
[SPECIES_CHIMECHO - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_ABSOL - 1] = ANIM_CIRCULAR_VIBRATE,
[SPECIES_WYNAUT - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_SNORUNT - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_GLALIE - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_SPHEAL - 1] = ANIM_SPIN,
[SPECIES_SEALEO - 1] = ANIM_V_STRETCH,
[SPECIES_WALREIN - 1] = ANIM_H_SHAKE,
[SPECIES_CLAMPERL - 1] = ANIM_TWIST,
[SPECIES_HUNTAIL - 1] = ANIM_GROW_VIBRATE,
[SPECIES_GOREBYSS - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_RELICANTH - 1] = ANIM_TIP_MOVE_FORWARD,
[SPECIES_LUVDISC - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_BAGON - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_SHELGON - 1] = ANIM_V_SLIDE,
[SPECIES_SALAMENCE - 1] = ANIM_H_SHAKE,
[SPECIES_BELDUM - 1] = ANIM_H_SHAKE,
[SPECIES_METANG - 1] = ANIM_V_SLIDE,
[SPECIES_METAGROSS - 1] = ANIM_V_SHAKE,
[SPECIES_REGIROCK - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_REGICE - 1] = ANIM_FOUR_PETAL,
[SPECIES_REGISTEEL - 1] = ANIM_GROW_VIBRATE,
[SPECIES_LATIAS - 1] = ANIM_SWING_CONCAVE_FAST_SHORT,
[SPECIES_LATIOS - 1] = ANIM_V_SHAKE,
[SPECIES_KYOGRE - 1] = ANIM_SWING_CONCAVE_FAST_SHORT,
[SPECIES_GROUDON - 1] = ANIM_V_SHAKE,
[SPECIES_RAYQUAZA - 1] = ANIM_H_SHAKE,
[SPECIES_JIRACHI - 1] = ANIM_SWING_CONVEX,
[SPECIES_DEOXYS - 1] = ANIM_H_PIVOT,
2019-05-05 10:09:52 +02:00
// Gen 4
[SPECIES_TURTWIG - 1] = ANIM_V_SLIDE,
[SPECIES_GROTLE - 1] = ANIM_H_SLIDE,
[SPECIES_TORTERRA - 1] = ANIM_V_SHAKE,
[SPECIES_CHIMCHAR - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_MONFERNO - 1] = ANIM_H_SHAKE_SLOW,
[SPECIES_INFERNAPE - 1] = ANIM_BACK_AND_LUNGE,
[SPECIES_PIPLUP - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_PRINPLUP - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_EMPOLEON - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_STARLY - 1] = ANIM_V_STRETCH,
[SPECIES_STARAVIA - 1] = ANIM_V_STRETCH,
[SPECIES_STARAPTOR - 1] = ANIM_H_STRETCH,
[SPECIES_BIDOOF - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_BIBAREL - 1] = ANIM_GROW,
[SPECIES_KRICKETOT - 1] = ANIM_V_SHAKE,
[SPECIES_KRICKETUNE - 1] = ANIM_V_SHAKE,
[SPECIES_SHINX - 1] = ANIM_V_STRETCH,
[SPECIES_LUXIO - 1] = ANIM_V_STRETCH,
[SPECIES_LUXRAY - 1] = ANIM_GLOW_YELLOW,
[SPECIES_BUDEW - 1] = ANIM_SHRINK_GROW,
[SPECIES_ROSERADE - 1] = ANIM_GLOW_PURPLE,
[SPECIES_CRANIDOS - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_RAMPARDOS - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_SHIELDON - 1] = ANIM_V_SHAKE,
[SPECIES_BASTIODON - 1] = ANIM_H_SHAKE,
[SPECIES_BURMY - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_WORMADAM - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_MOTHIM - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_COMBEE - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_VESPIQUEN - 1] = ANIM_GLOW_ORANGE,
[SPECIES_PACHIRISU - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BUIZEL - 1] = ANIM_CIRCULAR_VIBRATE,
[SPECIES_FLOATZEL - 1] = ANIM_SHRINK_GROW,
[SPECIES_CHERUBI - 1] = ANIM_DEEP_V_SQUISH_AND_BOUNCE,
[SPECIES_CHERRIM - 1] = ANIM_DEEP_V_SQUISH_AND_BOUNCE,
[SPECIES_SHELLOS - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_GASTRODON - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_AMBIPOM - 1] = ANIM_BACK_AND_LUNGE,
[SPECIES_DRIFLOON - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_DRIFBLIM - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_BUNEARY - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_LOPUNNY - 1] = ANIM_SHRINK_GROW,
[SPECIES_MISMAGIUS - 1] = ANIM_SWING_CONVEX_FAST,
[SPECIES_HONCHKROW - 1] = ANIM_GLOW_BLACK,
[SPECIES_GLAMEOW - 1] = ANIM_GROW_VIBRATE,
[SPECIES_PURUGLY - 1] = ANIM_V_SHAKE,
[SPECIES_CHINGLING - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_STUNKY - 1] = ANIM_TIP_MOVE_FORWARD,
[SPECIES_SKUNTANK - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_BRONZOR - 1] = ANIM_TWIST_TWICE,
[SPECIES_BRONZONG - 1] = ANIM_V_SLIDE_WOBBLE_SMALL,
[SPECIES_BONSLY - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_MIME_JR - 1] = ANIM_H_SLIDE_SHRINK,
[SPECIES_HAPPINY - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_CHATOT - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_SPIRITOMB - 1] = ANIM_GROW_IN_STAGES,
[SPECIES_GIBLE - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_GABITE - 1] = ANIM_V_STRETCH,
[SPECIES_GARCHOMP - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_MUNCHLAX - 1] = ANIM_SHRINK_GROW,
[SPECIES_RIOLU - 1] = ANIM_H_STRETCH,
[SPECIES_LUCARIO - 1] = ANIM_H_SHAKE,
[SPECIES_HIPPOPOTAS - 1] = ANIM_V_STRETCH,
[SPECIES_HIPPOWDON - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SKORUPI - 1] = ANIM_V_SHAKE,
[SPECIES_DRAPION - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_CROAGUNK - 1] = ANIM_GLOW_PURPLE,
[SPECIES_TOXICROAK - 1] = ANIM_V_SLIDE,
[SPECIES_CARNIVINE - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_FINNEON - 1] = ANIM_SWING_CONCAVE_FAST_SHORT,
[SPECIES_LUMINEON - 1] = ANIM_GLOW_BLUE,
[SPECIES_MANTYKE - 1] = ANIM_TWIST_TWICE,
[SPECIES_SNOVER - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_ABOMASNOW - 1] = ANIM_H_SHAKE,
[SPECIES_WEAVILE - 1] = ANIM_H_SHAKE,
[SPECIES_MAGNEZONE - 1] = ANIM_GLOW_YELLOW,
[SPECIES_LICKILICKY - 1] = ANIM_ROTATE_UP_SLAM_DOWN,
[SPECIES_RHYPERIOR - 1] = ANIM_LUNGE_GROW,
[SPECIES_TANGROWTH - 1] = ANIM_GROW_IN_STAGES,
[SPECIES_ELECTIVIRE - 1] = ANIM_GLOW_YELLOW,
[SPECIES_MAGMORTAR - 1] = ANIM_GLOW_RED,
[SPECIES_TOGEKISS - 1] = ANIM_TIP_MOVE_FORWARD,
[SPECIES_YANMEGA - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_LEAFEON - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_GLACEON - 1] = ANIM_V_STRETCH,
[SPECIES_GLISCOR - 1] = ANIM_TWIST,
[SPECIES_MAMOSWINE - 1] = ANIM_V_JUMPS_BIG,
[SPECIES_PORYGON_Z - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_GALLADE - 1] = ANIM_SHRINK_GROW,
[SPECIES_PROBOPASS - 1] = ANIM_SWING_CONVEX_FAST,
[SPECIES_DUSKNOIR - 1] = ANIM_GLOW_BLACK,
[SPECIES_FROSLASS - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_ROTOM - 1] = ANIM_GLOW_YELLOW,
[SPECIES_UXIE - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_MESPRIT - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_AZELF - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_DIALGA - 1] = ANIM_DEEP_V_SQUISH_AND_BOUNCE,
[SPECIES_PALKIA - 1] = ANIM_H_SHAKE,
[SPECIES_HEATRAN - 1] = ANIM_GLOW_RED,
[SPECIES_REGIGIGAS - 1] = ANIM_GROW_IN_STAGES,
[SPECIES_GIRATINA - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_CRESSELIA - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_PHIONE - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_MANAPHY - 1] = ANIM_V_STRETCH,
[SPECIES_DARKRAI - 1] = ANIM_GLOW_BLACK,
[SPECIES_SHAYMIN - 1] = ANIM_SHRINK_GROW,
[SPECIES_ARCEUS - 1] = ANIM_CIRCULAR_VIBRATE,
2019-05-05 10:09:52 +02:00
//Gen 6
[SPECIES_CHESPIN - 1] = ANIM_H_JUMPS,
[SPECIES_QUILLADIN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CHESNAUGHT - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_FENNEKIN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BRAIXEN - 1] = ANIM_SHAKE_GLOW_RED_SLOW,
[SPECIES_DELPHOX - 1] = ANIM_V_STRETCH,
[SPECIES_FROAKIE - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_FROGADIER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GRENINJA - 1] = ANIM_SHRINK_GROW,
[SPECIES_BUNNELBY - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_DIGGERSBY - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_FLETCHLING - 1] = ANIM_H_STRETCH,
[SPECIES_FLETCHINDER - 1] = ANIM_GROW_VIBRATE,
[SPECIES_TALONFLAME - 1] = ANIM_GROW_IN_STAGES,
[SPECIES_SCATTERBUG - 1] = ANIM_H_JUMPS,
[SPECIES_SPEWPA - 1] = ANIM_V_SHAKE,
[SPECIES_VIVILLON - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_LITLEO - 1] = ANIM_BACK_AND_LUNGE,
[SPECIES_PYROAR - 1] = ANIM_GROW_VIBRATE,
[SPECIES_FLABEBE - 1] = ANIM_V_SLIDE_WOBBLE_SMALL,
[SPECIES_FLOETTE - 1] = ANIM_SWING_CONVEX,
[SPECIES_FLORGES - 1] = ANIM_V_SLIDE_SLOW,
[SPECIES_SKIDDO - 1] = ANIM_H_STRETCH,
[SPECIES_GOGOAT - 1] = ANIM_V_STRETCH,
[SPECIES_PANCHAM - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_PANGORO - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_FURFROU - 1] = ANIM_H_STRETCH,
[SPECIES_ESPURR - 1] = ANIM_H_STRETCH,
[SPECIES_MEOWSTIC - 1] = ANIM_SHRINK_GROW,
[SPECIES_HONEDGE - 1] = ANIM_SWING_CONVEX,
[SPECIES_DOUBLADE - 1] = ANIM_SWING_CONVEX,
[SPECIES_AEGISLASH - 1] = ANIM_H_VIBRATE,
[SPECIES_SPRITZEE - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_AROMATISSE - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_SWIRLIX - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_SLURPUFF - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_INKAY - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_MALAMAR - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_BINACLE - 1] = ANIM_V_STRETCH,
[SPECIES_BARBARACLE - 1] = ANIM_ROTATE_UP_SLAM_DOWN,
[SPECIES_SKRELP - 1] = ANIM_V_SLIDE_WOBBLE_SMALL,
[SPECIES_DRAGALGE - 1] = ANIM_SHRINK_GROW,
[SPECIES_CLAUNCHER - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_CLAWITZER - 1] = ANIM_BACK_AND_LUNGE,
[SPECIES_HELIOPTILE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_HELIOLISK - 1] = ANIM_GROW_VIBRATE,
[SPECIES_TYRUNT - 1] = ANIM_V_SHAKE,
[SPECIES_TYRANTRUM - 1] = ANIM_H_SHAKE,
[SPECIES_AMAURA - 1] = ANIM_V_STRETCH,
[SPECIES_AURORUS - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_SYLVEON - 1] = ANIM_H_STRETCH,
[SPECIES_HAWLUCHA - 1] = ANIM_H_STRETCH,
[SPECIES_DEDENNE - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_CARBINK - 1] = ANIM_SWING_CONVEX,
[SPECIES_GOOMY - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_SLIGGOO - 1] = ANIM_H_SPRING_SLOW,
[SPECIES_GOODRA - 1] = ANIM_V_SHAKE,
[SPECIES_KLEFKI - 1] = ANIM_SWING_CONVEX,
[SPECIES_PHANTUMP - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_TREVENANT - 1] = ANIM_FLICKER_INCREASING,
[SPECIES_PUMPKABOO - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_GOURGEIST - 1] = ANIM_SWING_CONVEX,
[SPECIES_BERGMITE - 1] = ANIM_V_SHAKE,
[SPECIES_AVALUGG - 1] = ANIM_ROTATE_UP_SLAM_DOWN,
[SPECIES_NOIBAT - 1] = ANIM_V_SLIDE_WOBBLE_SMALL,
[SPECIES_NOIVERN - 1] = ANIM_GROW_VIBRATE,
[SPECIES_XERNEAS - 1] = ANIM_GLOW_YELLOW,
[SPECIES_YVELTAL - 1] = ANIM_SHAKE_GLOW_BLACK_SLOW,
[SPECIES_ZYGARDE - 1] = ANIM_GROW_VIBRATE,
[SPECIES_DIANCIE - 1] = ANIM_SWING_CONVEX,
[SPECIES_HOOPA - 1] = ANIM_ZIGZAG_SLOW,
[SPECIES_VOLCANION - 1] = ANIM_V_SHAKE,
// Gen 5 Todo: Assign proper ones.
[SPECIES_VICTINI - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SNIVY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SERVINE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SERPERIOR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TEPIG - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PIGNITE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_EMBOAR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_OSHAWOTT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DEWOTT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SAMUROTT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PATRAT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_WATCHOG - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_LILLIPUP - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_HERDIER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_STOUTLAND - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PURRLOIN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_LIEPARD - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PANSAGE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SIMISAGE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PANSEAR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SIMISEAR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PANPOUR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SIMIPOUR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MUNNA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MUSHARNA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PIDOVE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TRANQUILL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_UNFEZANT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BLITZLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ZEBSTRIKA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ROGGENROLA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BOLDORE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GIGALITH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_WOOBAT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SWOOBAT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DRILBUR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_EXCADRILL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_AUDINO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TIMBURR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GURDURR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CONKELDURR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TYMPOLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PALPITOAD - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SEISMITOAD - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_THROH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SAWK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SEWADDLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SWADLOON - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_LEAVANNY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_VENIPEDE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_WHIRLIPEDE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SCOLIPEDE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_COTTONEE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_WHIMSICOTT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PETILIL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_LILLIGANT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BASCULIN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SANDILE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_KROKOROK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_KROOKODILE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DARUMAKA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DARMANITAN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MARACTUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DWEBBLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CRUSTLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SCRAGGY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SCRAFTY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SIGILYPH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_YAMASK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_COFAGRIGUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TIRTOUGA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CARRACOSTA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ARCHEN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ARCHEOPS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TRUBBISH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GARBODOR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ZORUA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ZOROARK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MINCCINO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CINCCINO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GOTHITA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GOTHORITA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GOTHITELLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SOLOSIS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DUOSION - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_REUNICLUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DUCKLETT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SWANNA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_VANILLITE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_VANILLISH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_VANILLUXE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DEERLING - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SAWSBUCK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_EMOLGA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_KARRABLAST - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ESCAVALIER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FOONGUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_AMOONGUSS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FRILLISH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_JELLICENT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ALOMOMOLA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_JOLTIK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GALVANTULA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FERROSEED - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FERROTHORN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_KLINK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_KLANG - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_KLINKLANG - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TYNAMO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_EELEKTRIK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_EELEKTROSS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ELGYEM - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BEHEEYEM - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_LITWICK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_LAMPENT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CHANDELURE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_AXEW - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FRAXURE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_HAXORUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CUBCHOO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BEARTIC - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CRYOGONAL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SHELMET - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ACCELGOR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_STUNFISK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MIENFOO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MIENSHAO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DRUDDIGON - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GOLETT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GOLURK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PAWNIARD - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BISHARP - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BOUFFALANT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_RUFFLET - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BRAVIARY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_VULLABY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MANDIBUZZ - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_HEATMOR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DURANT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DEINO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ZWEILOUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_HYDREIGON - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_LARVESTA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_VOLCARONA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_COBALION - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TERRAKION - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_VIRIZION - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TORNADUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_THUNDURUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_RESHIRAM - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ZEKROM - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_LANDORUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_KYUREM - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_KELDEO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MELOETTA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GENESECT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
2020-12-16 21:57:36 +01:00
// Gen 7
[SPECIES_ROWLET - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DARTRIX - 1] = ANIM_H_STRETCH,
[SPECIES_DECIDUEYE - 1] = ANIM_H_VIBRATE,
[SPECIES_LITTEN - 1] = ANIM_H_STRETCH,
[SPECIES_TORRACAT - 1] = ANIM_V_STRETCH,
[SPECIES_INCINEROAR - 1] = ANIM_V_SHAKE,
[SPECIES_POPPLIO - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_BRIONNE - 1] = ANIM_SHRINK_GROW,
[SPECIES_PRIMARINA - 1] = ANIM_SHAKE_GLOW_BLUE_SLOW,
[SPECIES_PIKIPEK - 1] = ANIM_V_JUMPS_SMALL,
[SPECIES_TRUMBEAK - 1] = ANIM_H_STRETCH,
[SPECIES_TOUCANNON - 1] = ANIM_SHRINK_GROW_VIBRATE_FAST,
[SPECIES_YUNGOOS - 1] = ANIM_V_STRETCH,
[SPECIES_GUMSHOOS - 1] = ANIM_H_SHAKE,
[SPECIES_GRUBBIN - 1] = ANIM_H_SLIDE,
[SPECIES_CHARJABUG - 1] = ANIM_SHAKE_FLASH_YELLOW_SLOW,
[SPECIES_VIKAVOLT - 1] = ANIM_H_VIBRATE,
[SPECIES_CRABRAWLER - 1] = ANIM_V_SHAKE,
[SPECIES_CRABOMINABLE - 1] = ANIM_SHRINK_GROW_VIBRATE_FAST,
[SPECIES_ORICORIO - 1] = ANIM_CONCAVE_ARC_SMALL,
[SPECIES_CUTIEFLY - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_RIBOMBEE - 1] = ANIM_CONVEX_DOUBLE_ARC_TWICE,
[SPECIES_ROCKRUFF - 1] = ANIM_V_STRETCH,
[SPECIES_LYCANROC - 1] = ANIM_V_SHAKE,
[SPECIES_WISHIWASHI - 1] = ANIM_V_SLIDE_WOBBLE_SMALL,
[SPECIES_MAREANIE - 1] = ANIM_GLOW_PURPLE,
[SPECIES_TOXAPEX - 1] = ANIM_SHAKE_GLOW_PURPLE_SLOW,
[SPECIES_MUDBRAY - 1] = ANIM_V_SHAKE,
[SPECIES_MUDSDALE - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_DEWPIDER - 1] = ANIM_SHRINK_GROW,
[SPECIES_ARAQUANID - 1] = ANIM_H_SHAKE,
[SPECIES_FOMANTIS - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW,
[SPECIES_LURANTIS - 1] = ANIM_GROW_VIBRATE,
[SPECIES_MORELULL - 1] = ANIM_SHAKE_FLASH_YELLOW,
[SPECIES_SHIINOTIC - 1] = ANIM_SHAKE_GLOW_WHITE_SLOW,
[SPECIES_SALANDIT - 1] = ANIM_SHAKE_GLOW_RED_SLOW,
[SPECIES_SALAZZLE - 1] = ANIM_GROW_VIBRATE,
[SPECIES_STUFFUL - 1] = ANIM_H_STRETCH,
[SPECIES_BEWEAR - 1] = ANIM_H_STRETCH,
[SPECIES_BOUNSWEET - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_STEENEE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TSAREENA - 1] = ANIM_SHRINK_GROW,
[SPECIES_COMFEY - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_ORANGURU - 1] = ANIM_SHRINK_GROW,
[SPECIES_PASSIMIAN - 1] = ANIM_V_SHAKE,
[SPECIES_WIMPOD - 1] = ANIM_V_SHAKE_H_SLIDE_FAST,
[SPECIES_GOLISOPOD - 1] = ANIM_SHRINK_GROW_VIBRATE_FAST,
[SPECIES_SANDYGAST - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_PALOSSAND - 1] = ANIM_H_VIBRATE,
[SPECIES_PYUKUMUKU - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TYPE_NULL - 1] = ANIM_H_SHAKE,
[SPECIES_SILVALLY - 1] = ANIM_V_SHAKE,
[SPECIES_MINIOR - 1] = ANIM_TUMBLING_FRONT_FLIP_TWICE,
[SPECIES_KOMALA - 1] = ANIM_H_DIP,
[SPECIES_TURTONATOR - 1] = ANIM_SHAKE_GLOW_RED,
[SPECIES_TOGEDEMARU - 1] = ANIM_SHAKE_FLASH_YELLOW,
[SPECIES_MIMIKYU - 1] = ANIM_DEEP_V_SQUISH_AND_BOUNCE,
[SPECIES_BRUXISH - 1] = ANIM_RISING_WOBBLE,
[SPECIES_DRAMPA - 1] = ANIM_V_SHAKE,
[SPECIES_DHELMISE - 1] = ANIM_SWING_CONVEX,
[SPECIES_JANGMO_O - 1] = ANIM_H_STRETCH,
[SPECIES_HAKAMO_O - 1] = ANIM_H_STRETCH,
[SPECIES_KOMMO_O - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_TAPU_KOKO - 1] = ANIM_TRIANGLE_DOWN_TWICE,
[SPECIES_TAPU_LELE - 1] = ANIM_V_SLIDE_WOBBLE_SMALL,
[SPECIES_TAPU_BULU - 1] = ANIM_V_SHAKE_TWICE,
[SPECIES_TAPU_FINI - 1] = ANIM_SHAKE_GLOW_BLUE_SLOW,
[SPECIES_COSMOG - 1] = ANIM_H_JUMPS_V_STRETCH,
[SPECIES_COSMOEM - 1] = ANIM_RISING_WOBBLE,
[SPECIES_SOLGALEO - 1] = ANIM_GROW_VIBRATE,
[SPECIES_LUNALA - 1] = ANIM_CIRCULAR_VIBRATE,
[SPECIES_NIHILEGO - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_BUZZWOLE - 1] = ANIM_SHRINK_GROW_VIBRATE_FAST,
[SPECIES_PHEROMOSA - 1] = ANIM_SHRINK_GROW,
[SPECIES_XURKITREE - 1] = ANIM_SHAKE_FLASH_YELLOW_FAST,
[SPECIES_CELESTEELA - 1] = ANIM_GROW_STUTTER_SLOW,
[SPECIES_KARTANA - 1] = ANIM_H_VIBRATE,
[SPECIES_GUZZLORD - 1] = ANIM_SHRINK_GROW_VIBRATE_FAST,
[SPECIES_NECROZMA - 1] = ANIM_GROW_VIBRATE,
[SPECIES_MAGEARNA - 1] = ANIM_H_SLIDE_SLOW,
[SPECIES_MARSHADOW - 1] = ANIM_V_SHAKE,
[SPECIES_POIPOLE - 1] = ANIM_SHAKE_GLOW_PURPLE_SLOW,
[SPECIES_NAGANADEL - 1] = ANIM_TRIANGLE_DOWN_TWICE,
[SPECIES_STAKATAKA - 1] = ANIM_GROW_VIBRATE,
[SPECIES_BLACEPHALON - 1] = ANIM_SHAKE_GLOW_RED,
[SPECIES_ZERAORA - 1] = ANIM_V_STRETCH,
[SPECIES_MELTAN - 1] = ANIM_GROW_STUTTER_SLOW,
[SPECIES_MELMETAL - 1] = ANIM_GROW_VIBRATE,
2019-04-23 13:00:40 +02:00
2020-12-16 21:57:36 +01:00
// Gen 8 Todo: Assign proper ones.
[SPECIES_GROOKEY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_THWACKEY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_RILLABOOM - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SCORBUNNY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_RABOOT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CINDERACE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SOBBLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DRIZZILE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_INTELEON - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SKWOVET - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GREEDENT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ROOKIDEE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CORVISQUIRE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CORVIKNIGHT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BLIPBUG - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DOTTLER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ORBEETLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_NICKIT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_THIEVUL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GOSSIFLEUR - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ELDEGOSS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_WOOLOO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DUBWOOL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CHEWTLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DREDNAW - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_YAMPER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BOLTUND - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ROLYCOLY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CARKOL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_COALOSSAL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_APPLIN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FLAPPLE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_APPLETUN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SILICOBRA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SANDACONDA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CRAMORANT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ARROKUDA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_BARRASKEWDA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TOXEL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_TOXTRICITY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SIZZLIPEDE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CENTISKORCH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CLOBBOPUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GRAPPLOCT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SINISTEA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_POLTEAGEIST - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_HATENNA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_HATTREM - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_HATTERENE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_IMPIDIMP - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MORGREM - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GRIMMSNARL - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_OBSTAGOON - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PERRSERKER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CURSOLA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SIRFETCHD - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MR_RIME - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_RUNERIGUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MILCERY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ALCREMIE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FALINKS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PINCURCHIN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SNOM - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_FROSMOTH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_STONJOURNER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_EISCUE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_INDEEDEE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_MORPEKO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CUFANT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_COPPERAJAH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DRACOZOLT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ARCTOZOLT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DRACOVISH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ARCTOVISH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DURALUDON - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DREEPY - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DRAKLOAK - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_DRAGAPULT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ZACIAN - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ZAMAZENTA - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ETERNATUS - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_KUBFU - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_URSHIFU - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ZARUDE - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_REGIELEKI - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_REGIDRAGO - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_GLASTRIER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SPECTRIER - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_CALYREX - 1] = ANIM_V_SQUISH_AND_BOUNCE,
2020-12-16 21:57:36 +01:00
2019-04-23 13:00:40 +02:00
// Forms
[SPECIES_ROTOM_HEAT - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ROTOM_FROST - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ROTOM_FAN - 1] = ANIM_FIGURE_8,
[SPECIES_ROTOM_MOW - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_ROTOM_WASH - 1] = ANIM_V_SQUISH_AND_BOUNCE,
};
static const u8 sMonAnimationDelayTable[NUM_SPECIES - 1] =
{
2021-04-09 18:41:02 +02:00
[SPECIES_BLASTOISE - 1] = 50,
[SPECIES_WEEDLE - 1] = 10,
[SPECIES_KAKUNA - 1] = 20,
[SPECIES_BEEDRILL - 1] = 35,
[SPECIES_PIDGEOTTO - 1] = 25,
[SPECIES_FEAROW - 1] = 2,
[SPECIES_EKANS - 1] = 30,
[SPECIES_NIDORAN_F - 1] = 28,
[SPECIES_NIDOKING - 1] = 25,
[SPECIES_PARAS - 1] = 10,
[SPECIES_PARASECT - 1] = 45,
[SPECIES_VENONAT - 1] = 20,
[SPECIES_DIGLETT - 1] = 25,
[SPECIES_DUGTRIO - 1] = 35,
[SPECIES_MEOWTH - 1] = 40,
[SPECIES_PERSIAN - 1] = 20,
[SPECIES_MANKEY - 1] = 20,
[SPECIES_GROWLITHE - 1] = 30,
[SPECIES_ARCANINE - 1] = 40,
[SPECIES_POLIWHIRL - 1] = 5,
[SPECIES_WEEPINBELL - 1] = 3,
[SPECIES_MUK - 1] = 45,
[SPECIES_SHELLDER - 1] = 20,
[SPECIES_HAUNTER - 1] = 23,
[SPECIES_DROWZEE - 1] = 48,
[SPECIES_HYPNO - 1] = 40,
[SPECIES_HITMONCHAN - 1] = 25,
[SPECIES_SCYTHER - 1] = 10,
[SPECIES_TAUROS - 1] = 10,
[SPECIES_TYPHLOSION - 1] = 20,
[SPECIES_FERALIGATR - 1] = 5,
[SPECIES_NATU - 1] = 30,
[SPECIES_MAREEP - 1] = 50,
[SPECIES_AMPHAROS - 1] = 10,
[SPECIES_POLITOED - 1] = 40,
[SPECIES_DUNSPARCE - 1] = 10,
[SPECIES_STEELIX - 1] = 45,
[SPECIES_QWILFISH - 1] = 39,
[SPECIES_SCIZOR - 1] = 19,
[SPECIES_OCTILLERY - 1] = 20,
[SPECIES_SMOOCHUM - 1] = 40,
[SPECIES_TYRANITAR - 1] = 10,
[SPECIES_LUGIA - 1] = 20,
[SPECIES_WAILORD - 1] = 10,
[SPECIES_KECLEON - 1] = 30,
[SPECIES_MILOTIC - 1] = 45,
[SPECIES_SPHEAL - 1] = 15,
[SPECIES_SNORUNT - 1] = 20,
[SPECIES_GRUMPIG - 1] = 15,
[SPECIES_WYNAUT - 1] = 15,
[SPECIES_DUSCLOPS - 1] = 30,
[SPECIES_ABSOL - 1] = 45,
[SPECIES_SALAMENCE - 1] = 70,
[SPECIES_KYOGRE - 1] = 60,
[SPECIES_RAYQUAZA - 1] = 60,
[SPECIES_TAPU_FINI - 1] = 5,
[SPECIES_ROTOM_FAN - 1] = 7,
};
const u8 gPPUpGetMask[] = {0x03, 0x0c, 0x30, 0xc0}; // Masks for getting PP Up count, also PP Max values
const u8 gPPUpSetMask[] = {0xfc, 0xf3, 0xcf, 0x3f}; // Masks for setting PP Up count
const u8 gPPUpAddMask[] = {0x01, 0x04, 0x10, 0x40}; // Values added to PP Up count
2020-08-05 02:33:05 +02:00
const u8 gStatStageRatios[MAX_STAT_STAGE + 1][2] =
{
2020-08-05 02:33:05 +02:00
{10, 40}, // -6, MIN_STAT_STAGE
{10, 35}, // -5
{10, 30}, // -4
{10, 25}, // -3
{10, 20}, // -2
{10, 15}, // -1
2020-08-05 02:33:05 +02:00
{10, 10}, // 0, DEFAULT_STAT_STAGE
{15, 10}, // +1
{20, 10}, // +2
{25, 10}, // +3
{30, 10}, // +4
{35, 10}, // +5
2020-08-05 02:33:05 +02:00
{40, 10}, // +6, MAX_STAT_STAGE
};
2020-02-07 18:48:47 +01:00
const u16 gLinkPlayerFacilityClasses[NUM_MALE_LINK_FACILITY_CLASSES + NUM_FEMALE_LINK_FACILITY_CLASSES] =
{
2020-02-07 18:48:47 +01:00
// Male classes
2020-08-28 03:25:02 +02:00
FACILITY_CLASS_COOLTRAINER_M,
FACILITY_CLASS_BLACK_BELT,
2020-02-07 18:48:47 +01:00
FACILITY_CLASS_CAMPER,
2020-08-28 03:25:02 +02:00
FACILITY_CLASS_YOUNGSTER,
FACILITY_CLASS_PSYCHIC_M,
2020-02-07 18:48:47 +01:00
FACILITY_CLASS_BUG_CATCHER,
2020-08-28 03:25:02 +02:00
FACILITY_CLASS_PKMN_BREEDER_M,
2020-02-07 18:48:47 +01:00
FACILITY_CLASS_GUITARIST,
// Female Classes
2020-08-28 03:25:02 +02:00
FACILITY_CLASS_COOLTRAINER_F,
FACILITY_CLASS_HEX_MANIAC,
2020-02-07 18:48:47 +01:00
FACILITY_CLASS_PICNICKER,
2020-08-28 03:25:02 +02:00
FACILITY_CLASS_LASS,
FACILITY_CLASS_PSYCHIC_F,
2020-02-07 18:48:47 +01:00
FACILITY_CLASS_BATTLE_GIRL,
2020-08-28 03:25:02 +02:00
FACILITY_CLASS_PKMN_BREEDER_F,
2020-02-07 18:48:47 +01:00
FACILITY_CLASS_BEAUTY
};
static const u8 sHoldEffectToType[][2] =
{
{HOLD_EFFECT_BUG_POWER, TYPE_BUG},
{HOLD_EFFECT_STEEL_POWER, TYPE_STEEL},
{HOLD_EFFECT_GROUND_POWER, TYPE_GROUND},
{HOLD_EFFECT_ROCK_POWER, TYPE_ROCK},
{HOLD_EFFECT_GRASS_POWER, TYPE_GRASS},
{HOLD_EFFECT_DARK_POWER, TYPE_DARK},
{HOLD_EFFECT_FIGHTING_POWER, TYPE_FIGHTING},
{HOLD_EFFECT_ELECTRIC_POWER, TYPE_ELECTRIC},
{HOLD_EFFECT_WATER_POWER, TYPE_WATER},
{HOLD_EFFECT_FLYING_POWER, TYPE_FLYING},
{HOLD_EFFECT_POISON_POWER, TYPE_POISON},
{HOLD_EFFECT_ICE_POWER, TYPE_ICE},
{HOLD_EFFECT_GHOST_POWER, TYPE_GHOST},
{HOLD_EFFECT_PSYCHIC_POWER, TYPE_PSYCHIC},
{HOLD_EFFECT_FIRE_POWER, TYPE_FIRE},
{HOLD_EFFECT_DRAGON_POWER, TYPE_DRAGON},
{HOLD_EFFECT_NORMAL_POWER, TYPE_NORMAL},
};
2021-01-23 05:22:37 +01:00
const struct SpriteTemplate gBattlerSpriteTemplates[MAX_BATTLERS_COUNT] =
{
2021-01-23 05:22:37 +01:00
[B_POSITION_PLAYER_LEFT] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpritePlayerSide,
.anims = NULL,
2021-01-23 05:22:37 +01:00
.images = gBattlerPicTable_PlayerLeft,
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
.callback = SpriteCB_BattleSpriteStartSlideLeft,
},
2021-01-23 05:22:37 +01:00
[B_POSITION_OPPONENT_LEFT] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpriteOpponentSide,
.anims = NULL,
2021-01-23 05:22:37 +01:00
.images = gBattlerPicTable_OpponentLeft,
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
2018-12-23 14:52:47 +01:00
.callback = SpriteCb_WildMon,
},
2021-01-23 05:22:37 +01:00
[B_POSITION_PLAYER_RIGHT] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpritePlayerSide,
.anims = NULL,
2021-01-23 05:22:37 +01:00
.images = gBattlerPicTable_PlayerRight,
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
.callback = SpriteCB_BattleSpriteStartSlideLeft,
},
2021-01-23 05:22:37 +01:00
[B_POSITION_OPPONENT_RIGHT] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpriteOpponentSide,
.anims = NULL,
2021-01-23 05:22:37 +01:00
.images = gBattlerPicTable_OpponentRight,
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
2018-12-23 14:52:47 +01:00
.callback = SpriteCb_WildMon
},
};
2021-01-23 05:22:37 +01:00
static const struct SpriteTemplate sTrainerBackSpriteTemplates[] =
{
2021-01-23 05:22:37 +01:00
[TRAINER_BACK_PIC_BRENDAN] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpritePlayerSide,
.anims = NULL,
2019-02-02 22:53:47 +01:00
.images = gTrainerBackPicTable_Brendan,
2021-01-23 05:22:37 +01:00
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
.callback = SpriteCB_BattleSpriteStartSlideLeft,
},
2021-01-23 05:22:37 +01:00
[TRAINER_BACK_PIC_MAY] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpritePlayerSide,
.anims = NULL,
2019-02-02 22:53:47 +01:00
.images = gTrainerBackPicTable_May,
2021-01-23 05:22:37 +01:00
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
.callback = SpriteCB_BattleSpriteStartSlideLeft,
},
2021-01-23 05:22:37 +01:00
[TRAINER_BACK_PIC_RED] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpritePlayerSide,
.anims = NULL,
2019-02-02 22:53:47 +01:00
.images = gTrainerBackPicTable_Red,
2021-01-23 05:22:37 +01:00
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
.callback = SpriteCB_BattleSpriteStartSlideLeft,
},
2021-01-23 05:22:37 +01:00
[TRAINER_BACK_PIC_LEAF] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpritePlayerSide,
.anims = NULL,
2019-02-02 22:53:47 +01:00
.images = gTrainerBackPicTable_Leaf,
2021-01-23 05:22:37 +01:00
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
.callback = SpriteCB_BattleSpriteStartSlideLeft,
},
2021-01-23 05:22:37 +01:00
[TRAINER_BACK_PIC_RUBY_SAPPHIRE_BRENDAN] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpritePlayerSide,
.anims = NULL,
2019-02-02 22:53:47 +01:00
.images = gTrainerBackPicTable_RubySapphireBrendan,
2021-01-23 05:22:37 +01:00
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
.callback = SpriteCB_BattleSpriteStartSlideLeft,
},
2021-01-23 05:22:37 +01:00
[TRAINER_BACK_PIC_RUBY_SAPPHIRE_MAY] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpritePlayerSide,
.anims = NULL,
2019-02-02 22:53:47 +01:00
.images = gTrainerBackPicTable_RubySapphireMay,
2021-01-23 05:22:37 +01:00
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
.callback = SpriteCB_BattleSpriteStartSlideLeft,
},
2021-01-23 05:22:37 +01:00
[TRAINER_BACK_PIC_WALLY] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpritePlayerSide,
.anims = NULL,
2019-02-02 22:53:47 +01:00
.images = gTrainerBackPicTable_Wally,
2021-01-23 05:22:37 +01:00
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
.callback = SpriteCB_BattleSpriteStartSlideLeft,
},
2021-01-23 05:22:37 +01:00
[TRAINER_BACK_PIC_STEVEN] = {
.tileTag = 0xFFFF,
.paletteTag = 0,
2021-01-23 05:22:37 +01:00
.oam = &gOamData_BattleSpritePlayerSide,
.anims = NULL,
2019-02-02 22:53:47 +01:00
.images = gTrainerBackPicTable_Steven,
2021-01-23 05:22:37 +01:00
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
.callback = SpriteCB_BattleSpriteStartSlideLeft,
},
};
static const u8 sSecretBaseFacilityClasses[2][5] =
{
{FACILITY_CLASS_YOUNGSTER, FACILITY_CLASS_BUG_CATCHER, FACILITY_CLASS_RICH_BOY, FACILITY_CLASS_CAMPER, FACILITY_CLASS_COOLTRAINER_M},
{FACILITY_CLASS_LASS, FACILITY_CLASS_SCHOOL_KID_F, FACILITY_CLASS_LADY, FACILITY_CLASS_PICNICKER, FACILITY_CLASS_COOLTRAINER_F}
};
static const u8 sGetMonDataEVConstants[] =
{
MON_DATA_HP_EV,
MON_DATA_ATK_EV,
MON_DATA_DEF_EV,
MON_DATA_SPEED_EV,
MON_DATA_SPDEF_EV,
MON_DATA_SPATK_EV
};
2019-12-22 01:01:38 +01:00
// For stat-raising items
static const u8 sStatsToRaise[] =
{
STAT_ATK, STAT_ATK, STAT_SPEED, STAT_DEF, STAT_SPATK, STAT_ACC
};
2020-02-02 19:28:54 +01:00
// 3 modifiers each for how much to change friendship for different ranges
// 0-99, 100-199, 200+
static const s8 sFriendshipEventModifiers[][3] =
{
[FRIENDSHIP_EVENT_GROW_LEVEL] = { 5, 3, 2},
[FRIENDSHIP_EVENT_VITAMIN] = { 5, 3, 2},
[FRIENDSHIP_EVENT_BATTLE_ITEM] = { 1, 1, 0},
[FRIENDSHIP_EVENT_LEAGUE_BATTLE] = { 3, 2, 1},
[FRIENDSHIP_EVENT_LEARN_TMHM] = { 1, 1, 0},
[FRIENDSHIP_EVENT_WALKING] = { 1, 1, 1},
[FRIENDSHIP_EVENT_FAINT_SMALL] = {-1, -1, -1},
[FRIENDSHIP_EVENT_FAINT_FIELD_PSN] = {-5, -5, -10},
[FRIENDSHIP_EVENT_FAINT_LARGE] = {-5, -5, -10},
};
static const u16 sHMMoves[] =
{
MOVE_CUT, MOVE_FLY, MOVE_SURF, MOVE_STRENGTH, MOVE_FLASH,
MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, 0xFFFF
};
static const struct SpeciesItem sAlteringCaveWildMonHeldItems[] =
{
{SPECIES_NONE, ITEM_NONE},
{SPECIES_MAREEP, ITEM_GANLON_BERRY},
{SPECIES_PINECO, ITEM_APICOT_BERRY},
{SPECIES_HOUNDOUR, ITEM_BIG_MUSHROOM},
{SPECIES_TEDDIURSA, ITEM_PETAYA_BERRY},
{SPECIES_AIPOM, ITEM_BERRY_JUICE},
{SPECIES_SHUCKLE, ITEM_BERRY_JUICE},
{SPECIES_STANTLER, ITEM_PETAYA_BERRY},
{SPECIES_SMEARGLE, ITEM_SALAC_BERRY},
};
static const struct OamData sOamData_8329F20 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x64),
.x = 0,
.matrixNum = 0,
.size = SPRITE_SIZE(64x64),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0
};
static const struct SpriteTemplate gUnknown_08329F28 =
{
.tileTag = 0xFFFF,
.paletteTag = 0xFFFF,
.oam = &sOamData_8329F20,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
};
2018-02-05 17:39:26 +01:00
// code
2017-09-06 17:19:08 +02:00
void ZeroBoxMonData(struct BoxPokemon *boxMon)
{
u8 *raw = (u8 *)boxMon;
u32 i;
for (i = 0; i < sizeof(struct BoxPokemon); i++)
raw[i] = 0;
}
void ZeroMonData(struct Pokemon *mon)
{
u32 arg;
ZeroBoxMonData(&mon->box);
arg = 0;
SetMonData(mon, MON_DATA_STATUS, &arg);
SetMonData(mon, MON_DATA_LEVEL, &arg);
SetMonData(mon, MON_DATA_HP, &arg);
SetMonData(mon, MON_DATA_MAX_HP, &arg);
SetMonData(mon, MON_DATA_ATK, &arg);
SetMonData(mon, MON_DATA_DEF, &arg);
SetMonData(mon, MON_DATA_SPEED, &arg);
2017-09-06 17:19:08 +02:00
SetMonData(mon, MON_DATA_SPATK, &arg);
SetMonData(mon, MON_DATA_SPDEF, &arg);
arg = 255;
SetMonData(mon, MON_DATA_MAIL, &arg);
}
void ZeroPlayerPartyMons(void)
{
s32 i;
2018-02-05 17:39:26 +01:00
for (i = 0; i < PARTY_SIZE; i++)
2017-09-06 17:19:08 +02:00
ZeroMonData(&gPlayerParty[i]);
}
void ZeroEnemyPartyMons(void)
{
s32 i;
2018-02-05 17:39:26 +01:00
for (i = 0; i < PARTY_SIZE; i++)
2017-09-06 17:19:08 +02:00
ZeroMonData(&gEnemyParty[i]);
}
void CreateMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId)
{
u32 arg;
ZeroMonData(mon);
CreateBoxMon(&mon->box, species, level, fixedIV, hasFixedPersonality, fixedPersonality, otIdType, fixedOtId);
SetMonData(mon, MON_DATA_LEVEL, &level);
arg = 255;
SetMonData(mon, MON_DATA_MAIL, &arg);
CalculateMonStats(mon);
}
void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId)
{
u8 speciesName[POKEMON_NAME_LENGTH + 1];
u32 personality;
u32 value;
u16 checksum;
ZeroBoxMonData(boxMon);
if (hasFixedPersonality)
personality = fixedPersonality;
else
personality = Random32();
SetBoxMonData(boxMon, MON_DATA_PERSONALITY, &personality);
//Determine original trainer ID
if (otIdType == OT_ID_RANDOM_NO_SHINY) //Pokemon cannot be shiny
{
u32 shinyValue;
do
{
value = Random32();
shinyValue = HIHALF(value) ^ LOHALF(value) ^ HIHALF(personality) ^ LOHALF(personality);
} while (shinyValue < SHINY_ODDS);
2017-09-06 17:19:08 +02:00
}
else if (otIdType == OT_ID_PRESET) //Pokemon has a preset OT ID
{
value = fixedOtId;
}
else //Player is the OT
{
value = gSaveBlock2Ptr->playerTrainerId[0]
| (gSaveBlock2Ptr->playerTrainerId[1] << 8)
| (gSaveBlock2Ptr->playerTrainerId[2] << 16)
| (gSaveBlock2Ptr->playerTrainerId[3] << 24);
}
SetBoxMonData(boxMon, MON_DATA_OT_ID, &value);
checksum = CalculateBoxMonChecksum(boxMon);
SetBoxMonData(boxMon, MON_DATA_CHECKSUM, &checksum);
EncryptBoxMon(boxMon);
GetSpeciesName(speciesName, species);
SetBoxMonData(boxMon, MON_DATA_NICKNAME, speciesName);
SetBoxMonData(boxMon, MON_DATA_LANGUAGE, &gGameLanguage);
SetBoxMonData(boxMon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName);
SetBoxMonData(boxMon, MON_DATA_SPECIES, &species);
SetBoxMonData(boxMon, MON_DATA_EXP, &gExperienceTables[gBaseStats[species].growthRate][level]);
SetBoxMonData(boxMon, MON_DATA_FRIENDSHIP, &gBaseStats[species].friendship);
2018-12-27 23:30:47 +01:00
value = GetCurrentRegionMapSectionId();
2017-09-06 17:19:08 +02:00
SetBoxMonData(boxMon, MON_DATA_MET_LOCATION, &value);
SetBoxMonData(boxMon, MON_DATA_MET_LEVEL, &level);
SetBoxMonData(boxMon, MON_DATA_MET_GAME, &gGameVersion);
value = ITEM_POKE_BALL;
SetBoxMonData(boxMon, MON_DATA_POKEBALL, &value);
SetBoxMonData(boxMon, MON_DATA_OT_GENDER, &gSaveBlock2Ptr->playerGender);
if (fixedIV < USE_RANDOM_IVS)
2017-09-06 17:19:08 +02:00
{
SetBoxMonData(boxMon, MON_DATA_HP_IV, &fixedIV);
SetBoxMonData(boxMon, MON_DATA_ATK_IV, &fixedIV);
SetBoxMonData(boxMon, MON_DATA_DEF_IV, &fixedIV);
SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &fixedIV);
2017-09-06 17:19:08 +02:00
SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &fixedIV);
SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &fixedIV);
}
else
{
u32 iv;
value = Random();
iv = value & MAX_IV_MASK;
2017-09-06 17:19:08 +02:00
SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv);
iv = (value & (MAX_IV_MASK << 5)) >> 5;
2017-09-06 17:19:08 +02:00
SetBoxMonData(boxMon, MON_DATA_ATK_IV, &iv);
iv = (value & (MAX_IV_MASK << 10)) >> 10;
2017-09-06 17:19:08 +02:00
SetBoxMonData(boxMon, MON_DATA_DEF_IV, &iv);
value = Random();
iv = value & MAX_IV_MASK;
SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &iv);
iv = (value & (MAX_IV_MASK << 5)) >> 5;
2017-09-06 17:19:08 +02:00
SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv);
iv = (value & (MAX_IV_MASK << 10)) >> 10;
2017-09-06 17:19:08 +02:00
SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv);
}
if (gBaseStats[species].abilities[1])
2017-09-06 17:19:08 +02:00
{
value = personality & 1;
2019-05-14 15:22:16 +02:00
SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value);
2017-09-06 17:19:08 +02:00
}
GiveBoxMonInitialMoveset(boxMon);
}
void CreateMonWithNature(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 nature)
{
u32 personality;
do
{
personality = Random32();
}
while (nature != GetNatureFromPersonality(personality));
CreateMon(mon, species, level, fixedIV, 1, personality, OT_ID_PLAYER_ID, 0);
}
void CreateMonWithGenderNatureLetter(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 gender, u8 nature, u8 unownLetter)
{
u32 personality;
2021-01-19 10:03:16 +01:00
if ((u8)(unownLetter - 1) < NUM_UNOWN_FORMS)
2017-09-06 17:19:08 +02:00
{
u16 actualLetter;
do
{
personality = Random32();
2021-01-19 10:03:16 +01:00
actualLetter = GET_UNOWN_LETTER(personality);
2017-09-06 17:19:08 +02:00
}
while (nature != GetNatureFromPersonality(personality)
|| gender != GetGenderFromSpeciesAndPersonality(species, personality)
|| actualLetter != unownLetter - 1);
}
else
{
do
{
personality = Random32();
}
while (nature != GetNatureFromPersonality(personality)
|| gender != GetGenderFromSpeciesAndPersonality(species, personality));
}
CreateMon(mon, species, level, fixedIV, 1, personality, OT_ID_PLAYER_ID, 0);
}
// This is only used to create Wally's Ralts.
void CreateMaleMon(struct Pokemon *mon, u16 species, u8 level)
{
u32 personality;
u32 otId;
do
{
otId = Random32();
personality = Random32();
}
while (GetGenderFromSpeciesAndPersonality(species, personality) != MON_MALE);
CreateMon(mon, species, level, USE_RANDOM_IVS, 1, personality, OT_ID_PRESET, otId);
2017-09-06 17:19:08 +02:00
}
void CreateMonWithIVsPersonality(struct Pokemon *mon, u16 species, u8 level, u32 ivs, u32 personality)
{
CreateMon(mon, species, level, 0, 1, personality, OT_ID_PLAYER_ID, 0);
SetMonData(mon, MON_DATA_IVS, &ivs);
CalculateMonStats(mon);
}
void CreateMonWithIVsOTID(struct Pokemon *mon, u16 species, u8 level, u8 *ivs, u32 otId)
{
CreateMon(mon, species, level, 0, 0, 0, OT_ID_PRESET, otId);
SetMonData(mon, MON_DATA_HP_IV, &ivs[0]);
SetMonData(mon, MON_DATA_ATK_IV, &ivs[1]);
SetMonData(mon, MON_DATA_DEF_IV, &ivs[2]);
SetMonData(mon, MON_DATA_SPEED_IV, &ivs[3]);
2017-09-06 17:19:08 +02:00
SetMonData(mon, MON_DATA_SPATK_IV, &ivs[4]);
SetMonData(mon, MON_DATA_SPDEF_IV, &ivs[5]);
CalculateMonStats(mon);
}
void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 evSpread)
{
s32 i;
s32 statCount = 0;
u16 evAmount;
2018-02-09 15:55:12 +01:00
u8 evsBits;
2017-09-06 17:19:08 +02:00
2019-08-31 05:06:43 +02:00
CreateMon(mon, species, level, fixedIV, 0, 0, OT_ID_PLAYER_ID, 0);
2017-09-06 17:19:08 +02:00
2018-02-09 15:55:12 +01:00
evsBits = evSpread;
2017-09-06 17:19:08 +02:00
2018-02-09 15:55:12 +01:00
for (i = 0; i < NUM_STATS; i++)
2017-09-06 17:19:08 +02:00
{
2018-02-09 15:55:12 +01:00
if (evsBits & 1)
2017-09-06 17:19:08 +02:00
statCount++;
2018-02-09 15:55:12 +01:00
evsBits >>= 1;
2017-09-06 17:19:08 +02:00
}
2018-02-09 15:55:12 +01:00
evAmount = MAX_TOTAL_EVS / statCount;
2017-09-06 17:19:08 +02:00
2018-02-09 15:55:12 +01:00
evsBits = 1;
2017-09-06 17:19:08 +02:00
2018-02-09 15:55:12 +01:00
for (i = 0; i < NUM_STATS; i++)
2017-09-06 17:19:08 +02:00
{
2018-02-09 15:55:12 +01:00
if (evSpread & evsBits)
2017-09-06 17:19:08 +02:00
SetMonData(mon, MON_DATA_HP_EV + i, &evAmount);
2018-02-09 15:55:12 +01:00
evsBits <<= 1;
2017-09-06 17:19:08 +02:00
}
CalculateMonStats(mon);
}
2019-01-13 12:12:27 +01:00
void CreateBattleTowerMon(struct Pokemon *mon, struct BattleTowerPokemon *src)
2017-09-06 17:19:08 +02:00
{
s32 i;
u8 nickname[30];
u8 language;
u8 value;
2019-08-31 05:06:43 +02:00
CreateMon(mon, src->species, src->level, 0, 1, src->personality, OT_ID_PRESET, src->otId);
2017-09-06 17:19:08 +02:00
for (i = 0; i < MAX_MON_MOVES; i++)
2017-09-06 17:19:08 +02:00
SetMonMoveSlot(mon, src->moves[i], i);
SetMonData(mon, MON_DATA_PP_BONUSES, &src->ppBonuses);
SetMonData(mon, MON_DATA_HELD_ITEM, &src->heldItem);
SetMonData(mon, MON_DATA_FRIENDSHIP, &src->friendship);
StringCopy(nickname, src->nickname);
if (nickname[0] == EXT_CTRL_CODE_BEGIN && nickname[1] == EXT_CTRL_CODE_JPN)
{
language = LANGUAGE_JAPANESE;
StripExtCtrlCodes(nickname);
}
else
2017-09-12 15:36:04 +02:00
{
2017-09-06 17:19:08 +02:00
language = GAME_LANGUAGE;
2017-09-12 15:36:04 +02:00
}
SetMonData(mon, MON_DATA_LANGUAGE, &language);
SetMonData(mon, MON_DATA_NICKNAME, nickname);
SetMonData(mon, MON_DATA_HP_EV, &src->hpEV);
SetMonData(mon, MON_DATA_ATK_EV, &src->attackEV);
SetMonData(mon, MON_DATA_DEF_EV, &src->defenseEV);
SetMonData(mon, MON_DATA_SPEED_EV, &src->speedEV);
2017-09-12 15:36:04 +02:00
SetMonData(mon, MON_DATA_SPATK_EV, &src->spAttackEV);
SetMonData(mon, MON_DATA_SPDEF_EV, &src->spDefenseEV);
2019-05-14 15:22:16 +02:00
value = src->abilityNum;
SetMonData(mon, MON_DATA_ABILITY_NUM, &value);
2017-09-12 15:36:04 +02:00
value = src->hpIV;
SetMonData(mon, MON_DATA_HP_IV, &value);
value = src->attackIV;
SetMonData(mon, MON_DATA_ATK_IV, &value);
value = src->defenseIV;
SetMonData(mon, MON_DATA_DEF_IV, &value);
value = src->speedIV;
SetMonData(mon, MON_DATA_SPEED_IV, &value);
2017-09-12 15:36:04 +02:00
value = src->spAttackIV;
SetMonData(mon, MON_DATA_SPATK_IV, &value);
value = src->spDefenseIV;
SetMonData(mon, MON_DATA_SPDEF_IV, &value);
MonRestorePP(mon);
CalculateMonStats(mon);
}
2019-01-13 12:12:27 +01:00
void CreateBattleTowerMon2(struct Pokemon *mon, struct BattleTowerPokemon *src, bool8 lvl50)
2017-09-12 15:36:04 +02:00
{
s32 i;
u8 nickname[30];
u8 level;
u8 language;
u8 value;
2018-08-25 19:59:47 +02:00
if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50)
2018-08-26 15:27:06 +02:00
level = GetFrontierEnemyMonLevel(gSaveBlock2Ptr->frontier.lvlMode);
2017-09-12 15:36:04 +02:00
else if (lvl50)
level = 50;
else
level = src->level;
2019-08-31 05:06:43 +02:00
CreateMon(mon, src->species, level, 0, 1, src->personality, OT_ID_PRESET, src->otId);
2017-09-12 15:36:04 +02:00
for (i = 0; i < MAX_MON_MOVES; i++)
2017-09-12 15:36:04 +02:00
SetMonMoveSlot(mon, src->moves[i], i);
SetMonData(mon, MON_DATA_PP_BONUSES, &src->ppBonuses);
SetMonData(mon, MON_DATA_HELD_ITEM, &src->heldItem);
SetMonData(mon, MON_DATA_FRIENDSHIP, &src->friendship);
StringCopy(nickname, src->nickname);
if (nickname[0] == EXT_CTRL_CODE_BEGIN && nickname[1] == EXT_CTRL_CODE_JPN)
{
language = LANGUAGE_JAPANESE;
StripExtCtrlCodes(nickname);
}
else
{
language = GAME_LANGUAGE;
}
2017-09-06 17:19:08 +02:00
SetMonData(mon, MON_DATA_LANGUAGE, &language);
SetMonData(mon, MON_DATA_NICKNAME, nickname);
SetMonData(mon, MON_DATA_HP_EV, &src->hpEV);
SetMonData(mon, MON_DATA_ATK_EV, &src->attackEV);
SetMonData(mon, MON_DATA_DEF_EV, &src->defenseEV);
SetMonData(mon, MON_DATA_SPEED_EV, &src->speedEV);
2017-09-06 17:19:08 +02:00
SetMonData(mon, MON_DATA_SPATK_EV, &src->spAttackEV);
SetMonData(mon, MON_DATA_SPDEF_EV, &src->spDefenseEV);
2019-05-14 15:22:16 +02:00
value = src->abilityNum;
SetMonData(mon, MON_DATA_ABILITY_NUM, &value);
2017-09-06 17:19:08 +02:00
value = src->hpIV;
SetMonData(mon, MON_DATA_HP_IV, &value);
value = src->attackIV;
SetMonData(mon, MON_DATA_ATK_IV, &value);
value = src->defenseIV;
SetMonData(mon, MON_DATA_DEF_IV, &value);
value = src->speedIV;
SetMonData(mon, MON_DATA_SPEED_IV, &value);
2017-09-06 17:19:08 +02:00
value = src->spAttackIV;
SetMonData(mon, MON_DATA_SPATK_IV, &value);
value = src->spDefenseIV;
SetMonData(mon, MON_DATA_SPDEF_IV, &value);
2017-09-06 21:48:30 +02:00
MonRestorePP(mon);
2017-09-06 17:19:08 +02:00
CalculateMonStats(mon);
}
2018-02-09 15:55:12 +01:00
void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 monId)
2018-02-09 15:55:12 +01:00
{
s32 i;
u16 evAmount;
u8 language;
2018-10-14 14:35:51 +02:00
u32 otId = gApprentices[src->id].otId;
u32 personality = ((gApprentices[src->id].otId >> 8) | ((gApprentices[src->id].otId & 0xFF) << 8))
+ src->party[monId].species + src->number;
2018-02-09 15:55:12 +01:00
CreateMon(mon,
src->party[monId].species,
2018-10-14 14:35:51 +02:00
GetFrontierEnemyMonLevel(src->lvlMode - 1),
MAX_PER_STAT_IVS,
2018-02-09 15:55:12 +01:00
TRUE,
personality,
2019-08-31 05:06:43 +02:00
OT_ID_PRESET,
2018-02-09 15:55:12 +01:00
otId);
SetMonData(mon, MON_DATA_HELD_ITEM, &src->party[monId].item);
for (i = 0; i < MAX_MON_MOVES; i++)
SetMonMoveSlot(mon, src->party[monId].moves[i], i);
2018-02-09 15:55:12 +01:00
evAmount = MAX_TOTAL_EVS / NUM_STATS;
for (i = 0; i < NUM_STATS; i++)
SetMonData(mon, MON_DATA_HP_EV + i, &evAmount);
language = src->language;
SetMonData(mon, MON_DATA_LANGUAGE, &language);
2018-10-14 14:35:51 +02:00
SetMonData(mon, MON_DATA_OT_NAME, GetApprenticeNameInLanguage(src->id, language));
2018-02-09 15:55:12 +01:00
CalculateMonStats(mon);
}
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)
2018-02-09 15:55:12 +01:00
{
s32 i;
s32 statCount = 0;
u8 evsBits;
u16 evAmount;
// i is reused as personality value
do
{
i = Random32();
} while (nature != GetNatureFromPersonality(i));
2019-08-31 05:06:43 +02:00
CreateMon(mon, species, level, fixedIV, TRUE, i, OT_ID_PRESET, otId);
2018-02-09 15:55:12 +01:00
evsBits = evSpread;
for (i = 0; i < NUM_STATS; i++)
{
if (evsBits & 1)
statCount++;
evsBits >>= 1;
}
evAmount = MAX_TOTAL_EVS / statCount;
evsBits = 1;
for (i = 0; i < NUM_STATS; i++)
{
if (evSpread & evsBits)
SetMonData(mon, MON_DATA_HP_EV + i, &evAmount);
evsBits <<= 1;
}
CalculateMonStats(mon);
}
2020-12-24 22:18:47 +01:00
void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest)
2018-02-09 15:55:12 +01:00
{
s32 i;
u16 heldItem;
dest->species = GetMonData(mon, MON_DATA_SPECIES, NULL);
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, NULL);
if (heldItem == ITEM_ENIGMA_BERRY)
2020-12-24 22:18:47 +01:00
heldItem = ITEM_NONE;
2018-02-09 15:55:12 +01:00
dest->heldItem = heldItem;
for (i = 0; i < MAX_MON_MOVES; i++)
2018-02-09 15:55:12 +01:00
dest->moves[i] = GetMonData(mon, MON_DATA_MOVE1 + i, NULL);
dest->level = GetMonData(mon, MON_DATA_LEVEL, NULL);
dest->ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL);
dest->otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
dest->hpEV = GetMonData(mon, MON_DATA_HP_EV, NULL);
dest->attackEV = GetMonData(mon, MON_DATA_ATK_EV, NULL);
dest->defenseEV = GetMonData(mon, MON_DATA_DEF_EV, NULL);
dest->speedEV = GetMonData(mon, MON_DATA_SPEED_EV, NULL);
dest->spAttackEV = GetMonData(mon, MON_DATA_SPATK_EV, NULL);
dest->spDefenseEV = GetMonData(mon, MON_DATA_SPDEF_EV, NULL);
dest->friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, NULL);
dest->hpIV = GetMonData(mon, MON_DATA_HP_IV, NULL);
dest->attackIV = GetMonData(mon, MON_DATA_ATK_IV, NULL);
dest->defenseIV = GetMonData(mon, MON_DATA_DEF_IV, NULL);
dest->speedIV = GetMonData(mon, MON_DATA_SPEED_IV, NULL);
dest->spAttackIV = GetMonData(mon, MON_DATA_SPATK_IV, NULL);
dest->spDefenseIV = GetMonData(mon, MON_DATA_SPDEF_IV, NULL);
2019-05-14 15:22:16 +02:00
dest->abilityNum = GetMonData(mon, MON_DATA_ABILITY_NUM, NULL);
2018-02-09 15:55:12 +01:00
dest->personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
GetMonData(mon, MON_DATA_NICKNAME, dest->nickname);
}
void CreateEventLegalMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId)
2018-02-09 15:55:12 +01:00
{
bool32 isEventLegal = TRUE;
2018-02-09 15:55:12 +01:00
CreateMon(mon, species, level, fixedIV, hasFixedPersonality, fixedPersonality, otIdType, fixedOtId);
SetMonData(mon, MON_DATA_EVENT_LEGAL, &isEventLegal);
2018-02-09 15:55:12 +01:00
}
2021-01-23 05:22:37 +01:00
// If FALSE, should load this game's Deoxys form. If TRUE, should load normal Deoxys form
bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId)
2018-02-09 15:55:12 +01:00
{
switch (caseId)
{
case 0:
default:
return FALSE;
2021-01-23 05:22:37 +01:00
case 1: // Player's side in battle
2018-02-09 15:55:12 +01:00
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
return FALSE;
if (!gMain.inBattle)
return FALSE;
2018-07-22 12:49:49 +02:00
if (gLinkPlayers[GetMultiplayerId()].id == battlerId)
2018-02-09 15:55:12 +01:00
return FALSE;
break;
case 2:
break;
2021-01-23 05:22:37 +01:00
case 3: // Summary Screen
2018-02-09 15:55:12 +01:00
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
return FALSE;
if (!gMain.inBattle)
return FALSE;
if (battlerId == 1 || battlerId == 4 || battlerId == 5)
return TRUE;
return FALSE;
case 4:
break;
2021-01-23 05:22:37 +01:00
case 5: // In move animation, e.g. in Role Play or Snatch
2018-02-09 15:55:12 +01:00
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
{
if (!gMain.inBattle)
return FALSE;
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
{
2018-07-22 12:49:49 +02:00
if (gLinkPlayers[GetMultiplayerId()].id == battlerId)
2018-02-09 15:55:12 +01:00
return FALSE;
}
else
{
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER)
return FALSE;
}
}
else
{
if (!gMain.inBattle)
return FALSE;
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER)
return FALSE;
}
break;
}
return TRUE;
}
2020-06-03 21:28:29 +02:00
u16 GetUnionRoomTrainerPic(void)
2018-02-09 15:55:12 +01:00
{
u8 linkId;
u32 arrId;
2021-01-13 21:17:32 +01:00
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
linkId = gRecordedBattleMultiplayerId ^ 1;
2018-02-09 15:55:12 +01:00
else
linkId = GetMultiplayerId() ^ 1;
arrId = gLinkPlayers[linkId].trainerId & 7;
arrId |= gLinkPlayers[linkId].gender << 3;
return FacilityClassToPicIndex(gLinkPlayerFacilityClasses[arrId]);
2018-02-09 15:55:12 +01:00
}
2020-06-03 21:28:29 +02:00
u16 GetUnionRoomTrainerClass(void)
2018-02-09 15:55:12 +01:00
{
u8 linkId;
u32 arrId;
2021-01-13 21:17:32 +01:00
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
linkId = gRecordedBattleMultiplayerId ^ 1;
2018-02-09 15:55:12 +01:00
else
linkId = GetMultiplayerId() ^ 1;
arrId = gLinkPlayers[linkId].trainerId & 7;
arrId |= gLinkPlayers[linkId].gender << 3;
return gFacilityClassToTrainerClass[gLinkPlayerFacilityClasses[arrId]];
2018-02-09 15:55:12 +01:00
}
void CreateEventLegalEnemyMon(void)
2018-02-09 15:55:12 +01:00
{
s32 species = gSpecialVar_0x8004;
s32 level = gSpecialVar_0x8005;
s32 itemId = gSpecialVar_0x8006;
ZeroEnemyPartyMons();
CreateEventLegalMon(&gEnemyParty[0], species, level, USE_RANDOM_IVS, 0, 0, 0, 0);
2018-02-09 15:55:12 +01:00
if (itemId)
{
u8 heldItem[2];
heldItem[0] = itemId;
heldItem[1] = itemId >> 8;
SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, heldItem);
}
}
2018-02-11 17:35:01 +01:00
static u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon)
2018-02-09 15:55:12 +01:00
{
u16 checksum = 0;
union PokemonSubstruct *substruct0 = GetSubstruct(boxMon, boxMon->personality, 0);
union PokemonSubstruct *substruct1 = GetSubstruct(boxMon, boxMon->personality, 1);
union PokemonSubstruct *substruct2 = GetSubstruct(boxMon, boxMon->personality, 2);
union PokemonSubstruct *substruct3 = GetSubstruct(boxMon, boxMon->personality, 3);
s32 i;
for (i = 0; i < 6; i++)
checksum += substruct0->raw[i];
for (i = 0; i < 6; i++)
checksum += substruct1->raw[i];
for (i = 0; i < 6; i++)
checksum += substruct2->raw[i];
for (i = 0; i < 6; i++)
checksum += substruct3->raw[i];
return checksum;
}
#define CALC_STAT(base, iv, ev, statIndex, field) \
{ \
u8 baseStat = gBaseStats[species].base; \
s32 n = (((2 * baseStat + iv + ev / 4) * level) / 100) + 5; \
u8 nature = GetNature(mon); \
n = ModifyStatByNature(nature, n, statIndex); \
SetMonData(mon, field, &n); \
}
void CalculateMonStats(struct Pokemon *mon)
{
s32 oldMaxHP = GetMonData(mon, MON_DATA_MAX_HP, NULL);
s32 currentHP = GetMonData(mon, MON_DATA_HP, NULL);
s32 hpIV = GetMonData(mon, MON_DATA_HP_IV, NULL);
s32 hpEV = GetMonData(mon, MON_DATA_HP_EV, NULL);
s32 attackIV = GetMonData(mon, MON_DATA_ATK_IV, NULL);
s32 attackEV = GetMonData(mon, MON_DATA_ATK_EV, NULL);
s32 defenseIV = GetMonData(mon, MON_DATA_DEF_IV, NULL);
s32 defenseEV = GetMonData(mon, MON_DATA_DEF_EV, NULL);
s32 speedIV = GetMonData(mon, MON_DATA_SPEED_IV, NULL);
s32 speedEV = GetMonData(mon, MON_DATA_SPEED_EV, NULL);
s32 spAttackIV = GetMonData(mon, MON_DATA_SPATK_IV, NULL);
s32 spAttackEV = GetMonData(mon, MON_DATA_SPATK_EV, NULL);
s32 spDefenseIV = GetMonData(mon, MON_DATA_SPDEF_IV, NULL);
s32 spDefenseEV = GetMonData(mon, MON_DATA_SPDEF_EV, NULL);
u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
s32 level = GetLevelFromMonExp(mon);
s32 newMaxHP;
SetMonData(mon, MON_DATA_LEVEL, &level);
if (species == SPECIES_SHEDINJA)
{
newMaxHP = 1;
}
else
{
s32 n = 2 * gBaseStats[species].baseHP + hpIV;
newMaxHP = (((n + hpEV / 4) * level) / 100) + level + 10;
}
gBattleScripting.levelUpHP = newMaxHP - oldMaxHP;
if (gBattleScripting.levelUpHP == 0)
gBattleScripting.levelUpHP = 1;
2018-02-09 15:55:12 +01:00
SetMonData(mon, MON_DATA_MAX_HP, &newMaxHP);
2018-07-01 11:15:42 +02:00
CALC_STAT(baseAttack, attackIV, attackEV, STAT_ATK, MON_DATA_ATK)
CALC_STAT(baseDefense, defenseIV, defenseEV, STAT_DEF, MON_DATA_DEF)
CALC_STAT(baseSpeed, speedIV, speedEV, STAT_SPEED, MON_DATA_SPEED)
CALC_STAT(baseSpAttack, spAttackIV, spAttackEV, STAT_SPATK, MON_DATA_SPATK)
CALC_STAT(baseSpDefense, spDefenseIV, spDefenseEV, STAT_SPDEF, MON_DATA_SPDEF)
2018-02-09 15:55:12 +01:00
if (species == SPECIES_SHEDINJA)
{
if (currentHP != 0 || oldMaxHP == 0)
currentHP = 1;
else
return;
}
else
{
if (currentHP == 0 && oldMaxHP == 0)
currentHP = newMaxHP;
else if (currentHP != 0) {
2020-09-19 20:46:26 +02:00
// BUG: currentHP is unintentionally able to become <= 0 after the instruction below. This causes the pomeg berry glitch.
2018-02-09 15:55:12 +01:00
currentHP += newMaxHP - oldMaxHP;
2020-12-13 05:28:01 +01:00
#ifdef BUGFIX
if (currentHP <= 0)
currentHP = 1;
#endif
}
2018-02-09 15:55:12 +01:00
else
return;
}
SetMonData(mon, MON_DATA_HP, &currentHP);
}
void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest)
{
u32 value = 0;
dest->box = *src;
SetMonData(dest, MON_DATA_STATUS, &value);
SetMonData(dest, MON_DATA_HP, &value);
SetMonData(dest, MON_DATA_MAX_HP, &value);
value = 255;
SetMonData(dest, MON_DATA_MAIL, &value);
CalculateMonStats(dest);
}
u8 GetLevelFromMonExp(struct Pokemon *mon)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
u32 exp = GetMonData(mon, MON_DATA_EXP, NULL);
s32 level = 1;
2018-10-17 04:47:08 +02:00
while (level <= MAX_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp)
2018-02-09 15:55:12 +01:00
level++;
return level - 1;
}
u8 GetLevelFromBoxMonExp(struct BoxPokemon *boxMon)
{
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
u32 exp = GetBoxMonData(boxMon, MON_DATA_EXP, NULL);
s32 level = 1;
2018-10-17 04:47:08 +02:00
while (level <= MAX_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp)
2018-02-09 15:55:12 +01:00
level++;
return level - 1;
}
u16 GiveMoveToMon(struct Pokemon *mon, u16 move)
{
return GiveMoveToBoxMon(&mon->box, move);
}
2019-10-18 01:22:03 +02:00
static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
2018-02-09 15:55:12 +01:00
{
s32 i;
for (i = 0; i < MAX_MON_MOVES; i++)
2018-02-09 15:55:12 +01:00
{
u16 existingMove = GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, NULL);
2019-10-18 01:22:03 +02:00
if (existingMove == MOVE_NONE)
2018-02-09 15:55:12 +01:00
{
SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &move);
SetBoxMonData(boxMon, MON_DATA_PP1 + i, &gBattleMoves[move].pp);
return move;
}
if (existingMove == move)
2019-10-18 01:22:03 +02:00
return MON_ALREADY_KNOWS_MOVE;
2018-02-09 15:55:12 +01:00
}
2019-10-18 01:22:03 +02:00
return MON_HAS_MAX_MOVES;
2018-02-09 15:55:12 +01:00
}
u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move)
{
s32 i;
for (i = 0; i < MAX_MON_MOVES; i++)
2018-02-09 15:55:12 +01:00
{
if (!mon->moves[i])
{
mon->moves[i] = move;
mon->pp[i] = gBattleMoves[move].pp;
return move;
}
}
return 0xFFFF;
2018-02-09 15:55:12 +01:00
}
void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot)
{
SetMonData(mon, MON_DATA_MOVE1 + slot, &move);
SetMonData(mon, MON_DATA_PP1 + slot, &gBattleMoves[move].pp);
}
void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot)
{
mon->moves[slot] = move;
mon->pp[slot] = gBattleMoves[move].pp;
}
void GiveMonInitialMoveset(struct Pokemon *mon)
{
GiveBoxMonInitialMoveset(&mon->box);
}
void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon)
{
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
s32 level = GetLevelFromBoxMonExp(boxMon);
s32 i;
2019-10-06 15:57:33 +02:00
for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_END; i++)
2018-02-09 15:55:12 +01:00
{
2019-10-06 15:57:33 +02:00
if (gLevelUpLearnsets[species][i].level > level)
2018-02-09 15:55:12 +01:00
break;
2019-11-10 14:13:23 +01:00
if (GiveMoveToBoxMon(boxMon, gLevelUpLearnsets[species][i].move) == MON_HAS_MAX_MOVES)
2019-10-06 15:57:33 +02:00
DeleteFirstMoveAndGiveMoveToBoxMon(boxMon, gLevelUpLearnsets[species][i].move);
2018-02-09 15:55:12 +01:00
}
}
u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove)
{
2021-02-03 21:04:25 +01:00
u32 retVal = MOVE_NONE;
2018-02-09 15:55:12 +01:00
u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
u8 level = GetMonData(mon, MON_DATA_LEVEL, NULL);
// since you can learn more than one move per level
// the game needs to know whether you decided to
// learn it or keep the old set to avoid asking
// you to learn the same move over and over again
if (firstMove)
{
sLearningMoveTableID = 0;
2019-10-06 15:57:33 +02:00
while (gLevelUpLearnsets[species][sLearningMoveTableID].level != level)
2018-02-09 15:55:12 +01:00
{
sLearningMoveTableID++;
2019-10-06 15:57:33 +02:00
if (gLevelUpLearnsets[species][sLearningMoveTableID].move == LEVEL_UP_END)
2021-02-03 21:04:25 +01:00
return MOVE_NONE;
2018-02-09 15:55:12 +01:00
}
}
2019-10-06 15:57:33 +02:00
if (gLevelUpLearnsets[species][sLearningMoveTableID].level == level)
2018-02-09 15:55:12 +01:00
{
2019-10-06 15:57:33 +02:00
gMoveToLearn = gLevelUpLearnsets[species][sLearningMoveTableID].move;
2018-02-09 15:55:12 +01:00
sLearningMoveTableID++;
retVal = GiveMoveToMon(mon, gMoveToLearn);
}
return retVal;
}
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move)
{
s32 i;
2019-09-08 17:53:48 +02:00
u16 moves[MAX_MON_MOVES];
u8 pp[MAX_MON_MOVES];
2018-02-09 15:55:12 +01:00
u8 ppBonuses;
2019-09-08 17:53:48 +02:00
for (i = 0; i < MAX_MON_MOVES - 1; i++)
2018-02-09 15:55:12 +01:00
{
moves[i] = GetMonData(mon, MON_DATA_MOVE2 + i, NULL);
pp[i] = GetMonData(mon, MON_DATA_PP2 + i, NULL);
}
ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL);
ppBonuses >>= 2;
moves[3] = move;
pp[3] = gBattleMoves[move].pp;
for (i = 0; i < MAX_MON_MOVES; i++)
2018-02-09 15:55:12 +01:00
{
SetMonData(mon, MON_DATA_MOVE1 + i, &moves[i]);
SetMonData(mon, MON_DATA_PP1 + i, &pp[i]);
}
SetMonData(mon, MON_DATA_PP_BONUSES, &ppBonuses);
}
void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
{
s32 i;
2019-09-08 17:53:48 +02:00
u16 moves[MAX_MON_MOVES];
u8 pp[MAX_MON_MOVES];
2018-02-09 15:55:12 +01:00
u8 ppBonuses;
2019-09-08 17:53:48 +02:00
for (i = 0; i < MAX_MON_MOVES - 1; i++)
2018-02-09 15:55:12 +01:00
{
moves[i] = GetBoxMonData(boxMon, MON_DATA_MOVE2 + i, NULL);
pp[i] = GetBoxMonData(boxMon, MON_DATA_PP2 + i, NULL);
}
ppBonuses = GetBoxMonData(boxMon, MON_DATA_PP_BONUSES, NULL);
ppBonuses >>= 2;
moves[3] = move;
pp[3] = gBattleMoves[move].pp;
for (i = 0; i < MAX_MON_MOVES; i++)
2018-02-09 15:55:12 +01:00
{
SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &moves[i]);
SetBoxMonData(boxMon, MON_DATA_PP1 + i, &pp[i]);
}
SetBoxMonData(boxMon, MON_DATA_PP_BONUSES, &ppBonuses);
}
2018-02-09 18:46:00 +01:00
#define APPLY_STAT_MOD(var, mon, stat, statIndex) \
{ \
(var) = (stat) * (gStatStageRatios)[(mon)->statStages[(statIndex)]][0]; \
(var) /= (gStatStageRatios)[(mon)->statStages[(statIndex)]][1]; \
}
2018-02-27 18:13:28 +01:00
s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 battlerIdAtk, u8 battlerIdDef)
2018-02-09 18:46:00 +01:00
{
u32 i;
s32 damage = 0;
s32 damageHelper;
u8 type;
u16 attack, defense;
u16 spAttack, spDefense;
u8 defenderHoldEffect;
u8 defenderHoldEffectParam;
u8 attackerHoldEffect;
u8 attackerHoldEffectParam;
if (!powerOverride)
gBattleMovePower = gBattleMoves[move].power;
else
gBattleMovePower = powerOverride;
if (!typeOverride)
type = gBattleMoves[move].type;
else
type = typeOverride & 0x3F;
attack = attacker->attack;
defense = defender->defense;
spAttack = attacker->spAttack;
spDefense = defender->spDefense;
if (attacker->item == ITEM_ENIGMA_BERRY)
{
2018-02-27 18:13:28 +01:00
attackerHoldEffect = gEnigmaBerries[battlerIdAtk].holdEffect;
attackerHoldEffectParam = gEnigmaBerries[battlerIdAtk].holdEffectParam;
2018-02-09 18:46:00 +01:00
}
else
{
attackerHoldEffect = ItemId_GetHoldEffect(attacker->item);
attackerHoldEffectParam = ItemId_GetHoldEffectParam(attacker->item);
}
if (defender->item == ITEM_ENIGMA_BERRY)
{
2018-02-27 18:13:28 +01:00
defenderHoldEffect = gEnigmaBerries[battlerIdDef].holdEffect;
defenderHoldEffectParam = gEnigmaBerries[battlerIdDef].holdEffectParam;
2018-02-09 18:46:00 +01:00
}
else
{
defenderHoldEffect = ItemId_GetHoldEffect(defender->item);
defenderHoldEffectParam = ItemId_GetHoldEffectParam(defender->item);
}
if (attacker->ability == ABILITY_HUGE_POWER || attacker->ability == ABILITY_PURE_POWER)
attack *= 2;
2018-02-27 18:13:28 +01:00
if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, battlerIdAtk))
2018-02-09 18:46:00 +01:00
attack = (110 * attack) / 100;
2018-02-27 18:13:28 +01:00
if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, battlerIdDef))
2018-02-09 18:46:00 +01:00
defense = (110 * defense) / 100;
2018-02-27 18:13:28 +01:00
if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerIdAtk))
2018-02-09 18:46:00 +01:00
spAttack = (110 * spAttack) / 100;
2018-02-27 18:13:28 +01:00
if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerIdDef))
2018-02-09 18:46:00 +01:00
spDefense = (110 * spDefense) / 100;
for (i = 0; i < ARRAY_COUNT(sHoldEffectToType); i++)
2018-02-09 18:46:00 +01:00
{
if (attackerHoldEffect == sHoldEffectToType[i][0]
&& type == sHoldEffectToType[i][1])
2018-02-09 18:46:00 +01:00
{
2018-07-16 22:00:27 +02:00
if (IS_TYPE_PHYSICAL(type))
2018-02-09 18:46:00 +01:00
attack = (attack * (attackerHoldEffectParam + 100)) / 100;
else
spAttack = (spAttack * (attackerHoldEffectParam + 100)) / 100;
break;
}
}
if (attackerHoldEffect == HOLD_EFFECT_CHOICE_BAND)
attack = (150 * attack) / 100;
if (attackerHoldEffect == HOLD_EFFECT_SOUL_DEW && !(gBattleTypeFlags & (BATTLE_TYPE_FRONTIER)) && (attacker->species == SPECIES_LATIAS || attacker->species == SPECIES_LATIOS))
spAttack = (150 * spAttack) / 100;
if (defenderHoldEffect == HOLD_EFFECT_SOUL_DEW && !(gBattleTypeFlags & (BATTLE_TYPE_FRONTIER)) && (defender->species == SPECIES_LATIAS || defender->species == SPECIES_LATIOS))
spDefense = (150 * spDefense) / 100;
if (attackerHoldEffect == HOLD_EFFECT_DEEP_SEA_TOOTH && attacker->species == SPECIES_CLAMPERL)
spAttack *= 2;
if (defenderHoldEffect == HOLD_EFFECT_DEEP_SEA_SCALE && defender->species == SPECIES_CLAMPERL)
spDefense *= 2;
if (attackerHoldEffect == HOLD_EFFECT_LIGHT_BALL && attacker->species == SPECIES_PIKACHU)
spAttack *= 2;
if (defenderHoldEffect == HOLD_EFFECT_METAL_POWDER && defender->species == SPECIES_DITTO)
defense *= 2;
if (attackerHoldEffect == HOLD_EFFECT_THICK_CLUB && (attacker->species == SPECIES_CUBONE || attacker->species == SPECIES_MAROWAK))
attack *= 2;
if (defender->ability == ABILITY_THICK_FAT && (type == TYPE_FIRE || type == TYPE_ICE))
spAttack /= 2;
if (attacker->ability == ABILITY_HUSTLE)
attack = (150 * attack) / 100;
2018-07-16 20:47:30 +02:00
if (attacker->ability == ABILITY_PLUS && ABILITY_ON_FIELD2(ABILITY_MINUS))
2018-02-09 18:46:00 +01:00
spAttack = (150 * spAttack) / 100;
2018-07-16 20:47:30 +02:00
if (attacker->ability == ABILITY_MINUS && ABILITY_ON_FIELD2(ABILITY_PLUS))
2018-02-09 18:46:00 +01:00
spAttack = (150 * spAttack) / 100;
if (attacker->ability == ABILITY_GUTS && attacker->status1)
attack = (150 * attack) / 100;
if (defender->ability == ABILITY_MARVEL_SCALE && defender->status1)
defense = (150 * defense) / 100;
if (type == TYPE_ELECTRIC && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, 0xFD, 0))
gBattleMovePower /= 2;
if (type == TYPE_FIRE && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, 0xFE, 0))
gBattleMovePower /= 2;
if (type == TYPE_GRASS && attacker->ability == ABILITY_OVERGROW && attacker->hp <= (attacker->maxHP / 3))
gBattleMovePower = (150 * gBattleMovePower) / 100;
if (type == TYPE_FIRE && attacker->ability == ABILITY_BLAZE && attacker->hp <= (attacker->maxHP / 3))
gBattleMovePower = (150 * gBattleMovePower) / 100;
if (type == TYPE_WATER && attacker->ability == ABILITY_TORRENT && attacker->hp <= (attacker->maxHP / 3))
gBattleMovePower = (150 * gBattleMovePower) / 100;
if (type == TYPE_BUG && attacker->ability == ABILITY_SWARM && attacker->hp <= (attacker->maxHP / 3))
gBattleMovePower = (150 * gBattleMovePower) / 100;
if (gBattleMoves[gCurrentMove].effect == EFFECT_EXPLOSION)
defense /= 2;
2018-07-16 22:00:27 +02:00
if (IS_TYPE_PHYSICAL(type))
2018-02-09 18:46:00 +01:00
{
if (gCritMultiplier == 2)
{
2020-08-05 02:33:05 +02:00
if (attacker->statStages[STAT_ATK] > DEFAULT_STAT_STAGE)
APPLY_STAT_MOD(damage, attacker, attack, STAT_ATK)
2018-02-09 18:46:00 +01:00
else
damage = attack;
}
else
APPLY_STAT_MOD(damage, attacker, attack, STAT_ATK)
2018-02-09 18:46:00 +01:00
damage = damage * gBattleMovePower;
damage *= (2 * attacker->level / 5 + 2);
if (gCritMultiplier == 2)
{
2020-08-05 02:33:05 +02:00
if (defender->statStages[STAT_DEF] < DEFAULT_STAT_STAGE)
APPLY_STAT_MOD(damageHelper, defender, defense, STAT_DEF)
2018-02-09 18:46:00 +01:00
else
damageHelper = defense;
}
else
APPLY_STAT_MOD(damageHelper, defender, defense, STAT_DEF)
2018-02-09 18:46:00 +01:00
damage = damage / damageHelper;
damage /= 50;
if ((attacker->status1 & STATUS1_BURN) && attacker->ability != ABILITY_GUTS)
damage /= 2;
if ((sideStatus & SIDE_STATUS_REFLECT) && gCritMultiplier == 1)
{
2019-09-04 23:47:29 +02:00
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2)
2018-02-09 18:46:00 +01:00
damage = 2 * (damage / 3);
else
damage /= 2;
}
2020-07-09 20:52:19 +02:00
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == MOVE_TARGET_BOTH && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2)
2018-02-09 18:46:00 +01:00
damage /= 2;
// moves always do at least 1 damage.
if (damage == 0)
damage = 1;
}
if (type == TYPE_MYSTERY)
damage = 0; // is ??? type. does 0 damage.
2018-07-16 22:00:27 +02:00
if (IS_TYPE_SPECIAL(type))
2018-02-09 18:46:00 +01:00
{
if (gCritMultiplier == 2)
{
2020-08-05 02:33:05 +02:00
if (attacker->statStages[STAT_SPATK] > DEFAULT_STAT_STAGE)
APPLY_STAT_MOD(damage, attacker, spAttack, STAT_SPATK)
2018-02-09 18:46:00 +01:00
else
damage = spAttack;
}
else
APPLY_STAT_MOD(damage, attacker, spAttack, STAT_SPATK)
2018-02-09 18:46:00 +01:00
damage = damage * gBattleMovePower;
damage *= (2 * attacker->level / 5 + 2);
if (gCritMultiplier == 2)
{
2020-08-05 02:33:05 +02:00
if (defender->statStages[STAT_SPDEF] < DEFAULT_STAT_STAGE)
APPLY_STAT_MOD(damageHelper, defender, spDefense, STAT_SPDEF)
2018-02-09 18:46:00 +01:00
else
damageHelper = spDefense;
}
else
APPLY_STAT_MOD(damageHelper, defender, spDefense, STAT_SPDEF)
2018-02-09 18:46:00 +01:00
damage = (damage / damageHelper);
damage /= 50;
if ((sideStatus & SIDE_STATUS_LIGHTSCREEN) && gCritMultiplier == 1)
{
2019-09-04 23:47:29 +02:00
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2)
2018-02-09 18:46:00 +01:00
damage = 2 * (damage / 3);
else
damage /= 2;
}
2020-07-09 20:52:19 +02:00
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == MOVE_TARGET_BOTH && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2)
2018-02-09 18:46:00 +01:00
damage /= 2;
// are effects of weather negated with cloud nine or air lock
2018-07-16 20:47:30 +02:00
if (WEATHER_HAS_EFFECT2)
2018-02-09 18:46:00 +01:00
{
if (gBattleWeather & WEATHER_RAIN_TEMPORARY)
{
switch (type)
{
case TYPE_FIRE:
damage /= 2;
break;
case TYPE_WATER:
damage = (15 * damage) / 10;
break;
}
}
// any weather except sun weakens solar beam
if ((gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_HAIL_ANY)) && gCurrentMove == MOVE_SOLAR_BEAM)
2018-02-09 18:46:00 +01:00
damage /= 2;
// sunny
if (gBattleWeather & WEATHER_SUN_ANY)
{
switch (type)
{
case TYPE_FIRE:
damage = (15 * damage) / 10;
break;
case TYPE_WATER:
damage /= 2;
break;
}
}
}
// flash fire triggered
2019-04-04 23:53:06 +02:00
if ((gBattleResources->flags->flags[battlerIdAtk] & RESOURCE_FLAG_FLASH_FIRE) && type == TYPE_FIRE)
2018-02-09 18:46:00 +01:00
damage = (15 * damage) / 10;
}
return damage + 2;
}
u8 CountAliveMonsInBattle(u8 caseId)
{
s32 i;
u8 retVal = 0;
switch (caseId)
{
case BATTLE_ALIVE_EXCEPT_ACTIVE:
2019-09-08 17:53:48 +02:00
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
2018-02-09 18:46:00 +01:00
{
if (i != gActiveBattler && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
}
break;
case BATTLE_ALIVE_ATK_SIDE:
2019-09-08 17:53:48 +02:00
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
2018-02-09 18:46:00 +01:00
{
if (GetBattlerSide(i) == GetBattlerSide(gBattlerAttacker) && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
}
break;
case BATTLE_ALIVE_DEF_SIDE:
2019-09-08 17:53:48 +02:00
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
2018-02-09 18:46:00 +01:00
{
if (GetBattlerSide(i) == GetBattlerSide(gBattlerTarget) && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
}
break;
}
return retVal;
}
2018-02-11 17:35:01 +01:00
static bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId)
2018-02-09 18:46:00 +01:00
{
2021-01-13 21:17:32 +01:00
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_FRONTIER))
2018-02-09 18:46:00 +01:00
return FALSE;
else if (GetBattlerSide(battlerId) != B_SIDE_PLAYER)
2018-02-09 18:46:00 +01:00
return FALSE;
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gTrainerBattleOpponent_A == TRAINER_SECRET_BASE)
2018-02-09 18:46:00 +01:00
return FALSE;
else if (FlagGet(badgeFlag))
2018-02-09 18:46:00 +01:00
return TRUE;
else
return FALSE;
2018-02-09 18:46:00 +01:00
}
2018-02-11 17:35:01 +01:00
u8 GetDefaultMoveTarget(u8 battlerId)
2018-02-09 18:46:00 +01:00
{
2018-02-11 17:35:01 +01:00
u8 opposing = BATTLE_OPPOSITE(GetBattlerPosition(battlerId) & BIT_SIDE);
2018-02-09 18:46:00 +01:00
if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
2018-02-11 17:35:01 +01:00
return GetBattlerAtPosition(opposing);
2018-02-09 18:46:00 +01:00
if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) > 1)
{
2018-02-11 17:35:01 +01:00
u8 position;
2018-02-09 18:46:00 +01:00
if ((Random() & 1) == 0)
2018-02-11 17:35:01 +01:00
position = BATTLE_PARTNER(opposing);
2018-02-09 18:46:00 +01:00
else
2018-02-11 17:35:01 +01:00
position = opposing;
return GetBattlerAtPosition(position);
2018-02-09 18:46:00 +01:00
}
else
{
2018-02-11 17:35:01 +01:00
if ((gAbsentBattlerFlags & gBitTable[opposing]))
return GetBattlerAtPosition(BATTLE_PARTNER(opposing));
2018-02-09 18:46:00 +01:00
else
2018-02-11 17:35:01 +01:00
return GetBattlerAtPosition(opposing);
2018-02-09 18:46:00 +01:00
}
}
u8 GetMonGender(struct Pokemon *mon)
{
return GetBoxMonGender(&mon->box);
}
u8 GetBoxMonGender(struct BoxPokemon *boxMon)
{
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
u32 personality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY, NULL);
switch (gBaseStats[species].genderRatio)
{
case MON_MALE:
case MON_FEMALE:
case MON_GENDERLESS:
return gBaseStats[species].genderRatio;
}
if (gBaseStats[species].genderRatio > (personality & 0xFF))
return MON_FEMALE;
else
return MON_MALE;
}
u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality)
{
switch (gBaseStats[species].genderRatio)
{
case MON_MALE:
case MON_FEMALE:
case MON_GENDERLESS:
return gBaseStats[species].genderRatio;
}
if (gBaseStats[species].genderRatio > (personality & 0xFF))
return MON_FEMALE;
else
return MON_MALE;
}
2019-04-07 12:40:18 +02:00
u32 GetUnownSpeciesId(u32 personality)
{
return GetUnownLetterByPersonality(personality) + SPECIES_UNOWN_B - 1; //TODO
/*
u16 unownLetter = GetUnownLetterByPersonality(personality);
if (unownLetter == 0)
return SPECIES_UNOWN;
return unownLetter + SPECIES_UNOWN_B - 1;
*/
2019-04-07 12:40:18 +02:00
}
2019-04-05 00:07:39 +02:00
void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition)
2018-02-09 18:46:00 +01:00
{
if (gMonSpritesGfxPtr != NULL)
gMultiuseSpriteTemplate = gMonSpritesGfxPtr->templates[battlerPosition];
2018-02-09 18:46:00 +01:00
else if (gUnknown_020249B4[0])
gMultiuseSpriteTemplate = gUnknown_020249B4[0]->templates[battlerPosition];
2018-02-09 18:46:00 +01:00
else if (gUnknown_020249B4[1])
gMultiuseSpriteTemplate = gUnknown_020249B4[1]->templates[battlerPosition];
2018-02-09 18:46:00 +01:00
else
2021-01-23 05:22:37 +01:00
gMultiuseSpriteTemplate = gBattlerSpriteTemplates[battlerPosition];
2018-02-09 18:46:00 +01:00
2019-04-05 00:07:39 +02:00
gMultiuseSpriteTemplate.paletteTag = speciesTag;
if (battlerPosition == B_POSITION_PLAYER_LEFT || battlerPosition == B_POSITION_PLAYER_RIGHT)
gMultiuseSpriteTemplate.anims = gAnims_MonPic;
2019-04-05 00:07:39 +02:00
else if (speciesTag > SPECIES_SHINY_TAG)
gMultiuseSpriteTemplate.anims = gMonFrontAnimsPtrTable[speciesTag - SPECIES_SHINY_TAG];
2018-02-09 18:46:00 +01:00
else
2019-04-05 00:07:39 +02:00
gMultiuseSpriteTemplate.anims = gMonFrontAnimsPtrTable[speciesTag];
2018-02-09 18:46:00 +01:00
}
void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition)
2018-02-09 18:46:00 +01:00
{
gMultiuseSpriteTemplate.paletteTag = trainerSpriteId;
2018-02-11 17:35:01 +01:00
if (battlerPosition == B_POSITION_PLAYER_LEFT || battlerPosition == B_POSITION_PLAYER_RIGHT)
2018-02-09 18:46:00 +01:00
{
2021-01-23 05:22:37 +01:00
gMultiuseSpriteTemplate = sTrainerBackSpriteTemplates[trainerSpriteId];
gMultiuseSpriteTemplate.anims = gTrainerBackAnimsPtrTable[trainerSpriteId];
2018-02-09 18:46:00 +01:00
}
else
{
if (gMonSpritesGfxPtr != NULL)
gMultiuseSpriteTemplate = gMonSpritesGfxPtr->templates[battlerPosition];
2018-02-09 18:46:00 +01:00
else
2021-01-23 05:22:37 +01:00
gMultiuseSpriteTemplate = gBattlerSpriteTemplates[battlerPosition];
gMultiuseSpriteTemplate.anims = gTrainerFrontAnimsPtrTable[trainerSpriteId];
2018-02-09 18:46:00 +01:00
}
}
void SetMultiuseSpriteTemplateToTrainerFront(u16 arg0, u8 battlerPosition)
2018-02-09 18:46:00 +01:00
{
if (gMonSpritesGfxPtr != NULL)
gMultiuseSpriteTemplate = gMonSpritesGfxPtr->templates[battlerPosition];
2018-02-09 18:46:00 +01:00
else
2021-01-23 05:22:37 +01:00
gMultiuseSpriteTemplate = gBattlerSpriteTemplates[battlerPosition];
2018-02-09 18:46:00 +01:00
gMultiuseSpriteTemplate.paletteTag = arg0;
gMultiuseSpriteTemplate.anims = gTrainerFrontAnimsPtrTable[arg0];
2018-02-09 18:46:00 +01:00
}
2018-02-11 17:35:01 +01:00
static void EncryptBoxMon(struct BoxPokemon *boxMon)
2018-02-09 18:46:00 +01:00
{
u32 i;
for (i = 0; i < 12; i++)
{
boxMon->secure.raw[i] ^= boxMon->personality;
boxMon->secure.raw[i] ^= boxMon->otId;
}
}
2018-02-11 17:35:01 +01:00
static void DecryptBoxMon(struct BoxPokemon *boxMon)
2018-02-09 18:46:00 +01:00
{
u32 i;
for (i = 0; i < 12; i++)
{
boxMon->secure.raw[i] ^= boxMon->otId;
boxMon->secure.raw[i] ^= boxMon->personality;
}
}
#define SUBSTRUCT_CASE(n, v1, v2, v3, v4) \
case n: \
{ \
union PokemonSubstruct *substructs0 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs1 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs2 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs3 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs4 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs5 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs6 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs7 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs8 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs9 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs10 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs11 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs12 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs13 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs14 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs15 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs16 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs17 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs18 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs19 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs20 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs21 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs22 = boxMon->secure.substructs; \
union PokemonSubstruct *substructs23 = boxMon->secure.substructs; \
\
switch (substructType) \
{ \
case 0: \
substruct = &substructs ## n [v1]; \
break; \
case 1: \
substruct = &substructs ## n [v2]; \
break; \
case 2: \
substruct = &substructs ## n [v3]; \
break; \
case 3: \
substruct = &substructs ## n [v4]; \
break; \
} \
break; \
} \
2018-02-11 17:35:01 +01:00
static union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u8 substructType)
2018-02-09 18:46:00 +01:00
{
union PokemonSubstruct *substruct = NULL;
switch (personality % 24)
{
SUBSTRUCT_CASE( 0,0,1,2,3)
SUBSTRUCT_CASE( 1,0,1,3,2)
SUBSTRUCT_CASE( 2,0,2,1,3)
SUBSTRUCT_CASE( 3,0,3,1,2)
SUBSTRUCT_CASE( 4,0,2,3,1)
SUBSTRUCT_CASE( 5,0,3,2,1)
SUBSTRUCT_CASE( 6,1,0,2,3)
SUBSTRUCT_CASE( 7,1,0,3,2)
SUBSTRUCT_CASE( 8,2,0,1,3)
SUBSTRUCT_CASE( 9,3,0,1,2)
SUBSTRUCT_CASE(10,2,0,3,1)
SUBSTRUCT_CASE(11,3,0,2,1)
SUBSTRUCT_CASE(12,1,2,0,3)
SUBSTRUCT_CASE(13,1,3,0,2)
SUBSTRUCT_CASE(14,2,1,0,3)
SUBSTRUCT_CASE(15,3,1,0,2)
SUBSTRUCT_CASE(16,2,3,0,1)
SUBSTRUCT_CASE(17,3,2,0,1)
SUBSTRUCT_CASE(18,1,2,3,0)
SUBSTRUCT_CASE(19,1,3,2,0)
SUBSTRUCT_CASE(20,2,1,3,0)
SUBSTRUCT_CASE(21,3,1,2,0)
SUBSTRUCT_CASE(22,2,3,1,0)
SUBSTRUCT_CASE(23,3,2,1,0)
}
return substruct;
}
u32 GetMonData(struct Pokemon *mon, s32 field, u8* data)
{
u32 ret;
switch (field)
{
case MON_DATA_STATUS:
ret = mon->status;
break;
case MON_DATA_LEVEL:
ret = mon->level;
break;
case MON_DATA_HP:
ret = mon->hp;
break;
case MON_DATA_MAX_HP:
ret = mon->maxHP;
break;
case MON_DATA_ATK:
2020-12-22 07:39:19 +01:00
ret = mon->attack;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_DEF:
2020-12-22 07:39:19 +01:00
ret = mon->defense;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_SPEED:
2020-12-22 07:39:19 +01:00
ret = mon->speed;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_SPATK:
2020-12-22 07:39:19 +01:00
ret = mon->spAttack;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_SPDEF:
2020-12-22 07:39:19 +01:00
ret = mon->spDefense;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_ATK2:
ret = mon->attack;
break;
case MON_DATA_DEF2:
ret = mon->defense;
break;
case MON_DATA_SPEED2:
ret = mon->speed;
break;
case MON_DATA_SPATK2:
ret = mon->spAttack;
break;
case MON_DATA_SPDEF2:
ret = mon->spDefense;
break;
case MON_DATA_MAIL:
ret = mon->mail;
break;
default:
ret = GetBoxMonData(&mon->box, field, data);
break;
}
return ret;
}
u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
{
s32 i;
u32 retVal = 0;
struct PokemonSubstruct0 *substruct0 = NULL;
struct PokemonSubstruct1 *substruct1 = NULL;
struct PokemonSubstruct2 *substruct2 = NULL;
struct PokemonSubstruct3 *substruct3 = NULL;
2019-04-28 00:45:32 +02:00
// Any field greater than MON_DATA_ENCRYPT_SEPARATOR is encrypted and must be treated as such
if (field > MON_DATA_ENCRYPT_SEPARATOR)
2018-02-09 18:46:00 +01:00
{
substruct0 = &(GetSubstruct(boxMon, boxMon->personality, 0)->type0);
substruct1 = &(GetSubstruct(boxMon, boxMon->personality, 1)->type1);
substruct2 = &(GetSubstruct(boxMon, boxMon->personality, 2)->type2);
substruct3 = &(GetSubstruct(boxMon, boxMon->personality, 3)->type3);
DecryptBoxMon(boxMon);
if (CalculateBoxMonChecksum(boxMon) != boxMon->checksum)
{
boxMon->isBadEgg = 1;
boxMon->isEgg = 1;
substruct3->isEgg = 1;
}
}
switch (field)
{
case MON_DATA_PERSONALITY:
retVal = boxMon->personality;
break;
case MON_DATA_OT_ID:
retVal = boxMon->otId;
break;
case MON_DATA_NICKNAME:
{
if (boxMon->isBadEgg)
{
for (retVal = 0;
retVal < POKEMON_NAME_LENGTH && gText_BadEgg[retVal] != EOS;
data[retVal] = gText_BadEgg[retVal], retVal++) {}
data[retVal] = EOS;
}
else if (boxMon->isEgg)
{
StringCopy(data, gText_EggNickname);
retVal = StringLength(data);
}
else if (boxMon->language == LANGUAGE_JAPANESE)
{
data[0] = EXT_CTRL_CODE_BEGIN;
data[1] = EXT_CTRL_CODE_JPN;
for (retVal = 2, i = 0;
i < 5 && boxMon->nickname[i] != EOS;
data[retVal] = boxMon->nickname[i], retVal++, i++) {}
data[retVal++] = EXT_CTRL_CODE_BEGIN;
data[retVal++] = EXT_CTRL_CODE_ENG;
data[retVal] = EOS;
}
else
{
for (retVal = 0;
retVal < POKEMON_NAME_LENGTH;
data[retVal] = boxMon->nickname[retVal], retVal++){}
data[retVal] = EOS;
}
break;
}
case MON_DATA_LANGUAGE:
retVal = boxMon->language;
break;
2018-12-15 23:58:47 +01:00
case MON_DATA_SANITY_IS_BAD_EGG:
2018-02-09 18:46:00 +01:00
retVal = boxMon->isBadEgg;
break;
2018-12-15 23:58:47 +01:00
case MON_DATA_SANITY_HAS_SPECIES:
2018-02-09 18:46:00 +01:00
retVal = boxMon->hasSpecies;
break;
2018-12-15 23:58:47 +01:00
case MON_DATA_SANITY_IS_EGG:
2018-02-09 18:46:00 +01:00
retVal = boxMon->isEgg;
break;
case MON_DATA_OT_NAME:
{
retVal = 0;
2018-09-01 22:03:21 +02:00
while (retVal < PLAYER_NAME_LENGTH)
2018-02-09 18:46:00 +01:00
{
data[retVal] = boxMon->otName[retVal];
retVal++;
}
data[retVal] = EOS;
break;
}
case MON_DATA_MARKINGS:
retVal = boxMon->markings;
break;
case MON_DATA_CHECKSUM:
retVal = boxMon->checksum;
break;
2019-04-28 00:45:32 +02:00
case MON_DATA_ENCRYPT_SEPARATOR:
2018-02-09 18:46:00 +01:00
retVal = boxMon->unknown;
break;
case MON_DATA_SPECIES:
retVal = boxMon->isBadEgg ? SPECIES_EGG : substruct0->species;
break;
case MON_DATA_HELD_ITEM:
retVal = substruct0->heldItem;
break;
case MON_DATA_EXP:
retVal = substruct0->experience;
break;
case MON_DATA_PP_BONUSES:
retVal = substruct0->ppBonuses;
break;
case MON_DATA_FRIENDSHIP:
retVal = substruct0->friendship;
break;
case MON_DATA_MOVE1:
case MON_DATA_MOVE2:
case MON_DATA_MOVE3:
case MON_DATA_MOVE4:
retVal = substruct1->moves[field - MON_DATA_MOVE1];
break;
case MON_DATA_PP1:
case MON_DATA_PP2:
case MON_DATA_PP3:
case MON_DATA_PP4:
retVal = substruct1->pp[field - MON_DATA_PP1];
break;
case MON_DATA_HP_EV:
retVal = substruct2->hpEV;
break;
case MON_DATA_ATK_EV:
retVal = substruct2->attackEV;
break;
case MON_DATA_DEF_EV:
retVal = substruct2->defenseEV;
break;
case MON_DATA_SPEED_EV:
retVal = substruct2->speedEV;
break;
case MON_DATA_SPATK_EV:
retVal = substruct2->spAttackEV;
break;
case MON_DATA_SPDEF_EV:
retVal = substruct2->spDefenseEV;
break;
case MON_DATA_COOL:
retVal = substruct2->cool;
break;
case MON_DATA_BEAUTY:
retVal = substruct2->beauty;
break;
case MON_DATA_CUTE:
retVal = substruct2->cute;
break;
case MON_DATA_SMART:
retVal = substruct2->smart;
break;
case MON_DATA_TOUGH:
retVal = substruct2->tough;
break;
case MON_DATA_SHEEN:
retVal = substruct2->sheen;
break;
case MON_DATA_POKERUS:
retVal = substruct3->pokerus;
break;
case MON_DATA_MET_LOCATION:
retVal = substruct3->metLocation;
break;
case MON_DATA_MET_LEVEL:
retVal = substruct3->metLevel;
break;
case MON_DATA_MET_GAME:
retVal = substruct3->metGame;
break;
case MON_DATA_POKEBALL:
retVal = substruct3->pokeball;
break;
case MON_DATA_OT_GENDER:
retVal = substruct3->otGender;
break;
case MON_DATA_HP_IV:
retVal = substruct3->hpIV;
break;
case MON_DATA_ATK_IV:
retVal = substruct3->attackIV;
break;
case MON_DATA_DEF_IV:
retVal = substruct3->defenseIV;
break;
case MON_DATA_SPEED_IV:
retVal = substruct3->speedIV;
break;
case MON_DATA_SPATK_IV:
retVal = substruct3->spAttackIV;
break;
case MON_DATA_SPDEF_IV:
retVal = substruct3->spDefenseIV;
break;
case MON_DATA_IS_EGG:
retVal = substruct3->isEgg;
break;
2019-05-14 15:22:16 +02:00
case MON_DATA_ABILITY_NUM:
retVal = substruct3->abilityNum;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_COOL_RIBBON:
retVal = substruct3->coolRibbon;
break;
case MON_DATA_BEAUTY_RIBBON:
retVal = substruct3->beautyRibbon;
break;
case MON_DATA_CUTE_RIBBON:
retVal = substruct3->cuteRibbon;
break;
case MON_DATA_SMART_RIBBON:
retVal = substruct3->smartRibbon;
break;
case MON_DATA_TOUGH_RIBBON:
retVal = substruct3->toughRibbon;
break;
case MON_DATA_CHAMPION_RIBBON:
retVal = substruct3->championRibbon;
break;
case MON_DATA_WINNING_RIBBON:
retVal = substruct3->winningRibbon;
break;
case MON_DATA_VICTORY_RIBBON:
retVal = substruct3->victoryRibbon;
break;
case MON_DATA_ARTIST_RIBBON:
retVal = substruct3->artistRibbon;
break;
case MON_DATA_EFFORT_RIBBON:
retVal = substruct3->effortRibbon;
break;
case MON_DATA_MARINE_RIBBON:
retVal = substruct3->marineRibbon;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_LAND_RIBBON:
retVal = substruct3->landRibbon;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_SKY_RIBBON:
retVal = substruct3->skyRibbon;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_COUNTRY_RIBBON:
retVal = substruct3->countryRibbon;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_NATIONAL_RIBBON:
retVal = substruct3->nationalRibbon;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_EARTH_RIBBON:
retVal = substruct3->earthRibbon;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_WORLD_RIBBON:
retVal = substruct3->worldRibbon;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_UNUSED_RIBBONS:
retVal = substruct3->unusedRibbons;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_EVENT_LEGAL:
retVal = substruct3->eventLegal;
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_SPECIES2:
retVal = substruct0->species;
if (substruct0->species && (substruct3->isEgg || boxMon->isBadEgg))
retVal = SPECIES_EGG;
break;
case MON_DATA_IVS:
retVal = substruct3->hpIV | (substruct3->attackIV << 5) | (substruct3->defenseIV << 10) | (substruct3->speedIV << 15) | (substruct3->spAttackIV << 20) | (substruct3->spDefenseIV << 25);
break;
case MON_DATA_KNOWN_MOVES:
if (substruct0->species && !substruct3->isEgg)
{
u16 *moves = (u16 *)data;
s32 i = 0;
2018-12-15 23:58:47 +01:00
while (moves[i] != MOVES_COUNT)
2018-02-09 18:46:00 +01:00
{
u16 move = moves[i];
if (substruct1->moves[0] == move
2021-04-16 05:27:05 +02:00
|| substruct1->moves[1] == move
|| substruct1->moves[2] == move
|| substruct1->moves[3] == move)
2018-02-09 18:46:00 +01:00
retVal |= gBitTable[i];
i++;
}
}
break;
case MON_DATA_RIBBON_COUNT:
retVal = 0;
if (substruct0->species && !substruct3->isEgg)
{
retVal += substruct3->coolRibbon;
retVal += substruct3->beautyRibbon;
retVal += substruct3->cuteRibbon;
retVal += substruct3->smartRibbon;
retVal += substruct3->toughRibbon;
retVal += substruct3->championRibbon;
retVal += substruct3->winningRibbon;
retVal += substruct3->victoryRibbon;
retVal += substruct3->artistRibbon;
retVal += substruct3->effortRibbon;
retVal += substruct3->marineRibbon;
retVal += substruct3->landRibbon;
retVal += substruct3->skyRibbon;
retVal += substruct3->countryRibbon;
retVal += substruct3->nationalRibbon;
retVal += substruct3->earthRibbon;
retVal += substruct3->worldRibbon;
2018-02-09 18:46:00 +01:00
}
break;
case MON_DATA_RIBBONS:
retVal = 0;
if (substruct0->species && !substruct3->isEgg)
{
retVal = substruct3->championRibbon
| (substruct3->coolRibbon << 1)
| (substruct3->beautyRibbon << 4)
| (substruct3->cuteRibbon << 7)
| (substruct3->smartRibbon << 10)
| (substruct3->toughRibbon << 13)
| (substruct3->winningRibbon << 16)
| (substruct3->victoryRibbon << 17)
| (substruct3->artistRibbon << 18)
| (substruct3->effortRibbon << 19)
| (substruct3->marineRibbon << 20)
| (substruct3->landRibbon << 21)
| (substruct3->skyRibbon << 22)
| (substruct3->countryRibbon << 23)
| (substruct3->nationalRibbon << 24)
| (substruct3->earthRibbon << 25)
| (substruct3->worldRibbon << 26);
2018-02-09 18:46:00 +01:00
}
break;
default:
break;
}
2019-04-28 00:45:32 +02:00
if (field > MON_DATA_ENCRYPT_SEPARATOR)
2018-02-09 18:46:00 +01:00
EncryptBoxMon(boxMon);
return retVal;
}
#define SET8(lhs) (lhs) = *data
#define SET16(lhs) (lhs) = data[0] + (data[1] << 8)
#define SET32(lhs) (lhs) = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24)
void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg)
{
const u8 *data = dataArg;
2018-02-09 18:46:00 +01:00
switch (field)
{
case MON_DATA_STATUS:
SET32(mon->status);
break;
case MON_DATA_LEVEL:
SET8(mon->level);
break;
case MON_DATA_HP:
SET16(mon->hp);
break;
case MON_DATA_MAX_HP:
SET16(mon->maxHP);
break;
case MON_DATA_ATK:
SET16(mon->attack);
break;
case MON_DATA_DEF:
SET16(mon->defense);
break;
case MON_DATA_SPEED:
SET16(mon->speed);
break;
case MON_DATA_SPATK:
SET16(mon->spAttack);
break;
case MON_DATA_SPDEF:
SET16(mon->spDefense);
break;
case MON_DATA_MAIL:
SET8(mon->mail);
break;
case MON_DATA_SPECIES2:
break;
default:
SetBoxMonData(&mon->box, field, data);
break;
}
}
void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
{
const u8 *data = dataArg;
2018-02-09 18:46:00 +01:00
struct PokemonSubstruct0 *substruct0 = NULL;
struct PokemonSubstruct1 *substruct1 = NULL;
struct PokemonSubstruct2 *substruct2 = NULL;
struct PokemonSubstruct3 *substruct3 = NULL;
2019-04-28 00:45:32 +02:00
if (field > MON_DATA_ENCRYPT_SEPARATOR)
2018-02-09 18:46:00 +01:00
{
substruct0 = &(GetSubstruct(boxMon, boxMon->personality, 0)->type0);
substruct1 = &(GetSubstruct(boxMon, boxMon->personality, 1)->type1);
substruct2 = &(GetSubstruct(boxMon, boxMon->personality, 2)->type2);
substruct3 = &(GetSubstruct(boxMon, boxMon->personality, 3)->type3);
DecryptBoxMon(boxMon);
if (CalculateBoxMonChecksum(boxMon) != boxMon->checksum)
{
boxMon->isBadEgg = 1;
boxMon->isEgg = 1;
substruct3->isEgg = 1;
EncryptBoxMon(boxMon);
return;
}
}
switch (field)
{
case MON_DATA_PERSONALITY:
SET32(boxMon->personality);
break;
case MON_DATA_OT_ID:
SET32(boxMon->otId);
break;
case MON_DATA_NICKNAME:
{
s32 i;
for (i = 0; i < POKEMON_NAME_LENGTH; i++)
boxMon->nickname[i] = data[i];
break;
}
case MON_DATA_LANGUAGE:
SET8(boxMon->language);
break;
2018-12-15 23:58:47 +01:00
case MON_DATA_SANITY_IS_BAD_EGG:
2018-02-09 18:46:00 +01:00
SET8(boxMon->isBadEgg);
break;
2018-12-15 23:58:47 +01:00
case MON_DATA_SANITY_HAS_SPECIES:
2018-02-09 18:46:00 +01:00
SET8(boxMon->hasSpecies);
break;
2018-12-15 23:58:47 +01:00
case MON_DATA_SANITY_IS_EGG:
2018-02-09 18:46:00 +01:00
SET8(boxMon->isEgg);
break;
case MON_DATA_OT_NAME:
{
s32 i;
2018-09-01 22:03:21 +02:00
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
2018-02-09 18:46:00 +01:00
boxMon->otName[i] = data[i];
break;
}
case MON_DATA_MARKINGS:
SET8(boxMon->markings);
break;
case MON_DATA_CHECKSUM:
SET16(boxMon->checksum);
break;
2019-04-28 00:45:32 +02:00
case MON_DATA_ENCRYPT_SEPARATOR:
2018-02-09 18:46:00 +01:00
SET16(boxMon->unknown);
break;
case MON_DATA_SPECIES:
{
SET16(substruct0->species);
if (substruct0->species)
boxMon->hasSpecies = 1;
else
boxMon->hasSpecies = 0;
break;
}
case MON_DATA_HELD_ITEM:
SET16(substruct0->heldItem);
break;
case MON_DATA_EXP:
SET32(substruct0->experience);
break;
case MON_DATA_PP_BONUSES:
SET8(substruct0->ppBonuses);
break;
case MON_DATA_FRIENDSHIP:
SET8(substruct0->friendship);
break;
case MON_DATA_MOVE1:
case MON_DATA_MOVE2:
case MON_DATA_MOVE3:
case MON_DATA_MOVE4:
SET16(substruct1->moves[field - MON_DATA_MOVE1]);
break;
case MON_DATA_PP1:
case MON_DATA_PP2:
case MON_DATA_PP3:
case MON_DATA_PP4:
SET8(substruct1->pp[field - MON_DATA_PP1]);
break;
case MON_DATA_HP_EV:
SET8(substruct2->hpEV);
break;
case MON_DATA_ATK_EV:
SET8(substruct2->attackEV);
break;
case MON_DATA_DEF_EV:
SET8(substruct2->defenseEV);
break;
case MON_DATA_SPEED_EV:
SET8(substruct2->speedEV);
break;
case MON_DATA_SPATK_EV:
SET8(substruct2->spAttackEV);
break;
case MON_DATA_SPDEF_EV:
SET8(substruct2->spDefenseEV);
break;
case MON_DATA_COOL:
SET8(substruct2->cool);
break;
case MON_DATA_BEAUTY:
SET8(substruct2->beauty);
break;
case MON_DATA_CUTE:
SET8(substruct2->cute);
break;
case MON_DATA_SMART:
SET8(substruct2->smart);
break;
case MON_DATA_TOUGH:
SET8(substruct2->tough);
break;
case MON_DATA_SHEEN:
SET8(substruct2->sheen);
break;
case MON_DATA_POKERUS:
SET8(substruct3->pokerus);
break;
case MON_DATA_MET_LOCATION:
SET8(substruct3->metLocation);
break;
case MON_DATA_MET_LEVEL:
{
u8 metLevel = *data;
substruct3->metLevel = metLevel;
break;
}
case MON_DATA_MET_GAME:
SET8(substruct3->metGame);
break;
case MON_DATA_POKEBALL:
{
u8 pokeball = *data;
substruct3->pokeball = pokeball;
break;
}
case MON_DATA_OT_GENDER:
SET8(substruct3->otGender);
break;
case MON_DATA_HP_IV:
SET8(substruct3->hpIV);
break;
case MON_DATA_ATK_IV:
SET8(substruct3->attackIV);
break;
case MON_DATA_DEF_IV:
SET8(substruct3->defenseIV);
break;
case MON_DATA_SPEED_IV:
SET8(substruct3->speedIV);
break;
case MON_DATA_SPATK_IV:
SET8(substruct3->spAttackIV);
break;
case MON_DATA_SPDEF_IV:
SET8(substruct3->spDefenseIV);
break;
case MON_DATA_IS_EGG:
SET8(substruct3->isEgg);
if (substruct3->isEgg)
boxMon->isEgg = 1;
else
boxMon->isEgg = 0;
break;
2019-05-14 15:22:16 +02:00
case MON_DATA_ABILITY_NUM:
SET8(substruct3->abilityNum);
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_COOL_RIBBON:
SET8(substruct3->coolRibbon);
break;
case MON_DATA_BEAUTY_RIBBON:
SET8(substruct3->beautyRibbon);
break;
case MON_DATA_CUTE_RIBBON:
SET8(substruct3->cuteRibbon);
break;
case MON_DATA_SMART_RIBBON:
SET8(substruct3->smartRibbon);
break;
case MON_DATA_TOUGH_RIBBON:
SET8(substruct3->toughRibbon);
break;
case MON_DATA_CHAMPION_RIBBON:
SET8(substruct3->championRibbon);
break;
case MON_DATA_WINNING_RIBBON:
SET8(substruct3->winningRibbon);
break;
case MON_DATA_VICTORY_RIBBON:
SET8(substruct3->victoryRibbon);
break;
case MON_DATA_ARTIST_RIBBON:
SET8(substruct3->artistRibbon);
break;
case MON_DATA_EFFORT_RIBBON:
SET8(substruct3->effortRibbon);
break;
case MON_DATA_MARINE_RIBBON:
SET8(substruct3->marineRibbon);
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_LAND_RIBBON:
SET8(substruct3->landRibbon);
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_SKY_RIBBON:
SET8(substruct3->skyRibbon);
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_COUNTRY_RIBBON:
SET8(substruct3->countryRibbon);
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_NATIONAL_RIBBON:
SET8(substruct3->nationalRibbon);
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_EARTH_RIBBON:
SET8(substruct3->earthRibbon);
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_WORLD_RIBBON:
SET8(substruct3->worldRibbon);
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_UNUSED_RIBBONS:
SET8(substruct3->unusedRibbons);
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_EVENT_LEGAL:
SET8(substruct3->eventLegal);
2018-02-09 18:46:00 +01:00
break;
case MON_DATA_IVS:
{
u32 ivs = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
substruct3->hpIV = ivs & MAX_IV_MASK;
substruct3->attackIV = (ivs >> 5) & MAX_IV_MASK;
substruct3->defenseIV = (ivs >> 10) & MAX_IV_MASK;
substruct3->speedIV = (ivs >> 15) & MAX_IV_MASK;
substruct3->spAttackIV = (ivs >> 20) & MAX_IV_MASK;
substruct3->spDefenseIV = (ivs >> 25) & MAX_IV_MASK;
2018-02-09 18:46:00 +01:00
break;
}
default:
break;
}
2019-04-28 00:45:32 +02:00
if (field > MON_DATA_ENCRYPT_SEPARATOR)
2018-02-09 18:46:00 +01:00
{
boxMon->checksum = CalculateBoxMonChecksum(boxMon);
EncryptBoxMon(boxMon);
}
}
void CopyMon(void *dest, void *src, size_t size)
{
memcpy(dest, src, size);
}
u8 GiveMonToPlayer(struct Pokemon *mon)
{
s32 i;
SetMonData(mon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName);
SetMonData(mon, MON_DATA_OT_GENDER, &gSaveBlock2Ptr->playerGender);
SetMonData(mon, MON_DATA_OT_ID, gSaveBlock2Ptr->playerTrainerId);
2018-02-11 17:35:01 +01:00
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) == SPECIES_NONE)
break;
}
2018-02-09 18:46:00 +01:00
2018-02-11 17:35:01 +01:00
if (i >= PARTY_SIZE)
2018-02-09 18:46:00 +01:00
return SendMonToPC(mon);
CopyMon(&gPlayerParty[i], mon, sizeof(*mon));
gPlayerPartyCount = i + 1;
return MON_GIVEN_TO_PARTY;
}
u8 SendMonToPC(struct Pokemon* mon)
{
s32 boxNo, boxPos;
2019-09-17 07:49:07 +02:00
SetPCBoxToSendMon(VarGet(VAR_PC_BOX_TO_SEND_MON));
2018-02-09 18:46:00 +01:00
boxNo = StorageGetCurrentBox();
do
{
2018-12-21 22:35:01 +01:00
for (boxPos = 0; boxPos < IN_BOX_COUNT; boxPos++)
2018-02-09 18:46:00 +01:00
{
struct BoxPokemon* checkingMon = GetBoxedMonPtr(boxNo, boxPos);
if (GetBoxMonData(checkingMon, MON_DATA_SPECIES, NULL) == SPECIES_NONE)
{
MonRestorePP(mon);
CopyMon(checkingMon, &mon->box, sizeof(mon->box));
gSpecialVar_MonBoxId = boxNo;
gSpecialVar_MonBoxPos = boxPos;
2019-09-17 07:49:07 +02:00
if (GetPCBoxToSendMon() != boxNo)
FlagClear(FLAG_SHOWN_BOX_WAS_FULL_MESSAGE);
VarSet(VAR_PC_BOX_TO_SEND_MON, boxNo);
2018-02-09 18:46:00 +01:00
return MON_GIVEN_TO_PC;
}
}
boxNo++;
2018-12-21 22:35:01 +01:00
if (boxNo == TOTAL_BOXES_COUNT)
2018-02-09 18:46:00 +01:00
boxNo = 0;
} while (boxNo != StorageGetCurrentBox());
return MON_CANT_GIVE;
}
u8 CalculatePlayerPartyCount(void)
{
gPlayerPartyCount = 0;
2020-04-09 21:18:53 +02:00
while (gPlayerPartyCount < PARTY_SIZE
2018-02-09 18:46:00 +01:00
&& GetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, NULL) != SPECIES_NONE)
{
gPlayerPartyCount++;
}
return gPlayerPartyCount;
}
u8 CalculateEnemyPartyCount(void)
{
gEnemyPartyCount = 0;
2020-04-09 21:18:53 +02:00
while (gEnemyPartyCount < PARTY_SIZE
2018-02-09 18:46:00 +01:00
&& GetMonData(&gEnemyParty[gEnemyPartyCount], MON_DATA_SPECIES, NULL) != SPECIES_NONE)
{
gEnemyPartyCount++;
}
return gEnemyPartyCount;
}
u8 GetMonsStateToDoubles(void)
{
s32 aliveCount = 0;
s32 i;
CalculatePlayerPartyCount();
if (gPlayerPartyCount == 1)
return gPlayerPartyCount; // PLAYER_HAS_ONE_MON
for (i = 0; i < gPlayerPartyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_EGG
&& GetMonData(&gPlayerParty[i], MON_DATA_HP, NULL) != 0
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_NONE)
aliveCount++;
}
return (aliveCount > 1) ? PLAYER_HAS_TWO_USABLE_MONS : PLAYER_HAS_ONE_USABLE_MON;
}
u8 GetMonsStateToDoubles_2(void)
{
s32 aliveCount = 0;
s32 i;
for (i = 0; i < PARTY_SIZE; i++)
{
u32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL);
if (species != SPECIES_EGG && species != SPECIES_NONE
&& GetMonData(&gPlayerParty[i], MON_DATA_HP, NULL) != 0)
aliveCount++;
}
if (aliveCount == 1)
return PLAYER_HAS_ONE_MON; // may have more than one, but only one is alive
return (aliveCount > 1) ? PLAYER_HAS_TWO_USABLE_MONS : PLAYER_HAS_ONE_USABLE_MON;
}
2019-08-22 16:46:33 +02:00
u8 GetAbilityBySpecies(u16 species, u8 abilityNum)
2018-02-09 18:46:00 +01:00
{
2021-04-17 06:31:41 +02:00
if (abilityNum < NUM_ABILITY_SLOTS)
gLastUsedAbility = gBaseStats[species].abilities[abilityNum];
2018-02-09 18:46:00 +01:00
else
gLastUsedAbility = gBaseStats[species].abilities[0];
2018-02-09 18:46:00 +01:00
if (gLastUsedAbility == ABILITY_NONE)
gLastUsedAbility = gBaseStats[species].abilities[0];
2018-02-09 18:46:00 +01:00
return gLastUsedAbility;
}
u8 GetMonAbility(struct Pokemon *mon)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
2019-05-14 15:22:16 +02:00
u8 abilityNum = GetMonData(mon, MON_DATA_ABILITY_NUM, NULL);
return GetAbilityBySpecies(species, abilityNum);
2018-02-09 18:46:00 +01:00
}
2019-04-05 23:11:24 +02:00
void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord)
2018-02-09 18:46:00 +01:00
{
s32 i, j;
ZeroEnemyPartyMons();
*gBattleResources->secretBase = *secretBaseRecord;
for (i = 0; i < PARTY_SIZE; i++)
{
if (gBattleResources->secretBase->party.species[i])
{
CreateMon(&gEnemyParty[i],
gBattleResources->secretBase->party.species[i],
gBattleResources->secretBase->party.levels[i],
15,
1,
gBattleResources->secretBase->party.personality[i],
2019-08-31 05:06:43 +02:00
OT_ID_RANDOM_NO_SHINY,
2018-02-09 18:46:00 +01:00
0);
SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleResources->secretBase->party.heldItems[i]);
2020-04-09 21:18:53 +02:00
for (j = 0; j < NUM_STATS; j++)
2018-02-09 18:46:00 +01:00
SetMonData(&gEnemyParty[i], MON_DATA_HP_EV + j, &gBattleResources->secretBase->party.EVs[i]);
for (j = 0; j < MAX_MON_MOVES; j++)
2018-02-09 18:46:00 +01:00
{
2020-07-12 02:25:56 +02:00
SetMonData(&gEnemyParty[i], MON_DATA_MOVE1 + j, &gBattleResources->secretBase->party.moves[i * MAX_MON_MOVES + j]);
SetMonData(&gEnemyParty[i], MON_DATA_PP1 + j, &gBattleMoves[gBattleResources->secretBase->party.moves[i * MAX_MON_MOVES + j]].pp);
2018-02-09 18:46:00 +01:00
}
}
}
}
u8 GetSecretBaseTrainerPicIndex(void)
{
u8 facilityClass = sSecretBaseFacilityClasses[gBattleResources->secretBase->gender][gBattleResources->secretBase->trainerId[0] % 5];
2018-02-11 17:35:01 +01:00
return gFacilityClassToPicIndex[facilityClass];
2018-02-09 18:46:00 +01:00
}
2018-02-11 17:35:01 +01:00
u8 GetSecretBaseTrainerClass(void)
2018-02-09 18:46:00 +01:00
{
u8 facilityClass = sSecretBaseFacilityClasses[gBattleResources->secretBase->gender][gBattleResources->secretBase->trainerId[0] % 5];
2018-02-11 17:35:01 +01:00
return gFacilityClassToTrainerClass[facilityClass];
2018-02-09 18:46:00 +01:00
}
bool8 IsPlayerPartyAndPokemonStorageFull(void)
{
s32 i;
2018-02-11 17:35:01 +01:00
for (i = 0; i < PARTY_SIZE; i++)
2018-02-09 18:46:00 +01:00
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) == SPECIES_NONE)
return FALSE;
return IsPokemonStorageFull();
}
bool8 IsPokemonStorageFull(void)
{
s32 i, j;
2018-12-21 22:35:01 +01:00
for (i = 0; i < TOTAL_BOXES_COUNT; i++)
for (j = 0; j < IN_BOX_COUNT; j++)
2018-12-15 23:58:47 +01:00
if (GetBoxMonDataAt(i, j, MON_DATA_SPECIES) == SPECIES_NONE)
2018-02-09 18:46:00 +01:00
return FALSE;
return TRUE;
}
void GetSpeciesName(u8 *name, u16 species)
{
s32 i;
for (i = 0; i <= POKEMON_NAME_LENGTH; i++)
{
if (species > NUM_SPECIES)
name[i] = gSpeciesNames[0][i];
else
name[i] = gSpeciesNames[species][i];
if (name[i] == EOS)
break;
}
name[i] = EOS;
}
u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex)
{
u8 basePP = gBattleMoves[move].pp;
return basePP + ((basePP * 20 * ((gPPUpGetMask[moveIndex] & ppBonuses) >> (2 * moveIndex))) / 100);
2018-02-09 18:46:00 +01:00
}
void RemoveMonPPBonus(struct Pokemon *mon, u8 moveIndex)
{
u8 ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL);
ppBonuses &= gPPUpSetMask[moveIndex];
2018-02-09 18:46:00 +01:00
SetMonData(mon, MON_DATA_PP_BONUSES, &ppBonuses);
}
void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex)
{
mon->ppBonuses &= gPPUpSetMask[moveIndex];
2018-02-09 18:46:00 +01:00
}
2018-02-11 17:35:01 +01:00
void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex)
2018-02-09 18:46:00 +01:00
{
u16* hpSwitchout;
s32 i;
u8 nickname[POKEMON_NAME_LENGTH * 2];
2018-02-11 17:35:01 +01:00
gBattleMons[battlerId].species = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPECIES, NULL);
gBattleMons[battlerId].item = GetMonData(&gPlayerParty[partyIndex], MON_DATA_HELD_ITEM, NULL);
2018-02-09 18:46:00 +01:00
for (i = 0; i < MAX_MON_MOVES; i++)
2018-02-09 18:46:00 +01:00
{
2018-02-11 17:35:01 +01:00
gBattleMons[battlerId].moves[i] = GetMonData(&gPlayerParty[partyIndex], MON_DATA_MOVE1 + i, NULL);
gBattleMons[battlerId].pp[i] = GetMonData(&gPlayerParty[partyIndex], MON_DATA_PP1 + i, NULL);
}
gBattleMons[battlerId].ppBonuses = GetMonData(&gPlayerParty[partyIndex], MON_DATA_PP_BONUSES, NULL);
gBattleMons[battlerId].friendship = GetMonData(&gPlayerParty[partyIndex], MON_DATA_FRIENDSHIP, NULL);
gBattleMons[battlerId].experience = GetMonData(&gPlayerParty[partyIndex], MON_DATA_EXP, NULL);
gBattleMons[battlerId].hpIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_HP_IV, NULL);
gBattleMons[battlerId].attackIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ATK_IV, NULL);
gBattleMons[battlerId].defenseIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_DEF_IV, NULL);
gBattleMons[battlerId].speedIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPEED_IV, NULL);
gBattleMons[battlerId].spAttackIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPATK_IV, NULL);
gBattleMons[battlerId].spDefenseIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPDEF_IV, NULL);
gBattleMons[battlerId].personality = GetMonData(&gPlayerParty[partyIndex], MON_DATA_PERSONALITY, NULL);
gBattleMons[battlerId].status1 = GetMonData(&gPlayerParty[partyIndex], MON_DATA_STATUS, NULL);
gBattleMons[battlerId].level = GetMonData(&gPlayerParty[partyIndex], MON_DATA_LEVEL, NULL);
gBattleMons[battlerId].hp = GetMonData(&gPlayerParty[partyIndex], MON_DATA_HP, NULL);
gBattleMons[battlerId].maxHP = GetMonData(&gPlayerParty[partyIndex], MON_DATA_MAX_HP, NULL);
gBattleMons[battlerId].attack = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ATK, NULL);
gBattleMons[battlerId].defense = GetMonData(&gPlayerParty[partyIndex], MON_DATA_DEF, NULL);
gBattleMons[battlerId].speed = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPEED, NULL);
gBattleMons[battlerId].spAttack = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPATK, NULL);
gBattleMons[battlerId].spDefense = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPDEF, NULL);
2019-05-14 15:22:16 +02:00
gBattleMons[battlerId].abilityNum = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ABILITY_NUM, NULL);
2018-02-11 17:35:01 +01:00
gBattleMons[battlerId].otId = GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_ID, NULL);
gBattleMons[battlerId].type1 = gBaseStats[gBattleMons[battlerId].species].type1;
gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2;
2019-05-14 15:22:16 +02:00
gBattleMons[battlerId].ability = GetAbilityBySpecies(gBattleMons[battlerId].species, gBattleMons[battlerId].abilityNum);
2018-02-09 18:46:00 +01:00
GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, nickname);
2018-02-11 17:35:01 +01:00
StringCopy10(gBattleMons[battlerId].nickname, nickname);
GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_NAME, gBattleMons[battlerId].otName);
2018-02-09 18:46:00 +01:00
2018-02-11 17:35:01 +01:00
hpSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(battlerId)];
*hpSwitchout = gBattleMons[battlerId].hp;
2018-02-09 18:46:00 +01:00
2020-08-05 02:33:05 +02:00
for (i = 0; i < NUM_BATTLE_STATS; i++)
gBattleMons[battlerId].statStages[i] = DEFAULT_STAT_STAGE;
2018-02-09 18:46:00 +01:00
2018-02-11 17:35:01 +01:00
gBattleMons[battlerId].status2 = 0;
2020-07-28 00:10:42 +02:00
UpdateSentPokesToOpponentValue(battlerId);
2018-02-11 17:35:01 +01:00
ClearTemporarySpeciesSpriteData(battlerId, FALSE);
2018-02-09 18:46:00 +01:00
}
2018-02-11 17:35:01 +01:00
bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
return PokemonUseItemEffects(mon, item, partyIndex, moveIndex, FALSE);
2018-02-09 18:46:00 +01:00
}
2021-02-12 20:54:11 +01:00
#define UPDATE_FRIENDSHIP_FROM_ITEM \
{ \
if ((retVal == 0 || friendshipOnly) && !ShouldSkipFriendshipChange() && friendshipChange == 0) \
{ \
friendshipChange = itemEffect[itemEffectParam]; \
friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, NULL); \
2021-03-25 18:26:22 +01:00
if (friendshipChange > 0 && holdEffect == HOLD_EFFECT_FRIENDSHIP_UP) \
2021-02-12 20:54:11 +01:00
friendship += 150 * friendshipChange / 100; \
else \
friendship += friendshipChange; \
if (friendshipChange > 0) \
{ \
if (GetMonData(mon, MON_DATA_POKEBALL, NULL) == ITEM_LUXURY_BALL) \
friendship++; \
if (GetMonData(mon, MON_DATA_MET_LOCATION, NULL) == GetCurrentRegionMapSectionId()) \
friendship++; \
} \
if (friendship < 0) \
friendship = 0; \
if (friendship > MAX_FRIENDSHIP) \
friendship = MAX_FRIENDSHIP; \
SetMonData(mon, MON_DATA_FRIENDSHIP, &friendship); \
retVal = FALSE; \
} \
}
// Returns TRUE if the item has no effect on the Pokémon, FALSE otherwise
bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex, bool8 usedByAI)
2018-02-09 18:46:00 +01:00
{
u32 dataUnsigned;
s32 dataSigned;
s32 friendship;
2021-02-12 20:54:11 +01:00
s32 i;
2018-02-09 18:46:00 +01:00
bool8 retVal = TRUE;
const u8 *itemEffect;
2021-02-12 20:54:11 +01:00
u8 itemEffectParam = ITEM_EFFECT_ARG_START;
u32 temp1, temp2;
s8 friendshipChange = 0;
2018-02-09 18:46:00 +01:00
u8 holdEffect;
2021-02-12 20:54:11 +01:00
u8 battlerId = MAX_BATTLERS_COUNT;
u32 friendshipOnly = FALSE;
2018-02-09 18:46:00 +01:00
u16 heldItem;
2021-02-12 20:54:11 +01:00
u8 effectFlags;
s8 evChange;
2018-02-09 18:46:00 +01:00
u16 evCount;
2021-02-12 20:54:11 +01:00
// Get item hold effect
2018-02-09 18:46:00 +01:00
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, NULL);
if (heldItem == ITEM_ENIGMA_BERRY)
{
if (gMain.inBattle)
holdEffect = gEnigmaBerries[gBattlerInMenuId].holdEffect;
2018-02-09 18:46:00 +01:00
else
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
}
else
{
holdEffect = ItemId_GetHoldEffect(heldItem);
}
2021-02-12 20:54:11 +01:00
// Get battler id (if relevant)
gPotentialItemEffectBattler = gBattlerInMenuId;
2018-02-09 18:46:00 +01:00
if (gMain.inBattle)
{
gActiveBattler = gBattlerInMenuId;
2021-02-12 20:54:11 +01:00
i = (GetBattlerSide(gActiveBattler) != B_SIDE_PLAYER);
while (i < gBattlersCount)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
if (gBattlerPartyIndexes[i] == partyIndex)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
battlerId = i;
2018-02-09 18:46:00 +01:00
break;
}
2021-02-12 20:54:11 +01:00
i += 2;
2018-02-09 18:46:00 +01:00
}
}
else
{
gActiveBattler = 0;
battlerId = MAX_BATTLERS_COUNT;
}
2021-02-12 20:54:11 +01:00
// Skip using the item if it won't do anything
2019-04-14 17:20:26 +02:00
if (!ITEM_HAS_EFFECT(item))
2018-02-09 18:46:00 +01:00
return TRUE;
2019-04-14 17:20:26 +02:00
if (gItemEffectTable[item - ITEM_POTION] == NULL && item != ITEM_ENIGMA_BERRY)
2018-02-09 18:46:00 +01:00
return TRUE;
2021-02-12 20:54:11 +01:00
// Get item effect
2018-02-09 18:46:00 +01:00
if (item == ITEM_ENIGMA_BERRY)
{
if (gMain.inBattle)
itemEffect = gEnigmaBerries[gActiveBattler].itemEffect;
else
itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
}
else
{
2019-04-14 17:20:26 +02:00
itemEffect = gItemEffectTable[item - ITEM_POTION];
2018-02-09 18:46:00 +01:00
}
2021-02-12 20:54:11 +01:00
// Do item effect
for (i = 0; i < ITEM_EFFECT_ARG_START; i++)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
switch (i)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
// Handle ITEM0 effects (infatuation, Dire Hit, X Attack). ITEM0_SACRED_ASH is handled in party_menu.c
2018-02-09 18:46:00 +01:00
case 0:
2021-02-12 20:54:11 +01:00
// Cure infatuation
if ((itemEffect[i] & ITEM0_INFATUATION)
2019-04-14 17:20:26 +02:00
&& gMain.inBattle && battlerId != MAX_BATTLERS_COUNT && (gBattleMons[battlerId].status2 & STATUS2_INFATUATION))
2018-02-09 18:46:00 +01:00
{
gBattleMons[battlerId].status2 &= ~STATUS2_INFATUATION;
retVal = FALSE;
}
2021-02-12 20:54:11 +01:00
// Dire Hit
if ((itemEffect[i] & ITEM0_DIRE_HIT)
2018-02-09 18:46:00 +01:00
&& !(gBattleMons[gActiveBattler].status2 & STATUS2_FOCUS_ENERGY))
{
gBattleMons[gActiveBattler].status2 |= STATUS2_FOCUS_ENERGY;
retVal = FALSE;
}
2021-02-12 20:54:11 +01:00
// X Attack
if ((itemEffect[i] & ITEM0_X_ATTACK)
2020-08-05 02:33:05 +02:00
&& gBattleMons[gActiveBattler].statStages[STAT_ATK] < MAX_STAT_STAGE)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
gBattleMons[gActiveBattler].statStages[STAT_ATK] += itemEffect[i] & ITEM0_X_ATTACK;
2020-08-05 02:33:05 +02:00
if (gBattleMons[gActiveBattler].statStages[STAT_ATK] > MAX_STAT_STAGE)
gBattleMons[gActiveBattler].statStages[STAT_ATK] = MAX_STAT_STAGE;
2018-02-09 18:46:00 +01:00
retVal = FALSE;
}
break;
2021-02-12 20:54:11 +01:00
// Handle ITEM1 effects (in-battle stat boosting effects)
2018-02-09 18:46:00 +01:00
case 1:
2021-02-12 20:54:11 +01:00
// X Defend
if ((itemEffect[i] & ITEM1_X_DEFEND)
2020-08-05 02:33:05 +02:00
&& gBattleMons[gActiveBattler].statStages[STAT_DEF] < MAX_STAT_STAGE)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
gBattleMons[gActiveBattler].statStages[STAT_DEF] += (itemEffect[i] & ITEM1_X_DEFEND) >> 4;
2020-08-05 02:33:05 +02:00
if (gBattleMons[gActiveBattler].statStages[STAT_DEF] > MAX_STAT_STAGE)
gBattleMons[gActiveBattler].statStages[STAT_DEF] = MAX_STAT_STAGE;
2018-02-09 18:46:00 +01:00
retVal = FALSE;
}
2021-02-12 20:54:11 +01:00
// X Speed
if ((itemEffect[i] & ITEM1_X_SPEED)
2020-08-05 02:33:05 +02:00
&& gBattleMons[gActiveBattler].statStages[STAT_SPEED] < MAX_STAT_STAGE)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
gBattleMons[gActiveBattler].statStages[STAT_SPEED] += itemEffect[i] & ITEM1_X_SPEED;
2020-08-05 02:33:05 +02:00
if (gBattleMons[gActiveBattler].statStages[STAT_SPEED] > MAX_STAT_STAGE)
gBattleMons[gActiveBattler].statStages[STAT_SPEED] = MAX_STAT_STAGE;
2018-02-09 18:46:00 +01:00
retVal = FALSE;
}
break;
2021-02-12 20:54:11 +01:00
// Handle ITEM2 effects (more stat boosting effects)
2018-02-09 18:46:00 +01:00
case 2:
2021-02-12 20:54:11 +01:00
// X Accuracy
if ((itemEffect[i] & ITEM2_X_ACCURACY)
2020-08-05 02:33:05 +02:00
&& gBattleMons[gActiveBattler].statStages[STAT_ACC] < MAX_STAT_STAGE)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
gBattleMons[gActiveBattler].statStages[STAT_ACC] += (itemEffect[i] & ITEM2_X_ACCURACY) >> 4;
2020-08-05 02:33:05 +02:00
if (gBattleMons[gActiveBattler].statStages[STAT_ACC] > MAX_STAT_STAGE)
gBattleMons[gActiveBattler].statStages[STAT_ACC] = MAX_STAT_STAGE;
2018-02-09 18:46:00 +01:00
retVal = FALSE;
}
2021-02-12 20:54:11 +01:00
// X Sp Attack
if ((itemEffect[i] & ITEM2_X_SPATK)
2020-08-05 02:33:05 +02:00
&& gBattleMons[gActiveBattler].statStages[STAT_SPATK] < MAX_STAT_STAGE)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
gBattleMons[gActiveBattler].statStages[STAT_SPATK] += itemEffect[i] & ITEM2_X_SPATK;
2020-08-05 02:33:05 +02:00
if (gBattleMons[gActiveBattler].statStages[STAT_SPATK] > MAX_STAT_STAGE)
gBattleMons[gActiveBattler].statStages[STAT_SPATK] = MAX_STAT_STAGE;
2018-02-09 18:46:00 +01:00
retVal = FALSE;
}
break;
2021-02-12 20:54:11 +01:00
// Handle ITEM3 effects (Guard Spec, Rare Candy, cure status)
2018-02-09 18:46:00 +01:00
case 3:
2021-02-12 20:54:11 +01:00
// Guard Spec
if ((itemEffect[i] & ITEM3_GUARD_SPEC)
2018-02-09 18:46:00 +01:00
&& gSideTimers[GetBattlerSide(gActiveBattler)].mistTimer == 0)
{
gSideTimers[GetBattlerSide(gActiveBattler)].mistTimer = 5;
retVal = FALSE;
}
2021-02-12 20:54:11 +01:00
// Rare Candy
if ((itemEffect[i] & ITEM3_LEVEL_UP)
2018-10-17 04:47:08 +02:00
&& GetMonData(mon, MON_DATA_LEVEL, NULL) != MAX_LEVEL)
2018-02-09 18:46:00 +01:00
{
dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1];
SetMonData(mon, MON_DATA_EXP, &dataUnsigned);
CalculateMonStats(mon);
retVal = FALSE;
}
2021-02-12 20:54:11 +01:00
// Cure status
if ((itemEffect[i] & ITEM3_SLEEP)
&& HealStatusConditions(mon, partyIndex, STATUS1_SLEEP, battlerId) == 0)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
if (battlerId != MAX_BATTLERS_COUNT)
2018-02-09 18:46:00 +01:00
gBattleMons[battlerId].status2 &= ~STATUS2_NIGHTMARE;
retVal = FALSE;
}
2021-02-12 20:54:11 +01:00
if ((itemEffect[i] & ITEM3_POISON) && HealStatusConditions(mon, partyIndex, STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER, battlerId) == 0)
2018-02-09 18:46:00 +01:00
retVal = FALSE;
2021-02-12 20:54:11 +01:00
if ((itemEffect[i] & ITEM3_BURN) && HealStatusConditions(mon, partyIndex, STATUS1_BURN, battlerId) == 0)
2018-02-09 18:46:00 +01:00
retVal = FALSE;
2021-02-12 20:54:11 +01:00
if ((itemEffect[i] & ITEM3_FREEZE) && HealStatusConditions(mon, partyIndex, STATUS1_FREEZE, battlerId) == 0)
2018-02-09 18:46:00 +01:00
retVal = FALSE;
2021-02-12 20:54:11 +01:00
if ((itemEffect[i] & ITEM3_PARALYSIS) && HealStatusConditions(mon, partyIndex, STATUS1_PARALYSIS, battlerId) == 0)
2018-02-09 18:46:00 +01:00
retVal = FALSE;
2021-02-12 20:54:11 +01:00
if ((itemEffect[i] & ITEM3_CONFUSION) // heal confusion
2019-04-14 17:20:26 +02:00
&& gMain.inBattle && battlerId != MAX_BATTLERS_COUNT && (gBattleMons[battlerId].status2 & STATUS2_CONFUSION))
2018-02-09 18:46:00 +01:00
{
gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION;
retVal = FALSE;
}
break;
2021-02-12 20:54:11 +01:00
// Handle ITEM4 effects (Change HP/Atk EVs, HP heal, PP heal, PP up, Revive, and evolution stones)
2018-02-09 18:46:00 +01:00
case 4:
2021-02-12 20:54:11 +01:00
effectFlags = itemEffect[i];
// PP Up
if (effectFlags & ITEM4_PP_UP)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
effectFlags &= ~ITEM4_PP_UP;
dataUnsigned = (GetMonData(mon, MON_DATA_PP_BONUSES, NULL) & gPPUpGetMask[moveIndex]) >> (moveIndex * 2);
2021-02-12 20:54:11 +01:00
temp1 = CalculatePPWithBonus(GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex);
if (dataUnsigned <= 2 && temp1 > 4)
2018-02-09 18:46:00 +01:00
{
dataUnsigned = GetMonData(mon, MON_DATA_PP_BONUSES, NULL) + gPPUpAddMask[moveIndex];
2018-02-09 18:46:00 +01:00
SetMonData(mon, MON_DATA_PP_BONUSES, &dataUnsigned);
2021-02-12 20:54:11 +01:00
dataUnsigned = CalculatePPWithBonus(GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL), dataUnsigned, moveIndex) - temp1;
2018-02-09 18:46:00 +01:00
dataUnsigned = GetMonData(mon, MON_DATA_PP1 + moveIndex, NULL) + dataUnsigned;
SetMonData(mon, MON_DATA_PP1 + moveIndex, &dataUnsigned);
retVal = FALSE;
}
}
2021-02-12 20:54:11 +01:00
temp1 = 0;
// Loop through and try each of the remaining ITEM4 effects
while (effectFlags != 0)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
if (effectFlags & 1)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
switch (temp1)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
case 0: // ITEM4_EV_HP
case 1: // ITEM4_EV_ATK
2018-02-09 18:46:00 +01:00
evCount = GetMonEVCount(mon);
2021-02-12 20:54:11 +01:00
temp2 = itemEffect[itemEffectParam];
dataSigned = GetMonData(mon, sGetMonDataEVConstants[temp1], NULL);
evChange = temp2;
if (evChange > 0) // Increasing EV (HP or Atk)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
// Has EV increase limit already been reached?
2018-02-09 18:46:00 +01:00
if (evCount >= MAX_TOTAL_EVS)
return TRUE;
if (dataSigned >= EV_ITEM_RAISE_LIMIT)
2018-02-09 18:46:00 +01:00
break;
2021-02-12 20:54:11 +01:00
// Limit the increase
if (dataSigned + evChange > EV_ITEM_RAISE_LIMIT)
temp2 = EV_ITEM_RAISE_LIMIT - (dataSigned + evChange) + evChange;
2018-02-09 18:46:00 +01:00
else
2021-02-12 20:54:11 +01:00
temp2 = evChange;
2018-02-09 18:46:00 +01:00
2021-02-12 20:54:11 +01:00
if (evCount + temp2 > MAX_TOTAL_EVS)
temp2 += MAX_TOTAL_EVS - (evCount + temp2);
dataSigned += temp2;
2018-02-09 18:46:00 +01:00
}
2021-02-12 20:54:11 +01:00
else // Decreasing EV (HP or Atk)
2018-02-09 18:46:00 +01:00
{
if (dataSigned == 0)
{
2021-02-12 20:54:11 +01:00
// No EVs to lose, but make sure friendship updates anyway
friendshipOnly = TRUE;
itemEffectParam++;
2018-02-09 18:46:00 +01:00
break;
}
2021-02-12 20:54:11 +01:00
dataSigned += evChange;
2018-02-09 18:46:00 +01:00
if (dataSigned < 0)
dataSigned = 0;
}
2021-02-12 20:54:11 +01:00
// Update EVs and stats
SetMonData(mon, sGetMonDataEVConstants[temp1], &dataSigned);
2018-02-09 18:46:00 +01:00
CalculateMonStats(mon);
2021-02-12 20:54:11 +01:00
itemEffectParam++;
2018-02-09 18:46:00 +01:00
retVal = FALSE;
break;
2021-02-12 20:54:11 +01:00
case 2: // ITEM4_HEAL_HP
// If Revive, update number of times revive has been used
if (effectFlags & (ITEM4_REVIVE >> 2))
2018-02-09 18:46:00 +01:00
{
if (GetMonData(mon, MON_DATA_HP, NULL) != 0)
{
2021-02-12 20:54:11 +01:00
itemEffectParam++;
2018-02-09 18:46:00 +01:00
break;
}
if (gMain.inBattle)
{
2021-02-12 20:54:11 +01:00
if (battlerId != MAX_BATTLERS_COUNT)
2018-02-09 18:46:00 +01:00
{
gAbsentBattlerFlags &= ~gBitTable[battlerId];
2019-10-26 03:55:01 +02:00
CopyPlayerPartyMonToBattleData(battlerId, GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battlerId]));
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER && gBattleResults.numRevivesUsed < 255)
gBattleResults.numRevivesUsed++;
2018-02-09 18:46:00 +01:00
}
else
{
gAbsentBattlerFlags &= ~gBitTable[gActiveBattler ^ 2];
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER && gBattleResults.numRevivesUsed < 255)
gBattleResults.numRevivesUsed++;
2018-02-09 18:46:00 +01:00
}
}
}
else
{
if (GetMonData(mon, MON_DATA_HP, NULL) == 0)
{
2021-02-12 20:54:11 +01:00
itemEffectParam++;
2018-02-09 18:46:00 +01:00
break;
}
}
// Get amount of HP to restore
2021-02-12 20:54:11 +01:00
dataUnsigned = itemEffect[itemEffectParam++];
2018-02-09 18:46:00 +01:00
switch (dataUnsigned)
{
2021-02-12 20:54:11 +01:00
case ITEM6_HEAL_HP_FULL:
2018-02-09 18:46:00 +01:00
dataUnsigned = GetMonData(mon, MON_DATA_MAX_HP, NULL) - GetMonData(mon, MON_DATA_HP, NULL);
break;
2021-02-12 20:54:11 +01:00
case ITEM6_HEAL_HP_HALF:
2018-02-09 18:46:00 +01:00
dataUnsigned = GetMonData(mon, MON_DATA_MAX_HP, NULL) / 2;
if (dataUnsigned == 0)
dataUnsigned = 1;
break;
2021-02-12 20:54:11 +01:00
case ITEM6_HEAL_HP_LVL_UP:
dataUnsigned = gBattleScripting.levelUpHP;
2018-02-09 18:46:00 +01:00
break;
}
2021-02-12 20:54:11 +01:00
// Only restore HP if not at max health
2018-02-09 18:46:00 +01:00
if (GetMonData(mon, MON_DATA_MAX_HP, NULL) != GetMonData(mon, MON_DATA_HP, NULL))
{
2021-02-12 20:54:11 +01:00
if (!usedByAI)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
// Restore HP
2018-02-09 18:46:00 +01:00
dataUnsigned = GetMonData(mon, MON_DATA_HP, NULL) + dataUnsigned;
if (dataUnsigned > GetMonData(mon, MON_DATA_MAX_HP, NULL))
dataUnsigned = GetMonData(mon, MON_DATA_MAX_HP, NULL);
SetMonData(mon, MON_DATA_HP, &dataUnsigned);
2021-02-12 20:54:11 +01:00
// Update battler (if applicable)
if (gMain.inBattle && battlerId != MAX_BATTLERS_COUNT)
2018-02-09 18:46:00 +01:00
{
gBattleMons[battlerId].hp = dataUnsigned;
2021-02-12 20:54:11 +01:00
if (!(effectFlags & (ITEM4_REVIVE >> 2)) && GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
2018-02-09 18:46:00 +01:00
{
if (gBattleResults.numHealingItemsUsed < 255)
gBattleResults.numHealingItemsUsed++;
2021-02-12 20:54:11 +01:00
temp2 = gActiveBattler;
2018-02-09 18:46:00 +01:00
gActiveBattler = battlerId;
BtlController_EmitGetMonData(0, REQUEST_ALL_BATTLE, 0);
2018-02-09 18:46:00 +01:00
MarkBattlerForControllerExec(gActiveBattler);
2021-02-12 20:54:11 +01:00
gActiveBattler = temp2;
2018-02-09 18:46:00 +01:00
}
}
}
else
{
gBattleMoveDamage = -dataUnsigned;
}
retVal = FALSE;
}
2021-02-12 20:54:11 +01:00
effectFlags &= ~(ITEM4_REVIVE >> 2);
2018-02-09 18:46:00 +01:00
break;
2021-02-12 20:54:11 +01:00
case 3: // ITEM4_HEAL_PP
if (!(effectFlags & (ITEM4_HEAL_PP_ONE >> 3)))
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
// Heal PP for all moves
for (temp2 = 0; (signed)(temp2) < (signed)(MAX_MON_MOVES); temp2++)
2018-02-09 18:46:00 +01:00
{
u16 moveId;
2021-02-12 20:54:11 +01:00
dataUnsigned = GetMonData(mon, MON_DATA_PP1 + temp2, NULL);
moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL);
if (dataUnsigned != CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2))
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
dataUnsigned += itemEffect[itemEffectParam];
moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant
if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2))
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant
dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2);
2018-02-09 18:46:00 +01:00
}
2021-02-12 20:54:11 +01:00
SetMonData(mon, MON_DATA_PP1 + temp2, &dataUnsigned);
// Heal battler PP too (if applicable)
2018-02-09 18:46:00 +01:00
if (gMain.inBattle
2019-04-14 17:20:26 +02:00
&& battlerId != MAX_BATTLERS_COUNT && !(gBattleMons[battlerId].status2 & STATUS2_TRANSFORMED)
2021-02-12 20:54:11 +01:00
&& !(gDisableStructs[battlerId].mimickedMoves & gBitTable[temp2]))
gBattleMons[battlerId].pp[temp2] = dataUnsigned;
2018-02-09 18:46:00 +01:00
retVal = FALSE;
}
}
2021-02-12 20:54:11 +01:00
itemEffectParam++;
2018-02-09 18:46:00 +01:00
}
else
{
2021-02-12 20:54:11 +01:00
// Heal PP for one move
2018-02-09 18:46:00 +01:00
u16 moveId;
dataUnsigned = GetMonData(mon, MON_DATA_PP1 + moveIndex, NULL);
moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL);
if (dataUnsigned != CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex))
{
2021-02-12 20:54:11 +01:00
dataUnsigned += itemEffect[itemEffectParam++];
moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant
2018-02-09 18:46:00 +01:00
if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex))
{
2021-02-12 20:54:11 +01:00
moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant
2018-02-09 18:46:00 +01:00
dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex);
}
SetMonData(mon, MON_DATA_PP1 + moveIndex, &dataUnsigned);
2021-02-12 20:54:11 +01:00
// Heal battler PP too (if applicable)
2018-02-09 18:46:00 +01:00
if (gMain.inBattle
2021-02-12 20:54:11 +01:00
&& battlerId != MAX_BATTLERS_COUNT && !(gBattleMons[battlerId].status2 & STATUS2_TRANSFORMED)
&& !(gDisableStructs[battlerId].mimickedMoves & gBitTable[moveIndex]))
2018-02-09 18:46:00 +01:00
gBattleMons[battlerId].pp[moveIndex] = dataUnsigned;
2021-02-12 20:54:11 +01:00
2018-02-09 18:46:00 +01:00
retVal = FALSE;
}
}
break;
2021-02-12 20:54:11 +01:00
// cases 4-6 are ITEM4_HEAL_PP_ONE, ITEM4_PP_UP, and ITEM4_REVIVE, which
// are already handled above by other cases or before the loop
case 7: // ITEM4_EVO_STONE
2018-02-09 18:46:00 +01:00
{
u16 targetSpecies = GetEvolutionTargetSpecies(mon, EVO_MODE_ITEM_USE, item, SPECIES_NONE);
2018-02-09 18:46:00 +01:00
if (targetSpecies != SPECIES_NONE)
{
2021-02-12 20:54:11 +01:00
BeginEvolutionScene(mon, targetSpecies, FALSE, partyIndex);
2018-02-09 18:46:00 +01:00
return FALSE;
}
}
break;
}
}
2021-02-12 20:54:11 +01:00
temp1++;
effectFlags >>= 1;
2018-02-09 18:46:00 +01:00
}
break;
2021-02-12 20:54:11 +01:00
// Handle ITEM5 effects (Change Def/SpDef/SpAtk/Speed EVs, PP Max, and friendship changes)
2018-02-09 18:46:00 +01:00
case 5:
2021-02-12 20:54:11 +01:00
effectFlags = itemEffect[i];
temp1 = 0;
// Loop through and try each of the ITEM5 effects
while (effectFlags != 0)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
if (effectFlags & 1)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
switch (temp1)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
case 0: // ITEM5_EV_DEF
case 1: // ITEM5_EV_SPEED
case 2: // ITEM5_EV_SPDEF
case 3: // ITEM5_EV_SPATK
2018-02-09 18:46:00 +01:00
evCount = GetMonEVCount(mon);
2021-02-12 20:54:11 +01:00
temp2 = itemEffect[itemEffectParam];
dataSigned = GetMonData(mon, sGetMonDataEVConstants[temp1 + 2], NULL);
evChange = temp2;
if (evChange > 0) // Increasing EV
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
// Has EV increase limit already been reached?
2018-02-09 18:46:00 +01:00
if (evCount >= MAX_TOTAL_EVS)
return TRUE;
if (dataSigned >= EV_ITEM_RAISE_LIMIT)
2018-02-09 18:46:00 +01:00
break;
2021-02-12 20:54:11 +01:00
// Limit the increase
if (dataSigned + evChange > EV_ITEM_RAISE_LIMIT)
temp2 = EV_ITEM_RAISE_LIMIT - (dataSigned + evChange) + evChange;
2018-02-09 18:46:00 +01:00
else
2021-02-12 20:54:11 +01:00
temp2 = evChange;
2018-02-09 18:46:00 +01:00
2021-02-12 20:54:11 +01:00
if (evCount + temp2 > MAX_TOTAL_EVS)
temp2 += MAX_TOTAL_EVS - (evCount + temp2);
2018-02-09 18:46:00 +01:00
2021-02-12 20:54:11 +01:00
dataSigned += temp2;
2018-02-09 18:46:00 +01:00
}
2021-02-12 20:54:11 +01:00
else // Decreasing EV
2018-02-09 18:46:00 +01:00
{
if (dataSigned == 0)
{
2021-02-12 20:54:11 +01:00
// No EVs to lose, but make sure friendship updates anyway
friendshipOnly = TRUE;
itemEffectParam++;
2018-02-09 18:46:00 +01:00
break;
}
2021-02-12 20:54:11 +01:00
dataSigned += evChange;
2018-02-09 18:46:00 +01:00
if (dataSigned < 0)
dataSigned = 0;
}
2021-02-12 20:54:11 +01:00
// Update EVs and stats
SetMonData(mon, sGetMonDataEVConstants[temp1 + 2], &dataSigned);
2018-02-09 18:46:00 +01:00
CalculateMonStats(mon);
retVal = FALSE;
2021-02-12 20:54:11 +01:00
itemEffectParam++;
2018-02-09 18:46:00 +01:00
break;
2021-02-12 20:54:11 +01:00
case 4: // ITEM5_PP_MAX
dataUnsigned = (GetMonData(mon, MON_DATA_PP_BONUSES, NULL) & gPPUpGetMask[moveIndex]) >> (moveIndex * 2);
2021-02-12 20:54:11 +01:00
temp2 = CalculatePPWithBonus(GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex);
if (dataUnsigned < 3 && temp2 > 4)
2018-02-09 18:46:00 +01:00
{
dataUnsigned = GetMonData(mon, MON_DATA_PP_BONUSES, NULL);
dataUnsigned &= gPPUpSetMask[moveIndex];
dataUnsigned += gPPUpAddMask[moveIndex] * 3;
2018-02-09 18:46:00 +01:00
SetMonData(mon, MON_DATA_PP_BONUSES, &dataUnsigned);
2021-02-12 20:54:11 +01:00
dataUnsigned = CalculatePPWithBonus(GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL), dataUnsigned, moveIndex) - temp2;
2018-02-09 18:46:00 +01:00
dataUnsigned = GetMonData(mon, MON_DATA_PP1 + moveIndex, NULL) + dataUnsigned;
SetMonData(mon, MON_DATA_PP1 + moveIndex, &dataUnsigned);
retVal = FALSE;
}
break;
2021-02-12 20:54:11 +01:00
case 5: // ITEM5_FRIENDSHIP_LOW
// Changes to friendship are given differently depending on
// how much friendship the Pokémon already has.
// In general, Pokémon with lower friendship receive more,
// and Pokémon with higher friendship receive less.
if (GetMonData(mon, MON_DATA_FRIENDSHIP, NULL) < 100)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
UPDATE_FRIENDSHIP_FROM_ITEM;
2018-02-09 18:46:00 +01:00
}
2021-02-12 20:54:11 +01:00
itemEffectParam++;
2018-02-09 18:46:00 +01:00
break;
2021-02-12 20:54:11 +01:00
case 6: // ITEM5_FRIENDSHIP_MID
if (GetMonData(mon, MON_DATA_FRIENDSHIP, NULL) >= 100 && GetMonData(mon, MON_DATA_FRIENDSHIP, NULL) < 200)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
UPDATE_FRIENDSHIP_FROM_ITEM;
2018-02-09 18:46:00 +01:00
}
2021-02-12 20:54:11 +01:00
itemEffectParam++;
2018-02-09 18:46:00 +01:00
break;
2021-02-12 20:54:11 +01:00
case 7: // ITEM5_FRIENDSHIP_HIGH
if (GetMonData(mon, MON_DATA_FRIENDSHIP, NULL) >= 200)
2018-02-09 18:46:00 +01:00
{
2021-02-12 20:54:11 +01:00
UPDATE_FRIENDSHIP_FROM_ITEM;
2018-02-09 18:46:00 +01:00
}
2021-02-12 20:54:11 +01:00
itemEffectParam++;
2018-02-09 18:46:00 +01:00
break;
}
}
2021-02-12 20:54:11 +01:00
temp1++;
effectFlags >>= 1;
2018-02-09 18:46:00 +01:00
}
break;
}
}
return retVal;
}
2018-02-11 17:35:01 +01:00
bool8 HealStatusConditions(struct Pokemon *mon, u32 battlePartyId, u32 healMask, u8 battlerId)
2018-02-10 02:06:32 +01:00
{
u32 status = GetMonData(mon, MON_DATA_STATUS, 0);
if (status & healMask)
{
status &= ~healMask;
SetMonData(mon, MON_DATA_STATUS, &status);
2018-02-11 17:35:01 +01:00
if (gMain.inBattle && battlerId != MAX_BATTLERS_COUNT)
gBattleMons[battlerId].status1 &= ~healMask;
2018-02-10 02:06:32 +01:00
return FALSE;
}
else
{
return TRUE;
}
}
u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit)
{
const u8 *temp;
const u8 *itemEffect;
u8 offset;
int i;
u8 j;
2021-02-12 20:54:11 +01:00
u8 effectFlags;
2018-02-10 02:06:32 +01:00
2021-02-12 20:54:11 +01:00
offset = ITEM_EFFECT_ARG_START;
2018-02-10 02:06:32 +01:00
2019-04-14 17:20:26 +02:00
temp = gItemEffectTable[itemId - ITEM_POTION];
2018-02-10 02:06:32 +01:00
if (!temp && itemId != ITEM_ENIGMA_BERRY)
return 0;
if (itemId == ITEM_ENIGMA_BERRY)
{
temp = gEnigmaBerries[gActiveBattler].itemEffect;
}
itemEffect = temp;
2021-02-12 20:54:11 +01:00
for (i = 0; i < ITEM_EFFECT_ARG_START; i++)
2018-02-10 02:06:32 +01:00
{
switch (i)
{
case 0:
case 1:
case 2:
case 3:
if (i == effectByte)
return 0;
break;
case 4:
2021-02-12 20:54:11 +01:00
effectFlags = itemEffect[4];
if (effectFlags & ITEM4_PP_UP)
effectFlags &= ~(ITEM4_PP_UP);
2018-02-10 02:06:32 +01:00
j = 0;
2021-02-12 20:54:11 +01:00
while (effectFlags)
2018-02-10 02:06:32 +01:00
{
2021-02-12 20:54:11 +01:00
if (effectFlags & 1)
2018-02-10 02:06:32 +01:00
{
switch (j)
{
2021-02-12 20:54:11 +01:00
case 2: // ITEM4_HEAL_HP
if (effectFlags & (ITEM4_REVIVE >> 2))
effectFlags &= ~(ITEM4_REVIVE >> 2);
// fallthrough
case 0: // ITEM4_EV_HP
if (i == effectByte && (effectFlags & effectBit))
2018-02-10 02:06:32 +01:00
return offset;
offset++;
break;
2021-02-12 20:54:11 +01:00
case 1: // ITEM4_EV_ATK
if (i == effectByte && (effectFlags & effectBit))
2018-02-10 02:06:32 +01:00
return offset;
offset++;
break;
2021-02-12 20:54:11 +01:00
case 3: // ITEM4_HEAL_PP
if (i == effectByte && (effectFlags & effectBit))
2018-02-10 02:06:32 +01:00
return offset;
offset++;
break;
2021-02-12 20:54:11 +01:00
case 7: // ITEM4_EVO_STONE
2018-02-10 02:06:32 +01:00
if (i == effectByte)
return 0;
break;
}
}
j++;
2021-02-12 20:54:11 +01:00
effectFlags >>= 1;
2018-02-10 02:06:32 +01:00
if (i == effectByte)
effectBit >>= 1;
}
break;
case 5:
2021-02-12 20:54:11 +01:00
effectFlags = itemEffect[5];
2018-02-10 02:06:32 +01:00
j = 0;
2021-02-12 20:54:11 +01:00
while (effectFlags)
2018-02-10 02:06:32 +01:00
{
2021-02-12 20:54:11 +01:00
if (effectFlags & 1)
2018-02-10 02:06:32 +01:00
{
switch (j)
{
2021-02-12 20:54:11 +01:00
case 0: // ITEM5_EV_DEF
case 1: // ITEM5_EV_SPEED
case 2: // ITEM5_EV_SPDEF
case 3: // ITEM5_EV_SPATK
case 4: // ITEM5_PP_MAX
case 5: // ITEM5_FRIENDSHIP_LOW
case 6: // ITEM5_FRIENDSHIP_MID
if (i == effectByte && (effectFlags & effectBit))
2018-02-10 02:06:32 +01:00
return offset;
offset++;
break;
2021-02-12 20:54:11 +01:00
case 7: // ITEM5_FRIENDSHIP_HIGH
2018-02-10 02:06:32 +01:00
if (i == effectByte)
return 0;
break;
}
}
j++;
2021-02-12 20:54:11 +01:00
effectFlags >>= 1;
2018-02-10 02:06:32 +01:00
if (i == effectByte)
effectBit >>= 1;
}
break;
}
}
return offset;
}
2019-12-22 01:01:38 +01:00
static void BufferStatRoseMessage(s32 arg0)
2018-02-10 02:06:32 +01:00
{
gBattlerTarget = gBattlerInMenuId;
2019-12-22 01:01:38 +01:00
StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[arg0]]);
2018-02-10 02:06:32 +01:00
StringCopy(gBattleTextBuff2, gText_StatRose);
BattleStringExpandPlaceholdersToDisplayedString(gText_DefendersStatRose);
2018-02-10 02:06:32 +01:00
}
2019-12-22 01:01:38 +01:00
u8 *UseStatIncreaseItem(u16 itemId)
2018-02-10 02:06:32 +01:00
{
int i;
const u8 *itemEffect;
if (itemId == ITEM_ENIGMA_BERRY)
{
if (gMain.inBattle)
itemEffect = gEnigmaBerries[gBattlerInMenuId].itemEffect;
2018-02-10 02:06:32 +01:00
else
itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
}
else
{
2019-04-14 17:20:26 +02:00
itemEffect = gItemEffectTable[itemId - ITEM_POTION];
2018-02-10 02:06:32 +01:00
}
gPotentialItemEffectBattler = gBattlerInMenuId;
2018-02-10 02:06:32 +01:00
for (i = 0; i < 3; i++)
{
2019-12-22 01:01:38 +01:00
if (itemEffect[i] & (ITEM0_X_ATTACK | ITEM1_X_SPEED | ITEM2_X_SPATK))
BufferStatRoseMessage(i * 2);
if (itemEffect[i] & (ITEM0_DIRE_HIT | ITEM1_X_DEFEND | ITEM2_X_ACCURACY))
2018-02-10 02:06:32 +01:00
{
2019-12-22 01:01:38 +01:00
if (i != 0) // Dire Hit is the only ITEM0 above
2018-02-10 02:06:32 +01:00
{
2019-12-22 01:01:38 +01:00
BufferStatRoseMessage(i * 2 + 1);
2018-02-10 02:06:32 +01:00
}
else
{
gBattlerAttacker = gBattlerInMenuId;
2018-02-10 02:06:32 +01:00
BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnGettingPumped);
}
}
}
2019-12-22 01:01:38 +01:00
if (itemEffect[3] & ITEM3_GUARD_SPEC)
2018-02-10 02:06:32 +01:00
{
gBattlerAttacker = gBattlerInMenuId;
2018-02-10 02:06:32 +01:00
BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnShroudedInMist);
}
return gDisplayedStringBattle;
}
u8 GetNature(struct Pokemon *mon)
{
2020-07-17 02:12:12 +02:00
return GetMonData(mon, MON_DATA_PERSONALITY, 0) % NUM_NATURES;
2018-02-10 02:06:32 +01:00
}
u8 GetNatureFromPersonality(u32 personality)
{
2020-07-17 02:12:12 +02:00
return personality % NUM_NATURES;
2018-02-10 02:06:32 +01:00
}
u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, u16 tradePartnerSpecies)
2018-02-10 02:06:32 +01:00
{
2019-04-03 22:19:18 +02:00
int i, j;
2018-02-10 02:06:32 +01:00
u16 targetSpecies = 0;
u16 species = GetMonData(mon, MON_DATA_SPECIES, 0);
u16 heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
u8 level;
u16 friendship;
u8 beauty = GetMonData(mon, MON_DATA_BEAUTY, 0);
u16 upperPersonality = personality >> 16;
u8 holdEffect;
u16 currentMap;
2018-02-10 02:06:32 +01:00
if (heldItem == ITEM_ENIGMA_BERRY)
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
else
holdEffect = ItemId_GetHoldEffect(heldItem);
2021-02-12 20:54:11 +01:00
// Prevent evolution with Everstone, unless we're just viewing the party menu with an evolution item
if (holdEffect == HOLD_EFFECT_PREVENT_EVOLVE && mode != EVO_MODE_ITEM_CHECK)
2018-07-16 20:47:30 +02:00
return SPECIES_NONE;
2018-02-10 02:06:32 +01:00
2021-02-12 20:54:11 +01:00
switch (mode)
2018-02-10 02:06:32 +01:00
{
2021-02-12 20:54:11 +01:00
case EVO_MODE_NORMAL:
2018-02-10 02:06:32 +01:00
level = GetMonData(mon, MON_DATA_LEVEL, 0);
friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, 0);
2018-07-16 20:47:30 +02:00
for (i = 0; i < EVOS_PER_MON; i++)
2018-02-10 02:06:32 +01:00
{
switch (gEvolutionTable[species][i].method)
{
case EVO_FRIENDSHIP:
if (friendship >= 220)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_FRIENDSHIP_DAY:
RtcCalcLocalTime();
if (gLocalTime.hours >= 12 && gLocalTime.hours < 24 && friendship >= 220)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
2019-04-03 22:19:18 +02:00
case EVO_LEVEL_DAY:
RtcCalcLocalTime();
if (gLocalTime.hours >= 12 && gLocalTime.hours < 24 && gEvolutionTable[species][i].param <= level)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
2018-02-10 02:06:32 +01:00
case EVO_FRIENDSHIP_NIGHT:
RtcCalcLocalTime();
if (gLocalTime.hours >= 0 && gLocalTime.hours < 12 && friendship >= 220)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
2019-04-03 22:19:18 +02:00
case EVO_LEVEL_NIGHT:
RtcCalcLocalTime();
if (gLocalTime.hours >= 0 && gLocalTime.hours < 12 && gEvolutionTable[species][i].param <= level)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_ITEM_HOLD_NIGHT:
RtcCalcLocalTime();
if (gLocalTime.hours >= 0 && gLocalTime.hours < 12 && heldItem == gEvolutionTable[species][i].param)
{
heldItem = 0;
SetMonData(mon, MON_DATA_HELD_ITEM, &heldItem);
targetSpecies = gEvolutionTable[species][i].targetSpecies;
}
break;
case EVO_ITEM_HOLD_DAY:
RtcCalcLocalTime();
if (gLocalTime.hours >= 12 && gLocalTime.hours < 24 && heldItem == gEvolutionTable[species][i].param)
{
heldItem = 0;
SetMonData(mon, MON_DATA_HELD_ITEM, &heldItem);
targetSpecies = gEvolutionTable[species][i].targetSpecies;
}
break;
case EVO_LEVEL_DUSK:
RtcCalcLocalTime();
if (gLocalTime.hours >= 17 && gLocalTime.hours < 18 && gEvolutionTable[species][i].param <= level)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
2018-02-10 02:06:32 +01:00
case EVO_LEVEL:
if (gEvolutionTable[species][i].param <= level)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
2019-04-03 22:19:18 +02:00
case EVO_LEVEL_FEMALE:
if (gEvolutionTable[species][i].param <= level && GetMonGender(mon) == MON_FEMALE)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_MALE:
if (gEvolutionTable[species][i].param <= level && GetMonGender(mon) == MON_MALE)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
2018-02-10 02:06:32 +01:00
case EVO_LEVEL_ATK_GT_DEF:
if (gEvolutionTable[species][i].param <= level)
if (GetMonData(mon, MON_DATA_ATK, 0) > GetMonData(mon, MON_DATA_DEF, 0))
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_ATK_EQ_DEF:
if (gEvolutionTable[species][i].param <= level)
if (GetMonData(mon, MON_DATA_ATK, 0) == GetMonData(mon, MON_DATA_DEF, 0))
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_ATK_LT_DEF:
if (gEvolutionTable[species][i].param <= level)
if (GetMonData(mon, MON_DATA_ATK, 0) < GetMonData(mon, MON_DATA_DEF, 0))
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_SILCOON:
if (gEvolutionTable[species][i].param <= level && (upperPersonality % 10) <= 4)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_CASCOON:
if (gEvolutionTable[species][i].param <= level && (upperPersonality % 10) > 4)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL_NINJASK:
if (gEvolutionTable[species][i].param <= level)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_BEAUTY:
if (gEvolutionTable[species][i].param <= beauty)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
2019-04-03 22:19:18 +02:00
case EVO_MOVE:
if (MonKnowsMove(mon, gEvolutionTable[species][i].param))
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_MOVE_TYPE:
for (j = 0; j < 4; j++)
{
if (gBattleMoves[GetMonData(mon, MON_DATA_MOVE1 + j, NULL)].type == gEvolutionTable[species][i].param)
{
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
}
}
break;
case EVO_SPECIFIC_MON_IN_PARTY:
for (j = 0; j < PARTY_SIZE; j++)
{
if (GetMonData(&gPlayerParty[j], MON_DATA_SPECIES, NULL) == gEvolutionTable[species][i].param)
{
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
}
}
break;
case EVO_LEVEL_DARK_TYPE_MON_IN_PARTY:
2019-04-03 22:19:18 +02:00
if (gEvolutionTable[species][i].param <= level)
{
for (j = 0; j < PARTY_SIZE; j++)
{
2021-05-11 01:48:55 +02:00
u16 currSpecies = GetMonData(&gPlayerParty[j], MON_DATA_SPECIES, NULL);
if (gBaseStats[currSpecies].type1 == TYPE_DARK
|| gBaseStats[currSpecies].type2 == TYPE_DARK)
2019-04-03 22:19:18 +02:00
{
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
}
}
}
break;
case EVO_LEVEL_RAIN:
j = GetCurrentWeather();
2019-12-09 08:29:10 +01:00
if (j == WEATHER_RAIN || j == WEATHER_RAIN_THUNDERSTORM || j == WEATHER_DOWNPOUR)
2019-04-03 22:19:18 +02:00
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_MAPSEC:
if (gMapHeader.regionMapSectionId == gEvolutionTable[species][i].param)
2019-04-03 22:19:18 +02:00
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_SPECIFIC_MAP:
currentMap = ((gSaveBlock1Ptr->location.mapGroup) << 8 | gSaveBlock1Ptr->location.mapNum);
if (currentMap == gEvolutionTable[species][i].param)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
2018-02-10 02:06:32 +01:00
}
}
break;
2021-02-12 20:54:11 +01:00
case EVO_MODE_TRADE:
2018-07-16 20:47:30 +02:00
for (i = 0; i < EVOS_PER_MON; i++)
2018-02-10 02:06:32 +01:00
{
switch (gEvolutionTable[species][i].method)
{
case EVO_TRADE:
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_TRADE_ITEM:
if (gEvolutionTable[species][i].param == heldItem)
{
heldItem = 0;
2019-04-03 22:00:15 +02:00
SetMonData(mon, MON_DATA_HELD_ITEM, &heldItem);
2018-02-10 02:06:32 +01:00
targetSpecies = gEvolutionTable[species][i].targetSpecies;
}
break;
case EVO_TRADE_SPECIFIC_MON:
if (gEvolutionTable[species][i].param == tradePartnerSpecies)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
2018-02-10 02:06:32 +01:00
}
}
break;
2021-02-12 20:54:11 +01:00
case EVO_MODE_ITEM_USE:
case EVO_MODE_ITEM_CHECK:
2018-07-16 20:47:30 +02:00
for (i = 0; i < EVOS_PER_MON; i++)
2018-02-10 02:06:32 +01:00
{
2019-04-03 22:19:18 +02:00
switch (gEvolutionTable[species][i].method)
2018-02-10 02:06:32 +01:00
{
2019-04-03 22:19:18 +02:00
case EVO_ITEM:
if (gEvolutionTable[species][i].param == evolutionItem)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_ITEM_FEMALE:
if (GetMonGender(mon) == MON_FEMALE && gEvolutionTable[species][i].param == evolutionItem)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_ITEM_MALE:
if (GetMonGender(mon) == MON_MALE && gEvolutionTable[species][i].param == evolutionItem)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
2018-02-10 02:06:32 +01:00
break;
}
}
break;
}
return targetSpecies;
}
u16 HoennPokedexNumToSpecies(u16 hoennNum)
{
u16 species;
if (!hoennNum)
return 0;
species = 0;
while (species < (NUM_SPECIES - 1) && gSpeciesToHoennPokedexNum[species] != hoennNum)
2018-02-10 02:06:32 +01:00
species++;
if (species == NUM_SPECIES - 1)
2018-02-10 02:06:32 +01:00
return 0;
return species + 1;
}
u16 NationalPokedexNumToSpecies(u16 nationalNum)
{
u16 species;
if (!nationalNum)
return 0;
species = 0;
while (species < (NUM_SPECIES - 1) && gSpeciesToNationalPokedexNum[species] != nationalNum)
2018-02-10 02:06:32 +01:00
species++;
if (species == NUM_SPECIES - 1)
2018-02-10 02:06:32 +01:00
return 0;
return species + 1;
}
u16 NationalToHoennOrder(u16 nationalNum)
{
u16 hoennNum;
if (!nationalNum)
return 0;
hoennNum = 0;
2019-04-02 21:22:16 +02:00
while (hoennNum < (HOENN_DEX_COUNT - 1) && gHoennToNationalOrder[hoennNum] != nationalNum)
2018-02-10 02:06:32 +01:00
hoennNum++;
2019-04-02 21:22:16 +02:00
if (hoennNum >= HOENN_DEX_COUNT - 1)
2018-02-10 02:06:32 +01:00
return 0;
return hoennNum + 1;
}
u16 SpeciesToNationalPokedexNum(u16 species)
{
if (!species)
return 0;
return gSpeciesToNationalPokedexNum[species - 1];
}
u16 SpeciesToHoennPokedexNum(u16 species)
{
if (!species)
return 0;
return gSpeciesToHoennPokedexNum[species - 1];
}
u16 HoennToNationalOrder(u16 hoennNum)
{
2019-04-02 21:22:16 +02:00
if (!hoennNum || hoennNum >= HOENN_DEX_COUNT)
2018-02-10 02:06:32 +01:00
return 0;
return gHoennToNationalOrder[hoennNum - 1];
}
2021-01-23 05:22:37 +01:00
#define DRAW_SPINDA_SPOTS \
{ \
int i; \
for (i = 0; i < 4; i++) \
{ \
int j; \
u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8); \
u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8); \
\
for (j = 0; j < 16; j++) \
{ \
int k; \
s32 row = gSpindaSpotGraphics[i].image[j]; \
\
for (k = x; k < x + 16; k++) \
{ \
u8 *val = dest + ((k / 8) * 32) + \
((k % 8) / 2) + \
((y >> 3) << 8) + \
((y & 7) << 2); \
\
if (row & 1) \
{ \
if (k & 1) \
{ \
if ((u8)((*val & 0xF0) - 0x10) <= 0x20) \
*val += 0x40; \
} \
else \
{ \
if ((u8)((*val & 0xF) - 0x01) <= 0x02) \
*val += 0x04; \
} \
} \
\
row >>= 1; \
} \
\
y++; \
} \
\
personality >>= 8; \
} \
}
static void DrawSpindaSpotsUnused(u16 species, u32 personality, u8 *dest)
2018-02-10 02:06:32 +01:00
{
if (species == SPECIES_SPINDA
&& dest != gMonSpritesGfxPtr->sprites.ptr[0]
&& dest != gMonSpritesGfxPtr->sprites.ptr[2])
2021-01-23 05:22:37 +01:00
DRAW_SPINDA_SPOTS;
2018-02-10 02:06:32 +01:00
}
2021-01-23 05:22:37 +01:00
void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, bool8 isFrontPic)
2018-02-10 02:06:32 +01:00
{
2021-01-23 05:22:37 +01:00
if (species == SPECIES_SPINDA && isFrontPic)
DRAW_SPINDA_SPOTS;
2018-02-10 02:06:32 +01:00
}
void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies)
{
u8 language;
GetMonData(mon, MON_DATA_NICKNAME, gStringVar1);
language = GetMonData(mon, MON_DATA_LANGUAGE, &language);
if (language == GAME_LANGUAGE && !StringCompare(gSpeciesNames[oldSpecies], gStringVar1))
SetMonData(mon, MON_DATA_NICKNAME, gSpeciesNames[newSpecies]);
}
2019-10-31 19:11:55 +01:00
// The below two functions determine which side of a multi battle the trainer battles on
// 0 is the left (top in party menu), 1 is right (bottom in party menu)
u8 GetPlayerFlankId(void)
2018-02-10 02:06:32 +01:00
{
2019-10-31 19:11:55 +01:00
u8 flankId = 0;
2018-07-22 12:49:49 +02:00
switch (gLinkPlayers[GetMultiplayerId()].id)
2018-02-10 02:06:32 +01:00
{
case 0:
case 3:
2019-10-31 19:11:55 +01:00
flankId = 0;
2018-02-10 02:06:32 +01:00
break;
case 1:
case 2:
2019-10-31 19:11:55 +01:00
flankId = 1;
2018-02-10 02:06:32 +01:00
break;
}
2019-10-31 19:11:55 +01:00
return flankId;
2018-02-10 02:06:32 +01:00
}
2018-07-01 11:15:42 +02:00
u16 GetLinkTrainerFlankId(u8 linkPlayerId)
2018-02-10 02:06:32 +01:00
{
2018-07-01 11:15:42 +02:00
u16 flankId = 0;
2018-07-22 13:14:58 +02:00
switch (gLinkPlayers[linkPlayerId].id)
2018-02-10 02:06:32 +01:00
{
case 0:
case 3:
2018-07-01 11:15:42 +02:00
flankId = 0;
2018-02-10 02:06:32 +01:00
break;
case 1:
case 2:
2018-07-01 11:15:42 +02:00
flankId = 1;
2018-02-10 02:06:32 +01:00
break;
}
2018-07-01 11:15:42 +02:00
return flankId;
2018-02-10 02:06:32 +01:00
}
s32 GetBattlerMultiplayerId(u16 a1)
{
s32 id;
for (id = 0; id < MAX_LINK_PLAYERS; id++)
2018-07-22 12:49:49 +02:00
if (gLinkPlayers[id].id == a1)
2018-02-10 02:06:32 +01:00
break;
return id;
}
u8 GetTrainerEncounterMusicId(u16 trainerOpponentId)
{
if (InBattlePyramid())
2019-02-07 18:37:28 +01:00
return GetBattlePyramindTrainerEncounterMusicId(trainerOpponentId);
2019-10-07 02:04:30 +02:00
else if (InTrainerHillChallenge())
2019-01-13 20:50:08 +01:00
return GetTrainerEncounterMusicIdInTrainerHill(trainerOpponentId);
else
return TRAINER_ENCOUNTER_MUSIC(trainerOpponentId);
2018-02-10 02:06:32 +01:00
}
u16 ModifyStatByNature(u8 nature, u16 n, u8 statIndex)
{
2020-09-05 17:47:24 +02:00
u16 retVal;
// Don't modify HP, Accuracy, or Evasion by nature
2020-07-17 02:12:12 +02:00
if (statIndex <= STAT_HP || statIndex > NUM_NATURE_STATS)
2018-02-10 02:06:32 +01:00
{
2020-09-05 17:47:24 +02:00
return n;
2018-02-10 02:06:32 +01:00
}
switch (gNatureStatTable[nature][statIndex - 1])
{
case 1:
2020-09-06 21:16:40 +02:00
retVal = n * 110;
retVal /= 100;
2020-09-05 17:47:24 +02:00
break;
2018-02-10 02:06:32 +01:00
case -1:
2020-09-06 21:16:40 +02:00
retVal = n * 90;
retVal /= 100;
2020-09-05 17:47:24 +02:00
break;
default:
retVal = n;
break;
2018-02-10 02:06:32 +01:00
}
2020-09-05 17:47:24 +02:00
return retVal;
2018-02-10 02:06:32 +01:00
}
2020-02-02 19:28:54 +01:00
#define IS_LEAGUE_BATTLE \
((gBattleTypeFlags & BATTLE_TYPE_TRAINER) \
&& (gTrainers[gTrainerBattleOpponent_A].trainerClass == TRAINER_CLASS_ELITE_FOUR \
|| gTrainers[gTrainerBattleOpponent_A].trainerClass == TRAINER_CLASS_LEADER \
|| gTrainers[gTrainerBattleOpponent_A].trainerClass == TRAINER_CLASS_CHAMPION)) \
2018-02-10 02:06:32 +01:00
void AdjustFriendship(struct Pokemon *mon, u8 event)
{
u16 species, heldItem;
u8 holdEffect;
2020-02-02 19:28:54 +01:00
if (ShouldSkipFriendshipChange())
2018-02-10 02:06:32 +01:00
return;
species = GetMonData(mon, MON_DATA_SPECIES2, 0);
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
if (heldItem == ITEM_ENIGMA_BERRY)
{
if (gMain.inBattle)
holdEffect = gEnigmaBerries[0].holdEffect;
else
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
}
else
{
holdEffect = ItemId_GetHoldEffect(heldItem);
}
if (species && species != SPECIES_EGG)
{
u8 friendshipLevel = 0;
s16 friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, 0);
2020-02-02 19:28:54 +01:00
2018-02-10 02:06:32 +01:00
if (friendship > 99)
friendshipLevel++;
if (friendship > 199)
friendshipLevel++;
2020-02-02 19:28:54 +01:00
2020-08-28 03:25:02 +02:00
if ((event != FRIENDSHIP_EVENT_WALKING || !(Random() & 1))
2020-02-02 19:28:54 +01:00
&& (event != FRIENDSHIP_EVENT_LEAGUE_BATTLE || IS_LEAGUE_BATTLE))
2018-02-10 02:06:32 +01:00
{
2020-02-02 19:28:54 +01:00
s8 mod = sFriendshipEventModifiers[event][friendshipLevel];
2021-03-25 18:26:22 +01:00
if (mod > 0 && holdEffect == HOLD_EFFECT_FRIENDSHIP_UP)
2018-02-10 02:06:32 +01:00
mod = (150 * mod) / 100;
friendship += mod;
if (mod > 0)
{
if (GetMonData(mon, MON_DATA_POKEBALL, 0) == ITEM_LUXURY_BALL)
friendship++;
2018-12-27 23:30:47 +01:00
if (GetMonData(mon, MON_DATA_MET_LOCATION, 0) == GetCurrentRegionMapSectionId())
2018-02-10 02:06:32 +01:00
friendship++;
}
if (friendship < 0)
friendship = 0;
if (friendship > MAX_FRIENDSHIP)
friendship = MAX_FRIENDSHIP;
2018-02-10 02:06:32 +01:00
SetMonData(mon, MON_DATA_FRIENDSHIP, &friendship);
}
}
}
void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies)
{
u8 evs[NUM_STATS];
u16 evIncrease = 0;
u16 totalEVs = 0;
u16 heldItem;
u8 holdEffect;
2020-07-16 09:58:16 +02:00
int i, multiplier;
2018-02-10 02:06:32 +01:00
for (i = 0; i < NUM_STATS; i++)
{
evs[i] = GetMonData(mon, MON_DATA_HP_EV + i, 0);
totalEVs += evs[i];
}
for (i = 0; i < NUM_STATS; i++)
{
if (totalEVs >= MAX_TOTAL_EVS)
break;
2020-08-28 03:25:02 +02:00
2020-07-16 09:58:16 +02:00
if (CheckPartyHasHadPokerus(mon, 0))
2018-02-10 02:06:32 +01:00
multiplier = 2;
else
multiplier = 1;
switch (i)
{
2020-07-16 09:58:16 +02:00
case STAT_HP:
2018-02-10 02:06:32 +01:00
evIncrease = gBaseStats[defeatedSpecies].evYield_HP * multiplier;
break;
2020-07-16 09:58:16 +02:00
case STAT_ATK:
2018-02-10 02:06:32 +01:00
evIncrease = gBaseStats[defeatedSpecies].evYield_Attack * multiplier;
break;
2020-07-16 09:58:16 +02:00
case STAT_DEF:
2018-02-10 02:06:32 +01:00
evIncrease = gBaseStats[defeatedSpecies].evYield_Defense * multiplier;
break;
2020-07-16 09:58:16 +02:00
case STAT_SPEED:
2018-02-10 02:06:32 +01:00
evIncrease = gBaseStats[defeatedSpecies].evYield_Speed * multiplier;
break;
2020-07-16 09:58:16 +02:00
case STAT_SPATK:
2018-02-10 02:06:32 +01:00
evIncrease = gBaseStats[defeatedSpecies].evYield_SpAttack * multiplier;
break;
2020-07-16 09:58:16 +02:00
case STAT_SPDEF:
2018-02-10 02:06:32 +01:00
evIncrease = gBaseStats[defeatedSpecies].evYield_SpDefense * multiplier;
break;
}
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
if (heldItem == ITEM_ENIGMA_BERRY)
{
if (gMain.inBattle)
holdEffect = gEnigmaBerries[0].holdEffect;
else
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
}
else
{
holdEffect = ItemId_GetHoldEffect(heldItem);
}
if (holdEffect == HOLD_EFFECT_MACHO_BRACE)
evIncrease *= 2;
if (totalEVs + (s16)evIncrease > MAX_TOTAL_EVS)
evIncrease = ((s16)evIncrease + MAX_TOTAL_EVS) - (totalEVs + evIncrease);
2020-08-28 03:25:02 +02:00
if (evs[i] + (s16)evIncrease > MAX_PER_STAT_EVS)
2018-02-10 02:06:32 +01:00
{
2020-08-28 03:25:02 +02:00
int val1 = (s16)evIncrease + MAX_PER_STAT_EVS;
2018-02-10 02:06:32 +01:00
int val2 = evs[i] + evIncrease;
evIncrease = val1 - val2;
}
evs[i] += evIncrease;
totalEVs += evIncrease;
SetMonData(mon, MON_DATA_HP_EV + i, &evs[i]);
}
}
u16 GetMonEVCount(struct Pokemon *mon)
{
int i;
u16 count = 0;
for (i = 0; i < NUM_STATS; i++)
count += GetMonData(mon, MON_DATA_HP_EV + i, 0);
return count;
}
void RandomlyGivePartyPokerus(struct Pokemon *party)
{
u16 rnd = Random();
if (rnd == 0x4000 || rnd == 0x8000 || rnd == 0xC000)
{
struct Pokemon *mon;
do
{
do
{
rnd = Random() % PARTY_SIZE;
mon = &party[rnd];
}
while (!GetMonData(mon, MON_DATA_SPECIES, 0));
}
while (GetMonData(mon, MON_DATA_IS_EGG, 0));
if (!(CheckPartyHasHadPokerus(party, gBitTable[rnd])))
{
u8 rnd2;
do
{
rnd2 = Random();
}
while ((rnd2 & 0x7) == 0);
if (rnd2 & 0xF0)
rnd2 &= 0x7;
rnd2 |= (rnd2 << 4);
rnd2 &= 0xF3;
rnd2++;
SetMonData(&party[rnd], MON_DATA_POKERUS, &rnd2);
}
}
}
u8 CheckPartyPokerus(struct Pokemon *party, u8 selection)
{
u8 retVal;
int partyIndex = 0;
unsigned curBit = 1;
retVal = 0;
if (selection)
{
do
{
if ((selection & 1) && (GetMonData(&party[partyIndex], MON_DATA_POKERUS, 0) & 0xF))
retVal |= curBit;
partyIndex++;
curBit <<= 1;
selection >>= 1;
}
while (selection);
}
else if (GetMonData(&party[0], MON_DATA_POKERUS, 0) & 0xF)
{
retVal = 1;
}
return retVal;
}
u8 CheckPartyHasHadPokerus(struct Pokemon *party, u8 selection)
{
u8 retVal;
int partyIndex = 0;
unsigned curBit = 1;
retVal = 0;
if (selection)
{
do
{
if ((selection & 1) && GetMonData(&party[partyIndex], MON_DATA_POKERUS, 0))
retVal |= curBit;
partyIndex++;
curBit <<= 1;
selection >>= 1;
}
while (selection);
}
else if (GetMonData(&party[0], MON_DATA_POKERUS, 0))
{
retVal = 1;
}
return retVal;
}
void UpdatePartyPokerusTime(u16 days)
{
int i;
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, 0))
{
u8 pokerus = GetMonData(&gPlayerParty[i], MON_DATA_POKERUS, 0);
if (pokerus & 0xF)
{
if ((pokerus & 0xF) < days || days > 4)
pokerus &= 0xF0;
else
pokerus -= days;
if (pokerus == 0)
pokerus = 0x10;
SetMonData(&gPlayerParty[i], MON_DATA_POKERUS, &pokerus);
}
}
}
}
void PartySpreadPokerus(struct Pokemon *party)
{
if ((Random() % 3) == 0)
{
int i;
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_SPECIES, 0))
{
u8 pokerus = GetMonData(&party[i], MON_DATA_POKERUS, 0);
u8 curPokerus = pokerus;
if (pokerus)
{
if (pokerus & 0xF)
{
// Spread to adjacent party members.
2018-02-10 02:06:32 +01:00
if (i != 0 && !(GetMonData(&party[i - 1], MON_DATA_POKERUS, 0) & 0xF0))
SetMonData(&party[i - 1], MON_DATA_POKERUS, &curPokerus);
if (i != (PARTY_SIZE - 1) && !(GetMonData(&party[i + 1], MON_DATA_POKERUS, 0) & 0xF0))
{
SetMonData(&party[i + 1], MON_DATA_POKERUS, &curPokerus);
i++;
}
}
}
}
}
}
}
bool8 TryIncrementMonLevel(struct Pokemon *mon)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES, 0);
u8 nextLevel = GetMonData(mon, MON_DATA_LEVEL, 0) + 1;
u32 expPoints = GetMonData(mon, MON_DATA_EXP, 0);
2018-10-17 04:47:08 +02:00
if (expPoints > gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL])
2018-02-10 02:06:32 +01:00
{
2018-10-17 04:47:08 +02:00
expPoints = gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL];
2018-02-10 02:06:32 +01:00
SetMonData(mon, MON_DATA_EXP, &expPoints);
}
2018-10-17 04:47:08 +02:00
if (nextLevel > MAX_LEVEL || expPoints < gExperienceTables[gBaseStats[species].growthRate][nextLevel])
2018-02-10 02:06:32 +01:00
{
return FALSE;
}
else
{
SetMonData(mon, MON_DATA_LEVEL, &nextLevel);
return TRUE;
}
}
u32 CanMonLearnTMHM(struct Pokemon *mon, u8 tm)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
if (species == SPECIES_EGG)
{
return 0;
}
else if (tm < 32)
{
u32 mask = 1 << tm;
return gTMHMLearnsets[species][0] & mask;
}
else
{
u32 mask = 1 << (tm - 32);
return gTMHMLearnsets[species][1] & mask;
}
}
u32 CanSpeciesLearnTMHM(u16 species, u8 tm)
{
if (species == SPECIES_EGG)
{
return 0;
}
else if (tm < 32)
{
u32 mask = 1 << tm;
return gTMHMLearnsets[species][0] & mask;
}
else
{
u32 mask = 1 << (tm - 32);
return gTMHMLearnsets[species][1] & mask;
}
}
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
{
u16 learnedMoves[4];
u8 numMoves = 0;
u16 species = GetMonData(mon, MON_DATA_SPECIES, 0);
u8 level = GetMonData(mon, MON_DATA_LEVEL, 0);
int i, j, k;
for (i = 0; i < MAX_MON_MOVES; i++)
2018-02-10 02:06:32 +01:00
learnedMoves[i] = GetMonData(mon, MON_DATA_MOVE1 + i, 0);
2020-08-28 20:36:07 +02:00
for (i = 0; i < MAX_LEVEL_UP_MOVES; i++)
2018-02-10 02:06:32 +01:00
{
u16 moveLevel;
2019-10-06 15:57:33 +02:00
if (gLevelUpLearnsets[species][i].move == LEVEL_UP_END)
2018-02-10 02:06:32 +01:00
break;
2019-10-06 15:57:33 +02:00
moveLevel = gLevelUpLearnsets[species][i].level;
2018-02-10 02:06:32 +01:00
2019-10-06 15:57:33 +02:00
if (moveLevel <= level)
2018-02-10 02:06:32 +01:00
{
2019-10-06 15:57:33 +02:00
for (j = 0; j < MAX_MON_MOVES && learnedMoves[j] != gLevelUpLearnsets[species][i].move; j++)
2018-02-10 02:06:32 +01:00
;
if (j == MAX_MON_MOVES)
2018-02-10 02:06:32 +01:00
{
2019-10-06 15:57:33 +02:00
for (k = 0; k < numMoves && moves[k] != gLevelUpLearnsets[species][i].move; k++)
2018-02-10 02:06:32 +01:00
;
if (k == numMoves)
2019-10-06 15:57:33 +02:00
moves[numMoves++] = gLevelUpLearnsets[species][i].move;
2018-02-10 02:06:32 +01:00
}
}
}
return numMoves;
}
u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves)
{
u8 numMoves = 0;
int i;
2020-09-08 12:01:20 +02:00
for (i = 0; i < MAX_LEVEL_UP_MOVES && gLevelUpLearnsets[species][i].move != LEVEL_UP_END; i++)
2019-10-06 15:57:33 +02:00
moves[numMoves++] = gLevelUpLearnsets[species][i].move;
2018-02-10 02:06:32 +01:00
return numMoves;
}
u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
{
2019-09-08 17:53:48 +02:00
u16 learnedMoves[MAX_MON_MOVES];
2020-08-28 20:36:07 +02:00
u16 moves[MAX_LEVEL_UP_MOVES];
2018-02-10 02:06:32 +01:00
u8 numMoves = 0;
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
u8 level = GetMonData(mon, MON_DATA_LEVEL, 0);
int i, j, k;
if (species == SPECIES_EGG)
return 0;
for (i = 0; i < MAX_MON_MOVES; i++)
2018-02-10 02:06:32 +01:00
learnedMoves[i] = GetMonData(mon, MON_DATA_MOVE1 + i, 0);
2020-08-28 20:36:07 +02:00
for (i = 0; i < MAX_LEVEL_UP_MOVES; i++)
2018-02-10 02:06:32 +01:00
{
u16 moveLevel;
2019-10-06 15:57:33 +02:00
if (gLevelUpLearnsets[species][i].move == LEVEL_UP_END)
2018-02-10 02:06:32 +01:00
break;
2019-10-06 15:57:33 +02:00
moveLevel = gLevelUpLearnsets[species][i].level;
2018-02-10 02:06:32 +01:00
2019-10-06 15:57:33 +02:00
if (moveLevel <= level)
2018-02-10 02:06:32 +01:00
{
2019-10-06 15:57:33 +02:00
for (j = 0; j < MAX_MON_MOVES && learnedMoves[j] != gLevelUpLearnsets[species][i].move; j++)
2018-02-10 02:06:32 +01:00
;
if (j == MAX_MON_MOVES)
2018-02-10 02:06:32 +01:00
{
2019-10-06 15:57:33 +02:00
for (k = 0; k < numMoves && moves[k] != gLevelUpLearnsets[species][i].move; k++)
2018-02-10 02:06:32 +01:00
;
if (k == numMoves)
2019-10-06 15:57:33 +02:00
moves[numMoves++] = gLevelUpLearnsets[species][i].move;
2018-02-10 02:06:32 +01:00
}
}
}
return numMoves;
}
u16 SpeciesToPokedexNum(u16 species)
{
if (IsNationalPokedexEnabled())
{
return SpeciesToNationalPokedexNum(species);
}
else
{
species = SpeciesToHoennPokedexNum(species);
if (species <= HOENN_DEX_COUNT)
2018-02-10 02:06:32 +01:00
return species;
return 0xFFFF;
2018-02-10 02:06:32 +01:00
}
}
bool32 IsSpeciesInHoennDex(u16 species)
2018-02-10 02:06:32 +01:00
{
if (SpeciesToHoennPokedexNum(species) > HOENN_DEX_COUNT)
2018-02-10 02:06:32 +01:00
return FALSE;
else
return TRUE;
}
void ClearBattleMonForms(void)
{
int i;
2018-02-11 17:35:01 +01:00
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
2018-02-10 02:06:32 +01:00
gBattleMonForms[i] = 0;
}
u16 GetBattleBGM(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON)
2020-08-21 00:02:00 +02:00
return MUS_VS_KYOGRE_GROUDON;
else if (gBattleTypeFlags & BATTLE_TYPE_REGI)
2020-08-21 00:02:00 +02:00
return MUS_VS_REGI;
2021-01-13 21:17:32 +01:00
else if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
2020-08-21 00:02:00 +02:00
return MUS_VS_TRAINER;
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
2018-02-10 02:06:32 +01:00
{
u8 trainerClass;
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
trainerClass = GetFrontierOpponentClass(gTrainerBattleOpponent_A);
2018-09-20 22:00:00 +02:00
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
2018-02-10 02:06:32 +01:00
trainerClass = TRAINER_CLASS_EXPERT;
else
trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass;
switch (trainerClass)
{
case TRAINER_CLASS_AQUA_LEADER:
case TRAINER_CLASS_MAGMA_LEADER:
2020-08-21 00:02:00 +02:00
return MUS_VS_AQUA_MAGMA_LEADER;
2018-02-10 02:06:32 +01:00
case TRAINER_CLASS_TEAM_AQUA:
case TRAINER_CLASS_TEAM_MAGMA:
case TRAINER_CLASS_AQUA_ADMIN:
case TRAINER_CLASS_MAGMA_ADMIN:
2020-08-21 00:02:00 +02:00
return MUS_VS_AQUA_MAGMA;
2018-02-10 02:06:32 +01:00
case TRAINER_CLASS_LEADER:
2020-08-21 00:02:00 +02:00
return MUS_VS_GYM_LEADER;
2018-02-10 02:06:32 +01:00
case TRAINER_CLASS_CHAMPION:
2020-08-21 00:02:00 +02:00
return MUS_VS_CHAMPION;
2018-02-10 02:06:32 +01:00
case TRAINER_CLASS_PKMN_TRAINER_3:
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
2020-08-21 00:02:00 +02:00
return MUS_VS_RIVAL;
2018-02-10 02:06:32 +01:00
if (!StringCompare(gTrainers[gTrainerBattleOpponent_A].trainerName, gText_BattleWallyName))
2020-08-21 00:02:00 +02:00
return MUS_VS_TRAINER;
return MUS_VS_RIVAL;
2018-02-10 02:06:32 +01:00
case TRAINER_CLASS_ELITE_FOUR:
2020-08-21 00:02:00 +02:00
return MUS_VS_ELITE_FOUR;
2018-02-10 02:06:32 +01:00
case TRAINER_CLASS_SALON_MAIDEN:
case TRAINER_CLASS_DOME_ACE:
case TRAINER_CLASS_PALACE_MAVEN:
case TRAINER_CLASS_ARENA_TYCOON:
case TRAINER_CLASS_FACTORY_HEAD:
case TRAINER_CLASS_PIKE_QUEEN:
case TRAINER_CLASS_PYRAMID_KING:
2020-08-21 00:02:00 +02:00
return MUS_VS_FRONTIER_BRAIN;
2018-02-10 02:06:32 +01:00
default:
2020-08-21 00:02:00 +02:00
return MUS_VS_TRAINER;
2018-02-10 02:06:32 +01:00
}
}
else
2020-08-21 00:02:00 +02:00
return MUS_VS_WILD;
2018-02-10 02:06:32 +01:00
}
void PlayBattleBGM(void)
{
ResetMapMusic();
m4aMPlayAllStop();
PlayBGM(GetBattleBGM());
}
void PlayMapChosenOrBattleBGM(u16 songId)
{
ResetMapMusic();
m4aMPlayAllStop();
if (songId)
PlayNewMapMusic(songId);
else
PlayNewMapMusic(GetBattleBGM());
}
2020-12-24 22:18:47 +01:00
// Identical to PlayMapChosenOrBattleBGM, but uses a task instead
// Only used by Battle Dome
#define tSongId data[0]
void CreateTask_PlayMapChosenOrBattleBGM(u16 songId)
2018-02-10 02:06:32 +01:00
{
u8 taskId;
ResetMapMusic();
m4aMPlayAllStop();
2020-12-24 22:18:47 +01:00
taskId = CreateTask(Task_PlayMapChosenOrBattleBGM, 0);
gTasks[taskId].tSongId = songId;
2018-02-10 02:06:32 +01:00
}
2020-12-24 22:18:47 +01:00
static void Task_PlayMapChosenOrBattleBGM(u8 taskId)
2018-02-10 02:06:32 +01:00
{
2020-12-24 22:18:47 +01:00
if (gTasks[taskId].tSongId)
PlayNewMapMusic(gTasks[taskId].tSongId);
2018-02-10 02:06:32 +01:00
else
PlayNewMapMusic(GetBattleBGM());
DestroyTask(taskId);
}
2020-12-24 22:18:47 +01:00
#undef tSongId
2018-10-21 09:24:57 +02:00
const u32 *GetMonFrontSpritePal(struct Pokemon *mon)
2018-02-10 02:06:32 +01:00
{
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
2019-07-25 18:56:08 +02:00
return GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality);
2018-02-10 02:06:32 +01:00
}
2019-07-25 18:56:08 +02:00
const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality)
2018-02-10 02:06:32 +01:00
{
u32 shinyValue;
2018-12-30 17:58:42 +01:00
if (species > NUM_SPECIES)
2018-02-10 02:06:32 +01:00
return gMonPaletteTable[0].data;
shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
if (shinyValue < SHINY_ODDS)
2020-11-06 21:12:57 +01:00
{
if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
return gMonShinyPaletteTableFemale[species].data;
else
return gMonShinyPaletteTable[species].data;
}
2018-02-10 02:06:32 +01:00
else
2020-11-06 21:12:57 +01:00
{
if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
return gMonPaletteTableFemale[species].data;
else
return gMonPaletteTable[species].data;
}
2018-02-10 02:06:32 +01:00
}
2018-02-11 17:35:01 +01:00
const struct CompressedSpritePalette *GetMonSpritePalStruct(struct Pokemon *mon)
2018-02-10 02:06:32 +01:00
{
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
return GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
}
const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u16 species, u32 otId , u32 personality)
{
u32 shinyValue;
shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
if (shinyValue < SHINY_ODDS)
2020-11-06 21:12:57 +01:00
{
if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
return &gMonShinyPaletteTableFemale[species];
else
return &gMonShinyPaletteTable[species];
}
2018-02-10 02:06:32 +01:00
else
2020-11-06 21:12:57 +01:00
{
if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
return &gMonPaletteTableFemale[species];
else
return &gMonPaletteTable[species];
}
2018-02-10 02:06:32 +01:00
}
bool32 IsHMMove2(u16 move)
{
int i = 0;
while (sHMMoves[i] != 0xFFFF)
2018-02-10 02:06:32 +01:00
{
if (sHMMoves[i++] == move)
2018-02-10 02:06:32 +01:00
return TRUE;
}
return FALSE;
}
2018-02-11 17:35:01 +01:00
bool8 IsMonSpriteNotFlipped(u16 species)
2018-02-10 02:06:32 +01:00
{
return gBaseStats[species].noFlip;
}
s8 GetMonFlavorRelation(struct Pokemon *mon, u8 flavor)
{
u8 nature = GetNature(mon);
2020-07-17 02:12:12 +02:00
return gPokeblockFlavorCompatibilityTable[nature * FLAVOR_COUNT + flavor];
2018-02-10 02:06:32 +01:00
}
s8 GetFlavorRelationByPersonality(u32 personality, u8 flavor)
{
u8 nature = GetNatureFromPersonality(personality);
2020-07-17 02:12:12 +02:00
return gPokeblockFlavorCompatibilityTable[nature * FLAVOR_COUNT + flavor];
2018-02-10 02:06:32 +01:00
}
bool8 IsTradedMon(struct Pokemon *mon)
{
2018-09-01 22:03:21 +02:00
u8 otName[PLAYER_NAME_LENGTH + 1];
2018-02-10 02:06:32 +01:00
u32 otId;
GetMonData(mon, MON_DATA_OT_NAME, otName);
otId = GetMonData(mon, MON_DATA_OT_ID, 0);
return IsOtherTrainer(otId, otName);
}
bool8 IsOtherTrainer(u32 otId, u8 *otName)
{
if (otId ==
(gSaveBlock2Ptr->playerTrainerId[0]
| (gSaveBlock2Ptr->playerTrainerId[1] << 8)
| (gSaveBlock2Ptr->playerTrainerId[2] << 16)
| (gSaveBlock2Ptr->playerTrainerId[3] << 24)))
{
int i;
for (i = 0; otName[i] != EOS; i++)
if (otName[i] != gSaveBlock2Ptr->playerName[i])
return TRUE;
return FALSE;
}
return TRUE;
}
void MonRestorePP(struct Pokemon *mon)
{
BoxMonRestorePP(&mon->box);
}
void BoxMonRestorePP(struct BoxPokemon *boxMon)
{
int i;
for (i = 0; i < MAX_MON_MOVES; i++)
2018-02-10 02:06:32 +01:00
{
if (GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, 0))
{
u16 move = GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, 0);
u16 bonus = GetBoxMonData(boxMon, MON_DATA_PP_BONUSES, 0);
u8 pp = CalculatePPWithBonus(move, bonus, i);
SetBoxMonData(boxMon, MON_DATA_PP1 + i, &pp);
}
}
}
2018-07-07 19:57:09 +02:00
void SetMonPreventsSwitchingString(void)
2018-02-10 02:06:32 +01:00
{
2018-07-07 19:57:09 +02:00
gLastUsedAbility = gBattleStruct->abilityPreventingSwitchout;
2018-02-10 02:06:32 +01:00
gBattleTextBuff1[0] = B_BUFF_PLACEHOLDER_BEGIN;
gBattleTextBuff1[1] = B_BUFF_MON_NICK_WITH_PREFIX;
2018-07-07 19:57:09 +02:00
gBattleTextBuff1[2] = gBattleStruct->battlerPreventingSwitchout;
2018-02-10 02:06:32 +01:00
gBattleTextBuff1[4] = B_BUFF_EOS;
2018-07-07 19:57:09 +02:00
if (GetBattlerSide(gBattleStruct->battlerPreventingSwitchout) == B_SIDE_PLAYER)
2019-10-26 03:55:01 +02:00
gBattleTextBuff1[3] = GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[gBattleStruct->battlerPreventingSwitchout]);
2018-02-10 02:06:32 +01:00
else
2018-07-07 19:57:09 +02:00
gBattleTextBuff1[3] = gBattlerPartyIndexes[gBattleStruct->battlerPreventingSwitchout];
2018-02-10 02:06:32 +01:00
2019-10-26 03:55:01 +02:00
PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff2, gBattlerInMenuId, GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[gBattlerInMenuId]))
2018-02-10 02:06:32 +01:00
BattleStringExpandPlaceholders(gText_PkmnsXPreventsSwitching, gStringVar4);
}
static s32 GetWildMonTableIdInAlteringCave(u16 species)
{
s32 i;
for (i = 0; i < (s32) ARRAY_COUNT(sAlteringCaveWildMonHeldItems); i++)
if (sAlteringCaveWildMonHeldItems[i].species == species)
2018-02-10 02:06:32 +01:00
return i;
return 0;
}
void SetWildMonHeldItem(void)
{
if (!(gBattleTypeFlags & (BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_TRAINER | BATTLE_TYPE_PYRAMID | BATTLE_TYPE_PIKE)))
{
u16 rnd = Random() % 100;
u16 species = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, 0);
u16 var1 = 45;
u16 var2 = 95;
2018-12-15 23:58:47 +01:00
if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG, 0)
2018-02-10 02:06:32 +01:00
&& GetMonAbility(&gPlayerParty[0]) == ABILITY_COMPOUND_EYES)
{
var1 = 20;
var2 = 80;
}
2019-01-31 22:51:20 +01:00
if (gMapHeader.mapLayoutId == LAYOUT_ALTERING_CAVE)
2018-02-10 02:06:32 +01:00
{
s32 alteringCaveId = GetWildMonTableIdInAlteringCave(species);
if (alteringCaveId != 0)
{
if (rnd < var2)
return;
SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &sAlteringCaveWildMonHeldItems[alteringCaveId].item);
2018-02-10 02:06:32 +01:00
}
else
{
if (rnd < var1)
return;
if (rnd < var2)
SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item1);
else
SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item2);
}
}
else
{
if (gBaseStats[species].item1 == gBaseStats[species].item2 && gBaseStats[species].item1 != 0)
{
SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item1);
}
else
{
if (rnd < var1)
return;
if (rnd < var2)
SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item1);
else
SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item2);
}
}
}
}
bool8 IsMonShiny(struct Pokemon *mon)
{
u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
return IsShinyOtIdPersonality(otId, personality);
}
bool8 IsShinyOtIdPersonality(u32 otId, u32 personality)
{
bool8 retVal = FALSE;
u32 shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
if (shinyValue < SHINY_ODDS)
2018-02-10 02:06:32 +01:00
retVal = TRUE;
return retVal;
}
const u8 *GetTrainerPartnerName(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)
{
if (gPartnerTrainerId == TRAINER_STEVEN_PARTNER)
2018-02-10 02:06:32 +01:00
{
return gTrainers[TRAINER_STEVEN].trainerName;
}
else
{
GetFrontierTrainerName(gStringVar1, gPartnerTrainerId);
return gStringVar1;
}
}
else
{
u8 id = GetMultiplayerId();
2018-07-22 12:49:49 +02:00
return gLinkPlayers[GetBattlerMultiplayerId(gLinkPlayers[id].id ^ 2)].name;
2018-02-10 02:06:32 +01:00
}
}
#define READ_PTR_FROM_TASK(taskId, dataId) \
(void*)( \
((u16)(gTasks[taskId].data[dataId]) | \
2021-03-30 23:38:09 +02:00
((u16)(gTasks[taskId].data[dataId + 1]) << 16)))
2018-02-10 02:06:32 +01:00
#define STORE_PTR_IN_TASK(ptr, taskId, dataId) \
{ \
gTasks[taskId].data[dataId] = (u32)(ptr); \
2021-03-30 23:38:09 +02:00
gTasks[taskId].data[dataId + 1] = (u32)(ptr) >> 16; \
2018-02-10 02:06:32 +01:00
}
static void Task_AnimateAfterDelay(u8 taskId)
{
if (--gTasks[taskId].data[3] == 0)
{
LaunchAnimationTaskForFrontSprite(READ_PTR_FROM_TASK(taskId, 0), gTasks[taskId].data[2]);
DestroyTask(taskId);
}
}
static void Task_PokemonSummaryAnimateAfterDelay(u8 taskId)
{
if (--gTasks[taskId].data[3] == 0)
{
StartMonSummaryAnimation(READ_PTR_FROM_TASK(taskId, 0), gTasks[taskId].data[2]);
2021-04-09 18:41:02 +02:00
SummaryScreen_SetAnimDelayTaskId(TASK_NONE);
2018-02-10 02:06:32 +01:00
DestroyTask(taskId);
}
}
void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3)
{
2021-01-13 21:17:32 +01:00
if (gHitMarker & HITMARKER_NO_ANIMATIONS && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)))
2018-02-10 02:06:32 +01:00
DoMonFrontSpriteAnimation(sprite, species, noCry, arg3 | 0x80);
else
DoMonFrontSpriteAnimation(sprite, species, noCry, arg3);
}
void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3)
{
s8 pan;
switch (arg3 & 0x7F)
{
case 0:
pan = -25;
break;
case 1:
pan = 25;
break;
default:
pan = 0;
break;
}
if (arg3 & 0x80)
{
if (!noCry)
PlayCry1(species, pan);
sprite->callback = SpriteCallbackDummy;
}
else
{
if (!noCry)
{
PlayCry1(species, pan);
if (HasTwoFramesAnimation(species))
StartSpriteAnim(sprite, 1);
}
if (sMonAnimationDelayTable[species - 1] != 0)
2018-02-10 02:06:32 +01:00
{
u8 taskId = CreateTask(Task_AnimateAfterDelay, 0);
STORE_PTR_IN_TASK(sprite, taskId, 0);
gTasks[taskId].data[2] = sMonFrontAnimIdsTable[species - 1];
gTasks[taskId].data[3] = sMonAnimationDelayTable[species - 1];
2018-02-10 02:06:32 +01:00
}
else
{
LaunchAnimationTaskForFrontSprite(sprite, sMonFrontAnimIdsTable[species - 1]);
2018-02-10 02:06:32 +01:00
}
sprite->callback = SpriteCallbackDummy_2;
}
}
void PokemonSummaryDoMonAnimation(struct Sprite* sprite, u16 species, bool8 oneFrame)
{
if (!oneFrame && HasTwoFramesAnimation(species))
StartSpriteAnim(sprite, 1);
if (sMonAnimationDelayTable[species - 1] != 0)
2018-02-10 02:06:32 +01:00
{
u8 taskId = CreateTask(Task_PokemonSummaryAnimateAfterDelay, 0);
STORE_PTR_IN_TASK(sprite, taskId, 0);
gTasks[taskId].data[2] = sMonFrontAnimIdsTable[species - 1];
gTasks[taskId].data[3] = sMonAnimationDelayTable[species - 1];
2021-04-09 18:41:02 +02:00
SummaryScreen_SetAnimDelayTaskId(taskId);
2018-02-10 02:06:32 +01:00
SetSpriteCB_MonAnimDummy(sprite);
}
else
{
StartMonSummaryAnimation(sprite, sMonFrontAnimIdsTable[species - 1]);
2018-02-10 02:06:32 +01:00
}
}
void StopPokemonAnimationDelayTask(void)
2018-02-10 02:06:32 +01:00
{
u8 delayTaskId = FindTaskIdByFunc(Task_PokemonSummaryAnimateAfterDelay);
2021-02-20 05:22:26 +01:00
if (delayTaskId != TASK_NONE)
2018-02-10 02:06:32 +01:00
DestroyTask(delayTaskId);
}
void BattleAnimateBackSprite(struct Sprite* sprite, u16 species)
{
2021-01-13 21:17:32 +01:00
if (gHitMarker & HITMARKER_NO_ANIMATIONS && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)))
2018-02-10 02:06:32 +01:00
{
sprite->callback = SpriteCallbackDummy;
}
else
{
LaunchAnimationTaskForBackSprite(sprite, GetSpeciesBackAnimSet(species));
sprite->callback = SpriteCallbackDummy_2;
}
}
u8 sub_806EF08(u8 arg0)
{
s32 i;
s32 var = 0;
u8 multiplayerId = GetMultiplayerId();
2018-07-22 12:49:49 +02:00
switch (gLinkPlayers[multiplayerId].id)
2018-02-10 02:06:32 +01:00
{
case 0:
case 2:
var = (arg0 != 0) ? 1 : 3;
break;
case 1:
case 3:
var = (arg0 != 0) ? 2 : 0;
break;
}
2019-09-08 18:21:24 +02:00
for (i = 0; i < MAX_LINK_PLAYERS; i++)
2018-02-10 02:06:32 +01:00
{
2018-07-22 12:49:49 +02:00
if (gLinkPlayers[i].id == (s16)(var))
2018-02-10 02:06:32 +01:00
break;
}
return i;
}
u8 sub_806EF84(u8 arg0, u8 arg1)
{
s32 i;
s32 var = 0;
2018-07-22 12:49:49 +02:00
switch (gLinkPlayers[arg1].id)
2018-02-10 02:06:32 +01:00
{
case 0:
case 2:
var = (arg0 != 0) ? 1 : 3;
break;
case 1:
case 3:
var = (arg0 != 0) ? 2 : 0;
break;
}
2019-09-08 18:21:24 +02:00
for (i = 0; i < MAX_LINK_PLAYERS; i++)
2018-02-10 02:06:32 +01:00
{
2018-07-22 12:49:49 +02:00
if (gLinkPlayers[i].id == (s16)(var))
2018-02-10 02:06:32 +01:00
break;
}
return i;
}
2018-02-11 17:35:01 +01:00
u16 FacilityClassToPicIndex(u16 facilityClass)
2018-02-10 02:06:32 +01:00
{
2018-02-11 17:35:01 +01:00
return gFacilityClassToPicIndex[facilityClass];
2018-02-10 02:06:32 +01:00
}
u16 PlayerGenderToFrontTrainerPicId(u8 playerGender)
{
if (playerGender != MALE)
return FacilityClassToPicIndex(FACILITY_CLASS_MAY);
2018-08-19 01:06:10 +02:00
else
return FacilityClassToPicIndex(FACILITY_CLASS_BRENDAN);
2018-02-10 02:06:32 +01:00
}
void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality)
{
u8 getFlagCaseId = (caseId == FLAG_SET_SEEN) ? FLAG_GET_SEEN : FLAG_GET_CAUGHT;
if (!GetSetPokedexFlag(nationalNum, getFlagCaseId)) // don't set if it's already set
{
GetSetPokedexFlag(nationalNum, caseId);
if (NationalPokedexNumToSpecies(nationalNum) == SPECIES_UNOWN)
gSaveBlock2Ptr->pokedex.unownPersonality = personality;
if (NationalPokedexNumToSpecies(nationalNum) == SPECIES_SPINDA)
gSaveBlock2Ptr->pokedex.spindaPersonality = personality;
}
}
const u8 *GetTrainerClassNameFromId(u16 trainerId)
{
if (trainerId >= TRAINERS_COUNT)
trainerId = TRAINER_NONE;
2018-02-10 02:06:32 +01:00
return gTrainerClassNames[gTrainers[trainerId].trainerClass];
}
const u8 *GetTrainerNameFromId(u16 trainerId)
{
if (trainerId >= TRAINERS_COUNT)
trainerId = TRAINER_NONE;
2018-02-10 02:06:32 +01:00
return gTrainers[trainerId].trainerName;
}
bool8 HasTwoFramesAnimation(u16 species)
{
return (species != SPECIES_CASTFORM
&& species != SPECIES_SPINDA
2019-06-16 09:27:42 +02:00
&& species != SPECIES_UNOWN
&& species != SPECIES_CHERRIM);
2018-02-10 02:06:32 +01:00
}
2020-02-02 19:28:54 +01:00
static bool8 ShouldSkipFriendshipChange(void)
2018-02-10 02:06:32 +01:00
{
if (gMain.inBattle && gBattleTypeFlags & (BATTLE_TYPE_FRONTIER))
return TRUE;
if (!gMain.inBattle && (InBattlePike() || InBattlePyramid()))
return TRUE;
return FALSE;
}
2018-02-11 17:35:01 +01:00
static void sub_806F160(struct Unknown_806F160_Struct* structPtr)
2018-02-10 02:06:32 +01:00
{
2018-02-10 13:24:03 +01:00
u16 i, j;
2020-09-09 21:59:34 +02:00
for (i = 0; i < structPtr->field_0_0; i++)
2018-02-10 02:06:32 +01:00
{
2021-01-23 05:22:37 +01:00
structPtr->templates[i] = gBattlerSpriteTemplates[i];
2018-02-10 02:06:32 +01:00
for (j = 0; j < structPtr->field_1; j++)
{
structPtr->frameImages[i * structPtr->field_1 + j].data = &structPtr->byteArrays[i][j * 0x800];
}
structPtr->templates[i].images = &structPtr->frameImages[i * structPtr->field_1];
}
}
2018-02-11 17:35:01 +01:00
static void sub_806F1FC(struct Unknown_806F160_Struct* structPtr)
2018-02-10 02:06:32 +01:00
{
2018-02-10 13:24:03 +01:00
u16 i, j;
2020-09-09 21:59:34 +02:00
for (i = 0; i < structPtr->field_0_0; i++)
2018-02-10 02:06:32 +01:00
{
structPtr->templates[i] = gUnknown_08329F28;
for (j = 0; j < structPtr->field_1; j++)
{
structPtr->frameImages[i * structPtr->field_0_0 + j].data = &structPtr->byteArrays[i][j * 0x800];
}
structPtr->templates[i].images = &structPtr->frameImages[i * structPtr->field_0_0];
structPtr->templates[i].anims = gAnims_MonPic;
2018-02-10 02:06:32 +01:00
structPtr->templates[i].paletteTag = i;
}
}
2018-02-10 13:24:03 +01:00
struct Unknown_806F160_Struct *sub_806F2AC(u8 id, u8 arg1)
2018-02-10 02:06:32 +01:00
{
u8 i;
u8 flags;
struct Unknown_806F160_Struct *structPtr;
flags = 0;
2018-02-10 13:24:03 +01:00
id %= 2;
2018-02-10 02:06:32 +01:00
structPtr = AllocZeroed(sizeof(*structPtr));
if (structPtr == NULL)
return NULL;
switch (arg1)
{
case 2:
structPtr->field_0_0 = 7;
structPtr->field_0_1 = 7;
structPtr->field_1 = 4;
structPtr->field_3_0 = 1;
2018-02-10 02:06:32 +01:00
structPtr->field_3_1 = 2;
break;
case 0:
default:
structPtr->field_0_0 = 4;
structPtr->field_0_1 = 4;
structPtr->field_1 = 4;
structPtr->field_3_0 = 1;
2018-02-10 02:06:32 +01:00
structPtr->field_3_1 = 0;
break;
}
structPtr->bytes = AllocZeroed(structPtr->field_3_0 * 0x800 * 4 * structPtr->field_0_0);
2018-02-10 02:06:32 +01:00
structPtr->byteArrays = AllocZeroed(structPtr->field_0_0 * 32);
if (structPtr->bytes == NULL || structPtr->byteArrays == NULL)
{
flags |= 1;
}
else
{
2020-09-09 21:59:34 +02:00
for (i = 0; i < structPtr->field_0_0; i++)
2021-03-30 23:38:09 +02:00
structPtr->byteArrays[i] = structPtr->bytes + (structPtr->field_3_0 * (i << 13));
2018-02-10 02:06:32 +01:00
}
structPtr->templates = AllocZeroed(sizeof(struct SpriteTemplate) * structPtr->field_0_0);
structPtr->frameImages = AllocZeroed(sizeof(struct SpriteFrameImage) * structPtr->field_0_0 * structPtr->field_1);
if (structPtr->templates == NULL || structPtr->frameImages == NULL)
{
flags |= 2;
}
else
{
for (i = 0; i < structPtr->field_1 * structPtr->field_0_0; i++)
structPtr->frameImages[i].size = 0x800;
switch (structPtr->field_3_1)
{
case 2:
sub_806F1FC(structPtr);
break;
2020-09-09 22:05:22 +02:00
case 0:
case 1:
2018-02-10 02:06:32 +01:00
default:
sub_806F160(structPtr);
break;
}
}
if (flags & 2)
{
if (structPtr->frameImages != NULL)
FREE_AND_SET_NULL(structPtr->frameImages);
if (structPtr->templates != NULL)
FREE_AND_SET_NULL(structPtr->templates);
}
if (flags & 1)
{
if (structPtr->byteArrays != NULL)
FREE_AND_SET_NULL(structPtr->byteArrays);
if (structPtr->bytes != NULL)
FREE_AND_SET_NULL(structPtr->bytes);
}
if (flags)
{
memset(structPtr, 0, sizeof(*structPtr));
Free(structPtr);
}
else
{
structPtr->magic = 0xA3;
2018-02-10 13:24:03 +01:00
gUnknown_020249B4[id] = structPtr;
}
return gUnknown_020249B4[id];
}
void sub_806F47C(u8 id)
{
struct Unknown_806F160_Struct *structPtr;
id %= 2;
2018-02-10 13:24:03 +01:00
structPtr = gUnknown_020249B4[id];
if (structPtr == NULL)
return;
if (structPtr->magic != 0xA3)
2018-02-10 13:24:03 +01:00
{
memset(structPtr, 0, sizeof(struct Unknown_806F160_Struct));
}
else
{
if (structPtr->frameImages != NULL)
FREE_AND_SET_NULL(structPtr->frameImages);
if (structPtr->templates != NULL)
FREE_AND_SET_NULL(structPtr->templates);
if (structPtr->byteArrays != NULL)
FREE_AND_SET_NULL(structPtr->byteArrays);
if (structPtr->bytes != NULL)
FREE_AND_SET_NULL(structPtr->bytes);
memset(structPtr, 0, sizeof(struct Unknown_806F160_Struct));
Free(structPtr);
}
}
u8 *sub_806F4F8(u8 id, u8 arg1)
{
struct Unknown_806F160_Struct *structPtr = gUnknown_020249B4[id % 2];
if (structPtr->magic != 0xA3)
2018-02-10 13:24:03 +01:00
{
return NULL;
2018-02-10 02:06:32 +01:00
}
else
{
2020-10-26 05:01:53 +01:00
if (arg1 >= structPtr->field_0_0)
arg1 = 0;
return structPtr->byteArrays[arg1];
}
2018-02-10 02:06:32 +01:00
}
u16 GetFormSpeciesId(u16 speciesId, u8 formId)
{
if (gFormSpeciesIdTables[speciesId] != NULL)
return gFormSpeciesIdTables[speciesId][formId];
else
return speciesId;
}
u8 GetFormIdFromFormSpeciesId(u16 formSpeciesId)
{
u8 targetFormId = 0;
if (gFormSpeciesIdTables[formSpeciesId] != NULL)
{
for (targetFormId = 0; gFormSpeciesIdTables[formSpeciesId][targetFormId] != FORM_SPECIES_END; targetFormId++)
{
if (formSpeciesId == gFormSpeciesIdTables[formSpeciesId][targetFormId])
break;
}
}
return targetFormId;
}