Rename GoSpeedX functions to WalkNormal, WalkFast, etc.

This commit is contained in:
cbt6 2021-11-03 01:20:41 +08:00
parent 4cedd2d551
commit 3f5f057ebe
3 changed files with 26 additions and 29 deletions

View File

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

View File

@ -71,12 +71,12 @@ static void (*const sMachBikeTransitions[])(u8) =
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 faster speed
// bikeFrameCounter is input which is represented by sMachBikeSpeeds in order
static void (*const sMachBikeSpeedCallbacks[])(u8) =
{
PlayerGoSpeed1, // normal speed (1 speed)
PlayerGoSpeed2, // fast speed (2 speed)
PlayerGoSpeed4, // faster speed
PlayerWalkNormal,
PlayerWalkFast,
PlayerWalkFaster,
};
static void (*const sAcroBikeTransitions[])(u8) =

View File

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