silphco3.asm 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. SilphCo3Script:
  2. call SilphCo3Script_59f71
  3. call EnableAutoTextBoxDrawing
  4. ld hl, SilphCo3TrainerHeader0
  5. ld de, SilphCo3ScriptPointers
  6. ld a, [wSilphCo3CurScript]
  7. call ExecuteCurMapScriptInTable
  8. ld [wSilphCo3CurScript], a
  9. ret
  10. SilphCo3Script_59f71:
  11. ld hl, wCurrentMapScriptFlags
  12. bit 5, [hl]
  13. res 5, [hl]
  14. ret z
  15. ld hl, SilphCo3GateCoords
  16. call SilphCo2Script_59d43
  17. call SilphCo3Script_59fad
  18. CheckEvent EVENT_SILPH_CO_3_UNLOCKED_DOOR1
  19. jr nz, .asm_59f98
  20. push af
  21. ld a, $5f
  22. ld [wNewTileBlockID], a
  23. lb bc, 4, 4
  24. predef ReplaceTileBlock
  25. pop af
  26. .asm_59f98
  27. CheckEventAfterBranchReuseA EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1
  28. ret nz
  29. ld a, $5f
  30. ld [wNewTileBlockID], a
  31. lb bc, 4, 8
  32. predef_jump ReplaceTileBlock
  33. SilphCo3GateCoords:
  34. db $04,$04
  35. db $04,$08
  36. db $FF
  37. SilphCo3Script_59fad:
  38. EventFlagAddress hl, EVENT_SILPH_CO_3_UNLOCKED_DOOR1
  39. ld a, [$ffe0]
  40. and a
  41. ret z
  42. cp $1
  43. jr nz, .next
  44. SetEventReuseHL EVENT_SILPH_CO_3_UNLOCKED_DOOR1
  45. ret
  46. .next
  47. SetEventAfterBranchReuseHL EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1
  48. ret
  49. SilphCo3ScriptPointers:
  50. dw CheckFightingMapTrainers
  51. dw DisplayEnemyTrainerTextAndStartBattle
  52. dw EndTrainerBattle
  53. SilphCo3TextPointers:
  54. dw SilphCo3Text1
  55. dw SilphCo3Text2
  56. dw SilphCo3Text3
  57. dw PickUpItemText
  58. SilphCo3TrainerHeader0:
  59. dbEventFlagBit EVENT_BEAT_SILPH_CO_3F_TRAINER_0
  60. db ($2 << 4) ; trainer's view range
  61. dwEventFlagAddress EVENT_BEAT_SILPH_CO_3F_TRAINER_0
  62. dw SilphCo3BattleText1 ; TextBeforeBattle
  63. dw SilphCo3AfterBattleText1 ; TextAfterBattle
  64. dw SilphCo3EndBattleText1 ; TextEndBattle
  65. dw SilphCo3EndBattleText1 ; TextEndBattle
  66. SilphCo3TrainerHeader1:
  67. dbEventFlagBit EVENT_BEAT_SILPH_CO_3F_TRAINER_1
  68. db ($3 << 4) ; trainer's view range
  69. dwEventFlagAddress EVENT_BEAT_SILPH_CO_3F_TRAINER_1
  70. dw SilphCo3BattleText2 ; TextBeforeBattle
  71. dw SilphCo3AfterBattleText2 ; TextAfterBattle
  72. dw SilphCo3EndBattleText2 ; TextEndBattle
  73. dw SilphCo3EndBattleText2 ; TextEndBattle
  74. db $ff
  75. SilphCo3Text1:
  76. TX_ASM
  77. CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
  78. ld hl, SilphCo3Text_59ffe
  79. jr nz, .asm_59fee
  80. ld hl, SilphCo3Text_59ff9
  81. .asm_59fee
  82. call PrintText
  83. jp TextScriptEnd
  84. SilphCo3Text_59ff9:
  85. TX_FAR _SilphCo3Text_59ff9
  86. db "@"
  87. SilphCo3Text_59ffe:
  88. TX_FAR _SilphCo3Text_59ffe
  89. db "@"
  90. SilphCo3Text2:
  91. TX_ASM
  92. ld hl, SilphCo3TrainerHeader0
  93. call TalkToTrainer
  94. jp TextScriptEnd
  95. SilphCo3BattleText1:
  96. TX_FAR _SilphCo3BattleText1
  97. db "@"
  98. SilphCo3EndBattleText1:
  99. TX_FAR _SilphCo3EndBattleText1
  100. db "@"
  101. SilphCo3AfterBattleText1:
  102. TX_FAR _SilphCo3AfterBattleText1
  103. db "@"
  104. SilphCo3Text3:
  105. TX_ASM
  106. ld hl, SilphCo3TrainerHeader1
  107. call TalkToTrainer
  108. jp TextScriptEnd
  109. SilphCo3BattleText2:
  110. TX_FAR _SilphCo3BattleText2
  111. db "@"
  112. SilphCo3EndBattleText2:
  113. TX_FAR _SilphCo3EndBattleText2
  114. db "@"
  115. SilphCo3AfterBattleText2:
  116. TX_FAR _SilphCo3AfterBattleText2
  117. db "@"