1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
SilphCo5F_Script:
call SilphCo5FGateCallbackScript
call EnableAutoTextBoxDrawing
ld hl, SilphCo5TrainerHeaders
ld de, SilphCo5F_ScriptPointers
ld a, [wSilphCo5FCurScript]
call ExecuteCurMapScriptInTable
ld [wSilphCo5FCurScript], a
ret
SilphCo5FGateCallbackScript:
ld hl, wCurrentMapScriptFlags
bit BIT_CUR_MAP_LOADED_1, [hl]
res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphCo4F_SetCardKeyDoorYScript
call SilphCo5F_SetUnlockedSilphCoDoorsScript
CheckEvent EVENT_SILPH_CO_5_UNLOCKED_DOOR1
jr nz, .unlock_door1
push af
ld a, $5f
ld [wNewTileBlockID], a
lb bc, 2, 3
predef ReplaceTileBlock
pop af
.unlock_door1
CheckEventAfterBranchReuseA EVENT_SILPH_CO_5_UNLOCKED_DOOR2, EVENT_SILPH_CO_5_UNLOCKED_DOOR1
jr nz, .unlock_door2
push af
ld a, $5f
ld [wNewTileBlockID], a
lb bc, 6, 3
predef ReplaceTileBlock
pop af
.unlock_door2
CheckEventAfterBranchReuseA EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR2
ret nz
ld a, $5f
ld [wNewTileBlockID], a
lb bc, 5, 7
predef_jump ReplaceTileBlock
.GateCoordinates:
dbmapcoord 3, 2
dbmapcoord 3, 6
dbmapcoord 7, 5
db -1 ; end
SilphCo5F_SetUnlockedSilphCoDoorsScript:
EventFlagAddress hl, EVENT_SILPH_CO_5_UNLOCKED_DOOR1
ldh a, [hUnlockedSilphCoDoors]
and a
ret z
cp $1
jr nz, .unlock_door1
SetEventReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR1
ret
.unlock_door1
cp $2
jr nz, .unlock_door2
SetEventAfterBranchReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR2, EVENT_SILPH_CO_5_UNLOCKED_DOOR1
ret
.unlock_door2
SetEventAfterBranchReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR1
ret
SilphCo5F_ScriptPointers:
def_script_pointers
dw_const CheckFightingMapTrainers, SCRIPT_SILPHCO5F_DEFAULT
dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_SILPHCO5F_START_BATTLE
dw_const EndTrainerBattle, SCRIPT_SILPHCO5F_END_BATTLE
SilphCo5F_TextPointers:
def_text_pointers
dw_const SilphCo5FSilphWorkerMText, TEXT_SILPHCO5F_SILPH_WORKER_M
dw_const SilphCo5FRocket1Text, TEXT_SILPHCO5F_ROCKET1
dw_const SilphCo5FScientistText, TEXT_SILPHCO5F_SCIENTIST
dw_const SilphCo5FRockerText, TEXT_SILPHCO5F_ROCKER
dw_const SilphCo5FRocket2Text, TEXT_SILPHCO5F_ROCKET2
dw_const PickUpItemText, TEXT_SILPHCO5F_TM_TAKE_DOWN
dw_const PickUpItemText, TEXT_SILPHCO5F_PROTEIN
dw_const PickUpItemText, TEXT_SILPHCO5F_CARD_KEY
dw_const SilphCo5FPokemonReport1Text, TEXT_SILPHCO5F_POKEMON_REPORT1
dw_const SilphCo5FPokemonReport2Text, TEXT_SILPHCO5F_POKEMON_REPORT2
dw_const SilphCo5FPokemonReport3Text, TEXT_SILPHCO5F_POKEMON_REPORT3
SilphCo5TrainerHeaders:
def_trainers 2
SilphCo5TrainerHeader0:
trainer EVENT_BEAT_SILPH_CO_5F_TRAINER_0, 1, SilphCo5FRocket1BattleText, SilphCo5FRocket1EndBattleText, SilphCo5FRocket1AfterBattleText
SilphCo5TrainerHeader1:
trainer EVENT_BEAT_SILPH_CO_5F_TRAINER_1, 2, SilphCo5FScientistBattleText, SilphCo5FScientistEndBattleText, SilphCo5FScientistAfterBattleText
SilphCo5TrainerHeader2:
trainer EVENT_BEAT_SILPH_CO_5F_TRAINER_2, 4, SilphCo5FRockerBattleText, SilphCo5FRockerEndBattleText, SilphCo5FRockerAfterBattleText
SilphCo5TrainerHeader3:
trainer EVENT_BEAT_SILPH_CO_5F_TRAINER_3, 3, SilphCo5FRocket2BattleText, SilphCo5FRocket2EndBattleText, SilphCo5FRocket2AfterBattleText
db -1 ; end
SilphCo5FSilphWorkerMText:
text_asm
ld hl, .ThatsYouRightText
ld de, .YoureOurHeroText
call SilphCo6FBeatGiovanniPrintDEOrPrintHLScript
jp TextScriptEnd
.ThatsYouRightText:
text_far _SilphCo5FSilphWorkerMThatsYouRightText
text_end
.YoureOurHeroText:
text_far _SilphCo5FSilphWorkerMYoureOurHeroText
text_end
SilphCo5FRocket1Text:
text_asm
ld hl, SilphCo5TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
SilphCo5FRocket1BattleText:
text_far _SilphCo5FRocket1BattleText
text_end
SilphCo5FRocket1EndBattleText:
text_far _SilphCo5FRocket1EndBattleText
text_end
SilphCo5FRocket1AfterBattleText:
text_far _SilphCo5FRocket1AfterBattleText
text_end
SilphCo5FScientistText:
text_asm
ld hl, SilphCo5TrainerHeader1
call TalkToTrainer
jp TextScriptEnd
SilphCo5FScientistBattleText:
text_far _SilphCo5FScientistBattleText
text_end
SilphCo5FScientistEndBattleText:
text_far _SilphCo5FScientistEndBattleText
text_end
SilphCo5FScientistAfterBattleText:
text_far _SilphCo5FScientistAfterBattleText
text_end
SilphCo5FRockerText:
text_asm
ld hl, SilphCo5TrainerHeader2
call TalkToTrainer
jp TextScriptEnd
SilphCo5FRockerBattleText:
text_far _SilphCo5FRockerBattleText
text_end
SilphCo5FRockerEndBattleText:
text_far _SilphCo5FRockerEndBattleText
text_end
SilphCo5FRockerAfterBattleText:
text_far _SilphCo5FRockerAfterBattleText
text_end
SilphCo5FRocket2Text:
text_asm
ld hl, SilphCo5TrainerHeader3
call TalkToTrainer
jp TextScriptEnd
SilphCo5FRocket2BattleText:
text_far _SilphCo5FRocket2BattleText
text_end
SilphCo5FRocket2EndBattleText:
text_far _SilphCo5FRocket2EndBattleText
text_end
SilphCo5FRocket2AfterBattleText:
text_far _SilphCo5FRocket2AfterBattleText
text_end
SilphCo5FPokemonReport1Text:
text_far _SilphCo5FPokemonReport1Text
text_end
SilphCo5FPokemonReport2Text:
text_far _SilphCo5FPokemonReport2Text
text_end
SilphCo5FPokemonReport3Text:
text_far _SilphCo5FPokemonReport3Text
text_end
|