Add Sideways Stairs (#4836)
This commit is contained in:
commit
5a8a393dcd
@ -4,6 +4,7 @@
|
||||
// Movement config
|
||||
#define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors.
|
||||
#define OW_AUTO_SIGNPOST FALSE // When enabled, if the tile that the player is facing has MB_SIGNPOST, MB_POKEMART_SIGN, or MB_POKEMON_CENTER_SIGN, the player will automatically read the signpost, as seen in FRLG.
|
||||
#define SLOW_MOVEMENT_ON_STAIRS FALSE // If enabled, the player will move slower up/down stairs like in FR
|
||||
|
||||
// Other settings
|
||||
#define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all.
|
||||
|
||||
@ -247,6 +247,10 @@
|
||||
#define MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK 0x9F
|
||||
#define MOVEMENT_ACTION_EXIT_POKEBALL 0xA0
|
||||
#define MOVEMENT_ACTION_ENTER_POKEBALL 0xA1
|
||||
#define MOVEMENT_ACTION_RUN_DOWN_SLOW 0xA2 // slow running for rocky stairs
|
||||
#define MOVEMENT_ACTION_RUN_UP_SLOW 0xA3
|
||||
#define MOVEMENT_ACTION_RUN_LEFT_SLOW 0xA4
|
||||
#define MOVEMENT_ACTION_RUN_RIGHT_SLOW 0xA5
|
||||
|
||||
#define MOVEMENT_ACTION_STEP_END 0xFE
|
||||
#define MOVEMENT_ACTION_NONE 0xFF
|
||||
|
||||
@ -74,13 +74,13 @@
|
||||
#define MB_SLIDE_NORTH 0x46
|
||||
#define MB_SLIDE_SOUTH 0x47
|
||||
#define MB_TRICK_HOUSE_PUZZLE_8_FLOOR 0x48
|
||||
#define MB_UNUSED_49 0x49
|
||||
#define MB_UNUSED_4A 0x4A
|
||||
#define MB_UNUSED_4B 0x4B
|
||||
#define MB_UNUSED_4C 0x4C
|
||||
#define MB_UNUSED_4D 0x4D
|
||||
#define MB_UNUSED_4E 0x4E
|
||||
#define MB_UNUSED_4F 0x4F
|
||||
#define MB_SIDEWAYS_STAIRS_RIGHT_SIDE 0x49
|
||||
#define MB_SIDEWAYS_STAIRS_LEFT_SIDE 0x4A
|
||||
#define MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP 0x4B
|
||||
#define MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP 0x4C
|
||||
#define MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM 0x4D
|
||||
#define MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM 0x4E
|
||||
#define MB_ROCK_STAIRS 0x4F
|
||||
#define MB_EASTWARD_CURRENT 0x50
|
||||
#define MB_WESTWARD_CURRENT 0x51
|
||||
#define MB_NORTHWARD_CURRENT 0x52
|
||||
|
||||
@ -483,6 +483,15 @@ void SetVirtualObjectInvisibility(u8 virtualObjId, bool32 invisible);
|
||||
bool32 IsVirtualObjectInvisible(u8 virtualObjId);
|
||||
void SetVirtualObjectSpriteAnim(u8 virtualObjId, u8 animNum);
|
||||
bool32 IsVirtualObjectAnimating(u8 virtualObjId);
|
||||
u8 GetObjectEventIdByLocalId(u8 localId);
|
||||
bool32 IsFollowerVisible(void);
|
||||
|
||||
// run slow
|
||||
u8 GetPlayerRunSlowMovementAction(u32);
|
||||
//sideways stairs
|
||||
u8 GetSidewaysStairsToRightDirection(s16, s16, u8);
|
||||
u8 GetSidewaysStairsToLeftDirection(s16, s16, u8);
|
||||
u8 GetSidewaysStairsCollision(struct ObjectEvent *objectEvent, u8 dir, u8 currentBehavior, u8 nextBehavior, u8 collision);
|
||||
|
||||
bool8 MovementAction_EmoteX_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
bool8 MovementAction_EmoteDoubleExclamationMark_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
|
||||
@ -64,5 +64,9 @@ bool32 IsPlayerSpinExitActive(void);
|
||||
void SetPlayerInvisibility(bool8 invisible);
|
||||
u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y);
|
||||
void StartFishing(u8 rod);
|
||||
bool8 ObjectMovingOnRockStairs(struct ObjectEvent *objectEvent, u8 direction);
|
||||
//sideways stairs
|
||||
u8 GetRightSideStairsDirection(u8 direction);
|
||||
u8 GetLeftSideStairsDirection(u8 direction);
|
||||
|
||||
#endif // GUARD_FIELD_PLAYER_AVATAR_H
|
||||
|
||||
@ -217,7 +217,8 @@ struct ObjectEvent
|
||||
/*0x1D*/ u8 trainerRange_berryTreeId;
|
||||
/*0x1E*/ u8 currentMetatileBehavior;
|
||||
/*0x1F*/ u8 previousMetatileBehavior;
|
||||
/*0x20*/ u8 previousMovementDirection;
|
||||
/*0x20*/ u8 previousMovementDirection:4;
|
||||
u8 directionOverwrite:4;
|
||||
/*0x21*/ u8 directionSequenceIndex;
|
||||
/*0x22*/ u8 playerCopyableMovement; // COPY_MOVE_*
|
||||
/*0x23*/ u8 spriteId;
|
||||
@ -298,6 +299,8 @@ enum
|
||||
COLLISION_VERTICAL_RAIL,
|
||||
COLLISION_HORIZONTAL_RAIL,
|
||||
COLLISION_STAIR_WARP,
|
||||
COLLISION_SIDEWAYS_STAIRS_TO_RIGHT,
|
||||
COLLISION_SIDEWAYS_STAIRS_TO_LEFT
|
||||
};
|
||||
|
||||
// player running states
|
||||
|
||||
@ -156,5 +156,14 @@ bool8 MetatileBehavior_IsDirectionalStairWarp(u8 metatileBehavior);
|
||||
bool8 MetatileBehavior_IsSignpost(u32);
|
||||
bool8 MetatileBehavior_IsPokemonCenterSign(u32);
|
||||
bool8 MetatileBehavior_IsPokeMartSign(u32);
|
||||
bool8 MetatileBehavior_IsRockStairs(u8);
|
||||
bool8 MetatileBehavior_IsSidewaysStairsRightSide(u8);
|
||||
bool8 MetatileBehavior_IsSidewaysStairsLeftSide(u8);
|
||||
bool8 MetatileBehavior_IsSidewaysStairsRightSideTop(u8 metatileBehavior);
|
||||
bool8 MetatileBehavior_IsSidewaysStairsLeftSideTop(u8 metatileBehavior);
|
||||
bool8 MetatileBehavior_IsSidewaysStairsRightSideBottom(u8 metatileBehavior);
|
||||
bool8 MetatileBehavior_IsSidewaysStairsLeftSideBottom(u8 metatileBehavior);
|
||||
bool8 MetatileBehavior_IsSidewaysStairsRightSideAny(u8 metatileBehavior);
|
||||
bool8 MetatileBehavior_IsSidewaysStairsLeftSideAny(u8 metatileBehavior);
|
||||
|
||||
#endif // GUARD_METATILE_BEHAVIOR_H
|
||||
|
||||
25
src/bike.c
25
src/bike.c
@ -142,6 +142,19 @@ static u8 GetMachBikeTransition(u8 *dirTraveling)
|
||||
{
|
||||
// if the dir updated before this function, get the relevent new direction to check later.
|
||||
u8 direction = GetPlayerMovementDirection();
|
||||
|
||||
// fix direction when moving on sideways stairs
|
||||
switch (direction)
|
||||
{
|
||||
case DIR_SOUTHWEST:
|
||||
case DIR_NORTHWEST:
|
||||
direction = DIR_WEST;
|
||||
break;
|
||||
case DIR_SOUTHEAST:
|
||||
case DIR_NORTHEAST:
|
||||
direction = DIR_EAST;
|
||||
break;
|
||||
}
|
||||
|
||||
// is the player standing still?
|
||||
if (*dirTraveling == 0)
|
||||
@ -234,6 +247,9 @@ static void MachBikeTransition_TrySpeedUp(u8 direction)
|
||||
else
|
||||
{
|
||||
// we did not hit anything that can slow us down, so perform the advancement callback depending on the bikeFrameCounter and try to increase the mach bike's speed.
|
||||
if (ObjectMovingOnRockStairs(playerObjEvent, direction) && gPlayerAvatar.bikeFrameCounter > 1)
|
||||
gPlayerAvatar.bikeFrameCounter--;
|
||||
|
||||
sMachBikeSpeedCallbacks[gPlayerAvatar.bikeFrameCounter](direction);
|
||||
gPlayerAvatar.bikeSpeed = gPlayerAvatar.bikeFrameCounter + (gPlayerAvatar.bikeFrameCounter >> 1); // same as dividing by 2, but compiler is insistent on >> 1
|
||||
if (gPlayerAvatar.bikeFrameCounter < 2) // do not go faster than the last element in the mach bike array
|
||||
@ -368,6 +384,7 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16
|
||||
struct ObjectEvent *playerObjEvent;
|
||||
|
||||
direction = GetPlayerMovementDirection();
|
||||
|
||||
playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
gPlayerAvatar.runningState = NOT_MOVING;
|
||||
|
||||
@ -563,7 +580,10 @@ static void AcroBikeTransition_Moving(u8 direction)
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerRideWaterCurrent(direction);
|
||||
if (ObjectMovingOnRockStairs(playerObjEvent, direction))
|
||||
PlayerWalkFast(direction);
|
||||
else
|
||||
PlayerRideWaterCurrent(direction);
|
||||
}
|
||||
}
|
||||
|
||||
@ -696,6 +716,7 @@ static void AcroBikeTransition_WheelieMoving(u8 direction)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerWheelieMove(direction);
|
||||
gPlayerAvatar.runningState = MOVING;
|
||||
}
|
||||
@ -730,6 +751,7 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerPopWheelieWhileMoving(direction);
|
||||
gPlayerAvatar.runningState = MOVING;
|
||||
}
|
||||
@ -753,6 +775,7 @@ static void AcroBikeTransition_WheelieLoweringMoving(u8 direction)
|
||||
PlayerEndWheelie(direction);
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerEndWheelieWhileMoving(direction);
|
||||
}
|
||||
|
||||
|
||||
@ -266,6 +266,11 @@ u8 MovementAction_FlyUp_Step1(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_Fly_Finish(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_FlyDown_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_FlyDown_Step1(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementActionFunc_RunSlowDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
u8 MovementActionFunc_RunSlowUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
u8 MovementActionFunc_RunSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
u8 MovementActionFunc_RunSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
u8 MovementActionFunc_RunSlow_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
|
||||
u8 (*const gMovementActionFuncs_FaceDown[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_FaceUp[])(struct ObjectEvent *, struct Sprite *);
|
||||
@ -429,6 +434,10 @@ u8 (*const gMovementActionFuncs_FlyUp[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_FlyDown[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_EmoteX[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_EmoteDoubleExclMark[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_RunDownSlow[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_RunUpSlow[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_RunLeftSlow[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_RunRightSlow[])(struct ObjectEvent *, struct Sprite *);
|
||||
|
||||
u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
[MOVEMENT_ACTION_FACE_DOWN] = gMovementActionFuncs_FaceDown,
|
||||
@ -593,6 +602,10 @@ u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *)
|
||||
[MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK] = gMovementActionFuncs_EmoteDoubleExclMark,
|
||||
[MOVEMENT_ACTION_EXIT_POKEBALL] = gMovementActionFuncs_ExitPokeball,
|
||||
[MOVEMENT_ACTION_ENTER_POKEBALL] = gMovementActionFuncs_EnterPokeball,
|
||||
[MOVEMENT_ACTION_RUN_DOWN_SLOW] = gMovementActionFuncs_RunDownSlow,
|
||||
[MOVEMENT_ACTION_RUN_UP_SLOW] = gMovementActionFuncs_RunUpSlow,
|
||||
[MOVEMENT_ACTION_RUN_LEFT_SLOW] = gMovementActionFuncs_RunLeftSlow,
|
||||
[MOVEMENT_ACTION_RUN_RIGHT_SLOW] = gMovementActionFuncs_RunRightSlow,
|
||||
};
|
||||
|
||||
u8 (*const gMovementActionFuncs_FaceDown[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
@ -1554,3 +1567,27 @@ u8 (*const gMovementActionFuncs_EmoteDoubleExclMark[])(struct ObjectEvent *, str
|
||||
MovementAction_EmoteDoubleExclamationMark_Step0,
|
||||
MovementAction_Finish,
|
||||
};
|
||||
|
||||
u8 (*const gMovementActionFuncs_RunDownSlow[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
MovementActionFunc_RunSlowDown_Step0,
|
||||
MovementActionFunc_RunSlow_Step1,
|
||||
MovementAction_PauseSpriteAnim,
|
||||
};
|
||||
|
||||
u8 (*const gMovementActionFuncs_RunUpSlow[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
MovementActionFunc_RunSlowUp_Step0,
|
||||
MovementActionFunc_RunSlow_Step1,
|
||||
MovementAction_PauseSpriteAnim,
|
||||
};
|
||||
|
||||
u8 (*const gMovementActionFuncs_RunLeftSlow[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
MovementActionFunc_RunSlowLeft_Step0,
|
||||
MovementActionFunc_RunSlow_Step1,
|
||||
MovementAction_PauseSpriteAnim,
|
||||
};
|
||||
|
||||
u8 (*const gMovementActionFuncs_RunRightSlow[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
MovementActionFunc_RunSlowRight_Step0,
|
||||
MovementActionFunc_RunSlow_Step1,
|
||||
MovementAction_PauseSpriteAnim,
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -332,8 +332,39 @@ static const u8 *GetInteractedObjectEventScript(struct MapPosition *position, u8
|
||||
{
|
||||
u8 objectEventId;
|
||||
const u8 *script;
|
||||
|
||||
objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation);
|
||||
s16 currX = gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x;
|
||||
s16 currY = gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y;
|
||||
u8 currBehavior = MapGridGetMetatileBehaviorAt(currX, currY);
|
||||
|
||||
switch (direction)
|
||||
{
|
||||
case DIR_EAST:
|
||||
if (MetatileBehavior_IsSidewaysStairsLeftSideAny(metatileBehavior))
|
||||
// sideways stairs left-side to your right -> check northeast
|
||||
objectEventId = GetObjectEventIdByPosition(currX + 1, currY - 1, position->elevation);
|
||||
else if (MetatileBehavior_IsSidewaysStairsRightSideAny(currBehavior))
|
||||
// on top of right-side stairs -> check southeast
|
||||
objectEventId = GetObjectEventIdByPosition(currX + 1, currY + 1, position->elevation);
|
||||
else
|
||||
// check in front of player
|
||||
objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation);
|
||||
break;
|
||||
case DIR_WEST:
|
||||
if (MetatileBehavior_IsSidewaysStairsRightSideAny(metatileBehavior))
|
||||
// facing sideways stairs right side -> check northwest
|
||||
objectEventId = GetObjectEventIdByPosition(currX - 1, currY - 1, position->elevation);
|
||||
else if (MetatileBehavior_IsSidewaysStairsLeftSideAny(currBehavior))
|
||||
// on top of left-side stairs -> check southwest
|
||||
objectEventId = GetObjectEventIdByPosition(currX - 1, currY + 1, position->elevation);
|
||||
else
|
||||
// check in front of player
|
||||
objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation);
|
||||
break;
|
||||
default:
|
||||
objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation);
|
||||
break;
|
||||
}
|
||||
|
||||
if (objectEventId == OBJECT_EVENTS_COUNT || gObjectEvents[objectEventId].localId == OBJ_EVENT_ID_PLAYER)
|
||||
{
|
||||
if (MetatileBehavior_IsCounter(metatileBehavior) != TRUE)
|
||||
|
||||
@ -93,6 +93,8 @@ static bool8 PlayerAnimIsMultiFrameStationaryAndStateNotTurning(void);
|
||||
static bool8 PlayerIsAnimActive(void);
|
||||
static bool8 PlayerCheckIfAnimFinishedOrInactive(void);
|
||||
|
||||
static void PlayerWalkSlow(u8 direction);
|
||||
static void PlayerRunSlow(u8 direction);
|
||||
static void PlayerRun(u8);
|
||||
static void PlayerNotOnBikeCollide(u8);
|
||||
static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8);
|
||||
@ -457,7 +459,22 @@ static bool8 ForcedMovement_None(void)
|
||||
static bool8 DoForcedMovement(u8 direction, void (*moveFunc)(u8))
|
||||
{
|
||||
struct PlayerAvatar *playerAvatar = &gPlayerAvatar;
|
||||
u8 collision = CheckForPlayerAvatarCollision(direction);
|
||||
u8 collision;
|
||||
|
||||
// Check for sideways stairs onto ice movement.
|
||||
switch (direction)
|
||||
{
|
||||
case DIR_NORTHWEST:
|
||||
case DIR_SOUTHWEST:
|
||||
direction = DIR_WEST;
|
||||
break;
|
||||
case DIR_NORTHEAST:
|
||||
case DIR_SOUTHEAST:
|
||||
direction = DIR_EAST;
|
||||
break;
|
||||
}
|
||||
|
||||
collision = CheckForPlayerAvatarCollision(direction);
|
||||
|
||||
playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE;
|
||||
if (collision)
|
||||
@ -658,13 +675,20 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys)
|
||||
if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_UNDERWATER) && (heldKeys & B_BUTTON) && FlagGet(FLAG_SYS_B_DASH)
|
||||
&& IsRunningDisallowed(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior) == 0)
|
||||
{
|
||||
PlayerRun(direction);
|
||||
if (ObjectMovingOnRockStairs(&gObjectEvents[gPlayerAvatar.objectEventId], direction))
|
||||
PlayerRunSlow(direction);
|
||||
else
|
||||
PlayerRun(direction);
|
||||
|
||||
gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_DASH;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerWalkNormal(direction);
|
||||
if (ObjectMovingOnRockStairs(&gObjectEvents[gPlayerAvatar.objectEventId], direction))
|
||||
PlayerWalkSlow(direction);
|
||||
else
|
||||
PlayerWalkNormal(direction);
|
||||
}
|
||||
}
|
||||
|
||||
@ -696,6 +720,7 @@ static u8 CheckForPlayerAvatarStaticCollision(u8 direction)
|
||||
u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior)
|
||||
{
|
||||
u8 collision = GetCollisionAtCoords(objectEvent, x, y, direction);
|
||||
|
||||
if (collision == COLLISION_ELEVATION_MISMATCH && CanStopSurfing(x, y, direction))
|
||||
return COLLISION_STOP_SURFING;
|
||||
|
||||
@ -713,6 +738,7 @@ u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u
|
||||
return COLLISION_ROTATING_GATE;
|
||||
CheckAcroBikeCollision(x, y, metatileBehavior, &collision);
|
||||
}
|
||||
|
||||
return collision;
|
||||
}
|
||||
|
||||
@ -975,6 +1001,17 @@ void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement)
|
||||
}
|
||||
}
|
||||
|
||||
// slow
|
||||
static void PlayerWalkSlow(u8 direction)
|
||||
{
|
||||
PlayerSetAnimId(GetWalkSlowMovementAction(direction), 2);
|
||||
}
|
||||
static void PlayerRunSlow(u8 direction)
|
||||
{
|
||||
PlayerSetAnimId(GetPlayerRunSlowMovementAction(direction), 2);
|
||||
}
|
||||
|
||||
// normal speed (1 speed)
|
||||
void PlayerWalkNormal(u8 direction)
|
||||
{
|
||||
PlayerSetAnimId(GetWalkNormalMovementAction(direction), COPY_MOVE_WALK);
|
||||
@ -1636,7 +1673,7 @@ static void CreateStopSurfingTask(u8 direction)
|
||||
LockPlayerFieldControls();
|
||||
Overworld_ClearSavedMusic();
|
||||
Overworld_ChangeMusicToDefault();
|
||||
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_SURFING;
|
||||
gPlayerAvatar.flags ^= PLAYER_AVATAR_FLAG_SURFING;
|
||||
gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_ON_FOOT;
|
||||
gPlayerAvatar.preventStep = TRUE;
|
||||
taskId = CreateTask(Task_StopSurfingInit, 0xFF);
|
||||
@ -2430,3 +2467,69 @@ static u8 TrySpinPlayerForWarp(struct ObjectEvent *object, s16 *delayTimer)
|
||||
*delayTimer = 0;
|
||||
return sSpinDirections[object->facingDirection];
|
||||
}
|
||||
|
||||
//sideways stairs
|
||||
u8 GetRightSideStairsDirection(u8 direction)
|
||||
{
|
||||
switch (direction)
|
||||
{
|
||||
case DIR_WEST:
|
||||
return DIR_NORTHWEST;
|
||||
case DIR_EAST:
|
||||
return DIR_SOUTHEAST;
|
||||
default:
|
||||
if (direction > DIR_EAST)
|
||||
direction -= DIR_EAST;
|
||||
return direction;
|
||||
}
|
||||
}
|
||||
|
||||
u8 GetLeftSideStairsDirection(u8 direction)
|
||||
{
|
||||
switch (direction)
|
||||
{
|
||||
case DIR_WEST:
|
||||
return DIR_SOUTHWEST;
|
||||
case DIR_EAST:
|
||||
return DIR_NORTHEAST;
|
||||
default:
|
||||
if (direction > DIR_EAST)
|
||||
direction -= DIR_EAST;
|
||||
return direction;
|
||||
}
|
||||
}
|
||||
|
||||
bool8 ObjectMovingOnRockStairs(struct ObjectEvent *objectEvent, u8 direction)
|
||||
{
|
||||
#if SLOW_MOVEMENT_ON_STAIRS == TRUE
|
||||
s16 x = objectEvent->currentCoords.x;
|
||||
s16 y = objectEvent->currentCoords.y;
|
||||
|
||||
// TODO followers on sideways stairs
|
||||
if (IsFollowerVisible() && GetFollowerObject() != NULL && (objectEvent->isPlayer || objectEvent->localId == OBJ_EVENT_ID_FOLLOWER))
|
||||
return FALSE;
|
||||
|
||||
switch (direction)
|
||||
{
|
||||
case DIR_NORTH:
|
||||
return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x,y));
|
||||
case DIR_SOUTH:
|
||||
MoveCoords(DIR_SOUTH, &x, &y);
|
||||
return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x,y));
|
||||
case DIR_WEST:
|
||||
case DIR_EAST:
|
||||
case DIR_NORTHEAST:
|
||||
case DIR_NORTHWEST:
|
||||
case DIR_SOUTHWEST:
|
||||
case DIR_SOUTHEAST:
|
||||
// directionOverwrite is only used for sideways stairs motion
|
||||
if (objectEvent->directionOverwrite)
|
||||
return TRUE;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -8,126 +8,131 @@
|
||||
|
||||
static const u8 sTileBitAttributes[NUM_METATILE_BEHAVIORS] =
|
||||
{
|
||||
[MB_NORMAL] = TILE_FLAG_UNUSED,
|
||||
[MB_TALL_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_LONG_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_UNUSED_05] = TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_DEEP_SAND] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_SHORT_GRASS] = TILE_FLAG_UNUSED,
|
||||
[MB_CAVE] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_LONG_GRASS_SOUTH_EDGE] = TILE_FLAG_UNUSED,
|
||||
[MB_NO_RUNNING] = TILE_FLAG_UNUSED,
|
||||
[MB_INDOOR_ENCOUNTER] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_MOUNTAIN_TOP] = TILE_FLAG_UNUSED,
|
||||
[MB_BATTLE_PYRAMID_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_MOSSDEEP_GYM_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_MT_PYRE_HOLE] = TILE_FLAG_UNUSED,
|
||||
[MB_POND_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_INTERIOR_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_WATERFALL] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_SOOTOPOLIS_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_OCEAN_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_PUDDLE] = TILE_FLAG_UNUSED,
|
||||
[MB_SHALLOW_WATER] = TILE_FLAG_UNUSED,
|
||||
[MB_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_STAIRS_OUTSIDE_ABANDONED_SHIP] = TILE_FLAG_UNUSED,
|
||||
[MB_SHOAL_CAVE_ENTRANCE] = TILE_FLAG_UNUSED,
|
||||
[MB_ICE] = TILE_FLAG_UNUSED,
|
||||
[MB_SAND] = TILE_FLAG_UNUSED,
|
||||
[MB_SEAWEED] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_UNUSED_23] = TILE_FLAG_UNUSED,
|
||||
[MB_ASHGRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_FOOTPRINTS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_THIN_ICE] = TILE_FLAG_UNUSED,
|
||||
[MB_CRACKED_ICE] = TILE_FLAG_UNUSED,
|
||||
[MB_HOT_SPRINGS] = TILE_FLAG_UNUSED,
|
||||
[MB_LAVARIDGE_GYM_B1F_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_SEAWEED_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_REFLECTION_UNDER_BRIDGE] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_EAST] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_WEST] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_NORTH] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_SOUTH] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_NORTHEAST] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_NORTHWEST] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_SOUTHEAST] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_SOUTHWEST] = TILE_FLAG_UNUSED,
|
||||
[MB_JUMP_NORTHEAST] = TILE_FLAG_UNUSED,
|
||||
[MB_JUMP_NORTHWEST] = TILE_FLAG_UNUSED,
|
||||
[MB_JUMP_SOUTHEAST] = TILE_FLAG_UNUSED,
|
||||
[MB_JUMP_SOUTHWEST] = TILE_FLAG_UNUSED,
|
||||
[MB_WALK_EAST] = TILE_FLAG_UNUSED,
|
||||
[MB_WALK_WEST] = TILE_FLAG_UNUSED,
|
||||
[MB_WALK_NORTH] = TILE_FLAG_UNUSED,
|
||||
[MB_WALK_SOUTH] = TILE_FLAG_UNUSED,
|
||||
[MB_SLIDE_EAST] = TILE_FLAG_UNUSED,
|
||||
[MB_SLIDE_WEST] = TILE_FLAG_UNUSED,
|
||||
[MB_SLIDE_NORTH] = TILE_FLAG_UNUSED,
|
||||
[MB_SLIDE_SOUTH] = TILE_FLAG_UNUSED,
|
||||
[MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_FLAG_UNUSED,
|
||||
[MB_UNUSED_49] = TILE_FLAG_UNUSED,
|
||||
[MB_UNUSED_4A] = TILE_FLAG_UNUSED,
|
||||
[MB_EASTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_WESTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_NORTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_SOUTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_NON_ANIMATED_DOOR] = TILE_FLAG_UNUSED,
|
||||
[MB_LADDER] = TILE_FLAG_UNUSED,
|
||||
[MB_EAST_ARROW_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_WEST_ARROW_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_NORTH_ARROW_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_CRACKED_FLOOR_HOLE] = TILE_FLAG_UNUSED,
|
||||
[MB_AQUA_HIDEOUT_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_LAVARIDGE_GYM_1F_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_ANIMATED_DOOR] = TILE_FLAG_UNUSED,
|
||||
[MB_UP_ESCALATOR] = TILE_FLAG_UNUSED,
|
||||
[MB_DOWN_ESCALATOR] = TILE_FLAG_UNUSED,
|
||||
[MB_WATER_DOOR] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_WATER_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_DEEP_SOUTH_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_UNUSED_6F] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_BRIDGE_OVER_POND_LOW] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_MED] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_HIGH] = TILE_FLAG_UNUSED,
|
||||
[MB_PACIFIDLOG_VERTICAL_LOG_TOP] = TILE_FLAG_UNUSED,
|
||||
[MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM] = TILE_FLAG_UNUSED,
|
||||
[MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT] = TILE_FLAG_UNUSED,
|
||||
[MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT] = TILE_FLAG_UNUSED,
|
||||
[MB_FORTREE_BRIDGE] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_MED_EDGE_2] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_HIGH_EDGE_1] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_HIGH_EDGE_2] = TILE_FLAG_UNUSED,
|
||||
[MB_UNUSED_BRIDGE] = TILE_FLAG_UNUSED,
|
||||
[MB_BIKE_BRIDGE_OVER_BARRIER] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_SCENERY] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_TRAINER_SPOT] = TILE_FLAG_UNUSED,
|
||||
[MB_HOLDS_SMALL_DECORATION] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_BALLOON] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_IMPASSABLE] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_GLITTER_MAT] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_JUMP_MAT] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_SPIN_MAT] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_SOUND_MAT] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_BREAKABLE_DOOR] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_WEST_AND_EAST] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_HOLE] = TILE_FLAG_UNUSED,
|
||||
[MB_HOLDS_LARGE_DECORATION] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_TV_SHIELD] = TILE_FLAG_UNUSED,
|
||||
[MB_PLAYER_ROOM_PC_ON] = TILE_FLAG_UNUSED,
|
||||
[MB_MUDDY_SLOPE] = TILE_FLAG_UNUSED,
|
||||
[MB_BUMPY_SLOPE] = TILE_FLAG_UNUSED,
|
||||
[MB_CRACKED_FLOOR] = TILE_FLAG_UNUSED,
|
||||
[MB_ISOLATED_VERTICAL_RAIL] = TILE_FLAG_UNUSED,
|
||||
[MB_ISOLATED_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED,
|
||||
[MB_VERTICAL_RAIL] = TILE_FLAG_UNUSED,
|
||||
[MB_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED,
|
||||
[MB_SIGNPOST] = TILE_FLAG_UNUSED,
|
||||
[MB_POKEMON_CENTER_SIGN] = TILE_FLAG_UNUSED,
|
||||
[MB_POKEMART_SIGN] = TILE_FLAG_UNUSED,
|
||||
[MB_NORMAL] = TILE_FLAG_UNUSED,
|
||||
[MB_TALL_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_LONG_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_UNUSED_05] = TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_DEEP_SAND] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_SHORT_GRASS] = TILE_FLAG_UNUSED,
|
||||
[MB_CAVE] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_LONG_GRASS_SOUTH_EDGE] = TILE_FLAG_UNUSED,
|
||||
[MB_NO_RUNNING] = TILE_FLAG_UNUSED,
|
||||
[MB_INDOOR_ENCOUNTER] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_MOUNTAIN_TOP] = TILE_FLAG_UNUSED,
|
||||
[MB_BATTLE_PYRAMID_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_MOSSDEEP_GYM_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_MT_PYRE_HOLE] = TILE_FLAG_UNUSED,
|
||||
[MB_POND_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_INTERIOR_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_WATERFALL] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_SOOTOPOLIS_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_OCEAN_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_PUDDLE] = TILE_FLAG_UNUSED,
|
||||
[MB_SHALLOW_WATER] = TILE_FLAG_UNUSED,
|
||||
[MB_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_STAIRS_OUTSIDE_ABANDONED_SHIP] = TILE_FLAG_UNUSED,
|
||||
[MB_SHOAL_CAVE_ENTRANCE] = TILE_FLAG_UNUSED,
|
||||
[MB_ICE] = TILE_FLAG_UNUSED,
|
||||
[MB_SAND] = TILE_FLAG_UNUSED,
|
||||
[MB_SEAWEED] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_UNUSED_23] = TILE_FLAG_UNUSED,
|
||||
[MB_ASHGRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_FOOTPRINTS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_THIN_ICE] = TILE_FLAG_UNUSED,
|
||||
[MB_CRACKED_ICE] = TILE_FLAG_UNUSED,
|
||||
[MB_HOT_SPRINGS] = TILE_FLAG_UNUSED,
|
||||
[MB_LAVARIDGE_GYM_B1F_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_SEAWEED_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
|
||||
[MB_REFLECTION_UNDER_BRIDGE] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_EAST] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_WEST] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_NORTH] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_SOUTH] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_NORTHEAST] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_NORTHWEST] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_SOUTHEAST] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_SOUTHWEST] = TILE_FLAG_UNUSED,
|
||||
[MB_JUMP_NORTHEAST] = TILE_FLAG_UNUSED,
|
||||
[MB_JUMP_NORTHWEST] = TILE_FLAG_UNUSED,
|
||||
[MB_JUMP_SOUTHEAST] = TILE_FLAG_UNUSED,
|
||||
[MB_JUMP_SOUTHWEST] = TILE_FLAG_UNUSED,
|
||||
[MB_WALK_EAST] = TILE_FLAG_UNUSED,
|
||||
[MB_WALK_WEST] = TILE_FLAG_UNUSED,
|
||||
[MB_WALK_NORTH] = TILE_FLAG_UNUSED,
|
||||
[MB_WALK_SOUTH] = TILE_FLAG_UNUSED,
|
||||
[MB_SLIDE_EAST] = TILE_FLAG_UNUSED,
|
||||
[MB_SLIDE_WEST] = TILE_FLAG_UNUSED,
|
||||
[MB_SLIDE_NORTH] = TILE_FLAG_UNUSED,
|
||||
[MB_SLIDE_SOUTH] = TILE_FLAG_UNUSED,
|
||||
[MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_FLAG_UNUSED,
|
||||
[MB_EASTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_WESTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_NORTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_SOUTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_NON_ANIMATED_DOOR] = TILE_FLAG_UNUSED,
|
||||
[MB_LADDER] = TILE_FLAG_UNUSED,
|
||||
[MB_EAST_ARROW_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_WEST_ARROW_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_NORTH_ARROW_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_CRACKED_FLOOR_HOLE] = TILE_FLAG_UNUSED,
|
||||
[MB_AQUA_HIDEOUT_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_LAVARIDGE_GYM_1F_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_ANIMATED_DOOR] = TILE_FLAG_UNUSED,
|
||||
[MB_UP_ESCALATOR] = TILE_FLAG_UNUSED,
|
||||
[MB_DOWN_ESCALATOR] = TILE_FLAG_UNUSED,
|
||||
[MB_WATER_DOOR] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_WATER_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_DEEP_SOUTH_WARP] = TILE_FLAG_UNUSED,
|
||||
[MB_UNUSED_6F] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE,
|
||||
[MB_BRIDGE_OVER_POND_LOW] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_MED] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_HIGH] = TILE_FLAG_UNUSED,
|
||||
[MB_PACIFIDLOG_VERTICAL_LOG_TOP] = TILE_FLAG_UNUSED,
|
||||
[MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM] = TILE_FLAG_UNUSED,
|
||||
[MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT] = TILE_FLAG_UNUSED,
|
||||
[MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT] = TILE_FLAG_UNUSED,
|
||||
[MB_FORTREE_BRIDGE] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_MED_EDGE_2] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_HIGH_EDGE_1] = TILE_FLAG_UNUSED,
|
||||
[MB_BRIDGE_OVER_POND_HIGH_EDGE_2] = TILE_FLAG_UNUSED,
|
||||
[MB_UNUSED_BRIDGE] = TILE_FLAG_UNUSED,
|
||||
[MB_BIKE_BRIDGE_OVER_BARRIER] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_SCENERY] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_TRAINER_SPOT] = TILE_FLAG_UNUSED,
|
||||
[MB_HOLDS_SMALL_DECORATION] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_BALLOON] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_IMPASSABLE] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_GLITTER_MAT] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_JUMP_MAT] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_SPIN_MAT] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_SOUND_MAT] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_BREAKABLE_DOOR] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_FLAG_UNUSED,
|
||||
[MB_IMPASSABLE_WEST_AND_EAST] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_HOLE] = TILE_FLAG_UNUSED,
|
||||
[MB_HOLDS_LARGE_DECORATION] = TILE_FLAG_UNUSED,
|
||||
[MB_SECRET_BASE_TV_SHIELD] = TILE_FLAG_UNUSED,
|
||||
[MB_PLAYER_ROOM_PC_ON] = TILE_FLAG_UNUSED,
|
||||
[MB_MUDDY_SLOPE] = TILE_FLAG_UNUSED,
|
||||
[MB_BUMPY_SLOPE] = TILE_FLAG_UNUSED,
|
||||
[MB_CRACKED_FLOOR] = TILE_FLAG_UNUSED,
|
||||
[MB_ISOLATED_VERTICAL_RAIL] = TILE_FLAG_UNUSED,
|
||||
[MB_ISOLATED_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED,
|
||||
[MB_VERTICAL_RAIL] = TILE_FLAG_UNUSED,
|
||||
[MB_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED,
|
||||
[MB_SIGNPOST] = TILE_FLAG_UNUSED,
|
||||
[MB_POKEMON_CENTER_SIGN] = TILE_FLAG_UNUSED,
|
||||
[MB_POKEMART_SIGN] = TILE_FLAG_UNUSED,
|
||||
[MB_SIDEWAYS_STAIRS_RIGHT_SIDE] = TILE_FLAG_UNUSED,
|
||||
[MB_SIDEWAYS_STAIRS_LEFT_SIDE] = TILE_FLAG_UNUSED,
|
||||
[MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP] = TILE_FLAG_UNUSED,
|
||||
[MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP] = TILE_FLAG_UNUSED,
|
||||
[MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM] = TILE_FLAG_UNUSED,
|
||||
[MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM] = TILE_FLAG_UNUSED,
|
||||
[MB_ROCK_STAIRS] = TILE_FLAG_UNUSED,
|
||||
};
|
||||
|
||||
bool8 MetatileBehavior_IsATile(u8 metatileBehavior)
|
||||
@ -1461,3 +1466,79 @@ bool8 MetatileBehavior_IsPokeMartSign(u32 metatileBehavior)
|
||||
{
|
||||
return (metatileBehavior == MB_POKEMART_SIGN);
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSidewaysStairsRightSide(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE || metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSidewaysStairsLeftSide(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE || metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSidewaysStairsRightSideTop(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSidewaysStairsLeftSideTop(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSidewaysStairsRightSideBottom(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSidewaysStairsLeftSideBottom(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSidewaysStairsRightSideAny(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE
|
||||
|| metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM
|
||||
|| metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSidewaysStairsLeftSideAny(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE
|
||||
|| metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM
|
||||
|| metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsRockStairs(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_ROCK_STAIRS)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -1009,6 +1009,8 @@ bool8 ScrCmd_applymovement(struct ScriptContext *ctx)
|
||||
ClearObjectEventMovement(objEvent, &gSprites[objEvent->spriteId]);
|
||||
gSprites[objEvent->spriteId].animCmdIndex = 0; // Reset start frame of animation
|
||||
}
|
||||
|
||||
gObjectEvents[GetObjectEventIdByLocalId(localId)].directionOverwrite = DIR_NONE;
|
||||
ScriptMovement_StartObjectMovementScript(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, movementScript);
|
||||
sMovingNpcId = localId;
|
||||
objEvent = GetFollowerObject();
|
||||
@ -1033,6 +1035,7 @@ bool8 ScrCmd_applymovementat(struct ScriptContext *ctx)
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
|
||||
gObjectEvents[GetObjectEventIdByLocalId(localId)].directionOverwrite = DIR_NONE;
|
||||
ScriptMovement_StartObjectMovementScript(localId, mapNum, mapGroup, movementScript);
|
||||
sMovingNpcId = localId;
|
||||
return FALSE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user