summaryrefslogtreecommitdiff
path: root/include/pokemon.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/pokemon.h')
-rw-r--r--include/pokemon.h167
1 files changed, 77 insertions, 90 deletions
diff --git a/include/pokemon.h b/include/pokemon.h
index 558eedc67..9dd5850b4 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -2,6 +2,7 @@
#define GUARD_POKEMON_H
#include "global.h"
+#include "sprite.h"
#define MON_DATA_PERSONALITY 0
#define MON_DATA_OT_ID 1
@@ -109,6 +110,16 @@
#define MON_FEMALE 0xFE
#define MON_GENDERLESS 0xFF
+#define FRIENDSHIP_EVENT_GROW_LEVEL 0x0
+#define FRIENDSHIP_EVENT_VITAMIN 0x1
+#define FRIENDSHIP_EVENT_BATTLE_ITEM 0x2
+#define FRIENDSHIP_EVENT_LEAGUE_BATTLE 0x3
+#define FRIENDSHIP_EVENT_LEARN_TMHM 0x4
+#define FRIENDSHIP_EVENT_WALKING 0x5
+#define FRIENDSHIP_EVENT_FAINT_SMALL 0x6
+#define FRIENDSHIP_EVENT_FAINT_OUTSIDE_BATTLE 0x7
+#define FRIENDSHIP_EVENT_FAINT_LARGE 0x8
+
#define TYPE_NORMAL 0x00
#define TYPE_FIGHTING 0x01
#define TYPE_FLYING 0x02
@@ -425,8 +436,7 @@ struct BaseStats
/* 0x13 */ u8 growthRate;
/* 0x14 */ u8 eggGroup1;
/* 0x15 */ u8 eggGroup2;
- /* 0x16 */ u8 ability1;
- /* 0x17 */ u8 ability2;
+ /* 0x16 */ u8 abilities[2];
/* 0x18 */ u8 safariZoneFleeRate;
/* 0x19 */ u8 bodyColor : 7;
u8 noFlip : 1;
@@ -530,11 +540,6 @@ extern const u16 *const gLevelUpLearnsets[];
extern const u8 gFacilityClassToPicIndex[];
extern const u8 gFacilityClassToTrainerClass[];
-u8 CountAliveMons(u8 caseId);
-#define BATTLE_ALIVE_EXCEPT_ACTIVE 0
-#define BATTLE_ALIVE_ATK_SIDE 1
-#define BATTLE_ALIVE_DEF_SIDE 2
-
void ZeroBoxMonData(struct BoxPokemon *boxMon);
void ZeroMonData(struct Pokemon *mon);
void ZeroPlayerPartyMons(void);
@@ -545,30 +550,32 @@ 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);
-u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon);
+void CreateBattleTowerMon(struct Pokemon *mon, struct BattleTowerPokemon *src);
+void sub_803E23C(struct Pokemon *mon, struct BattleTowerPokemon *dest);
void CalculateMonStats(struct Pokemon *mon);
-u8 GetLevelFromMonExp(struct Pokemon *mon);
+void BoxMonToMon(struct BoxPokemon *src, struct Pokemon *dest);
u8 GetLevelFromBoxMonExp(struct BoxPokemon *boxMon);
u16 GiveMoveToMon(struct Pokemon *mon, u16 move);
-u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move);
-void MonRestorePP(struct Pokemon *mon);
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);
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move);
-void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
-bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex);
-bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex, u8 e);
+s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 battlerIdAtk, u8 battlerIdDef);
+
+#define BATTLE_ALIVE_EXCEPT_ACTIVE 0
+#define BATTLE_ALIVE_ATK_SIDE 1
+#define BATTLE_ALIVE_DEF_SIDE 2
+
+u8 CountAliveMonsInBattle(u8 caseId);
+u8 GetDefaultMoveTarget(u8 battlerId);
u8 GetMonGender(struct Pokemon *mon);
u8 GetBoxMonGender(struct BoxPokemon *boxMon);
u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality);
-void EncryptBoxMon(struct BoxPokemon *boxMon);
-void DecryptBoxMon(struct BoxPokemon *boxMon);
+void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition);
+void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition);
// These are full type signatures for GetMonData() and GetBoxMonData(),
// but they are not used since some code erroneously omits the third arg.
@@ -583,101 +590,81 @@ u32 GetMonData();
u32 GetBoxMonData();
#endif // IS_POKEMON_C
-void SetMonData(struct Pokemon *mon, s32 field, const void *data);
-void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *data);
+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 SendMonToPC(struct Pokemon *mon);
u8 CalculatePlayerPartyCount(void);
u8 CalculateEnemyPartyCount(void);
-
+u8 GetMonsStateToDoubles(void);
u8 GetAbilityBySpecies(u16 species, bool8 altAbility);
u8 GetMonAbility(struct Pokemon *mon);
-void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord);
u8 GetSecretBaseTrainerPicIndex(void);
u8 GetSecretBaseTrainerNameIndex(void);
bool8 IsPlayerPartyAndPokemonStorageFull(void);
-bool8 IsPokemonStorageFull(void);
void GetSpeciesName(u8 *name, u16 species);
u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex);
void RemoveMonPPBonus(struct Pokemon *mon, u8 moveIndex);
void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex);
-void CopyPlayerPartyMonToBattleData(u8 battleIndex, u8 partyIndex);
-
+bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex);
+bool8 PokemonUseItemEffects(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 moveIndex, u8 e);
+bool8 PokemonUseItemEffects2(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 moveIndex, u8 e);
+u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit);
+const u8 *Battle_PrintStatBoosterEffectMessage(u16 itemId);
u8 GetNature(struct Pokemon *mon);
-u8 GetNatureFromPersonality(u32 personality);
-
-u16 nature_stat_mod(u8 nature, u16 n, u8 statIndex);
-
-void MonRestorePP(struct Pokemon *);
-void BoxMonRestorePP(struct BoxPokemon *);
-
+u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem);
u16 NationalPokedexNumToSpecies(u16 nationalNum);
-u16 NationalToHoennOrder(u16);
-u16 SpeciesToNationalPokedexNum(u16);
-u16 HoennToNationalOrder(u16);
+u16 SpeciesToNationalPokedexNum(u16 species);
+u16 HoennToNationalOrder(u16 hoennNum);
u16 SpeciesToCryId(u16 species);
-void DrawSpindaSpots(u16, u32, u8 *, u8);
-void AdjustFriendship(struct Pokemon *, u8);
-u8 CheckPartyHasHadPokerus(struct Pokemon *, u8);
-void UpdatePartyPokerusTime(u16);
-u32 CanMonLearnTMHM(struct Pokemon *, u8);
-u32 CanSpeciesLearnTMHM(u16 species, u8 tm);
+void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, u8 a4);
+void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies);
+bool8 sub_80435E0(void);
+bool8 GetLinkTrainerFlankId(u8 linkPlayerId);
+s32 GetBankMultiplayerId(u16 a1);
+u8 GetTrainerEncounterMusicId(u16 trainer);
+void AdjustFriendship(struct Pokemon *mon, u8 event);
+void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies);
+u16 GetMonEVCount(struct Pokemon *mon);
+void sub_8043A68(void);
+u8 CheckPartyPokerus(struct Pokemon *party, u8 selection);
+u8 CheckPartyHasHadPokerus(struct Pokemon *party, u8 selection);
+void sub_8043B40(void);
+bool8 TryIncrementMonLevel(struct Pokemon *mon);
+u32 CanMonLearnTMHM(struct Pokemon *mon, u8 tm);
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves);
+u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves);
+u8 GetNumberOfRelearnableMoves(struct Pokemon *mon);
+u16 sub_8043F90(u16 species);
void ClearBattleMonForms(void);
+void PlayBattleBGM(void);
+void PlayMapChosenOrBattleBGM(u16 songId);
const u32 *GetMonFrontSpritePal(struct Pokemon *mon);
-const u32 *GetFrontSpritePalFromSpeciesAndPersonality(u16, u32, u32);
-const struct CompressedSpritePalette *sub_80409C8(u16, u32, u32);
-bool8 IsOtherTrainer(u32, u8 *);
-void SetWildMonHeldItem(void);
-u16 GetMonEVCount(struct Pokemon *);
-
-const struct CompressedSpritePalette *sub_806E794(struct Pokemon *mon);
+const u32 *GetFrontSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality);
const struct CompressedSpritePalette *GetMonSpritePalStruct(struct Pokemon *mon);
const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u16 species, u32 otId , u32 personality);
bool32 IsHMMove2(u16 move);
bool8 IsPokeSpriteNotFlipped(u16 species);
-bool8 IsMonShiny(struct Pokemon *mon);
-bool8 IsShinyOtIdPersonality(u32 otId, u32 personality);
-
-void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies);
+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);
+void sub_8044348(void);
+void SetWildMonHeldItem(void);
+bool8 IsMonShiny(struct Pokemon *mon);
+u8 *GetTrainerPartnerName(void);
+u8 GetPlayerPartyHighestLevel(void);
+u16 FacilityClassToPicIndex(u16 facilityClass);
+bool8 sub_804455C(u8 caseId, u8 battlerId);
+void SetDeoxysStats(void);
+u16 sub_80447AC(void);
+u16 sub_80447F0(void);
+void CreateObedientEnemyMon(void);
void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality);
-s32 GetBankMultiplayerId(u16 a1);
-bool16 sub_806D82C(u8 id);
-u16 MonTryLearningNewMove(struct Pokemon* mon, bool8);
-void sub_8068AA4(void); // sets stats for deoxys
-bool8 HasTwoFramesAnimation(u16 species);
-u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem);
-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);
-s8 GetMonFlavorRelation(struct Pokemon *mon, u8 a2);
-s8 GetFlavorRelationByPersonality(u32 personality, u8 a2);
-u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit);
-u8 GetDefaultMoveTarget(u8 atkBank);
-u16 PlayerGenderToFrontTrainerPicId(u8 playerGender);
-void sub_806A1C0(u16 arg0, u8 bankIdentity);
-void sub_806A12C(u16 trainerSpriteId, u8 bankIdentity);
-u8 GetSecretBaseTrainerPicIndex(void);
-bool8 TryIncrementMonLevel(struct Pokemon *mon);
-void BoxMonToMon(struct BoxPokemon *srcMon, struct Pokemon *dstMon);
-u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves);
-bool8 HealStatusConditions(struct Pokemon *mon, u32 battlePartyId, u32 healMask, u8 battlerId);
-
-#include "sprite.h"
-
-void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3);
-void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3);
-void BattleAnimateBackSprite(struct Sprite* sprite, u16 species);
-
-void PlayMapChosenOrBattleBGM(u16 songId);
-u8 GetMonsStateToDoubles(void);
-void sub_803E0A4(struct Pokemon *mon, struct BattleTowerPokemon *src);
-void SetMultiuseSpriteTemplateToPokemon(u16 trainerSpriteId, u8 battlerPosition);
-
-const u8 * Battle_PrintStatBoosterEffectMessage(u16 itemId);
+bool8 CheckBattleTypeGhost(struct Pokemon *mon, u8 bank);
+struct OakSpeechNidoranFStruct *OakSpeechNidoranFSetup(u8 battlePosition, bool8 enable);
+void OakSpeechNidoranFFreeResources(void);
+void *OakSpeechNidoranFGetBuffer(u8 bufferId);
#endif // GUARD_POKEMON_H