You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Merge pull request #684 from Rangi42/master
Define TileCollisionTable as a standard 'db' series
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
; collision permissions (see data/collision_permissions.asm)
|
; collision permissions (see data/collision_permissions.asm)
|
||||||
LANDTILE EQU $00
|
LAND_TILE EQU $00
|
||||||
WATERTILE EQU $01
|
WATER_TILE EQU $01
|
||||||
WALLTILE EQU $0f
|
WALL_TILE EQU $0f
|
||||||
TALK EQU $10
|
TALK EQU $10
|
||||||
|
|
||||||
; collision data types (see data/tilesets/*_collision.asm)
|
; collision data types (see data/tilesets/*_collision.asm)
|
||||||
; TileCollisionTable indexes (see data/collision_permissions.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
|
jr z, .alreadyfail
|
||||||
call GetFacingTileCoord
|
call GetFacingTileCoord
|
||||||
call GetTileCollision
|
call GetTileCollision
|
||||||
cp WATERTILE
|
cp WATER_TILE
|
||||||
jr nz, .cannotsurf
|
jr nz, .cannotsurf
|
||||||
call CheckDirection
|
call CheckDirection
|
||||||
jr c, .cannotsurf
|
jr c, .cannotsurf
|
||||||
@@ -497,7 +497,7 @@ TrySurfOW::
|
|||||||
; Must be facing water.
|
; Must be facing water.
|
||||||
ld a, [wFacingTileID]
|
ld a, [wFacingTileID]
|
||||||
call GetTileCollision
|
call GetTileCollision
|
||||||
cp WATERTILE
|
cp WATER_TILE
|
||||||
jr nz, .quit
|
jr nz, .quit
|
||||||
|
|
||||||
; Check tile permissions.
|
; Check tile permissions.
|
||||||
@@ -1453,7 +1453,7 @@ FishFunction:
|
|||||||
jr z, .fail
|
jr z, .fail
|
||||||
call GetFacingTileCoord
|
call GetFacingTileCoord
|
||||||
call GetTileCollision
|
call GetTileCollision
|
||||||
cp WATERTILE
|
cp WATER_TILE
|
||||||
jr z, .facingwater
|
jr z, .facingwater
|
||||||
.fail
|
.fail
|
||||||
ld a, $3
|
ld a, $3
|
||||||
@@ -1697,8 +1697,8 @@ BikeFunction:
|
|||||||
|
|
||||||
.ok
|
.ok
|
||||||
call GetPlayerStandingTile
|
call GetPlayerStandingTile
|
||||||
and WALLTILE | WATERTILE ; can't use our bike in a wall or on water
|
and $f ; lo nybble only
|
||||||
jr nz, .nope
|
jr nz, .nope ; not FLOOR_TILE
|
||||||
xor a
|
xor a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@ WillObjectBumpIntoWater:
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld d, a
|
ld d, a
|
||||||
call GetTileCollision
|
call GetTileCollision
|
||||||
and a ; LANDTILE
|
and a ; LAND_TILE
|
||||||
jr z, WillObjectBumpIntoTile
|
jr z, WillObjectBumpIntoTile
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
@@ -87,7 +87,7 @@ WillObjectBumpIntoLand:
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
call GetTileCollision
|
call GetTileCollision
|
||||||
cp WATERTILE
|
cp WATER_TILE
|
||||||
jr z, WillObjectBumpIntoTile
|
jr z, WillObjectBumpIntoTile
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
@@ -213,11 +213,11 @@ Function6fa1:
|
|||||||
call GetCoordTile
|
call GetCoordTile
|
||||||
call GetTileCollision
|
call GetTileCollision
|
||||||
pop de
|
pop de
|
||||||
and a ; LANDTILE
|
and a ; LAND_TILE
|
||||||
jr nz, .not_land
|
jr nz, .not_land
|
||||||
call GetCoordTile
|
call GetCoordTile
|
||||||
call GetTileCollision
|
call GetTileCollision
|
||||||
and a ; LANDTILE
|
and a ; LAND_TILE
|
||||||
jr nz, .not_land
|
jr nz, .not_land
|
||||||
xor a
|
xor a
|
||||||
ret
|
ret
|
||||||
|
@@ -738,7 +738,7 @@ ENDM
|
|||||||
; Return 0 if tile a is land. Otherwise, return carry.
|
; Return 0 if tile a is land. Otherwise, return carry.
|
||||||
|
|
||||||
call GetTileCollision
|
call GetTileCollision
|
||||||
and a ; LANDTILE?
|
and a ; LAND_TILE
|
||||||
ret z
|
ret z
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
@@ -748,11 +748,11 @@ ENDM
|
|||||||
; Otherwise, return carry.
|
; Otherwise, return carry.
|
||||||
|
|
||||||
call GetTileCollision
|
call GetTileCollision
|
||||||
cp WATERTILE
|
cp WATER_TILE
|
||||||
jr z, .Water
|
jr z, .Water
|
||||||
|
|
||||||
; Can walk back onto land from water.
|
; Can walk back onto land from water.
|
||||||
and a ; LANDTILE?
|
and a ; LAND_TILE
|
||||||
jr z, .Land
|
jr z, .Land
|
||||||
|
|
||||||
jr .Neither
|
jr .Neither
|
||||||
|
@@ -80,7 +80,7 @@ GetPlayerStandingTile::
|
|||||||
CheckOnWater::
|
CheckOnWater::
|
||||||
ld a, [wPlayerStandingTile]
|
ld a, [wPlayerStandingTile]
|
||||||
call GetTileCollision
|
call GetTileCollision
|
||||||
sub WATERTILE
|
sub WATER_TILE
|
||||||
ret z
|
ret z
|
||||||
and a
|
and a
|
||||||
ret
|
ret
|
||||||
|
Reference in New Issue
Block a user