2015-12-15 15:59:49 -08:00
|
|
|
CheckWarpCollision:: ; 1499a
|
|
|
|
; Is this tile a warp?
|
2016-01-10 23:28:09 -08:00
|
|
|
ld a, [PlayerStandingTile]
|
2017-12-12 13:15:58 -08:00
|
|
|
cp COLL_PIT
|
2015-12-15 15:59:49 -08:00
|
|
|
jr z, .warp
|
2017-12-12 13:15:58 -08:00
|
|
|
cp COLL_PIT_68
|
2015-12-15 15:59:49 -08:00
|
|
|
jr z, .warp
|
|
|
|
and $f0
|
2017-12-12 13:15:58 -08:00
|
|
|
cp HI_NYBBLE_WARPS
|
2015-12-15 15:59:49 -08:00
|
|
|
jr z, .warp
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.warp
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 149af
|
|
|
|
|
|
|
|
CheckDirectionalWarp:: ; 149af
|
|
|
|
; If this is a directional warp, clear carry (press the designated button to warp).
|
|
|
|
; Else, set carry (immediate warp).
|
2016-01-10 23:28:09 -08:00
|
|
|
ld a, [PlayerStandingTile]
|
2017-12-12 13:15:58 -08:00
|
|
|
cp COLL_WARP_CARPET_DOWN
|
2016-03-01 19:31:21 -08:00
|
|
|
jr z, .directional
|
2017-12-12 13:15:58 -08:00
|
|
|
cp COLL_WARP_CARPET_LEFT
|
2016-03-01 19:31:21 -08:00
|
|
|
jr z, .directional
|
2017-12-12 13:15:58 -08:00
|
|
|
cp COLL_WARP_CARPET_UP
|
2016-03-01 19:31:21 -08:00
|
|
|
jr z, .directional
|
2017-12-12 13:15:58 -08:00
|
|
|
cp COLL_WARP_CARPET_RIGHT
|
2016-03-01 19:31:21 -08:00
|
|
|
jr z, .directional
|
2015-12-15 15:59:49 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
.directional
|
2015-12-15 15:59:49 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; 149c6
|
|
|
|
|
|
|
|
CheckWarpFacingDown: ; 149c6
|
|
|
|
ld de, 1
|
|
|
|
ld hl, .blocks
|
2016-01-10 23:28:09 -08:00
|
|
|
ld a, [PlayerStandingTile]
|
2015-12-15 15:59:49 -08:00
|
|
|
call IsInArray
|
|
|
|
ret
|
|
|
|
; 149d3
|
|
|
|
|
2016-04-10 12:01:49 -07:00
|
|
|
.blocks ; 149d3
|
2017-12-12 13:15:58 -08:00
|
|
|
db COLL_DOOR
|
|
|
|
db COLL_DOOR_79
|
|
|
|
db COLL_STAIRCASE
|
|
|
|
db COLL_STAIRCASE_73
|
|
|
|
db COLL_CAVE
|
|
|
|
db COLL_CAVE_74
|
|
|
|
db COLL_WARP_PANEL
|
|
|
|
db COLL_DOOR_75
|
|
|
|
db COLL_DOOR_7D
|
2015-12-15 15:59:49 -08:00
|
|
|
db -1
|
|
|
|
; 149dd
|
|
|
|
|
|
|
|
CheckGrassCollision:: ; 149dd
|
2016-01-10 23:28:09 -08:00
|
|
|
ld a, [PlayerStandingTile]
|
2015-12-15 15:59:49 -08:00
|
|
|
ld hl, .blocks
|
|
|
|
ld de, 1
|
|
|
|
call IsInArray
|
|
|
|
ret
|
|
|
|
; 149ea
|
|
|
|
|
2016-04-10 12:01:49 -07:00
|
|
|
.blocks ; 149ea
|
2017-12-12 13:15:58 -08:00
|
|
|
db COLL_CUT_08
|
|
|
|
db COLL_TALL_GRASS
|
|
|
|
db COLL_LONG_GRASS
|
|
|
|
db COLL_CUT_28
|
|
|
|
db COLL_WATER
|
|
|
|
db COLL_GRASS_48
|
|
|
|
db COLL_GRASS_49
|
|
|
|
db COLL_GRASS_4A
|
|
|
|
db COLL_GRASS_4B
|
|
|
|
db COLL_GRASS_4C
|
2015-12-15 15:59:49 -08:00
|
|
|
db -1
|
|
|
|
; 149f5
|
|
|
|
|
|
|
|
CheckCutCollision: ; 149f5
|
|
|
|
ld a, c
|
|
|
|
ld hl, .blocks
|
|
|
|
ld de, 1
|
|
|
|
call IsInArray
|
|
|
|
ret
|
|
|
|
; 14a00
|
|
|
|
|
2016-04-10 12:01:49 -07:00
|
|
|
.blocks ; 14a00
|
2017-12-12 13:15:58 -08:00
|
|
|
db COLL_CUT_TREE
|
|
|
|
db COLL_CUT_TREE_1A
|
|
|
|
db COLL_TALL_GRASS_10
|
|
|
|
db COLL_TALL_GRASS
|
|
|
|
db COLL_LONG_GRASS
|
|
|
|
db COLL_LONG_GRASS_1C
|
2015-12-15 15:59:49 -08:00
|
|
|
db -1
|
|
|
|
; 14a07
|
|
|
|
|
2017-10-29 03:09:24 -07:00
|
|
|
GetWarpSFX:: ; 14a07
|
2016-01-10 23:28:09 -08:00
|
|
|
ld a, [PlayerStandingTile]
|
2017-10-29 03:09:24 -07:00
|
|
|
ld de, SFX_ENTER_DOOR
|
2017-12-12 13:15:58 -08:00
|
|
|
cp COLL_DOOR
|
2015-12-15 15:59:49 -08:00
|
|
|
ret z
|
2017-10-29 03:09:24 -07:00
|
|
|
ld de, SFX_WARP_TO
|
2017-12-12 13:15:58 -08:00
|
|
|
cp COLL_WARP_PANEL
|
2015-12-15 15:59:49 -08:00
|
|
|
ret z
|
2017-10-29 03:09:24 -07:00
|
|
|
ld de, SFX_EXIT_BUILDING
|
2015-12-15 15:59:49 -08:00
|
|
|
ret
|
|
|
|
; 14a1a
|