pokered/scripts/SilphCo9F.asm

224 lines
4.3 KiB
NASM
Raw Normal View History

SilphCo9F_Script:
2014-05-18 18:19:10 +00:00
call SilphCo9Script_5d7d1
call EnableAutoTextBoxDrawing
ld hl, SilphCo9TrainerHeader0
ld de, SilphCo9F_ScriptPointers
ld a, [wSilphCo9FCurScript]
2014-05-18 18:19:10 +00:00
call ExecuteCurMapScriptInTable
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:
dbmapcoord 1, 4
dbmapcoord 9, 2
dbmapcoord 9, 5
dbmapcoord 5, 6
db -1 ; end
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
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
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
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
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
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
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:
trainer EVENT_BEAT_SILPH_CO_9F_TRAINER_0, 4, SilphCo9BattleText1, SilphCo9EndBattleText1, SilphCo9AfterBattleText1
2016-06-12 00:24:04 +00:00
SilphCo9TrainerHeader1:
trainer EVENT_BEAT_SILPH_CO_9F_TRAINER_1, 2, SilphCo9BattleText2, SilphCo9EndBattleText2, SilphCo9AfterBattleText2
2016-06-12 00:24:04 +00:00
SilphCo9TrainerHeader2:
trainer EVENT_BEAT_SILPH_CO_9F_TRAINER_2, 4, SilphCo9BattleText3, SilphCo9EndBattleText3, SilphCo9AfterBattleText3
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9Text1:
text_asm
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
jr nz, .asm_5d8dc
2014-05-18 18:19:10 +00:00
ld hl, SilphCo9Text_5d8e5
call PrintText
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
jr .asm_5d8e2
.asm_5d8dc
2014-05-18 18:19:10 +00:00
ld hl, SilphCo9Text_5d8ef
call PrintText
.asm_5d8e2
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo9Text_5d8e5:
text_far _SilphCo9Text_5d8e5
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9Text_5d8ea:
text_far _SilphCo9Text_5d8ea
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9Text_5d8ef:
text_far _SilphCo9Text_5d8ef
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9Text2:
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:
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:
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:
text_far _SilphCo9BattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9EndBattleText1:
text_far _SilphCo9EndBattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9AfterBattleText1:
text_far _SilphCo9AfterBattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9BattleText2:
text_far _SilphCo9BattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9EndBattleText2:
text_far _SilphCo9EndBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9AfterBattleText2:
text_far _SilphCo9AfterBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9BattleText3:
text_far _SilphCo9BattleText3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9EndBattleText3:
text_far _SilphCo9EndBattleText3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo9AfterBattleText3:
text_far _SilphCo9AfterBattleText3
text_end