route22gate.asm 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. Route22GateScript:
  2. call EnableAutoTextBoxDrawing
  3. ld hl, Route22GateScriptPointers
  4. ld a, [wRoute22GateCurScript]
  5. call CallFunctionInTable
  6. ld a, [wYCoord]
  7. cp $4
  8. ld a, ROUTE_23
  9. jr c, .asm_1e69a
  10. ld a, ROUTE_22
  11. .asm_1e69a
  12. ld [wLastMap], a
  13. ret
  14. Route22GateScriptPointers:
  15. dw Route22GateScript0
  16. dw Route22GateScript1
  17. dw Route22GateScript2
  18. Route22GateScript0:
  19. ld hl, Route22GateScriptCoords
  20. call ArePlayerCoordsInArray
  21. ret nc
  22. xor a
  23. ld [hJoyHeld], a
  24. ld a, $1
  25. ld [hSpriteIndexOrTextID], a
  26. jp DisplayTextID
  27. Route22GateScriptCoords:
  28. db 2,4
  29. db 2,5
  30. db $ff
  31. Route22GateScript_1e6ba:
  32. ld a, $1
  33. ld [wSimulatedJoypadStatesIndex], a
  34. ld a, D_DOWN
  35. ld [wSimulatedJoypadStatesEnd], a
  36. ld [wSpriteStateData1 + 9], a
  37. ld [wJoyIgnore], a
  38. jp StartSimulatingJoypadStates
  39. Route22GateScript1:
  40. ld a, [wSimulatedJoypadStatesIndex]
  41. and a
  42. ret nz
  43. xor a
  44. ld [wJoyIgnore], a
  45. call Delay3
  46. ld a, $0
  47. ld [wRoute22GateCurScript], a
  48. Route22GateScript2:
  49. ret
  50. Route22GateTextPointers:
  51. dw Route22GateText1
  52. Route22GateText1:
  53. TX_ASM
  54. ld a, [wObtainedBadges]
  55. bit 0, a
  56. jr nz, .asm_1e6f6
  57. ld hl, Route22GateText_1e704
  58. call PrintText
  59. call Route22GateScript_1e6ba
  60. ld a, $1
  61. jr .asm_1e6fe
  62. .asm_1e6f6
  63. ld hl, Route22GateText_1e71a
  64. call PrintText
  65. ld a, $2
  66. .asm_1e6fe
  67. ld [wRoute22GateCurScript], a
  68. jp TextScriptEnd
  69. Route22GateText_1e704:
  70. TX_FAR _Route22GateText_1e704
  71. TX_ASM
  72. ld a, SFX_DENIED
  73. call PlaySoundWaitForCurrent
  74. call WaitForSoundToFinish
  75. ld hl, Route22GateText_1e715
  76. ret
  77. Route22GateText_1e715:
  78. TX_FAR _Route22GateText_1e715
  79. db "@"
  80. Route22GateText_1e71a:
  81. TX_FAR _Route22GateText_1e71a
  82. TX_SFX_ITEM_1
  83. db "@"