-
Notifications
You must be signed in to change notification settings - Fork 3
/
oneskull.tsct
493 lines (474 loc) · 13.2 KB
/
oneskull.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
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
486
487
488
489
490
491
492
493
/*
* 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_1 { 0, 0 }
VAR_14 { 0, 1019, -800, 8182, 1067, -800, 6376, 1601, -800, 6926, -622, -800, 5973, 941, -800, 6576, 993, -800, 8095, 1061, -800, 7176, -622, -1675, 5973, 941, -2275, 6576, 993, -2275, 8095, 1061, -2275, 7176 }
wandering_gen_script2 { 0, 0, 0, 1, -1, 8, 2, 19, 1000, -2275, 7177, 12, 61, 58, 60, 58, -1, 13, 0, 14, 0, 1, 4, 17, 0, 200, -1, 18, 100, -1 }
wandering_gen_script3 { 0, 0, 0, 1, -1, 8, 2, 12, 58, 60, 60, 60, -1, 13, 0, 14, 0, 1, 4, 5, 0, 100, 18, 100, -1 }
VAR_25 { 0, 0, 0 }
init_position1 { 1184, -2275, 7430 }
init_position { -578, -1675, 5967 }
init_position2 { -91, -1675, 5688 }
init_position3 { -1113, -1675, 5958 }
ai_script { 0, -638, -1675, 6388, 3, VAR_49, 0, 0, -1145, -1675, 5900, 0, -519, -1675, 5164, 3, VAR_50, 0, 0, -22, -1675, 5535, 7, 8 }
VAR_49 "lookout"
VAR_50 "lookout"
ai_script1 { 0, -519, -1675, 5164, 3, VAR_52, 0, 0, -22, -1675, 5535, 0, -638, -1675, 6388, 3, VAR_53, 0, 0, -1145, -1675, 5900, 7, 8 }
VAR_52 "lookout"
VAR_53 "lookout"
VAR_54 { 633, -2075, 7141, 482, -2075, 7305 }
VAR_55 { 2502, -2074, 5413, 3016, -2075, 5961 }
VAR_56 { 1035, -2275, 6269, 1867, -2275, 6933 }
VAR_57 { 1019, -800, 8182, 1067, -800, 6376, 1601, -800, 6926 }
/*
Interpretation of: enemy_gen_script
Generate at 3 positions from: VAR_57
Order of positions: Sequential
Total waves: 3; 1 enemies generated in each wave.
Trigger wave when there are less than 3 enemies left.
Delay for first enemy: 15; delay between each enemy: 100
Enemies:
drop_wraith
*/
enemy_gen_script { 0, 1, 3, VAR_57, 8, 1, 4, 0, 9, 1, 1, 3, 90, -1, 5, 1, 15, 100, 6, 1, 7, 1, 3, -1 }
tele_position { 503, -2075, 7100 }
VAR_61 { 1601, -2275, 6934 }
VAR_62 { 993, -2275, 6728 }
VAR_63 { 1276, -2275, 7850 }
VAR_64 { 954, -2275, 8195 }
VAR_65 { 668, -2275, 7774 }
VAR_66 { 1126, -2275, 6869 }
VAR_67 { 433, -2275, 7609 }
arr { VAR_61, VAR_62, VAR_63, VAR_64, VAR_65, VAR_66, VAR_67 }
VAR_69 { -622, -1675, 5973, 941, -2275, 6576, 993, -2275, 8095, 1061, -2275, 7176 }
/*
Interpretation of: enemy_gen_script1
Generate at 4 positions from: VAR_69
Order of positions: Sequential
Total waves: 1; 4 enemies generated in each wave.
Trigger wave when there are less than 2 enemies left.
Delay for first enemy: 100; delay between each enemy: 0
Enemies:
grow_boney
wraithp
wraithp
grow_skel
*/
enemy_gen_script1 { 0, 1, 4, VAR_69, 8, 1, 4, 0, 9, 1, 1, 1, 69, 60, 60, 68, -1, 5, 0, 100, 6, 1, 7, 1, 2, -1 }
VAR_78 { 1019, -800, 8182, 1067, -800, 6376, 1601, -800, 6926, -622, -800, 5973, 941, -800, 6576, 993, -800, 8095, 1061, -800, 7176 }
VAR_79 { -622, -1675, 5973, 941, -2275, 6576, 993, -2275, 8095, 1061, -2275, 7176 }
wandering_gen_script { 0, 1, 4, VAR_79, 8, 2, 19, 1000, -2275, 7177, 12, 69, 60, 60, 68, -1, 13, 0, 14, 0, 1, 4, 17, 0, 200, -1, 18, 40, -1 }
wandering_gen_script1 { 0, 1, 7, VAR_78, 8, 2, 12, 89, 90, 90, 90, -1, 13, 0, 14, 0, 1, 4, 5, 0, 100, 18, 30, -1 }
VAR_83 10
VAR_84 1
._on_load
call play_bgm("DEADPT1")
execute SCRIPT_10
call load_item(int 93 /* cutlass */ )
call load_char("boney")
call load_char("wraith")
call load_char("skel")
if(gamevar is_room_cleared)
{
execute SCRIPT_8
}
else
{
switch(gamevar room_state)
{
case 1
execute SCRIPT_4
break
case 2
execute SCRIPT_7
break
case 0
break
}
}
gamevar SMACKER_X = int 48
gamevar SMACKER_Y = int 280
call play_2d_anim("skel1", int 1, int 1, int 0)
gamevar SMACKER_X = int 56
gamevar SMACKER_Y = int 392
call play_2d_anim("skel2", int 1, int 1, int 0)
call load_sound_set(int 20)
._infinite_loop
execute SCRIPT_9
execute SCRIPT_11
if(gamevar !is_room_cleared)
{
switch(gamevar room_state)
{
case 1
execute SCRIPT_3
break
case 2
execute SCRIPT_6
break
case 0
break
}
}
._on_exit
if(gamevar !is_room_cleared)
{
switch(gamevar room_state)
{
case 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
switch(var VAR_24)
{
case 0
if(call func_d1(var &VAR_56))
{
call char_walk_to(var npc_skel, int 502, int -2075, int 7102)
call log_string("projectile sensed")
var VAR_71 = int 1
}
if(call func_8a(var &VAR_55))
{
call char_walk_to(var npc_skel, int 502, int -2075, int 7102)
call log_string("heros crossed tripwire")
var VAR_71 = int 1
}
if(var VAR_71)
{
var VAR_24 ++
}
break
case 1
if(call is_char_standing(var npc_skel))
{
call char_teleport_to_pos(var npc_skel, var &tele_position, int 250)
var VAR_24 ++
}
break
case 2
var VAR_25 ++
if(var VAR_25 > int 50)
{
call play_char_anim(var npc_skel, var rchp90a_anim, int 0)
var VAR_25 = int 0
var VAR_24 ++
}
break
case 3
var VAR_25 ++
if(var VAR_25 == int 8)
{
var VAR_0 = int 1
}
if(var VAR_25 > int 15)
{
/* play the sound 'teleport' */
call play_loaded_sound(int 3, int 0, int 20, int 0)
var VAR_24 ++
var VAR_25 = int 0
}
break
case 4
var VAR_25 ++
if(var VAR_25 == int 20)
{
call char_walk_to(var npc_skel, int 113, int -2275, int 7465)
if(call is_char_handle_in_level(int 8126464 /* SKEL */ ))
{
call func_46(var skel1, int 13)
call set_char_running(var skel1)
}
if(call is_char_handle_in_level(int 8126465 /* SKEL */ ))
{
call func_46(var skel2, int 13)
call set_char_running(var skel2)
}
}
if(var VAR_25 == int 50)
{
if(call is_char_handle_in_level(int 8126464 /* SKEL */ ))
{
call char_walk_to(var skel1, int 813, int -2275, int 7433)
}
}
if(var VAR_25 > int 100)
{
var VAR_25 = int 0
var VAR_24 ++
var VAR_7 = int 1
var VAR_37 = var npc_skel
if(call is_char_handle_in_level(int 8126465 /* SKEL */ ))
{
call char_walk_to(var skel2, int 303, int -2075, int 7151)
}
var skel = call create_enemy_through_door(int 58, int 3, int 1, int 90)
call set_char_running(var skel)
call func_106(var skel, int 1, int 0, int 3)
call set_char_init_state(var skel, int 1)
}
break
case 5
var VAR_25 ++
if(var VAR_25 > int 180)
{
if(call is_char_handle_in_level(int 8126467 /* SKEL */ ))
{
call char_walk_to(var skel, int 606, int -2275, int 7745)
}
var VAR_25 = int 0
var VAR_24 ++
}
break
case 6
if(call get_num_of_enemies() < int 2)
{
var grow_boney = call create_enemy(int 69, int 0, var &init_position, int 0)
var VAR_24 ++
}
break
case 7
if(call get_num_of_enemies() < int 2&&call func_8a(var &VAR_54))
{
var VAR_26 = call run_enemy_generator(var &enemy_gen_script, int 10)
var VAR_24 ++
}
break
case 8
if(call get_num_of_enemies() < int 2&&call func_122(var VAR_26) == int 0)
{
var index = call randomize_int(int 0, int 6)
call log_var(var VAR_60)
var npc_skel = call create_enemy(int 71, int 0, @arr[var VAR_60], int 0)
gamevar script_object = var npc_skel
gamevar *object_p+6 |= int 8388608
var VAR_25 = int 0
call set_char_running(var npc_skel)
var VAR_24 ++
}
break
case 9
var VAR_25 ++
if(var VAR_25 > int 30)
{
call char_walk_to_pos(var npc_skel, var &tele_position)
var VAR_25 = int 0
var VAR_24 ++
}
break
case 10
if(call is_char_at_pos(var npc_skel, var &tele_position, int 320))
{
var david = call get_david_char()
while(var david)
{
if(call is_char_at_pos(var david, var &tele_position, int 320))
{
var VAR_73 ++
}
var david = call get_next_char_from_list()
}
if(var VAR_73 > int 0)
{
var VAR_25 = int 0
var VAR_24 = int 13
}
if(call is_char_standing(var npc_skel))
{
var VAR_24 ++
var VAR_25 = int 0
}
}
break
case 11
call char_teleport_to_pos(var npc_skel, var &tele_position, int 120)
var VAR_24 ++
var VAR_25 = int 0
break
case 12
var VAR_25 ++
if(var VAR_25 == int 30)
{
call play_char_anim(var npc_skel, var rpunchr_anim, int 0)
}
if(var VAR_25 > int 48)
{
var VAR_0 = int 1
var VAR_25 = int 0
var VAR_24 ++
/* play the sound 'teleport' */
call play_loaded_sound(int 3, int 0, int 20, int 0)
var VAR_27 = call run_enemy_generator(var &enemy_gen_script1, int 20)
}
break
case 13
var VAR_25 ++
if(var VAR_25 == int 60)
{
call char_walk_to(var npc_skel, int 113, int -2275, int 7465)
}
if(var VAR_25 == int 100)
{
var VAR_7 = int 1
var VAR_37 = var npc_skel
var VAR_25 = int 0
var VAR_24 ++
}
break
}
if(var VAR_7 == int 1)
{
execute SCRIPT_5
}
._SCRIPT_4
call load_char("boney")
call load_char("wraith")
call load_char("skel")
var rchp90a_anim = call load_anim("rchp90a")
var rpunchr_anim = call load_anim("rpunchr")
var lookout_anim = call load_anim("lookout")
var npc_skel = call create_char(var &init_position1, "nskel", int 90, int 13)
call set_char_running(var npc_skel)
gamevar script_object = var npc_skel
gamevar *object_p+6 |= int 8388608
var skel1 = call create_enemy(int 58, int 0, var &init_position2, int 200)
call func_106(var skel1, int 1, int 0, int 3)
call set_char_init_state(var skel1, int 1)
var skel2 = call create_enemy(int 58, int 1, var &init_position3, int 20)
call func_106(var skel2, int 1, int 0, int 3)
call set_char_init_state(var skel2, int 1)
call set_char_init_state(var skel1, int 13)
call play_char_ai_script(var skel1, var &ai_script)
gamevar script_object = var skel1
gamevar *character_stats_p+15 = int 1000
call set_char_init_state(var skel2, int 13)
call play_char_ai_script(var skel2, var &ai_script1)
gamevar script_object = var skel2
gamevar *character_stats_p+15 = int 1000
._SCRIPT_5
var VAR_9 ++
if(var VAR_9 == int 16)
{
call func_f1(var VAR_37, var VAR_8)
var VAR_9 = int 0
var VAR_8 ++
if(var VAR_8 == int 8)
{
var VAR_8 = int 0
var VAR_7 = int 0
call remove_char(var VAR_37)
}
}
._SCRIPT_6
._SCRIPT_7
._SCRIPT_8
call log_string("wandering baddies")
var VAR_76 = call randomize_int(int 0, int 2)
if(var ! VAR_76)
{
call run_wandering_generator(var &wandering_gen_script, int 100)
}
else
{
call run_wandering_generator(var &wandering_gen_script1, int 100)
}
._SCRIPT_9
if(var ! VAR_86)
{
var VAR_86 = int 1 + call randomize_int(int 0, int 2)
call play_loaded_sound(var VAR_86, int 0, int 20, int 0)
var VAR_86 = int 150 + call randomize_int(int 50, int 101)
}
if(var VAR_82 > var VAR_83)
{
var VAR_85 = var VAR_84
var VAR_84 = int 1 + call randomize_int(int 0, int 2)
if(var VAR_84 == var VAR_85)
{
var VAR_84 ++
if(var VAR_84 > int 2)
{
var VAR_84 = int 1
}
}
call play_loaded_sound(var VAR_84, int 0, int 20, int 0)
var VAR_83 = call randomize_int(int 100, int 201) + int 150
var VAR_82 = int 0
}
var VAR_82 ++
var VAR_86 --
._SCRIPT_10
gamevar SMACKER_X = int 328
gamevar SMACKER_Y = int 232
call play_2d_anim("gong", int 1, int 1, var &VAR_0)
gamevar SMACKER_X = int 464
gamevar SMACKER_Y = int 80
call play_2d_anim("ban1", int 1, int 1, int 0)
gamevar SMACKER_X = int 528
gamevar SMACKER_Y = int 80
call play_2d_anim("ban2", int 1, int 1, int 0)
gamevar SMACKER_X = int 592
gamevar SMACKER_Y = int 80
call play_2d_anim("ban3", int 1, int 1, int 0)
gamevar SMACKER_X = int 544
gamevar SMACKER_Y = int 304
call play_2d_anim("ban4", int 1, int 1, int 0)
._SCRIPT_11
if(var VAR_13 == int 99&&var VAR_2 != int 0)
{
var VAR_14 = int 1
gamevar global_collision_type = int 0
}
if(var VAR_14)
{
if(var VAR_13 == int 1)
{
var VAR_0 = int 0
call log_string("Gong finished")
var VAR_14 = int 0
}
}
var VAR_2 = var VAR_0
var VAR_13 = var VAR_1
if(gamevar global_collision_type == int 18)
{
gamevar global_collision_type = int 0
call log_string("HIT THE GONG")
/* play the sound 'teleport' */
call play_loaded_sound(int 3, int 0, int 20, int 0)
var VAR_12 = call randomize_int(int 0, int 2)
if(call get_num_of_enemies() == int 0)
{
if(var ! VAR_12)
{
call run_wandering_generator(var &wandering_gen_script2, int 30)
}
else
{
call run_wandering_generator(var &wandering_gen_script3, int 30)
}
}
if(var VAR_2 == int 0)
{
var VAR_0 = int 1
}
}