museum1f.asm 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. Museum1FScript:
  2. ld a, $1
  3. ld [wAutoTextBoxDrawingControl], a
  4. xor a
  5. ld [wDoNotWaitForButtonPressAfterDisplayingText], a
  6. ld hl, Museum1FScriptPointers
  7. ld a, [wMuseum1fCurScript]
  8. jp CallFunctionInTable
  9. Museum1FScriptPointers:
  10. dw Museum1FScript0
  11. dw Museum1FScript1
  12. Museum1FScript0:
  13. ld a, [wYCoord]
  14. cp $4
  15. ret nz
  16. ld a, [wXCoord]
  17. cp $9
  18. jr z, .asm_5c120
  19. ld a, [wXCoord]
  20. cp $a
  21. ret nz
  22. .asm_5c120
  23. xor a
  24. ld [hJoyHeld], a
  25. ld a, $1
  26. ld [hSpriteIndexOrTextID], a
  27. jp DisplayTextID
  28. Museum1FScript1:
  29. ret
  30. Museum1FTextPointers:
  31. dw Museum1FText1
  32. dw Museum1FText2
  33. dw Museum1FText3
  34. dw Museum1FText4
  35. dw Museum1FText5
  36. Museum1FText1:
  37. TX_ASM
  38. ld a, [wYCoord]
  39. cp $4
  40. jr nz, .asm_8774b
  41. ld a, [wXCoord]
  42. cp $d
  43. jp z, Museum1FScript_5c1f9
  44. jr .asm_b8709
  45. .asm_8774b
  46. cp $3
  47. jr nz, .asm_d49e7
  48. ld a, [wXCoord]
  49. cp $c
  50. jp z, Museum1FScript_5c1f9
  51. .asm_d49e7
  52. CheckEvent EVENT_BOUGHT_MUSEUM_TICKET
  53. jr nz, .asm_31a16
  54. ld hl, Museum1FText_5c23d
  55. call PrintText
  56. jp Museum1FScriptEnd
  57. .asm_b8709
  58. CheckEvent EVENT_BOUGHT_MUSEUM_TICKET
  59. jr z, .asm_3ded4
  60. .asm_31a16
  61. ld hl, Museum1FText_5c242
  62. call PrintText
  63. jp Museum1FScriptEnd
  64. .asm_3ded4
  65. ld a, MONEY_BOX
  66. ld [wTextBoxID], a
  67. call DisplayTextBoxID
  68. xor a
  69. ld [hJoyHeld], a
  70. ld hl, Museum1FText_5c21f
  71. call PrintText
  72. call YesNoChoice
  73. ld a, [wCurrentMenuItem]
  74. and a
  75. jr nz, .asm_de133
  76. xor a
  77. ld [hMoney], a
  78. ld [hMoney + 1], a
  79. ld a, $50
  80. ld [hMoney + 2], a
  81. call HasEnoughMoney
  82. jr nc, .asm_0f3e3
  83. ld hl, Museum1FText_5c229
  84. call PrintText
  85. jp .asm_de133
  86. .asm_0f3e3
  87. ld hl, Museum1FText_5c224
  88. call PrintText
  89. SetEvent EVENT_BOUGHT_MUSEUM_TICKET
  90. xor a
  91. ld [wPriceTemp], a
  92. ld [wPriceTemp + 1], a
  93. ld a, $50
  94. ld [wPriceTemp + 2], a
  95. ld hl, wPriceTemp + 2
  96. ld de, wPlayerMoney + 2
  97. ld c, $3
  98. predef SubBCDPredef
  99. ld a, MONEY_BOX
  100. ld [wTextBoxID], a
  101. call DisplayTextBoxID
  102. ld a, SFX_PURCHASE
  103. call PlaySoundWaitForCurrent
  104. call WaitForSoundToFinish
  105. jr .asm_0b094
  106. .asm_de133
  107. ld hl, Museum1FText_5c21a
  108. call PrintText
  109. ld a, $1
  110. ld [wSimulatedJoypadStatesIndex], a
  111. ld a, D_DOWN
  112. ld [wSimulatedJoypadStatesEnd], a
  113. call StartSimulatingJoypadStates
  114. call UpdateSprites
  115. jr Museum1FScriptEnd
  116. .asm_0b094
  117. ld a, $1
  118. ld [wMuseum1fCurScript], a
  119. jr Museum1FScriptEnd
  120. Museum1FScript_5c1f9:
  121. ld hl, Museum1FText_5c22e
  122. call PrintText
  123. call YesNoChoice
  124. ld a, [wCurrentMenuItem]
  125. cp $0
  126. jr nz, .asm_d1144
  127. ld hl, Museum1FText_5c233
  128. call PrintText
  129. jr Museum1FScriptEnd
  130. .asm_d1144
  131. ld hl, Museum1FText_5c238
  132. call PrintText
  133. Museum1FScriptEnd:
  134. jp TextScriptEnd
  135. Museum1FText_5c21a:
  136. TX_FAR _Museum1FText_5c21a
  137. db "@"
  138. Museum1FText_5c21f:
  139. TX_FAR _Museum1FText_5c21f
  140. db "@"
  141. Museum1FText_5c224:
  142. TX_FAR _Museum1FText_5c224
  143. db "@"
  144. Museum1FText_5c229:
  145. TX_FAR _Museum1FText_5c229
  146. db "@"
  147. Museum1FText_5c22e:
  148. TX_FAR _Museum1FText_5c22e
  149. db "@"
  150. Museum1FText_5c233:
  151. TX_FAR _Museum1FText_5c233
  152. db "@"
  153. Museum1FText_5c238:
  154. TX_FAR _Museum1FText_5c238
  155. db "@"
  156. Museum1FText_5c23d:
  157. TX_FAR _Museum1FText_5c23d
  158. db "@"
  159. Museum1FText_5c242:
  160. TX_FAR _Museum1FText_5c242
  161. db "@"
  162. Museum1FText2:
  163. TX_ASM
  164. ld hl, Museum1FText_5c251
  165. call PrintText
  166. jp TextScriptEnd
  167. Museum1FText_5c251:
  168. TX_FAR _Museum1FText_5c251
  169. db "@"
  170. Museum1FText3:
  171. TX_ASM
  172. CheckEvent EVENT_GOT_OLD_AMBER
  173. jr nz, .asm_5c285
  174. ld hl, Museum1FText_5c28e
  175. call PrintText
  176. lb bc, OLD_AMBER, 1
  177. call GiveItem
  178. jr nc, .BagFull
  179. SetEvent EVENT_GOT_OLD_AMBER
  180. ld a, HS_OLD_AMBER
  181. ld [wMissableObjectIndex], a
  182. predef HideObject
  183. ld hl, ReceivedOldAmberText
  184. jr .asm_5c288
  185. .BagFull
  186. ld hl, Museum1FText_5c29e
  187. jr .asm_5c288
  188. .asm_5c285
  189. ld hl, Museum1FText_5c299
  190. .asm_5c288
  191. call PrintText
  192. jp TextScriptEnd
  193. Museum1FText_5c28e:
  194. TX_FAR _Museum1FText_5c28e
  195. db "@"
  196. ReceivedOldAmberText:
  197. TX_FAR _ReceivedOldAmberText
  198. TX_SFX_ITEM_1
  199. db "@"
  200. Museum1FText_5c299:
  201. TX_FAR _Museum1FText_5c299
  202. db "@"
  203. Museum1FText_5c29e:
  204. TX_FAR _Museum1FText_5c29e
  205. db "@"
  206. Museum1FText4:
  207. TX_ASM
  208. ld hl, Museum1FText_5c2ad
  209. call PrintText
  210. jp TextScriptEnd
  211. Museum1FText_5c2ad:
  212. TX_FAR _Museum1FText_5c2ad
  213. db "@"
  214. Museum1FText5:
  215. TX_ASM
  216. ld hl, Museum1FText_5c2bc
  217. call PrintText
  218. jp TextScriptEnd
  219. Museum1FText_5c2bc:
  220. TX_FAR _Museum1FText_5c2bc
  221. db "@"