mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-01-23 09:16:20 -08:00
Define TileCollisionTable as a standard 'db' series
This commit is contained in:
parent
53cf08b6b3
commit
88bbdb6a2f
@ -1,8 +1,8 @@
|
||||
; collision permissions (see data/collision_permissions.asm)
|
||||
LANDTILE EQU $00
|
||||
WATERTILE EQU $01
|
||||
WALLTILE EQU $0f
|
||||
TALK EQU $10
|
||||
LAND_TILE EQU $00
|
||||
WATER_TILE EQU $01
|
||||
WALL_TILE EQU $0f
|
||||
TALK EQU $10
|
||||
|
||||
; collision data types (see data/tilesets/*_collision.asm)
|
||||
; TileCollisionTable indexes (see data/collision_permissions.asm)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -360,7 +360,7 @@ SurfFunction:
|
||||
jr z, .alreadyfail
|
||||
call GetFacingTileCoord
|
||||
call GetTileCollision
|
||||
cp WATERTILE
|
||||
cp WATER_TILE
|
||||
jr nz, .cannotsurf
|
||||
call CheckDirection
|
||||
jr c, .cannotsurf
|
||||
@ -497,7 +497,7 @@ TrySurfOW::
|
||||
; Must be facing water.
|
||||
ld a, [wFacingTileID]
|
||||
call GetTileCollision
|
||||
cp WATERTILE
|
||||
cp WATER_TILE
|
||||
jr nz, .quit
|
||||
|
||||
; Check tile permissions.
|
||||
@ -1453,7 +1453,7 @@ FishFunction:
|
||||
jr z, .fail
|
||||
call GetFacingTileCoord
|
||||
call GetTileCollision
|
||||
cp WATERTILE
|
||||
cp WATER_TILE
|
||||
jr z, .facingwater
|
||||
.fail
|
||||
ld a, $3
|
||||
@ -1697,8 +1697,8 @@ BikeFunction:
|
||||
|
||||
.ok
|
||||
call GetPlayerStandingTile
|
||||
and WALLTILE | WATERTILE ; can't use our bike in a wall or on water
|
||||
jr nz, .nope
|
||||
and $f ; lo nybble only
|
||||
jr nz, .nope ; not FLOOR_TILE
|
||||
xor a
|
||||
ret
|
||||
|
||||
|
@ -75,7 +75,7 @@ WillObjectBumpIntoWater:
|
||||
ld a, [hl]
|
||||
ld d, a
|
||||
call GetTileCollision
|
||||
and a ; LANDTILE
|
||||
and a ; LAND_TILE
|
||||
jr z, WillObjectBumpIntoTile
|
||||
scf
|
||||
ret
|
||||
@ -87,7 +87,7 @@ WillObjectBumpIntoLand:
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
call GetTileCollision
|
||||
cp WATERTILE
|
||||
cp WATER_TILE
|
||||
jr z, WillObjectBumpIntoTile
|
||||
scf
|
||||
ret
|
||||
@ -213,11 +213,11 @@ Function6fa1:
|
||||
call GetCoordTile
|
||||
call GetTileCollision
|
||||
pop de
|
||||
and a ; LANDTILE
|
||||
and a ; LAND_TILE
|
||||
jr nz, .not_land
|
||||
call GetCoordTile
|
||||
call GetTileCollision
|
||||
and a ; LANDTILE
|
||||
and a ; LAND_TILE
|
||||
jr nz, .not_land
|
||||
xor a
|
||||
ret
|
||||
|
@ -738,7 +738,7 @@ ENDM
|
||||
; Return 0 if tile a is land. Otherwise, return carry.
|
||||
|
||||
call GetTileCollision
|
||||
and a ; LANDTILE?
|
||||
and a ; LAND_TILE
|
||||
ret z
|
||||
scf
|
||||
ret
|
||||
@ -748,11 +748,11 @@ ENDM
|
||||
; Otherwise, return carry.
|
||||
|
||||
call GetTileCollision
|
||||
cp WATERTILE
|
||||
cp WATER_TILE
|
||||
jr z, .Water
|
||||
|
||||
; Can walk back onto land from water.
|
||||
and a ; LANDTILE?
|
||||
and a ; LAND_TILE
|
||||
jr z, .Land
|
||||
|
||||
jr .Neither
|
||||
|
@ -80,7 +80,7 @@ GetPlayerStandingTile::
|
||||
CheckOnWater::
|
||||
ld a, [wPlayerStandingTile]
|
||||
call GetTileCollision
|
||||
sub WATERTILE
|
||||
sub WATER_TILE
|
||||
ret z
|
||||
and a
|
||||
ret
|
||||
|
Loading…
x
Reference in New Issue
Block a user