pokefirered/include/event_object_movement.h
2020-03-25 03:22:12 -04:00

202 lines
8.7 KiB
C

#ifndef GUARD_EVENT_OBJECT_MOVEMENT_H
#define GUARD_EVENT_OBJECT_MOVEMENT_H
#include "global.h"
// Exported struct declarations
enum SpinnerRunnerFollowPatterns
{
RUNFOLLOW_ANY,
RUNFOLLOW_NORTH_SOUTH,
RUNFOLLOW_EAST_WEST,
RUNFOLLOW_NORTH_WEST,
RUNFOLLOW_NORTH_EAST,
RUNFOLLOW_SOUTH_WEST,
RUNFOLLOW_SOUTH_EAST,
RUNFOLLOW_NORTH_SOUTH_WEST,
RUNFOLLOW_NORTH_SOUTH_EAST,
RUNFOLLOW_NORTH_EAST_WEST,
RUNFOLLOW_SOUTH_EAST_WEST
};
struct UnkStruct_083A3698
{
const union AnimCmd *const *anims;
u8 animPos[4];
};
#define GROUND_EFFECT_FLAG_TALL_GRASS_ON_SPAWN (1 << 0)
#define GROUND_EFFECT_FLAG_TALL_GRASS_ON_MOVE (1 << 1)
#define GROUND_EFFECT_FLAG_LONG_GRASS_ON_SPAWN (1 << 2)
#define GROUND_EFFECT_FLAG_LONG_GRASS_ON_MOVE (1 << 3)
#define GROUND_EFFECT_FLAG_ICE_REFLECTION (1 << 4)
#define GROUND_EFFECT_FLAG_REFLECTION (1 << 5)
#define GROUND_EFFECT_FLAG_SHALLOW_FLOWING_WATER (1 << 6)
#define GROUND_EFFECT_FLAG_SAND (1 << 7)
#define GROUND_EFFECT_FLAG_DEEP_SAND (1 << 8)
#define GROUND_EFFECT_FLAG_RIPPLES (1 << 9)
#define GROUND_EFFECT_FLAG_PUDDLE (1 << 10)
#define GROUND_EFFECT_FLAG_SAND_PILE (1 << 11)
#define GROUND_EFFECT_FLAG_LAND_IN_TALL_GRASS (1 << 12)
#define GROUND_EFFECT_FLAG_LAND_IN_LONG_GRASS (1 << 13)
#define GROUND_EFFECT_FLAG_LAND_IN_SHALLOW_WATER (1 << 14)
#define GROUND_EFFECT_FLAG_LAND_IN_DEEP_WATER (1 << 15)
#define GROUND_EFFECT_FLAG_LAND_ON_NORMAL_GROUND (1 << 16)
#define GROUND_EFFECT_FLAG_SHORT_GRASS (1 << 17)
#define GROUND_EFFECT_FLAG_HOT_SPRINGS (1 << 18)
#define GROUND_EFFECT_FLAG_SEAWEED (1 << 19)
struct PairedPalettes
{
u16 tag;
const u16 *data;
};
// Exported RAM declarations
// Exported ROM declarations
void sub_808D438(void);
u8 GetObjectEventIdByLocalIdAndMap(u8, u8, u8);
bool8 TryGetObjectEventIdByLocalIdAndMap(u8, u8, u8, u8 *);
u8 GetObjectEventIdByXY(s16, s16);
void SetObjectEventDirection(struct ObjectEvent *, u8);
u8 sub_808D4F4(void);
void RemoveObjectEventByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup);
u16 sub_805FCD8(u8 localId, u8 mapNum, u8 mapGroup);
void LoadPlayerObjectReflectionPalette(u16, u8);
void LoadSpecialObjectReflectionPalette(u16, u8);
void TryMoveObjectEventToMapCoords(u8, u8, u8, s16, s16);
void PatchObjectPalette(u16, u8);
void sub_808E16C(s16, s16);
void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat);
void sub_8063AD4(s16, s16, s16 *, s16 *);
u8 GetFaceDirectionAnimNum(u8);
void sub_8063BC4(s16 *, s16 *, s16, s16);
void ObjectEventClearHeldMovement(struct ObjectEvent *);
void ObjectEventClearHeldMovementIfActive(struct ObjectEvent *);
void SpawnObjectEventsInView(s16, s16);
u8 sprite_new(u8, u8, s16, s16, u8, u8);
u8 AddPseudoObjectEvent(u16, SpriteCallback, s16, s16, u8);
u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup);
int SpawnSpecialObjectEventParameterized(u8, u8, u8, s16, s16, u8);
u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *);
void CameraObjectReset1(void);
void CameraObjectReset2(void);
void ObjectEventSetGraphicsId(struct ObjectEvent *, u8);
void ObjectEventTurn(struct ObjectEvent *, u8);
void ObjectEventTurnByLocalIdAndMap(u8, u8, u8, u8);
void ObjectEventForceSetHeldMovement(struct ObjectEvent *, u8);
const struct ObjectEventGraphicsInfo *GetObjectEventGraphicsInfo(u8);
void npc_by_local_id_and_map_set_field_1_bit_x20(u8, u8, u8, u8);
void FreeAndReserveObjectSpritePalettes(void);
void sub_808E82C(u8, u8, u8, s16, s16);
void sub_805F400(u8, u8, u8);
void sub_805F3A8(u8, u8, u8, u8);
void sub_808E75C(s16, s16);
void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup);
void ShiftObjectEventCoords(struct ObjectEvent *, s16, s16);
void sub_808EB08(struct ObjectEvent *, s16, s16);
void TryOverrideObjectEventTemplateCoords(u8, u8, u8);
void UpdateObjectEventCurrentMovement(struct ObjectEvent *, struct Sprite *, bool8(struct ObjectEvent *, struct Sprite *));
u8 ObjectEventFaceOppositeDirection(struct ObjectEvent *, u8);
u8 GetOppositeDirection(u8);
u8 GetWalkInPlaceFastMovementAction(u32);
u8 GetStepInPlaceDelay8AnimId(u32);
u8 GetWalkInPlaceNormalMovementAction(u32);
u8 GetWalkInPlaceSlowMovementAction(u32);
u8 GetStepInPlaceDelay32AnimId(u32);
u8 GetCollisionAtCoords(struct ObjectEvent *, s16, s16, u32);
void MoveCoords(u8, s16 *, s16 *);
bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *);
u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *);
u8 GetObjectEventIdByXYZ(u16 x, u16 y, u8 z);
void sub_8063E28(struct ObjectEvent *, struct Sprite *);
bool8 ObjectEventSetHeldMovement(struct ObjectEvent *, u8);
void ShiftStillObjectEventCoords(struct ObjectEvent *);
void OverrideMovementTypeForObjectEvent(const struct ObjectEvent *, u8);
void SetTrainerMovementType(struct ObjectEvent *, u8);
u8 GetFishingNoCatchDirectionAnimNum(u8 direction);
u8 GetFishingBiteDirectionAnimNum(u8 a0);
void ObjectEventSetGraphicsId(struct ObjectEvent *objectEvent, u8 a1);
u8 sub_805EB44(u8, u8, s16, s16);
void InitObjectEventPalettes(u8 mode);
bool8 ObjectEventIsMovementOverridden(struct ObjectEvent *objectEvent);
u8 ObjectEventCheckHeldMovementStatus(struct ObjectEvent *objectEvent);
u8 GetWalkNormalMovementAction(u32);
u8 GetWalkFastMovementAction(u32);
u8 GetWalkFastestMovementAction(u32);
u8 sub_8063F2C(u32 direction);
u8 GetTrainerFacingDirectionMovementType(u8 direction);
u8 GetFaceDirectionMovementAction(u32);
void CameraObjectSetFollowedObjectId(u8 objectId);
void UnfreezeObjectEvents(void);
void sub_8069058(u8, u8);
u8 GetSlideMovementAction(u32);
u8 GetJumpInPlaceMovementAction(u32);
u8 GetJumpMovementAction(u32);
u8 GetJump2MovementAction(u32);
bool8 sub_8068BCC(struct Sprite *sprite);
void sub_8068D1C(struct Sprite *, u8, u8, u8);
u8 sub_8068D3C(struct Sprite *);
u8 sub_8068DC4(struct Sprite *);
void TurnObjectEvent(u8, u8);
const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId);
u8 GetFirstInactiveObjectEventId(void);
u8 GetCollisionFlagsAtCoords(struct ObjectEvent * objectEvent, s16 x, s16 y, u8 direction);
u8 sub_8063FB0(u8 direction);
void OverrideTemplateCoordsForObjectEvent(const struct ObjectEvent *objectEvent);void sub_805C774(void);
void FreezeObjectEvents(void);
bool8 FreezeObjectEvent(struct ObjectEvent *);
void UnfreezeObjectEvent(struct ObjectEvent *);
void FreezeObjectEventsExceptOne(u8 objEventId);
void RfuUnionObjectSetFacingDirection(u8 objectEventId, u8 direction);
void RfuUnionObjectToggleInvisibility(u8 objectEventId, bool32 invisible);
bool32 RfuUnionObjectIsInvisible(u8 objectEventId);
void RfuUnionObjectStartWarp(u8 objectEventId, u8 animNo);
bool32 RfuUnionObjectIsWarping(u8 objectEventId);
u8 sub_80641C0(u32 direction);
void sub_805F378(s16 x, s16 y);
void MoveObjectEventToMapCoords(struct ObjectEvent *objectEvent, s16 x, s16 y);
u8 CreateCopySpriteAt(struct Sprite * sprite, s16 x, s16 y, u8 subpriority);
u16 GetObjectPaletteTag(u8 paletteIndex);
void SetSpritePosToMapCoords(s16 x, s16 y, s16 *x2, s16 *y2);
void UpdateObjectEventSpriteVisibility(struct Sprite *sprite, bool8 invisible);
bool8 AreZCoordsCompatible(u8, u8);
u8 ZCoordToPriority(u8 z);
void ObjectEventUpdateZCoord(struct ObjectEvent *pObject);
void SetObjectSubpriorityByZCoord(u8 z, struct Sprite * sprite, u8 offset);
bool8 IsZCoordMismatchAt(u8, s16, s16);
void MakeObjectTemplateFromObjectEventGraphicsInfo(u16 graphicsId, void (*callback)(struct Sprite *), struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables);
u8 AddCameraObject(u8 trackedSpriteId);
void UpdateObjectEventsForCameraUpdate(s16 x, s16 y);
void UpdateObjectEventSpriteSubpriorityAndVisibility(struct Sprite *);
void SetMovementDelay(struct Sprite *, s16);
bool8 WaitForMovementDelay(struct Sprite *);
void oamt_npc_ministep_reset(struct Sprite *, u8, u8);
bool8 obj_npc_ministep(struct Sprite *sprite);
void sub_8068BBC(struct Sprite *, u8);
void sub_8068C58(struct Sprite *, u8);
bool8 sub_8068C68(struct Sprite *sprite);
void sub_8068C08(struct Sprite *, u8);
bool8 sub_8068C18(struct Sprite *sprite);
void DoShadowFieldEffect(struct ObjectEvent *);
void sub_8068CA4(struct Sprite *, u8);
bool8 sub_8068CB4(struct Sprite *sprite);
void SetAndStartSpriteAnim(struct Sprite *, u8, u8);
bool8 SpriteAnimEnded(struct Sprite *);
u8 GetMoveDirectionAnimNum(u8 direction);
// Exported data declarations
extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
extern const struct SpritePalette gUnknown_83A5348;
extern const struct SpriteTemplate * const gFieldEffectObjectTemplatePointers[];
extern const struct OamData gObjectEventBaseOam_32x32;
extern const u16 gUnknown_8398648[];
extern const u16 gUnknown_8398688[];
extern const u8 gReflectionEffectPaletteMap[];
#endif // GUARD_EVENT_OBJECT_MOVEMENT_H