viridianmart.asm 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ViridianMartScript:
  2. call ViridianMartScript_1d47d
  3. call EnableAutoTextBoxDrawing
  4. ld hl, ViridianMartScriptPointers
  5. ld a, [wViridianMarketCurScript]
  6. jp CallFunctionInTable
  7. ViridianMartScript_1d47d:
  8. CheckEvent EVENT_OAK_GOT_PARCEL
  9. jr nz, .asm_1d489
  10. ld hl, ViridianMartTextPointers
  11. jr .asm_1d48c
  12. .asm_1d489
  13. ld hl, ViridianMartTextPointers + $a ; starts at ViridianMartText6
  14. .asm_1d48c
  15. ld a, l
  16. ld [wMapTextPtr], a
  17. ld a, h
  18. ld [wMapTextPtr+1], a
  19. ret
  20. ViridianMartScriptPointers:
  21. dw ViridianMartScript0
  22. dw ViridianMartScript1
  23. dw ViridianMartScript2
  24. ViridianMartScript0:
  25. call UpdateSprites
  26. ld a, $4
  27. ld [hSpriteIndexOrTextID], a
  28. call DisplayTextID
  29. ld hl, wSimulatedJoypadStatesEnd
  30. ld de, RLEMovement1d4bb
  31. call DecodeRLEList
  32. dec a
  33. ld [wSimulatedJoypadStatesIndex], a
  34. call StartSimulatingJoypadStates
  35. ld a, $1
  36. ld [wViridianMarketCurScript], a
  37. ret
  38. RLEMovement1d4bb:
  39. db D_LEFT, $01
  40. db D_UP, $02
  41. db $ff
  42. ViridianMartScript1:
  43. ld a, [wSimulatedJoypadStatesIndex]
  44. and a
  45. ret nz
  46. call Delay3
  47. ld a, $5
  48. ld [hSpriteIndexOrTextID], a
  49. call DisplayTextID
  50. lb bc, OAKS_PARCEL, 1
  51. call GiveItem
  52. SetEvent EVENT_GOT_OAKS_PARCEL
  53. ld a, $2
  54. ld [wViridianMarketCurScript], a
  55. ; fallthrough
  56. ViridianMartScript2:
  57. ret
  58. ViridianMartTextPointers:
  59. dw ViridianMartText1
  60. dw ViridianMartText2
  61. dw ViridianMartText3
  62. dw ViridianMartText4
  63. dw ViridianMartText5
  64. dw ViridianCashierText
  65. dw ViridianMartText2
  66. dw ViridianMartText3
  67. ViridianMartText1:
  68. TX_FAR _ViridianMartText1
  69. db "@"
  70. ViridianMartText4:
  71. TX_FAR _ViridianMartText4
  72. db "@"
  73. ViridianMartText5:
  74. TX_FAR ViridianMartParcelQuestText
  75. TX_SFX_KEY_ITEM
  76. db "@"
  77. ViridianMartText2:
  78. TX_FAR _ViridianMartText2
  79. db "@"
  80. ViridianMartText3:
  81. TX_FAR _ViridianMartText3
  82. db "@"