pokered/scripts/SilphCo4F.asm

181 lines
3.4 KiB
NASM
Raw Normal View History

SilphCo4F_Script:
2014-05-18 18:19:10 +00:00
call SilphCo4Script_19d21
call EnableAutoTextBoxDrawing
ld hl, SilphCo4TrainerHeaders
ld de, SilphCo4F_ScriptPointers
ld a, [wSilphCo4FCurScript]
2014-05-18 18:19:10 +00:00
call ExecuteCurMapScriptInTable
ld [wSilphCo4FCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
SilphCo4Script_19d21:
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, SilphCo4GateCoords
2014-05-18 18:19:10 +00:00
call SilphCo4Script_19d5d
call SilphCo4Script_19d89
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_SILPH_CO_4_UNLOCKED_DOOR1
2014-05-18 18:19:10 +00:00
jr nz, .asm_19d48
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, 6, 2
2014-09-14 18:29:18 +00:00
predef ReplaceTileBlock
2014-05-18 18:19:10 +00:00
pop af
.asm_19d48
2015-07-21 17:36:03 +00:00
CheckEventAfterBranchReuseA EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1
2014-05-18 18:19:10 +00:00
ret nz
ld a, $54
2015-07-24 21:39:45 +00:00
ld [wNewTileBlockID], a
2015-08-05 21:20:29 +00:00
lb bc, 4, 6
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
SilphCo4GateCoords:
dbmapcoord 2, 6
dbmapcoord 6, 4
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4Script_19d5d:
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_19d69
ld a, [hli]
cp $ff
jr z, .asm_19d85
2014-05-18 18:19:10 +00:00
push hl
ld hl, hUnlockedSilphCoDoors
2014-05-18 18:19:10 +00:00
inc [hl]
pop hl
cp b
jr z, .asm_19d7a
2014-05-18 18:19:10 +00:00
inc hl
jr .asm_19d69
2014-05-18 18:19:10 +00:00
.asm_19d7a
ld a, [hli]
cp c
jr nz, .asm_19d69
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_19d85
xor a
ldh [hUnlockedSilphCoDoors], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
SilphCo4Script_19d89:
2015-07-21 17:36:03 +00:00
EventFlagAddress hl, EVENT_SILPH_CO_4_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, .next
2015-07-21 17:36:03 +00:00
SetEventReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR1
2014-05-18 18:19:10 +00:00
ret
2015-07-21 01:32:02 +00:00
.next
2015-07-21 17:36:03 +00:00
SetEventAfterBranchReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1
2014-05-18 18:19:10 +00:00
ret
SilphCo4F_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
SilphCo4F_TextPointers:
2014-05-18 18:19:10 +00:00
dw SilphCo4Text1
dw SilphCo4Text2
dw SilphCo4Text3
dw SilphCo4Text4
2015-07-18 15:17:29 +00:00
dw PickUpItemText
dw PickUpItemText
dw PickUpItemText
2014-05-18 18:19:10 +00:00
SilphCo4TrainerHeaders:
def_trainers 2
2016-06-12 00:24:04 +00:00
SilphCo4TrainerHeader0:
trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_0, 4, SilphCo4BattleText2, SilphCo4EndBattleText2, SilphCo4AfterBattleText2
SilphCo4TrainerHeader1:
trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_1, 3, SilphCo4BattleText3, SilphCo4EndBattleText3, SilphCo4AfterBattleText3
SilphCo4TrainerHeader2:
trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_2, 4, SilphCo4BattleText4, SilphCo4EndBattleText4, SilphCo4AfterBattleText4
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4Text1:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, SilphCo4Text_19de0
ld de, SilphCo4Text_19de5
call SilphCo6Script_1a22f
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo4Text_19de0:
text_far _SilphCo4Text_19de0
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4Text_19de5:
text_far _SilphCo4Text_19de5
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4Text2:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, SilphCo4TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo4BattleText2:
text_far _SilphCo4BattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4EndBattleText2:
text_far _SilphCo4EndBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4AfterBattleText2:
text_far _SilphCo4AfterBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4Text3:
text_asm
ld hl, SilphCo4TrainerHeader1
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo4BattleText3:
text_far _SilphCo4BattleText3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4EndBattleText3:
text_far _SilphCo4EndBattleText3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4AfterBattleText3:
text_far _SilphCo4AfterBattleText3
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4Text4:
text_asm
ld hl, SilphCo4TrainerHeader2
2014-05-18 18:19:10 +00:00
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
SilphCo4BattleText4:
text_far _SilphCo4BattleText4
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4EndBattleText4:
text_far _SilphCo4EndBattleText4
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SilphCo4AfterBattleText4:
text_far _SilphCo4AfterBattleText4
text_end