Rename EventObj to ObjEvent
This commit is contained in:
+58
-58
@@ -186,31 +186,31 @@ static void MachBikeTransition_FaceDirection(u8 direction)
|
||||
|
||||
static void MachBikeTransition_TurnDirection(u8 direction)
|
||||
{
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior))
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior))
|
||||
{
|
||||
PlayerTurnInPlace(direction);
|
||||
Bike_SetBikeStill();
|
||||
}
|
||||
else
|
||||
{
|
||||
MachBikeTransition_FaceDirection(playerEventObj->facingDirection);
|
||||
MachBikeTransition_FaceDirection(playerObjEvent->facingDirection);
|
||||
}
|
||||
}
|
||||
|
||||
static void MachBikeTransition_TrySpeedUp(u8 direction)
|
||||
{
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
u8 collision;
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == FALSE)
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == FALSE)
|
||||
{
|
||||
// we cannot go forward, so either slow down or, if we are stopped, idle face direction.
|
||||
if (gPlayerAvatar.bikeSpeed)
|
||||
MachBikeTransition_TrySlowDown(playerEventObj->movementDirection);
|
||||
MachBikeTransition_TrySlowDown(playerObjEvent->movementDirection);
|
||||
else
|
||||
MachBikeTransition_FaceDirection(playerEventObj->movementDirection);
|
||||
MachBikeTransition_FaceDirection(playerObjEvent->movementDirection);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -366,10 +366,10 @@ static u8 AcroBikeHandleInputTurning(u8 *newDirection, u16 newKeys, u16 heldKeys
|
||||
static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
u8 direction;
|
||||
struct ObjectEvent *playerEventObj;
|
||||
struct ObjectEvent *playerObjEvent;
|
||||
|
||||
direction = GetPlayerMovementDirection();
|
||||
playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
gPlayerAvatar.runningState = NOT_MOVING;
|
||||
|
||||
if (heldKeys & B_BUTTON)
|
||||
@@ -378,7 +378,7 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16
|
||||
{
|
||||
// B button was released.
|
||||
gPlayerAvatar.bikeFrameCounter = 0;
|
||||
if (!MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior))
|
||||
if (!MetatileBehavior_IsBumpySlope(playerObjEvent->currentMetatileBehavior))
|
||||
{
|
||||
// Go back to normal on flat ground
|
||||
*newDirection = direction;
|
||||
@@ -413,15 +413,15 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16
|
||||
static u8 AcroBikeHandleInputBunnyHop(u8 *newDirection, u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
u8 direction;
|
||||
struct ObjectEvent *playerEventObj;
|
||||
struct ObjectEvent *playerObjEvent;
|
||||
|
||||
direction = GetPlayerMovementDirection();
|
||||
playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
if (!(heldKeys & B_BUTTON))
|
||||
{
|
||||
// B button was released
|
||||
Bike_SetBikeStill();
|
||||
if (MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior))
|
||||
if (MetatileBehavior_IsBumpySlope(playerObjEvent->currentMetatileBehavior))
|
||||
{
|
||||
// even though B was released, dont undo the wheelie on the bumpy slope.
|
||||
gPlayerAvatar.acroBikeState = ACRO_STATE_WHEELIE_STANDING;
|
||||
@@ -460,15 +460,15 @@ static u8 AcroBikeHandleInputBunnyHop(u8 *newDirection, u16 newKeys, u16 heldKey
|
||||
static u8 AcroBikeHandleInputWheelieMoving(u8 *newDirection, u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
u8 direction;
|
||||
struct ObjectEvent *playerEventObj;
|
||||
struct ObjectEvent *playerObjEvent;
|
||||
|
||||
direction = GetPlayerFacingDirection();
|
||||
playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
if (!(heldKeys & B_BUTTON))
|
||||
{
|
||||
// we were moving on a wheelie, but we let go while moving. reset bike still status
|
||||
Bike_SetBikeStill();
|
||||
if (!MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior))
|
||||
if (!MetatileBehavior_IsBumpySlope(playerObjEvent->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;
|
||||
@@ -514,10 +514,10 @@ static u8 AcroBikeHandleInputWheelieMoving(u8 *newDirection, u16 newKeys, u16 he
|
||||
|
||||
static u8 AcroBikeHandleInputSidewaysJump(u8 *ptr, u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
playerEventObj->facingDirectionLocked = 0;
|
||||
SetObjectEventDirection(playerEventObj, playerEventObj->facingDirection);
|
||||
playerObjEvent->facingDirectionLocked = 0;
|
||||
SetObjectEventDirection(playerObjEvent, playerObjEvent->facingDirection);
|
||||
gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;
|
||||
return CheckMovementInputAcroBike(ptr, newKeys, heldKeys);
|
||||
}
|
||||
@@ -535,21 +535,21 @@ static void AcroBikeTransition_FaceDirection(u8 direction)
|
||||
|
||||
static void AcroBikeTransition_TurnDirection(u8 direction)
|
||||
{
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == 0)
|
||||
direction = playerEventObj->movementDirection;
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == 0)
|
||||
direction = playerObjEvent->movementDirection;
|
||||
PlayerFaceDirection(direction);
|
||||
}
|
||||
|
||||
static void AcroBikeTransition_Moving(u8 direction)
|
||||
{
|
||||
u8 collision;
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == 0)
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == 0)
|
||||
{
|
||||
AcroBikeTransition_FaceDirection(playerEventObj->movementDirection);
|
||||
AcroBikeTransition_FaceDirection(playerObjEvent->movementDirection);
|
||||
return;
|
||||
}
|
||||
collision = GetBikeCollision(direction);
|
||||
@@ -570,48 +570,48 @@ static void AcroBikeTransition_Moving(u8 direction)
|
||||
|
||||
static void AcroBikeTransition_NormalToWheelie(u8 direction)
|
||||
{
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == 0)
|
||||
direction = playerEventObj->movementDirection;
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == 0)
|
||||
direction = playerObjEvent->movementDirection;
|
||||
PlayerStartWheelie(direction);
|
||||
}
|
||||
|
||||
static void AcroBikeTransition_WheelieToNormal(u8 direction)
|
||||
{
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == 0)
|
||||
direction = playerEventObj->movementDirection;
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == 0)
|
||||
direction = playerObjEvent->movementDirection;
|
||||
PlayerEndWheelie(direction);
|
||||
}
|
||||
|
||||
static void AcroBikeTransition_WheelieIdle(u8 direction)
|
||||
{
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == 0)
|
||||
direction = playerEventObj->movementDirection;
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == 0)
|
||||
direction = playerObjEvent->movementDirection;
|
||||
PlayerIdleWheelie(direction);
|
||||
}
|
||||
|
||||
static void AcroBikeTransition_WheelieHoppingStanding(u8 direction)
|
||||
{
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == 0)
|
||||
direction = playerEventObj->movementDirection;
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == 0)
|
||||
direction = playerObjEvent->movementDirection;
|
||||
PlayerStandingHoppingWheelie(direction);
|
||||
}
|
||||
|
||||
static void AcroBikeTransition_WheelieHoppingMoving(u8 direction)
|
||||
{
|
||||
u8 collision;
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == 0)
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == 0)
|
||||
{
|
||||
AcroBikeTransition_WheelieHoppingStanding(playerEventObj->movementDirection);
|
||||
AcroBikeTransition_WheelieHoppingStanding(playerObjEvent->movementDirection);
|
||||
return;
|
||||
}
|
||||
collision = GetBikeCollision(direction);
|
||||
@@ -641,7 +641,7 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction)
|
||||
static void AcroBikeTransition_SideJump(u8 direction)
|
||||
{
|
||||
u8 collision;
|
||||
struct ObjectEvent *playerEventObj;
|
||||
struct ObjectEvent *playerObjEvent;
|
||||
|
||||
collision = GetBikeCollision(direction);
|
||||
if (collision)
|
||||
@@ -659,9 +659,9 @@ static void AcroBikeTransition_SideJump(u8 direction)
|
||||
return;
|
||||
}
|
||||
}
|
||||
playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
PlaySE(SE_JITE_PYOKO);
|
||||
playerEventObj->facingDirectionLocked = 1;
|
||||
playerObjEvent->facingDirectionLocked = 1;
|
||||
PlayerSetAnimId(GetJumpMovementAction(direction), 2);
|
||||
}
|
||||
|
||||
@@ -673,11 +673,11 @@ static void AcroBikeTransition_TurnJump(u8 direction)
|
||||
static void AcroBikeTransition_WheelieMoving(u8 direction)
|
||||
{
|
||||
u8 collision;
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == 0)
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == 0)
|
||||
{
|
||||
PlayerIdleWheelie(playerEventObj->movementDirection);
|
||||
PlayerIdleWheelie(playerObjEvent->movementDirection);
|
||||
return;
|
||||
}
|
||||
collision = GetBikeCollision(direction);
|
||||
@@ -693,7 +693,7 @@ static void AcroBikeTransition_WheelieMoving(u8 direction)
|
||||
}
|
||||
else if (collision < COLLISION_STOP_SURFING)
|
||||
{
|
||||
if (MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior))
|
||||
if (MetatileBehavior_IsBumpySlope(playerObjEvent->currentMetatileBehavior))
|
||||
PlayerIdleWheelie(direction);
|
||||
else
|
||||
sub_808B980(direction); //hit wall?
|
||||
@@ -707,11 +707,11 @@ static void AcroBikeTransition_WheelieMoving(u8 direction)
|
||||
static void AcroBikeTransition_WheelieRisingMoving(u8 direction)
|
||||
{
|
||||
u8 collision;
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == 0)
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == 0)
|
||||
{
|
||||
PlayerStartWheelie(playerEventObj->movementDirection);
|
||||
PlayerStartWheelie(playerObjEvent->movementDirection);
|
||||
return;
|
||||
}
|
||||
collision = GetBikeCollision(direction);
|
||||
@@ -727,7 +727,7 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction)
|
||||
}
|
||||
else if (collision < COLLISION_STOP_SURFING)
|
||||
{
|
||||
if (MetatileBehavior_IsBumpySlope(playerEventObj->currentMetatileBehavior))
|
||||
if (MetatileBehavior_IsBumpySlope(playerObjEvent->currentMetatileBehavior))
|
||||
PlayerIdleWheelie(direction);
|
||||
else
|
||||
sub_808B980(direction); //hit wall?
|
||||
@@ -741,11 +741,11 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction)
|
||||
static void AcroBikeTransition_WheelieLoweringMoving(u8 direction)
|
||||
{
|
||||
u8 collision;
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerEventObj->currentMetatileBehavior) == 0)
|
||||
if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior) == 0)
|
||||
{
|
||||
PlayerEndWheelie(playerEventObj->movementDirection);
|
||||
PlayerEndWheelie(playerObjEvent->movementDirection);
|
||||
return;
|
||||
}
|
||||
collision = GetBikeCollision(direction);
|
||||
@@ -868,12 +868,12 @@ static u8 Bike_DPadToDirection(u16 heldKeys)
|
||||
static u8 GetBikeCollision(u8 direction)
|
||||
{
|
||||
u8 metatitleBehavior;
|
||||
struct ObjectEvent *playerEventObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
s16 x = playerEventObj->currentCoords.x;
|
||||
s16 y = playerEventObj->currentCoords.y;
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
s16 x = playerObjEvent->currentCoords.x;
|
||||
s16 y = playerObjEvent->currentCoords.y;
|
||||
MoveCoords(direction, &x, &y);
|
||||
metatitleBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
||||
return GetBikeCollisionAt(playerEventObj, x, y, direction, metatitleBehavior);
|
||||
return GetBikeCollisionAt(playerObjEvent, x, y, direction, metatitleBehavior);
|
||||
}
|
||||
|
||||
static u8 GetBikeCollisionAt(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatitleBehavior)
|
||||
|
||||
Reference in New Issue
Block a user