mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Apply e0c278a595bdd0b724607e14398a3c340860b449 from pokecrystal
This commit is contained in:
parent
5c4d982702
commit
b1fd8f941a
@ -6,7 +6,7 @@ DEF WALL_TILE EQU $0f
|
|||||||
DEF TALK EQU $10
|
DEF TALK EQU $10
|
||||||
|
|
||||||
; collision data types (see data/tilesets/*_collision.asm)
|
; collision data types (see data/tilesets/*_collision.asm)
|
||||||
; TileCollisionTable indexes (see data/collision/collision_permissions.asm)
|
; CollisionPermissionTable indexes (see data/collision/collision_permissions.asm)
|
||||||
DEF COLL_FLOOR EQU $00
|
DEF COLL_FLOOR EQU $00
|
||||||
DEF COLL_01 EQU $01 ; garbage
|
DEF COLL_01 EQU $01 ; garbage
|
||||||
DEF COLL_03 EQU $03 ; garbage
|
DEF COLL_03 EQU $03 ; garbage
|
||||||
|
@ -14,7 +14,7 @@ DEF OBJECT_STEP_DURATION rb ; 0a
|
|||||||
DEF OBJECT_ACTION rb ; 0b
|
DEF OBJECT_ACTION rb ; 0b
|
||||||
DEF OBJECT_STEP_FRAME rb ; 0c
|
DEF OBJECT_STEP_FRAME rb ; 0c
|
||||||
DEF OBJECT_FACING rb ; 0d
|
DEF OBJECT_FACING rb ; 0d
|
||||||
DEF OBJECT_TILE rb ; 0e
|
DEF OBJECT_TILE_COLLISION rb ; 0e
|
||||||
DEF OBJECT_LAST_TILE rb ; 0f
|
DEF OBJECT_LAST_TILE rb ; 0f
|
||||||
DEF OBJECT_MAP_X rb ; 10
|
DEF OBJECT_MAP_X rb ; 10
|
||||||
DEF OBJECT_MAP_Y rb ; 11
|
DEF OBJECT_MAP_Y rb ; 11
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
TileCollisionTable::
|
CollisionPermissionTable::
|
||||||
; entries correspond to COLL_* constants
|
; entries correspond to COLL_* constants
|
||||||
table_width 1, TileCollisionTable
|
table_width 1, CollisionPermissionTable
|
||||||
db LAND_TILE ; COLL_FLOOR
|
db LAND_TILE ; COLL_FLOOR
|
||||||
db LAND_TILE ; COLL_01
|
db LAND_TILE ; COLL_01
|
||||||
db LAND_TILE ; 02
|
db LAND_TILE ; 02
|
||||||
|
@ -1725,7 +1725,7 @@ This bug is why the Lapras in [maps/UnionCaveB2F.asm](https://github.com/pret/po
|
|||||||
cp PLAYER_SURF_PIKA
|
cp PLAYER_SURF_PIKA
|
||||||
jr z, .fail
|
jr z, .fail
|
||||||
call GetFacingTileCoord
|
call GetFacingTileCoord
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
cp WATER_TILE
|
cp WATER_TILE
|
||||||
- jr z, .facingwater
|
- jr z, .facingwater
|
||||||
+ jr nz, .fail
|
+ jr nz, .fail
|
||||||
@ -2126,7 +2126,7 @@ If `[wWalkingDirection]` is `STANDING` (`$FF`), this will check `[.EdgeWarps + $
|
|||||||
ld d, 0
|
ld d, 0
|
||||||
ld hl, .EdgeWarps
|
ld hl, .EdgeWarps
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
cp [hl]
|
cp [hl]
|
||||||
jr nz, .not_warp
|
jr nz, .not_warp
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@
|
|||||||
9) When the step finishes (i.e. ``PLAYERSTEP_STOP_F`` becomes set) in some ``HandleMap`` iteration, ``CheckPlayerState`` sets ``wEnabledPlayerEvents`` to $ff and ``wMapEventStatus`` to ``MAPEVENTS_ON``.
|
9) When the step finishes (i.e. ``PLAYERSTEP_STOP_F`` becomes set) in some ``HandleMap`` iteration, ``CheckPlayerState`` sets ``wEnabledPlayerEvents`` to $ff and ``wMapEventStatus`` to ``MAPEVENTS_ON``.
|
||||||
10) In the next ``HandleMap`` iteration, ``CheckBoardEvent.board`` is called with ``wEnabledPlayerEvents[4]`` set.
|
10) In the next ``HandleMap`` iteration, ``CheckBoardEvent.board`` is called with ``wEnabledPlayerEvents[4]`` set.
|
||||||
- If ``wCurSpaceNextSpace`` matches ``NEXT_SPACE_IS_ANCHOR_POINT``: If player is at a tile with an anchor event, ``wCurSpaceNextSpace`` is updated with the next space byte of salid anchor event. ``wEnabledPlayerEvents[4]`` is reset. **Go back to 7**.
|
- If ``wCurSpaceNextSpace`` matches ``NEXT_SPACE_IS_ANCHOR_POINT``: If player is at a tile with an anchor event, ``wCurSpaceNextSpace`` is updated with the next space byte of salid anchor event. ``wEnabledPlayerEvents[4]`` is reset. **Go back to 7**.
|
||||||
- If player is not above a tile (``wPlayerTile``) with a space collision: ``wEnabledPlayerEvents[4]`` is reset. **Go back to 7**.
|
- If player is not above a tile (``wPlayerTileCollision``) with a space collision: ``wEnabledPlayerEvents[4]`` is reset. **Go back to 7**.
|
||||||
- If player is above a tile, the corresponding space script is queued to be executed by ``ScriptEvents`` in the current ``HandleMap`` iteration. ``wEnabledPlayerEvents[4]`` is reset. **Continue to 11**.
|
- If player is above a tile, the corresponding space script is queued to be executed by ``ScriptEvents`` in the current ``HandleMap`` iteration. ``wEnabledPlayerEvents[4]`` is reset. **Continue to 11**.
|
||||||
11) The space script loads the value of ``wCurSpaceNextSpace`` into ``wCurSpace``, and loads the new space data to ``wCurSpaceStruct[]``. Unless the space is a Branch Space or a Union Space, ``wSpacesLeft`` is decreased.
|
11) The space script loads the value of ``wCurSpaceNextSpace`` into ``wCurSpace``, and loads the new space data to ``wCurSpaceStruct[]``. Unless the space is a Branch Space or a Union Space, ``wSpacesLeft`` is decreased.
|
||||||
- If the space is a Branch Space, the branch data is loaded to ``wTempSpaceBranchStruct``. Then the player is prompted to choose a valid direction. ``wCurSpaceNextSpace`` is populated with the next space that corresponds to the chosen direction. **Go back to 6**.
|
- If the space is a Branch Space, the branch data is loaded to ``wTempSpaceBranchStruct``. Then the player is prompted to choose a valid direction. ``wCurSpaceNextSpace`` is populated with the next space that corresponds to the chosen direction. **Go back to 6**.
|
||||||
|
@ -368,7 +368,7 @@ SurfFunction:
|
|||||||
cp PLAYER_SURF_PIKA
|
cp PLAYER_SURF_PIKA
|
||||||
jr z, .alreadyfail
|
jr z, .alreadyfail
|
||||||
call GetFacingTileCoord
|
call GetFacingTileCoord
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
cp WATER_TILE
|
cp WATER_TILE
|
||||||
jr nz, .cannotsurf
|
jr nz, .cannotsurf
|
||||||
call CheckDirection
|
call CheckDirection
|
||||||
@ -510,7 +510,7 @@ TrySurfOW::
|
|||||||
|
|
||||||
; Must be facing water.
|
; Must be facing water.
|
||||||
ld a, [wFacingTileID]
|
ld a, [wFacingTileID]
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
cp WATER_TILE
|
cp WATER_TILE
|
||||||
jr nz, .quit
|
jr nz, .quit
|
||||||
|
|
||||||
@ -718,7 +718,7 @@ Script_UsedWaterfall:
|
|||||||
CheckContinueWaterfall:
|
CheckContinueWaterfall:
|
||||||
xor a
|
xor a
|
||||||
ldh [hScriptVar], a
|
ldh [hScriptVar], a
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
call CheckWaterfallTile
|
call CheckWaterfallTile
|
||||||
ret z
|
ret z
|
||||||
ld a, $1
|
ld a, $1
|
||||||
@ -1485,7 +1485,7 @@ FishFunction:
|
|||||||
cp PLAYER_SURF_PIKA
|
cp PLAYER_SURF_PIKA
|
||||||
jr z, .fail
|
jr z, .fail
|
||||||
call GetFacingTileCoord
|
call GetFacingTileCoord
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
cp WATER_TILE
|
cp WATER_TILE
|
||||||
jr z, .facingwater
|
jr z, .facingwater
|
||||||
.fail
|
.fail
|
||||||
@ -1724,7 +1724,7 @@ BikeFunction:
|
|||||||
jr z, .nope
|
jr z, .nope
|
||||||
|
|
||||||
.ok
|
.ok
|
||||||
call GetPlayerTile
|
call GetPlayerTilePermission
|
||||||
and $f ; lo nybble only
|
and $f ; lo nybble only
|
||||||
jr nz, .nope ; not FLOOR_TILE
|
jr nz, .nope ; not FLOOR_TILE
|
||||||
xor a
|
xor a
|
||||||
|
@ -271,7 +271,7 @@ CmdQueue_StoneTable:
|
|||||||
cp SPRITEMOVEDATA_STRENGTH_BOULDER
|
cp SPRITEMOVEDATA_STRENGTH_BOULDER
|
||||||
jr nz, .next
|
jr nz, .next
|
||||||
|
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
call CheckPitTile
|
call CheckPitTile
|
||||||
|
@ -456,11 +456,11 @@ CheckBoardEvent:
|
|||||||
|
|
||||||
.next
|
.next
|
||||||
; space handler
|
; space handler
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
and $f0
|
and $f0
|
||||||
cp HI_NYBBLE_SPACES
|
cp HI_NYBBLE_SPACES
|
||||||
jr nz, .no_space_effect
|
jr nz, .no_space_effect
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
and $0f
|
and $0f
|
||||||
ld e, a
|
ld e, a
|
||||||
ld d, 0
|
ld d, 0
|
||||||
@ -598,7 +598,7 @@ CheckTileEvent:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.warp_tile
|
.warp_tile
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
call CheckPitTile
|
call CheckPitTile
|
||||||
jr nz, .not_pit
|
jr nz, .not_pit
|
||||||
ld a, PLAYEREVENT_FALL
|
ld a, PLAYEREVENT_FALL
|
||||||
@ -758,7 +758,7 @@ CheckFacingTileEvent:
|
|||||||
|
|
||||||
; Must be facing water.
|
; Must be facing water.
|
||||||
ld a, [wFacingTileID]
|
ld a, [wFacingTileID]
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
cp WATER_TILE
|
cp WATER_TILE
|
||||||
jr nz, .next_event_1
|
jr nz, .next_event_1
|
||||||
|
|
||||||
@ -1587,7 +1587,7 @@ CanEncounterWildMon::
|
|||||||
jr nc, .no
|
jr nc, .no
|
||||||
|
|
||||||
.ice_check
|
.ice_check
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
call CheckIceTile
|
call CheckIceTile
|
||||||
jr z, .no
|
jr z, .no
|
||||||
scf
|
scf
|
||||||
@ -1658,7 +1658,7 @@ ChooseWildEncounter_BugContest::
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
TryWildEncounter_BugContest:
|
TryWildEncounter_BugContest:
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
call CheckSuperTallGrassTile
|
call CheckSuperTallGrassTile
|
||||||
ld b, 40 percent
|
ld b, 40 percent
|
||||||
jr z, .ok
|
jr z, .ok
|
||||||
|
@ -195,14 +195,14 @@ CopyCoordsTileToLastCoordsTile:
|
|||||||
ld hl, OBJECT_LAST_MAP_Y
|
ld hl, OBJECT_LAST_MAP_Y
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld hl, OBJECT_LAST_TILE
|
ld hl, OBJECT_LAST_TILE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
call SetTallGrassFlags
|
call SetTallGrassFlags
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
call UselessAndA
|
call UselessAndA
|
||||||
@ -228,12 +228,12 @@ UpdateTallGrassFlags:
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
bit OVERHEAD_F, [hl]
|
bit OVERHEAD_F, [hl]
|
||||||
jr z, .ok
|
jr z, .ok
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
call SetTallGrassFlags
|
call SetTallGrassFlags
|
||||||
.ok
|
.ok
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
call UselessAndA
|
call UselessAndA
|
||||||
@ -321,9 +321,9 @@ GetNextTile:
|
|||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld e, a
|
ld e, a
|
||||||
push bc
|
push bc
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
pop bc
|
pop bc
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ret
|
ret
|
||||||
@ -502,9 +502,9 @@ StepFunction_Reset:
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
ld e, [hl]
|
ld e, [hl]
|
||||||
push bc
|
push bc
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
pop bc
|
pop bc
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
call CopyCoordsTileToLastCoordsTile
|
call CopyCoordsTileToLastCoordsTile
|
||||||
@ -656,7 +656,7 @@ MovementFunction_Strength:
|
|||||||
dw .stop
|
dw .stop
|
||||||
|
|
||||||
.start:
|
.start:
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
call CheckPitTile
|
call CheckPitTile
|
||||||
@ -2278,9 +2278,9 @@ UpdateObjectTile:
|
|||||||
ld hl, OBJECT_MAP_Y
|
ld hl, OBJECT_MAP_Y
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld e, [hl]
|
ld e, [hl]
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
pop bc
|
pop bc
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
call UpdateTallGrassFlags
|
call UpdateTallGrassFlags
|
||||||
|
@ -668,7 +668,7 @@ NormalStep:
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], OBJECT_ACTION_STEP
|
ld [hl], OBJECT_ACTION_STEP
|
||||||
|
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
call CheckSuperTallGrassTile
|
call CheckSuperTallGrassTile
|
||||||
|
@ -70,11 +70,11 @@ WillObjectBumpIntoWater:
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
bit OAM_PRIORITY, [hl]
|
bit OAM_PRIORITY, [hl]
|
||||||
jp nz, WillObjectRemainOnWater
|
jp nz, WillObjectRemainOnWater
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld d, a
|
ld d, a
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
and a ; LAND_TILE
|
and a ; LAND_TILE
|
||||||
jr z, WillObjectBumpIntoTile
|
jr z, WillObjectBumpIntoTile
|
||||||
scf
|
scf
|
||||||
@ -83,17 +83,17 @@ WillObjectBumpIntoWater:
|
|||||||
WillObjectBumpIntoLand:
|
WillObjectBumpIntoLand:
|
||||||
call CanObjectLeaveTile
|
call CanObjectLeaveTile
|
||||||
ret c
|
ret c
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
cp WATER_TILE
|
cp WATER_TILE
|
||||||
jr z, WillObjectBumpIntoTile
|
jr z, WillObjectBumpIntoTile
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
||||||
WillObjectBumpIntoTile:
|
WillObjectBumpIntoTile:
|
||||||
ld hl, OBJECT_TILE
|
ld hl, OBJECT_TILE_COLLISION
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
call GetSideWallDirectionMask
|
call GetSideWallDirectionMask
|
||||||
@ -210,13 +210,13 @@ WillObjectRemainOnWater:
|
|||||||
inc e
|
inc e
|
||||||
|
|
||||||
.continue
|
.continue
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
pop de
|
pop de
|
||||||
and a ; LAND_TILE
|
and a ; LAND_TILE
|
||||||
jr nz, .not_land
|
jr nz, .not_land
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
and a ; LAND_TILE
|
and a ; LAND_TILE
|
||||||
jr nz, .not_land
|
jr nz, .not_land
|
||||||
xor a
|
xor a
|
||||||
|
@ -162,14 +162,14 @@ DoPlayerMovement::
|
|||||||
ld e, a
|
ld e, a
|
||||||
push de
|
push de
|
||||||
inc e
|
inc e
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
cp COLL_OUT_OF_BOUNDS
|
cp COLL_OUT_OF_BOUNDS
|
||||||
jr nz, .next1
|
jr nz, .next1
|
||||||
ld [wTileDown], a
|
ld [wTileDown], a
|
||||||
.next1
|
.next1
|
||||||
pop de
|
pop de
|
||||||
dec e
|
dec e
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
cp COLL_OUT_OF_BOUNDS
|
cp COLL_OUT_OF_BOUNDS
|
||||||
jr nz, .next2
|
jr nz, .next2
|
||||||
ld [wTileUp], a
|
ld [wTileUp], a
|
||||||
@ -181,14 +181,14 @@ DoPlayerMovement::
|
|||||||
ld e, a
|
ld e, a
|
||||||
push de
|
push de
|
||||||
dec d
|
dec d
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
cp COLL_OUT_OF_BOUNDS
|
cp COLL_OUT_OF_BOUNDS
|
||||||
jr nz, .next3
|
jr nz, .next3
|
||||||
ld [wTileLeft], a
|
ld [wTileLeft], a
|
||||||
.next3
|
.next3
|
||||||
pop de
|
pop de
|
||||||
inc d
|
inc d
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
cp COLL_OUT_OF_BOUNDS
|
cp COLL_OUT_OF_BOUNDS
|
||||||
jr nz, .next4
|
jr nz, .next4
|
||||||
ld [wTileRight], a
|
ld [wTileRight], a
|
||||||
@ -311,7 +311,7 @@ DoPlayerMovement::
|
|||||||
; Tiles such as waterfalls and warps move the player
|
; Tiles such as waterfalls and warps move the player
|
||||||
; in a given direction, overriding input.
|
; in a given direction, overriding input.
|
||||||
|
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
ld c, a
|
ld c, a
|
||||||
call CheckWhirlpoolTile
|
call CheckWhirlpoolTile
|
||||||
jr c, .not_whirlpool
|
jr c, .not_whirlpool
|
||||||
@ -474,7 +474,7 @@ DoPlayerMovement::
|
|||||||
cp 2
|
cp 2
|
||||||
jr z, .bump
|
jr z, .bump
|
||||||
|
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
call CheckIceTile
|
call CheckIceTile
|
||||||
jr nc, .ice
|
jr nc, .ice
|
||||||
|
|
||||||
@ -552,7 +552,7 @@ DoPlayerMovement::
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.TryJump:
|
.TryJump:
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
ld e, a
|
ld e, a
|
||||||
and $f0
|
and $f0
|
||||||
cp HI_NYBBLE_LEDGES
|
cp HI_NYBBLE_LEDGES
|
||||||
@ -598,7 +598,7 @@ DoPlayerMovement::
|
|||||||
ld d, 0
|
ld d, 0
|
||||||
ld hl, .EdgeWarps
|
ld hl, .EdgeWarps
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
cp [hl]
|
cp [hl]
|
||||||
jr nz, .not_warp
|
jr nz, .not_warp
|
||||||
|
|
||||||
@ -790,7 +790,7 @@ DoPlayerMovement::
|
|||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wWalkingTile], a
|
ld [wWalkingTileCollision], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
MACRO player_action
|
MACRO player_action
|
||||||
@ -801,7 +801,7 @@ ENDM
|
|||||||
|
|
||||||
.action_table:
|
.action_table:
|
||||||
.action_table_1
|
.action_table_1
|
||||||
player_action STANDING, FACE_CURRENT, 0, 0, wPlayerTile
|
player_action STANDING, FACE_CURRENT, 0, 0, wPlayerTileCollision
|
||||||
.action_table_1_end
|
.action_table_1_end
|
||||||
player_action RIGHT, FACE_RIGHT, 1, 0, wTileRight
|
player_action RIGHT, FACE_RIGHT, 1, 0, wTileRight
|
||||||
player_action LEFT, FACE_LEFT, -1, 0, wTileLeft
|
player_action LEFT, FACE_LEFT, -1, 0, wTileLeft
|
||||||
@ -891,7 +891,7 @@ ENDM
|
|||||||
and d
|
and d
|
||||||
jr nz, .NotWalkable
|
jr nz, .NotWalkable
|
||||||
|
|
||||||
ld a, [wWalkingTile]
|
ld a, [wWalkingTileCollision]
|
||||||
call .CheckWalkable
|
call .CheckWalkable
|
||||||
jr c, .NotWalkable
|
jr c, .NotWalkable
|
||||||
|
|
||||||
@ -912,7 +912,7 @@ ENDM
|
|||||||
and d
|
and d
|
||||||
jr nz, .NotSurfable
|
jr nz, .NotSurfable
|
||||||
|
|
||||||
ld a, [wWalkingTile]
|
ld a, [wWalkingTileCollision]
|
||||||
call .CheckSurfable
|
call .CheckSurfable
|
||||||
jr c, .NotSurfable
|
jr c, .NotSurfable
|
||||||
|
|
||||||
@ -933,7 +933,7 @@ ENDM
|
|||||||
.CheckWalkable:
|
.CheckWalkable:
|
||||||
; Return 0 if tile a is land. Otherwise, return carry.
|
; Return 0 if tile a is land. Otherwise, return carry.
|
||||||
|
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
and a ; LAND_TILE
|
and a ; LAND_TILE
|
||||||
ret z
|
ret z
|
||||||
cp SPACE_TILE
|
cp SPACE_TILE
|
||||||
@ -945,7 +945,7 @@ ENDM
|
|||||||
; Return 0 if tile a is water, or 1 if land.
|
; Return 0 if tile a is water, or 1 if land.
|
||||||
; Otherwise, return carry.
|
; Otherwise, return carry.
|
||||||
|
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
cp WATER_TILE
|
cp WATER_TILE
|
||||||
jr z, .Water
|
jr z, .Water
|
||||||
; because this is called during PLAYER_SURF or PLAYER_SURF_PIKA state,
|
; because this is called during PLAYER_SURF or PLAYER_SURF_PIKA state,
|
||||||
@ -986,7 +986,7 @@ CheckStandingOnIce::
|
|||||||
jr z, .not_ice
|
jr z, .not_ice
|
||||||
cp $f0
|
cp $f0
|
||||||
jr z, .not_ice
|
jr z, .not_ice
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
call CheckIceTile
|
call CheckIceTile
|
||||||
jr nc, .yep
|
jr nc, .yep
|
||||||
ld a, [wPlayerState]
|
ld a, [wPlayerState]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
CheckWarpCollision::
|
CheckWarpCollision::
|
||||||
; Is this tile a warp?
|
; Is this tile a warp?
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
cp COLL_PIT
|
cp COLL_PIT
|
||||||
jr z, .warp
|
jr z, .warp
|
||||||
cp COLL_PIT_68
|
cp COLL_PIT_68
|
||||||
@ -18,7 +18,7 @@ CheckWarpCollision::
|
|||||||
CheckDirectionalWarp::
|
CheckDirectionalWarp::
|
||||||
; If this is a directional warp, clear carry (press the designated button to warp).
|
; If this is a directional warp, clear carry (press the designated button to warp).
|
||||||
; Else, set carry (immediate warp).
|
; Else, set carry (immediate warp).
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
cp COLL_WARP_CARPET_DOWN
|
cp COLL_WARP_CARPET_DOWN
|
||||||
jr z, .directional
|
jr z, .directional
|
||||||
cp COLL_WARP_CARPET_LEFT
|
cp COLL_WARP_CARPET_LEFT
|
||||||
@ -37,7 +37,7 @@ CheckDirectionalWarp::
|
|||||||
CheckWarpFacingDown:
|
CheckWarpFacingDown:
|
||||||
ld de, 1
|
ld de, 1
|
||||||
ld hl, .blocks
|
ld hl, .blocks
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
call IsInArray
|
call IsInArray
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ CheckWarpFacingDown:
|
|||||||
db -1
|
db -1
|
||||||
|
|
||||||
CheckGrassCollision::
|
CheckGrassCollision::
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
ld hl, .blocks
|
ld hl, .blocks
|
||||||
ld de, 1
|
ld de, 1
|
||||||
call IsInArray
|
call IsInArray
|
||||||
@ -90,7 +90,7 @@ CheckCutCollision:
|
|||||||
db -1
|
db -1
|
||||||
|
|
||||||
GetWarpSFX::
|
GetWarpSFX::
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
ld de, SFX_ENTER_DOOR
|
ld de, SFX_ENTER_DOOR
|
||||||
cp COLL_DOOR
|
cp COLL_DOOR
|
||||||
ret z
|
ret z
|
||||||
|
16
home/map.asm
16
home/map.asm
@ -1739,12 +1739,12 @@ GetMovementPermissions::
|
|||||||
ld d, a
|
ld d, a
|
||||||
ld a, [wPlayerMapY]
|
ld a, [wPlayerMapY]
|
||||||
ld e, a
|
ld e, a
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
ld [wPlayerTile], a
|
ld [wPlayerTileCollision], a
|
||||||
call .CheckHiNybble
|
call .CheckHiNybble
|
||||||
ret nz
|
ret nz
|
||||||
|
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
and 7
|
and 7
|
||||||
ld hl, .MovementPermissionsData
|
ld hl, .MovementPermissionsData
|
||||||
add l
|
add l
|
||||||
@ -1776,13 +1776,13 @@ GetMovementPermissions::
|
|||||||
|
|
||||||
push de
|
push de
|
||||||
inc e
|
inc e
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
ld [wTileDown], a
|
ld [wTileDown], a
|
||||||
call .Down
|
call .Down
|
||||||
|
|
||||||
pop de
|
pop de
|
||||||
dec e
|
dec e
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
ld [wTileUp], a
|
ld [wTileUp], a
|
||||||
call .Up
|
call .Up
|
||||||
ret
|
ret
|
||||||
@ -1795,13 +1795,13 @@ GetMovementPermissions::
|
|||||||
|
|
||||||
push de
|
push de
|
||||||
dec d
|
dec d
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
ld [wTileLeft], a
|
ld [wTileLeft], a
|
||||||
call .Left
|
call .Left
|
||||||
|
|
||||||
pop de
|
pop de
|
||||||
inc d
|
inc d
|
||||||
call GetCoordTile
|
call GetCoordTileCollision
|
||||||
ld [wTileRight], a
|
ld [wTileRight], a
|
||||||
call .Right
|
call .Right
|
||||||
ret
|
ret
|
||||||
@ -1929,7 +1929,7 @@ GetFacingTileCoord::
|
|||||||
db 1, 0
|
db 1, 0
|
||||||
dw wTileRight
|
dw wTileRight
|
||||||
|
|
||||||
GetCoordTile::
|
GetCoordTileCollision::
|
||||||
; Get the collision byte for tile d, e
|
; Get the collision byte for tile d, e
|
||||||
call GetBlockLocation
|
call GetBlockLocation
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
|
@ -71,9 +71,9 @@ DoesSpriteHaveFacings::
|
|||||||
pop de
|
pop de
|
||||||
ret
|
ret
|
||||||
|
|
||||||
GetPlayerTile::
|
GetPlayerTilePermission::
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
ld b, a
|
ld b, a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -81,8 +81,8 @@ CheckOnWater::
|
|||||||
; return z if on water, nz otherwise.
|
; return z if on water, nz otherwise.
|
||||||
; if tile permission is SPACE_TILE, wPlayerState dictates whether player is on water or not.
|
; if tile permission is SPACE_TILE, wPlayerState dictates whether player is on water or not.
|
||||||
; otherwise the current tile permission being LAND_TILE or WATER_TILE dictates it.
|
; otherwise the current tile permission being LAND_TILE or WATER_TILE dictates it.
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
call GetTileCollision
|
call GetTilePermission
|
||||||
cp SPACE_TILE
|
cp SPACE_TILE
|
||||||
jr z, .check_player_state
|
jr z, .check_player_state
|
||||||
sub WATER_TILE
|
sub WATER_TILE
|
||||||
@ -97,20 +97,20 @@ CheckOnWater::
|
|||||||
cp PLAYER_SURF_PIKA
|
cp PLAYER_SURF_PIKA
|
||||||
ret
|
ret
|
||||||
|
|
||||||
GetTileCollision::
|
GetTilePermission::
|
||||||
; Get the collision type of tile a.
|
; Get the permission of tile collision a.
|
||||||
|
|
||||||
push de
|
push de
|
||||||
push hl
|
push hl
|
||||||
|
|
||||||
ld hl, TileCollisionTable
|
ld hl, CollisionPermissionTable
|
||||||
ld e, a
|
ld e, a
|
||||||
ld d, 0
|
ld d, 0
|
||||||
add hl, de
|
add hl, de
|
||||||
|
|
||||||
ldh a, [hROMBank]
|
ldh a, [hROMBank]
|
||||||
push af
|
push af
|
||||||
ld a, BANK(TileCollisionTable)
|
ld a, BANK(CollisionPermissionTable)
|
||||||
rst Bankswitch
|
rst Bankswitch
|
||||||
ld e, [hl]
|
ld e, [hl]
|
||||||
pop af
|
pop af
|
||||||
@ -201,7 +201,7 @@ CheckWaterfallTile::
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
CheckStandingOnEntrance::
|
CheckStandingOnEntrance::
|
||||||
ld a, [wPlayerTile]
|
ld a, [wPlayerTileCollision]
|
||||||
cp COLL_DOOR
|
cp COLL_DOOR
|
||||||
ret z
|
ret z
|
||||||
cp COLL_DOOR_79
|
cp COLL_DOOR_79
|
||||||
|
@ -307,7 +307,7 @@ MACRO object_struct
|
|||||||
\1Action:: db
|
\1Action:: db
|
||||||
\1StepFrame:: db
|
\1StepFrame:: db
|
||||||
\1Facing:: db
|
\1Facing:: db
|
||||||
\1Tile:: db
|
\1TileCollision:: db
|
||||||
\1LastTile:: db
|
\1LastTile:: db
|
||||||
\1MapX:: db
|
\1MapX:: db
|
||||||
\1MapY:: db
|
\1MapY:: db
|
||||||
|
@ -1666,7 +1666,7 @@ wWalkingDirection:: db
|
|||||||
wFacingDirection:: db
|
wFacingDirection:: db
|
||||||
wWalkingX:: db
|
wWalkingX:: db
|
||||||
wWalkingY:: db
|
wWalkingY:: db
|
||||||
wWalkingTile:: db
|
wWalkingTileCollision:: db
|
||||||
ds 7
|
ds 7
|
||||||
wPlayerTurningDirection:: db
|
wPlayerTurningDirection:: db
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user