summaryrefslogtreecommitdiff
path: root/src/bike.c
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2018-06-11 09:19:17 -0500
committerMarcus Huderle <huderlem@gmail.com>2018-06-11 09:19:17 -0500
commit4018acfae12ab5d39aaff9acdeaa5d713d1def0e (patch)
treec918365a54ec69c75b3349dfafd81b3a08baa80a /src/bike.c
parent38a126df66092487803d2759c1698fa86a5be01d (diff)
Update event object struct members
Diffstat (limited to 'src/bike.c')
-rw-r--r--src/bike.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/bike.c b/src/bike.c
index d413989f0..92f4b8a60 100644
--- a/src/bike.c
+++ b/src/bike.c
@@ -198,14 +198,14 @@ static void MachBikeTransition_TurnDirection(u8 direction)
{
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E))
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior))
{
PlayerTurnInPlace(direction);
Bike_SetBikeStill();
}
else
{
- MachBikeTransition_FaceDirection(playerMapObj->mapobj_unk_18);
+ MachBikeTransition_FaceDirection(playerMapObj->facingDirection);
}
}
@@ -214,13 +214,13 @@ static void MachBikeTransition_TrySpeedUp(u8 direction)
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
u8 collision;
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == FALSE)
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == FALSE)
{
// we cannot go forward, so either slow down or, if we are stopped, idle face direction.
if (gPlayerAvatar.bikeSpeed)
- MachBikeTransition_TrySlowDown(playerMapObj->placeholder18);
+ MachBikeTransition_TrySlowDown(playerMapObj->movementDirection);
else
- MachBikeTransition_FaceDirection(playerMapObj->placeholder18);
+ MachBikeTransition_FaceDirection(playerMapObj->movementDirection);
}
else
{
@@ -388,7 +388,7 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16
{
// B button was released.
gPlayerAvatar.bikeFrameCounter = 0;
- if (!MetatileBehavior_IsBumpySlope(playerMapObj->mapobj_unk_1E))
+ if (!MetatileBehavior_IsBumpySlope(playerMapObj->currentMetatileBehavior))
{
// Go back to normal on flat ground
*newDirection = direction;
@@ -431,7 +431,7 @@ static u8 AcroBikeHandleInputBunnyHop(u8 *newDirection, u16 newKeys, u16 heldKey
{
// B button was released
Bike_SetBikeStill();
- if (MetatileBehavior_IsBumpySlope(playerMapObj->mapobj_unk_1E))
+ if (MetatileBehavior_IsBumpySlope(playerMapObj->currentMetatileBehavior))
{
// even though B was released, dont undo the wheelie on the bumpy slope.
gPlayerAvatar.acroBikeState = ACRO_STATE_WHEELIE_STANDING;
@@ -478,7 +478,7 @@ static u8 AcroBikeHandleInputWheelieMoving(u8 *newDirection, u16 newKeys, u16 he
{
// we were moving on a wheelie, but we let go while moving. reset bike still status
Bike_SetBikeStill();
- if (!MetatileBehavior_IsBumpySlope(playerMapObj->mapobj_unk_1E))
+ if (!MetatileBehavior_IsBumpySlope(playerMapObj->currentMetatileBehavior))
{
// we let go of B and arent on a bumpy slope, set state to normal because now we need to handle this
gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;
@@ -526,8 +526,8 @@ static u8 AcroBikeHandleInputSidewaysJump(u8 *ptr, u16 newKeys, u16 heldKeys)
{
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- playerMapObj->mapobj_bit_9 = 0;
- FieldObjectSetDirection(playerMapObj, playerMapObj->mapobj_unk_18);
+ playerMapObj->facingDirectionLocked = 0;
+ FieldObjectSetDirection(playerMapObj, playerMapObj->facingDirection);
gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;
return CheckMovementInputAcroBike(ptr, newKeys, heldKeys);
}
@@ -547,8 +547,8 @@ static void AcroBikeTransition_TurnDirection(u8 direction)
{
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
- direction = playerMapObj->placeholder18;
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
+ direction = playerMapObj->movementDirection;
PlayerFaceDirection(direction);
}
@@ -557,9 +557,9 @@ static void AcroBikeTransition_Moving(u8 direction)
u8 collision;
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
{
- AcroBikeTransition_FaceDirection(playerMapObj->placeholder18);
+ AcroBikeTransition_FaceDirection(playerMapObj->movementDirection);
return;
}
collision = get_some_collision(direction);
@@ -582,8 +582,8 @@ static void AcroBikeTransition_NormalToWheelie(u8 direction)
{
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
- direction = playerMapObj->placeholder18;
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
+ direction = playerMapObj->movementDirection;
PlayerStartWheelie(direction);
}
@@ -591,8 +591,8 @@ static void AcroBikeTransition_WheelieToNormal(u8 direction)
{
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
- direction = playerMapObj->placeholder18;
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
+ direction = playerMapObj->movementDirection;
PlayerEndWheelie(direction);
}
@@ -600,8 +600,8 @@ static void AcroBikeTransition_WheelieIdle(u8 direction)
{
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
- direction = playerMapObj->placeholder18;
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
+ direction = playerMapObj->movementDirection;
PlayerIdleWheelie(direction);
}
@@ -609,8 +609,8 @@ static void AcroBikeTransition_WheelieHoppingStanding(u8 direction)
{
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
- direction = playerMapObj->placeholder18;
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
+ direction = playerMapObj->movementDirection;
PlayerStandingHoppingWheelie(direction);
}
@@ -619,9 +619,9 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction)
u8 collision;
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
{
- AcroBikeTransition_WheelieHoppingStanding(playerMapObj->placeholder18);
+ AcroBikeTransition_WheelieHoppingStanding(playerMapObj->movementDirection);
return;
}
collision = get_some_collision(direction);
@@ -671,7 +671,7 @@ static void AcroBikeTransition_SideJump(u8 direction)
}
playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
PlaySE(SE_JITE_PYOKO);
- playerMapObj->mapobj_bit_9 = 1;
+ playerMapObj->facingDirectionLocked = 1;
PlayerSetAnimId(sub_8093514(direction), 2);
}
@@ -685,9 +685,9 @@ static void AcroBikeTransition_WheelieMoving(u8 direction)
u8 collision;
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
{
- PlayerIdleWheelie(playerMapObj->placeholder18);
+ PlayerIdleWheelie(playerMapObj->movementDirection);
return;
}
collision = get_some_collision(direction);
@@ -703,7 +703,7 @@ static void AcroBikeTransition_WheelieMoving(u8 direction)
}
else if (collision <= 4)
{
- if (MetatileBehavior_IsBumpySlope(playerMapObj->mapobj_unk_1E))
+ if (MetatileBehavior_IsBumpySlope(playerMapObj->currentMetatileBehavior))
PlayerIdleWheelie(direction);
else
sub_808B980(direction); //hit wall?
@@ -719,9 +719,9 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction)
u8 collision;
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
{
- PlayerStartWheelie(playerMapObj->placeholder18);
+ PlayerStartWheelie(playerMapObj->movementDirection);
return;
}
collision = get_some_collision(direction);
@@ -737,7 +737,7 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction)
}
else if (collision <= 4)
{
- if (MetatileBehavior_IsBumpySlope(playerMapObj->mapobj_unk_1E))
+ if (MetatileBehavior_IsBumpySlope(playerMapObj->currentMetatileBehavior))
PlayerIdleWheelie(direction);
else
sub_808B980(direction); //hit wall?
@@ -753,9 +753,9 @@ static void AcroBikeTransition_WheelieLoweringMoving(u8 direction)
u8 collision;
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
+ if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
{
- PlayerEndWheelie(playerMapObj->placeholder18);
+ PlayerEndWheelie(playerMapObj->movementDirection);
return;
}
collision = get_some_collision(direction);
@@ -882,8 +882,8 @@ static u8 get_some_collision(u8 direction)
u8 metatitleBehavior;
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
- x = playerMapObj->coords2.x;
- y = playerMapObj->coords2.y;
+ x = playerMapObj->currentCoords.x;
+ y = playerMapObj->currentCoords.y;
MoveCoords(direction, &x, &y);
metatitleBehavior = MapGridGetMetatileBehaviorAt(x, y);
return Bike_CheckCollisionTryAdvanceCollisionCount(playerMapObj, x, y, direction, metatitleBehavior);
@@ -979,7 +979,7 @@ bool8 IsBikingDisallowedByPlayer(void)
bool8 player_should_look_direction_be_enforced_upon_movement(void)
{
- if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE) != FALSE && MetatileBehavior_IsBumpySlope(gMapObjects[gPlayerAvatar.mapObjectId].mapobj_unk_1E) != FALSE)
+ if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE) != FALSE && MetatileBehavior_IsBumpySlope(gMapObjects[gPlayerAvatar.mapObjectId].currentMetatileBehavior) != FALSE)
return FALSE;
else
return TRUE;