pokered/scripts/SilphCo3F.asm

127 lines
3.1 KiB
NASM
Raw Normal View History

SilphCo3F_Script:
call SilphCo3FGateCallbackScript
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
ld hl, SilphCo3TrainerHeaders
ld de, SilphCo3F_ScriptPointers
ld a, [wSilphCo3FCurScript]
2014-05-18 18:19:10 +00:00
call ExecuteCurMapScriptInTable
ld [wSilphCo3FCurScript], a
2014-05-18 18:19:10 +00:00
ret
SilphCo3FGateCallbackScript:
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
ld hl, .GateCoordinates
call SilphCo2F_SetCardKeyDoorYScript
call SilphCo3F_UnlockedDoorEventScript
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_SILPH_CO_3_UNLOCKED_DOOR1
jr nz, .unlock_door1
2014-05-18 18:19:10 +00:00
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, 4
2014-09-14 18:29:18 +00:00
predef ReplaceTileBlock
2014-05-18 18:19:10 +00:00
pop af
.unlock_door1
2015-07-21 17:36:03 +00:00
CheckEventAfterBranchReuseA EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1
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, 8
2014-09-14 18:29:18 +00:00
predef_jump ReplaceTileBlock
2014-05-18 18:19:10 +00:00
.GateCoordinates:
dbmapcoord 4, 4
dbmapcoord 8, 4
db -1 ; end
2014-05-18 18:19:10 +00:00
SilphCo3F_UnlockedDoorEventScript:
2015-07-21 17:36:03 +00:00
EventFlagAddress hl, EVENT_SILPH_CO_3_UNLOCKED_DOOR1
ldh a, [hUnlockedSilphCoDoors]
2014-05-18 18:19:10 +00:00
and a
ret z
cp $1
jr nz, .unlock_door1
2015-07-21 17:36:03 +00:00
SetEventReuseHL EVENT_SILPH_CO_3_UNLOCKED_DOOR1
2014-05-18 18:19:10 +00:00
ret
.unlock_door1
2015-07-21 17:36:03 +00:00
SetEventAfterBranchReuseHL EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1
2014-05-18 18:19:10 +00:00
ret
SilphCo3F_ScriptPointers:
def_script_pointers
dw_const CheckFightingMapTrainers, SCRIPT_SILPHCO3F_DEFAULT
dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_SILPHCO3F_START_BATTLE
dw_const EndTrainerBattle, SCRIPT_SILPHCO3F_END_BATTLE
2014-05-18 18:19:10 +00:00
SilphCo3F_TextPointers:
def_text_pointers
dw_const SilphCo3FSilphWorkerMText, TEXT_SILPHCO3F_SILPH_WORKER_M
dw_const SilphCo3FRocketText, TEXT_SILPHCO3F_ROCKET
dw_const SilphCo3FScientistText, TEXT_SILPHCO3F_SCIENTIST
dw_const PickUpItemText, TEXT_SILPHCO3F_HYPER_POTION
2014-05-18 18:19:10 +00:00
SilphCo3TrainerHeaders:
def_trainers 2
2016-06-12 00:24:04 +00:00
SilphCo3TrainerHeader0:
trainer EVENT_BEAT_SILPH_CO_3F_TRAINER_0, 2, SilphCo3FRocketBattleText, SilphCo3FRocketEndBattleText, SilphCo3FRocketAfterBattleText
2016-06-12 00:24:04 +00:00
SilphCo3TrainerHeader1:
trainer EVENT_BEAT_SILPH_CO_3F_TRAINER_1, 3, SilphCo3FScientistBattleText, SilphCo3FScientistEndBattleText, SilphCo3FScientistAfterBattleText
db -1 ; end
2014-05-18 18:19:10 +00:00
SilphCo3FSilphWorkerMText:
text_asm
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
ld hl, .YouSavedUsText
jr nz, .beat_giovanni
ld hl, .WhatShouldIDoText
.beat_giovanni
2014-05-18 18:19:10 +00:00
call PrintText
jp TextScriptEnd
.WhatShouldIDoText:
text_far _SilphCo3FSilphWorkerMWhatShouldIDoText
text_end
2014-05-18 18:19:10 +00:00
.YouSavedUsText:
text_far _SilphCo3FSilphWorkerMYouSavedUsText
text_end
2014-05-18 18:19:10 +00:00
SilphCo3FRocketText:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, SilphCo3TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
SilphCo3FRocketBattleText:
text_far _SilphCo3FRocketBattleText
text_end
2014-05-18 18:19:10 +00:00
SilphCo3FRocketEndBattleText:
text_far _SilphCo3FRocketEndBattleText
text_end
2014-05-18 18:19:10 +00:00
SilphCo3FRocketAfterBattleText:
text_far _SilphCo3FRocketAfterBattleText
text_end
2014-05-18 18:19:10 +00:00
SilphCo3FScientistText:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, SilphCo3TrainerHeader1
call TalkToTrainer
jp TextScriptEnd
SilphCo3FScientistBattleText:
text_far _SilphCo3FScientistBattleText
text_end
2014-05-18 18:19:10 +00:00
SilphCo3FScientistEndBattleText:
text_far _SilphCo3FScientistEndBattleText
text_end
2014-05-18 18:19:10 +00:00
SilphCo3FScientistAfterBattleText:
text_far _SilphCo3FScientistAfterBattleText
text_end