summaryrefslogtreecommitdiff
path: root/data/maps/SeafoamIslands_B4F/scripts.inc
blob: 8d69a4808eee7dee336be21e9aa88bce39b5f17e (plain)
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
SeafoamIslands_B4F_MapScripts:: @ 816302E
	map_script 3, SeafoamIslands_B4F_MapScript1_163066
	map_script 5, SeafoamIslands_B4F_MapScript2_163048
	map_script 1, SeafoamIslands_B4F_MapScript3_1630B1
	map_script 4, SeafoamIslands_B4F_MapScript4_1630E7
	map_script 2, SeafoamIslands_B4F_MapScript5_1630F9
	.byte 0

SeafoamIslands_B4F_MapScript2_163048:: @ 8163048
	checkflag FLAG_SYS_SPECIAL_WILD_BATTLE
	call_if TRUE, EventScript_163052
	end

EventScript_163052:: @ 8163052
	specialvar VAR_RESULT, Special_GetBattleOutcome
	compare_var_to_value VAR_RESULT, B_OUTCOME_CAUGHT
	goto_if ne, EventScript_1A77A9
	removeobject VAR_LAST_TALKED
	return

SeafoamIslands_B4F_MapScript1_163066:: @ 8163066
	checkflag FLAG_FOUGHT_ARTICUNO
	call_if FALSE, EventScript_1630AD
	checkflag FLAG_STOPPED_SEAFOAM_B4F_CURRENT
	call_if FALSE, EventScript_163082
	checkflag FLAG_STOPPED_SEAFOAM_B4F_CURRENT
	call_if TRUE, EventScript_1630A9
	end

EventScript_163082:: @ 8163082
	setvar VAR_0x4002, 0
	checkflag FLAG_HIDE_SEAFOAM_B4F_BOULDER_1
	call_if FALSE, EventScript_163169
	checkflag FLAG_HIDE_SEAFOAM_B4F_BOULDER_2
	call_if FALSE, EventScript_163169
	compare_var_to_value VAR_0x4002, 2
	call_if eq, EventScript_1630A5
	return

EventScript_1630A5:: @ 81630A5
	setflag FLAG_STOPPED_SEAFOAM_B4F_CURRENT
	return

EventScript_1630A9:: @ 81630A9
	setmaplayoutindex LAYOUT_UNUSED_LAYOUT_833BE30
	return

EventScript_1630AD:: @ 81630AD
	clearflag FLAG_HIDE_ARTICUNO
	return

SeafoamIslands_B4F_MapScript3_1630B1:: @ 81630B1
	setvar VAR_0x4002, 0
	checkflag FLAG_HIDE_SEAFOAM_B4F_BOULDER_1
	call_if FALSE, EventScript_163169
	checkflag FLAG_HIDE_SEAFOAM_B4F_BOULDER_2
	call_if FALSE, EventScript_163169
	compare_var_to_value VAR_0x4002, 2
	goto_if eq, EventScript_1630D4
	end

EventScript_1630D4:: @ 81630D4
	setmetatile 12, 14, 299, 0
	setmetatile 13, 14, 299, 0
	end

SeafoamIslands_B4F_MapScript4_1630E7:: @ 81630E7
	map_script_2 VAR_MAP_SCENE_SEAFOAM_ISLANDS_B4F, 1, EventScript_1630F1
	.2byte 0

EventScript_1630F1:: @ 81630F1
	turnobject 255, 2
	special Special_ForcePlayerToStartSurfing
	end

SeafoamIslands_B4F_MapScript5_1630F9:: @ 81630F9
	map_script_2 VAR_MAP_SCENE_SEAFOAM_ISLANDS_B4F, 1, EventScript_16310B
	map_script_2 VAR_0x4001, 1, EventScript_163121
	.2byte 0

EventScript_16310B:: @ 816310B
	lockall
	applymovement 255, Movement_16311D
	waitmovement 0
	setvar VAR_MAP_SCENE_SEAFOAM_ISLANDS_B4F, 0
	releaseall
	end

Movement_16311D:: @ 816311D
	step_1e
	step_1e
	step_1e
	step_end

EventScript_163121:: @ 8163121
	lockall
	setvar VAR_0x4002, 0
	checkflag FLAG_HIDE_SEAFOAM_B4F_BOULDER_1
	call_if FALSE, EventScript_163169
	checkflag FLAG_HIDE_SEAFOAM_B4F_BOULDER_2
	call_if FALSE, EventScript_163169
	compare_var_to_value VAR_0x4002, 2
	goto_if eq, EventScript_163185
	getplayerxy VAR_0x8008, VAR_0x8009
	compare_var_to_value VAR_0x8008, 9
	call_if lt, EventScript_16316F
	compare_var_to_value VAR_0x8008, 9
	call_if ge, EventScript_16317A
	special sub_805D1A8
	setvar VAR_0x4001, 0
	releaseall
	end

EventScript_163169:: @ 8163169
	addvar VAR_0x4002, 1
	return

EventScript_16316F:: @ 816316F
	applymovement 255, Movement_16318C
	waitmovement 0
	return

EventScript_16317A:: @ 816317A
	applymovement 255, Movement_163195
	waitmovement 0
	return

EventScript_163185:: @ 8163185
	setvar VAR_0x4001, 0
	releaseall
	end

Movement_16318C:: @ 816318C
	step_11
	step_11
	step_11
	step_13
	step_13
	step_13
	step_13
	step_11
	step_end

Movement_163195:: @ 8163195
	step_11
	step_11
	step_11
	step_13
	step_13
	step_13
	step_11
	step_end

SeafoamIslands_B4F_EventScript_16319D:: @ 816319D
	lockall
	applymovement 255, Movement_1631AA
	waitmovement 0
	releaseall
	end

Movement_1631AA:: @ 81631AA
	step_11
	step_end

SeafoamIslands_B4F_EventScript_1631AC:: @ 81631AC
	special sub_8110AB4
	compare_var_to_value VAR_RESULT, 2
	goto_if eq, EventScript_1A7AE0
	special sub_8112364
	lock
	faceplayer
	setwildbattle SPECIES_ARTICUNO, 50, ITEM_NONE
	waitse
	playmoncry SPECIES_ARTICUNO, 2
	message Text_1A6448
	waitmessage
	waitmoncry
	delay 10
	playbgm MUS_EXEYE, 0
	waitbuttonpress
	setflag FLAG_SYS_SPECIAL_WILD_BATTLE
	special Special_StartLegendaryBattle
	waitstate
	clearflag FLAG_SYS_SPECIAL_WILD_BATTLE
	specialvar VAR_RESULT, Special_GetBattleOutcome
	compare_var_to_value VAR_RESULT, B_OUTCOME_WON
	goto_if eq, EventScript_16320F
	compare_var_to_value VAR_RESULT, B_OUTCOME_RAN
	goto_if eq, EventScript_163218
	compare_var_to_value VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED
	goto_if eq, EventScript_163218
	setflag FLAG_FOUGHT_ARTICUNO
	release
	end

EventScript_16320F:: @ 816320F
	setflag FLAG_FOUGHT_ARTICUNO
	goto EventScript_1A922D

EventScript_163217:: @ 8163217
	end

EventScript_163218:: @ 8163218
	setvar VAR_0x8004, SPECIES_ARTICUNO
	goto EventScript_1A9236

EventScript_163222:: @ 8163222
	end

SeafoamIslands_B4F_EventScript_163223:: @ 8163223
	msgbox gUnknown_8179B36, 3
	end

SeafoamIslands_B4F_EventScript_16322C:: @ 816322C
	msgbox gUnknown_8179B65, 3
	end