rockethideout3.asm 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. RocketHideout3Script:
  2. call EnableAutoTextBoxDrawing
  3. ld hl, RocketHideout3TrainerHeader0
  4. ld de, RocketHideout3ScriptPointers
  5. ld a, [wRocketHideout3CurScript]
  6. call ExecuteCurMapScriptInTable
  7. ld [wRocketHideout3CurScript], a
  8. ret
  9. RocketHideout3ScriptPointers:
  10. dw RocketHideout3Script0
  11. dw DisplayEnemyTrainerTextAndStartBattle
  12. dw EndTrainerBattle
  13. dw RocketHideout3Script3
  14. RocketHideout3Script0:
  15. ld a, [wYCoord]
  16. ld b, a
  17. ld a, [wXCoord]
  18. ld c, a
  19. ld hl, RocketHideout3ArrowTilePlayerMovement
  20. call DecodeArrowMovementRLE
  21. cp $ff
  22. jp z, CheckFightingMapTrainers
  23. ld hl, wd736
  24. set 7, [hl]
  25. call StartSimulatingJoypadStates
  26. ld a, SFX_ARROW_TILES
  27. call PlaySound
  28. ld a, $ff
  29. ld [wJoyIgnore], a
  30. ld a, $3
  31. ld [wCurMapScript], a
  32. ret
  33. ;format:
  34. ;db y,x
  35. ;dw pointer to movement
  36. RocketHideout3ArrowTilePlayerMovement:
  37. db $d,$a
  38. dw RocketHideout3ArrowMovement6
  39. db $13,$a
  40. dw RocketHideout3ArrowMovement1
  41. db $12,$b
  42. dw RocketHideout3ArrowMovement2
  43. db $b,$c
  44. dw RocketHideout3ArrowMovement3
  45. db $11,$c
  46. dw RocketHideout3ArrowMovement4
  47. db $14,$c
  48. dw RocketHideout3ArrowMovement5
  49. db $10,$d
  50. dw RocketHideout3ArrowMovement6
  51. db $b,$e
  52. dw RocketHideout3ArrowMovement7
  53. db $f,$e
  54. dw RocketHideout3ArrowMovement6
  55. db $11,$e
  56. dw RocketHideout3ArrowMovement8
  57. db $13,$e
  58. dw RocketHideout3ArrowMovement9
  59. db $10,$f
  60. dw RocketHideout3ArrowMovement7
  61. db $12,$f
  62. dw RocketHideout3ArrowMovement10
  63. db $d,$10
  64. dw RocketHideout3ArrowMovement11
  65. db $c,$11
  66. dw RocketHideout3ArrowMovement10
  67. db $10,$12
  68. dw RocketHideout3ArrowMovement12
  69. db $FF
  70. ;format: direction, count
  71. ;each list is read starting from the $FF and working backwards
  72. RocketHideout3ArrowMovement1:
  73. db D_RIGHT,$04
  74. db D_UP,$04
  75. db D_RIGHT,$04
  76. db $FF
  77. RocketHideout3ArrowMovement2:
  78. db D_DOWN,$04
  79. db D_RIGHT,$04
  80. db $FF
  81. RocketHideout3ArrowMovement3:
  82. db D_LEFT,$02
  83. db $FF
  84. RocketHideout3ArrowMovement4:
  85. db D_RIGHT,$04
  86. db D_UP,$02
  87. db D_RIGHT,$02
  88. db $FF
  89. RocketHideout3ArrowMovement5:
  90. db D_RIGHT,$04
  91. db D_UP,$02
  92. db D_RIGHT,$02
  93. db D_UP,$03
  94. db $FF
  95. RocketHideout3ArrowMovement6:
  96. db D_RIGHT,$04
  97. db $FF
  98. RocketHideout3ArrowMovement7:
  99. db D_RIGHT,$02
  100. db $FF
  101. RocketHideout3ArrowMovement8:
  102. db D_RIGHT,$04
  103. db D_UP,$02
  104. db $FF
  105. RocketHideout3ArrowMovement9:
  106. db D_RIGHT,$04
  107. db D_UP,$04
  108. db $FF
  109. RocketHideout3ArrowMovement10:
  110. db D_DOWN,$04
  111. db $FF
  112. RocketHideout3ArrowMovement11:
  113. db D_UP,$02
  114. db $FF
  115. RocketHideout3ArrowMovement12:
  116. db D_UP,$01
  117. db $FF
  118. RocketHideout3Script3:
  119. ld a, [wSimulatedJoypadStatesIndex]
  120. and a
  121. jp nz, LoadSpinnerArrowTiles
  122. xor a
  123. ld [wJoyIgnore], a
  124. ld hl, wd736
  125. res 7, [hl]
  126. ld a, $0
  127. ld [wCurMapScript], a
  128. ret
  129. RocketHideout3TextPointers:
  130. dw RocketHideout3Text1
  131. dw RocketHideout3Text2
  132. dw PickUpItemText
  133. dw PickUpItemText
  134. RocketHideout3TrainerHeader0:
  135. dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0
  136. db ($2 << 4) ; trainer's view range
  137. dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0
  138. dw RocketHideout3BattleText2 ; TextBeforeBattle
  139. dw RocketHideout3AfterBattleTxt2 ; TextAfterBattle
  140. dw RocketHideout3EndBattleText2 ; TextEndBattle
  141. dw RocketHideout3EndBattleText2 ; TextEndBattle
  142. RocketHideout3TrainerHeader1:
  143. dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_1
  144. db ($4 << 4) ; trainer's view range
  145. dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_1
  146. dw RocketHideout3BattleTxt ; TextBeforeBattle
  147. dw RocketHideout3AfterBattleText3 ; TextAfterBattle
  148. dw RocketHideout3EndBattleText3 ; TextEndBattle
  149. dw RocketHideout3EndBattleText3 ; TextEndBattle
  150. db $ff
  151. RocketHideout3Text1:
  152. TX_ASM
  153. ld hl, RocketHideout3TrainerHeader0
  154. call TalkToTrainer
  155. jp TextScriptEnd
  156. RocketHideout3BattleText2:
  157. TX_FAR _RocketHideout3BattleText2
  158. db "@"
  159. RocketHideout3EndBattleText2:
  160. TX_FAR _RocketHideout3EndBattleText2
  161. db "@"
  162. RocketHideout3AfterBattleTxt2:
  163. TX_FAR _RocketHideout3AfterBattleTxt2
  164. db "@"
  165. RocketHideout3Text2:
  166. TX_ASM
  167. ld hl, RocketHideout3TrainerHeader1
  168. call TalkToTrainer
  169. jp TextScriptEnd
  170. RocketHideout3BattleTxt:
  171. TX_FAR _RocketHideout3BattleTxt
  172. db "@"
  173. RocketHideout3EndBattleText3:
  174. TX_FAR _RocketHideout3EndBattleText3
  175. db "@"
  176. RocketHideout3AfterBattleText3:
  177. TX_FAR _RocketHide3AfterBattleText3
  178. db "@"