Merge pull request #71 from cawtds/update-pokemon-species

Update pokemon species
This commit is contained in:
cawtds 2025-03-20 18:11:27 +01:00 committed by GitHub
commit bebc1bb830
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 9902 additions and 1931 deletions

View File

@ -25,55 +25,55 @@
#define TYPE_STELLAR 20
#define NUMBER_OF_MON_TYPES 21
// Pokemon egg groups
#define EGG_GROUP_NONE 0
#define EGG_GROUP_MONSTER 1
#define EGG_GROUP_WATER_1 2
#define EGG_GROUP_BUG 3
#define EGG_GROUP_FLYING 4
#define EGG_GROUP_FIELD 5
#define EGG_GROUP_FAIRY 6
#define EGG_GROUP_GRASS 7
#define EGG_GROUP_HUMAN_LIKE 8
#define EGG_GROUP_WATER_3 9
#define EGG_GROUP_MINERAL 10
#define EGG_GROUP_AMORPHOUS 11
#define EGG_GROUP_WATER_2 12
#define EGG_GROUP_DITTO 13
#define EGG_GROUP_DRAGON 14
#define EGG_GROUP_NO_EGGS_DISCOVERED 15
// Pokémon egg groups
#define EGG_GROUP_NONE 0
#define EGG_GROUP_MONSTER 1
#define EGG_GROUP_WATER_1 2
#define EGG_GROUP_BUG 3
#define EGG_GROUP_FLYING 4
#define EGG_GROUP_FIELD 5
#define EGG_GROUP_FAIRY 6
#define EGG_GROUP_GRASS 7
#define EGG_GROUP_HUMAN_LIKE 8
#define EGG_GROUP_WATER_3 9
#define EGG_GROUP_MINERAL 10
#define EGG_GROUP_AMORPHOUS 11
#define EGG_GROUP_WATER_2 12
#define EGG_GROUP_DITTO 13
#define EGG_GROUP_DRAGON 14
#define EGG_GROUP_NO_EGGS_DISCOVERED 15
#define EGG_GROUPS_PER_MON 2
#define EGG_GROUPS_PER_MON 2
// Pokemon natures
#define NATURE_HARDY 0
#define NATURE_LONELY 1
#define NATURE_BRAVE 2
#define NATURE_ADAMANT 3
#define NATURE_NAUGHTY 4
#define NATURE_BOLD 5
#define NATURE_DOCILE 6
#define NATURE_RELAXED 7
#define NATURE_IMPISH 8
#define NATURE_LAX 9
#define NATURE_TIMID 10
#define NATURE_HASTY 11
#define NATURE_SERIOUS 12
#define NATURE_JOLLY 13
#define NATURE_NAIVE 14
#define NATURE_MODEST 15
#define NATURE_MILD 16
#define NATURE_QUIET 17
#define NATURE_BASHFUL 18
#define NATURE_RASH 19
#define NATURE_CALM 20
#define NATURE_GENTLE 21
#define NATURE_SASSY 22
#define NATURE_CAREFUL 23
#define NATURE_QUIRKY 24
// Pokémon natures
#define NATURE_HARDY 0 // Neutral
#define NATURE_LONELY 1 // +Atk -Def
#define NATURE_BRAVE 2 // +Atk -Speed
#define NATURE_ADAMANT 3 // +Atk -SpAtk
#define NATURE_NAUGHTY 4 // +Atk -SpDef
#define NATURE_BOLD 5 // +Def -Atk
#define NATURE_DOCILE 6 // Neutral
#define NATURE_RELAXED 7 // +Def -Speed
#define NATURE_IMPISH 8 // +Def -SpAtk
#define NATURE_LAX 9 // +Def -SpDef
#define NATURE_TIMID 10 // +Speed -Atk
#define NATURE_HASTY 11 // +Speed -Def
#define NATURE_SERIOUS 12 // Neutral
#define NATURE_JOLLY 13 // +Speed -SpAtk
#define NATURE_NAIVE 14 // +Speed - SpDef
#define NATURE_MODEST 15 // +SpAtk -Atk
#define NATURE_MILD 16 // +SpAtk -Def
#define NATURE_QUIET 17 // +SpAtk -Speed
#define NATURE_BASHFUL 18 // Neutral
#define NATURE_RASH 19 // +SpAtk -SpDef
#define NATURE_CALM 20 // +SpDef -Atk
#define NATURE_GENTLE 21 // +SpDef -Def
#define NATURE_SASSY 22 // +SpDef -Speed
#define NATURE_CAREFUL 23 // +SpDef -SpAtk
#define NATURE_QUIRKY 24 // Neutral
#define NUM_NATURES 25
// Pokemon Stats
// Pokémon Stats
#define STAT_HP 0
#define STAT_ATK 1
#define STAT_DEF 2
@ -95,6 +95,55 @@
// Shiny odds
#define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536
// Ribbon IDs used by TV and Pokénav
#define CHAMPION_RIBBON 0
#define COOL_RIBBON_NORMAL 1
#define COOL_RIBBON_SUPER 2
#define COOL_RIBBON_HYPER 3
#define COOL_RIBBON_MASTER 4
#define BEAUTY_RIBBON_NORMAL 5
#define BEAUTY_RIBBON_SUPER 6
#define BEAUTY_RIBBON_HYPER 7
#define BEAUTY_RIBBON_MASTER 8
#define CUTE_RIBBON_NORMAL 9
#define CUTE_RIBBON_SUPER 10
#define CUTE_RIBBON_HYPER 11
#define CUTE_RIBBON_MASTER 12
#define SMART_RIBBON_NORMAL 13
#define SMART_RIBBON_SUPER 14
#define SMART_RIBBON_HYPER 15
#define SMART_RIBBON_MASTER 16
#define TOUGH_RIBBON_NORMAL 17
#define TOUGH_RIBBON_SUPER 18
#define TOUGH_RIBBON_HYPER 19
#define TOUGH_RIBBON_MASTER 20
#define WINNING_RIBBON 21
#define VICTORY_RIBBON 22
#define ARTIST_RIBBON 23
#define EFFORT_RIBBON 24
#define MARINE_RIBBON 25
#define LAND_RIBBON 26
#define SKY_RIBBON 27
#define COUNTRY_RIBBON 28
#define NATIONAL_RIBBON 29
#define EARTH_RIBBON 30
#define WORLD_RIBBON 31
#define FIRST_GIFT_RIBBON MARINE_RIBBON
#define LAST_GIFT_RIBBON WORLD_RIBBON
#define NUM_GIFT_RIBBONS (1 + LAST_GIFT_RIBBON - FIRST_GIFT_RIBBON)
// The above gift ribbons (Marine - World) are
// special distribution ribbons that correspond to
// 1 bit each in the Pokémon struct. Gen 4 hard-codes
// each of these to the given name. In Gen 3 they're
// used to get an index into giftRibbons in the save block,
// which can have a value 0-64 (0 is 'no ribbon') that
// corresponds to one of the special ribbons listed
// in gGiftRibbonDescriptionPointers. Most of these were
// never distributed
#define MAX_GIFT_RIBBON 64
#define MIN_LEVEL 1
#define MAX_LEVEL 100
@ -104,17 +153,16 @@
#define OT_ID_PRESET 1
#define OT_ID_RANDOM_NO_SHINY 2
#define MON_GIVEN_TO_PARTY 0
#define MON_GIVEN_TO_PC 1
#define MON_CANT_GIVE 2
#define MON_GIVEN_TO_PARTY 0
#define MON_GIVEN_TO_PC 1
#define MON_CANT_GIVE 2
#define PLAYER_HAS_TWO_USABLE_MONS 0
#define PLAYER_HAS_ONE_MON 1
#define PLAYER_HAS_ONE_USABLE_MON 2
#define PLAYER_HAS_TWO_USABLE_MONS 0
#define PLAYER_HAS_ONE_MON 1
#define PLAYER_HAS_ONE_USABLE_MON 2
// Learning moves
#define MON_ALREADY_KNOWS_MOVE 0xFFFE
#define MON_HAS_MAX_MOVES 0xFFFF
#define MON_ALREADY_KNOWS_MOVE 0xFFFE
#define MON_HAS_MAX_MOVES 0xFFFF
#define LEVEL_UP_MOVE_ID 0x01FF
#define LEVEL_UP_MOVE_LV 0xFE00
@ -127,9 +175,10 @@
#define MON_FEMALE 0xFE
#define MON_GENDERLESS 0xFF
// Constants for AdjustFriendship
#define FRIENDSHIP_EVENT_GROW_LEVEL 0
#define FRIENDSHIP_EVENT_VITAMIN 1
#define FRIENDSHIP_EVENT_BATTLE_ITEM 2
#define FRIENDSHIP_EVENT_VITAMIN 1 // unused, handled by PokemonUseItemEffects
#define FRIENDSHIP_EVENT_BATTLE_ITEM 2 // unused, handled by PokemonUseItemEffects
#define FRIENDSHIP_EVENT_LEAGUE_BATTLE 3
#define FRIENDSHIP_EVENT_LEARN_TMHM 4
#define FRIENDSHIP_EVENT_WALKING 5
@ -138,6 +187,15 @@
#define FRIENDSHIP_EVENT_FAINT_OUTSIDE_BATTLE 8
#define FRIENDSHIP_EVENT_FAINT_LARGE 9
// Constants for GetLeadMonFriendshipScore
#define FRIENDSHIP_NONE 0
#define FRIENDSHIP_1_TO_49 1
#define FRIENDSHIP_50_TO_99 2
#define FRIENDSHIP_100_TO_149 3
#define FRIENDSHIP_150_TO_199 4
#define FRIENDSHIP_200_TO_254 5
#define FRIENDSHIP_MAX 6
// Constants for GetBattlerAffectionHearts (based on friendship value)
#define AFFECTION_NO_HEARTS 0 // 0-79 friendship
#define AFFECTION_ONE_HEART 1 // 80-129 friendship
@ -165,14 +223,6 @@
#define DAMAGE_CATEGORY_SPECIAL 1
#define DAMAGE_CATEGORY_STATUS 2
// Battle move flags
#define FLAG_MAKES_CONTACT (1 << 0)
#define FLAG_PROTECT_AFFECTED (1 << 1)
#define FLAG_MAGIC_COAT_AFFECTED (1 << 2)
#define FLAG_SNATCH_AFFECTED (1 << 3)
#define FLAG_MIRROR_MOVE_AFFECTED (1 << 4)
#define FLAG_KINGS_ROCK_AFFECTED (1 << 5)
// Growth rates
#define GROWTH_MEDIUM_FAST 0
#define GROWTH_ERRATIC 1
@ -181,7 +231,7 @@
#define GROWTH_FAST 4
#define GROWTH_SLOW 5
// Body colors for pokedex search
// Body colors for Pokédex search
#define BODY_COLOR_RED 0
#define BODY_COLOR_BLUE 1
#define BODY_COLOR_YELLOW 2
@ -193,11 +243,12 @@
#define BODY_COLOR_WHITE 8
#define BODY_COLOR_PINK 9
// Evolution types
#define F_SUMMARY_SCREEN_FLIP_SPRITE 0x80
#define EVOLUTIONS_END 0xFFFF // Not an actual evolution, used to mark the end of an evolution array.
#define EVO_NONE 0xFFFE // Not an actual evolution, used to generate offspring that can't evolve into the specified species, like regional forms.
enum EvolutionMethods {
EVO_NONE, // Not an actual evolution, used to generate offspring that can't evolve into the specified species, like regional forms.
EVO_FRIENDSHIP, // Pokémon levels up with friendship ≥ 220
EVO_FRIENDSHIP_DAY, // Pokémon levels up during the day with friendship ≥ 220
EVO_FRIENDSHIP_NIGHT, // Pokémon levels up at night with friendship ≥ 220
@ -263,6 +314,14 @@ enum EvolutionMode {
EVO_MODE_BATTLE_ONLY, // This mode is only used in battles to support Tandemaus' unique requirement
};
enum PokemonJumpType{
PKMN_JUMP_TYPE_NONE, // Not allowed in Pokémon Jump
PKMN_JUMP_TYPE_NORMAL,
PKMN_JUMP_TYPE_FAST,
PKMN_JUMP_TYPE_SLOW,
};
#define MON_PIC_WIDTH 64
#define MON_PIC_HEIGHT 64
#define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2)
@ -280,7 +339,6 @@ enum EvolutionMode {
#define SKIP_FRONT_ANIM (1 << 7)
#define NUM_ABILITY_SLOTS (NUM_NORMAL_ABILITY_SLOTS + NUM_HIDDEN_ABILITY_SLOTS)
#define NUM_NORMAL_ABILITY_SLOTS 2
#define NUM_HIDDEN_ABILITY_SLOTS 1
@ -288,6 +346,10 @@ enum EvolutionMode {
// Used as a signal for givemon to generate a default ability by personality.
#define NUM_ABILITY_PERSONALITY 0xFF
#if P_LEGENDARY_PERFECT_IVS >= GEN_6
#define LEGENDARY_PERFECT_IV_COUNT 3
#else
#define LEGENDARY_PERFECT_IV_COUNT 0
#endif
#endif // GUARD_CONSTANTS_POKEMON_H

View File

@ -391,7 +391,9 @@ struct SaveBlock2
/*0x898*/ u16 mapView[0x100];
/*0xA98*/ struct LinkBattleRecords linkBattleRecords;
/*0xAF0*/ struct BerryCrush berryCrush;
#if FREE_POKEMON_JUMP == FALSE
/*0xB00*/ struct PokemonJumpRecords pokeJump;
#endif //FREE_POKEMON_JUMP
/*0xB10*/ struct BerryPickingResults berryPick;
/*0x169C*/ struct BerryTree berryTrees[BERRY_TREES_COUNT]; // moved to SaveBlock2 due to QuestLogScene taking up SaveBlock1
/*0x???*/ u8 filler_90[212];

View File

@ -3,15 +3,14 @@
#include "sprite.h"
#include "constants/items.h"
#include "constants/regions.h"
#include "constants/region_map_sections.h"
#include "constants/map_groups.h"
#include "constants/pokemon.h"
#include "contest_effect.h"
#define GET_BASE_SPECIES_ID(speciesId) (GetFormSpeciesId(speciesId, 0))
#define FORM_SPECIES_END (0xffff)
// Property labels for Get(Box)MonData / Set(Box)MonData
enum {
MON_DATA_PERSONALITY,
@ -120,7 +119,6 @@ enum {
MON_DATA_EVOLUTION_TRACKER,
};
struct PokemonSubstruct0
{
u16 species:11; // 2047 species.
@ -142,8 +140,7 @@ struct PokemonSubstruct1
u16 move1:11; // 2047 moves.
u16 evolutionTracker1:5;
u16 move2:11; // 2047 moves.
u16 evolutionTracker2:4;
u16 unused_02:1;
u16 evolutionTracker2:5;
u16 move3:11; // 2047 moves.
u16 unused_04:5;
u16 move4:11; // 2047 moves.
@ -213,13 +210,13 @@ struct PokemonSubstruct3
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.
/* 0x0B */ u32 modernFatefulEncounter:1;
// 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.
@ -287,12 +284,11 @@ struct MonSpritesGfxManager
{
u32 numSprites:4;
u32 numSprites2:4; // Never read
u32 battlePosition:4;
u32 numFrames:8;
u32 active:8;
u32 mode:4;
u32 dataSize;
u8 *spriteBuffer;
u32 dataSize:4;
u32 mode:4; // MON_SPR_GFX_MODE_*
void *spriteBuffer;
u8 **spritePointers;
struct SpriteTemplate *templates;
struct SpriteFrameImage *frameImages;
@ -459,7 +455,7 @@ struct SpeciesInfo /*0xC4*/
#else
u8 paddingF:3;
#endif //P_GENDER_DIFFERENCES
u8 padding3:2;
u8 pokemonJumpType:2; // According to the clerk, the Pokémon allowed in Pokémon Jump are all <= 28 inches/71 cm, and do not only swim, burrow, or fly.
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;
@ -525,12 +521,64 @@ struct Ability
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
@ -542,7 +590,6 @@ struct SpindaSpot
u16 image[SPINDA_SPOT_HEIGHT];
};
struct LevelUpMove
{
u16 move;
@ -586,17 +633,19 @@ extern u8 gPlayerPartyCount;
extern struct Pokemon gPlayerParty[PARTY_SIZE];
extern u8 gEnemyPartyCount;
extern struct Pokemon gEnemyParty[PARTY_SIZE];
extern const struct SpeciesInfo gSpeciesInfo[];
extern const u8 *const gItemEffectTable[ITEMS_COUNT];
extern const u8 gStatStageRatios[][2];
extern struct SpriteTemplate gMultiuseSpriteTemplate;
extern u16 gFollowerSteps;
extern const u32 gExperienceTables[][MAX_LEVEL + 1];
// extern const u16 *const gLevelUpLearnsets[];
extern const u8 gFacilityClassToPicIndex[];
extern const u8 gFacilityClassToTrainerClass[];
extern const struct SpriteTemplate gBattlerSpriteTemplates[];
extern const struct SpeciesInfo gSpeciesInfo[];
extern const u32 gExperienceTables[][MAX_LEVEL + 1];
extern const u8 gPPUpGetMask[];
extern const u8 gPPUpClearMask[];
extern const u8 gPPUpAddValues[];
extern const u8 gStatStageRatios[MAX_STAT_STAGE + 1][2];
extern const u16 gUnionRoomFacilityClasses[];
extern const struct SpriteTemplate gBattlerSpriteTemplates[];
extern const u32 sExpCandyExperienceTable[];
extern const struct Ability gAbilitiesInfo[];
extern const struct NatureInfo gNaturesInfo[];
@ -611,9 +660,17 @@ void CreateMonWithNature(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV,
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);
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);
void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId);
void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest);
bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId);
u16 GetUnionRoomTrainerPic(void);
u16 GetUnionRoomTrainerClass(void);
void CreateEnemyEventMon(void);
void CalculateMonStats(struct Pokemon *mon);
void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest);
u8 GetLevelFromMonExp(struct Pokemon *mon);
@ -623,36 +680,22 @@ u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
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);
u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove);
u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove);
void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv);
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move);
u32 GetMonAffectionHearts(struct Pokemon *pokemon);
void UpdateMonPersonality(struct BoxPokemon *boxMon, u32 personality);
void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
u8 CountAliveMonsInBattle(u8 caseId, u32 battler);
u8 GetDefaultMoveTarget(u8 battler);
u8 GetDefaultMoveTarget(u8 battlerId);
u8 GetMonGender(struct Pokemon *mon);
u8 GetBoxMonGender(struct BoxPokemon *boxMon);
u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality);
bool32 IsPersonalityFemale(u16 species, u32 personality);
u32 GetUnownSpeciesId(u32 personality);
void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition);
void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition);
void SetMultiuseSpriteTemplateToTrainerFront(u16 trainerPicId, u8 battlerPosition);
// These are full type signatures for GetMonData() and GetBoxMonData(),
// but they are not used since some code erroneously omits the third arg.
// u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data);
// u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data);
// #ifdef IS_POKEMON_C
// u32 GetMonData(struct Pokemon *, s32, u8 *);
// u32 GetBoxMonData(struct BoxPokemon *, s32, u8 *);
// #else
// u32 GetMonData();
// u32 GetBoxMonData();
// #endif // IS_POKEMON_C
/* 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
@ -669,6 +712,7 @@ void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg);
void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg);
void CopyMon(void *dest, void *src, size_t size);
u8 GiveMonToPlayer(struct Pokemon *mon);
u8 CopyMonToPC(struct Pokemon *mon);
u8 CalculatePlayerPartyCount(void);
u8 CalculateEnemyPartyCount(void);
u8 CalculateEnemyPartyCountInSide(u32 battler);
@ -676,8 +720,9 @@ u8 GetMonsStateToDoubles(void);
u8 GetMonsStateToDoubles_2(void);
u16 GetAbilityBySpecies(u16 species, u8 abilityNum);
u16 GetMonAbility(struct Pokemon *mon);
// void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord);
u8 GetSecretBaseTrainerPicIndex(void);
u8 GetSecretBaseTrainerNameIndex(void);
u8 GetSecretBaseTrainerClass(void);
bool8 IsPlayerPartyAndPokemonStorageFull(void);
bool8 IsPokemonStorageFull(void);
const u8 *GetSpeciesName(u16 species);
@ -695,48 +740,61 @@ u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex);
void RemoveMonPPBonus(struct Pokemon *mon, u8 moveIndex);
void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex);
void PokemonToBattleMon(struct Pokemon *src, struct BattlePokemon *dst);
void CopyPartyMonToBattleData(u32 battlerId, u32 partyIndex);
bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex);
bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex, bool8 usedByAI);
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);
u8 CanLearnTeachableMove(u16 species, u16 move);
u8 *UseStatIncreaseItem(u16 itemId);
u8 GetNature(struct Pokemon *mon);
u8 GetNatureFromPersonality(u32 personality);
u32 GetGMaxTargetSpecies(u32 species);
u16 GetEvolutionTargetSpecies(struct Pokemon *mon, enum EvolutionMode mode, u16 evolutionItem, struct Pokemon *tradePartner);
bool8 IsMonPastEvolutionLevel(struct Pokemon *mon);
u16 NationalPokedexNumToSpecies(u16 nationalNum);
u16 NationalToHoennOrder(u16 nationalNum);
u16 SpeciesToNationalPokedexNum(u16 species);
u16 SpeciesToHoennPokedexNum(u16 species);
u16 HoennToNationalOrder(u16 hoennNum);
u16 SpeciesToKantoDexNum(u16 species);
bool32 IsSpeciesInKantoDex(u16 species);
u16 KantoToNationalDexNum(u16 kantoNum);
u16 NationalToKantoDexNum(u16 nationalNum);
u16 HoennToNationalDexNum(u16 hoennNum);
u16 GetCryIdBySpecies(u16 species);
u16 KantoNumToSpecies(u16 kantoNum);
u16 HoennNumToSpecies(u16 hoennNum);
void DrawSpindaSpots(u32 species, u32 personality, u8 *dest, bool8 isFrontPic);
void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies);
bool8 GetPlayerFlankId(void);
bool16 GetLinkTrainerFlankId(u8 linkPlayerId);
s32 GetBattlerMultiplayerId(u16 a1);
u8 GetTrainerEncounterMusicId(u16 trainer);
u8 GetPlayerFlankId(void);
u16 GetLinkTrainerFlankId(u8 id);
s32 GetBattlerMultiplayerId(u16 id);
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);
void RandomlyGivePartyPokerus(struct Pokemon *party);
u8 CheckPartyPokerus(struct Pokemon *party, u8 party_bm);
u8 CheckPartyPokerus(struct Pokemon *party, u8 selection);
u8 CheckPartyHasHadPokerus(struct Pokemon *party, u8 selection);
void UpdatePartyPokerusTime(u16 days);
void PartySpreadPokerus(struct Pokemon *party);
bool8 TryIncrementMonLevel(struct Pokemon *mon);
u8 CanLearnTeachableMove(u16 species, u16 move);
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves);
u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves);
u8 GetNumberOfRelearnableMoves(struct Pokemon *mon);
u16 SpeciesToPokedexNum(u16 species);
bool32 IsSpeciesInHoennDex(u16 species);
u16 GetBattleBGM(void);
void PlayBattleBGM(void);
void PlayMapChosenOrBattleBGM(u16 songId);
void CreateTask_PlayMapChosenOrBattleBGM(u16 songId);
const u32 *GetMonFrontSpritePal(struct Pokemon *mon);
const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, bool32 isShiny, u32 personality);
const u32 *GetMonSpritePalFromSpecies(u16 species, bool32 isShiny, bool32 isFemale);
bool8 IsMoveHM(u16 move);
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);
@ -748,17 +806,16 @@ bool8 IsMonShiny(struct Pokemon *mon);
const u8 *GetTrainerPartnerName(void);
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);
void BattleAnimateBackSprite(struct Sprite *sprite, u16 species);
u8 GetPlayerPartyHighestLevel(void);
u16 GetUnionRoomTrainerPic(void);
u16 GetUnionRoomTrainerClass(void);
void CreateEnemyEventMon(void);
u8 GetOpposingLinkMultiBattlerId(bool8 rightSide, u8 multiplayerId);
u16 FacilityClassToPicIndex(u16 facilityClass);
u16 PlayerGenderToFrontTrainerPicId(u8 playerGender);
void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality);
bool8 HasTwoFramesAnimation(u16 species);
bool8 CheckBattleTypeGhost(struct Pokemon *mon, u8 bank);
struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 battlePosition, u8 mode);
struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 managerId, u8 mode);
void DestroyMonSpritesGfxManager(u8 managerId);
u8 *MonSpritesGfxManager_GetSpritePtr(u8 managerId, u8 spriteNum);
u16 GetFormSpeciesId(u16 speciesId, u8 formId);
@ -766,23 +823,21 @@ u8 GetFormIdFromFormSpeciesId(u16 formSpeciesId);
u32 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg);
u32 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 arg);
bool32 DoesSpeciesHaveFormChangeMethod(u16 species, u16 method);
void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method);
bool8 IsMonPastEvolutionLevel(struct Pokemon *mon);
bool32 IsPersonalityFemale(u16 species, u32 personality);
u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove);
void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv);
bool32 SpeciesHasGenderDifferences(u16 species);
bool32 TryFormChange(u32 monId, u32 side, u16 method);
u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex);
bool8 HealStatusConditions(struct Pokemon *mon, u32 healMask, u8 battleId);
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);
u32 GetUnownSpeciesId(u32 personality);
u8 CalculatePartyCount(struct Pokemon *party);
u16 GetFirstPartnerMove(u16 species);
u16 GetCryIdBySpecies(u16 species);
u16 GetSpeciesPreEvolution(u16 species);
void HealPokemon(struct Pokemon *mon);
void HealBoxPokemon(struct BoxPokemon *boxMon);
u16 KantoNumToSpecies(u16 kantoNum);
u16 HoennNumToSpecies(u16 hoennNum);
u8 CopyMonToPC(struct Pokemon *mon);
void UpdateDaysPassedSinceFormChange(u16 days);
void TrySetDayLimitToFormChange(struct Pokemon *mon);
u32 CheckDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler);
@ -790,4 +845,7 @@ uq4_12_t GetDynamaxLevelHPMultiplier(u32 dynamaxLevel, bool32 inverseMultiplier)
u32 GetRegionalFormByRegion(u32 species, u32 region);
bool32 IsSpeciesForeignRegionalForm(u32 species, u32 currentRegion);
u16 GetFirstPartnerMove(u16 species);
u8 GetPlayerPartyHighestLevel(void);
#endif // GUARD_POKEMON_H

View File

@ -2213,7 +2213,7 @@ static const u8 *BattleStringGetOpponentClassByTrainerId(u16 trainerId)
const u8 *toCpy;
if (gBattleTypeFlags & BATTLE_TYPE_SECRET_BASE)
toCpy = gTrainerClasses[GetSecretBaseTrainerNameIndex()].name;
toCpy = gTrainerClasses[GetSecretBaseTrainerClass()].name;
else if (trainerId == TRAINER_UNION_ROOM)
toCpy = gTrainerClasses[GetUnionRoomTrainerClass()].name;
else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)

File diff suppressed because it is too large Load Diff

View File

@ -45,7 +45,7 @@
#define OVERWORLD_PAL_FEMALE(...)
#endif //OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE
#define OVERWORLD_DATA(objEventPic, _size, shadow, _tracks, _anims) \
#define OVERWORLD_DATA(picTable, _size, shadow, _tracks, _anims) \
{ \
.tileTag = TAG_NONE, \
.paletteTag = OBJ_EVENT_PAL_TAG_DYNAMIC, \
@ -61,7 +61,7 @@
.oam = (_size == SIZE_32x32 ? &gObjectEventBaseOam_32x32 : &gObjectEventBaseOam_64x64), \
.subspriteTables = (_size == SIZE_32x32 ? sOamTables_32x32 : sOamTables_64x64), \
.anims = _anims, \
.images = (const struct SpriteFrameImage[]) { overworld_ascending_frames(objEventPic, SIZE_32x32 ? 4 : 8, SIZE_32x32 ? 4 : 8), }, \
.images = picTable, \
.affineAnims = gDummySpriteAffineAnimTable, \
}
@ -122,7 +122,9 @@ const struct SpeciesInfo gSpeciesInfo[] =
.shinyPalette = gMonShinyPalette_CircledQuestionMark,
.iconSprite = gMonIcon_QuestionMark,
.iconPalIndex = 0,
.pokemonJumpType = PKMN_JUMP_TYPE_NONE,
FOOTPRINT(QuestionMark)
SHADOW(-1, 0, SHADOW_SIZE_M)
#if OW_POKEMON_OBJECT_EVENTS
.overworldData = {
.tileTag = TAG_NONE,
@ -139,7 +141,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.oam = &gObjectEventBaseOam_32x32,
.subspriteTables = sOamTables_32x32,
.anims = sAnimTable_Following,
.images = (const struct SpriteFrameImage[]) { overworld_ascending_frames(gObjectEventPic_Substitute, 4, 4), },
.images = sPicTable_Substitute,
.affineAnims = gDummySpriteAffineAnimTable,
},
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,6 @@
#include "recorded_battle.h"
#include "rtc.h"
#include "sound.h"
#include "sprite.h"
#include "string_util.h"
#include "strings.h"
#include "task.h"
@ -377,7 +376,7 @@ static const u16 sKantoDexNumToNationalDexNum[KANTO_DEX_COUNT + 1] =
};
// Assigns all Hoenn Dex Indexes to a National Dex Index
static const u16 sHoennToNationalOrder[NUM_SPECIES - 1] =
static const u16 sHoennToNationalOrder[HOENN_DEX_COUNT - 1] =
{
HOENN_TO_NATIONAL(TREECKO),
HOENN_TO_NATIONAL(GROVYLE),
@ -643,7 +642,7 @@ const struct NatureInfo gNaturesInfo[NUM_NATURES] =
.statUp = STAT_ATK,
.statDown = STAT_ATK,
.backAnim = 0,
},
},
[NATURE_LONELY] =
{
.name = COMPOUND_STRING("Lonely"),
@ -844,6 +843,7 @@ const struct NatureInfo gNaturesInfo[NUM_NATURES] =
#include "data/pokemon/form_species_tables.h"
#include "data/pokemon/form_change_tables.h"
#include "data/pokemon/form_change_table_pointers.h"
#include "data/object_events/object_event_pic_tables_followers.h"
#include "data/pokemon/species_info.h"
@ -910,7 +910,7 @@ const u8 gStatStageRatios[MAX_STAT_STAGE + 1][2] =
// The classes used by other players in the Union Room.
// These should correspond with the overworld graphics in sUnionRoomObjGfxIds
const u16 gUnionRoomFacilityClasses[NUM_UNION_ROOM_CLASSES * GENDER_COUNT] =
const u16 gUnionRoomFacilityClasses[NUM_UNION_ROOM_CLASSES * GENDER_COUNT] =
{
// Male
FACILITY_CLASS_COOLTRAINER_M,
@ -1093,7 +1093,7 @@ static const s8 sFriendshipEventModifiers[][3] =
#define HM_MOVES_END 0xFFFF
const u16 sHMMoves[] =
static const u16 sHMMoves[] =
{
MOVE_CUT, MOVE_FLY, MOVE_SURF, MOVE_STRENGTH, MOVE_FLASH,
MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, HM_MOVES_END
@ -2162,6 +2162,19 @@ u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove)
}
}
// Handler for if Zacian or Zamazenta should learn Iron Head
// since it transforms in the Behemoth Blade/Bash move in
// battle in the Crowned forms.
if (learnset[sLearningMoveTableID].move == MOVE_IRON_HEAD && (species == SPECIES_ZAMAZENTA_CROWNED || species == SPECIES_ZACIAN_CROWNED))
{
for (u32 accessor = MON_DATA_MOVE1; accessor <= MON_DATA_MOVE4; accessor++)
{
u32 move = GetMonData(mon, accessor);
if (move == MOVE_BEHEMOTH_BLADE || move == MOVE_BEHEMOTH_BASH)
return MOVE_NONE;
}
}
if (learnset[sLearningMoveTableID].level == level)
{
gMoveToLearn = learnset[sLearningMoveTableID].move;
@ -2228,8 +2241,9 @@ void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
u8 CountAliveMonsInBattle(u8 caseId, u32 battler)
{
s32 i;
u8 retVal = 0;
u32 i;
u32 battlerSide;
u32 retVal = 0;
switch (caseId)
{
@ -2248,9 +2262,10 @@ u8 CountAliveMonsInBattle(u8 caseId, u32 battler)
}
break;
case BATTLE_ALIVE_SIDE:
battlerSide = GetBattlerSide(battler);
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (GetBattlerSide(i) == GetBattlerSide(battler) && !(gAbsentBattlerFlags & (1u << i)))
if (GetBattlerSide(i) == battlerSide && !(gAbsentBattlerFlags & (1u << i)))
retVal++;
}
break;
@ -3680,7 +3695,7 @@ u8 GetSecretBaseTrainerPicIndex(void)
return gFacilityClassToPicIndex[facilityClass];
}
u8 GetSecretBaseTrainerNameIndex(void)
u8 GetSecretBaseTrainerClass(void)
{
u8 facilityClass = sSecretBaseFacilityClasses[gBattleResources->secretBase->gender][gBattleResources->secretBase->trainerId[0] % NUM_SECRET_BASE_CLASSES];
return gFacilityClassToTrainerClass[facilityClass];
@ -3858,15 +3873,15 @@ void PokemonToBattleMon(struct Pokemon *src, struct BattlePokemon *dst)
dst->status2 = 0;
}
// void CopyPartyMonToBattleData(u32 battlerId, u32 partyIndex)
// {
// u32 side = GetBattlerSide(battlerId);
// struct Pokemon *party = GetSideParty(side);
// PokemonToBattleMon(&party[partyIndex], &gBattleMons[battlerId]);
// gBattleStruct->hpOnSwitchout[side] = gBattleMons[battlerId].hp;
// UpdateSentPokesToOpponentValue(battlerId);
// ClearTemporarySpeciesSpriteData(battlerId, FALSE, FALSE);
// }
void CopyPartyMonToBattleData(u32 battlerId, u32 partyIndex)
{
u32 side = GetBattlerSide(battlerId);
struct Pokemon *party = GetSideParty(side);
PokemonToBattleMon(&party[partyIndex], &gBattleMons[battlerId]);
gBattleStruct->hpOnSwitchout[side] = gBattleMons[battlerId].hp;
UpdateSentPokesToOpponentValue(battlerId);
ClearTemporarySpeciesSpriteData(battlerId, FALSE, FALSE);
}
bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex)
{
@ -4497,80 +4512,80 @@ u8 GetItemEffectParamOffset(u32 battler, u16 itemId, u8 effectByte, u8 effectBit
return offset;
}
// static void BufferStatRoseMessage(s32 statIdx)
// {
// gBattlerTarget = gBattlerInMenuId;
// StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[statIdx]]);
// if (B_X_ITEMS_BUFF >= GEN_7)
// {
// StringCopy(gBattleTextBuff2, gText_StatSharply);
// StringAppend(gBattleTextBuff2, gText_StatRose);
// }
// else
// {
// StringCopy(gBattleTextBuff2, gText_StatRose);
// }
// BattleStringExpandPlaceholdersToDisplayedString(gText_DefendersStatRose);
// }
static void BufferStatRoseMessage(s32 statIdx)
{
gBattlerTarget = gBattlerInMenuId;
StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[statIdx]]);
if (B_X_ITEMS_BUFF >= GEN_7)
{
StringCopy(gBattleTextBuff2, gText_StatSharply);
StringAppend(gBattleTextBuff2, gText_StatRose);
}
else
{
StringCopy(gBattleTextBuff2, gText_StatRose);
}
BattleStringExpandPlaceholdersToDisplayedString(gText_DefendersStatRose);
}
// u8 *UseStatIncreaseItem(u16 itemId)
// {
// const u8 *itemEffect;
u8 *UseStatIncreaseItem(u16 itemId)
{
const u8 *itemEffect;
// if (itemId == ITEM_ENIGMA_BERRY_E_READER)
// {
// if (gMain.inBattle)
// itemEffect = gEnigmaBerries[gBattlerInMenuId].itemEffect;
// else
// #if FREE_ENIGMA_BERRY == FALSE
// itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
// #else
// itemEffect = 0;
// #endif //FREE_ENIGMA_BERRY
// }
// else
// {
// itemEffect = ItemId_GetEffect(itemId);
// }
if (itemId == ITEM_ENIGMA_BERRY_E_READER)
{
if (gMain.inBattle)
itemEffect = gEnigmaBerries[gBattlerInMenuId].itemEffect;
else
#if FREE_ENIGMA_BERRY == FALSE
itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
#else
itemEffect = 0;
#endif //FREE_ENIGMA_BERRY
}
else
{
itemEffect = ItemId_GetEffect(itemId);
}
// gPotentialItemEffectBattler = gBattlerInMenuId;
gPotentialItemEffectBattler = gBattlerInMenuId;
// if (itemEffect[0] & ITEM0_DIRE_HIT)
// {
// gBattlerAttacker = gBattlerInMenuId;
// BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnGettingPumped);
// }
if (itemEffect[0] & ITEM0_DIRE_HIT)
{
gBattlerAttacker = gBattlerInMenuId;
BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnGettingPumped);
}
// switch (itemEffect[1])
// {
// case ITEM1_X_ATTACK:
// BufferStatRoseMessage(STAT_ATK);
// break;
// case ITEM1_X_DEFENSE:
// BufferStatRoseMessage(STAT_DEF);
// break;
// case ITEM1_X_SPEED:
// BufferStatRoseMessage(STAT_SPEED);
// break;
// case ITEM1_X_SPATK:
// BufferStatRoseMessage(STAT_SPATK);
// break;
// case ITEM1_X_SPDEF:
// BufferStatRoseMessage(STAT_SPDEF);
// break;
// case ITEM1_X_ACCURACY:
// BufferStatRoseMessage(STAT_ACC);
// break;
// }
switch (itemEffect[1])
{
case ITEM1_X_ATTACK:
BufferStatRoseMessage(STAT_ATK);
break;
case ITEM1_X_DEFENSE:
BufferStatRoseMessage(STAT_DEF);
break;
case ITEM1_X_SPEED:
BufferStatRoseMessage(STAT_SPEED);
break;
case ITEM1_X_SPATK:
BufferStatRoseMessage(STAT_SPATK);
break;
case ITEM1_X_SPDEF:
BufferStatRoseMessage(STAT_SPDEF);
break;
case ITEM1_X_ACCURACY:
BufferStatRoseMessage(STAT_ACC);
break;
}
// if (itemEffect[3] & ITEM3_GUARD_SPEC)
// {
// gBattlerAttacker = gBattlerInMenuId;
// BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnShroudedInMist);
// }
if (itemEffect[3] & ITEM3_GUARD_SPEC)
{
gBattlerAttacker = gBattlerInMenuId;
BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnShroudedInMist);
}
// return gDisplayedStringBattle;
// }
return gDisplayedStringBattle;
}
u8 GetNature(struct Pokemon *mon)
{
@ -6970,25 +6985,25 @@ void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method)
}
}
// u32 GetMonFriendshipScore(struct Pokemon *pokemon)
// {
// u32 friendshipScore = GetMonData(pokemon, MON_DATA_FRIENDSHIP, NULL);
u32 GetMonFriendshipScore(struct Pokemon *pokemon)
{
u32 friendshipScore = GetMonData(pokemon, MON_DATA_FRIENDSHIP, NULL);
// if (friendshipScore == MAX_FRIENDSHIP)
// return FRIENDSHIP_MAX;
// if (friendshipScore >= 200)
// return FRIENDSHIP_200_TO_254;
// if (friendshipScore >= 150)
// return FRIENDSHIP_150_TO_199;
// if (friendshipScore >= 100)
// return FRIENDSHIP_100_TO_149;
// if (friendshipScore >= 50)
// return FRIENDSHIP_50_TO_99;
// if (friendshipScore >= 1)
// return FRIENDSHIP_1_TO_49;
if (friendshipScore == MAX_FRIENDSHIP)
return FRIENDSHIP_MAX;
if (friendshipScore >= 200)
return FRIENDSHIP_200_TO_254;
if (friendshipScore >= 150)
return FRIENDSHIP_150_TO_199;
if (friendshipScore >= 100)
return FRIENDSHIP_100_TO_149;
if (friendshipScore >= 50)
return FRIENDSHIP_50_TO_99;
if (friendshipScore >= 1)
return FRIENDSHIP_1_TO_49;
// return FRIENDSHIP_NONE;
// }
return FRIENDSHIP_NONE;
}
u32 GetMonAffectionHearts(struct Pokemon *pokemon)
{
@ -7098,50 +7113,6 @@ u16 GetSpeciesPreEvolution(u16 species)
return SPECIES_NONE;
}
u16 GetFirstPartnerMove(u16 species)
{
switch(species)
{
case SPECIES_VENUSAUR:
case SPECIES_MEGANIUM:
case SPECIES_SCEPTILE:
case SPECIES_TORTERRA:
case SPECIES_SERPERIOR:
case SPECIES_CHESNAUGHT:
case SPECIES_DECIDUEYE:
case SPECIES_DECIDUEYE_HISUI:
case SPECIES_RILLABOOM:
case SPECIES_MEOWSCARADA:
return MOVE_FRENZY_PLANT;
case SPECIES_CHARIZARD:
case SPECIES_TYPHLOSION:
case SPECIES_TYPHLOSION_HISUI:
case SPECIES_BLAZIKEN:
case SPECIES_INFERNAPE:
case SPECIES_EMBOAR:
case SPECIES_DELPHOX:
case SPECIES_INCINEROAR:
case SPECIES_CINDERACE:
case SPECIES_SKELEDIRGE:
return MOVE_BLAST_BURN;
case SPECIES_BLASTOISE:
case SPECIES_FERALIGATR:
case SPECIES_SWAMPERT:
case SPECIES_EMPOLEON:
case SPECIES_SAMUROTT:
case SPECIES_SAMUROTT_HISUI:
case SPECIES_GRENINJA:
case SPECIES_GRENINJA_ASH:
case SPECIES_GRENINJA_BATTLE_BOND:
case SPECIES_PRIMARINA:
case SPECIES_INTELEON:
case SPECIES_QUAQUAVAL:
return MOVE_HYDRO_CANNON;
default:
return MOVE_NONE;
}
}
void UpdateDaysPassedSinceFormChange(u16 days)
{
u32 i;
@ -7237,7 +7208,7 @@ u32 GetRegionalFormByRegion(u32 species, u32 region)
{
if (firstFoundSpecies == 0)
firstFoundSpecies = formTable[formId];
if (IsSpeciesRegionalFormFromRegion(formTable[formId], region))
return formTable[formId];
}
@ -7291,3 +7262,47 @@ bool8 CheckBattleTypeGhost(struct Pokemon *mon, u8 battlerId)
}
return FALSE;
}
u16 GetFirstPartnerMove(u16 species)
{
switch(species)
{
case SPECIES_VENUSAUR:
case SPECIES_MEGANIUM:
case SPECIES_SCEPTILE:
case SPECIES_TORTERRA:
case SPECIES_SERPERIOR:
case SPECIES_CHESNAUGHT:
case SPECIES_DECIDUEYE:
case SPECIES_DECIDUEYE_HISUI:
case SPECIES_RILLABOOM:
case SPECIES_MEOWSCARADA:
return MOVE_FRENZY_PLANT;
case SPECIES_CHARIZARD:
case SPECIES_TYPHLOSION:
case SPECIES_TYPHLOSION_HISUI:
case SPECIES_BLAZIKEN:
case SPECIES_INFERNAPE:
case SPECIES_EMBOAR:
case SPECIES_DELPHOX:
case SPECIES_INCINEROAR:
case SPECIES_CINDERACE:
case SPECIES_SKELEDIRGE:
return MOVE_BLAST_BURN;
case SPECIES_BLASTOISE:
case SPECIES_FERALIGATR:
case SPECIES_SWAMPERT:
case SPECIES_EMPOLEON:
case SPECIES_SAMUROTT:
case SPECIES_SAMUROTT_HISUI:
case SPECIES_GRENINJA:
case SPECIES_GRENINJA_ASH:
case SPECIES_GRENINJA_BATTLE_BOND:
case SPECIES_PRIMARINA:
case SPECIES_INTELEON:
case SPECIES_QUAQUAVAL:
return MOVE_HYDRO_CANNON;
default:
return MOVE_NONE;
}
}

View File

@ -272,7 +272,7 @@ static void InitGame(struct PokemonJump *);
static void ResetForNewGame(struct PokemonJump *);
static void InitPlayerAndJumpTypes(void);
static void ResetPlayersForNewGame(void);
static s16 GetPokemonJumpSpeciesIdx(u16 species);
static s16 GetSpeciesPokemonJumpType(u16 species);
static void InitJumpMonInfo(struct PokemonJump_MonInfo *monInfo, struct Pokemon *mon);
static void CB2_PokemonJump(void);
static void Task_StartPokemonJump(u8 taskId);
@ -703,119 +703,6 @@ static void Task_StaticCountdown_Run(u8 taskId)
#undef sId
#undef sNumberSpriteId
/*
According to the clerk, the Pokémon allowed in
Pokémon Jump are all <= 28 inches, and do not
only swim, burrow, or fly.
*/
static const struct PokemonJumpMons
{
u16 species;
u16 jumpType;
} sPokeJumpMons[] =
{
{ .species = SPECIES_BULBASAUR, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_CHARMANDER, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_SQUIRTLE, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_CATERPIE, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_METAPOD, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_WEEDLE, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_KAKUNA, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_RATTATA, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_RATICATE, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_PIKACHU, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_SANDSHREW, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_NIDORAN_F, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_NIDORAN_M, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_CLEFAIRY, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_VULPIX, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_JIGGLYPUFF, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_ODDISH, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_PARAS, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_MEOWTH, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_PSYDUCK, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_MANKEY, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_GROWLITHE, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_POLIWAG, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_BELLSPROUT, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_SHELLDER, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_KRABBY, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_EXEGGCUTE, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_CUBONE, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_DITTO, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_EEVEE, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_OMANYTE, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_KABUTO, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_CHIKORITA, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_CYNDAQUIL, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_TOTODILE, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_SPINARAK, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_PICHU, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_CLEFFA, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_IGGLYBUFF, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_TOGEPI, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_MAREEP, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_BELLOSSOM, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_MARILL, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_SUNKERN, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_WOOPER, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_PINECO, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_SNUBBULL, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_SHUCKLE, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_TEDDIURSA, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_SLUGMA, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_SWINUB, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_HOUNDOUR, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_PHANPY, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_PORYGON2, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_TYROGUE, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_SMOOCHUM, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_ELEKID, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_MAGBY, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_LARVITAR, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_TREECKO, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_TORCHIC, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_MUDKIP, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_MARSHTOMP, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_POOCHYENA, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_ZIGZAGOON, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_LINOONE, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_WURMPLE, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_SILCOON, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_CASCOON, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_LOTAD, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_SEEDOT, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_RALTS, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_KIRLIA, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_SURSKIT, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_SHROOMISH, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_NINCADA, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_WHISMUR, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_AZURILL, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_SKITTY, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_SABLEYE, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_MAWILE, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_ARON, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_MEDITITE, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_ELECTRIKE, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_PLUSLE, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_MINUN, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_VOLBEAT, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_ILLUMISE, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_ROSELIA, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_GULPIN, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_NUMEL, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_TORKOAL, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_SPOINK, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_TRAPINCH, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_CACNEA, .jumpType = JUMP_TYPE_SLOW },
{ .species = SPECIES_ANORITH, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_WYNAUT, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_SNORUNT, .jumpType = JUMP_TYPE_NORMAL },
{ .species = SPECIES_CLAMPERL, .jumpType = JUMP_TYPE_FAST },
{ .species = SPECIES_BAGON, .jumpType = JUMP_TYPE_FAST },
};
void StartPokemonJump(u16 partyId, MainCallback exitCallback)
{
u8 taskId;
@ -902,12 +789,11 @@ static void ResetForNewGame(struct PokemonJump *jump)
static void InitPlayerAndJumpTypes(void)
{
int i, index;
int i;
for (i = 0; i < MAX_RFU_PLAYERS; i++)
{
index = GetPokemonJumpSpeciesIdx(sPokemonJump->monInfo[i].species);
sPokemonJump->players[i].monJumpType = sPokeJumpMons[index].jumpType;
sPokemonJump->players[i].monJumpType = GetSpeciesPokemonJumpType(sPokemonJump->monInfo[i].species);
}
sPokemonJump->player = &sPokemonJump->players[sPokemonJump->multiplayerId];
@ -929,16 +815,9 @@ static void ResetPlayersForNewGame(void)
}
}
static s16 GetPokemonJumpSpeciesIdx(u16 species)
static s16 GetSpeciesPokemonJumpType(u16 species)
{
u32 i;
for (i = 0; i < ARRAY_COUNT(sPokeJumpMons); i++)
{
if (sPokeJumpMons[i].species == species)
return i;
}
return -1; // species isnt allowed
return gSpeciesInfo[SanitizeSpeciesId(species)].pokemonJumpType;
}
static void InitJumpMonInfo(struct PokemonJump_MonInfo *monInfo, struct Pokemon *mon)
@ -2631,7 +2510,7 @@ static u8 *GetPokeJumpPlayerName(u8 multiplayerId)
bool32 IsSpeciesAllowedInPokemonJump(u16 species)
{
return GetPokemonJumpSpeciesIdx(species) > -1;
return GetSpeciesPokemonJumpType(species) != PKMN_JUMP_TYPE_NONE;
}
void IsPokemonJumpSpeciesInParty(void)