mansion4.asm 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. Mansion4Script:
  2. call Mansion4Script_523cf
  3. call EnableAutoTextBoxDrawing
  4. ld hl, Mansion4TrainerHeader0
  5. ld de, Mansion4ScriptPointers
  6. ld a, [wMansion4CurScript]
  7. call ExecuteCurMapScriptInTable
  8. ld [wMansion4CurScript], a
  9. ret
  10. Mansion4Script_523cf:
  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_523ff
  17. ld a, $e
  18. ld bc, $80d
  19. call Mansion2Script_5202f
  20. ld a, $e
  21. ld bc, $b06
  22. call Mansion2Script_5202f
  23. ld a, $5f
  24. ld bc, $304
  25. call Mansion2Script_5202f
  26. ld a, $54
  27. ld bc, $808
  28. call Mansion2Script_5202f
  29. ret
  30. .asm_523ff
  31. ld a, $2d
  32. ld bc, $80d
  33. call Mansion2Script_5202f
  34. ld a, $5f
  35. ld bc, $b06
  36. call Mansion2Script_5202f
  37. ld a, $e
  38. ld bc, $304
  39. call Mansion2Script_5202f
  40. ld a, $e
  41. ld bc, $808
  42. call Mansion2Script_5202f
  43. ret
  44. Mansion4Script_Switches:
  45. ld a, [wSpriteStateData1 + 9]
  46. cp SPRITE_FACING_UP
  47. ret nz
  48. xor a
  49. ld [hJoyHeld], a
  50. ld a, $9
  51. ld [hSpriteIndexOrTextID], a
  52. jp DisplayTextID
  53. Mansion4ScriptPointers:
  54. dw CheckFightingMapTrainers
  55. dw DisplayEnemyTrainerTextAndStartBattle
  56. dw EndTrainerBattle
  57. Mansion4TextPointers:
  58. dw Mansion4Text1
  59. dw Mansion4Text2
  60. dw PickUpItemText
  61. dw PickUpItemText
  62. dw PickUpItemText
  63. dw PickUpItemText
  64. dw Mansion4Text7
  65. dw PickUpItemText
  66. dw Mansion3Text6
  67. Mansion4TrainerHeader0:
  68. dbEventFlagBit EVENT_BEAT_MANSION_4_TRAINER_0
  69. db ($0 << 4) ; trainer's view range
  70. dwEventFlagAddress EVENT_BEAT_MANSION_4_TRAINER_0
  71. dw Mansion4BattleText1 ; TextBeforeBattle
  72. dw Mansion4AfterBattleText1 ; TextAfterBattle
  73. dw Mansion4EndBattleText1 ; TextEndBattle
  74. dw Mansion4EndBattleText1 ; TextEndBattle
  75. Mansion4TrainerHeader1:
  76. dbEventFlagBit EVENT_BEAT_MANSION_4_TRAINER_1
  77. db ($3 << 4) ; trainer's view range
  78. dwEventFlagAddress EVENT_BEAT_MANSION_4_TRAINER_1
  79. dw Mansion4BattleText2 ; TextBeforeBattle
  80. dw Mansion4AfterBattleText2 ; TextAfterBattle
  81. dw Mansion4EndBattleText2 ; TextEndBattle
  82. dw Mansion4EndBattleText2 ; TextEndBattle
  83. db $ff
  84. Mansion4Text1:
  85. TX_ASM
  86. ld hl, Mansion4TrainerHeader0
  87. call TalkToTrainer
  88. jp TextScriptEnd
  89. Mansion4Text2:
  90. TX_ASM
  91. ld hl, Mansion4TrainerHeader1
  92. call TalkToTrainer
  93. jp TextScriptEnd
  94. Mansion4BattleText1:
  95. TX_FAR _Mansion4BattleText1
  96. db "@"
  97. Mansion4EndBattleText1:
  98. TX_FAR _Mansion4EndBattleText1
  99. db "@"
  100. Mansion4AfterBattleText1:
  101. TX_FAR _Mansion4AfterBattleText1
  102. db "@"
  103. Mansion4BattleText2:
  104. TX_FAR _Mansion4BattleText2
  105. db "@"
  106. Mansion4EndBattleText2:
  107. TX_FAR _Mansion4EndBattleText2
  108. db "@"
  109. Mansion4AfterBattleText2:
  110. TX_FAR _Mansion4AfterBattleText2
  111. db "@"
  112. Mansion4Text7:
  113. TX_FAR _Mansion4Text7
  114. db "@"