-
Notifications
You must be signed in to change notification settings - Fork 3
/
s_gates.tsct
262 lines (245 loc) · 5.89 KB
/
s_gates.tsct
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
/*
* This file was auto-generated using 'silver-reversing-sct' tool
* to better understand the scripts presented, one is encouraged to
* view the catalogs at:
* https://github.com/nadavshemesh/silver-reversing-sct/blob/master/docs/index.md
*
* Any further information and support of this project please visit:
* https://github.com/nadavshemesh/silver-reversing-sct
*/
._DATA
VAR_0 { -919, 900, -60 }
VAR_2 { 0, 0 }
VAR_3 { 0, 0, 0 }
VAR_5 { 0, 0 }
init_position { 255, -4, 247 }
init_position1 { -457, -1, 201 }
VAR_15 { 461, -1, 664, -539, -10, 622, -185, -10, 364, 332, -7, 1182, -528, -10, 1014, -791, 5, 584, 94, -15, 1233 }
/*
Interpretation of: enemy_gen_script
Generate at 7 positions from: VAR_15
Order of positions: Single position
Total waves: 2; 4 enemies generated in each wave.
Trigger wave when there are less than 1 enemies left.
Delay for first enemy: 100; delay between each enemy: 0
Enemies:
grow_sguard
*/
enemy_gen_script { 0, 1, 7, 32, VAR_15, 2, 4, 0, 9, 1, 1, 2, 33, -1, 5, 0, 100, 6, 1, 7, 1, 1, -1 }
VAR_17 { 490, 7, 858, -810, 7, 891 }
VAR_18 { 0, 0 }
VAR_23 { -94, -15, 559 }
VAR_24 { 94, -15, 667 }
VAR_25 { -129, -15, 814 }
VAR_26 { -41, -15, 793 }
arr { 88, VAR_23, VAR_24, VAR_25 }
arr_1 VAR_26
VAR_33 -1
._on_load
if(gamevar is_room_cleared)
{
execute SCRIPT_9
}
else
{
switch(gamevar room_state)
{
case 1
execute SCRIPT_6
break
case 2
execute SCRIPT_8
break
case 0
break
}
}
call load_sound_set(int 46)
/* play the sound 'palhum' */
call play_loaded_sound(int 3, int -1, int 46, int 0)
/* play the sound 'piston' */
call play_loaded_sound(int 8, int -1, int 46, var &VAR_0)
._infinite_loop
execute SCRIPT_4
if(gamevar !is_room_cleared)
{
switch(gamevar room_state)
{
case 1
execute SCRIPT_5
break
case 2
execute SCRIPT_7
break
case 0
break
}
}
._on_exit
if(gamevar !is_room_cleared)
{
switch(gamevar room_state)
{
case 1
gamevar *scene_info_p+1 = int 1
gamevar room_state ++
gamevar is_room_cleared = int 1
break
case 2
gamevar room_state ++
gamevar is_room_cleared = int 1
break
case 0
break
default
gamevar room_state = int 0
break
}
}
._SCRIPT_3
gamevar SMACKER_X = int 196
gamevar SMACKER_Y = int 60
call play_2d_anim("flamloop", int 1, int 0, var &VAR_3)
call play_2d_anim("flamfade", int -2147483, int 1, var &VAR_1)
gamevar SMACKER_X = int 260
gamevar SMACKER_Y = int 132
call play_2d_anim("s_gatops", int -2147483, int 0, var &VAR_4)
._SCRIPT_4
if(gamevar script_time > var VAR_34)
{
var VAR_34 = gamevar script_time + int 60 + call randomize_int(int 0, int 40)
/* play the sound 'cricklp' */
call play_loaded_sound(int 2, int 0, int 46, int 0)
}
._SCRIPT_5
if(var VAR_33 != var VAR_18)
{
var VAR_33 = var VAR_18
call log_var(var VAR_18)
}
switch(var VAR_18)
{
case 0
if(call func_8a(var &VAR_17))
{
if(call is_char_handle_in_level(int 1179648))
{
call func_50(var sguard, int 129)
}
if(call is_char_handle_in_level(int 1179649))
{
call func_50(var sguard1, int 129)
}
var VAR_18 = int 1
}
if(call func_d1(var &VAR_17))
{
if(call is_char_handle_in_level(int 1179648))
{
call func_50(var sguard, int 129)
}
if(call is_char_handle_in_level(int 1179649))
{
call func_50(var sguard1, int 129)
}
var VAR_18 = int 1
}
break
case 1
if(call get_num_of_enemies() < int 1)
{
var VAR_18 ++
var VAR_19 = call run_enemy_generator(var &enemy_gen_script, int 10)
}
break
case 2
if(call func_122(var VAR_19) == int 0&&call get_num_of_enemies() < int 1)
{
call set_input_system(int 2)
var VAR_18 ++
var VAR_32 = int 0
}
break
case 3
if(var VAR_32 > int 150)
{
var david = call get_david_char()
while(var david)
{
call char_walk_to_pos(var david, @arr[var VAR_22])
var david = call get_next_char_from_list()
var index ++
}
var VAR_18 ++
}
break
case 4
var index_1 = int 0
var david = call get_david_char()
while(var david)
{
if(!arr_1[var VAR_31])
{
if(call is_char_standing(var david))
{
@arr_1[var index_1]= int 1
call func_36(var david, int -51, int 10, int -204)
}
}
var index_1 ++
var david = call get_next_char_from_list()
}
if(var index_1 != int 3)
{
var VAR_30 = int 1
}
if(var arr_1&&var VAR_29&&var VAR_30)
{
var VAR_3 = int 0
var VAR_1 = int 1
var VAR_18 ++
}
break
case 5
var VAR_20 = var VAR_5
if(var VAR_20 == int 50)
{
gamevar *scene_info_p+3 = int 2
call set_input_system(int 1)
var VAR_18 ++
}
break
}
var VAR_32 ++
if(var VAR_1)
{
var VAR_20 = var VAR_2
var VAR_10 = int 18 - var VAR_20
if(var VAR_10 < int 0)
{
var VAR_10 = int 0
}
call set_sound_volume(var torches2_sound_ref, var VAR_10)
if(var VAR_20 == int 19)
{
var VAR_1 = int 0
call stop_playing_sound(var torches2_sound_ref)
var VAR_4 = int 1
/* play the sound 'swamp1' */
call play_loaded_sound(int 1, int 0, int 46, int 0)
call func_4e(int 0)
}
}
._SCRIPT_6
call load_sound_set(int 30)
var torches2_sound_ref = call play_loaded_sound(int 1, int -1, int 30, int 0)
execute SCRIPT_3
var VAR_3 = int 1
var sguard = call create_enemy(int 34, int 0, var &init_position, int 325)
var sguard1 = call create_enemy(int 34, int 1, var &init_position1, int 30)
call func_47(var sguard, int 129)
call func_47(var sguard1, int 129)
gamevar *scene_info_p+3 = int 16
._SCRIPT_7
._SCRIPT_8
._SCRIPT_9