ddc752eb14
# Conflicts: # asm/macros/event.inc # data/field_effect_scripts.s # data/maps/BattleFrontier_BattleTowerLobby/scripts.inc # data/script_cmd_table.inc # graphics/pokemon/castform/sunny/anim_front.png # graphics/pokemon/castform/sunny/normal.pal # include/battle_util.h # include/constants/event_object_movement.h # include/constants/field_effects.h # src/battle_controller_player.c # src/battle_util.c # src/data/object_events/movement_action_func_tables.h # src/data/object_events/object_event_pic_tables.h # src/data/trainer_graphics/back_pic_anims.h # src/daycare.c # src/event_object_movement.c # src/field_effect_helpers.c # src/load_save.c # src/scrcmd.c # src/trainer_see.c
174 lines
5.6 KiB
C
174 lines
5.6 KiB
C
#ifndef GUARD_DATA_H
|
|
#define GUARD_DATA_H
|
|
|
|
#include "constants/moves.h"
|
|
#include "constants/trainers.h"
|
|
|
|
#define SPECIES_SHINY_TAG 5000
|
|
#define N_FOLLOWER_HAPPY_MESSAGES 31
|
|
#define N_FOLLOWER_NEUTRAL_MESSAGES 14
|
|
#define N_FOLLOWER_SAD_MESSAGES 3
|
|
#define N_FOLLOWER_UPSET_MESSAGES 3
|
|
#define N_FOLLOWER_ANGRY_MESSAGES 5
|
|
#define N_FOLLOWER_PENSIVE_MESSAGES 20
|
|
#define N_FOLLOWER_LOVE_MESSAGES 10
|
|
#define N_FOLLOWER_SURPRISE_MESSAGES 20
|
|
#define N_FOLLOWER_CURIOUS_MESSAGES 7
|
|
#define N_FOLLOWER_MUSIC_MESSAGES 14
|
|
#define N_FOLLOWER_POISONED_MESSAGES 1
|
|
|
|
#define MAX_TRAINER_ITEMS 4
|
|
|
|
#define TRAINER_PIC_WIDTH 64
|
|
#define TRAINER_PIC_HEIGHT 64
|
|
#define TRAINER_PIC_SIZE (TRAINER_PIC_WIDTH * TRAINER_PIC_HEIGHT / 2)
|
|
|
|
// Red and Leaf's back pics have 5 frames, but this is presumably irrelevant in the places this is used.
|
|
#define MAX_TRAINER_PIC_FRAMES 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;
|
|
};
|
|
|
|
struct TrainerSprite
|
|
{
|
|
u8 y_offset;
|
|
struct CompressedSpriteSheet frontPic;
|
|
struct CompressedSpritePalette palette;
|
|
const union AnimCmd *const *const animation;
|
|
const struct Coords16 mugshotCoords;
|
|
s16 mugshotRotation;
|
|
};
|
|
|
|
struct TrainerBacksprite
|
|
{
|
|
struct MonCoords coordinates;
|
|
struct CompressedSpriteSheet backPic;
|
|
struct CompressedSpritePalette palette;
|
|
const union AnimCmd *const *const animation;
|
|
};
|
|
|
|
#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)
|
|
#define TRAINER_PARTY_IVS(hp, atk, def, speed, spatk, spdef) (hp | (atk << 5) | (def << 10) | (speed << 15) | (spatk << 20) | (spdef << 25))
|
|
#define TRAINER_PARTY_EVS(hp, atk, def, speed, spatk, spdef) ((const u8[6]){hp,atk,def,spatk,spdef,speed})
|
|
#define TRAINER_PARTY_NATURE(nature) (nature+1)
|
|
|
|
struct TrainerMon
|
|
{
|
|
const u8 *nickname;
|
|
const u8 *ev;
|
|
u32 iv;
|
|
u16 moves[4];
|
|
u16 species;
|
|
u16 heldItem;
|
|
u16 ability;
|
|
u8 lvl;
|
|
u8 ball;
|
|
u8 friendship;
|
|
u8 nature : 5;
|
|
bool8 gender : 2;
|
|
bool8 isShiny : 1;
|
|
u8 dynamaxLevel : 4;
|
|
bool8 gigantamaxFactor : 1;
|
|
};
|
|
|
|
#define TRAINER_PARTY(partyArray) partyArray, .partySize = ARRAY_COUNT(partyArray)
|
|
|
|
struct Trainer
|
|
{
|
|
/*0x00*/ u32 aiFlags;
|
|
/*0x04*/ const struct TrainerMon *party;
|
|
/*0x08*/ u16 items[MAX_TRAINER_ITEMS];
|
|
/*0x10*/ u8 trainerClass;
|
|
/*0x11*/ u8 encounterMusic_gender; // last bit is gender
|
|
/*0x12*/ u8 trainerPic;
|
|
/*0x13*/ u8 trainerName[TRAINER_NAME_LENGTH + 1];
|
|
/*0x1E*/ bool8 doubleBattle:1;
|
|
bool8 mugshotEnabled:1;
|
|
u8 padding:6;
|
|
/*0x1F*/ u8 mugshotColor;
|
|
/*0x20*/ u8 partySize;
|
|
};
|
|
|
|
struct TrainerClass
|
|
{
|
|
u8 name[13];
|
|
u8 money;
|
|
u16 ball;
|
|
};
|
|
|
|
#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F))
|
|
|
|
struct FollowerMsgInfo {
|
|
const u8 *text;
|
|
const u8 *script;
|
|
};
|
|
|
|
struct FollowerMessagePool
|
|
{
|
|
const struct FollowerMsgInfo * messages;
|
|
const u8 * script;
|
|
u16 length;
|
|
};
|
|
|
|
|
|
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 sAnim_GeneralFrame0[];
|
|
extern const union AnimCmd sAnim_GeneralFrame3[];
|
|
extern const union AnimCmd *const gAnims_MonPic[];
|
|
extern const struct TrainerSprite gTrainerSprites[];
|
|
extern const struct TrainerBacksprite gTrainerBacksprites[];
|
|
|
|
extern const struct Trainer gTrainers[];
|
|
extern const struct Trainer gBattlePartners[];
|
|
|
|
extern const struct TrainerClass gTrainerClasses[TRAINER_CLASS_COUNT];
|
|
extern const u8 gMoveNames[MOVES_COUNT_DYNAMAX][MOVE_NAME_LENGTH + 1];
|
|
extern const u8 *const gZMoveNames[];
|
|
extern const u8 *const gMaxMoveNames[];
|
|
|
|
// Follower text messages
|
|
extern const struct FollowerMsgInfo gFollowerHappyMessages[];
|
|
extern const struct FollowerMsgInfo gFollowerNeutralMessages[];
|
|
extern const struct FollowerMsgInfo gFollowerSadMessages[];
|
|
extern const struct FollowerMsgInfo gFollowerUpsetMessages[];
|
|
extern const struct FollowerMsgInfo gFollowerAngryMessages[];
|
|
extern const struct FollowerMsgInfo gFollowerPensiveMessages[];
|
|
extern const struct FollowerMsgInfo gFollowerLoveMessages[];
|
|
extern const struct FollowerMsgInfo gFollowerSurpriseMessages[];
|
|
extern const struct FollowerMsgInfo gFollowerCuriousMessages[];
|
|
extern const struct FollowerMsgInfo gFollowerMusicMessages[];
|
|
extern const struct FollowerMsgInfo gFollowerPoisonedMessages[];
|
|
|
|
#endif // GUARD_DATA_H
|