mirror of
https://github.com/thornAvery/jep-hack.git
synced 2026-04-01 00:59: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
58
engine/overworld/spawn_points.asm
Normal file
58
engine/overworld/spawn_points.asm
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
INCLUDE "data/maps/spawn_points.asm"
|
||||
|
||||
EnterMapSpawnPoint:
|
||||
; loads the spawn point in wDefaultSpawnpoint
|
||||
push hl
|
||||
push de
|
||||
ld a, [wDefaultSpawnpoint]
|
||||
cp SPAWN_N_A
|
||||
jr z, .spawn_n_a
|
||||
ld l, a
|
||||
ld h, 0
|
||||
add hl, hl
|
||||
add hl, hl
|
||||
ld de, SpawnPoints
|
||||
add hl, de
|
||||
ld a, [hli]
|
||||
ld [wMapGroup], a
|
||||
ld a, [hli]
|
||||
ld [wMapNumber], a
|
||||
ld a, [hli]
|
||||
ld [wXCoord], a
|
||||
ld a, [hli]
|
||||
ld [wYCoord], a
|
||||
.spawn_n_a
|
||||
pop de
|
||||
pop hl
|
||||
ret
|
||||
|
||||
IsSpawnPoint:
|
||||
; Checks if the map loaded in de is a spawn point. Returns carry if it's a spawn point.
|
||||
ld hl, SpawnPoints
|
||||
ld c, 0
|
||||
.loop
|
||||
ld a, [hl]
|
||||
cp SPAWN_N_A
|
||||
jr z, .nope
|
||||
cp d
|
||||
jr nz, .next
|
||||
inc hl
|
||||
ld a, [hld]
|
||||
cp e
|
||||
jr z, .yes
|
||||
|
||||
.next
|
||||
push bc
|
||||
ld bc, 4 ; length of a spawn table entry
|
||||
add hl, bc
|
||||
pop bc
|
||||
inc c
|
||||
jr .loop
|
||||
|
||||
.nope
|
||||
and a
|
||||
ret
|
||||
|
||||
.yes
|
||||
scf
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue