Label movement action arrays, z coord -> elevation

This commit is contained in:
GriffinR
2022-10-05 17:16:40 -04:00
parent b41b3614ad
commit 57e82c9264
16 changed files with 260 additions and 268 deletions
+6 -6
View File
@@ -3032,7 +3032,7 @@ static void LoadCableClubPlayer(s32 linkPlayerId, s32 myPlayerId, struct CableCl
GetLinkPlayerCoords(linkPlayerId, &x, &y);
player->pos.x = x;
player->pos.y = y;
player->pos.height = GetLinkPlayerElevation(linkPlayerId);
player->pos.elevation = GetLinkPlayerElevation(linkPlayerId);
player->metatileBehavior = MapGridGetMetatileBehaviorAt(x, y);
}
@@ -3085,7 +3085,7 @@ static const u8 *TryInteractWithPlayer(struct CableClubPlayer *player)
otherPlayerPos = player->pos;
otherPlayerPos.x += gDirectionToVectors[player->facing].x;
otherPlayerPos.y += gDirectionToVectors[player->facing].y;
otherPlayerPos.height = 0;
otherPlayerPos.elevation = 0;
linkPlayerId = GetLinkPlayerIdAt(otherPlayerPos.x, otherPlayerPos.y);
if (linkPlayerId != 4)
@@ -3295,7 +3295,7 @@ static void InitLinkPlayerObjectEventPos(struct ObjectEvent *objEvent, s16 x, s1
objEvent->previousCoords.y = y;
SetSpritePosToMapCoords(x, y, &objEvent->initialCoords.x, &objEvent->initialCoords.y);
objEvent->initialCoords.x += 8;
ObjectEventUpdateZCoord(objEvent);
ObjectEventUpdateElevation(objEvent);
}
static void SetLinkPlayerObjectRange(u8 linkPlayerId, u8 dir)
@@ -3434,7 +3434,7 @@ static bool8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *linkPlayer
{
objEvent->directionSequenceIndex = 16;
ShiftObjectEventCoords(objEvent, x, y);
ObjectEventUpdateZCoord(objEvent);
ObjectEventUpdateElevation(objEvent);
return TRUE;
}
}
@@ -3536,8 +3536,8 @@ static void SpriteCB_LinkPlayer(struct Sprite *sprite)
struct ObjectEvent *objEvent = &gObjectEvents[linkPlayerObjEvent->objEventId];
sprite->x = objEvent->initialCoords.x;
sprite->y = objEvent->initialCoords.y;
SetObjectSubpriorityByZCoord(objEvent->previousElevation, sprite, 1);
sprite->oam.priority = ZCoordToPriority(objEvent->previousElevation);
SetObjectSubpriorityByElevation(objEvent->previousElevation, sprite, 1);
sprite->oam.priority = ElevationToPriority(objEvent->previousElevation);
if (!linkPlayerObjEvent->movementMode != MOVEMENT_MODE_FREE)
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(linkDirection(objEvent)));