mansion2.asm 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. Mansion2Script:
  2. call Mansion2Script_51fee
  3. call EnableAutoTextBoxDrawing
  4. ld hl, Mansion2TrainerHeader0
  5. ld de, Mansion2ScriptPointers
  6. ld a, [wMansion2CurScript]
  7. call ExecuteCurMapScriptInTable
  8. ld [wMansion2CurScript], a
  9. ret
  10. Mansion2Script_51fee:
  11. ld hl, wCurrentMapScriptFlags
  12. bit 5, [hl]
  13. res 5, [hl]
  14. ret z
  15. CheckEvent EVENT_MANSION_SWITCH_ON
  16. jr nz, .asm_52016
  17. ld a, $e
  18. lb bc, 2, 4
  19. call Mansion2Script_5202f
  20. ld a, $54
  21. lb bc, 4, 9
  22. call Mansion2Script_5202f
  23. ld a, $5f
  24. lb bc, 11, 3
  25. call Mansion2Script_5202f
  26. ret
  27. .asm_52016
  28. ld a, $5f
  29. lb bc, 2, 4
  30. call Mansion2Script_5202f
  31. ld a, $e
  32. lb bc, 4, 9
  33. call Mansion2Script_5202f
  34. ld a, $e
  35. lb bc, 11, 3
  36. call Mansion2Script_5202f
  37. ret
  38. Mansion2Script_5202f:
  39. ld [wNewTileBlockID], a
  40. predef_jump ReplaceTileBlock
  41. Mansion2Script_Switches:
  42. ld a, [wSpriteStateData1 + 9]
  43. cp SPRITE_FACING_UP
  44. ret nz
  45. xor a
  46. ld [hJoyHeld], a
  47. ld a, $5
  48. ld [hSpriteIndexOrTextID], a
  49. jp DisplayTextID
  50. Mansion2ScriptPointers:
  51. dw CheckFightingMapTrainers
  52. dw DisplayEnemyTrainerTextAndStartBattle
  53. dw EndTrainerBattle
  54. Mansion2TextPointers:
  55. dw Mansion2Text1
  56. dw PickUpItemText
  57. dw Mansion2Text3
  58. dw Mansion2Text4
  59. dw Mansion2Text5
  60. Mansion2TrainerHeader0:
  61. dbEventFlagBit EVENT_BEAT_MANSION_2_TRAINER_0
  62. db ($0 << 4) ; trainer's view range
  63. dwEventFlagAddress EVENT_BEAT_MANSION_2_TRAINER_0
  64. dw Mansion2BattleText1 ; TextBeforeBattle
  65. dw Mansion2AfterBattleText1 ; TextAfterBattle
  66. dw Mansion2EndBattleText1 ; TextEndBattle
  67. dw Mansion2EndBattleText1 ; TextEndBattle
  68. db $ff
  69. Mansion2Text1:
  70. TX_ASM
  71. ld hl, Mansion2TrainerHeader0
  72. call TalkToTrainer
  73. jp TextScriptEnd
  74. Mansion2BattleText1:
  75. TX_FAR _Mansion2BattleText1
  76. db "@"
  77. Mansion2EndBattleText1:
  78. TX_FAR _Mansion2EndBattleText1
  79. db "@"
  80. Mansion2AfterBattleText1:
  81. TX_FAR _Mansion2AfterBattleText1
  82. db "@"
  83. Mansion2Text3:
  84. TX_FAR _Mansion2Text3
  85. db "@"
  86. Mansion2Text4:
  87. TX_FAR _Mansion2Text4
  88. db "@"
  89. Mansion3Text6:
  90. Mansion2Text5:
  91. TX_ASM
  92. ld hl, Mansion2Text_520c2
  93. call PrintText
  94. call YesNoChoice
  95. ld a, [wCurrentMenuItem]
  96. and a
  97. jr nz, .asm_520b9
  98. ld a, $1
  99. ld [wDoNotWaitForButtonPressAfterDisplayingText], a
  100. ld hl, wCurrentMapScriptFlags
  101. set 5, [hl]
  102. ld hl, Mansion2Text_520c7
  103. call PrintText
  104. ld a, SFX_GO_INSIDE
  105. call PlaySound
  106. CheckAndSetEvent EVENT_MANSION_SWITCH_ON
  107. jr z, .asm_520bf
  108. ResetEventReuseHL EVENT_MANSION_SWITCH_ON
  109. jr .asm_520bf
  110. .asm_520b9
  111. ld hl, Mansion2Text_520cc
  112. call PrintText
  113. .asm_520bf
  114. jp TextScriptEnd
  115. Mansion2Text_520c2:
  116. TX_FAR _Mansion2Text_520c2
  117. db "@"
  118. Mansion2Text_520c7:
  119. TX_FAR _Mansion2Text_520c7
  120. db "@"
  121. Mansion2Text_520cc:
  122. TX_FAR _Mansion2Text_520cc
  123. db "@"