summaryrefslogtreecommitdiff
path: root/src/field_player_avatar.c
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-01-26 04:41:13 -0500
committerGriffinR <griffin.g.richards@gmail.com>2021-01-26 04:42:18 -0500
commit9e5958122011a2d5092db57f07f14fd511fb6f42 (patch)
tree316c5533951be13d21d8568a936d868a810ae27a /src/field_player_avatar.c
parent0064333e4aa1bacb42f840ba67d38a9aced8816e (diff)
Document object lock and some trainer approach
Diffstat (limited to 'src/field_player_avatar.c')
-rw-r--r--src/field_player_avatar.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c
index cc4c03c9d..3d29e013f 100644
--- a/src/field_player_avatar.c
+++ b/src/field_player_avatar.c
@@ -96,7 +96,7 @@ static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8);
static void PlayCollisionSoundIfNotFacingWarp(u8 a);
-static void sub_808C280(struct ObjectEvent *);
+static void HideShowWarpArrow(struct ObjectEvent *);
static void StartStrengthAnim(u8, u8);
static void Task_PushBoulder(u8 taskId);
@@ -323,7 +323,7 @@ void PlayerStep(u8 direction, u16 newKeys, u16 heldKeys)
{
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
- sub_808C280(playerObjEvent);
+ HideShowWarpArrow(playerObjEvent);
if (gPlayerAvatar.preventStep == FALSE)
{
Bike_TryAcroBikeHistoryUpdate(newKeys, heldKeys);
@@ -940,9 +940,9 @@ u8 PlayerGetCopyableMovement(void)
return gObjectEvents[gPlayerAvatar.objectEventId].playerCopyableMovement;
}
-static void sub_808B6BC(u8 a)
+static void PlayerForceSetHeldMovement(u8 movementActionId)
{
- ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], a);
+ ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], movementActionId);
}
void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement)
@@ -1020,12 +1020,13 @@ void PlayerJumpLedge(u8 direction)
PlayerSetAnimId(GetJump2MovementAction(direction), 8);
}
-void sub_808B864(void)
+// Stop player on current facing direction once they're done moving and if they're not currently Acro Biking on bumpy slope
+void PlayerFreeze(void)
{
if (gPlayerAvatar.tileTransitionState == T_TILE_CENTER || gPlayerAvatar.tileTransitionState == T_NOT_MOVING)
{
- if (player_should_look_direction_be_enforced_upon_movement())
- sub_808B6BC(GetFaceDirectionMovementAction(gObjectEvents[gPlayerAvatar.objectEventId].facingDirection));
+ if (IsPlayerNotUsingAcroBikeOnBumpySlope())
+ PlayerForceSetHeldMovement(GetFaceDirectionMovementAction(gObjectEvents[gPlayerAvatar.objectEventId].facingDirection));
}
}
@@ -1424,7 +1425,7 @@ void SetPlayerAvatarWatering(u8 direction)
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFaceDirectionAnimNum(direction));
}
-static void sub_808C280(struct ObjectEvent *objectEvent)
+static void HideShowWarpArrow(struct ObjectEvent *objectEvent)
{
s16 x;
s16 y;
@@ -1435,6 +1436,7 @@ static void sub_808C280(struct ObjectEvent *objectEvent)
{
if (sArrowWarpMetatileBehaviorChecks2[x](metatileBehavior) && direction == objectEvent->movementDirection)
{
+ // Show warp arrow if applicable
x = objectEvent->currentCoords.x;
y = objectEvent->currentCoords.y;
MoveCoords(direction, &x, &y);