rockethideout4.asm 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. RocketHideout4Script:
  2. call RocketHideout4Script_45473
  3. call EnableAutoTextBoxDrawing
  4. ld hl, RocketHideout4TrainerHeader0
  5. ld de, RocketHideout4ScriptPointers
  6. ld a, [wRocketHideout4CurScript]
  7. call ExecuteCurMapScriptInTable
  8. ld [wRocketHideout4CurScript], a
  9. ret
  10. RocketHideout4Script_45473:
  11. ld hl, wCurrentMapScriptFlags
  12. bit 5, [hl]
  13. res 5, [hl]
  14. ret z
  15. CheckEvent EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED
  16. jr nz, .asm_45496
  17. CheckBothEventsSet EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0, EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1, 1
  18. jr z, .asm_4548c
  19. ld a, $2d
  20. jr .asm_45498
  21. .asm_4548c
  22. ld a, SFX_GO_INSIDE
  23. call PlaySound
  24. SetEvent EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED
  25. .asm_45496
  26. ld a, $e
  27. .asm_45498
  28. ld [wNewTileBlockID], a
  29. lb bc, 5, 12
  30. predef_jump ReplaceTileBlock
  31. RocketHideout4Script_454a3:
  32. xor a
  33. ld [wJoyIgnore], a
  34. ld [wRocketHideout4CurScript], a
  35. ld [wCurMapScript], a
  36. ret
  37. RocketHideout4ScriptPointers:
  38. dw CheckFightingMapTrainers
  39. dw DisplayEnemyTrainerTextAndStartBattle
  40. dw EndTrainerBattle
  41. dw RocketHideout4Script3
  42. RocketHideout4Script3:
  43. ld a, [wIsInBattle]
  44. cp $ff
  45. jp z, RocketHideout4Script_454a3
  46. call UpdateSprites
  47. ld a, $f0
  48. ld [wJoyIgnore], a
  49. SetEvent EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI
  50. ld a, $a
  51. ld [hSpriteIndexOrTextID], a
  52. call DisplayTextID
  53. call GBFadeOutToBlack
  54. ld a, HS_ROCKET_HIDEOUT_4_GIOVANNI
  55. ld [wMissableObjectIndex], a
  56. predef HideObject
  57. ld a, HS_ROCKET_HIDEOUT_4_ITEM_4
  58. ld [wMissableObjectIndex], a
  59. predef ShowObject
  60. call UpdateSprites
  61. call GBFadeInFromBlack
  62. xor a
  63. ld [wJoyIgnore], a
  64. ld hl, wCurrentMapScriptFlags
  65. set 5, [hl]
  66. ld a, $0
  67. ld [wRocketHideout4CurScript], a
  68. ld [wCurMapScript], a
  69. ret
  70. RocketHideout4TextPointers:
  71. dw RocketHideout4Text1
  72. dw RocketHideout4Text2
  73. dw RocketHideout4Text3
  74. dw RocketHideout4Text4
  75. dw PickUpItemText
  76. dw PickUpItemText
  77. dw PickUpItemText
  78. dw PickUpItemText
  79. dw PickUpItemText
  80. dw RocketHideout4Text10
  81. RocketHideout4TrainerHeader0:
  82. dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0
  83. db ($0 << 4) ; trainer's view range
  84. dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0
  85. dw RocketHideout4BattleText2 ; TextBeforeBattle
  86. dw RocketHideout4AfterBattleText2 ; TextAfterBattle
  87. dw RocketHideout4EndBattleText2 ; TextEndBattle
  88. dw RocketHideout4EndBattleText2 ; TextEndBattle
  89. RocketHideout4TrainerHeader1:
  90. dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
  91. db ($0 << 4) ; trainer's view range
  92. dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
  93. dw RocketHideout4BattleText3 ; TextBeforeBattle
  94. dw RocketHideout4AfterBattleText3 ; TextAfterBattle
  95. dw RocketHideout4EndBattleText3 ; TextEndBattle
  96. dw RocketHideout4EndBattleText3 ; TextEndBattle
  97. RocketHideout4TrainerHeader2:
  98. dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2
  99. db ($1 << 4) ; trainer's view range
  100. dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2
  101. dw RocketHideout4BattleText4 ; TextBeforeBattle
  102. dw RocketHideout4AfterBattleText4 ; TextAfterBattle
  103. dw RocketHideout4EndBattleText4 ; TextEndBattle
  104. dw RocketHideout4EndBattleText4 ; TextEndBattle
  105. db $ff
  106. RocketHideout4Text1:
  107. TX_ASM
  108. CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI
  109. jp nz, .asm_545571
  110. ld hl, RocketHideout4Text_4557a
  111. call PrintText
  112. ld hl, wd72d
  113. set 6, [hl]
  114. set 7, [hl]
  115. ld hl, RocketHideout4Text_4557f
  116. ld de, RocketHideout4Text_4557f
  117. call SaveEndBattleTextPointers
  118. ld a, [H_SPRITEINDEX]
  119. ld [wSpriteIndex], a
  120. call EngageMapTrainer
  121. call InitBattleEnemyParameters
  122. xor a
  123. ld [hJoyHeld], a
  124. ld a, $3
  125. ld [wRocketHideout4CurScript], a
  126. ld [wCurMapScript], a
  127. jr .asm_209f0
  128. .asm_545571
  129. ld hl, RocketHideout4Text10
  130. call PrintText
  131. .asm_209f0
  132. jp TextScriptEnd
  133. RocketHideout4Text_4557a:
  134. TX_FAR _RocketHideout4Text_4557a
  135. db "@"
  136. RocketHideout4Text_4557f:
  137. TX_FAR _RocketHideout4Text_4557f
  138. db "@"
  139. RocketHideout4Text10:
  140. TX_FAR _RocketHideout4Text_45584
  141. db "@"
  142. RocketHideout4Text2:
  143. TX_ASM
  144. ld hl, RocketHideout4TrainerHeader0
  145. call TalkToTrainer
  146. jp TextScriptEnd
  147. RocketHideout4BattleText2:
  148. TX_FAR _RocketHideout4BattleText2
  149. db "@"
  150. RocketHideout4EndBattleText2:
  151. TX_FAR _RocketHideout4EndBattleText2
  152. db "@"
  153. RocketHideout4AfterBattleText2:
  154. TX_FAR _RocketHide4AfterBattleText2
  155. db "@"
  156. RocketHideout4Text3:
  157. TX_ASM
  158. ld hl, RocketHideout4TrainerHeader1
  159. call TalkToTrainer
  160. jp TextScriptEnd
  161. RocketHideout4BattleText3:
  162. TX_FAR _RocketHideout4BattleText3
  163. db "@"
  164. RocketHideout4EndBattleText3:
  165. TX_FAR _RocketHideout4EndBattleText3
  166. db "@"
  167. RocketHideout4AfterBattleText3:
  168. TX_FAR _RocketHide4AfterBattleText3
  169. db "@"
  170. RocketHideout4Text4:
  171. TX_ASM
  172. ld hl, RocketHideout4TrainerHeader2
  173. call TalkToTrainer
  174. jp TextScriptEnd
  175. RocketHideout4BattleText4:
  176. TX_FAR _RocketHideout4BattleText4
  177. db "@"
  178. RocketHideout4EndBattleText4:
  179. TX_FAR _RocketHideout4EndBattleText4
  180. db "@"
  181. RocketHideout4AfterBattleText4:
  182. TX_ASM
  183. ld hl, RocketHideout4Text_455ec
  184. call PrintText
  185. CheckAndSetEvent EVENT_ROCKET_DROPPED_LIFT_KEY
  186. jr nz, .asm_455e9
  187. ld a, HS_ROCKET_HIDEOUT_4_ITEM_5
  188. ld [wMissableObjectIndex], a
  189. predef ShowObject
  190. .asm_455e9
  191. jp TextScriptEnd
  192. RocketHideout4Text_455ec:
  193. TX_FAR _RocketHideout4Text_455ec
  194. db "@"