Advertisement
KDLPro

snippet kanto grass

Mar 7th, 2021 (edited)
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FindNest:
  2. ; Parameters:
  3. ; e: 0 = Johto, 1 = Kanto
  4. ; wNamedObjectIndex: species
  5.     hlcoord 0, 0
  6.     ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
  7.     xor a
  8.     call ByteFill
  9.     ld a, e
  10.     and a
  11.     jr nz, .kanto
  12.     decoord 0, 0
  13.     ld hl, JohtoGrassWildMons
  14.     call .FindGrass
  15.     ld hl, JohtoWaterWildMons
  16.     call .FindWater
  17.     call .RoamMon1
  18.     call .RoamMon2
  19.     ret
  20.  
  21. .kanto
  22.     decoord 0, 0
  23.     ld hl, KantoGrassWildMons
  24.     call .FindGrass
  25.     ld hl, KantoWaterWildMons
  26.     jp .FindWater
  27.  
  28. .FindGrass:
  29.     ld a, [hl]
  30.     cp -1
  31.     ret z
  32.     push hl
  33.     ld a, [hli]
  34.     ld b, a
  35.     ld a, [hli]
  36.     ld c, a
  37.     inc hl
  38.     inc hl
  39.     inc hl
  40.     ld a, NUM_GRASSMON * 3
  41.     call .SearchMapForMon
  42.     jr nc, .next_grass
  43.     ld [de], a
  44.     inc de
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement