mtmoon3.asm 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. MtMoon3Script:
  2. call EnableAutoTextBoxDrawing
  3. ld hl, MtMoon3TrainerHeader0
  4. ld de, MtMoon3ScriptPointers
  5. ld a, [wMtMoon3CurScript]
  6. call ExecuteCurMapScriptInTable
  7. ld [wMtMoon3CurScript], a
  8. CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
  9. ret z
  10. ld hl, CoordsData_49d37
  11. call ArePlayerCoordsInArray
  12. jr nc, .asm_49d31
  13. ld hl, wd72e
  14. set 4, [hl]
  15. ret
  16. .asm_49d31
  17. ld hl, wd72e
  18. res 4, [hl]
  19. ret
  20. CoordsData_49d37:
  21. db $05,$0B
  22. db $05,$0C
  23. db $05,$0D
  24. db $05,$0E
  25. db $06,$0B
  26. db $06,$0C
  27. db $06,$0D
  28. db $06,$0E
  29. db $07,$0B
  30. db $07,$0C
  31. db $07,$0D
  32. db $07,$0E
  33. db $08,$0B
  34. db $08,$0C
  35. db $08,$0D
  36. db $08,$0E
  37. db $FF
  38. MtMoon3Script_49d58:
  39. xor a
  40. ld [wJoyIgnore], a
  41. ld [wMtMoon3CurScript], a
  42. ld [wCurMapScript], a
  43. ret
  44. MtMoon3ScriptPointers:
  45. dw MtMoon3Script0
  46. dw DisplayEnemyTrainerTextAndStartBattle
  47. dw EndTrainerBattle
  48. dw MtMoon3Script3
  49. dw MtMoon3Script4
  50. dw MtMoon3Script5
  51. MtMoon3Script0:
  52. CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
  53. jp nz, MtMoon3Script_49d91
  54. ld a, [wYCoord]
  55. cp $8
  56. jp nz, MtMoon3Script_49d91
  57. ld a, [wXCoord]
  58. cp $d
  59. jp nz, MtMoon3Script_49d91
  60. xor a
  61. ld [hJoyHeld], a
  62. ld a, $1
  63. ld [hSpriteIndexOrTextID], a
  64. jp DisplayTextID
  65. MtMoon3Script_49d91:
  66. CheckEitherEventSet EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL
  67. jp z, CheckFightingMapTrainers
  68. ret
  69. MtMoon3Script3:
  70. ld a, [wIsInBattle]
  71. cp $ff
  72. jp z, MtMoon3Script_49d58
  73. call UpdateSprites
  74. call Delay3
  75. SetEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
  76. xor a
  77. ld [wJoyIgnore], a
  78. ld a, $0
  79. ld [wMtMoon3CurScript], a
  80. ld [wCurMapScript], a
  81. ret
  82. MtMoon3Script4:
  83. ld a, $1
  84. ld [H_SPRITEINDEX], a
  85. call SetSpriteMovementBytesToFF
  86. ld hl, CoordsData_49dea
  87. call ArePlayerCoordsInArray
  88. jr c, .asm_49dd7
  89. ld hl, CoordsData_49df1
  90. call ArePlayerCoordsInArray
  91. jp nc, CheckFightingMapTrainers
  92. ld de, MovementData_49df9
  93. jr .asm_49dda
  94. .asm_49dd7
  95. ld de, MovementData_49df8
  96. .asm_49dda
  97. ld a, $1
  98. ld [H_SPRITEINDEX], a
  99. call MoveSprite
  100. ld a, $5
  101. ld [wMtMoon3CurScript], a
  102. ld [wCurMapScript], a
  103. ret
  104. CoordsData_49dea:
  105. db $07,$0C
  106. db $06,$0B
  107. db $05,$0C
  108. db $FF
  109. CoordsData_49df1:
  110. db $07,$0D
  111. db $06,$0E
  112. db $05,$0E
  113. db $FF
  114. MovementData_49df8:
  115. db NPC_MOVEMENT_RIGHT
  116. MovementData_49df9:
  117. db NPC_MOVEMENT_UP,$FF
  118. MtMoon3Script5:
  119. ld a, [wd730]
  120. bit 0, a
  121. ret nz
  122. ld a, $f0
  123. ld [wJoyIgnore], a
  124. ld a, $1
  125. ld [wDoNotWaitForButtonPressAfterDisplayingText], a
  126. ld a, $a
  127. ld [hSpriteIndexOrTextID], a
  128. call DisplayTextID
  129. CheckEvent EVENT_GOT_DOME_FOSSIL
  130. jr z, .asm_49e1d
  131. ld a, HS_MT_MOON_3_FOSSIL_2
  132. jr .asm_49e1f
  133. .asm_49e1d
  134. ld a, HS_MT_MOON_3_FOSSIL_1
  135. .asm_49e1f
  136. ld [wMissableObjectIndex], a
  137. predef HideObject
  138. xor a
  139. ld [wJoyIgnore], a
  140. ld a, $0
  141. ld [wMtMoon3CurScript], a
  142. ld [wCurMapScript], a
  143. ret
  144. MtMoon3TextPointers:
  145. dw MtMoon3Text1
  146. dw MtMoon3Text2
  147. dw MtMoon3Text3
  148. dw MtMoon3Text4
  149. dw MtMoon3Text5
  150. dw MtMoon3Text6
  151. dw MtMoon3Text7
  152. dw PickUpItemText
  153. dw PickUpItemText
  154. dw MtMoon3Text_49f99
  155. MtMoon3TrainerHeader0:
  156. dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_0
  157. db ($4 << 4) ; trainer's view range
  158. dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_0
  159. dw MtMoon3BattleText2 ; TextBeforeBattle
  160. dw MtMoon3AfterBattleText2 ; TextAfterBattle
  161. dw MtMoon3EndBattleText2 ; TextEndBattle
  162. dw MtMoon3EndBattleText2 ; TextEndBattle
  163. MtMoon3TrainerHeader1:
  164. dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_1
  165. db ($4 << 4) ; trainer's view range
  166. dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_1
  167. dw MtMoon3BattleText3 ; TextBeforeBattle
  168. dw MtMoon3AfterBattleText3 ; TextAfterBattle
  169. dw MtMoon3EndBattleText3 ; TextEndBattle
  170. dw MtMoon3EndBattleText3 ; TextEndBattle
  171. MtMoon3TrainerHeader2:
  172. dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_2
  173. db ($4 << 4) ; trainer's view range
  174. dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_2
  175. dw MtMoon3BattleText4 ; TextBeforeBattle
  176. dw MtMoon3AfterBattleText4 ; TextAfterBattle
  177. dw MtMoon3EndBattleText4 ; TextEndBattle
  178. dw MtMoon3EndBattleText4 ; TextEndBattle
  179. MtMoon3TrainerHeader3:
  180. dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_3
  181. db ($4 << 4) ; trainer's view range
  182. dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_3
  183. dw MtMoon3BattleText5 ; TextBeforeBattle
  184. dw MtMoon3AfterBattleText5 ; TextAfterBattle
  185. dw MtMoon3EndBattleText5 ; TextEndBattle
  186. dw MtMoon3EndBattleText5 ; TextEndBattle
  187. db $ff
  188. MtMoon3Text1:
  189. TX_ASM
  190. CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
  191. jr z, .asm_49e8d
  192. and $c0
  193. jr nz, .asm_49eb8
  194. ld hl, MtMoon3Text_49f8f
  195. call PrintText
  196. jr .asm_49ebe
  197. .asm_49e8d
  198. ld hl, MtMoon3Text_49f85
  199. call PrintText
  200. ld hl, wd72d
  201. set 6, [hl]
  202. set 7, [hl]
  203. ld hl, MtMoon3Text_49f8a
  204. ld de, MtMoon3Text_49f8a
  205. call SaveEndBattleTextPointers
  206. ld a, [H_SPRITEINDEX]
  207. ld [wSpriteIndex], a
  208. call EngageMapTrainer
  209. call InitBattleEnemyParameters
  210. ld a, $3
  211. ld [wMtMoon3CurScript], a
  212. ld [wCurMapScript], a
  213. jr .asm_49ebe
  214. .asm_49eb8
  215. ld hl, MtMoon3Text_49f94
  216. call PrintText
  217. .asm_49ebe
  218. jp TextScriptEnd
  219. MtMoon3Text2:
  220. TX_ASM
  221. ld hl, MtMoon3TrainerHeader0
  222. call TalkToTrainer
  223. jp TextScriptEnd
  224. MtMoon3Text3:
  225. TX_ASM
  226. ld hl, MtMoon3TrainerHeader1
  227. call TalkToTrainer
  228. jp TextScriptEnd
  229. MtMoon3Text4:
  230. TX_ASM
  231. ld hl, MtMoon3TrainerHeader2
  232. call TalkToTrainer
  233. jp TextScriptEnd
  234. MtMoon3Text5:
  235. TX_ASM
  236. ld hl, MtMoon3TrainerHeader3
  237. call TalkToTrainer
  238. jp TextScriptEnd
  239. MtMoon3Text6:
  240. TX_ASM
  241. ld a, $1
  242. ld [wDoNotWaitForButtonPressAfterDisplayingText], a
  243. ld hl, MtMoon3Text_49f24
  244. call PrintText
  245. call YesNoChoice
  246. ld a, [wCurrentMenuItem]
  247. and a
  248. jr nz, .asm_49f21
  249. lb bc, DOME_FOSSIL, 1
  250. call GiveItem
  251. jp nc, MtMoon3Script_49f76
  252. call MtMoon3Script_49f69
  253. ld a, HS_MT_MOON_3_FOSSIL_1
  254. ld [wMissableObjectIndex], a
  255. predef HideObject
  256. SetEvent EVENT_GOT_DOME_FOSSIL
  257. ld a, $4
  258. ld [wMtMoon3CurScript], a
  259. ld [wCurMapScript], a
  260. .asm_49f21
  261. jp TextScriptEnd
  262. MtMoon3Text_49f24:
  263. TX_FAR _MtMoon3Text_49f24
  264. db "@"
  265. MtMoon3Text7:
  266. TX_ASM
  267. ld a, $1
  268. ld [wDoNotWaitForButtonPressAfterDisplayingText], a
  269. ld hl, MtMoon3Text_49f64
  270. call PrintText
  271. call YesNoChoice
  272. ld a, [wCurrentMenuItem]
  273. and a
  274. jr nz, .asm_49f61
  275. lb bc, HELIX_FOSSIL, 1
  276. call GiveItem
  277. jp nc, MtMoon3Script_49f76
  278. call MtMoon3Script_49f69
  279. ld a, HS_MT_MOON_3_FOSSIL_2
  280. ld [wMissableObjectIndex], a
  281. predef HideObject
  282. SetEvent EVENT_GOT_HELIX_FOSSIL
  283. ld a, $4
  284. ld [wMtMoon3CurScript], a
  285. ld [wCurMapScript], a
  286. .asm_49f61
  287. jp TextScriptEnd
  288. MtMoon3Text_49f64:
  289. TX_FAR _MtMoon3Text_49f64
  290. db "@"
  291. MtMoon3Script_49f69:
  292. ld hl, MtMoon3Text_49f6f
  293. jp PrintText
  294. MtMoon3Text_49f6f:
  295. TX_FAR _MtMoon3Text_49f6f
  296. TX_SFX_KEY_ITEM
  297. TX_WAIT
  298. db "@"
  299. MtMoon3Script_49f76:
  300. ld hl, MtMoon3Text_49f7f
  301. call PrintText
  302. jp TextScriptEnd
  303. MtMoon3Text_49f7f:
  304. TX_FAR _MtMoon3Text_49f7f
  305. TX_WAIT
  306. db "@"
  307. MtMoon3Text_49f85:
  308. TX_FAR _MtMoon3Text_49f85
  309. db "@"
  310. MtMoon3Text_49f8a:
  311. TX_FAR _MtMoon3Text_49f8a
  312. db "@"
  313. MtMoon3Text_49f8f:
  314. TX_FAR _MtMoon3Text_49f8f
  315. db "@"
  316. MtMoon3Text_49f94:
  317. TX_FAR _MtMoon3Text_49f94
  318. db "@"
  319. MtMoon3Text_49f99:
  320. TX_FAR _MtMoon3Text_49f99
  321. TX_SFX_KEY_ITEM
  322. db "@"
  323. MtMoon3BattleText2:
  324. TX_FAR _MtMoon3BattleText2
  325. db "@"
  326. MtMoon3EndBattleText2:
  327. TX_FAR _MtMoon3EndBattleText2
  328. db "@"
  329. MtMoon3AfterBattleText2:
  330. TX_FAR _MtMoon3AfterBattleText2
  331. db "@"
  332. MtMoon3BattleText3:
  333. TX_FAR _MtMoon3BattleText3
  334. db "@"
  335. MtMoon3EndBattleText3:
  336. TX_FAR _MtMoon3EndBattleText3
  337. db "@"
  338. MtMoon3AfterBattleText3:
  339. TX_FAR _MtMoon3AfterBattleText3
  340. db "@"
  341. MtMoon3BattleText4:
  342. TX_FAR _MtMoon3BattleText4
  343. db "@"
  344. MtMoon3EndBattleText4:
  345. TX_FAR _MtMoon3EndBattleText4
  346. db "@"
  347. MtMoon3AfterBattleText4:
  348. TX_FAR _MtMoon3AfterBattleText4
  349. db "@"
  350. MtMoon3BattleText5:
  351. TX_FAR _MtMoon3BattleText5
  352. db "@"
  353. MtMoon3EndBattleText5:
  354. TX_FAR _MtMoon3EndBattleText5
  355. db "@"
  356. MtMoon3AfterBattleText5:
  357. TX_FAR _MtMoon3AfterBattleText5
  358. db "@"