Merge pull request #1538 from cbt6/move-speed

Rename some player movement speed functions
This commit is contained in:
GriffinR 2021-11-02 15:07:59 -04:00 committed by GitHub
commit c98fbb5ca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 136 additions and 131 deletions

View File

@ -17,11 +17,11 @@ struct BikeHistoryInputInfo
// Player speeds // Player speeds
enum enum
{ {
SPEED_STANDING, BIKE_SPEED_STANDING,
SPEED_NORMAL, BIKE_SPEED_NORMAL,
SPEED_FAST, BIKE_SPEED_FAST,
SPEED_FASTER, BIKE_SPEED_FASTER,
SPEED_FASTEST, BIKE_SPEED_FASTEST,
}; };
// mach bike transitions enum // mach bike transitions enum

View File

@ -128,10 +128,10 @@
#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP 0x2A #define MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP 0x2A
#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT 0x2B #define MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT 0x2B
#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT 0x2C #define MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT 0x2C
#define MOVEMENT_ACTION_WALK_FASTEST_DOWN 0x2D #define MOVEMENT_ACTION_WALK_FASTER_DOWN 0x2D
#define MOVEMENT_ACTION_WALK_FASTEST_UP 0x2E #define MOVEMENT_ACTION_WALK_FASTER_UP 0x2E
#define MOVEMENT_ACTION_WALK_FASTEST_LEFT 0x2F #define MOVEMENT_ACTION_WALK_FASTER_LEFT 0x2F
#define MOVEMENT_ACTION_WALK_FASTEST_RIGHT 0x30 #define MOVEMENT_ACTION_WALK_FASTER_RIGHT 0x30
#define MOVEMENT_ACTION_SLIDE_DOWN 0x31 #define MOVEMENT_ACTION_SLIDE_DOWN 0x31
#define MOVEMENT_ACTION_SLIDE_UP 0x32 #define MOVEMENT_ACTION_SLIDE_UP 0x32
#define MOVEMENT_ACTION_SLIDE_LEFT 0x33 #define MOVEMENT_ACTION_SLIDE_LEFT 0x33

View File

@ -136,7 +136,7 @@ u8 GetFaceDirectionMovementAction(u32);
u8 GetWalkNormalMovementAction(u32); u8 GetWalkNormalMovementAction(u32);
u8 GetWalkFastMovementAction(u32); u8 GetWalkFastMovementAction(u32);
u8 GetRideWaterCurrentMovementAction(u32); u8 GetRideWaterCurrentMovementAction(u32);
u8 GetWalkFastestMovementAction(u32); u8 GetWalkFasterMovementAction(u32);
u8 GetPlayerRunMovementAction(u32); u8 GetPlayerRunMovementAction(u32);
u8 GetJumpInPlaceMovementAction(u32); u8 GetJumpInPlaceMovementAction(u32);
u8 GetAcroWheelieFaceDirectionMovementAction(u32); u8 GetAcroWheelieFaceDirectionMovementAction(u32);

View File

@ -11,10 +11,10 @@ void PlayerGetDestCoords(s16 *, s16 *);
u8 GetPlayerFacingDirection(void); u8 GetPlayerFacingDirection(void);
u8 GetPlayerMovementDirection(void); u8 GetPlayerMovementDirection(void);
u8 PlayerGetCopyableMovement(void); u8 PlayerGetCopyableMovement(void);
void PlayerGoSpeed1(u8); void PlayerWalkNormal(u8);
void PlayerGoSpeed2(u8); void PlayerWalkFast(u8);
void PlayerRideWaterCurrent(u8); void PlayerRideWaterCurrent(u8);
void PlayerGoSpeed4(u8); void PlayerWalkFaster(u8);
void PlayerOnBikeCollide(u8); void PlayerOnBikeCollide(u8);
void PlayerFaceDirection(u8 a); void PlayerFaceDirection(u8 a);
void PlayerTurnInPlace(u8 a); void PlayerTurnInPlace(u8 a);

View File

@ -71,12 +71,12 @@ static void (*const sMachBikeTransitions[])(u8) =
MachBikeTransition_TrySlowDown, MachBikeTransition_TrySlowDown,
}; };
// bikeFrameCounter is input which is represented by sMachBikeSpeeds in order: 0 is normal speed (1 speed), 1 is fast speed (2 speed), 2 is fastest speed (4 speed) // bikeFrameCounter is input which is represented by sMachBikeSpeeds in order
static void (*const sMachBikeSpeedCallbacks[])(u8) = static void (*const sMachBikeSpeedCallbacks[])(u8) =
{ {
PlayerGoSpeed1, // normal speed (1 speed) PlayerWalkNormal,
PlayerGoSpeed2, // fast speed (2 speed) PlayerWalkFast,
PlayerGoSpeed4, // fastest speed (4 speed) PlayerWalkFaster,
}; };
static void (*const sAcroBikeTransitions[])(u8) = static void (*const sAcroBikeTransitions[])(u8) =
@ -108,7 +108,7 @@ static u8 (*const sAcroBikeInputHandlers[])(u8 *, u16, u16) =
}; };
// used with bikeFrameCounter from mach bike // used with bikeFrameCounter from mach bike
static const u16 sMachBikeSpeeds[] = {SPEED_NORMAL, SPEED_FAST, SPEED_FASTEST}; static const u16 sMachBikeSpeeds[] = {BIKE_SPEED_NORMAL, BIKE_SPEED_FAST, BIKE_SPEED_FASTEST};
// this is a list of timers to compare against later, terminated with 0. the only timer being compared against is 4 frames in this list. // this is a list of timers to compare against later, terminated with 0. the only timer being compared against is 4 frames in this list.
static const u8 sAcroBikeJumpTimerList[] = {4, 0}; static const u8 sAcroBikeJumpTimerList[] = {4, 0};
@ -147,7 +147,7 @@ static u8 GetMachBikeTransition(u8 *dirTraveling)
if (*dirTraveling == 0) if (*dirTraveling == 0)
{ {
*dirTraveling = direction; // update the direction, since below we either faced a direction or we started moving. *dirTraveling = direction; // update the direction, since below we either faced a direction or we started moving.
if (gPlayerAvatar.bikeSpeed == SPEED_STANDING) if (gPlayerAvatar.bikeSpeed == BIKE_SPEED_STANDING)
{ {
gPlayerAvatar.runningState = NOT_MOVING; gPlayerAvatar.runningState = NOT_MOVING;
return MACH_TRANS_FACE_DIRECTION; return MACH_TRANS_FACE_DIRECTION;
@ -159,7 +159,7 @@ static u8 GetMachBikeTransition(u8 *dirTraveling)
// we need to check if the last traveled direction changed from the new direction as well as ensuring that we dont update the state while the player is moving: see the else check. // we need to check if the last traveled direction changed from the new direction as well as ensuring that we dont update the state while the player is moving: see the else check.
if (*dirTraveling != direction && gPlayerAvatar.runningState != MOVING) if (*dirTraveling != direction && gPlayerAvatar.runningState != MOVING)
{ {
if (gPlayerAvatar.bikeSpeed != SPEED_STANDING) if (gPlayerAvatar.bikeSpeed != BIKE_SPEED_STANDING)
{ {
*dirTraveling = direction; // implement the new direction *dirTraveling = direction; // implement the new direction
gPlayerAvatar.runningState = MOVING; gPlayerAvatar.runningState = MOVING;
@ -246,7 +246,7 @@ static void MachBikeTransition_TrySlowDown(u8 direction)
{ {
u8 collision; u8 collision;
if (gPlayerAvatar.bikeSpeed != SPEED_STANDING) if (gPlayerAvatar.bikeSpeed != BIKE_SPEED_STANDING)
gPlayerAvatar.bikeFrameCounter = --gPlayerAvatar.bikeSpeed; gPlayerAvatar.bikeFrameCounter = --gPlayerAvatar.bikeSpeed;
collision = GetBikeCollision(direction); collision = GetBikeCollision(direction);
@ -306,7 +306,7 @@ static u8 AcroBikeHandleInputNormal(u8 *newDirection, u16 newKeys, u16 heldKeys)
return ACRO_TRANS_FACE_DIRECTION; return ACRO_TRANS_FACE_DIRECTION;
} }
} }
if (*newDirection == direction && (heldKeys & B_BUTTON) && gPlayerAvatar.bikeSpeed == SPEED_STANDING) if (*newDirection == direction && (heldKeys & B_BUTTON) && gPlayerAvatar.bikeSpeed == BIKE_SPEED_STANDING)
{ {
gPlayerAvatar.bikeSpeed++; gPlayerAvatar.bikeSpeed++;
gPlayerAvatar.acroBikeState = ACRO_STATE_WHEELIE_MOVING; gPlayerAvatar.acroBikeState = ACRO_STATE_WHEELIE_MOVING;
@ -342,7 +342,7 @@ static u8 AcroBikeHandleInputTurning(u8 *newDirection, u16 newKeys, u16 heldKeys
if (*newDirection == AcroBike_GetJumpDirection()) if (*newDirection == AcroBike_GetJumpDirection())
{ {
Bike_SetBikeStill(); // Bike_SetBikeStill sets speed to standing, but the next line immediately overrides it. could have just reset acroBikeState to 0 here instead of wasting a jump. Bike_SetBikeStill(); // Bike_SetBikeStill sets speed to standing, but the next line immediately overrides it. could have just reset acroBikeState to 0 here instead of wasting a jump.
gPlayerAvatar.bikeSpeed = SPEED_NORMAL; gPlayerAvatar.bikeSpeed = BIKE_SPEED_NORMAL;
if (*newDirection == GetOppositeDirection(direction)) if (*newDirection == GetOppositeDirection(direction))
{ {
// do a turn jump. // do a turn jump.
@ -775,7 +775,7 @@ static void AcroBike_TryHistoryUpdate(u16 newKeys, u16 heldKeys) // newKeys is u
else else
{ {
Bike_UpdateDirTimerHistory(direction); Bike_UpdateDirTimerHistory(direction);
gPlayerAvatar.bikeSpeed = SPEED_STANDING; gPlayerAvatar.bikeSpeed = BIKE_SPEED_STANDING;
} }
direction = heldKeys & (A_BUTTON | B_BUTTON | SELECT_BUTTON | START_BUTTON); // directions is reused for some reason. direction = heldKeys & (A_BUTTON | B_BUTTON | SELECT_BUTTON | START_BUTTON); // directions is reused for some reason.
@ -787,7 +787,7 @@ static void AcroBike_TryHistoryUpdate(u16 newKeys, u16 heldKeys) // newKeys is u
else else
{ {
Bike_UpdateABStartSelectHistory(direction); Bike_UpdateABStartSelectHistory(direction);
gPlayerAvatar.bikeSpeed = SPEED_STANDING; gPlayerAvatar.bikeSpeed = BIKE_SPEED_STANDING;
} }
} }
@ -994,7 +994,7 @@ void BikeClearState(int newDirHistory, int newAbStartHistory)
gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL; gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;
gPlayerAvatar.newDirBackup = DIR_NONE; gPlayerAvatar.newDirBackup = DIR_NONE;
gPlayerAvatar.bikeFrameCounter = 0; gPlayerAvatar.bikeFrameCounter = 0;
gPlayerAvatar.bikeSpeed = SPEED_STANDING; gPlayerAvatar.bikeSpeed = BIKE_SPEED_STANDING;
gPlayerAvatar.directionHistory = newDirHistory; gPlayerAvatar.directionHistory = newDirHistory;
gPlayerAvatar.abStartSelectHistory = newAbStartHistory; gPlayerAvatar.abStartSelectHistory = newAbStartHistory;
@ -1014,7 +1014,7 @@ void Bike_UpdateBikeCounterSpeed(u8 counter)
static void Bike_SetBikeStill(void) static void Bike_SetBikeStill(void)
{ {
gPlayerAvatar.bikeFrameCounter = 0; gPlayerAvatar.bikeFrameCounter = 0;
gPlayerAvatar.bikeSpeed = SPEED_STANDING; gPlayerAvatar.bikeSpeed = BIKE_SPEED_STANDING;
} }
s16 GetPlayerSpeed(void) s16 GetPlayerSpeed(void)
@ -1027,11 +1027,11 @@ s16 GetPlayerSpeed(void)
if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_MACH_BIKE) if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_MACH_BIKE)
return machSpeeds[gPlayerAvatar.bikeFrameCounter]; return machSpeeds[gPlayerAvatar.bikeFrameCounter];
else if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_ACRO_BIKE) else if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_ACRO_BIKE)
return SPEED_FASTER; return BIKE_SPEED_FASTER;
else if (gPlayerAvatar.flags & (PLAYER_AVATAR_FLAG_SURFING | PLAYER_AVATAR_FLAG_DASH)) else if (gPlayerAvatar.flags & (PLAYER_AVATAR_FLAG_SURFING | PLAYER_AVATAR_FLAG_DASH))
return SPEED_FAST; return BIKE_SPEED_FAST;
else else
return SPEED_NORMAL; return BIKE_SPEED_NORMAL;
} }
void Bike_HandleBumpySlopeJump(void) void Bike_HandleBumpySlopeJump(void)

View File

@ -85,14 +85,14 @@ u8 MovementAction_RideWaterCurrentLeft_Step0(struct ObjectEvent *, struct Sprite
u8 MovementAction_RideWaterCurrentLeft_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_RideWaterCurrentLeft_Step1(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_RideWaterCurrentRight_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_RideWaterCurrentRight_Step0(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_RideWaterCurrentRight_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_RideWaterCurrentRight_Step1(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_WalkFastestDown_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_WalkFasterDown_Step0(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_WalkFastestDown_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_WalkFasterDown_Step1(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_WalkFastestUp_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_WalkFasterUp_Step0(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_WalkFastestUp_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_WalkFasterUp_Step1(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_WalkFastestLeft_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_WalkFasterLeft_Step0(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_WalkFastestLeft_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_WalkFasterLeft_Step1(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_WalkFastestRight_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_WalkFasterRight_Step0(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_WalkFastestRight_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_WalkFasterRight_Step1(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_SlideDown_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_SlideDown_Step0(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_SlideDown_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_SlideDown_Step1(struct ObjectEvent *, struct Sprite *);
u8 MovementAction_SlideUp_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_SlideUp_Step0(struct ObjectEvent *, struct Sprite *);
@ -307,10 +307,10 @@ u8 (*const gMovementActionFuncs_RideWaterCurrentDown[])(struct ObjectEvent *, st
u8 (*const gMovementActionFuncs_RideWaterCurrentUp[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_RideWaterCurrentUp[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_RideWaterCurrentLeft[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_RideWaterCurrentLeft[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_RideWaterCurrentRight[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_RideWaterCurrentRight[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_WalkFastestDown[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_WalkFasterDown[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_WalkFastestUp[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_WalkFasterUp[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_WalkFastestLeft[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_WalkFasterLeft[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_WalkFastestRight[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_WalkFasterRight[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_SlideDown[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_SlideDown[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_SlideUp[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_SlideUp[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_SlideLeft[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_SlideLeft[])(struct ObjectEvent *, struct Sprite *);
@ -467,10 +467,10 @@ u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *)
[MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP] = gMovementActionFuncs_RideWaterCurrentUp, [MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP] = gMovementActionFuncs_RideWaterCurrentUp,
[MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT] = gMovementActionFuncs_RideWaterCurrentLeft, [MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT] = gMovementActionFuncs_RideWaterCurrentLeft,
[MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT] = gMovementActionFuncs_RideWaterCurrentRight, [MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT] = gMovementActionFuncs_RideWaterCurrentRight,
[MOVEMENT_ACTION_WALK_FASTEST_DOWN] = gMovementActionFuncs_WalkFastestDown, [MOVEMENT_ACTION_WALK_FASTER_DOWN] = gMovementActionFuncs_WalkFasterDown,
[MOVEMENT_ACTION_WALK_FASTEST_UP] = gMovementActionFuncs_WalkFastestUp, [MOVEMENT_ACTION_WALK_FASTER_UP] = gMovementActionFuncs_WalkFasterUp,
[MOVEMENT_ACTION_WALK_FASTEST_LEFT] = gMovementActionFuncs_WalkFastestLeft, [MOVEMENT_ACTION_WALK_FASTER_LEFT] = gMovementActionFuncs_WalkFasterLeft,
[MOVEMENT_ACTION_WALK_FASTEST_RIGHT] = gMovementActionFuncs_WalkFastestRight, [MOVEMENT_ACTION_WALK_FASTER_RIGHT] = gMovementActionFuncs_WalkFasterRight,
[MOVEMENT_ACTION_SLIDE_DOWN] = gMovementActionFuncs_SlideDown, [MOVEMENT_ACTION_SLIDE_DOWN] = gMovementActionFuncs_SlideDown,
[MOVEMENT_ACTION_SLIDE_UP] = gMovementActionFuncs_SlideUp, [MOVEMENT_ACTION_SLIDE_UP] = gMovementActionFuncs_SlideUp,
[MOVEMENT_ACTION_SLIDE_LEFT] = gMovementActionFuncs_SlideLeft, [MOVEMENT_ACTION_SLIDE_LEFT] = gMovementActionFuncs_SlideLeft,
@ -603,11 +603,11 @@ u8 (*const gMovementActionFuncs_FaceRight[])(struct ObjectEvent *, struct Sprite
}; };
static u8 (*const sDirectionAnimFuncsBySpeed[])(u8) = { static u8 (*const sDirectionAnimFuncsBySpeed[])(u8) = {
GetMoveDirectionAnimNum, [MOVE_SPEED_NORMAL] = GetMoveDirectionAnimNum,
GetMoveDirectionFastAnimNum, [MOVE_SPEED_FAST_1] = GetMoveDirectionFastAnimNum,
GetMoveDirectionFastAnimNum, [MOVE_SPEED_FAST_2] = GetMoveDirectionFastAnimNum,
GetMoveDirectionFasterAnimNum, [MOVE_SPEED_FASTER] = GetMoveDirectionFasterAnimNum,
GetMoveDirectionFastestAnimNum, [MOVE_SPEED_FASTEST] = GetMoveDirectionFastestAnimNum,
}; };
u8 (*const gMovementActionFuncs_WalkSlowDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *) = { u8 (*const gMovementActionFuncs_WalkSlowDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *) = {
@ -907,27 +907,27 @@ u8 (*const gMovementActionFuncs_RideWaterCurrentRight[])(struct ObjectEvent *, s
MovementAction_PauseSpriteAnim, MovementAction_PauseSpriteAnim,
}; };
u8 (*const gMovementActionFuncs_WalkFastestDown[])(struct ObjectEvent *, struct Sprite *) = { u8 (*const gMovementActionFuncs_WalkFasterDown[])(struct ObjectEvent *, struct Sprite *) = {
MovementAction_WalkFastestDown_Step0, MovementAction_WalkFasterDown_Step0,
MovementAction_WalkFastestDown_Step1, MovementAction_WalkFasterDown_Step1,
MovementAction_PauseSpriteAnim, MovementAction_PauseSpriteAnim,
}; };
u8 (*const gMovementActionFuncs_WalkFastestUp[])(struct ObjectEvent *, struct Sprite *) = { u8 (*const gMovementActionFuncs_WalkFasterUp[])(struct ObjectEvent *, struct Sprite *) = {
MovementAction_WalkFastestUp_Step0, MovementAction_WalkFasterUp_Step0,
MovementAction_WalkFastestUp_Step1, MovementAction_WalkFasterUp_Step1,
MovementAction_PauseSpriteAnim, MovementAction_PauseSpriteAnim,
}; };
u8 (*const gMovementActionFuncs_WalkFastestLeft[])(struct ObjectEvent *, struct Sprite *) = { u8 (*const gMovementActionFuncs_WalkFasterLeft[])(struct ObjectEvent *, struct Sprite *) = {
MovementAction_WalkFastestLeft_Step0, MovementAction_WalkFasterLeft_Step0,
MovementAction_WalkFastestLeft_Step1, MovementAction_WalkFasterLeft_Step1,
MovementAction_PauseSpriteAnim, MovementAction_PauseSpriteAnim,
}; };
u8 (*const gMovementActionFuncs_WalkFastestRight[])(struct ObjectEvent *, struct Sprite *) = { u8 (*const gMovementActionFuncs_WalkFasterRight[])(struct ObjectEvent *, struct Sprite *) = {
MovementAction_WalkFastestRight_Step0, MovementAction_WalkFasterRight_Step0,
MovementAction_WalkFastestRight_Step1, MovementAction_WalkFasterRight_Step1,
MovementAction_PauseSpriteAnim, MovementAction_PauseSpriteAnim,
}; };

View File

@ -32,6 +32,14 @@
// this file was known as evobjmv.c in Game Freak's original source // this file was known as evobjmv.c in Game Freak's original source
enum {
MOVE_SPEED_NORMAL, // walking
MOVE_SPEED_FAST_1, // running / surfing / sliding (ice tile)
MOVE_SPEED_FAST_2, // water current / acro bike
MOVE_SPEED_FASTER, // mach bike's max speed
MOVE_SPEED_FASTEST,
};
// Sprite data used throughout // Sprite data used throughout
#define sObjEventId data[0] #define sObjEventId data[0]
#define sTypeFuncId data[1] // Index into corresponding gMovementTypeFuncs_* table #define sTypeFuncId data[1] // Index into corresponding gMovementTypeFuncs_* table
@ -941,12 +949,12 @@ const u8 gRideWaterCurrentMovementActions[] = {
MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT,
MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT,
}; };
const u8 gWalkFastestMovementActions[] = { const u8 gWalkFasterMovementActions[] = {
MOVEMENT_ACTION_WALK_FASTEST_DOWN, MOVEMENT_ACTION_WALK_FASTER_DOWN,
MOVEMENT_ACTION_WALK_FASTEST_DOWN, MOVEMENT_ACTION_WALK_FASTER_DOWN,
MOVEMENT_ACTION_WALK_FASTEST_UP, MOVEMENT_ACTION_WALK_FASTER_UP,
MOVEMENT_ACTION_WALK_FASTEST_LEFT, MOVEMENT_ACTION_WALK_FASTER_LEFT,
MOVEMENT_ACTION_WALK_FASTEST_RIGHT, MOVEMENT_ACTION_WALK_FASTER_RIGHT,
}; };
const u8 gSlideMovementActions[] = { const u8 gSlideMovementActions[] = {
MOVEMENT_ACTION_SLIDE_DOWN, MOVEMENT_ACTION_SLIDE_DOWN,
@ -4314,7 +4322,7 @@ bool8 CopyablePlayerMovement_GoSpeed2(struct ObjectEvent *objectEvent, struct Sp
direction = playerDirection; direction = playerDirection;
direction = state_to_direction(gInitialMovementTypeFacingDirections[objectEvent->movementType], objectEvent->directionSequenceIndex, direction); direction = state_to_direction(gInitialMovementTypeFacingDirections[objectEvent->movementType], objectEvent->directionSequenceIndex, direction);
ObjectEventMoveDestCoords(objectEvent, direction, &x, &y); ObjectEventMoveDestCoords(objectEvent, direction, &x, &y);
ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkFastestMovementAction(direction)); ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkFasterMovementAction(direction));
if (GetCollisionAtCoords(objectEvent, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) if (GetCollisionAtCoords(objectEvent, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y))))
{ {
ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction));
@ -5025,7 +5033,7 @@ dirn_to_anim(GetWalkSlowMovementAction, gWalkSlowMovementActions);
dirn_to_anim(GetWalkNormalMovementAction, gWalkNormalMovementActions); dirn_to_anim(GetWalkNormalMovementAction, gWalkNormalMovementActions);
dirn_to_anim(GetWalkFastMovementAction, gWalkFastMovementActions); dirn_to_anim(GetWalkFastMovementAction, gWalkFastMovementActions);
dirn_to_anim(GetRideWaterCurrentMovementAction, gRideWaterCurrentMovementActions); dirn_to_anim(GetRideWaterCurrentMovementAction, gRideWaterCurrentMovementActions);
dirn_to_anim(GetWalkFastestMovementAction, gWalkFastestMovementActions); dirn_to_anim(GetWalkFasterMovementAction, gWalkFasterMovementActions);
dirn_to_anim(GetSlideMovementAction, gSlideMovementActions); dirn_to_anim(GetSlideMovementAction, gSlideMovementActions);
dirn_to_anim(GetPlayerRunMovementAction, gPlayerRunMovementActions); dirn_to_anim(GetPlayerRunMovementAction, gPlayerRunMovementActions);
dirn_to_anim(GetJump2MovementAction, gJump2MovementActions); dirn_to_anim(GetJump2MovementAction, gJump2MovementActions);
@ -5356,7 +5364,7 @@ bool8 MovementAction_WalkSlowRight_Step1(struct ObjectEvent *objectEvent, struct
bool8 MovementAction_WalkNormalDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkNormalDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_NORTHWEST, 0); InitMovementNormal(objectEvent, sprite, DIR_NORTHWEST, MOVE_SPEED_NORMAL);
return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite); return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite);
} }
@ -5372,7 +5380,7 @@ bool8 MovementAction_WalkNormalDiagonalUpLeft_Step1(struct ObjectEvent *objectEv
bool8 MovementAction_WalkNormalDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkNormalDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_NORTHEAST, 0); InitMovementNormal(objectEvent, sprite, DIR_NORTHEAST, MOVE_SPEED_NORMAL);
return MovementAction_WalkNormalDiagonalUpRight_Step1(objectEvent, sprite); return MovementAction_WalkNormalDiagonalUpRight_Step1(objectEvent, sprite);
} }
@ -5388,7 +5396,7 @@ bool8 MovementAction_WalkNormalDiagonalUpRight_Step1(struct ObjectEvent *objectE
bool8 MovementAction_WalkNormalDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkNormalDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_SOUTHWEST, 0); InitMovementNormal(objectEvent, sprite, DIR_SOUTHWEST, MOVE_SPEED_NORMAL);
return MovementAction_WalkNormalDiagonalDownLeft_Step1(objectEvent, sprite); return MovementAction_WalkNormalDiagonalDownLeft_Step1(objectEvent, sprite);
} }
@ -5404,7 +5412,7 @@ bool8 MovementAction_WalkNormalDiagonalDownLeft_Step1(struct ObjectEvent *object
bool8 MovementAction_WalkNormalDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkNormalDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_SOUTHEAST, 0); InitMovementNormal(objectEvent, sprite, DIR_SOUTHEAST, MOVE_SPEED_NORMAL);
return MovementAction_WalkNormalDiagonalDownRight_Step1(objectEvent, sprite); return MovementAction_WalkNormalDiagonalDownRight_Step1(objectEvent, sprite);
} }
@ -5420,7 +5428,7 @@ bool8 MovementAction_WalkNormalDiagonalDownRight_Step1(struct ObjectEvent *objec
bool8 MovementAction_WalkNormalDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkNormalDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_SOUTH, 0); InitMovementNormal(objectEvent, sprite, DIR_SOUTH, MOVE_SPEED_NORMAL);
return MovementAction_WalkNormalDown_Step1(objectEvent, sprite); return MovementAction_WalkNormalDown_Step1(objectEvent, sprite);
} }
@ -5436,7 +5444,7 @@ bool8 MovementAction_WalkNormalDown_Step1(struct ObjectEvent *objectEvent, struc
bool8 MovementAction_WalkNormalUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkNormalUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_NORTH, 0); InitMovementNormal(objectEvent, sprite, DIR_NORTH, MOVE_SPEED_NORMAL);
return MovementAction_WalkNormalUp_Step1(objectEvent, sprite); return MovementAction_WalkNormalUp_Step1(objectEvent, sprite);
} }
@ -5452,7 +5460,7 @@ bool8 MovementAction_WalkNormalUp_Step1(struct ObjectEvent *objectEvent, struct
bool8 MovementAction_WalkNormalLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkNormalLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_WEST, 0); InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_NORMAL);
return MovementAction_WalkNormalLeft_Step1(objectEvent, sprite); return MovementAction_WalkNormalLeft_Step1(objectEvent, sprite);
} }
@ -5468,7 +5476,7 @@ bool8 MovementAction_WalkNormalLeft_Step1(struct ObjectEvent *objectEvent, struc
bool8 MovementAction_WalkNormalRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkNormalRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_EAST, 0); InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_NORMAL);
return MovementAction_WalkNormalRight_Step1(objectEvent, sprite); return MovementAction_WalkNormalRight_Step1(objectEvent, sprite);
} }
@ -5701,7 +5709,7 @@ bool8 MovementAction_Delay16_Step0(struct ObjectEvent *objectEvent, struct Sprit
bool8 MovementAction_WalkFastDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFastDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_SOUTH, 1); InitMovementNormal(objectEvent, sprite, DIR_SOUTH, MOVE_SPEED_FAST_1);
return MovementAction_WalkFastDown_Step1(objectEvent, sprite); return MovementAction_WalkFastDown_Step1(objectEvent, sprite);
} }
@ -5717,7 +5725,7 @@ bool8 MovementAction_WalkFastDown_Step1(struct ObjectEvent *objectEvent, struct
bool8 MovementAction_WalkFastUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFastUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_NORTH, 1); InitMovementNormal(objectEvent, sprite, DIR_NORTH, MOVE_SPEED_FAST_1);
return MovementAction_WalkFastUp_Step1(objectEvent, sprite); return MovementAction_WalkFastUp_Step1(objectEvent, sprite);
} }
@ -5733,7 +5741,7 @@ bool8 MovementAction_WalkFastUp_Step1(struct ObjectEvent *objectEvent, struct Sp
bool8 MovementAction_WalkFastLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFastLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_WEST, 1); InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FAST_1);
return MovementAction_WalkFastLeft_Step1(objectEvent, sprite); return MovementAction_WalkFastLeft_Step1(objectEvent, sprite);
} }
@ -5749,7 +5757,7 @@ bool8 MovementAction_WalkFastLeft_Step1(struct ObjectEvent *objectEvent, struct
bool8 MovementAction_WalkFastRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFastRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_EAST, 1); InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FAST_1);
return MovementAction_WalkFastRight_Step1(objectEvent, sprite); return MovementAction_WalkFastRight_Step1(objectEvent, sprite);
} }
@ -5891,7 +5899,7 @@ bool8 MovementAction_WalkInPlaceFastestRight_Step0(struct ObjectEvent *objectEve
bool8 MovementAction_RideWaterCurrentDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_RideWaterCurrentDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_SOUTH, 2); InitMovementNormal(objectEvent, sprite, DIR_SOUTH, MOVE_SPEED_FAST_2);
return MovementAction_RideWaterCurrentDown_Step1(objectEvent, sprite); return MovementAction_RideWaterCurrentDown_Step1(objectEvent, sprite);
} }
@ -5907,7 +5915,7 @@ bool8 MovementAction_RideWaterCurrentDown_Step1(struct ObjectEvent *objectEvent,
bool8 MovementAction_RideWaterCurrentUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_RideWaterCurrentUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_NORTH, 2); InitMovementNormal(objectEvent, sprite, DIR_NORTH, MOVE_SPEED_FAST_2);
return MovementAction_RideWaterCurrentUp_Step1(objectEvent, sprite); return MovementAction_RideWaterCurrentUp_Step1(objectEvent, sprite);
} }
@ -5923,7 +5931,7 @@ bool8 MovementAction_RideWaterCurrentUp_Step1(struct ObjectEvent *objectEvent, s
bool8 MovementAction_RideWaterCurrentLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_RideWaterCurrentLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_WEST, 2); InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FAST_2);
return MovementAction_RideWaterCurrentLeft_Step1(objectEvent, sprite); return MovementAction_RideWaterCurrentLeft_Step1(objectEvent, sprite);
} }
@ -5939,7 +5947,7 @@ bool8 MovementAction_RideWaterCurrentLeft_Step1(struct ObjectEvent *objectEvent,
bool8 MovementAction_RideWaterCurrentRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_RideWaterCurrentRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_EAST, 2); InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FAST_2);
return MovementAction_RideWaterCurrentRight_Step1(objectEvent, sprite); return MovementAction_RideWaterCurrentRight_Step1(objectEvent, sprite);
} }
@ -5953,13 +5961,13 @@ bool8 MovementAction_RideWaterCurrentRight_Step1(struct ObjectEvent *objectEvent
return FALSE; return FALSE;
} }
bool8 MovementAction_WalkFastestDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFasterDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_SOUTH, 3); InitMovementNormal(objectEvent, sprite, DIR_SOUTH, MOVE_SPEED_FASTER);
return MovementAction_WalkFastestDown_Step1(objectEvent, sprite); return MovementAction_WalkFasterDown_Step1(objectEvent, sprite);
} }
bool8 MovementAction_WalkFastestDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFasterDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
if (UpdateMovementNormal(objectEvent, sprite)) if (UpdateMovementNormal(objectEvent, sprite))
{ {
@ -5969,13 +5977,13 @@ bool8 MovementAction_WalkFastestDown_Step1(struct ObjectEvent *objectEvent, stru
return FALSE; return FALSE;
} }
bool8 MovementAction_WalkFastestUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFasterUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_NORTH, 3); InitMovementNormal(objectEvent, sprite, DIR_NORTH, MOVE_SPEED_FASTER);
return MovementAction_WalkFastestUp_Step1(objectEvent, sprite); return MovementAction_WalkFasterUp_Step1(objectEvent, sprite);
} }
bool8 MovementAction_WalkFastestUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFasterUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
if (UpdateMovementNormal(objectEvent, sprite)) if (UpdateMovementNormal(objectEvent, sprite))
{ {
@ -5985,13 +5993,13 @@ bool8 MovementAction_WalkFastestUp_Step1(struct ObjectEvent *objectEvent, struct
return FALSE; return FALSE;
} }
bool8 MovementAction_WalkFastestLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFasterLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_WEST, 3); InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FASTER);
return MovementAction_WalkFastestLeft_Step1(objectEvent, sprite); return MovementAction_WalkFasterLeft_Step1(objectEvent, sprite);
} }
bool8 MovementAction_WalkFastestLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFasterLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
if (UpdateMovementNormal(objectEvent, sprite)) if (UpdateMovementNormal(objectEvent, sprite))
{ {
@ -6001,13 +6009,13 @@ bool8 MovementAction_WalkFastestLeft_Step1(struct ObjectEvent *objectEvent, stru
return FALSE; return FALSE;
} }
bool8 MovementAction_WalkFastestRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFasterRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_EAST, 3); InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FASTER);
return MovementAction_WalkFastestRight_Step1(objectEvent, sprite); return MovementAction_WalkFasterRight_Step1(objectEvent, sprite);
} }
bool8 MovementAction_WalkFastestRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkFasterRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
if (UpdateMovementNormal(objectEvent, sprite)) if (UpdateMovementNormal(objectEvent, sprite))
{ {
@ -6019,7 +6027,7 @@ bool8 MovementAction_WalkFastestRight_Step1(struct ObjectEvent *objectEvent, str
bool8 MovementAction_SlideDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_SlideDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_SOUTH, 4); InitMovementNormal(objectEvent, sprite, DIR_SOUTH, MOVE_SPEED_FASTEST);
return MovementAction_SlideDown_Step1(objectEvent, sprite); return MovementAction_SlideDown_Step1(objectEvent, sprite);
} }
@ -6035,7 +6043,7 @@ bool8 MovementAction_SlideDown_Step1(struct ObjectEvent *objectEvent, struct Spr
bool8 MovementAction_SlideUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_SlideUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_NORTH, 4); InitMovementNormal(objectEvent, sprite, DIR_NORTH, MOVE_SPEED_FASTEST);
return MovementAction_SlideUp_Step1(objectEvent, sprite); return MovementAction_SlideUp_Step1(objectEvent, sprite);
} }
@ -6051,7 +6059,7 @@ bool8 MovementAction_SlideUp_Step1(struct ObjectEvent *objectEvent, struct Sprit
bool8 MovementAction_SlideLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_SlideLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_WEST, 4); InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FASTEST);
return MovementAction_SlideLeft_Step1(objectEvent, sprite); return MovementAction_SlideLeft_Step1(objectEvent, sprite);
} }
@ -6067,7 +6075,7 @@ bool8 MovementAction_SlideLeft_Step1(struct ObjectEvent *objectEvent, struct Spr
bool8 MovementAction_SlideRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_SlideRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_EAST, 4); InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FASTEST);
return MovementAction_SlideRight_Step1(objectEvent, sprite); return MovementAction_SlideRight_Step1(objectEvent, sprite);
} }
@ -6728,7 +6736,7 @@ bool8 MovementAction_WalkDownAffine_Step1(struct ObjectEvent *objectEvent, struc
bool8 MovementAction_WalkLeftAffine_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkLeftAffine_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_WEST, 1); InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FAST_1);
sprite->affineAnimPaused = FALSE; sprite->affineAnimPaused = FALSE;
ChangeSpriteAffineAnimIfDifferent(sprite, 2); ChangeSpriteAffineAnimIfDifferent(sprite, 2);
return MovementAction_WalkLeftAffine_Step1(objectEvent, sprite); return MovementAction_WalkLeftAffine_Step1(objectEvent, sprite);
@ -6747,7 +6755,7 @@ bool8 MovementAction_WalkLeftAffine_Step1(struct ObjectEvent *objectEvent, struc
bool8 MovementAction_WalkRightAffine_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkRightAffine_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
InitMovementNormal(objectEvent, sprite, DIR_EAST, 1); InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FAST_1);
sprite->affineAnimPaused = FALSE; sprite->affineAnimPaused = FALSE;
ChangeSpriteAffineAnimIfDifferent(sprite, 3); ChangeSpriteAffineAnimIfDifferent(sprite, 3);
return MovementAction_WalkRightAffine_Step1(objectEvent, sprite); return MovementAction_WalkRightAffine_Step1(objectEvent, sprite);

View File

@ -470,27 +470,27 @@ static u8 DoForcedMovementInCurrentDirection(void (*a)(u8))
static bool8 ForcedMovement_Slip(void) static bool8 ForcedMovement_Slip(void)
{ {
return DoForcedMovementInCurrentDirection(PlayerGoSpeed2); return DoForcedMovementInCurrentDirection(PlayerWalkFast);
} }
static bool8 ForcedMovement_WalkSouth(void) static bool8 ForcedMovement_WalkSouth(void)
{ {
return DoForcedMovement(DIR_SOUTH, PlayerGoSpeed1); return DoForcedMovement(DIR_SOUTH, PlayerWalkNormal);
} }
static bool8 ForcedMovement_WalkNorth(void) static bool8 ForcedMovement_WalkNorth(void)
{ {
return DoForcedMovement(DIR_NORTH, PlayerGoSpeed1); return DoForcedMovement(DIR_NORTH, PlayerWalkNormal);
} }
static bool8 ForcedMovement_WalkWest(void) static bool8 ForcedMovement_WalkWest(void)
{ {
return DoForcedMovement(DIR_WEST, PlayerGoSpeed1); return DoForcedMovement(DIR_WEST, PlayerWalkNormal);
} }
static bool8 ForcedMovement_WalkEast(void) static bool8 ForcedMovement_WalkEast(void)
{ {
return DoForcedMovement(DIR_EAST, PlayerGoSpeed1); return DoForcedMovement(DIR_EAST, PlayerWalkNormal);
} }
static bool8 ForcedMovement_PushedSouthByCurrent(void) static bool8 ForcedMovement_PushedSouthByCurrent(void)
@ -524,22 +524,22 @@ static u8 ForcedMovement_Slide(u8 direction, void (*b)(u8))
static bool8 ForcedMovement_SlideSouth(void) static bool8 ForcedMovement_SlideSouth(void)
{ {
return ForcedMovement_Slide(DIR_SOUTH, PlayerGoSpeed2); return ForcedMovement_Slide(DIR_SOUTH, PlayerWalkFast);
} }
static bool8 ForcedMovement_SlideNorth(void) static bool8 ForcedMovement_SlideNorth(void)
{ {
return ForcedMovement_Slide(DIR_NORTH, PlayerGoSpeed2); return ForcedMovement_Slide(DIR_NORTH, PlayerWalkFast);
} }
static bool8 ForcedMovement_SlideWest(void) static bool8 ForcedMovement_SlideWest(void)
{ {
return ForcedMovement_Slide(DIR_WEST, PlayerGoSpeed2); return ForcedMovement_Slide(DIR_WEST, PlayerWalkFast);
} }
static bool8 ForcedMovement_SlideEast(void) static bool8 ForcedMovement_SlideEast(void)
{ {
return ForcedMovement_Slide(DIR_EAST, PlayerGoSpeed2); return ForcedMovement_Slide(DIR_EAST, PlayerWalkFast);
} }
static bool8 ForcedMovement_MatJump(void) static bool8 ForcedMovement_MatJump(void)
@ -562,7 +562,7 @@ static bool8 ForcedMovement_MuddySlope(void)
{ {
Bike_UpdateBikeCounterSpeed(0); Bike_UpdateBikeCounterSpeed(0);
playerObjEvent->facingDirectionLocked = TRUE; playerObjEvent->facingDirectionLocked = TRUE;
return DoForcedMovement(DIR_SOUTH, PlayerGoSpeed2); return DoForcedMovement(DIR_SOUTH, PlayerWalkFast);
} }
else else
{ {
@ -631,8 +631,8 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys)
if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING)
{ {
// speed 2 is fast, same speed as running // same speed as running
PlayerGoSpeed2(direction); PlayerWalkFast(direction);
return; return;
} }
@ -645,7 +645,7 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys)
} }
else else
{ {
PlayerGoSpeed1(direction); PlayerWalkNormal(direction);
} }
} }
@ -953,16 +953,14 @@ void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement)
} }
} }
// normal speed (1 speed) void PlayerWalkNormal(u8 direction)
void PlayerGoSpeed1(u8 a)
{ {
PlayerSetAnimId(GetWalkNormalMovementAction(a), 2); PlayerSetAnimId(GetWalkNormalMovementAction(direction), 2);
} }
// fast speed (2 speed) void PlayerWalkFast(u8 direction)
void PlayerGoSpeed2(u8 a)
{ {
PlayerSetAnimId(GetWalkFastMovementAction(a), 2); PlayerSetAnimId(GetWalkFastMovementAction(direction), 2);
} }
void PlayerRideWaterCurrent(u8 a) void PlayerRideWaterCurrent(u8 a)
@ -970,10 +968,9 @@ void PlayerRideWaterCurrent(u8 a)
PlayerSetAnimId(GetRideWaterCurrentMovementAction(a), 2); PlayerSetAnimId(GetRideWaterCurrentMovementAction(a), 2);
} }
// fastest speed (4 speed) void PlayerWalkFaster(u8 direction)
void PlayerGoSpeed4(u8 a)
{ {
PlayerSetAnimId(GetWalkFastestMovementAction(a), 2); PlayerSetAnimId(GetWalkFasterMovementAction(direction), 2);
} }
static void PlayerRun(u8 a) static void PlayerRun(u8 a)