2019-01-01 20:06:23 +00:00
|
|
|
SilphCo9F_Script:
|
2014-05-18 18:19:10 +00:00
|
|
|
call SilphCo9Script_5d7d1
|
|
|
|
call EnableAutoTextBoxDrawing
|
2016-07-20 05:40:04 +00:00
|
|
|
ld hl, SilphCo9TrainerHeader0
|
2019-01-01 20:06:23 +00:00
|
|
|
ld de, SilphCo9F_ScriptPointers
|
|
|
|
ld a, [wSilphCo9FCurScript]
|
2014-05-18 18:19:10 +00:00
|
|
|
call ExecuteCurMapScriptInTable
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSilphCo9FCurScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9Script_5d7d1:
|
2016-01-03 19:17:10 +00:00
|
|
|
ld hl, wCurrentMapScriptFlags
|
2014-05-18 18:19:10 +00:00
|
|
|
bit 5, [hl]
|
|
|
|
res 5, [hl]
|
|
|
|
ret z
|
2015-08-05 21:20:29 +00:00
|
|
|
ld hl, SilphCo9GateCoords
|
2014-05-18 18:19:10 +00:00
|
|
|
call SilphCo9Script_5d837
|
|
|
|
call SilphCo9Script_5d863
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_SILPH_CO_9_UNLOCKED_DOOR1
|
2014-05-18 18:19:10 +00:00
|
|
|
jr nz, .asm_5d7f8
|
|
|
|
push af
|
|
|
|
ld a, $5f
|
2015-07-24 21:39:45 +00:00
|
|
|
ld [wNewTileBlockID], a
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, 4, 1
|
2014-09-14 18:29:18 +00:00
|
|
|
predef ReplaceTileBlock
|
2014-05-18 18:19:10 +00:00
|
|
|
pop af
|
|
|
|
.asm_5d7f8
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR2, EVENT_SILPH_CO_9_UNLOCKED_DOOR1
|
2014-05-18 18:19:10 +00:00
|
|
|
jr nz, .asm_5d80b
|
|
|
|
push af
|
|
|
|
ld a, $54
|
2015-07-24 21:39:45 +00:00
|
|
|
ld [wNewTileBlockID], a
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, 2, 9
|
2014-09-14 18:29:18 +00:00
|
|
|
predef ReplaceTileBlock
|
2014-05-18 18:19:10 +00:00
|
|
|
pop af
|
|
|
|
.asm_5d80b
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR3, EVENT_SILPH_CO_9_UNLOCKED_DOOR2
|
2014-05-18 18:19:10 +00:00
|
|
|
jr nz, .asm_5d81e
|
|
|
|
push af
|
|
|
|
ld a, $54
|
2015-07-24 21:39:45 +00:00
|
|
|
ld [wNewTileBlockID], a
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, 5, 9
|
2014-09-14 18:29:18 +00:00
|
|
|
predef ReplaceTileBlock
|
2014-05-18 18:19:10 +00:00
|
|
|
pop af
|
|
|
|
.asm_5d81e
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR3
|
2014-05-18 18:19:10 +00:00
|
|
|
ret nz
|
|
|
|
ld a, $5f
|
2015-07-24 21:39:45 +00:00
|
|
|
ld [wNewTileBlockID], a
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, 6, 5
|
2014-09-14 18:29:18 +00:00
|
|
|
predef_jump ReplaceTileBlock
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9GateCoords:
|
2015-08-05 21:20:29 +00:00
|
|
|
db $04,$01
|
|
|
|
db $02,$09
|
|
|
|
db $05,$09
|
|
|
|
db $06,$05
|
|
|
|
db $FF
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9Script_5d837:
|
2014-05-18 18:19:10 +00:00
|
|
|
push hl
|
2014-09-14 18:29:18 +00:00
|
|
|
ld hl, wCardKeyDoorY
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
ld a, [hl]
|
|
|
|
ld c, a
|
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hUnlockedSilphCoDoors], a
|
2014-05-18 18:19:10 +00:00
|
|
|
pop hl
|
|
|
|
.asm_5d843
|
|
|
|
ld a, [hli]
|
|
|
|
cp $ff
|
|
|
|
jr z, .asm_5d85f
|
|
|
|
push hl
|
2020-07-04 02:11:35 +00:00
|
|
|
ld hl, hUnlockedSilphCoDoors
|
2014-05-18 18:19:10 +00:00
|
|
|
inc [hl]
|
|
|
|
pop hl
|
|
|
|
cp b
|
|
|
|
jr z, .asm_5d854
|
|
|
|
inc hl
|
|
|
|
jr .asm_5d843
|
|
|
|
.asm_5d854
|
|
|
|
ld a, [hli]
|
|
|
|
cp c
|
|
|
|
jr nz, .asm_5d843
|
2014-09-14 18:29:18 +00:00
|
|
|
ld hl, wCardKeyDoorY
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
.asm_5d85f
|
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hUnlockedSilphCoDoors], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9Script_5d863:
|
2015-07-21 17:36:03 +00:00
|
|
|
EventFlagAddress hl, EVENT_SILPH_CO_9_UNLOCKED_DOOR1
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh a, [hUnlockedSilphCoDoors]
|
2014-05-18 18:19:10 +00:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
cp $1
|
2015-07-21 01:32:02 +00:00
|
|
|
jr nz, .next1
|
2015-07-21 17:36:03 +00:00
|
|
|
SetEventReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR1
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
2015-07-21 01:32:02 +00:00
|
|
|
.next1
|
2014-05-18 18:19:10 +00:00
|
|
|
cp $2
|
2015-07-21 01:32:02 +00:00
|
|
|
jr nz, .next2
|
2015-07-21 17:36:03 +00:00
|
|
|
SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR2, EVENT_SILPH_CO_9_UNLOCKED_DOOR1
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
2015-07-21 01:32:02 +00:00
|
|
|
.next2
|
2014-05-18 18:19:10 +00:00
|
|
|
cp $3
|
2015-07-21 01:32:02 +00:00
|
|
|
jr nz, .next3
|
2015-07-21 17:36:03 +00:00
|
|
|
SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR3, EVENT_SILPH_CO_9_UNLOCKED_DOOR1
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
2015-07-21 01:32:02 +00:00
|
|
|
.next3
|
2014-05-18 18:19:10 +00:00
|
|
|
cp $4
|
|
|
|
ret nz
|
2015-07-21 17:36:03 +00:00
|
|
|
SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR1
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
SilphCo9F_ScriptPointers:
|
2014-05-18 18:19:10 +00:00
|
|
|
dw CheckFightingMapTrainers
|
2014-09-14 18:29:18 +00:00
|
|
|
dw DisplayEnemyTrainerTextAndStartBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
dw EndTrainerBattle
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
SilphCo9F_TextPointers:
|
2014-05-18 18:19:10 +00:00
|
|
|
dw SilphCo9Text1
|
|
|
|
dw SilphCo9Text2
|
|
|
|
dw SilphCo9Text3
|
|
|
|
dw SilphCo9Text4
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9TrainerHeader0:
|
2015-07-21 01:32:02 +00:00
|
|
|
dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_0
|
2014-05-18 18:19:10 +00:00
|
|
|
db ($4 << 4) ; trainer's view range
|
2015-07-21 01:32:02 +00:00
|
|
|
dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_0
|
2015-07-03 19:38:12 +00:00
|
|
|
dw SilphCo9BattleText1 ; TextBeforeBattle
|
|
|
|
dw SilphCo9AfterBattleText1 ; TextAfterBattle
|
|
|
|
dw SilphCo9EndBattleText1 ; TextEndBattle
|
|
|
|
dw SilphCo9EndBattleText1 ; TextEndBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9TrainerHeader1:
|
2015-07-21 01:32:02 +00:00
|
|
|
dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_1
|
2014-05-18 18:19:10 +00:00
|
|
|
db ($2 << 4) ; trainer's view range
|
2015-07-21 01:32:02 +00:00
|
|
|
dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_1
|
2015-07-03 19:38:12 +00:00
|
|
|
dw SilphCo9BattleText2 ; TextBeforeBattle
|
|
|
|
dw SilphCo9AfterBattleText2 ; TextAfterBattle
|
|
|
|
dw SilphCo9EndBattleText2 ; TextEndBattle
|
|
|
|
dw SilphCo9EndBattleText2 ; TextEndBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9TrainerHeader2:
|
2015-07-21 01:32:02 +00:00
|
|
|
dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_2
|
2014-05-18 18:19:10 +00:00
|
|
|
db ($4 << 4) ; trainer's view range
|
2015-07-21 01:32:02 +00:00
|
|
|
dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_2
|
2015-07-03 19:38:12 +00:00
|
|
|
dw SilphCo9BattleText3 ; TextBeforeBattle
|
|
|
|
dw SilphCo9AfterBattleText3 ; TextAfterBattle
|
|
|
|
dw SilphCo9EndBattleText3 ; TextEndBattle
|
|
|
|
dw SilphCo9EndBattleText3 ; TextEndBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
|
|
|
|
db $ff
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9Text1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
|
2015-07-03 19:38:12 +00:00
|
|
|
jr nz, .asm_5d8dc
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, SilphCo9Text_5d8e5
|
|
|
|
call PrintText
|
2014-06-16 20:57:26 +00:00
|
|
|
predef HealParty
|
2014-09-13 07:50:56 +00:00
|
|
|
call GBFadeOutToWhite
|
2014-05-18 18:19:10 +00:00
|
|
|
call Delay3
|
2014-09-13 07:50:56 +00:00
|
|
|
call GBFadeInFromWhite
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, SilphCo9Text_5d8ea
|
|
|
|
call PrintText
|
2015-07-03 19:38:12 +00:00
|
|
|
jr .asm_5d8e2
|
|
|
|
.asm_5d8dc
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, SilphCo9Text_5d8ef
|
|
|
|
call PrintText
|
2015-07-03 19:38:12 +00:00
|
|
|
.asm_5d8e2
|
2014-05-18 18:19:10 +00:00
|
|
|
jp TextScriptEnd
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9Text_5d8e5:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9Text_5d8e5
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9Text_5d8ea:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9Text_5d8ea
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9Text_5d8ef:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9Text_5d8ef
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9Text2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, SilphCo9TrainerHeader0
|
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9Text3:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, SilphCo9TrainerHeader1
|
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9Text4:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, SilphCo9TrainerHeader2
|
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9BattleText1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9BattleText1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9EndBattleText1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9EndBattleText1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9AfterBattleText1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9AfterBattleText1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9BattleText2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9BattleText2
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9EndBattleText2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9EndBattleText2
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9AfterBattleText2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9AfterBattleText2
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9BattleText3:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9BattleText3
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9EndBattleText3:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9EndBattleText3
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo9AfterBattleText3:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _SilphCo9AfterBattleText3
|
|
|
|
text_end
|