mansion3.asm 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. Mansion3Script:
  2. call Mansion3Script_52204
  3. call EnableAutoTextBoxDrawing
  4. ld hl, Mansion3TrainerHeader0
  5. ld de, Mansion3ScriptPointers
  6. ld a, [wMansion3CurScript]
  7. call ExecuteCurMapScriptInTable
  8. ld [wMansion3CurScript], a
  9. ret
  10. Mansion3Script_52204:
  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_52224
  17. ld a, $e
  18. ld bc, $207
  19. call Mansion2Script_5202f
  20. ld a, $5f
  21. ld bc, $507
  22. call Mansion2Script_5202f
  23. ret
  24. .asm_52224
  25. ld a, $5f
  26. ld bc, $207
  27. call Mansion2Script_5202f
  28. ld a, $e
  29. ld bc, $507
  30. call Mansion2Script_5202f
  31. ret
  32. Mansion3ScriptPointers:
  33. dw Mansion3Script0
  34. dw DisplayEnemyTrainerTextAndStartBattle
  35. dw EndTrainerBattle
  36. Mansion3Script0:
  37. ld hl, CoordsData_52254
  38. call Mansion3Script_5225b
  39. ld a, [wWhichDungeonWarp]
  40. and a
  41. jp z, CheckFightingMapTrainers
  42. cp $3
  43. ld a, $a5
  44. jr nz, .asm_52250
  45. ld a, $d6
  46. .asm_52250
  47. ld [wDungeonWarpDestinationMap], a
  48. ret
  49. CoordsData_52254:
  50. db $0E,$10
  51. db $0E,$11
  52. db $0E,$13
  53. db $FF
  54. Mansion3Script_5225b:
  55. xor a
  56. ld [wWhichDungeonWarp], a
  57. ld a, [wd72d]
  58. bit 4, a
  59. ret nz
  60. call ArePlayerCoordsInArray
  61. ret nc
  62. ld a, [wCoordIndex]
  63. ld [wWhichDungeonWarp], a
  64. ld hl, wd72d
  65. set 4, [hl]
  66. ld hl, wd732
  67. set 4, [hl]
  68. ret
  69. Mansion3Script_Switches:
  70. ld a, [wSpriteStateData1 + 9]
  71. cp SPRITE_FACING_UP
  72. ret nz
  73. xor a
  74. ld [hJoyHeld], a
  75. ld a, $6
  76. ld [hSpriteIndexOrTextID], a
  77. jp DisplayTextID
  78. Mansion3TextPointers:
  79. dw Mansion3Text1
  80. dw Mansion3Text2
  81. dw PickUpItemText
  82. dw PickUpItemText
  83. dw Mansion3Text5
  84. dw Mansion3Text6
  85. Mansion3TrainerHeader0:
  86. dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_0
  87. db ($0 << 4) ; trainer's view range
  88. dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_0
  89. dw Mansion3BattleText1 ; TextBeforeBattle
  90. dw Mansion3AfterBattleText1 ; TextAfterBattle
  91. dw Mansion3EndBattleText1 ; TextEndBattle
  92. dw Mansion3EndBattleText1 ; TextEndBattle
  93. Mansion3TrainerHeader1:
  94. dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_1
  95. db ($2 << 4) ; trainer's view range
  96. dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_1
  97. dw Mansion3BattleText2 ; TextBeforeBattle
  98. dw Mansion3AfterBattleText2 ; TextAfterBattle
  99. dw Mansion3EndBattleText2 ; TextEndBattle
  100. dw Mansion3EndBattleText2 ; TextEndBattle
  101. db $ff
  102. Mansion3Text1:
  103. TX_ASM
  104. ld hl, Mansion3TrainerHeader0
  105. call TalkToTrainer
  106. jp TextScriptEnd
  107. Mansion3Text2:
  108. TX_ASM
  109. ld hl, Mansion3TrainerHeader1
  110. call TalkToTrainer
  111. jp TextScriptEnd
  112. Mansion3BattleText1:
  113. TX_FAR _Mansion3BattleText1
  114. db "@"
  115. Mansion3EndBattleText1:
  116. TX_FAR _Mansion3EndBattleText1
  117. db "@"
  118. Mansion3AfterBattleText1:
  119. TX_FAR _Mansion3AfterBattleText1
  120. db "@"
  121. Mansion3BattleText2:
  122. TX_FAR _Mansion3BattleText2
  123. db "@"
  124. Mansion3EndBattleText2:
  125. TX_FAR _Mansion3EndBattleText2
  126. db "@"
  127. Mansion3AfterBattleText2:
  128. TX_FAR _Mansion3AfterBattleText2
  129. db "@"
  130. Mansion3Text5:
  131. TX_FAR _Mansion3Text5
  132. db "@"