fuchsiagym.asm 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. FuchsiaGymScript:
  2. call FuchsiaGymScript_75453
  3. call EnableAutoTextBoxDrawing
  4. ld hl, FuchsiaGymTrainerHeader0
  5. ld de, FuchsiaGymScriptPointers
  6. ld a, [wFuchsiaGymCurScript]
  7. call ExecuteCurMapScriptInTable
  8. ld [wFuchsiaGymCurScript], a
  9. ret
  10. FuchsiaGymScript_75453:
  11. ld hl, wCurrentMapScriptFlags
  12. bit 6, [hl]
  13. res 6, [hl]
  14. ret z
  15. ld hl, Gym5CityName
  16. ld de, Gym5LeaderName
  17. call LoadGymLeaderAndCityName
  18. ret
  19. Gym5CityName:
  20. db "FUCHSIA CITY@"
  21. Gym5LeaderName:
  22. db "KOGA@"
  23. FuchsiaGymScript_75477:
  24. xor a
  25. ld [wJoyIgnore], a
  26. ld [wFuchsiaGymCurScript], a
  27. ld [wCurMapScript], a
  28. ret
  29. FuchsiaGymScriptPointers:
  30. dw CheckFightingMapTrainers
  31. dw DisplayEnemyTrainerTextAndStartBattle
  32. dw EndTrainerBattle
  33. dw FuchsiaGymScript3
  34. FuchsiaGymScript3:
  35. ld a, [wIsInBattle]
  36. cp $ff
  37. jp z, FuchsiaGymScript_75477
  38. ld a, $f0
  39. ld [wJoyIgnore], a
  40. FuchsiaGymScript3_75497:
  41. ld a, $9
  42. ld [hSpriteIndexOrTextID], a
  43. call DisplayTextID
  44. SetEvent EVENT_BEAT_KOGA
  45. lb bc, TM_06, 1
  46. call GiveItem
  47. jr nc, .BagFull
  48. ld a, $a
  49. ld [hSpriteIndexOrTextID], a
  50. call DisplayTextID
  51. SetEvent EVENT_GOT_TM06
  52. jr .asm_754c0
  53. .BagFull
  54. ld a, $b
  55. ld [hSpriteIndexOrTextID], a
  56. call DisplayTextID
  57. .asm_754c0
  58. ld hl, wObtainedBadges
  59. set 4, [hl]
  60. ld hl, wBeatGymFlags
  61. set 4, [hl]
  62. ; deactivate gym trainers
  63. SetEventRange EVENT_BEAT_FUCHSIA_GYM_TRAINER_0, EVENT_BEAT_FUCHSIA_GYM_TRAINER_5
  64. jp FuchsiaGymScript_75477
  65. FuchsiaGymTextPointers:
  66. dw FuchsiaGymText1
  67. dw FuchsiaGymText2
  68. dw FuchsiaGymText3
  69. dw FuchsiaGymText4
  70. dw FuchsiaGymText5
  71. dw FuchsiaGymText6
  72. dw FuchsiaGymText7
  73. dw FuchsiaGymText8
  74. dw FuchsiaGymText9
  75. dw FuchsiaGymText10
  76. dw FuchsiaGymText11
  77. FuchsiaGymTrainerHeader0:
  78. dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_0
  79. db ($2 << 4) ; trainer's view range
  80. dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_0
  81. dw FuchsiaGymBattleText1 ; TextBeforeBattle
  82. dw FuchsiaGymAfterBattleText1 ; TextAfterBattle
  83. dw FuchsiaGymEndBattleText1 ; TextEndBattle
  84. dw FuchsiaGymEndBattleText1 ; TextEndBattle
  85. FuchsiaGymTrainerHeader1:
  86. dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_1
  87. db ($2 << 4) ; trainer's view range
  88. dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_1
  89. dw FuchsiaGymBattleText2 ; TextBeforeBattle
  90. dw FuchsiaGymAfterBattleText2 ; TextAfterBattle
  91. dw FuchsiaGymEndBattleText2 ; TextEndBattle
  92. dw FuchsiaGymEndBattleText2 ; TextEndBattle
  93. FuchsiaGymTrainerHeader2:
  94. dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_2
  95. db ($4 << 4) ; trainer's view range
  96. dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_2
  97. dw FuchsiaGymBattleText3 ; TextBeforeBattle
  98. dw FuchsiaGymAfterBattleText3 ; TextAfterBattle
  99. dw FuchsiaGymEndBattleText3 ; TextEndBattle
  100. dw FuchsiaGymEndBattleText3 ; TextEndBattle
  101. FuchsiaGymTrainerHeader3:
  102. dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_3
  103. db ($2 << 4) ; trainer's view range
  104. dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_3
  105. dw FuchsiaGymBattleText4 ; TextBeforeBattle
  106. dw FuchsiaGymAfterBattleText4 ; TextAfterBattle
  107. dw FuchsiaGymEndBattleText4 ; TextEndBattle
  108. dw FuchsiaGymEndBattleText4 ; TextEndBattle
  109. FuchsiaGymTrainerHeader4:
  110. dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_4
  111. db ($2 << 4) ; trainer's view range
  112. dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_4
  113. dw FuchsiaGymBattleText5 ; TextBeforeBattle
  114. dw FuchsiaGymAfterBattleText5 ; TextAfterBattle
  115. dw FuchsiaGymEndBattleText5 ; TextEndBattle
  116. dw FuchsiaGymEndBattleText5 ; TextEndBattle
  117. FuchsiaGymTrainerHeader5:
  118. dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_5
  119. db ($2 << 4) ; trainer's view range
  120. dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_5
  121. dw FuchsiaGymBattleText6 ; TextBeforeBattle
  122. dw FuchsiaGymAfterBattleText6 ; TextAfterBattle
  123. dw FuchsiaGymEndBattleText6 ; TextEndBattle
  124. dw FuchsiaGymEndBattleText6 ; TextEndBattle
  125. db $ff
  126. FuchsiaGymText1:
  127. TX_ASM
  128. CheckEvent EVENT_BEAT_KOGA
  129. jr z, .asm_181b6
  130. CheckEventReuseA EVENT_GOT_TM06
  131. jr nz, .asm_adc3b
  132. call z, FuchsiaGymScript3_75497
  133. call DisableWaitingAfterTextDisplay
  134. jr .asm_e84c6
  135. .asm_adc3b
  136. ld hl, KogaExplainToxicText
  137. call PrintText
  138. jr .asm_e84c6
  139. .asm_181b6
  140. ld hl, KogaBeforeBattleText
  141. call PrintText
  142. ld hl, wd72d
  143. set 6, [hl]
  144. set 7, [hl]
  145. ld hl, KogaAfterBattleText
  146. ld de, KogaAfterBattleText
  147. call SaveEndBattleTextPointers
  148. ld a, [H_SPRITEINDEX]
  149. ld [wSpriteIndex], a
  150. call EngageMapTrainer
  151. call InitBattleEnemyParameters
  152. ld a, $5
  153. ld [wGymLeaderNo], a
  154. xor a
  155. ld [hJoyHeld], a
  156. ld a, $3
  157. ld [wFuchsiaGymCurScript], a
  158. .asm_e84c6
  159. jp TextScriptEnd
  160. KogaBeforeBattleText:
  161. TX_FAR _KogaBeforeBattleText
  162. db "@"
  163. KogaAfterBattleText:
  164. TX_FAR _KogaAfterBattleText
  165. db "@"
  166. KogaExplainToxicText:
  167. TX_FAR _KogaExplainToxicText
  168. db "@"
  169. FuchsiaGymText9:
  170. TX_FAR _FuchsiaGymText9
  171. db "@"
  172. FuchsiaGymText10:
  173. TX_FAR _ReceivedTM06Text
  174. TX_SFX_KEY_ITEM
  175. TM06ExplanationText:
  176. TX_FAR _TM06ExplanationText
  177. db "@"
  178. FuchsiaGymText11:
  179. TX_FAR _TM06NoRoomText
  180. db "@"
  181. FuchsiaGymText2:
  182. TX_ASM
  183. ld hl, FuchsiaGymTrainerHeader0
  184. call TalkToTrainer
  185. jp TextScriptEnd
  186. FuchsiaGymBattleText1:
  187. TX_FAR _FuchsiaGymBattleText1
  188. db "@"
  189. FuchsiaGymEndBattleText1:
  190. TX_FAR _FuchsiaGymEndBattleText1
  191. db "@"
  192. FuchsiaGymAfterBattleText1:
  193. TX_FAR _FuchsiaGymAfterBattleText1
  194. db "@"
  195. FuchsiaGymText3:
  196. TX_ASM
  197. ld hl, FuchsiaGymTrainerHeader1
  198. call TalkToTrainer
  199. jp TextScriptEnd
  200. FuchsiaGymBattleText2:
  201. TX_FAR _FuchsiaGymBattleText2
  202. db "@"
  203. FuchsiaGymEndBattleText2:
  204. TX_FAR _FuchsiaGymEndBattleText2
  205. db "@"
  206. FuchsiaGymAfterBattleText2:
  207. TX_FAR _FuchsiaGymAfterBattleText2
  208. db "@"
  209. FuchsiaGymText4:
  210. TX_ASM
  211. ld hl, FuchsiaGymTrainerHeader2
  212. call TalkToTrainer
  213. jp TextScriptEnd
  214. FuchsiaGymBattleText3:
  215. TX_FAR _FuchsiaGymBattleText3
  216. db "@"
  217. FuchsiaGymEndBattleText3:
  218. TX_FAR _FuchsiaGymEndBattleText3
  219. db "@"
  220. FuchsiaGymAfterBattleText3:
  221. TX_FAR _FuchsiaGymAfterBattleText3
  222. db "@"
  223. FuchsiaGymText5:
  224. TX_ASM
  225. ld hl, FuchsiaGymTrainerHeader3
  226. call TalkToTrainer
  227. jp TextScriptEnd
  228. FuchsiaGymBattleText4:
  229. TX_FAR _FuchsiaGymBattleText4
  230. db "@"
  231. FuchsiaGymEndBattleText4:
  232. TX_FAR _FuchsiaGymEndBattleText4
  233. db "@"
  234. FuchsiaGymAfterBattleText4:
  235. TX_FAR _FuchsiaGymAfterBattleText4
  236. db "@"
  237. FuchsiaGymText6:
  238. TX_ASM
  239. ld hl, FuchsiaGymTrainerHeader4
  240. call TalkToTrainer
  241. jp TextScriptEnd
  242. FuchsiaGymBattleText5:
  243. TX_FAR _FuchsiaGymBattleText5
  244. db "@"
  245. FuchsiaGymEndBattleText5:
  246. TX_FAR _FuchsiaGymEndBattleText5
  247. db "@"
  248. FuchsiaGymAfterBattleText5:
  249. TX_FAR _FuchsiaGymAfterBattleText5
  250. db "@"
  251. FuchsiaGymText7:
  252. TX_ASM
  253. ld hl, FuchsiaGymTrainerHeader5
  254. call TalkToTrainer
  255. jp TextScriptEnd
  256. FuchsiaGymBattleText6:
  257. TX_FAR _FuchsiaGymBattleText6
  258. db "@"
  259. FuchsiaGymEndBattleText6:
  260. TX_FAR _FuchsiaGymEndBattleText6
  261. db "@"
  262. FuchsiaGymAfterBattleText6:
  263. TX_FAR _FuchsiaGymAfterBattleText6
  264. db "@"
  265. FuchsiaGymText8:
  266. TX_ASM
  267. CheckEvent EVENT_BEAT_KOGA
  268. ld hl, FuchsiaGymText_75653
  269. jr nz, .asm_50671
  270. ld hl, FuchsiaGymText_7564e
  271. .asm_50671
  272. call PrintText
  273. jp TextScriptEnd
  274. FuchsiaGymText_7564e:
  275. TX_FAR _FuchsiaGymText_7564e
  276. db "@"
  277. FuchsiaGymText_75653:
  278. TX_FAR _FuchsiaGymText_75653
  279. db "@"