cinnabarisland.asm 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. CinnabarIslandScript:
  2. call EnableAutoTextBoxDrawing
  3. ld hl, wCurrentMapScriptFlags
  4. set 5, [hl]
  5. ResetEvent EVENT_MANSION_SWITCH_ON
  6. ResetEvent EVENT_LAB_STILL_REVIVING_FOSSIL
  7. ld hl, CinnabarIslandScriptPointers
  8. ld a, [wCinnabarIslandCurScript]
  9. jp CallFunctionInTable
  10. CinnabarIslandScriptPointers:
  11. dw CinnabarIslandScript0
  12. dw CinnabarIslandScript1
  13. CinnabarIslandScript0:
  14. ld b, SECRET_KEY
  15. call IsItemInBag
  16. ret nz
  17. ld a, [wYCoord]
  18. cp $4
  19. ret nz
  20. ld a, [wXCoord]
  21. cp $12
  22. ret nz
  23. ld a, PLAYER_DIR_UP
  24. ld [wPlayerMovingDirection], a
  25. ld a, $8
  26. ld [hSpriteIndexOrTextID], a
  27. call DisplayTextID
  28. xor a
  29. ld [hJoyHeld], a
  30. ld a, $1
  31. ld [wSimulatedJoypadStatesIndex], a
  32. ld a, D_DOWN
  33. ld [wSimulatedJoypadStatesEnd], a
  34. call StartSimulatingJoypadStates
  35. xor a
  36. ld [wSpriteStateData1 + 9], a
  37. ld [wJoyIgnore], a
  38. ld a, $1
  39. ld [wCinnabarIslandCurScript], a
  40. ret
  41. CinnabarIslandScript1:
  42. ld a, [wSimulatedJoypadStatesIndex]
  43. and a
  44. ret nz
  45. call Delay3
  46. ld a, $0
  47. ld [wCinnabarIslandCurScript], a
  48. ret
  49. CinnabarIslandTextPointers:
  50. dw CinnabarIslandText1
  51. dw CinnabarIslandText2
  52. dw CinnabarIslandText3
  53. dw MartSignText
  54. dw PokeCenterSignText
  55. dw CinnabarIslandText6
  56. dw CinnabarIslandText7
  57. dw CinnabarIslandText8
  58. CinnabarIslandText8:
  59. TX_FAR _CinnabarIslandText8
  60. db "@"
  61. CinnabarIslandText1:
  62. TX_FAR _CinnabarIslandText1
  63. db "@"
  64. CinnabarIslandText2:
  65. TX_FAR _CinnabarIslandText2
  66. db "@"
  67. CinnabarIslandText3:
  68. TX_FAR _CinnabarIslandText3
  69. db "@"
  70. CinnabarIslandText6:
  71. TX_FAR _CinnabarIslandText6
  72. db "@"
  73. CinnabarIslandText7:
  74. TX_FAR _CinnabarIslandText7
  75. db "@"