summaryrefslogtreecommitdiff
path: root/data/maps/CeladonCity_GameCorner/scripts.inc
blob: 65aa9a52920ff387084d9187a532ad2971d8ab6f (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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
CeladonCity_GameCorner_MapScripts:: @ 816C646
	map_script 1, CeladonCity_GameCorner_MapScript1_16C64C
	.byte 0

CeladonCity_GameCorner_MapScript1_16C64C:: @ 816C64C
	checkflag FLAG_OPENED_ROCKET_HIDEOUT
	call_if FALSE, EventScript_16C656
	end

EventScript_16C656:: @ 816C656
	setmetatile 15, 2, 658, 0
	setmetatile 16, 2, 658, 0
	setmetatile 17, 2, 658, 0
	setmetatile 16, 3, 719, 1
	setmetatile 17, 3, 719, 1
	return

CeladonCity_GameCorner_EventScript_16C684:: @ 816C684
	msgbox gUnknown_8196940, 2
	end

CeladonCity_GameCorner_EventScript_16C68D:: @ 816C68D
	special sub_8110AB4
	compare_var_to_value VAR_RESULT, 2
	goto_if eq, EventScript_1A7AE0
	lock
	faceplayer
	showmoneybox 0, 0, 0
	showcoinsbox 0, 5
	message Text_196984
	waitmessage
	multichoice 13, 0, MULTICHOICE_GAME_CORNER_COIN_PURCHASE_COUNTER, FALSE
	copyvar VAR_0x8009, VAR_RESULT
	switch VAR_RESULT
	case 0, EventScript_16C6E6
	case 1, EventScript_16C6E6
	case 2, EventScript_16C782
	case 127, EventScript_16C782
	end

EventScript_16C6E6:: @ 816C6E6
	checkflag FLAG_GOT_COIN_CASE
	goto_if FALSE, EventScript_16C790
	compare_var_to_value VAR_0x8009, 0
	goto_if eq, EventScript_16C734
	compare_var_to_value VAR_0x8009, 1
	goto_if eq, EventScript_16C706
	end

EventScript_16C706:: @ 816C706
	checkcoins VAR_0x4001
	compare_var_to_value VAR_0x4001, 9500
	goto_if ge, EventScript_16C79E
	checkmoney 10000, 0
	compare_var_to_value VAR_RESULT, 0
	goto_if eq, EventScript_16C7AC
	givecoins 500
	takemoney 10000, 0
	goto EventScript_16C762
	end

EventScript_16C734:: @ 816C734
	checkcoins VAR_0x4001
	compare_var_to_value VAR_0x4001, 9950
	goto_if ge, EventScript_16C79E
	checkmoney 1000, 0
	compare_var_to_value VAR_RESULT, 0
	goto_if eq, EventScript_16C7AC
	givecoins 50
	takemoney 1000, 0
	goto EventScript_16C762
	end

EventScript_16C762:: @ 816C762
	updatemoneybox 0, 0, 0
	updatecoinsbox 0, 5
	playse SE_SHOP
	msgbox gUnknown_8196A62
	goto EventScript_16C77A
	end

EventScript_16C77A:: @ 816C77A
	hidemoneybox 0, 0
	hidecoinsbox 0, 5
	release
	end

EventScript_16C782:: @ 816C782
	msgbox gUnknown_81969DC
	goto EventScript_16C77A
	end

EventScript_16C790:: @ 816C790
	msgbox gUnknown_81969FB
	goto EventScript_16C77A
	end

EventScript_16C79E:: @ 816C79E
	msgbox gUnknown_8196A26
	goto EventScript_16C77A
	end

EventScript_16C7AC:: @ 816C7AC
	msgbox gUnknown_8196A46
	goto EventScript_16C77A
	end

CeladonCity_GameCorner_EventScript_16C7BA:: @ 816C7BA
	lock
	faceplayer
	msgbox gUnknown_8196A82
	goto EventScript_16C7CA
	end

EventScript_16C7CA:: @ 816C7CA
	closemessage
	applymovement VAR_LAST_TALKED, Movement_1A75E5
	waitmovement 0
	release
	end

CeladonCity_GameCorner_EventScript_16C7D7:: @ 816C7D7
	lock
	faceplayer
	msgbox gUnknown_8196AC7
	goto EventScript_16C7CA
	end

CeladonCity_GameCorner_EventScript_16C7E7:: @ 816C7E7
	lock
	faceplayer
	checkflag FLAG_GOT_10_COINS_FROM_GAMBLER
	goto_if TRUE, EventScript_16C849
	msgbox gUnknown_8196AF3
	checkflag FLAG_GOT_COIN_CASE
	goto_if FALSE, EventScript_16C839
	checkcoins VAR_0x4001
	compare_var_to_value VAR_0x4001, 9990
	goto_if ge, EventScript_16C82B
	givecoins 10
	textcolor 3
	msgbox gUnknown_8196B0D
	playse SE_SHOP
	waitse
	setflag FLAG_GOT_10_COINS_FROM_GAMBLER
	goto EventScript_16C7CA
	end

EventScript_16C82B:: @ 816C82B
	msgbox gUnknown_8196B30
	goto EventScript_16C7CA
	end

EventScript_16C839:: @ 816C839
	textcolor 3
	msgbox gUnknown_8196F26
	goto EventScript_16C7CA
	end

EventScript_16C849:: @ 816C849
	msgbox gUnknown_8196B49
	goto EventScript_16C7CA
	end

CeladonCity_GameCorner_EventScript_16C857:: @ 816C857
	lock
	faceplayer
	checkflag FLAG_DEFEATED_ERIKA
	goto_if TRUE, EventScript_16C870
	msgbox gUnknown_8196BAD
	goto EventScript_16C7CA
	end

EventScript_16C870:: @ 816C870
	msgbox gUnknown_8196CA1
	goto EventScript_16C7CA
	end

CeladonCity_GameCorner_EventScript_16C87E:: @ 816C87E
	lock
	faceplayer
	msgbox gUnknown_8196B7B
	goto EventScript_16C7CA
	end

CeladonCity_GameCorner_EventScript_16C88E:: @ 816C88E
	lock
	faceplayer
	msgbox gUnknown_8196CFE
	goto EventScript_16C7CA
	end

CeladonCity_GameCorner_EventScript_16C89E:: @ 816C89E
	lock
	faceplayer
	checkflag FLAG_GOT_20_COINS_FROM_GAMBLER
	goto_if TRUE, EventScript_16C8F0
	msgbox gUnknown_8196D2B
	checkflag FLAG_GOT_COIN_CASE
	goto_if FALSE, EventScript_16C839
	checkcoins VAR_0x4001
	compare_var_to_value VAR_0x4001, 9980
	goto_if ge, EventScript_16C8E2
	givecoins 20
	textcolor 3
	msgbox gUnknown_8196D47
	playse SE_SHOP
	waitse
	setflag FLAG_GOT_20_COINS_FROM_GAMBLER
	goto EventScript_16C7CA
	end

EventScript_16C8E2:: @ 816C8E2
	msgbox gUnknown_8196D6F
	goto EventScript_16C7CA
	end

EventScript_16C8F0:: @ 816C8F0
	msgbox gUnknown_8196D87
	goto EventScript_16C7CA
	end

CeladonCity_GameCorner_EventScript_16C8FE:: @ 816C8FE
	lock
	faceplayer
	checkflag FLAG_GOT_20_COINS_FROM_GAMBLER_2
	goto_if TRUE, EventScript_16C950
	msgbox gUnknown_8196DB7
	checkflag FLAG_GOT_COIN_CASE
	goto_if FALSE, EventScript_16C839
	checkcoins VAR_0x4001
	compare_var_to_value VAR_0x4001, 9980
	goto_if ge, EventScript_16C942
	givecoins 20
	textcolor 3
	msgbox gUnknown_8196DF8
	playse SE_SHOP
	waitse
	setflag FLAG_GOT_20_COINS_FROM_GAMBLER_2
	goto EventScript_16C7CA
	end

EventScript_16C942:: @ 816C942
	msgbox gUnknown_8196E1B
	goto EventScript_16C7CA
	end

EventScript_16C950:: @ 816C950
	msgbox gUnknown_8196E40
	goto EventScript_16C7CA
	end

CeladonCity_GameCorner_EventScript_16C95E:: @ 816C95E
	lockall
	setvar VAR_0x8004, 0
	goto EventScript_16C96C
	end

EventScript_16C96A:: @ 816C96A
	releaseall
	end

EventScript_16C96C:: @ 816C96C
	checkflag FLAG_GOT_COIN_CASE
	goto_if FALSE, EventScript_16CAA0
	msgbox gUnknown_8196F46, MSGBOX_YESNO
	compare_var_to_value VAR_RESULT, 0
	goto_if eq, EventScript_16C96A
	setfieldeffectarg 0, 255
	setfieldeffectarg 1, 10
	setfieldeffectarg 2, 14
	dofieldeffect 64
	waitfieldeffect 64
	specialvar VAR_RESULT, Special_GetRandomSlotMachine
	playslotmachine VAR_RESULT
	releaseall
	end

CeladonCity_GameCorner_EventScript_16C9A4:: @ 816C9A4
	lockall
	setvar VAR_0x8004, 1
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16C9B0:: @ 816C9B0
	lockall
	setvar VAR_0x8004, 2
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16C9BC:: @ 816C9BC
	lockall
	setvar VAR_0x8004, 3
	goto EventScript_16C96C
	end

EventScript_16C9C8:: @ 816C9C8
	lockall
	setvar VAR_0x8004, 4
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16C9D4:: @ 816C9D4
	lockall
	setvar VAR_0x8004, 5
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16C9E0:: @ 816C9E0
	lockall
	setvar VAR_0x8004, 6
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16C9EC:: @ 816C9EC
	lockall
	setvar VAR_0x8004, 7
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16C9F8:: @ 816C9F8
	lockall
	setvar VAR_0x8004, 8
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA04:: @ 816CA04
	lockall
	setvar VAR_0x8004, 9
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA10:: @ 816CA10
	lockall
	setvar VAR_0x8004, 10
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA1C:: @ 816CA1C
	lockall
	setvar VAR_0x8004, 11
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA28:: @ 816CA28
	lockall
	setvar VAR_0x8004, 12
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA34:: @ 816CA34
	lockall
	setvar VAR_0x8004, 13
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA40:: @ 816CA40
	lockall
	setvar VAR_0x8004, 14
	goto EventScript_16C96C
	end

EventScript_16CA4C:: @ 816CA4C
	lockall
	setvar VAR_0x8004, 15
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA58:: @ 816CA58
	lockall
	setvar VAR_0x8004, 16
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA64:: @ 816CA64
	lockall
	setvar VAR_0x8004, 17
	goto EventScript_16C96C
	end

EventScript_16CA70:: @ 816CA70
	lockall
	setvar VAR_0x8004, 18
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA7C:: @ 816CA7C
	lockall
	setvar VAR_0x8004, 19
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA88:: @ 816CA88
	lockall
	setvar VAR_0x8004, 20
	goto EventScript_16C96C
	end

CeladonCity_GameCorner_EventScript_16CA94:: @ 816CA94
	lockall
	setvar VAR_0x8004, 21
	goto EventScript_16C96C
	end

EventScript_16CAA0:: @ 816CAA0
	msgbox gUnknown_8196F0D
	releaseall
	end

CeladonCity_GameCorner_EventScript_16CAAA:: @ 816CAAA
	lockall
	msgbox gUnknown_8196EDC
	checkflag FLAG_OPENED_ROCKET_HIDEOUT
	call_if FALSE, EventScript_16CABE
	releaseall
	end

EventScript_16CABE:: @ 816CABE
	playse SE_KI_GASYAN
	setmetatile 15, 2, 669, 0
	setmetatile 16, 2, 670, 1
	setmetatile 17, 2, 671, 1
	setmetatile 16, 3, 678, 1
	setmetatile 17, 3, 679, 1
	special DrawWholeMapView
	setflag FLAG_OPENED_ROCKET_HIDEOUT
	return

CeladonCity_GameCorner_EventScript_16CAF5:: @ 816CAF5
	trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_TEAM_ROCKET_GRUNT_7, 0, Text_196E69, Text_196E95, EventScript_16CB10
	msgbox gUnknown_8196E9B, 6
	end

EventScript_16CB10:: @ 816CB10
	msgbox gUnknown_8196E9B
	closemessage
	compare_var_to_value VAR_FACING, 3
	call_if eq, EventScript_16CB34
	compare_var_to_value VAR_FACING, 3
	call_if ne, EventScript_16CB3F
	removeobject 11
	release
	end

EventScript_16CB34:: @ 816CB34
	applymovement 11, Movement_16CB4A
	waitmovement 0
	return

EventScript_16CB3F:: @ 816CB3F
	applymovement 11, Movement_16CB53
	waitmovement 0
	return

Movement_16CB4A:: @ 816CB4A
	step_10
	step_13
	step_13
	step_11
	step_13
	step_13
	step_13
	step_13
	step_end

Movement_16CB53:: @ 816CB53
	step_13
	step_13
	step_13
	step_13
	step_13
	step_13
	step_end

CeladonCity_GameCorner_EventScript_16CB5A:: @ 816CB5A
	msgbox gUnknown_8196F64, 3
	end

CeladonCity_GameCorner_EventScript_16CB63:: @ 816CB63
	msgbox gUnknown_8196F81, 3
	end

CeladonCity_GameCorner_EventScript_16CB6C:: @ 816CB6C
	msgbox gUnknown_8196FA0, 3
	end