diff options
Diffstat (limited to 'src/field_player_avatar.c')
-rw-r--r-- | src/field_player_avatar.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index cb2beacee..df714d7db 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -32,7 +32,7 @@ #include "constants/species.h" static EWRAM_DATA u8 gUnknown_0203734C = 0; -EWRAM_DATA struct EventObject gEventObjects[NUM_EVENT_OBJECTS] = {}; +EWRAM_DATA struct EventObject gEventObjects[EVENT_OBJECTS_COUNT] = {}; EWRAM_DATA struct PlayerAvatar gPlayerAvatar = {}; static void StartStrengthAnim(u8, u8); @@ -123,7 +123,7 @@ static u8 Fishing14(struct Task *task); static u8 Fishing15(struct Task *task); static u8 Fishing16(struct Task *task); -static bool8 (*const gUnknown_084973FC[])(u8) = +static bool8 (*const sForcedMovementTestFuncs[])(u8) = { MetatileBehavior_IsTrickHouseSlipperyFloor, MetatileBehavior_IsIce_2, @@ -145,7 +145,7 @@ static bool8 (*const gUnknown_084973FC[])(u8) = MetatileBehavior_IsMuddySlope, }; -static bool8 (*const gUnknown_08497444[])(void) = +static bool8 (*const sForcedMovementFuncs[])(void) = { ForcedMovement_None, ForcedMovement_Slip, @@ -285,12 +285,12 @@ static bool8 (*const sPlayerAvatarSecretBaseMatSpin[])(struct Task *, struct Eve // .text void MovementType_Player(struct Sprite *sprite) { - UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, EventObjectCB2_NoMovement2); + UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, EventObjectCB2_NoMovement2); } static u8 EventObjectCB2_NoMovement2(void) { - return 0; + return 0; } void player_step(u8 direction, u16 newKeys, u16 heldKeys) @@ -380,7 +380,7 @@ static void PlayerAllowForcedMovementIfMovingSameDirection(void) static bool8 TryDoMetatileBehaviorForcedMovement(void) { - return gUnknown_08497444[GetForcedMovementByMetatileBehavior()](); + return sForcedMovementFuncs[GetForcedMovementByMetatileBehavior()](); } static u8 GetForcedMovementByMetatileBehavior(void) @@ -393,7 +393,7 @@ static u8 GetForcedMovementByMetatileBehavior(void) for (i = 0; i < 18; i++) { - if (gUnknown_084973FC[i](metatileBehavior)) + if (sForcedMovementTestFuncs[i](metatileBehavior)) return i + 1; } } @@ -622,7 +622,7 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) { - // speed 2 is fast, same speed as running + // speed 2 is fast, same speed as running PlayerGoSpeed2(direction); return; } @@ -1700,7 +1700,7 @@ static bool8 (*const sFishingStateFuncs[])(struct Task *) = }; static void Task_Fishing(u8 taskId); -static void sub_808CF78(void); +static void AlignFishingAnimationFrames(void); #define tStep data[0] #define tFrameCounter data[1] @@ -1759,7 +1759,7 @@ static bool8 Fishing2(struct Task *task) static bool8 Fishing3(struct Task *task) { - sub_808CF78(); + AlignFishingAnimationFrames(); // Wait one second task->tFrameCounter++; @@ -1791,7 +1791,7 @@ static bool8 Fishing5(struct Task *task) { const u8 dot[] = _("·"); - sub_808CF78(); + AlignFishingAnimationFrames(); task->tFrameCounter++; if (gMain.newKeys & A_BUTTON) { @@ -1827,7 +1827,7 @@ static bool8 Fishing6(struct Task *task) { bool8 bite; - sub_808CF78(); + AlignFishingAnimationFrames(); task->tStep++; bite = FALSE; @@ -1872,7 +1872,7 @@ static bool8 Fishing6(struct Task *task) // Oh! A Bite! static bool8 Fishing7(struct Task *task) { - sub_808CF78(); + AlignFishingAnimationFrames(); AddTextPrinterParameterized(0, 1, gText_OhABite, 0, 17, 0, NULL); task->tStep++; task->tFrameCounter = 0; @@ -1884,7 +1884,7 @@ static bool8 Fishing8(struct Task *task) { const s16 reelTimeouts[3] = {36, 33, 30}; - sub_808CF78(); + AlignFishingAnimationFrames(); task->tFrameCounter++; if (task->tFrameCounter >= reelTimeouts[task->tFishingRod]) task->tStep = FISHING_GOT_AWAY; @@ -1903,7 +1903,7 @@ static bool8 Fishing9(struct Task *task) {70, 30} }; - sub_808CF78(); + AlignFishingAnimationFrames(); task->tStep++; if (task->tRoundsPlayed < task->tMinRoundsRequired) { @@ -1922,7 +1922,7 @@ static bool8 Fishing9(struct Task *task) static bool8 Fishing10(struct Task *task) { - sub_808CF78(); + AlignFishingAnimationFrames(); FillWindowPixelBuffer(0, 0x11); AddTextPrinterParameterized2(0, 1, gText_PokemonOnHook, 1, 0, 2, 1, 3); task->tStep++; @@ -1933,7 +1933,7 @@ static bool8 Fishing10(struct Task *task) static bool8 Fishing11(struct Task *task) { if (task->tFrameCounter == 0) - sub_808CF78(); + AlignFishingAnimationFrames(); RunTextPrinters(); @@ -1969,7 +1969,7 @@ static bool8 Fishing11(struct Task *task) // Not even a nibble static bool8 Fishing12(struct Task *task) { - sub_808CF78(); + AlignFishingAnimationFrames(); StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingNoCatchDirectionAnimNum(GetPlayerFacingDirection())); FillWindowPixelBuffer(0, 0x11); AddTextPrinterParameterized2(0, 1, gText_NotEvenANibble, 1, 0, 2, 1, 3); @@ -1980,7 +1980,7 @@ static bool8 Fishing12(struct Task *task) // It got away static bool8 Fishing13(struct Task *task) { - sub_808CF78(); + AlignFishingAnimationFrames(); StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingNoCatchDirectionAnimNum(GetPlayerFacingDirection())); FillWindowPixelBuffer(0, 0x11); AddTextPrinterParameterized2(0, 1, gText_ItGotAway, 1, 0, 2, 1, 3); @@ -1991,14 +1991,14 @@ static bool8 Fishing13(struct Task *task) // Wait one second static bool8 Fishing14(struct Task *task) { - sub_808CF78(); + AlignFishingAnimationFrames(); task->tStep++; return FALSE; } static bool8 Fishing15(struct Task *task) { - sub_808CF78(); + AlignFishingAnimationFrames(); if (gSprites[gPlayerAvatar.spriteId].animEnded) { struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; @@ -2033,7 +2033,7 @@ static bool8 Fishing16(struct Task *task) #undef tFrameCounter #undef tFishingRod -static void sub_808CF78(void) +static void AlignFishingAnimationFrames(void) { struct Sprite *playerSprite = &gSprites[gPlayerAvatar.spriteId]; u8 animCmdIndex; @@ -2114,7 +2114,7 @@ static void sub_808D094(u8 taskId) data[3] -= data[2]; data[2] += 3; sprite->pos1.y = data[3] >> 4; - if (sprite->pos1.y + (s16)gUnknown_03005DE8 < -32) + if (sprite->pos1.y + (s16)gTotalCameraPixelOffsetY < -32) { data[0]++; } |