pokeemerald/include/battle_anim.h

248 lines
9.4 KiB
C
Raw Normal View History

2017-10-14 14:55:25 +00:00
#ifndef GUARD_BATTLE_ANIM_H
#define GUARD_BATTLE_ANIM_H
2018-10-23 12:25:51 +00:00
#include "battle.h"
2018-10-21 19:07:10 +00:00
#include "constants/battle_anim.h"
2018-12-08 18:22:52 +00:00
#include "task.h"
2018-10-21 19:07:10 +00:00
2017-10-14 14:55:25 +00:00
enum
{
BG_ANIM_SCREEN_SIZE,
BG_ANIM_AREA_OVERFLOW_MODE,
2018-12-13 05:18:25 +00:00
BG_ANIM_MOSAIC,
BG_ANIM_CHAR_BASE_BLOCK,
2017-10-14 14:55:25 +00:00
BG_ANIM_PRIORITY,
2018-12-13 05:18:25 +00:00
BG_ANIM_PALETTES_MODE,
BG_ANIM_SCREEN_BASE_BLOCK,
2017-10-14 14:55:25 +00:00
};
struct UnknownAnimStruct2
{
2018-10-07 10:32:20 +00:00
u8 *bgTiles;
2017-10-14 14:55:25 +00:00
u16 *unk4;
u8 unk8;
2018-10-07 10:32:20 +00:00
u8 bgId;
u16 tilesOffset;
2017-10-14 14:55:25 +00:00
u16 unkC;
};
2017-10-14 21:37:44 +00:00
struct BattleAnimBackground
{
2018-11-07 18:35:31 +00:00
const u32 *image;
const u32 *palette;
const u32 *tilemap;
2017-10-14 21:37:44 +00:00
};
2017-10-15 21:21:59 +00:00
#define ANIM_ARGS_COUNT 8
extern void (*gAnimScriptCallback)(void);
extern bool8 gAnimScriptActive;
extern u8 gAnimVisualTaskCount;
extern u8 gAnimSoundTaskCount;
extern struct DisableStruct *gAnimDisableStructPtr;
2018-10-07 15:45:37 +00:00
extern s32 gAnimMoveDmg;
2017-10-15 21:21:59 +00:00
extern u16 gAnimMovePower;
extern u8 gAnimFriendship;
extern u16 gWeatherMoveAnim;
extern s16 gBattleAnimArgs[ANIM_ARGS_COUNT];
extern u8 gAnimMoveTurn;
2018-02-06 19:48:02 +00:00
extern u8 gBattleAnimAttacker;
extern u8 gBattleAnimTarget;
2018-04-18 14:03:15 +00:00
extern u16 gAnimBattlerSpecies[MAX_BATTLERS_COUNT];
2017-10-15 21:21:59 +00:00
extern u8 gUnknown_02038440;
2017-10-14 14:55:25 +00:00
void ClearBattleAnimationVars(void);
void DoMoveAnim(u16 move);
2017-10-22 16:43:15 +00:00
void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMoveAnim);
2017-10-14 14:55:25 +00:00
void DestroyAnimSprite(struct Sprite *sprite);
void DestroyAnimVisualTask(u8 taskId);
void DestroyAnimSoundTask(u8 taskId);
2018-02-07 21:53:40 +00:00
bool8 IsBattlerSpriteVisible(u8 battlerId);
void sub_80A438C(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible);
2017-10-14 14:55:25 +00:00
bool8 IsContest(void);
2017-10-14 21:37:44 +00:00
s8 BattleAnimAdjustPanning(s8 pan);
s8 BattleAnimAdjustPanning2(s8 pan);
2018-04-18 14:03:15 +00:00
s16 KeepPanInRange(s16 a);
2017-10-15 21:21:59 +00:00
s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan);
2018-10-07 10:32:20 +00:00
void sub_80A4720(u16 a, u16 *b, u32 c, u8 d);
void sub_80A477C(bool8);
2017-10-14 14:55:25 +00:00
2018-12-13 05:18:25 +00:00
// battle_intro.s
2017-10-14 14:55:25 +00:00
void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value);
2018-12-13 05:18:25 +00:00
void sub_8118FBC(int bgId, u8 arg1, u8 arg2, u8 battlerPosition, u8 arg4, u8 *arg5, u16 *arg6, u16 arg7);
2017-10-22 16:43:15 +00:00
void HandleIntroSlide(u8 terrainId);
2018-12-13 05:18:25 +00:00
int GetAnimBgAttribute(u8 bgId, u8 attributeId);
2017-10-22 16:43:15 +00:00
// battle_anim_80A5C6C.s
2018-11-25 23:00:18 +00:00
void sub_80A6450(struct Sprite *sprite);
void SetAverageBattlerPositions(u8 battlerId, bool8 a2, s16 *x, s16 *y);
2018-12-18 04:08:08 +00:00
void DestroySpriteAndMatrix(struct Sprite *sprite);
void TranslateAnimLinearSimple(struct Sprite *sprite);
2018-11-25 23:00:18 +00:00
void InitAnimSpritePos(struct Sprite *sprite, u8 a2);
void sub_80A6980(struct Sprite *sprite, bool8 a2);
void StartAnimLinearTranslation(struct Sprite *sprite);
void InitAnimArcTranslation(struct Sprite *sprite);
2018-10-07 10:32:20 +00:00
bool8 TranslateAnimLinear(struct Sprite *sprite);
2018-11-25 23:00:18 +00:00
void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite);
void sub_80A8EE4(struct Sprite *sprite);
2018-11-26 15:03:50 +00:00
u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId);
void sub_80A6FD4(struct Sprite *sprite);
u16 ArcTan2Neg(s16 a, s16 b);
2018-12-18 04:08:08 +00:00
void TrySetSpriteRotScale(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation);
void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite);
2018-11-26 15:31:03 +00:00
void sub_80A66DC(struct Sprite *sprite);
2018-12-18 04:08:08 +00:00
void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite);
void RunStoredCallbackWhenAnimEnds(struct Sprite *sprite);
2018-11-26 15:31:03 +00:00
void sub_80A6864(struct Sprite *sprite, s16 a2);
s16 sub_80A861C(u8 battlerId, u8 a2);
u8 GetBattlerYCoordWithElevation(u8 battlerId);
2018-11-26 15:55:31 +00:00
void WaitAnimForDuration(struct Sprite *sprite);
2018-11-26 16:25:51 +00:00
void sub_80A7938(struct Sprite *sprite);
void InitAnimLinearTranslation(struct Sprite *sprite);
void sub_80A6F98(struct Sprite *sprite);
u8 sub_80A8328(u8 battlerId);
2018-12-18 04:08:08 +00:00
void *LoadPointerFromVars(s16 bottom, s16 top);
void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr);
2017-10-22 16:43:15 +00:00
void sub_80A8278(void);
void sub_80A6B30(struct UnknownAnimStruct2*);
void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1);
2018-12-18 04:08:08 +00:00
u8 GetBattlerSpriteSubpriority(u8 battlerId);
2018-10-06 21:04:53 +00:00
bool8 TranslateAnimArc(struct Sprite *sprite);
2018-10-07 15:45:37 +00:00
void sub_80A6630(struct Sprite *sprite);
void sub_80A6680(struct Sprite *sprite);
2018-12-18 04:08:08 +00:00
void ResetSpriteRotScale(u8 spriteId);
void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation);
2018-11-25 23:00:18 +00:00
void InitSpriteDataForLinearTranslation(struct Sprite *sprite);
2018-12-18 04:08:08 +00:00
void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode);
void SetBattlerSpriteYOffsetFromRotation(u8 spriteId);
u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7);
u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4);
u8 sub_80A77AC(u8 a1);
2018-12-18 04:08:08 +00:00
s16 CloneBattlerSpriteWithBlend(u8);
void obj_delete_but_dont_free_vram(struct Sprite*);
u8 sub_80A89C8(int, u8, int);
void sub_80A6D60(struct UnknownAnimStruct2*, const void*, u32);
void sub_80A6CC0(u32, const void*, u32);
void sub_80A6DAC(bool8);
2018-12-18 04:08:08 +00:00
void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *);
2018-12-08 18:22:52 +00:00
void sub_80A653C(struct Sprite *);
2018-12-18 04:08:08 +00:00
void SetBattlerSpriteYOffsetFromYScale(u8 spriteId);
2018-12-08 18:22:52 +00:00
void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7);
u8 sub_80A80C8(struct Task *task);
void sub_80A8EE4(struct Sprite *);
2018-12-09 08:14:07 +00:00
void sub_80A67F4(struct Sprite *);
2018-12-14 03:33:54 +00:00
void sub_80A6D48(u32 bgId, const void *src);
2018-12-16 17:35:10 +00:00
void sub_80A7160(struct Sprite *sprite);
bool8 sub_80A70E8(struct Sprite *sprite);
void sub_80A70C0(struct Sprite *sprite);
void TranslateMonBGUntil(struct Sprite *sprite);
void TranslateSpriteOverDuration(struct Sprite *sprite);
void sub_80A77C8(struct Sprite *sprite);
2018-12-18 03:56:34 +00:00
void sub_80A7000(struct Sprite *sprite);
2018-12-18 04:08:08 +00:00
void TranslateSpriteInCircleOverDuration(struct Sprite *sprite);
void SetGreyscaleOrOriginalPalette(u16 a1, bool8 a2);
void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds);
bool8 RunAffineAnimFromTaskData(struct Task *task);
2018-12-18 03:56:34 +00:00
void sub_80A78AC(struct Sprite *sprite);
void sub_80A6BFC(struct UnknownAnimStruct2 *unk, u8 unused);
u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, u32 a10);
void sub_80A749C(struct Sprite *sprite);
void sub_80A6814(u8 taskId);
void sub_80A8610(struct Sprite *sprite);
2017-12-02 18:39:07 +00:00
enum
{
2018-10-06 21:04:53 +00:00
BATTLER_COORD_X,
BATTLER_COORD_Y,
BATTLER_COORD_X_2,
2018-12-18 04:08:08 +00:00
BATTLER_COORD_Y_PIC_OFFSET,
BATTLER_COORD_Y_PIC_OFFSET_DEFAULT,
2017-12-02 18:39:07 +00:00
};
2018-02-07 21:53:40 +00:00
u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId);
2017-12-02 18:39:07 +00:00
2018-02-07 21:53:40 +00:00
bool8 IsBattlerSpritePresent(u8 battlerId);
2018-10-07 10:32:20 +00:00
void sub_80A6C68(u32 arg0);
2018-02-07 21:53:40 +00:00
u8 GetAnimBattlerSpriteId(u8 wantedBattler);
2017-10-22 16:43:15 +00:00
bool8 IsDoubleBattle(void);
u8 sub_80A6D94(void);
2018-10-07 10:32:20 +00:00
u8 sub_80A8364(u8 battlerId);
2017-10-22 16:43:15 +00:00
void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*spriteCallback)(struct Sprite*));
void oamt_add_pos2_onto_pos1(struct Sprite *sprite);
2018-02-07 21:53:40 +00:00
u8 GetBattlerSpriteDefault_Y(u8 battlerId);
u8 GetSubstituteSpriteDefault_Y(u8 battlerId);
2017-11-04 15:11:13 +00:00
// battle_anim_80A9C70.s
2018-10-07 13:39:46 +00:00
#define STAT_ANIM_PLUS1 15
#define STAT_ANIM_PLUS2 39
#define STAT_ANIM_MINUS1 22
#define STAT_ANIM_MINUS2 46
#define STAT_ANIM_MULTIPLE_PLUS1 55
#define STAT_ANIM_MULTIPLE_PLUS2 56
#define STAT_ANIM_MULTIPLE_MINUS1 57
#define STAT_ANIM_MULTIPLE_MINUS2 58
2018-02-07 21:53:40 +00:00
void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId);
2017-10-14 14:55:25 +00:00
2017-12-02 18:39:07 +00:00
// battle_anim_8170478.s
u8 ItemIdToBallId(u16 itemId);
2018-12-14 03:33:54 +00:00
u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId);
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId);
2017-12-02 18:39:07 +00:00
// battle_anim_utility_funcs.s
void sub_8116EB4(u8);
void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u8 *arg8, const u8 *arg9, const u16 *palette);
2018-11-30 23:29:55 +00:00
u32 UnpackSelectedBattleAnimPalettes(s16);
2018-10-06 21:04:53 +00:00
u8 GetBattlerSpriteFinal_Y(u8, u16, u8);
2018-05-10 23:28:52 +00:00
2018-10-23 12:25:51 +00:00
extern const struct OamData gUnknown_08524944;
extern const struct OamData gUnknown_08524A8C;
extern const struct OamData gUnknown_08524904;
extern const struct OamData gUnknown_085249C4;
extern const struct OamData gUnknown_0852490C;
extern const struct OamData gUnknown_08524934;
extern const struct OamData gUnknown_08524974;
extern const struct OamData gUnknown_0852499C;
extern const struct OamData gUnknown_085249CC;
2018-10-23 16:17:31 +00:00
extern const struct OamData gUnknown_08524914;
extern const struct OamData gUnknown_0852496C;
extern const struct OamData gUnknown_08524A34;
extern const struct OamData gUnknown_08524A3C;
extern const struct OamData gUnknown_08524A94;
extern const struct OamData gUnknown_08524954;
extern const struct OamData gUnknown_08524AE4;
extern const struct OamData gUnknown_085249D4;
2018-10-24 19:52:21 +00:00
extern const struct OamData gUnknown_08524A9C;
extern const struct OamData gUnknown_08524ADC;
extern const struct OamData gUnknown_08524B14;
extern const struct OamData gUnknown_08524A54;
extern const struct OamData gUnknown_08524A14;
extern const struct OamData gUnknown_08524A1C;
extern const struct OamData gUnknown_085249BC;
extern const struct OamData gUnknown_08524AF4;
extern const struct OamData gUnknown_085249DC;
extern const struct OamData gUnknown_08524AFC;
extern const struct OamData gUnknown_08524B1C;
extern const struct OamData gUnknown_08524A04;
extern const struct OamData gUnknown_08524A2C;
extern const struct OamData gUnknown_08524AEC;
extern const struct OamData gUnknown_08524964;
2018-10-25 00:01:40 +00:00
extern const struct OamData gUnknown_08524B24;
extern const struct OamData gUnknown_08524A24;
extern const struct OamData gUnknown_08524AC4;
extern const struct OamData gUnknown_08524A84;
extern const struct OamData gUnknown_08524A64;
2018-10-25 21:46:23 +00:00
extern const struct OamData gUnknown_0852491C;
extern const struct OamData gUnknown_0852495C;
extern const struct OamData gUnknown_0852497C;
extern const struct OamData gUnknown_085249F4;
extern const struct OamData gUnknown_0852493C;
extern const struct OamData gUnknown_08524A5C;
extern const struct OamData gUnknown_08524A74;
2018-10-23 12:25:51 +00:00
2018-12-14 03:33:54 +00:00
extern const struct CompressedSpriteSheet gBattleAnimPicTable[];
extern const struct CompressedSpritePalette gBattleAnimPaletteTable[];
2017-10-14 14:55:25 +00:00
#endif // GUARD_BATTLE_ANIM_H