powerplant.asm 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. PowerPlantScript:
  2. call EnableAutoTextBoxDrawing
  3. ld hl, Voltorb0TrainerHeader
  4. ld de, .ScriptPointers
  5. ld a, [wPowerPlantCurScript]
  6. call ExecuteCurMapScriptInTable
  7. ld [wPowerPlantCurScript], a
  8. ret
  9. .ScriptPointers
  10. dw CheckFightingMapTrainers
  11. dw DisplayEnemyTrainerTextAndStartBattle
  12. dw EndTrainerBattle
  13. PowerPlantTextPointers:
  14. dw Voltorb0Text
  15. dw Voltorb1Text
  16. dw Voltorb2Text
  17. dw Voltorb3Text
  18. dw Voltorb4Text
  19. dw Voltorb5Text
  20. dw Voltorb6Text
  21. dw Voltorb7Text
  22. dw ZapdosText
  23. dw PickUpItemText
  24. dw PickUpItemText
  25. dw PickUpItemText
  26. dw PickUpItemText
  27. dw PickUpItemText
  28. Voltorb0TrainerHeader:
  29. dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_0
  30. db 0 ; view range
  31. dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_0
  32. dw VoltorbBattleText ; TextBeforeBattle
  33. dw VoltorbBattleText ; TextAfterBattle
  34. dw VoltorbBattleText ; TextEndBattle
  35. dw VoltorbBattleText ; TextEndBattle
  36. Voltorb1TrainerHeader:
  37. dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_1
  38. db 0 ; view range
  39. dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_1
  40. dw VoltorbBattleText ; TextBeforeBattle
  41. dw VoltorbBattleText ; TextAfterBattle
  42. dw VoltorbBattleText ; TextEndBattle
  43. dw VoltorbBattleText ; TextEndBattle
  44. Voltorb2TrainerHeader:
  45. dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_2
  46. db 0 ; view range
  47. dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_2
  48. dw VoltorbBattleText ; TextBeforeBattle
  49. dw VoltorbBattleText ; TextAfterBattle
  50. dw VoltorbBattleText ; TextEndBattle
  51. dw VoltorbBattleText ; TextEndBattle
  52. Voltorb3TrainerHeader:
  53. dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_3
  54. db 0 ; view range
  55. dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_3
  56. dw VoltorbBattleText ; TextBeforeBattle
  57. dw VoltorbBattleText ; TextAfterBattle
  58. dw VoltorbBattleText ; TextEndBattle
  59. dw VoltorbBattleText ; TextEndBattle
  60. Voltorb4TrainerHeader:
  61. dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_4
  62. db 0 ; view range
  63. dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_4
  64. dw VoltorbBattleText ; TextBeforeBattle
  65. dw VoltorbBattleText ; TextAfterBattle
  66. dw VoltorbBattleText ; TextEndBattle
  67. dw VoltorbBattleText ; TextEndBattle
  68. Voltorb5TrainerHeader:
  69. dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_5
  70. db 0 ; view range
  71. dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_5
  72. dw VoltorbBattleText ; TextBeforeBattle
  73. dw VoltorbBattleText ; TextAfterBattle
  74. dw VoltorbBattleText ; TextEndBattle
  75. dw VoltorbBattleText ; TextEndBattle
  76. Voltorb6TrainerHeader:
  77. dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_6
  78. db 0 ; view range
  79. dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_6
  80. dw VoltorbBattleText ; TextBeforeBattle
  81. dw VoltorbBattleText ; TextAfterBattle
  82. dw VoltorbBattleText ; TextEndBattle
  83. dw VoltorbBattleText ; TextEndBattle
  84. Voltorb7TrainerHeader:
  85. dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_7, 1
  86. db 0 ; view range
  87. dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_7, 1
  88. dw VoltorbBattleText ; TextBeforeBattle
  89. dw VoltorbBattleText ; TextAfterBattle
  90. dw VoltorbBattleText ; TextEndBattle
  91. dw VoltorbBattleText ; TextEndBattle
  92. ZapdosTrainerHeader:
  93. dbEventFlagBit EVENT_BEAT_ZAPDOS, 1
  94. db 0 ; view range
  95. dwEventFlagAddress EVENT_BEAT_ZAPDOS, 1
  96. dw ZapdosBattleText ; TextBeforeBattle
  97. dw ZapdosBattleText ; TextAfterBattle
  98. dw ZapdosBattleText ; TextEndBattle
  99. dw ZapdosBattleText ; TextEndBattle
  100. db $ff
  101. InitVoltorbBattle:
  102. call TalkToTrainer
  103. ld a, [wCurMapScript]
  104. ld [wPowerPlantCurScript], a
  105. jp TextScriptEnd
  106. Voltorb0Text:
  107. TX_ASM
  108. ld hl, Voltorb0TrainerHeader
  109. jr InitVoltorbBattle
  110. Voltorb1Text:
  111. TX_ASM
  112. ld hl, Voltorb1TrainerHeader
  113. jr InitVoltorbBattle
  114. Voltorb2Text:
  115. TX_ASM
  116. ld hl, Voltorb2TrainerHeader
  117. jr InitVoltorbBattle
  118. Voltorb3Text:
  119. TX_ASM
  120. ld hl, Voltorb3TrainerHeader
  121. jr InitVoltorbBattle
  122. Voltorb4Text:
  123. TX_ASM
  124. ld hl, Voltorb4TrainerHeader
  125. jr InitVoltorbBattle
  126. Voltorb5Text:
  127. TX_ASM
  128. ld hl, Voltorb5TrainerHeader
  129. jr InitVoltorbBattle
  130. Voltorb6Text:
  131. TX_ASM
  132. ld hl, Voltorb6TrainerHeader
  133. jr InitVoltorbBattle
  134. Voltorb7Text:
  135. TX_ASM
  136. ld hl, Voltorb7TrainerHeader
  137. jr InitVoltorbBattle
  138. ZapdosText:
  139. TX_ASM
  140. ld hl, ZapdosTrainerHeader
  141. jr InitVoltorbBattle
  142. VoltorbBattleText:
  143. TX_FAR _VoltorbBattleText
  144. db "@"
  145. ZapdosBattleText:
  146. TX_FAR _ZapdosBattleText
  147. TX_ASM
  148. ld a, ZAPDOS
  149. call PlayCry
  150. call WaitForSoundToFinish
  151. jp TextScriptEnd