diff --git a/asm/battle_frontier_1.s b/asm/battle_frontier_1.s index 535bbbbbe..522c5d5f5 100644 --- a/asm/battle_frontier_1.s +++ b/asm/battle_frontier_1.s @@ -14294,7 +14294,7 @@ sub_81963F0: @ 81963F0 lsls r0, 2 ldr r1, =gEventObjects adds r0, r1 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished bl sub_80D338C bl UnfreezeEventObjects bl ScriptContext2_Disable diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s index c42d96640..b2b454278 100644 --- a/asm/battle_frontier_2.s +++ b/asm/battle_frontier_2.s @@ -27222,7 +27222,7 @@ _081A896E: lsls r0, 2 ldr r1, =gEventObjects adds r0, r1 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished bl sub_80D338C pop {r4} pop {r0} diff --git a/asm/field_control_avatar.s b/asm/field_control_avatar.s index ff10928cb..c2b13e2bf 100644 --- a/asm/field_control_avatar.s +++ b/asm/field_control_avatar.s @@ -189,7 +189,7 @@ sub_809C014: @ 809C014 strh r1, [r0] ldr r0, =gSelectedEventObject strb r1, [r0] - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r6, r0, 24 mov r4, sp @@ -2452,7 +2452,7 @@ _0809D276: GetEventObjectScriptPointerForComparison: @ 809D280 push {r4,r5,lr} sub sp, 0x8 - bl player_get_direction_upper_nybble + bl GetPlayerMovementDirection adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -2481,7 +2481,7 @@ GetEventObjectScriptPointerForComparison: @ 809D280 sub_809D2BC: @ 809D2BC push {r4,lr} sub sp, 0x8 - bl player_get_direction_upper_nybble + bl GetPlayerMovementDirection mov r4, sp mov r0, sp bl player_get_pos_to_and_height diff --git a/asm/field_effect_helpers.s b/asm/field_effect_helpers.s index 08df3215c..6cf62ba8b 100644 --- a/asm/field_effect_helpers.s +++ b/asm/field_effect_helpers.s @@ -931,7 +931,7 @@ _08154624: _08154632: adds r0, r5, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility ldrh r1, [r5, 0x2E] lsls r1, 24 lsrs r1, 24 @@ -1262,7 +1262,7 @@ _081548B4: _081548D4: adds r0, r5, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility ldrh r1, [r5, 0x2E] lsls r1, 24 lsrs r1, 24 @@ -1523,7 +1523,7 @@ _08154AB2: lsls r1, 29 lsrs r1, 31 adds r0, r4, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility _08154AF2: add sp, 0x4 pop {r3} @@ -1729,7 +1729,7 @@ sub_8154C7C: @ 8154C7C _08154C92: adds r0, r1, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility pop {r0} bx r0 thumb_func_end sub_8154C7C @@ -1758,7 +1758,7 @@ sub_8154CA0: @ 8154CA0 lsls r1, 29 lsrs r1, 31 adds r0, r4, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0x38 @@ -1910,7 +1910,7 @@ _08154DCA: strh r0, [r4, 0x22] adds r0, r4, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility _08154E0A: add sp, 0x4 pop {r4} @@ -2162,7 +2162,7 @@ _08154FFC: strb r0, [r1] adds r0, r4, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility ldr r1, [r5, 0x10] ldr r0, [r4, 0x34] cmp r1, r0 @@ -2381,7 +2381,7 @@ _081551A0: strb r0, [r1] adds r0, r4, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility _081551E4: add sp, 0x4 pop {r4,r5} @@ -2789,7 +2789,7 @@ sub_815550C: @ 815550C push {r4,lr} adds r4, r0, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility adds r0, r4, 0 adds r0, 0x3F ldrb r1, [r0] @@ -3493,7 +3493,7 @@ _08155A46: strb r0, [r1] adds r0, r4, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility _08155A76: add sp, 0x4 pop {r4-r6} @@ -3567,7 +3567,7 @@ sub_8155AEC: @ 8155AEC strh r1, [r4, 0x22] adds r0, r4, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility ldrh r1, [r4, 0x3E] ldr r0, =0x00001004 ands r0, r1 @@ -4460,7 +4460,7 @@ sub_8156194: @ 8156194 _081561B2: adds r0, r4, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility ldrh r0, [r4, 0x2E] lsls r0, 24 lsrs r0, 24 @@ -4492,7 +4492,7 @@ sub_81561D0: @ 81561D0 _081561EE: adds r0, r2, 0 movs r1, 0 - bl sub_80979D4 + bl UpdateEventObjectSpriteVisibility _081561F6: pop {r0} bx r0 diff --git a/asm/field_player_avatar.s b/asm/field_player_avatar.s index 375177337..c0becc6da 100644 --- a/asm/field_player_avatar.s +++ b/asm/field_player_avatar.s @@ -5,9 +5,9 @@ .text - thumb_func_start EventObjectCB_NoMovement2 -@ void EventObjectCB_NoMovement2(struct obj *object) -EventObjectCB_NoMovement2: @ 808A998 + thumb_func_start MovementType_Player +@ void MovementType_Player(struct obj *object) +MovementType_Player: @ 808A998 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -18,11 +18,11 @@ EventObjectCB_NoMovement2: @ 808A998 ldr r2, =gEventObjects adds r0, r2 ldr r2, =EventObjectCB2_NoMovement2 - bl EventObjectStep + bl UpdateEventObjectCurrentMovement pop {r0} bx r0 .pool - thumb_func_end EventObjectCB_NoMovement2 + thumb_func_end MovementType_Player thumb_func_start EventObjectCB2_NoMovement2 EventObjectCB2_NoMovement2: @ 808A9BC @@ -93,17 +93,17 @@ TryInterruptEventObjectSpecialAnim: @ 808AA38 lsls r1, 24 lsrs r5, r1, 24 adds r6, r5, 0 - bl EventObjectIsSpecialAnimOrDirectionSequenceAnimActive + bl EventObjectIsMovementOverridden lsls r0, 24 cmp r0, 0 beq _0808AA92 adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 bne _0808AA92 adds r0, r4, 0 - bl EventObjectGetSpecialAnim + bl EventObjectGetHeldMovementActionId lsls r0, 24 movs r1, 0xE7 lsls r1, 24 @@ -123,7 +123,7 @@ _0808AA74: beq _0808AA84 _0808AA7C: adds r0, r4, 0 - bl EventObjectClearAnim + bl EventObjectClearHeldMovement b _0808AA92 _0808AA84: adds r0, r6, 0 @@ -302,7 +302,7 @@ ForcedMovement_None: @ 808AB94 ldrb r1, [r0, 0x18] lsls r1, 28 lsrs r1, 28 - bl EventObjectSetDirection + bl SetEventObjectDirection ldrb r1, [r4] movs r0, 0xBF ands r0, r1 @@ -697,7 +697,7 @@ CheckMovementInputNotOnBike: @ 808AE98 b _0808AED2 .pool _0808AEB0: - bl player_get_direction_upper_nybble + bl GetPlayerMovementDirection lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -725,7 +725,7 @@ _0808AED2: @ void PlayerNotOnBikeNotMoving(u8 direction, u8 heldKeys) PlayerNotOnBikeNotMoving: @ 808AEDC push {lr} - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 bl PlayerFaceDirection @@ -963,7 +963,7 @@ CheckForEventObjectCollision: @ 808B094 adds r1, r5, 0 adds r2, r4, 0 adds r3, r6, 0 - bl npc_block_way + bl GetCollisionAtCoords lsls r0, 24 lsrs r0, 24 mov r1, sp @@ -1061,7 +1061,7 @@ sub_808B164: @ 808B164 adds r1, r5, 0 adds r2, r4, 0 adds r3, r6, 0 - bl npc_block_way + bl GetCollisionAtCoords lsls r0, 24 lsrs r0, 24 mov r1, sp @@ -1211,7 +1211,7 @@ sub_808B238: @ 808B238 ldrsh r2, [r5, r0] adds r0, r4, 0 adds r3, r7, 0 - bl npc_block_way + bl GetCollisionAtCoords lsls r0, 24 cmp r0, 0 bne _0808B2D8 @@ -1698,7 +1698,7 @@ PlayerIsAnimActive: @ 808B63C lsls r0, 2 ldr r1, =gEventObjects adds r0, r1 - bl EventObjectIsSpecialAnimOrDirectionSequenceAnimActive + bl EventObjectIsMovementOverridden lsls r0, 24 lsrs r0, 24 pop {r1} @@ -1717,7 +1717,7 @@ PlayerCheckIfAnimFinishedOrInactive: @ 808B660 lsls r0, 2 ldr r1, =gEventObjects adds r0, r1 - bl EventObjectCheckIfSpecialAnimFinishedOrInactive + bl EventObjectCheckHeldMovementStatus lsls r0, 24 lsrs r0, 24 pop {r1} @@ -1740,8 +1740,8 @@ player_set_x22: @ 808B684 .pool thumb_func_end player_set_x22 - thumb_func_start player_get_x22 -player_get_x22: @ 808B6A0 + thumb_func_start PlayerGetCopyableMovement +PlayerGetCopyableMovement: @ 808B6A0 ldr r2, =gEventObjects ldr r0, =gPlayerAvatar ldrb r1, [r0, 0x5] @@ -1753,7 +1753,7 @@ player_get_x22: @ 808B6A0 ldrb r0, [r0] bx lr .pool - thumb_func_end player_get_x22 + thumb_func_end PlayerGetCopyableMovement thumb_func_start sub_808B6BC sub_808B6BC: @ 808B6BC @@ -1768,7 +1768,7 @@ sub_808B6BC: @ 808B6BC lsls r0, 2 ldr r2, =gEventObjects adds r0, r2 - bl EventObjectForceSetSpecialAnim + bl EventObjectForceSetHeldMovement pop {r0} bx r0 .pool @@ -1796,7 +1796,7 @@ PlayerSetAnimId: @ 808B6E4 ldr r1, =gEventObjects adds r0, r1 adds r1, r5, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement _0808B712: pop {r4,r5} pop {r0} @@ -1810,7 +1810,7 @@ PlayerGoSpeed1: @ 808B720 push {lr} lsls r0, 24 lsrs r0, 24 - bl GetGoSpeed0AnimId + bl GetWalkNormalMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -1825,7 +1825,7 @@ PlayerGoSpeed2: @ 808B738 push {lr} lsls r0, 24 lsrs r0, 24 - bl GetGoSpeed1AnimId + bl GetWalkFastMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -1840,7 +1840,7 @@ PlayerGoSpeed3: @ 808B750 push {lr} lsls r0, 24 lsrs r0, 24 - bl GetGoSpeed2AnimId + bl GetRideWaterCurrentMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -1855,7 +1855,7 @@ PlayerGoSpeed4: @ 808B768 push {lr} lsls r0, 24 lsrs r0, 24 - bl GetGoSpeed3AnimId + bl GetWalkFastestMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -1870,7 +1870,7 @@ PlayerRun: @ 808B780 push {lr} lsls r0, 24 lsrs r0, 24 - bl GetRunAnimId + bl GetPlayerRunMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -1889,7 +1889,7 @@ PlayerOnBikeCollide: @ 808B798 adds r0, r4, 0 bl PlayCollisionSoundIfNotFacingWarp adds r0, r4, 0 - bl GetStepInPlaceDelay16AnimId + bl GetWalkInPlaceNormalMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -1905,7 +1905,7 @@ PlayerOnBikeCollideWithFarawayIslandMew: @ 808B7BC push {lr} lsls r0, 24 lsrs r0, 24 - bl GetStepInPlaceDelay16AnimId + bl GetWalkInPlaceNormalMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -1924,7 +1924,7 @@ PlayerNotOnBikeCollide: @ 808B7D4 adds r0, r4, 0 bl PlayCollisionSoundIfNotFacingWarp adds r0, r4, 0 - bl GetStepInPlaceDelay32AnimId + bl GetWalkInPlaceSlowMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -1940,7 +1940,7 @@ PlayerNotOnBikeCollideWithFarawayIslandMew: @ 808B7F8 push {lr} lsls r0, 24 lsrs r0, 24 - bl GetStepInPlaceDelay32AnimId + bl GetWalkInPlaceSlowMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -1955,7 +1955,7 @@ PlayerFaceDirection: @ 808B810 push {lr} lsls r0, 24 lsrs r0, 24 - bl GetFaceDirectionAnimId + bl GetFaceDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -1970,7 +1970,7 @@ PlayerTurnInPlace: @ 808B828 push {lr} lsls r0, 24 lsrs r0, 24 - bl GetStepInPlaceDelay8AnimId + bl GetWalkInPlaceFastMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -1989,7 +1989,7 @@ PlayerJumpLedge: @ 808B840 movs r0, 0xA bl PlaySE adds r0, r4, 0 - bl GetJumpLedgeAnimId + bl GetJump2MovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x8 @@ -2022,7 +2022,7 @@ _0808B872: ldrb r0, [r0, 0x18] lsls r0, 28 lsrs r0, 28 - bl GetFaceDirectionAnimId + bl GetFaceDirectionMovementAction lsls r0, 24 lsrs r0, 24 bl sub_808B6BC @@ -2038,7 +2038,7 @@ PlayerIdleWheelie: @ 808B8A8 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_8093648 + bl GetAcroWheelieFaceDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -2052,7 +2052,7 @@ PlayerStartWheelie: @ 808B8C0 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_8093674 + bl GetAcroPopWheelieFaceDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -2066,7 +2066,7 @@ PlayerEndWheelie: @ 808B8D8 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_80936A0 + bl GetAcroEndWheelieFaceDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -2084,7 +2084,7 @@ PlayerStandingHoppingWheelie: @ 808B8F0 movs r0, 0x22 bl PlaySE adds r0, r4, 0 - bl sub_80936CC + bl GetAcroWheelieHopFaceDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -2103,7 +2103,7 @@ PlayerMovingHoppingWheelie: @ 808B914 movs r0, 0x22 bl PlaySE adds r0, r4, 0 - bl sub_80936F8 + bl GetAcroWheelieHopDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -2122,7 +2122,7 @@ PlayerLedgeHoppingWheelie: @ 808B938 movs r0, 0x22 bl PlaySE adds r0, r4, 0 - bl sub_8093724 + bl GetAcroWheelieJumpDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x8 @@ -2141,7 +2141,7 @@ PlayerAcroTurnJump: @ 808B95C movs r0, 0x22 bl PlaySE adds r0, r4, 0 - bl sub_80934E8 + bl GetJumpInPlaceTurnAroundMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -2160,7 +2160,7 @@ sub_808B980: @ 808B980 movs r0, 0x7 bl PlaySE adds r0, r4, 0 - bl sub_8093750 + bl GetAcroWheelieInPlaceDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -2175,7 +2175,7 @@ sub_808B9A4: @ 808B9A4 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_809377C + bl GetAcroPopWheelieMoveDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -2189,7 +2189,7 @@ sub_808B9BC: @ 808B9BC push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_80937A8 + bl GetAcroWheelieMoveDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -2203,7 +2203,7 @@ npc_use_some_d2s: @ 808B9D4 push {lr} lsls r0, 24 lsrs r0, 24 - bl d2s_08064034 + bl GetAcroEndWheelieMoveDirectionMovementAction lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -2291,7 +2291,7 @@ GetXYCoordsOneStepInFrontOfPlayer: @ 808BA68 adds r0, r3 ldrh r0, [r0, 0x12] strh r0, [r5] - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 @@ -2462,9 +2462,9 @@ _0808BC30: bx r1 thumb_func_end plaer_get_pos_including_state_based_drift - thumb_func_start player_get_direction_lower_nybble -@ u8 player_get_direction_lower_nybble() -player_get_direction_lower_nybble: @ 808BC38 + thumb_func_start GetPlayerFacingDirection +@ u8 GetPlayerFacingDirection() +GetPlayerFacingDirection: @ 808BC38 ldr r2, =gEventObjects ldr r0, =gPlayerAvatar ldrb r1, [r0, 0x5] @@ -2477,11 +2477,11 @@ player_get_direction_lower_nybble: @ 808BC38 lsrs r0, 28 bx lr .pool - thumb_func_end player_get_direction_lower_nybble + thumb_func_end GetPlayerFacingDirection - thumb_func_start player_get_direction_upper_nybble -@ u8 player_get_direction_upper_nybble() -player_get_direction_upper_nybble: @ 808BC58 + thumb_func_start GetPlayerMovementDirection +@ u8 GetPlayerMovementDirection() +GetPlayerMovementDirection: @ 808BC58 ldr r2, =gEventObjects ldr r0, =gPlayerAvatar ldrb r1, [r0, 0x5] @@ -2493,7 +2493,7 @@ player_get_direction_upper_nybble: @ 808BC58 lsrs r0, 4 bx lr .pool - thumb_func_end player_get_direction_upper_nybble + thumb_func_end GetPlayerMovementDirection thumb_func_start PlayerGetZCoord @ u8 PlayerGetZCoord() @@ -2586,7 +2586,7 @@ sub_808BCF4: @ 808BCF4 lsls r1, 28 lsrs r1, 28 adds r0, r4, 0 - bl EventObjectSetDirection + bl SetEventObjectDirection movs r0, 0x6 bl TestPlayerAvatarFlags lsls r0, 24 @@ -2780,7 +2780,7 @@ _0808BE46: @ bool8 IsPlayerSurfingNorth() IsPlayerSurfingNorth: @ 808BE50 push {lr} - bl player_get_direction_upper_nybble + bl GetPlayerMovementDirection lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -2833,7 +2833,7 @@ IsPlayerFacingSurfableFishableWater: @ 808BE74 lsls r3, 28 lsrs r3, 28 adds r0, r4, 0 - bl npc_block_way + bl GetCollisionAtCoords lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 @@ -3202,7 +3202,7 @@ sub_808C15C: @ 808C15C ldr r0, =gSprites adds r4, r0 adds r0, r5, 0 - bl sub_8092A0C + bl GetFishingDirectionAnimNum adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -3244,7 +3244,7 @@ sub_808C1B4: @ 808C1B4 mov r8, r0 add r4, r8 adds r0, r5, 0 - bl sub_80929BC + bl GetAcroWheelieDirectionAnimNum adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -3292,7 +3292,7 @@ sub_808C228: @ 808C228 ldr r0, =gSprites adds r4, r0 adds r0, r5, 0 - bl EventObjectDirectionToImageAnimId + bl GetFaceDirectionAnimNum adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -3474,49 +3474,49 @@ do_boulder_dust: @ 808C3C4 adds r5, r1, 0 adds r4, r2, 0 adds r0, r5, 0 - bl EventObjectIsSpecialAnimActive + bl EventObjectIsHeldMovementActive lsls r0, 24 cmp r0, 0 beq _0808C3DE adds r0, r5, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished _0808C3DE: adds r0, r4, 0 - bl EventObjectIsSpecialAnimActive + bl EventObjectIsHeldMovementActive lsls r0, 24 cmp r0, 0 beq _0808C3F0 adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished _0808C3F0: adds r0, r5, 0 - bl EventObjectIsSpecialAnimOrDirectionSequenceAnimActive + bl EventObjectIsMovementOverridden lsls r0, 24 cmp r0, 0 bne _0808C472 adds r0, r4, 0 - bl EventObjectIsSpecialAnimOrDirectionSequenceAnimActive + bl EventObjectIsMovementOverridden lsls r0, 24 cmp r0, 0 bne _0808C472 adds r0, r5, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished ldrb r0, [r6, 0xC] - bl GetStepInPlaceDelay16AnimId + bl GetWalkInPlaceNormalMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement ldrb r0, [r6, 0xC] - bl GetSimpleGoAnimId + bl GetWalkSlowMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement ldr r2, =gFieldEffectArguments movs r1, 0x10 ldrsh r0, [r4, r1] @@ -3558,19 +3558,19 @@ sub_808C484: @ 808C484 adds r4, r1, 0 adds r5, r2, 0 adds r0, r4, 0 - bl EventObjectCheckIfSpecialAnimFinishedOrInactive + bl EventObjectCheckHeldMovementStatus lsls r0, 24 cmp r0, 0 beq _0808C4C6 adds r0, r5, 0 - bl EventObjectCheckIfSpecialAnimFinishedOrInactive + bl EventObjectCheckHeldMovementStatus lsls r0, 24 cmp r0, 0 beq _0808C4C6 adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished adds r0, r5, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished ldr r1, =gPlayerAvatar movs r0, 0 strb r0, [r1, 0x6] @@ -3648,7 +3648,7 @@ sub_808C544: @ 808C544 movs r0, 0x1 strb r0, [r5, 0x6] adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 beq _0808C5A0 @@ -3657,12 +3657,12 @@ sub_808C544: @ 808C544 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl sub_80934BC + bl GetJumpInPlaceMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement ldrh r0, [r6, 0xA] adds r0, 0x1 strh r0, [r6, 0xA] @@ -3772,7 +3772,7 @@ sub_808C644: @ 808C644 movs r2, 0x4 bl memcpy adds r0, r5, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 beq _0808C6AC @@ -3782,12 +3782,12 @@ sub_808C644: @ 808C644 add r0, sp ldrb r6, [r0] adds r0, r6, 0 - bl GetFaceDirectionAnimId + bl GetFaceDirectionMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement ldrb r0, [r4, 0xA] cmp r6, r0 bne _0808C68A @@ -3831,7 +3831,7 @@ sub_808C6BC: @ 808C6BC movs r2, 0x5 bl memcpy adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 beq _0808C6EC @@ -3840,7 +3840,7 @@ sub_808C6BC: @ 808C6BC add r0, sp ldrb r1, [r0] adds r0, r4, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement movs r0, 0x1 strh r0, [r5, 0x8] _0808C6EC: @@ -3858,7 +3858,7 @@ sub_808C6FC: @ 808C6FC adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 beq _0808C740 @@ -3866,12 +3866,12 @@ sub_808C6FC: @ 808C6FC bl GetOppositeDirection lsls r0, 24 lsrs r0, 24 - bl GetSimpleGoAnimId + bl GetWalkSlowMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement bl ScriptContext2_Disable ldr r1, =gPlayerAvatar movs r0, 0 @@ -3939,12 +3939,12 @@ taskFF_0805D1D4: @ 808C7A8 ldr r1, =gEventObjects adds r5, r0, r1 adds r0, r5, 0 - bl EventObjectIsSpecialAnimOrDirectionSequenceAnimActive + bl EventObjectIsMovementOverridden lsls r0, 24 cmp r0, 0 beq _0808C7D4 adds r0, r5, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 beq _0808C7FC @@ -3958,12 +3958,12 @@ _0808C7D4: lsls r4, 3 adds r4, r0 ldrb r0, [r4, 0x8] - bl sub_8093540 + bl GetJumpSpecialMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement ldr r0, =sub_808C814 str r0, [r4] _0808C7FC: @@ -3986,7 +3986,7 @@ sub_808C814: @ 808C814 ldr r1, =gEventObjects adds r4, r0, r1 adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 beq _0808C87A @@ -4000,12 +4000,12 @@ sub_808C814: @ 808C814 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl GetFaceDirectionAnimId + bl GetFaceDirectionMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement movs r0, 0 strb r0, [r6, 0x6] bl ScriptContext2_Disable @@ -4142,7 +4142,7 @@ fish1: @ 808C918 lsls r4, 2 adds r4, r3 adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimActive + bl EventObjectClearHeldMovementIfActive ldrb r0, [r4, 0x1] movs r1, 0x8 orrs r0, r1 @@ -4373,10 +4373,10 @@ _0808CB32: lsls r4, 2 ldr r0, =gSprites adds r4, r0 - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 - bl sub_8092A2C + bl GetFishingBiteDirectionAnimNum adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -4671,10 +4671,10 @@ fishB: @ 808CD94 lsls r4, 2 ldr r0, =gSprites adds r4, r0 - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 - bl sub_8092A1C + bl GetFishingNoCatchDirectionAnimNum adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -4719,10 +4719,10 @@ fishC: @ 808CE04 lsls r4, 2 ldr r0, =gSprites adds r4, r0 - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 - bl sub_8092A1C + bl GetFishingNoCatchDirectionAnimNum adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -4956,7 +4956,7 @@ _0808CFF0: bhi _0808D022 movs r0, 0x8 strh r0, [r4, 0x24] - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 @@ -5066,7 +5066,7 @@ _0808D0E8: b _0808D18A _0808D0EE: adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 beq _0808D18A @@ -5257,12 +5257,12 @@ _0808D25E: ldrsh r0, [r5, r3] adds r0, r1 ldrb r0, [r0] - bl GetFaceDirectionAnimId + bl GetFaceDirectionMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl EventObjectForceSetSpecialAnim + bl EventObjectForceSetHeldMovement movs r0, 0 mov r9, r0 strh r6, [r5, 0x2] @@ -5414,7 +5414,7 @@ sub_808D38C: @ 808D38C ble _0808D3E4 _0808D3A8: adds r0, r5, 0 - bl EventObjectCheckIfSpecialAnimFinishedOrInactive + bl EventObjectCheckHeldMovementStatus lsls r0, 24 cmp r0, 0 beq _0808D3E4 @@ -5424,12 +5424,12 @@ _0808D3A8: lsrs r0, 28 adds r0, r4 ldrb r0, [r0] - bl GetFaceDirectionAnimId + bl GetFaceDirectionMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl EventObjectForceSetSpecialAnim + bl EventObjectForceSetHeldMovement movs r0, 0 strh r0, [r6] ldrb r0, [r5, 0x18] diff --git a/asm/field_screen.s b/asm/field_screen.s index 5d5602b7f..08eaf949a 100644 --- a/asm/field_screen.s +++ b/asm/field_screen.s @@ -8413,7 +8413,7 @@ _080AF4A4: ldr r1, =gEventObjects adds r0, r1 movs r1, 0x8 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement movs r0, 0x2 strh r0, [r5, 0x8] b _080AF54A @@ -8443,7 +8443,7 @@ _080AF4DC: lsls r0, 2 ldr r1, =gEventObjects adds r0, r1 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished movs r0, 0x3 strh r0, [r5, 0x8] b _080AF54A @@ -8532,15 +8532,15 @@ _080AF5A2: lsls r4, 2 ldr r0, =gEventObjects adds r4, r0 - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 - bl GetGoSpeed0AnimId + bl GetWalkNormalMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement movs r0, 0x2 strh r0, [r5, 0x8] b _080AF60A @@ -9183,7 +9183,7 @@ _080AFB26: lsls r0, 2 ldr r4, =gEventObjects adds r0, r4 - bl EventObjectClearAnimIfSpecialAnimActive + bl EventObjectClearHeldMovementIfActive movs r0, 0xFF movs r1, 0 movs r2, 0 @@ -9196,7 +9196,7 @@ _080AFB26: lsls r0, 2 adds r0, r4 movs r1, 0x9 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement movs r0, 0x2 strh r0, [r5, 0x8] b _080AFBE8 @@ -9227,7 +9227,7 @@ _080AFB6C: lsls r0, 2 ldr r1, =gEventObjects adds r0, r1 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished movs r0, 0 bl sub_80AF0F4 movs r0, 0x3 diff --git a/asm/field_specials.s b/asm/field_specials.s index 6916fc6ea..3db508001 100644 --- a/asm/field_specials.s +++ b/asm/field_specials.s @@ -766,7 +766,7 @@ SpawnLinkPartnerEventObject: @ 81382A0 lsls r0, 24 lsrs r0, 24 mov r10, r0 - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 @@ -1989,7 +1989,7 @@ PCTurnOnEffect_0: @ 8138D10 cmp r0, 0x6 bne _08138D7C strh r5, [r4, 0xE] - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 @@ -2134,7 +2134,7 @@ PCTurnOffEffect: @ 8138E2C movs r6, 0 movs r5, 0 movs r4, 0 - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index 702852445..840d38f64 100644 --- a/asm/fldeff_80F9BCC.s +++ b/asm/fldeff_80F9BCC.s @@ -567,7 +567,7 @@ sub_80FA004: @ 80FA004 ldrh r0, [r0] cmp r0, 0x1 beq _080FA0AE - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -1493,7 +1493,7 @@ sub_80FA794: @ 80FA794 lsls r1, 16 lsrs r4, r1, 16 adds r6, r4, 0 - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1815,7 +1815,7 @@ sub_80FAA7C: @ 80FAA7C movs r3, 0 ldrsh r0, [r4, r3] str r0, [r1, 0x18] - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -2315,29 +2315,29 @@ sub_80FAEF0: @ 80FAEF0 ldr r1, =gEventObjects adds r4, r0, r1 adds r0, r4, 0 - bl EventObjectIsSpecialAnimOrDirectionSequenceAnimActive + bl EventObjectIsMovementOverridden lsls r0, 24 cmp r0, 0 beq _080FAF1C adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 beq _080FAF4E _080FAF1C: - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 bl sub_808C228 - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 - bl GetStepInPlaceDelay16AnimId + bl GetWalkInPlaceNormalMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -2365,7 +2365,7 @@ sub_80FAF64: @ 80FAF64 ldr r1, =gEventObjects adds r5, r0, r1 adds r0, r5, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 beq _080FAFC8 @@ -2381,15 +2381,15 @@ sub_80FAF64: @ 80FAF64 asrs r0, 16 cmp r0, 0x9 bgt _080FAFC4 - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 - bl GetStepInPlaceDelay16AnimId + bl GetWalkInPlaceNormalMovementAction adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement b _080FAFC8 .pool _080FAFC4: diff --git a/asm/rom_8011DC0.s b/asm/rom_8011DC0.s index 14e418f1c..f906304ca 100644 --- a/asm/rom_8011DC0.s +++ b/asm/rom_8011DC0.s @@ -13609,13 +13609,13 @@ sub_8019AD8: @ 8019AD8 ldr r1, =gEventObjects adds r4, r0, r1 adds r0, r4, 0 - bl EventObjectIsSpecialAnimOrDirectionSequenceAnimActive + bl EventObjectIsMovementOverridden lsls r0, 24 cmp r0, 0 bne _08019B30 ldrb r1, [r5] adds r0, r4, 0 - bl EventObjectSetSpecialAnim + bl EventObjectSetHeldMovement lsls r0, 24 cmp r0, 0 bne _08019B30 @@ -13655,7 +13655,7 @@ sub_8019B3C: @ 8019B3C ldr r1, =gEventObjects adds r4, r0, r1 adds r0, r4, 0 - bl EventObjectClearAnimIfSpecialAnimFinished + bl EventObjectClearHeldMovementIfFinished lsls r0, 24 cmp r0, 0 bne _08019B84 @@ -13668,7 +13668,7 @@ _08019B84: cmp r0, 0 bne _08019B96 adds r0, r4, 0 - bl npc_sync_anim_pause_bits + bl UnfreezeEventObject b _08019B9C _08019B96: adds r0, r4, 0 @@ -14619,7 +14619,7 @@ sub_801A2A8: @ 801A2A8 b _0801A396 _0801A2C4: ldr r4, =gUnknown_082F076A - bl player_get_direction_lower_nybble + bl GetPlayerFacingDirection lsls r0, 24 lsrs r0, 24 adds r0, r4 diff --git a/data/field_effect_scripts.s b/data/field_effect_scripts.s index 8dfbd6782..581b72e43 100644 --- a/data/field_effect_scripts.s +++ b/data/field_effect_scripts.s @@ -38,7 +38,7 @@ gFieldEffectScriptPointers:: @ 82DB9D4 .4byte gFieldEffectScript_Unknown30 .4byte gFieldEffectScript_UseFly .4byte gFieldEffectScript_FlyIn - .4byte gFieldEffectScript_ExclamationMarkIcon2 + .4byte gFieldEffectScript_QuestionMarkIcon .4byte gFieldEffectScript_FeetInFlowingWater .4byte gFieldEffectScript_BikeTireTracks .4byte gFieldEffectScript_SandDisguisePlaceholder @@ -74,7 +74,7 @@ gFieldEffectScriptPointers:: @ 82DB9D4 .4byte gFieldEffectScript_Unknown66 gFieldEffectScript_ExclamationMarkIcon1:: @ 82DBAE0 - field_eff_callnative FldEff_ExclamationMarkIcon1 + field_eff_callnative FldEff_ExclamationMarkIcon field_eff_end gFieldEffectScript_UseCutOnTallGrass:: @ 82DBAE6 @@ -206,8 +206,8 @@ gFieldEffectScript_FlyIn:: @ 82DBBE9 field_eff_callnative FldEff_FlyIn field_eff_end -gFieldEffectScript_ExclamationMarkIcon2:: @ 82DBBEF - field_eff_callnative FldEff_ExclamationMarkIcon2 +gFieldEffectScript_QuestionMarkIcon:: @ 82DBBEF + field_eff_callnative FldEff_QuestionMarkIcon field_eff_end gFieldEffectScript_FeetInFlowingWater:: @ 82DBBF5 diff --git a/data/scripts/maps/LavaridgeTown.inc b/data/scripts/maps/LavaridgeTown.inc index 0631a5d33..8a8e2baed 100644 --- a/data/scripts/maps/LavaridgeTown.inc +++ b/data/scripts/maps/LavaridgeTown.inc @@ -212,7 +212,7 @@ LavaridgeTown_Movement_1EA6F8: @ 81EA6F8 step_end LavaridgeTown_EventScript_1EA6FA:: @ 81EA6FA - specialvar VAR_RESULT, player_get_direction_lower_nybble + specialvar VAR_RESULT, GetPlayerFacingDirection compare VAR_RESULT, 1 goto_eq LavaridgeTown_EventScript_1EA70B end diff --git a/data/specials.inc b/data/specials.inc index 939995150..dfbac56fa 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -297,7 +297,7 @@ gSpecials:: @ 81DBA64 def_special WaitWeather def_special sub_8139238 def_special sub_8139248 - def_special player_get_direction_lower_nybble + def_special GetPlayerFacingDirection def_special sub_81392AC def_special sub_81392D4 def_special sub_81392F8 diff --git a/include/event_object_movement.h b/include/event_object_movement.h index ca2449a6d..8a1749b0b 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -4,9 +4,255 @@ #define NUM_OBJECT_GRAPHICS_INFO 239 #define SPRITE_VAR 240 -// Exported struct declarations +enum +{ + MOVEMENT_TYPE_NONE, + MOVEMENT_TYPE_LOOK_AROUND, + MOVEMENT_TYPE_WANDER_AROUND, + MOVEMENT_TYPE_WANDER_UP_AND_DOWN, + MOVEMENT_TYPE_WANDER_DOWN_AND_UP, + MOVEMENT_TYPE_WANDER_LEFT_AND_RIGHT, + MOVEMENT_TYPE_WANDER_RIGHT_AND_LEFT, + MOVEMENT_TYPE_FACE_UP, + MOVEMENT_TYPE_FACE_DOWN, + MOVEMENT_TYPE_FACE_LEFT, + MOVEMENT_TYPE_FACE_RIGHT, + MOVEMENT_TYPE_PLAYER, + MOVEMENT_TYPE_BERRY_TREE_GROWTH, + MOVEMENT_TYPE_FACE_DOWN_AND_UP, + MOVEMENT_TYPE_FACE_LEFT_AND_RIGHT, + MOVEMENT_TYPE_FACE_UP_AND_LEFT, + MOVEMENT_TYPE_FACE_UP_AND_RIGHT, + MOVEMENT_TYPE_FACE_DOWN_AND_LEFT, + MOVEMENT_TYPE_FACE_DOWN_AND_RIGHT, + MOVEMENT_TYPE_FACE_DOWN_UP_AND_LEFT, + MOVEMENT_TYPE_FACE_DOWN_UP_AND_RIGHT, + MOVEMENT_TYPE_FACE_UP_LEFT_AND_RIGHT, + MOVEMENT_TYPE_FACE_DOWN_LEFT_AND_RIGHT, + MOVEMENT_TYPE_ROTATE_COUNTERCLOCKWISE, + MOVEMENT_TYPE_ROTATE_CLOCKWISE, + MOVEMENT_TYPE_WALK_UP_AND_DOWN, + MOVEMENT_TYPE_WALK_DOWN_AND_UP, + MOVEMENT_TYPE_WALK_LEFT_AND_RIGHT, + MOVEMENT_TYPE_WALK_RIGHT_AND_LEFT, + MOVEMENT_TYPE_WALK_SEQUENCE_UP_RIGHT_LEFT_DOWN, + MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_LEFT_DOWN_UP, + MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_UP_RIGHT_LEFT, + MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_DOWN_UP_RIGHT, + MOVEMENT_TYPE_WALK_SEQUENCE_UP_LEFT_RIGHT_DOWN, + MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_RIGHT_DOWN_UP, + MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_UP_LEFT_RIGHT, + MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_DOWN_UP_LEFT, + MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_UP_DOWN_RIGHT, + MOVEMENT_TYPE_WALK_SEQUENCE_UP_DOWN_RIGHT_LEFT, + MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_LEFT_UP_DOWN, + MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_RIGHT_LEFT_UP, + MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_UP_DOWN_LEFT, + MOVEMENT_TYPE_WALK_SEQUENCE_UP_DOWN_LEFT_RIGHT, + MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_RIGHT_UP_DOWN, + MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_LEFT_RIGHT_UP, + MOVEMENT_TYPE_WALK_SEQUENCE_UP_LEFT_DOWN_RIGHT, + MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_RIGHT_UP_LEFT, + MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_DOWN_RIGHT_UP, + MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_UP_LEFT_DOWN, + MOVEMENT_TYPE_WALK_SEQUENCE_UP_RIGHT_DOWN_LEFT, + MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_LEFT_UP_RIGHT, + MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_UP_RIGHT_DOWN, + MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_DOWN_LEFT_UP, + MOVEMENT_TYPE_COPY_PLAYER, + MOVEMENT_TYPE_COPY_PLAYER_OPPOSITE, + MOVEMENT_TYPE_COPY_PLAYER_COUNTERCLOCKWISE, + MOVEMENT_TYPE_COPY_PLAYER_CLOCKWISE, + MOVEMENT_TYPE_TREE_DISGUISE, + MOVEMENT_TYPE_MOUNTAIN_DISGUISE, + MOVEMENT_TYPE_COPY_PLAYER_IN_GRASS, + MOVEMENT_TYPE_COPY_PLAYER_OPPOSITE_IN_GRASS, + MOVEMENT_TYPE_COPY_PLAYER_COUNTERCLOCKWISE_IN_GRASS, + MOVEMENT_TYPE_COPY_PLAYER_CLOCKWISE_IN_GRASS, + MOVEMENT_TYPE_HIDDEN, + MOVEMENT_TYPE_WALK_IN_PLACE_DOWN, + MOVEMENT_TYPE_WALK_IN_PLACE_UP, + MOVEMENT_TYPE_WALK_IN_PLACE_LEFT, + MOVEMENT_TYPE_WALK_IN_PLACE_RIGHT, + MOVEMENT_TYPE_JOG_IN_PLACE_DOWN, + MOVEMENT_TYPE_JOG_IN_PLACE_UP, + MOVEMENT_TYPE_JOG_IN_PLACE_LEFT, + MOVEMENT_TYPE_JOG_IN_PLACE_RIGHT, + MOVEMENT_TYPE_RUN_IN_PLACE_DOWN, + MOVEMENT_TYPE_RUN_IN_PLACE_UP, + MOVEMENT_TYPE_RUN_IN_PLACE_LEFT, + MOVEMENT_TYPE_RUN_IN_PLACE_RIGHT, + MOVEMENT_TYPE_INVISIBLE, + MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_DOWN, + MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_UP, + MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_LEFT, + MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_RIGHT, +}; -enum SpinnerRunnerFollowPatterns { +enum +{ + MOVEMENT_ACTION_FACE_DOWN, + MOVEMENT_ACTION_FACE_UP, + MOVEMENT_ACTION_FACE_LEFT, + MOVEMENT_ACTION_FACE_RIGHT, + MOVEMENT_ACTION_WALK_SLOW_DOWN, + MOVEMENT_ACTION_WALK_SLOW_UP, + MOVEMENT_ACTION_WALK_SLOW_LEFT, + MOVEMENT_ACTION_WALK_SLOW_RIGHT, + MOVEMENT_ACTION_WALK_NORMAL_DOWN, + MOVEMENT_ACTION_WALK_NORMAL_UP, + MOVEMENT_ACTION_WALK_NORMAL_LEFT, + MOVEMENT_ACTION_WALK_NORMAL_RIGHT, + MOVEMENT_ACTION_JUMP_2_DOWN, + MOVEMENT_ACTION_JUMP_2_UP, + MOVEMENT_ACTION_JUMP_2_LEFT, + MOVEMENT_ACTION_JUMP_2_RIGHT, + MOVEMENT_ACTION_DELAY_1, + MOVEMENT_ACTION_DELAY_2, + MOVEMENT_ACTION_DELAY_4, + MOVEMENT_ACTION_DELAY_8, + MOVEMENT_ACTION_DELAY_16, + MOVEMENT_ACTION_WALK_FAST_DOWN, + MOVEMENT_ACTION_WALK_FAST_UP, + MOVEMENT_ACTION_WALK_FAST_LEFT, + MOVEMENT_ACTION_WALK_FAST_RIGHT, + MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_UP, + MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT, + MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT, + MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_UP, + MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT, + MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT, + MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_FAST_UP, + MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT, + MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT, + MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_UP, + MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_LEFT, + MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_RIGHT, + MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, + MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP, + MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, + MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, + MOVEMENT_ACTION_WALK_FASTEST_DOWN, + MOVEMENT_ACTION_WALK_FASTEST_UP, + MOVEMENT_ACTION_WALK_FASTEST_LEFT, + MOVEMENT_ACTION_WALK_FASTEST_RIGHT, + MOVEMENT_ACTION_SLIDE_DOWN, + MOVEMENT_ACTION_SLIDE_UP, + MOVEMENT_ACTION_SLIDE_LEFT, + MOVEMENT_ACTION_SLIDE_RIGHT, + MOVEMENT_ACTION_PLAYER_RUN_DOWN, + MOVEMENT_ACTION_PLAYER_RUN_UP, + MOVEMENT_ACTION_PLAYER_RUN_LEFT, + MOVEMENT_ACTION_PLAYER_RUN_RIGHT, + MOVEMENT_ACTION_START_ANIM_IN_DIRECTION, + MOVEMENT_ACTION_JUMP_SPECIAL_DOWN, + MOVEMENT_ACTION_JUMP_SPECIAL_UP, + MOVEMENT_ACTION_JUMP_SPECIAL_LEFT, + MOVEMENT_ACTION_JUMP_SPECIAL_RIGHT, + MOVEMENT_ACTION_FACE_PLAYER, + MOVEMENT_ACTION_FACE_AWAY_PLAYER, + MOVEMENT_ACTION_LOCK_FACING_DIRECTION, + MOVEMENT_ACTION_UNLOCK_FACING_DIRECTION, + MOVEMENT_ACTION_JUMP_DOWN, + MOVEMENT_ACTION_JUMP_UP, + MOVEMENT_ACTION_JUMP_LEFT, + MOVEMENT_ACTION_JUMP_RIGHT, + MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN, + MOVEMENT_ACTION_JUMP_IN_PLACE_UP, + MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT, + MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT, + MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN_UP, + MOVEMENT_ACTION_JUMP_IN_PLACE_UP_DOWN, + MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT_RIGHT, + MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT_LEFT, + MOVEMENT_ACTION_FACE_ORIGINAL_DIRECTION, + MOVEMENT_ACTION_NURSE_JOY_BOW_DOWN, + MOVEMENT_ACTION_ENABLE_JUMP_LANDING_GROUND_EFFECT, + MOVEMENT_ACTION_DISABLE_JUMP_LANDING_GROUND_EFFECT, + MOVEMENT_ACTION_DISABLE_ANIMATION, + MOVEMENT_ACTION_RESTORE_ANIMATION, + MOVEMENT_ACTION_SET_INVISIBLE, + MOVEMENT_ACTION_SET_VISIBLE, + MOVEMENT_ACTION_EMOTE_EXCLAMATION_MARK, + MOVEMENT_ACTION_EMOTE_QUESTION_MARK, + MOVEMENT_ACTION_EMOTE_HEART, + MOVEMENT_ACTION_REVEAL_TRAINER, + MOVEMENT_ACTION_ROCK_SMASH_BREAK, + MOVEMENT_ACTION_CUT_TREE, + MOVEMENT_ACTION_SET_FIXED_PRIORITY, + MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY, + MOVEMENT_ACTION_INIT_AFFINE_ANIM, + MOVEMENT_ACTION_CLEAR_AFFINE_ANIM, + MOVEMENT_ACTION_UNKNOWN1, + MOVEMENT_ACTION_UNKNOWN2, + MOVEMENT_ACTION_WALK_DOWN_START_AFFINE, + MOVEMENT_ACTION_WALK_DOWN_AFFINE, + MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_UP, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT, + MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, + MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_UP, + MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT, + MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, + MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT, + MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_UP, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT, + MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT, + MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, + MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_UP, + MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, + MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, + MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_UP_LEFT, + MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_UP_RIGHT, + MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_DOWN_LEFT, + MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_DOWN_RIGHT, + MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_LEFT, + MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_RIGHT, + MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_LEFT, + MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_RIGHT, + MOVEMENT_ACTION_STORE_AND_LOCK_ANIM, + MOVEMENT_ACTION_FREE_AND_UNLOCK_ANIM, + MOVEMENT_ACTION_WALK_LEFT_AFFINE, + MOVEMENT_ACTION_WALK_RIGHT_AFFINE, + MOVEMENT_ACTION_LEVITATE, + MOVEMENT_ACTION_STOP_LEVITATE, + MOVEMENT_ACTION_DESTROY_EXTRA_TASK_IF_AT_TOP, + MOVEMENT_ACTION_FIGURE_8, + MOVEMENT_ACTION_FLY_UP, + MOVEMENT_ACTION_FLY_DOWN, +}; + +enum SpinnerRunnerFollowPatterns +{ RUNFOLLOW_ANY, RUNFOLLOW_NORTH_SOUTH, RUNFOLLOW_EAST_WEST, @@ -46,57 +292,49 @@ struct UnkStruct_085094AC { #define GROUND_EFFECT_FLAG_HOT_SPRINGS (1 << 18) #define GROUND_EFFECT_FLAG_SEAWEED (1 << 19) -#define null_object_step(name, retval) \ -bool8 EventObjectCB2_##name(struct EventObject *, struct Sprite *);\ -void EventObjectCB_##name(struct Sprite *sprite)\ +#define movement_type_def(setup, table) \ +static u8 setup##_callback(struct EventObject *, struct Sprite *);\ +void setup(struct Sprite *sprite)\ {\ - EventObjectStep(&gEventObjects[sprite->data[0]], sprite, EventObjectCB2_##name);\ + UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, setup##_callback);\ }\ -bool8 EventObjectCB2_##name(struct EventObject *eventObject, struct Sprite *sprite)\ +static u8 setup##_callback(struct EventObject *eventObject, struct Sprite *sprite)\ {\ - return (retval);\ + return table[sprite->data[1]](eventObject, sprite);\ } -#define field_object_step(name, table) \ -extern bool8 (*const (table)[])(struct EventObject *, struct Sprite *);\ -bool8 EventObjectCB2_##name(struct EventObject *, struct Sprite *);\ -void EventObjectCB_##name(struct Sprite *sprite)\ +#define movement_type_empty_callback(setup) \ +static u8 setup##_callback(struct EventObject *, struct Sprite *);\ +void setup(struct Sprite *sprite)\ {\ - EventObjectStep(&gEventObjects[sprite->data[0]], sprite, EventObjectCB2_##name);\ + UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, setup##_callback);\ }\ -bool8 EventObjectCB2_##name(struct EventObject *eventObject, struct Sprite *sprite)\ +static u8 setup##_callback(struct EventObject *eventObject, struct Sprite *sprite)\ {\ - return (table)[sprite->data[1]](eventObject, sprite);\ + return 0;\ } -#define field_object_path(idx, table, sub, path, catch, coord)\ -field_object_step(GoInDirectionSequence##idx, table)\ -extern const u8 path[4];\ -bool8 sub(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - u8 route[sizeof(path)];\ - memcpy(route, path, sizeof(path));\ - if (eventObject->directionSequenceIndex == (catch) && eventObject->initialCoords.coord == eventObject->currentCoords.coord)\ - {\ - eventObject->directionSequenceIndex = (catch) + 1;\ - }\ - return MoveEventObjectInNextDirectionInSequence(eventObject, sprite, route);\ -}\ - -struct PairedPalettes { +struct PairedPalettes +{ u16 tag; const u16 *data; }; +struct LockedAnimEventObjects +{ + u8 eventObjectIds[NUM_EVENT_OBJECTS]; + u8 count; +}; + extern const struct SpriteFrameImage gEventObjectPicTable_PechaBerryTree[]; void sub_808D438(void); -u8 get_go_image_anim_num(u8); +u8 GetMoveDirectionAnimNum(u8); u8 GetEventObjectIdByLocalIdAndMap(u8, u8, u8); bool8 TryGetEventObjectIdByLocalIdAndMap(u8, u8, u8, u8 *); u8 GetEventObjectIdByXY(s16, s16); -void EventObjectSetDirection(struct EventObject *, u8); -u8 sub_808D4F4(void); +void SetEventObjectDirection(struct EventObject *, u8); +u8 GetFirstInactiveEventObjectId(void); void RemoveEventObjectByLocalIdAndMap(u8, u8, u8); void npc_load_two_palettes__no_record(u16, u8); void npc_load_two_palettes__and_record(u16, u8); @@ -105,11 +343,11 @@ void pal_patch_for_npc(u16, u8); void sub_808E16C(s16, s16); void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat); void sub_8092FF0(s16, s16, s16 *, s16 *); -u8 EventObjectDirectionToImageAnimId(u8); +u8 GetFaceDirectionAnimNum(u8); void sub_80930E0(s16 *, s16 *, s16, s16); -void EventObjectClearAnim(struct EventObject *); -void EventObjectClearAnimIfSpecialAnimActive(struct EventObject *); -void SpawnEventObjectsInView(s16, s16); +void EventObjectClearHeldMovement(struct EventObject *); +void EventObjectClearHeldMovementIfActive(struct EventObject *); +void TrySpawnEventObjects(s16, s16); u8 sprite_new(u8, u8, s16, s16, u8, u8); u8 AddPseudoEventObject(u16, void (*)(struct Sprite *), s16, s16, u8); u8 show_sprite(u8, u8, u8); @@ -128,50 +366,50 @@ void sub_808E7E4(u8, u8, u8); void sub_808E78C(u8, u8, u8, u8); void sub_808E75C(s16, s16); void EventObjectGetLocalIdAndMap(struct EventObject *eventObject, void *localId, void *mapNum, void *mapGroup); -void npc_coords_shift(struct EventObject *, s16, s16); +void ShiftEventObjectCoords(struct EventObject *, s16, s16); void sub_808EB08(struct EventObject *, s16, s16); void sub_808F254(u8, u8, u8); -void EventObjectStep(struct EventObject *, struct Sprite *, bool8(struct EventObject *, struct Sprite *)); +void UpdateEventObjectCurrentMovement(struct EventObject *, struct Sprite *, bool8(struct EventObject *, struct Sprite *)); u8 EventObjectFaceOppositeDirection(struct EventObject *, u8); u8 GetOppositeDirection(u8); -u8 GetStepInPlaceDelay4AnimId(u32); -u8 GetStepInPlaceDelay8AnimId(u32); -u8 GetStepInPlaceDelay16AnimId(u32); -u8 GetStepInPlaceDelay32AnimId(u32); -u8 npc_block_way(struct EventObject *, s16, s16, u32); +u8 GetWalkInPlaceFastestMovementAction(u32); +u8 GetWalkInPlaceFastMovementAction(u32); +u8 GetWalkInPlaceNormalMovementAction(u32); +u8 GetWalkInPlaceSlowMovementAction(u32); +u8 GetCollisionAtCoords(struct EventObject *, s16, s16, u32); void MoveCoords(u8, s16 *, s16 *); -bool8 EventObjectIsSpecialAnimActive(struct EventObject *); -u8 EventObjectClearAnimIfSpecialAnimFinished(struct EventObject *); +bool8 EventObjectIsHeldMovementActive(struct EventObject *); +u8 EventObjectClearHeldMovementIfFinished(struct EventObject *); u8 GetEventObjectIdByXYZ(u16 x, u16 y, u8 z); -void npc_set_running_behaviour_etc(struct EventObject *eventObject, u8 movementType); -u8 npc_running_behaviour_by_direction(u8 direction); +void SetTrainerMovementType(struct EventObject *eventObject, u8 movementType); +u8 GetTrainerFacingDirectionMovementType(u8 direction); const u8 *GetEventObjectScriptPointerByEventObjectId(u8 eventObjectId); -u8 sub_8092C8C(struct EventObject *eventObject, s16 x, s16 y, u8 direction); -u8 GetFaceDirectionAnimId(u32); -u8 GetGoSpeed0AnimId(u32); -u8 GetGoSpeed1AnimId(u32); -u8 GetGoSpeed3AnimId(u32); -u8 sub_80934BC(u32); -bool8 EventObjectSetSpecialAnim(struct EventObject *eventObject, u8 specialAnimId); -bool8 EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(struct EventObject *eventObject); -u8 EventObjectCheckIfSpecialAnimFinishedOrInactive(struct EventObject *eventObject); -void sub_808F23C(const struct EventObject *eventObject, u8 movementType); -void sub_808F208(const struct EventObject *eventObject); -void npc_coords_shift_still(struct EventObject *pObject); +u8 GetCollisionFlagsAtCoords(struct EventObject *eventObject, s16 x, s16 y, u8 direction); +u8 GetFaceDirectionMovementAction(u32); +u8 GetWalkNormalMovementAction(u32); +u8 GetWalkFastMovementAction(u32); +u8 GetWalkFastestMovementAction(u32); +u8 GetJumpInPlaceMovementAction(u32); +bool8 EventObjectSetHeldMovement(struct EventObject *eventObject, u8 specialAnimId); +bool8 EventObjectIsMovementOverridden(struct EventObject *eventObject); +u8 EventObjectCheckHeldMovementStatus(struct EventObject *eventObject); +void TryOverrideTemplateCoordsForEventObject(const struct EventObject *eventObject, u8 movementType); +void OverrideTemplateCoordsForEventObject(const struct EventObject *eventObject); +void ShiftStillEventObjectCoords(struct EventObject *pObject); void EventObjectMoveDestCoords(struct EventObject *pObject, u32 unk_19, s16 *pInt, s16 *pInt1); u8 AddCameraObject(u8 linkedSpriteId); void UpdateEventObjectsForCameraUpdate(s16 x, s16 y); -u8 GetSimpleGoAnimId(u32); -u8 sub_8093514(u32); +u8 GetWalkSlowMovementAction(u32); +u8 GetJumpMovementAction(u32); bool8 AreZCoordsCompatible(u8, u8); u8 ZCoordToPriority(u8); void EventObjectUpdateZCoord(struct EventObject *pObject); void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8); bool8 IsZCoordMismatchAt(u8, s16, s16); -void sub_8097AC8(struct Sprite *); -void npc_sync_anim_pause_bits(struct EventObject *); +void UpdateEventObjectSpriteSubpriorityAndVisibility(struct Sprite *); +void UnfreezeEventObject(struct EventObject *); void oamt_npc_ministep_reset(struct Sprite *, u8, u8); -u8 sub_8097F78(struct EventObject *); +u8 FindLockedEventObjectIndex(struct EventObject *); bool8 obj_npc_ministep(struct Sprite *sprite); bool8 sub_80976EC(struct Sprite *sprite); void sub_80976DC(struct Sprite *, u8); @@ -179,262 +417,236 @@ void sub_809783C(struct Sprite *, u8, u8, u8); void DoShadowFieldEffect(struct EventObject *); u8 sub_809785C(struct Sprite *); u8 sub_80978E4(struct Sprite *); -void obj_anim_image_set_and_seek(struct Sprite *, u8, u8); -bool8 sub_80979BC(struct Sprite *); +void SetAndStartSpriteAnim(struct Sprite *, u8, u8); +bool8 SpriteAnimEnded(struct Sprite *); void sub_8097750(struct Sprite *); bool8 sub_8097758(struct Sprite *); -void sub_8097FA4(struct EventObject *); -void sub_8098044(u8); +void CreateLevitateMovementTask(struct EventObject *); +void DestroyExtraMovementTask(u8); void UnfreezeEventObjects(void); void FreezeEventObjectsExceptOne(u8 eventObjectId); void sub_8097B78(u8, u8); void sub_8098074(u8 var1, u8 var2); void FreezeEventObjects(void); bool8 FreezeEventObject(struct EventObject *eventObject); -u8 get_go_fast_image_anim_num(u8); -u8 get_go_faster_image_anim_num(u8); -u8 get_go_fastest_image_anim_num(u8); +u8 GetMoveDirectionFastAnimNum(u8); +u8 GetMoveDirectionFasterAnimNum(u8); +u8 GetMoveDirectionFastestAnimNum(u8); -void EventObjectCB_NoMovement1(struct Sprite *); -void EventObjectCB_LookRandomDirections(struct Sprite *); -void EventObjectCB_GoRandomDirections(struct Sprite *); -void EventObjectCB_RandomlyGoNorthOrSouth(struct Sprite *); -void EventObjectCB_RandomlyGoNorthOrSouth(struct Sprite *); -void EventObjectCB_RandomlyGoEastOrWest(struct Sprite *); -void EventObjectCB_RandomlyGoEastOrWest(struct Sprite *); -void EventObjectCB_FaceFixedDirection(struct Sprite *); -void EventObjectCB_FaceFixedDirection(struct Sprite *); -void EventObjectCB_FaceFixedDirection(struct Sprite *); -void EventObjectCB_FaceFixedDirection(struct Sprite *); -void EventObjectCB_NoMovement2(struct Sprite *); -void EventObjectCB_BerryTree(struct Sprite *); -void EventObjectCB_RandomlyLookNorthOrSouth(struct Sprite *); -void EventObjectCB_RandomlyLookEastOrWest(struct Sprite *); -void EventObjectCB_RandomlyLookNorthOrWest(struct Sprite *); -void EventObjectCB_RandomlyLookNorthOrEast(struct Sprite *); -void EventObjectCB_RandomlyLookSouthOrWest(struct Sprite *); -void EventObjectCB_RandomlyLookSouthOrEast(struct Sprite *); -void EventObjectCB_RandomlyLookNorthOrSouthOrWest(struct Sprite *); -void EventObjectCB_RandomlyLookNorthOrSouthOrEast(struct Sprite *); -void EventObjectCB_RandomlyLookNorthOrEastOrWest(struct Sprite *); -void EventObjectCB_RandomlyLookSouthOrEastOrWest(struct Sprite *); -void EventObjectCB_LookAroundCounterclockwise(struct Sprite *); -void EventObjectCB_LookAroundClockwise(struct Sprite *); -void EventObjectCB_AlternatelyGoInOppositeDirections(struct Sprite *); -void EventObjectCB_AlternatelyGoInOppositeDirections(struct Sprite *); -void EventObjectCB_AlternatelyGoInOppositeDirections(struct Sprite *); -void EventObjectCB_AlternatelyGoInOppositeDirections(struct Sprite *); -void EventObjectCB_GoInDirectionSequence1(struct Sprite *); -void EventObjectCB_GoInDirectionSequence2(struct Sprite *); -void EventObjectCB_GoInDirectionSequence3(struct Sprite *); -void EventObjectCB_GoInDirectionSequence4(struct Sprite *); -void EventObjectCB_GoInDirectionSequence5(struct Sprite *); -void EventObjectCB_GoInDirectionSequence6(struct Sprite *); -void EventObjectCB_GoInDirectionSequence7(struct Sprite *); -void EventObjectCB_GoInDirectionSequence8(struct Sprite *); -void EventObjectCB_GoInDirectionSequence9(struct Sprite *); -void EventObjectCB_GoInDirectionSequence10(struct Sprite *); -void EventObjectCB_GoInDirectionSequence11(struct Sprite *); -void EventObjectCB_GoInDirectionSequence12(struct Sprite *); -void EventObjectCB_GoInDirectionSequence13(struct Sprite *); -void EventObjectCB_GoInDirectionSequence14(struct Sprite *); -void EventObjectCB_GoInDirectionSequence15(struct Sprite *); -void EventObjectCB_GoInDirectionSequence16(struct Sprite *); -void EventObjectCB_GoInDirectionSequence17(struct Sprite *); -void EventObjectCB_GoInDirectionSequence18(struct Sprite *); -void EventObjectCB_GoInDirectionSequence19(struct Sprite *); -void EventObjectCB_GoInDirectionSequence20(struct Sprite *); -void EventObjectCB_GoInDirectionSequence21(struct Sprite *); -void EventObjectCB_GoInDirectionSequence22(struct Sprite *); -void EventObjectCB_GoInDirectionSequence23(struct Sprite *); -void EventObjectCB_GoInDirectionSequence24(struct Sprite *); -void EventObjectCB_CopyPlayer1(struct Sprite *); -void EventObjectCB_CopyPlayer1(struct Sprite *); -void EventObjectCB_CopyPlayer1(struct Sprite *); -void EventObjectCB_CopyPlayer1(struct Sprite *); -void EventObjectCB_TreeDisguise(struct Sprite *); -void EventObjectCB_MountainDisguise(struct Sprite *); -void EventObjectCB_CopyPlayer2(struct Sprite *); -void EventObjectCB_CopyPlayer2(struct Sprite *); -void EventObjectCB_CopyPlayer2(struct Sprite *); -void EventObjectCB_CopyPlayer2(struct Sprite *); -void EventObjectCB_Hidden1(struct Sprite *); -void EventObjectCB_WalkInPlace1(struct Sprite *); -void EventObjectCB_WalkInPlace1(struct Sprite *); -void EventObjectCB_WalkInPlace1(struct Sprite *); -void EventObjectCB_WalkInPlace1(struct Sprite *); -void EventObjectCB_WalkInPlace2(struct Sprite *); -void EventObjectCB_WalkInPlace2(struct Sprite *); -void EventObjectCB_WalkInPlace2(struct Sprite *); -void EventObjectCB_WalkInPlace2(struct Sprite *); -void EventObjectCB_WalkInPlace3(struct Sprite *); -void EventObjectCB_WalkInPlace3(struct Sprite *); -void EventObjectCB_WalkInPlace3(struct Sprite *); -void EventObjectCB_WalkInPlace3(struct Sprite *); -void EventObjectCB_Hidden2(struct Sprite *); -void EventObjectCB_WalkInPlace4(struct Sprite *); -void EventObjectCB_WalkInPlace4(struct Sprite *); -void EventObjectCB_WalkInPlace4(struct Sprite *); -void EventObjectCB_WalkInPlace4(struct Sprite *); +void MovementType_None(struct Sprite *); +void MovementType_LookAround(struct Sprite *); +void MovementType_WanderAround(struct Sprite *); +void MovementType_WanderUpAndDown(struct Sprite *); +void MovementType_WanderLeftAndRight(struct Sprite *); +void MovementType_FaceDirection(struct Sprite *); +void MovementType_Player(struct Sprite *); +void MovementType_BerryTreeGrowth(struct Sprite *); +void MovementType_FaceDownAndUp(struct Sprite *); +void MovementType_FaceLeftAndRight(struct Sprite *); +void MovementType_FaceUpAndLeft(struct Sprite *); +void MovementType_FaceUpAndRight(struct Sprite *); +void MovementType_FaceDownAndLeft(struct Sprite *); +void MovementType_FaceDownAndRight(struct Sprite *); +void MovementType_FaceDownUpAndLeft(struct Sprite *); +void MovementType_FaceDownUpAndRight(struct Sprite *); +void MovementType_FaceUpRightAndLeft(struct Sprite *); +void MovementType_FaceDownRightAndLeft(struct Sprite *); +void MovementType_RotateCounterclockwise(struct Sprite *); +void MovementType_RotateClockwise(struct Sprite *); +void MovementType_WalkBackAndForth(struct Sprite *); +void MovementType_WalkSequenceUpRightLeftDown(struct Sprite *); +void MovementType_WalkSequenceRightLeftDownUp(struct Sprite *); +void MovementType_WalkSequenceDownUpRightLeft(struct Sprite *); +void MovementType_WalkSequenceLeftDownUpRight(struct Sprite *); +void MovementType_WalkSequenceUpLeftRightDown(struct Sprite *); +void MovementType_WalkSequenceLeftRightDownUp(struct Sprite *); +void MovementType_WalkSequenceDownUpLeftRight(struct Sprite *); +void MovementType_WalkSequenceRightDownUpLeft(struct Sprite *); +void MovementType_WalkSequenceLeftUpDownRight(struct Sprite *); +void MovementType_WalkSequenceUpDownRightLeft(struct Sprite *); +void MovementType_WalkSequenceRightLeftUpDown(struct Sprite *); +void MovementType_WalkSequenceDownRightLeftUp(struct Sprite *); +void MovementType_WalkSequenceRightUpDownLeft(struct Sprite *); +void MovementType_WalkSequenceUpDownLeftRight(struct Sprite *); +void MovementType_WalkSequenceLeftRightUpDown(struct Sprite *); +void MovementType_WalkSequenceDownLeftRightUp(struct Sprite *); +void MovementType_WalkSequenceUpLeftDownRight(struct Sprite *); +void MovementType_WalkSequenceDownRightUpLeft(struct Sprite *); +void MovementType_WalkSequenceLeftDownRightUp(struct Sprite *); +void MovementType_WalkSequenceRightUpLeftDown(struct Sprite *); +void MovementType_WalkSequenceUpRightDownLeft(struct Sprite *); +void MovementType_WalkSequenceDownLeftUpRight(struct Sprite *); +void MovementType_WalkSequenceLeftUpRightDown(struct Sprite *); +void MovementType_WalkSequenceRightDownLeftUp(struct Sprite *); +void MovementType_CopyPlayer(struct Sprite *); +void MovementType_TreeDisguise(struct Sprite *); +void MovementType_MountainDisguise(struct Sprite *); +void MovementType_CopyPlayerInGrass(struct Sprite *); +void MovementType_Hidden(struct Sprite *); +void MovementType_WalkInPlace(struct Sprite *); +void MovementType_JogInPlace(struct Sprite *); +void MovementType_RunInPlace(struct Sprite *); +void MovementType_Invisible(struct Sprite *); +void MovementType_WalkSlowlyInPlace(struct Sprite *); +u8 GetSlideMovementAction(u32); +u8 GetJumpInPlaceMovementAction(u32); +u8 GetJumpMovementAction(u32); +u8 GetJump2MovementAction(u32); -u8 sub_808F44C(struct EventObject *, struct Sprite *); -u8 sub_808F460(struct EventObject *, struct Sprite *); -u8 sub_808F48C(struct EventObject *, struct Sprite *); -u8 sub_808F4C8(struct EventObject *, struct Sprite *); -u8 sub_808F4E8(struct EventObject *, struct Sprite *); -u8 sub_808F534(struct EventObject *, struct Sprite *); -u8 sub_808F564(struct EventObject *, struct Sprite *); -u8 GetRegularRunningPastFacingDirection(s16, s16, s16, s16); -u8 GetNorthSouthRunningPastFacingDirection(s16, s16, s16, s16); -u8 GetEastWestRunningPastFacingDirection(s16, s16, s16, s16); -u8 GetNorthEastRunningPastFacingDirection(s16, s16, s16, s16); -u8 GetNorthWestRunningPastFacingDirection(s16, s16, s16, s16); -u8 GetSouthEastRunningPastFacingDirection(s16, s16, s16, s16); -u8 GetSouthWestRunningPastFacingDirection(s16, s16, s16, s16); -u8 GetNonEastRunningPastFacingDirection(s16, s16, s16, s16); -u8 GetNonWestRunningPastFacingDirection(s16, s16, s16, s16); -u8 GetNonSouthRunningPastFacingDirection(s16, s16, s16, s16); -u8 GetNonNorthRunningPastFacingDirection(s16, s16, s16, s16); -u8 sub_808F988(struct EventObject *, struct Sprite *); -u8 sub_808F99C(struct EventObject *, struct Sprite *); -u8 sub_808F9C8(struct EventObject *, struct Sprite *); -u8 sub_808FA0C(struct EventObject *, struct Sprite *); -u8 sub_808FA3C(struct EventObject *, struct Sprite *); -u8 sub_808FAC8(struct EventObject *, struct Sprite *); -u8 sub_808FADC(struct EventObject *, struct Sprite *); -u8 sub_808FB08(struct EventObject *, struct Sprite *); -u8 sub_808FB44(struct EventObject *, struct Sprite *); -u8 sub_808FB64(struct EventObject *, struct Sprite *); -u8 sub_808FBB0(struct EventObject *, struct Sprite *); -u8 sub_808FBE0(struct EventObject *, struct Sprite *); -u8 sub_808FC4C(struct EventObject *, struct Sprite *); -u8 sub_808FC60(struct EventObject *, struct Sprite *); -u8 sub_808FC8C(struct EventObject *, struct Sprite *); -u8 sub_808FCC8(struct EventObject *, struct Sprite *); -u8 sub_808FCE8(struct EventObject *, struct Sprite *); -u8 sub_808FD34(struct EventObject *, struct Sprite *); -u8 sub_808FD64(struct EventObject *, struct Sprite *); -u8 sub_808FDD0(struct EventObject *, struct Sprite *); -u8 sub_808FDFC(struct EventObject *, struct Sprite *); -u8 sub_808FE1C(struct EventObject *, struct Sprite *); -u8 do_berry_tree_growth_sparkle_1(struct EventObject *, struct Sprite *); -u8 sub_808FF48(struct EventObject *, struct Sprite *); -u8 do_berry_tree_growth_sparkle_2(struct EventObject *, struct Sprite *); -u8 sub_808FFB4(struct EventObject *, struct Sprite *); -u8 sub_8090004(struct EventObject *, struct Sprite *); -u8 sub_8090094(struct EventObject *, struct Sprite *); -u8 sub_80900A8(struct EventObject *, struct Sprite *); -u8 sub_80900D4(struct EventObject *, struct Sprite *); -u8 sub_8090118(struct EventObject *, struct Sprite *); -u8 sub_8090148(struct EventObject *, struct Sprite *); -u8 sub_80901D4(struct EventObject *, struct Sprite *); -u8 sub_80901E8(struct EventObject *, struct Sprite *); -u8 sub_8090214(struct EventObject *, struct Sprite *); -u8 sub_8090258(struct EventObject *, struct Sprite *); -u8 sub_8090288(struct EventObject *, struct Sprite *); -u8 sub_8090314(struct EventObject *, struct Sprite *); -u8 sub_8090328(struct EventObject *, struct Sprite *); -u8 sub_8090354(struct EventObject *, struct Sprite *); -u8 sub_8090398(struct EventObject *, struct Sprite *); -u8 sub_80903C8(struct EventObject *, struct Sprite *); -u8 sub_8090454(struct EventObject *, struct Sprite *); -u8 sub_8090468(struct EventObject *, struct Sprite *); -u8 sub_8090494(struct EventObject *, struct Sprite *); -u8 sub_80904D8(struct EventObject *, struct Sprite *); -u8 sub_8090508(struct EventObject *, struct Sprite *); -u8 sub_8090594(struct EventObject *, struct Sprite *); -u8 sub_80905A8(struct EventObject *, struct Sprite *); -u8 sub_80905D4(struct EventObject *, struct Sprite *); -u8 sub_8090618(struct EventObject *, struct Sprite *); -u8 sub_8090648(struct EventObject *, struct Sprite *); -u8 sub_80906D4(struct EventObject *, struct Sprite *); -u8 sub_80906E8(struct EventObject *, struct Sprite *); -u8 sub_8090714(struct EventObject *, struct Sprite *); -u8 sub_8090758(struct EventObject *, struct Sprite *); -u8 sub_8090788(struct EventObject *, struct Sprite *); -u8 sub_8090814(struct EventObject *, struct Sprite *); -u8 sub_8090828(struct EventObject *, struct Sprite *); -u8 sub_8090854(struct EventObject *, struct Sprite *); -u8 sub_8090898(struct EventObject *, struct Sprite *); -u8 sub_80908C8(struct EventObject *, struct Sprite *); -u8 sub_8090954(struct EventObject *, struct Sprite *); -u8 sub_8090968(struct EventObject *, struct Sprite *); -u8 sub_8090994(struct EventObject *, struct Sprite *); -u8 sub_80909D8(struct EventObject *, struct Sprite *); -u8 sub_8090A08(struct EventObject *, struct Sprite *); -u8 sub_8090A94(struct EventObject *, struct Sprite *); -u8 sub_8090AA8(struct EventObject *, struct Sprite *); -u8 sub_8090AD4(struct EventObject *, struct Sprite *); -u8 sub_8090B18(struct EventObject *, struct Sprite *); -u8 sub_8090B48(struct EventObject *, struct Sprite *); -u8 sub_8090BD4(struct EventObject *, struct Sprite *); -u8 sub_8090BE8(struct EventObject *, struct Sprite *); -u8 sub_8090C14(struct EventObject *, struct Sprite *); -u8 sub_8090C58(struct EventObject *, struct Sprite *); -u8 sub_8090C88(struct EventObject *, struct Sprite *); -u8 sub_8090D14(struct EventObject *, struct Sprite *); -u8 sub_8090D40(struct EventObject *, struct Sprite *); -u8 sub_8090D64(struct EventObject *, struct Sprite *); -u8 sub_8090D90(struct EventObject *, struct Sprite *); -u8 sub_8090E18(struct EventObject *, struct Sprite *); -u8 sub_8090E44(struct EventObject *, struct Sprite *); -u8 sub_8090E68(struct EventObject *, struct Sprite *); -u8 sub_8090E94(struct EventObject *, struct Sprite *); -u8 sub_8090F1C(struct EventObject *, struct Sprite *); -u8 sub_8090F30(struct EventObject *, struct Sprite *); -u8 sub_8090F68(struct EventObject *, struct Sprite *); -u8 sub_8091020(struct EventObject *, struct Sprite *); -u8 sub_8091048(struct EventObject *, struct Sprite *); -u8 sub_809117C(struct EventObject *, struct Sprite *); -u8 sub_8091110(struct EventObject *, struct Sprite *); -u8 sub_8091208(struct EventObject *, struct Sprite *); -u8 sub_8091294(struct EventObject *, struct Sprite *); -u8 sub_8091320(struct EventObject *, struct Sprite *); -u8 sub_80913AC(struct EventObject *, struct Sprite *); -u8 sub_8091438(struct EventObject *, struct Sprite *); -u8 sub_80914C4(struct EventObject *, struct Sprite *); -u8 sub_8091550(struct EventObject *, struct Sprite *); -u8 sub_80915DC(struct EventObject *, struct Sprite *); -u8 sub_8091668(struct EventObject *, struct Sprite *); -u8 sub_80916F4(struct EventObject *, struct Sprite *); -u8 sub_8091780(struct EventObject *, struct Sprite *); -u8 sub_809180C(struct EventObject *, struct Sprite *); -u8 sub_8091898(struct EventObject *, struct Sprite *); -u8 sub_8091924(struct EventObject *, struct Sprite *); -u8 sub_80919B0(struct EventObject *, struct Sprite *); -u8 sub_8091A3C(struct EventObject *, struct Sprite *); -u8 sub_8091AC8(struct EventObject *, struct Sprite *); -u8 sub_8091B54(struct EventObject *, struct Sprite *); -u8 sub_8091BE0(struct EventObject *, struct Sprite *); -u8 sub_8091C6C(struct EventObject *, struct Sprite *); -u8 sub_8091CF8(struct EventObject *, struct Sprite *); -u8 sub_8091D84(struct EventObject *, struct Sprite *); -u8 sub_8091E10(struct EventObject *, struct Sprite *); -u8 mss_npc_reset_oampriv3_1_unk2_unk3(struct EventObject *, struct Sprite *); -u8 sub_8091EC0(struct EventObject *, struct Sprite *); -u8 sub_8091F20(struct EventObject *, struct Sprite *); -bool8 sub_8091F48(struct EventObject *, struct Sprite *, u8, bool8(u8)); -bool8 sub_8091F4C(struct EventObject *, struct Sprite *, u8, bool8(u8)); -bool8 sub_8091F94(struct EventObject *, struct Sprite *, u8, bool8(u8)); -bool8 sub_80920A4(struct EventObject *, struct Sprite *, u8, bool8(u8)); -bool8 sub_809215C(struct EventObject *, struct Sprite *, u8, bool8(u8)); -bool8 sub_8092214(struct EventObject *, struct Sprite *, u8, bool8(u8)); +u8 MovementType_WanderAround_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_WanderAround_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WanderAround_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_WanderAround_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_WanderAround_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_WanderAround_Step5(struct EventObject *, struct Sprite *); +u8 MovementType_WanderAround_Step6(struct EventObject *, struct Sprite *); +u8 GetVectorDirection(s16, s16, s16, s16); +u8 GetLimitedVectorDirection_SouthNorth(s16, s16, s16, s16); +u8 GetLimitedVectorDirection_WestEast(s16, s16, s16, s16); +u8 GetLimitedVectorDirection_WestNorth(s16, s16, s16, s16); +u8 GetLimitedVectorDirection_EastNorth(s16, s16, s16, s16); +u8 GetLimitedVectorDirection_WestSouth(s16, s16, s16, s16); +u8 GetLimitedVectorDirection_EastSouth(s16, s16, s16, s16); +u8 GetLimitedVectorDirection_SouthNorthWest(s16, s16, s16, s16); +u8 GetLimitedVectorDirection_SouthNorthEast(s16, s16, s16, s16); +u8 GetLimitedVectorDirection_NorthWestEast(s16, s16, s16, s16); +u8 GetLimitedVectorDirection_SouthWestEast(s16, s16, s16, s16); +u8 MovementType_LookAround_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_LookAround_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_LookAround_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_LookAround_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_LookAround_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_WanderUpAndDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_WanderUpAndDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WanderUpAndDown_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_WanderUpAndDown_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_WanderUpAndDown_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_WanderUpAndDown_Step5(struct EventObject *, struct Sprite *); +u8 MovementType_WanderUpAndDown_Step6(struct EventObject *, struct Sprite *); +u8 MovementType_WanderLeftAndRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_WanderLeftAndRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WanderLeftAndRight_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_WanderLeftAndRight_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_WanderLeftAndRight_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_WanderLeftAndRight_Step5(struct EventObject *, struct Sprite *); +u8 MovementType_WanderLeftAndRight_Step6(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDirection_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDirection_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDirection_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_BerryTreeGrowth_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_BerryTreeGrowth_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_BerryTreeGrowth_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_BerryTreeGrowth_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_BerryTreeGrowth_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndUp_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndUp_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndUp_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_FaceLeftAndRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceLeftAndRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceLeftAndRight_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_FaceLeftAndRight_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_FaceLeftAndRight_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpAndLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpAndLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpAndLeft_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpAndLeft_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpAndLeft_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpAndRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpAndRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpAndRight_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpAndRight_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpAndRight_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndLeft_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndLeft_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndLeft_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndRight_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndRight_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownAndRight_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownUpAndLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownUpAndLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownUpAndLeft_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownUpAndLeft_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownUpAndLeft_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownUpAndRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownUpAndRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownUpAndRight_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownUpAndRight_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownUpAndRight_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpLeftAndRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpLeftAndRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpLeftAndRight_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpLeftAndRight_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_FaceUpLeftAndRight_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownLeftAndRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownLeftAndRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownLeftAndRight_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownLeftAndRight_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_FaceDownLeftAndRight_Step4(struct EventObject *, struct Sprite *); +u8 MovementType_RotateCounterclockwise_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_RotateCounterclockwise_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_RotateCounterclockwise_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_RotateCounterclockwise_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_RotateClockwise_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_RotateClockwise_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_RotateClockwise_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_RotateClockwise_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_WalkBackAndForth_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_WalkBackAndForth_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkBackAndForth_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_WalkBackAndForth_Step3(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequence_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequence_Step2(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceUpRightLeftDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceRightLeftDownUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceDownUpRightLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceLeftDownUpRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceUpLeftRightDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceLeftRightDownUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceDownUpLeftRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceRightDownUpLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceLeftUpDownRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceUpDownRightLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceRightLeftUpDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceDownRightLeftUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceRightUpDownLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceUpDownLeftRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceLeftRightUpDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceDownLeftRightUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceUpLeftDownRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceDownRightUpLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceLeftDownRightUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceRightUpLeftDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceUpRightDownLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceDownLeftUpRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceLeftUpRightDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSequenceRightDownLeftUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_CopyPlayer_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_CopyPlayer_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_CopyPlayer_Step2(struct EventObject *, struct Sprite *); +bool8 CopyablePlayerMovement_None(struct EventObject *, struct Sprite *, u8, bool8(u8)); +bool8 CopyablePlayerMovement_FaceDirection(struct EventObject *, struct Sprite *, u8, bool8(u8)); +bool8 CopyablePlayerMovement_GoSpeed0(struct EventObject *, struct Sprite *, u8, bool8(u8)); +bool8 CopyablePlayerMovement_GoSpeed1(struct EventObject *, struct Sprite *, u8, bool8(u8)); +bool8 CopyablePlayerMovement_GoSpeed2(struct EventObject *, struct Sprite *, u8, bool8(u8)); +bool8 CopyablePlayerMovement_Slide(struct EventObject *, struct Sprite *, u8, bool8(u8)); bool8 cph_IM_DIFFERENT(struct EventObject *, struct Sprite *, u8, bool8(u8)); -bool8 sub_8092314(struct EventObject *, struct Sprite *, u8, bool8(u8)); -bool8 oac_hopping(struct EventObject *, struct Sprite *, u8, bool8(u8)); -u8 mss_08062EA4(struct EventObject *, struct Sprite *); -u8 sub_80926AC(struct EventObject *, struct Sprite *); -u8 sub_8092718(struct EventObject *, struct Sprite *); -u8 sub_80926B8(struct EventObject *, struct Sprite *); -u8 sub_8092788(struct EventObject *, struct Sprite *); -u8 sub_80927F8(struct EventObject *, struct Sprite *); -u8 sub_8092868(struct EventObject *, struct Sprite *); -u8 sub_80928D8(struct EventObject *, struct Sprite *); -u8 sub_809290C(struct EventObject *, struct Sprite *); -u8 sub_809292C(struct EventObject *, struct Sprite *); - -// Exported data declarations - -extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; +bool8 CopyablePlayerMovement_GoSpeed4(struct EventObject *, struct Sprite *, u8, bool8(u8)); +bool8 CopyablePlayerMovement_Jump(struct EventObject *, struct Sprite *, u8, bool8(u8)); +u8 MovementType_CopyPlayerInGrass_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_Hidden_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_WalkInPlace_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_MoveInPlace_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_WalkSlowlyInPlace_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_JogInPlace_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_RunInPlace_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_Invisible_Step0(struct EventObject *, struct Sprite *); +u8 MovementType_Invisible_Step1(struct EventObject *, struct Sprite *); +u8 MovementType_Invisible_Step2(struct EventObject *, struct Sprite *); #endif //GUARD_FIELD_EVENT_OBJ_H diff --git a/include/field_effect.h b/include/field_effect.h index 5e7cec4cb..800048605 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -11,7 +11,7 @@ extern const struct OamData gNewGameBirchOamAttributes; enum FieldEffectScriptIdx { - FLDEFF_EXCLAMATION_MARK_ICON_1, + FLDEFF_EXCLAMATION_MARK_ICON, FLDEFF_USE_CUT_ON_GRASS, FLDEFF_USE_CUT_ON_TREE, FLDEFF_SHADOW, @@ -44,7 +44,7 @@ enum FieldEffectScriptIdx FLDEFF_NPCFLY_OUT, FLDEFF_USE_FLY, FLDEFF_FLY_IN, - FLDEFF_EXCLAMATION_MARK_ICON_2, + FLDEFF_QUESTION_MARK_ICON, FLDEFF_FEET_IN_FLOWING_WATER, FLDEFF_BIKE_TIRE_TRACKS, FLDEFF_SAND_DISGUISE, diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 970f47d5f..8cd6c275b 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -8,9 +8,9 @@ u8 GetPlayerAvatarGenderByGraphicsId(u8); bool8 TestPlayerAvatarFlags(u8); u8 GetPlayerAvatarObjectId(void); void PlayerGetDestCoords(s16 *, s16 *); -u8 player_get_direction_lower_nybble(void); -u8 player_get_direction_upper_nybble(void); -u8 player_get_x22(void); +u8 GetPlayerFacingDirection(void); +u8 GetPlayerMovementDirection(void); +u8 PlayerGetCopyableMovement(void); void PlayerGoSpeed1(u8); void PlayerGoSpeed2(u8); void PlayerGoSpeed3(u8); @@ -43,6 +43,6 @@ void sub_808C114(void); u8 GetPlayerAvatarGraphicsIdByCurrentState(void); void SetPlayerAvatarStateMask(u8 a); u8 GetPlayerAvatarGraphicsIdByStateId(u8 a); -u8 sub_8093540(u32); +u8 GetJumpSpecialMovementAction(u32); #endif // GUARD_FIELD_PLAYER_AVATAR_H diff --git a/include/overworld.h b/include/overworld.h index ace988f4e..a81f10b0d 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -141,6 +141,6 @@ bool32 sub_8087598(void); bool32 sub_80875C8(void); bool32 sub_8087634(void); bool32 sub_808766C(void); -void ZeroAllLinkPlayerEventObjects(void); +void ClearLinkPlayerEventObjects(void); #endif // GUARD_OVERWORLD_H diff --git a/include/trainer_see.h b/include/trainer_see.h index 39f3cd8b0..43f8b82d2 100644 --- a/include/trainer_see.h +++ b/include/trainer_see.h @@ -20,8 +20,8 @@ bool8 CheckForTrainersWantingBattle(void); void sub_80B4578(struct EventObject *var); void EndTrainerApproach(void); void sub_80B45D0(void); -u8 FldEff_ExclamationMarkIcon1(void); -u8 FldEff_ExclamationMarkIcon2(void); +u8 FldEff_ExclamationMarkIcon(void); +u8 FldEff_QuestionMarkIcon(void); u8 FldEff_HeartIcon(void); u8 GetCurrentApproachingTrainerEventObjectId(void); u8 GetChosenApproachingTrainerEventObjectId(u8 arrayId); diff --git a/src/battle_setup.c b/src/battle_setup.c index 2875aaff2..ccc36b7c2 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -1203,7 +1203,7 @@ void sub_80B16D8(void) { struct EventObject *eventObject = &gEventObjects[gSelectedEventObject]; - npc_set_running_behaviour_etc(eventObject, npc_running_behaviour_by_direction(eventObject->facingDirection)); + SetTrainerMovementType(eventObject, GetTrainerFacingDirectionMovementType(eventObject->facingDirection)); } u8 GetTrainerBattleMode(void) diff --git a/src/berry.c b/src/berry.c index 7b83743a7..f8a0204c4 100644 --- a/src/berry.c +++ b/src/berry.c @@ -12,7 +12,7 @@ extern u8 EventObjectGetBerryTreeId(u8 eventObjectId); extern void sub_8092EF0(u8 mapId, u8 mapNumber, u8 mapGroup); extern void CB2_ChooseBerry(void); extern const u8* GetEventObjectScriptPointerForComparison(void); -extern bool8 sub_8092E9C(u8, u8, u8); +extern bool8 IsBerryTreeSparkling(u8, u8, u8); extern u16 gSpecialVar_ItemId; @@ -1166,7 +1166,7 @@ void EventObjectInteractionGetBerryTreeData(void) unk = gSpecialVar_LastTalked; num = gSaveBlock1Ptr->location.mapNum; group = gSaveBlock1Ptr->location.mapGroup; - if (sub_8092E9C(unk, num, group)) + if (IsBerryTreeSparkling(unk, num, group)) gSpecialVar_0x8004 = 0xFF; else gSpecialVar_0x8004 = GetStageByBerryTreeId(id); diff --git a/src/bike.c b/src/bike.c index d44bb1043..87110b87b 100644 --- a/src/bike.c +++ b/src/bike.c @@ -152,7 +152,7 @@ static void MovePlayerOnMachBike(u8 direction, u16 newKeys, u16 heldKeys) static u8 GetMachBikeTransition(u8 *dirTraveling) { // if the dir updated before this function, get the relevent new direction to check later. - u8 direction = player_get_direction_upper_nybble(); + u8 direction = GetPlayerMovementDirection(); // is the player standing still? if (*dirTraveling == 0) @@ -296,7 +296,7 @@ static u8 CheckMovementInputAcroBike(u8 *newDirection, u16 newKeys, u16 heldKeys static u8 AcroBikeHandleInputNormal(u8 *newDirection, u16 newKeys, u16 heldKeys) { - u8 direction = player_get_direction_upper_nybble(); + u8 direction = GetPlayerMovementDirection(); gPlayerAvatar.bikeFrameCounter = 0; if (*newDirection == DIR_NONE) @@ -349,7 +349,7 @@ static u8 AcroBikeHandleInputTurning(u8 *newDirection, u16 newKeys, u16 heldKeys Bike_SetBikeStill(); return ACRO_TRANS_TURN_DIRECTION; } - direction = player_get_direction_upper_nybble(); + direction = GetPlayerMovementDirection(); if (*newDirection == AcroBike_GetJumpDirection()) { Bike_SetBikeStill(); // Bike_SetBikeStill sets speed to standing, but the next line immediately overrides it. could have just reset acroBikeState to 0 here instead of wasting a jump. @@ -378,7 +378,7 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16 u8 direction; struct EventObject *playerEventObj; - direction = player_get_direction_upper_nybble(); + direction = GetPlayerMovementDirection(); playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; gPlayerAvatar.runningState = NOT_MOVING; @@ -425,7 +425,7 @@ static u8 AcroBikeHandleInputBunnyHop(u8 *newDirection, u16 newKeys, u16 heldKey u8 direction; struct EventObject *playerEventObj; - direction = player_get_direction_upper_nybble(); + direction = GetPlayerMovementDirection(); playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; if (!(heldKeys & B_BUTTON)) { @@ -472,7 +472,7 @@ static u8 AcroBikeHandleInputWheelieMoving(u8 *newDirection, u16 newKeys, u16 he u8 direction; struct EventObject *playerEventObj; - direction = player_get_direction_lower_nybble(); + direction = GetPlayerFacingDirection(); playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; if (!(heldKeys & B_BUTTON)) { @@ -527,7 +527,7 @@ static u8 AcroBikeHandleInputSidewaysJump(u8 *ptr, u16 newKeys, u16 heldKeys) struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; playerEventObj->facingDirectionLocked = 0; - EventObjectSetDirection(playerEventObj, playerEventObj->facingDirection); + SetEventObjectDirection(playerEventObj, playerEventObj->facingDirection); gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL; return CheckMovementInputAcroBike(ptr, newKeys, heldKeys); } @@ -672,7 +672,7 @@ static void AcroBikeTransition_SideJump(u8 direction) playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; PlaySE(SE_JITE_PYOKO); playerEventObj->facingDirectionLocked = 1; - PlayerSetAnimId(sub_8093514(direction), 2); + PlayerSetAnimId(GetJumpMovementAction(direction), 2); } static void AcroBikeTransition_TurnJump(u8 direction) @@ -1062,7 +1062,7 @@ void Bike_HandleBumpySlopeJump(void) if (MetatileBehavior_IsBumpySlope(tileBehavior)) { gPlayerAvatar.acroBikeState = ACRO_STATE_WHEELIE_STANDING; - sub_808C1B4(player_get_direction_upper_nybble()); + sub_808C1B4(GetPlayerMovementDirection()); } } } diff --git a/src/data/field_event_obj/movement_action_func_tables.h b/src/data/field_event_obj/movement_action_func_tables.h index 519ca771a..b24f5dea4 100755 --- a/src/data/field_event_obj/movement_action_func_tables.h +++ b/src/data/field_event_obj/movement_action_func_tables.h @@ -2,1505 +2,1517 @@ #define GUARD_MOVEMENT_ACTION_FUNC_TABLES_H u8 MovementAction_FaceDown_Step0(struct EventObject *, struct Sprite *); -u8 sub_8093950(struct EventObject *, struct Sprite *); -u8 sub_80964BC(struct EventObject *, struct Sprite *); -u8 sub_8093960(struct EventObject *, struct Sprite *); -u8 sub_8093970(struct EventObject *, struct Sprite *); -u8 sub_8093980(struct EventObject *, struct Sprite *); -u8 sub_8093BC4(struct EventObject *, struct Sprite *); -u8 sub_8093BC4_2(struct EventObject *, struct Sprite *); -u8 sub_8093C04(struct EventObject *, struct Sprite *); -u8 sub_8093C04_2(struct EventObject *, struct Sprite *); -u8 sub_8093C44(struct EventObject *, struct Sprite *); -u8 sub_8093C44_2(struct EventObject *, struct Sprite *); -u8 sub_8093C84(struct EventObject *, struct Sprite *); -u8 sub_8093C84_2(struct EventObject *, struct Sprite *); -u8 sub_8093CC4(struct EventObject *, struct Sprite *); -u8 sub_8093CC4_2(struct EventObject *, struct Sprite *); -u8 sub_8093D04(struct EventObject *, struct Sprite *); -u8 sub_8093D04_2(struct EventObject *, struct Sprite *); -u8 sub_8093D44(struct EventObject *, struct Sprite *); -u8 sub_8093D44_2(struct EventObject *, struct Sprite *); -u8 sub_8093D84(struct EventObject *, struct Sprite *); -u8 sub_8093D84_2(struct EventObject *, struct Sprite *); -u8 sub_8093DC4(struct EventObject *, struct Sprite *); -u8 sub_8093DC4_2(struct EventObject *, struct Sprite *); -u8 sub_8093E04(struct EventObject *, struct Sprite *); -u8 sub_8093E04_2(struct EventObject *, struct Sprite *); -u8 sub_8093E44(struct EventObject *, struct Sprite *); -u8 sub_8093E44_2(struct EventObject *, struct Sprite *); -u8 sub_8093E84(struct EventObject *, struct Sprite *); -u8 sub_8093E84_2(struct EventObject *, struct Sprite *); -u8 sub_8093EC4(struct EventObject *, struct Sprite *); -u8 sub_8093EC4_2(struct EventObject *, struct Sprite *); -u8 sub_8093F04(struct EventObject *, struct Sprite *); -u8 sub_8093F04_2(struct EventObject *, struct Sprite *); -u8 sub_8093F44(struct EventObject *, struct Sprite *); -u8 sub_8093F44_2(struct EventObject *, struct Sprite *); -u8 sub_8093F84(struct EventObject *, struct Sprite *); -u8 sub_8093F84_2(struct EventObject *, struct Sprite *); -u8 sub_8094230(struct EventObject *, struct Sprite *); -u8 sub_8094230_2(struct EventObject *, struct Sprite *); -u8 sub_8094288(struct EventObject *, struct Sprite *); -u8 sub_8094288_2(struct EventObject *, struct Sprite *); -u8 sub_80942E0(struct EventObject *, struct Sprite *); -u8 sub_80942E0_2(struct EventObject *, struct Sprite *); -u8 sub_8094338(struct EventObject *, struct Sprite *); -u8 sub_8094338_2(struct EventObject *, struct Sprite *); -u8 sub_80943B4(struct EventObject *, struct Sprite *); -u8 sub_8094398(struct EventObject *, struct Sprite *); -u8 sub_80964B8(struct EventObject *, struct Sprite *); -u8 sub_80943D4(struct EventObject *, struct Sprite *); -u8 sub_80943F4(struct EventObject *, struct Sprite *); -u8 sub_8094414(struct EventObject *, struct Sprite *); -u8 sub_8094434(struct EventObject *, struct Sprite *); -u8 sub_8094454(struct EventObject *, struct Sprite *); -u8 sub_8094454_2(struct EventObject *, struct Sprite *); -u8 sub_8094494(struct EventObject *, struct Sprite *); -u8 sub_8094494_2(struct EventObject *, struct Sprite *); -u8 sub_80944D4(struct EventObject *, struct Sprite *); -u8 sub_80944D4_2(struct EventObject *, struct Sprite *); -u8 sub_8094514(struct EventObject *, struct Sprite *); -u8 sub_8094514_2(struct EventObject *, struct Sprite *); -u8 sub_8094600(struct EventObject *, struct Sprite *); -u8 sub_80945C4(struct EventObject *, struct Sprite *); -u8 sub_8094638(struct EventObject *, struct Sprite *); -u8 sub_8094670(struct EventObject *, struct Sprite *); -u8 sub_80946A8(struct EventObject *, struct Sprite *); -u8 sub_80946E0(struct EventObject *, struct Sprite *); -u8 sub_809459C(struct EventObject *, struct Sprite *); -u8 sub_8094718(struct EventObject *, struct Sprite *); -u8 sub_8094750(struct EventObject *, struct Sprite *); -u8 sub_8094788(struct EventObject *, struct Sprite *); -u8 sub_80947C0(struct EventObject *, struct Sprite *); -u8 sub_80947F8(struct EventObject *, struct Sprite *); -u8 sub_8094830(struct EventObject *, struct Sprite *); -u8 sub_8094868(struct EventObject *, struct Sprite *); -u8 sub_80948A0(struct EventObject *, struct Sprite *); -u8 sub_80948D8(struct EventObject *, struct Sprite *); -u8 sub_8094910(struct EventObject *, struct Sprite *); -u8 sub_8094948(struct EventObject *, struct Sprite *); -u8 sub_8094980(struct EventObject *, struct Sprite *); -u8 sub_8094980_2(struct EventObject *, struct Sprite *); -u8 sub_80949C0(struct EventObject *, struct Sprite *); -u8 sub_80949C0_2(struct EventObject *, struct Sprite *); -u8 sub_8094A00(struct EventObject *, struct Sprite *); -u8 sub_8094A00_2(struct EventObject *, struct Sprite *); -u8 sub_8094A40(struct EventObject *, struct Sprite *); -u8 sub_8094A40_2(struct EventObject *, struct Sprite *); -u8 sub_8094A80(struct EventObject *, struct Sprite *); -u8 sub_8094A80_2(struct EventObject *, struct Sprite *); -u8 sub_8094AC0(struct EventObject *, struct Sprite *); -u8 sub_8094AC0_2(struct EventObject *, struct Sprite *); -u8 sub_8094B00(struct EventObject *, struct Sprite *); -u8 sub_8094B00_2(struct EventObject *, struct Sprite *); -u8 sub_8094B40(struct EventObject *, struct Sprite *); -u8 sub_8094B40_2(struct EventObject *, struct Sprite *); -u8 sub_8094B80(struct EventObject *, struct Sprite *); -u8 sub_8094B80_2(struct EventObject *, struct Sprite *); -u8 sub_8094BC0(struct EventObject *, struct Sprite *); -u8 sub_8094BC0_2(struct EventObject *, struct Sprite *); -u8 sub_8094C00(struct EventObject *, struct Sprite *); -u8 sub_8094C00_2(struct EventObject *, struct Sprite *); -u8 sub_8094C40(struct EventObject *, struct Sprite *); -u8 sub_8094C40_2(struct EventObject *, struct Sprite *); -u8 sub_8094C80(struct EventObject *, struct Sprite *); -u8 sub_8094C80_2(struct EventObject *, struct Sprite *); -u8 sub_8094CC0(struct EventObject *, struct Sprite *); -u8 sub_8094CC0_2(struct EventObject *, struct Sprite *); -u8 sub_8094D00(struct EventObject *, struct Sprite *); -u8 sub_8094D00_2(struct EventObject *, struct Sprite *); -u8 sub_8094D40(struct EventObject *, struct Sprite *); -u8 sub_8094D40_2(struct EventObject *, struct Sprite *); -u8 sub_8094DAC(struct EventObject *, struct Sprite *); -u8 sub_8094DC4(struct EventObject *, struct Sprite *); -u8 sub_8094E18(struct EventObject *, struct Sprite *); -u8 sub_8094E18_2(struct EventObject *, struct Sprite *); -u8 sub_8094E60(struct EventObject *, struct Sprite *); -u8 sub_8094E60_2(struct EventObject *, struct Sprite *); -u8 sub_8094EB8(struct EventObject *, struct Sprite *); -u8 sub_8094EB8_2(struct EventObject *, struct Sprite *); -u8 sub_8094710(struct EventObject *, struct Sprite *); -u8 sub_8094710_2(struct EventObject *, struct Sprite *); -u8 sub_8094F38(struct EventObject *, struct Sprite *); -u8 sub_8094F94(struct EventObject *, struct Sprite *); -u8 sub_8094FF8(struct EventObject *, struct Sprite *); -u8 sub_8095008(struct EventObject *, struct Sprite *); -u8 sub_8095018(struct EventObject *, struct Sprite *); -u8 sub_8095018_2(struct EventObject *, struct Sprite *); -u8 sub_8095070(struct EventObject *, struct Sprite *); -u8 sub_8095070_2(struct EventObject *, struct Sprite *); -u8 sub_80950C8(struct EventObject *, struct Sprite *); -u8 sub_80950C8_2(struct EventObject *, struct Sprite *); -u8 sub_8095120(struct EventObject *, struct Sprite *); -u8 sub_8095120_2(struct EventObject *, struct Sprite *); -u8 sub_8095178(struct EventObject *, struct Sprite *); -u8 sub_8095178_2(struct EventObject *, struct Sprite *); -u8 sub_80951D0(struct EventObject *, struct Sprite *); -u8 sub_80951D0_2(struct EventObject *, struct Sprite *); -u8 sub_8095228(struct EventObject *, struct Sprite *); -u8 sub_8095228_2(struct EventObject *, struct Sprite *); -u8 sub_8095280(struct EventObject *, struct Sprite *); -u8 sub_8095280_2(struct EventObject *, struct Sprite *); -u8 sub_80952D8(struct EventObject *, struct Sprite *); -u8 sub_80952D8_2(struct EventObject *, struct Sprite *); -u8 sub_8095330(struct EventObject *, struct Sprite *); -u8 sub_8095330_2(struct EventObject *, struct Sprite *); -u8 sub_8095388(struct EventObject *, struct Sprite *); -u8 sub_8095388_2(struct EventObject *, struct Sprite *); -u8 sub_80953E0(struct EventObject *, struct Sprite *); -u8 sub_80953E0_2(struct EventObject *, struct Sprite *); -u8 sub_8095438(struct EventObject *, struct Sprite *); -u8 sub_8095450(struct EventObject *, struct Sprite *); -u8 sub_8095460(struct EventObject *, struct Sprite *); -u8 sub_8095470(struct EventObject *, struct Sprite *); -u8 sub_8095480(struct EventObject *, struct Sprite *); -u8 sub_8095490(struct EventObject *, struct Sprite *); -u8 sub_80954BC(struct EventObject *, struct Sprite *); -u8 sub_80954CC(struct EventObject *, struct Sprite *); -u8 do_exclamation_mark_bubble_1(struct EventObject *, struct Sprite *); -u8 do_exclamation_mark_bubble_2(struct EventObject *, struct Sprite *); -u8 do_heart_bubble(struct EventObject *, struct Sprite *); -u8 sub_8095548(struct EventObject *, struct Sprite *); -u8 sub_809558C(struct EventObject *, struct Sprite *); -u8 sub_80955AC(struct EventObject *, struct Sprite *); -u8 sub_80955C8(struct EventObject *, struct Sprite *); -u8 sub_80955EC(struct EventObject *, struct Sprite *); -u8 sub_8095628(struct EventObject *, struct Sprite *); -u8 sub_8095644(struct EventObject *, struct Sprite *); -u8 sub_8095668(struct EventObject *, struct Sprite *); -u8 sub_80956A4(struct EventObject *, struct Sprite *); -u8 sub_80956B4(struct EventObject *, struct Sprite *); -u8 sub_80956C4(struct EventObject *, struct Sprite *); -u8 sub_80956F4(struct EventObject *, struct Sprite *); -u8 sub_8095724(struct EventObject *, struct Sprite *); -u8 sub_8095730(struct EventObject *, struct Sprite *); -u8 sub_8095740(struct EventObject *, struct Sprite *); -u8 sub_8095740_2(struct EventObject *, struct Sprite *); -u8 sub_80957A0(struct EventObject *, struct Sprite *); -u8 sub_80957A0_2(struct EventObject *, struct Sprite *); -u8 sub_8095800(struct EventObject *, struct Sprite *); -u8 sub_8095800_2(struct EventObject *, struct Sprite *); -u8 sub_8095860(struct EventObject *, struct Sprite *); -u8 sub_8095860_2(struct EventObject *, struct Sprite *); -u8 sub_8095900(struct EventObject *, struct Sprite *); -u8 sub_8095910(struct EventObject *, struct Sprite *); -u8 sub_8095920(struct EventObject *, struct Sprite *); -u8 sub_8095930(struct EventObject *, struct Sprite *); -u8 sub_8095940(struct EventObject *, struct Sprite *); -u8 sub_8095964(struct EventObject *, struct Sprite *); -u8 sub_8095988(struct EventObject *, struct Sprite *); -u8 sub_80959AC(struct EventObject *, struct Sprite *); -u8 sub_80959D0(struct EventObject *, struct Sprite *); -u8 sub_80959F4(struct EventObject *, struct Sprite *); -u8 sub_8095A18(struct EventObject *, struct Sprite *); -u8 sub_8095A3C(struct EventObject *, struct Sprite *); -u8 sub_8095A60(struct EventObject *, struct Sprite *); -u8 sub_8095A84(struct EventObject *, struct Sprite *); -u8 sub_8095AA8(struct EventObject *, struct Sprite *); -u8 sub_8095ACC(struct EventObject *, struct Sprite *); -u8 sub_8095B44(struct EventObject *, struct Sprite *); -u8 sub_8095B64(struct EventObject *, struct Sprite *); -u8 sub_8095BC8(struct EventObject *, struct Sprite *); -u8 sub_8095BC8_2(struct EventObject *, struct Sprite *); -u8 sub_8095C20(struct EventObject *, struct Sprite *); -u8 sub_8095C20_2(struct EventObject *, struct Sprite *); -u8 sub_8095C78(struct EventObject *, struct Sprite *); -u8 sub_8095C78_2(struct EventObject *, struct Sprite *); -u8 sub_8095CD0(struct EventObject *, struct Sprite *); -u8 sub_8095CD0_2(struct EventObject *, struct Sprite *); -u8 sub_8095D28(struct EventObject *, struct Sprite *); -u8 sub_8095D28_2(struct EventObject *, struct Sprite *); -u8 sub_8095D80(struct EventObject *, struct Sprite *); -u8 sub_8095D80_2(struct EventObject *, struct Sprite *); -u8 sub_8095DD8(struct EventObject *, struct Sprite *); -u8 sub_8095DD8_2(struct EventObject *, struct Sprite *); -u8 sub_8095E30(struct EventObject *, struct Sprite *); -u8 sub_8095E30_2(struct EventObject *, struct Sprite *); -u8 sub_8095E88(struct EventObject *, struct Sprite *); -u8 sub_8095E88_2(struct EventObject *, struct Sprite *); -u8 sub_8095EE0(struct EventObject *, struct Sprite *); -u8 sub_8095EE0_2(struct EventObject *, struct Sprite *); -u8 sub_8095F38(struct EventObject *, struct Sprite *); -u8 sub_8095F38_2(struct EventObject *, struct Sprite *); -u8 sub_8095F90(struct EventObject *, struct Sprite *); -u8 sub_8095F90_2(struct EventObject *, struct Sprite *); -u8 sub_8095FE8(struct EventObject *, struct Sprite *); -u8 sub_8096020(struct EventObject *, struct Sprite *); -u8 sub_8096058(struct EventObject *, struct Sprite *); -u8 sub_8096090(struct EventObject *, struct Sprite *); -u8 sub_8096100(struct EventObject *, struct Sprite *); -u8 sub_8096100_2(struct EventObject *, struct Sprite *); -u8 sub_8096140(struct EventObject *, struct Sprite *); -u8 sub_8096140_2(struct EventObject *, struct Sprite *); -u8 sub_8096180(struct EventObject *, struct Sprite *); -u8 sub_8096180_2(struct EventObject *, struct Sprite *); -u8 sub_80961C0(struct EventObject *, struct Sprite *); -u8 sub_80961C0_2(struct EventObject *, struct Sprite *); -u8 sub_8096230(struct EventObject *, struct Sprite *); -u8 sub_8096230_2(struct EventObject *, struct Sprite *); -u8 sub_8096270(struct EventObject *, struct Sprite *); -u8 sub_8096270_2(struct EventObject *, struct Sprite *); -u8 sub_80962B0(struct EventObject *, struct Sprite *); -u8 sub_80962B0_2(struct EventObject *, struct Sprite *); -u8 sub_80962F0(struct EventObject *, struct Sprite *); -u8 sub_80962F0_2(struct EventObject *, struct Sprite *); -u8 sub_8096368(struct EventObject *, struct Sprite *); -u8 sub_8096368_2(struct EventObject *, struct Sprite *); -u8 sub_80963A8(struct EventObject *, struct Sprite *); -u8 sub_80963A8_2(struct EventObject *, struct Sprite *); -u8 sub_80963E8(struct EventObject *, struct Sprite *); -u8 sub_80963E8_2(struct EventObject *, struct Sprite *); -u8 sub_8096428(struct EventObject *, struct Sprite *); -u8 sub_8096428_2(struct EventObject *, struct Sprite *); -u8 sub_8096468(struct EventObject *, struct Sprite *); -u8 sub_809647C(struct EventObject *, struct Sprite *); -u8 sub_8096494(struct EventObject *, struct Sprite *); -u8 sub_8097E50(struct EventObject *, struct Sprite *); -u8 sub_80964B8(struct EventObject *, struct Sprite *); -u8 sub_8097EF0(struct EventObject *, struct Sprite *); -u8 sub_80980C0(struct EventObject *, struct Sprite *); -u8 sub_80980D0(struct EventObject *, struct Sprite *); -u8 sub_8098124(struct EventObject *, struct Sprite *); -u8 sub_80980F4(struct EventObject *, struct Sprite *); -u8 sub_8098108(struct EventObject *, struct Sprite *); +u8 MovementAction_FaceDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_PauseSpriteAnim(struct EventObject *, struct Sprite *); +u8 MovementAction_FaceUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_FaceLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_FaceRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowDiagonalUpLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowDiagonalUpLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowDiagonalUpRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowDiagonalUpRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowDiagonalDownLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowDiagonalDownLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowDiagonalDownRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowDiagonalDownRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkSlowRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalDiagonalUpLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalDiagonalUpLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalDiagonalUpRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalDiagonalUpRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalDiagonalDownLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalDiagonalDownLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalDiagonalDownRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalDiagonalDownRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkNormalRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_Jump2Down_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Jump2Down_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_Jump2Up_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Jump2Up_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_Jump2Left_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Jump2Left_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_Jump2Right_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Jump2Right_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_Delay1_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Delay_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_Finish(struct EventObject *, struct Sprite *); +u8 MovementAction_Delay2_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Delay4_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Delay8_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Delay16_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceSlowDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceSlow_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceSlowUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceSlowLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceSlowRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceNormalDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlace_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceNormalUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceNormalLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceNormalRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceFastDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceFastUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceFastLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceFastRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceFastestDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceFastestUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceFastestLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkInPlaceFastestRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_RideWaterCurrentDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_RideWaterCurrentDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_RideWaterCurrentUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_RideWaterCurrentUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_RideWaterCurrentLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_RideWaterCurrentLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_RideWaterCurrentRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_RideWaterCurrentRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastestDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastestDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastestUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastestUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastestLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastestLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastestRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkFastestRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_SlideDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_SlideDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_SlideUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_SlideUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_SlideLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_SlideLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_SlideRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_SlideRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_PlayerRunDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_PlayerRunDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_PlayerRunUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_PlayerRunUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_PlayerRunLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_PlayerRunLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_PlayerRunRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_PlayerRunRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_StartAnimInDirection_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WaitSpriteAnim(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpSpecialDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpSpecialDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpSpecialUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpSpecialUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpSpecialLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpSpecialLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpSpecialRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpSpecialRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_FacePlayer_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_FaceAwayPlayer_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_LockFacingDirection_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_UnlockFacingDirection_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceDownUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceDownUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceUpDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceUpDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceLeftRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceLeftRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceRightLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_JumpInPlaceRightLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_FaceOriginalDirection_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_NurseJoyBowDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_EnableJumpLandingGroundEffect_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_DisableJumpLandingGroundEffect_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_DisableAnimation_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_RestoreAnimation_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_SetInvisible_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_SetVisible_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_EmoteExclamationMark_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_EmoteQuestionMark_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_EmoteHeart_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_RevealTrainer_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_RevealTrainer_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_RockSmashBreak_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_RockSmashBreak_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_RockSmashBreak_Step2(struct EventObject *, struct Sprite *); +u8 MovementAction_CutTree_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_CutTree_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_CutTree_Step2(struct EventObject *, struct Sprite *); +u8 MovementAction_SetFixedPriority_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_ClearFixedPriority_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_InitAffineAnim_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_ClearAffineAnim_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Unknown1_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Unknown2_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkDownStartAffine_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkDownStartAffine_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkDownAffine_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkDownAffine_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkLeftAffine_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkLeftAffine_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkRightAffine_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_WalkRightAffine_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieFaceDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieFaceUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieFaceLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieFaceRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieFaceDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieFaceUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieFaceLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieFaceRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_UnusedAcroActionDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_UnusedAcroActionUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_UnusedAcroActionLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_UnusedAcroActionRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Figure8_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Figure8_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopFaceDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopFaceDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopFaceUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopFaceUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopFaceLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopFaceLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopFaceRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopFaceRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieHopRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieJumpDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieJumpDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieJumpUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieJumpUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieJumpLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieJumpLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieJumpRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieJumpRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieInPlaceDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieInPlaceUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieInPlaceLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieInPlaceRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieMoveDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieMoveDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieMoveUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieMoveUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieMoveLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieMoveLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieMoveRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroPopWheelieMoveRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieMoveDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieMoveDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieMoveUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieMoveUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieMoveLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieMoveLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieMoveRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroWheelieMoveRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieMoveDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieMoveDown_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieMoveUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieMoveUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieMoveLeft_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieMoveLeft_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieMoveRight_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_AcroEndWheelieMoveRight_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_Levitate_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_StopLevitate_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_DestroyExtraTaskIfAtTop_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_StoreAndLockAnim_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_Finish(struct EventObject *, struct Sprite *); +u8 MovementAction_FreeAndUnlockAnim_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_FlyUp_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_FlyUp_Step1(struct EventObject *, struct Sprite *); +u8 MovementAction_Fly_Finish(struct EventObject *, struct Sprite *); +u8 MovementAction_FlyDown_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_FlyDown_Step1(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DEC8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DED0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DED8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DEE0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF2C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF38[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF44[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF50[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF8C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF98[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DFA4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DFB0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DFC8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DFD4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DFE0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DFEC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DFF8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E004[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E010[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E01C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E028[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E034[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E040[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E04C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E058[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E064[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E070[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E07C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E088[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E094[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E0A0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E0AC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E0B8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E0C4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E0D0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E0DC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E0E8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E0F4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E100[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E10C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E118[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E124[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E130[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E13C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E148[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E154[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E160[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E16C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E178[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E184[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E190[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E19C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E1A8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E1B4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E1C0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E1CC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E1D8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E1E4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E1F0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E1FC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E208[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E214[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E220[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E228[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E230[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E238[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E240[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E24C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E258[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E264[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E270[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E27C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E288[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E294[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E2A0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E2AC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E2B8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E2C4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E2D0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E2D8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E2E4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E2EC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E2F4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E2FC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E304[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E30C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E314[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E31C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E324[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E32C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E338[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E348[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E358[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E360[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E368[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E370[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E378[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E380[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E388[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E394[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E3B8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E3C0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E3C8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E3D0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E3D8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E3E4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E3F0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E3FC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E408[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E414[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E420[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E42C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E474[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E480[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E48C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E498[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E4A4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E4B0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E4BC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E4C8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E4D4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E4E0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E4EC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E4F8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E504[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E510[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E51C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E528[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E534[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E540[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E54C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E558[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E564[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E570[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E57C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E588[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E594[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E5A0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E5AC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E5B8[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF5C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF68[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF74[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF80[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DEFC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF08[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF14[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850DF20[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E854[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E85C[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E3A0[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E3AC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E5C4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E5CC[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E5D4[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E468[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E864[])(struct EventObject *, struct Sprite *); -u8 (*const gUnknown_0850E870[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_FaceDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_FaceUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_FaceLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_FaceRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkSlowDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkSlowUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkSlowLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkSlowRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkNormalDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkNormalUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkNormalLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkNormalRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Jump2Down[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Jump2Up[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Jump2Left[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Jump2Right[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Delay1[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Delay2[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Delay4[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Delay8[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Delay16[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFastDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFastUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFastLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFastRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceSlowDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceSlowUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceSlowLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceSlowRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceNormalDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceNormalUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceNormalLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceNormalRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceFastDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceFastUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceFastLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceFastRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceFastestDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceFastestUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceFastestLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkInPlaceFastestRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_RideWaterCurrentDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_RideWaterCurrentUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_RideWaterCurrentLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_RideWaterCurrentRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFastestDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFastestUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFastestLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFastestRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_SlideDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_SlideUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_SlideLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_SlideRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_PlayerRunDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_PlayerRunUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_PlayerRunLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_PlayerRunRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_StartAnimInDirection[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpSpecialDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpSpecialUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpSpecialLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpSpecialRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_FacePlayer[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_FaceAwayPlayer[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_LockFacingDirection[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_UnlockFacingDirection[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpInPlaceDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpInPlaceUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpInPlaceLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpInPlaceRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpInPlaceDownUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpInPlaceUpDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpInPlaceLeftRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_JumpInPlaceRightLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_FaceOriginalDirection[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_NurseJoyBowDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_EnableJumpLandingGroundEffect[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_DisableJumpLandingGroundEffect[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_DisableAnimation[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_RestoreAnimation[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_SetInvisible[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_SetVisible[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_EmoteExclamationMark[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_EmoteQuestionMark[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_EmoteHeart[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_RevealTrainer[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_RockSmashBreak[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_CutTree[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_SetFixedPriority[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_ClearFixedPriority[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_InitAffineAnim[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_ClearAffineAnim[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Unknown1[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Unknown2[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkDownStartAffine[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkDownAffine[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieFaceDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieFaceUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieFaceLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieFaceRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroPopWheelieDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroPopWheelieUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroPopWheelieLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroPopWheelieRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroEndWheelieFaceDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroEndWheelieFaceUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroEndWheelieFaceLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroEndWheelieFaceRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieHopFaceDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieHopFaceUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieHopFaceLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieHopFaceRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieHopDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieHopUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieHopLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieHopRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieJumpDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieJumpUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieJumpLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieJumpRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieInPlaceDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieInPlaceUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieInPlaceLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieInPlaceRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroPopWheelieMoveDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroPopWheelieMoveUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroPopWheelieMoveLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroPopWheelieMoveRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieMoveDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieMoveUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieMoveLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroWheelieMoveRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroEndWheelieMoveDown[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroEndWheelieMoveUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroEndWheelieMoveLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroEndWheelieMoveRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkNormalDiagonalUpLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkNormalDiagonalUpRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkNormalDiagonalDownLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkNormalDiagonalDownRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkSlowDiagonalUpLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkSlowDiagonalUpRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkSlowDiagonalDownLeft[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkSlowDiagonalDownRight[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_StoreAndLockAnim[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_FreeAndUnlockAnim[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkLeftAffine[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkRightAffine[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Levitate[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_StopLevitate[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_DestroyExtraTaskIfAtTop[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_Figure8[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_FlyUp[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_FlyDown[])(struct EventObject *, struct Sprite *); -u8 (*const *const gUnknown_0850DC50[])(struct EventObject *, struct Sprite *) = { - gUnknown_0850DEC8, - gUnknown_0850DED0, - gUnknown_0850DED8, - gUnknown_0850DEE0, - gUnknown_0850DF2C, - gUnknown_0850DF38, - gUnknown_0850DF44, - gUnknown_0850DF50, - gUnknown_0850DF8C, - gUnknown_0850DF98, - gUnknown_0850DFA4, - gUnknown_0850DFB0, - gUnknown_0850DFC8, - gUnknown_0850DFD4, - gUnknown_0850DFE0, - gUnknown_0850DFEC, - gUnknown_0850DFF8, - gUnknown_0850E004, - gUnknown_0850E010, - gUnknown_0850E01C, - gUnknown_0850E028, - gUnknown_0850E034, - gUnknown_0850E040, - gUnknown_0850E04C, - gUnknown_0850E058, - gUnknown_0850E064, - gUnknown_0850E070, - gUnknown_0850E07C, - gUnknown_0850E088, - gUnknown_0850E094, - gUnknown_0850E0A0, - gUnknown_0850E0AC, - gUnknown_0850E0B8, - gUnknown_0850E0C4, - gUnknown_0850E0D0, - gUnknown_0850E0DC, - gUnknown_0850E0E8, - gUnknown_0850E0F4, - gUnknown_0850E100, - gUnknown_0850E10C, - gUnknown_0850E118, - gUnknown_0850E124, - gUnknown_0850E130, - gUnknown_0850E13C, - gUnknown_0850E148, - gUnknown_0850E154, - gUnknown_0850E160, - gUnknown_0850E16C, - gUnknown_0850E178, - gUnknown_0850E184, - gUnknown_0850E190, - gUnknown_0850E19C, - gUnknown_0850E1A8, - gUnknown_0850E1B4, - gUnknown_0850E1C0, - gUnknown_0850E1CC, - gUnknown_0850E1D8, - gUnknown_0850E1E4, - gUnknown_0850E1F0, - gUnknown_0850E1FC, - gUnknown_0850E208, - gUnknown_0850E214, - gUnknown_0850E220, - gUnknown_0850E228, - gUnknown_0850E230, - gUnknown_0850E238, - gUnknown_0850E240, - gUnknown_0850E24C, - gUnknown_0850E258, - gUnknown_0850E264, - gUnknown_0850E270, - gUnknown_0850E27C, - gUnknown_0850E288, - gUnknown_0850E294, - gUnknown_0850E2A0, - gUnknown_0850E2AC, - gUnknown_0850E2B8, - gUnknown_0850E2C4, - gUnknown_0850E2D0, - gUnknown_0850E2D8, - gUnknown_0850E2E4, - gUnknown_0850E2EC, - gUnknown_0850E2F4, - gUnknown_0850E2FC, - gUnknown_0850E304, - gUnknown_0850E30C, - gUnknown_0850E314, - gUnknown_0850E31C, - gUnknown_0850E324, - gUnknown_0850E32C, - gUnknown_0850E338, - gUnknown_0850E348, - gUnknown_0850E358, - gUnknown_0850E360, - gUnknown_0850E368, - gUnknown_0850E370, - gUnknown_0850E378, - gUnknown_0850E380, - gUnknown_0850E388, - gUnknown_0850E394, - gUnknown_0850E3B8, - gUnknown_0850E3C0, - gUnknown_0850E3C8, - gUnknown_0850E3D0, - gUnknown_0850E3D8, - gUnknown_0850E3E4, - gUnknown_0850E3F0, - gUnknown_0850E3FC, - gUnknown_0850E408, - gUnknown_0850E414, - gUnknown_0850E420, - gUnknown_0850E42C, - gUnknown_0850E474, - gUnknown_0850E480, - gUnknown_0850E48C, - gUnknown_0850E498, - gUnknown_0850E4A4, - gUnknown_0850E4B0, - gUnknown_0850E4BC, - gUnknown_0850E4C8, - gUnknown_0850E4D4, - gUnknown_0850E4E0, - gUnknown_0850E4EC, - gUnknown_0850E4F8, - gUnknown_0850E504, - gUnknown_0850E510, - gUnknown_0850E51C, - gUnknown_0850E528, - gUnknown_0850E534, - gUnknown_0850E540, - gUnknown_0850E54C, - gUnknown_0850E558, - gUnknown_0850E564, - gUnknown_0850E570, - gUnknown_0850E57C, - gUnknown_0850E588, - gUnknown_0850E594, - gUnknown_0850E5A0, - gUnknown_0850E5AC, - gUnknown_0850E5B8, - gUnknown_0850DF5C, - gUnknown_0850DF68, - gUnknown_0850DF74, - gUnknown_0850DF80, - gUnknown_0850DEFC, - gUnknown_0850DF08, - gUnknown_0850DF14, - gUnknown_0850DF20, - gUnknown_0850E854, - gUnknown_0850E85C, - gUnknown_0850E3A0, - gUnknown_0850E3AC, - gUnknown_0850E5C4, - gUnknown_0850E5CC, - gUnknown_0850E5D4, - gUnknown_0850E468, - gUnknown_0850E864, - gUnknown_0850E870, +u8 (*const *const gMovementActionFuncs[])(struct EventObject *, struct Sprite *) = { + gMovementActionFuncs_FaceDown, // MOVEMENT_ACTION_FACE_DOWN + gMovementActionFuncs_FaceUp, // MOVEMENT_ACTION_FACE_UP + gMovementActionFuncs_FaceLeft, // MOVEMENT_ACTION_FACE_LEFT + gMovementActionFuncs_FaceRight, // MOVEMENT_ACTION_FACE_RIGHT + gMovementActionFuncs_WalkSlowDown, // MOVEMENT_ACTION_WALK_SLOW_DOWN + gMovementActionFuncs_WalkSlowUp, // MOVEMENT_ACTION_WALK_SLOW_UP + gMovementActionFuncs_WalkSlowLeft, // MOVEMENT_ACTION_WALK_SLOW_LEFT + gMovementActionFuncs_WalkSlowRight, // MOVEMENT_ACTION_WALK_SLOW_RIGHT + gMovementActionFuncs_WalkNormalDown, // MOVEMENT_ACTION_WALK_NORMAL_DOWN + gMovementActionFuncs_WalkNormalUp, // MOVEMENT_ACTION_WALK_NORMAL_UP + gMovementActionFuncs_WalkNormalLeft, // MOVEMENT_ACTION_WALK_NORMAL_LEFT + gMovementActionFuncs_WalkNormalRight, // MOVEMENT_ACTION_WALK_NORMAL_RIGHT + gMovementActionFuncs_Jump2Down, // MOVEMENT_ACTION_JUMP_2_DOWN + gMovementActionFuncs_Jump2Up, // MOVEMENT_ACTION_JUMP_2_UP + gMovementActionFuncs_Jump2Left, // MOVEMENT_ACTION_JUMP_2_LEFT + gMovementActionFuncs_Jump2Right, // MOVEMENT_ACTION_JUMP_2_RIGHT + gMovementActionFuncs_Delay1, // MOVEMENT_ACTION_DELAY_1 + gMovementActionFuncs_Delay2, // MOVEMENT_ACTION_DELAY_2 + gMovementActionFuncs_Delay4, // MOVEMENT_ACTION_DELAY_4 + gMovementActionFuncs_Delay8, // MOVEMENT_ACTION_DELAY_8 + gMovementActionFuncs_Delay16, // MOVEMENT_ACTION_DELAY_16 + gMovementActionFuncs_WalkFastDown, // MOVEMENT_ACTION_WALK_FAST_DOWN + gMovementActionFuncs_WalkFastUp, // MOVEMENT_ACTION_WALK_FAST_UP + gMovementActionFuncs_WalkFastLeft, // MOVEMENT_ACTION_WALK_FAST_LEFT + gMovementActionFuncs_WalkFastRight, // MOVEMENT_ACTION_WALK_FAST_RIGHT + gMovementActionFuncs_WalkInPlaceSlowDown, // MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN + gMovementActionFuncs_WalkInPlaceSlowUp, // MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_UP + gMovementActionFuncs_WalkInPlaceSlowLeft, // MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT + gMovementActionFuncs_WalkInPlaceSlowRight, // MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT + gMovementActionFuncs_WalkInPlaceNormalDown, // MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN + gMovementActionFuncs_WalkInPlaceNormalUp, // MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_UP + gMovementActionFuncs_WalkInPlaceNormalLeft, // MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT + gMovementActionFuncs_WalkInPlaceNormalRight, // MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT + gMovementActionFuncs_WalkInPlaceFastDown, // MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN + gMovementActionFuncs_WalkInPlaceFastUp, // MOVEMENT_ACTION_WALK_IN_PLACE_FAST_UP + gMovementActionFuncs_WalkInPlaceFastLeft, // MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT + gMovementActionFuncs_WalkInPlaceFastRight, // MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT + gMovementActionFuncs_WalkInPlaceFastestDown, // MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_DOWN + gMovementActionFuncs_WalkInPlaceFastestUp, // MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_UP + gMovementActionFuncs_WalkInPlaceFastestLeft, // MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_LEFT + gMovementActionFuncs_WalkInPlaceFastestRight, // MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_RIGHT + gMovementActionFuncs_RideWaterCurrentDown, // MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN + gMovementActionFuncs_RideWaterCurrentUp, // MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP + gMovementActionFuncs_RideWaterCurrentLeft, // MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT + gMovementActionFuncs_RideWaterCurrentRight, // MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT + gMovementActionFuncs_WalkFastestDown, // MOVEMENT_ACTION_WALK_FASTEST_DOWN + gMovementActionFuncs_WalkFastestUp, // MOVEMENT_ACTION_WALK_FASTEST_UP + gMovementActionFuncs_WalkFastestLeft, // MOVEMENT_ACTION_WALK_FASTEST_LEFT + gMovementActionFuncs_WalkFastestRight, // MOVEMENT_ACTION_WALK_FASTEST_RIGHT + gMovementActionFuncs_SlideDown, // MOVEMENT_ACTION_SLIDE_DOWN + gMovementActionFuncs_SlideUp, // MOVEMENT_ACTION_SLIDE_UP + gMovementActionFuncs_SlideLeft, // MOVEMENT_ACTION_SLIDE_LEFT + gMovementActionFuncs_SlideRight, // MOVEMENT_ACTION_SLIDE_RIGHT + gMovementActionFuncs_PlayerRunDown, // MOVEMENT_ACTION_PLAYER_RUN_DOWN + gMovementActionFuncs_PlayerRunUp, // MOVEMENT_ACTION_PLAYER_RUN_UP + gMovementActionFuncs_PlayerRunLeft, // MOVEMENT_ACTION_PLAYER_RUN_LEFT + gMovementActionFuncs_PlayerRunRight, // MOVEMENT_ACTION_PLAYER_RUN_RIGHT + gMovementActionFuncs_StartAnimInDirection, // MOVEMENT_ACTION_START_ANIM_IN_DIRECTION + gMovementActionFuncs_JumpSpecialDown, // MOVEMENT_ACTION_JUMP_SPECIAL_DOWN + gMovementActionFuncs_JumpSpecialUp, // MOVEMENT_ACTION_JUMP_SPECIAL_UP + gMovementActionFuncs_JumpSpecialLeft, // MOVEMENT_ACTION_JUMP_SPECIAL_LEFT + gMovementActionFuncs_JumpSpecialRight, // MOVEMENT_ACTION_JUMP_SPECIAL_RIGHT + gMovementActionFuncs_FacePlayer, // MOVEMENT_ACTION_FACE_PLAYER + gMovementActionFuncs_FaceAwayPlayer, // MOVEMENT_ACTION_FACE_AWAY_PLAYER + gMovementActionFuncs_LockFacingDirection, // MOVEMENT_ACTION_LOCK_FACING_DIRECTION + gMovementActionFuncs_UnlockFacingDirection, // MOVEMENT_ACTION_UNLOCK_FACING_DIRECTION + gMovementActionFuncs_JumpDown, // MOVEMENT_ACTION_JUMP_DOWN + gMovementActionFuncs_JumpUp, // MOVEMENT_ACTION_JUMP_UP + gMovementActionFuncs_JumpLeft, // MOVEMENT_ACTION_JUMP_LEFT + gMovementActionFuncs_JumpRight, // MOVEMENT_ACTION_JUMP_RIGHT + gMovementActionFuncs_JumpInPlaceDown, // MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN + gMovementActionFuncs_JumpInPlaceUp, // MOVEMENT_ACTION_JUMP_IN_PLACE_UP + gMovementActionFuncs_JumpInPlaceLeft, // MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT + gMovementActionFuncs_JumpInPlaceRight, // MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT + gMovementActionFuncs_JumpInPlaceDownUp, // MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN_UP + gMovementActionFuncs_JumpInPlaceUpDown, // MOVEMENT_ACTION_JUMP_IN_PLACE_UP_DOWN + gMovementActionFuncs_JumpInPlaceLeftRight, // MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT_RIGHT + gMovementActionFuncs_JumpInPlaceRightLeft, // MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT_LEFT + gMovementActionFuncs_FaceOriginalDirection, // MOVEMENT_ACTION_FACE_ORIGINAL_DIRECTION + gMovementActionFuncs_NurseJoyBowDown, // MOVEMENT_ACTION_NURSE_JOY_BOW_DOWN + gMovementActionFuncs_EnableJumpLandingGroundEffect, // MOVEMENT_ACTION_ENABLE_JUMP_LANDING_GROUND_EFFECT + gMovementActionFuncs_DisableJumpLandingGroundEffect, // MOVEMENT_ACTION_DISABLE_JUMP_LANDING_GROUND_EFFECT + gMovementActionFuncs_DisableAnimation, // MOVEMENT_ACTION_DISABLE_ANIMATION + gMovementActionFuncs_RestoreAnimation, // MOVEMENT_ACTION_RESTORE_ANIMATION + gMovementActionFuncs_SetInvisible, // MOVEMENT_ACTION_SET_INVISIBLE + gMovementActionFuncs_SetVisible, // MOVEMENT_ACTION_SET_VISIBLE + gMovementActionFuncs_EmoteExclamationMark, // MOVEMENT_ACTION_EMOTE_EXCLAMATION_MARK + gMovementActionFuncs_EmoteQuestionMark, // MOVEMENT_ACTION_EMOTE_QUESTION_MARK + gMovementActionFuncs_EmoteHeart, // MOVEMENT_ACTION_EMOTE_HEART + gMovementActionFuncs_RevealTrainer, // MOVEMENT_ACTION_REVEAL_TRAINER + gMovementActionFuncs_RockSmashBreak, // MOVEMENT_ACTION_ROCK_SMASH_BREAK + gMovementActionFuncs_CutTree, // MOVEMENT_ACTION_CUT_TREE + gMovementActionFuncs_SetFixedPriority, // MOVEMENT_ACTION_SET_FIXED_PRIORITY + gMovementActionFuncs_ClearFixedPriority, // MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY + gMovementActionFuncs_InitAffineAnim, // MOVEMENT_ACTION_INIT_AFFINE_ANIM + gMovementActionFuncs_ClearAffineAnim, // MOVEMENT_ACTION_CLEAR_AFFINE_ANIM + gMovementActionFuncs_Unknown1, // MOVEMENT_ACTION_UNKNOWN1 + gMovementActionFuncs_Unknown2, // MOVEMENT_ACTION_UNKNOWN2 + gMovementActionFuncs_WalkDownStartAffine, // MOVEMENT_ACTION_WALK_DOWN_START_AFFINE + gMovementActionFuncs_WalkDownAffine, // MOVEMENT_ACTION_WALK_DOWN_AFFINE + gMovementActionFuncs_AcroWheelieFaceDown, // MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN + gMovementActionFuncs_AcroWheelieFaceUp, // MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP + gMovementActionFuncs_AcroWheelieFaceLeft, // MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT + gMovementActionFuncs_AcroWheelieFaceRight, // MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT + gMovementActionFuncs_AcroPopWheelieDown, // MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN + gMovementActionFuncs_AcroPopWheelieUp, // MOVEMENT_ACTION_ACRO_POP_WHEELIE_UP + gMovementActionFuncs_AcroPopWheelieLeft, // MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT + gMovementActionFuncs_AcroPopWheelieRight, // MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT + gMovementActionFuncs_AcroEndWheelieFaceDown, // MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN + gMovementActionFuncs_AcroEndWheelieFaceUp, // MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_UP + gMovementActionFuncs_AcroEndWheelieFaceLeft, // MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT + gMovementActionFuncs_AcroEndWheelieFaceRight, // MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT + gMovementActionFuncs_AcroWheelieHopFaceDown, // MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN + gMovementActionFuncs_AcroWheelieHopFaceUp, // MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_UP + gMovementActionFuncs_AcroWheelieHopFaceLeft, // MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT + gMovementActionFuncs_AcroWheelieHopFaceRight, // MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT + gMovementActionFuncs_AcroWheelieHopDown, // MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN + gMovementActionFuncs_AcroWheelieHopUp, // MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP + gMovementActionFuncs_AcroWheelieHopLeft, // MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT + gMovementActionFuncs_AcroWheelieHopRight, // MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT + gMovementActionFuncs_AcroWheelieJumpDown, // MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN + gMovementActionFuncs_AcroWheelieJumpUp, // MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_UP + gMovementActionFuncs_AcroWheelieJumpLeft, // MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT + gMovementActionFuncs_AcroWheelieJumpRight, // MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT + gMovementActionFuncs_AcroWheelieInPlaceDown, // MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN + gMovementActionFuncs_AcroWheelieInPlaceUp, // MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_UP + gMovementActionFuncs_AcroWheelieInPlaceLeft, // MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT + gMovementActionFuncs_AcroWheelieInPlaceRight, // MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT + gMovementActionFuncs_AcroPopWheelieMoveDown, // MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN + gMovementActionFuncs_AcroPopWheelieMoveUp, // MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_UP + gMovementActionFuncs_AcroPopWheelieMoveLeft, // MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT + gMovementActionFuncs_AcroPopWheelieMoveRight, // MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT + gMovementActionFuncs_AcroWheelieMoveDown, // MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN + gMovementActionFuncs_AcroWheelieMoveUp, // MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_UP + gMovementActionFuncs_AcroWheelieMoveLeft, // MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT + gMovementActionFuncs_AcroWheelieMoveRight, // MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT + gMovementActionFuncs_AcroEndWheelieMoveDown, // MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN + gMovementActionFuncs_AcroEndWheelieMoveUp, // MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_UP + gMovementActionFuncs_AcroEndWheelieMoveLeft, // MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT + gMovementActionFuncs_AcroEndWheelieMoveRight, // MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT + gMovementActionFuncs_WalkNormalDiagonalUpLeft, // MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_UP_LEFT + gMovementActionFuncs_WalkNormalDiagonalUpRight, // MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_UP_RIGHT + gMovementActionFuncs_WalkNormalDiagonalDownLeft, // MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_DOWN_LEFT + gMovementActionFuncs_WalkNormalDiagonalDownRight, // MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_DOWN_RIGHT + gMovementActionFuncs_WalkSlowDiagonalUpLeft, // MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_LEFT + gMovementActionFuncs_WalkSlowDiagonalUpRight, // MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_RIGHT + gMovementActionFuncs_WalkSlowDiagonalDownLeft, // MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_LEFT + gMovementActionFuncs_WalkSlowDiagonalDownRight, // MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_RIGHT + gMovementActionFuncs_StoreAndLockAnim, // MOVEMENT_ACTION_STORE_AND_LOCK_ANIM + gMovementActionFuncs_FreeAndUnlockAnim, // MOVEMENT_ACTION_FREE_AND_UNLOCK_ANIM + gMovementActionFuncs_WalkLeftAffine, // MOVEMENT_ACTION_WALK_LEFT_AFFINE + gMovementActionFuncs_WalkRightAffine, // MOVEMENT_ACTION_WALK_RIGHT_AFFINE + gMovementActionFuncs_Levitate, // MOVEMENT_ACTION_LEVITATE + gMovementActionFuncs_StopLevitate, // MOVEMENT_ACTION_STOP_LEVITATE + gMovementActionFuncs_DestroyExtraTaskIfAtTop, // MOVEMENT_ACTION_DESTROY_EXTRA_TASK_IF_AT_TOP + gMovementActionFuncs_Figure8, // MOVEMENT_ACTION_FIGURE_8 + gMovementActionFuncs_FlyUp, // MOVEMENT_ACTION_FLY_UP + gMovementActionFuncs_FlyDown, // MOVEMENT_ACTION_FLY_DOWN }; -u8 (*const gUnknown_0850DEC8[])(struct EventObject *, struct Sprite *) = { - sub_8093950, - sub_80964BC, +u8 (*const gMovementActionFuncs_FaceDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_FaceDown_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DED0[])(struct EventObject *, struct Sprite *) = { - sub_8093960, - sub_80964BC, +u8 (*const gMovementActionFuncs_FaceUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_FaceUp_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DED8[])(struct EventObject *, struct Sprite *) = { - sub_8093970, - sub_80964BC, +u8 (*const gMovementActionFuncs_FaceLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_FaceLeft_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DEE0[])(struct EventObject *, struct Sprite *) = { - sub_8093980, - sub_80964BC, +u8 (*const gMovementActionFuncs_FaceRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_FaceRight_Step0, + MovementAction_PauseSpriteAnim, }; u8 (*const gUnknown_0850DEE8[])(u8) = { - get_go_image_anim_num, - get_go_fast_image_anim_num, - get_go_fast_image_anim_num, - get_go_faster_image_anim_num, - get_go_fastest_image_anim_num, + GetMoveDirectionAnimNum, + GetMoveDirectionFastAnimNum, + GetMoveDirectionFastAnimNum, + GetMoveDirectionFasterAnimNum, + GetMoveDirectionFastestAnimNum, }; -u8 (*const gUnknown_0850DEFC[])(struct EventObject *, struct Sprite *) = { - sub_8093BC4, - sub_8093BC4_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkSlowDiagonalUpLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkSlowDiagonalUpLeft_Step0, + MovementAction_WalkSlowDiagonalUpLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF08[])(struct EventObject *, struct Sprite *) = { - sub_8093C04, - sub_8093C04_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkSlowDiagonalUpRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkSlowDiagonalUpRight_Step0, + MovementAction_WalkSlowDiagonalUpRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF14[])(struct EventObject *, struct Sprite *) = { - sub_8093C44, - sub_8093C44_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkSlowDiagonalDownLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkSlowDiagonalDownLeft_Step0, + MovementAction_WalkSlowDiagonalDownLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF20[])(struct EventObject *, struct Sprite *) = { - sub_8093C84, - sub_8093C84_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkSlowDiagonalDownRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkSlowDiagonalDownRight_Step0, + MovementAction_WalkSlowDiagonalDownRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF2C[])(struct EventObject *, struct Sprite *) = { - sub_8093CC4, - sub_8093CC4_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkSlowDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkSlowDown_Step0, + MovementAction_WalkSlowDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF38[])(struct EventObject *, struct Sprite *) = { - sub_8093D04, - sub_8093D04_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkSlowUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkSlowUp_Step0, + MovementAction_WalkSlowUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF44[])(struct EventObject *, struct Sprite *) = { - sub_8093D44, - sub_8093D44_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkSlowLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkSlowLeft_Step0, + MovementAction_WalkSlowLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF50[])(struct EventObject *, struct Sprite *) = { - sub_8093D84, - sub_8093D84_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkSlowRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkSlowRight_Step0, + MovementAction_WalkSlowRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF5C[])(struct EventObject *, struct Sprite *) = { - sub_8093DC4, - sub_8093DC4_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkNormalDiagonalUpLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkNormalDiagonalUpLeft_Step0, + MovementAction_WalkNormalDiagonalUpLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF68[])(struct EventObject *, struct Sprite *) = { - sub_8093E04, - sub_8093E04_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkNormalDiagonalUpRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkNormalDiagonalUpRight_Step0, + MovementAction_WalkNormalDiagonalUpRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF74[])(struct EventObject *, struct Sprite *) = { - sub_8093E44, - sub_8093E44_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkNormalDiagonalDownLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkNormalDiagonalDownLeft_Step0, + MovementAction_WalkNormalDiagonalDownLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF80[])(struct EventObject *, struct Sprite *) = { - sub_8093E84, - sub_8093E84_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkNormalDiagonalDownRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkNormalDiagonalDownRight_Step0, + MovementAction_WalkNormalDiagonalDownRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF8C[])(struct EventObject *, struct Sprite *) = { - sub_8093EC4, - sub_8093EC4_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkNormalDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkNormalDown_Step0, + MovementAction_WalkNormalDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DF98[])(struct EventObject *, struct Sprite *) = { - sub_8093F04, - sub_8093F04_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkNormalUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkNormalUp_Step0, + MovementAction_WalkNormalUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DFA4[])(struct EventObject *, struct Sprite *) = { - sub_8093F44, - sub_8093F44_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkNormalLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkNormalLeft_Step0, + MovementAction_WalkNormalLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DFB0[])(struct EventObject *, struct Sprite *) = { - sub_8093F84, - sub_8093F84_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkNormalRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkNormalRight_Step0, + MovementAction_WalkNormalRight_Step1, + MovementAction_PauseSpriteAnim, }; const s16 gUnknown_0850DFBC[] = {0, 1, 1}; const s16 gUnknown_0850DFC2[] = {0, 0, 1}; -u8 (*const gUnknown_0850DFC8[])(struct EventObject *, struct Sprite *) = { - sub_8094230, - sub_8094230_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_Jump2Down[])(struct EventObject *, struct Sprite *) = { + MovementAction_Jump2Down_Step0, + MovementAction_Jump2Down_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DFD4[])(struct EventObject *, struct Sprite *) = { - sub_8094288, - sub_8094288_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_Jump2Up[])(struct EventObject *, struct Sprite *) = { + MovementAction_Jump2Up_Step0, + MovementAction_Jump2Up_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DFE0[])(struct EventObject *, struct Sprite *) = { - sub_80942E0, - sub_80942E0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_Jump2Left[])(struct EventObject *, struct Sprite *) = { + MovementAction_Jump2Left_Step0, + MovementAction_Jump2Left_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DFEC[])(struct EventObject *, struct Sprite *) = { - sub_8094338, - sub_8094338_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_Jump2Right[])(struct EventObject *, struct Sprite *) = { + MovementAction_Jump2Right_Step0, + MovementAction_Jump2Right_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DFF8[])(struct EventObject *, struct Sprite *) = { - sub_80943B4, - sub_8094398, - sub_80964B8, +u8 (*const gMovementActionFuncs_Delay1[])(struct EventObject *, struct Sprite *) = { + MovementAction_Delay1_Step0, + MovementAction_Delay_Step1, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E004[])(struct EventObject *, struct Sprite *) = { - sub_80943D4, - sub_8094398, - sub_80964B8, +u8 (*const gMovementActionFuncs_Delay2[])(struct EventObject *, struct Sprite *) = { + MovementAction_Delay2_Step0, + MovementAction_Delay_Step1, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E010[])(struct EventObject *, struct Sprite *) = { - sub_80943F4, - sub_8094398, - sub_80964B8, +u8 (*const gMovementActionFuncs_Delay4[])(struct EventObject *, struct Sprite *) = { + MovementAction_Delay4_Step0, + MovementAction_Delay_Step1, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E01C[])(struct EventObject *, struct Sprite *) = { - sub_8094414, - sub_8094398, - sub_80964B8, +u8 (*const gMovementActionFuncs_Delay8[])(struct EventObject *, struct Sprite *) = { + MovementAction_Delay8_Step0, + MovementAction_Delay_Step1, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E028[])(struct EventObject *, struct Sprite *) = { - sub_8094434, - sub_8094398, - sub_80964B8, +u8 (*const gMovementActionFuncs_Delay16[])(struct EventObject *, struct Sprite *) = { + MovementAction_Delay16_Step0, + MovementAction_Delay_Step1, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E034[])(struct EventObject *, struct Sprite *) = { - sub_8094454, - sub_8094454_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkFastDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkFastDown_Step0, + MovementAction_WalkFastDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E040[])(struct EventObject *, struct Sprite *) = { - sub_8094494, - sub_8094494_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkFastUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkFastUp_Step0, + MovementAction_WalkFastUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E04C[])(struct EventObject *, struct Sprite *) = { - sub_80944D4, - sub_80944D4_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkFastLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkFastLeft_Step0, + MovementAction_WalkFastLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E058[])(struct EventObject *, struct Sprite *) = { - sub_8094514, - sub_8094514_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkFastRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkFastRight_Step0, + MovementAction_WalkFastRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E064[])(struct EventObject *, struct Sprite *) = { - sub_8094600, - sub_80945C4, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceSlowDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceSlowDown_Step0, + MovementAction_WalkInPlaceSlow_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E070[])(struct EventObject *, struct Sprite *) = { - sub_8094638, - sub_80945C4, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceSlowUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceSlowUp_Step0, + MovementAction_WalkInPlaceSlow_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E07C[])(struct EventObject *, struct Sprite *) = { - sub_8094670, - sub_80945C4, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceSlowLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceSlowLeft_Step0, + MovementAction_WalkInPlaceSlow_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E088[])(struct EventObject *, struct Sprite *) = { - sub_80946A8, - sub_80945C4, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceSlowRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceSlowRight_Step0, + MovementAction_WalkInPlaceSlow_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E094[])(struct EventObject *, struct Sprite *) = { - sub_80946E0, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceNormalDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceNormalDown_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E0A0[])(struct EventObject *, struct Sprite *) = { - sub_8094718, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceNormalUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceNormalUp_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E0AC[])(struct EventObject *, struct Sprite *) = { - sub_8094750, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceNormalLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceNormalLeft_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E0B8[])(struct EventObject *, struct Sprite *) = { - sub_8094788, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceNormalRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceNormalRight_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E0C4[])(struct EventObject *, struct Sprite *) = { - sub_80947C0, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceFastDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceFastDown_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E0D0[])(struct EventObject *, struct Sprite *) = { - sub_80947F8, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceFastUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceFastUp_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E0DC[])(struct EventObject *, struct Sprite *) = { - sub_8094830, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceFastLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceFastLeft_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E0E8[])(struct EventObject *, struct Sprite *) = { - sub_8094868, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceFastRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceFastRight_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E0F4[])(struct EventObject *, struct Sprite *) = { - sub_80948A0, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceFastestDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceFastestDown_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E100[])(struct EventObject *, struct Sprite *) = { - sub_80948D8, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceFastestUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceFastestUp_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E10C[])(struct EventObject *, struct Sprite *) = { - sub_8094910, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceFastestLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceFastestLeft_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E118[])(struct EventObject *, struct Sprite *) = { - sub_8094948, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkInPlaceFastestRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkInPlaceFastestRight_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E124[])(struct EventObject *, struct Sprite *) = { - sub_8094980, - sub_8094980_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_RideWaterCurrentDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_RideWaterCurrentDown_Step0, + MovementAction_RideWaterCurrentDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E130[])(struct EventObject *, struct Sprite *) = { - sub_80949C0, - sub_80949C0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_RideWaterCurrentUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_RideWaterCurrentUp_Step0, + MovementAction_RideWaterCurrentUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E13C[])(struct EventObject *, struct Sprite *) = { - sub_8094A00, - sub_8094A00_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_RideWaterCurrentLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_RideWaterCurrentLeft_Step0, + MovementAction_RideWaterCurrentLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E148[])(struct EventObject *, struct Sprite *) = { - sub_8094A40, - sub_8094A40_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_RideWaterCurrentRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_RideWaterCurrentRight_Step0, + MovementAction_RideWaterCurrentRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E154[])(struct EventObject *, struct Sprite *) = { - sub_8094A80, - sub_8094A80_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkFastestDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkFastestDown_Step0, + MovementAction_WalkFastestDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E160[])(struct EventObject *, struct Sprite *) = { - sub_8094AC0, - sub_8094AC0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkFastestUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkFastestUp_Step0, + MovementAction_WalkFastestUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E16C[])(struct EventObject *, struct Sprite *) = { - sub_8094B00, - sub_8094B00_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkFastestLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkFastestLeft_Step0, + MovementAction_WalkFastestLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E178[])(struct EventObject *, struct Sprite *) = { - sub_8094B40, - sub_8094B40_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkFastestRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkFastestRight_Step0, + MovementAction_WalkFastestRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E184[])(struct EventObject *, struct Sprite *) = { - sub_8094B80, - sub_8094B80_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_SlideDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_SlideDown_Step0, + MovementAction_SlideDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E190[])(struct EventObject *, struct Sprite *) = { - sub_8094BC0, - sub_8094BC0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_SlideUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_SlideUp_Step0, + MovementAction_SlideUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E19C[])(struct EventObject *, struct Sprite *) = { - sub_8094C00, - sub_8094C00_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_SlideLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_SlideLeft_Step0, + MovementAction_SlideLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E1A8[])(struct EventObject *, struct Sprite *) = { - sub_8094C40, - sub_8094C40_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_SlideRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_SlideRight_Step0, + MovementAction_SlideRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E1B4[])(struct EventObject *, struct Sprite *) = { - sub_8094C80, - sub_8094C80_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_PlayerRunDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_PlayerRunDown_Step0, + MovementAction_PlayerRunDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E1C0[])(struct EventObject *, struct Sprite *) = { - sub_8094CC0, - sub_8094CC0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_PlayerRunUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_PlayerRunUp_Step0, + MovementAction_PlayerRunUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E1CC[])(struct EventObject *, struct Sprite *) = { - sub_8094D00, - sub_8094D00_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_PlayerRunLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_PlayerRunLeft_Step0, + MovementAction_PlayerRunLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E1D8[])(struct EventObject *, struct Sprite *) = { - sub_8094D40, - sub_8094D40_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_PlayerRunRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_PlayerRunRight_Step0, + MovementAction_PlayerRunRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E1E4[])(struct EventObject *, struct Sprite *) = { - sub_8094DAC, - sub_8094DC4, - sub_80964BC, +u8 (*const gMovementActionFuncs_StartAnimInDirection[])(struct EventObject *, struct Sprite *) = { + MovementAction_StartAnimInDirection_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E1F0[])(struct EventObject *, struct Sprite *) = { - sub_8094E18, - sub_8094E18_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpSpecialDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpSpecialDown_Step0, + MovementAction_JumpSpecialDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E1FC[])(struct EventObject *, struct Sprite *) = { - sub_8094E60, - sub_8094E60_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpSpecialUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpSpecialUp_Step0, + MovementAction_JumpSpecialUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E208[])(struct EventObject *, struct Sprite *) = { - sub_8094EB8, - sub_8094EB8_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpSpecialLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpSpecialLeft_Step0, + MovementAction_JumpSpecialLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E214[])(struct EventObject *, struct Sprite *) = { - sub_8094710, - sub_8094710_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpSpecialRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpSpecialRight_Step0, + MovementAction_JumpSpecialRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E220[])(struct EventObject *, struct Sprite *) = { - sub_8094F38, - sub_80964BC, +u8 (*const gMovementActionFuncs_FacePlayer[])(struct EventObject *, struct Sprite *) = { + MovementAction_FacePlayer_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E228[])(struct EventObject *, struct Sprite *) = { - sub_8094F94, - sub_80964BC, +u8 (*const gMovementActionFuncs_FaceAwayPlayer[])(struct EventObject *, struct Sprite *) = { + MovementAction_FaceAwayPlayer_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E230[])(struct EventObject *, struct Sprite *) = { - sub_8094FF8, - sub_80964BC, +u8 (*const gMovementActionFuncs_LockFacingDirection[])(struct EventObject *, struct Sprite *) = { + MovementAction_LockFacingDirection_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E238[])(struct EventObject *, struct Sprite *) = { - sub_8095008, - sub_80964BC, +u8 (*const gMovementActionFuncs_UnlockFacingDirection[])(struct EventObject *, struct Sprite *) = { + MovementAction_UnlockFacingDirection_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E240[])(struct EventObject *, struct Sprite *) = { - sub_8095018, - sub_8095018_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpDown_Step0, + MovementAction_JumpDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E24C[])(struct EventObject *, struct Sprite *) = { - sub_8095070, - sub_8095070_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpUp_Step0, + MovementAction_JumpUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E258[])(struct EventObject *, struct Sprite *) = { - sub_80950C8, - sub_80950C8_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpLeft_Step0, + MovementAction_JumpLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E264[])(struct EventObject *, struct Sprite *) = { - sub_8095120, - sub_8095120_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpRight_Step0, + MovementAction_JumpRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E270[])(struct EventObject *, struct Sprite *) = { - sub_8095178, - sub_8095178_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpInPlaceDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpInPlaceDown_Step0, + MovementAction_JumpInPlaceDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E27C[])(struct EventObject *, struct Sprite *) = { - sub_80951D0, - sub_80951D0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpInPlaceUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpInPlaceUp_Step0, + MovementAction_JumpInPlaceUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E288[])(struct EventObject *, struct Sprite *) = { - sub_8095228, - sub_8095228_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpInPlaceLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpInPlaceLeft_Step0, + MovementAction_JumpInPlaceLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E294[])(struct EventObject *, struct Sprite *) = { - sub_8095280, - sub_8095280_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpInPlaceRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpInPlaceRight_Step0, + MovementAction_JumpInPlaceRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E2A0[])(struct EventObject *, struct Sprite *) = { - sub_80952D8, - sub_80952D8_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpInPlaceDownUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpInPlaceDownUp_Step0, + MovementAction_JumpInPlaceDownUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E2AC[])(struct EventObject *, struct Sprite *) = { - sub_8095330, - sub_8095330_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpInPlaceUpDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpInPlaceUpDown_Step0, + MovementAction_JumpInPlaceUpDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E2B8[])(struct EventObject *, struct Sprite *) = { - sub_8095388, - sub_8095388_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpInPlaceLeftRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpInPlaceLeftRight_Step0, + MovementAction_JumpInPlaceLeftRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E2C4[])(struct EventObject *, struct Sprite *) = { - sub_80953E0, - sub_80953E0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_JumpInPlaceRightLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_JumpInPlaceRightLeft_Step0, + MovementAction_JumpInPlaceRightLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E2D0[])(struct EventObject *, struct Sprite *) = { - sub_8095438, - sub_80964BC, +u8 (*const gMovementActionFuncs_FaceOriginalDirection[])(struct EventObject *, struct Sprite *) = { + MovementAction_FaceOriginalDirection_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E2D8[])(struct EventObject *, struct Sprite *) = { - sub_8095450, - sub_8094DC4, - sub_80964BC, +u8 (*const gMovementActionFuncs_NurseJoyBowDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_NurseJoyBowDown_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E2E4[])(struct EventObject *, struct Sprite *) = { - sub_8095460, - sub_80964B8, +u8 (*const gMovementActionFuncs_EnableJumpLandingGroundEffect[])(struct EventObject *, struct Sprite *) = { + MovementAction_EnableJumpLandingGroundEffect_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E2EC[])(struct EventObject *, struct Sprite *) = { - sub_8095470, - sub_80964B8, +u8 (*const gMovementActionFuncs_DisableJumpLandingGroundEffect[])(struct EventObject *, struct Sprite *) = { + MovementAction_DisableJumpLandingGroundEffect_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E2F4[])(struct EventObject *, struct Sprite *) = { - sub_8095480, - sub_80964B8, +u8 (*const gMovementActionFuncs_DisableAnimation[])(struct EventObject *, struct Sprite *) = { + MovementAction_DisableAnimation_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E2FC[])(struct EventObject *, struct Sprite *) = { - sub_8095490, - sub_80964B8, +u8 (*const gMovementActionFuncs_RestoreAnimation[])(struct EventObject *, struct Sprite *) = { + MovementAction_RestoreAnimation_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E304[])(struct EventObject *, struct Sprite *) = { - sub_80954BC, - sub_80964B8, +u8 (*const gMovementActionFuncs_SetInvisible[])(struct EventObject *, struct Sprite *) = { + MovementAction_SetInvisible_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E30C[])(struct EventObject *, struct Sprite *) = { - sub_80954CC, - sub_80964B8, +u8 (*const gMovementActionFuncs_SetVisible[])(struct EventObject *, struct Sprite *) = { + MovementAction_SetVisible_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E314[])(struct EventObject *, struct Sprite *) = { - do_exclamation_mark_bubble_1, - sub_80964B8, +u8 (*const gMovementActionFuncs_EmoteExclamationMark[])(struct EventObject *, struct Sprite *) = { + MovementAction_EmoteExclamationMark_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E31C[])(struct EventObject *, struct Sprite *) = { - do_exclamation_mark_bubble_2, - sub_80964B8, +u8 (*const gMovementActionFuncs_EmoteQuestionMark[])(struct EventObject *, struct Sprite *) = { + MovementAction_EmoteQuestionMark_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E324[])(struct EventObject *, struct Sprite *) = { - do_heart_bubble, - sub_80964B8, +u8 (*const gMovementActionFuncs_EmoteHeart[])(struct EventObject *, struct Sprite *) = { + MovementAction_EmoteHeart_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E32C[])(struct EventObject *, struct Sprite *) = { - sub_8095548, - sub_809558C, - sub_80964B8, +u8 (*const gMovementActionFuncs_RevealTrainer[])(struct EventObject *, struct Sprite *) = { + MovementAction_RevealTrainer_Step0, + MovementAction_RevealTrainer_Step1, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E338[])(struct EventObject *, struct Sprite *) = { - sub_80955AC, - sub_80955C8, - sub_80955EC, - sub_80964B8, +u8 (*const gMovementActionFuncs_RockSmashBreak[])(struct EventObject *, struct Sprite *) = { + MovementAction_RockSmashBreak_Step0, + MovementAction_RockSmashBreak_Step1, + MovementAction_RockSmashBreak_Step2, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E348[])(struct EventObject *, struct Sprite *) = { - sub_8095628, - sub_8095644, - sub_8095668, - sub_80964B8, +u8 (*const gMovementActionFuncs_CutTree[])(struct EventObject *, struct Sprite *) = { + MovementAction_CutTree_Step0, + MovementAction_CutTree_Step1, + MovementAction_CutTree_Step2, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E358[])(struct EventObject *, struct Sprite *) = { - sub_80956A4, - sub_80964B8, +u8 (*const gMovementActionFuncs_SetFixedPriority[])(struct EventObject *, struct Sprite *) = { + MovementAction_SetFixedPriority_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E360[])(struct EventObject *, struct Sprite *) = { - sub_80956B4, - sub_80964B8, +u8 (*const gMovementActionFuncs_ClearFixedPriority[])(struct EventObject *, struct Sprite *) = { + MovementAction_ClearFixedPriority_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E368[])(struct EventObject *, struct Sprite *) = { - sub_80956C4, - sub_80964B8, +u8 (*const gMovementActionFuncs_InitAffineAnim[])(struct EventObject *, struct Sprite *) = { + MovementAction_InitAffineAnim_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E370[])(struct EventObject *, struct Sprite *) = { - sub_80956F4, - sub_80964B8, +u8 (*const gMovementActionFuncs_ClearAffineAnim[])(struct EventObject *, struct Sprite *) = { + MovementAction_ClearAffineAnim_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E378[])(struct EventObject *, struct Sprite *) = { - sub_8095724, - sub_80964B8, +u8 (*const gMovementActionFuncs_Unknown1[])(struct EventObject *, struct Sprite *) = { + MovementAction_Unknown1_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E380[])(struct EventObject *, struct Sprite *) = { - sub_8095730, - sub_80964B8, +u8 (*const gMovementActionFuncs_Unknown2[])(struct EventObject *, struct Sprite *) = { + MovementAction_Unknown2_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E388[])(struct EventObject *, struct Sprite *) = { - sub_8095740, - sub_8095740_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkDownStartAffine[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkDownStartAffine_Step0, + MovementAction_WalkDownStartAffine_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E394[])(struct EventObject *, struct Sprite *) = { - sub_80957A0, - sub_80957A0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkDownAffine[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkDownAffine_Step0, + MovementAction_WalkDownAffine_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E3A0[])(struct EventObject *, struct Sprite *) = { - sub_8095800, - sub_8095800_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkLeftAffine[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkLeftAffine_Step0, + MovementAction_WalkLeftAffine_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E3AC[])(struct EventObject *, struct Sprite *) = { - sub_8095860, - sub_8095860_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_WalkRightAffine[])(struct EventObject *, struct Sprite *) = { + MovementAction_WalkRightAffine_Step0, + MovementAction_WalkRightAffine_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E3B8[])(struct EventObject *, struct Sprite *) = { - sub_8095900, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieFaceDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieFaceDown_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E3C0[])(struct EventObject *, struct Sprite *) = { - sub_8095910, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieFaceUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieFaceUp_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E3C8[])(struct EventObject *, struct Sprite *) = { - sub_8095920, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieFaceLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieFaceLeft_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E3D0[])(struct EventObject *, struct Sprite *) = { - sub_8095930, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieFaceRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieFaceRight_Step0, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E3D8[])(struct EventObject *, struct Sprite *) = { - sub_8095940, - sub_8094DC4, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroPopWheelieDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroPopWheelieDown_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E3E4[])(struct EventObject *, struct Sprite *) = { - sub_8095964, - sub_8094DC4, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroPopWheelieUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroPopWheelieUp_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E3F0[])(struct EventObject *, struct Sprite *) = { - sub_8095988, - sub_8094DC4, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroPopWheelieLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroPopWheelieLeft_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E3FC[])(struct EventObject *, struct Sprite *) = { - sub_80959AC, - sub_8094DC4, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroPopWheelieRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroPopWheelieRight_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E408[])(struct EventObject *, struct Sprite *) = { - sub_80959D0, - sub_8094DC4, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroEndWheelieFaceDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroEndWheelieFaceDown_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E414[])(struct EventObject *, struct Sprite *) = { - sub_80959F4, - sub_8094DC4, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroEndWheelieFaceUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroEndWheelieFaceUp_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E420[])(struct EventObject *, struct Sprite *) = { - sub_8095A18, - sub_8094DC4, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroEndWheelieFaceLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroEndWheelieFaceLeft_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E42C[])(struct EventObject *, struct Sprite *) = { - sub_8095A3C, - sub_8094DC4, - sub_80964BC, - sub_8095A60, - sub_8094DC4, - sub_80964BC, - sub_8095A84, - sub_8094DC4, - sub_80964BC, - sub_8095AA8, - sub_8094DC4, - sub_80964BC, - sub_8095ACC, - sub_8094DC4, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroEndWheelieFaceRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroEndWheelieFaceRight_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E468[])(struct EventObject *, struct Sprite *) = { - sub_8095B44, - sub_8095B64, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroUnusedAcroActionDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_UnusedAcroActionDown_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E474[])(struct EventObject *, struct Sprite *) = { - sub_8095BC8, - sub_8095BC8_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroUnusedAcroActionUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_UnusedAcroActionUp_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E480[])(struct EventObject *, struct Sprite *) = { - sub_8095C20, - sub_8095C20_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroUnusedAcroActionLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_UnusedAcroActionLeft_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E48C[])(struct EventObject *, struct Sprite *) = { - sub_8095C78, - sub_8095C78_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroUnusedAcroActionRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_UnusedAcroActionRight_Step0, + MovementAction_WaitSpriteAnim, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E498[])(struct EventObject *, struct Sprite *) = { - sub_8095CD0, - sub_8095CD0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_Figure8[])(struct EventObject *, struct Sprite *) = { + MovementAction_Figure8_Step0, + MovementAction_Figure8_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E4A4[])(struct EventObject *, struct Sprite *) = { - sub_8095D28, - sub_8095D28_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieHopFaceDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieHopFaceDown_Step0, + MovementAction_AcroWheelieHopFaceDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E4B0[])(struct EventObject *, struct Sprite *) = { - sub_8095D80, - sub_8095D80_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieHopFaceUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieHopFaceUp_Step0, + MovementAction_AcroWheelieHopFaceUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E4BC[])(struct EventObject *, struct Sprite *) = { - sub_8095DD8, - sub_8095DD8_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieHopFaceLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieHopFaceLeft_Step0, + MovementAction_AcroWheelieHopFaceLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E4C8[])(struct EventObject *, struct Sprite *) = { - sub_8095E30, - sub_8095E30_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieHopFaceRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieHopFaceRight_Step0, + MovementAction_AcroWheelieHopFaceRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E4D4[])(struct EventObject *, struct Sprite *) = { - sub_8095E88, - sub_8095E88_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieHopDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieHopDown_Step0, + MovementAction_AcroWheelieHopDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E4E0[])(struct EventObject *, struct Sprite *) = { - sub_8095EE0, - sub_8095EE0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieHopUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieHopUp_Step0, + MovementAction_AcroWheelieHopUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E4EC[])(struct EventObject *, struct Sprite *) = { - sub_8095F38, - sub_8095F38_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieHopLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieHopLeft_Step0, + MovementAction_AcroWheelieHopLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E4F8[])(struct EventObject *, struct Sprite *) = { - sub_8095F90, - sub_8095F90_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieHopRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieHopRight_Step0, + MovementAction_AcroWheelieHopRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E504[])(struct EventObject *, struct Sprite *) = { - sub_8095FE8, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieJumpDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieJumpDown_Step0, + MovementAction_AcroWheelieJumpDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E510[])(struct EventObject *, struct Sprite *) = { - sub_8096020, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieJumpUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieJumpUp_Step0, + MovementAction_AcroWheelieJumpUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E51C[])(struct EventObject *, struct Sprite *) = { - sub_8096058, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieJumpLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieJumpLeft_Step0, + MovementAction_AcroWheelieJumpLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E528[])(struct EventObject *, struct Sprite *) = { - sub_8096090, - sub_809459C, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieJumpRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieJumpRight_Step0, + MovementAction_AcroWheelieJumpRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E534[])(struct EventObject *, struct Sprite *) = { - sub_8096100, - sub_8096100_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieInPlaceDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieInPlaceDown_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E540[])(struct EventObject *, struct Sprite *) = { - sub_8096140, - sub_8096140_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieInPlaceUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieInPlaceUp_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E54C[])(struct EventObject *, struct Sprite *) = { - sub_8096180, - sub_8096180_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieInPlaceLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieInPlaceLeft_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E558[])(struct EventObject *, struct Sprite *) = { - sub_80961C0, - sub_80961C0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieInPlaceRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieInPlaceRight_Step0, + MovementAction_WalkInPlace_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E564[])(struct EventObject *, struct Sprite *) = { - sub_8096230, - sub_8096230_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroPopWheelieMoveDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroPopWheelieMoveDown_Step0, + MovementAction_AcroPopWheelieMoveDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E570[])(struct EventObject *, struct Sprite *) = { - sub_8096270, - sub_8096270_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroPopWheelieMoveUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroPopWheelieMoveUp_Step0, + MovementAction_AcroPopWheelieMoveUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E57C[])(struct EventObject *, struct Sprite *) = { - sub_80962B0, - sub_80962B0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroPopWheelieMoveLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroPopWheelieMoveLeft_Step0, + MovementAction_AcroPopWheelieMoveLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E588[])(struct EventObject *, struct Sprite *) = { - sub_80962F0, - sub_80962F0_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroPopWheelieMoveRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroPopWheelieMoveRight_Step0, + MovementAction_AcroPopWheelieMoveRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E594[])(struct EventObject *, struct Sprite *) = { - sub_8096368, - sub_8096368_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieMoveDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieMoveDown_Step0, + MovementAction_AcroWheelieMoveDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E5A0[])(struct EventObject *, struct Sprite *) = { - sub_80963A8, - sub_80963A8_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieMoveUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieMoveUp_Step0, + MovementAction_AcroWheelieMoveUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E5AC[])(struct EventObject *, struct Sprite *) = { - sub_80963E8, - sub_80963E8_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieMoveLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieMoveLeft_Step0, + MovementAction_AcroWheelieMoveLeft_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E5B8[])(struct EventObject *, struct Sprite *) = { - sub_8096428, - sub_8096428_2, - sub_80964BC, +u8 (*const gMovementActionFuncs_AcroWheelieMoveRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroWheelieMoveRight_Step0, + MovementAction_AcroWheelieMoveRight_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E5C4[])(struct EventObject *, struct Sprite *) = { - sub_8096468, - sub_80964B8, +u8 (*const gMovementActionFuncs_AcroEndWheelieMoveDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroEndWheelieMoveDown_Step0, + MovementAction_AcroEndWheelieMoveDown_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E5CC[])(struct EventObject *, struct Sprite *) = { - sub_809647C, - sub_80964B8, +u8 (*const gMovementActionFuncs_AcroEndWheelieMoveUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroEndWheelieMoveUp_Step0, + MovementAction_AcroEndWheelieMoveUp_Step1, + MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850E5D4[])(struct EventObject *, struct Sprite *) = { - sub_8096494, - sub_80964B8, +u8 (*const gMovementActionFuncs_AcroEndWheelieMoveLeft[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroEndWheelieMoveLeft_Step0, + MovementAction_AcroEndWheelieMoveLeft_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_AcroEndWheelieMoveRight[])(struct EventObject *, struct Sprite *) = { + MovementAction_AcroEndWheelieMoveRight_Step0, + MovementAction_AcroEndWheelieMoveRight_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_Levitate[])(struct EventObject *, struct Sprite *) = { + MovementAction_Levitate_Step0, + MovementAction_Finish, +}; + +u8 (*const gMovementActionFuncs_StopLevitate[])(struct EventObject *, struct Sprite *) = { + MovementAction_StopLevitate_Step0, + MovementAction_Finish, +}; + +u8 (*const gMovementActionFuncs_DestroyExtraTaskIfAtTop[])(struct EventObject *, struct Sprite *) = { + MovementAction_DestroyExtraTaskIfAtTop_Step0, + MovementAction_Finish, }; #endif //GUARD_MOVEMENT_ACTION_FUNC_TABLES_H diff --git a/src/data/field_event_obj/movement_type_func_tables.h b/src/data/field_event_obj/movement_type_func_tables.h index 3b18c90d1..165e96220 100755 --- a/src/data/field_event_obj/movement_type_func_tables.h +++ b/src/data/field_event_obj/movement_type_func_tables.h @@ -1,443 +1,443 @@ #ifndef GUARD_MOVEMENT_TYPE_FUNC_TABLES_H #define GUARD_MOVEMENT_TYPE_FUNC_TABLES_H -u8 (*const gUnknown_0850D6F4[])(struct EventObject *, struct Sprite *) = { - sub_808F44C, - sub_808F460, - sub_808F48C, - sub_808F4C8, - sub_808F4E8, - sub_808F534, - sub_808F564, +u8 (*const gMovementTypeFuncs_WanderAround[])(struct EventObject *, struct Sprite *) = { + MovementType_WanderAround_Step0, + MovementType_WanderAround_Step1, + MovementType_WanderAround_Step2, + MovementType_WanderAround_Step3, + MovementType_WanderAround_Step4, + MovementType_WanderAround_Step5, + MovementType_WanderAround_Step6, }; -const u8 gUnknown_0850D710[] = {DIR_SOUTH, DIR_NORTH, DIR_WEST, DIR_EAST}; +const u8 gStandardDirections[] = {DIR_SOUTH, DIR_NORTH, DIR_WEST, DIR_EAST}; -u8 (*const gUnknown_0850D714[])(s16, s16, s16, s16) = { - GetRegularRunningPastFacingDirection, - GetNorthSouthRunningPastFacingDirection, - GetEastWestRunningPastFacingDirection, - GetNorthEastRunningPastFacingDirection, - GetNorthWestRunningPastFacingDirection, - GetSouthEastRunningPastFacingDirection, - GetSouthWestRunningPastFacingDirection, - GetNonEastRunningPastFacingDirection, - GetNonWestRunningPastFacingDirection, - GetNonSouthRunningPastFacingDirection, - GetNonNorthRunningPastFacingDirection, +u8 (*const gGetVectorDirectionFuncs[])(s16, s16, s16, s16) = { + GetVectorDirection, + GetLimitedVectorDirection_SouthNorth, + GetLimitedVectorDirection_WestEast, + GetLimitedVectorDirection_WestNorth, + GetLimitedVectorDirection_EastNorth, + GetLimitedVectorDirection_WestSouth, + GetLimitedVectorDirection_EastSouth, + GetLimitedVectorDirection_SouthNorthWest, + GetLimitedVectorDirection_SouthNorthEast, + GetLimitedVectorDirection_NorthWestEast, + GetLimitedVectorDirection_SouthWestEast, }; -u8 (*const gUnknown_0850D740[])(struct EventObject *, struct Sprite *) = { - sub_808F988, - sub_808F99C, - sub_808F9C8, - sub_808FA0C, - sub_808FA3C, +u8 (*const gMovementTypeFuncs_LookAround[])(struct EventObject *, struct Sprite *) = { + MovementType_LookAround_Step0, + MovementType_LookAround_Step1, + MovementType_LookAround_Step2, + MovementType_LookAround_Step3, + MovementType_LookAround_Step4, }; -u8 (*const gUnknown_0850D754[])(struct EventObject *, struct Sprite *) = { - sub_808FAC8, - sub_808FADC, - sub_808FB08, - sub_808FB44, - sub_808FB64, - sub_808FBB0, - sub_808FBE0, +u8 (*const gMovementTypeFuncs_WanderUpAndDown[])(struct EventObject *, struct Sprite *) = { + MovementType_WanderUpAndDown_Step0, + MovementType_WanderUpAndDown_Step1, + MovementType_WanderUpAndDown_Step2, + MovementType_WanderUpAndDown_Step3, + MovementType_WanderUpAndDown_Step4, + MovementType_WanderUpAndDown_Step5, + MovementType_WanderUpAndDown_Step6, }; -const u8 gUnknown_0850D770[] = {DIR_SOUTH, DIR_NORTH}; +const u8 gUpAndDownDirections[] = {DIR_SOUTH, DIR_NORTH}; -u8 (*const gUnknown_0850D774[])(struct EventObject *, struct Sprite *) = { - sub_808FC4C, - sub_808FC60, - sub_808FC8C, - sub_808FCC8, - sub_808FCE8, - sub_808FD34, - sub_808FD64, +u8 (*const gMovementTypeFuncs_WanderLeftAndRight[])(struct EventObject *, struct Sprite *) = { + MovementType_WanderLeftAndRight_Step0, + MovementType_WanderLeftAndRight_Step1, + MovementType_WanderLeftAndRight_Step2, + MovementType_WanderLeftAndRight_Step3, + MovementType_WanderLeftAndRight_Step4, + MovementType_WanderLeftAndRight_Step5, + MovementType_WanderLeftAndRight_Step6, }; -const u8 gUnknown_0850D790[] = {DIR_WEST, DIR_EAST}; +const u8 gLeftAndRightDirections[] = {DIR_WEST, DIR_EAST}; -u8 (*const gUnknown_0850D794[])(struct EventObject *, struct Sprite *) = { - sub_808FDD0, - sub_808FDFC, - sub_808FE1C, +u8 (*const gMovementTypeFuncs_FaceDirection[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceDirection_Step0, + MovementType_FaceDirection_Step1, + MovementType_FaceDirection_Step2, }; -u8 (*const gUnknown_0850D7A0[])(struct EventObject *, struct Sprite *) = { - do_berry_tree_growth_sparkle_1, - sub_808FF48, - do_berry_tree_growth_sparkle_2, - sub_808FFB4, - sub_8090004, +u8 (*const gMovementTypeFuncs_BerryTreeGrowth[])(struct EventObject *, struct Sprite *) = { + MovementType_BerryTreeGrowth_Step0, + MovementType_BerryTreeGrowth_Step1, + MovementType_BerryTreeGrowth_Step2, + MovementType_BerryTreeGrowth_Step3, + MovementType_BerryTreeGrowth_Step4, }; -u8 (*const gUnknown_0850D7B4[])(struct EventObject *, struct Sprite *) = { - sub_8090094, - sub_80900A8, - sub_80900D4, - sub_8090118, - sub_8090148, +u8 (*const gMovementTypeFuncs_FaceDownAndUp[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceDownAndUp_Step0, + MovementType_FaceDownAndUp_Step1, + MovementType_FaceDownAndUp_Step2, + MovementType_FaceDownAndUp_Step3, + MovementType_FaceDownAndUp_Step4, }; -u8 (*const gUnknown_0850D7C8[])(struct EventObject *, struct Sprite *) = { - sub_80901D4, - sub_80901E8, - sub_8090214, - sub_8090258, - sub_8090288, +u8 (*const gMovementTypeFuncs_FaceLeftAndRight[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceLeftAndRight_Step0, + MovementType_FaceLeftAndRight_Step1, + MovementType_FaceLeftAndRight_Step2, + MovementType_FaceLeftAndRight_Step3, + MovementType_FaceLeftAndRight_Step4, }; -u8 (*const gUnknown_0850D7DC[])(struct EventObject *, struct Sprite *) = { - sub_8090314, - sub_8090328, - sub_8090354, - sub_8090398, - sub_80903C8, +u8 (*const gMovementTypeFuncs_FaceUpAndLeft[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceUpAndLeft_Step0, + MovementType_FaceUpAndLeft_Step1, + MovementType_FaceUpAndLeft_Step2, + MovementType_FaceUpAndLeft_Step3, + MovementType_FaceUpAndLeft_Step4, }; -const u8 gUnknown_0850D7F0[] = {DIR_NORTH, DIR_WEST}; +const u8 gUpAndLeftDirections[] = {DIR_NORTH, DIR_WEST}; -u8 (*const gUnknown_0850D7F4[])(struct EventObject *, struct Sprite *) = { - sub_8090454, - sub_8090468, - sub_8090494, - sub_80904D8, - sub_8090508, +u8 (*const gMovementTypeFuncs_FaceUpAndRight[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceUpAndRight_Step0, + MovementType_FaceUpAndRight_Step1, + MovementType_FaceUpAndRight_Step2, + MovementType_FaceUpAndRight_Step3, + MovementType_FaceUpAndRight_Step4, }; -const u8 gUnknown_0850D808[] = {DIR_NORTH, DIR_EAST}; +const u8 gUpAndRightDirections[] = {DIR_NORTH, DIR_EAST}; -u8 (*const gUnknown_0850D80C[])(struct EventObject *, struct Sprite *) = { - sub_8090594, - sub_80905A8, - sub_80905D4, - sub_8090618, - sub_8090648, +u8 (*const gMovementTypeFuncs_FaceDownAndLeft[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceDownAndLeft_Step0, + MovementType_FaceDownAndLeft_Step1, + MovementType_FaceDownAndLeft_Step2, + MovementType_FaceDownAndLeft_Step3, + MovementType_FaceDownAndLeft_Step4, }; -const u8 gUnknown_0850D820[] = {DIR_SOUTH, DIR_WEST}; +const u8 gDownAndLeftDirections[] = {DIR_SOUTH, DIR_WEST}; -u8 (*const gUnknown_0850D824[])(struct EventObject *, struct Sprite *) = { - sub_80906D4, - sub_80906E8, - sub_8090714, - sub_8090758, - sub_8090788, +u8 (*const gMovementTypeFuncs_FaceDownAndRight[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceDownAndRight_Step0, + MovementType_FaceDownAndRight_Step1, + MovementType_FaceDownAndRight_Step2, + MovementType_FaceDownAndRight_Step3, + MovementType_FaceDownAndRight_Step4, }; -const u8 gUnknown_0850D838[] = {DIR_SOUTH, DIR_EAST}; +const u8 gDownAndRightDirections[] = {DIR_SOUTH, DIR_EAST}; -u8 (*const gUnknown_0850D83C[])(struct EventObject *, struct Sprite *) = { - sub_8090814, - sub_8090828, - sub_8090854, - sub_8090898, - sub_80908C8, +u8 (*const gMovementTypeFuncs_FaceDownUpAndLeft[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceDownUpAndLeft_Step0, + MovementType_FaceDownUpAndLeft_Step1, + MovementType_FaceDownUpAndLeft_Step2, + MovementType_FaceDownUpAndLeft_Step3, + MovementType_FaceDownUpAndLeft_Step4, }; -const u8 gUnknown_0850D850[] = {DIR_NORTH, DIR_SOUTH, DIR_WEST, DIR_SOUTH}; +const u8 gDownUpAndLeftDirections[] = {DIR_NORTH, DIR_SOUTH, DIR_WEST, DIR_SOUTH}; -u8 (*const gUnknown_0850D854[])(struct EventObject *, struct Sprite *) = { - sub_8090954, - sub_8090968, - sub_8090994, - sub_80909D8, - sub_8090A08, +u8 (*const gMovementTypeFuncs_FaceDownUpAndRight[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceDownUpAndRight_Step0, + MovementType_FaceDownUpAndRight_Step1, + MovementType_FaceDownUpAndRight_Step2, + MovementType_FaceDownUpAndRight_Step3, + MovementType_FaceDownUpAndRight_Step4, }; -const u8 gUnknown_0850D868[] = {DIR_SOUTH, DIR_NORTH, DIR_EAST, DIR_SOUTH}; +const u8 gDownUpAndRightDirections[] = {DIR_SOUTH, DIR_NORTH, DIR_EAST, DIR_SOUTH}; -u8 (*const gUnknown_0850D86C[])(struct EventObject *, struct Sprite *) = { - sub_8090A94, - sub_8090AA8, - sub_8090AD4, - sub_8090B18, - sub_8090B48, +u8 (*const gMovementTypeFuncs_FaceUpLeftAndRight[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceUpLeftAndRight_Step0, + MovementType_FaceUpLeftAndRight_Step1, + MovementType_FaceUpLeftAndRight_Step2, + MovementType_FaceUpLeftAndRight_Step3, + MovementType_FaceUpLeftAndRight_Step4, }; -const u8 gUnknown_0850D880[] = {DIR_NORTH, DIR_WEST, DIR_EAST, DIR_NORTH}; +const u8 gUpLeftAndRightDirections[] = {DIR_NORTH, DIR_WEST, DIR_EAST, DIR_NORTH}; -u8 (*const gUnknown_0850D884[])(struct EventObject *, struct Sprite *) = { - sub_8090BD4, - sub_8090BE8, - sub_8090C14, - sub_8090C58, - sub_8090C88, +u8 (*const gMovementTypeFuncs_FaceDownLeftAndRight[])(struct EventObject *, struct Sprite *) = { + MovementType_FaceDownLeftAndRight_Step0, + MovementType_FaceDownLeftAndRight_Step1, + MovementType_FaceDownLeftAndRight_Step2, + MovementType_FaceDownLeftAndRight_Step3, + MovementType_FaceDownLeftAndRight_Step4, }; -const u8 gUnknown_0850D898[] = {DIR_WEST, DIR_EAST, DIR_SOUTH, DIR_SOUTH}; +const u8 gDownLeftAndRightDirections[] = {DIR_WEST, DIR_EAST, DIR_SOUTH, DIR_SOUTH}; -u8 (*const gUnknown_0850D89C[])(struct EventObject *, struct Sprite *) = { - sub_8090D14, - sub_8090D40, - sub_8090D64, - sub_8090D90, +u8 (*const gMovementTypeFuncs_RotateCounterclockwise[])(struct EventObject *, struct Sprite *) = { + MovementType_RotateCounterclockwise_Step0, + MovementType_RotateCounterclockwise_Step1, + MovementType_RotateCounterclockwise_Step2, + MovementType_RotateCounterclockwise_Step3, }; -const u8 gUnknown_0850D8AC[] = {DIR_SOUTH, DIR_EAST, DIR_WEST, DIR_SOUTH, DIR_NORTH}; +const u8 gCounterclockwiseDirections[] = {DIR_SOUTH, DIR_EAST, DIR_WEST, DIR_SOUTH, DIR_NORTH}; -u8 (*const gUnknown_0850D8B4[])(struct EventObject *, struct Sprite *) = { - sub_8090E18, - sub_8090E44, - sub_8090E68, - sub_8090E94, +u8 (*const gMovementTypeFuncs_RotateClockwise[])(struct EventObject *, struct Sprite *) = { + MovementType_RotateClockwise_Step0, + MovementType_RotateClockwise_Step1, + MovementType_RotateClockwise_Step2, + MovementType_RotateClockwise_Step3, }; -const u8 gUnknown_0850D8C4[] = {DIR_SOUTH, DIR_WEST, DIR_EAST, DIR_NORTH, DIR_SOUTH}; +const u8 gClockwiseDirections[] = {DIR_SOUTH, DIR_WEST, DIR_EAST, DIR_NORTH, DIR_SOUTH}; -u8 (*const gUnknown_0850D8CC[])(struct EventObject *, struct Sprite *) = { - sub_8090F1C, - sub_8090F30, - sub_8090F68, - sub_8091020, +u8 (*const gMovementTypeFuncs_WalkBackAndForth[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkBackAndForth_Step0, + MovementType_WalkBackAndForth_Step1, + MovementType_WalkBackAndForth_Step2, + MovementType_WalkBackAndForth_Step3, }; -u8 (*const gUnknown_0850D8DC[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_809117C, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceUpRightLeftDown[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceUpRightLeftDown_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D8E8[] = {DIR_NORTH, DIR_EAST, DIR_WEST, DIR_SOUTH}; +const u8 gUpRightLeftDownDirections[] = {DIR_NORTH, DIR_EAST, DIR_WEST, DIR_SOUTH}; -u8 (*const gUnknown_0850D8EC[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091208, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceRightLeftDownUp[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceRightLeftDownUp_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D8F8[] = {DIR_EAST, DIR_WEST, DIR_SOUTH, DIR_NORTH}; +const u8 gRightLeftDownUpDirections[] = {DIR_EAST, DIR_WEST, DIR_SOUTH, DIR_NORTH}; -u8 (*const gUnknown_0850D8FC[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091294, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceDownUpRightLeft[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceDownUpRightLeft_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D908[] = {DIR_SOUTH, DIR_NORTH, DIR_EAST, DIR_WEST}; +const u8 gDownUpRightLeftDirections[] = {DIR_SOUTH, DIR_NORTH, DIR_EAST, DIR_WEST}; -u8 (*const gUnknown_0850D90C[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091320, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceLeftDownUpRight[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceLeftDownUpRight_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D918[] = {DIR_WEST, DIR_SOUTH, DIR_NORTH, DIR_EAST}; +const u8 gLeftDownUpRightDirections[] = {DIR_WEST, DIR_SOUTH, DIR_NORTH, DIR_EAST}; -u8 (*const gUnknown_0850D91C[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_80913AC, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceUpLeftRightDown[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceUpLeftRightDown_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D928[] = {DIR_NORTH, DIR_WEST, DIR_EAST, DIR_SOUTH}; +const u8 gUpLeftRightDownDirections[] = {DIR_NORTH, DIR_WEST, DIR_EAST, DIR_SOUTH}; -u8 (*const gUnknown_0850D92C[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091438, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceLeftRightDownUp[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceLeftRightDownUp_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D938[] = {DIR_WEST, DIR_EAST, DIR_SOUTH, DIR_NORTH}; +const u8 gLeftRightDownUpDirections[] = {DIR_WEST, DIR_EAST, DIR_SOUTH, DIR_NORTH}; -u8 (*const gUnknown_0850D93C[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_80914C4, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceDownUpLeftRight[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceDownUpLeftRight_Step1, + MovementType_WalkSequence_Step2, }; -u8 (*const gUnknown_0850D948[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091550, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceRightDownUpLeft[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceRightDownUpLeft_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D954[] = {DIR_EAST, DIR_SOUTH, DIR_NORTH, DIR_WEST}; +const u8 gRightDownUpLeftDirections[] = {DIR_EAST, DIR_SOUTH, DIR_NORTH, DIR_WEST}; -u8 (*const gUnknown_0850D958[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_80915DC, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceLeftUpDownRight[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceLeftUpDownRight_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D964[] = {DIR_WEST, DIR_NORTH, DIR_SOUTH, DIR_EAST}; +const u8 gLeftUpDownRightDirections[] = {DIR_WEST, DIR_NORTH, DIR_SOUTH, DIR_EAST}; -u8 (*const gUnknown_0850D968[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091668, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceUpDownRightLeft[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceUpDownRightLeft_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D974[] = {DIR_NORTH, DIR_SOUTH, DIR_EAST, DIR_WEST}; +const u8 gUpDownRightLeftDirections[] = {DIR_NORTH, DIR_SOUTH, DIR_EAST, DIR_WEST}; -u8 (*const gUnknown_0850D978[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_80916F4, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceRightLeftUpDown[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceRightLeftUpDown_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D984[] = {DIR_EAST, DIR_WEST, DIR_NORTH, DIR_SOUTH}; +const u8 gRightLeftUpDownDirections[] = {DIR_EAST, DIR_WEST, DIR_NORTH, DIR_SOUTH}; -u8 (*const gUnknown_0850D988[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091780, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceDownRightLeftUp[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceDownRightLeftUp_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D994[] = {DIR_SOUTH, DIR_EAST, DIR_WEST, DIR_NORTH}; +const u8 gDownRightLeftUpDirections[] = {DIR_SOUTH, DIR_EAST, DIR_WEST, DIR_NORTH}; -u8 (*const gUnknown_0850D998[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_809180C, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceRightUpDownLeft[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceRightUpDownLeft_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D9A4[] = {DIR_EAST, DIR_NORTH, DIR_SOUTH, DIR_WEST}; +const u8 gRightUpDownLeftDirections[] = {DIR_EAST, DIR_NORTH, DIR_SOUTH, DIR_WEST}; -u8 (*const gUnknown_0850D9A8[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091898, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceUpDownLeftRight[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceUpDownLeftRight_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D9B4[] = {DIR_NORTH, DIR_SOUTH, DIR_WEST, DIR_EAST}; +const u8 gUpDownLeftRightDirections[] = {DIR_NORTH, DIR_SOUTH, DIR_WEST, DIR_EAST}; -u8 (*const gUnknown_0850D9B8[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091924, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceLeftRightUpDown[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceLeftRightUpDown_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D9C4[] = {DIR_WEST, DIR_EAST, DIR_NORTH, DIR_SOUTH}; +const u8 gLeftRightUpDownDirections[] = {DIR_WEST, DIR_EAST, DIR_NORTH, DIR_SOUTH}; -u8 (*const gUnknown_0850D9C8[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_80919B0, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceDownLeftRightUp[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceDownLeftRightUp_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D9D4[] = {DIR_SOUTH, DIR_WEST, DIR_EAST, DIR_NORTH}; +const u8 gDownLeftRightUpDirections[] = {DIR_SOUTH, DIR_WEST, DIR_EAST, DIR_NORTH}; -u8 (*const gUnknown_0850D9D8[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091A3C, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceUpLeftDownRight[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceUpLeftDownRight_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D9E4[] = {DIR_NORTH, DIR_WEST, DIR_SOUTH, DIR_EAST}; +const u8 gUpLeftDownRightDirections[] = {DIR_NORTH, DIR_WEST, DIR_SOUTH, DIR_EAST}; -u8 (*const gUnknown_0850D9E8[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091AC8, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceDownRightUpLeft[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceDownRightUpLeft_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850D9F4[] = {DIR_SOUTH, DIR_EAST, DIR_NORTH, DIR_WEST}; +const u8 gDownRightUpLeftDirections[] = {DIR_SOUTH, DIR_EAST, DIR_NORTH, DIR_WEST}; -u8 (*const gUnknown_0850D9F8[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091B54, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceLeftDownRightUp[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceLeftDownRightUp_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850DA04[] = {DIR_WEST, DIR_SOUTH, DIR_EAST, DIR_NORTH}; +const u8 gLeftDownRightUpDirections[] = {DIR_WEST, DIR_SOUTH, DIR_EAST, DIR_NORTH}; -u8 (*const gUnknown_0850DA08[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091BE0, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceRightUpLeftDown[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceRightUpLeftDown_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850DA14[] = {DIR_EAST, DIR_NORTH, DIR_WEST, DIR_SOUTH}; +const u8 gRightUpLeftDownDirections[] = {DIR_EAST, DIR_NORTH, DIR_WEST, DIR_SOUTH}; -u8 (*const gUnknown_0850DA18[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091C6C, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceUpRightDownLeft[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceUpRightDownLeft_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850DA24[] = {DIR_NORTH, DIR_EAST, DIR_SOUTH, DIR_WEST}; +const u8 gUpRightDownLeftDirections[] = {DIR_NORTH, DIR_EAST, DIR_SOUTH, DIR_WEST}; -u8 (*const gUnknown_0850DA28[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091CF8, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceDownLeftUpRight[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceDownLeftUpRight_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850DA34[] = {DIR_SOUTH, DIR_WEST, DIR_NORTH, DIR_EAST}; +const u8 gDownLeftUpRightDirections[] = {DIR_SOUTH, DIR_WEST, DIR_NORTH, DIR_EAST}; -u8 (*const gUnknown_0850DA38[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091D84, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceLeftUpRightDown[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceLeftUpRightDown_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850DA44[] = {DIR_WEST, DIR_NORTH, DIR_EAST, DIR_SOUTH}; +const u8 gLeftUpRightDownDirections[] = {DIR_WEST, DIR_NORTH, DIR_EAST, DIR_SOUTH}; -u8 (*const gUnknown_0850DA48[])(struct EventObject *, struct Sprite *) = { - sub_8091048, - sub_8091E10, - sub_8091110, +u8 (*const gMovementTypeFuncs_WalkSequenceRightDownLeftUp[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSequence_Step0, + MovementType_WalkSequenceRightDownLeftUp_Step1, + MovementType_WalkSequence_Step2, }; -const u8 gUnknown_0850DA54[] = {DIR_EAST, DIR_SOUTH, DIR_WEST, DIR_NORTH}; +const u8 gRightDownLeftUpDirections[] = {DIR_EAST, DIR_SOUTH, DIR_WEST, DIR_NORTH}; -u8 (*const gUnknown_0850DA58[])(struct EventObject *, struct Sprite *) = { - mss_npc_reset_oampriv3_1_unk2_unk3, - sub_8091EC0, - sub_8091F20, +u8 (*const gMovementTypeFuncs_CopyPlayer[])(struct EventObject *, struct Sprite *) = { + MovementType_CopyPlayer_Step0, + MovementType_CopyPlayer_Step1, + MovementType_CopyPlayer_Step2, }; -bool8 (*const gUnknown_0850DA64[])(struct EventObject *, struct Sprite *, u8, bool8(u8)) = { - sub_8091F48, - sub_8091F4C, - sub_8091F94, - sub_80920A4, - sub_809215C, - sub_8092214, +bool8 (*const gCopyPlayerMovementFuncs[])(struct EventObject *, struct Sprite *, u8, bool8(u8)) = { + CopyablePlayerMovement_None, + CopyablePlayerMovement_FaceDirection, + CopyablePlayerMovement_GoSpeed0, + CopyablePlayerMovement_GoSpeed1, + CopyablePlayerMovement_GoSpeed2, + CopyablePlayerMovement_Slide, cph_IM_DIFFERENT, - sub_8092314, - oac_hopping, - sub_8091F48, - sub_8091F48, + CopyablePlayerMovement_GoSpeed4, + CopyablePlayerMovement_Jump, + CopyablePlayerMovement_None, + CopyablePlayerMovement_None, }; -u8 (*const gUnknown_0850DA90[])(struct EventObject *, struct Sprite *) = { - mss_npc_reset_oampriv3_1_unk2_unk3, - mss_08062EA4, - sub_8091F20, +u8 (*const gMovementTypeFuncs_CopyPlayerInGrass[])(struct EventObject *, struct Sprite *) = { + MovementType_CopyPlayer_Step0, + MovementType_CopyPlayerInGrass_Step1, + MovementType_CopyPlayer_Step2, }; -u8 (*const gUnknown_0850DA9C[])(struct EventObject *, struct Sprite *) = { - sub_80926AC, +u8 (*const gMovementTypeFuncs_Hidden[])(struct EventObject *, struct Sprite *) = { + MovementType_Hidden_Step0, }; -u8 (*const gUnknown_0850DAA0[])(struct EventObject *, struct Sprite *) = { - sub_8092718, - sub_80926B8, +u8 (*const gMovementTypeFuncs_WalkInPlace[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkInPlace_Step0, + MovementType_MoveInPlace_Step1, }; -u8 (*const gUnknown_0850DAA8[])(struct EventObject *, struct Sprite *) = { - sub_8092788, - sub_80926B8, +u8 (*const gMovementTypeFuncs_WalkSlowlyInPlace[])(struct EventObject *, struct Sprite *) = { + MovementType_WalkSlowlyInPlace_Step0, + MovementType_MoveInPlace_Step1, }; -u8 (*const gUnknown_0850DAB0[])(struct EventObject *, struct Sprite *) = { - sub_80927F8, - sub_80926B8, +u8 (*const gMovementTypeFuncs_JogInPlace[])(struct EventObject *, struct Sprite *) = { + MovementType_JogInPlace_Step0, + MovementType_MoveInPlace_Step1, }; -u8 (*const gUnknown_0850DAB8[])(struct EventObject *, struct Sprite *) = { - sub_8092868, - sub_80926B8, +u8 (*const gMovementTypeFuncs_RunInPlace[])(struct EventObject *, struct Sprite *) = { + MovementType_RunInPlace_Step0, + MovementType_MoveInPlace_Step1, }; -u8 (*const gUnknown_0850DAC0[])(struct EventObject *, struct Sprite *) = { - sub_80928D8, - sub_809290C, - sub_809292C, +u8 (*const gMovementTypeFuncs_Invisible[])(struct EventObject *, struct Sprite *) = { + MovementType_Invisible_Step0, + MovementType_Invisible_Step1, + MovementType_Invisible_Step2, }; #endif //GUARD_MOVEMENT_TYPE_FUNC_TABLES_H diff --git a/src/decoration.c b/src/decoration.c index 83030ccb7..ad2cdfa30 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -2247,7 +2247,7 @@ bool8 sub_81299AC(u8 taskId) void SetUpPuttingAwayDecorationPlayerAvatar(void) { - player_get_direction_lower_nybble(); + GetPlayerFacingDirection(); sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.spriteId].data[0]; sub_812A39C(); gUnknown_03005DD0.spriteId = CreateSprite(&gUnknown_085A7404, 0x78, 0x50, 0); diff --git a/src/event_obj_lock.c b/src/event_obj_lock.c index 1582c00f8..efa498c0f 100644 --- a/src/event_obj_lock.c +++ b/src/event_obj_lock.c @@ -90,7 +90,7 @@ void LockSelectedEventObject(void) void sub_80984F4(void) { u8 objectId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0); - EventObjectClearAnimIfSpecialAnimFinished(&gEventObjects[objectId]); + EventObjectClearHeldMovementIfFinished(&gEventObjects[objectId]); sub_80D338C(); UnfreezeEventObjects(); } @@ -100,9 +100,9 @@ void sub_8098524(void) u8 objectId; if (gEventObjects[gSelectedEventObject].active) - EventObjectClearAnimIfSpecialAnimFinished(&gEventObjects[gSelectedEventObject]); + EventObjectClearHeldMovementIfFinished(&gEventObjects[gSelectedEventObject]); objectId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0); - EventObjectClearAnimIfSpecialAnimFinished(&gEventObjects[objectId]); + EventObjectClearHeldMovementIfFinished(&gEventObjects[objectId]); sub_80D338C(); UnfreezeEventObjects(); } @@ -114,7 +114,7 @@ void sub_8098574(void) void sub_809859C(void) { - EventObjectClearAnimIfSpecialAnimActive(&gEventObjects[gSelectedEventObject]); + EventObjectClearHeldMovementIfActive(&gEventObjects[gSelectedEventObject]); } static void sub_80985BC(u8 taskId) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index d23bba92b..35b04ea1e 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1,8 +1,8 @@ #include "global.h" -#include "event_object_movement.h" #include "berry.h" #include "decoration.h" #include "event_data.h" +#include "event_object_movement.h" #include "event_scripts.h" #include "field_camera.h" #include "field_effect.h" @@ -27,56 +27,20 @@ extern u8 gUnknown_020375B4; extern u16 gUnknown_020375B6; -extern u8 *gUnknown_020375B8; +extern struct LockedAnimEventObjects *gLockedAnimEventObjects; -static void sub_808D450(void); -static u8 GetEventObjectIdByLocalId(u8); -static u8 GetEventObjectIdByLocalIdAndMapInternal(u8, u8, u8); -static bool8 GetAvailableEventObjectSlot(u16, u8, u8, u8 *); -static void EventObjectHandleDynamicGraphicsId(struct EventObject *); -static void RemoveEventObjectInternal (struct EventObject *); -static u16 GetEventObjectFlagIdByEventObjectId(u8); -static void sub_8096518(struct EventObject *, struct Sprite *); -static void MakeObjectTemplateFromEventObjectTemplate(struct EventObjectTemplate *, struct SpriteTemplate *, const struct SubspriteTable **); -static void GetEventObjectMovingCameraOffset(s16 *, s16 *); -static struct EventObjectTemplate *GetEventObjectTemplateByLocalIdAndMap(u8, u8, u8); -static void sub_808E894(u16); -static void RemoveEventObjectIfOutsideView(struct EventObject *); -static void sub_808E1B8(u8, s16, s16); -static void SetPlayerAvatarEventObjectIdAndObjectId(u8, u8); -static void sub_808E38C(struct EventObject *); -static u8 sub_808E8F4(const struct SpritePalette *); -static u8 FindEventObjectPaletteIndexByTag(u16); -static void sub_808EAB0(u16, u8); -static bool8 EventObjectDoesZCoordMatch(struct EventObject *, u8); -static void ObjectCB_CameraObject(struct Sprite *); -static void CameraObject_0(struct Sprite *); -static void CameraObject_1(struct Sprite *); -static void CameraObject_2(struct Sprite *); -static struct EventObjectTemplate *FindEventObjectTemplateInArrayByLocalId(u8 localId, struct EventObjectTemplate *templates, u8 count); -static void npc_reset(struct EventObject *, struct Sprite *); -static void EventObjectSetRegularAnim(struct EventObject *, struct Sprite *, u8); - -u8 sub_8093438(u32); -u8 sub_80934BC(u32); -u8 sub_8093514(u32); -u8 GetJumpLedgeAnimId(u32); -void sub_8092F88(u32, s16 *, s16 *, s16, s16); - -bool8 EventObjectExecRegularAnim(struct EventObject *, struct Sprite *); -static void SetEventObjectStepTimer(struct Sprite *, s16); -bool8 RunEventObjectStepTimer(struct Sprite *); -bool8 npc_block_way__next_tile(struct EventObject *, u8); +static void MoveCoordsInDirection(u32, s16 *, s16 *, s16, s16); +static bool8 EventObjectExecSingleMovementAction(struct EventObject *, struct Sprite *); +static void SetMovementDelay(struct Sprite *, s16); +static bool8 WaitForMovementDelay(struct Sprite *); +static u8 GetCollisionInDirection(struct EventObject *, u8); static u32 state_to_direction(u8, u32, u32); -/*static*/ void sub_80964E8(struct EventObject *, struct Sprite *); -static void EventObjectExecSpecialAnim(struct EventObject *, struct Sprite *); -/*static*/ void npc_obj_transfer_image_anim_pause_flag(struct EventObject *, struct Sprite *); - -static bool8 IsCoordOutsideEventObjectMovementRect(struct EventObject *, s16, s16); +static void TryEnableEventObjectAnim(struct EventObject *, struct Sprite *); +static void EventObjectExecHeldMovementAction(struct EventObject *, struct Sprite *); +static void UpdateEventObjectSpriteAnimPause(struct EventObject *, struct Sprite *); +static bool8 IsCoordOutsideEventObjectMovementRange(struct EventObject *, s16, s16); static bool8 IsMetatileDirectionallyImpassable(struct EventObject *, s16, s16, u8); -static bool8 CheckForCollisionBetweenEventObjects(struct EventObject *, s16, s16); -bool8 sub_809558C(struct EventObject *, struct Sprite *); -bool8 sub_8095B64(struct EventObject *, struct Sprite *); +static bool8 DoesObjectCollideWithObjectAt(struct EventObject *, s16, s16); static void sub_8096530(struct EventObject *, struct Sprite *); static void npc_update_obj_anim_flag(struct EventObject *, struct Sprite *); static void EventObjectUpdateMetatileBehaviors(struct EventObject*); @@ -106,7 +70,36 @@ static void DoGroundEffects_OnSpawn(struct EventObject*, struct Sprite*); static void DoGroundEffects_OnBeginStep(struct EventObject*, struct Sprite*); static void DoGroundEffects_OnFinishStep(struct EventObject*, struct Sprite*); static void sub_8097D68(struct Sprite*); -static void sub_8097FE4(u8); +static void ApplyLevitateMovement(u8); +static bool8 MovementType_Disguise_Callback(struct EventObject *, struct Sprite *); +static bool8 MovementType_Hidden_Callback(struct EventObject *, struct Sprite *); +static void sub_808D450(void); +static u8 GetEventObjectIdByLocalId(u8); +static u8 GetEventObjectIdByLocalIdAndMapInternal(u8, u8, u8); +static bool8 GetAvailableEventObjectId(u16, u8, u8, u8 *); +static void SetEventObjectDynamicGraphicsId(struct EventObject *); +static void RemoveEventObjectInternal(struct EventObject *); +static u16 GetEventObjectFlagIdByEventObjectId(u8); +static void UpdateEventObjectVisibility(struct EventObject *, struct Sprite *); +static void MakeObjectTemplateFromEventObjectTemplate(struct EventObjectTemplate *, struct SpriteTemplate *, const struct SubspriteTable **); +static void GetEventObjectMovingCameraOffset(s16 *, s16 *); +static struct EventObjectTemplate *GetEventObjectTemplateByLocalIdAndMap(u8, u8, u8); +static void sub_808E894(u16); +static void RemoveEventObjectIfOutsideView(struct EventObject *); +static void sub_808E1B8(u8, s16, s16); +static void SetPlayerAvatarEventObjectIdAndObjectId(u8, u8); +static void sub_808E38C(struct EventObject *); +static u8 sub_808E8F4(const struct SpritePalette *); +static u8 FindEventObjectPaletteIndexByTag(u16); +static void sub_808EAB0(u16, u8); +static bool8 EventObjectDoesZCoordMatch(struct EventObject *, u8); +static void ObjectCB_CameraObject(struct Sprite *); +static void CameraObject_0(struct Sprite *); +static void CameraObject_1(struct Sprite *); +static void CameraObject_2(struct Sprite *); +static struct EventObjectTemplate *FindEventObjectTemplateByLocalId(u8 localId, struct EventObjectTemplate *templates, u8 count); +static void ClearEventObjectMovement(struct EventObject *, struct Sprite *); +static void EventObjectSetSingleMovement(struct EventObject *, struct Sprite *, u8); const u8 gUnknown_084975C4[] = {1, 1, 6, 7, 8, 9, 6, 7, 8, 9, 11, 11, 0, 0, 0, 0}; @@ -121,257 +114,257 @@ void (*const gCameraObjectFuncs[])(struct Sprite *) = { #include "data/field_event_obj/event_object_graphics.h" // movement type callbacks -void (*const gUnknown_08505438[])(struct Sprite *) = +static void (*const sMovementTypeCallbacks[])(struct Sprite *) = { - EventObjectCB_NoMovement1, - EventObjectCB_LookRandomDirections, - EventObjectCB_GoRandomDirections, - EventObjectCB_RandomlyGoNorthOrSouth, - EventObjectCB_RandomlyGoNorthOrSouth, - EventObjectCB_RandomlyGoEastOrWest, - EventObjectCB_RandomlyGoEastOrWest, - EventObjectCB_FaceFixedDirection, - EventObjectCB_FaceFixedDirection, - EventObjectCB_FaceFixedDirection, - EventObjectCB_FaceFixedDirection, - EventObjectCB_NoMovement2, - EventObjectCB_BerryTree, - EventObjectCB_RandomlyLookNorthOrSouth, - EventObjectCB_RandomlyLookEastOrWest, - EventObjectCB_RandomlyLookNorthOrWest, - EventObjectCB_RandomlyLookNorthOrEast, - EventObjectCB_RandomlyLookSouthOrWest, - EventObjectCB_RandomlyLookSouthOrEast, - EventObjectCB_RandomlyLookNorthOrSouthOrWest, - EventObjectCB_RandomlyLookNorthOrSouthOrEast, - EventObjectCB_RandomlyLookNorthOrEastOrWest, - EventObjectCB_RandomlyLookSouthOrEastOrWest, - EventObjectCB_LookAroundCounterclockwise, - EventObjectCB_LookAroundClockwise, - EventObjectCB_AlternatelyGoInOppositeDirections, - EventObjectCB_AlternatelyGoInOppositeDirections, - EventObjectCB_AlternatelyGoInOppositeDirections, - EventObjectCB_AlternatelyGoInOppositeDirections, - EventObjectCB_GoInDirectionSequence1, - EventObjectCB_GoInDirectionSequence2, - EventObjectCB_GoInDirectionSequence3, - EventObjectCB_GoInDirectionSequence4, - EventObjectCB_GoInDirectionSequence5, - EventObjectCB_GoInDirectionSequence6, - EventObjectCB_GoInDirectionSequence7, - EventObjectCB_GoInDirectionSequence8, - EventObjectCB_GoInDirectionSequence9, - EventObjectCB_GoInDirectionSequence10, - EventObjectCB_GoInDirectionSequence11, - EventObjectCB_GoInDirectionSequence12, - EventObjectCB_GoInDirectionSequence13, - EventObjectCB_GoInDirectionSequence14, - EventObjectCB_GoInDirectionSequence15, - EventObjectCB_GoInDirectionSequence16, - EventObjectCB_GoInDirectionSequence17, - EventObjectCB_GoInDirectionSequence18, - EventObjectCB_GoInDirectionSequence19, - EventObjectCB_GoInDirectionSequence20, - EventObjectCB_GoInDirectionSequence21, - EventObjectCB_GoInDirectionSequence22, - EventObjectCB_GoInDirectionSequence23, - EventObjectCB_GoInDirectionSequence24, - EventObjectCB_CopyPlayer1, - EventObjectCB_CopyPlayer1, - EventObjectCB_CopyPlayer1, - EventObjectCB_CopyPlayer1, - EventObjectCB_TreeDisguise, - EventObjectCB_MountainDisguise, - EventObjectCB_CopyPlayer2, - EventObjectCB_CopyPlayer2, - EventObjectCB_CopyPlayer2, - EventObjectCB_CopyPlayer2, - EventObjectCB_Hidden1, - EventObjectCB_WalkInPlace1, - EventObjectCB_WalkInPlace1, - EventObjectCB_WalkInPlace1, - EventObjectCB_WalkInPlace1, - EventObjectCB_WalkInPlace2, - EventObjectCB_WalkInPlace2, - EventObjectCB_WalkInPlace2, - EventObjectCB_WalkInPlace2, - EventObjectCB_WalkInPlace3, - EventObjectCB_WalkInPlace3, - EventObjectCB_WalkInPlace3, - EventObjectCB_WalkInPlace3, - EventObjectCB_Hidden2, - EventObjectCB_WalkInPlace4, - EventObjectCB_WalkInPlace4, - EventObjectCB_WalkInPlace4, - EventObjectCB_WalkInPlace4, + MovementType_None, // MOVEMENT_TYPE_NONE + MovementType_LookAround, // MOVEMENT_TYPE_LOOK_AROUND + MovementType_WanderAround, // MOVEMENT_TYPE_WANDER_AROUND + MovementType_WanderUpAndDown, // MOVEMENT_TYPE_WANDER_UP_AND_DOWN + MovementType_WanderUpAndDown, // MOVEMENT_TYPE_WANDER_DOWN_AND_UP + MovementType_WanderLeftAndRight, // MOVEMENT_TYPE_WANDER_LEFT_AND_RIGHT + MovementType_WanderLeftAndRight, // MOVEMENT_TYPE_WANDER_RIGHT_AND_LEFT + MovementType_FaceDirection, // MOVEMENT_TYPE_FACE_UP + MovementType_FaceDirection, // MOVEMENT_TYPE_FACE_DOWN + MovementType_FaceDirection, // MOVEMENT_TYPE_FACE_LEFT + MovementType_FaceDirection, // MOVEMENT_TYPE_FACE_RIGHT + MovementType_Player, // MOVEMENT_TYPE_PLAYER + MovementType_BerryTreeGrowth, // MOVEMENT_TYPE_BERRY_TREE_GROWTH + MovementType_FaceDownAndUp, // MOVEMENT_TYPE_FACE_DOWN_AND_UP + MovementType_FaceLeftAndRight, // MOVEMENT_TYPE_FACE_LEFT_AND_RIGHT + MovementType_FaceUpAndLeft, // MOVEMENT_TYPE_FACE_UP_AND_LEFT + MovementType_FaceUpAndRight, // MOVEMENT_TYPE_FACE_UP_AND_RIGHT + MovementType_FaceDownAndLeft, // MOVEMENT_TYPE_FACE_DOWN_AND_LEFT + MovementType_FaceDownAndRight, // MOVEMENT_TYPE_FACE_DOWN_AND_RIGHT + MovementType_FaceDownUpAndLeft, // MOVEMENT_TYPE_FACE_DOWN_UP_AND_LEFT + MovementType_FaceDownUpAndRight, // MOVEMENT_TYPE_FACE_DOWN_UP_AND_RIGHT + MovementType_FaceUpRightAndLeft, // MOVEMENT_TYPE_FACE_UP_LEFT_AND_RIGHT + MovementType_FaceDownRightAndLeft, // MOVEMENT_TYPE_FACE_DOWN_LEFT_AND_RIGHT + MovementType_RotateCounterclockwise, // MOVEMENT_TYPE_ROTATE_COUNTERCLOCKWISE + MovementType_RotateClockwise, // MOVEMENT_TYPE_ROTATE_CLOCKWISE + MovementType_WalkBackAndForth, // MOVEMENT_TYPE_WALK_UP_AND_DOWN + MovementType_WalkBackAndForth, // MOVEMENT_TYPE_WALK_DOWN_AND_UP + MovementType_WalkBackAndForth, // MOVEMENT_TYPE_WALK_LEFT_AND_RIGHT + MovementType_WalkBackAndForth, // MOVEMENT_TYPE_WALK_RIGHT_AND_LEFT + MovementType_WalkSequenceUpRightLeftDown, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_RIGHT_LEFT_DOWN + MovementType_WalkSequenceRightLeftDownUp, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_LEFT_DOWN_UP + MovementType_WalkSequenceDownUpRightLeft, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_UP_RIGHT_LEFT + MovementType_WalkSequenceLeftDownUpRight, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_DOWN_UP_RIGHT + MovementType_WalkSequenceUpLeftRightDown, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_LEFT_RIGHT_DOWN + MovementType_WalkSequenceLeftRightDownUp, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_RIGHT_DOWN_UP + MovementType_WalkSequenceDownUpLeftRight, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_UP_LEFT_RIGHT + MovementType_WalkSequenceRightDownUpLeft, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_DOWN_UP_LEFT + MovementType_WalkSequenceLeftUpDownRight, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_UP_DOWN_RIGHT + MovementType_WalkSequenceUpDownRightLeft, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_DOWN_RIGHT_LEFT + MovementType_WalkSequenceRightLeftUpDown, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_LEFT_UP_DOWN + MovementType_WalkSequenceDownRightLeftUp, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_RIGHT_LEFT_UP + MovementType_WalkSequenceRightUpDownLeft, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_UP_DOWN_LEFT + MovementType_WalkSequenceUpDownLeftRight, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_DOWN_LEFT_RIGHT + MovementType_WalkSequenceLeftRightUpDown, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_RIGHT_UP_DOWN + MovementType_WalkSequenceDownLeftRightUp, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_LEFT_RIGHT_UP + MovementType_WalkSequenceUpLeftDownRight, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_LEFT_DOWN_RIGHT + MovementType_WalkSequenceDownRightUpLeft, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_RIGHT_UP_LEFT + MovementType_WalkSequenceLeftDownRightUp, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_DOWN_RIGHT_UP + MovementType_WalkSequenceRightUpLeftDown, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_UP_LEFT_DOWN + MovementType_WalkSequenceUpRightDownLeft, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_RIGHT_DOWN_LEFT + MovementType_WalkSequenceDownLeftUpRight, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_LEFT_UP_RIGHT + MovementType_WalkSequenceLeftUpRightDown, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_UP_RIGHT_DOWN + MovementType_WalkSequenceRightDownLeftUp, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_DOWN_LEFT_UP + MovementType_CopyPlayer, // MOVEMENT_TYPE_COPY_PLAYER + MovementType_CopyPlayer, // MOVEMENT_TYPE_COPY_PLAYER_OPPOSITE + MovementType_CopyPlayer, // MOVEMENT_TYPE_COPY_PLAYER_COUNTERCLOCKWISE + MovementType_CopyPlayer, // MOVEMENT_TYPE_COPY_PLAYER_CLOCKWISE + MovementType_TreeDisguise, // MOVEMENT_TYPE_TREE_DISGUISE + MovementType_MountainDisguise, // MOVEMENT_TYPE_MOUNTAIN_DISGUISE + MovementType_CopyPlayerInGrass, // MOVEMENT_TYPE_COPY_PLAYER_IN_GRASS + MovementType_CopyPlayerInGrass, // MOVEMENT_TYPE_COPY_PLAYER_OPPOSITE_IN_GRASS + MovementType_CopyPlayerInGrass, // MOVEMENT_TYPE_COPY_PLAYER_COUNTERCLOCKWISE_IN_GRASS + MovementType_CopyPlayerInGrass, // MOVEMENT_TYPE_COPY_PLAYER_CLOCKWISE_IN_GRASS + MovementType_Hidden, // MOVEMENT_TYPE_HIDDEN + MovementType_WalkInPlace, // MOVEMENT_TYPE_WALK_IN_PLACE_DOWN + MovementType_WalkInPlace, // MOVEMENT_TYPE_WALK_IN_PLACE_UP + MovementType_WalkInPlace, // MOVEMENT_TYPE_WALK_IN_PLACE_LEFT + MovementType_WalkInPlace, // MOVEMENT_TYPE_WALK_IN_PLACE_RIGHT + MovementType_JogInPlace, // MOVEMENT_TYPE_JOG_IN_PLACE_DOWN + MovementType_JogInPlace, // MOVEMENT_TYPE_JOG_IN_PLACE_UP + MovementType_JogInPlace, // MOVEMENT_TYPE_JOG_IN_PLACE_LEFT + MovementType_JogInPlace, // MOVEMENT_TYPE_JOG_IN_PLACE_RIGHT + MovementType_RunInPlace, // MOVEMENT_TYPE_RUN_IN_PLACE_DOWN + MovementType_RunInPlace, // MOVEMENT_TYPE_RUN_IN_PLACE_UP + MovementType_RunInPlace, // MOVEMENT_TYPE_RUN_IN_PLACE_LEFT + MovementType_RunInPlace, // MOVEMENT_TYPE_RUN_IN_PLACE_RIGHT + MovementType_Invisible, // MOVEMENT_TYPE_INVISIBLE + MovementType_WalkSlowlyInPlace, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_DOWN + MovementType_WalkSlowlyInPlace, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_UP + MovementType_WalkSlowlyInPlace, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_LEFT + MovementType_WalkSlowlyInPlace, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_RIGHT }; const u8 gRangedMovementTypes[] = { - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, + 0, // MOVEMENT_TYPE_NONE + 0, // MOVEMENT_TYPE_LOOK_AROUND + 1, // MOVEMENT_TYPE_WANDER_AROUND + 1, // MOVEMENT_TYPE_WANDER_UP_AND_DOWN + 1, // MOVEMENT_TYPE_WANDER_DOWN_AND_UP + 1, // MOVEMENT_TYPE_WANDER_LEFT_AND_RIGHT + 1, // MOVEMENT_TYPE_WANDER_RIGHT_AND_LEFT + 0, // MOVEMENT_TYPE_FACE_UP + 0, // MOVEMENT_TYPE_FACE_DOWN + 0, // MOVEMENT_TYPE_FACE_LEFT + 0, // MOVEMENT_TYPE_FACE_RIGHT + 0, // MOVEMENT_TYPE_PLAYER + 0, // MOVEMENT_TYPE_BERRY_TREE_GROWTH + 0, // MOVEMENT_TYPE_FACE_DOWN_AND_UP + 0, // MOVEMENT_TYPE_FACE_LEFT_AND_RIGHT + 0, // MOVEMENT_TYPE_FACE_UP_AND_LEFT + 0, // MOVEMENT_TYPE_FACE_UP_AND_RIGHT + 0, // MOVEMENT_TYPE_FACE_DOWN_AND_LEFT + 0, // MOVEMENT_TYPE_FACE_DOWN_AND_RIGHT + 0, // MOVEMENT_TYPE_FACE_DOWN_UP_AND_LEFT + 0, // MOVEMENT_TYPE_FACE_DOWN_UP_AND_RIGHT + 0, // MOVEMENT_TYPE_FACE_UP_LEFT_AND_RIGHT + 0, // MOVEMENT_TYPE_FACE_DOWN_LEFT_AND_RIGHT + 0, // MOVEMENT_TYPE_ROTATE_COUNTERCLOCKWISE + 0, // MOVEMENT_TYPE_ROTATE_CLOCKWISE + 1, // MOVEMENT_TYPE_WALK_UP_AND_DOWN + 1, // MOVEMENT_TYPE_WALK_DOWN_AND_UP + 1, // MOVEMENT_TYPE_WALK_LEFT_AND_RIGHT + 1, // MOVEMENT_TYPE_WALK_RIGHT_AND_LEFT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_RIGHT_LEFT_DOWN + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_LEFT_DOWN_UP + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_UP_RIGHT_LEFT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_DOWN_UP_RIGHT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_LEFT_RIGHT_DOWN + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_RIGHT_DOWN_UP + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_UP_LEFT_RIGHT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_DOWN_UP_LEFT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_UP_DOWN_RIGHT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_DOWN_RIGHT_LEFT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_LEFT_UP_DOWN + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_RIGHT_LEFT_UP + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_UP_DOWN_LEFT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_DOWN_LEFT_RIGHT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_RIGHT_UP_DOWN + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_LEFT_RIGHT_UP + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_LEFT_DOWN_RIGHT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_RIGHT_UP_LEFT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_DOWN_RIGHT_UP + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_UP_LEFT_DOWN + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_RIGHT_DOWN_LEFT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_LEFT_UP_RIGHT + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_UP_RIGHT_DOWN + 1, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_DOWN_LEFT_UP + 1, // MOVEMENT_TYPE_COPY_PLAYER + 1, // MOVEMENT_TYPE_COPY_PLAYER_OPPOSITE + 1, // MOVEMENT_TYPE_COPY_PLAYER_COUNTERCLOCKWISE + 1, // MOVEMENT_TYPE_COPY_PLAYER_CLOCKWISE + 0, // MOVEMENT_TYPE_TREE_DISGUISE + 0, // MOVEMENT_TYPE_MOUNTAIN_DISGUISE + 1, // MOVEMENT_TYPE_COPY_PLAYER_IN_GRASS + 1, // MOVEMENT_TYPE_COPY_PLAYER_OPPOSITE_IN_GRASS + 1, // MOVEMENT_TYPE_COPY_PLAYER_COUNTERCLOCKWISE_IN_GRASS + 1, // MOVEMENT_TYPE_COPY_PLAYER_CLOCKWISE_IN_GRASS + 0, // MOVEMENT_TYPE_HIDDEN + 0, // MOVEMENT_TYPE_WALK_IN_PLACE_DOWN + 0, // MOVEMENT_TYPE_WALK_IN_PLACE_UP + 0, // MOVEMENT_TYPE_WALK_IN_PLACE_LEFT + 0, // MOVEMENT_TYPE_WALK_IN_PLACE_RIGHT + 0, // MOVEMENT_TYPE_JOG_IN_PLACE_DOWN + 0, // MOVEMENT_TYPE_JOG_IN_PLACE_UP + 0, // MOVEMENT_TYPE_JOG_IN_PLACE_LEFT + 0, // MOVEMENT_TYPE_JOG_IN_PLACE_RIGHT + 0, // MOVEMENT_TYPE_RUN_IN_PLACE_DOWN + 0, // MOVEMENT_TYPE_RUN_IN_PLACE_UP + 0, // MOVEMENT_TYPE_RUN_IN_PLACE_LEFT + 0, // MOVEMENT_TYPE_RUN_IN_PLACE_RIGHT + 0, // MOVEMENT_TYPE_INVISIBLE + 0, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_DOWN + 0, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_UP + 0, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_LEFT + 0, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_RIGHT }; const u8 gInitialMovementTypeFacingDirections[] = { - DIR_SOUTH, - DIR_SOUTH, - DIR_SOUTH, - DIR_NORTH, - DIR_SOUTH, - DIR_WEST, - DIR_EAST, - DIR_NORTH, - DIR_SOUTH, - DIR_WEST, - DIR_EAST, - DIR_SOUTH, - DIR_SOUTH, - DIR_SOUTH, - DIR_WEST, - DIR_NORTH, - DIR_NORTH, - DIR_SOUTH, - DIR_SOUTH, - DIR_SOUTH, - DIR_SOUTH, - DIR_NORTH, - DIR_SOUTH, - DIR_SOUTH, - DIR_SOUTH, - DIR_NORTH, - DIR_SOUTH, - DIR_WEST, - DIR_EAST, - DIR_NORTH, - DIR_EAST, - DIR_SOUTH, - DIR_WEST, - DIR_NORTH, - DIR_WEST, - DIR_SOUTH, - DIR_EAST, - DIR_WEST, - DIR_NORTH, - DIR_EAST, - DIR_SOUTH, - DIR_EAST, - DIR_NORTH, - DIR_WEST, - DIR_SOUTH, - DIR_NORTH, - DIR_SOUTH, - DIR_WEST, - DIR_EAST, - DIR_NORTH, - DIR_SOUTH, - DIR_WEST, - DIR_EAST, - DIR_NORTH, - DIR_SOUTH, - DIR_WEST, - DIR_EAST, - DIR_SOUTH, - DIR_SOUTH, - DIR_NORTH, - DIR_SOUTH, - DIR_WEST, - DIR_EAST, - DIR_SOUTH, - DIR_SOUTH, - DIR_NORTH, - DIR_WEST, - DIR_EAST, - DIR_SOUTH, - DIR_NORTH, - DIR_WEST, - DIR_EAST, - DIR_SOUTH, - DIR_NORTH, - DIR_WEST, - DIR_EAST, - DIR_SOUTH, - DIR_SOUTH, - DIR_NORTH, - DIR_WEST, - DIR_EAST, + DIR_SOUTH, // MOVEMENT_TYPE_NONE + DIR_SOUTH, // MOVEMENT_TYPE_LOOK_AROUND + DIR_SOUTH, // MOVEMENT_TYPE_WANDER_AROUND + DIR_NORTH, // MOVEMENT_TYPE_WANDER_UP_AND_DOWN + DIR_SOUTH, // MOVEMENT_TYPE_WANDER_DOWN_AND_UP + DIR_WEST, // MOVEMENT_TYPE_WANDER_LEFT_AND_RIGHT + DIR_EAST, // MOVEMENT_TYPE_WANDER_RIGHT_AND_LEFT + DIR_NORTH, // MOVEMENT_TYPE_FACE_UP + DIR_SOUTH, // MOVEMENT_TYPE_FACE_DOWN + DIR_WEST, // MOVEMENT_TYPE_FACE_LEFT + DIR_EAST, // MOVEMENT_TYPE_FACE_RIGHT + DIR_SOUTH, // MOVEMENT_TYPE_PLAYER + DIR_SOUTH, // MOVEMENT_TYPE_BERRY_TREE_GROWTH + DIR_SOUTH, // MOVEMENT_TYPE_FACE_DOWN_AND_UP + DIR_WEST, // MOVEMENT_TYPE_FACE_LEFT_AND_RIGHT + DIR_NORTH, // MOVEMENT_TYPE_FACE_UP_AND_LEFT + DIR_NORTH, // MOVEMENT_TYPE_FACE_UP_AND_RIGHT + DIR_SOUTH, // MOVEMENT_TYPE_FACE_DOWN_AND_LEFT + DIR_SOUTH, // MOVEMENT_TYPE_FACE_DOWN_AND_RIGHT + DIR_SOUTH, // MOVEMENT_TYPE_FACE_DOWN_UP_AND_LEFT + DIR_SOUTH, // MOVEMENT_TYPE_FACE_DOWN_UP_AND_RIGHT + DIR_NORTH, // MOVEMENT_TYPE_FACE_UP_LEFT_AND_RIGHT + DIR_SOUTH, // MOVEMENT_TYPE_FACE_DOWN_LEFT_AND_RIGHT + DIR_SOUTH, // MOVEMENT_TYPE_ROTATE_COUNTERCLOCKWISE + DIR_SOUTH, // MOVEMENT_TYPE_ROTATE_CLOCKWISE + DIR_NORTH, // MOVEMENT_TYPE_WALK_UP_AND_DOWN + DIR_SOUTH, // MOVEMENT_TYPE_WALK_DOWN_AND_UP + DIR_WEST, // MOVEMENT_TYPE_WALK_LEFT_AND_RIGHT + DIR_EAST, // MOVEMENT_TYPE_WALK_RIGHT_AND_LEFT + DIR_NORTH, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_RIGHT_LEFT_DOWN + DIR_EAST, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_LEFT_DOWN_UP + DIR_SOUTH, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_UP_RIGHT_LEFT + DIR_WEST, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_DOWN_UP_RIGHT + DIR_NORTH, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_LEFT_RIGHT_DOWN + DIR_WEST, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_RIGHT_DOWN_UP + DIR_SOUTH, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_UP_LEFT_RIGHT + DIR_EAST, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_DOWN_UP_LEFT + DIR_WEST, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_UP_DOWN_RIGHT + DIR_NORTH, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_DOWN_RIGHT_LEFT + DIR_EAST, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_LEFT_UP_DOWN + DIR_SOUTH, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_RIGHT_LEFT_UP + DIR_EAST, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_UP_DOWN_LEFT + DIR_NORTH, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_DOWN_LEFT_RIGHT + DIR_WEST, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_RIGHT_UP_DOWN + DIR_SOUTH, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_LEFT_RIGHT_UP + DIR_NORTH, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_LEFT_DOWN_RIGHT + DIR_SOUTH, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_RIGHT_UP_LEFT + DIR_WEST, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_DOWN_RIGHT_UP + DIR_EAST, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_UP_LEFT_DOWN + DIR_NORTH, // MOVEMENT_TYPE_WALK_SEQUENCE_UP_RIGHT_DOWN_LEFT + DIR_SOUTH, // MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_LEFT_UP_RIGHT + DIR_WEST, // MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_UP_RIGHT_DOWN + DIR_EAST, // MOVEMENT_TYPE_WALK_SEQUENCE_RIGHT_DOWN_LEFT_UP + DIR_NORTH, // MOVEMENT_TYPE_COPY_PLAYER + DIR_SOUTH, // MOVEMENT_TYPE_COPY_PLAYER_OPPOSITE + DIR_WEST, // MOVEMENT_TYPE_COPY_PLAYER_COUNTERCLOCKWISE + DIR_EAST, // MOVEMENT_TYPE_COPY_PLAYER_CLOCKWISE + DIR_SOUTH, // MOVEMENT_TYPE_TREE_DISGUISE + DIR_SOUTH, // MOVEMENT_TYPE_MOUNTAIN_DISGUISE + DIR_NORTH, // MOVEMENT_TYPE_COPY_PLAYER_IN_GRASS + DIR_SOUTH, // MOVEMENT_TYPE_COPY_PLAYER_OPPOSITE_IN_GRASS + DIR_WEST, // MOVEMENT_TYPE_COPY_PLAYER_COUNTERCLOCKWISE_IN_GRASS + DIR_EAST, // MOVEMENT_TYPE_COPY_PLAYER_CLOCKWISE_IN_GRASS + DIR_SOUTH, // MOVEMENT_TYPE_HIDDEN + DIR_SOUTH, // MOVEMENT_TYPE_WALK_IN_PLACE_DOWN + DIR_NORTH, // MOVEMENT_TYPE_WALK_IN_PLACE_UP + DIR_WEST, // MOVEMENT_TYPE_WALK_IN_PLACE_LEFT + DIR_EAST, // MOVEMENT_TYPE_WALK_IN_PLACE_RIGHT + DIR_SOUTH, // MOVEMENT_TYPE_JOG_IN_PLACE_DOWN + DIR_NORTH, // MOVEMENT_TYPE_JOG_IN_PLACE_UP + DIR_WEST, // MOVEMENT_TYPE_JOG_IN_PLACE_LEFT + DIR_EAST, // MOVEMENT_TYPE_JOG_IN_PLACE_RIGHT + DIR_SOUTH, // MOVEMENT_TYPE_RUN_IN_PLACE_DOWN + DIR_NORTH, // MOVEMENT_TYPE_RUN_IN_PLACE_UP + DIR_WEST, // MOVEMENT_TYPE_RUN_IN_PLACE_LEFT + DIR_EAST, // MOVEMENT_TYPE_RUN_IN_PLACE_RIGHT + DIR_SOUTH, // MOVEMENT_TYPE_INVISIBLE + DIR_SOUTH, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_DOWN + DIR_NORTH, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_UP + DIR_WEST, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_LEFT + DIR_EAST, // MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_RIGHT }; #include "data/field_event_obj/event_object_graphics_info_pointers.h" @@ -612,196 +605,182 @@ const s16 gMovementDelaysShort[] = {32, 48, 64, 80}; #include "data/field_event_obj/movement_type_func_tables.h" -const u8 gUnknown_0850DACC[] = { - 0x00, - 0x00, - 0x01, - 0x02, - 0x03, - 0x00, - 0x00, - 0x01, - 0x01, +const u8 gFaceDirectionAnimNums[] = { + 0, // DIR_NONE + 0, // DIR_SOUTH + 1, // DIR_NORTH + 2, // DIR_WEST + 3, // DIR_EAST + 0, // DIR_SOUTHWEST + 0, // DIR_SOUTHEAST + 1, // DIR_NORTHWEST + 1, // DIR_NORTHEAST +}; +const u8 gMoveDirectionAnimNums[] = { + 4, // DIR_NONE + 4, // DIR_SOUTH + 5, // DIR_NORTH + 6, // DIR_WEST + 7, // DIR_EAST + 4, // DIR_SOUTHWEST + 4, // DIR_SOUTHEAST + 5, // DIR_NORTHWEST + 5, // DIR_NORTHEAST +}; +const u8 gMoveDirectionFastAnimNums[] = { + 8, // DIR_NONE + 8, // DIR_SOUTH + 9, // DIR_NORTH + 10, // DIR_WEST + 11, // DIR_EAST + 8, // DIR_SOUTHWEST + 8, // DIR_SOUTHEAST + 9, // DIR_NORTHWEST + 9, // DIR_NORTHEAST +}; +const u8 gMoveDirectionFasterAnimNums[] = { + 12, // DIR_NONE + 12, // DIR_SOUTH + 13, // DIR_NORTH + 14, // DIR_WEST + 15, // DIR_EAST + 12, // DIR_SOUTHWEST + 12, // DIR_SOUTHEAST + 13, // DIR_NORTHWEST + 13, // DIR_NORTHEAST +}; +const u8 gMoveDirectionFastestAnimNums[] = { + 16, // DIR_NONE + 16, // DIR_SOUTH + 17, // DIR_NORTH + 18, // DIR_WEST + 19, // DIR_EAST + 16, // DIR_SOUTHWEST + 16, // DIR_SOUTHEAST + 17, // DIR_NORTHWEST + 17, // DIR_NORTHEAST +}; +const u8 gJumpSpecialDirectionAnimNums[] = { // used for jumping onto surf mon + 20, // DIR_NONE + 20, // DIR_SOUTH + 21, // DIR_NORTH + 22, // DIR_WEST + 23, // DIR_EAST + 20, // DIR_SOUTHWEST + 20, // DIR_SOUTHEAST + 21, // DIR_NORTHWEST + 21, // DIR_NORTHEAST +}; +const u8 gAcroWheelieDirectionAnimNums[] = { + 20, // DIR_NONE + 20, // DIR_SOUTH + 21, // DIR_NORTH + 22, // DIR_WEST + 23, // DIR_EAST + 20, // DIR_SOUTHWEST + 20, // DIR_SOUTHEAST + 21, // DIR_NORTHWEST + 21, // DIR_NORTHEAST +}; +const u8 gUnrefAnimNums_08375633[] = { + 24, // DIR_NONE + 24, // DIR_SOUTH + 25, // DIR_NORTH + 26, // DIR_WEST + 27, // DIR_EAST + 24, // DIR_SOUTHWEST + 24, // DIR_SOUTHEAST + 25, // DIR_NORTHWEST + 25, // DIR_NORTHEAST +}; +const u8 gAcroEndWheelieDirectionAnimNums[] = { + 28, // DIR_NONE + 28, // DIR_SOUTH + 29, // DIR_NORTH + 30, // DIR_WEST + 31, // DIR_EAST + 28, // DIR_SOUTHWEST + 28, // DIR_SOUTHEAST + 29, // DIR_NORTHWEST + 29, // DIR_NORTHEAST +}; +const u8 gAcroUnusedActionDirectionAnimNums[] = { + 32, // DIR_NONE + 32, // DIR_SOUTH + 33, // DIR_NORTH + 34, // DIR_WEST + 35, // DIR_EAST + 32, // DIR_SOUTHWEST + 32, // DIR_SOUTHEAST + 33, // DIR_NORTHWEST + 33, // DIR_NORTHEAST +}; +const u8 gAcroWheeliePedalDirectionAnimNums[] = { + 36, // DIR_NONE + 36, // DIR_SOUTH + 37, // DIR_NORTH + 38, // DIR_WEST + 39, // DIR_EAST + 36, // DIR_SOUTHWEST + 36, // DIR_SOUTHEAST + 37, // DIR_NORTHWEST + 37, // DIR_NORTHEAST +}; +const u8 gFishingDirectionAnimNums[] = { + 0, // DIR_NONE + 0, // DIR_SOUTH + 1, // DIR_NORTH + 2, // DIR_WEST + 3, // DIR_EAST + 0, // DIR_SOUTHWEST + 0, // DIR_SOUTHEAST + 1, // DIR_NORTHWEST + 1, // DIR_NORTHEAST +}; +const u8 gFishingNoCatchDirectionAnimNums[] = { + 4, // DIR_NONE + 4, // DIR_SOUTH + 5, // DIR_NORTH + 6, // DIR_WEST + 7, // DIR_EAST + 4, // DIR_SOUTHWEST + 4, // DIR_SOUTHEAST + 5, // DIR_NORTHWEST + 5, // DIR_NORTHEAST +}; +const u8 gFishingBiteDirectionAnimNums[] = { + 8, // DIR_NONE + 8, // DIR_SOUTH + 9, // DIR_NORTH + 10, // DIR_WEST + 11, // DIR_EAST + 8, // DIR_SOUTHWEST + 8, // DIR_SOUTHEAST + 9, // DIR_NORTHWEST + 9, // DIR_NORTHEAST +}; +const u8 gRunningDirectionAnimNums[] = { + 20, // DIR_NONE + 20, // DIR_SOUTH + 21, // DIR_NORTH + 22, // DIR_WEST + 23, // DIR_EAST + 20, // DIR_SOUTHWEST + 20, // DIR_SOUTHEAST + 21, // DIR_NORTHWEST + 21, // DIR_NORTHEAST }; -const u8 gUnknown_0850DAD5[] = { - 0x04, - 0x04, - 0x05, - 0x06, - 0x07, - 0x04, - 0x04, - 0x05, - 0x05, -}; - -const u8 gUnknown_0850DADE[] = { - 0x08, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x08, - 0x08, - 0x09, - 0x09, -}; - -const u8 gUnknown_0850DAE7[] = { - 0x0c, - 0x0c, - 0x0d, - 0x0e, - 0x0f, - 0x0c, - 0x0c, - 0x0d, - 0x0d, -}; - -const u8 gUnknown_0850DAF0[] = { - 0x10, - 0x10, - 0x11, - 0x12, - 0x13, - 0x10, - 0x10, - 0x11, - 0x11, -}; - -const u8 gUnknown_0850DAF9[] = { - 0x14, - 0x14, - 0x15, - 0x16, - 0x17, - 0x14, - 0x14, - 0x15, - 0x15, -}; - -const u8 gUnknown_0850DB02[] = { - 0x14, - 0x14, - 0x15, - 0x16, - 0x17, - 0x14, - 0x14, - 0x15, - 0x15, -}; - -const u8 gUnknown_0850DB0B[] = { - 0x18, - 0x18, - 0x19, - 0x1a, - 0x1b, - 0x18, - 0x18, - 0x19, - 0x19, -}; - -const u8 gUnknown_0850DB14[] = { - 0x1c, - 0x1c, - 0x1d, - 0x1e, - 0x1f, - 0x1c, - 0x1c, - 0x1d, - 0x1d, -}; - -const u8 gUnknown_0850DB1D[] = { - 0x20, - 0x20, - 0x21, - 0x22, - 0x23, - 0x20, - 0x20, - 0x21, - 0x21, -}; - -const u8 gUnknown_0850DB26[] = { - 0x24, - 0x24, - 0x25, - 0x26, - 0x27, - 0x24, - 0x24, - 0x25, - 0x25, -}; - -const u8 gUnknown_0850DB2F[] = { - 0x00, - 0x00, - 0x01, - 0x02, - 0x03, - 0x00, - 0x00, - 0x01, - 0x01, -}; - -const u8 gUnknown_0850DB38[] = { - 0x04, - 0x04, - 0x05, - 0x06, - 0x07, - 0x04, - 0x04, - 0x05, - 0x05, -}; - -const u8 gUnknown_0850DB41[] = { - 0x08, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x08, - 0x08, - 0x09, - 0x09, -}; - -const u8 gUnknown_0850DB4A[] = { - 0x14, - 0x14, - 0x15, - 0x16, - 0x17, - 0x14, - 0x14, - 0x15, - 0x15, -}; - -const u8 gUnknown_0850DB53[] = { - 0x08, - 0x08, - 0x07, - 0x09, - 0x0a, - 0x08, - 0x08, - 0x07, - 0x07, +const u8 gTrainerFacingDirectionMovementTypes[] = { + MOVEMENT_TYPE_FACE_DOWN, // DIR_NONE + MOVEMENT_TYPE_FACE_DOWN, // DIR_SOUTH + MOVEMENT_TYPE_FACE_UP, // DIR_NORTH + MOVEMENT_TYPE_FACE_LEFT, // DIR_WEST + MOVEMENT_TYPE_FACE_RIGHT, // DIR_EAST + MOVEMENT_TYPE_FACE_DOWN, // DIR_SOUTHWEST + MOVEMENT_TYPE_FACE_DOWN, // DIR_SOUTHEAST + MOVEMENT_TYPE_FACE_UP, // DIR_NORTHWEST + MOVEMENT_TYPE_FACE_UP, // DIR_NORTHEAST }; bool8 (*const gOppositeDirectionBlockedMetatileFuncs[])(u8) = { @@ -830,220 +809,194 @@ const struct Coords16 gDirectionToVectors[] = { { 1, -1} }; -const u8 gUnknown_0850DBA0[] = { - 0x00, - 0x00, - 0x01, - 0x02, - 0x03, +const u8 gFaceDirectionMovementActions[] = { + MOVEMENT_ACTION_FACE_DOWN, + MOVEMENT_ACTION_FACE_DOWN, + MOVEMENT_ACTION_FACE_UP, + MOVEMENT_ACTION_FACE_LEFT, + MOVEMENT_ACTION_FACE_RIGHT, }; - -const u8 gUnknown_0850DBA5[] = { - 0x04, - 0x04, - 0x05, - 0x06, - 0x07, +const u8 gWalkSlowMovementActions[] = { + MOVEMENT_ACTION_WALK_SLOW_DOWN, + MOVEMENT_ACTION_WALK_SLOW_DOWN, + MOVEMENT_ACTION_WALK_SLOW_UP, + MOVEMENT_ACTION_WALK_SLOW_LEFT, + MOVEMENT_ACTION_WALK_SLOW_RIGHT, }; - -const u8 gUnknown_0850DBAA[] = { - 0x08, - 0x08, - 0x09, - 0x0a, - 0x0b, +const u8 gWalkNormalMovementActions[] = { + MOVEMENT_ACTION_WALK_NORMAL_DOWN, + MOVEMENT_ACTION_WALK_NORMAL_DOWN, + MOVEMENT_ACTION_WALK_NORMAL_UP, + MOVEMENT_ACTION_WALK_NORMAL_LEFT, + MOVEMENT_ACTION_WALK_NORMAL_RIGHT, }; - -const u8 gUnknown_0850DBAF[] = { - 0x15, - 0x15, - 0x16, - 0x17, - 0x18, +const u8 gWalkFastMovementActions[] = { + MOVEMENT_ACTION_WALK_FAST_DOWN, + MOVEMENT_ACTION_WALK_FAST_DOWN, + MOVEMENT_ACTION_WALK_FAST_UP, + MOVEMENT_ACTION_WALK_FAST_LEFT, + MOVEMENT_ACTION_WALK_FAST_RIGHT, }; - -const u8 gUnknown_0850DBB4[] = { - 0x29, - 0x29, - 0x2a, - 0x2b, - 0x2c, +const u8 gRideWaterCurrentMovementActions[] = { + MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, + MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, + MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP, + MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, + MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, }; - -const u8 gUnknown_0850DBB9[] = { - 0x2d, - 0x2d, - 0x2e, - 0x2f, - 0x30, +const u8 gWalkFastestMovementActions[] = { + MOVEMENT_ACTION_WALK_FASTEST_DOWN, + MOVEMENT_ACTION_WALK_FASTEST_DOWN, + MOVEMENT_ACTION_WALK_FASTEST_UP, + MOVEMENT_ACTION_WALK_FASTEST_LEFT, + MOVEMENT_ACTION_WALK_FASTEST_RIGHT, }; - -const u8 gUnknown_0850DBBE[] = { - 0x31, - 0x31, - 0x32, - 0x33, - 0x34, +const u8 gSlideMovementActions[] = { + MOVEMENT_ACTION_SLIDE_DOWN, + MOVEMENT_ACTION_SLIDE_DOWN, + MOVEMENT_ACTION_SLIDE_UP, + MOVEMENT_ACTION_SLIDE_LEFT, + MOVEMENT_ACTION_SLIDE_RIGHT, }; - -const u8 gUnknown_0850DBC3[] = { - 0x35, - 0x35, - 0x36, - 0x37, - 0x38, +const u8 gPlayerRunMovementActions[] = { + MOVEMENT_ACTION_PLAYER_RUN_DOWN, + MOVEMENT_ACTION_PLAYER_RUN_DOWN, + MOVEMENT_ACTION_PLAYER_RUN_UP, + MOVEMENT_ACTION_PLAYER_RUN_LEFT, + MOVEMENT_ACTION_PLAYER_RUN_RIGHT, }; - -const u8 gUnknown_0850DBC8[] = { - 0x0c, - 0x0c, - 0x0d, - 0x0e, - 0x0f, +const u8 gJump2MovementActions[] = { + MOVEMENT_ACTION_JUMP_2_DOWN, + MOVEMENT_ACTION_JUMP_2_DOWN, + MOVEMENT_ACTION_JUMP_2_UP, + MOVEMENT_ACTION_JUMP_2_LEFT, + MOVEMENT_ACTION_JUMP_2_RIGHT, }; - -const u8 gUnknown_0850DBCD[] = { - 0x46, - 0x46, - 0x47, - 0x48, - 0x49, +const u8 gJumpInPlaceMovementActions[] = { + MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN, + MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN, + MOVEMENT_ACTION_JUMP_IN_PLACE_UP, + MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT, + MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT, }; - -const u8 gUnknown_0850DBD2[] = { - 0x4b, - 0x4b, - 0x4a, - 0x4d, - 0x4c, +const u8 gJumpInPlaceTurnAroundMovementActions[] = { + MOVEMENT_ACTION_JUMP_IN_PLACE_UP_DOWN, + MOVEMENT_ACTION_JUMP_IN_PLACE_UP_DOWN, + MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN_UP, + MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT_LEFT, + MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT_RIGHT, }; - -const u8 gUnknown_0850DBD7[] = { - 0x42, - 0x42, - 0x43, - 0x44, - 0x45, +const u8 gJumpMovementActions[] = { + MOVEMENT_ACTION_JUMP_DOWN, + MOVEMENT_ACTION_JUMP_DOWN, + MOVEMENT_ACTION_JUMP_UP, + MOVEMENT_ACTION_JUMP_LEFT, + MOVEMENT_ACTION_JUMP_RIGHT, }; - -const u8 gUnknown_0850DBDC[] = { - 0x3a, - 0x3a, - 0x3b, - 0x3c, - 0x3d, +const u8 gJumpSpecialMovementActions[] = { + MOVEMENT_ACTION_JUMP_SPECIAL_DOWN, + MOVEMENT_ACTION_JUMP_SPECIAL_DOWN, + MOVEMENT_ACTION_JUMP_SPECIAL_UP, + MOVEMENT_ACTION_JUMP_SPECIAL_LEFT, + MOVEMENT_ACTION_JUMP_SPECIAL_RIGHT, }; - -const u8 gUnknown_0850DBE1[] = { - 0x19, - 0x19, - 0x1a, - 0x1b, - 0x1c, +const u8 gWalkInPlaceSlowMovementActions[] = { + MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_UP, + MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT, + MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT, }; - -const u8 gUnknown_0850DBE6[] = { - 0x1d, - 0x1d, - 0x1e, - 0x1f, - 0x20, +const u8 gWalkInPlaceNormalMovementActions[] = { + MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_UP, + MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT, + MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT, }; - -const u8 gUnknown_0850DBEB[] = { - 0x21, - 0x21, - 0x22, - 0x23, - 0x24, +const u8 gWalkInPlaceFastMovementActions[] = { + MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_FAST_UP, + MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT, + MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT, }; - -const u8 gUnknown_0850DBF0[] = { - 0x25, - 0x25, - 0x26, - 0x27, - 0x28, +const u8 gWalkInPlaceFastestMovementActions[] = { + MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_DOWN, + MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_UP, + MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_LEFT, + MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_RIGHT, }; - -const u8 gUnknown_0850DBF5[] = { - 0x64, - 0x64, - 0x65, - 0x66, - 0x67, +const u8 gAcroWheelieFaceDirectionMovementActions[] = { + MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT, }; - -const u8 gUnknown_0850DBFA[] = { - 0x68, - 0x68, - 0x69, - 0x6a, - 0x6b, +const u8 gAcroPopWheelieFaceDirectionMovementActions[] = { + MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_UP, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT, }; - -const u8 gUnknown_0850DBFF[] = { - 0x6c, - 0x6c, - 0x6d, - 0x6e, - 0x6f, +const u8 gAcroEndWheelieFaceDirectionMovementActions[] = { + MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, + MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, + MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_UP, + MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT, + MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT, }; - -const u8 gUnknown_0850DC04[] = { - 0x70, - 0x70, - 0x71, - 0x72, - 0x73, +const u8 gAcroWheelieHopFaceDirectionMovementActions[] = { + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, }; - -const u8 gUnknown_0850DC09[] = { - 0x74, - 0x74, - 0x75, - 0x76, - 0x77, +const u8 gAcroWheelieHopDirectionMovementActions[] = { + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, }; - -const u8 gUnknown_0850DC0E[] = { - 0x78, - 0x78, - 0x79, - 0x7a, - 0x7b, +const u8 gAcroWheelieJumpDirectionMovementActions[] = { + MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT, }; - -const u8 gUnknown_0850DC13[] = { - 0x7c, - 0x7c, - 0x7d, - 0x7e, - 0x7f, +const u8 gAcroWheelieInPlaceDirectionMovementActions[] = { + MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT, }; - -const u8 gUnknown_0850DC18[] = { - 0x80, - 0x80, - 0x81, - 0x82, - 0x83, +const u8 gAcroPopWheelieMoveDirectionMovementActions[] = { + MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_UP, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT, + MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT, }; - -const u8 gUnknown_0850DC1D[] = { - 0x84, - 0x84, - 0x85, - 0x86, - 0x87, +const u8 gAcroWheelieMoveDirectionMovementActions[] = { + MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, + MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_UP, + MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT, + MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT, }; - -const u8 gUnknown_0850DC22[] = { - 0x88, - 0x88, - 0x89, - 0x8a, - 0x8b, +const u8 gAcroEndWheelieMoveDirectionMovementActions[] = { + MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, + MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, + MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_UP, + MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, + MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, }; const u8 gOppositeDirections[] = { @@ -1075,122 +1028,109 @@ const u8 gUnknown_0850DC3F[][4] = { // Code -static void npc_clear_ids_and_state(struct EventObject *eventObject) +static void ClearEventObject(struct EventObject *eventObject) { *eventObject = (struct EventObject){}; eventObject->localId = 0xFF; - eventObject->mapNum = -1; - eventObject->mapGroup = -1; - eventObject->movementActionId = -1; + eventObject->mapNum = 0xFF; + eventObject->mapGroup = 0xFF; + eventObject->movementActionId = 0xFF; } -static void npcs_clear_ids_and_state(void) +static void ClearAllEventObjects(void) { u8 i; - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) - { - npc_clear_ids_and_state(&gEventObjects[i]); - } + for (i = 0; i < NUM_EVENT_OBJECTS; i++) + ClearEventObject(&gEventObjects[i]); } void sub_808D438(void) { - ZeroAllLinkPlayerEventObjects(); - npcs_clear_ids_and_state(); + ClearLinkPlayerEventObjects(); + ClearAllEventObjects(); ClearPlayerAvatarInfo(); sub_808D450(); } static void sub_808D450(void) { - u8 spriteIdx; + u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[21], 0, 0, 31); + gSprites[spriteId].oam.affineMode = 1; + InitSpriteAffineAnim(&gSprites[spriteId]); + StartSpriteAffineAnim(&gSprites[spriteId], 0); + gSprites[spriteId].invisible = 1; - spriteIdx = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[21], 0, 0, 31); - gSprites[spriteIdx].oam.affineMode = 1; - InitSpriteAffineAnim(&gSprites[spriteIdx]); - StartSpriteAffineAnim(&gSprites[spriteIdx], 0); - gSprites[spriteIdx].invisible = TRUE; - - spriteIdx = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[21], 0, 0, 31); - gSprites[spriteIdx].oam.affineMode = 1; - InitSpriteAffineAnim(&gSprites[spriteIdx]); - StartSpriteAffineAnim(&gSprites[spriteIdx], 1); - gSprites[spriteIdx].invisible = TRUE; + spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[21], 0, 0, 31); + gSprites[spriteId].oam.affineMode = 1; + InitSpriteAffineAnim(&gSprites[spriteId]); + StartSpriteAffineAnim(&gSprites[spriteId], 1); + gSprites[spriteId].invisible = 1; } -u8 sub_808D4F4(void) +u8 GetFirstInactiveEventObjectId(void) { u8 i; - - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { if (!gEventObjects[i].active) - { break; - } } + return i; } -u8 GetEventObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +u8 GetEventObjectIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroupId) { if (localId < 0xff) { - return GetEventObjectIdByLocalIdAndMapInternal(localId, mapId, mapGroupId); + return GetEventObjectIdByLocalIdAndMapInternal(localId, mapNum, mapGroupId); } return GetEventObjectIdByLocalId(localId); } -bool8 TryGetEventObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId, u8 *eventObjectId) +bool8 TryGetEventObjectIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroupId, u8 *eventObjectId) { - *eventObjectId = GetEventObjectIdByLocalIdAndMap(localId, mapId, mapGroupId); + *eventObjectId = GetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroupId); if (*eventObjectId == NUM_EVENT_OBJECTS) - { return TRUE; - } - return FALSE; + else + return FALSE; } u8 GetEventObjectIdByXY(s16 x, s16 y) { u8 i; - - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { if (gEventObjects[i].active && gEventObjects[i].currentCoords.x == x && gEventObjects[i].currentCoords.y == y) - { break; - } } + return i; } -static u8 GetEventObjectIdByLocalIdAndMapInternal(u8 localId, u8 mapId, u8 mapGroupId) +static u8 GetEventObjectIdByLocalIdAndMapInternal(u8 localId, u8 mapNum, u8 mapGroupId) { u8 i; - - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { - if (gEventObjects[i].active && gEventObjects[i].localId == localId && gEventObjects[i].mapNum == mapId && gEventObjects[i].mapGroup == mapGroupId) - { + if (gEventObjects[i].active && gEventObjects[i].localId == localId && gEventObjects[i].mapNum == mapNum && gEventObjects[i].mapGroup == mapGroupId) return i; - } } + return NUM_EVENT_OBJECTS; } static u8 GetEventObjectIdByLocalId(u8 localId) { u8 i; - - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { if (gEventObjects[i].active && gEventObjects[i].localId == localId) - { return i; - } } + return NUM_EVENT_OBJECTS; } @@ -1199,17 +1139,17 @@ static u8 GetEventObjectIdByLocalId(u8 localId) static u8 InitEventObjectStateFromTemplate(struct EventObjectTemplate *template, u8 mapNum, u8 mapGroup) { struct EventObject *eventObject; + u8 eventObjectId; s16 x; s16 y; - u8 slot; // mapNum and mapGroup are in the wrong registers (r7/r6 instead of r6/r7) - if (GetAvailableEventObjectSlot(template->localId, mapNum, mapGroup, &slot)) + if (GetAvailableEventObjectId(template->localId, mapNum, mapGroup, &eventObjectId)) { return NUM_EVENT_OBJECTS; } - eventObject = &gEventObjects[slot]; - npc_clear_ids_and_state(eventObject); + eventObject = &gEventObjects[eventObjectId]; + ClearEventObject(eventObject); x = template->x + 7; y = template->y + 7; eventObject->active = TRUE; @@ -1233,22 +1173,22 @@ static u8 InitEventObjectStateFromTemplate(struct EventObjectTemplate *template, eventObject->trainerType = template->trainerType; eventObject->trainerRange_berryTreeId = template->trainerRange_berryTreeId; eventObject->previousMovementDirection = gInitialMovementTypeFacingDirections[template->movementType]; - EventObjectSetDirection(eventObject, eventObject->previousMovementDirection); - EventObjectHandleDynamicGraphicsId(eventObject); + SetEventObjectDirection(eventObject, eventObject->previousMovementDirection); + SetEventObjectDynamicGraphicsId(eventObject); if (gRangedMovementTypes[eventObject->movementType]) { if ((eventObject->range.as_nybbles.x) == 0) { // r9 is invoked here - eventObject->range.as_nybbles.x ++; + eventObject->range.as_nybbles.x++; } if ((eventObject->range.as_nybbles.y) == 0) { - eventObject->range.as_nybbles.y ++; + eventObject->range.as_nybbles.y++; } } - return slot; + return eventObjectId; } #else static NAKED u8 InitEventObjectStateFromTemplate(struct EventObjectTemplate *template, u8 mapId, u8 mapGroupId) @@ -1267,7 +1207,7 @@ static NAKED u8 InitEventObjectStateFromTemplate(struct EventObjectTemplate *tem "\tadds r1, r6, 0\n" "\tadds r2, r7, 0\n" "\tmov r3, sp\n" - "\tbl GetAvailableEventObjectSlot\n" + "\tbl GetAvailableEventObjectId\n" "\tlsls r0, 24\n" "\tcmp r0, 0\n" "\tbeq _0808D66E\n" @@ -1282,7 +1222,7 @@ static NAKED u8 InitEventObjectStateFromTemplate(struct EventObjectTemplate *tem "\tldr r1, =gEventObjects\n" "\tadds r4, r0, r1\n" "\tadds r0, r4, 0\n" - "\tbl npc_clear_ids_and_state\n" + "\tbl ClearEventObject\n" "\tldrh r3, [r5, 0x4]\n" "\tadds r3, 0x7\n" "\tlsls r3, 16\n" @@ -1356,9 +1296,9 @@ static NAKED u8 InitEventObjectStateFromTemplate(struct EventObjectTemplate *tem "\tstrb r1, [r0]\n" "\tldrb r1, [r0]\n" "\tadds r0, r4, 0\n" - "\tbl EventObjectSetDirection\n" + "\tbl SetEventObjectDirection\n" "\tadds r0, r4, 0\n" - "\tbl EventObjectHandleDynamicGraphicsId\n" + "\tbl SetEventObjectDynamicGraphicsId\n" "\tldr r1, =gRangedMovementTypes\n" "\tldrb r0, [r4, 0x6]\n" "\tadds r0, r1\n" @@ -1407,7 +1347,7 @@ static NAKED u8 InitEventObjectStateFromTemplate(struct EventObjectTemplate *tem } #endif -u8 unref_sub_808D77C(u8 localId) +u8 Unref_TryInitLocalEventObject(u8 localId) { u8 i; u8 nObjects; @@ -1427,7 +1367,7 @@ u8 unref_sub_808D77C(u8 localId) { nObjects = gMapHeader.events->eventObjectCount; } - for (i = 0; i < nObjects; i ++) + for (i = 0; i < nObjects; i++) { template = &gSaveBlock1Ptr->eventObjectTemplates[i]; if (template->localId == localId && !FlagGet(template->flagId)) @@ -1439,16 +1379,16 @@ u8 unref_sub_808D77C(u8 localId) return NUM_EVENT_OBJECTS; } -static bool8 GetAvailableEventObjectSlot(u16 localId, u8 mapNum, u8 mapGroup, u8 *result) +static bool8 GetAvailableEventObjectId(u16 localId, u8 mapNum, u8 mapGroup, u8 *eventObjectId) // Looks for an empty slot. // Returns FALSE and the location of the available slot -// in *result. +// in *eventObjectId. // If no slots are available, or if the object is already // loaded, returns TRUE. { u8 i = 0; - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { if (!gEventObjects[i].active) break; @@ -1457,12 +1397,12 @@ static bool8 GetAvailableEventObjectSlot(u16 localId, u8 mapNum, u8 mapGroup, u8 } if (i >= NUM_EVENT_OBJECTS) return TRUE; - *result = i; + *eventObjectId = i; do { if (gEventObjects[i].active && gEventObjects[i].localId == localId && gEventObjects[i].mapNum == mapNum && gEventObjects[i].mapGroup == mapGroup) return TRUE; - i ++; + i++; } while (i < NUM_EVENT_OBJECTS); return FALSE; } @@ -1475,11 +1415,11 @@ static void RemoveEventObject(struct EventObject *eventObject) void RemoveEventObjectByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup) { - u8 index; - if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &index)) + u8 eventObjectId; + if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjectId)) { - FlagSet(GetEventObjectFlagIdByEventObjectId(index)); - RemoveEventObject(&gEventObjects[index]); + FlagSet(GetEventObjectFlagIdByEventObjectId(eventObjectId)); + RemoveEventObject(&gEventObjects[eventObjectId]); } } @@ -1491,20 +1431,18 @@ static void RemoveEventObjectInternal(struct EventObject *eventObject) DestroySprite(&gSprites[eventObject->spriteId]); } -void unref_sub_808D958(void) +void RemoveAllEventObjectsExceptPlayer(void) { u8 i; - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { if (i != gPlayerAvatar.eventObjectId) - { RemoveEventObject(&gEventObjects[i]); - } } } -static u8 SpawnEventObjectInternal(struct EventObjectTemplate *eventObjectTemplate, struct SpriteTemplate *spriteTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY) +static u8 TrySetupEventObjectSprite(struct EventObjectTemplate *eventObjectTemplate, struct SpriteTemplate *spriteTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY) { struct EventObject *eventObject; const struct EventObjectGraphicsInfo *graphicsInfo; @@ -1515,9 +1453,8 @@ static u8 SpawnEventObjectInternal(struct EventObjectTemplate *eventObjectTempla eventObjectId = InitEventObjectStateFromTemplate(eventObjectTemplate, mapNum, mapGroup); if (eventObjectId == NUM_EVENT_OBJECTS) - { return NUM_EVENT_OBJECTS; - } + eventObject = &gEventObjects[eventObjectId]; graphicsInfo = GetEventObjectGraphicsInfo(eventObject->graphicsId); paletteSlot = graphicsInfo->paletteSlot; @@ -1558,14 +1495,14 @@ static u8 SpawnEventObjectInternal(struct EventObjectTemplate *eventObjectTempla eventObject->inanimate = graphicsInfo->inanimate; if (!eventObject->inanimate) { - StartSpriteAnim(sprite, EventObjectDirectionToImageAnimId(eventObject->facingDirection)); + StartSpriteAnim(sprite, GetFaceDirectionAnimNum(eventObject->facingDirection)); } SetObjectSubpriorityByZCoord(eventObject->previousElevation, sprite, 1); - sub_8096518(eventObject, sprite); + UpdateEventObjectVisibility(eventObject, sprite); return eventObjectId; } -static u8 SpawnEventObject(struct EventObjectTemplate *eventObjectTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY) +static u8 TrySpawnEventObject(struct EventObjectTemplate *eventObjectTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY) { const struct EventObjectGraphicsInfo *graphicsInfo; struct SpriteTemplate spriteTemplate; @@ -1578,7 +1515,7 @@ static u8 SpawnEventObject(struct EventObjectTemplate *eventObjectTemplate, u8 m MakeObjectTemplateFromEventObjectTemplate(eventObjectTemplate, &spriteTemplate, &subspriteTables); spriteFrameImage.size = graphicsInfo->size; spriteTemplate.images = &spriteFrameImage; - eventObjectId = SpawnEventObjectInternal(eventObjectTemplate, &spriteTemplate, mapNum, mapGroup, cameraX, cameraY); + eventObjectId = TrySetupEventObjectSprite(eventObjectTemplate, &spriteTemplate, mapNum, mapGroup, cameraX, cameraY); if (eventObjectId == NUM_EVENT_OBJECTS) { return NUM_EVENT_OBJECTS; @@ -1597,7 +1534,7 @@ u8 SpawnSpecialEventObject(struct EventObjectTemplate *eventObjectTemplate) s16 cameraY; GetEventObjectMovingCameraOffset(&cameraX, &cameraY); - return SpawnEventObject(eventObjectTemplate, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY); + return TrySpawnEventObject(eventObjectTemplate, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY); } u8 SpawnSpecialEventObjectParametrized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 z) @@ -1632,7 +1569,7 @@ u8 show_sprite(u8 localId, u8 mapNum, u8 mapGroup) return NUM_EVENT_OBJECTS; } GetEventObjectMovingCameraOffset(&cameraX, &cameraY); - return SpawnEventObject(eventObjectTemplate, mapNum, mapGroup, cameraX, cameraY); + return TrySpawnEventObject(eventObjectTemplate, mapNum, mapGroup, cameraX, cameraY); } static void MakeObjectTemplateFromEventObjectGraphicsInfo(u16 graphicsId, void (*callback)(struct Sprite *), struct SpriteTemplate *sprTemplate, const struct SubspriteTable **subspriteTables) @@ -1651,7 +1588,7 @@ static void MakeObjectTemplateFromEventObjectGraphicsInfo(u16 graphicsId, void ( static void MakeObjectTemplateFromEventObjectGraphicsInfoWithCallbackIndex(u16 graphicsId, u16 callbackIndex, struct SpriteTemplate *sprTemplate, const struct SubspriteTable **subspriteTables) { - MakeObjectTemplateFromEventObjectGraphicsInfo(graphicsId, gUnknown_08505438[callbackIndex], sprTemplate, subspriteTables); + MakeObjectTemplateFromEventObjectGraphicsInfo(graphicsId, sMovementTypeCallbacks[callbackIndex], sprTemplate, subspriteTables); } static void MakeObjectTemplateFromEventObjectTemplate(struct EventObjectTemplate *eventObjectTemplate, struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables) @@ -1693,7 +1630,7 @@ u8 sprite_new(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction) struct Sprite *sprite; graphicsInfo = GetEventObjectGraphicsInfo(graphicsId); - MakeObjectTemplateFromEventObjectGraphicsInfo(graphicsId, sub_8097AC8, &spriteTemplate, &subspriteTables); + MakeObjectTemplateFromEventObjectGraphicsInfo(graphicsId, UpdateEventObjectSpriteSubpriorityAndVisibility, &spriteTemplate, &subspriteTables); *(u16 *)&spriteTemplate.paletteTag = 0xffff; x += 7; y += 7; @@ -1728,12 +1665,12 @@ u8 sprite_new(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction) } InitObjectPriorityByZCoord(sprite, z); SetObjectSubpriorityByZCoord(z, sprite, 1); - StartSpriteAnim(sprite, EventObjectDirectionToImageAnimId(direction)); + StartSpriteAnim(sprite, GetFaceDirectionAnimNum(direction)); } return spriteId; } -void SpawnEventObjectsInView(s16 cameraX, s16 cameraY) +void TrySpawnEventObjects(s16 cameraX, s16 cameraY) { u8 i; s16 left; @@ -1772,21 +1709,21 @@ void SpawnEventObjectsInView(s16 cameraX, s16 cameraY) if (top <= npcY && bottom >= npcY && left <= npcX && right >= npcX && !FlagGet(template->flagId)) - SpawnEventObject(template, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY); + TrySpawnEventObject(template, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY); } } } -/*static*/ void RemoveEventObjectsOutsideView(void) +void RemoveEventObjectsOutsideView(void) { u8 i; u8 j; bool8 isActiveLinkPlayer; struct EventObject *eventObject; - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { - for (j = 0, isActiveLinkPlayer = FALSE; j < ARRAY_COUNT(gLinkPlayerEventObjects); j ++) + for (j = 0, isActiveLinkPlayer = FALSE; j < ARRAY_COUNT(gLinkPlayerEventObjects); j++) { if (gLinkPlayerEventObjects[j].active && i == gLinkPlayerEventObjects[j].eventObjId) isActiveLinkPlayer = TRUE; @@ -1827,7 +1764,7 @@ void sub_808E16C(s16 x, s16 y) u8 i; ClearPlayerAvatarInfo(); - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { if (gEventObjects[i].active) { @@ -1849,7 +1786,7 @@ static void sub_808E1B8(u8 eventObjectId, s16 x, s16 y) struct Sprite *sprite; #define i spriteId - for (i = 0; i < ARRAY_COUNT(gLinkPlayerEventObjects); i ++) + for (i = 0; i < ARRAY_COUNT(gLinkPlayerEventObjects); i++) { if (gLinkPlayerEventObjects[i].active && eventObjectId == gLinkPlayerEventObjects[i].eventObjId) { @@ -1905,7 +1842,7 @@ static void sub_808E1B8(u8 eventObjectId, s16 x, s16 y) eventObject->spriteId = spriteId; if (!eventObject->inanimate && eventObject->movementType != 0x0b) { - StartSpriteAnim(sprite, EventObjectDirectionToImageAnimId(eventObject->facingDirection)); + StartSpriteAnim(sprite, GetFaceDirectionAnimNum(eventObject->facingDirection)); } sub_808E38C(eventObject); SetObjectSubpriorityByZCoord(eventObject->previousElevation, sprite, 1); @@ -1914,7 +1851,7 @@ static void sub_808E1B8(u8 eventObjectId, s16 x, s16 y) static void sub_808E38C(struct EventObject *eventObject) { - eventObject->singleMovementActive = FALSE; + eventObject->singleMovementActive = 0; eventObject->triggerGroundEffectsOnMove = TRUE; eventObject->hasShadow = FALSE; eventObject->hasReflection = FALSE; @@ -1922,7 +1859,7 @@ static void sub_808E38C(struct EventObject *eventObject) eventObject->inShallowFlowingWater = FALSE; eventObject->inSandPile = FALSE; eventObject->inHotSprings = FALSE; - EventObjectClearAnim(eventObject); + EventObjectClearHeldMovement(eventObject); } static void SetPlayerAvatarEventObjectIdAndObjectId(u8 eventObjectId, u8 spriteId) @@ -1986,10 +1923,10 @@ void EventObjectSetGraphicsIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, void EventObjectTurn(struct EventObject *eventObject, u8 direction) { - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); if (!eventObject->inanimate) { - StartSpriteAnim(&gSprites[eventObject->spriteId], EventObjectDirectionToImageAnimId(eventObject->facingDirection)); + StartSpriteAnim(&gSprites[eventObject->spriteId], GetFaceDirectionAnimNum(eventObject->facingDirection)); SeekSpriteAnim(&gSprites[eventObject->spriteId], 0); } } @@ -2054,7 +1991,7 @@ const struct EventObjectGraphicsInfo *GetEventObjectGraphicsInfo(u8 graphicsId) return gEventObjectGraphicsInfoPointers[graphicsId]; } -static void EventObjectHandleDynamicGraphicsId(struct EventObject *eventObject) +static void SetEventObjectDynamicGraphicsId(struct EventObject *eventObject) { if (eventObject->graphicsId >= SPRITE_VAR) { @@ -2154,7 +2091,7 @@ void sub_808E8C0(u16 *paletteTags) { u8 i; - for (i = 0; paletteTags[i] != 0x11ff; i ++) + for (i = 0; paletteTags[i] != 0x11ff; i++) { sub_808E894(paletteTags[i]); } @@ -2182,8 +2119,8 @@ void pal_patch_for_npc_range(const u16 *paletteTags, u8 minSlot, u8 maxSlot) while (minSlot < maxSlot) { pal_patch_for_npc(*paletteTags, minSlot); - paletteTags ++; - minSlot ++; + paletteTags++; + minSlot++; } } @@ -2191,7 +2128,7 @@ static u8 FindEventObjectPaletteIndexByTag(u16 tag) { u8 i; - for (i = 0; gUnknown_0850BBC8[i].tag != 0x11ff; i ++) + for (i = 0; gUnknown_0850BBC8[i].tag != 0x11ff; i++) { if (gUnknown_0850BBC8[i].tag == tag) { @@ -2206,7 +2143,7 @@ void npc_load_two_palettes__no_record(u16 tag, u8 slot) u8 i; pal_patch_for_npc(tag, slot); - for (i = 0; gUnknown_0850BD00[i].tag != 0x11ff; i ++) + for (i = 0; gUnknown_0850BD00[i].tag != 0x11ff; i++) { if (gUnknown_0850BD00[i].tag == tag) { @@ -2222,7 +2159,7 @@ void npc_load_two_palettes__and_record(u16 tag, u8 slot) gUnknown_020375B6 = tag; pal_patch_for_npc(tag, slot); - for (i = 0; gUnknown_0850BD78[i].tag != 0x11ff; i ++) + for (i = 0; gUnknown_0850BD78[i].tag != 0x11ff; i++) { if (gUnknown_0850BD78[i].tag == tag) { @@ -2245,7 +2182,7 @@ void unref_sub_808EAC4(struct EventObject *eventObject, s16 x, s16 y) eventObject->currentCoords.y += y; } -void npc_coords_shift(struct EventObject *eventObject, s16 x, s16 y) +void ShiftEventObjectCoords(struct EventObject *eventObject, s16 x, s16 y) { eventObject->previousCoords.x = eventObject->currentCoords.x; eventObject->previousCoords.y = eventObject->currentCoords.y; @@ -2293,9 +2230,9 @@ void sub_808EBA8(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y) } } -void npc_coords_shift_still(struct EventObject *eventObject) +void ShiftStillEventObjectCoords(struct EventObject *eventObject) { - npc_coords_shift(eventObject, eventObject->currentCoords.x, eventObject->currentCoords.y); + ShiftEventObjectCoords(eventObject, eventObject->currentCoords.x, eventObject->currentCoords.y); } void UpdateEventObjectCoordsForCameraUpdate(void) @@ -2308,7 +2245,7 @@ void UpdateEventObjectCoordsForCameraUpdate(void) { dx = gCamera.x; dy = gCamera.y; - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { if (gEventObjects[i].active) { @@ -2326,7 +2263,7 @@ void UpdateEventObjectCoordsForCameraUpdate(void) u8 GetEventObjectIdByXYZ(u16 x, u16 y, u8 z) { u8 i; - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { if (gEventObjects[i].active) { @@ -2351,7 +2288,7 @@ static bool8 EventObjectDoesZCoordMatch(struct EventObject *eventObject, u8 z) void UpdateEventObjectsForCameraUpdate(s16 x, s16 y) { UpdateEventObjectCoordsForCameraUpdate(); - SpawnEventObjectsInView(x, y); + TrySpawnEventObjects(x, y); RemoveEventObjectsOutsideView(); } @@ -2407,7 +2344,7 @@ static struct Sprite *FindCameraObject(void) { u8 spriteId; - for (spriteId = 0; spriteId < MAX_SPRITES; spriteId ++) + for (spriteId = 0; spriteId < MAX_SPRITES; spriteId++) { if (gSprites[spriteId].inUse && gSprites[spriteId].callback == ObjectCB_CameraObject) { @@ -2462,7 +2399,7 @@ u8 CopySprite(struct Sprite *sprite, s16 x, s16 y, u8 subpriority) { u8 i; - for (i = 0; i < MAX_SPRITES; i ++) + for (i = 0; i < MAX_SPRITES; i++) { if (!gSprites[i].inUse) { @@ -2494,7 +2431,7 @@ u8 obj_unfreeze(struct Sprite *sprite, s16 x, s16 y, u8 subpriority) return MAX_SPRITES; } -void EventObjectSetDirection(struct EventObject *eventObject, u8 direction) +void SetEventObjectDirection(struct EventObject *eventObject, u8 direction) { s8 d2; eventObject->previousMovementDirection = eventObject->facingDirection; @@ -2575,14 +2512,14 @@ static struct EventObjectTemplate *GetEventObjectTemplateByLocalIdAndMap(u8 loca templates = mapHeader->events->eventObjects; count = mapHeader->events->eventObjectCount; } - return FindEventObjectTemplateInArrayByLocalId(localId, templates, count); + return FindEventObjectTemplateByLocalId(localId, templates, count); } -static struct EventObjectTemplate *FindEventObjectTemplateInArrayByLocalId(u8 localId, struct EventObjectTemplate *templates, u8 count) +static struct EventObjectTemplate *FindEventObjectTemplateByLocalId(u8 localId, struct EventObjectTemplate *templates, u8 count) { u8 i; - for (i = 0; i < count; i ++) + for (i = 0; i < count; i++) { if (templates[i].localId == localId) { @@ -2592,7 +2529,7 @@ static struct EventObjectTemplate *FindEventObjectTemplateInArrayByLocalId(u8 lo return NULL; } -struct EventObjectTemplate *sub_808F1B4(const struct EventObject *eventObject) +struct EventObjectTemplate *GetBaseTemplateForEventObject(const struct EventObject *eventObject) { int i; @@ -2600,7 +2537,7 @@ struct EventObjectTemplate *sub_808F1B4(const struct EventObject *eventObject) { return NULL; } - for (i = 0; i < 64; i ++) // Using ARRAY_COUNT here results in the wrong conditional branch instruction (bls instead of ble) + for (i = 0; i < 64; i++) // Using ARRAY_COUNT here results in the wrong conditional branch instruction (bls instead of ble) { if (eventObject->localId == gSaveBlock1Ptr->eventObjectTemplates[i].localId) { @@ -2610,11 +2547,11 @@ struct EventObjectTemplate *sub_808F1B4(const struct EventObject *eventObject) return NULL; } -void sub_808F208(const struct EventObject *eventObject) +void OverrideTemplateCoordsForEventObject(const struct EventObject *eventObject) { struct EventObjectTemplate *eventObjectTemplate; - eventObjectTemplate = sub_808F1B4(eventObject); + eventObjectTemplate = GetBaseTemplateForEventObject(eventObject); if (eventObjectTemplate != NULL) { eventObjectTemplate->x = eventObject->currentCoords.x - 7; @@ -2622,22 +2559,22 @@ void sub_808F208(const struct EventObject *eventObject) } } -void sub_808F228(const struct EventObject *eventObject, const u8 *script) +void OverrideMovementTypeForEventObject(const struct EventObject *eventObject, const u8 *script) { struct EventObjectTemplate *eventObjectTemplate; - eventObjectTemplate = sub_808F1B4(eventObject); + eventObjectTemplate = GetBaseTemplateForEventObject(eventObject); if (eventObjectTemplate != NULL) { eventObjectTemplate->script = script; } } -void sub_808F23C(const struct EventObject *eventObject, u8 movementType) +void TryOverrideTemplateCoordsForEventObject(const struct EventObject *eventObject, u8 movementType) { struct EventObjectTemplate *eventObjectTemplate; - eventObjectTemplate = sub_808F1B4(eventObject); + eventObjectTemplate = GetBaseTemplateForEventObject(eventObject); if (eventObjectTemplate != NULL) { eventObjectTemplate->movementType = movementType; @@ -2650,7 +2587,7 @@ void sub_808F254(u8 localId, u8 mapNum, u8 mapGroup) if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjectId)) { - sub_808F208(&gEventObjects[eventObjectId]); + OverrideTemplateCoordsForEventObject(&gEventObjects[eventObjectId]); } } @@ -2663,10 +2600,10 @@ void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat) switch (decorCat) { case DECORCAT_DOLL: - sub_808F228(&gEventObjects[eventObjectId], EventScript_2766A2); + OverrideMovementTypeForEventObject(&gEventObjects[eventObjectId], EventScript_2766A2); break; case DECORCAT_CUSHION: - sub_808F228(&gEventObjects[eventObjectId], EventScript_2766A6); + OverrideMovementTypeForEventObject(&gEventObjects[eventObjectId], EventScript_2766A6); break; } } @@ -2696,7 +2633,7 @@ u16 npc_paltag_by_palslot(u8 palSlot) { return gUnknown_0850BE38[gUnknown_020375B4][palSlot]; } - for (i = 0; gUnknown_0850BD78[i].tag != 0x11ff; i ++) + for (i = 0; gUnknown_0850BD78[i].tag != 0x11ff; i++) { if (gUnknown_0850BD78[i].tag == gUnknown_020375B6) { @@ -2706,41 +2643,37 @@ u16 npc_paltag_by_palslot(u8 palSlot) return 0x11ff; } -// Map Object Step Callbacks -// file boundary? +movement_type_empty_callback(MovementType_None) +movement_type_def(MovementType_WanderAround, gMovementTypeFuncs_WanderAround) -null_object_step(NoMovement1, FALSE) - -field_object_step(GoRandomDirections, gUnknown_0850D6F4) - -bool8 sub_808F44C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderAround_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_808F460(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderAround_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_808F48C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderAround_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (!EventObjectExecRegularAnim(eventObject, sprite)) + if (!EventObjectExecSingleMovementAction(eventObject, sprite)) { return FALSE; } - SetEventObjectStepTimer(sprite, gMovementDelaysMedium[Random() & 0x03]); + SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); sprite->data[1] = 3; return TRUE; } -bool8 sub_808F4C8(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderAround_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite)) + if (WaitForMovementDelay(sprite)) { sprite->data[1] = 4; return TRUE; @@ -2748,35 +2681,35 @@ bool8 sub_808F4C8(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_808F4E8(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderAround_Step4(struct EventObject *eventObject, struct Sprite *sprite) { u8 directions[4]; u8 chosenDirection; - memcpy(directions, gUnknown_0850D710, sizeof directions); - chosenDirection = directions[Random() & 0x03]; - EventObjectSetDirection(eventObject, chosenDirection); + memcpy(directions, gStandardDirections, sizeof directions); + chosenDirection = directions[Random() & 3]; + SetEventObjectDirection(eventObject, chosenDirection); sprite->data[1] = 5; - if (npc_block_way__next_tile(eventObject, chosenDirection)) + if (GetCollisionInDirection(eventObject, chosenDirection)) { sprite->data[1] = 1; } return TRUE; } -bool8 sub_808F534(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderAround_Step5(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetGoSpeed0AnimId(eventObject->movementDirection)); - eventObject->singleMovementActive = TRUE; + EventObjectSetSingleMovement(eventObject, sprite, GetWalkNormalMovementAction(eventObject->movementDirection)); + eventObject->singleMovementActive = 1; sprite->data[1] = 6; return TRUE; } -bool8 sub_808F564(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderAround_Step6(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - eventObject->singleMovementActive = FALSE; + eventObject->singleMovementActive = 0; sprite->data[1] = 1; } return FALSE; @@ -2793,7 +2726,7 @@ bool8 EventObjectIsTrainerAndCloseToPlayer(struct EventObject *eventObject) s16 minY; s16 maxY; - if (!TestPlayerAvatarFlags(0x80)) + if (!TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_DASH)) { return FALSE; } @@ -2815,7 +2748,7 @@ bool8 EventObjectIsTrainerAndCloseToPlayer(struct EventObject *eventObject) return TRUE; } -u8 GetRegularRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetVectorDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; @@ -2838,7 +2771,7 @@ u8 GetRegularRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) return direction; } -u8 GetNorthSouthRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetLimitedVectorDirection_SouthNorth(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; @@ -2850,7 +2783,7 @@ u8 GetNorthSouthRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) return direction; } -u8 GetEastWestRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetLimitedVectorDirection_WestEast(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; @@ -2862,14 +2795,14 @@ u8 GetEastWestRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) return direction; } -u8 GetNorthEastRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetLimitedVectorDirection_WestNorth(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; - direction = GetRegularRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_SOUTH) { - direction = GetEastWestRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); if (direction == DIR_EAST) { direction = DIR_NORTH; @@ -2877,7 +2810,7 @@ u8 GetNorthEastRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) } else if (direction == DIR_EAST) { - direction = GetNorthSouthRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); if (direction == DIR_SOUTH) { direction = DIR_NORTH; @@ -2886,14 +2819,14 @@ u8 GetNorthEastRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) return direction; } -u8 GetNorthWestRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetLimitedVectorDirection_EastNorth(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; - direction = GetRegularRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_SOUTH) { - direction = GetEastWestRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); if (direction == DIR_WEST) { direction = DIR_NORTH; @@ -2901,7 +2834,7 @@ u8 GetNorthWestRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) } else if (direction == DIR_WEST) { - direction = GetNorthSouthRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); if (direction == DIR_SOUTH) { direction = DIR_NORTH; @@ -2910,14 +2843,14 @@ u8 GetNorthWestRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) return direction; } -u8 GetSouthEastRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetLimitedVectorDirection_WestSouth(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; - direction = GetRegularRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_NORTH) { - direction = GetEastWestRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); if (direction == DIR_EAST) { direction = DIR_SOUTH; @@ -2925,7 +2858,7 @@ u8 GetSouthEastRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) } else if (direction == DIR_EAST) { - direction = GetNorthSouthRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); if (direction == DIR_NORTH) { direction = DIR_SOUTH; @@ -2934,14 +2867,14 @@ u8 GetSouthEastRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) return direction; } -u8 GetSouthWestRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetLimitedVectorDirection_EastSouth(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; - direction = GetRegularRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_NORTH) { - direction = GetEastWestRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); if (direction == DIR_WEST) { direction = DIR_SOUTH; @@ -2949,7 +2882,7 @@ u8 GetSouthWestRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) } else if (direction == DIR_WEST) { - direction = GetNorthSouthRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); if (direction == DIR_NORTH) { direction = DIR_SOUTH; @@ -2958,55 +2891,55 @@ u8 GetSouthWestRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) return direction; } -u8 GetNonEastRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetLimitedVectorDirection_SouthNorthWest(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; - direction = GetRegularRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_EAST) { - direction = GetNorthSouthRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); } return direction; } -u8 GetNonWestRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetLimitedVectorDirection_SouthNorthEast(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; - direction = GetRegularRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_WEST) { - direction = GetNorthSouthRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); } return direction; } -u8 GetNonSouthRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetLimitedVectorDirection_NorthWestEast(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; - direction = GetRegularRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_SOUTH) { - direction = GetEastWestRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); } return direction; } -u8 GetNonNorthRunningPastFacingDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) +u8 GetLimitedVectorDirection_SouthWestEast(s16 dx, s16 dy, s16 absdx, s16 absdy) { u8 direction; - direction = GetRegularRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_NORTH) { - direction = GetEastWestRunningPastFacingDirection(dx, dy, absdx, absdy); + direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); } return direction; } -u8 GetRunningPastFacingDirection(struct EventObject *eventObject, u8 movementType) +u8 TryGetTrainerEncounterDirection(struct EventObject *eventObject, u8 movementType) { s16 dx; s16 dy; @@ -3030,39 +2963,39 @@ u8 GetRunningPastFacingDirection(struct EventObject *eventObject, u8 movementTyp { absdy = -absdy; } - return gUnknown_0850D714[movementType](dx, dy, absdx, absdy); + return gGetVectorDirectionFuncs[movementType](dx, dy, absdx, absdy); } -field_object_step(LookRandomDirections, gUnknown_0850D740) +movement_type_def(MovementType_LookAround, gMovementTypeFuncs_LookAround) -bool8 sub_808F988(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_LookAround_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_808F99C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_LookAround_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_808F9C8(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_LookAround_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysMedium[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_808FA0C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_LookAround_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3070,52 +3003,50 @@ bool8 sub_808FA0C(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_808FA3C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_LookAround_Step4(struct EventObject *eventObject, struct Sprite *sprite) { + u8 direction; u8 directions[4]; - u8 direction; + memcpy(directions, gStandardDirections, sizeof directions); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_ANY); + if (direction == DIR_NONE) + direction = directions[Random() & 3]; - memcpy(directions, gUnknown_0850D710, sizeof directions); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_ANY); - if (direction == 0) - { - direction = directions[Random() & 0x03]; - } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(RandomlyGoNorthOrSouth, gUnknown_0850D754) +movement_type_def(MovementType_WanderUpAndDown, gMovementTypeFuncs_WanderUpAndDown) -bool8 sub_808FAC8(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderUpAndDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_808FADC(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderUpAndDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_808FB08(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderUpAndDown_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (!EventObjectExecRegularAnim(eventObject, sprite)) + if (!EventObjectExecSingleMovementAction(eventObject, sprite)) { return FALSE; } - SetEventObjectStepTimer(sprite, gMovementDelaysMedium[Random() & 0x03]); + SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); sprite->data[1] = 3; return TRUE; } -bool8 sub_808FB44(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderUpAndDown_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite)) + if (WaitForMovementDelay(sprite)) { sprite->data[1] = 4; return TRUE; @@ -3123,70 +3054,69 @@ bool8 sub_808FB44(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_808FB64(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderUpAndDown_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[2]; u8 direction; - - memcpy(directions, gUnknown_0850D770, sizeof directions); - direction = directions[Random() & 0x01]; - EventObjectSetDirection(eventObject, direction); + u8 directions[2]; + memcpy(directions, gUpAndDownDirections, sizeof directions); + direction = directions[Random() & 1]; + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 5; - if (npc_block_way__next_tile(eventObject, direction)) + if (GetCollisionInDirection(eventObject, direction)) { sprite->data[1] = 1; } return TRUE; } -bool8 sub_808FBB0(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderUpAndDown_Step5(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetGoSpeed0AnimId(eventObject->movementDirection)); - eventObject->singleMovementActive = TRUE; + EventObjectSetSingleMovement(eventObject, sprite, GetWalkNormalMovementAction(eventObject->movementDirection)); + eventObject->singleMovementActive = 1; sprite->data[1] = 6; return TRUE; } -bool8 sub_808FBE0(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderUpAndDown_Step6(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - eventObject->singleMovementActive = FALSE; + eventObject->singleMovementActive = 0; sprite->data[1] = 1; } return FALSE; } -field_object_step(RandomlyGoEastOrWest, gUnknown_0850D774) +movement_type_def(MovementType_WanderLeftAndRight, gMovementTypeFuncs_WanderLeftAndRight) -bool8 sub_808FC4C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderLeftAndRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_808FC60(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderLeftAndRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_808FC8C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderLeftAndRight_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (!EventObjectExecRegularAnim(eventObject, sprite)) + if (!EventObjectExecSingleMovementAction(eventObject, sprite)) { return FALSE; } - SetEventObjectStepTimer(sprite, gMovementDelaysMedium[Random() & 0x03]); + SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); sprite->data[1] = 3; return TRUE; } -bool8 sub_808FCC8(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderLeftAndRight_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite)) + if (WaitForMovementDelay(sprite)) { sprite->data[1] = 4; return TRUE; @@ -3194,53 +3124,52 @@ bool8 sub_808FCC8(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_808FCE8(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderLeftAndRight_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[2]; u8 direction; - - memcpy(directions, gUnknown_0850D790, sizeof directions); - direction = directions[Random() & 0x01]; - EventObjectSetDirection(eventObject, direction); + u8 directions[2]; + memcpy(directions, gLeftAndRightDirections, sizeof directions); + direction = directions[Random() & 1]; + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 5; - if (npc_block_way__next_tile(eventObject, direction)) + if (GetCollisionInDirection(eventObject, direction)) { sprite->data[1] = 1; } return TRUE; } -bool8 sub_808FD34(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderLeftAndRight_Step5(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetGoSpeed0AnimId(eventObject->movementDirection)); - eventObject->singleMovementActive = TRUE; + EventObjectSetSingleMovement(eventObject, sprite, GetWalkNormalMovementAction(eventObject->movementDirection)); + eventObject->singleMovementActive = 1; sprite->data[1] = 6; return TRUE; } -bool8 sub_808FD64(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WanderLeftAndRight_Step6(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - eventObject->singleMovementActive = FALSE; + eventObject->singleMovementActive = 0; sprite->data[1] = 1; } return FALSE; } -field_object_step(FaceFixedDirection, gUnknown_0850D794) +movement_type_def(MovementType_FaceDirection, gMovementTypeFuncs_FaceDirection) -bool8 sub_808FDD0(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDirection_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + ClearEventObjectMovement(eventObject, sprite); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 1; return TRUE; } -bool8 sub_808FDFC(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDirection_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { sprite->data[1] = 2; return TRUE; @@ -3248,42 +3177,41 @@ bool8 sub_808FDFC(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_808FE1C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDirection_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - eventObject->singleMovementActive = FALSE; + eventObject->singleMovementActive = 0; return FALSE; } static bool8 EventObjectCB2_BerryTree(struct EventObject *eventObject, struct Sprite *sprite); -extern bool8 (*const gUnknown_0850D7A0[])(struct EventObject *eventObject, struct Sprite *sprite); -void EventObjectCB_BerryTree(struct Sprite *sprite) +extern bool8 (*const gMovementTypeFuncs_BerryTreeGrowth[])(struct EventObject *eventObject, struct Sprite *sprite); +void MovementType_BerryTreeGrowth(struct Sprite *sprite) { struct EventObject *eventObject; eventObject = &gEventObjects[sprite->data[0]]; - if (!(sprite->data[7] & 0x0001)) + if (!(sprite->data[7] & 1)) { get_berry_tree_graphics(eventObject, sprite); - sprite->data[7] |= 0x0001; + sprite->data[7] |= 1; } - EventObjectStep(eventObject, sprite, EventObjectCB2_BerryTree); + UpdateEventObjectCurrentMovement(eventObject, sprite, EventObjectCB2_BerryTree); } static bool8 EventObjectCB2_BerryTree(struct EventObject *eventObject, struct Sprite *sprite) { - return gUnknown_0850D7A0[sprite->data[1]](eventObject, sprite); + return gMovementTypeFuncs_BerryTreeGrowth[sprite->data[1]](eventObject, sprite); } -bool8 do_berry_tree_growth_sparkle_1 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_BerryTreeGrowth_Step0(struct EventObject *eventObject, struct Sprite *sprite) { u8 berryStage; - - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); eventObject->invisible = TRUE; sprite->invisible = TRUE; berryStage = GetStageByBerryTreeId(eventObject->trainerRange_berryTreeId); if (berryStage == 0) { - if (!(sprite->data[7] & 0x0004) && sprite->animNum == 4) + if (!(sprite->data[7] & 4) && sprite->animNum == 4) { gFieldEffectArguments[0] = eventObject->currentCoords.x; gFieldEffectArguments[1] = eventObject->currentCoords.y; @@ -3303,14 +3231,14 @@ bool8 do_berry_tree_growth_sparkle_1 (struct EventObject *eventObject, struct Sp return TRUE; } get_berry_tree_graphics(eventObject, sprite); - EventObjectSetRegularAnim(eventObject, sprite, 0x39); + EventObjectSetSingleMovement(eventObject, sprite, MOVEMENT_ACTION_START_ANIM_IN_DIRECTION); sprite->data[1] = 1; return TRUE; } -bool8 sub_808FF48 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_BerryTreeGrowth_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { sprite->data[1] = 0; return TRUE; @@ -3318,12 +3246,12 @@ bool8 sub_808FF48 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 do_berry_tree_growth_sparkle_2 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_BerryTreeGrowth_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - eventObject->singleMovementActive = TRUE; + eventObject->singleMovementActive = 1; sprite->data[1] = 3; sprite->data[2] = 0; - sprite->data[7] |= 0x0002; + sprite->data[7] |= 2; gFieldEffectArguments[0] = eventObject->currentCoords.x; gFieldEffectArguments[1] = eventObject->currentCoords.y; gFieldEffectArguments[2] = sprite->subpriority - 1; @@ -3332,9 +3260,9 @@ bool8 do_berry_tree_growth_sparkle_2 (struct EventObject *eventObject, struct Sp return TRUE; } -bool8 sub_808FFB4 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_BerryTreeGrowth_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - sprite->data[2] ++; + sprite->data[2]++; eventObject->invisible = (sprite->data[2] & 0x02) >> 1; sprite->animPaused = TRUE; if (sprite->data[2] > 64) @@ -3347,9 +3275,9 @@ bool8 sub_808FFB4 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8090004 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_BerryTreeGrowth_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - sprite->data[2] ++; + sprite->data[2]++; eventObject->invisible = (sprite->data[2] & 0x02) >> 1; sprite->animPaused = TRUE; if (sprite->data[2] > 64) @@ -3361,36 +3289,36 @@ bool8 sub_8090004 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -field_object_step(RandomlyLookNorthOrSouth, gUnknown_0850D7B4) +movement_type_def(MovementType_FaceDownAndUp, gMovementTypeFuncs_FaceDownAndUp) -bool8 sub_8090094 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_80900A8 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_80900D4 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndUp_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysMedium[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_8090118 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndUp_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3398,52 +3326,51 @@ bool8 sub_8090118 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8090148 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndUp_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[2]; u8 direction; - - memcpy(directions, gUnknown_0850D770, sizeof gUnknown_0850D770); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_NORTH_SOUTH); + u8 directions[2]; + memcpy(directions, gUpAndDownDirections, sizeof gUpAndDownDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_NORTH_SOUTH); if (direction == 0) { - direction = directions[Random() & 0x01]; + direction = directions[Random() & 1]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(RandomlyLookEastOrWest, gUnknown_0850D7C8) +movement_type_def(MovementType_FaceLeftAndRight, gMovementTypeFuncs_FaceLeftAndRight) -bool8 sub_80901D4 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceLeftAndRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_80901E8 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceLeftAndRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_8090214 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceLeftAndRight_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysMedium[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_8090258 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceLeftAndRight_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3451,52 +3378,51 @@ bool8 sub_8090258 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8090288 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceLeftAndRight_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[2]; u8 direction; - - memcpy(directions, gUnknown_0850D790, sizeof gUnknown_0850D790); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_EAST_WEST); + u8 directions[2]; + memcpy(directions, gLeftAndRightDirections, sizeof gLeftAndRightDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_EAST_WEST); if (direction == 0) { - direction = directions[Random() & 0x01]; + direction = directions[Random() & 1]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(RandomlyLookNorthOrWest, gUnknown_0850D7DC) +movement_type_def(MovementType_FaceUpAndLeft, gMovementTypeFuncs_FaceUpAndLeft) -bool8 sub_8090314 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpAndLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_8090328 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpAndLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_8090354 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpAndLeft_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysShort[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_8090398 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpAndLeft_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3504,52 +3430,51 @@ bool8 sub_8090398 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_80903C8 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpAndLeft_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[2]; u8 direction; - - memcpy(directions, gUnknown_0850D7F0, sizeof gUnknown_0850D7F0); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_NORTH_WEST); + u8 directions[2]; + memcpy(directions, gUpAndLeftDirections, sizeof gUpAndLeftDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_NORTH_WEST); if (direction == 0) { - direction = directions[Random() & 0x01]; + direction = directions[Random() & 1]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(RandomlyLookNorthOrEast, gUnknown_0850D7F4) +movement_type_def(MovementType_FaceUpAndRight, gMovementTypeFuncs_FaceUpAndRight) -bool8 sub_8090454 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpAndRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_8090468 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpAndRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_8090494 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpAndRight_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysShort[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_80904D8 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpAndRight_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3557,52 +3482,51 @@ bool8 sub_80904D8 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8090508 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpAndRight_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[2]; u8 direction; - - memcpy(directions, gUnknown_0850D808, sizeof gUnknown_0850D808); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_NORTH_EAST); + u8 directions[2]; + memcpy(directions, gUpAndRightDirections, sizeof gUpAndRightDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_NORTH_EAST); if (direction == 0) { - direction = directions[Random() & 0x01]; + direction = directions[Random() & 1]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(RandomlyLookSouthOrWest, gUnknown_0850D80C) +movement_type_def(MovementType_FaceDownAndLeft, gMovementTypeFuncs_FaceDownAndLeft) -bool8 sub_8090594 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_80905A8 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_80905D4 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndLeft_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysShort[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_8090618 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndLeft_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3610,52 +3534,51 @@ bool8 sub_8090618 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8090648 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndLeft_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[2]; u8 direction; - - memcpy(directions, gUnknown_0850D820, sizeof gUnknown_0850D820); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_SOUTH_WEST); + u8 directions[2]; + memcpy(directions, gDownAndLeftDirections, sizeof gDownAndLeftDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_SOUTH_WEST); if (direction == 0) { - direction = directions[Random() & 0x01]; + direction = directions[Random() & 1]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(RandomlyLookSouthOrEast, gUnknown_0850D824) +movement_type_def(MovementType_FaceDownAndRight, gMovementTypeFuncs_FaceDownAndRight) -bool8 sub_80906D4 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_80906E8 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_8090714 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndRight_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysShort[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_8090758 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndRight_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3663,52 +3586,51 @@ bool8 sub_8090758 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8090788 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownAndRight_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[2]; u8 direction; - - memcpy(directions, gUnknown_0850D838, sizeof gUnknown_0850D838); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_SOUTH_EAST); + u8 directions[2]; + memcpy(directions, gDownAndRightDirections, sizeof gDownAndRightDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_SOUTH_EAST); if (direction == 0) { - direction = directions[Random() & 0x01]; + direction = directions[Random() & 1]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(RandomlyLookNorthOrSouthOrWest, gUnknown_0850D83C) +movement_type_def(MovementType_FaceDownUpAndLeft, gMovementTypeFuncs_FaceDownUpAndLeft) -bool8 sub_8090814 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownUpAndLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_8090828 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownUpAndLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_8090854 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownUpAndLeft_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysShort[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_8090898 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownUpAndLeft_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3716,52 +3638,51 @@ bool8 sub_8090898 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_80908C8 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownUpAndLeft_Step4(struct EventObject *eventObject, struct Sprite *sprite) { + u8 direction; u8 directions[4]; - u8 direction; - - memcpy(directions, gUnknown_0850D850, sizeof gUnknown_0850D850); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_NORTH_SOUTH_WEST); + memcpy(directions, gDownUpAndLeftDirections, sizeof gDownUpAndLeftDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_NORTH_SOUTH_WEST); if (direction == 0) { - direction = directions[Random() & 0x03]; + direction = directions[Random() & 3]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(RandomlyLookNorthOrSouthOrEast, gUnknown_0850D854) +movement_type_def(MovementType_FaceDownUpAndRight, gMovementTypeFuncs_FaceDownUpAndRight) -bool8 sub_8090954 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownUpAndRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_8090968 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownUpAndRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_8090994 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownUpAndRight_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysShort[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_80909D8 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownUpAndRight_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3769,52 +3690,51 @@ bool8 sub_80909D8 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8090A08 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownUpAndRight_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[4]; u8 direction; - - memcpy(directions, gUnknown_0850D868, sizeof gUnknown_0850D868); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_NORTH_SOUTH_EAST); + u8 directions[4]; + memcpy(directions, gDownUpAndRightDirections, sizeof gDownUpAndRightDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_NORTH_SOUTH_EAST); if (direction == 0) { - direction = directions[Random() & 0x03]; + direction = directions[Random() & 3]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(RandomlyLookNorthOrEastOrWest, gUnknown_0850D86C) +movement_type_def(MovementType_FaceUpRightAndLeft, gMovementTypeFuncs_FaceUpLeftAndRight) -bool8 sub_8090A94 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpLeftAndRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_8090AA8 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpLeftAndRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_8090AD4 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpLeftAndRight_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysShort[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_8090B18 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpLeftAndRight_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3822,52 +3742,51 @@ bool8 sub_8090B18 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8090B48 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceUpLeftAndRight_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[4]; u8 direction; - - memcpy(directions, gUnknown_0850D880, sizeof gUnknown_0850D880); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_NORTH_EAST_WEST); + u8 directions[4]; + memcpy(directions, gUpLeftAndRightDirections, sizeof gUpLeftAndRightDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_NORTH_EAST_WEST); if (direction == 0) { - direction = directions[Random() & 0x03]; + direction = directions[Random() & 3]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(RandomlyLookSouthOrEastOrWest, gUnknown_0850D884) +movement_type_def(MovementType_FaceDownRightAndLeft, gMovementTypeFuncs_FaceDownLeftAndRight) -bool8 sub_8090BD4 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownLeftAndRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_8090BE8 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownLeftAndRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 2; return TRUE; } -bool8 sub_8090C14 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownLeftAndRight_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, gMovementDelaysShort[Random() & 0x03]); - eventObject->singleMovementActive = FALSE; + SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + eventObject->singleMovementActive = 0; sprite->data[1] = 3; } return FALSE; } -bool8 sub_8090C58 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownLeftAndRight_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 4; return TRUE; @@ -3875,122 +3794,119 @@ bool8 sub_8090C58 (struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8090C88 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_FaceDownLeftAndRight_Step4(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[4]; u8 direction; - - memcpy(directions, gUnknown_0850D898, sizeof gUnknown_0850D898); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_SOUTH_EAST_WEST); + u8 directions[4]; + memcpy(directions, gDownLeftAndRightDirections, sizeof gDownLeftAndRightDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_SOUTH_EAST_WEST); if (direction == 0) { - direction = directions[Random() & 0x03]; + direction = directions[Random() & 3]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 1; return TRUE; } -field_object_step(LookAroundCounterclockwise, gUnknown_0850D89C) +movement_type_def(MovementType_RotateCounterclockwise, gMovementTypeFuncs_RotateCounterclockwise) -bool8 sub_8090D14 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_RotateCounterclockwise_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + ClearEventObjectMovement(eventObject, sprite); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 1; return TRUE; } -bool8 sub_8090D40 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_RotateCounterclockwise_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, 48); + SetMovementDelay(sprite, 48); sprite->data[1] = 2; } return FALSE; } -bool8 sub_8090D64 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_RotateCounterclockwise_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 3; } return FALSE; } -bool8 sub_8090D90 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_RotateCounterclockwise_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[5]; u8 direction; - - memcpy(directions, gUnknown_0850D8AC, sizeof gUnknown_0850D8AC); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_ANY); + u8 directions[5]; + memcpy(directions, gCounterclockwiseDirections, sizeof gCounterclockwiseDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_ANY); if (direction == 0) { direction = directions[eventObject->facingDirection]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 0; return TRUE; } -field_object_step(LookAroundClockwise, gUnknown_0850D8B4) +movement_type_def(MovementType_RotateClockwise, gMovementTypeFuncs_RotateClockwise) -bool8 sub_8090E18 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_RotateClockwise_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + ClearEventObjectMovement(eventObject, sprite); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); sprite->data[1] = 1; return TRUE; } -bool8 sub_8090E44 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_RotateClockwise_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - SetEventObjectStepTimer(sprite, 48); + SetMovementDelay(sprite, 48); sprite->data[1] = 2; } return FALSE; } -bool8 sub_8090E68 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_RotateClockwise_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (RunEventObjectStepTimer(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) + if (WaitForMovementDelay(sprite) || EventObjectIsTrainerAndCloseToPlayer(eventObject)) { sprite->data[1] = 3; } return FALSE; } -bool8 sub_8090E94 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_RotateClockwise_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - u8 directions[5]; u8 direction; - - memcpy(directions, gUnknown_0850D8C4, sizeof gUnknown_0850D8C4); - direction = GetRunningPastFacingDirection(eventObject, RUNFOLLOW_ANY); + u8 directions[5]; + memcpy(directions, gClockwiseDirections, sizeof gClockwiseDirections); + direction = TryGetTrainerEncounterDirection(eventObject, RUNFOLLOW_ANY); if (direction == 0) { direction = directions[eventObject->facingDirection]; } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 0; return TRUE; } -field_object_step(AlternatelyGoInOppositeDirections, gUnknown_0850D8CC) +movement_type_def(MovementType_WalkBackAndForth, gMovementTypeFuncs_WalkBackAndForth) -bool8 sub_8090F1C (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WalkBackAndForth_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 sub_8090F30 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WalkBackAndForth_Step1(struct EventObject *eventObject, struct Sprite *sprite) { u8 direction; @@ -3999,167 +3915,454 @@ bool8 sub_8090F30 (struct EventObject *eventObject, struct Sprite *sprite) { direction = GetOppositeDirection(direction); } - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); sprite->data[1] = 2; return TRUE; } -bool8 sub_8090F68 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WalkBackAndForth_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - bool8 blockingWay; - u8 animId; + bool8 collisionState; + u8 movementActionId; if (eventObject->directionSequenceIndex && eventObject->initialCoords.x == eventObject->currentCoords.x && eventObject->initialCoords.y == eventObject->currentCoords.y) { eventObject->directionSequenceIndex = 0; - EventObjectSetDirection(eventObject, GetOppositeDirection(eventObject->movementDirection)); + SetEventObjectDirection(eventObject, GetOppositeDirection(eventObject->movementDirection)); } - blockingWay = npc_block_way__next_tile(eventObject, eventObject->movementDirection); - animId = GetGoSpeed0AnimId(eventObject->movementDirection); - if (blockingWay == TRUE) + collisionState = GetCollisionInDirection(eventObject, eventObject->movementDirection); + movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection); + if (collisionState == TRUE) { - eventObject->directionSequenceIndex ++; - EventObjectSetDirection(eventObject, GetOppositeDirection(eventObject->movementDirection)); - animId = GetGoSpeed0AnimId(eventObject->movementDirection); - blockingWay = npc_block_way__next_tile(eventObject, eventObject->movementDirection); + eventObject->directionSequenceIndex++; + SetEventObjectDirection(eventObject, GetOppositeDirection(eventObject->movementDirection)); + movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection); + collisionState = GetCollisionInDirection(eventObject, eventObject->movementDirection); } - if (blockingWay) + if (collisionState) { - animId = GetStepInPlaceDelay16AnimId(eventObject->facingDirection); + movementActionId = GetWalkInPlaceNormalMovementAction(eventObject->facingDirection); } - EventObjectSetRegularAnim(eventObject, sprite, animId); - eventObject->singleMovementActive = TRUE; + EventObjectSetSingleMovement(eventObject, sprite, movementActionId); + eventObject->singleMovementActive = 1; sprite->data[1] = 3; return TRUE; } -bool8 sub_8091020 (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WalkBackAndForth_Step3(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - eventObject->singleMovementActive = FALSE; + eventObject->singleMovementActive = 0; sprite->data[1] = 1; } return FALSE; } -bool8 sub_8091048(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WalkSequence_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); sprite->data[1] = 1; return TRUE; } -bool8 MoveEventObjectInNextDirectionInSequence(struct EventObject *eventObject, struct Sprite *sprite, u8 *route) +bool8 MoveNextDirectionInSequence(struct EventObject *eventObject, struct Sprite *sprite, u8 *route) { - u8 blockingWay; - u8 animId; + u8 collisionState; + u8 movementActionId; if (eventObject->directionSequenceIndex == 3 && eventObject->initialCoords.x == eventObject->currentCoords.x && eventObject->initialCoords.y == eventObject->currentCoords.y) { eventObject->directionSequenceIndex = 0; } - EventObjectSetDirection(eventObject, route[eventObject->directionSequenceIndex]); - animId = GetGoSpeed0AnimId(eventObject->movementDirection); - blockingWay = npc_block_way__next_tile(eventObject, eventObject->movementDirection); - if (blockingWay == TRUE) + SetEventObjectDirection(eventObject, route[eventObject->directionSequenceIndex]); + movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection); + collisionState = GetCollisionInDirection(eventObject, eventObject->movementDirection); + if (collisionState == TRUE) { - eventObject->directionSequenceIndex ++; - EventObjectSetDirection(eventObject, route[eventObject->directionSequenceIndex]); - animId = GetGoSpeed0AnimId(eventObject->movementDirection); - blockingWay = npc_block_way__next_tile(eventObject, eventObject->movementDirection); + eventObject->directionSequenceIndex++; + SetEventObjectDirection(eventObject, route[eventObject->directionSequenceIndex]); + movementActionId = GetWalkNormalMovementAction(eventObject->movementDirection); + collisionState = GetCollisionInDirection(eventObject, eventObject->movementDirection); } - if (blockingWay) + if (collisionState) { - animId = GetStepInPlaceDelay16AnimId(eventObject->facingDirection); + movementActionId = GetWalkInPlaceNormalMovementAction(eventObject->facingDirection); } - EventObjectSetRegularAnim(eventObject, sprite, animId); - eventObject->singleMovementActive = TRUE; + EventObjectSetSingleMovement(eventObject, sprite, movementActionId); + eventObject->singleMovementActive = 1; sprite->data[1] = 2; return TRUE; } -bool8 sub_8091110(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WalkSequence_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - eventObject->singleMovementActive = FALSE; + eventObject->singleMovementActive = 0; sprite->data[1] = 1; } return FALSE; } -field_object_path( 1, gUnknown_0850D8DC, sub_809117C, gUnknown_0850D8E8, 2, x) -field_object_path( 2, gUnknown_0850D8EC, sub_8091208, gUnknown_0850D8F8, 1, x) -field_object_path( 3, gUnknown_0850D8FC, sub_8091294, gUnknown_0850D908, 1, y) -field_object_path( 4, gUnknown_0850D90C, sub_8091320, gUnknown_0850D918, 2, y) -field_object_path( 5, gUnknown_0850D91C, sub_80913AC, gUnknown_0850D928, 2, x) -field_object_path( 6, gUnknown_0850D92C, sub_8091438, gUnknown_0850D938, 1, x) -field_object_path( 7, gUnknown_0850D93C, sub_80914C4, gUnknown_0850D710, 1, y) -field_object_path( 8, gUnknown_0850D948, sub_8091550, gUnknown_0850D954, 2, y) -field_object_path( 9, gUnknown_0850D958, sub_80915DC, gUnknown_0850D964, 2, y) -field_object_path(10, gUnknown_0850D968, sub_8091668, gUnknown_0850D974, 1, y) -field_object_path(11, gUnknown_0850D978, sub_80916F4, gUnknown_0850D984, 1, x) -field_object_path(12, gUnknown_0850D988, sub_8091780, gUnknown_0850D994, 2, x) -field_object_path(13, gUnknown_0850D998, sub_809180C, gUnknown_0850D9A4, 2, y) -field_object_path(14, gUnknown_0850D9A8, sub_8091898, gUnknown_0850D9B4, 1, y) -field_object_path(15, gUnknown_0850D9B8, sub_8091924, gUnknown_0850D9C4, 1, x) -field_object_path(16, gUnknown_0850D9C8, sub_80919B0, gUnknown_0850D9D4, 2, x) -field_object_path(17, gUnknown_0850D9D8, sub_8091A3C, gUnknown_0850D9E4, 2, y) -field_object_path(18, gUnknown_0850D9E8, sub_8091AC8, gUnknown_0850D9F4, 2, y) -field_object_path(19, gUnknown_0850D9F8, sub_8091B54, gUnknown_0850DA04, 2, x) -field_object_path(20, gUnknown_0850DA08, sub_8091BE0, gUnknown_0850DA14, 2, x) -field_object_path(21, gUnknown_0850DA18, sub_8091C6C, gUnknown_0850DA24, 2, y) -field_object_path(22, gUnknown_0850DA28, sub_8091CF8, gUnknown_0850DA34, 2, y) -field_object_path(23, gUnknown_0850DA38, sub_8091D84, gUnknown_0850DA44, 2, x) -field_object_path(24, gUnknown_0850DA48, sub_8091E10, gUnknown_0850DA54, 2, x) +movement_type_def(MovementType_WalkSequenceUpRightLeftDown, gMovementTypeFuncs_WalkSequenceUpRightLeftDown) -field_object_step(CopyPlayer1, gUnknown_0850DA58) - -bool8 mss_npc_reset_oampriv3_1_unk2_unk3(struct EventObject *eventObject, struct Sprite *sprite) +u8 MovementType_WalkSequenceUpRightLeftDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + u8 directions[sizeof(gUpRightLeftDownDirections)]; + memcpy(directions, gUpRightLeftDownDirections, sizeof(gUpRightLeftDownDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceRightLeftDownUp, gMovementTypeFuncs_WalkSequenceRightLeftDownUp) + +u8 MovementType_WalkSequenceRightLeftDownUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gRightLeftDownUpDirections)]; + memcpy(directions, gRightLeftDownUpDirections, sizeof(gRightLeftDownUpDirections)); + if (eventObject->directionSequenceIndex == 1 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 2; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceDownUpRightLeft, gMovementTypeFuncs_WalkSequenceDownUpRightLeft) + +u8 MovementType_WalkSequenceDownUpRightLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gDownUpRightLeftDirections)]; + memcpy(directions, gDownUpRightLeftDirections, sizeof(gDownUpRightLeftDirections)); + if (eventObject->directionSequenceIndex == 1 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 2; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceLeftDownUpRight, gMovementTypeFuncs_WalkSequenceLeftDownUpRight) + +u8 MovementType_WalkSequenceLeftDownUpRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gLeftDownUpRightDirections)]; + memcpy(directions, gLeftDownUpRightDirections, sizeof(gLeftDownUpRightDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceUpLeftRightDown, gMovementTypeFuncs_WalkSequenceUpLeftRightDown) + +u8 MovementType_WalkSequenceUpLeftRightDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gUpLeftRightDownDirections)]; + memcpy(directions, gUpLeftRightDownDirections, sizeof(gUpLeftRightDownDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceLeftRightDownUp, gMovementTypeFuncs_WalkSequenceLeftRightDownUp) + +u8 MovementType_WalkSequenceLeftRightDownUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gLeftRightDownUpDirections)]; + memcpy(directions, gLeftRightDownUpDirections, sizeof(gLeftRightDownUpDirections)); + if (eventObject->directionSequenceIndex == 1 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 2; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceDownUpLeftRight, gMovementTypeFuncs_WalkSequenceDownUpLeftRight) + +u8 MovementType_WalkSequenceDownUpLeftRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gStandardDirections)]; + memcpy(directions, gStandardDirections, sizeof(gStandardDirections)); + if (eventObject->directionSequenceIndex == 1 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 2; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceRightDownUpLeft, gMovementTypeFuncs_WalkSequenceRightDownUpLeft) + +u8 MovementType_WalkSequenceRightDownUpLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gRightDownUpLeftDirections)]; + memcpy(directions, gRightDownUpLeftDirections, sizeof(gRightDownUpLeftDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceLeftUpDownRight, gMovementTypeFuncs_WalkSequenceLeftUpDownRight) + +u8 MovementType_WalkSequenceLeftUpDownRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gLeftUpDownRightDirections)]; + memcpy(directions, gLeftUpDownRightDirections, sizeof(gLeftUpDownRightDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceUpDownRightLeft, gMovementTypeFuncs_WalkSequenceUpDownRightLeft) + +u8 MovementType_WalkSequenceUpDownRightLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gUpDownRightLeftDirections)]; + memcpy(directions, gUpDownRightLeftDirections, sizeof(gUpDownRightLeftDirections)); + if (eventObject->directionSequenceIndex == 1 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 2; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceRightLeftUpDown, gMovementTypeFuncs_WalkSequenceRightLeftUpDown) + +u8 MovementType_WalkSequenceRightLeftUpDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gRightLeftUpDownDirections)]; + memcpy(directions, gRightLeftUpDownDirections, sizeof(gRightLeftUpDownDirections)); + if (eventObject->directionSequenceIndex == 1 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 2; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceDownRightLeftUp, gMovementTypeFuncs_WalkSequenceDownRightLeftUp) + +u8 MovementType_WalkSequenceDownRightLeftUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gDownRightLeftUpDirections)]; + memcpy(directions, gDownRightLeftUpDirections, sizeof(gDownRightLeftUpDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceRightUpDownLeft, gMovementTypeFuncs_WalkSequenceRightUpDownLeft) + +u8 MovementType_WalkSequenceRightUpDownLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gRightUpDownLeftDirections)]; + memcpy(directions, gRightUpDownLeftDirections, sizeof(gRightUpDownLeftDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceUpDownLeftRight, gMovementTypeFuncs_WalkSequenceUpDownLeftRight) + +u8 MovementType_WalkSequenceUpDownLeftRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gUpDownLeftRightDirections)]; + memcpy(directions, gUpDownLeftRightDirections, sizeof(gUpDownLeftRightDirections)); + if (eventObject->directionSequenceIndex == 1 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 2; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceLeftRightUpDown, gMovementTypeFuncs_WalkSequenceLeftRightUpDown) + +u8 MovementType_WalkSequenceLeftRightUpDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gLeftRightUpDownDirections)]; + memcpy(directions, gLeftRightUpDownDirections, sizeof(gLeftRightUpDownDirections)); + if (eventObject->directionSequenceIndex == 1 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 2; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceDownLeftRightUp, gMovementTypeFuncs_WalkSequenceDownLeftRightUp) + +u8 MovementType_WalkSequenceDownLeftRightUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gDownLeftRightUpDirections)]; + memcpy(directions, gDownLeftRightUpDirections, sizeof(gDownLeftRightUpDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceUpLeftDownRight, gMovementTypeFuncs_WalkSequenceUpLeftDownRight) + +u8 MovementType_WalkSequenceUpLeftDownRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gUpLeftDownRightDirections)]; + memcpy(directions, gUpLeftDownRightDirections, sizeof(gUpLeftDownRightDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceDownRightUpLeft, gMovementTypeFuncs_WalkSequenceDownRightUpLeft) + +u8 MovementType_WalkSequenceDownRightUpLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gDownRightUpLeftDirections)]; + memcpy(directions, gDownRightUpLeftDirections, sizeof(gDownRightUpLeftDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceLeftDownRightUp, gMovementTypeFuncs_WalkSequenceLeftDownRightUp) + +u8 MovementType_WalkSequenceLeftDownRightUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gLeftDownRightUpDirections)]; + memcpy(directions, gLeftDownRightUpDirections, sizeof(gLeftDownRightUpDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceRightUpLeftDown, gMovementTypeFuncs_WalkSequenceRightUpLeftDown) + +u8 MovementType_WalkSequenceRightUpLeftDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gRightUpLeftDownDirections)]; + memcpy(directions, gRightUpLeftDownDirections, sizeof(gRightUpLeftDownDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceUpRightDownLeft, gMovementTypeFuncs_WalkSequenceUpRightDownLeft) + +u8 MovementType_WalkSequenceUpRightDownLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gUpRightDownLeftDirections)]; + memcpy(directions, gUpRightDownLeftDirections, sizeof(gUpRightDownLeftDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceDownLeftUpRight, gMovementTypeFuncs_WalkSequenceDownLeftUpRight) + +u8 MovementType_WalkSequenceDownLeftUpRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gDownLeftUpRightDirections)]; + memcpy(directions, gDownLeftUpRightDirections, sizeof(gDownLeftUpRightDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.y == eventObject->currentCoords.y) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceLeftUpRightDown, gMovementTypeFuncs_WalkSequenceLeftUpRightDown) + +u8 MovementType_WalkSequenceLeftUpRightDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gLeftUpRightDownDirections)]; + memcpy(directions, gLeftUpRightDownDirections, sizeof(gLeftUpRightDownDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_WalkSequenceRightDownLeftUp, gMovementTypeFuncs_WalkSequenceRightDownLeftUp) + +u8 MovementType_WalkSequenceRightDownLeftUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 directions[sizeof(gRightDownLeftUpDirections)]; + memcpy(directions, gRightDownLeftUpDirections, sizeof(gRightDownLeftUpDirections)); + if (eventObject->directionSequenceIndex == 2 && eventObject->initialCoords.x == eventObject->currentCoords.x) + { + eventObject->directionSequenceIndex = 3; + } + return MoveNextDirectionInSequence(eventObject, sprite, directions); +} + +movement_type_def(MovementType_CopyPlayer, gMovementTypeFuncs_CopyPlayer) + +bool8 MovementType_CopyPlayer_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + ClearEventObjectMovement(eventObject, sprite); if (eventObject->directionSequenceIndex == 0) { - eventObject->directionSequenceIndex = player_get_direction_lower_nybble(); + eventObject->directionSequenceIndex = GetPlayerFacingDirection(); } sprite->data[1] = 1; return TRUE; } -bool8 sub_8091EC0(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_CopyPlayer_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - if (gEventObjects[gPlayerAvatar.eventObjectId].movementActionId == 0xFF || gPlayerAvatar.tileTransitionState == 2) + if (gEventObjects[gPlayerAvatar.eventObjectId].movementActionId == 0xFF || gPlayerAvatar.tileTransitionState == T_TILE_CENTER) { return FALSE; } - return gUnknown_0850DA64[player_get_x22()](eventObject, sprite, player_get_direction_upper_nybble(), NULL); + return gCopyPlayerMovementFuncs[PlayerGetCopyableMovement()](eventObject, sprite, GetPlayerMovementDirection(), NULL); } -bool8 sub_8091F20(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_CopyPlayer_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { - eventObject->singleMovementActive = FALSE; + eventObject->singleMovementActive = 0; sprite->data[1] = 1; } return FALSE; } -bool8 sub_8091F48(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCB(u8)) +bool8 CopyablePlayerMovement_None(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { return FALSE; } -bool8 sub_8091F4C(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCB(u8)) +bool8 CopyablePlayerMovement_FaceDirection(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, playerDirection))); - eventObject->singleMovementActive = TRUE; + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, playerDirection))); + eventObject->singleMovementActive = 1; sprite->data[1] = 2; return TRUE; } -bool8 sub_8091F94(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCB(u8)) +bool8 CopyablePlayerMovement_GoSpeed0(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { u32 direction; s16 x; @@ -4174,8 +4377,8 @@ bool8 sub_8091F94(struct EventObject *eventObject, struct Sprite *sprite, u8 pla direction = playerDirection; direction = state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, direction); EventObjectMoveDestCoords(eventObject, direction, &x, &y); - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(direction)); - eventObject->singleMovementActive = TRUE; + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(direction)); + eventObject->singleMovementActive = 1; sprite->data[1] = 2; return TRUE; } @@ -4185,17 +4388,17 @@ bool8 sub_8091F94(struct EventObject *eventObject, struct Sprite *sprite, u8 pla direction = state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, direction); } EventObjectMoveDestCoords(eventObject, direction, &x, &y); - EventObjectSetRegularAnim(eventObject, sprite, GetGoSpeed0AnimId(direction)); - if (npc_block_way(eventObject, x, y, direction) || (tileCB != NULL && !tileCB(MapGridGetMetatileBehaviorAt(x, y)))) + EventObjectSetSingleMovement(eventObject, sprite, GetWalkNormalMovementAction(direction)); + if (GetCollisionAtCoords(eventObject, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(direction)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(direction)); } - eventObject->singleMovementActive = TRUE; + eventObject->singleMovementActive = 1; sprite->data[1] = 2; return TRUE; } -bool8 sub_80920A4(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCB(u8)) +bool8 CopyablePlayerMovement_GoSpeed1(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { u32 direction; s16 x; @@ -4204,17 +4407,17 @@ bool8 sub_80920A4(struct EventObject *eventObject, struct Sprite *sprite, u8 pla direction = playerDirection; direction = state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, direction); EventObjectMoveDestCoords(eventObject, direction, &x, &y); - EventObjectSetRegularAnim(eventObject, sprite, GetGoSpeed1AnimId(direction)); - if (npc_block_way(eventObject, x, y, direction) || (tileCB != NULL && !tileCB(MapGridGetMetatileBehaviorAt(x, y)))) + EventObjectSetSingleMovement(eventObject, sprite, GetWalkFastMovementAction(direction)); + if (GetCollisionAtCoords(eventObject, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(direction)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(direction)); } - eventObject->singleMovementActive = TRUE; + eventObject->singleMovementActive = 1; sprite->data[1] = 2; return TRUE; } -bool8 sub_809215C(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCB(u8)) +bool8 CopyablePlayerMovement_GoSpeed2(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { u32 direction; s16 x; @@ -4223,17 +4426,17 @@ bool8 sub_809215C(struct EventObject *eventObject, struct Sprite *sprite, u8 pla direction = playerDirection; direction = state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, direction); EventObjectMoveDestCoords(eventObject, direction, &x, &y); - EventObjectSetRegularAnim(eventObject, sprite, GetGoSpeed3AnimId(direction)); - if (npc_block_way(eventObject, x, y, direction) || (tileCB != NULL && !tileCB(MapGridGetMetatileBehaviorAt(x, y)))) + EventObjectSetSingleMovement(eventObject, sprite, GetWalkFastestMovementAction(direction)); + if (GetCollisionAtCoords(eventObject, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(direction)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(direction)); } - eventObject->singleMovementActive = TRUE; + eventObject->singleMovementActive = 1; sprite->data[1] = 2; return TRUE; } -bool8 sub_8092214(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCB(u8)) +bool8 CopyablePlayerMovement_Slide(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { u32 direction; s16 x; @@ -4242,29 +4445,29 @@ bool8 sub_8092214(struct EventObject *eventObject, struct Sprite *sprite, u8 pla direction = playerDirection; direction = state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, direction); EventObjectMoveDestCoords(eventObject, direction, &x, &y); - EventObjectSetRegularAnim(eventObject, sprite, sub_8093438(direction)); - if (npc_block_way(eventObject, x, y, direction) || (tileCB != NULL && !tileCB(MapGridGetMetatileBehaviorAt(x, y)))) + EventObjectSetSingleMovement(eventObject, sprite, GetSlideMovementAction(direction)); + if (GetCollisionAtCoords(eventObject, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(direction)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(direction)); } - eventObject->singleMovementActive = TRUE; + eventObject->singleMovementActive = 1; sprite->data[1] = 2; return TRUE; } -bool8 cph_IM_DIFFERENT(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCB(u8)) +bool8 cph_IM_DIFFERENT(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { u32 direction; direction = playerDirection; direction = state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, direction); - EventObjectSetRegularAnim(eventObject, sprite, sub_80934BC(direction)); - eventObject->singleMovementActive = TRUE; + EventObjectSetSingleMovement(eventObject, sprite, GetJumpInPlaceMovementAction(direction)); + eventObject->singleMovementActive = 1; sprite->data[1] = 2; return TRUE; } -bool8 sub_8092314(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCB(u8)) +bool8 CopyablePlayerMovement_GoSpeed4(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { u32 direction; s16 x; @@ -4273,17 +4476,17 @@ bool8 sub_8092314(struct EventObject *eventObject, struct Sprite *sprite, u8 pla direction = playerDirection; direction = state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, direction); EventObjectMoveDestCoords(eventObject, direction, &x, &y); - EventObjectSetRegularAnim(eventObject, sprite, sub_8093514(direction)); - if (npc_block_way(eventObject, x, y, direction) || (tileCB != NULL && !tileCB(MapGridGetMetatileBehaviorAt(x, y)))) + EventObjectSetSingleMovement(eventObject, sprite, GetJumpMovementAction(direction)); + if (GetCollisionAtCoords(eventObject, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(direction)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(direction)); } - eventObject->singleMovementActive = TRUE; + eventObject->singleMovementActive = 1; sprite->data[1] = 2; return TRUE; } -bool8 oac_hopping(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCB(u8)) +bool8 CopyablePlayerMovement_Jump(struct EventObject *eventObject, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { u32 direction; s16 x; @@ -4293,31 +4496,29 @@ bool8 oac_hopping(struct EventObject *eventObject, struct Sprite *sprite, u8 pla direction = state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, direction); x = eventObject->currentCoords.x; y = eventObject->currentCoords.y; - sub_8092F88(direction, &x, &y, 2, 2); - EventObjectSetRegularAnim(eventObject, sprite, GetJumpLedgeAnimId(direction)); - if (npc_block_way(eventObject, x, y, direction) || (tileCB != NULL && !tileCB(MapGridGetMetatileBehaviorAt(x, y)))) + MoveCoordsInDirection(direction, &x, &y, 2, 2); + EventObjectSetSingleMovement(eventObject, sprite, GetJump2MovementAction(direction)); + if (GetCollisionAtCoords(eventObject, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) { - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(direction)); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(direction)); } - eventObject->singleMovementActive = TRUE; + eventObject->singleMovementActive = 1; sprite->data[1] = 2; return TRUE; } -field_object_step(CopyPlayer2, gUnknown_0850DA90) +movement_type_def(MovementType_CopyPlayerInGrass, gMovementTypeFuncs_CopyPlayerInGrass) -bool8 mss_08062EA4(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_CopyPlayerInGrass_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - if (gEventObjects[gPlayerAvatar.eventObjectId].movementActionId == 0xFF || gPlayerAvatar.tileTransitionState == 2) + if (gEventObjects[gPlayerAvatar.eventObjectId].movementActionId == 0xFF || gPlayerAvatar.tileTransitionState == T_TILE_CENTER) { return FALSE; } - return gUnknown_0850DA64[player_get_x22()](eventObject, sprite, player_get_direction_upper_nybble(), MetatileBehavior_IsPokeGrass); + return gCopyPlayerMovementFuncs[PlayerGetCopyableMovement()](eventObject, sprite, GetPlayerMovementDirection(), MetatileBehavior_IsPokeGrass); } -bool8 sub_80925AC(struct EventObject *, struct Sprite *); - -void EventObjectCB_TreeDisguise(struct Sprite *sprite) +void MovementType_TreeDisguise(struct Sprite *sprite) { struct EventObject *eventObject; @@ -4327,18 +4528,18 @@ void EventObjectCB_TreeDisguise(struct Sprite *sprite) EventObjectGetLocalIdAndMap(eventObject, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); eventObject->fieldEffectSpriteId = FieldEffectStart(FLDEFF_TREE_DISGUISE); eventObject->directionSequenceIndex = 1; - sprite->data[7] ++; + sprite->data[7]++; } - EventObjectStep(&gEventObjects[sprite->data[0]], sprite, sub_80925AC); + UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, MovementType_Disguise_Callback); } -bool8 sub_80925AC(struct EventObject *eventObject, struct Sprite *sprite) +static bool8 MovementType_Disguise_Callback(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); return FALSE; } -void EventObjectCB_MountainDisguise(struct Sprite *sprite) +void MovementType_MountainDisguise(struct Sprite *sprite) { struct EventObject *eventObject; @@ -4348,98 +4549,96 @@ void EventObjectCB_MountainDisguise(struct Sprite *sprite) EventObjectGetLocalIdAndMap(eventObject, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); eventObject->fieldEffectSpriteId = FieldEffectStart(FLDEFF_MOUNTAIN_DISGUISE); eventObject->directionSequenceIndex = 1; - sprite->data[7] ++; + sprite->data[7]++; } - EventObjectStep(&gEventObjects[sprite->data[0]], sprite, sub_80925AC); + UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, MovementType_Disguise_Callback); } -extern bool8 (*const gUnknown_0850DA9C[])(struct EventObject *, struct Sprite *); -bool8 sub_809268C(struct EventObject *, struct Sprite *); - -void EventObjectCB_Hidden1(struct Sprite *sprite) +void MovementType_Hidden(struct Sprite *sprite) { if (!sprite->data[7]) { gEventObjects[sprite->data[0]].fixedPriority = TRUE; sprite->subspriteMode = 2; sprite->oam.priority = 3; - sprite->data[7] ++; + sprite->data[7]++; } - EventObjectStep(&gEventObjects[sprite->data[0]], sprite, sub_809268C); + UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, MovementType_Hidden_Callback); } -bool8 sub_809268C(struct EventObject *eventObject, struct Sprite *sprite) +static bool8 MovementType_Hidden_Callback(struct EventObject *eventObject, struct Sprite *sprite) { - return gUnknown_0850DA9C[sprite->data[1]](eventObject, sprite); + return gMovementTypeFuncs_Hidden[sprite->data[1]](eventObject, sprite); } -bool8 sub_80926AC (struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_Hidden_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); + ClearEventObjectMovement(eventObject, sprite); return FALSE; } -bool8 sub_80926B8 (struct EventObject *eventObject, struct Sprite *sprite) + +bool8 MovementType_MoveInPlace_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { sprite->data[1] = 0; } return FALSE; } -field_object_step(WalkInPlace1, gUnknown_0850DAA0) +movement_type_def(MovementType_WalkInPlace, gMovementTypeFuncs_WalkInPlace) -bool8 sub_8092718(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WalkInPlace_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); - EventObjectSetRegularAnim(eventObject, sprite, GetStepInPlaceDelay16AnimId(eventObject->facingDirection)); + ClearEventObjectMovement(eventObject, sprite); + EventObjectSetSingleMovement(eventObject, sprite, GetWalkInPlaceNormalMovementAction(eventObject->facingDirection)); sprite->data[1] = 1; return TRUE; } -field_object_step(WalkInPlace4, gUnknown_0850DAA8) +movement_type_def(MovementType_WalkSlowlyInPlace, gMovementTypeFuncs_WalkSlowlyInPlace) -bool8 sub_8092788(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_WalkSlowlyInPlace_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); - EventObjectSetRegularAnim(eventObject, sprite, GetStepInPlaceDelay32AnimId(eventObject->facingDirection)); + ClearEventObjectMovement(eventObject, sprite); + EventObjectSetSingleMovement(eventObject, sprite, GetWalkInPlaceSlowMovementAction(eventObject->facingDirection)); sprite->data[1] = 1; return TRUE; } -field_object_step(WalkInPlace2, gUnknown_0850DAB0) +movement_type_def(MovementType_JogInPlace, gMovementTypeFuncs_JogInPlace) -bool8 sub_80927F8(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_JogInPlace_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); - EventObjectSetRegularAnim(eventObject, sprite, GetStepInPlaceDelay8AnimId(eventObject->facingDirection)); + ClearEventObjectMovement(eventObject, sprite); + EventObjectSetSingleMovement(eventObject, sprite, GetWalkInPlaceFastMovementAction(eventObject->facingDirection)); sprite->data[1] = 1; return TRUE; } -field_object_step(WalkInPlace3, gUnknown_0850DAB8) +movement_type_def(MovementType_RunInPlace, gMovementTypeFuncs_RunInPlace) -bool8 sub_8092868(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_RunInPlace_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); - EventObjectSetRegularAnim(eventObject, sprite, GetStepInPlaceDelay4AnimId(eventObject->facingDirection)); + ClearEventObjectMovement(eventObject, sprite); + EventObjectSetSingleMovement(eventObject, sprite, GetWalkInPlaceFastestMovementAction(eventObject->facingDirection)); sprite->data[1] = 1; return TRUE; } -field_object_step(Hidden2, gUnknown_0850DAC0) +movement_type_def(MovementType_Invisible, gMovementTypeFuncs_Invisible) -bool8 sub_80928D8(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_Invisible_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_reset(eventObject, sprite); - EventObjectSetRegularAnim(eventObject, sprite, GetFaceDirectionAnimId(eventObject->facingDirection)); + ClearEventObjectMovement(eventObject, sprite); + EventObjectSetSingleMovement(eventObject, sprite, GetFaceDirectionMovementAction(eventObject->facingDirection)); eventObject->invisible = TRUE; sprite->data[1] = 1; return TRUE; } -bool8 sub_809290C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_Invisible_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectExecRegularAnim(eventObject, sprite)) + if (EventObjectExecSingleMovementAction(eventObject, sprite)) { sprite->data[1] = 2; return TRUE; @@ -4447,48 +4646,101 @@ bool8 sub_809290C(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_809292C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementType_Invisible_Step2(struct EventObject *eventObject, struct Sprite *sprite) { - eventObject->singleMovementActive = FALSE; + eventObject->singleMovementActive = 0; return FALSE; } -static void npc_reset(struct EventObject *eventObject, struct Sprite *sprite) +static void ClearEventObjectMovement(struct EventObject *eventObject, struct Sprite *sprite) { - eventObject->singleMovementActive = FALSE; + eventObject->singleMovementActive = 0; eventObject->heldMovementActive = FALSE; eventObject->heldMovementFinished = FALSE; eventObject->movementActionId = 0xFF; sprite->data[1] = 0; } -#define dirn2anim(name, table)\ -u8 name(u8 direction)\ -{\ - return table[direction];\ +u8 GetFaceDirectionAnimNum(u8 direction) +{ + return gFaceDirectionAnimNums[direction]; } -dirn2anim(EventObjectDirectionToImageAnimId, gUnknown_0850DACC) -dirn2anim(get_go_image_anim_num, gUnknown_0850DAD5) -dirn2anim(get_go_fast_image_anim_num, gUnknown_0850DADE) -dirn2anim(get_go_faster_image_anim_num, gUnknown_0850DAE7) -dirn2anim(get_go_fastest_image_anim_num, gUnknown_0850DAF0) -dirn2anim(sub_80929AC, gUnknown_0850DAF9) -dirn2anim(sub_80929BC, gUnknown_0850DB02) -dirn2anim(sub_80929CC, gUnknown_0850DB0B) -dirn2anim(sub_80929DC, gUnknown_0850DB14) -dirn2anim(sub_80929EC, gUnknown_0850DB1D) -dirn2anim(sub_80929FC, gUnknown_0850DB26) -dirn2anim(sub_8092A0C, gUnknown_0850DB2F) -dirn2anim(sub_8092A1C, gUnknown_0850DB38) -dirn2anim(sub_8092A2C, gUnknown_0850DB41) -dirn2anim(get_run_image_anim_num, gUnknown_0850DB4A) +u8 GetMoveDirectionAnimNum(u8 direction) +{ + return gMoveDirectionAnimNums[direction]; +} + +u8 GetMoveDirectionFastAnimNum(u8 direction) +{ + return gMoveDirectionFastAnimNums[direction]; +} + +u8 GetMoveDirectionFasterAnimNum(u8 direction) +{ + return gMoveDirectionFasterAnimNums[direction]; +} + +u8 GetMoveDirectionFastestAnimNum(u8 direction) +{ + return gMoveDirectionFastestAnimNums[direction]; +} + +u8 GetJumpSpecialDirectionAnimNum(u8 direction) +{ + return gJumpSpecialDirectionAnimNums[direction]; +} + +u8 GetAcroWheelieDirectionAnimNum(u8 direction) +{ + return gAcroWheelieDirectionAnimNums[direction]; +} + +u8 Unref_GetAnimNums_08375633(u8 direction) +{ + return gUnrefAnimNums_08375633[direction]; +} + +u8 GetAcroEndWheelieDirectionAnimNum(u8 direction) +{ + return gAcroEndWheelieDirectionAnimNums[direction]; +} + +u8 GetAcroUnusedActionDirectionAnimNum(u8 direction) +{ + return gAcroUnusedActionDirectionAnimNums[direction]; +} + +u8 GetAcroWheeliePedalDirectionAnimNum(u8 direction) +{ + return gAcroWheeliePedalDirectionAnimNums[direction]; +} + +u8 GetFishingDirectionAnimNum(u8 direction) +{ + return gFishingDirectionAnimNums[direction]; +} + +u8 GetFishingNoCatchDirectionAnimNum(u8 direction) +{ + return gFishingNoCatchDirectionAnimNums[direction]; +} + +u8 GetFishingBiteDirectionAnimNum(u8 direction) +{ + return gFishingBiteDirectionAnimNums[direction]; +} + +u8 GetRunningDirectionAnimNum(u8 direction) +{ + return gRunningDirectionAnimNums[direction]; +} static const struct UnkStruct_085094AC *sub_8092A4C(const union AnimCmd *const *anims) { const struct UnkStruct_085094AC *retval; - for (retval = gUnknown_085094AC; retval->anims != NULL; retval ++) + for (retval = gUnknown_085094AC; retval->anims != NULL; retval++) { if (retval->anims == anims) { @@ -4545,7 +4797,7 @@ void obj_npc_animation_step(struct EventObject *eventObject, struct Sprite *spri // file boundary? -u8 sub_8092AF8(s16 x1, s16 y1, s16 x2, s16 y2) +u8 GetDirectionToFace(s16 x1, s16 y1, s16 x2, s16 y2) { if (x1 > x2) { @@ -4562,81 +4814,64 @@ u8 sub_8092AF8(s16 x1, s16 y1, s16 x2, s16 y2) return DIR_SOUTH; } -void npc_set_running_behaviour_etc(struct EventObject *eventObject, u8 movementType) +void SetTrainerMovementType(struct EventObject *eventObject, u8 movementType) { eventObject->movementType = movementType; eventObject->directionSequenceIndex = 0; eventObject->playerCopyableMovement = 0; - gSprites[eventObject->spriteId].callback = gUnknown_08505438[movementType]; + gSprites[eventObject->spriteId].callback = sMovementTypeCallbacks[movementType]; gSprites[eventObject->spriteId].data[1] = 0; } -dirn2anim(npc_running_behaviour_by_direction, gUnknown_0850DB53) +u8 GetTrainerFacingDirectionMovementType(u8 direction) +{ + return gTrainerFacingDirectionMovementTypes[direction]; +} -u8 npc_block_way__next_tile(struct EventObject *eventObject, u8 direction) +static u8 GetCollisionInDirection(struct EventObject *eventObject, u8 direction) { s16 x; s16 y; - x = eventObject->currentCoords.x; y = eventObject->currentCoords.y; MoveCoords(direction, &x, &y); - return npc_block_way(eventObject, x, y, direction); + return GetCollisionAtCoords(eventObject, x, y, direction); } -u8 npc_block_way(struct EventObject *eventObject, s16 x, s16 y, u32 dirn) +u8 GetCollisionAtCoords(struct EventObject *eventObject, s16 x, s16 y, u32 dirn) { u8 direction; direction = dirn; - if (IsCoordOutsideEventObjectMovementRect(eventObject, x, y)) - { + if (IsCoordOutsideEventObjectMovementRange(eventObject, x, y)) return 1; - } - if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(eventObject, x, y, direction)) - { + else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(eventObject, x, y, direction)) return 2; - } - if (eventObject->trackedByCamera && !CanCameraMoveInDirection(direction)) - { + else if (eventObject->trackedByCamera && !CanCameraMoveInDirection(direction)) return 2; - } - if (IsZCoordMismatchAt(eventObject->currentElevation, x, y)) - { + else if (IsZCoordMismatchAt(eventObject->currentElevation, x, y)) return 3; - } - if (CheckForCollisionBetweenEventObjects(eventObject, x, y)) - { + else if (DoesObjectCollideWithObjectAt(eventObject, x, y)) return 4; - } return 0; } -u8 sub_8092C8C(struct EventObject *eventObject, s16 x, s16 y, u8 direction) +u8 GetCollisionFlagsAtCoords(struct EventObject *eventObject, s16 x, s16 y, u8 direction) { - u8 retval; + u8 flags = 0; - retval = 0x00; - if (IsCoordOutsideEventObjectMovementRect(eventObject, x, y)) - { - retval |= 1; - } + if (IsCoordOutsideEventObjectMovementRange(eventObject, x, y)) + flags |= 1; if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(eventObject, x, y, direction) || (eventObject->trackedByCamera && !CanCameraMoveInDirection(direction))) - { - retval |= 2; - } + flags |= 2; if (IsZCoordMismatchAt(eventObject->currentElevation, x, y)) - { - retval |= 4; - } - if (CheckForCollisionBetweenEventObjects(eventObject, x, y)) - { - retval |= 8; - } - return retval; + flags |= 4; + if (DoesObjectCollideWithObjectAt(eventObject, x, y)) + flags |= 8; + return flags; } -static bool8 IsCoordOutsideEventObjectMovementRect(struct EventObject *eventObject, s16 x, s16 y) +static bool8 IsCoordOutsideEventObjectMovementRange(struct EventObject *eventObject, s16 x, s16 y) { s16 left; s16 right; @@ -4666,19 +4901,20 @@ static bool8 IsCoordOutsideEventObjectMovementRect(struct EventObject *eventObje static bool8 IsMetatileDirectionallyImpassable(struct EventObject *eventObject, s16 x, s16 y, u8 direction) { - if (gOppositeDirectionBlockedMetatileFuncs[direction - 1](eventObject->currentMetatileBehavior) || gDirectionBlockedMetatileFuncs[direction - 1](MapGridGetMetatileBehaviorAt(x, y))) + if (gOppositeDirectionBlockedMetatileFuncs[direction - 1](eventObject->currentMetatileBehavior) + || gDirectionBlockedMetatileFuncs[direction - 1](MapGridGetMetatileBehaviorAt(x, y))) { return TRUE; } return FALSE; } -static bool8 CheckForCollisionBetweenEventObjects(struct EventObject *eventObject, s16 x, s16 y) +static bool8 DoesObjectCollideWithObjectAt(struct EventObject *eventObject, s16 x, s16 y) { u8 i; struct EventObject *curObject; - for (i = 0; i < NUM_EVENT_OBJECTS; i ++) + for (i = 0; i < NUM_EVENT_OBJECTS; i++) { curObject = &gEventObjects[i]; if (curObject->active && curObject != eventObject) @@ -4695,14 +4931,16 @@ static bool8 CheckForCollisionBetweenEventObjects(struct EventObject *eventObjec return FALSE; } -bool8 sub_8092E9C(u8 localId, u8 mapNum, u8 mapGroup) +bool8 IsBerryTreeSparkling(u8 localId, u8 mapNum, u8 mapGroup) { u8 eventObjectId; - if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjectId) && gSprites[gEventObjects[eventObjectId].spriteId].data[7] & 0x02) + if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjectId) + && gSprites[gEventObjects[eventObjectId].spriteId].data[7] & 2) { return TRUE; } + return FALSE; } @@ -4728,35 +4966,19 @@ void sub_8092F60(u8 direction, s16 *x, s16 *y) *y += gDirectionToVectors[direction].y << 4; } -void sub_8092F88(u32 dirn, s16 *x, s16 *y, s16 dx, s16 dy) +static void MoveCoordsInDirection(u32 dir, s16 *x, s16 *y, s16 deltaX, s16 deltaY) { - u8 direction; - s16 dx_2; - s16 dy_2; - s16 cur_x; - s16 cur_y; - - direction = dirn; - dx_2 = dx; - dy_2 = dy; - cur_x = gDirectionToVectors[direction].x; - if (cur_x > 0) - { - *x += dx_2; - } - if (cur_x < 0) - { - *x -= dx_2; - } - cur_y = gDirectionToVectors[direction].y; - if (cur_y > 0) - { - *y += dy_2; - } - if (cur_y < 0) - { - *y -= dy_2; - } + u8 direction = dir; + s16 dx2 = (u16)deltaX; + s16 dy2 = (u16)deltaY; + if (gDirectionToVectors[direction].x > 0) + *x += dx2; + if (gDirectionToVectors[direction].x < 0) + *x -= dx2; + if (gDirectionToVectors[direction].y > 0) + *y += dy2; + if (gDirectionToVectors[direction].y < 0) + *y -= dy2; } void sub_8092FF0(s16 x, s16 y, s16 *dest_x, s16 *dest_y) @@ -4807,7 +5029,7 @@ static void GetEventObjectMovingCameraOffset(s16 *x, s16 *y) *y = 0; if (gUnknown_03005DD0.x > 0) { - (*x) ++; + (*x)++; } if (gUnknown_03005DD0.x < 0) { @@ -4815,7 +5037,7 @@ static void GetEventObjectMovingCameraOffset(s16 *x, s16 *y) } if (gUnknown_03005DD0.y > 0) { - (*y) ++; + (*y)++; } if (gUnknown_03005DD0.y < 0) { @@ -4823,65 +5045,56 @@ static void GetEventObjectMovingCameraOffset(s16 *x, s16 *y) } } -void EventObjectMoveDestCoords(struct EventObject *eventObject, u32 dirn, s16 *x, s16 *y) +void EventObjectMoveDestCoords(struct EventObject *eventObject, u32 direction, s16 *x, s16 *y) { - u8 direction; - - direction = dirn; + u8 newDirn = direction; *x = eventObject->currentCoords.x; *y = eventObject->currentCoords.y; - MoveCoords(direction, x, y); + MoveCoords(newDirn, x, y); } -// file boundary? - -bool8 EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(struct EventObject *eventObject) +bool8 EventObjectIsMovementOverridden(struct EventObject *eventObject) { if (eventObject->singleMovementActive || eventObject->heldMovementActive) - { return TRUE; - } + return FALSE; } -bool8 EventObjectIsSpecialAnimActive(struct EventObject *eventObject) +bool8 EventObjectIsHeldMovementActive(struct EventObject *eventObject) { if (eventObject->heldMovementActive && eventObject->movementActionId != 0xFF) - { return TRUE; - } + return FALSE; } -bool8 EventObjectSetSpecialAnim(struct EventObject *eventObject, u8 specialAnimId) +bool8 EventObjectSetHeldMovement(struct EventObject *eventObject, u8 movementActionId) { - if (EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(eventObject)) - { + if (EventObjectIsMovementOverridden(eventObject)) return TRUE; - } - npc_sync_anim_pause_bits(eventObject); - eventObject->movementActionId = specialAnimId; + + UnfreezeEventObject(eventObject); + eventObject->movementActionId = movementActionId; eventObject->heldMovementActive = TRUE; eventObject->heldMovementFinished = FALSE; gSprites[eventObject->spriteId].data[2] = 0; return FALSE; } -void EventObjectForceSetSpecialAnim(struct EventObject *eventObject, u8 specialAnimId) +void EventObjectForceSetHeldMovement(struct EventObject *eventObject, u8 movementActionId) { - EventObjectClearAnimIfSpecialAnimActive(eventObject); - EventObjectSetSpecialAnim(eventObject, specialAnimId); + EventObjectClearHeldMovementIfActive(eventObject); + EventObjectSetHeldMovement(eventObject, movementActionId); } -void EventObjectClearAnimIfSpecialAnimActive(struct EventObject *eventObject) +void EventObjectClearHeldMovementIfActive(struct EventObject *eventObject) { if (eventObject->heldMovementActive) - { - EventObjectClearAnim(eventObject); - } + EventObjectClearHeldMovement(eventObject); } -void EventObjectClearAnim(struct EventObject *eventObject) +void EventObjectClearHeldMovement(struct EventObject *eventObject) { eventObject->movementActionId = 0xFF; eventObject->heldMovementActive = FALSE; @@ -4890,43 +5103,38 @@ void EventObjectClearAnim(struct EventObject *eventObject) gSprites[eventObject->spriteId].data[2] = 0; } -u8 EventObjectCheckIfSpecialAnimFinishedOrInactive(struct EventObject *eventObject) +u8 EventObjectCheckHeldMovementStatus(struct EventObject *eventObject) { if (eventObject->heldMovementActive) - { return eventObject->heldMovementFinished; - } - return 0x10; + + return 16; } -u8 EventObjectClearAnimIfSpecialAnimFinished(struct EventObject *eventObject) +u8 EventObjectClearHeldMovementIfFinished(struct EventObject *eventObject) { - u8 specialAnimState; + u8 heldMovementStatus = EventObjectCheckHeldMovementStatus(eventObject); + if (heldMovementStatus != 0 && heldMovementStatus != 16) + EventObjectClearHeldMovementIfActive(eventObject); - specialAnimState = EventObjectCheckIfSpecialAnimFinishedOrInactive(eventObject); - if (specialAnimState != 0 && specialAnimState != 16) - { - EventObjectClearAnimIfSpecialAnimActive(eventObject); - } - return specialAnimState; + return heldMovementStatus; } -u8 EventObjectGetSpecialAnim(struct EventObject *eventObject) +u8 EventObjectGetHeldMovementActionId(struct EventObject *eventObject) { if (eventObject->heldMovementActive) - { return eventObject->movementActionId; - } + return 0xFF; } -void EventObjectStep(struct EventObject *eventObject, struct Sprite *sprite, bool8 (*callback)(struct EventObject *, struct Sprite *)) +void UpdateEventObjectCurrentMovement(struct EventObject *eventObject, struct Sprite *sprite, bool8 (*callback)(struct EventObject *, struct Sprite *)) { DoGroundEffects_OnSpawn(eventObject, sprite); - sub_80964E8(eventObject, sprite); - if (EventObjectIsSpecialAnimActive(eventObject)) + TryEnableEventObjectAnim(eventObject, sprite); + if (EventObjectIsHeldMovementActive(eventObject)) { - EventObjectExecSpecialAnim(eventObject, sprite); + EventObjectExecHeldMovementAction(eventObject, sprite); } else if (!eventObject->frozen) { @@ -4934,58 +5142,55 @@ void EventObjectStep(struct EventObject *eventObject, struct Sprite *sprite, boo } DoGroundEffects_OnBeginStep(eventObject, sprite); DoGroundEffects_OnFinishStep(eventObject, sprite); - npc_obj_transfer_image_anim_pause_flag(eventObject, sprite); - sub_8096518(eventObject, sprite); + UpdateEventObjectSpriteAnimPause(eventObject, sprite); + UpdateEventObjectVisibility(eventObject, sprite); EventObjectUpdateSubpriority(eventObject, sprite); } -#define dirn2anim_2(name, table) \ -u8 name(u32 direction) \ -{ \ - u8 dirn2; \ - u8 animIds[5]; \ - dirn2 = direction; \ - memcpy(animIds, table, 5); \ - if (dirn2 > DIR_EAST) \ - { \ - dirn2 = 0; \ - } \ - return animIds[dirn2]; \ +#define dirn_to_anim(name, table)\ +u8 name(u32 idx)\ +{\ + u8 direction;\ + u8 animIds[sizeof(table)];\ + direction = idx;\ + memcpy(animIds, (table), sizeof(table));\ + if (direction > DIR_EAST) direction = 0;\ + return animIds[direction];\ } -dirn2anim_2(GetFaceDirectionAnimId, gUnknown_0850DBA0); -dirn2anim_2(GetSimpleGoAnimId, gUnknown_0850DBA5); -dirn2anim_2(GetGoSpeed0AnimId, gUnknown_0850DBAA); -dirn2anim_2(GetGoSpeed1AnimId, gUnknown_0850DBAF); -dirn2anim_2(GetGoSpeed2AnimId, gUnknown_0850DBB4); -dirn2anim_2(GetGoSpeed3AnimId, gUnknown_0850DBB9); -dirn2anim_2(sub_8093438, gUnknown_0850DBBE); -dirn2anim_2(GetRunAnimId, gUnknown_0850DBC3); -dirn2anim_2(GetJumpLedgeAnimId, gUnknown_0850DBC8); -dirn2anim_2(sub_80934BC, gUnknown_0850DBCD); -dirn2anim_2(sub_80934E8, gUnknown_0850DBD2); -dirn2anim_2(sub_8093514, gUnknown_0850DBD7); -dirn2anim_2(sub_8093540, gUnknown_0850DBDC); -dirn2anim_2(GetStepInPlaceDelay32AnimId, gUnknown_0850DBE1); -dirn2anim_2(GetStepInPlaceDelay16AnimId, gUnknown_0850DBE6); -dirn2anim_2(GetStepInPlaceDelay8AnimId, gUnknown_0850DBEB); -dirn2anim_2(GetStepInPlaceDelay4AnimId, gUnknown_0850DBF0); +dirn_to_anim(GetFaceDirectionMovementAction, gFaceDirectionMovementActions); +dirn_to_anim(GetWalkSlowMovementAction, gWalkSlowMovementActions); +dirn_to_anim(GetWalkNormalMovementAction, gWalkNormalMovementActions); +dirn_to_anim(GetWalkFastMovementAction, gWalkFastMovementActions); +dirn_to_anim(GetRideWaterCurrentMovementAction, gRideWaterCurrentMovementActions); +dirn_to_anim(GetWalkFastestMovementAction, gWalkFastestMovementActions); +dirn_to_anim(GetSlideMovementAction, gSlideMovementActions); +dirn_to_anim(GetPlayerRunMovementAction, gPlayerRunMovementActions); +dirn_to_anim(GetJump2MovementAction, gJump2MovementActions); +dirn_to_anim(GetJumpInPlaceMovementAction, gJumpInPlaceMovementActions); +dirn_to_anim(GetJumpInPlaceTurnAroundMovementAction, gJumpInPlaceTurnAroundMovementActions); +dirn_to_anim(GetJumpMovementAction, gJumpMovementActions); +dirn_to_anim(GetJumpSpecialMovementAction, gJumpSpecialMovementActions); +dirn_to_anim(GetWalkInPlaceSlowMovementAction, gWalkInPlaceSlowMovementActions); +dirn_to_anim(GetWalkInPlaceNormalMovementAction, gWalkInPlaceNormalMovementActions); +dirn_to_anim(GetWalkInPlaceFastMovementAction, gWalkInPlaceFastMovementActions); +dirn_to_anim(GetWalkInPlaceFastestMovementAction, gWalkInPlaceFastestMovementActions); bool8 EventObjectFaceOppositeDirection(struct EventObject *eventObject, u8 direction) { - return EventObjectSetSpecialAnim(eventObject, GetFaceDirectionAnimId(GetOppositeDirection(direction))); + return EventObjectSetHeldMovement(eventObject, GetFaceDirectionMovementAction(GetOppositeDirection(direction))); } -dirn2anim_2(sub_8093648, gUnknown_0850DBF5); -dirn2anim_2(sub_8093674, gUnknown_0850DBFA); -dirn2anim_2(sub_80936A0, gUnknown_0850DBFF); -dirn2anim_2(sub_80936CC, gUnknown_0850DC04); -dirn2anim_2(sub_80936F8, gUnknown_0850DC09); -dirn2anim_2(sub_8093724, gUnknown_0850DC0E); -dirn2anim_2(sub_8093750, gUnknown_0850DC13); -dirn2anim_2(sub_809377C, gUnknown_0850DC18); -dirn2anim_2(sub_80937A8, gUnknown_0850DC1D); -dirn2anim_2(d2s_08064034, gUnknown_0850DC22); +dirn_to_anim(GetAcroWheelieFaceDirectionMovementAction, gAcroWheelieFaceDirectionMovementActions); +dirn_to_anim(GetAcroPopWheelieFaceDirectionMovementAction, gAcroPopWheelieFaceDirectionMovementActions); +dirn_to_anim(GetAcroEndWheelieFaceDirectionMovementAction, gAcroEndWheelieFaceDirectionMovementActions); +dirn_to_anim(GetAcroWheelieHopFaceDirectionMovementAction, gAcroWheelieHopFaceDirectionMovementActions); +dirn_to_anim(GetAcroWheelieHopDirectionMovementAction, gAcroWheelieHopDirectionMovementActions); +dirn_to_anim(GetAcroWheelieJumpDirectionMovementAction, gAcroWheelieJumpDirectionMovementActions); +dirn_to_anim(GetAcroWheelieInPlaceDirectionMovementAction, gAcroWheelieInPlaceDirectionMovementActions); +dirn_to_anim(GetAcroPopWheelieMoveDirectionMovementAction, gAcroPopWheelieMoveDirectionMovementActions); +dirn_to_anim(GetAcroWheelieMoveDirectionMovementAction, gAcroWheelieMoveDirectionMovementActions); +dirn_to_anim(GetAcroEndWheelieMoveDirectionMovementAction, gAcroEndWheelieMoveDirectionMovementActions); u8 GetOppositeDirection(u8 direction) { @@ -5020,17 +5225,17 @@ static u32 state_to_direction(u8 a0, u32 a1, u32 a2) return gUnknown_0850DC3F[a0 - 1][zffuOffset - 1]; } -static void EventObjectExecSpecialAnim(struct EventObject *eventObject, struct Sprite *sprite) +static void EventObjectExecHeldMovementAction(struct EventObject *eventObject, struct Sprite *sprite) { - if (gUnknown_0850DC50[eventObject->movementActionId][sprite->data[2]](eventObject, sprite)) + if (gMovementActionFuncs[eventObject->movementActionId][sprite->data[2]](eventObject, sprite)) { eventObject->heldMovementFinished = TRUE; } } -bool8 EventObjectExecRegularAnim(struct EventObject *eventObject, struct Sprite *sprite) +static bool8 EventObjectExecSingleMovementAction(struct EventObject *eventObject, struct Sprite *sprite) { - if (gUnknown_0850DC50[eventObject->movementActionId][sprite->data[2]](eventObject, sprite)) + if (gMovementActionFuncs[eventObject->movementActionId][sprite->data[2]](eventObject, sprite)) { eventObject->movementActionId = 0xFF; sprite->data[2] = 0; @@ -5039,44 +5244,42 @@ bool8 EventObjectExecRegularAnim(struct EventObject *eventObject, struct Sprite return FALSE; } -static void EventObjectSetRegularAnim(struct EventObject *eventObject, struct Sprite *sprite, u8 animId) +static void EventObjectSetSingleMovement(struct EventObject *eventObject, struct Sprite *sprite, u8 animId) { eventObject->movementActionId = animId; sprite->data[2] = 0; } -// file boundary? - -void an_look_any(struct EventObject *eventObject, struct Sprite *sprite, u8 direction) +static void FaceDirection(struct EventObject *eventObject, struct Sprite *sprite, u8 direction) { - EventObjectSetDirection(eventObject, direction); - npc_coords_shift_still(eventObject); - obj_npc_animation_step(eventObject, sprite, get_go_image_anim_num(eventObject->facingDirection)); + SetEventObjectDirection(eventObject, direction); + ShiftStillEventObjectCoords(eventObject); + obj_npc_animation_step(eventObject, sprite, GetMoveDirectionAnimNum(eventObject->facingDirection)); sprite->animPaused = TRUE; sprite->data[2] = 1; } -bool8 sub_8093950(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_FaceDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - an_look_any(eventObject, sprite, DIR_SOUTH); + FaceDirection(eventObject, sprite, DIR_SOUTH); return TRUE; } -bool8 sub_8093960(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_FaceUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - an_look_any(eventObject, sprite, DIR_NORTH); + FaceDirection(eventObject, sprite, DIR_NORTH); return TRUE; } -bool8 sub_8093970(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_FaceLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - an_look_any(eventObject, sprite, DIR_WEST); + FaceDirection(eventObject, sprite, DIR_WEST); return TRUE; } -bool8 sub_8093980(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_FaceRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - an_look_any(eventObject, sprite, DIR_EAST); + FaceDirection(eventObject, sprite, DIR_EAST); return TRUE; } @@ -5087,12 +5290,12 @@ void npc_apply_direction(struct EventObject *eventObject, struct Sprite *sprite, x = eventObject->currentCoords.x; y = eventObject->currentCoords.y; - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); MoveCoords(direction, &x, &y); - npc_coords_shift(eventObject, x, y); + ShiftEventObjectCoords(eventObject, x, y); oamt_npc_ministep_reset(sprite, direction, speed); sprite->animPaused = FALSE; - if (gUnknown_020375B8 != NULL && sub_8097F78(eventObject) != 0x10) + if (gLockedAnimEventObjects != NULL && FindLockedEventObjectIndex(eventObject) != NUM_EVENT_OBJECTS) { sprite->animPaused = TRUE; } @@ -5109,17 +5312,17 @@ void do_go_anim(struct EventObject *eventObject, struct Sprite *sprite, u8 direc npc_apply_anim_looping(eventObject, sprite, functions[speed](eventObject->facingDirection)); } -void do_run_anim(struct EventObject *eventObject, struct Sprite *sprite, u8 direction) +void StartRunningAnim(struct EventObject *eventObject, struct Sprite *sprite, u8 direction) { npc_apply_direction(eventObject, sprite, direction, 1); - npc_apply_anim_looping(eventObject, sprite, get_run_image_anim_num(eventObject->facingDirection)); + npc_apply_anim_looping(eventObject, sprite, GetRunningDirectionAnimNum(eventObject->facingDirection)); } bool8 npc_obj_ministep_stop_on_arrival(struct EventObject *eventObject, struct Sprite *sprite) { if (obj_npc_ministep(sprite)) { - npc_coords_shift_still(eventObject); + ShiftStillEventObjectCoords(eventObject); eventObject->triggerGroundEffectsOnStop = TRUE; sprite->animPaused = TRUE; return TRUE; @@ -5134,9 +5337,9 @@ void sub_8093AF0(struct EventObject *eventObject, struct Sprite *sprite, u8 dire x = eventObject->currentCoords.x; y = eventObject->currentCoords.y; - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); MoveCoords(direction, &x, &y); - npc_coords_shift(eventObject, x, y); + ShiftEventObjectCoords(eventObject, x, y); sub_80976DC(sprite, direction); sprite->animPaused = FALSE; eventObject->triggerGroundEffectsOnMove = TRUE; @@ -5146,14 +5349,14 @@ void sub_8093AF0(struct EventObject *eventObject, struct Sprite *sprite, u8 dire void sub_8093B60(struct EventObject *eventObject, struct Sprite *sprite, u8 direction) { sub_8093AF0(eventObject, sprite, direction); - npc_apply_anim_looping(eventObject, sprite, get_go_image_anim_num(eventObject->facingDirection)); + npc_apply_anim_looping(eventObject, sprite, GetMoveDirectionAnimNum(eventObject->facingDirection)); } bool8 an_walk_any_2(struct EventObject *eventObject, struct Sprite *sprite) { if (sub_80976EC(sprite)) { - npc_coords_shift_still(eventObject); + ShiftStillEventObjectCoords(eventObject); eventObject->triggerGroundEffectsOnStop = TRUE; sprite->animPaused = TRUE; return TRUE; @@ -5161,39 +5364,261 @@ bool8 an_walk_any_2(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -#define an_walk_any_2_macro(name, fn1, fn2, ...) \ -bool8 name##_2(struct EventObject *, struct Sprite *);\ -bool8 name(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - fn1(eventObject, sprite, __VA_ARGS__);\ - return name##_2(eventObject, sprite);\ -}\ -bool8 name##_2(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - if (fn2(eventObject, sprite))\ - {\ - sprite->data[2] = 2;\ - return TRUE;\ - }\ - return FALSE;\ +bool8 MovementAction_WalkSlowDiagonalUpLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8093B60(eventObject, sprite, DIR_NORTHWEST); + return MovementAction_WalkSlowDiagonalUpLeft_Step1(eventObject, sprite); } -an_walk_any_2_macro(sub_8093BC4, sub_8093B60, an_walk_any_2, 7) -an_walk_any_2_macro(sub_8093C04, sub_8093B60, an_walk_any_2, 8) -an_walk_any_2_macro(sub_8093C44, sub_8093B60, an_walk_any_2, 5) -an_walk_any_2_macro(sub_8093C84, sub_8093B60, an_walk_any_2, 6) -an_walk_any_2_macro(sub_8093CC4, sub_8093B60, an_walk_any_2, 1) -an_walk_any_2_macro(sub_8093D04, sub_8093B60, an_walk_any_2, 2) -an_walk_any_2_macro(sub_8093D44, sub_8093B60, an_walk_any_2, 3) -an_walk_any_2_macro(sub_8093D84, sub_8093B60, an_walk_any_2, 4) -an_walk_any_2_macro(sub_8093DC4, do_go_anim, npc_obj_ministep_stop_on_arrival, 7, 0) -an_walk_any_2_macro(sub_8093E04, do_go_anim, npc_obj_ministep_stop_on_arrival, 8, 0) -an_walk_any_2_macro(sub_8093E44, do_go_anim, npc_obj_ministep_stop_on_arrival, 5, 0) -an_walk_any_2_macro(sub_8093E84, do_go_anim, npc_obj_ministep_stop_on_arrival, 6, 0) -an_walk_any_2_macro(sub_8093EC4, do_go_anim, npc_obj_ministep_stop_on_arrival, 1, 0) -an_walk_any_2_macro(sub_8093F04, do_go_anim, npc_obj_ministep_stop_on_arrival, 2, 0) -an_walk_any_2_macro(sub_8093F44, do_go_anim, npc_obj_ministep_stop_on_arrival, 3, 0) -an_walk_any_2_macro(sub_8093F84, do_go_anim, npc_obj_ministep_stop_on_arrival, 4, 0) +bool8 MovementAction_WalkSlowDiagonalUpLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (an_walk_any_2(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkSlowDiagonalUpRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8093B60(eventObject, sprite, DIR_NORTHEAST); + return MovementAction_WalkSlowDiagonalUpRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkSlowDiagonalUpRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (an_walk_any_2(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkSlowDiagonalDownLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8093B60(eventObject, sprite, DIR_SOUTHWEST); + return MovementAction_WalkSlowDiagonalDownLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkSlowDiagonalDownLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (an_walk_any_2(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkSlowDiagonalDownRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8093B60(eventObject, sprite, DIR_SOUTHEAST); + return MovementAction_WalkSlowDiagonalDownRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkSlowDiagonalDownRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (an_walk_any_2(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkSlowDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8093B60(eventObject, sprite, DIR_SOUTH); + return MovementAction_WalkSlowDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkSlowDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (an_walk_any_2(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkSlowUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8093B60(eventObject, sprite, DIR_NORTH); + return MovementAction_WalkSlowUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkSlowUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (an_walk_any_2(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkSlowLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8093B60(eventObject, sprite, DIR_WEST); + return MovementAction_WalkSlowLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkSlowLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (an_walk_any_2(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkSlowRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8093B60(eventObject, sprite, DIR_EAST); + return MovementAction_WalkSlowRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkSlowRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (an_walk_any_2(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkNormalDiagonalUpLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_NORTHWEST, 0); + return MovementAction_WalkNormalDiagonalUpLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkNormalDiagonalUpLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkNormalDiagonalUpRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_NORTHEAST, 0); + return MovementAction_WalkNormalDiagonalUpRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkNormalDiagonalUpRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkNormalDiagonalDownLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_SOUTHWEST, 0); + return MovementAction_WalkNormalDiagonalDownLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkNormalDiagonalDownLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkNormalDiagonalDownRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_SOUTHEAST, 0); + return MovementAction_WalkNormalDiagonalDownRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkNormalDiagonalDownRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkNormalDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_SOUTH, 0); + return MovementAction_WalkNormalDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkNormalDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkNormalUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_NORTH, 0); + return MovementAction_WalkNormalUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkNormalUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkNormalLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_WEST, 0); + return MovementAction_WalkNormalLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkNormalLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkNormalRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_EAST, 0); + return MovementAction_WalkNormalRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkNormalRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} void sub_8093FC4(struct EventObject *eventObject, struct Sprite *sprite, u8 direction, u8 speed, u8 a5) { @@ -5204,9 +5629,9 @@ void sub_8093FC4(struct EventObject *eventObject, struct Sprite *sprite, u8 dire memcpy(displacements, gUnknown_0850DFBC, sizeof gUnknown_0850DFBC); x = 0; y = 0; - EventObjectSetDirection(eventObject, direction); - sub_8092F88(direction, &x, &y, displacements[speed], displacements[speed]); - npc_coords_shift(eventObject, eventObject->currentCoords.x + x, eventObject->currentCoords.y + y); + SetEventObjectDirection(eventObject, direction); + MoveCoordsInDirection(direction, &x, &y, displacements[speed], displacements[speed]); + ShiftEventObjectCoords(eventObject, eventObject->currentCoords.x + x, eventObject->currentCoords.y + y); sub_809783C(sprite, direction, speed, a5); sprite->data[2] = 1; sprite->animPaused = 0; @@ -5217,7 +5642,7 @@ void sub_8093FC4(struct EventObject *eventObject, struct Sprite *sprite, u8 dire void maybe_shadow_1(struct EventObject *eventObject, struct Sprite *sprite, u8 direction, u8 speed, u8 a4) { sub_8093FC4(eventObject, sprite, direction, speed, a4); - npc_apply_anim_looping(eventObject, sprite, get_go_image_anim_num(eventObject->facingDirection)); + npc_apply_anim_looping(eventObject, sprite, GetMoveDirectionAnimNum(eventObject->facingDirection)); DoShadowFieldEffect(eventObject); } @@ -5234,14 +5659,14 @@ u8 sub_80940C4(struct EventObject *eventObject, struct Sprite *sprite, u8 callba { x = 0; y = 0; - sub_8092F88(eventObject->movementDirection, &x, &y, displacements[sprite->data[4]], displacements[sprite->data[4]]); - npc_coords_shift(eventObject, eventObject->currentCoords.x + x, eventObject->currentCoords.y + y); + MoveCoordsInDirection(eventObject->movementDirection, &x, &y, displacements[sprite->data[4]], displacements[sprite->data[4]]); + ShiftEventObjectCoords(eventObject, eventObject->currentCoords.x + x, eventObject->currentCoords.y + y); eventObject->triggerGroundEffectsOnMove = TRUE; eventObject->disableCoveringGroundEffects = TRUE; } else if (result == 0xFF) { - npc_coords_shift_still(eventObject); + ShiftStillEventObjectCoords(eventObject); eventObject->triggerGroundEffectsOnStop = TRUE; eventObject->landingJump = TRUE; sprite->animPaused = TRUE; @@ -5284,35 +5709,81 @@ bool8 sub_80941E0(struct EventObject *eventObject, struct Sprite *sprite) case 255: return TRUE; case 1: - EventObjectSetDirection(eventObject, GetOppositeDirection(eventObject->movementDirection)); - obj_npc_animation_step(eventObject, sprite, get_go_image_anim_num(eventObject->facingDirection)); + SetEventObjectDirection(eventObject, GetOppositeDirection(eventObject->movementDirection)); + obj_npc_animation_step(eventObject, sprite, GetMoveDirectionAnimNum(eventObject->facingDirection)); default: return FALSE; } } -#define maybe_shadow_1_macro(name, fn1, fn2, ...) \ -bool8 name##_2(struct EventObject *, struct Sprite *);\ -bool8 name(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - fn1(eventObject, sprite, __VA_ARGS__);\ - return name##_2(eventObject, sprite);\ -}\ -bool8 name##_2(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - if (fn2(eventObject, sprite))\ - {\ - eventObject->hasShadow = FALSE;\ - sprite->data[2] = 2;\ - return TRUE;\ - }\ - return FALSE;\ +bool8 MovementAction_Jump2Down_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_SOUTH, 2, 0); + return MovementAction_Jump2Down_Step1(eventObject, sprite); +} + +bool8 MovementAction_Jump2Down_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_Jump2Up_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_NORTH, 2, 0); + return MovementAction_Jump2Up_Step1(eventObject, sprite); +} + +bool8 MovementAction_Jump2Up_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_Jump2Left_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_WEST, 2, 0); + return MovementAction_Jump2Left_Step1(eventObject, sprite); +} + +bool8 MovementAction_Jump2Left_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_Jump2Right_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_EAST, 2, 0); + return MovementAction_Jump2Right_Step1(eventObject, sprite); +} + +bool8 MovementAction_Jump2Right_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; } -maybe_shadow_1_macro(sub_8094230, maybe_shadow_1, sub_80941B0, DIR_SOUTH, 2, 0) -maybe_shadow_1_macro(sub_8094288, maybe_shadow_1, sub_80941B0, DIR_NORTH, 2, 0) -maybe_shadow_1_macro(sub_80942E0, maybe_shadow_1, sub_80941B0, DIR_WEST, 2, 0) -maybe_shadow_1_macro(sub_8094338, maybe_shadow_1, sub_80941B0, DIR_EAST, 2, 0) void sub_8094390(struct Sprite *sprite, u16 duration) { @@ -5320,7 +5791,7 @@ void sub_8094390(struct Sprite *sprite, u16 duration) sprite->data[3] = duration; } -bool8 sub_8094398(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_Delay_Step1(struct EventObject *eventObject, struct Sprite *sprite) { if (-- sprite->data[3] == 0) { @@ -5330,34 +5801,111 @@ bool8 sub_8094398(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -#define special_anim_with_timer(name, duration)\ -bool8 name(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - sub_8094390(sprite, duration);\ - return sub_8094398(eventObject, sprite);\ +bool8 MovementAction_Delay1_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094390(sprite, 1); + return MovementAction_Delay_Step1(eventObject, sprite); } -special_anim_with_timer(sub_80943B4, 1) -special_anim_with_timer(sub_80943D4, 2) -special_anim_with_timer(sub_80943F4, 4) -special_anim_with_timer(sub_8094414, 8) -special_anim_with_timer(sub_8094434, 16) +bool8 MovementAction_Delay2_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094390(sprite, 2); + return MovementAction_Delay_Step1(eventObject, sprite); +} + +bool8 MovementAction_Delay4_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094390(sprite, 4); + return MovementAction_Delay_Step1(eventObject, sprite); +} + +bool8 MovementAction_Delay8_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094390(sprite, 8); + return MovementAction_Delay_Step1(eventObject, sprite); +} + +bool8 MovementAction_Delay16_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094390(sprite, 16); + return MovementAction_Delay_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkFastDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_SOUTH, 1); + return MovementAction_WalkFastDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkFastDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkFastUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_NORTH, 1); + return MovementAction_WalkFastUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkFastUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkFastLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_WEST, 1); + return MovementAction_WalkFastLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkFastLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkFastRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_EAST, 1); + return MovementAction_WalkFastRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkFastRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} -an_walk_any_2_macro(sub_8094454, do_go_anim, npc_obj_ministep_stop_on_arrival, 1, 1) -an_walk_any_2_macro(sub_8094494, do_go_anim, npc_obj_ministep_stop_on_arrival, 2, 1) -an_walk_any_2_macro(sub_80944D4, do_go_anim, npc_obj_ministep_stop_on_arrival, 3, 1) -an_walk_any_2_macro(sub_8094514, do_go_anim, npc_obj_ministep_stop_on_arrival, 4, 1) void sub_8094554(struct EventObject *eventObject, struct Sprite *sprite, u8 direction, u8 animNum, u16 duration) { - EventObjectSetDirection(eventObject, direction); + SetEventObjectDirection(eventObject, direction); npc_apply_anim_looping(eventObject, sprite, animNum); sprite->animPaused = FALSE; sprite->data[2] = 1; sprite->data[3] = duration; } -bool8 sub_809459C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_WalkInPlace_Step1(struct EventObject *eventObject, struct Sprite *sprite) { if (-- sprite->data[3] == 0) { @@ -5368,74 +5916,383 @@ bool8 sub_809459C(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_80945C4(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_WalkInPlaceSlow_Step1(struct EventObject *eventObject, struct Sprite *sprite) { if (sprite->data[3] & 1) { - sprite->animDelayCounter ++; + sprite->animDelayCounter++; } - return sub_809459C(eventObject, sprite); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); } -#define special_anim_with_timer_2(name, direction, images, duration, timer) \ -bool8 name(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - u8 animId;\ - animId = images(DIR_##direction);\ - sub_8094554(eventObject, sprite, DIR_##direction, animId, duration);\ - return timer(eventObject, sprite);\ -} - -special_anim_with_timer_2(sub_8094600, SOUTH, get_go_image_anim_num, 32, sub_80945C4) -special_anim_with_timer_2(sub_8094638, NORTH, get_go_image_anim_num, 32, sub_80945C4) -special_anim_with_timer_2(sub_8094670, WEST, get_go_image_anim_num, 32, sub_80945C4) -special_anim_with_timer_2(sub_80946A8, EAST, get_go_image_anim_num, 32, sub_80945C4) -special_anim_with_timer_2(sub_80946E0, SOUTH, get_go_image_anim_num, 16, sub_809459C) -special_anim_with_timer_2(sub_8094718, NORTH, get_go_image_anim_num, 16, sub_809459C) -special_anim_with_timer_2(sub_8094750, WEST, get_go_image_anim_num, 16, sub_809459C) -special_anim_with_timer_2(sub_8094788, EAST, get_go_image_anim_num, 16, sub_809459C) -special_anim_with_timer_2(sub_80947C0, SOUTH, get_go_fast_image_anim_num, 8, sub_809459C) -special_anim_with_timer_2(sub_80947F8, NORTH, get_go_fast_image_anim_num, 8, sub_809459C) -special_anim_with_timer_2(sub_8094830, WEST, get_go_fast_image_anim_num, 8, sub_809459C) -special_anim_with_timer_2(sub_8094868, EAST, get_go_fast_image_anim_num, 8, sub_809459C) -special_anim_with_timer_2(sub_80948A0, SOUTH, get_go_faster_image_anim_num, 4, sub_809459C) -special_anim_with_timer_2(sub_80948D8, NORTH, get_go_faster_image_anim_num, 4, sub_809459C) -special_anim_with_timer_2(sub_8094910, WEST, get_go_faster_image_anim_num, 4, sub_809459C) -special_anim_with_timer_2(sub_8094948, EAST, get_go_faster_image_anim_num, 4, sub_809459C) - -an_walk_any_2_macro(sub_8094980, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_SOUTH, 2) -an_walk_any_2_macro(sub_80949C0, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_NORTH, 2) -an_walk_any_2_macro(sub_8094A00, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_WEST, 2) -an_walk_any_2_macro(sub_8094A40, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_EAST, 2) -an_walk_any_2_macro(sub_8094A80, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_SOUTH, 3) -an_walk_any_2_macro(sub_8094AC0, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_NORTH, 3) -an_walk_any_2_macro(sub_8094B00, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_WEST, 3) -an_walk_any_2_macro(sub_8094B40, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_EAST, 3) -an_walk_any_2_macro(sub_8094B80, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_SOUTH, 4) -an_walk_any_2_macro(sub_8094BC0, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_NORTH, 4) -an_walk_any_2_macro(sub_8094C00, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_WEST, 4) -an_walk_any_2_macro(sub_8094C40, do_go_anim, npc_obj_ministep_stop_on_arrival, DIR_EAST, 4) -an_walk_any_2_macro(sub_8094C80, do_run_anim, npc_obj_ministep_stop_on_arrival, DIR_SOUTH) -an_walk_any_2_macro(sub_8094CC0, do_run_anim, npc_obj_ministep_stop_on_arrival, DIR_NORTH) -an_walk_any_2_macro(sub_8094D00, do_run_anim, npc_obj_ministep_stop_on_arrival, DIR_WEST) -an_walk_any_2_macro(sub_8094D40, do_run_anim, npc_obj_ministep_stop_on_arrival, DIR_EAST) - -void npc_set_direction_and_anim__an_proceed(struct EventObject *eventObject, struct Sprite *sprite, u8 direction, u8 animNum) +bool8 MovementAction_WalkInPlaceSlowDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - obj_anim_image_set_and_seek(sprite, animNum, 0); - EventObjectSetDirection(eventObject, direction); - sprite->data[2] = 1; + sub_8094554(eventObject, sprite, DIR_SOUTH, GetMoveDirectionAnimNum(DIR_SOUTH), 32); + return MovementAction_WalkInPlaceSlow_Step1(eventObject, sprite); } -bool8 sub_8094DAC(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_WalkInPlaceSlowUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - npc_set_direction_and_anim__an_proceed(eventObject, sprite, eventObject->movementDirection, sprite->animNum); + sub_8094554(eventObject, sprite, DIR_NORTH, GetMoveDirectionAnimNum(DIR_NORTH), 32); + return MovementAction_WalkInPlaceSlow_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceSlowLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_WEST, GetMoveDirectionAnimNum(DIR_WEST), 32); + return MovementAction_WalkInPlaceSlow_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceSlowRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_EAST, GetMoveDirectionAnimNum(DIR_EAST), 32); + return MovementAction_WalkInPlaceSlow_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceNormalDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_SOUTH, GetMoveDirectionAnimNum(DIR_SOUTH), 16); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceNormalUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_NORTH, GetMoveDirectionAnimNum(DIR_NORTH), 16); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceNormalLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_WEST, GetMoveDirectionAnimNum(DIR_WEST), 16); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceNormalRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_EAST, GetMoveDirectionAnimNum(DIR_EAST), 16); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceFastDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_SOUTH, GetMoveDirectionFastAnimNum(DIR_SOUTH), 8); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceFastUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_NORTH, GetMoveDirectionFastAnimNum(DIR_NORTH), 8); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceFastLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_WEST, GetMoveDirectionFastAnimNum(DIR_WEST), 8); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceFastRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_EAST, GetMoveDirectionFastAnimNum(DIR_EAST), 8); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceFastestDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_SOUTH, GetMoveDirectionFasterAnimNum(DIR_SOUTH), 4); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceFastestUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_NORTH, GetMoveDirectionFasterAnimNum(DIR_NORTH), 4); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceFastestLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_WEST, GetMoveDirectionFasterAnimNum(DIR_WEST), 4); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkInPlaceFastestRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_EAST, GetMoveDirectionFasterAnimNum(DIR_EAST), 4); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_RideWaterCurrentDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_SOUTH, 2); + return MovementAction_RideWaterCurrentDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_RideWaterCurrentDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } return FALSE; } -bool8 sub_8094DC4(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_RideWaterCurrentUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - if (sub_80979BC(sprite)) + do_go_anim(eventObject, sprite, DIR_NORTH, 2); + return MovementAction_RideWaterCurrentUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_RideWaterCurrentUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_RideWaterCurrentLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_WEST, 2); + return MovementAction_RideWaterCurrentLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_RideWaterCurrentLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_RideWaterCurrentRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_EAST, 2); + return MovementAction_RideWaterCurrentRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_RideWaterCurrentRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkFastestDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_SOUTH, 3); + return MovementAction_WalkFastestDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkFastestDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkFastestUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_NORTH, 3); + return MovementAction_WalkFastestUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkFastestUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkFastestLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_WEST, 3); + return MovementAction_WalkFastestLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkFastestLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkFastestRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_EAST, 3); + return MovementAction_WalkFastestRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkFastestRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_SlideDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_SOUTH, 4); + return MovementAction_SlideDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_SlideDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_SlideUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_NORTH, 4); + return MovementAction_SlideUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_SlideUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_SlideLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_WEST, 4); + return MovementAction_SlideLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_SlideLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_SlideRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_EAST, 4); + return MovementAction_SlideRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_SlideRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_PlayerRunDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartRunningAnim(eventObject, sprite, DIR_SOUTH); + return MovementAction_PlayerRunDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_PlayerRunDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_PlayerRunUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartRunningAnim(eventObject, sprite, DIR_NORTH); + return MovementAction_PlayerRunUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_PlayerRunUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_PlayerRunLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartRunningAnim(eventObject, sprite, DIR_WEST); + return MovementAction_PlayerRunLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_PlayerRunLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_PlayerRunRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartRunningAnim(eventObject, sprite, DIR_EAST); + return MovementAction_PlayerRunRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_PlayerRunRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +void StartSpriteAnimInDirection(struct EventObject *eventObject, struct Sprite *sprite, u8 direction, u8 animNum) +{ + SetAndStartSpriteAnim(sprite, animNum, 0); + SetEventObjectDirection(eventObject, direction); + sprite->data[2] = 1; +} + +bool8 MovementAction_StartAnimInDirection_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, eventObject->movementDirection, sprite->animNum); + return FALSE; +} + +bool8 MovementAction_WaitSpriteAnim(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (SpriteAnimEnded(sprite)) { sprite->data[2] = 2; return TRUE; @@ -5446,154 +6303,390 @@ bool8 sub_8094DC4(struct EventObject *eventObject, struct Sprite *sprite) void sub_8094DE4(struct EventObject *eventObject, struct Sprite *sprite, u8 direction) { sub_8093FC4(eventObject, sprite, direction, 1, 0); - StartSpriteAnim(sprite, sub_80929AC(direction)); + StartSpriteAnim(sprite, GetJumpSpecialDirectionAnimNum(direction)); } -#define unk_macro_8094E18(name, direction)\ -bool8 name##_2(struct EventObject *, struct Sprite *);\ -bool8 name(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - sub_8094DE4(eventObject, sprite, direction);\ - return name##_2(eventObject, sprite);\ -}\ -bool8 name##_2(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - if (sub_80941C8(eventObject, sprite))\ - {\ - sprite->data[2] = 2;\ - eventObject->landingJump = FALSE;\ - return TRUE;\ - }\ - return FALSE;\ -} - -unk_macro_8094E18(sub_8094E18, DIR_SOUTH) -unk_macro_8094E18(sub_8094E60, DIR_NORTH) -unk_macro_8094E18(sub_8094EB8, DIR_WEST) -unk_macro_8094E18(sub_8094710, DIR_EAST) - -bool8 sub_8094F38(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_JumpSpecialDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - u8 eventObjectId; + sub_8094DE4(eventObject, sprite, DIR_SOUTH); + return MovementAction_JumpSpecialDown_Step1(eventObject, sprite); +} - if (!TryGetEventObjectIdByLocalIdAndMap(0xFF, 0, 0, &eventObjectId)) +bool8 MovementAction_JumpSpecialDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941C8(eventObject, sprite)) { - an_look_any(eventObject, sprite, sub_8092AF8(eventObject->currentCoords.x, eventObject->currentCoords.y, gEventObjects[eventObjectId].currentCoords.x, gEventObjects[eventObjectId].currentCoords.y)); + sprite->data[2] = 2; + eventObject->landingJump = FALSE; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpSpecialUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094DE4(eventObject, sprite, DIR_NORTH); + return MovementAction_JumpSpecialUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpSpecialUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941C8(eventObject, sprite)) + { + sprite->data[2] = 2; + eventObject->landingJump = FALSE; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpSpecialLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094DE4(eventObject, sprite, DIR_WEST); + return MovementAction_JumpSpecialLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpSpecialLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941C8(eventObject, sprite)) + { + sprite->data[2] = 2; + eventObject->landingJump = FALSE; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpSpecialRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094DE4(eventObject, sprite, DIR_EAST); + return MovementAction_JumpSpecialRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpSpecialRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941C8(eventObject, sprite)) + { + sprite->data[2] = 2; + eventObject->landingJump = FALSE; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_FacePlayer_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + u8 playerObjectId; + + if (!TryGetEventObjectIdByLocalIdAndMap(0xFF, 0, 0, &playerObjectId)) + { + FaceDirection(eventObject, sprite, GetDirectionToFace(eventObject->currentCoords.x, eventObject->currentCoords.y, gEventObjects[playerObjectId].currentCoords.x, gEventObjects[playerObjectId].currentCoords.y)); } sprite->data[2] = 1; return TRUE; } -bool8 sub_8094F94(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_FaceAwayPlayer_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - u8 eventObjectId; + u8 playerObjectId; - if (!TryGetEventObjectIdByLocalIdAndMap(0xFF, 0, 0, &eventObjectId)) + if (!TryGetEventObjectIdByLocalIdAndMap(0xFF, 0, 0, &playerObjectId)) { - an_look_any(eventObject, sprite, GetOppositeDirection(sub_8092AF8(eventObject->currentCoords.x, eventObject->currentCoords.y, gEventObjects[eventObjectId].currentCoords.x, gEventObjects[eventObjectId].currentCoords.y))); + FaceDirection(eventObject, sprite, GetOppositeDirection(GetDirectionToFace(eventObject->currentCoords.x, eventObject->currentCoords.y, gEventObjects[playerObjectId].currentCoords.x, gEventObjects[playerObjectId].currentCoords.y))); } sprite->data[2] = 1; return TRUE; } -bool8 sub_8094FF8(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_LockFacingDirection_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->facingDirectionLocked = TRUE; sprite->data[2] = 1; return TRUE; } -bool8 sub_8095008(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_UnlockFacingDirection_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->facingDirectionLocked = FALSE; sprite->data[2] = 1; return TRUE; } -maybe_shadow_1_macro(sub_8095018, maybe_shadow_1, sub_80941B0, DIR_SOUTH, 1, 2) -maybe_shadow_1_macro(sub_8095070, maybe_shadow_1, sub_80941B0, DIR_NORTH, 1, 2) -maybe_shadow_1_macro(sub_80950C8, maybe_shadow_1, sub_80941B0, DIR_WEST, 1, 2) -maybe_shadow_1_macro(sub_8095120, maybe_shadow_1, sub_80941B0, DIR_EAST, 1, 2) -maybe_shadow_1_macro(sub_8095178, maybe_shadow_1, sub_80941B0, DIR_SOUTH, 0, 0) -maybe_shadow_1_macro(sub_80951D0, maybe_shadow_1, sub_80941B0, DIR_NORTH, 0, 0) -maybe_shadow_1_macro(sub_8095228, maybe_shadow_1, sub_80941B0, DIR_WEST, 0, 0) -maybe_shadow_1_macro(sub_8095280, maybe_shadow_1, sub_80941B0, DIR_EAST, 0, 0) -maybe_shadow_1_macro(sub_80952D8, maybe_shadow_1, sub_80941E0, DIR_SOUTH, 0, 2) -maybe_shadow_1_macro(sub_8095330, maybe_shadow_1, sub_80941E0, DIR_NORTH, 0, 2) -maybe_shadow_1_macro(sub_8095388, maybe_shadow_1, sub_80941E0, DIR_WEST, 0, 2) -maybe_shadow_1_macro(sub_80953E0, maybe_shadow_1, sub_80941E0, DIR_EAST, 0, 2) - -bool8 sub_8095438(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_JumpDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - an_look_any(eventObject, sprite, gInitialMovementTypeFacingDirections[eventObject->movementType]); - return TRUE; + maybe_shadow_1(eventObject, sprite, DIR_SOUTH, 1, 2); + return MovementAction_JumpDown_Step1(eventObject, sprite); } -bool8 sub_8095450(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_JumpDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - npc_set_direction_and_anim__an_proceed(eventObject, sprite, DIR_SOUTH, 0x14); + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } return FALSE; } -bool8 sub_8095460(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_JumpUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_NORTH, 1, 2); + return MovementAction_JumpUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_WEST, 1, 2); + return MovementAction_JumpLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_EAST, 1, 2); + return MovementAction_JumpRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpInPlaceDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_SOUTH, 0, 0); + return MovementAction_JumpInPlaceDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpInPlaceDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpInPlaceUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_NORTH, 0, 0); + return MovementAction_JumpInPlaceUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpInPlaceUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpInPlaceLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_WEST, 0, 0); + return MovementAction_JumpInPlaceLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpInPlaceLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpInPlaceRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_EAST, 0, 0); + return MovementAction_JumpInPlaceRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpInPlaceRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpInPlaceDownUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_SOUTH, 0, 2); + return MovementAction_JumpInPlaceDownUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpInPlaceDownUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941E0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpInPlaceUpDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_NORTH, 0, 2); + return MovementAction_JumpInPlaceUpDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpInPlaceUpDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941E0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpInPlaceLeftRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_WEST, 0, 2); + return MovementAction_JumpInPlaceLeftRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpInPlaceLeftRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941E0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_JumpInPlaceRightLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + maybe_shadow_1(eventObject, sprite, DIR_EAST, 0, 2); + return MovementAction_JumpInPlaceRightLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_JumpInPlaceRightLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941E0(eventObject, sprite)) + { + eventObject->hasShadow = 0; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_FaceOriginalDirection_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + FaceDirection(eventObject, sprite, gInitialMovementTypeFacingDirections[eventObject->movementType]); + return TRUE; +} + +bool8 MovementAction_NurseJoyBowDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_SOUTH, 0x14); + return FALSE; +} + +bool8 MovementAction_EnableJumpLandingGroundEffect_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->disableJumpLandingGroundEffect = FALSE; sprite->data[2] = 1; return TRUE; } -bool8 sub_8095470(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_DisableJumpLandingGroundEffect_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->disableJumpLandingGroundEffect = TRUE; sprite->data[2] = 1; return TRUE; } -bool8 sub_8095480(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_DisableAnimation_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->inanimate = TRUE; sprite->data[2] = 1; return TRUE; } -bool8 sub_8095490(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_RestoreAnimation_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->inanimate = GetEventObjectGraphicsInfo(eventObject->graphicsId)->inanimate; sprite->data[2] = 1; return TRUE; } -bool8 sub_80954BC(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_SetInvisible_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->invisible = TRUE; sprite->data[2] = 1; return TRUE; } -bool8 sub_80954CC(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_SetVisible_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->invisible = FALSE; sprite->data[2] = 1; return TRUE; } -bool8 do_exclamation_mark_bubble_1(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_EmoteExclamationMark_Step0(struct EventObject *eventObject, struct Sprite *sprite) { EventObjectGetLocalIdAndMap(eventObject, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); - FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON_1); + FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON); sprite->data[2] = 1; return TRUE; } -bool8 do_exclamation_mark_bubble_2(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_EmoteQuestionMark_Step0(struct EventObject *eventObject, struct Sprite *sprite) { EventObjectGetLocalIdAndMap(eventObject, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); - FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON_2); + FieldEffectStart(FLDEFF_QUESTION_MARK_ICON); sprite->data[2] = 1; return TRUE; } -bool8 do_heart_bubble(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_EmoteHeart_Step0(struct EventObject *eventObject, struct Sprite *sprite) { EventObjectGetLocalIdAndMap(eventObject, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); FieldEffectStart(FLDEFF_HEART_ICON); @@ -5601,24 +6694,24 @@ bool8 do_heart_bubble(struct EventObject *eventObject, struct Sprite *sprite) return TRUE; } -bool8 sub_8095548(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_RevealTrainer_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - if (eventObject->movementType == 0x3F) + if (eventObject->movementType == MOVEMENT_TYPE_HIDDEN) { sub_80B4578(eventObject); return FALSE; } - if (eventObject->movementType != 0x39 && eventObject->movementType != 0x3A) + if (eventObject->movementType != MOVEMENT_TYPE_TREE_DISGUISE && eventObject->movementType != MOVEMENT_TYPE_MOUNTAIN_DISGUISE) { sprite->data[2] = 2; return TRUE; } sub_8155D78(eventObject); sprite->data[2] = 1; - return sub_809558C(eventObject, sprite); + return MovementAction_RevealTrainer_Step1(eventObject, sprite); } -bool8 sub_809558C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_RevealTrainer_Step1(struct EventObject *eventObject, struct Sprite *sprite) { if (sub_8155DA0(eventObject)) { @@ -5628,27 +6721,27 @@ bool8 sub_809558C(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_80955AC(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_RockSmashBreak_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - obj_anim_image_set_and_seek(sprite, 1, 0); + SetAndStartSpriteAnim(sprite, 1, 0); sprite->data[2] = 1; return FALSE; } -bool8 sub_80955C8(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_RockSmashBreak_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - if (sub_80979BC(sprite)) + if (SpriteAnimEnded(sprite)) { - SetEventObjectStepTimer(sprite, 32); + SetMovementDelay(sprite, 32); sprite->data[2] = 2; } return FALSE; } -bool8 sub_80955EC(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_RockSmashBreak_Step2(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->invisible ^= TRUE; - if (RunEventObjectStepTimer(sprite)) + if (WaitForMovementDelay(sprite)) { eventObject->invisible = TRUE; sprite->data[2] = 3; @@ -5656,27 +6749,27 @@ bool8 sub_80955EC(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8095628(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_CutTree_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - obj_anim_image_set_and_seek(sprite, 1, 0); + SetAndStartSpriteAnim(sprite, 1, 0); sprite->data[2] = 1; return FALSE; } -bool8 sub_8095644(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_CutTree_Step1(struct EventObject *eventObject, struct Sprite *sprite) { - if (sub_80979BC(sprite)) + if (SpriteAnimEnded(sprite)) { - SetEventObjectStepTimer(sprite, 32); + SetMovementDelay(sprite, 32); sprite->data[2] = 2; } return FALSE; } -bool8 sub_8095668(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_CutTree_Step2(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->invisible ^= TRUE; - if (RunEventObjectStepTimer(sprite)) + if (WaitForMovementDelay(sprite)) { eventObject->invisible = TRUE; sprite->data[2] = 3; @@ -5684,126 +6777,229 @@ bool8 sub_8095668(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_80956A4(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_SetFixedPriority_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->fixedPriority = TRUE; sprite->data[2] = 1; return TRUE; } -bool8 sub_80956B4(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_ClearFixedPriority_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->fixedPriority = FALSE; sprite->data[2] = 1; return TRUE; } -bool8 sub_80956C4(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_InitAffineAnim_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - sprite->oam.affineMode = 3; + sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; InitSpriteAffineAnim(sprite); sprite->affineAnimPaused = TRUE; sprite->subspriteMode = 0; return TRUE; } -bool8 sub_80956F4(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_ClearAffineAnim_Step0(struct EventObject *eventObject, struct Sprite *sprite) { FreeOamMatrix(sprite->oam.matrixNum); - sprite->oam.affineMode = 0; + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); return TRUE; } -bool8 sub_8095724(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_Unknown1_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->unk3_3 = TRUE; return TRUE; } -bool8 sub_8095730(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_Unknown2_Step0(struct EventObject *eventObject, struct Sprite *sprite) { eventObject->unk3_3 = FALSE; return TRUE; } -#define affine_an_walk_any_2_macro(name, fn, fn2, action, anim, ...)\ -bool8 name##_2(struct EventObject *, struct Sprite *);\ -bool8 name(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - fn(eventObject, sprite, __VA_ARGS__);\ - sprite->affineAnimPaused = FALSE;\ - action(sprite, anim);\ - return name##_2(eventObject, sprite);\ -}\ -bool8 name##_2(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - if (fn2(eventObject, sprite))\ - {\ - sprite->affineAnimPaused = TRUE;\ - sprite->data[2] = 2;\ - return TRUE;\ - }\ - return FALSE;\ -}\ +bool8 MovementAction_WalkDownStartAffine_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8093B60(eventObject, sprite, DIR_SOUTH); + sprite->affineAnimPaused = FALSE; + StartSpriteAffineAnimIfDifferent(sprite, 0); + return MovementAction_WalkDownStartAffine_Step1(eventObject, sprite); +} -affine_an_walk_any_2_macro(sub_8095740, sub_8093B60, an_walk_any_2, StartSpriteAffineAnimIfDifferent, 0, DIR_SOUTH) -affine_an_walk_any_2_macro(sub_80957A0, sub_8093B60, an_walk_any_2, ChangeSpriteAffineAnimIfDifferent, 1, DIR_SOUTH) -affine_an_walk_any_2_macro(sub_8095800, do_go_anim, npc_obj_ministep_stop_on_arrival, ChangeSpriteAffineAnimIfDifferent, 2, DIR_WEST, 1) -affine_an_walk_any_2_macro(sub_8095860, do_go_anim, npc_obj_ministep_stop_on_arrival, ChangeSpriteAffineAnimIfDifferent, 3, DIR_EAST, 1) +bool8 MovementAction_WalkDownStartAffine_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (an_walk_any_2(eventObject, sprite)) + { + sprite->affineAnimPaused = TRUE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkDownAffine_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8093B60(eventObject, sprite, DIR_SOUTH); + sprite->affineAnimPaused = FALSE; + ChangeSpriteAffineAnimIfDifferent(sprite, 1); + return MovementAction_WalkDownAffine_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkDownAffine_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (an_walk_any_2(eventObject, sprite)) + { + sprite->affineAnimPaused = TRUE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkLeftAffine_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_WEST, 1); + sprite->affineAnimPaused = FALSE; + ChangeSpriteAffineAnimIfDifferent(sprite, 2); + return MovementAction_WalkLeftAffine_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkLeftAffine_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->affineAnimPaused = TRUE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_WalkRightAffine_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + do_go_anim(eventObject, sprite, DIR_EAST, 1); + sprite->affineAnimPaused = FALSE; + ChangeSpriteAffineAnimIfDifferent(sprite, 3); + return MovementAction_WalkRightAffine_Step1(eventObject, sprite); +} + +bool8 MovementAction_WalkRightAffine_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->affineAnimPaused = TRUE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} static void sub_80958C0(struct EventObject *eventObject, struct Sprite *sprite, u8 direction) { - EventObjectSetDirection(eventObject, direction); - npc_coords_shift_still(eventObject); - obj_npc_animation_step(eventObject, sprite, sub_80929FC(direction)); + SetEventObjectDirection(eventObject, direction); + ShiftStillEventObjectCoords(eventObject); + obj_npc_animation_step(eventObject, sprite, GetAcroWheeliePedalDirectionAnimNum(direction)); sprite->animPaused = TRUE; sprite->data[2] = 1; } -bool8 sub_8095900(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_AcroWheelieFaceDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) { sub_80958C0(eventObject, sprite, DIR_SOUTH); return TRUE; } -bool8 sub_8095910(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_AcroWheelieFaceUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) { sub_80958C0(eventObject, sprite, DIR_NORTH); return TRUE; } -bool8 sub_8095920(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_AcroWheelieFaceLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) { sub_80958C0(eventObject, sprite, DIR_WEST); return TRUE; } -bool8 sub_8095930(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_AcroWheelieFaceRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) { sub_80958C0(eventObject, sprite, DIR_EAST); return TRUE; } -#define set_dirn_and_anim__an_proceed(name, direction, anims)\ -bool8 name(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - npc_set_direction_and_anim__an_proceed(eventObject, sprite, direction, anims(direction));\ - return FALSE;\ +bool8 MovementAction_AcroPopWheelieDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_SOUTH, GetAcroWheelieDirectionAnimNum(DIR_SOUTH)); + return FALSE; } -set_dirn_and_anim__an_proceed(sub_8095940, DIR_SOUTH, sub_80929BC) -set_dirn_and_anim__an_proceed(sub_8095964, DIR_NORTH, sub_80929BC) -set_dirn_and_anim__an_proceed(sub_8095988, DIR_WEST, sub_80929BC) -set_dirn_and_anim__an_proceed(sub_80959AC, DIR_EAST, sub_80929BC) -set_dirn_and_anim__an_proceed(sub_80959D0, DIR_SOUTH, sub_80929DC) -set_dirn_and_anim__an_proceed(sub_80959F4, DIR_NORTH, sub_80929DC) -set_dirn_and_anim__an_proceed(sub_8095A18, DIR_WEST, sub_80929DC) -set_dirn_and_anim__an_proceed(sub_8095A3C, DIR_EAST, sub_80929DC) -set_dirn_and_anim__an_proceed(sub_8095A60, DIR_SOUTH, sub_80929EC) -set_dirn_and_anim__an_proceed(sub_8095A84, DIR_NORTH, sub_80929EC) -set_dirn_and_anim__an_proceed(sub_8095AA8, DIR_WEST, sub_80929EC) -set_dirn_and_anim__an_proceed(sub_8095ACC, DIR_EAST, sub_80929EC) +bool8 MovementAction_AcroPopWheelieUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_NORTH, GetAcroWheelieDirectionAnimNum(DIR_NORTH)); + return FALSE; +} + +bool8 MovementAction_AcroPopWheelieLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_WEST, GetAcroWheelieDirectionAnimNum(DIR_WEST)); + return FALSE; +} + +bool8 MovementAction_AcroPopWheelieRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_EAST, GetAcroWheelieDirectionAnimNum(DIR_EAST)); + return FALSE; +} + +bool8 MovementAction_AcroEndWheelieFaceDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_SOUTH, GetAcroEndWheelieDirectionAnimNum(DIR_SOUTH)); + return FALSE; +} + +bool8 MovementAction_AcroEndWheelieFaceUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_NORTH, GetAcroEndWheelieDirectionAnimNum(DIR_NORTH)); + return FALSE; +} + +bool8 MovementAction_AcroEndWheelieFaceLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_WEST, GetAcroEndWheelieDirectionAnimNum(DIR_WEST)); + return FALSE; +} + +bool8 MovementAction_AcroEndWheelieFaceRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_EAST, GetAcroEndWheelieDirectionAnimNum(DIR_EAST)); + return FALSE; +} + +bool8 MovementAction_UnusedAcroActionDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_SOUTH, GetAcroUnusedActionDirectionAnimNum(DIR_SOUTH)); + return FALSE; +} + +bool8 MovementAction_UnusedAcroActionUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_NORTH, GetAcroUnusedActionDirectionAnimNum(DIR_NORTH)); + return FALSE; +} + +bool8 MovementAction_UnusedAcroActionLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_WEST, GetAcroUnusedActionDirectionAnimNum(DIR_WEST)); + return FALSE; +} + +bool8 MovementAction_UnusedAcroActionRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + StartSpriteAnimInDirection(eventObject, sprite, DIR_EAST, GetAcroUnusedActionDirectionAnimNum(DIR_EAST)); + return FALSE; +} void sub_8095AF0(struct EventObject *eventObject, struct Sprite *sprite) { @@ -5815,7 +7011,7 @@ bool8 sub_8095B0C(struct EventObject *eventObject, struct Sprite *sprite) { if (sub_8097758(sprite)) { - npc_coords_shift_still(eventObject); + ShiftStillEventObjectCoords(eventObject); eventObject->triggerGroundEffectsOnStop = TRUE; sprite->animPaused = TRUE; return TRUE; @@ -5823,14 +7019,14 @@ bool8 sub_8095B0C(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -bool8 sub_8095B44(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_Figure8_Step0(struct EventObject *eventObject, struct Sprite *sprite) { sub_8095AF0(eventObject, sprite); sprite->data[2] = 1; - return sub_8095B64(eventObject, sprite); + return MovementAction_Figure8_Step1(eventObject, sprite); } -bool8 sub_8095B64(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_Figure8_Step1(struct EventObject *eventObject, struct Sprite *sprite) { if (sub_8095B0C(eventObject, sprite)) { @@ -5843,100 +7039,488 @@ bool8 sub_8095B64(struct EventObject *eventObject, struct Sprite *sprite) void sub_8095B84(struct EventObject *eventObject, struct Sprite *sprite, u8 direction, u8 speed, u8 a4) { sub_8093FC4(eventObject, sprite, direction, speed, a4); - StartSpriteAnimIfDifferent(sprite, sub_80929BC(direction)); + StartSpriteAnimIfDifferent(sprite, GetAcroWheelieDirectionAnimNum(direction)); DoShadowFieldEffect(eventObject); } -maybe_shadow_1_macro(sub_8095BC8, sub_8095B84, sub_80941B0, DIR_SOUTH, 0, 1) -maybe_shadow_1_macro(sub_8095C20, sub_8095B84, sub_80941B0, DIR_NORTH, 0, 1) -maybe_shadow_1_macro(sub_8095C78, sub_8095B84, sub_80941B0, DIR_WEST, 0, 1) -maybe_shadow_1_macro(sub_8095CD0, sub_8095B84, sub_80941B0, DIR_EAST, 0, 1) -maybe_shadow_1_macro(sub_8095D28, sub_8095B84, sub_80941B0, DIR_SOUTH, 1, 1) -maybe_shadow_1_macro(sub_8095D80, sub_8095B84, sub_80941B0, DIR_NORTH, 1, 1) -maybe_shadow_1_macro(sub_8095DD8, sub_8095B84, sub_80941B0, DIR_WEST, 1, 1) -maybe_shadow_1_macro(sub_8095E30, sub_8095B84, sub_80941B0, DIR_EAST, 1, 1) -maybe_shadow_1_macro(sub_8095E88, sub_8095B84, sub_80941B0, DIR_SOUTH, 2, 0) -maybe_shadow_1_macro(sub_8095EE0, sub_8095B84, sub_80941B0, DIR_NORTH, 2, 0) -maybe_shadow_1_macro(sub_8095F38, sub_8095B84, sub_80941B0, DIR_WEST, 2, 0) -maybe_shadow_1_macro(sub_8095F90, sub_8095B84, sub_80941B0, DIR_EAST, 2, 0) +bool8 MovementAction_AcroWheelieHopFaceDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_SOUTH, 0, 1); + return MovementAction_AcroWheelieHopFaceDown_Step1(eventObject, sprite); +} -special_anim_with_timer_2(sub_8095FE8, SOUTH, sub_80929FC, 8, sub_809459C) -special_anim_with_timer_2(sub_8096020, NORTH, sub_80929FC, 8, sub_809459C) -special_anim_with_timer_2(sub_8096058, WEST, sub_80929FC, 8, sub_809459C) -special_anim_with_timer_2(sub_8096090, EAST, sub_80929FC, 8, sub_809459C) +bool8 MovementAction_AcroWheelieHopFaceDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieHopFaceUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_NORTH, 0, 1); + return MovementAction_AcroWheelieHopFaceUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieHopFaceUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieHopFaceLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_WEST, 0, 1); + return MovementAction_AcroWheelieHopFaceLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieHopFaceLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieHopFaceRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_EAST, 0, 1); + return MovementAction_AcroWheelieHopFaceRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieHopFaceRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieHopDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_SOUTH, 1, 1); + return MovementAction_AcroWheelieHopDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieHopDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieHopUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_NORTH, 1, 1); + return MovementAction_AcroWheelieHopUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieHopUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieHopLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_WEST, 1, 1); + return MovementAction_AcroWheelieHopLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieHopLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieHopRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_EAST, 1, 1); + return MovementAction_AcroWheelieHopRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieHopRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieJumpDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_SOUTH, 2, 0); + return MovementAction_AcroWheelieJumpDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieJumpDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieJumpUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_NORTH, 2, 0); + return MovementAction_AcroWheelieJumpUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieJumpUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieJumpLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_WEST, 2, 0); + return MovementAction_AcroWheelieJumpLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieJumpLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieJumpRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8095B84(eventObject, sprite, DIR_EAST, 2, 0); + return MovementAction_AcroWheelieJumpRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieJumpRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (sub_80941B0(eventObject, sprite)) + { + eventObject->hasShadow = FALSE; + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieInPlaceDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_SOUTH, GetAcroWheeliePedalDirectionAnimNum(DIR_SOUTH), 8); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieInPlaceUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_NORTH, GetAcroWheeliePedalDirectionAnimNum(DIR_NORTH), 8); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieInPlaceLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_WEST, GetAcroWheeliePedalDirectionAnimNum(DIR_WEST), 8); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieInPlaceRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8094554(eventObject, sprite, DIR_EAST, GetAcroWheeliePedalDirectionAnimNum(DIR_EAST), 8); + return MovementAction_WalkInPlace_Step1(eventObject, sprite); +} void sub_80960C8(struct EventObject *eventObject, struct Sprite *sprite, u8 direction, u8 speed) { npc_apply_direction(eventObject, sprite, direction, speed); - StartSpriteAnim(sprite, sub_80929BC(eventObject->facingDirection)); + StartSpriteAnim(sprite, GetAcroWheelieDirectionAnimNum(eventObject->facingDirection)); SeekSpriteAnim(sprite, 0); } -an_walk_any_2_macro(sub_8096100, sub_80960C8, npc_obj_ministep_stop_on_arrival, DIR_SOUTH, 1) -an_walk_any_2_macro(sub_8096140, sub_80960C8, npc_obj_ministep_stop_on_arrival, DIR_NORTH, 1) -an_walk_any_2_macro(sub_8096180, sub_80960C8, npc_obj_ministep_stop_on_arrival, DIR_WEST, 1) -an_walk_any_2_macro(sub_80961C0, sub_80960C8, npc_obj_ministep_stop_on_arrival, DIR_EAST, 1) +bool8 MovementAction_AcroPopWheelieMoveDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_80960C8(eventObject, sprite, DIR_SOUTH, 1); + return MovementAction_AcroPopWheelieMoveDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroPopWheelieMoveDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroPopWheelieMoveUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_80960C8(eventObject, sprite, DIR_NORTH, 1); + return MovementAction_AcroPopWheelieMoveUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroPopWheelieMoveUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroPopWheelieMoveLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_80960C8(eventObject, sprite, DIR_WEST, 1); + return MovementAction_AcroPopWheelieMoveLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroPopWheelieMoveLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroPopWheelieMoveRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_80960C8(eventObject, sprite, DIR_EAST, 1); + return MovementAction_AcroPopWheelieMoveRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroPopWheelieMoveRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} void sub_8096200(struct EventObject *eventObject, struct Sprite *sprite, u8 direction, u8 speed) { npc_apply_direction(eventObject, sprite, direction, speed); - npc_apply_anim_looping(eventObject, sprite, sub_80929FC(eventObject->facingDirection)); + npc_apply_anim_looping(eventObject, sprite, GetAcroWheeliePedalDirectionAnimNum(eventObject->facingDirection)); } -an_walk_any_2_macro(sub_8096230, sub_8096200, npc_obj_ministep_stop_on_arrival, DIR_SOUTH, 1) -an_walk_any_2_macro(sub_8096270, sub_8096200, npc_obj_ministep_stop_on_arrival, DIR_NORTH, 1) -an_walk_any_2_macro(sub_80962B0, sub_8096200, npc_obj_ministep_stop_on_arrival, DIR_WEST, 1) -an_walk_any_2_macro(sub_80962F0, sub_8096200, npc_obj_ministep_stop_on_arrival, DIR_EAST, 1) +bool8 MovementAction_AcroWheelieMoveDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8096200(eventObject, sprite, DIR_SOUTH, 1); + return MovementAction_AcroWheelieMoveDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieMoveDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieMoveUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8096200(eventObject, sprite, DIR_NORTH, 1); + return MovementAction_AcroWheelieMoveUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieMoveUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieMoveLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8096200(eventObject, sprite, DIR_WEST, 1); + return MovementAction_AcroWheelieMoveLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieMoveLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroWheelieMoveRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8096200(eventObject, sprite, DIR_EAST, 1); + return MovementAction_AcroWheelieMoveRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroWheelieMoveRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} void sub_8096330(struct EventObject *eventObject, struct Sprite *sprite, u8 direction, u8 speed) { npc_apply_direction(eventObject, sprite, direction, speed); - StartSpriteAnim(sprite, sub_80929DC(eventObject->facingDirection)); + StartSpriteAnim(sprite, GetAcroEndWheelieDirectionAnimNum(eventObject->facingDirection)); SeekSpriteAnim(sprite, 0); } -an_walk_any_2_macro(sub_8096368, sub_8096330, npc_obj_ministep_stop_on_arrival, DIR_SOUTH, 1) -an_walk_any_2_macro(sub_80963A8, sub_8096330, npc_obj_ministep_stop_on_arrival, DIR_NORTH, 1) -an_walk_any_2_macro(sub_80963E8, sub_8096330, npc_obj_ministep_stop_on_arrival, DIR_WEST, 1) -an_walk_any_2_macro(sub_8096428, sub_8096330, npc_obj_ministep_stop_on_arrival, DIR_EAST, 1) -bool8 sub_8096468(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_AcroEndWheelieMoveDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - sub_8097FA4(eventObject); + sub_8096330(eventObject, sprite, DIR_SOUTH, 1); + return MovementAction_AcroEndWheelieMoveDown_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroEndWheelieMoveDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroEndWheelieMoveUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8096330(eventObject, sprite, DIR_NORTH, 1); + return MovementAction_AcroEndWheelieMoveUp_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroEndWheelieMoveUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroEndWheelieMoveLeft_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8096330(eventObject, sprite, DIR_WEST, 1); + return MovementAction_AcroEndWheelieMoveLeft_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroEndWheelieMoveLeft_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroEndWheelieMoveRight_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + sub_8096330(eventObject, sprite, DIR_EAST, 1); + return MovementAction_AcroEndWheelieMoveRight_Step1(eventObject, sprite); +} + +bool8 MovementAction_AcroEndWheelieMoveRight_Step1(struct EventObject *eventObject, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(eventObject, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_Levitate_Step0(struct EventObject *eventObject, struct Sprite *sprite) +{ + CreateLevitateMovementTask(eventObject); sprite->data[2] = 1; return TRUE; } -bool8 sub_809647C(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_StopLevitate_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - sub_8098044(eventObject->warpArrowSpriteId); + DestroyExtraMovementTask(eventObject->warpArrowSpriteId); sprite->pos2.y = 0; sprite->data[2] = 1; return TRUE; } -bool8 sub_8096494(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_DestroyExtraTaskIfAtTop_Step0(struct EventObject *eventObject, struct Sprite *sprite) { if (sprite->pos2.y == 0) { - sub_8098044(eventObject->warpArrowSpriteId); + DestroyExtraMovementTask(eventObject->warpArrowSpriteId); sprite->data[2] = 1; return TRUE; } return FALSE; } -u8 sub_80964B8(struct EventObject *eventObject, struct Sprite *sprite) +u8 MovementAction_Finish(struct EventObject *eventObject, struct Sprite *sprite) { return TRUE; } -bool8 sub_80964BC(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_PauseSpriteAnim(struct EventObject *eventObject, struct Sprite *sprite) { sprite->animPaused = TRUE; return TRUE; } -void npc_obj_transfer_image_anim_pause_flag(struct EventObject *eventObject, struct Sprite *sprite) +static void UpdateEventObjectSpriteAnimPause(struct EventObject *eventObject, struct Sprite *sprite) { if (eventObject->disableAnim) { @@ -5944,7 +7528,7 @@ void npc_obj_transfer_image_anim_pause_flag(struct EventObject *eventObject, str } } -void sub_80964E8(struct EventObject *eventObject, struct Sprite *sprite) +static void TryEnableEventObjectAnim(struct EventObject *eventObject, struct Sprite *sprite) { if (eventObject->enableAnim) { @@ -5954,7 +7538,7 @@ void sub_80964E8(struct EventObject *eventObject, struct Sprite *sprite) } } -static void sub_8096518(struct EventObject *eventObject, struct Sprite *sprite) +static void UpdateEventObjectVisibility(struct EventObject *eventObject, struct Sprite *sprite) { sub_8096530(eventObject, sprite); npc_update_obj_anim_flag(eventObject, sprite); @@ -6784,7 +8368,7 @@ void FreezeEventObjectsExceptOne(u8 a1) FreezeEventObject(&gEventObjects[i]); } -void npc_sync_anim_pause_bits(struct EventObject *eventObject) +void UnfreezeEventObject(struct EventObject *eventObject) { if (eventObject->active && eventObject->frozen) { @@ -6799,34 +8383,34 @@ void UnfreezeEventObjects(void) u8 i; for (i = 0; i < EVENT_OBJECTS_COUNT; i++) if (gEventObjects[i].active) - npc_sync_anim_pause_bits(&gEventObjects[i]); + UnfreezeEventObject(&gEventObjects[i]); } -void little_step(struct Sprite *sprite, u8 dir) +void Step1(struct Sprite *sprite, u8 dir) { sprite->pos1.x += gDirectionToVectors[dir].x; sprite->pos1.y += gDirectionToVectors[dir].y; } -void double_little_steps(struct Sprite *sprite, u8 dir) +void Step2(struct Sprite *sprite, u8 dir) { sprite->pos1.x += 2 * (u16) gDirectionToVectors[dir].x; sprite->pos1.y += 2 * (u16) gDirectionToVectors[dir].y; } -void triple_little_steps(struct Sprite *sprite, u8 dir) +void Step3(struct Sprite *sprite, u8 dir) { sprite->pos1.x += 2 * (u16) gDirectionToVectors[dir].x + (u16) gDirectionToVectors[dir].x; sprite->pos1.y += 2 * (u16) gDirectionToVectors[dir].y + (u16) gDirectionToVectors[dir].y; } -void quad_little_steps(struct Sprite *sprite, u8 dir) +void Step4(struct Sprite *sprite, u8 dir) { sprite->pos1.x += 4 * (u16) gDirectionToVectors[dir].x; sprite->pos1.y += 4 * (u16) gDirectionToVectors[dir].y; } -void oct_little_steps(struct Sprite *sprite, u8 dir) +void Step8(struct Sprite *sprite, u8 dir) { sprite->pos1.x += 8 * (u16) gDirectionToVectors[dir].x; sprite->pos1.y += 8 * (u16) gDirectionToVectors[dir].y; @@ -6842,54 +8426,54 @@ void oamt_npc_ministep_reset(struct Sprite *sprite, u8 a2, u8 a3) typedef void (*SpriteStepFunc)(struct Sprite *sprite, u8 dir); static const SpriteStepFunc gUnknown_0850E6C4[] = { - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, - little_step, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, + Step1, }; static const SpriteStepFunc gUnknown_0850E704[] = { - double_little_steps, - double_little_steps, - double_little_steps, - double_little_steps, - double_little_steps, - double_little_steps, - double_little_steps, - double_little_steps, + Step2, + Step2, + Step2, + Step2, + Step2, + Step2, + Step2, + Step2, }; static const SpriteStepFunc gUnknown_0850E724[] = { - double_little_steps, - triple_little_steps, - triple_little_steps, - double_little_steps, - triple_little_steps, - triple_little_steps, + Step2, + Step3, + Step3, + Step2, + Step3, + Step3, }; static const SpriteStepFunc gUnknown_0850E73C[] = { - quad_little_steps, - quad_little_steps, - quad_little_steps, - quad_little_steps, + Step4, + Step4, + Step4, + Step4, }; static const SpriteStepFunc gUnknown_0850E74C[] = { - oct_little_steps, - oct_little_steps, + Step8, + Step8, }; static const SpriteStepFunc *const gUnknown_0850E754[] = { @@ -6930,7 +8514,7 @@ bool8 sub_80976EC(struct Sprite *sprite) { if (!(sprite->data[4] & 1)) { - little_step(sprite, sprite->data[3]); + Step1(sprite, sprite->data[3]); sprite->data[5]++; } @@ -7069,7 +8653,7 @@ u8 sub_809785C(struct Sprite *sprite) v2 = 0; if (sprite->data[4]) - little_step(sprite, sprite->data[3]); + Step1(sprite, sprite->data[3]); sprite->pos2.y = sub_8097820(sprite->data[6] >> v6[sprite->data[4]], sprite->data[5]); @@ -7106,7 +8690,7 @@ u8 sub_80978E4(struct Sprite *sprite) v2 = 0; if (sprite->data[4] && !(sprite->data[6] & 1)) - little_step(sprite, sprite->data[3]); + Step1(sprite, sprite->data[3]); sprite->pos2.y = sub_8097820(sprite->data[6] >> v6[sprite->data[4]], sprite->data[5]); @@ -7124,12 +8708,12 @@ u8 sub_80978E4(struct Sprite *sprite) return v2; } -void SetEventObjectStepTimer(struct Sprite *sprite, s16 timer) +void SetMovementDelay(struct Sprite *sprite, s16 timer) { sprite->data[3] = timer; } -bool8 RunEventObjectStepTimer(struct Sprite *sprite) +static bool8 WaitForMovementDelay(struct Sprite *sprite) { sprite->data[3]--; @@ -7139,14 +8723,14 @@ bool8 RunEventObjectStepTimer(struct Sprite *sprite) return FALSE; } -void obj_anim_image_set_and_seek(struct Sprite *sprite, u8 a2, u8 a3) +void SetAndStartSpriteAnim(struct Sprite *sprite, u8 a2, u8 a3) { sprite->animNum = a2; sprite->animPaused = 0 ; SeekSpriteAnim(sprite, a3); } -bool8 sub_80979BC(struct Sprite *sprite) +bool8 SpriteAnimEnded(struct Sprite *sprite) { if (sprite->animEnded) return TRUE; @@ -7154,7 +8738,7 @@ bool8 sub_80979BC(struct Sprite *sprite) return FALSE; } -void sub_80979D4(struct Sprite *sprite, bool8 invisible) +void UpdateEventObjectSpriteVisibility(struct Sprite *sprite, bool8 invisible) { u16 x, y; s16 x2, y2; @@ -7181,11 +8765,11 @@ void sub_80979D4(struct Sprite *sprite, bool8 invisible) sprite->invisible = 1; } -void sub_8097AC8(struct Sprite *sprite) +void UpdateEventObjectSpriteSubpriorityAndVisibility(struct Sprite *sprite) { sub_8097D68(sprite); SetObjectSubpriorityByZCoord(sprite->data[1], sprite, 1); - sub_80979D4(sprite, sprite->data[2]); + UpdateEventObjectSpriteVisibility(sprite, sprite->data[2]); } void sub_8097AF0(void) @@ -7195,7 +8779,7 @@ void sub_8097AF0(void) for(i = 0; i < MAX_SPRITES; i++) { struct Sprite *sprite = &gSprites[i]; - if(sprite->inUse && sprite->callback == sub_8097AC8) + if(sprite->inUse && sprite->callback == UpdateEventObjectSpriteSubpriorityAndVisibility) DestroySprite(sprite); } } @@ -7207,7 +8791,7 @@ int sub_8097B2C(u8 var) // this should return a u8, because all that call this s for(i = 0; i < MAX_SPRITES; i++) { struct Sprite *sprite = &gSprites[i]; - if(sprite->inUse && sprite->callback == sub_8097AC8 && (u8)sprite->data[0] == var) + if(sprite->inUse && sprite->callback == UpdateEventObjectSpriteSubpriorityAndVisibility && (u8)sprite->data[0] == var) return i; } return MAX_SPRITES; @@ -7218,7 +8802,7 @@ void sub_8097B78(u8 var1, u8 var2) u8 spriteId = sub_8097B2C(var1); if(spriteId != MAX_SPRITES) - StartSpriteAnim(&gSprites[spriteId], EventObjectDirectionToImageAnimId(var2)); + StartSpriteAnim(&gSprites[spriteId], GetFaceDirectionAnimNum(var2)); } void sub_8097BB4(u8 var1, u8 var2) @@ -7377,38 +8961,38 @@ static void DoRippleFieldEffect(struct EventObject *eventObject, struct Sprite * FieldEffectStart(FLDEFF_RIPPLE); } -u8 (*const gUnknown_0850E854[])(struct EventObject *, struct Sprite *) = { - sub_8097E50, - sub_80964B8, +u8 (*const gMovementActionFuncs_StoreAndLockAnim[])(struct EventObject *, struct Sprite *) = { + MovementAction_StoreAndLockAnim_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E85C[])(struct EventObject *, struct Sprite *) = { - sub_8097EF0, - sub_80964B8, +u8 (*const gMovementActionFuncs_FreeAndUnlockAnim[])(struct EventObject *, struct Sprite *) = { + MovementAction_FreeAndUnlockAnim_Step0, + MovementAction_Finish, }; -u8 (*const gUnknown_0850E864[])(struct EventObject *, struct Sprite *) = { - sub_80980C0, - sub_80980D0, - sub_8098124, +u8 (*const gMovementActionFuncs_FlyUp[])(struct EventObject *, struct Sprite *) = { + MovementAction_FlyUp_Step0, + MovementAction_FlyUp_Step1, + MovementAction_Fly_Finish, }; -u8 (*const gUnknown_0850E870[])(struct EventObject *, struct Sprite *) = { - sub_80980F4, - sub_8098108, - sub_8098124, +u8 (*const gMovementActionFuncs_FlyDown[])(struct EventObject *, struct Sprite *) = { + MovementAction_FlyDown_Step0, + MovementAction_FlyDown_Step1, + MovementAction_Fly_Finish, }; -u8 sub_8097E50(struct EventObject *eventObject, struct Sprite *sprite) +u8 MovementAction_StoreAndLockAnim_Step0(struct EventObject *eventObject, struct Sprite *sprite) { u32 one; bool32 ableToStore = FALSE; - if (gUnknown_020375B8 == NULL) + if (gLockedAnimEventObjects == NULL) { - gUnknown_020375B8 = AllocZeroed(0x14); - gUnknown_020375B8[0] = eventObject->localId; + gLockedAnimEventObjects = AllocZeroed(sizeof(struct LockedAnimEventObjects)); + gLockedAnimEventObjects->eventObjectIds[0] = eventObject->localId; // needed to match - gUnknown_020375B8[16] = (one = 1); + gLockedAnimEventObjects->count = (one = 1); ableToStore = one; } else @@ -7418,10 +9002,10 @@ u8 sub_8097E50(struct EventObject *eventObject, struct Sprite *sprite) bool32 found; for (firstFreeSlot = 16, found = FALSE, i = 0; i < 16; i++) { - if (firstFreeSlot == 16 && gUnknown_020375B8[i] == 0) + if (firstFreeSlot == 16 && gLockedAnimEventObjects->eventObjectIds[i] == 0) firstFreeSlot = i; - if (gUnknown_020375B8[i] == eventObject->localId) + if (gLockedAnimEventObjects->eventObjectIds[i] == eventObject->localId) { found = TRUE; break; @@ -7430,8 +9014,8 @@ u8 sub_8097E50(struct EventObject *eventObject, struct Sprite *sprite) if (!found && firstFreeSlot != 16) { - gUnknown_020375B8[firstFreeSlot] = eventObject->localId; - gUnknown_020375B8[16]++; + gLockedAnimEventObjects->eventObjectIds[firstFreeSlot] = eventObject->localId; + gLockedAnimEventObjects->count++; ableToStore = TRUE; } } @@ -7446,28 +9030,28 @@ u8 sub_8097E50(struct EventObject *eventObject, struct Sprite *sprite) return TRUE; } -u8 sub_8097EF0(struct EventObject *eventObject, struct Sprite *sprite) +u8 MovementAction_FreeAndUnlockAnim_Step0(struct EventObject *eventObject, struct Sprite *sprite) { bool32 ableToStore; - u8 id; + u8 index; sprite->data[2] = 1; - if (gUnknown_020375B8 != NULL) + if (gLockedAnimEventObjects != NULL) { ableToStore = FALSE; - id = sub_8097F78(eventObject); - if (id != 16) + index = FindLockedEventObjectIndex(eventObject); + if (index != 16) { - gUnknown_020375B8[id] = 0; - gUnknown_020375B8[16]--; + gLockedAnimEventObjects->eventObjectIds[index] = 0; + gLockedAnimEventObjects->count--; ableToStore = TRUE; } - if (gUnknown_020375B8[16] == 0) - FREE_AND_SET_NULL(gUnknown_020375B8); + if (gLockedAnimEventObjects->count == 0) + FREE_AND_SET_NULL(gLockedAnimEventObjects); if (ableToStore == TRUE) { eventObject->inanimate = GetEventObjectGraphicsInfo(eventObject->graphicsId)->inanimate; - eventObject->facingDirectionLocked = 0; + eventObject->facingDirectionLocked = FALSE; sprite->animPaused = 0; } } @@ -7475,21 +9059,21 @@ u8 sub_8097EF0(struct EventObject *eventObject, struct Sprite *sprite) return TRUE; } -u8 sub_8097F78(struct EventObject *eventObject) +u8 FindLockedEventObjectIndex(struct EventObject *eventObject) { u8 i; - for(i = 0; i < EVENT_OBJECTS_COUNT; i++) + for (i = 0; i < EVENT_OBJECTS_COUNT; i++) { - if(gUnknown_020375B8[i] == eventObject->localId) + if (gLockedAnimEventObjects->eventObjectIds[i] == eventObject->localId) return i; } return EVENT_OBJECTS_COUNT; } -void sub_8097FA4(struct EventObject *eventObject) +void CreateLevitateMovementTask(struct EventObject *eventObject) { - u8 taskId = CreateTask(sub_8097FE4, 0xFF); + u8 taskId = CreateTask(ApplyLevitateMovement, 0xFF); struct Task *task = &gTasks[taskId]; StoreWordInTwoHalfwords(&task->data[0], (u32)eventObject); @@ -7497,7 +9081,7 @@ void sub_8097FA4(struct EventObject *eventObject) task->data[3] = 0xFFFF; } -static void sub_8097FE4(u8 taskId) +static void ApplyLevitateMovement(u8 taskId) { struct EventObject *eventObject; struct Sprite *sprite; @@ -7515,12 +9099,12 @@ static void sub_8097FE4(u8 taskId) task->data[2]++; } -void sub_8098044(u8 taskId) +void DestroyExtraMovementTask(u8 taskId) { - u32 word; + struct EventObject *eventObject; struct Task *task = &gTasks[taskId]; - LoadWordFromTwoHalfwords(&task->data[0], &word); // huh??? why does it load a word that never gets used??? + LoadWordFromTwoHalfwords(&task->data[0], (u32 *)&eventObject); // unused eventObject DestroyTask(taskId); } @@ -7536,14 +9120,14 @@ void sub_8098074(u8 var1, u8 var2) } } -u8 sub_80980C0(struct EventObject *eventObject, struct Sprite *sprite) +u8 MovementAction_FlyUp_Step0(struct EventObject *eventObject, struct Sprite *sprite) { sprite->pos2.y = 0; sprite->data[2]++; return FALSE; } -u8 sub_80980D0(struct EventObject *eventObject, struct Sprite *sprite) +u8 MovementAction_FlyUp_Step1(struct EventObject *eventObject, struct Sprite *sprite) { sprite->pos2.y -= 8; @@ -7552,14 +9136,14 @@ u8 sub_80980D0(struct EventObject *eventObject, struct Sprite *sprite) return FALSE; } -u8 sub_80980F4(struct EventObject *eventObject, struct Sprite *sprite) +u8 MovementAction_FlyDown_Step0(struct EventObject *eventObject, struct Sprite *sprite) { sprite->pos2.y = -160; sprite->data[2]++; return FALSE; } -u8 sub_8098108(struct EventObject *eventObject, struct Sprite *sprite) +u8 MovementAction_FlyDown_Step1(struct EventObject *eventObject, struct Sprite *sprite) { sprite->pos2.y += 8; @@ -7569,7 +9153,7 @@ u8 sub_8098108(struct EventObject *eventObject, struct Sprite *sprite) } // though this function returns TRUE without doing anything, this header is required due to being in an array of functions which needs it. -u8 sub_8098124(struct EventObject *eventObject, struct Sprite *sprite) +u8 MovementAction_Fly_Finish(struct EventObject *eventObject, struct Sprite *sprite) { return TRUE; } diff --git a/src/field_camera.c b/src/field_camera.c index f4d9550a3..d7063bd89 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -477,7 +477,7 @@ static void CameraPanningCB_PanAhead(void) gUnknown_03000E2C = 0; } - var = player_get_direction_upper_nybble(); + var = GetPlayerMovementDirection(); if (var == 2) { if (gUnknown_03000E2A > -8) diff --git a/src/field_effect.c b/src/field_effect.c index 4ad3bd916..00814192e 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1246,7 +1246,7 @@ bool8 sub_80B6BCC(struct Task *task) // gUnknown_0855C3C8[0] CameraObjectReset2(); gEventObjects[gPlayerAvatar.eventObjectId].invisible = 1; gPlayerAvatar.preventStep = TRUE; - EventObjectSetSpecialAnim(playerObject, GetFaceDirectionAnimId(player_get_direction_lower_nybble())); + EventObjectSetHeldMovement(playerObject, GetFaceDirectionMovementAction(GetPlayerFacingDirection())); task->data[4] = playerSprite->subspriteMode; playerObject->fixedPriority = 1; playerSprite->oam.priority = 1; @@ -1393,9 +1393,9 @@ bool8 sub_80B6EE0(struct Task *task) { struct EventObject *eventObject; eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (!EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(eventObject) || EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (!EventObjectIsMovementOverridden(eventObject) || EventObjectClearHeldMovementIfFinished(eventObject)) { - EventObjectSetSpecialAnim(eventObject, GetFaceDirectionAnimId(player_get_direction_lower_nybble())); + EventObjectSetHeldMovement(eventObject, GetFaceDirectionMovementAction(GetPlayerFacingDirection())); task->data[0]++; task->data[2] = 0; task->data[3] = 0; @@ -1512,7 +1512,7 @@ bool8 sub_80B7114(struct Task *task) u8 behavior; CameraObjectReset2(); eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - EventObjectSetSpecialAnim(eventObject, GetFaceDirectionAnimId(DIR_EAST)); + EventObjectSetHeldMovement(eventObject, GetFaceDirectionMovementAction(DIR_EAST)); PlayerGetDestCoords(&x, &y); behavior = MapGridGetMetatileBehaviorAt(x, y); task->data[0]++; @@ -1606,11 +1606,11 @@ bool8 sub_80B72F4(struct Task *task) { struct EventObject *eventObject; eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (EventObjectClearHeldMovementIfFinished(eventObject)) { CameraObjectReset1(); ScriptContext2_Disable(); - EventObjectSetSpecialAnim(eventObject, GetGoSpeed0AnimId(DIR_EAST)); + EventObjectSetHeldMovement(eventObject, GetWalkNormalMovementAction(DIR_EAST)); DestroyTask(FindTaskIdByFunc(sub_80B70DC)); } return FALSE; @@ -1643,9 +1643,9 @@ bool8 sub_80B73D0(struct Task *task, struct EventObject *eventObject) bool8 waterfall_1_do_anim_probably(struct Task *task, struct EventObject *eventObject) { ScriptContext2_Enable(); - if (!EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(eventObject)) + if (!EventObjectIsMovementOverridden(eventObject)) { - EventObjectClearAnimIfSpecialAnimFinished(eventObject); + EventObjectClearHeldMovementIfFinished(eventObject); gFieldEffectArguments[0] = task->data[1]; FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); task->data[0]++; @@ -1665,14 +1665,14 @@ bool8 waterfall_2_wait_anim_finish_probably(struct Task *task, struct EventObjec bool8 sub_80B7450(struct Task *task, struct EventObject *eventObject) { - EventObjectSetSpecialAnim(eventObject, GetSimpleGoAnimId(DIR_NORTH)); + EventObjectSetHeldMovement(eventObject, GetWalkSlowMovementAction(DIR_NORTH)); task->data[0]++; return FALSE; } bool8 sub_80B7478(struct Task *task, struct EventObject *eventObject) { - if (!EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (!EventObjectClearHeldMovementIfFinished(eventObject)) { return FALSE; } @@ -1899,14 +1899,14 @@ bool8 sub_80B7968(struct Task *task, struct EventObject *eventObject, struct Spr eventObject->invisible = 0; CameraObjectReset1(); PlaySE(SE_W091); - EventObjectSetSpecialAnim(eventObject, sub_8093514(DIR_EAST)); + EventObjectSetHeldMovement(eventObject, GetJumpMovementAction(DIR_EAST)); } return FALSE; } bool8 sub_80B79BC(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (EventObjectClearHeldMovementIfFinished(eventObject)) { gPlayerAvatar.preventStep = FALSE; ScriptContext2_Disable(); @@ -1960,7 +1960,7 @@ bool8 sub_80B7AE8(struct Task *task, struct EventObject *eventObject, struct Spr bool8 sub_80B7B18(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite) { - if (EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (EventObjectClearHeldMovementIfFinished(eventObject)) { if (task->data[1] > 3) { @@ -1973,7 +1973,7 @@ bool8 sub_80B7B18(struct Task *task, struct EventObject *eventObject, struct Spr } else { task->data[1]++; - EventObjectSetSpecialAnim(eventObject, GetStepInPlaceDelay4AnimId(eventObject->facingDirection)); + EventObjectSetHeldMovement(eventObject, GetWalkInPlaceFastestMovementAction(eventObject->facingDirection)); PlaySE(SE_FU_ZUZUZU); } } @@ -2050,7 +2050,7 @@ void sub_80B7D14(struct Task *task) { task->data[0]++; task->data[14] = 64; - task->data[15] = player_get_direction_lower_nybble(); + task->data[15] = GetPlayerFacingDirection(); } void sub_80B7D34(struct Task *task) @@ -2063,11 +2063,11 @@ void sub_80B7D34(struct Task *task) sub_80AF0B4(); } eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (!EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(eventObject) || EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (!EventObjectIsMovementOverridden(eventObject) || EventObjectClearHeldMovementIfFinished(eventObject)) { if (task->data[14] == 0 && !gPaletteFade.active && sub_80859A0() == TRUE) { - EventObjectSetDirection(eventObject, task->data[15]); + SetEventObjectDirection(eventObject, task->data[15]); sub_8084E14(); warp_in(); gFieldCallback = mapldr_080859D4; @@ -2075,7 +2075,7 @@ void sub_80B7D34(struct Task *task) DestroyTask(FindTaskIdByFunc(sub_80B7CE4)); } else if (task->data[1] == 0 || (--task->data[1]) == 0) { - EventObjectSetSpecialAnim(eventObject, GetFaceDirectionAnimId(spinDirections[eventObject->facingDirection])); + EventObjectSetHeldMovement(eventObject, GetFaceDirectionMovementAction(spinDirections[eventObject->facingDirection])); if (task->data[2] < 12) { task->data[2]++; @@ -2113,7 +2113,7 @@ void sub_80B7EC4(struct Task *task) if (IsWeatherNotFadingIn()) { task->data[0]++; - task->data[15] = player_get_direction_lower_nybble(); + task->data[15] = GetPlayerFacingDirection(); } } @@ -2123,11 +2123,11 @@ void sub_80B7EE8(struct Task *task) struct EventObject *eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; if (task->data[1] == 0 || (--task->data[1]) == 0) { - if (EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(eventObject) && !EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (EventObjectIsMovementOverridden(eventObject) && !EventObjectClearHeldMovementIfFinished(eventObject)) { return; } - if (task->data[2] >= 32 && task->data[15] == player_get_direction_lower_nybble()) + if (task->data[2] >= 32 && task->data[15] == GetPlayerFacingDirection()) { eventObject->invisible = 0; ScriptContext2_Disable(); @@ -2135,7 +2135,7 @@ void sub_80B7EE8(struct Task *task) DestroyTask(FindTaskIdByFunc(sub_80B7E94)); return; } - EventObjectSetSpecialAnim(eventObject, GetFaceDirectionAnimId(spinDirections[eventObject->facingDirection])); + EventObjectSetHeldMovement(eventObject, GetFaceDirectionMovementAction(spinDirections[eventObject->facingDirection])); if (task->data[2] < 32) { task->data[2]++; @@ -2174,7 +2174,7 @@ static void TeleportFieldEffectTask1(struct Task *task) ScriptContext2_Enable(); FreezeEventObjects(); CameraObjectReset2(); - task->data[15] = player_get_direction_lower_nybble(); + task->data[15] = GetPlayerFacingDirection(); task->data[0]++; } @@ -2286,7 +2286,7 @@ void sub_80B8280(struct Task *task) task->data[1] = 8; task->data[2] = 1; task->data[14] = sprite->subspriteMode; - task->data[15] = player_get_direction_lower_nybble(); + task->data[15] = GetPlayerFacingDirection(); PlaySE(SE_TK_WARPIN); } } @@ -2904,10 +2904,10 @@ void sub_80B8E14(struct Task *task) { struct EventObject *eventObject; eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (!EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(eventObject) || EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (!EventObjectIsMovementOverridden(eventObject) || EventObjectClearHeldMovementIfFinished(eventObject)) { sub_808C114(); - EventObjectSetSpecialAnim(eventObject, 0x39); + EventObjectSetHeldMovement(eventObject, 0x39); task->data[0]++; } } @@ -2916,7 +2916,7 @@ void sub_80B8E60(struct Task *task) { struct EventObject *eventObject; eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (EventObjectCheckIfSpecialAnimFinishedOrInactive(eventObject)) + if (EventObjectCheckHeldMovementStatus(eventObject)) { gFieldEffectArguments[0] = task->data[15] | 0x80000000; FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); @@ -2931,8 +2931,8 @@ void sub_80B8EA8(struct Task *task) { eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; EventObjectSetGraphicsId(eventObject, GetPlayerAvatarGraphicsIdByStateId(3)); - EventObjectClearAnimIfSpecialAnimFinished(eventObject); - EventObjectSetSpecialAnim(eventObject, sub_8093540(eventObject->movementDirection)); + EventObjectClearHeldMovementIfFinished(eventObject); + EventObjectSetHeldMovement(eventObject, GetJumpSpecialMovementAction(eventObject->movementDirection)); gFieldEffectArguments[0] = task->data[1]; gFieldEffectArguments[1] = task->data[2]; gFieldEffectArguments[2] = gPlayerAvatar.eventObjectId; @@ -2945,11 +2945,11 @@ void sub_80B8F24(struct Task *task) { struct EventObject *eventObject; eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (EventObjectClearHeldMovementIfFinished(eventObject)) { gPlayerAvatar.preventStep = FALSE; gPlayerAvatar.flags &= 0xdf; - EventObjectSetSpecialAnim(eventObject, GetFaceDirectionAnimId(eventObject->movementDirection)); + EventObjectSetHeldMovement(eventObject, GetFaceDirectionMovementAction(eventObject->movementDirection)); sub_81555AC(eventObject->fieldEffectSpriteId, 1); UnfreezeEventObjects(); ScriptContext2_Disable(); @@ -3206,13 +3206,13 @@ void sub_80B9204(struct Task *task) { struct EventObject *eventObject; eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (!EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(eventObject) || EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (!EventObjectIsMovementOverridden(eventObject) || EventObjectClearHeldMovementIfFinished(eventObject)) { task->data[15] = gPlayerAvatar.flags; gPlayerAvatar.preventStep = TRUE; SetPlayerAvatarStateMask(1); sub_808C114(); - EventObjectSetSpecialAnim(eventObject, 0x39); + EventObjectSetHeldMovement(eventObject, 0x39); task->data[0]++; } } @@ -3221,7 +3221,7 @@ void sub_80B925C(struct Task *task) { struct EventObject *eventObject; eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (EventObjectClearHeldMovementIfFinished(eventObject)) { task->data[0]++; gFieldEffectArguments[0] = task->data[1]; @@ -3252,7 +3252,7 @@ void sub_80B92F8(struct Task *task) task->data[0]++; task->data[2] = 16; SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT); - EventObjectSetSpecialAnim(&gEventObjects[gPlayerAvatar.eventObjectId], 0x02); + EventObjectSetHeldMovement(&gEventObjects[gPlayerAvatar.eventObjectId], 0x02); } } @@ -3260,7 +3260,7 @@ void sub_80B933C(struct Task *task) { struct EventObject *eventObject; eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - if ((task->data[2] == 0 || (--task->data[2]) == 0) && EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if ((task->data[2] == 0 || (--task->data[2]) == 0) && EventObjectClearHeldMovementIfFinished(eventObject)) { task->data[0]++; PlaySE(SE_W019); @@ -3277,7 +3277,7 @@ void sub_80B9390(struct Task *task) EventObjectSetGraphicsId(eventObject, GetPlayerAvatarGraphicsIdByStateId(0x03)); StartSpriteAnim(&gSprites[eventObject->spriteId], 0x16); eventObject->inanimate = 1; - EventObjectSetSpecialAnim(eventObject, 0x48); + EventObjectSetHeldMovement(eventObject, 0x48); if (task->data[15] & 0x08) { DestroySprite(&gSprites[eventObject->fieldEffectSpriteId]); @@ -3293,7 +3293,7 @@ void sub_80B9418(struct Task *task) if ((++task->data[2]) >= 10) { eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - EventObjectClearAnimIfSpecialAnimActive(eventObject); + EventObjectClearHeldMovementIfActive(eventObject); eventObject->inanimate = 0; eventObject->hasShadow = 0; sub_80B9560(task->data[1], eventObject->spriteId); @@ -3503,7 +3503,7 @@ void sub_80B9804(struct Task *task) { struct EventObject *eventObject; eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (!EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(eventObject) || EventObjectClearAnimIfSpecialAnimFinished(eventObject)) + if (!EventObjectIsMovementOverridden(eventObject) || EventObjectClearHeldMovementIfFinished(eventObject)) { task->data[0]++; task->data[2] = 17; @@ -3587,14 +3587,14 @@ void sub_80B9978(struct Task *task) sprite->pos2.y = 0; sprite->coordOffsetEnabled = 1; sub_808C114(); - EventObjectSetSpecialAnim(eventObject, 0x39); + EventObjectSetHeldMovement(eventObject, 0x39); task->data[0]++; } } void sub_80B99F0(struct Task *task) { - if (EventObjectClearAnimIfSpecialAnimFinished(&gEventObjects[gPlayerAvatar.eventObjectId])) + if (EventObjectClearHeldMovementIfFinished(&gEventObjects[gPlayerAvatar.eventObjectId])) { task->data[0]++; sub_80B9794(task->data[1]); @@ -3848,7 +3848,7 @@ bool8 sub_80B9E28(struct Sprite* sprite) yPos = object->currentCoords.y - 7; xPos = (gFieldEffectArguments[3] - xPos) * 16; yPos = (gFieldEffectArguments[4] - yPos) * 16; - npc_coords_shift(object, gFieldEffectArguments[3] + 7, gFieldEffectArguments[4] + 7); + ShiftEventObjectCoords(object, gFieldEffectArguments[3] + 7, gFieldEffectArguments[4] + 7); taskId = CreateTask(sub_80B9EDC, 0x50); gTasks[taskId].data[1] = object->spriteId; gTasks[taskId].data[2] = gSprites[object->spriteId].pos1.x + xPos; @@ -3886,7 +3886,7 @@ void sub_80B9EDC(u8 taskId) struct EventObject *object = &gEventObjects[data[9]]; sprite->pos1.x = data[2]; sprite->pos1.y = data[3]; - npc_coords_shift_still(object); + ShiftStillEventObjectCoords(object); object->triggerGroundEffectsOnStop = TRUE; FieldEffectActiveListRemove(0x42); DestroyTask(taskId); diff --git a/src/field_special_scene.c b/src/field_special_scene.c index a5058b363..39977808f 100644 --- a/src/field_special_scene.c +++ b/src/field_special_scene.c @@ -335,11 +335,11 @@ void sub_80FB6EC(void) if (VarGet(0x40B4) == 2) { - StartSpriteAnim(&gSprites[spriteId], EventObjectDirectionToImageAnimId(4)); + StartSpriteAnim(&gSprites[spriteId], GetFaceDirectionAnimNum(4)); } else { - StartSpriteAnim(&gSprites[spriteId], EventObjectDirectionToImageAnimId(3)); + StartSpriteAnim(&gSprites[spriteId], GetFaceDirectionAnimNum(3)); } } diff --git a/src/item_use.c b/src/item_use.c index 2044a8c87..96f63ee3e 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -337,7 +337,7 @@ void sub_80FD504(u8 taskId) } else { - playerDir = player_get_direction_lower_nybble(); + playerDir = GetPlayerFacingDirection(); for (i = 0; i < 4; i++) { if (playerDir == gUnknown_085920E4[i]) @@ -579,15 +579,15 @@ u8 sub_80FD9B0(s16 itemX, s16 itemY) void sub_80FDA24(u8 direction) { - EventObjectClearAnimIfSpecialAnimFinished(&gEventObjects[GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0)]); - EventObjectClearAnim(&gEventObjects[GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0)]); - npc_sync_anim_pause_bits(&gEventObjects[GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0)]); + EventObjectClearHeldMovementIfFinished(&gEventObjects[GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0)]); + EventObjectClearHeldMovement(&gEventObjects[GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0)]); + UnfreezeEventObject(&gEventObjects[GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0)]); PlayerTurnInPlace(direction); } void sub_80FDA94(u8 taskId) { - if (EventObjectCheckIfSpecialAnimFinishedOrInactive(&gEventObjects[GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0)]) == TRUE) + if (EventObjectCheckHeldMovementStatus(&gEventObjects[GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0)]) == TRUE) DisplayItemMessageOnField(taskId, gText_ItemFinderNearby, sub_80FD5CC); } @@ -595,7 +595,7 @@ void sub_80FDADC(u8 taskId) { s16 *data = gTasks[taskId].data; - if (EventObjectCheckIfSpecialAnimFinishedOrInactive(&gEventObjects[GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0)]) == TRUE + if (EventObjectCheckHeldMovementStatus(&gEventObjects[GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0)]) == TRUE || data[2] == FALSE) { sub_80FDA24(gUnknown_085920E4[data[5]]); diff --git a/src/overworld.c b/src/overworld.c index 5b92b8023..1e4116053 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -169,7 +169,7 @@ extern const u8* sub_809C2C8(struct MapPosition *a1, u8, u8); extern u8 *sub_809D0F4(void*); extern u8 sub_808BD6C(u8); extern u8 sub_808BD7C(u8); -extern void sub_80979D4(struct Sprite*, u8); +extern void UpdateEventObjectSpriteVisibility(struct Sprite*, u8); // this file's functions static void Overworld_ResetStateAfterWhiteOut(void); @@ -912,7 +912,7 @@ void player_avatar_init_params_reset(void) void walkrun_find_lowest_active_bit_in_bitfield(void) { - sUnknown_02032300.player_field_1 = player_get_direction_lower_nybble(); + sUnknown_02032300.player_field_1 = GetPlayerFacingDirection(); if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_MACH_BIKE)) sUnknown_02032300.player_field_0 = 2; @@ -2170,7 +2170,7 @@ static void sub_80869DC(void) gUnknown_03005DEC = 0; gUnknown_03005DE8 = 0; sub_808D438(); - SpawnEventObjectsInView(0, 0); + TrySpawnEventObjects(0, 0); mapheader_run_first_tag4_script_list_match(); } @@ -2187,7 +2187,7 @@ static void mli4_mapscripts_and_other(void) InitPlayerAvatar(x, y, player->player_field_1, gSaveBlock2Ptr->playerGender); SetPlayerAvatarTransitionFlags(player->player_field_0); player_avatar_init_params_reset(); - SpawnEventObjectsInView(0, 0); + TrySpawnEventObjects(0, 0); mapheader_run_first_tag4_script_list_match(); } @@ -2894,7 +2894,7 @@ static void ZeroLinkPlayerEventObject(struct LinkPlayerEventObject *linkPlayerEv memset(linkPlayerEventObj, 0, sizeof(struct LinkPlayerEventObject)); } -void ZeroAllLinkPlayerEventObjects(void) +void ClearLinkPlayerEventObjects(void) { memset(gLinkPlayerEventObjects, 0, sizeof(gLinkPlayerEventObjects)); } @@ -2906,7 +2906,7 @@ static void ZeroEventObject(struct EventObject *eventObj) static void SpawnLinkPlayerEventObject(u8 linkPlayerId, s16 x, s16 y, u8 a4) { - u8 eventObjId = sub_808D4F4(); + u8 eventObjId = GetFirstInactiveEventObjectId(); struct LinkPlayerEventObject *linkPlayerEventObj = &gLinkPlayerEventObjects[linkPlayerId]; struct EventObject *eventObj = &gEventObjects[eventObjId]; @@ -3059,7 +3059,7 @@ static u8 sub_8087A20(struct LinkPlayerEventObject *linkPlayerEventObj, struct E else { eventObj->directionSequenceIndex = 16; - npc_coords_shift(eventObj, x, y); + ShiftEventObjectCoords(eventObj, x, y); EventObjectUpdateZCoord(eventObj); return 1; } @@ -3083,7 +3083,7 @@ static void sub_8087AA8(struct LinkPlayerEventObject *linkPlayerEventObj, struct MoveCoords(eventObj->range.as_byte, &eventObj->initialCoords.x, &eventObj->initialCoords.y); if (!eventObj->directionSequenceIndex) { - npc_coords_shift_still(eventObj); + ShiftStillEventObjectCoords(eventObj); linkPlayerEventObj->mode = 2; } } @@ -3166,11 +3166,11 @@ static void SpriteCB_LinkPlayer(struct Sprite *sprite) sprite->oam.priority = ZCoordToPriority(eventObj->previousElevation); if (!linkPlayerEventObj->mode) - StartSpriteAnim(sprite, EventObjectDirectionToImageAnimId(eventObj->range.as_byte)); + StartSpriteAnim(sprite, GetFaceDirectionAnimNum(eventObj->range.as_byte)); else - StartSpriteAnimIfDifferent(sprite, get_go_image_anim_num(eventObj->range.as_byte)); + StartSpriteAnimIfDifferent(sprite, GetMoveDirectionAnimNum(eventObj->range.as_byte)); - sub_80979D4(sprite, 0); + UpdateEventObjectSpriteVisibility(sprite, 0); if (eventObj->triggerGroundEffectsOnMove) { sprite->invisible = ((sprite->data[7] & 4) >> 2); diff --git a/src/rom6.c b/src/rom6.c index 60447f641..cdc1064dd 100644 --- a/src/rom6.c +++ b/src/rom6.c @@ -61,8 +61,8 @@ static void task08_080C9820(u8 taskId) ScriptContext2_Enable(); gPlayerAvatar.preventStep = TRUE; eventObjId = gPlayerAvatar.eventObjectId; - if (!EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(&gEventObjects[eventObjId]) - || EventObjectClearAnimIfSpecialAnimFinished(&gEventObjects[eventObjId])) + if (!EventObjectIsMovementOverridden(&gEventObjects[eventObjId]) + || EventObjectClearHeldMovementIfFinished(&gEventObjects[eventObjId])) { if (gMapHeader.mapType == MAP_TYPE_UNDERWATER) { @@ -72,7 +72,7 @@ static void task08_080C9820(u8 taskId) else { sub_808C114(); - EventObjectSetSpecialAnim(&gEventObjects[eventObjId], 0x39); + EventObjectSetHeldMovement(&gEventObjects[eventObjId], 0x39); gTasks[taskId].func = sub_813552C; } } @@ -80,7 +80,7 @@ static void task08_080C9820(u8 taskId) static void sub_813552C(u8 taskId) { - if (EventObjectCheckIfSpecialAnimFinishedOrInactive(&gEventObjects[gPlayerAvatar.eventObjectId]) == TRUE) + if (EventObjectCheckHeldMovementStatus(&gEventObjects[gPlayerAvatar.eventObjectId]) == TRUE) { FieldEffectStart(FLDEFF_FIELD_MOVE_SHOW_MON_INIT); gTasks[taskId].func = sub_8135578; @@ -91,7 +91,7 @@ static void sub_8135578(u8 taskId) { if (!FieldEffectActiveListContains(6)) { - gFieldEffectArguments[1] = player_get_direction_lower_nybble(); + gFieldEffectArguments[1] = GetPlayerFacingDirection(); if (gFieldEffectArguments[1] == 1) gFieldEffectArguments[2] = 0; if (gFieldEffectArguments[1] == 2) diff --git a/src/scrcmd.c b/src/scrcmd.c index e3edb5abf..4e3fceb10 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1157,7 +1157,7 @@ bool8 ScrCmd_faceplayer(struct ScriptContext *ctx) if (gEventObjects[gSelectedEventObject].active) { EventObjectFaceOppositeDirection(&gEventObjects[gSelectedEventObject], - player_get_direction_lower_nybble()); + GetPlayerFacingDirection()); } return FALSE; } @@ -1244,7 +1244,7 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx) HideFieldMessageBox(); objectId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0); - EventObjectClearAnimIfSpecialAnimFinished(&gEventObjects[objectId]); + EventObjectClearHeldMovementIfFinished(&gEventObjects[objectId]); sub_80D338C(); UnfreezeEventObjects(); return FALSE; @@ -1256,9 +1256,9 @@ bool8 ScrCmd_release(struct ScriptContext *ctx) HideFieldMessageBox(); if (gEventObjects[gSelectedEventObject].active) - EventObjectClearAnimIfSpecialAnimFinished(&gEventObjects[gSelectedEventObject]); + EventObjectClearHeldMovementIfFinished(&gEventObjects[gSelectedEventObject]); objectId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0); - EventObjectClearAnimIfSpecialAnimFinished(&gEventObjects[objectId]); + EventObjectClearHeldMovementIfFinished(&gEventObjects[objectId]); sub_80D338C(); UnfreezeEventObjects(); return FALSE; @@ -2238,7 +2238,7 @@ bool8 ScrCmd_warpD1(struct ScriptContext *ctx) u16 y = VarGet(ScriptReadHalfword(ctx)); Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y); - sub_808D074(player_get_direction_lower_nybble()); + sub_808D074(GetPlayerFacingDirection()); sub_80B0244(); player_avatar_init_params_reset(); return TRUE; diff --git a/src/script_movement.c b/src/script_movement.c index 27280addf..9fee9e060 100644 --- a/src/script_movement.c +++ b/src/script_movement.c @@ -189,7 +189,7 @@ static void UnfreezeObjects(u8 taskId) for (i = 0; i < 16; i++, pEventObjId++) { if (*pEventObjId != 0xFF) - npc_sync_anim_pause_bits(&gEventObjects[*pEventObjId]); + UnfreezeEventObject(&gEventObjects[*pEventObjId]); } } @@ -210,8 +210,8 @@ static void sub_80A2490(u8 taskId, u8 b, u8 eventObjId, const u8 *d) { u8 var; - if (EventObjectIsSpecialAnimActive(&gEventObjects[eventObjId]) - && !EventObjectClearAnimIfSpecialAnimFinished(&gEventObjects[eventObjId])) + if (EventObjectIsHeldMovementActive(&gEventObjects[eventObjId]) + && !EventObjectClearHeldMovementIfFinished(&gEventObjects[eventObjId])) return; var = *d; @@ -222,7 +222,7 @@ static void sub_80A2490(u8 taskId, u8 b, u8 eventObjId, const u8 *d) } else { - if (!EventObjectSetSpecialAnim(&gEventObjects[eventObjId], var)) + if (!EventObjectSetHeldMovement(&gEventObjects[eventObjId], var)) { d++; npc_obj_offscreen_culling_and_flag_update(b, d); diff --git a/src/trainer_see.c b/src/trainer_see.c index cf47bbe2a..f5e9c300e 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -362,7 +362,7 @@ static u8 CheckPathBetweenTrainerAndPlayer(struct EventObject *trainerObj, u8 ap MoveCoords(direction, &x, &y); for (i = 0; i < approachDistance - 1; i++, MoveCoords(direction, &x, &y)) { - collision = sub_8092C8C(trainerObj, x, y, direction); + collision = GetCollisionFlagsAtCoords(trainerObj, x, y, direction); if (collision != 0 && (collision & COLLISION_MASK)) return 0; } @@ -373,7 +373,7 @@ static u8 CheckPathBetweenTrainerAndPlayer(struct EventObject *trainerObj, u8 ap trainerObj->range.as_nybbles.x = 0; trainerObj->range.as_nybbles.y = 0; - collision = npc_block_way(trainerObj, x, y, direction); + collision = GetCollisionAtCoords(trainerObj, x, y, direction); trainerObj->range.as_nybbles.x = unk19_temp; trainerObj->range.as_nybbles.y = unk19b_temp; @@ -439,16 +439,16 @@ static bool8 sub_80B417C(u8 taskId, struct Task *task, struct EventObject *train u8 direction; EventObjectGetLocalIdAndMap(trainerObj, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); - FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON_1); - direction = GetFaceDirectionAnimId(trainerObj->facingDirection); - EventObjectSetSpecialAnim(trainerObj, direction); + FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON); + direction = GetFaceDirectionMovementAction(trainerObj->facingDirection); + EventObjectSetHeldMovement(trainerObj, direction); task->tFuncId++; return TRUE; } static bool8 sub_80B41C0(u8 taskId, struct Task *task, struct EventObject *trainerObj) { - if (FieldEffectActiveListContains(FLDEFF_EXCLAMATION_MARK_ICON_1)) + if (FieldEffectActiveListContains(FLDEFF_EXCLAMATION_MARK_ICON)) { return FALSE; } @@ -465,16 +465,16 @@ static bool8 sub_80B41C0(u8 taskId, struct Task *task, struct EventObject *train static bool8 sub_80B4200(u8 taskId, struct Task *task, struct EventObject *trainerObj) { - if (!(EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(trainerObj)) || EventObjectClearAnimIfSpecialAnimFinished(trainerObj)) + if (!(EventObjectIsMovementOverridden(trainerObj)) || EventObjectClearHeldMovementIfFinished(trainerObj)) { if (task->tTrainerRange) { - EventObjectSetSpecialAnim(trainerObj, GetGoSpeed0AnimId(trainerObj->facingDirection)); + EventObjectSetHeldMovement(trainerObj, GetWalkNormalMovementAction(trainerObj->facingDirection)); task->tTrainerRange--; } else { - EventObjectSetSpecialAnim(trainerObj, 0x3E); + EventObjectSetHeldMovement(trainerObj, 0x3E); task->tFuncId++; } } @@ -485,19 +485,19 @@ static bool8 sub_80B425C(u8 taskId, struct Task *task, struct EventObject *train { struct EventObject *playerObj; - if (EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(trainerObj) && !EventObjectClearAnimIfSpecialAnimFinished(trainerObj)) + if (EventObjectIsMovementOverridden(trainerObj) && !EventObjectClearHeldMovementIfFinished(trainerObj)) return FALSE; - npc_set_running_behaviour_etc(trainerObj, npc_running_behaviour_by_direction(trainerObj->facingDirection)); - sub_808F23C(trainerObj, npc_running_behaviour_by_direction(trainerObj->facingDirection)); - sub_808F208(trainerObj); + SetTrainerMovementType(trainerObj, GetTrainerFacingDirectionMovementType(trainerObj->facingDirection)); + TryOverrideTemplateCoordsForEventObject(trainerObj, GetTrainerFacingDirectionMovementType(trainerObj->facingDirection)); + OverrideTemplateCoordsForEventObject(trainerObj); playerObj = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(playerObj) && !EventObjectClearAnimIfSpecialAnimFinished(playerObj)) + if (EventObjectIsMovementOverridden(playerObj) && !EventObjectClearHeldMovementIfFinished(playerObj)) return FALSE; sub_808BCE8(); - EventObjectSetSpecialAnim(&gEventObjects[gPlayerAvatar.eventObjectId], GetFaceDirectionAnimId(GetOppositeDirection(trainerObj->facingDirection))); + EventObjectSetHeldMovement(&gEventObjects[gPlayerAvatar.eventObjectId], GetFaceDirectionMovementAction(GetOppositeDirection(trainerObj->facingDirection))); task->tFuncId++; return FALSE; } @@ -506,18 +506,18 @@ static bool8 sub_80B4318(u8 taskId, struct Task *task, struct EventObject *train { struct EventObject *playerObj = &gEventObjects[gPlayerAvatar.eventObjectId]; - if (!EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(playerObj) - || EventObjectClearAnimIfSpecialAnimFinished(playerObj)) + if (!EventObjectIsMovementOverridden(playerObj) + || EventObjectClearHeldMovementIfFinished(playerObj)) SwitchTaskToFollowupFunc(taskId); return FALSE; } static bool8 sub_80B435C(u8 taskId, struct Task *task, struct EventObject *trainerObj) { - if (!EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(trainerObj) - || EventObjectClearAnimIfSpecialAnimFinished(trainerObj)) + if (!EventObjectIsMovementOverridden(trainerObj) + || EventObjectClearHeldMovementIfFinished(trainerObj)) { - EventObjectSetSpecialAnim(trainerObj, 0x59); + EventObjectSetHeldMovement(trainerObj, 0x59); task->tFuncId++; } return FALSE; @@ -525,7 +525,7 @@ static bool8 sub_80B435C(u8 taskId, struct Task *task, struct EventObject *train static bool8 sub_80B4390(u8 taskId, struct Task *task, struct EventObject *trainerObj) { - if (EventObjectClearAnimIfSpecialAnimFinished(trainerObj)) + if (EventObjectClearHeldMovementIfFinished(trainerObj)) task->tFuncId = 3; return FALSE; @@ -533,10 +533,10 @@ static bool8 sub_80B4390(u8 taskId, struct Task *task, struct EventObject *train static bool8 sub_80B43AC(u8 taskId, struct Task *task, struct EventObject *trainerObj) { - if (!EventObjectIsSpecialAnimOrDirectionSequenceAnimActive(trainerObj) - || EventObjectClearAnimIfSpecialAnimFinished(trainerObj)) + if (!EventObjectIsMovementOverridden(trainerObj) + || EventObjectClearHeldMovementIfFinished(trainerObj)) { - EventObjectSetSpecialAnim(trainerObj, 0x3E); + EventObjectSetHeldMovement(trainerObj, 0x3E); task->tFuncId++; } return FALSE; @@ -544,7 +544,7 @@ static bool8 sub_80B43AC(u8 taskId, struct Task *task, struct EventObject *train static bool8 sub_80B43E0(u8 taskId, struct Task *task, struct EventObject *trainerObj) { - if (EventObjectCheckIfSpecialAnimFinishedOrInactive(trainerObj)) + if (EventObjectCheckHeldMovementStatus(trainerObj)) { gFieldEffectArguments[0] = trainerObj->currentCoords.x; gFieldEffectArguments[1] = trainerObj->currentCoords.y; @@ -567,8 +567,8 @@ static bool8 sub_80B4438(u8 taskId, struct Task *task, struct EventObject *train sprite = &gSprites[trainerObj->spriteId]; sprite->oam.priority = 2; - EventObjectClearAnimIfSpecialAnimFinished(trainerObj); - EventObjectSetSpecialAnim(trainerObj, sub_80934BC(trainerObj->facingDirection)); + EventObjectClearHeldMovementIfFinished(trainerObj); + EventObjectSetHeldMovement(trainerObj, GetJumpInPlaceMovementAction(trainerObj->facingDirection)); task->tFuncId++; } @@ -597,14 +597,14 @@ static void sub_80B44C8(u8 taskId) LoadWordFromTwoHalfwords(&task->data[1], (u32 *)&eventObj); if (!task->data[7]) { - EventObjectClearAnim(eventObj); + EventObjectClearHeldMovement(eventObj); task->data[7]++; } sTrainerSeeFuncList2[task->data[0]](taskId, task, eventObj); if (task->data[0] == 3 && !FieldEffectActiveListContains(FLDEFF_POP_OUT_OF_ASH)) { - npc_set_running_behaviour_etc(eventObj, npc_running_behaviour_by_direction(eventObj->facingDirection)); - sub_808F23C(eventObj, npc_running_behaviour_by_direction(eventObj->facingDirection)); + SetTrainerMovementType(eventObj, GetTrainerFacingDirectionMovementType(eventObj->facingDirection)); + TryOverrideTemplateCoordsForEventObject(eventObj, GetTrainerFacingDirectionMovementType(eventObj->facingDirection)); DestroyTask(taskId); } else @@ -659,22 +659,22 @@ void sub_80B45D0(void) #define sData4 data[4] #define sFldEffId data[7] -u8 FldEff_ExclamationMarkIcon1(void) +u8 FldEff_ExclamationMarkIcon(void) { u8 spriteId = CreateSpriteAtEnd(&sSpriteTemplate_ExclamationQuestionMark, 0, 0, 0x53); if (spriteId != MAX_SPRITES) - SetIconSpriteData(&gSprites[spriteId], FLDEFF_EXCLAMATION_MARK_ICON_1, 0); + SetIconSpriteData(&gSprites[spriteId], FLDEFF_EXCLAMATION_MARK_ICON, 0); return 0; } -u8 FldEff_ExclamationMarkIcon2(void) +u8 FldEff_QuestionMarkIcon(void) { u8 spriteId = CreateSpriteAtEnd(&sSpriteTemplate_ExclamationQuestionMark, 0, 0, 0x52); if (spriteId != MAX_SPRITES) - SetIconSpriteData(&gSprites[spriteId], FLDEFF_EXCLAMATION_MARK_ICON_2, 1); + SetIconSpriteData(&gSprites[spriteId], FLDEFF_QUESTION_MARK_ICON, 1); return 0; } @@ -764,14 +764,14 @@ void sub_80B4808(void) if (gUnknown_030060AC == 1) { trainerObj = &gEventObjects[gApproachingTrainers[gUnknown_03006080].eventObjectId]; - gUnknown_03006084[0] = GetFaceDirectionAnimId(GetOppositeDirection(trainerObj->facingDirection)); + gUnknown_03006084[0] = GetFaceDirectionMovementAction(GetOppositeDirection(trainerObj->facingDirection)); gUnknown_03006084[1] = 0xFE; ScriptMovement_StartObjectMovementScript(0xFF, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gUnknown_03006084); } else { trainerObj = &gEventObjects[gPlayerAvatar.eventObjectId]; - gUnknown_03006084[0] = GetFaceDirectionAnimId(trainerObj->facingDirection); + gUnknown_03006084[0] = GetFaceDirectionMovementAction(trainerObj->facingDirection); gUnknown_03006084[1] = 0xFE; ScriptMovement_StartObjectMovementScript(0xFF, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gUnknown_03006084); } diff --git a/sym_ewram.txt b/sym_ewram.txt index 17fe48f70..7ea9bef79 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -234,7 +234,7 @@ gUnknown_020375B4: @ 20375B4 gUnknown_020375B6: @ 20375B6 .space 0x2 -gUnknown_020375B8: @ 20375B8 +gLockedAnimEventObjects: @ 20375B8 .space 0x4 .include "src/field_message_box.o"