forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 3
Reflections
ghoulslash edited this page Feb 24, 2022
·
1 revision
- Find
PlayerStep
insrc/field_player_avatar.c
- add this function above it:
static void TryHidePlayerReflection(void)
{
if (gObjectEvents[gPlayerAvatar.objectEventId].hasReflection) {
s16 x, y;
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
x = playerObjEvent->currentCoords.x;
y = playerObjEvent->currentCoords.y;
MoveCoords(DIR_SOUTH, &x, &y);
if (!MetatileBehavior_IsReflective(MapGridGetMetatileBehaviorAt(x, y)))
playerObjEvent->hideReflection = TRUE;
else
playerObjEvent->hideReflection = FALSE;
}
}
- Now change the function to this:
void PlayerStep(u8 direction, u16 newKeys, u16 heldKeys)
{
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
HideShowWarpArrow(playerObjEvent);
if (gPlayerAvatar.preventStep == FALSE)
{
TryHidePlayerReflection();
Bike_TryAcroBikeHistoryUpdate(newKeys, heldKeys);
if (TryInterruptObjectEventSpecialAnim(playerObjEvent, direction) == 0)
{
npc_clear_strange_bits(playerObjEvent);
DoPlayerAvatarTransition();
if (TryDoMetatileBehaviorForcedMovement() == 0)
{
MovePlayerAvatarUsingKeypadInput(direction, newKeys, heldKeys);
PlayerAllowForcedMovementIfMovingSameDirection();
}
TryHidePlayerReflection();
}
}
}
You're done!