Apply e0c278a595bdd0b724607e14398a3c340860b449 from pokecrystal

This commit is contained in:
xCrystal
2024-02-11 00:25:25 +01:00
parent 5c4d982702
commit b1fd8f941a
17 changed files with 80 additions and 80 deletions

View File

@@ -368,7 +368,7 @@ SurfFunction:
cp PLAYER_SURF_PIKA
jr z, .alreadyfail
call GetFacingTileCoord
call GetTileCollision
call GetTilePermission
cp WATER_TILE
jr nz, .cannotsurf
call CheckDirection
@@ -510,7 +510,7 @@ TrySurfOW::
; Must be facing water.
ld a, [wFacingTileID]
call GetTileCollision
call GetTilePermission
cp WATER_TILE
jr nz, .quit
@@ -718,7 +718,7 @@ Script_UsedWaterfall:
CheckContinueWaterfall:
xor a
ldh [hScriptVar], a
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
call CheckWaterfallTile
ret z
ld a, $1
@@ -1485,7 +1485,7 @@ FishFunction:
cp PLAYER_SURF_PIKA
jr z, .fail
call GetFacingTileCoord
call GetTileCollision
call GetTilePermission
cp WATER_TILE
jr z, .facingwater
.fail
@@ -1724,7 +1724,7 @@ BikeFunction:
jr z, .nope
.ok
call GetPlayerTile
call GetPlayerTilePermission
and $f ; lo nybble only
jr nz, .nope ; not FLOOR_TILE
xor a

View File

@@ -271,7 +271,7 @@ CmdQueue_StoneTable:
cp SPRITEMOVEDATA_STRENGTH_BOULDER
jr nz, .next
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, de
ld a, [hl]
call CheckPitTile

View File

@@ -456,11 +456,11 @@ CheckBoardEvent:
.next
; space handler
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
and $f0
cp HI_NYBBLE_SPACES
jr nz, .no_space_effect
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
and $0f
ld e, a
ld d, 0
@@ -598,7 +598,7 @@ CheckTileEvent:
ret
.warp_tile
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
call CheckPitTile
jr nz, .not_pit
ld a, PLAYEREVENT_FALL
@@ -758,7 +758,7 @@ CheckFacingTileEvent:
; Must be facing water.
ld a, [wFacingTileID]
call GetTileCollision
call GetTilePermission
cp WATER_TILE
jr nz, .next_event_1
@@ -1587,7 +1587,7 @@ CanEncounterWildMon::
jr nc, .no
.ice_check
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
call CheckIceTile
jr z, .no
scf
@@ -1658,7 +1658,7 @@ ChooseWildEncounter_BugContest::
ret
TryWildEncounter_BugContest:
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
call CheckSuperTallGrassTile
ld b, 40 percent
jr z, .ok

View File

@@ -195,14 +195,14 @@ CopyCoordsTileToLastCoordsTile:
ld hl, OBJECT_LAST_MAP_Y
add hl, bc
ld [hl], a
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld a, [hl]
ld hl, OBJECT_LAST_TILE
add hl, bc
ld [hl], a
call SetTallGrassFlags
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld a, [hl]
call UselessAndA
@@ -228,12 +228,12 @@ UpdateTallGrassFlags:
add hl, bc
bit OVERHEAD_F, [hl]
jr z, .ok
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld a, [hl]
call SetTallGrassFlags
.ok
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld a, [hl]
call UselessAndA
@@ -321,9 +321,9 @@ GetNextTile:
ld [hl], a
ld e, a
push bc
call GetCoordTile
call GetCoordTileCollision
pop bc
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld [hl], a
ret
@@ -502,9 +502,9 @@ StepFunction_Reset:
add hl, bc
ld e, [hl]
push bc
call GetCoordTile
call GetCoordTileCollision
pop bc
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld [hl], a
call CopyCoordsTileToLastCoordsTile
@@ -656,7 +656,7 @@ MovementFunction_Strength:
dw .stop
.start:
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld a, [hl]
call CheckPitTile
@@ -2278,9 +2278,9 @@ UpdateObjectTile:
ld hl, OBJECT_MAP_Y
add hl, bc
ld e, [hl]
call GetCoordTile
call GetCoordTileCollision
pop bc
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld [hl], a
call UpdateTallGrassFlags

View File

@@ -668,7 +668,7 @@ NormalStep:
add hl, bc
ld [hl], OBJECT_ACTION_STEP
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld a, [hl]
call CheckSuperTallGrassTile

View File

@@ -70,11 +70,11 @@ WillObjectBumpIntoWater:
add hl, bc
bit OAM_PRIORITY, [hl]
jp nz, WillObjectRemainOnWater
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld a, [hl]
ld d, a
call GetTileCollision
call GetTilePermission
and a ; LAND_TILE
jr z, WillObjectBumpIntoTile
scf
@@ -83,17 +83,17 @@ WillObjectBumpIntoWater:
WillObjectBumpIntoLand:
call CanObjectLeaveTile
ret c
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld a, [hl]
call GetTileCollision
call GetTilePermission
cp WATER_TILE
jr z, WillObjectBumpIntoTile
scf
ret
WillObjectBumpIntoTile:
ld hl, OBJECT_TILE
ld hl, OBJECT_TILE_COLLISION
add hl, bc
ld a, [hl]
call GetSideWallDirectionMask
@@ -210,13 +210,13 @@ WillObjectRemainOnWater:
inc e
.continue
call GetCoordTile
call GetTileCollision
call GetCoordTileCollision
call GetTilePermission
pop de
and a ; LAND_TILE
jr nz, .not_land
call GetCoordTile
call GetTileCollision
call GetCoordTileCollision
call GetTilePermission
and a ; LAND_TILE
jr nz, .not_land
xor a

View File

@@ -162,14 +162,14 @@ DoPlayerMovement::
ld e, a
push de
inc e
call GetCoordTile
call GetCoordTileCollision
cp COLL_OUT_OF_BOUNDS
jr nz, .next1
ld [wTileDown], a
.next1
pop de
dec e
call GetCoordTile
call GetCoordTileCollision
cp COLL_OUT_OF_BOUNDS
jr nz, .next2
ld [wTileUp], a
@@ -181,14 +181,14 @@ DoPlayerMovement::
ld e, a
push de
dec d
call GetCoordTile
call GetCoordTileCollision
cp COLL_OUT_OF_BOUNDS
jr nz, .next3
ld [wTileLeft], a
.next3
pop de
inc d
call GetCoordTile
call GetCoordTileCollision
cp COLL_OUT_OF_BOUNDS
jr nz, .next4
ld [wTileRight], a
@@ -311,7 +311,7 @@ DoPlayerMovement::
; Tiles such as waterfalls and warps move the player
; in a given direction, overriding input.
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
ld c, a
call CheckWhirlpoolTile
jr c, .not_whirlpool
@@ -474,7 +474,7 @@ DoPlayerMovement::
cp 2
jr z, .bump
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
call CheckIceTile
jr nc, .ice
@@ -552,7 +552,7 @@ DoPlayerMovement::
ret
.TryJump:
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
ld e, a
and $f0
cp HI_NYBBLE_LEDGES
@@ -598,7 +598,7 @@ DoPlayerMovement::
ld d, 0
ld hl, .EdgeWarps
add hl, de
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
cp [hl]
jr nz, .not_warp
@@ -790,7 +790,7 @@ DoPlayerMovement::
ld h, [hl]
ld l, a
ld a, [hl]
ld [wWalkingTile], a
ld [wWalkingTileCollision], a
ret
MACRO player_action
@@ -801,7 +801,7 @@ ENDM
.action_table:
.action_table_1
player_action STANDING, FACE_CURRENT, 0, 0, wPlayerTile
player_action STANDING, FACE_CURRENT, 0, 0, wPlayerTileCollision
.action_table_1_end
player_action RIGHT, FACE_RIGHT, 1, 0, wTileRight
player_action LEFT, FACE_LEFT, -1, 0, wTileLeft
@@ -891,7 +891,7 @@ ENDM
and d
jr nz, .NotWalkable
ld a, [wWalkingTile]
ld a, [wWalkingTileCollision]
call .CheckWalkable
jr c, .NotWalkable
@@ -912,7 +912,7 @@ ENDM
and d
jr nz, .NotSurfable
ld a, [wWalkingTile]
ld a, [wWalkingTileCollision]
call .CheckSurfable
jr c, .NotSurfable
@@ -933,7 +933,7 @@ ENDM
.CheckWalkable:
; Return 0 if tile a is land. Otherwise, return carry.
call GetTileCollision
call GetTilePermission
and a ; LAND_TILE
ret z
cp SPACE_TILE
@@ -945,7 +945,7 @@ ENDM
; Return 0 if tile a is water, or 1 if land.
; Otherwise, return carry.
call GetTileCollision
call GetTilePermission
cp WATER_TILE
jr z, .Water
; because this is called during PLAYER_SURF or PLAYER_SURF_PIKA state,
@@ -986,7 +986,7 @@ CheckStandingOnIce::
jr z, .not_ice
cp $f0
jr z, .not_ice
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
call CheckIceTile
jr nc, .yep
ld a, [wPlayerState]

View File

@@ -1,6 +1,6 @@
CheckWarpCollision::
; Is this tile a warp?
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
cp COLL_PIT
jr z, .warp
cp COLL_PIT_68
@@ -18,7 +18,7 @@ CheckWarpCollision::
CheckDirectionalWarp::
; If this is a directional warp, clear carry (press the designated button to warp).
; Else, set carry (immediate warp).
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
cp COLL_WARP_CARPET_DOWN
jr z, .directional
cp COLL_WARP_CARPET_LEFT
@@ -37,7 +37,7 @@ CheckDirectionalWarp::
CheckWarpFacingDown:
ld de, 1
ld hl, .blocks
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
call IsInArray
ret
@@ -54,7 +54,7 @@ CheckWarpFacingDown:
db -1
CheckGrassCollision::
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
ld hl, .blocks
ld de, 1
call IsInArray
@@ -90,7 +90,7 @@ CheckCutCollision:
db -1
GetWarpSFX::
ld a, [wPlayerTile]
ld a, [wPlayerTileCollision]
ld de, SFX_ENTER_DOOR
cp COLL_DOOR
ret z