Vendily

Page 4 caught location/time/level

Oct 19th, 2021 (edited)
690
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LoadOrangePage:
  2.     call .placeCaughtLocation
  3.     ld de, MetAtMapString
  4.     hlcoord 1, 9
  5.     call PlaceString
  6.     call .placeCaughtLevel
  7.     ret
  8.  
  9. .placeCaughtLocation
  10.     ld a, [wTempMonCaughtLocation]
  11.     and CAUGHT_LOCATION_MASK
  12.     jr z, .unknown_location
  13.     cp LANDMARK_EVENT
  14.     jr z, .unknown_location
  15.     cp LANDMARK_GIFT
  16.     jr z, .unknown_location
  17.     ld e, a
  18.     farcall GetLandmarkName
  19.     ld de, wStringBuffer1
  20.     hlcoord 2, 10
  21.     call PlaceString
  22.     ld a, [wTempMonCaughtTime]
  23.     and CAUGHT_TIME_MASK
  24.     ret z ; no time
  25.     rlca
  26.     rlca
  27.     dec a
  28.     ld hl, .times
  29.     call GetNthString
  30.     ld d, h
  31.     ld e, l
  32.     call CopyName1
  33.     ld de, wStringBuffer2
  34.     hlcoord 2, 11
  35.     call PlaceString
  36.     ret
  37.  
  38. .unknown_location:
  39.     ld de, MetUnknownMapString
  40.     hlcoord 2, 10
  41.     call PlaceString
  42.     ret
  43.  
  44. .times
  45.     db "MORN@"
  46.     db "DAY@"
  47.     db "NITE@"
  48.  
  49. .placeCaughtLevel
  50.     ; caught level
  51.     ; Limited to between 1 and 63 since it's a 6-bit quantity.
  52.     ld a, [wTempMonCaughtLevel]
  53.     and CAUGHT_LEVEL_MASK
  54.     jr z, .unknown_level
  55.     cp CAUGHT_EGG_LEVEL ; egg marker value
  56.     jr nz, .print
  57.     ld a, EGG_LEVEL ; egg hatch level
  58.  
  59. .print
  60.     ld [wTextDecimalByte], a
  61.     hlcoord 3, 13
  62.     ld de, wTextDecimalByte
  63.     lb bc, PRINTNUM_LEFTALIGN | 1, 3
  64.     call PrintNum
  65.     ld de, MetAtLevelString
  66.     hlcoord 1, 12
  67.     call PlaceString
  68.     hlcoord 2, 13
  69.     ld [hl], "<LV>"
  70.     ret
  71.  
  72. .unknown_level
  73.     ld de, MetUnknownLevelString
  74.     hlcoord 2, 12
  75.     call PlaceString
  76.     ret
  77.  
  78. MetAtMapString:
  79.     db "MET AT:@"
  80.  
  81. MetUnknownMapString:
  82.     db "UNKNOWN@"
  83.    
  84. MetAtLevelString:
  85.     db "MET LEVEL:@"    
  86. MetUnknownLevelString:
  87.     db "???@"
RAW Paste Data