Move field effects enum to defines
This commit is contained in:
+63
-57
@@ -4,11 +4,10 @@
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "field_camera.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "field_effect.h"
|
||||
#include "field_effect_helpers.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "fieldmap.h"
|
||||
#include "global.fieldmap.h"
|
||||
#include "menu.h"
|
||||
#include "metatile_behavior.h"
|
||||
#include "overworld.h"
|
||||
@@ -25,6 +24,7 @@
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/event_object_movement_constants.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/flags.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/moves.h"
|
||||
@@ -35,39 +35,15 @@ static EWRAM_DATA u8 gUnknown_0203734C = 0;
|
||||
EWRAM_DATA struct EventObject gEventObjects[EVENT_OBJECTS_COUNT] = {};
|
||||
EWRAM_DATA struct PlayerAvatar gPlayerAvatar = {};
|
||||
|
||||
static void StartStrengthAnim(u8, u8);
|
||||
static bool8 ShouldJumpLedge(s16, s16, u8);
|
||||
static bool8 sub_808B1BC(s16, s16, u8);
|
||||
static u8 sub_808B164(struct EventObject *, s16, s16, u8, u8);
|
||||
static u8 sub_808B238(s16, s16, u8);
|
||||
static void check_acro_bike_metatile(s16, s16, u8, u8 *);
|
||||
static void PlayerNotOnBikeCollide(u8);
|
||||
static void PlayCollisionSoundIfNotFacingWarp(u8 a);
|
||||
static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8);
|
||||
static void PlayerRun(u8);
|
||||
static void MovePlayerNotOnBike(u8, u16);
|
||||
static u8 CheckMovementInputNotOnBike(u8);
|
||||
static void DoPlayerMatSpin(void);
|
||||
static void DoPlayerMatJump(void);
|
||||
static u8 CheckForPlayerAvatarCollision(u8);
|
||||
// static declarations
|
||||
|
||||
static u8 EventObjectCB2_NoMovement2();
|
||||
static void sub_808C280(struct EventObject *);
|
||||
static bool8 TryInterruptEventObjectSpecialAnim(struct EventObject *, u8);
|
||||
static void npc_clear_strange_bits(struct EventObject *);
|
||||
static void DoPlayerAvatarTransition(void);
|
||||
static bool8 player_is_anim_in_certain_ranges(void);
|
||||
static bool8 sub_808B618(void);
|
||||
static bool8 PlayerIsAnimActive(void);
|
||||
static bool8 PlayerCheckIfAnimFinishedOrInactive(void);
|
||||
static bool8 TryDoMetatileBehaviorForcedMovement();
|
||||
static void MovePlayerAvatarUsingKeypadInput(u8, u16, u16);
|
||||
static void PlayerAllowForcedMovementIfMovingSameDirection();
|
||||
static u8 sub_808B028(u8);
|
||||
static bool8 TryDoMetatileBehaviorForcedMovement();
|
||||
static u8 GetForcedMovementByMetatileBehavior();
|
||||
static void PlayerNotOnBikeNotMoving(u8, u16);
|
||||
static void PlayerNotOnBikeTurningInPlace(u8, u16);
|
||||
static void PlayerNotOnBikeMoving(u8, u16);
|
||||
static void sub_808C750(u8);
|
||||
|
||||
static bool8 ForcedMovement_None(void);
|
||||
static bool8 ForcedMovement_Slip(void);
|
||||
@@ -87,25 +63,63 @@ static bool8 ForcedMovement_0xBB(void);
|
||||
static bool8 ForcedMovement_0xBC(void);
|
||||
static bool8 ForcedMovement_MuddySlope(void);
|
||||
|
||||
static void MovePlayerNotOnBike(u8, u16);
|
||||
static u8 CheckMovementInputNotOnBike(u8);
|
||||
static void PlayerNotOnBikeNotMoving(u8, u16);
|
||||
static void PlayerNotOnBikeTurningInPlace(u8, u16);
|
||||
static void PlayerNotOnBikeMoving(u8, u16);
|
||||
static u8 CheckForPlayerAvatarCollision(u8);
|
||||
static u8 sub_808B028(u8);
|
||||
static u8 sub_808B164(struct EventObject *, s16, s16, u8, u8);
|
||||
static bool8 sub_808B1BC(s16, s16, u8);
|
||||
static bool8 ShouldJumpLedge(s16, s16, u8);
|
||||
static u8 sub_808B238(s16, s16, u8);
|
||||
static void check_acro_bike_metatile(s16, s16, u8, u8 *);
|
||||
|
||||
static void DoPlayerAvatarTransition(void);
|
||||
static void PlayerAvatarTransition_Dummy(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_Normal(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_MachBike(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_AcroBike(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_Surfing(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_Underwater(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_ReturnToField(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_Dummy(struct EventObject *a);
|
||||
|
||||
static bool8 player_is_anim_in_certain_ranges(void);
|
||||
static bool8 sub_808B618(void);
|
||||
static bool8 PlayerIsAnimActive(void);
|
||||
static bool8 PlayerCheckIfAnimFinishedOrInactive(void);
|
||||
|
||||
static void PlayerRun(u8);
|
||||
static void PlayerNotOnBikeCollide(u8);
|
||||
static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8);
|
||||
|
||||
static void PlayCollisionSoundIfNotFacingWarp(u8 a);
|
||||
|
||||
static void sub_808C280(struct EventObject *);
|
||||
|
||||
static void StartStrengthAnim(u8, u8);
|
||||
static void Task_BumpBoulder(u8 taskId);
|
||||
static u8 sub_808C3A4(struct Task *task, struct EventObject *playerObject, struct EventObject *strengthObject);
|
||||
static u8 do_boulder_dust(struct Task *task, struct EventObject *playerObject, struct EventObject *strengthObject);
|
||||
static u8 sub_808C484(struct Task *task, struct EventObject *playerObject, struct EventObject *strengthObject);
|
||||
|
||||
static void DoPlayerMatJump(void);
|
||||
static void DoPlayerAvatarSecretBaseMatJump(u8 taskId);
|
||||
static u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *task, struct EventObject *eventObject);
|
||||
|
||||
static void DoPlayerMatSpin(void);
|
||||
static void PlayerAvatar_DoSecretBaseMatSpin(u8 taskId);
|
||||
static bool8 PlayerAvatar_SecretBaseMatSpinStep0(struct Task *task, struct EventObject *eventObject);
|
||||
static bool8 PlayerAvatar_SecretBaseMatSpinStep1(struct Task *task, struct EventObject *eventObject);
|
||||
static bool8 PlayerAvatar_SecretBaseMatSpinStep2(struct Task *task, struct EventObject *eventObject);
|
||||
static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *task, struct EventObject *eventObject);
|
||||
|
||||
static void sub_808C750(u8);
|
||||
static void taskFF_0805D1D4(u8 taskId);
|
||||
static void sub_808C814(u8 taskId);
|
||||
|
||||
static void Task_Fishing(u8 taskId);
|
||||
static u8 Fishing1(struct Task *task);
|
||||
static u8 Fishing2(struct Task *task);
|
||||
static u8 Fishing3(struct Task *task);
|
||||
@@ -122,6 +136,11 @@ static u8 Fishing13(struct Task *task);
|
||||
static u8 Fishing14(struct Task *task);
|
||||
static u8 Fishing15(struct Task *task);
|
||||
static u8 Fishing16(struct Task *task);
|
||||
static void AlignFishingAnimationFrames(void);
|
||||
|
||||
static u8 sub_808D38C(struct EventObject *object, s16 *a1);
|
||||
|
||||
// .rodata
|
||||
|
||||
static bool8 (*const sForcedMovementTestFuncs[])(u8) =
|
||||
{
|
||||
@@ -283,6 +302,7 @@ static bool8 (*const sPlayerAvatarSecretBaseMatSpin[])(struct Task *, struct Eve
|
||||
};
|
||||
|
||||
// .text
|
||||
|
||||
void MovementType_Player(struct Sprite *sprite)
|
||||
{
|
||||
UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, EventObjectCB2_NoMovement2);
|
||||
@@ -728,18 +748,18 @@ static u8 sub_808B238(s16 x, s16 y, u8 direction)
|
||||
{
|
||||
u8 eventObjectId = GetEventObjectIdByXY(x, y);
|
||||
|
||||
if (eventObjectId != 16 && gEventObjects[eventObjectId].graphicsId == 0x57)
|
||||
if (eventObjectId != 16 && gEventObjects[eventObjectId].graphicsId == EVENT_OBJ_GFX_PUSHABLE_BOULDER)
|
||||
{
|
||||
x = gEventObjects[eventObjectId].currentCoords.x;
|
||||
y = gEventObjects[eventObjectId].currentCoords.y;
|
||||
MoveCoords(direction, &x, &y);
|
||||
if (GetCollisionAtCoords(&gEventObjects[eventObjectId], x, y, direction) == 0
|
||||
&& MetatileBehavior_IsNonAnimDoor(MapGridGetMetatileBehaviorAt(x, y)) == 0)
|
||||
{
|
||||
x = gEventObjects[eventObjectId].currentCoords.x;
|
||||
y = gEventObjects[eventObjectId].currentCoords.y;
|
||||
MoveCoords(direction, &x, &y);
|
||||
if (GetCollisionAtCoords(&gEventObjects[eventObjectId], x, y, direction) == 0
|
||||
&& MetatileBehavior_IsNonAnimDoor(MapGridGetMetatileBehaviorAt(x, y)) == 0)
|
||||
{
|
||||
StartStrengthAnim(eventObjectId, direction);
|
||||
return 1;
|
||||
}
|
||||
StartStrengthAnim(eventObjectId, direction);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -981,7 +1001,7 @@ void PlayerGoSpeed4(u8 a)
|
||||
PlayerSetAnimId(GetWalkFastestMovementAction(a), 2);
|
||||
}
|
||||
|
||||
void PlayerRun(u8 a)
|
||||
static void PlayerRun(u8 a)
|
||||
{
|
||||
PlayerSetAnimId(GetPlayerRunMovementAction(a), 2);
|
||||
}
|
||||
@@ -997,13 +1017,13 @@ void PlayerOnBikeCollideWithFarawayIslandMew(u8 a)
|
||||
PlayerSetAnimId(GetWalkInPlaceNormalMovementAction(a), 2);
|
||||
}
|
||||
|
||||
void PlayerNotOnBikeCollide(u8 a)
|
||||
static void PlayerNotOnBikeCollide(u8 a)
|
||||
{
|
||||
PlayCollisionSoundIfNotFacingWarp(a);
|
||||
PlayerSetAnimId(GetWalkInPlaceSlowMovementAction(a), 2);
|
||||
}
|
||||
|
||||
void PlayerNotOnBikeCollideWithFarawayIslandMew(u8 a)
|
||||
static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8 a)
|
||||
{
|
||||
PlayerSetAnimId(GetWalkInPlaceSlowMovementAction(a), 2);
|
||||
}
|
||||
@@ -1450,8 +1470,6 @@ static void sub_808C280(struct EventObject *eventObject)
|
||||
|
||||
/* Strength */
|
||||
|
||||
static void Task_BumpBoulder(u8 taskId);
|
||||
|
||||
static void StartStrengthAnim(u8 a, u8 b)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_BumpBoulder, 0xFF);
|
||||
@@ -1523,8 +1541,6 @@ static bool8 sub_808C484(struct Task *task, struct EventObject *playerObject, st
|
||||
|
||||
/* Some field effect */
|
||||
|
||||
static void DoPlayerAvatarSecretBaseMatJump(u8 taskId);
|
||||
|
||||
static void DoPlayerMatJump(void)
|
||||
{
|
||||
DoPlayerAvatarSecretBaseMatJump(CreateTask(DoPlayerAvatarSecretBaseMatJump, 0xFF));
|
||||
@@ -1557,8 +1573,6 @@ static u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *task, struct EventObject
|
||||
|
||||
/* Some field effect */
|
||||
|
||||
static void PlayerAvatar_DoSecretBaseMatSpin(u8 taskId);
|
||||
|
||||
static void DoPlayerMatSpin(void)
|
||||
{
|
||||
u8 taskId = CreateTask(PlayerAvatar_DoSecretBaseMatSpin, 0xFF);
|
||||
@@ -1632,9 +1646,6 @@ static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *task, struct Event
|
||||
|
||||
/* Some Field effect */
|
||||
|
||||
static void taskFF_0805D1D4(u8 taskId);
|
||||
static void sub_808C814(u8 taskId);
|
||||
|
||||
static void sub_808C750(u8 a)
|
||||
{
|
||||
u8 taskId;
|
||||
@@ -1699,9 +1710,6 @@ static bool8 (*const sFishingStateFuncs[])(struct Task *) =
|
||||
Fishing16,
|
||||
};
|
||||
|
||||
static void Task_Fishing(u8 taskId);
|
||||
static void AlignFishingAnimationFrames(void);
|
||||
|
||||
#define tStep data[0]
|
||||
#define tFrameCounter data[1]
|
||||
#define tNumDots data[2]
|
||||
@@ -2082,8 +2090,6 @@ static u8 sub_808D080(void)
|
||||
return gUnknown_0203734C;
|
||||
}
|
||||
|
||||
static u8 sub_808D38C(struct EventObject *object, s16 *a1);
|
||||
|
||||
static void sub_808D094(u8 taskId)
|
||||
{
|
||||
struct EventObject *object = &gEventObjects[gPlayerAvatar.eventObjectId];
|
||||
|
||||
Reference in New Issue
Block a user