2019-01-01 20:06:23 +00:00
|
|
|
SilphCo8F_Script:
|
2023-07-14 01:27:56 +00:00
|
|
|
call SilphCo8FGateCallbackScript
|
2014-05-18 18:19:10 +00:00
|
|
|
call EnableAutoTextBoxDrawing
|
2021-04-13 22:24:37 +00:00
|
|
|
ld hl, SilphCo8TrainerHeaders
|
2019-01-01 20:06:23 +00:00
|
|
|
ld de, SilphCo8F_ScriptPointers
|
|
|
|
ld a, [wSilphCo8FCurScript]
|
2014-05-18 18:19:10 +00:00
|
|
|
call ExecuteCurMapScriptInTable
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wSilphCo8FCurScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FGateCallbackScript:
|
2016-01-03 19:17:10 +00:00
|
|
|
ld hl, wCurrentMapScriptFlags
|
2024-09-24 15:39:44 +00:00
|
|
|
bit BIT_CUR_MAP_LOADED_1, [hl]
|
|
|
|
res BIT_CUR_MAP_LOADED_1, [hl]
|
2014-05-18 18:19:10 +00:00
|
|
|
ret z
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .GateCoordinates
|
|
|
|
call SilphCo8F_SetCardKeyDoorYScript
|
|
|
|
call SilphCo8F_UnlockedDoorEventScript
|
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
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.GateCoordinates:
|
2020-07-16 16:32:19 +00:00
|
|
|
dbmapcoord 3, 4
|
|
|
|
db -1 ; end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8F_SetCardKeyDoorYScript:
|
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
|
2023-07-14 01:27:56 +00:00
|
|
|
.loop_check_doors
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, [hli]
|
|
|
|
cp $ff
|
2023-07-14 01:27:56 +00:00
|
|
|
jr z, .exit_loop
|
2014-05-18 18:19:10 +00:00
|
|
|
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
|
2023-07-14 01:27:56 +00:00
|
|
|
jr z, .check_y_coord
|
2014-05-18 18:19:10 +00:00
|
|
|
inc hl
|
2023-07-14 01:27:56 +00:00
|
|
|
jr .loop_check_doors
|
|
|
|
.check_y_coord
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, [hli]
|
|
|
|
cp c
|
2023-07-14 01:27:56 +00:00
|
|
|
jr nz, .loop_check_doors
|
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
|
2023-07-14 01:27:56 +00:00
|
|
|
.exit_loop
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2020-07-06 23:03:05 +00:00
|
|
|
ldh [hUnlockedSilphCoDoors], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8F_UnlockedDoorEventScript:
|
2020-07-06 23:03:05 +00:00
|
|
|
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
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
SilphCo8F_ScriptPointers:
|
2023-07-14 01:27:56 +00:00
|
|
|
def_script_pointers
|
|
|
|
dw_const CheckFightingMapTrainers, SCRIPT_SILPHCO8F_DEFAULT
|
|
|
|
dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_SILPHCO8F_START_BATTLE
|
|
|
|
dw_const EndTrainerBattle, SCRIPT_SILPHCO8F_END_BATTLE
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
SilphCo8F_TextPointers:
|
2023-07-14 01:27:56 +00:00
|
|
|
def_text_pointers
|
|
|
|
dw_const SilphCo8FSilphWorkerMText, TEXT_SILPHCO8F_SILPH_WORKER_M
|
|
|
|
dw_const SilphCo8FRocket1Text, TEXT_SILPHCO8F_ROCKET1
|
|
|
|
dw_const SilphCo8FScientistText, TEXT_SILPHCO8F_SCIENTIST
|
|
|
|
dw_const SilphCo8FRocket2Text, TEXT_SILPHCO8F_ROCKET2
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2021-04-13 22:24:37 +00:00
|
|
|
SilphCo8TrainerHeaders:
|
|
|
|
def_trainers 2
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo8TrainerHeader0:
|
2023-07-14 01:27:56 +00:00
|
|
|
trainer EVENT_BEAT_SILPH_CO_8F_TRAINER_0, 4, SilphCo8FRocket1BattleText, SilphCo8FRocket1EndBattleText, SilphCo8FRocket1AfterBattleText
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo8TrainerHeader1:
|
2023-07-14 01:27:56 +00:00
|
|
|
trainer EVENT_BEAT_SILPH_CO_8F_TRAINER_1, 4, SilphCo8FScientistBattleText, SilphCo8FScientistEndBattleText, SilphCo8FScientistAfterBattleText
|
2016-06-12 00:24:04 +00:00
|
|
|
SilphCo8TrainerHeader2:
|
2023-07-14 01:27:56 +00:00
|
|
|
trainer EVENT_BEAT_SILPH_CO_8F_TRAINER_2, 4, SilphCo8FRocket2BattleText, SilphCo8FRocket2EndBattleText, SilphCo8FRocket2AfterBattleText
|
2020-07-14 19:45:36 +00:00
|
|
|
db -1 ; end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FSilphWorkerMText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2015-07-21 17:36:03 +00:00
|
|
|
CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
|
2023-07-14 01:27:56 +00:00
|
|
|
ld hl, .ThanksForSavingUsText
|
|
|
|
jr nz, .beat_giovanni
|
|
|
|
ld hl, .SilphIsFinishedText
|
|
|
|
.beat_giovanni
|
2014-05-18 18:19:10 +00:00
|
|
|
call PrintText
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.SilphIsFinishedText:
|
|
|
|
text_far __SilphCo8FSilphWorkerMThanksForSavingUsText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
.ThanksForSavingUsText:
|
|
|
|
text_far _SilphCo8FSilphWorkerMThanksForSavingUsText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FRocket1Text:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, SilphCo8TrainerHeader0
|
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FScientistText:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, SilphCo8TrainerHeader1
|
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FRocket2Text:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, SilphCo8TrainerHeader2
|
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FRocket1BattleText:
|
|
|
|
text_far _SilphCo8FRocket1BattleText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FRocket1EndBattleText:
|
|
|
|
text_far _SilphCo8FRocket1EndBattleText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FRocket1AfterBattleText:
|
|
|
|
text_far _SilphCo8FRocket1AfterBattleText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FScientistBattleText:
|
|
|
|
text_far _SilphCo8FScientistBattleText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FScientistEndBattleText:
|
|
|
|
text_far _SilphCo8FScientistEndBattleText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FScientistAfterBattleText:
|
|
|
|
text_far _SilphCo8FScientistAfterBattleText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FRocket2BattleText:
|
|
|
|
text_far _SilphCo8FRocket2BattleText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FRocket2EndBattleText:
|
|
|
|
text_far _SilphCo8FRocket2EndBattleText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2023-07-14 01:27:56 +00:00
|
|
|
SilphCo8FRocket2AfterBattleText:
|
|
|
|
text_far _SilphCo8FRocket2AfterBattleText
|
2020-07-04 21:09:35 +00:00
|
|
|
text_end
|