summaryrefslogtreecommitdiff
path: root/data/maps/SootopolisCity_Gym_1F/scripts.inc
blob: 38f97a3b03392d46522ba38de63ed402a94feae3 (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
SootopolisCity_Gym_1F_MapScripts:: @ 815AF07
	map_script MAP_SCRIPT_ON_FRAME_TABLE, SootopolisCity_Gym_1F_MapScript2_15AF86
	map_script MAP_SCRIPT_ON_RESUME, SootopolisCity_Gym_1F_MapScript1_15AF22
	map_script MAP_SCRIPT_ON_LOAD, SootopolisCity_Gym_1F_MapScript1_15AF25
	map_script MAP_SCRIPT_ON_TRANSITION, SootopolisCity_Gym_1F_MapScript1_15AF1C
	.byte 0

SootopolisCity_Gym_1F_MapScript1_15AF1C:: @ 815AF1C
	setvar VAR_ICE_STEP_COUNT, 1
	end

SootopolisCity_Gym_1F_MapScript1_15AF22:: @ 815AF22
	setstepcallback 4
	end

SootopolisCity_Gym_1F_MapScript1_15AF25:: @ 815AF25
	call SootopolisCity_Gym_1F_EventScript_15AF2E
	special SetSootopolisGymCrackedIceMetatiles
	end

SootopolisCity_Gym_1F_EventScript_15AF2E:: @ 815AF2E
	compare VAR_ICE_STEP_COUNT, 8
	goto_if_lt SootopolisCity_Gym_1F_EventScript_15AF85
	compare VAR_ICE_STEP_COUNT, 28
	goto_if_lt SootopolisCity_Gym_1F_EventScript_15AF73
	compare VAR_ICE_STEP_COUNT, 69
	goto_if_lt SootopolisCity_Gym_1F_EventScript_15AF61
	setmetatile 8, 4, METATILE_SootopolisGym_Stairs, 0
	setmetatile 8, 5, METATILE_SootopolisGym_Stairs, 0

SootopolisCity_Gym_1F_EventScript_15AF61:: @ 815AF61
	setmetatile 8, 10, METATILE_SootopolisGym_Stairs, 0
	setmetatile 8, 11, METATILE_SootopolisGym_Stairs, 0

SootopolisCity_Gym_1F_EventScript_15AF73:: @ 815AF73
	setmetatile 8, 15, METATILE_SootopolisGym_Stairs, 0
	setmetatile 8, 16, METATILE_SootopolisGym_Stairs, 0

SootopolisCity_Gym_1F_EventScript_15AF85:: @ 815AF85
	return

SootopolisCity_Gym_1F_MapScript2_15AF86:: @ 815AF86
	map_script_2 VAR_ICE_STEP_COUNT, 8, SootopolisCity_Gym_1F_EventScript_15AFA8
	map_script_2 VAR_ICE_STEP_COUNT, 28, SootopolisCity_Gym_1F_EventScript_15AFBC
	map_script_2 VAR_ICE_STEP_COUNT, 69, SootopolisCity_Gym_1F_EventScript_15AFD0
	map_script_2 VAR_ICE_STEP_COUNT, 0, SootopolisCity_Gym_1F_EventScript_15AFE4
	.2byte 0

SootopolisCity_Gym_1F_EventScript_15AFA8:: @ 815AFA8
	addvar VAR_ICE_STEP_COUNT, 1
	delay 40
	playse SE_ICE_STAIRS
	call SootopolisCity_Gym_1F_EventScript_15AF2E
	special DrawWholeMapView
	end

SootopolisCity_Gym_1F_EventScript_15AFBC:: @ 815AFBC
	addvar VAR_ICE_STEP_COUNT, 1
	delay 40
	playse SE_ICE_STAIRS
	call SootopolisCity_Gym_1F_EventScript_15AF2E
	special DrawWholeMapView
	end

SootopolisCity_Gym_1F_EventScript_15AFD0:: @ 815AFD0
	addvar VAR_ICE_STEP_COUNT, 1
	delay 40
	playse SE_ICE_STAIRS
	call SootopolisCity_Gym_1F_EventScript_15AF2E
	special DrawWholeMapView
	end

SootopolisCity_Gym_1F_EventScript_15AFE4:: @ 815AFE4
	lockall
	delay 20
	applymovement OBJ_EVENT_ID_PLAYER, SootopolisCity_Gym_1F_Movement_15AFFD
	waitmovement 0
	playse SE_FALL
	delay 60
	warphole MAP_SOOTOPOLIS_CITY_GYM_B1F
	waitstate
	end

SootopolisCity_Gym_1F_Movement_15AFFD:: @ 815AFFD
	set_invisible
	step_end

SootopolisCity_Gym_1F_EventScript_15AFFF:: @ 815AFFF
	trainerbattle_single TRAINER_WALLACE, SootopolisCity_Gym_1F_Text_18F0CA, SootopolisCity_Gym_1F_Text_18F282, SootopolisCity_Gym_1F_EventScript_15B02D, NO_MUSIC
	goto_if_unset FLAG_RECEIVED_TM03, SootopolisCity_Gym_1F_EventScript_15B056
	goto_if_unset FLAG_BADGE06_GET, SootopolisCity_Gym_1F_EventScript_15B07A
	msgbox SootopolisCity_Gym_1F_Text_18F4D7, MSGBOX_DEFAULT
	release
	end

SootopolisCity_Gym_1F_EventScript_15B02D:: @ 815B02D
	message SootopolisCity_Gym_1F_Text_18F342
	waitmessage
	call Common_EventScript_PlayGymBadgeFanfare
	msgbox SootopolisCity_Gym_1F_Text_18F36B, MSGBOX_DEFAULT
	setflag FLAG_DEFEATED_SOOTOPOLIS_GYM
	setflag FLAG_BADGE08_GET
	setvar VAR_0x8008, 8
	call Common_EventScript_SetGymTrainers
	goto SootopolisCity_Gym_1F_EventScript_15B056
	end

SootopolisCity_Gym_1F_EventScript_15B056:: @ 815B056
	giveitem ITEM_TM03_WATER_PULSE
	compare VAR_RESULT, 0
	goto_if_eq Common_EventScript_ShowBagIsFull
	msgbox SootopolisCity_Gym_1F_Text_18F466, MSGBOX_DEFAULT
	setflag FLAG_RECEIVED_TM03
	release
	end

SootopolisCity_Gym_1F_EventScript_15B07A:: @ 815B07A
	msgbox SootopolisCity_Gym_1F_Text_18F5B4, MSGBOX_DEFAULT
	release
	end

SootopolisCity_Gym_1F_EventScript_15B084:: @ 815B084
	lock
	faceplayer
	goto_if_set FLAG_DEFEATED_SOOTOPOLIS_GYM, SootopolisCity_Gym_1F_EventScript_15B099
	msgbox SootopolisCity_Gym_1F_Text_18E8A5, MSGBOX_DEFAULT
	release
	end

SootopolisCity_Gym_1F_EventScript_15B099:: @ 815B099
	msgbox SootopolisCity_Gym_1F_Text_18E9C9, MSGBOX_DEFAULT
	release
	end

SootopolisCity_Gym_1F_EventScript_15B0A3:: @ 815B0A3
	lockall
	goto_if_set FLAG_BADGE08_GET, SootopolisCity_Gym_1F_EventScript_15B0C3
	goto SootopolisCity_Gym_1F_EventScript_15B0CD
	end

SootopolisCity_Gym_1F_EventScript_15B0B3:: @ 815B0B3
	lockall
	goto_if_set FLAG_BADGE08_GET, SootopolisCity_Gym_1F_EventScript_15B0C3
	goto SootopolisCity_Gym_1F_EventScript_15B0CD
	end

SootopolisCity_Gym_1F_EventScript_15B0C3:: @ 815B0C3
	msgbox SootopolisCity_Gym_1F_Text_18F665, MSGBOX_DEFAULT
	releaseall
	end

SootopolisCity_Gym_1F_EventScript_15B0CD:: @ 815B0CD
	msgbox SootopolisCity_Gym_1F_Text_18F649, MSGBOX_DEFAULT
	releaseall
	end