mtmoonpokecenter.asm 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. MtMoonPokecenterScript:
  2. call Serial_TryEstablishingExternallyClockedConnection
  3. jp EnableAutoTextBoxDrawing
  4. MtMoonPokecenterTextPointers:
  5. dw MtMoonHealNurseText
  6. dw MtMoonPokecenterText2
  7. dw MtMoonPokecenterText3
  8. dw MagikarpSalesmanText
  9. dw MtMoonPokecenterText5
  10. dw MtMoonTradeNurseText
  11. MtMoonHealNurseText:
  12. db $ff
  13. MtMoonPokecenterText2:
  14. TX_FAR _MtMoonPokecenterText1
  15. db "@"
  16. MtMoonPokecenterText3:
  17. TX_FAR _MtMoonPokecenterText3
  18. db "@"
  19. MagikarpSalesmanText:
  20. TX_ASM
  21. CheckEvent EVENT_BOUGHT_MAGIKARP, 1
  22. jp c, .alreadyBoughtMagikarp
  23. ld hl, .Text1
  24. call PrintText
  25. ld a, MONEY_BOX
  26. ld [wTextBoxID], a
  27. call DisplayTextBoxID
  28. call YesNoChoice
  29. ld a, [wCurrentMenuItem]
  30. and a
  31. jp nz, .choseNo
  32. ld [hMoney], a
  33. ld [hMoney + 2], a
  34. ld a, $5
  35. ld [hMoney + 1], a
  36. call HasEnoughMoney
  37. jr nc, .enoughMoney
  38. ld hl, .NoMoneyText
  39. jr .printText
  40. .enoughMoney
  41. lb bc, MAGIKARP, 5
  42. call GivePokemon
  43. jr nc, .done
  44. xor a
  45. ld [wPriceTemp], a
  46. ld [wPriceTemp + 2], a
  47. ld a, $5
  48. ld [wPriceTemp + 1], a
  49. ld hl, wPriceTemp + 2
  50. ld de, wPlayerMoney + 2
  51. ld c, $3
  52. predef SubBCDPredef
  53. ld a, MONEY_BOX
  54. ld [wTextBoxID], a
  55. call DisplayTextBoxID
  56. SetEvent EVENT_BOUGHT_MAGIKARP
  57. jr .done
  58. .choseNo
  59. ld hl, .RefuseText
  60. jr .printText
  61. .alreadyBoughtMagikarp
  62. ld hl, .Text2
  63. .printText
  64. call PrintText
  65. .done
  66. jp TextScriptEnd
  67. .Text1
  68. TX_FAR _MagikarpSalesmanText1
  69. db "@"
  70. .RefuseText
  71. TX_FAR _MagikarpSalesmanNoText
  72. db "@"
  73. .NoMoneyText
  74. TX_FAR _MagikarpSalesmanNoMoneyText
  75. db "@"
  76. .Text2
  77. TX_FAR _MagikarpSalesmanText2
  78. db "@"
  79. MtMoonPokecenterText5:
  80. TX_FAR _MtMoonPokecenterText5
  81. db "@"
  82. MtMoonTradeNurseText:
  83. db $f6