pokemontower6.asm 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. PokemonTower6Script:
  2. call EnableAutoTextBoxDrawing
  3. ld hl, PokemonTower6TrainerHeader0
  4. ld de, PokemonTower6ScriptPointers
  5. ld a, [wPokemonTower6CurScript]
  6. call ExecuteCurMapScriptInTable
  7. ld [wPokemonTower6CurScript], a
  8. ret
  9. PokemonTower6Script_60b02:
  10. xor a
  11. ld [wJoyIgnore], a
  12. ld [wPokemonTower6CurScript], a
  13. ld [wCurMapScript], a
  14. ret
  15. PokemonTower6ScriptPointers:
  16. dw PokemonTower6Script0
  17. dw DisplayEnemyTrainerTextAndStartBattle
  18. dw EndTrainerBattle
  19. dw PokemonTower6Script3
  20. dw PokemonTower6Script4
  21. PokemonTower6Script0:
  22. CheckEvent EVENT_BEAT_GHOST_MAROWAK
  23. jp nz, CheckFightingMapTrainers
  24. ld hl, CoordsData_60b45
  25. call ArePlayerCoordsInArray
  26. jp nc, CheckFightingMapTrainers
  27. xor a
  28. ld [hJoyHeld], a
  29. ld a, $6
  30. ld [hSpriteIndexOrTextID], a
  31. call DisplayTextID
  32. ld a, MAROWAK
  33. ld [wCurOpponent], a
  34. ld a, 30
  35. ld [wCurEnemyLVL], a
  36. ld a, $4
  37. ld [wPokemonTower6CurScript], a
  38. ld [wCurMapScript], a
  39. ret
  40. CoordsData_60b45:
  41. db $10,$0A,$FF
  42. PokemonTower6Script4:
  43. ld a, [wIsInBattle]
  44. cp $ff
  45. jp z, PokemonTower6Script_60b02
  46. ld a, $ff
  47. ld [wJoyIgnore], a
  48. ld a, [wd72d]
  49. bit 6, a
  50. ret nz
  51. call UpdateSprites
  52. ld a, $f0
  53. ld [wJoyIgnore], a
  54. ld a, [wBattleResult]
  55. and a
  56. jr nz, .asm_60b82
  57. SetEvent EVENT_BEAT_GHOST_MAROWAK
  58. ld a, $7
  59. ld [hSpriteIndexOrTextID], a
  60. call DisplayTextID
  61. xor a
  62. ld [wJoyIgnore], a
  63. ld a, $0
  64. ld [wPokemonTower6CurScript], a
  65. ld [wCurMapScript], a
  66. ret
  67. .asm_60b82
  68. ld a, $1
  69. ld [wSimulatedJoypadStatesIndex], a
  70. ld a, $10
  71. ld [wSimulatedJoypadStatesEnd], a
  72. xor a
  73. ld [wSpriteStateData2 + $06], a
  74. ld [wOverrideSimulatedJoypadStatesMask], a
  75. ld hl, wd730
  76. set 7, [hl]
  77. ld a, $3
  78. ld [wPokemonTower6CurScript], a
  79. ld [wCurMapScript], a
  80. ret
  81. PokemonTower6Script3:
  82. ld a, [wSimulatedJoypadStatesIndex]
  83. and a
  84. ret nz
  85. call Delay3
  86. xor a
  87. ld [wPokemonTower6CurScript], a
  88. ld [wCurMapScript], a
  89. ret
  90. PokemonTower6TextPointers:
  91. dw PokemonTower6Text1
  92. dw PokemonTower6Text2
  93. dw PokemonTower6Text3
  94. dw PickUpItemText
  95. dw PickUpItemText
  96. dw PokemonTower6Text6
  97. dw PokemonTower6Text7
  98. PokemonTower6TrainerHeader0:
  99. dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_0
  100. db ($3 << 4) ; trainer's view range
  101. dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_0
  102. dw PokemonTower6BattleText1 ; TextBeforeBattle
  103. dw PokemonTower6AfterBattleText1 ; TextAfterBattle
  104. dw PokemonTower6EndBattleText1 ; TextEndBattle
  105. dw PokemonTower6EndBattleText1 ; TextEndBattle
  106. PokemonTower6TrainerHeader1:
  107. dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_1
  108. db ($3 << 4) ; trainer's view range
  109. dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_1
  110. dw PokemonTower6BattleText2 ; TextBeforeBattle
  111. dw PokemonTower6AfterBattleText2 ; TextAfterBattle
  112. dw PokemonTower6EndBattleText2 ; TextEndBattle
  113. dw PokemonTower6EndBattleText2 ; TextEndBattle
  114. PokemonTower6TrainerHeader2:
  115. dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_2
  116. db ($2 << 4) ; trainer's view range
  117. dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_2
  118. dw PokemonTower6BattleText3 ; TextBeforeBattle
  119. dw PokemonTower6AfterBattleText3 ; TextAfterBattle
  120. dw PokemonTower6EndBattleText3 ; TextEndBattle
  121. dw PokemonTower6EndBattleText3 ; TextEndBattle
  122. db $ff
  123. PokemonTower6Text1:
  124. TX_ASM
  125. ld hl, PokemonTower6TrainerHeader0
  126. call TalkToTrainer
  127. jp TextScriptEnd
  128. PokemonTower6Text2:
  129. TX_ASM
  130. ld hl, PokemonTower6TrainerHeader1
  131. call TalkToTrainer
  132. jp TextScriptEnd
  133. PokemonTower6Text3:
  134. TX_ASM
  135. ld hl, PokemonTower6TrainerHeader2
  136. call TalkToTrainer
  137. jp TextScriptEnd
  138. PokemonTower6Text7:
  139. TX_ASM
  140. ld hl, PokemonTower2Text_60c1f
  141. call PrintText
  142. ld a, MAROWAK
  143. call PlayCry
  144. call WaitForSoundToFinish
  145. ld c, 30
  146. call DelayFrames
  147. ld hl, PokemonTower2Text_60c24
  148. call PrintText
  149. jp TextScriptEnd
  150. PokemonTower2Text_60c1f:
  151. TX_FAR _PokemonTower2Text_60c1f
  152. db "@"
  153. PokemonTower2Text_60c24:
  154. TX_FAR _PokemonTower2Text_60c24
  155. db "@"
  156. PokemonTower6BattleText1:
  157. TX_FAR _PokemonTower6BattleText1
  158. db "@"
  159. PokemonTower6EndBattleText1:
  160. TX_FAR _PokemonTower6EndBattleText1
  161. db "@"
  162. PokemonTower6AfterBattleText1:
  163. TX_FAR _PokemonTower6AfterBattleText1
  164. db "@"
  165. PokemonTower6BattleText2:
  166. TX_FAR _PokemonTower6BattleText2
  167. db "@"
  168. PokemonTower6EndBattleText2:
  169. TX_FAR _PokemonTower6EndBattleText2
  170. db "@"
  171. PokemonTower6AfterBattleText2:
  172. TX_FAR _PokemonTower6AfterBattleText2
  173. db "@"
  174. PokemonTower6BattleText3:
  175. TX_FAR _PokemonTower6BattleText3
  176. db "@"
  177. PokemonTower6EndBattleText3:
  178. TX_FAR _PokemonTower6EndBattleText3
  179. db "@"
  180. PokemonTower6AfterBattleText3:
  181. TX_FAR _PokemonTower6AfterBattleText3
  182. db "@"
  183. PokemonTower6Text6:
  184. TX_FAR _PokemonTower6Text6
  185. db "@"