You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
28
home/map.asm
28
home/map.asm
@@ -246,10 +246,10 @@ GetDestinationWarpNumber::
|
||||
ret
|
||||
|
||||
.GetDestinationWarpNumber:
|
||||
ld a, [wPlayerStandingMapY]
|
||||
ld a, [wPlayerMapY]
|
||||
sub 4
|
||||
ld e, a
|
||||
ld a, [wPlayerStandingMapX]
|
||||
ld a, [wPlayerMapX]
|
||||
sub 4
|
||||
ld d, a
|
||||
ld a, [wCurMapWarpCount]
|
||||
@@ -1514,16 +1514,16 @@ GetMovementPermissions::
|
||||
call .LeftRight
|
||||
call .UpDown
|
||||
; get coords of current tile
|
||||
ld a, [wPlayerStandingMapX]
|
||||
ld a, [wPlayerMapX]
|
||||
ld d, a
|
||||
ld a, [wPlayerStandingMapY]
|
||||
ld a, [wPlayerMapY]
|
||||
ld e, a
|
||||
call GetCoordTile
|
||||
ld [wPlayerStandingTile], a
|
||||
ld [wPlayerTile], a
|
||||
call .CheckHiNybble
|
||||
ret nz
|
||||
|
||||
ld a, [wPlayerStandingTile]
|
||||
ld a, [wPlayerTile]
|
||||
and 7
|
||||
ld hl, .MovementPermissionsData
|
||||
add l
|
||||
@@ -1548,9 +1548,9 @@ GetMovementPermissions::
|
||||
db UP_MASK | LEFT_MASK
|
||||
|
||||
.UpDown:
|
||||
ld a, [wPlayerStandingMapX]
|
||||
ld a, [wPlayerMapX]
|
||||
ld d, a
|
||||
ld a, [wPlayerStandingMapY]
|
||||
ld a, [wPlayerMapY]
|
||||
ld e, a
|
||||
|
||||
push de
|
||||
@@ -1567,9 +1567,9 @@ GetMovementPermissions::
|
||||
ret
|
||||
|
||||
.LeftRight:
|
||||
ld a, [wPlayerStandingMapX]
|
||||
ld a, [wPlayerMapX]
|
||||
ld d, a
|
||||
ld a, [wPlayerStandingMapY]
|
||||
ld a, [wPlayerMapY]
|
||||
ld e, a
|
||||
|
||||
push de
|
||||
@@ -1688,10 +1688,10 @@ GetFacingTileCoord::
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
|
||||
ld a, [wPlayerStandingMapX]
|
||||
ld a, [wPlayerMapX]
|
||||
add d
|
||||
ld d, a
|
||||
ld a, [wPlayerStandingMapY]
|
||||
ld a, [wPlayerMapY]
|
||||
add e
|
||||
ld e, a
|
||||
ld a, [hl]
|
||||
@@ -1861,10 +1861,10 @@ CheckCurrentMapCoordEvents::
|
||||
call CheckScenes
|
||||
ld b, a
|
||||
; Load your current coordinates into de. This will be used to check if your position is in the coord event table for the current map.
|
||||
ld a, [wPlayerStandingMapX]
|
||||
ld a, [wPlayerMapX]
|
||||
sub 4
|
||||
ld d, a
|
||||
ld a, [wPlayerStandingMapY]
|
||||
ld a, [wPlayerMapY]
|
||||
sub 4
|
||||
ld e, a
|
||||
|
||||
|
@@ -71,14 +71,14 @@ DoesSpriteHaveFacings::
|
||||
pop de
|
||||
ret
|
||||
|
||||
GetPlayerStandingTile::
|
||||
ld a, [wPlayerStandingTile]
|
||||
GetPlayerTile::
|
||||
ld a, [wPlayerTile]
|
||||
call GetTileCollision
|
||||
ld b, a
|
||||
ret
|
||||
|
||||
CheckOnWater::
|
||||
ld a, [wPlayerStandingTile]
|
||||
ld a, [wPlayerTile]
|
||||
call GetTileCollision
|
||||
sub WATER_TILE
|
||||
ret z
|
||||
@@ -189,7 +189,7 @@ CheckWaterfallTile::
|
||||
ret
|
||||
|
||||
CheckStandingOnEntrance::
|
||||
ld a, [wPlayerStandingTile]
|
||||
ld a, [wPlayerTile]
|
||||
cp COLL_DOOR
|
||||
ret z
|
||||
cp COLL_DOOR_79
|
||||
@@ -404,7 +404,7 @@ LoadMovementDataPointer::
|
||||
call CheckObjectVisibility
|
||||
ret c
|
||||
|
||||
ld hl, OBJECT_MOVEMENTTYPE
|
||||
ld hl, OBJECT_MOVEMENT_TYPE
|
||||
add hl, bc
|
||||
ld [hl], SPRITEMOVEDATA_SCRIPTED
|
||||
|
||||
@@ -447,7 +447,7 @@ FindFirstEmptyObjectStruct::
|
||||
ret
|
||||
|
||||
GetSpriteMovementFunction::
|
||||
ld hl, OBJECT_MOVEMENTTYPE
|
||||
ld hl, OBJECT_MOVEMENT_TYPE
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
cp NUM_SPRITEMOVEDATA
|
||||
@@ -500,7 +500,7 @@ CopySpriteMovementData::
|
||||
ret
|
||||
|
||||
.CopyData:
|
||||
ld hl, OBJECT_MOVEMENTTYPE
|
||||
ld hl, OBJECT_MOVEMENT_TYPE
|
||||
add hl, de
|
||||
ld [hl], a
|
||||
|
||||
@@ -520,7 +520,7 @@ endr
|
||||
rlca
|
||||
rlca
|
||||
maskbits NUM_DIRECTIONS, 2
|
||||
ld hl, OBJECT_FACING
|
||||
ld hl, OBJECT_DIRECTION
|
||||
add hl, de
|
||||
ld [hl], a
|
||||
|
||||
@@ -549,16 +549,16 @@ endr
|
||||
ld [hl], a
|
||||
ret
|
||||
|
||||
_GetMovementByte::
|
||||
_GetMovementIndex::
|
||||
; Switch to the movement data bank
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ld a, [hli]
|
||||
rst Bankswitch
|
||||
; Load the current script byte as given by OBJECT_MOVEMENT_BYTE_INDEX, and increment OBJECT_MOVEMENT_BYTE_INDEX
|
||||
; Load the current script byte as given by OBJECT_MOVEMENT_INDEX, and increment OBJECT_MOVEMENT_INDEX
|
||||
ld a, [hli]
|
||||
ld d, [hl]
|
||||
ld hl, OBJECT_MOVEMENT_BYTE_INDEX
|
||||
ld hl, OBJECT_MOVEMENT_INDEX
|
||||
add hl, bc
|
||||
add [hl]
|
||||
ld e, a
|
||||
@@ -611,7 +611,7 @@ DoesObjectHaveASprite::
|
||||
SetSpriteDirection::
|
||||
; preserves other flags
|
||||
push af
|
||||
ld hl, OBJECT_FACING
|
||||
ld hl, OBJECT_DIRECTION
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and %11110011
|
||||
@@ -623,7 +623,7 @@ SetSpriteDirection::
|
||||
ret
|
||||
|
||||
GetSpriteDirection::
|
||||
ld hl, OBJECT_FACING
|
||||
ld hl, OBJECT_DIRECTION
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
maskbits NUM_DIRECTIONS, 2
|
||||
|
@@ -38,10 +38,10 @@ HandleStoneQueue::
|
||||
.IsObjectOnWarp:
|
||||
push de
|
||||
|
||||
ld hl, OBJECT_NEXT_MAP_X
|
||||
ld hl, OBJECT_MAP_X
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
ld hl, OBJECT_NEXT_MAP_Y
|
||||
ld hl, OBJECT_MAP_Y
|
||||
add hl, de
|
||||
ld e, [hl]
|
||||
|
||||
|
@@ -138,19 +138,19 @@ FacingPlayerDistance::
|
||||
; Return carry if the sprite at bc is facing the player,
|
||||
; its distance in d, and its direction in e.
|
||||
|
||||
ld hl, OBJECT_NEXT_MAP_X ; x
|
||||
ld hl, OBJECT_MAP_X ; x
|
||||
add hl, bc
|
||||
ld d, [hl]
|
||||
|
||||
ld hl, OBJECT_NEXT_MAP_Y ; y
|
||||
ld hl, OBJECT_MAP_Y ; y
|
||||
add hl, bc
|
||||
ld e, [hl]
|
||||
|
||||
ld a, [wPlayerStandingMapX]
|
||||
ld a, [wPlayerMapX]
|
||||
cp d
|
||||
jr z, .CheckY
|
||||
|
||||
ld a, [wPlayerStandingMapY]
|
||||
ld a, [wPlayerMapY]
|
||||
cp e
|
||||
jr z, .CheckX
|
||||
|
||||
@@ -158,7 +158,7 @@ FacingPlayerDistance::
|
||||
ret
|
||||
|
||||
.CheckY:
|
||||
ld a, [wPlayerStandingMapY]
|
||||
ld a, [wPlayerMapY]
|
||||
sub e
|
||||
jr z, .NotFacing
|
||||
jr nc, .Above
|
||||
@@ -176,7 +176,7 @@ FacingPlayerDistance::
|
||||
jr .CheckFacing
|
||||
|
||||
.CheckX:
|
||||
ld a, [wPlayerStandingMapX]
|
||||
ld a, [wPlayerMapX]
|
||||
sub d
|
||||
jr z, .NotFacing
|
||||
jr nc, .Left
|
||||
|
Reference in New Issue
Block a user