2022-01-04 00:00:31 -06:00
|
|
|
#ifndef GUARD_MOVES_H
|
|
|
|
#define GUARD_MOVES_H
|
|
|
|
|
2023-09-01 04:09:46 -04:00
|
|
|
#include "code_809447C.h"
|
2022-01-04 00:00:31 -06:00
|
|
|
#include "constants/move.h"
|
2021-12-31 16:08:12 -06:00
|
|
|
#include "constants/move_id.h"
|
2023-09-01 04:09:46 -04:00
|
|
|
#include "pokemon.h"
|
2023-09-20 22:26:35 -04:00
|
|
|
#include "structs/subStruct_203B240.h"
|
2022-01-04 00:00:31 -06:00
|
|
|
|
2023-09-01 04:09:46 -04:00
|
|
|
// size: 0x8
|
2023-09-02 08:50:36 -04:00
|
|
|
typedef struct MoveLearnset
|
2023-09-01 04:09:46 -04:00
|
|
|
{
|
|
|
|
const u8 *levelUpMoves;
|
|
|
|
const u8 *HMTMMoves;
|
2023-09-02 08:50:36 -04:00
|
|
|
} MoveLearnset;
|
2023-01-16 20:01:56 +01:00
|
|
|
|
2023-09-01 04:09:46 -04:00
|
|
|
// size: 0x8
|
2023-09-02 08:50:36 -04:00
|
|
|
typedef struct MoveDataFile
|
2023-09-01 04:09:46 -04:00
|
|
|
{
|
2023-09-02 08:50:36 -04:00
|
|
|
MoveDataEntry *moveData;
|
|
|
|
MoveLearnset *moveLearnsets;
|
|
|
|
} MoveDataFile;
|
2023-01-18 20:14:43 +01:00
|
|
|
|
2023-09-09 15:10:53 -04:00
|
|
|
bool8 CanBeSnatched(u16 moveID);
|
2024-10-17 16:01:38 +02:00
|
|
|
void CopyAndResetMoves(Moves *destMoves, Move *srcMoves);
|
2023-09-09 19:53:10 -04:00
|
|
|
void CopyBareMoveData(Move *destMoves, Move *srcMoves);
|
2023-09-09 19:03:23 -04:00
|
|
|
bool8 DoesMoveCharge(u16 move);
|
|
|
|
bool8 FailsWhileMuzzled(u16 moveID);
|
|
|
|
const u8 *GetHMTMMoves(s16 species);
|
|
|
|
const u8 *GetLevelUpMoves(s16 species);
|
2023-09-09 19:53:10 -04:00
|
|
|
s32 GetLinkedSequence(s32 index, Move *moves, u16 *sequenceMoveIDs);
|
2023-09-09 19:03:23 -04:00
|
|
|
s32 GetMoveAccuracyOrAIChance(Move *move, u32 accuracyType);
|
2023-09-09 19:53:10 -04:00
|
|
|
u8 GetMoveAIWeight(Move *move);
|
|
|
|
s32 GetMoveBasePower(Move *move);
|
|
|
|
u32 GetMoveBasePP(Move *move);
|
|
|
|
u32 GetMoveCritChance(Move *move);
|
|
|
|
u32 GetMoveMaxUpgradeLevel(Move *move);
|
|
|
|
u32 GetMoveNumberOfChainedHits(Move *move);
|
2023-09-09 19:03:23 -04:00
|
|
|
s16 GetMoveTargetAndRange(Move *move, bool32 isAI);
|
|
|
|
u8 *GetMoveUseText(u16 moveID);
|
2023-09-09 19:53:10 -04:00
|
|
|
u8 GetMoveType(Move *move);
|
2023-09-09 19:03:23 -04:00
|
|
|
void InitPokemonMove(Move *move, u16 moveID);
|
|
|
|
void InitZeroedPPPokemonMove(Move *move, u16 moveID);
|
2023-09-09 19:53:10 -04:00
|
|
|
bool8 IsAnyMoveLinked(s32 unused, Move *moves);
|
2023-09-09 19:03:23 -04:00
|
|
|
bool8 IsMoveEnabled(s32 index, Move *moves);
|
|
|
|
bool8 IsMoveSet(s32 index, Move *moves);
|
|
|
|
bool8 IsNextMoveLinked(s32 index, Move *moves);
|
|
|
|
bool8 IsReflectedByMagicCoat(u16 moveID);
|
2023-09-09 19:53:10 -04:00
|
|
|
bool8 IsSoundMove(Move *move);
|
2023-09-01 04:09:46 -04:00
|
|
|
void LoadWazaParameters(void);
|
2023-09-09 19:53:10 -04:00
|
|
|
bool8 MoveCannotHitFrozen(Move *move);
|
|
|
|
bool8 MoveIgnoresTaunted(Move *move);
|
|
|
|
void RemoveLinkSequenceFromMoves8(Move *moves, s32 index);
|
2024-11-09 03:22:29 -05:00
|
|
|
void ReadPoke1MovesBits(DataSerializer *, Move *moveSet);
|
|
|
|
void WritePoke1MovesBits(DataSerializer *, Move *moveSet);
|
2023-09-09 19:03:23 -04:00
|
|
|
bool8 ToggleMoveEnabled(s32 index, Move *moves);
|
|
|
|
bool8 ToggleSetMove(s32 index, Move *moves);
|
|
|
|
bool8 TryLinkMovesAfter(s32 index, Move *moves);
|
2023-09-09 19:53:10 -04:00
|
|
|
void unk_CopyMoves4To8(Move *destMoves, Move *srcMoves);
|
|
|
|
void unk_CopyMoves4To8AndClearFlag2Unk4(Move *destMoves, Move *srcMoves);
|
|
|
|
s32 unk_FindMoveEnabledForAIAfter4(Move *moves, s32 index);
|
|
|
|
s32 unk_FindMoveEnabledForAIAfter8(Move *moves, s32 index);
|
|
|
|
s32 unk_FindMoveEnabledForAIAfter8_v2(Move *moves, s32 index);
|
|
|
|
s32 unk_FindMoveEnabledForAIBefore8(Move *moves, s32 index);
|
|
|
|
s32 unk_FindMoveEnabledForAIBefore8_v2(Move *moves, s32 index);
|
|
|
|
void unk_FixLinkedMovesSetEnabled4(Move *moves);
|
|
|
|
void unk_FixLinkedMovesSetEnabled8(Move *moves);
|
|
|
|
void unk_FixLinkedMovesSetEnabled8_v2(Move *moves);
|
|
|
|
s32 unk_MoveIDPrintMoveDescription(s32, u16 moveID, s32, struct subStruct_203B240 **);
|
|
|
|
s32 unk_PrintMoveDescription(s32 x, Move *move, s32, struct subStruct_203B240 **);
|
|
|
|
s32 unk_SetMoveToFirstInLinkedSequence4(Move *moves, s32 index);
|
|
|
|
s32 unk_SetMoveToFirstInLinkedSequence8_v2(Move *moves, s32 index);
|
|
|
|
s32 unk_SetMoveToLastInLinkedSequence4(Move *moves, s32 index);
|
|
|
|
s32 unk_SetMoveToLastInLinkedSequence8_v2(Move *moves, s32 index);
|
2023-09-09 19:03:23 -04:00
|
|
|
bool8 UnlinkMovesAfter(s32 index, Move *moves);
|
|
|
|
void UnSetMove(s32 index, Move *moves);
|
2023-02-01 21:54:49 +01:00
|
|
|
|
2023-09-09 19:53:10 -04:00
|
|
|
u8 sub_809287C(Move *move);
|
|
|
|
void sub_80928A0(u8 *buffer, Move *move, const unkStruct_80928C0 *);
|
2025-02-03 20:43:41 -06:00
|
|
|
void BufferMoveName(u8 *buffer, Move *move, const unkStruct_80928C0 *);
|
2025-02-02 13:36:37 -06:00
|
|
|
void InitPokemonMoveOrNullObject(Move *move, u16 moveID);
|
2023-09-09 19:53:10 -04:00
|
|
|
void sub_8092C84(u8 *buffer, u16 moveID);
|
|
|
|
s32 sub_8092DB8(Move *moves, s32 index);
|
|
|
|
s32 sub_8092F4C(Move *moves, s32 index);
|
|
|
|
bool8 sub_8093318(s32, Move *moves);
|
|
|
|
bool8 sub_809333C(s32, Move *moves);
|
|
|
|
s32 sub_80935B8(Move *moves, s32 index);
|
|
|
|
void sub_8094060(Move *srcMoves, Move *destMoves);
|
2024-11-09 03:22:29 -05:00
|
|
|
void WritePoke2MovesBits(DataSerializer *, struct Moves *);
|
|
|
|
void ReadPoke2MovesBits(DataSerializer *, struct Moves *);
|
2023-02-01 21:54:49 +01:00
|
|
|
|
2024-10-12 21:08:16 +02:00
|
|
|
static inline bool8 MoveFlagExists(Move *move)
|
|
|
|
{
|
|
|
|
return (move->moveFlags & MOVE_FLAG_EXISTS);
|
|
|
|
}
|
|
|
|
|
2024-10-15 16:27:41 +02:00
|
|
|
static inline bool8 MoveFlagSet(Move *move)
|
|
|
|
{
|
|
|
|
return (move->moveFlags & MOVE_FLAG_SET);
|
|
|
|
}
|
|
|
|
|
2024-10-17 11:14:09 +02:00
|
|
|
static inline bool8 MoveFlagLastUsed(Move *move)
|
|
|
|
{
|
|
|
|
return (move->moveFlags & MOVE_FLAG_LAST_USED);
|
|
|
|
}
|
|
|
|
|
2024-10-13 14:35:12 +02:00
|
|
|
static inline bool8 MoveFlagLinkChain(Move *move)
|
|
|
|
{
|
|
|
|
return (move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool8 MoveFlagDisabled(Move *move)
|
|
|
|
{
|
|
|
|
return (move->moveFlags & MOVE_FLAG_DISABLED);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool8 MoveFlagSealed(Move *move)
|
|
|
|
{
|
|
|
|
return (move->moveFlags2 & MOVE_FLAG_SEALED);
|
|
|
|
}
|
|
|
|
|
2024-09-18 19:35:14 -07:00
|
|
|
#endif // GUARD_MOVES_H
|