mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
afcc1178b2
# Conflicts: # data/battle_ai_scripts.s # data/battle_scripts_1.s # include/battle_controllers.h # include/battle_script_commands.h # include/battle_util.h # include/constants/battle_script_commands.h # include/constants/global.h # include/decompress.h # src/battle_anim_effects_1.c # src/battle_anim_normal.c # src/battle_anim_poison.c # src/battle_anim_water.c # src/battle_arena.c # src/battle_controller_link_opponent.c # src/battle_controller_link_partner.c # src/battle_controller_opponent.c # src/battle_controller_player.c # src/battle_controller_player_partner.c # src/battle_controller_recorded_opponent.c # src/battle_controller_recorded_player.c # src/battle_controller_safari.c # src/battle_controller_wally.c # src/battle_gfx_sfx_util.c # src/battle_interface.c # src/battle_main.c # src/battle_message.c # src/battle_script_commands.c # src/battle_util.c # src/berry.c # src/data/trainers.h # src/decompress.c # src/field_effect.c # src/hall_of_fame.c # src/overworld.c # src/pokeball.c # src/pokemon.c # src/pokemon_icon.c # src/pokemon_storage_system.c # src/scrcmd.c
140 lines
5.0 KiB
C
140 lines
5.0 KiB
C
#ifndef GUARD_DATA_H
|
|
#define GUARD_DATA_H
|
|
|
|
#include "constants/moves.h"
|
|
|
|
#define SPECIES_SHINY_TAG 5000
|
|
|
|
#define MAX_TRAINER_ITEMS 4
|
|
|
|
enum {
|
|
BATTLER_AFFINE_NORMAL,
|
|
BATTLER_AFFINE_EMERGE,
|
|
BATTLER_AFFINE_RETURN,
|
|
};
|
|
|
|
struct MonCoords
|
|
{
|
|
// This would use a bitfield, but some function
|
|
// uses it as a u8 and casting won't match.
|
|
u8 size; // u8 width:4, height:4;
|
|
u8 y_offset;
|
|
};
|
|
|
|
#define MON_COORDS_SIZE(width, height)(DIV_ROUND_UP(width, 8) << 4 | DIV_ROUND_UP(height, 8))
|
|
#define GET_MON_COORDS_WIDTH(size)((size >> 4) * 8)
|
|
#define GET_MON_COORDS_HEIGHT(size)((size & 0xF) * 8)
|
|
|
|
struct TrainerMonNoItemDefaultMoves
|
|
{
|
|
u16 iv;
|
|
u8 lvl;
|
|
u16 species;
|
|
};
|
|
|
|
struct TrainerMonItemDefaultMoves
|
|
{
|
|
u16 iv;
|
|
u8 lvl;
|
|
u16 species;
|
|
u16 heldItem;
|
|
};
|
|
|
|
struct TrainerMonNoItemCustomMoves
|
|
{
|
|
u16 iv;
|
|
u8 lvl;
|
|
u16 species;
|
|
u16 moves[MAX_MON_MOVES];
|
|
};
|
|
|
|
struct TrainerMonItemCustomMoves
|
|
{
|
|
u16 iv;
|
|
u8 lvl;
|
|
u16 species;
|
|
u16 heldItem;
|
|
u16 moves[MAX_MON_MOVES];
|
|
};
|
|
|
|
#define NO_ITEM_DEFAULT_MOVES(party) { .NoItemDefaultMoves = party }, .partySize = ARRAY_COUNT(party), .partyFlags = 0
|
|
#define NO_ITEM_CUSTOM_MOVES(party) { .NoItemCustomMoves = party }, .partySize = ARRAY_COUNT(party), .partyFlags = F_TRAINER_PARTY_CUSTOM_MOVESET
|
|
#define ITEM_DEFAULT_MOVES(party) { .ItemDefaultMoves = party }, .partySize = ARRAY_COUNT(party), .partyFlags = F_TRAINER_PARTY_HELD_ITEM
|
|
#define ITEM_CUSTOM_MOVES(party) { .ItemCustomMoves = party }, .partySize = ARRAY_COUNT(party), .partyFlags = F_TRAINER_PARTY_CUSTOM_MOVESET | F_TRAINER_PARTY_HELD_ITEM
|
|
|
|
union TrainerMonPtr
|
|
{
|
|
const struct TrainerMonNoItemDefaultMoves *NoItemDefaultMoves;
|
|
const struct TrainerMonNoItemCustomMoves *NoItemCustomMoves;
|
|
const struct TrainerMonItemDefaultMoves *ItemDefaultMoves;
|
|
const struct TrainerMonItemCustomMoves *ItemCustomMoves;
|
|
};
|
|
|
|
struct Trainer
|
|
{
|
|
/*0x00*/ u8 partyFlags;
|
|
/*0x01*/ u8 trainerClass;
|
|
/*0x02*/ u8 encounterMusic_gender; // last bit is gender
|
|
/*0x03*/ u8 trainerPic;
|
|
/*0x04*/ u8 trainerName[TRAINER_NAME_LENGTH + 1];
|
|
/*0x10*/ u16 items[MAX_TRAINER_ITEMS];
|
|
/*0x18*/ bool8 doubleBattle;
|
|
/*0x1C*/ u32 aiFlags;
|
|
/*0x20*/ u8 partySize;
|
|
/*0x24*/ union TrainerMonPtr party;
|
|
};
|
|
|
|
#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F))
|
|
|
|
extern const u16 gMinigameDigits_Pal[];
|
|
extern const u32 gMinigameDigits_Gfx[];
|
|
|
|
extern const struct SpriteFrameImage gBattlerPicTable_PlayerLeft[];
|
|
extern const struct SpriteFrameImage gBattlerPicTable_OpponentLeft[];
|
|
extern const struct SpriteFrameImage gBattlerPicTable_PlayerRight[];
|
|
extern const struct SpriteFrameImage gBattlerPicTable_OpponentRight[];
|
|
extern const struct SpriteFrameImage gTrainerBackPicTable_Brendan[];
|
|
extern const struct SpriteFrameImage gTrainerBackPicTable_May[];
|
|
extern const struct SpriteFrameImage gTrainerBackPicTable_Red[];
|
|
extern const struct SpriteFrameImage gTrainerBackPicTable_Leaf[];
|
|
extern const struct SpriteFrameImage gTrainerBackPicTable_RubySapphireBrendan[];
|
|
extern const struct SpriteFrameImage gTrainerBackPicTable_RubySapphireMay[];
|
|
extern const struct SpriteFrameImage gTrainerBackPicTable_Wally[];
|
|
extern const struct SpriteFrameImage gTrainerBackPicTable_Steven[];
|
|
|
|
extern const union AffineAnimCmd *const gAffineAnims_BattleSpritePlayerSide[];
|
|
extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteOpponentSide[];
|
|
extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteContest[];
|
|
|
|
extern const union AnimCmd *const gAnims_MonPic[];
|
|
extern const struct MonCoords gMonFrontPicCoords[];
|
|
extern const struct MonCoords gMonBackPicCoords[];
|
|
extern const struct CompressedSpriteSheet gMonBackPicTable[];
|
|
extern const struct CompressedSpriteSheet gMonBackPicTableFemale[];
|
|
extern const struct CompressedSpritePalette gMonPaletteTable[];
|
|
extern const struct CompressedSpritePalette gMonPaletteTableFemale[];
|
|
extern const struct CompressedSpritePalette gMonShinyPaletteTable[];
|
|
extern const struct CompressedSpritePalette gMonShinyPaletteTableFemale[];
|
|
extern const union AnimCmd *const *const gTrainerFrontAnimsPtrTable[];
|
|
extern const struct MonCoords gTrainerFrontPicCoords[];
|
|
extern const struct CompressedSpriteSheet gTrainerFrontPicTable[];
|
|
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
|
|
extern const union AnimCmd *const *const gTrainerBackAnimsPtrTable[];
|
|
extern const struct MonCoords gTrainerBackPicCoords[];
|
|
extern const struct CompressedSpriteSheet gTrainerBackPicTable[]; // functionally unused
|
|
extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[];
|
|
|
|
extern const u8 gEnemyMonElevation[NUM_SPECIES];
|
|
|
|
extern const union AnimCmd *const *const gMonFrontAnimsPtrTable[];
|
|
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
|
|
extern const struct CompressedSpriteSheet gMonFrontPicTableFemale[];
|
|
|
|
extern const struct Trainer gTrainers[];
|
|
extern const u8 gTrainerClassNames[][13];
|
|
extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1];
|
|
extern const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1];
|
|
extern const u8 *const gZMoveNames[];
|
|
|
|
#endif // GUARD_DATA_H
|