silphco5.asm 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. SilphCo5Script:
  2. call SilphCo5Script_19f4d
  3. call EnableAutoTextBoxDrawing
  4. ld hl, SilphCo5TrainerHeader0
  5. ld de, SilphCo5ScriptPointers
  6. ld a, [wSilphCo5CurScript]
  7. call ExecuteCurMapScriptInTable
  8. ld [wSilphCo5CurScript], a
  9. ret
  10. SilphCo5Script_19f4d:
  11. ld hl, wCurrentMapScriptFlags
  12. bit 5, [hl]
  13. res 5, [hl]
  14. ret z
  15. ld hl, SilphCo5GateCoords
  16. call SilphCo4Script_19d5d
  17. call SilphCo5Script_19f9e
  18. CheckEvent EVENT_SILPH_CO_5_UNLOCKED_DOOR1
  19. jr nz, .asm_19f74
  20. push af
  21. ld a, $5f
  22. ld [wNewTileBlockID], a
  23. lb bc, 2, 3
  24. predef ReplaceTileBlock
  25. pop af
  26. .asm_19f74
  27. CheckEventAfterBranchReuseA EVENT_SILPH_CO_5_UNLOCKED_DOOR2, EVENT_SILPH_CO_5_UNLOCKED_DOOR1
  28. jr nz, .asm_19f87
  29. push af
  30. ld a, $5f
  31. ld [wNewTileBlockID], a
  32. lb bc, 6, 3
  33. predef ReplaceTileBlock
  34. pop af
  35. .asm_19f87
  36. CheckEventAfterBranchReuseA EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR2
  37. ret nz
  38. ld a, $5f
  39. ld [wNewTileBlockID], a
  40. lb bc, 5, 7
  41. predef_jump ReplaceTileBlock
  42. SilphCo5GateCoords:
  43. db $02,$03
  44. db $06,$03
  45. db $05,$07
  46. db $FF
  47. SilphCo5Script_19f9e:
  48. EventFlagAddress hl, EVENT_SILPH_CO_5_UNLOCKED_DOOR1
  49. ld a, [$ffe0]
  50. and a
  51. ret z
  52. cp $1
  53. jr nz, .next1
  54. SetEventReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR1
  55. ret
  56. .next1
  57. cp $2
  58. jr nz, .next2
  59. SetEventAfterBranchReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR2, EVENT_SILPH_CO_5_UNLOCKED_DOOR1
  60. ret
  61. .next2
  62. SetEventAfterBranchReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR1
  63. ret
  64. SilphCo5ScriptPointers:
  65. dw CheckFightingMapTrainers
  66. dw DisplayEnemyTrainerTextAndStartBattle
  67. dw EndTrainerBattle
  68. SilphCo5TextPointers:
  69. dw SilphCo5Text1
  70. dw SilphCo5Text2
  71. dw SilphCo5Text3
  72. dw SilphCo5Text4
  73. dw SilphCo5Text5
  74. dw PickUpItemText
  75. dw PickUpItemText
  76. dw PickUpItemText
  77. dw SilphCo5Text9
  78. dw SilphCo5Text10
  79. dw SilphCo5Text11
  80. SilphCo5TrainerHeader0:
  81. dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_0
  82. db ($1 << 4) ; trainer's view range
  83. dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_0
  84. dw SilphCo5BattleText2 ; TextBeforeBattle
  85. dw SilphCo5AfterBattleText2 ; TextAfterBattle
  86. dw SilphCo5EndBattleText2 ; TextEndBattle
  87. dw SilphCo5EndBattleText2 ; TextEndBattle
  88. SilphCo5TrainerHeader1:
  89. dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_1
  90. db ($2 << 4) ; trainer's view range
  91. dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_1
  92. dw SilphCo5BattleText3 ; TextBeforeBattle
  93. dw SilphCo5AfterBattleText3 ; TextAfterBattle
  94. dw SilphCo5EndBattleText3 ; TextEndBattle
  95. dw SilphCo5EndBattleText3 ; TextEndBattle
  96. SilphCo5TrainerHeader2:
  97. dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_2
  98. db ($4 << 4) ; trainer's view range
  99. dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_2
  100. dw SilphCo5BattleText4 ; TextBeforeBattle
  101. dw SilphCo5AfterBattleText4 ; TextAfterBattle
  102. dw SilphCo5EndBattleText4 ; TextEndBattle
  103. dw SilphCo5EndBattleText4 ; TextEndBattle
  104. SilphCo5TrainerHeader3:
  105. dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_3
  106. db ($3 << 4) ; trainer's view range
  107. dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_3
  108. dw SilphCo5BattleText5 ; TextBeforeBattle
  109. dw SilphCo5AfterBattleText5 ; TextAfterBattle
  110. dw SilphCo5EndBattleText5 ; TextEndBattle
  111. dw SilphCo5EndBattleText5 ; TextEndBattle
  112. db $ff
  113. SilphCo5Text1:
  114. TX_ASM
  115. ld hl, SilphCo5Text_1a010
  116. ld de, SilphCo5Text_1a015
  117. call SilphCo6Script_1a22f
  118. jp TextScriptEnd
  119. SilphCo5Text_1a010:
  120. TX_FAR _SilphCo5Text_1a010
  121. db "@"
  122. SilphCo5Text_1a015:
  123. TX_FAR _SilphCo5Text_1a015
  124. db "@"
  125. SilphCo5Text2:
  126. TX_ASM
  127. ld hl, SilphCo5TrainerHeader0
  128. call TalkToTrainer
  129. jp TextScriptEnd
  130. SilphCo5BattleText2:
  131. TX_FAR _SilphCo5BattleText2
  132. db "@"
  133. SilphCo5EndBattleText2:
  134. TX_FAR _SilphCo5EndBattleText2
  135. db "@"
  136. SilphCo5AfterBattleText2:
  137. TX_FAR _SilphCo5AfterBattleText2
  138. db "@"
  139. SilphCo5Text3:
  140. TX_ASM
  141. ld hl, SilphCo5TrainerHeader1
  142. call TalkToTrainer
  143. jp TextScriptEnd
  144. SilphCo5BattleText3:
  145. TX_FAR _SilphCo5BattleText3
  146. db "@"
  147. SilphCo5EndBattleText3:
  148. TX_FAR _SilphCo5EndBattleText3
  149. db "@"
  150. SilphCo5AfterBattleText3:
  151. TX_FAR _SilphCo5AfterBattleText3
  152. db "@"
  153. SilphCo5Text4:
  154. TX_ASM
  155. ld hl, SilphCo5TrainerHeader2
  156. call TalkToTrainer
  157. jp TextScriptEnd
  158. SilphCo5BattleText4:
  159. TX_FAR _SilphCo5BattleText4
  160. db "@"
  161. SilphCo5EndBattleText4:
  162. TX_FAR _SilphCo5EndBattleText4
  163. db "@"
  164. SilphCo5AfterBattleText4:
  165. TX_FAR _SilphCo5AfterBattleText4
  166. db "@"
  167. SilphCo5Text5:
  168. TX_ASM
  169. ld hl, SilphCo5TrainerHeader3
  170. call TalkToTrainer
  171. jp TextScriptEnd
  172. SilphCo5BattleText5:
  173. TX_FAR _SilphCo5BattleText5
  174. db "@"
  175. SilphCo5EndBattleText5:
  176. TX_FAR _SilphCo5EndBattleText5
  177. db "@"
  178. SilphCo5AfterBattleText5:
  179. TX_FAR _SilphCo5AfterBattleText5
  180. db "@"
  181. SilphCo5Text9:
  182. TX_FAR _SilphCo5Text9
  183. db "@"
  184. SilphCo5Text10:
  185. TX_FAR _SilphCo5Text10
  186. db "@"
  187. SilphCo5Text11:
  188. TX_FAR _SilphCo5Text11
  189. db "@"