ssanne2.asm 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. SSAnne2Script:
  2. call EnableAutoTextBoxDrawing
  3. ld hl, SSAnne2ScriptPointers
  4. ld a, [wSSAnne2CurScript]
  5. jp CallFunctionInTable
  6. SSAnne2Script_613ab:
  7. xor a
  8. ld [wJoyIgnore], a
  9. ld [wSSAnne2CurScript], a
  10. ret
  11. SSAnne2ScriptPointers:
  12. dw SSAnne2Script0
  13. dw SSAnne2Script1
  14. dw SSAnne2Script2
  15. dw SSAnne2Script3
  16. dw SSAnne2Script4
  17. SSAnne2Script4:
  18. ret
  19. SSAnne2Script0:
  20. ld hl, CoordsData_61411
  21. call ArePlayerCoordsInArray
  22. ret nc
  23. ld a, $ff
  24. ld [wNewSoundID], a
  25. call PlaySound
  26. ld c, BANK(Music_MeetRival)
  27. ld a, MUSIC_MEET_RIVAL
  28. call PlayMusic
  29. ld a, [wCoordIndex]
  30. ld [$ffdb], a
  31. ld a, HS_SS_ANNE_2_RIVAL
  32. ld [wMissableObjectIndex], a
  33. predef ShowObject
  34. call Delay3
  35. ld a, $2
  36. ld [H_SPRITEINDEX], a
  37. call SetSpriteMovementBytesToFF
  38. xor a
  39. ld [hJoyHeld], a
  40. ld a, $f0
  41. ld [wJoyIgnore], a
  42. ld a, [$ffdb]
  43. cp $2
  44. jr nz, .asm_61400
  45. ld de, MovementData_6140c
  46. jr .asm_61403
  47. .asm_61400
  48. ld de, MovementData_6140d
  49. .asm_61403
  50. call MoveSprite
  51. ld a, $1
  52. ld [wSSAnne2CurScript], a
  53. ret
  54. MovementData_6140c:
  55. db NPC_MOVEMENT_DOWN
  56. MovementData_6140d:
  57. db NPC_MOVEMENT_DOWN
  58. db NPC_MOVEMENT_DOWN
  59. db NPC_MOVEMENT_DOWN
  60. db $FF
  61. CoordsData_61411:
  62. db $08,$24
  63. db $08,$25
  64. db $FF
  65. SSAnne2Script_61416:
  66. ld a, [wXCoord]
  67. cp $25
  68. jr nz, .asm_61426
  69. ld a, PLAYER_DIR_LEFT
  70. ld [wPlayerMovingDirection], a
  71. ld a, SPRITE_FACING_RIGHT
  72. jr .asm_61427
  73. .asm_61426
  74. xor a ; SPRITE_FACING_DOWN
  75. .asm_61427
  76. ld [hSpriteFacingDirection], a
  77. ld a, $2
  78. ld [H_SPRITEINDEX], a
  79. jp SetSpriteFacingDirectionAndDelay
  80. SSAnne2Script1:
  81. ld a, [wd730]
  82. bit 0, a
  83. ret nz
  84. call SSAnne2Script_61416
  85. xor a
  86. ld [wJoyIgnore], a
  87. ld a, $2
  88. ld [hSpriteIndexOrTextID], a
  89. call DisplayTextID
  90. call Delay3
  91. ld a, OPP_SONY2
  92. ld [wCurOpponent], a
  93. ; select which team to use during the encounter
  94. ld a, [wRivalStarter]
  95. cp STARTER2
  96. jr nz, .NotSquirtle
  97. ld a, $1
  98. jr .done
  99. .NotSquirtle
  100. cp STARTER3
  101. jr nz, .Charmander
  102. ld a, $2
  103. jr .done
  104. .Charmander
  105. ld a, $3
  106. .done
  107. ld [wTrainerNo], a
  108. call SSAnne2Script_61416
  109. ld a, $2
  110. ld [wSSAnne2CurScript], a
  111. ret
  112. SSAnne2Script2:
  113. ld a, [wIsInBattle]
  114. cp $ff
  115. jp z, SSAnne2Script_613ab
  116. call SSAnne2Script_61416
  117. ld a, $f0
  118. ld [wJoyIgnore], a
  119. ld a, $3
  120. ld [hSpriteIndexOrTextID], a
  121. call DisplayTextID
  122. ld a, $2
  123. ld [H_SPRITEINDEX], a
  124. call SetSpriteMovementBytesToFF
  125. ld a, [wXCoord]
  126. cp $25
  127. jr nz, .asm_61497
  128. ld de, MovementData_614b9
  129. jr .asm_6149a
  130. .asm_61497
  131. ld de, MovementData_614b7
  132. .asm_6149a
  133. ld a, $2
  134. ld [H_SPRITEINDEX], a
  135. call MoveSprite
  136. ld a, $ff
  137. ld [wNewSoundID], a
  138. call PlaySound
  139. callba Music_RivalAlternateStart
  140. ld a, $3
  141. ld [wSSAnne2CurScript], a
  142. ret
  143. MovementData_614b7:
  144. db NPC_MOVEMENT_RIGHT
  145. db NPC_MOVEMENT_DOWN
  146. MovementData_614b9:
  147. db NPC_MOVEMENT_DOWN
  148. db NPC_MOVEMENT_DOWN
  149. db NPC_MOVEMENT_DOWN
  150. db NPC_MOVEMENT_DOWN
  151. db $FF
  152. SSAnne2Script3:
  153. ld a, [wd730]
  154. bit 0, a
  155. ret nz
  156. xor a
  157. ld [wJoyIgnore], a
  158. ld a, HS_SS_ANNE_2_RIVAL
  159. ld [wMissableObjectIndex], a
  160. predef HideObject
  161. call PlayDefaultMusic
  162. ld a, $4
  163. ld [wSSAnne2CurScript], a
  164. ret
  165. SSAnne2TextPointers:
  166. dw SSAnne2Text1
  167. dw SSAnne2Text2
  168. dw SSAnne2Text3
  169. SSAnne2Text1:
  170. TX_FAR _SSAnne2Text1
  171. db "@"
  172. SSAnne2Text2:
  173. TX_ASM
  174. ld hl, SSAnneRivalBeforeBattleText
  175. call PrintText
  176. ld hl, wd72d
  177. set 6, [hl]
  178. set 7, [hl]
  179. ld hl, SSAnneRivalDefeatedText
  180. ld de, SSAnneRivalWonText
  181. call SaveEndBattleTextPointers
  182. jp TextScriptEnd
  183. SSAnneRivalBeforeBattleText:
  184. TX_FAR _SSAnneRivalBeforeBattleText
  185. db "@"
  186. SSAnneRivalDefeatedText:
  187. TX_FAR _SSAnneRivalDefeatedText
  188. db "@"
  189. SSAnneRivalWonText:
  190. TX_FAR _SSAnneRivalWonText
  191. db "@"
  192. SSAnne2Text3:
  193. TX_FAR _SSAnneRivalCaptainText
  194. db "@"