pokered/scripts/SilphCo8F.asm

165 lines
3 KiB
NASM
Raw Normal View History

SilphCo8F_Script:
2014-05-18 18:19:10 +00:00
call SilphCo8Script_5651a
call EnableAutoTextBoxDrawing
ld hl, SilphCo8TrainerHeaders
ld de, SilphCo8F_ScriptPointers
ld a, [wSilphCo8FCurScript]
2014-05-18 18:19:10 +00:00
call ExecuteCurMapScriptInTable
ld [wSilphCo8FCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
SilphCo8Script_5651a:
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, SilphCo8GateCoords
2014-05-18 18:19:10 +00:00
call SilphCo8Script_56541
call SilphCo8Script_5656d
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR
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, 4, 3
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
SilphCo8GateCoords:
dbmapcoord 3, 4
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8Script_56541:
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_5654d
ld a, [hli]
cp $ff
jr z, .asm_56569
push hl
ld hl, hUnlockedSilphCoDoors
2014-05-18 18:19:10 +00:00
inc [hl]
pop hl
cp b
jr z, .asm_5655e
inc hl
jr .asm_5654d
.asm_5655e
ld a, [hli]
cp c
jr nz, .asm_5654d
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_56569
xor a
ldh [hUnlockedSilphCoDoors], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
SilphCo8Script_5656d:
ldh a, [hUnlockedSilphCoDoors]
2014-05-18 18:19:10 +00:00
and a
ret z
2015-07-21 17:36:03 +00:00
SetEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR
2014-05-18 18:19:10 +00:00
ret
SilphCo8F_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
SilphCo8F_TextPointers:
2014-05-18 18:19:10 +00:00
dw SilphCo8Text1
dw SilphCo8Text2
dw SilphCo8Text3
dw SilphCo8Text4
SilphCo8TrainerHeaders:
def_trainers 2
2016-06-12 00:24:04 +00:00
SilphCo8TrainerHeader0:
trainer EVENT_BEAT_SILPH_CO_8F_TRAINER_0, 4, SilphCo8BattleText1, SilphCo8EndBattleText1, SilphCo8AfterBattleText1
2016-06-12 00:24:04 +00:00
SilphCo8TrainerHeader1:
trainer EVENT_BEAT_SILPH_CO_8F_TRAINER_1, 4, SilphCo8BattleText2, SilphCo8EndBattleText2, SilphCo8AfterBattleText2
2016-06-12 00:24:04 +00:00
SilphCo8TrainerHeader2:
trainer EVENT_BEAT_SILPH_CO_8F_TRAINER_2, 4, SilphCo8BattleText3, SilphCo8EndBattleText3, SilphCo8AfterBattleText3
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8Text1:
text_asm
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
2014-05-18 18:19:10 +00:00
ld hl, SilphCo8Text_565c3
jr nz, .asm_565b8
2014-05-18 18:19:10 +00:00
ld hl, SilphCo8Text_565be
.asm_565b8
2014-05-18 18:19:10 +00:00
call PrintText
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo8Text_565be:
text_far _SilphCo8Text_565be
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8Text_565c3:
text_far _SilphCo8Text_565c3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8Text2:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, SilphCo8TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo8Text3:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, SilphCo8TrainerHeader1
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo8Text4:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, SilphCo8TrainerHeader2
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo8BattleText1:
text_far _SilphCo8BattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8EndBattleText1:
text_far _SilphCo8EndBattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8AfterBattleText1:
text_far _SilphCo8AfterBattleText1
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8BattleText2:
text_far _SilphCo8BattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8EndBattleText2:
text_far _SilphCo8EndBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8AfterBattleText2:
text_far _SilphCo8AfterBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8BattleText3:
text_far _SilphCo8BattleText3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8EndBattleText3:
text_far _SilphCo8EndBattleText3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo8AfterBattleText3:
text_far _SilphCo8AfterBattleText3
text_end