sovereignx/include/pokemon.h

908 lines
32 KiB
C
Raw Normal View History

2017-09-02 22:28:44 +01:00
#ifndef GUARD_POKEMON_H
#define GUARD_POKEMON_H
2018-02-11 16:35:01 +00:00
#include "sprite.h"
2023-03-23 09:02:32 +00:00
#include "constants/items.h"
#include "constants/region_map_sections.h"
#include "constants/map_groups.h"
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
#include "contest_effect.h"
2018-02-11 16:35:01 +00:00
#define GET_BASE_SPECIES_ID(speciesId) (GetFormSpeciesId(speciesId, 0))
2021-12-03 22:32:31 +00:00
#define FORM_SPECIES_END (0xffff)
2022-08-15 22:36:55 +01:00
// Property labels for Get(Box)MonData / Set(Box)MonData
2022-08-08 23:40:47 +01:00
enum {
MON_DATA_PERSONALITY,
MON_DATA_STATUS,
2022-08-08 23:40:47 +01:00
MON_DATA_OT_ID,
MON_DATA_LANGUAGE,
MON_DATA_SANITY_IS_BAD_EGG,
MON_DATA_SANITY_HAS_SPECIES,
MON_DATA_SANITY_IS_EGG,
MON_DATA_OT_NAME,
MON_DATA_MARKINGS,
MON_DATA_CHECKSUM,
MON_DATA_HP,
MON_DATA_IS_SHINY,
MON_DATA_HIDDEN_NATURE,
MON_DATA_HP_LOST,
MON_DATA_DAYS_SINCE_FORM_CHANGE,
2022-08-08 23:40:47 +01:00
MON_DATA_ENCRYPT_SEPARATOR,
MON_DATA_NICKNAME,
2024-03-29 17:43:17 +00:00
MON_DATA_NICKNAME10,
2022-08-08 23:40:47 +01:00
MON_DATA_SPECIES,
MON_DATA_HELD_ITEM,
MON_DATA_MOVE1,
MON_DATA_MOVE2,
MON_DATA_MOVE3,
MON_DATA_MOVE4,
MON_DATA_PP1,
MON_DATA_PP2,
MON_DATA_PP3,
MON_DATA_PP4,
MON_DATA_PP_BONUSES,
MON_DATA_COOL,
MON_DATA_BEAUTY,
MON_DATA_CUTE,
MON_DATA_EXP,
MON_DATA_HP_EV,
MON_DATA_ATK_EV,
MON_DATA_DEF_EV,
MON_DATA_SPEED_EV,
MON_DATA_SPATK_EV,
MON_DATA_SPDEF_EV,
MON_DATA_FRIENDSHIP,
MON_DATA_SMART,
MON_DATA_POKERUS,
MON_DATA_MET_LOCATION,
MON_DATA_MET_LEVEL,
MON_DATA_MET_GAME,
MON_DATA_POKEBALL,
MON_DATA_HP_IV,
MON_DATA_ATK_IV,
MON_DATA_DEF_IV,
MON_DATA_SPEED_IV,
MON_DATA_SPATK_IV,
MON_DATA_SPDEF_IV,
MON_DATA_IS_EGG,
MON_DATA_ABILITY_NUM,
MON_DATA_TOUGH,
MON_DATA_SHEEN,
MON_DATA_OT_GENDER,
MON_DATA_COOL_RIBBON,
MON_DATA_BEAUTY_RIBBON,
MON_DATA_CUTE_RIBBON,
MON_DATA_SMART_RIBBON,
MON_DATA_TOUGH_RIBBON,
MON_DATA_LEVEL,
MON_DATA_MAX_HP,
MON_DATA_ATK,
MON_DATA_DEF,
MON_DATA_SPEED,
MON_DATA_SPATK,
MON_DATA_SPDEF,
MON_DATA_MAIL,
MON_DATA_SPECIES_OR_EGG,
2022-08-08 23:40:47 +01:00
MON_DATA_IVS,
MON_DATA_CHAMPION_RIBBON,
MON_DATA_WINNING_RIBBON,
MON_DATA_VICTORY_RIBBON,
MON_DATA_ARTIST_RIBBON,
MON_DATA_EFFORT_RIBBON,
MON_DATA_MARINE_RIBBON,
MON_DATA_LAND_RIBBON,
MON_DATA_SKY_RIBBON,
MON_DATA_COUNTRY_RIBBON,
MON_DATA_NATIONAL_RIBBON,
MON_DATA_EARTH_RIBBON,
MON_DATA_WORLD_RIBBON,
2023-02-15 16:56:11 +00:00
MON_DATA_MODERN_FATEFUL_ENCOUNTER,
2022-08-08 23:40:47 +01:00
MON_DATA_KNOWN_MOVES,
MON_DATA_RIBBON_COUNT,
MON_DATA_RIBBONS,
MON_DATA_ATK2,
MON_DATA_DEF2,
MON_DATA_SPEED2,
MON_DATA_SPATK2,
MON_DATA_SPDEF2,
MON_DATA_HYPER_TRAINED_HP,
MON_DATA_HYPER_TRAINED_ATK,
MON_DATA_HYPER_TRAINED_DEF,
MON_DATA_HYPER_TRAINED_SPEED,
MON_DATA_HYPER_TRAINED_SPATK,
MON_DATA_HYPER_TRAINED_SPDEF,
MON_DATA_IS_SHADOW,
MON_DATA_DYNAMAX_LEVEL,
MON_DATA_GIGANTAMAX_FACTOR,
MON_DATA_TERA_TYPE,
MON_DATA_EVOLUTION_TRACKER,
2022-08-08 23:40:47 +01:00
};
struct PokemonSubstruct0
{
u16 species:11; // 2047 species.
u16 teraType:5; // 30 types.
u16 heldItem:10; // 1023 items.
u16 unused_02:6;
u32 experience:21;
u32 nickname11:8; // 11th character of nickname.
u32 unused_04:3;
u8 ppBonuses;
u8 friendship;
u16 pokeball:6; // 63 balls.
u16 nickname12:8; // 12th character of nickname.
u16 unused_0A:2;
};
struct PokemonSubstruct1
{
u16 move1:11; // 2047 moves.
u16 evolutionTracker1:5;
u16 move2:11; // 2047 moves.
u16 evolutionTracker2:5;
u16 move3:11; // 2047 moves.
u16 unused_04:5;
u16 move4:11; // 2047 moves.
u16 unused_06:3;
u16 hyperTrainedHP:1;
u16 hyperTrainedAttack:1;
u8 pp1:7; // 127 PP.
u8 hyperTrainedDefense:1;
u8 pp2:7; // 127 PP.
u8 hyperTrainedSpeed:1;
u8 pp3:7; // 127 PP.
u8 hyperTrainedSpAttack:1;
u8 pp4:7; // 127 PP.
u8 hyperTrainedSpDefense:1;
};
struct PokemonSubstruct2
{
u8 hpEV;
u8 attackEV;
u8 defenseEV;
u8 speedEV;
u8 spAttackEV;
u8 spDefenseEV;
u8 cool;
u8 beauty;
u8 cute;
u8 smart;
u8 tough;
u8 sheen;
};
struct PokemonSubstruct3
{
u8 pokerus;
u8 metLocation;
u16 metLevel:7;
u16 metGame:4;
u16 dynamaxLevel:4;
u16 otGender:1;
u32 hpIV:5;
u32 attackIV:5;
u32 defenseIV:5;
u32 speedIV:5;
u32 spAttackIV:5;
u32 spDefenseIV:5;
u32 isEgg:1;
u32 gigantamaxFactor:1;
u32 coolRibbon:3; // Stores the highest contest rank achieved in the Cool category.
u32 beautyRibbon:3; // Stores the highest contest rank achieved in the Beauty category.
u32 cuteRibbon:3; // Stores the highest contest rank achieved in the Cute category.
u32 smartRibbon:3; // Stores the highest contest rank achieved in the Smart category.
u32 toughRibbon:3; // Stores the highest contest rank achieved in the Tough category.
u32 championRibbon:1; // Given when defeating the Champion. Because both RSE and FRLG use it, later generations don't specify from which region it comes from.
u32 winningRibbon:1; // Given at the Battle Tower's Level 50 challenge by winning a set of seven battles that extends the current streak to 56 or more.
u32 victoryRibbon:1; // Given at the Battle Tower's Level 100 challenge by winning a set of seven battles that extends the current streak to 56 or more.
u32 artistRibbon:1; // Given at the Contest Hall by winning a Master Rank contest with at least 800 points, and agreeing to have the Pokémon's portrait placed in the museum after being offered.
u32 effortRibbon:1; // Given at Slateport's market to Pokémon with maximum EVs.
u32 marineRibbon:1; // Never distributed.
u32 landRibbon:1; // Never distributed.
u32 skyRibbon:1; // Never distributed.
u32 countryRibbon:1; // Distributed during Pokémon Festa '04 and '05 to tournament winners.
u32 nationalRibbon:1; // Given to purified Shadow Pokémon in Colosseum/XD.
u32 earthRibbon:1; // Given to teams that have beaten Mt. Battle's 100-battle challenge in Colosseum/XD.
u32 worldRibbon:1; // Distributed during Pokémon Festa '04 and '05 to tournament winners.
u32 isShadow:1;
u32 unused_0B:1;
u32 abilityNum:2;
// The functionality of this bit changed in FRLG:
// In RS, this bit does nothing, is never set, & is accidentally unset when hatching Eggs.
// In FRLG & Emerald, this controls Mew & Deoxys obedience and whether they can be traded.
// If set, a Pokémon is a fateful encounter in FRLG's summary screen if hatched & for all Pokémon in Gen 4+ summary screens.
// Set for in-game event island legendaries, events distributed after a certain date, & Pokémon from XD: Gale of Darkness.
// Not to be confused with METLOC_FATEFUL_ENCOUNTER.
u32 modernFatefulEncounter:1;
};
// Number of bytes in the largest Pokémon substruct.
// They are assumed to be the same size, and will be padded to
// the largest size by the union.
// By default they are all 12 bytes.
#define NUM_SUBSTRUCT_BYTES (max(sizeof(struct PokemonSubstruct0), \
max(sizeof(struct PokemonSubstruct1), \
max(sizeof(struct PokemonSubstruct2), \
sizeof(struct PokemonSubstruct3)))))
union PokemonSubstruct
{
struct PokemonSubstruct0 type0;
struct PokemonSubstruct1 type1;
struct PokemonSubstruct2 type2;
struct PokemonSubstruct3 type3;
u16 raw[NUM_SUBSTRUCT_BYTES / 2]; // /2 because it's u16, not u8
};
struct BoxPokemon
{
u32 personality;
u32 otId;
u8 nickname[min(10, POKEMON_NAME_LENGTH)];
u8 language:3;
u8 hiddenNatureModifier:5; // 31 natures.
u8 isBadEgg:1;
u8 hasSpecies:1;
u8 isEgg:1;
u8 blockBoxRS:1; // Unused, but Pokémon Box Ruby & Sapphire will refuse to deposit a Pokémon with this flag set.
u8 daysSinceFormChange:3; // 7 days.
u8 unused_13:1;
2018-09-01 21:03:21 +01:00
u8 otName[PLAYER_NAME_LENGTH];
u8 markings:4;
u8 compressedStatus:4;
u16 checksum;
u16 hpLost:14; // 16383 HP.
u16 shinyModifier:1;
u16 unused_1E:1;
union
{
u32 raw[(NUM_SUBSTRUCT_BYTES * 4) / 4]; // *4 because there are 4 substructs, /4 because it's u32, not u8
union PokemonSubstruct substructs[4];
} secure;
};
struct Pokemon
{
struct BoxPokemon box;
u32 status;
u8 level;
2017-09-11 17:27:54 +01:00
u8 mail;
u16 hp;
u16 maxHP;
u16 attack;
u16 defense;
u16 speed;
u16 spAttack;
u16 spDefense;
};
2021-10-03 04:47:59 +01:00
struct MonSpritesGfxManager
2018-02-11 16:35:01 +00:00
{
2021-10-03 04:47:59 +01:00
u32 numSprites:4;
u32 numSprites2:4; // Never read
u32 numFrames:8;
u32 active:8;
u32 dataSize:4;
u32 mode:4; // MON_SPR_GFX_MODE_*
void *spriteBuffer;
u8 **spritePointers;
2018-02-11 16:35:01 +00:00
struct SpriteTemplate *templates;
struct SpriteFrameImage *frameImages;
};
2021-10-03 04:47:59 +01:00
enum {
MON_SPR_GFX_MODE_NORMAL,
MON_SPR_GFX_MODE_BATTLE,
MON_SPR_GFX_MODE_FULL_PARTY,
};
enum {
MON_SPR_GFX_MANAGER_A,
MON_SPR_GFX_MANAGER_B, // Nothing ever sets up this manager.
MON_SPR_GFX_MANAGERS_COUNT
};
2017-09-04 20:43:13 +01:00
struct BattlePokemon
{
/*0x00*/ u16 species;
/*0x02*/ u16 attack;
/*0x04*/ u16 defense;
/*0x06*/ u16 speed;
/*0x08*/ u16 spAttack;
/*0x0A*/ u16 spDefense;
2019-09-08 16:53:48 +01:00
/*0x0C*/ u16 moves[MAX_MON_MOVES];
2017-09-04 20:43:13 +01:00
/*0x14*/ u32 hpIV:5;
/*0x14*/ u32 attackIV:5;
/*0x15*/ u32 defenseIV:5;
/*0x15*/ u32 speedIV:5;
/*0x16*/ u32 spAttackIV:5;
/*0x17*/ u32 spDefenseIV:5;
/*0x17*/ u32 abilityNum:2;
2018-11-18 19:00:36 +00:00
/*0x18*/ s8 statStages[NUM_BATTLE_STATS];
/*0x20*/ u16 ability;
2024-08-07 19:35:45 +01:00
/*0x22*/ u8 types[3];
/*0x25*/ u8 pp[MAX_MON_MOVES];
/*0x29*/ u16 hp;
/*0x2B*/ u8 level;
/*0x2C*/ u8 friendship;
/*0x2D*/ u16 maxHP;
/*0x2F*/ u16 item;
/*0x31*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
/*0x3C*/ u8 ppBonuses;
/*0x3D*/ u8 otName[PLAYER_NAME_LENGTH + 1];
/*0x45*/ u32 experience;
/*0x49*/ u32 personality;
/*0x4D*/ u32 status1;
/*0x51*/ u32 status2;
/*0x55*/ u32 otId;
/*0x59*/ u8 metLevel;
/*0x5A*/ bool8 isShiny;
2017-09-04 20:43:13 +01:00
};
Species Simplifier™ - Part 3 (#3562) * Added SpeciesInfo fields # Conflicts: # include/pokemon.h * Added missing comments * Renamed gigantamax to isGigantamax * Converted species flags to agbcc bit flags * Added padding after flags * Pikachu form config * Dex text * Reordered Paradox flag * Missing Pikachu ifdef comments * Moved P_GEN_x_POKEMON settings to the species_families file * Gen 1 Dex entries * Renamed file to species_enabled.h * Prevent Pokémon from evolving if their evolution is disabled * Prevent Pokémon from being affected by Eviolite if their evolution is disabled * Prevent Pokémon offspring if they're disabled * Corrected imprementation of evolution prevention It could potentially overwrite items by accident * Cross-evo configs * Gen 2 dex entries * Changed cry table to use assignable IDs # Conflicts: # include/pokemon.h * Form table pointers * Beginning support for moving data to gSpeciesInfo * Pokédexes reads text from gSpeciesInfo * Reading species names from gSpeciesInfo * Fixed erroneous copy-paste * Moved Bulbasaur to Raichu Family data do gSpeciesinfo * Added female pic sizes * Macros for Front, Back, Palette and Learnsets * Sandshrew to Dugtrio Families * Obtains Height/Weight from gSpeciesInfo * Read category from gSpeciesInfo * Removed unused data from pokedex_entries.h * Moved Gen 1 data to gSpeciesInfo * Moved Gen 2 data to gSpeciesInfo + fixed Ursaluna Bloodmoon not producing Teddiursa eggs * Moved Gen 3 data to gSpeciesInfo * Moved Gen 4 data to gSpeciesInfo * HGSS dex properly shows form sprites * Fixed data type for GetSpeciesHeight/Weight * Reading Pokédex Size data from gSpeciesInfo * Cleaned up mon graphic decompression function * Reading Front Pics gSpeciesInfo * Reading Back Pics gSpeciesInfo * Updated uses of GetMonSpritePalStruct to allow loading the data directly instead of reading the struct * Reading palettes from gSpeciesInfo * Reading animation delay from gSpeciesInfo * Fixed Pokémon Debug Menu not reading animation delay * Reading front anim Id from gSpeciesInfo * Reading back anim Id from gSpeciesInfo * Reading Animation Frames from gSpeciesInfo * Reading Icon Sprites from gSpeciesInfo * Reading Icon Palette IDs from gSpeciesInfo * Reading Footprints from gSpeciesInfo * Reading Mon Pic sizes from gSpeciesInfo * Separate mon pic sizes for female mon * Reading Level Up Learnsets from gSpeciesInfo * Reading Teachable Learnsets from gSpeciesInfo * Reading National Dex Number from gSpeciesInfo * Reading Enemy Mon Elevation from gSpeciesInfo * Reading Evolutions from gSpeciesInfo * Reading form table from gSpeciesInfo * Fixed button label inconsistency in pokémon debug menu * Reading form change table from gSpeciesInfo * Removed need to define mon graphics in include/graphics.h * Reordered mon graphics by family * Fixed National dex number offset * gFrontierBannedSpecies now checks IsSpeciesEnabled * Added 3 more toggles for Fusions, Primal Reversions and Ultra Burst * Gen 3 & 4 family toggles for dex entries * Fixed missing Mr. Rime data * Gen 1 dex descriptions as compound strings * Gen 2 dex descriptions as compound strings * Gen 3 dex descriptions as compound strings * Gen 4 dex descriptions as compound strings * Fixed compile in agbcc * Moved Gen 5 data to gSpeciesInfo * Using PLACEHOLDER_ANIM_SINGLE_FRAME when needed (same hash) * Renamed PLACEHOLDER_TWO_FRAME_ANIMATION to PLACEHOLDER_ANIM_TWO_FRAMES * Fixed capitalization for front pic anims * Fixed `CanEvolve` * Moved Gen 6 data to gSpeciesInfo * Gen 7 without macros * Gen 8 without macros * Gen 9 without macros * Fixed Gen 9 sound data * Finished moving Gen 7 data in macros (by Alex) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Ultra Necrozma is now included in the fusion forms define * Cries are now properly excluded from the rom when disabling species * Removed P_GEN_x_POKEMON from form_change_tables.h * Fixed Yanmega's cry ignoring the P_GEN_4_CROSS_EVOS setting * Added P_NEW_EVOS_IN_REGIONAL_DEX setting * Automatic ASSUMPTION_FAIL when used species are disabled * Finished moving Gen 8 data in macros (by Alex) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Expanded Alcremie macro * Finished moving Gen 9 data in macros (by Alex) * Fixed missing data for Komala and Marshadow * Form species id tables use family toggles + added missing Ursaluna form species id table * Fixed Genesect palettes * Fixed Flabébé family graphics * Fixed Minior Graphics * Fixed missing Calyrex data * Family toggles in mon graphcis (By Jasper/Bassoonian) Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed missing Ogerpon data * Ordered Level Up Learnsets (missing toggles) Also added White Basculin learnset * Added more Minior synonyms * Fixed enamorus order * Reordered teachable learnsets * Removed sSpeciesXXX level up learnsets + reordered * Removed unneeded assumes * Removed unused extra animations * Family toggles in mon level up learnsets (By Jasper/Bassoonian) Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed Phione graphics inclusion * Family toggles for Teachable Learnsets Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Ordered Front Pic Anims * Family toggles for front pic animations Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed HGSS dex incorrectly showing the wrong mon when catching it * Family toggles for Egg Moves + reodered Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed HGSS not checking for null footprints * Review changes * Fixed Female difference mon not using their macros * Fixed Alcremie Macro * Fixed compile error when disabling the Bulbasaur family * Fixed Turtwig and Chimchar family + Houndour and Mareep cries not being excluded properly * Re-added missing Egg graphical data * Fixed crash during the Birch Intro when Lotad is disabled * Renamed PALLETE to PALETTES * Removed extra spacing for YOffsets * Fixed compile when only disabling cross-gen evolutions * Added Tera Forms define (Ogerpon and Terapagos) * Fixed Necrozma macro * Removed .noFlip = FALSE * Fixed dex number in summary screen for forms when nat dex is disabled * Fixed Paldean form paths --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-08 14:05:10 +00:00
struct Evolution
{
u16 method;
u16 param;
u16 targetSpecies;
};
struct SpeciesInfo /*0xC4*/
{
u8 baseHP;
u8 baseAttack;
u8 baseDefense;
u8 baseSpeed;
u8 baseSpAttack;
u8 baseSpDefense;
u8 types[2];
u8 catchRate;
u8 forceTeraType;
u16 expYield; // expYield was changed from u8 to u16 for the new Exp System.
u16 evYield_HP:2;
u16 evYield_Attack:2;
u16 evYield_Defense:2;
u16 evYield_Speed:2;
u16 evYield_SpAttack:2;
u16 evYield_SpDefense:2;
u16 padding2:4;
u16 itemCommon;
u16 itemRare;
u8 genderRatio;
u8 eggCycles;
u8 friendship;
u8 growthRate;
u8 eggGroups[2];
u16 abilities[NUM_ABILITY_SLOTS]; // 3 abilities, no longer u8 because we have over 255 abilities now.
u8 safariZoneFleeRate;
// Pokédex data
u8 categoryName[13];
u8 speciesName[POKEMON_NAME_LENGTH + 1];
u16 cryId;
u16 natDexNum;
u16 height; //in decimeters
u16 weight; //in hectograms
u16 pokemonScale;
u16 pokemonOffset;
u16 trainerScale;
u16 trainerOffset;
const u8 *description;
u8 bodyColor:7;
// Graphical Data
u8 noFlip:1;
u8 frontAnimDelay;
u8 frontAnimId;
u8 backAnimId;
const union AnimCmd *const *frontAnimFrames;
const u32 *frontPic;
const u32 *backPic;
const u32 *palette;
const u32 *shinyPalette;
const u8 *iconSprite;
#if P_GENDER_DIFFERENCES
const u32 *frontPicFemale;
const u32 *backPicFemale;
const u32 *paletteFemale;
const u32 *shinyPaletteFemale;
const u8 *iconSpriteFemale;
#endif //P_GENDER_DIFFERENCES
#if P_FOOTPRINTS
const u8 *footprint;
#endif
// All Pokémon pics are 64x64, but this data table defines where in this 64x64 frame the sprite's non-transparent pixels actually are.
u8 frontPicSize; // The dimensions of this drawn pixel area.
u8 frontPicYOffset; // The number of pixels between the drawn pixel area and the bottom edge.
u8 backPicSize; // The dimensions of this drawn pixel area.
u8 backPicYOffset; // The number of pixels between the drawn pixel area and the bottom edge.
#if P_GENDER_DIFFERENCES
u8 frontPicSizeFemale; // The dimensions of this drawn pixel area.
u8 backPicSizeFemale; // The dimensions of this drawn pixel area.
#endif //P_GENDER_DIFFERENCES
u8 iconPalIndex:3;
#if P_GENDER_DIFFERENCES
u8 iconPalIndexFemale:3;
#else
u8 paddingF:3;
#endif //P_GENDER_DIFFERENCES
u8 padding3:2;
u8 enemyMonElevation; // This determines how much higher above the usual position the enemy Pokémon is during battle. Species that float or fly have nonzero values.
// Flags
u32 isLegendary:1;
u32 isMythical:1;
u32 isUltraBeast:1;
u32 isParadox:1;
u32 isTotem:1;
u32 isMegaEvolution:1;
u32 isPrimalReversion:1;
u32 isUltraBurst:1;
u32 isGigantamax:1;
u32 isTeraForm:1;
u32 isAlolanForm:1;
u32 isGalarianForm:1;
u32 isHisuianForm:1;
u32 isPaldeanForm:1;
u32 cannotBeTraded:1;
u32 perfectIVCount:3; // This species will always generate with the specified amount of perfect IVs.
u32 dexForceRequired:1; // This species will be taken into account for Pokédex ratings even if they have the "isMythical" flag set.
u32 tmIlliterate:1; // This species will be unable to learn the universal moves.
u32 isFrontierBanned:1; // This species is not allowed to participate in Battle Frontier facilities.
u32 padding4:11;
// Shadow settings
s8 enemyShadowXOffset; // This determines the X-offset for an enemy Pokémon's shadow during battle; negative values point left, positive values point right.
s8 enemyShadowYOffset; // This determines the Y-offset for an enemy Pokémon's shadow during battle; negative values point up, positive values point down.
u16 enemyShadowSize:3; // This determines the size of the shadow sprite used for an enemy Pokémon's front sprite during battle.
u16 suppressEnemyShadow:1; // If set to true, then a shadow will not be drawn beneath an enemy Pokémon's front sprite during battle.
u16 padding5:12;
// Move Data
const struct LevelUpMove *levelUpLearnset;
const u16 *teachableLearnset;
const u16 *eggMoveLearnset;
const struct Evolution *evolutions;
const u16 *formSpeciesIdTable;
const struct FormChange *formChangeTable;
#if OW_POKEMON_OBJECT_EVENTS
struct ObjectEventGraphicsInfo overworldData;
#if P_GENDER_DIFFERENCES
struct ObjectEventGraphicsInfo overworldDataFemale;
#endif //P_GENDER_DIFFERENCES
#if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE
const void* overworldPalette;
const void* overworldShinyPalette;
#if P_GENDER_DIFFERENCES
const void* overworldPaletteFemale;
const void* overworldShinyPaletteFemale;
#endif //P_GENDER_DIFFERENCES
#endif //OW_PKMN_OBJECTS_SHARE_PALETTES
#endif //OW_POKEMON_OBJECT_EVENTS
};
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
struct MoveInfo
{
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
const u8 *name;
const u8 *description;
u16 effect;
u16 type:5;
u16 category:2;
u16 power:9; // up to 511
u16 accuracy:7;
u16 target:9;
u8 pp;
union {
u8 effect;
u8 powerOverride;
} zMove;
s32 priority:4;
u32 recoil:7;
u32 strikeCount:4; // Max 15 hits. Defaults to 1 if not set. May apply its effect on each hit.
u32 criticalHitStage:2;
u32 alwaysCriticalHit:1;
u32 numAdditionalEffects:2; // limited to 3 - don't want to get too crazy
// 12 bits left to complete this word - continues into flags
Convert move flags and bans into GCC bitfields (#2952) * Slicing moves to new bitfield * Wind moves to new bitfield * Two-strike moves to new bitfield * Forgot to add flagTwoStrikes to battle_moves.h * Removed "flag" from field names * FLAG_HIT_IN_SUBSTITUTE and FLAG_THAW_USER * Airborne moves * FLAG_POWDER, FLAG_TARGET_ABILITY_IGNORED and FLAG_DANCE * FLAG_BALLISTIC and FLAG_PROTECTION_MOVE * Fixed missing uses of MOVE_UNAVAILABLE in battle_ai_util.c * FLAG_SOUND * FLAG_DMG_UNDERGROUND and FLAG_DMG_UNDERWATER * FLAG_DMG_MINIMIZE * Cleanup * FLAG_STAT_STAGES_IGNORED * Updated Pollen Puff's ballistic flag * FLAG_STRONG_JAW_BOOST and FLAG_MEGA_LAUNCHER_BOOST * thaw * FLAG_THREE_STRIKES * FLAG_IRON_FIST_BOOST * FLAG_RECKLESS_BOOST * FLAG_HIGH_CRIT * Removed empty flags * Moves that fail when called by Me First + added missing Shell Trap * Moves that fail when Gravity is active * Better names for banned fields * Moves that fail when called by Instruct * Cleanup * Contact Moves + Fixed Wandering Spirit skipping contact checks * Inverted FLAG_PROTECT_AFFECTED so that there's a flag for moves that SKIP protect. * Simplified B_MOVE_FLAGS configs * FORBIDDEN_METRONOME * Renamed hitsPastSubstitute to ignoresSubstitute * FORBIDDEN_PARENTAL_BOND * Struggle uncallable by Metronome * FORBIDDEN_MIMIC * FLAG_KINGS_ROCK_AFFECTED * Made a single config for move flags * Macro for checking move flags * FLAG_MAGIC_COAT_AFFECTED * Fixed HasMagicCoatAffectedMove * FLAG_SNATCH_AFFECTED * Removed unused EFFECT_FLINCH_MINIMIZE_HIT * Fixed Stench/King's Rock interaction * Removed sMovesNotAffectedByStench in favor of checking move effects * Removed EFFECT_TWISTER, which was a repeat of EFFECT_FLINCH_HIT * Changed Gen2 configs to less than Gen 3 * FORBIDDEN_SLEEP_TALK * Cleanup * Inverted FLAG_MIRROR_MOVE_AFFECTED * FLAG_SHEER_FORCE_BOOST * Ordered * FORBIDDEN_ASSIST and FORBIDDEN_COPYCAT * Removed TestMoveFlags and TestMoveFlagsInMoveset + flags field * Fixed Triple Arrows test
2023-07-03 09:01:59 +01:00
// Flags
u32 makesContact:1;
u32 ignoresProtect:1;
u32 magicCoatAffected:1;
u32 snatchAffected:1;
u32 ignoresKingsRock:1;
u32 punchingMove:1;
u32 bitingMove:1;
u32 pulseMove:1;
u32 soundMove:1;
u32 ballisticMove:1;
u32 powderMove:1;
u32 danceMove:1;
u32 windMove:1;
2024-02-25 08:54:04 +00:00
u32 slicingMove:1; // end of word
2024-01-30 08:54:43 +00:00
u32 healingMove:1;
Convert move flags and bans into GCC bitfields (#2952) * Slicing moves to new bitfield * Wind moves to new bitfield * Two-strike moves to new bitfield * Forgot to add flagTwoStrikes to battle_moves.h * Removed "flag" from field names * FLAG_HIT_IN_SUBSTITUTE and FLAG_THAW_USER * Airborne moves * FLAG_POWDER, FLAG_TARGET_ABILITY_IGNORED and FLAG_DANCE * FLAG_BALLISTIC and FLAG_PROTECTION_MOVE * Fixed missing uses of MOVE_UNAVAILABLE in battle_ai_util.c * FLAG_SOUND * FLAG_DMG_UNDERGROUND and FLAG_DMG_UNDERWATER * FLAG_DMG_MINIMIZE * Cleanup * FLAG_STAT_STAGES_IGNORED * Updated Pollen Puff's ballistic flag * FLAG_STRONG_JAW_BOOST and FLAG_MEGA_LAUNCHER_BOOST * thaw * FLAG_THREE_STRIKES * FLAG_IRON_FIST_BOOST * FLAG_RECKLESS_BOOST * FLAG_HIGH_CRIT * Removed empty flags * Moves that fail when called by Me First + added missing Shell Trap * Moves that fail when Gravity is active * Better names for banned fields * Moves that fail when called by Instruct * Cleanup * Contact Moves + Fixed Wandering Spirit skipping contact checks * Inverted FLAG_PROTECT_AFFECTED so that there's a flag for moves that SKIP protect. * Simplified B_MOVE_FLAGS configs * FORBIDDEN_METRONOME * Renamed hitsPastSubstitute to ignoresSubstitute * FORBIDDEN_PARENTAL_BOND * Struggle uncallable by Metronome * FORBIDDEN_MIMIC * FLAG_KINGS_ROCK_AFFECTED * Made a single config for move flags * Macro for checking move flags * FLAG_MAGIC_COAT_AFFECTED * Fixed HasMagicCoatAffectedMove * FLAG_SNATCH_AFFECTED * Removed unused EFFECT_FLINCH_MINIMIZE_HIT * Fixed Stench/King's Rock interaction * Removed sMovesNotAffectedByStench in favor of checking move effects * Removed EFFECT_TWISTER, which was a repeat of EFFECT_FLINCH_HIT * Changed Gen2 configs to less than Gen 3 * FORBIDDEN_SLEEP_TALK * Cleanup * Inverted FLAG_MIRROR_MOVE_AFFECTED * FLAG_SHEER_FORCE_BOOST * Ordered * FORBIDDEN_ASSIST and FORBIDDEN_COPYCAT * Removed TestMoveFlags and TestMoveFlagsInMoveset + flags field * Fixed Triple Arrows test
2023-07-03 09:01:59 +01:00
u32 minimizeDoubleDamage:1;
u32 ignoresTargetAbility:1;
u32 ignoresTargetDefenseEvasionStages:1;
u32 damagesUnderground:1;
u32 damagesUnderwater:1;
u32 damagesAirborne:1;
u32 damagesAirborneDoubleDamage:1;
u32 ignoreTypeIfFlyingAndUngrounded:1;
u32 thawsUser:1;
u32 ignoresSubstitute:1;
u32 forcePressure:1;
u32 cantUseTwice:1;
2024-01-30 08:54:43 +00:00
// Ban flags
Convert move flags and bans into GCC bitfields (#2952) * Slicing moves to new bitfield * Wind moves to new bitfield * Two-strike moves to new bitfield * Forgot to add flagTwoStrikes to battle_moves.h * Removed "flag" from field names * FLAG_HIT_IN_SUBSTITUTE and FLAG_THAW_USER * Airborne moves * FLAG_POWDER, FLAG_TARGET_ABILITY_IGNORED and FLAG_DANCE * FLAG_BALLISTIC and FLAG_PROTECTION_MOVE * Fixed missing uses of MOVE_UNAVAILABLE in battle_ai_util.c * FLAG_SOUND * FLAG_DMG_UNDERGROUND and FLAG_DMG_UNDERWATER * FLAG_DMG_MINIMIZE * Cleanup * FLAG_STAT_STAGES_IGNORED * Updated Pollen Puff's ballistic flag * FLAG_STRONG_JAW_BOOST and FLAG_MEGA_LAUNCHER_BOOST * thaw * FLAG_THREE_STRIKES * FLAG_IRON_FIST_BOOST * FLAG_RECKLESS_BOOST * FLAG_HIGH_CRIT * Removed empty flags * Moves that fail when called by Me First + added missing Shell Trap * Moves that fail when Gravity is active * Better names for banned fields * Moves that fail when called by Instruct * Cleanup * Contact Moves + Fixed Wandering Spirit skipping contact checks * Inverted FLAG_PROTECT_AFFECTED so that there's a flag for moves that SKIP protect. * Simplified B_MOVE_FLAGS configs * FORBIDDEN_METRONOME * Renamed hitsPastSubstitute to ignoresSubstitute * FORBIDDEN_PARENTAL_BOND * Struggle uncallable by Metronome * FORBIDDEN_MIMIC * FLAG_KINGS_ROCK_AFFECTED * Made a single config for move flags * Macro for checking move flags * FLAG_MAGIC_COAT_AFFECTED * Fixed HasMagicCoatAffectedMove * FLAG_SNATCH_AFFECTED * Removed unused EFFECT_FLINCH_MINIMIZE_HIT * Fixed Stench/King's Rock interaction * Removed sMovesNotAffectedByStench in favor of checking move effects * Removed EFFECT_TWISTER, which was a repeat of EFFECT_FLINCH_HIT * Changed Gen2 configs to less than Gen 3 * FORBIDDEN_SLEEP_TALK * Cleanup * Inverted FLAG_MIRROR_MOVE_AFFECTED * FLAG_SHEER_FORCE_BOOST * Ordered * FORBIDDEN_ASSIST and FORBIDDEN_COPYCAT * Removed TestMoveFlags and TestMoveFlagsInMoveset + flags field * Fixed Triple Arrows test
2023-07-03 09:01:59 +01:00
u32 gravityBanned:1;
2024-01-30 08:54:43 +00:00
u32 mirrorMoveBanned:1;
u32 meFirstBanned:1;
Convert move flags and bans into GCC bitfields (#2952) * Slicing moves to new bitfield * Wind moves to new bitfield * Two-strike moves to new bitfield * Forgot to add flagTwoStrikes to battle_moves.h * Removed "flag" from field names * FLAG_HIT_IN_SUBSTITUTE and FLAG_THAW_USER * Airborne moves * FLAG_POWDER, FLAG_TARGET_ABILITY_IGNORED and FLAG_DANCE * FLAG_BALLISTIC and FLAG_PROTECTION_MOVE * Fixed missing uses of MOVE_UNAVAILABLE in battle_ai_util.c * FLAG_SOUND * FLAG_DMG_UNDERGROUND and FLAG_DMG_UNDERWATER * FLAG_DMG_MINIMIZE * Cleanup * FLAG_STAT_STAGES_IGNORED * Updated Pollen Puff's ballistic flag * FLAG_STRONG_JAW_BOOST and FLAG_MEGA_LAUNCHER_BOOST * thaw * FLAG_THREE_STRIKES * FLAG_IRON_FIST_BOOST * FLAG_RECKLESS_BOOST * FLAG_HIGH_CRIT * Removed empty flags * Moves that fail when called by Me First + added missing Shell Trap * Moves that fail when Gravity is active * Better names for banned fields * Moves that fail when called by Instruct * Cleanup * Contact Moves + Fixed Wandering Spirit skipping contact checks * Inverted FLAG_PROTECT_AFFECTED so that there's a flag for moves that SKIP protect. * Simplified B_MOVE_FLAGS configs * FORBIDDEN_METRONOME * Renamed hitsPastSubstitute to ignoresSubstitute * FORBIDDEN_PARENTAL_BOND * Struggle uncallable by Metronome * FORBIDDEN_MIMIC * FLAG_KINGS_ROCK_AFFECTED * Made a single config for move flags * Macro for checking move flags * FLAG_MAGIC_COAT_AFFECTED * Fixed HasMagicCoatAffectedMove * FLAG_SNATCH_AFFECTED * Removed unused EFFECT_FLINCH_MINIMIZE_HIT * Fixed Stench/King's Rock interaction * Removed sMovesNotAffectedByStench in favor of checking move effects * Removed EFFECT_TWISTER, which was a repeat of EFFECT_FLINCH_HIT * Changed Gen2 configs to less than Gen 3 * FORBIDDEN_SLEEP_TALK * Cleanup * Inverted FLAG_MIRROR_MOVE_AFFECTED * FLAG_SHEER_FORCE_BOOST * Ordered * FORBIDDEN_ASSIST and FORBIDDEN_COPYCAT * Removed TestMoveFlags and TestMoveFlagsInMoveset + flags field * Fixed Triple Arrows test
2023-07-03 09:01:59 +01:00
u32 mimicBanned:1;
u32 metronomeBanned:1;
u32 copycatBanned:1;
u32 assistBanned:1; // Matches same moves as copycatBanned + semi-invulnerable moves and Mirror Coat.
Convert move flags and bans into GCC bitfields (#2952) * Slicing moves to new bitfield * Wind moves to new bitfield * Two-strike moves to new bitfield * Forgot to add flagTwoStrikes to battle_moves.h * Removed "flag" from field names * FLAG_HIT_IN_SUBSTITUTE and FLAG_THAW_USER * Airborne moves * FLAG_POWDER, FLAG_TARGET_ABILITY_IGNORED and FLAG_DANCE * FLAG_BALLISTIC and FLAG_PROTECTION_MOVE * Fixed missing uses of MOVE_UNAVAILABLE in battle_ai_util.c * FLAG_SOUND * FLAG_DMG_UNDERGROUND and FLAG_DMG_UNDERWATER * FLAG_DMG_MINIMIZE * Cleanup * FLAG_STAT_STAGES_IGNORED * Updated Pollen Puff's ballistic flag * FLAG_STRONG_JAW_BOOST and FLAG_MEGA_LAUNCHER_BOOST * thaw * FLAG_THREE_STRIKES * FLAG_IRON_FIST_BOOST * FLAG_RECKLESS_BOOST * FLAG_HIGH_CRIT * Removed empty flags * Moves that fail when called by Me First + added missing Shell Trap * Moves that fail when Gravity is active * Better names for banned fields * Moves that fail when called by Instruct * Cleanup * Contact Moves + Fixed Wandering Spirit skipping contact checks * Inverted FLAG_PROTECT_AFFECTED so that there's a flag for moves that SKIP protect. * Simplified B_MOVE_FLAGS configs * FORBIDDEN_METRONOME * Renamed hitsPastSubstitute to ignoresSubstitute * FORBIDDEN_PARENTAL_BOND * Struggle uncallable by Metronome * FORBIDDEN_MIMIC * FLAG_KINGS_ROCK_AFFECTED * Made a single config for move flags * Macro for checking move flags * FLAG_MAGIC_COAT_AFFECTED * Fixed HasMagicCoatAffectedMove * FLAG_SNATCH_AFFECTED * Removed unused EFFECT_FLINCH_MINIMIZE_HIT * Fixed Stench/King's Rock interaction * Removed sMovesNotAffectedByStench in favor of checking move effects * Removed EFFECT_TWISTER, which was a repeat of EFFECT_FLINCH_HIT * Changed Gen2 configs to less than Gen 3 * FORBIDDEN_SLEEP_TALK * Cleanup * Inverted FLAG_MIRROR_MOVE_AFFECTED * FLAG_SHEER_FORCE_BOOST * Ordered * FORBIDDEN_ASSIST and FORBIDDEN_COPYCAT * Removed TestMoveFlags and TestMoveFlagsInMoveset + flags field * Fixed Triple Arrows test
2023-07-03 09:01:59 +01:00
u32 sleepTalkBanned:1;
u32 instructBanned:1;
u32 encoreBanned:1;
u32 parentalBondBanned:1;
Added support for XY's Sky Battles (#2950) * Original implementation from Phlayne * Moved Sky Battle Flag / Var into a config * Optimized existing code and fixed existing bugs Added error message for when sky battle var and flag are not set Merged CanDoSkyBattle and PrepareSkyBattle into one special * Added compatibility for Gen7+ * Commented out Volt Crash from banned moves * Cleaned up debug scripts from testing * Fixed bug where player did not white out even if they had no healthy Pokémon and only an egg Zeroed out both Sky Battle configs * Removed extra include from src/field_specials.c Removed extra line break in src/battle_script_commands.c * Added FLAG_DISABLED_IN_SKY_BATTLE Added FLAG_DISABLED_IN_SKY_BATTLE to appropriate moves * Changed DoesSkyBattleCancelCurrentMove to look at move flags * Fixed alignment and spacing in battle_moves.h * Added FLAG_DISABLED_IN_SKY_BATTLE to Sticky Web * Added FLAG_DISABLED_IN_SKY_BATTLE to Steel Roller * Disabled the ability to change Battle Terrain when Sky Battle is happening Stopped Ceaseless Edge from spawning Spikes when Sky Battle is happening Added B_SKY_BATTLE_STRICT_MECHANICS config * Fixed bug with SKY_BATTLE_STRICT_MECHANICS where conditions were not consistently being applied * Add rulesVariants to the BattleStruct Added skyBattle check in AllocateBattleResources * Replaced B_FLAG_SKY_BATTLE checks with rulesVariants.skyBattle checks * Fixed debug script * Reverted include/config/battle.h * Fixed spacing and placement of functions * Fixed debug script omission Fixed bug where Spikes did not set from Ceaseless Edge and Stone Axe * Added FLAG_DISABLED_IN_SKY_BATTLE to Psychic Terrain * Addressed DizzyEgg PR feedback * Forgot a file in last commit * Addressed feedback from DizzyEggg * Address Lunos' PR feedback * Update specials.inc Added an empty line at the end of data/specials.inc * Fixed spacing * Apply suggestions from code review Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Updated skyBattleBanned and HandleBattleVariantEndParty to use correct names * Removed STRICT_MOVES and STRICT_MECHANICS * Fixed minor spacing issues with merge * Merged in upcoming * Implemented feedback from Jasper https://github.com/rh-hideout/pokeemerald-expansion/pull/2950/files/5da6117d1bc725900c6386e62ab719f8e1695027 --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-11-26 15:59:44 +00:00
u32 skyBattleBanned:1;
u32 sketchBanned:1;
u32 padding:5; // end of word
u32 argument;
// primary/secondary effects
const struct AdditionalEffect *additionalEffects;
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
// contest parameters
u8 contestEffect;
u8 contestCategory:3;
u8 contestComboStarterId;
u8 contestComboMoves[MAX_COMBO_MOVES];
const u8 *battleAnimScript;
};
#define EFFECTS_ARR(...) (const struct AdditionalEffect[]) {__VA_ARGS__}
#define ADDITIONAL_EFFECTS(...) EFFECTS_ARR( __VA_ARGS__ ), .numAdditionalEffects = ARRAY_COUNT(EFFECTS_ARR( __VA_ARGS__ ))
2023-11-25 14:06:51 +00:00
2024-01-30 04:27:46 +00:00
// Just a hack to make a move boosted by Sheer Force despite having no secondary effects affected
#define SHEER_FORCE_HACK { .moveEffect = 0, .chance = 100, }
struct AdditionalEffect
{
2024-01-30 08:54:43 +00:00
u16 moveEffect;
u8 self:1;
u8 onlyIfTargetRaisedStats:1;
u8 onChargeTurnOnly:1;
u8 chance; // 0% = effect certain, primary effect
};
struct Ability
{
u8 name[ABILITY_NAME_LENGTH + 1];
const u8 *description;
s8 aiRating;
u8 cantBeCopied:1; // cannot be copied by Role Play or Doodle
u8 cantBeSwapped:1; // cannot be swapped with Skill Swap or Wandering Spirit
u8 cantBeTraced:1; // cannot be copied by Trace - same as cantBeCopied except for Wonder Guard
u8 cantBeSuppressed:1; // cannot be negated by Gastro Acid or Neutralizing Gas
u8 cantBeOverwritten:1; // cannot be overwritten by Entrainment, Worry Seed or Simple Beam (but can be by Mummy) - same as cantBeSuppressed except for Truant
u8 breakable:1; // can be bypassed by Mold Breaker and clones
u8 failsOnImposter:1; // doesn't work on an Imposter mon; when can we actually use this?
};
enum {
AFFINE_NONE,
AFFINE_TURN_UP,
AFFINE_TURN_UP_AND_DOWN,
AFFINE_TURN_DOWN,
AFFINE_TURN_DOWN_SLOW,
AFFINE_TURN_DOWN_SLIGHT,
AFFINE_TURN_UP_HIGH,
AFFINE_UNUSED_1,
AFFINE_UNUSED_2,
AFFINE_UNUSED_3,
NUM_MON_AFFINES,
};
// The animation the Pokémon does during the feeding scene depends on their nature.
// The below values are offsets into sMonPokeblockAnims of the animation data for that nature.
#define ANIM_HARDY 0
#define ANIM_LONELY (ANIM_HARDY + 3)
#define ANIM_BRAVE (ANIM_LONELY + 1)
#define ANIM_ADAMANT (ANIM_BRAVE + 1)
#define ANIM_NAUGHTY (ANIM_ADAMANT + 5)
#define ANIM_BOLD (ANIM_NAUGHTY + 3)
#define ANIM_DOCILE (ANIM_BOLD + 2)
#define ANIM_RELAXED (ANIM_DOCILE + 1)
#define ANIM_IMPISH (ANIM_RELAXED + 2)
#define ANIM_LAX (ANIM_IMPISH + 1)
#define ANIM_TIMID (ANIM_LAX + 1)
#define ANIM_HASTY (ANIM_TIMID + 5)
#define ANIM_SERIOUS (ANIM_HASTY + 2)
#define ANIM_JOLLY (ANIM_SERIOUS + 1)
#define ANIM_NAIVE (ANIM_JOLLY + 1)
#define ANIM_MODEST (ANIM_NAIVE + 4)
#define ANIM_MILD (ANIM_MODEST + 3)
#define ANIM_QUIET (ANIM_MILD + 1)
#define ANIM_BASHFUL (ANIM_QUIET + 2)
#define ANIM_RASH (ANIM_BASHFUL + 3)
#define ANIM_CALM (ANIM_RASH + 3)
#define ANIM_GENTLE (ANIM_CALM + 1)
#define ANIM_SASSY (ANIM_GENTLE + 1)
#define ANIM_CAREFUL (ANIM_SASSY + 1)
#define ANIM_QUIRKY (ANIM_CAREFUL + 5)
// In palace double battles, Pokémon have a target preference depending on nature
#define PALACE_TARGET_STRONGER 0
#define PALACE_TARGET_WEAKER 1
#define PALACE_TARGET_RANDOM 2
struct NatureInfo
{
const u8 *name;
u8 statUp;
u8 statDown;
u8 backAnim;
u8 pokeBlockAnim[2];
u8 battlePalacePercents[4];
u8 battlePalaceFlavorText;
u8 battlePalaceSmokescreen;
const u8 *natureGirlMessage;
};
#define SPINDA_SPOT_WIDTH 16
#define SPINDA_SPOT_HEIGHT 16
2017-09-11 10:35:41 +01:00
struct SpindaSpot
{
u8 x, y;
u16 image[SPINDA_SPOT_HEIGHT];
2017-09-11 10:35:41 +01:00
};
2018-09-22 12:52:38 +01:00
struct LevelUpMove
2017-09-06 16:19:08 +01:00
{
2018-09-22 12:52:38 +01:00
u16 move;
u16 level;
2017-09-06 16:19:08 +01:00
};
struct FormChange
{
2021-01-27 22:26:18 +00:00
u16 method;
u16 targetSpecies;
u16 param1;
u16 param2;
u16 param3;
2021-01-27 22:26:18 +00:00
};
2021-03-02 20:25:15 +00:00
Add support for legendary fusion (#3274) * Legendary Mon Fusion Evolution Compatibility Added Kyurem, Calyrex, and Necrozma Fusions have been implemented, however, the animation for the the process is incomplete, the party menu screen needs to be updated while the screen is whited out and it has proved beyond me right now. Smh * Added Fusion Move Prompts Handles cases for learning the fusion moves from the other fused mon and deleting the move when you unfuse (plus learning confusion (well a set choice in the data struct) if there are no moves left after deleting one) * Fix Bug With Fusion Mon Move Learning If the main fusion came after the fused mon in the party order it would try to teach the move to the next member in the party * Apply suggestions from code review Co-authored-by: LOuroboros <lunosouroboros@gmail.com> * Fix build * Fix fusion items being used up * Fixed animations * RefreshPartyMenu * Apply suggestions from code review Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Apply suggestions * Update form_change_tables.h * Fix animation and simplify fusion tables * Fix party full message * Remove trailing whitespaces * Update party_menu.c * Update party_menu.c * Make IsFusionMon better * Apply suggestions from code review Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> --------- Co-authored-by: TeamAquasHideout <jonathonheddings@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> Co-authored-by: LOuroboros <lunosouroboros@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-11-23 21:59:51 +00:00
struct Fusion
{
u16 fusionStorageIndex;
u16 itemId;
u16 targetSpecies1;
u16 targetSpecies2;
u16 fusingIntoMon;
u16 fusionMove;
u16 unfuseForgetMove;
};
extern const struct Fusion *const gFusionTablePointers[NUM_SPECIES];
2021-01-19 09:03:16 +00:00
#define NUM_UNOWN_FORMS 28
2021-01-19 17:36:36 +00:00
#define GET_UNOWN_LETTER(personality) (( \
(((personality) & 0x03000000) >> 18) \
| (((personality) & 0x00030000) >> 12) \
| (((personality) & 0x00000300) >> 6) \
| (((personality) & 0x00000003) >> 0) \
2021-01-19 09:03:16 +00:00
) % NUM_UNOWN_FORMS)
2022-09-11 18:35:58 +01:00
#define GET_SHINY_VALUE(otId, personality) (HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality))
2017-09-06 16:19:08 +01:00
extern u8 gPlayerPartyCount;
extern struct Pokemon gPlayerParty[PARTY_SIZE];
extern u8 gEnemyPartyCount;
extern struct Pokemon gEnemyParty[PARTY_SIZE];
extern struct SpriteTemplate gMultiuseSpriteTemplate;
extern u16 gFollowerSteps;
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
extern const struct MoveInfo gMovesInfo[];
extern const u8 gFacilityClassToPicIndex[];
extern const u8 gFacilityClassToTrainerClass[];
2022-10-24 21:01:48 +01:00
extern const struct SpeciesInfo gSpeciesInfo[];
2018-10-17 03:47:08 +01:00
extern const u32 gExperienceTables[][MAX_LEVEL + 1];
extern const u8 gPPUpGetMask[];
extern const u8 gPPUpClearMask[];
extern const u8 gPPUpAddValues[];
2020-08-05 01:33:05 +01:00
extern const u8 gStatStageRatios[MAX_STAT_STAGE + 1][2];
extern const u16 gUnionRoomFacilityClasses[];
2021-01-23 04:22:37 +00:00
extern const struct SpriteTemplate gBattlerSpriteTemplates[];
2022-08-31 14:05:51 +01:00
extern const u32 sExpCandyExperienceTable[];
extern const struct Ability gAbilitiesInfo[];
extern const struct NatureInfo gNaturesInfo[];
2017-09-11 17:27:54 +01:00
2017-09-06 16:19:08 +01:00
void ZeroBoxMonData(struct BoxPokemon *boxMon);
void ZeroMonData(struct Pokemon *mon);
void ZeroPlayerPartyMons(void);
void ZeroEnemyPartyMons(void);
void CreateMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
void CreateMonWithNature(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 nature);
void CreateMonWithGenderNatureLetter(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 gender, u8 nature, u8 unownLetter);
void CreateMaleMon(struct Pokemon *mon, u16 species, u8 level);
void CreateMonWithIVsPersonality(struct Pokemon *mon, u16 species, u8 level, u32 ivs, u32 personality);
void CreateMonWithIVsOTID(struct Pokemon *mon, u16 species, u8 level, u8 *ivs, u32 otId);
void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 evSpread);
2019-01-13 11:12:27 +00:00
void CreateBattleTowerMon(struct Pokemon *mon, struct BattleTowerPokemon *src);
void CreateBattleTowerMon_HandleLevel(struct Pokemon *mon, struct BattleTowerPokemon *src, bool8 lvl50);
void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 monId);
2018-11-11 15:44:27 +00:00
void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId);
2020-12-24 21:18:47 +00:00
void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest);
2021-01-23 04:22:37 +00:00
bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId);
2020-06-03 20:28:29 +01:00
u16 GetUnionRoomTrainerPic(void);
u16 GetUnionRoomTrainerClass(void);
2023-02-15 16:56:11 +00:00
void CreateEnemyEventMon(void);
2017-09-06 16:19:08 +01:00
void CalculateMonStats(struct Pokemon *mon);
2018-02-11 16:35:01 +00:00
void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest);
2017-09-06 16:19:08 +01:00
u8 GetLevelFromMonExp(struct Pokemon *mon);
u8 GetLevelFromBoxMonExp(struct BoxPokemon *boxMon);
u16 GiveMoveToMon(struct Pokemon *mon, u16 move);
2023-04-30 10:25:48 +01:00
u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
2017-09-06 16:19:08 +01:00
u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move);
void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot);
void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot);
void GiveMonInitialMoveset(struct Pokemon *mon);
void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon);
2018-02-11 16:35:01 +00:00
u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove);
2017-09-06 16:19:08 +01:00
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move);
void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
u8 CountAliveMonsInBattle(u8 caseId, u32 battler);
2018-02-11 16:35:01 +00:00
u8 GetDefaultMoveTarget(u8 battlerId);
2017-09-06 16:19:08 +01:00
u8 GetMonGender(struct Pokemon *mon);
u8 GetBoxMonGender(struct BoxPokemon *boxMon);
u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality);
bool32 IsPersonalityFemale(u16 species, u32 personality);
2019-04-07 11:40:18 +01:00
u32 GetUnownSpeciesId(u32 personality);
2019-04-04 23:07:39 +01:00
void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition);
void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition);
2022-05-21 20:21:50 +01:00
void SetMultiuseSpriteTemplateToTrainerFront(u16 trainerPicId, u8 battlerPosition);
2017-09-06 16:19:08 +01:00
/* GameFreak called Get(Box)MonData with either 2 or 3 arguments, for
* type safety we have a Get(Box)MonData macro which dispatches to
* either Get(Box)MonData2 or Get(Box)MonData3 based on the number of
* arguments. The two functions are aliases of each other, but they
* differ for matching purposes in the caller's codegen. */
#define GetMonData(...) CAT(GetMonData, NARG_8(__VA_ARGS__))(__VA_ARGS__)
#define GetBoxMonData(...) CAT(GetBoxMonData, NARG_8(__VA_ARGS__))(__VA_ARGS__)
u32 GetMonData3(struct Pokemon *mon, s32 field, u8 *data);
u32 GetMonData2(struct Pokemon *mon, s32 field);
u32 GetBoxMonData3(struct BoxPokemon *boxMon, s32 field, u8 *data);
u32 GetBoxMonData2(struct BoxPokemon *boxMon, s32 field);
2018-02-11 16:35:01 +00:00
void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg);
void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg);
2017-09-06 16:19:08 +01:00
void CopyMon(void *dest, void *src, size_t size);
u8 GiveMonToPlayer(struct Pokemon *mon);
u8 CopyMonToPC(struct Pokemon *mon);
2017-09-06 16:19:08 +01:00
u8 CalculatePlayerPartyCount(void);
u8 CalculateEnemyPartyCount(void);
u8 CalculateEnemyPartyCountInSide(u32 battler);
2018-02-11 16:35:01 +00:00
u8 GetMonsStateToDoubles(void);
u8 GetMonsStateToDoubles_2(void);
u16 GetAbilityBySpecies(u16 species, u8 abilityNum);
u16 GetMonAbility(struct Pokemon *mon);
2019-04-05 22:11:24 +01:00
void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord);
2017-09-06 16:19:08 +01:00
u8 GetSecretBaseTrainerPicIndex(void);
2018-02-11 16:35:01 +00:00
u8 GetSecretBaseTrainerClass(void);
2017-09-11 23:01:12 +01:00
bool8 IsPlayerPartyAndPokemonStorageFull(void);
bool8 IsPokemonStorageFull(void);
const u8 *GetSpeciesName(u16 species);
Species Simplifier™ - Part 3 (#3562) * Added SpeciesInfo fields # Conflicts: # include/pokemon.h * Added missing comments * Renamed gigantamax to isGigantamax * Converted species flags to agbcc bit flags * Added padding after flags * Pikachu form config * Dex text * Reordered Paradox flag * Missing Pikachu ifdef comments * Moved P_GEN_x_POKEMON settings to the species_families file * Gen 1 Dex entries * Renamed file to species_enabled.h * Prevent Pokémon from evolving if their evolution is disabled * Prevent Pokémon from being affected by Eviolite if their evolution is disabled * Prevent Pokémon offspring if they're disabled * Corrected imprementation of evolution prevention It could potentially overwrite items by accident * Cross-evo configs * Gen 2 dex entries * Changed cry table to use assignable IDs # Conflicts: # include/pokemon.h * Form table pointers * Beginning support for moving data to gSpeciesInfo * Pokédexes reads text from gSpeciesInfo * Reading species names from gSpeciesInfo * Fixed erroneous copy-paste * Moved Bulbasaur to Raichu Family data do gSpeciesinfo * Added female pic sizes * Macros for Front, Back, Palette and Learnsets * Sandshrew to Dugtrio Families * Obtains Height/Weight from gSpeciesInfo * Read category from gSpeciesInfo * Removed unused data from pokedex_entries.h * Moved Gen 1 data to gSpeciesInfo * Moved Gen 2 data to gSpeciesInfo + fixed Ursaluna Bloodmoon not producing Teddiursa eggs * Moved Gen 3 data to gSpeciesInfo * Moved Gen 4 data to gSpeciesInfo * HGSS dex properly shows form sprites * Fixed data type for GetSpeciesHeight/Weight * Reading Pokédex Size data from gSpeciesInfo * Cleaned up mon graphic decompression function * Reading Front Pics gSpeciesInfo * Reading Back Pics gSpeciesInfo * Updated uses of GetMonSpritePalStruct to allow loading the data directly instead of reading the struct * Reading palettes from gSpeciesInfo * Reading animation delay from gSpeciesInfo * Fixed Pokémon Debug Menu not reading animation delay * Reading front anim Id from gSpeciesInfo * Reading back anim Id from gSpeciesInfo * Reading Animation Frames from gSpeciesInfo * Reading Icon Sprites from gSpeciesInfo * Reading Icon Palette IDs from gSpeciesInfo * Reading Footprints from gSpeciesInfo * Reading Mon Pic sizes from gSpeciesInfo * Separate mon pic sizes for female mon * Reading Level Up Learnsets from gSpeciesInfo * Reading Teachable Learnsets from gSpeciesInfo * Reading National Dex Number from gSpeciesInfo * Reading Enemy Mon Elevation from gSpeciesInfo * Reading Evolutions from gSpeciesInfo * Reading form table from gSpeciesInfo * Fixed button label inconsistency in pokémon debug menu * Reading form change table from gSpeciesInfo * Removed need to define mon graphics in include/graphics.h * Reordered mon graphics by family * Fixed National dex number offset * gFrontierBannedSpecies now checks IsSpeciesEnabled * Added 3 more toggles for Fusions, Primal Reversions and Ultra Burst * Gen 3 & 4 family toggles for dex entries * Fixed missing Mr. Rime data * Gen 1 dex descriptions as compound strings * Gen 2 dex descriptions as compound strings * Gen 3 dex descriptions as compound strings * Gen 4 dex descriptions as compound strings * Fixed compile in agbcc * Moved Gen 5 data to gSpeciesInfo * Using PLACEHOLDER_ANIM_SINGLE_FRAME when needed (same hash) * Renamed PLACEHOLDER_TWO_FRAME_ANIMATION to PLACEHOLDER_ANIM_TWO_FRAMES * Fixed capitalization for front pic anims * Fixed `CanEvolve` * Moved Gen 6 data to gSpeciesInfo * Gen 7 without macros * Gen 8 without macros * Gen 9 without macros * Fixed Gen 9 sound data * Finished moving Gen 7 data in macros (by Alex) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Ultra Necrozma is now included in the fusion forms define * Cries are now properly excluded from the rom when disabling species * Removed P_GEN_x_POKEMON from form_change_tables.h * Fixed Yanmega's cry ignoring the P_GEN_4_CROSS_EVOS setting * Added P_NEW_EVOS_IN_REGIONAL_DEX setting * Automatic ASSUMPTION_FAIL when used species are disabled * Finished moving Gen 8 data in macros (by Alex) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Expanded Alcremie macro * Finished moving Gen 9 data in macros (by Alex) * Fixed missing data for Komala and Marshadow * Form species id tables use family toggles + added missing Ursaluna form species id table * Fixed Genesect palettes * Fixed Flabébé family graphics * Fixed Minior Graphics * Fixed missing Calyrex data * Family toggles in mon graphcis (By Jasper/Bassoonian) Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed missing Ogerpon data * Ordered Level Up Learnsets (missing toggles) Also added White Basculin learnset * Added more Minior synonyms * Fixed enamorus order * Reordered teachable learnsets * Removed sSpeciesXXX level up learnsets + reordered * Removed unneeded assumes * Removed unused extra animations * Family toggles in mon level up learnsets (By Jasper/Bassoonian) Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed Phione graphics inclusion * Family toggles for Teachable Learnsets Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Ordered Front Pic Anims * Family toggles for front pic animations Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed HGSS dex incorrectly showing the wrong mon when catching it * Family toggles for Egg Moves + reodered Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed HGSS not checking for null footprints * Review changes * Fixed Female difference mon not using their macros * Fixed Alcremie Macro * Fixed compile error when disabling the Bulbasaur family * Fixed Turtwig and Chimchar family + Houndour and Mareep cries not being excluded properly * Re-added missing Egg graphical data * Fixed crash during the Birch Intro when Lotad is disabled * Renamed PALLETE to PALETTES * Removed extra spacing for YOffsets * Fixed compile when only disabling cross-gen evolutions * Added Tera Forms define (Ogerpon and Terapagos) * Fixed Necrozma macro * Removed .noFlip = FALSE * Fixed dex number in summary screen for forms when nat dex is disabled * Fixed Paldean form paths --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-08 14:05:10 +00:00
const u8 *GetSpeciesCategory(u16 species);
const u8 *GetSpeciesPokedexDescription(u16 species);
u16 GetSpeciesHeight(u16 species);
u16 GetSpeciesWeight(u16 species);
const struct LevelUpMove *GetSpeciesLevelUpLearnset(u16 species);
const u16 *GetSpeciesTeachableLearnset(u16 species);
const u16 *GetSpeciesEggMoves(u16 species);
Species Simplifier™ - Part 3 (#3562) * Added SpeciesInfo fields # Conflicts: # include/pokemon.h * Added missing comments * Renamed gigantamax to isGigantamax * Converted species flags to agbcc bit flags * Added padding after flags * Pikachu form config * Dex text * Reordered Paradox flag * Missing Pikachu ifdef comments * Moved P_GEN_x_POKEMON settings to the species_families file * Gen 1 Dex entries * Renamed file to species_enabled.h * Prevent Pokémon from evolving if their evolution is disabled * Prevent Pokémon from being affected by Eviolite if their evolution is disabled * Prevent Pokémon offspring if they're disabled * Corrected imprementation of evolution prevention It could potentially overwrite items by accident * Cross-evo configs * Gen 2 dex entries * Changed cry table to use assignable IDs # Conflicts: # include/pokemon.h * Form table pointers * Beginning support for moving data to gSpeciesInfo * Pokédexes reads text from gSpeciesInfo * Reading species names from gSpeciesInfo * Fixed erroneous copy-paste * Moved Bulbasaur to Raichu Family data do gSpeciesinfo * Added female pic sizes * Macros for Front, Back, Palette and Learnsets * Sandshrew to Dugtrio Families * Obtains Height/Weight from gSpeciesInfo * Read category from gSpeciesInfo * Removed unused data from pokedex_entries.h * Moved Gen 1 data to gSpeciesInfo * Moved Gen 2 data to gSpeciesInfo + fixed Ursaluna Bloodmoon not producing Teddiursa eggs * Moved Gen 3 data to gSpeciesInfo * Moved Gen 4 data to gSpeciesInfo * HGSS dex properly shows form sprites * Fixed data type for GetSpeciesHeight/Weight * Reading Pokédex Size data from gSpeciesInfo * Cleaned up mon graphic decompression function * Reading Front Pics gSpeciesInfo * Reading Back Pics gSpeciesInfo * Updated uses of GetMonSpritePalStruct to allow loading the data directly instead of reading the struct * Reading palettes from gSpeciesInfo * Reading animation delay from gSpeciesInfo * Fixed Pokémon Debug Menu not reading animation delay * Reading front anim Id from gSpeciesInfo * Reading back anim Id from gSpeciesInfo * Reading Animation Frames from gSpeciesInfo * Reading Icon Sprites from gSpeciesInfo * Reading Icon Palette IDs from gSpeciesInfo * Reading Footprints from gSpeciesInfo * Reading Mon Pic sizes from gSpeciesInfo * Separate mon pic sizes for female mon * Reading Level Up Learnsets from gSpeciesInfo * Reading Teachable Learnsets from gSpeciesInfo * Reading National Dex Number from gSpeciesInfo * Reading Enemy Mon Elevation from gSpeciesInfo * Reading Evolutions from gSpeciesInfo * Reading form table from gSpeciesInfo * Fixed button label inconsistency in pokémon debug menu * Reading form change table from gSpeciesInfo * Removed need to define mon graphics in include/graphics.h * Reordered mon graphics by family * Fixed National dex number offset * gFrontierBannedSpecies now checks IsSpeciesEnabled * Added 3 more toggles for Fusions, Primal Reversions and Ultra Burst * Gen 3 & 4 family toggles for dex entries * Fixed missing Mr. Rime data * Gen 1 dex descriptions as compound strings * Gen 2 dex descriptions as compound strings * Gen 3 dex descriptions as compound strings * Gen 4 dex descriptions as compound strings * Fixed compile in agbcc * Moved Gen 5 data to gSpeciesInfo * Using PLACEHOLDER_ANIM_SINGLE_FRAME when needed (same hash) * Renamed PLACEHOLDER_TWO_FRAME_ANIMATION to PLACEHOLDER_ANIM_TWO_FRAMES * Fixed capitalization for front pic anims * Fixed `CanEvolve` * Moved Gen 6 data to gSpeciesInfo * Gen 7 without macros * Gen 8 without macros * Gen 9 without macros * Fixed Gen 9 sound data * Finished moving Gen 7 data in macros (by Alex) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Ultra Necrozma is now included in the fusion forms define * Cries are now properly excluded from the rom when disabling species * Removed P_GEN_x_POKEMON from form_change_tables.h * Fixed Yanmega's cry ignoring the P_GEN_4_CROSS_EVOS setting * Added P_NEW_EVOS_IN_REGIONAL_DEX setting * Automatic ASSUMPTION_FAIL when used species are disabled * Finished moving Gen 8 data in macros (by Alex) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Expanded Alcremie macro * Finished moving Gen 9 data in macros (by Alex) * Fixed missing data for Komala and Marshadow * Form species id tables use family toggles + added missing Ursaluna form species id table * Fixed Genesect palettes * Fixed Flabébé family graphics * Fixed Minior Graphics * Fixed missing Calyrex data * Family toggles in mon graphcis (By Jasper/Bassoonian) Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed missing Ogerpon data * Ordered Level Up Learnsets (missing toggles) Also added White Basculin learnset * Added more Minior synonyms * Fixed enamorus order * Reordered teachable learnsets * Removed sSpeciesXXX level up learnsets + reordered * Removed unneeded assumes * Removed unused extra animations * Family toggles in mon level up learnsets (By Jasper/Bassoonian) Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed Phione graphics inclusion * Family toggles for Teachable Learnsets Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Ordered Front Pic Anims * Family toggles for front pic animations Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed HGSS dex incorrectly showing the wrong mon when catching it * Family toggles for Egg Moves + reodered Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed HGSS not checking for null footprints * Review changes * Fixed Female difference mon not using their macros * Fixed Alcremie Macro * Fixed compile error when disabling the Bulbasaur family * Fixed Turtwig and Chimchar family + Houndour and Mareep cries not being excluded properly * Re-added missing Egg graphical data * Fixed crash during the Birch Intro when Lotad is disabled * Renamed PALLETE to PALETTES * Removed extra spacing for YOffsets * Fixed compile when only disabling cross-gen evolutions * Added Tera Forms define (Ogerpon and Terapagos) * Fixed Necrozma macro * Removed .noFlip = FALSE * Fixed dex number in summary screen for forms when nat dex is disabled * Fixed Paldean form paths --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-08 14:05:10 +00:00
const struct Evolution *GetSpeciesEvolutions(u16 species);
const u16 *GetSpeciesFormTable(u16 species);
const struct FormChange *GetSpeciesFormChanges(u16 species);
2017-09-06 16:19:08 +01:00
u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex);
void RemoveMonPPBonus(struct Pokemon *mon, u8 moveIndex);
void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex);
2018-07-15 17:07:01 +01:00
void PokemonToBattleMon(struct Pokemon *src, struct BattlePokemon *dst);
void CopyPartyMonToBattleData(u32 battlerId, u32 partyIndex);
2018-02-11 16:35:01 +00:00
bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex);
bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex, u8 e);
bool8 HealStatusConditions(struct Pokemon *mon, u32 healMask, u8 battlerId);
u8 GetItemEffectParamOffset(u32 battler, u16 itemId, u8 effectByte, u8 effectBit);
2019-12-22 00:01:38 +00:00
u8 *UseStatIncreaseItem(u16 itemId);
2017-09-06 16:19:08 +01:00
u8 GetNature(struct Pokemon *mon);
u8 GetNatureFromPersonality(u32 personality);
u16 GetEvolutionTargetSpecies(struct Pokemon *mon, enum EvolutionMode mode, u16 evolutionItem, struct Pokemon *tradePartner);
bool8 IsMonPastEvolutionLevel(struct Pokemon *mon);
2017-09-11 10:35:41 +01:00
u16 NationalPokedexNumToSpecies(u16 nationalNum);
2018-02-11 16:35:01 +00:00
u16 NationalToHoennOrder(u16 nationalNum);
u16 SpeciesToNationalPokedexNum(u16 species);
u16 SpeciesToHoennPokedexNum(u16 species);
u16 HoennToNationalOrder(u16 hoennNum);
void DrawSpindaSpots(u32 personality, u8 *dest, bool32 isSecondFrame);
2018-02-11 16:35:01 +00:00
void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies);
2019-10-31 18:11:55 +00:00
u8 GetPlayerFlankId(void);
u16 GetLinkTrainerFlankId(u8 id);
2022-06-01 17:41:57 +01:00
s32 GetBattlerMultiplayerId(u16 id);
2018-02-11 16:35:01 +00:00
u8 GetTrainerEncounterMusicId(u16 trainerOpponentId);
u16 ModifyStatByNature(u8 nature, u16 n, u8 statIndex);
void AdjustFriendship(struct Pokemon *mon, u8 event);
void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies);
u16 GetMonEVCount(struct Pokemon *mon);
2017-10-05 23:12:01 +01:00
void RandomlyGivePartyPokerus(struct Pokemon *party);
u8 CheckPartyPokerus(struct Pokemon *party, u8 selection);
u8 CheckPartyHasHadPokerus(struct Pokemon *party, u8 selection);
void UpdatePartyPokerusTime(u16 days);
void PartySpreadPokerus(struct Pokemon *party);
2017-11-14 19:23:25 +00:00
bool8 TryIncrementMonLevel(struct Pokemon *mon);
u8 CanLearnTeachableMove(u16 species, u16 move);
2018-02-11 16:35:01 +00:00
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves);
2017-11-14 20:43:23 +00:00
u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves);
2018-02-11 16:35:01 +00:00
u8 GetNumberOfRelearnableMoves(struct Pokemon *mon);
u16 SpeciesToPokedexNum(u16 species);
bool32 IsSpeciesInHoennDex(u16 species);
2018-02-11 16:35:01 +00:00
u16 GetBattleBGM(void);
void PlayBattleBGM(void);
void PlayMapChosenOrBattleBGM(u16 songId);
2020-12-24 21:18:47 +00:00
void CreateTask_PlayMapChosenOrBattleBGM(u16 songId);
2018-10-21 08:24:57 +01:00
const u32 *GetMonFrontSpritePal(struct Pokemon *mon);
const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, bool32 isShiny, u32 personality);
2024-01-18 12:10:20 +00:00
const u32 *GetMonSpritePalFromSpecies(u16 species, bool32 isShiny, bool32 isFemale);
bool8 IsMoveHM(u16 move);
2018-02-11 16:35:01 +00:00
bool8 IsMonSpriteNotFlipped(u16 species);
s8 GetMonFlavorRelation(struct Pokemon *mon, u8 flavor);
s8 GetFlavorRelationByPersonality(u32 personality, u8 flavor);
bool8 IsTradedMon(struct Pokemon *mon);
bool8 IsOtherTrainer(u32 otId, u8 *otName);
void MonRestorePP(struct Pokemon *mon);
void BoxMonRestorePP(struct BoxPokemon *boxMon);
2018-07-07 18:57:09 +01:00
void SetMonPreventsSwitchingString(void);
2018-02-11 16:35:01 +00:00
void SetWildMonHeldItem(void);
bool8 IsMonShiny(struct Pokemon *mon);
const u8 *GetTrainerPartnerName(void);
2022-07-29 16:15:33 +01:00
void BattleAnimateFrontSprite(struct Sprite *sprite, u16 species, bool8 noCry, u8 panMode);
void DoMonFrontSpriteAnimation(struct Sprite *sprite, u16 species, bool8 noCry, u8 panModeAnimFlag);
void PokemonSummaryDoMonAnimation(struct Sprite *sprite, u16 species, bool8 oneFrame);
void StopPokemonAnimationDelayTask(void);
2022-07-29 16:15:33 +01:00
void BattleAnimateBackSprite(struct Sprite *sprite, u16 species);
u8 GetOpposingLinkMultiBattlerId(bool8 rightSide, u8 multiplayerId);
2018-02-11 16:35:01 +00:00
u16 FacilityClassToPicIndex(u16 facilityClass);
u16 PlayerGenderToFrontTrainerPicId(u8 playerGender);
void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality);
bool8 HasTwoFramesAnimation(u16 species);
2021-10-03 04:47:59 +01:00
struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 managerId, u8 mode);
void DestroyMonSpritesGfxManager(u8 managerId);
u8 *MonSpritesGfxManager_GetSpritePtr(u8 managerId, u8 spriteNum);
u16 GetFormSpeciesId(u16 speciesId, u8 formId);
u8 GetFormIdFromFormSpeciesId(u16 formSpeciesId);
2021-03-03 19:07:50 +00:00
u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg);
u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 arg);
bool32 DoesSpeciesHaveFormChangeMethod(u16 species, u16 method);
u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove);
bool32 SpeciesHasGenderDifferences(u16 species);
bool32 TryFormChange(u32 monId, u32 side, u16 method);
void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method);
u32 GetMonFriendshipScore(struct Pokemon *pokemon);
u32 GetMonAffectionHearts(struct Pokemon *pokemon);
void UpdateMonPersonality(struct BoxPokemon *boxMon, u32 personality);
u8 CalculatePartyCount(struct Pokemon *party);
u16 SanitizeSpeciesId(u16 species);
bool32 IsSpeciesEnabled(u16 species);
Species Simplifier™ - Part 3 (#3562) * Added SpeciesInfo fields # Conflicts: # include/pokemon.h * Added missing comments * Renamed gigantamax to isGigantamax * Converted species flags to agbcc bit flags * Added padding after flags * Pikachu form config * Dex text * Reordered Paradox flag * Missing Pikachu ifdef comments * Moved P_GEN_x_POKEMON settings to the species_families file * Gen 1 Dex entries * Renamed file to species_enabled.h * Prevent Pokémon from evolving if their evolution is disabled * Prevent Pokémon from being affected by Eviolite if their evolution is disabled * Prevent Pokémon offspring if they're disabled * Corrected imprementation of evolution prevention It could potentially overwrite items by accident * Cross-evo configs * Gen 2 dex entries * Changed cry table to use assignable IDs # Conflicts: # include/pokemon.h * Form table pointers * Beginning support for moving data to gSpeciesInfo * Pokédexes reads text from gSpeciesInfo * Reading species names from gSpeciesInfo * Fixed erroneous copy-paste * Moved Bulbasaur to Raichu Family data do gSpeciesinfo * Added female pic sizes * Macros for Front, Back, Palette and Learnsets * Sandshrew to Dugtrio Families * Obtains Height/Weight from gSpeciesInfo * Read category from gSpeciesInfo * Removed unused data from pokedex_entries.h * Moved Gen 1 data to gSpeciesInfo * Moved Gen 2 data to gSpeciesInfo + fixed Ursaluna Bloodmoon not producing Teddiursa eggs * Moved Gen 3 data to gSpeciesInfo * Moved Gen 4 data to gSpeciesInfo * HGSS dex properly shows form sprites * Fixed data type for GetSpeciesHeight/Weight * Reading Pokédex Size data from gSpeciesInfo * Cleaned up mon graphic decompression function * Reading Front Pics gSpeciesInfo * Reading Back Pics gSpeciesInfo * Updated uses of GetMonSpritePalStruct to allow loading the data directly instead of reading the struct * Reading palettes from gSpeciesInfo * Reading animation delay from gSpeciesInfo * Fixed Pokémon Debug Menu not reading animation delay * Reading front anim Id from gSpeciesInfo * Reading back anim Id from gSpeciesInfo * Reading Animation Frames from gSpeciesInfo * Reading Icon Sprites from gSpeciesInfo * Reading Icon Palette IDs from gSpeciesInfo * Reading Footprints from gSpeciesInfo * Reading Mon Pic sizes from gSpeciesInfo * Separate mon pic sizes for female mon * Reading Level Up Learnsets from gSpeciesInfo * Reading Teachable Learnsets from gSpeciesInfo * Reading National Dex Number from gSpeciesInfo * Reading Enemy Mon Elevation from gSpeciesInfo * Reading Evolutions from gSpeciesInfo * Reading form table from gSpeciesInfo * Fixed button label inconsistency in pokémon debug menu * Reading form change table from gSpeciesInfo * Removed need to define mon graphics in include/graphics.h * Reordered mon graphics by family * Fixed National dex number offset * gFrontierBannedSpecies now checks IsSpeciesEnabled * Added 3 more toggles for Fusions, Primal Reversions and Ultra Burst * Gen 3 & 4 family toggles for dex entries * Fixed missing Mr. Rime data * Gen 1 dex descriptions as compound strings * Gen 2 dex descriptions as compound strings * Gen 3 dex descriptions as compound strings * Gen 4 dex descriptions as compound strings * Fixed compile in agbcc * Moved Gen 5 data to gSpeciesInfo * Using PLACEHOLDER_ANIM_SINGLE_FRAME when needed (same hash) * Renamed PLACEHOLDER_TWO_FRAME_ANIMATION to PLACEHOLDER_ANIM_TWO_FRAMES * Fixed capitalization for front pic anims * Fixed `CanEvolve` * Moved Gen 6 data to gSpeciesInfo * Gen 7 without macros * Gen 8 without macros * Gen 9 without macros * Fixed Gen 9 sound data * Finished moving Gen 7 data in macros (by Alex) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Ultra Necrozma is now included in the fusion forms define * Cries are now properly excluded from the rom when disabling species * Removed P_GEN_x_POKEMON from form_change_tables.h * Fixed Yanmega's cry ignoring the P_GEN_4_CROSS_EVOS setting * Added P_NEW_EVOS_IN_REGIONAL_DEX setting * Automatic ASSUMPTION_FAIL when used species are disabled * Finished moving Gen 8 data in macros (by Alex) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Expanded Alcremie macro * Finished moving Gen 9 data in macros (by Alex) * Fixed missing data for Komala and Marshadow * Form species id tables use family toggles + added missing Ursaluna form species id table * Fixed Genesect palettes * Fixed Flabébé family graphics * Fixed Minior Graphics * Fixed missing Calyrex data * Family toggles in mon graphcis (By Jasper/Bassoonian) Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed missing Ogerpon data * Ordered Level Up Learnsets (missing toggles) Also added White Basculin learnset * Added more Minior synonyms * Fixed enamorus order * Reordered teachable learnsets * Removed sSpeciesXXX level up learnsets + reordered * Removed unneeded assumes * Removed unused extra animations * Family toggles in mon level up learnsets (By Jasper/Bassoonian) Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed Phione graphics inclusion * Family toggles for Teachable Learnsets Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Ordered Front Pic Anims * Family toggles for front pic animations Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed HGSS dex incorrectly showing the wrong mon when catching it * Family toggles for Egg Moves + reodered Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed HGSS not checking for null footprints * Review changes * Fixed Female difference mon not using their macros * Fixed Alcremie Macro * Fixed compile error when disabling the Bulbasaur family * Fixed Turtwig and Chimchar family + Houndour and Mareep cries not being excluded properly * Re-added missing Egg graphical data * Fixed crash during the Birch Intro when Lotad is disabled * Renamed PALLETE to PALETTES * Removed extra spacing for YOffsets * Fixed compile when only disabling cross-gen evolutions * Added Tera Forms define (Ogerpon and Terapagos) * Fixed Necrozma macro * Removed .noFlip = FALSE * Fixed dex number in summary screen for forms when nat dex is disabled * Fixed Paldean form paths --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-08 14:05:10 +00:00
u16 GetCryIdBySpecies(u16 species);
u16 GetSpeciesPreEvolution(u16 species);
void HealPokemon(struct Pokemon *mon);
void HealBoxPokemon(struct BoxPokemon *boxMon);
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
const u8 *GetMoveName(u16 moveId);
const u8 *GetMoveAnimationScript(u16 moveId);
void UpdateDaysPassedSinceFormChange(u16 days);
void TrySetDayLimitToFormChange(struct Pokemon *mon);
u32 CheckDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler);
2017-09-18 22:48:47 +01:00
2017-09-02 22:28:44 +01:00
#endif // GUARD_POKEMON_H