mansion1.asm 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. Mansion1Script:
  2. call Mansion1Subscript1
  3. call EnableAutoTextBoxDrawing
  4. ld hl, Mansion1TrainerHeader0
  5. ld de, Mansion1ScriptPointers
  6. ld a, [wMansion1CurScript]
  7. call ExecuteCurMapScriptInTable
  8. ld [wMansion1CurScript], a
  9. ret
  10. Mansion1Subscript1:
  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_442ec
  17. lb bc, 6, 12
  18. call Mansion1Script_4430b
  19. lb bc, 3, 8
  20. call Mansion1Script_44304
  21. lb bc, 8, 10
  22. call Mansion1Script_44304
  23. lb bc, 13, 13
  24. jp Mansion1Script_44304
  25. .asm_442ec
  26. lb bc, 6, 12
  27. call Mansion1Script_44304
  28. lb bc, 3, 8
  29. call Mansion1Script_4430b
  30. lb bc, 8, 10
  31. call Mansion1Script_4430b
  32. lb bc, 13, 13
  33. jp Mansion1Script_4430b
  34. Mansion1Script_44304:
  35. ld a, $2d
  36. ld [wNewTileBlockID], a
  37. jr Mansion1ReplaceBlock
  38. Mansion1Script_4430b:
  39. ld a, $e
  40. ld [wNewTileBlockID], a
  41. Mansion1ReplaceBlock:
  42. predef ReplaceTileBlock
  43. ret
  44. Mansion1Script_Switches:
  45. ld a, [wSpriteStateData1 + 9]
  46. cp SPRITE_FACING_UP
  47. ret nz
  48. xor a
  49. ld [hJoyHeld], a
  50. ld a, $4
  51. ld [hSpriteIndexOrTextID], a
  52. jp DisplayTextID
  53. Mansion1ScriptPointers:
  54. dw CheckFightingMapTrainers
  55. dw DisplayEnemyTrainerTextAndStartBattle
  56. dw EndTrainerBattle
  57. Mansion1TextPointers:
  58. dw Mansion1Text1
  59. dw PickUpItemText
  60. dw PickUpItemText
  61. dw Mansion1Text4
  62. Mansion1TrainerHeader0:
  63. dbEventFlagBit EVENT_BEAT_MANSION_1_TRAINER_0
  64. db ($3 << 4) ; trainer's view range
  65. dwEventFlagAddress EVENT_BEAT_MANSION_1_TRAINER_0
  66. dw Mansion1BattleText2 ; TextBeforeBattle
  67. dw Mansion1AfterBattleText2 ; TextAfterBattle
  68. dw Mansion1EndBattleText2 ; TextEndBattle
  69. dw Mansion1EndBattleText2 ; TextEndBattle
  70. db $ff
  71. Mansion1Text1:
  72. TX_ASM
  73. ld hl, Mansion1TrainerHeader0
  74. call TalkToTrainer
  75. jp TextScriptEnd
  76. Mansion1BattleText2:
  77. TX_FAR _Mansion1BattleText2
  78. db "@"
  79. Mansion1EndBattleText2:
  80. TX_FAR _Mansion1EndBattleText2
  81. db "@"
  82. Mansion1AfterBattleText2:
  83. TX_FAR _Mansion1AfterBattleText2
  84. db "@"
  85. Mansion1Text4:
  86. TX_ASM
  87. ld hl, MansionSwitchText
  88. call PrintText
  89. call YesNoChoice
  90. ld a, [wCurrentMenuItem]
  91. and a
  92. jr nz, .asm_4438c
  93. ld a, $1
  94. ld [wDoNotWaitForButtonPressAfterDisplayingText], a
  95. ld hl, wCurrentMapScriptFlags
  96. set 5, [hl]
  97. ld hl, MansionSwitchPressedText
  98. call PrintText
  99. ld a, SFX_GO_INSIDE
  100. call PlaySound
  101. CheckAndSetEvent EVENT_MANSION_SWITCH_ON
  102. jr z, .asm_44392
  103. ResetEventReuseHL EVENT_MANSION_SWITCH_ON
  104. jr .asm_44392
  105. .asm_4438c
  106. ld hl, MansionSwitchNotPressedText
  107. call PrintText
  108. .asm_44392
  109. jp TextScriptEnd
  110. MansionSwitchText:
  111. TX_FAR _MansionSwitchText
  112. db "@"
  113. MansionSwitchPressedText:
  114. TX_FAR _MansionSwitchPressedText
  115. db "@"
  116. MansionSwitchNotPressedText:
  117. TX_FAR _MansionSwitchNotPressedText
  118. db "@"