2017-01-01 01:23:54 +00:00
|
|
|
LoadWildData:
|
2017-12-30 00:54:27 +00:00
|
|
|
ld hl, WildDataPointers
|
|
|
|
ld a, [wCurMap]
|
2017-01-01 01:23:54 +00:00
|
|
|
|
|
|
|
; get wild data for current map
|
2017-12-30 00:54:27 +00:00
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
add hl, bc
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a ; hl now points to wild data for current map
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wGrassRate], a
|
2017-01-01 01:23:54 +00:00
|
|
|
and a
|
2017-12-30 00:54:27 +00:00
|
|
|
jr z, .NoGrassData ; if no grass data, skip to surfing data
|
2017-01-01 01:23:54 +00:00
|
|
|
push hl
|
2017-12-30 00:54:27 +00:00
|
|
|
ld de, wGrassMons ; otherwise, load grass data
|
|
|
|
ld bc, $0014
|
2017-01-01 01:23:54 +00:00
|
|
|
call CopyData
|
|
|
|
pop hl
|
2017-12-30 00:54:27 +00:00
|
|
|
ld bc, $0014
|
|
|
|
add hl, bc
|
2017-01-01 01:23:54 +00:00
|
|
|
.NoGrassData
|
2017-12-30 00:54:27 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld [wWaterRate], a
|
2017-01-01 01:23:54 +00:00
|
|
|
and a
|
|
|
|
ret z ; if no water data, we're done
|
2017-12-30 00:54:27 +00:00
|
|
|
ld de, wWaterMons ; otherwise, load surfing data
|
|
|
|
ld bc, $0014
|
2017-01-01 01:23:54 +00:00
|
|
|
jp CopyData
|
|
|
|
|
|
|
|
INCLUDE "data/wild_mons.asm"
|