Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/overworld/wild_mons.asm
1271 views
1
LoadWildData::
2
ld hl, WildDataPointers
3
ld a, [wCurMap]
4
5
; get wild data for current map
6
ld c, a
7
ld b, 0
8
add hl, bc
9
add hl, bc
10
ld a, [hli]
11
ld h, [hl]
12
ld l, a ; hl now points to wild data for current map
13
ld a, [hli]
14
ld [wGrassRate], a
15
and a
16
jr z, .NoGrassData ; if no grass data, skip to surfing data
17
push hl
18
ld de, wGrassMons ; otherwise, load grass data
19
ld bc, WILDDATA_LENGTH - 1
20
call CopyData
21
pop hl
22
ld bc, WILDDATA_LENGTH - 1
23
add hl, bc
24
.NoGrassData
25
ld a, [hli]
26
ld [wWaterRate], a
27
and a
28
ret z ; if no water data, we're done
29
ld de, wWaterMons ; otherwise, load surfing data
30
ld bc, WILDDATA_LENGTH - 1
31
jp CopyData
32
33
INCLUDE "data/wild/grass_water.asm"
34
35