2018-06-24 07:09:41 -07:00
|
|
|
MovementPointers:
|
2020-07-08 12:30:23 -07:00
|
|
|
; entries correspond to movement_* constants (see macros/scripts/movement.asm)
|
2021-03-11 13:28:52 -08:00
|
|
|
table_width 2, MovementPointers
|
2015-10-29 20:32:11 -07:00
|
|
|
dw Movement_turn_head_down ; 00
|
|
|
|
dw Movement_turn_head_up ; 01
|
|
|
|
dw Movement_turn_head_left ; 02
|
|
|
|
dw Movement_turn_head_right ; 03
|
2015-12-29 10:15:58 -08:00
|
|
|
dw Movement_turn_step_down ; 04
|
|
|
|
dw Movement_turn_step_up ; 05
|
|
|
|
dw Movement_turn_step_left ; 06
|
|
|
|
dw Movement_turn_step_right ; 07
|
2015-10-29 20:32:11 -07:00
|
|
|
dw Movement_slow_step_down ; 08
|
|
|
|
dw Movement_slow_step_up ; 09
|
|
|
|
dw Movement_slow_step_left ; 0a
|
|
|
|
dw Movement_slow_step_right ; 0b
|
|
|
|
dw Movement_step_down ; 0c
|
|
|
|
dw Movement_step_up ; 0d
|
|
|
|
dw Movement_step_left ; 0e
|
|
|
|
dw Movement_step_right ; 0f
|
|
|
|
dw Movement_big_step_down ; 10
|
|
|
|
dw Movement_big_step_up ; 11
|
|
|
|
dw Movement_big_step_left ; 12
|
|
|
|
dw Movement_big_step_right ; 13
|
|
|
|
dw Movement_slow_slide_step_down ; 14
|
|
|
|
dw Movement_slow_slide_step_up ; 15
|
|
|
|
dw Movement_slow_slide_step_left ; 16
|
|
|
|
dw Movement_slow_slide_step_right ; 17
|
|
|
|
dw Movement_slide_step_down ; 18
|
|
|
|
dw Movement_slide_step_up ; 19
|
|
|
|
dw Movement_slide_step_left ; 1a
|
|
|
|
dw Movement_slide_step_right ; 1b
|
|
|
|
dw Movement_fast_slide_step_down ; 1c
|
|
|
|
dw Movement_fast_slide_step_up ; 1d
|
|
|
|
dw Movement_fast_slide_step_left ; 1e
|
|
|
|
dw Movement_fast_slide_step_right ; 1f
|
|
|
|
dw Movement_turn_away_down ; 20
|
|
|
|
dw Movement_turn_away_up ; 21
|
|
|
|
dw Movement_turn_away_left ; 22
|
|
|
|
dw Movement_turn_away_right ; 23
|
|
|
|
dw Movement_turn_in_down ; 24
|
|
|
|
dw Movement_turn_in_up ; 25
|
|
|
|
dw Movement_turn_in_left ; 26
|
|
|
|
dw Movement_turn_in_right ; 27
|
|
|
|
dw Movement_turn_waterfall_down ; 28
|
|
|
|
dw Movement_turn_waterfall_up ; 29
|
|
|
|
dw Movement_turn_waterfall_left ; 2a
|
|
|
|
dw Movement_turn_waterfall_right ; 2b
|
|
|
|
dw Movement_slow_jump_step_down ; 2c
|
|
|
|
dw Movement_slow_jump_step_up ; 2d
|
|
|
|
dw Movement_slow_jump_step_left ; 2e
|
|
|
|
dw Movement_slow_jump_step_right ; 2f
|
|
|
|
dw Movement_jump_step_down ; 30
|
|
|
|
dw Movement_jump_step_up ; 31
|
|
|
|
dw Movement_jump_step_left ; 32
|
|
|
|
dw Movement_jump_step_right ; 33
|
|
|
|
dw Movement_fast_jump_step_down ; 34
|
|
|
|
dw Movement_fast_jump_step_up ; 35
|
|
|
|
dw Movement_fast_jump_step_left ; 36
|
|
|
|
dw Movement_fast_jump_step_right ; 37
|
2016-05-14 09:28:00 -07:00
|
|
|
dw Movement_remove_sliding ; 38
|
|
|
|
dw Movement_set_sliding ; 39
|
2015-10-29 20:32:11 -07:00
|
|
|
dw Movement_remove_fixed_facing ; 3a
|
|
|
|
dw Movement_fix_facing ; 3b
|
2017-12-24 10:46:34 -08:00
|
|
|
dw Movement_show_object ; 3c
|
|
|
|
dw Movement_hide_object ; 3d
|
2015-11-11 20:38:57 -08:00
|
|
|
dw Movement_step_sleep_1 ; 3e
|
|
|
|
dw Movement_step_sleep_2 ; 3f
|
|
|
|
dw Movement_step_sleep_3 ; 40
|
|
|
|
dw Movement_step_sleep_4 ; 41
|
|
|
|
dw Movement_step_sleep_5 ; 42
|
|
|
|
dw Movement_step_sleep_6 ; 43
|
|
|
|
dw Movement_step_sleep_7 ; 44
|
|
|
|
dw Movement_step_sleep_8 ; 45
|
2015-10-29 20:32:11 -07:00
|
|
|
dw Movement_step_sleep ; 46
|
|
|
|
dw Movement_step_end ; 47
|
|
|
|
dw Movement_48 ; 48
|
2017-12-24 10:46:34 -08:00
|
|
|
dw Movement_remove_object ; 49
|
2015-11-11 20:38:57 -08:00
|
|
|
dw Movement_step_loop ; 4a
|
2015-10-29 20:32:11 -07:00
|
|
|
dw Movement_4b ; 4b
|
|
|
|
dw Movement_teleport_from ; 4c
|
|
|
|
dw Movement_teleport_to ; 4d
|
|
|
|
dw Movement_skyfall ; 4e
|
2015-11-15 18:28:15 -08:00
|
|
|
dw Movement_step_dig ; 4f
|
|
|
|
dw Movement_step_bump ; 50
|
2015-11-11 20:38:57 -08:00
|
|
|
dw Movement_fish_got_bite ; 51
|
|
|
|
dw Movement_fish_cast_rod ; 52
|
2015-10-29 20:32:11 -07:00
|
|
|
dw Movement_hide_emote ; 53
|
|
|
|
dw Movement_show_emote ; 54
|
|
|
|
dw Movement_step_shake ; 55
|
2016-05-14 09:28:00 -07:00
|
|
|
dw Movement_tree_shake ; 56
|
2015-11-11 20:38:57 -08:00
|
|
|
dw Movement_rock_smash ; 57
|
2015-11-16 08:53:26 -08:00
|
|
|
dw Movement_return_dig ; 58
|
2016-05-14 09:28:00 -07:00
|
|
|
dw Movement_skyfall_top ; 59
|
2021-03-11 13:28:52 -08:00
|
|
|
assert_table_length NUM_MOVEMENT_CMDS
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_teleport_from:
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-15 18:28:15 -08:00
|
|
|
ld [hl], STEP_TYPE_TELEPORT_FROM
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_teleport_to:
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-15 18:28:15 -08:00
|
|
|
ld [hl], STEP_TYPE_TELEPORT_TO
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_skyfall:
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-15 18:28:15 -08:00
|
|
|
ld [hl], STEP_TYPE_SKYFALL
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_skyfall_top:
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-12-15 08:21:58 -08:00
|
|
|
ld [hl], STEP_TYPE_SKYFALL_TOP
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_dig:
|
2013-07-20 19:34:40 -07:00
|
|
|
call GetSpriteDirection
|
|
|
|
rlca
|
|
|
|
rlca
|
2015-11-15 18:28:15 -08:00
|
|
|
ld hl, OBJECT_STEP_FRAME
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_SPIN
|
2015-12-29 10:15:58 -08:00
|
|
|
call JumpMovementPointer
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_STEP_DURATION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2020-10-22 14:41:48 -07:00
|
|
|
ld [hl], STEP_TYPE_SLEEP
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_WALKING
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-11 20:38:57 -08:00
|
|
|
ld [hl], STANDING
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_return_dig:
|
2013-07-20 19:34:40 -07:00
|
|
|
call GetSpriteDirection
|
|
|
|
rlca
|
|
|
|
rlca
|
2015-11-15 18:28:15 -08:00
|
|
|
ld hl, OBJECT_STEP_FRAME
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-12-29 10:15:58 -08:00
|
|
|
call JumpMovementPointer
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_STEP_DURATION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_WALKING
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-11 20:38:57 -08:00
|
|
|
ld [hl], STANDING
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_RETURN_DIG
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fish_got_bite:
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_FISHING
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_GOT_BITE
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_rock_smash:
|
2015-12-29 10:15:58 -08:00
|
|
|
call JumpMovementPointer
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_STEP_DURATION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_STAND
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_ROCK_SMASH
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fish_cast_rod:
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_FISHING
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2020-10-22 14:41:48 -07:00
|
|
|
ld [hl], STEP_TYPE_FROM_MOVEMENT
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_loop:
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_MOVEMENT_INDEX
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-11-11 20:38:57 -08:00
|
|
|
jp ContinueReadingMovement
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_end:
|
2015-11-02 08:15:32 -08:00
|
|
|
call RestoreDefaultMovement
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_MOVEMENT_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_MOVEMENT_INDEX
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2024-02-10 15:34:46 -08:00
|
|
|
ld hl, wStateFlags
|
2013-07-20 19:34:40 -07:00
|
|
|
res 7, [hl]
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2020-10-22 14:41:48 -07:00
|
|
|
ld [hl], STEP_TYPE_FROM_MOVEMENT
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_48:
|
2015-11-02 08:15:32 -08:00
|
|
|
call RestoreDefaultMovement
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_MOVEMENT_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_MOVEMENT_INDEX
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2015-12-29 10:15:58 -08:00
|
|
|
call JumpMovementPointer
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_STEP_DURATION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2020-10-22 14:41:48 -07:00
|
|
|
ld [hl], STEP_TYPE_SLEEP
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2024-02-10 15:34:46 -08:00
|
|
|
ld hl, wStateFlags
|
2013-07-20 19:34:40 -07:00
|
|
|
res 7, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_remove_object:
|
2015-12-17 12:14:51 -08:00
|
|
|
call DeleteMapObject
|
2015-11-02 08:15:32 -08:00
|
|
|
ld hl, wObjectFollow_Leader
|
2020-12-23 13:54:28 -08:00
|
|
|
ldh a, [hMapObjectIndex]
|
2013-07-20 19:34:40 -07:00
|
|
|
cp [hl]
|
2015-11-11 20:38:57 -08:00
|
|
|
jr nz, .not_leading
|
|
|
|
ld [hl], -1
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2015-11-11 20:38:57 -08:00
|
|
|
.not_leading
|
2024-02-10 15:34:46 -08:00
|
|
|
ld hl, wStateFlags
|
2013-07-20 19:34:40 -07:00
|
|
|
res 7, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_4b:
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_STAND
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2020-10-22 14:41:48 -07:00
|
|
|
ld [hl], STEP_TYPE_STANDING
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2024-02-10 15:34:46 -08:00
|
|
|
ld hl, wStateFlags
|
2013-07-20 19:34:40 -07:00
|
|
|
res 7, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_sleep_1:
|
2015-11-13 15:59:49 -08:00
|
|
|
ld a, 1
|
|
|
|
jr Movement_step_sleep_common
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_sleep_2:
|
2015-11-13 15:59:49 -08:00
|
|
|
ld a, 2
|
|
|
|
jr Movement_step_sleep_common
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_sleep_3:
|
2015-11-13 15:59:49 -08:00
|
|
|
ld a, 3
|
|
|
|
jr Movement_step_sleep_common
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_sleep_4:
|
2015-11-13 15:59:49 -08:00
|
|
|
ld a, 4
|
|
|
|
jr Movement_step_sleep_common
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_sleep_5:
|
2015-11-13 15:59:49 -08:00
|
|
|
ld a, 5
|
|
|
|
jr Movement_step_sleep_common
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_sleep_6:
|
2015-11-13 15:59:49 -08:00
|
|
|
ld a, 6
|
|
|
|
jr Movement_step_sleep_common
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_sleep_7:
|
2015-11-13 15:59:49 -08:00
|
|
|
ld a, 7
|
|
|
|
jr Movement_step_sleep_common
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_sleep_8:
|
2015-11-13 15:59:49 -08:00
|
|
|
ld a, 8
|
|
|
|
jr Movement_step_sleep_common
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_sleep:
|
2013-07-20 19:34:40 -07:00
|
|
|
; parameters:
|
|
|
|
; duration (DecimalParam)
|
|
|
|
|
2015-12-29 10:15:58 -08:00
|
|
|
call JumpMovementPointer
|
2015-11-13 15:59:49 -08:00
|
|
|
jr Movement_step_sleep_common
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_sleep_common:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_STEP_DURATION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2020-10-22 14:41:48 -07:00
|
|
|
ld [hl], STEP_TYPE_SLEEP
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_STAND
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_WALKING
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-11 20:38:57 -08:00
|
|
|
ld [hl], STANDING
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_bump:
|
2015-11-15 18:28:15 -08:00
|
|
|
ld a, 1
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_STEP_DURATION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_BUMP
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_BUMP
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_WALKING
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-11 20:38:57 -08:00
|
|
|
ld [hl], STANDING
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_tree_shake:
|
2015-11-14 20:02:38 -08:00
|
|
|
ld a, 24
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_STEP_DURATION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-14 20:02:38 -08:00
|
|
|
|
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2020-10-22 14:41:48 -07:00
|
|
|
ld [hl], STEP_TYPE_SLEEP
|
2015-11-14 20:02:38 -08:00
|
|
|
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_WEIRD_TREE
|
2015-11-14 20:02:38 -08:00
|
|
|
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_WALKING
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-11 20:38:57 -08:00
|
|
|
ld [hl], STANDING
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_remove_sliding:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_FLAGS1
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2018-05-23 10:15:07 -07:00
|
|
|
res SLIDING_F, [hl]
|
2015-11-11 20:38:57 -08:00
|
|
|
jp ContinueReadingMovement
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_set_sliding:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_FLAGS1
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2018-05-23 10:15:07 -07:00
|
|
|
set SLIDING_F, [hl]
|
2015-11-11 20:38:57 -08:00
|
|
|
jp ContinueReadingMovement
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_remove_fixed_facing:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_FLAGS1
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2018-05-23 10:15:07 -07:00
|
|
|
res FIXED_FACING_F, [hl]
|
2015-11-11 20:38:57 -08:00
|
|
|
jp ContinueReadingMovement
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fix_facing:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_FLAGS1
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2018-05-23 10:15:07 -07:00
|
|
|
set FIXED_FACING_F, [hl]
|
2015-11-11 20:38:57 -08:00
|
|
|
jp ContinueReadingMovement
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_show_object:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_FLAGS1
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2018-05-23 10:15:07 -07:00
|
|
|
res INVISIBLE_F, [hl]
|
2015-11-11 20:38:57 -08:00
|
|
|
jp ContinueReadingMovement
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_hide_object:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_FLAGS1
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2018-05-23 10:15:07 -07:00
|
|
|
set INVISIBLE_F, [hl]
|
2015-11-11 20:38:57 -08:00
|
|
|
jp ContinueReadingMovement
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_hide_emote:
|
2015-11-14 11:41:47 -08:00
|
|
|
call DespawnEmote
|
2015-11-11 20:38:57 -08:00
|
|
|
jp ContinueReadingMovement
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_show_emote:
|
2015-11-14 11:41:47 -08:00
|
|
|
call SpawnEmote
|
2015-11-11 20:38:57 -08:00
|
|
|
jp ContinueReadingMovement
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_shake:
|
2013-07-20 19:34:40 -07:00
|
|
|
; parameters:
|
|
|
|
; displacement (DecimalParam)
|
|
|
|
|
2015-12-29 10:15:58 -08:00
|
|
|
call JumpMovementPointer
|
2015-11-14 11:41:47 -08:00
|
|
|
call ShakeScreen
|
2015-11-11 20:38:57 -08:00
|
|
|
jp ContinueReadingMovement
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_head_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, OW_DOWN
|
|
|
|
jr TurnHead
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_head_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, OW_UP
|
|
|
|
jr TurnHead
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_head_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, OW_LEFT
|
|
|
|
jr TurnHead
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_head_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, OW_RIGHT
|
|
|
|
jr TurnHead
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
TurnHead:
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_DIRECTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-14 20:02:38 -08:00
|
|
|
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_STAND
|
2015-11-14 20:02:38 -08:00
|
|
|
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_WALKING
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-11 20:38:57 -08:00
|
|
|
ld [hl], STANDING
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_step_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | DOWN
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_step_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | UP
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_step_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | LEFT
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_step_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | RIGHT
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | DOWN
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | UP
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | LEFT
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_step_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | RIGHT
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_big_step_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | DOWN
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_big_step_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | UP
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_big_step_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | LEFT
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_big_step_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | RIGHT
|
|
|
|
jp NormalStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_away_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | DOWN
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_away_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | UP
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_away_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | LEFT
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_away_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | RIGHT
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_in_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | DOWN
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_in_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | UP
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_in_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | LEFT
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_in_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | RIGHT
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_waterfall_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | DOWN
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_waterfall_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | UP
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_waterfall_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | LEFT
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_waterfall_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | RIGHT
|
|
|
|
jp TurningStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_slide_step_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | DOWN
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_slide_step_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | UP
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_slide_step_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | LEFT
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_slide_step_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | RIGHT
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slide_step_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | DOWN
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slide_step_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | UP
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slide_step_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | LEFT
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slide_step_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | RIGHT
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fast_slide_step_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | DOWN
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fast_slide_step_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | UP
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fast_slide_step_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | LEFT
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fast_slide_step_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | RIGHT
|
|
|
|
jp SlideStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_jump_step_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | DOWN
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_jump_step_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | UP
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_jump_step_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | LEFT
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_slow_jump_step_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_SLOW << 2 | RIGHT
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_jump_step_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | DOWN
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_jump_step_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | UP
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_jump_step_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | LEFT
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_jump_step_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_WALK << 2 | RIGHT
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fast_jump_step_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | DOWN
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fast_jump_step_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | UP
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fast_jump_step_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | LEFT
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_fast_jump_step_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, STEP_BIKE << 2 | RIGHT
|
|
|
|
jp JumpStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_step_down:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, OW_DOWN
|
2015-12-29 10:15:58 -08:00
|
|
|
jr TurnStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_step_up:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, OW_UP
|
2015-12-29 10:15:58 -08:00
|
|
|
jr TurnStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_step_left:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, OW_LEFT
|
2015-12-29 10:15:58 -08:00
|
|
|
jr TurnStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Movement_turn_step_right:
|
2015-10-29 20:32:11 -07:00
|
|
|
ld a, OW_RIGHT
|
2015-12-29 10:15:58 -08:00
|
|
|
jr TurnStep
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
TurnStep:
|
2017-12-29 07:19:51 -08:00
|
|
|
ld hl, OBJECT_1D ; new facing
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
2015-11-14 20:02:38 -08:00
|
|
|
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_STEP
|
2015-11-14 20:02:38 -08:00
|
|
|
|
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2020-10-22 14:41:48 -07:00
|
|
|
ld [hl], STEP_TYPE_TURN
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
NormalStep:
|
2015-12-17 12:14:51 -08:00
|
|
|
call InitStep
|
|
|
|
call UpdateTallGrassFlags
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_STEP
|
2015-11-14 20:02:38 -08:00
|
|
|
|
2024-02-10 15:25:25 -08:00
|
|
|
ld hl, OBJECT_TILE_COLLISION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-07-23 00:41:52 -07:00
|
|
|
call CheckSuperTallGrassTile
|
2015-11-14 20:02:38 -08:00
|
|
|
jr z, .shake_grass
|
2013-12-23 01:39:26 -08:00
|
|
|
|
2015-11-15 11:59:38 -08:00
|
|
|
call CheckGrassTile
|
2015-11-14 20:02:38 -08:00
|
|
|
jr c, .skip_grass
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
.shake_grass
|
2015-11-14 11:41:47 -08:00
|
|
|
call ShakeGrass
|
2013-07-20 19:34:40 -07:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
.skip_grass
|
2015-11-16 08:53:26 -08:00
|
|
|
ld hl, wCenteredObject
|
2020-12-23 13:54:28 -08:00
|
|
|
ldh a, [hMapObjectIndex]
|
2013-07-20 19:34:40 -07:00
|
|
|
cp [hl]
|
2015-11-16 08:53:26 -08:00
|
|
|
jr z, .player
|
2013-12-23 01:39:26 -08:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_NPC_WALK
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2015-11-16 08:53:26 -08:00
|
|
|
.player
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_PLAYER_WALK
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
TurningStep:
|
2015-12-17 12:14:51 -08:00
|
|
|
call InitStep
|
|
|
|
call UpdateTallGrassFlags
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_SPIN
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-16 08:53:26 -08:00
|
|
|
ld hl, wCenteredObject
|
2020-12-23 13:54:28 -08:00
|
|
|
ldh a, [hMapObjectIndex]
|
2013-07-20 19:34:40 -07:00
|
|
|
cp [hl]
|
2015-11-16 08:53:26 -08:00
|
|
|
jr z, .player
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_NPC_WALK
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2015-11-16 08:53:26 -08:00
|
|
|
.player
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_PLAYER_WALK
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
SlideStep:
|
2015-12-17 12:14:51 -08:00
|
|
|
call InitStep
|
|
|
|
call UpdateTallGrassFlags
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_STAND
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-16 08:53:26 -08:00
|
|
|
ld hl, wCenteredObject
|
2020-12-23 13:54:28 -08:00
|
|
|
ldh a, [hMapObjectIndex]
|
2013-07-20 19:34:40 -07:00
|
|
|
cp [hl]
|
2015-11-16 08:53:26 -08:00
|
|
|
jr z, .player
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_NPC_WALK
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2015-11-16 08:53:26 -08:00
|
|
|
.player
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_PLAYER_WALK
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
JumpStep:
|
2015-12-17 12:14:51 -08:00
|
|
|
call InitStep
|
2022-09-12 06:15:44 -07:00
|
|
|
ld hl, OBJECT_JUMP_HEIGHT
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-10-29 20:32:11 -07:00
|
|
|
ld hl, OBJECT_FLAGS2
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2018-05-23 10:15:07 -07:00
|
|
|
res OVERHEAD_F, [hl]
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-14 11:41:47 -08:00
|
|
|
ld hl, OBJECT_ACTION
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2017-12-24 10:46:34 -08:00
|
|
|
ld [hl], OBJECT_ACTION_STEP
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-14 11:41:47 -08:00
|
|
|
call SpawnShadow
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-16 08:53:26 -08:00
|
|
|
ld hl, wCenteredObject
|
2020-12-23 13:54:28 -08:00
|
|
|
ldh a, [hMapObjectIndex]
|
2013-07-20 19:34:40 -07:00
|
|
|
cp [hl]
|
2015-11-16 08:53:26 -08:00
|
|
|
jr z, .player
|
2015-11-15 18:28:15 -08:00
|
|
|
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_NPC_JUMP
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|
|
|
|
|
2015-11-16 08:53:26 -08:00
|
|
|
.player
|
2015-11-14 20:02:38 -08:00
|
|
|
ld hl, OBJECT_STEP_TYPE
|
2013-07-20 19:34:40 -07:00
|
|
|
add hl, bc
|
2015-11-16 08:53:26 -08:00
|
|
|
ld [hl], STEP_TYPE_PLAYER_JUMP
|
2013-07-20 19:34:40 -07:00
|
|
|
ret
|