mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Movement etc.
This commit is contained in:
parent
efee40447e
commit
caa83c08a7
@ -269,7 +269,7 @@ MAX_OUTDOOR_SPRITES EQU 23
|
|||||||
|
|
||||||
const_def
|
const_def
|
||||||
const STEP_TYPE_00
|
const STEP_TYPE_00
|
||||||
const STEP_TYPE_STANDING
|
const STEP_TYPE_SLEEP
|
||||||
const STEP_TYPE_NPC_WALK
|
const STEP_TYPE_NPC_WALK
|
||||||
const STEP_TYPE_03
|
const STEP_TYPE_03
|
||||||
const STEP_TYPE_04
|
const STEP_TYPE_04
|
||||||
@ -287,7 +287,7 @@ MAX_OUTDOOR_SPRITES EQU 23
|
|||||||
const STEP_TYPE_GOT_BITE
|
const STEP_TYPE_GOT_BITE
|
||||||
const STEP_TYPE_ROCK_SMASH
|
const STEP_TYPE_ROCK_SMASH
|
||||||
const STEP_TYPE_RETURN_DIG
|
const STEP_TYPE_RETURN_DIG
|
||||||
const STEP_TYPE_13
|
const STEP_TYPE_TRACKING_OBJECT
|
||||||
const STEP_TYPE_14
|
const STEP_TYPE_14
|
||||||
const STEP_TYPE_15
|
const STEP_TYPE_15
|
||||||
const STEP_TYPE_16
|
const STEP_TYPE_16
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
INCLUDE "includes.asm"
|
INCLUDE "includes.asm"
|
||||||
|
|
||||||
|
|
||||||
SECTION "Events", ROMX, BANK[EVENTS]
|
SECTION "Events", ROMX, BANK[EVENTS]
|
||||||
|
|
||||||
OverworldLoop:: ; 966b0
|
OverworldLoop:: ; 966b0
|
||||||
@ -23,7 +22,6 @@ OverworldLoop:: ; 966b0
|
|||||||
dw .done
|
dw .done
|
||||||
; 966cb
|
; 966cb
|
||||||
|
|
||||||
|
|
||||||
DisableEvents: ; 966cb
|
DisableEvents: ; 966cb
|
||||||
xor a
|
xor a
|
||||||
ld [ScriptFlags3], a
|
ld [ScriptFlags3], a
|
||||||
@ -114,21 +112,16 @@ CheckWildEncountersScriptFlag: ; 9671e
|
|||||||
ret
|
ret
|
||||||
; 96724
|
; 96724
|
||||||
|
|
||||||
|
|
||||||
StartMap: ; 96724
|
StartMap: ; 96724
|
||||||
xor a
|
xor a
|
||||||
ld [ScriptVar], a
|
ld [ScriptVar], a
|
||||||
xor a
|
xor a
|
||||||
ld [ScriptRunning], a
|
ld [ScriptRunning], a
|
||||||
ld hl, MapStatus
|
ld hl, MapStatus
|
||||||
ld bc, $3e ; 62
|
ld bc, wMapStatusEnd - MapStatus
|
||||||
call ByteFill
|
call ByteFill
|
||||||
callba InitCallReceiveDelay
|
callba InitCallReceiveDelay
|
||||||
call ClearJoypad
|
call ClearJoypad
|
||||||
; fallthrough
|
|
||||||
; 9673e
|
|
||||||
|
|
||||||
|
|
||||||
EnterMap: ; 9673e
|
EnterMap: ; 9673e
|
||||||
xor a
|
xor a
|
||||||
ld [wd453], a
|
ld [wd453], a
|
||||||
@ -157,17 +150,15 @@ EnterMap: ; 9673e
|
|||||||
ret
|
ret
|
||||||
; 9676d
|
; 9676d
|
||||||
|
|
||||||
|
UnusedWait30Frames: ; 9676d
|
||||||
Function9676d: ; 9676d
|
|
||||||
ld c, 30
|
ld c, 30
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ret
|
ret
|
||||||
; 96773
|
; 96773
|
||||||
|
|
||||||
|
|
||||||
HandleMap: ; 96773
|
HandleMap: ; 96773
|
||||||
call ResetOverworldDelay
|
call ResetOverworldDelay
|
||||||
call Function967c1
|
call HandleMapTimeAndJoypad
|
||||||
callba HandleCmdQueue ; no need to farcall
|
callba HandleCmdQueue ; no need to farcall
|
||||||
call MapEvents
|
call MapEvents
|
||||||
|
|
||||||
@ -183,7 +174,6 @@ HandleMap: ; 96773
|
|||||||
ret
|
ret
|
||||||
; 96795
|
; 96795
|
||||||
|
|
||||||
|
|
||||||
MapEvents: ; 96795
|
MapEvents: ; 96795
|
||||||
ld a, [MapEventStatus]
|
ld a, [MapEventStatus]
|
||||||
ld hl, .jumps
|
ld hl, .jumps
|
||||||
@ -206,7 +196,6 @@ MapEvents: ; 96795
|
|||||||
ret
|
ret
|
||||||
; 967af
|
; 967af
|
||||||
|
|
||||||
|
|
||||||
MaxOverworldDelay: ; 967af
|
MaxOverworldDelay: ; 967af
|
||||||
db 2
|
db 2
|
||||||
; 967b0
|
; 967b0
|
||||||
@ -226,7 +215,7 @@ NextOverworldFrame: ; 967b7
|
|||||||
ret
|
ret
|
||||||
; 967c1
|
; 967c1
|
||||||
|
|
||||||
Function967c1: ; 967c1
|
HandleMapTimeAndJoypad: ; 967c1
|
||||||
ld a, [MapEventStatus]
|
ld a, [MapEventStatus]
|
||||||
cp 1 ; no events
|
cp 1 ; no events
|
||||||
ret z
|
ret z
|
||||||
@ -281,7 +270,6 @@ Function96812: ; 96812
|
|||||||
ret
|
ret
|
||||||
; 9681f
|
; 9681f
|
||||||
|
|
||||||
|
|
||||||
PlayerEvents: ; 9681f
|
PlayerEvents: ; 9681f
|
||||||
|
|
||||||
xor a
|
xor a
|
||||||
@ -313,7 +301,6 @@ PlayerEvents: ; 9681f
|
|||||||
xor a
|
xor a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
.ok
|
.ok
|
||||||
push af
|
push af
|
||||||
callba EnableScriptMode
|
callba EnableScriptMode
|
||||||
@ -335,7 +322,6 @@ PlayerEvents: ; 9681f
|
|||||||
ret
|
ret
|
||||||
; 96867
|
; 96867
|
||||||
|
|
||||||
|
|
||||||
CheckTrainerBattle3: ; 96867
|
CheckTrainerBattle3: ; 96867
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
@ -351,7 +337,6 @@ CheckTrainerBattle3: ; 96867
|
|||||||
ret
|
ret
|
||||||
; 96874
|
; 96874
|
||||||
|
|
||||||
|
|
||||||
CheckTileEvent: ; 96874
|
CheckTileEvent: ; 96874
|
||||||
; Check for warps, tile triggers or wild battles.
|
; Check for warps, tile triggers or wild battles.
|
||||||
|
|
||||||
@ -418,7 +403,6 @@ CheckTileEvent: ; 96874
|
|||||||
ret
|
ret
|
||||||
; 968c7
|
; 968c7
|
||||||
|
|
||||||
|
|
||||||
CheckWildEncounterCooldown:: ; 968c7
|
CheckWildEncounterCooldown:: ; 968c7
|
||||||
ld hl, wWildEncounterCooldown
|
ld hl, wWildEncounterCooldown
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
@ -543,7 +527,6 @@ CheckTimeEvents: ; 9693a
|
|||||||
ret
|
ret
|
||||||
; 96974
|
; 96974
|
||||||
|
|
||||||
|
|
||||||
OWPlayerInput: ; 96974
|
OWPlayerInput: ; 96974
|
||||||
|
|
||||||
call PlayerMovement
|
call PlayerMovement
|
||||||
@ -573,7 +556,6 @@ OWPlayerInput: ; 96974
|
|||||||
ret
|
ret
|
||||||
; 96999
|
; 96999
|
||||||
|
|
||||||
|
|
||||||
CheckAPressOW: ; 96999
|
CheckAPressOW: ; 96999
|
||||||
ld a, [hJoyPressed]
|
ld a, [hJoyPressed]
|
||||||
and A_BUTTON
|
and A_BUTTON
|
||||||
@ -588,7 +570,6 @@ CheckAPressOW: ; 96999
|
|||||||
ret
|
ret
|
||||||
; 969ac
|
; 969ac
|
||||||
|
|
||||||
|
|
||||||
PlayTalkObject: ; 969ac
|
PlayTalkObject: ; 969ac
|
||||||
push de
|
push de
|
||||||
ld de, SFX_READ_TEXT_2
|
ld de, SFX_READ_TEXT_2
|
||||||
@ -597,7 +578,6 @@ PlayTalkObject: ; 969ac
|
|||||||
ret
|
ret
|
||||||
; 969b5
|
; 969b5
|
||||||
|
|
||||||
|
|
||||||
TryObjectEvent: ; 969b5
|
TryObjectEvent: ; 969b5
|
||||||
callba CheckFacingObject
|
callba CheckFacingObject
|
||||||
jr c, .IsObject
|
jr c, .IsObject
|
||||||
@ -704,7 +684,6 @@ TryObjectEvent: ; 969b5
|
|||||||
ret
|
ret
|
||||||
; 96a38
|
; 96a38
|
||||||
|
|
||||||
|
|
||||||
TryReadSign: ; 96a38
|
TryReadSign: ; 96a38
|
||||||
call CheckFacingSign
|
call CheckFacingSign
|
||||||
jr c, .IsSign
|
jr c, .IsSign
|
||||||
@ -810,7 +789,6 @@ endr
|
|||||||
ret
|
ret
|
||||||
; 96ad8
|
; 96ad8
|
||||||
|
|
||||||
|
|
||||||
CheckSignFlag: ; 96ad8
|
CheckSignFlag: ; 96ad8
|
||||||
ld hl, EngineBuffer4
|
ld hl, EngineBuffer4
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
@ -829,7 +807,6 @@ CheckSignFlag: ; 96ad8
|
|||||||
ret
|
ret
|
||||||
; 96af0
|
; 96af0
|
||||||
|
|
||||||
|
|
||||||
PlayerMovement: ; 96af0
|
PlayerMovement: ; 96af0
|
||||||
callba DoPlayerMovement
|
callba DoPlayerMovement
|
||||||
ld a, c
|
ld a, c
|
||||||
@ -896,7 +873,6 @@ PlayerMovement: ; 96af0
|
|||||||
ret
|
ret
|
||||||
; 96b30
|
; 96b30
|
||||||
|
|
||||||
|
|
||||||
CheckMenuOW: ; 96b30
|
CheckMenuOW: ; 96b30
|
||||||
xor a
|
xor a
|
||||||
ld [hMenuReturn], a
|
ld [hMenuReturn], a
|
||||||
@ -928,7 +904,6 @@ CheckMenuOW: ; 96b30
|
|||||||
ret
|
ret
|
||||||
; 96b58
|
; 96b58
|
||||||
|
|
||||||
|
|
||||||
StartMenuScript: ; 96b58
|
StartMenuScript: ; 96b58
|
||||||
callasm StartMenu
|
callasm StartMenu
|
||||||
jump StartMenuCallback
|
jump StartMenuCallback
|
||||||
@ -956,7 +931,6 @@ SelectMenuCallback: ; 96b66
|
|||||||
end
|
end
|
||||||
; 96b79
|
; 96b79
|
||||||
|
|
||||||
|
|
||||||
CountStep: ; 96b79
|
CountStep: ; 96b79
|
||||||
; Don't count steps in link communication rooms.
|
; Don't count steps in link communication rooms.
|
||||||
ld a, [wLinkMode]
|
ld a, [wLinkMode]
|
||||||
@ -1024,7 +998,6 @@ CountStep: ; 96b79
|
|||||||
ret
|
ret
|
||||||
; 96bd3
|
; 96bd3
|
||||||
|
|
||||||
|
|
||||||
.unreferenced: ; 96bd3
|
.unreferenced: ; 96bd3
|
||||||
ld a, 7
|
ld a, 7
|
||||||
scf
|
scf
|
||||||
|
@ -49,7 +49,7 @@ sprite_movement_data: macro
|
|||||||
; 4357
|
; 4357
|
||||||
|
|
||||||
|
|
||||||
Function4357:: ; 4357
|
DeleteMapObject:: ; 4357
|
||||||
push bc
|
push bc
|
||||||
ld hl, OBJECT_MAP_OBJECT_INDEX
|
ld hl, OBJECT_MAP_OBJECT_INDEX
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@ -76,14 +76,14 @@ Function4357:: ; 4357
|
|||||||
; 437b
|
; 437b
|
||||||
|
|
||||||
Function437b: ; 437b
|
Function437b: ; 437b
|
||||||
call Function4386
|
call .CheckObjectStillVisible
|
||||||
ret c
|
ret c
|
||||||
call Function43f3
|
call Function43f3
|
||||||
call Function4427
|
call Function4427
|
||||||
ret
|
ret
|
||||||
; 4386
|
; 4386
|
||||||
|
|
||||||
Function4386: ; 4386
|
.CheckObjectStillVisible: ; 4386
|
||||||
ld hl, OBJECT_FLAGS2
|
ld hl, OBJECT_FLAGS2
|
||||||
add hl, bc
|
add hl, bc
|
||||||
res 6, [hl]
|
res 6, [hl]
|
||||||
@ -143,7 +143,7 @@ Function4386: ; 4386
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
bit 1, [hl]
|
bit 1, [hl]
|
||||||
jr nz, .yes2
|
jr nz, .yes2
|
||||||
call Function4357
|
call DeleteMapObject
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -167,26 +167,26 @@ Function43f3: ; 43f3
|
|||||||
bit 5, [hl]
|
bit 5, [hl]
|
||||||
jr nz, .bit5
|
jr nz, .bit5
|
||||||
|
|
||||||
cp STEP_TYPE_STANDING
|
cp STEP_TYPE_SLEEP
|
||||||
jr z, .one
|
jr z, .one
|
||||||
jr .ok
|
jr .ok
|
||||||
|
|
||||||
.zero
|
.zero
|
||||||
call Function47bc
|
call ObjectMovementReset
|
||||||
ld hl, OBJECT_FLAGS2
|
ld hl, OBJECT_FLAGS2
|
||||||
add hl, bc
|
add hl, bc
|
||||||
bit 5, [hl]
|
bit 5, [hl]
|
||||||
jr nz, .bit5
|
jr nz, .bit5
|
||||||
|
|
||||||
.one
|
.one
|
||||||
call Function47dd
|
call MapObjectMovementPattern
|
||||||
|
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
cp STEP_TYPE_STANDING
|
cp STEP_TYPE_SLEEP
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
.ok
|
.ok
|
||||||
@ -553,7 +553,7 @@ Function45ed: ; 45ed
|
|||||||
ret
|
ret
|
||||||
; 4600
|
; 4600
|
||||||
|
|
||||||
Function4600: ; 4600
|
CopyNextCoordsTileToStandingCoordsTile: ; 4600
|
||||||
|
|
||||||
ld hl, OBJECT_NEXT_MAP_X
|
ld hl, OBJECT_NEXT_MAP_X
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@ -604,7 +604,7 @@ Function462a: ; 462a
|
|||||||
ret
|
ret
|
||||||
; 463f
|
; 463f
|
||||||
|
|
||||||
Function463f: ; 463f
|
UpdateTallGrassFlags: ; 463f
|
||||||
ld hl, OBJECT_FLAGS2
|
ld hl, OBJECT_FLAGS2
|
||||||
add hl, bc
|
add hl, bc
|
||||||
bit 3, [hl] ; is current tile grass?
|
bit 3, [hl] ; is current tile grass?
|
||||||
@ -651,7 +651,7 @@ UselessAndA: ; 4679
|
|||||||
ret
|
ret
|
||||||
; 467b
|
; 467b
|
||||||
|
|
||||||
Function467b: ; 467b
|
EndSpriteMovement: ; 467b
|
||||||
xor a
|
xor a
|
||||||
ld hl, OBJECT_STEP_FRAME
|
ld hl, OBJECT_STEP_FRAME
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@ -668,7 +668,7 @@ endr
|
|||||||
ret
|
ret
|
||||||
; 4690
|
; 4690
|
||||||
|
|
||||||
Function4690: ; 4690
|
InitStep: ; 4690
|
||||||
ld hl, OBJECT_DIRECTION_WALKING
|
ld hl, OBJECT_DIRECTION_WALKING
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
@ -676,7 +676,6 @@ Function4690: ; 4690
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
bit FIXED_FACING, [hl]
|
bit FIXED_FACING, [hl]
|
||||||
jr nz, GetNextTile
|
jr nz, GetNextTile
|
||||||
|
|
||||||
rept 2
|
rept 2
|
||||||
add a
|
add a
|
||||||
endr
|
endr
|
||||||
@ -684,7 +683,6 @@ endr
|
|||||||
ld hl, OBJECT_FACING
|
ld hl, OBJECT_FACING
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
|
|
||||||
GetNextTile: ; 46a6
|
GetNextTile: ; 46a6
|
||||||
call GetStepVector
|
call GetStepVector
|
||||||
|
|
||||||
@ -794,7 +792,7 @@ GetStepVectorSign: ; 4730
|
|||||||
ret ; 129 - 255
|
ret ; 129 - 255
|
||||||
; 4738
|
; 4738
|
||||||
|
|
||||||
Function4738: ; 4738
|
UpdatePlayerStep: ; 4738
|
||||||
ld hl, OBJECT_DIRECTION_WALKING
|
ld hl, OBJECT_DIRECTION_WALKING
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
@ -913,7 +911,7 @@ SetValueObjectStructField28: ; 47b6
|
|||||||
ret
|
ret
|
||||||
; 47bc
|
; 47bc
|
||||||
|
|
||||||
Function47bc: ; 47bc
|
ObjectMovementReset: ; 47bc
|
||||||
ld hl, OBJECT_NEXT_MAP_X
|
ld hl, OBJECT_NEXT_MAP_X
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld d, [hl]
|
ld d, [hl]
|
||||||
@ -926,15 +924,15 @@ Function47bc: ; 47bc
|
|||||||
ld hl, OBJECT_NEXT_TILE
|
ld hl, OBJECT_NEXT_TILE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
call Function4600
|
call CopyNextCoordsTileToStandingCoordsTile
|
||||||
call Function467b
|
call EndSpriteMovement
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 47dd
|
; 47dd
|
||||||
|
|
||||||
Function47dd: ; 47dd
|
MapObjectMovementPattern: ; 47dd
|
||||||
call ClearObjectStructField28
|
call ClearObjectStructField28
|
||||||
call GetSpriteMovementFunction
|
call GetSpriteMovementFunction
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
@ -944,34 +942,35 @@ Function47dd: ; 47dd
|
|||||||
; 47e9
|
; 47e9
|
||||||
|
|
||||||
.Pointers ; 47e9
|
.Pointers ; 47e9
|
||||||
dw .Null_00 ; 00
|
jumptable_start
|
||||||
dw .RandomWalkY ; 01
|
jumptable .Null_00 ; 00
|
||||||
dw .RandomWalkX ; 02
|
jumptable .RandomWalkY ; 01
|
||||||
dw .RandomWalkXY ; 03
|
jumptable .RandomWalkX ; 02
|
||||||
dw .RandomSpin1 ; 04
|
jumptable .RandomWalkXY ; 03
|
||||||
dw .RandomSpin2 ; 05
|
jumptable .RandomSpin1 ; 04
|
||||||
dw .Standing ; 06
|
jumptable .RandomSpin2 ; 05
|
||||||
dw .ObeyDPad ; 07
|
jumptable .Standing ; 06
|
||||||
dw .Movement08 ; 08
|
jumptable .ObeyDPad ; 07
|
||||||
dw .Movement09 ; 09
|
jumptable .Movement08 ; 08
|
||||||
dw .Movement0a ; 0a
|
jumptable .Movement09 ; 09
|
||||||
dw .Movement0b ; 0b
|
jumptable .Movement0a ; 0a
|
||||||
dw .Movement0c ; 0c
|
jumptable .Movement0b ; 0b
|
||||||
dw .Movement0d ; 0d
|
jumptable .Movement0c ; 0c
|
||||||
dw .Movement0e ; 0e
|
jumptable .Movement0d ; 0d
|
||||||
dw .Follow ; 0f
|
jumptable .Movement0e ; 0e
|
||||||
dw .Script ; 10
|
jumptable .Follow ; 0f
|
||||||
dw .Strength ; 11
|
jumptable .Script ; 10
|
||||||
dw .FollowNotExact ; 12
|
jumptable .Strength ; 11
|
||||||
dw .MovementShadow ; 13
|
jumptable .FollowNotExact ; 12
|
||||||
dw .MovementEmote ; 14
|
jumptable .MovementShadow ; 13
|
||||||
dw .MovementBigStanding ; 15
|
jumptable .MovementEmote ; 14
|
||||||
dw .MovementBouncing ; 16
|
jumptable .MovementBigStanding ; 15
|
||||||
dw .MovementScreenShake ; 17
|
jumptable .MovementBouncing ; 16
|
||||||
dw .MovementSpinClockwise ; 18
|
jumptable .MovementScreenShake ; 17
|
||||||
dw .MovementSpinCounterclockwise ; 19
|
jumptable .MovementSpinClockwise ; 18
|
||||||
dw .MovementBoulderDust ; 1a
|
jumptable .MovementSpinCounterclockwise ; 19
|
||||||
dw .MovementShakingGrass ; 1b
|
jumptable .MovementBoulderDust ; 1a
|
||||||
|
jumptable .MovementShakingGrass ; 1b
|
||||||
; 4821
|
; 4821
|
||||||
|
|
||||||
.Null_00: ; 4821
|
.Null_00: ; 4821
|
||||||
@ -1030,7 +1029,7 @@ Function47dd: ; 47dd
|
|||||||
|
|
||||||
.Standing: ; 4869
|
.Standing: ; 4869
|
||||||
call Function462a
|
call Function462a
|
||||||
call Function467b
|
call EndSpriteMovement
|
||||||
ld hl, OBJECT_ACTION
|
ld hl, OBJECT_ACTION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], PERSON_ACTION_STAND
|
ld [hl], PERSON_ACTION_STAND
|
||||||
@ -1110,14 +1109,14 @@ Function47dd: ; 47dd
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and %00000011
|
and %00000011
|
||||||
or 0
|
or 0
|
||||||
call Function4690
|
call InitStep
|
||||||
call Function6ec1
|
call Function6ec1
|
||||||
jr c, .ok2
|
jr c, .ok2
|
||||||
|
|
||||||
ld de, SFX_STRENGTH
|
ld de, SFX_STRENGTH
|
||||||
call PlaySFX
|
call PlaySFX
|
||||||
call SpawnStrengthBoulderDust
|
call SpawnStrengthBoulderDust
|
||||||
call Function463f
|
call UpdateTallGrassFlags
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_0F
|
ld [hl], STEP_TYPE_0F
|
||||||
@ -1211,7 +1210,7 @@ Function47dd: ; 47dd
|
|||||||
; 4958
|
; 4958
|
||||||
|
|
||||||
.MovementBigStanding: ; 4958
|
.MovementBigStanding: ; 4958
|
||||||
call Function467b
|
call EndSpriteMovement
|
||||||
ld hl, OBJECT_DIRECTION_WALKING
|
ld hl, OBJECT_DIRECTION_WALKING
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STANDING
|
ld [hl], STANDING
|
||||||
@ -1225,7 +1224,7 @@ Function47dd: ; 47dd
|
|||||||
; 496e
|
; 496e
|
||||||
|
|
||||||
.MovementBouncing: ; 496e
|
.MovementBouncing: ; 496e
|
||||||
call Function467b
|
call EndSpriteMovement
|
||||||
ld hl, OBJECT_DIRECTION_WALKING
|
ld hl, OBJECT_DIRECTION_WALKING
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STANDING
|
ld [hl], STANDING
|
||||||
@ -1253,7 +1252,7 @@ Function47dd: ; 47dd
|
|||||||
; 4996
|
; 4996
|
||||||
|
|
||||||
.MovementSpinInit: ; 4996
|
.MovementSpinInit: ; 4996
|
||||||
call Function467b
|
call EndSpriteMovement
|
||||||
call IncrementObjectMovementByteIndex
|
call IncrementObjectMovementByteIndex
|
||||||
.MovementSpinRepeat: ; 499c
|
.MovementSpinRepeat: ; 499c
|
||||||
ld hl, OBJECT_ACTION
|
ld hl, OBJECT_ACTION
|
||||||
@ -1329,12 +1328,12 @@ Function47dd: ; 47dd
|
|||||||
add hl, de
|
add hl, de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and 3
|
and 3
|
||||||
ld d, $e
|
ld d, 1 * 8 + 6
|
||||||
cp DOWN
|
cp DOWN
|
||||||
jr z, .ok_13
|
jr z, .ok_13
|
||||||
cp UP
|
cp UP
|
||||||
jr z, .ok_13
|
jr z, .ok_13
|
||||||
ld d, $c
|
ld d, 1 * 8 + 4
|
||||||
|
|
||||||
.ok_13
|
.ok_13
|
||||||
ld hl, OBJECT_SPRITE_Y_OFFSET
|
ld hl, OBJECT_SPRITE_Y_OFFSET
|
||||||
@ -1345,12 +1344,12 @@ Function47dd: ; 47dd
|
|||||||
ld [hl], 0
|
ld [hl], 0
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_13
|
ld [hl], STEP_TYPE_TRACKING_OBJECT
|
||||||
ret
|
ret
|
||||||
; 4a21
|
; 4a21
|
||||||
|
|
||||||
.MovementEmote: ; 4a21
|
.MovementEmote: ; 4a21
|
||||||
call Function467b
|
call EndSpriteMovement
|
||||||
call ._MovementShadow_Grass_Emote_BoulderDust
|
call ._MovementShadow_Grass_Emote_BoulderDust
|
||||||
ld hl, OBJECT_ACTION
|
ld hl, OBJECT_ACTION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@ -1360,18 +1359,18 @@ Function47dd: ; 47dd
|
|||||||
ld [hl], 0
|
ld [hl], 0
|
||||||
ld hl, OBJECT_SPRITE_Y_OFFSET
|
ld hl, OBJECT_SPRITE_Y_OFFSET
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], -$10
|
ld [hl], -2 * 8
|
||||||
ld hl, OBJECT_SPRITE_X_OFFSET
|
ld hl, OBJECT_SPRITE_X_OFFSET
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], 0
|
ld [hl], 0
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_13
|
ld [hl], STEP_TYPE_TRACKING_OBJECT
|
||||||
ret
|
ret
|
||||||
; 4a46
|
; 4a46
|
||||||
|
|
||||||
.MovementBoulderDust: ; 4a46
|
.MovementBoulderDust: ; 4a46
|
||||||
call Function467b
|
call EndSpriteMovement
|
||||||
call ._MovementShadow_Grass_Emote_BoulderDust
|
call ._MovementShadow_Grass_Emote_BoulderDust
|
||||||
ld hl, OBJECT_ACTION
|
ld hl, OBJECT_ACTION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@ -1405,7 +1404,7 @@ endr
|
|||||||
ld [hl], e
|
ld [hl], e
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_13
|
ld [hl], STEP_TYPE_TRACKING_OBJECT
|
||||||
ret
|
ret
|
||||||
; 4a81
|
; 4a81
|
||||||
|
|
||||||
@ -1418,7 +1417,7 @@ endr
|
|||||||
; 4a89
|
; 4a89
|
||||||
|
|
||||||
.MovementShakingGrass: ; 4a89
|
.MovementShakingGrass: ; 4a89
|
||||||
call Function467b
|
call EndSpriteMovement
|
||||||
call ._MovementShadow_Grass_Emote_BoulderDust
|
call ._MovementShadow_Grass_Emote_BoulderDust
|
||||||
ld hl, OBJECT_ACTION
|
ld hl, OBJECT_ACTION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@ -1432,7 +1431,7 @@ endr
|
|||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_13
|
ld [hl], STEP_TYPE_TRACKING_OBJECT
|
||||||
ret
|
ret
|
||||||
; 4aa8
|
; 4aa8
|
||||||
|
|
||||||
@ -1454,7 +1453,7 @@ endr
|
|||||||
; 4abc
|
; 4abc
|
||||||
|
|
||||||
.MovementScreenShake: ; 4abc
|
.MovementScreenShake: ; 4abc
|
||||||
call Function467b
|
call EndSpriteMovement
|
||||||
ld hl, OBJECT_ACTION
|
ld hl, OBJECT_ACTION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], PERSON_ACTION_00
|
ld [hl], PERSON_ACTION_00
|
||||||
@ -1493,11 +1492,11 @@ endr
|
|||||||
; 4af0
|
; 4af0
|
||||||
|
|
||||||
.RandomWalkContinue: ; 4af0
|
.RandomWalkContinue: ; 4af0
|
||||||
call Function4690
|
call InitStep
|
||||||
call Function6ec1 ; check whether the object can move in that direction
|
call Function6ec1 ; check whether the object can move in that direction
|
||||||
jr c, .NewDuration
|
jr c, .NewDuration
|
||||||
|
|
||||||
call Function463f
|
call UpdateTallGrassFlags
|
||||||
ld hl, OBJECT_ACTION
|
ld hl, OBJECT_ACTION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], PERSON_ACTION_STEP
|
ld [hl], PERSON_ACTION_STEP
|
||||||
@ -1519,7 +1518,7 @@ endr
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.NewDuration: ; 4b17
|
.NewDuration: ; 4b17
|
||||||
call Function467b
|
call EndSpriteMovement
|
||||||
call Function462a
|
call Function462a
|
||||||
RandomStepDuration_Slow: ; 4b1d
|
RandomStepDuration_Slow: ; 4b1d
|
||||||
call Random
|
call Random
|
||||||
@ -1550,32 +1549,33 @@ SetRandomStepDuration: ; 4b2d
|
|||||||
|
|
||||||
Pointers4b45: ; 4b45
|
Pointers4b45: ; 4b45
|
||||||
; These pointers use OBJECT_STEP_TYPE. See constants/sprite_constants.asm
|
; These pointers use OBJECT_STEP_TYPE. See constants/sprite_constants.asm
|
||||||
dw Function47bc ; 00
|
jumptable_start
|
||||||
dw Function47dd ; 01
|
jumptable ObjectMovementReset ; 00
|
||||||
dw Function4e2b ; 02 npc walk
|
jumptable MapObjectMovementPattern ; 01
|
||||||
dw Function4ddd ; 03
|
jumptable NPCStep ; 02 npc walk
|
||||||
dw Function4e21 ; 04
|
jumptable Function4ddd ; 03
|
||||||
dw Function4e0c ; 05
|
jumptable Function4e21 ; 04
|
||||||
dw Function4e56 ; 06 player walk
|
jumptable Function4e0c ; 05
|
||||||
dw Function4e47 ; 07
|
jumptable PlayerStep ; 06 player walk
|
||||||
dw Function4b86 ; 08 npc jump step
|
jumptable Function4e47 ; 07
|
||||||
dw Function4bbf ; 09 player jump step
|
jumptable NPCJump ; 08 npc jump step
|
||||||
dw Function4e83 ; 0a half step
|
jumptable PlayerJump ; 09 player jump step
|
||||||
dw Function4dff ; 0b
|
jumptable PlayerOrNPCHalfStep ; 0a half step
|
||||||
dw Function4c18 ; 0c teleport from
|
jumptable Function4dff ; 0b
|
||||||
dw Function4c89 ; 0d teleport to
|
jumptable TeleportFrom ; 0c teleport from
|
||||||
dw Function4d14 ; 0e skyfall
|
jumptable TeleportTo ; 0d teleport to
|
||||||
dw Function4ecd ; 0f
|
jumptable Skyfall ; 0e skyfall
|
||||||
dw Function4d7e ; 10
|
jumptable Function4ecd ; 0f
|
||||||
dw Function4daf ; 11
|
jumptable GotBiteStep ; 10
|
||||||
dw Function4dc8 ; 12
|
jumptable RockSmashStep ; 11
|
||||||
dw Function4f04 ; 13
|
jumptable ReturnDigStep ; 12
|
||||||
dw Function4f33 ; 14
|
jumptable Function4f04 ; 13
|
||||||
dw Function4f33 ; 15
|
jumptable Function4f33 ; 14
|
||||||
dw Function4f77 ; 16
|
jumptable Function4f33 ; 15
|
||||||
dw Function4f7a ; 17
|
jumptable Function4f77 ; 16
|
||||||
dw Function4df0 ; 18
|
jumptable Function4f7a ; 17
|
||||||
dw Function4f83 ; 19
|
jumptable Function4df0 ; 18
|
||||||
|
jumptable SkyfallTop ; 19
|
||||||
; 4b79
|
; 4b79
|
||||||
|
|
||||||
Function4b79: ; 4b79
|
Function4b79: ; 4b79
|
||||||
@ -1585,11 +1585,11 @@ Function4b79: ; 4b79
|
|||||||
ret nz
|
ret nz
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4b86
|
; 4b86
|
||||||
|
|
||||||
Function4b86: ; 4b86
|
NPCJump: ; 4b86
|
||||||
call Object28AnonymousJumptable
|
call Object28AnonymousJumptable
|
||||||
; anonymous jumptable
|
; anonymous jumptable
|
||||||
dw Function4b8d
|
dw Function4b8d
|
||||||
@ -1603,7 +1603,7 @@ Function4b8d: ; 4b8d
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
dec [hl]
|
dec [hl]
|
||||||
ret nz
|
ret nz
|
||||||
call Function4600
|
call CopyNextCoordsTileToStandingCoordsTile
|
||||||
call GetNextTile
|
call GetNextTile
|
||||||
ld hl, OBJECT_FLAGS2
|
ld hl, OBJECT_FLAGS2
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@ -1619,34 +1619,34 @@ Function4ba9: ; 4ba9
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
dec [hl]
|
dec [hl]
|
||||||
ret nz
|
ret nz
|
||||||
call Function4600
|
call CopyNextCoordsTileToStandingCoordsTile
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4bbf
|
; 4bbf
|
||||||
|
|
||||||
Function4bbf: ; 4bbf
|
PlayerJump: ; 4bbf
|
||||||
call Object28AnonymousJumptable
|
call Object28AnonymousJumptable
|
||||||
; anonymous jumptable
|
; anonymous jumptable
|
||||||
dw Function4bca
|
dw .initjump
|
||||||
dw Function4bd2
|
dw .stepjump
|
||||||
dw Function4bf2
|
dw .initland
|
||||||
dw Function4bfd
|
dw .stepland
|
||||||
; 4bca
|
; 4bca
|
||||||
|
|
||||||
Function4bca: ; 4bca
|
.initjump: ; 4bca
|
||||||
ld hl, wPlayerStepFlags
|
ld hl, wPlayerStepFlags
|
||||||
set 7, [hl]
|
set 7, [hl]
|
||||||
call IncrementObjectStructField28
|
call IncrementObjectStructField28
|
||||||
Function4bd2: ; 4bd2
|
.stepjump: ; 4bd2
|
||||||
call UpdateJumpPosition
|
call UpdateJumpPosition
|
||||||
call Function4738
|
call UpdatePlayerStep
|
||||||
ld hl, OBJECT_STEP_DURATION
|
ld hl, OBJECT_STEP_DURATION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
dec [hl]
|
dec [hl]
|
||||||
ret nz
|
ret nz
|
||||||
call Function4600
|
call CopyNextCoordsTileToStandingCoordsTile
|
||||||
ld hl, OBJECT_FLAGS2
|
ld hl, OBJECT_FLAGS2
|
||||||
add hl, bc
|
add hl, bc
|
||||||
res 3, [hl]
|
res 3, [hl]
|
||||||
@ -1657,28 +1657,28 @@ Function4bd2: ; 4bd2
|
|||||||
ret
|
ret
|
||||||
; 4bf2
|
; 4bf2
|
||||||
|
|
||||||
Function4bf2: ; 4bf2
|
.initland: ; 4bf2
|
||||||
call GetNextTile
|
call GetNextTile
|
||||||
ld hl, wPlayerStepFlags
|
ld hl, wPlayerStepFlags
|
||||||
set 7, [hl]
|
set 7, [hl]
|
||||||
call IncrementObjectStructField28
|
call IncrementObjectStructField28
|
||||||
Function4bfd: ; 4bfd
|
.stepland: ; 4bfd
|
||||||
call UpdateJumpPosition
|
call UpdateJumpPosition
|
||||||
call Function4738
|
call UpdatePlayerStep
|
||||||
ld hl, OBJECT_STEP_DURATION
|
ld hl, OBJECT_STEP_DURATION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
dec [hl]
|
dec [hl]
|
||||||
ret nz
|
ret nz
|
||||||
ld hl, wPlayerStepFlags
|
ld hl, wPlayerStepFlags
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
call Function4600
|
call CopyNextCoordsTileToStandingCoordsTile
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4c18
|
; 4c18
|
||||||
|
|
||||||
Function4c18: ; 4c18
|
TeleportFrom: ; 4c18
|
||||||
call Object28AnonymousJumptable
|
call Object28AnonymousJumptable
|
||||||
; anonymous jumptable
|
; anonymous jumptable
|
||||||
dw Function4c23
|
dw Function4c23
|
||||||
@ -1745,11 +1745,11 @@ Function4c5d: ; 4c5d
|
|||||||
ld [hl], 0
|
ld [hl], 0
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4c89
|
; 4c89
|
||||||
|
|
||||||
Function4c89: ; 4c89
|
TeleportTo: ; 4c89
|
||||||
call Object28AnonymousJumptable
|
call Object28AnonymousJumptable
|
||||||
; anonymous jumptable
|
; anonymous jumptable
|
||||||
dw Function4c9a
|
dw Function4c9a
|
||||||
@ -1837,11 +1837,11 @@ Function4d01: ; 4d01
|
|||||||
ld [hl], 0
|
ld [hl], 0
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4d14
|
; 4d14
|
||||||
|
|
||||||
Function4d14: ; 4d14
|
Skyfall: ; 4d14
|
||||||
call Object28AnonymousJumptable
|
call Object28AnonymousJumptable
|
||||||
; anonymous jumptable
|
; anonymous jumptable
|
||||||
dw Function4d1f
|
dw Function4d1f
|
||||||
@ -1902,11 +1902,11 @@ Function4d6b: ; 4d6b
|
|||||||
ld [hl], 0
|
ld [hl], 0
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4d7e
|
; 4d7e
|
||||||
|
|
||||||
Function4d7e: ; 4d7e
|
GotBiteStep: ; 4d7e
|
||||||
call Object28AnonymousJumptable
|
call Object28AnonymousJumptable
|
||||||
; anonymous jumptable
|
; anonymous jumptable
|
||||||
dw Function4d85
|
dw Function4d85
|
||||||
@ -1936,11 +1936,11 @@ Function4d94: ; 4d94
|
|||||||
ld [hl], 0
|
ld [hl], 0
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4daf
|
; 4daf
|
||||||
|
|
||||||
Function4daf: ; 4daf
|
RockSmashStep: ; 4daf
|
||||||
call Function4db5
|
call Function4db5
|
||||||
jp Function4b79
|
jp Function4b79
|
||||||
; 4db5
|
; 4db5
|
||||||
@ -1961,7 +1961,7 @@ Function4db5: ; 4db5
|
|||||||
ret
|
ret
|
||||||
; 4dc8
|
; 4dc8
|
||||||
|
|
||||||
Function4dc8: ; 4dc8
|
ReturnDigStep: ; 4dc8
|
||||||
ld hl, OBJECT_STEP_DURATION
|
ld hl, OBJECT_STEP_DURATION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
@ -1987,7 +1987,7 @@ Function4ddd: ; 4ddd
|
|||||||
ret nz
|
ret nz
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4df0
|
; 4df0
|
||||||
|
|
||||||
@ -1999,7 +1999,7 @@ Function4df0: ; 4df0
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
dec [hl]
|
dec [hl]
|
||||||
ret nz
|
ret nz
|
||||||
jp Function4357
|
jp DeleteMapObject
|
||||||
; 4dff
|
; 4dff
|
||||||
|
|
||||||
Function4dff: ; 4dff
|
Function4dff: ; 4dff
|
||||||
@ -2009,7 +2009,7 @@ Function4dff: ; 4dff
|
|||||||
ret nz
|
ret nz
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4e0c
|
; 4e0c
|
||||||
|
|
||||||
@ -2028,27 +2028,27 @@ Function4e13: ; 4e13
|
|||||||
ld [hl], a
|
ld [hl], a
|
||||||
call IncrementObjectStructField28
|
call IncrementObjectStructField28
|
||||||
Function4e21: ; 4e21
|
Function4e21: ; 4e21
|
||||||
call Function4fb2
|
call MobileFn_4fb2
|
||||||
ld hl, OBJECT_DIRECTION_WALKING
|
ld hl, OBJECT_DIRECTION_WALKING
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STANDING
|
ld [hl], STANDING
|
||||||
ret
|
ret
|
||||||
; 4e2b
|
; 4e2b
|
||||||
|
|
||||||
Function4e2b: ; 4e2b
|
NPCStep: ; 4e2b
|
||||||
call Function4fb2
|
call MobileFn_4fb2
|
||||||
call AddStepVector
|
call AddStepVector
|
||||||
ld hl, OBJECT_STEP_DURATION
|
ld hl, OBJECT_STEP_DURATION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
dec [hl]
|
dec [hl]
|
||||||
ret nz
|
ret nz
|
||||||
call Function4600
|
call CopyNextCoordsTileToStandingCoordsTile
|
||||||
ld hl, OBJECT_DIRECTION_WALKING
|
ld hl, OBJECT_DIRECTION_WALKING
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STANDING
|
ld [hl], STANDING
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4e47
|
; 4e47
|
||||||
|
|
||||||
@ -2058,24 +2058,24 @@ Function4e47: ; 4e47
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
dec [hl]
|
dec [hl]
|
||||||
ret nz
|
ret nz
|
||||||
call Function4600
|
call CopyNextCoordsTileToStandingCoordsTile
|
||||||
jp RandomStepDuration_Slow
|
jp RandomStepDuration_Slow
|
||||||
; 4e56
|
; 4e56
|
||||||
|
|
||||||
Function4e56: ; 4e56
|
PlayerStep: ; 4e56
|
||||||
; AnimateStep?
|
; AnimateStep?
|
||||||
call Object28AnonymousJumptable
|
call Object28AnonymousJumptable
|
||||||
; anonymous jumptable
|
; anonymous jumptable
|
||||||
dw Function4e5d
|
dw .init
|
||||||
dw Function4e65
|
dw .step
|
||||||
; 4e5d
|
; 4e5d
|
||||||
|
|
||||||
Function4e5d: ; 4e5d
|
.init: ; 4e5d
|
||||||
ld hl, wPlayerStepFlags
|
ld hl, wPlayerStepFlags
|
||||||
set 7, [hl]
|
set 7, [hl]
|
||||||
call IncrementObjectStructField28
|
call IncrementObjectStructField28
|
||||||
Function4e65: ; 4e65
|
.step: ; 4e65
|
||||||
call Function4738
|
call UpdatePlayerStep
|
||||||
ld hl, OBJECT_STEP_DURATION
|
ld hl, OBJECT_STEP_DURATION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
dec [hl]
|
dec [hl]
|
||||||
@ -2083,26 +2083,26 @@ Function4e65: ; 4e65
|
|||||||
|
|
||||||
ld hl, wPlayerStepFlags
|
ld hl, wPlayerStepFlags
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
call Function4600
|
call CopyNextCoordsTileToStandingCoordsTile
|
||||||
ld hl, OBJECT_DIRECTION_WALKING
|
ld hl, OBJECT_DIRECTION_WALKING
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STANDING
|
ld [hl], STANDING
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4e83
|
; 4e83
|
||||||
|
|
||||||
Function4e83: ; 4e83
|
PlayerOrNPCHalfStep: ; 4e83
|
||||||
call Object28AnonymousJumptable
|
call Object28AnonymousJumptable
|
||||||
; anonymous jumptable
|
; anonymous jumptable
|
||||||
dw Function4e8e
|
dw .init1
|
||||||
dw Function4ea4
|
dw .step1
|
||||||
dw Function4ead
|
dw .init2
|
||||||
dw Function4ec0
|
dw .step2
|
||||||
; 4e8e
|
; 4e8e
|
||||||
|
|
||||||
Function4e8e: ; 4e8e
|
.init1: ; 4e8e
|
||||||
ld hl, OBJECT_DIRECTION_WALKING
|
ld hl, OBJECT_DIRECTION_WALKING
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STANDING
|
ld [hl], STANDING
|
||||||
@ -2114,14 +2114,14 @@ Function4e8e: ; 4e8e
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], 2
|
ld [hl], 2
|
||||||
call IncrementObjectStructField28
|
call IncrementObjectStructField28
|
||||||
Function4ea4: ; 4ea4
|
.step1: ; 4ea4
|
||||||
ld hl, OBJECT_STEP_DURATION
|
ld hl, OBJECT_STEP_DURATION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
dec [hl]
|
dec [hl]
|
||||||
ret nz
|
ret nz
|
||||||
call IncrementObjectStructField28
|
call IncrementObjectStructField28
|
||||||
Function4ead: ; 4ead
|
.init2: ; 4ead
|
||||||
ld hl, OBJECT_29
|
ld hl, OBJECT_29 ; new facing
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld hl, OBJECT_FACING
|
ld hl, OBJECT_FACING
|
||||||
@ -2129,16 +2129,16 @@ Function4ead: ; 4ead
|
|||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, OBJECT_STEP_DURATION
|
ld hl, OBJECT_STEP_DURATION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], $2
|
ld [hl], 2
|
||||||
call IncrementObjectStructField28
|
call IncrementObjectStructField28
|
||||||
Function4ec0: ; 4ec0
|
.step2: ; 4ec0
|
||||||
ld hl, OBJECT_STEP_DURATION
|
ld hl, OBJECT_STEP_DURATION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
dec [hl]
|
dec [hl]
|
||||||
ret nz
|
ret nz
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4ecd
|
; 4ecd
|
||||||
|
|
||||||
@ -2164,13 +2164,13 @@ Function4ecd: ; 4ecd
|
|||||||
ld hl, OBJECT_FLAGS2
|
ld hl, OBJECT_FLAGS2
|
||||||
add hl, bc
|
add hl, bc
|
||||||
res 2, [hl]
|
res 2, [hl]
|
||||||
call Function4600
|
call CopyNextCoordsTileToStandingCoordsTile
|
||||||
ld hl, OBJECT_DIRECTION_WALKING
|
ld hl, OBJECT_DIRECTION_WALKING
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STANDING
|
ld [hl], STANDING
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4f04
|
; 4f04
|
||||||
|
|
||||||
@ -2206,7 +2206,7 @@ Function4f04: ; 4f04
|
|||||||
ret nz
|
ret nz
|
||||||
|
|
||||||
.nope
|
.nope
|
||||||
jp Function4357
|
jp DeleteMapObject
|
||||||
; 4f33
|
; 4f33
|
||||||
|
|
||||||
Function4f33: ; 4f33
|
Function4f33: ; 4f33
|
||||||
@ -2245,7 +2245,7 @@ Function4f43: ; 4f43
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.ok
|
.ok
|
||||||
call Function4357
|
call DeleteMapObject
|
||||||
ret
|
ret
|
||||||
; 4f6c
|
; 4f6c
|
||||||
|
|
||||||
@ -2267,12 +2267,12 @@ Function4f77: ; 4f77
|
|||||||
Function4f7a: ; 4f7a
|
Function4f7a: ; 4f7a
|
||||||
call Object28AnonymousJumptable
|
call Object28AnonymousJumptable
|
||||||
; anonymous jumptable
|
; anonymous jumptable
|
||||||
dw Function4f83
|
dw SkyfallTop
|
||||||
dw Function4f83
|
dw SkyfallTop
|
||||||
dw Function4f83
|
dw SkyfallTop
|
||||||
; 4f83
|
; 4f83
|
||||||
|
|
||||||
Function4f83: ; 4f83
|
SkyfallTop: ; 4f83
|
||||||
call Object28AnonymousJumptable
|
call Object28AnonymousJumptable
|
||||||
; anonymous jumptable
|
; anonymous jumptable
|
||||||
dw Function4f8a
|
dw Function4f8a
|
||||||
@ -2302,15 +2302,11 @@ Function4f99: ; 4f99
|
|||||||
ld [hl], 0
|
ld [hl], 0
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 4fb2
|
; 4fb2
|
||||||
|
|
||||||
Function4fb2: ; 4fb2
|
MobileFn_4fb2: mobile
|
||||||
ret
|
|
||||||
; 4fb3
|
|
||||||
|
|
||||||
Function4fb3: ; 4fb3
|
|
||||||
ld hl, OBJECT_29
|
ld hl, OBJECT_29
|
||||||
add hl, bc
|
add hl, bc
|
||||||
inc [hl]
|
inc [hl]
|
||||||
@ -2839,7 +2835,7 @@ Function5688: ; 5688
|
|||||||
ld hl, OBJECT_NEXT_TILE
|
ld hl, OBJECT_NEXT_TILE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
callba Function463f ; no need to farcall
|
callba UpdateTallGrassFlags ; no need to farcall
|
||||||
ret
|
ret
|
||||||
; 56a3
|
; 56a3
|
||||||
|
|
||||||
@ -2996,12 +2992,12 @@ Function56cd: ; 56cd
|
|||||||
; 576a
|
; 576a
|
||||||
|
|
||||||
Function576a:: ; 576a
|
Function576a:: ; 576a
|
||||||
call Function5771
|
call .ResetStepVector
|
||||||
call Function5781
|
call Function5781
|
||||||
ret
|
ret
|
||||||
; 5771
|
; 5771
|
||||||
|
|
||||||
Function5771: ; 5771
|
.ResetStepVector: ; 5771
|
||||||
xor a
|
xor a
|
||||||
ld [wPlayerStepVectorX], a
|
ld [wPlayerStepVectorX], a
|
||||||
ld [wPlayerStepVectorY], a
|
ld [wPlayerStepVectorY], a
|
||||||
|
@ -193,7 +193,7 @@ Movement_fish_cast_rod: ; 51ab
|
|||||||
ld [hl], PERSON_ACTION_FISHING
|
ld [hl], PERSON_ACTION_FISHING
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 51b8
|
; 51b8
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ Movement_step_end: ; 51c1
|
|||||||
|
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
ret
|
ret
|
||||||
; 51db
|
; 51db
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ Movement_48: ; 51db
|
|||||||
; 51fd
|
; 51fd
|
||||||
|
|
||||||
Movement_remove_person: ; 51fd
|
Movement_remove_person: ; 51fd
|
||||||
call Function4357
|
call DeleteMapObject
|
||||||
ld hl, wObjectFollow_Leader
|
ld hl, wObjectFollow_Leader
|
||||||
ld a, [hMapObjectIndexBuffer]
|
ld a, [hMapObjectIndexBuffer]
|
||||||
cp [hl]
|
cp [hl]
|
||||||
@ -726,7 +726,7 @@ Movement_half_step_right: ; 53fc
|
|||||||
jr HalfStep
|
jr HalfStep
|
||||||
|
|
||||||
HalfStep: ; 5400
|
HalfStep: ; 5400
|
||||||
ld hl, OBJECT_29
|
ld hl, OBJECT_29 ; new facing
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
|
|
||||||
@ -741,8 +741,8 @@ HalfStep: ; 5400
|
|||||||
; 5412
|
; 5412
|
||||||
|
|
||||||
NormalStep: ; 5412
|
NormalStep: ; 5412
|
||||||
call Function4690
|
call InitStep
|
||||||
call Function463f
|
call UpdateTallGrassFlags
|
||||||
ld hl, OBJECT_ACTION
|
ld hl, OBJECT_ACTION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], PERSON_ACTION_STEP
|
ld [hl], PERSON_ACTION_STEP
|
||||||
@ -778,8 +778,8 @@ NormalStep: ; 5412
|
|||||||
; 5446
|
; 5446
|
||||||
|
|
||||||
TurningStep: ; 5446
|
TurningStep: ; 5446
|
||||||
call Function4690
|
call InitStep
|
||||||
call Function463f
|
call UpdateTallGrassFlags
|
||||||
|
|
||||||
ld hl, OBJECT_ACTION
|
ld hl, OBJECT_ACTION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@ -804,8 +804,8 @@ TurningStep: ; 5446
|
|||||||
|
|
||||||
|
|
||||||
SlideStep: ; 5468
|
SlideStep: ; 5468
|
||||||
call Function4690
|
call InitStep
|
||||||
call Function463f
|
call UpdateTallGrassFlags
|
||||||
|
|
||||||
ld hl, OBJECT_ACTION
|
ld hl, OBJECT_ACTION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@ -830,7 +830,7 @@ SlideStep: ; 5468
|
|||||||
|
|
||||||
|
|
||||||
JumpStep: ; 548a
|
JumpStep: ; 548a
|
||||||
call Function4690
|
call InitStep
|
||||||
ld hl, OBJECT_31
|
ld hl, OBJECT_31
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], $0
|
ld [hl], $0
|
||||||
|
@ -369,7 +369,7 @@ Function1967:: ; 1967
|
|||||||
call Function1985
|
call Function1985
|
||||||
pop af
|
pop af
|
||||||
call GetObjectStruct
|
call GetObjectStruct
|
||||||
callba Function4357
|
callba DeleteMapObject
|
||||||
ret
|
ret
|
||||||
; 1985
|
; 1985
|
||||||
|
|
||||||
@ -435,7 +435,7 @@ Function19b8:: ; 19b8
|
|||||||
.ok
|
.ok
|
||||||
ld a, b
|
ld a, b
|
||||||
call GetObjectStruct
|
call GetObjectStruct
|
||||||
callba Function4357
|
callba DeleteMapObject
|
||||||
ret
|
ret
|
||||||
; 19e9
|
; 19e9
|
||||||
|
|
||||||
|
3
wram.asm
3
wram.asm
@ -2417,7 +2417,8 @@ wReceiveCallDelay_StartTime:: ds 3
|
|||||||
ds 3
|
ds 3
|
||||||
wBugContestMinsRemaining:: ds 1
|
wBugContestMinsRemaining:: ds 1
|
||||||
wBugContestSecsRemaining:: ds 1
|
wBugContestSecsRemaining:: ds 1
|
||||||
ds 4
|
ds 2
|
||||||
|
wMapStatusEnd:: ds 2 ; d470
|
||||||
|
|
||||||
wCrystalData::
|
wCrystalData::
|
||||||
PlayerGender:: ; d472
|
PlayerGender:: ; d472
|
||||||
|
Loading…
Reference in New Issue
Block a user