mirror of
https://github.com/thornAvery/jep-hack.git
synced 2026-04-04 10:31:47 +13:00
First Commit
Upload literally everything from the pokecrystal16 expand-move-ID branch
This commit is contained in:
commit
2f8a41f833
4618 changed files with 480386 additions and 0 deletions
82
engine/overworld/landmarks.asm
Normal file
82
engine/overworld/landmarks.asm
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
GetLandmarkCoords:
|
||||
; Return coordinates (d, e) of landmark e.
|
||||
push hl
|
||||
ld l, e
|
||||
ld h, 0
|
||||
add hl, hl
|
||||
add hl, hl
|
||||
ld de, Landmarks
|
||||
add hl, de
|
||||
ld a, [hli]
|
||||
ld e, a
|
||||
ld d, [hl]
|
||||
pop hl
|
||||
ret
|
||||
|
||||
GetLandmarkName::
|
||||
; Copy the name of landmark e to wStringBuffer1.
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
|
||||
ld l, e
|
||||
ld h, 0
|
||||
add hl, hl
|
||||
add hl, hl
|
||||
ld de, Landmarks + 2
|
||||
add hl, de
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
|
||||
ld de, wStringBuffer1
|
||||
ld c, 18
|
||||
.copy
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
inc de
|
||||
dec c
|
||||
jr nz, .copy
|
||||
|
||||
pop bc
|
||||
pop de
|
||||
pop hl
|
||||
ret
|
||||
|
||||
INCLUDE "data/maps/landmarks.asm"
|
||||
|
||||
RegionCheck:
|
||||
; Checks if the player is in Kanto or Johto.
|
||||
; If in Johto, returns 0 in e.
|
||||
; If in Kanto, returns 1 in e.
|
||||
ld a, [wMapGroup]
|
||||
ld b, a
|
||||
ld a, [wMapNumber]
|
||||
ld c, a
|
||||
call GetWorldMapLocation
|
||||
cp LANDMARK_FAST_SHIP ; S.S. Aqua
|
||||
jr z, .johto
|
||||
cp LANDMARK_SPECIAL
|
||||
jr nz, .checkagain
|
||||
|
||||
; In a special map, get the backup map group / map id
|
||||
ld a, [wBackupMapGroup]
|
||||
ld b, a
|
||||
ld a, [wBackupMapNumber]
|
||||
ld c, a
|
||||
call GetWorldMapLocation
|
||||
|
||||
.checkagain
|
||||
cp KANTO_LANDMARK
|
||||
jr c, .johto
|
||||
|
||||
; Victory Road area is considered to be Johto.
|
||||
cp LANDMARK_VICTORY_ROAD
|
||||
jr c, .kanto
|
||||
|
||||
.johto
|
||||
ld e, JOHTO_REGION
|
||||
ret
|
||||
.kanto
|
||||
ld e, KANTO_REGION
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue