1 | #################
|
---|
2 | ### VARIABLES ###
|
---|
3 | #################
|
---|
4 |
|
---|
5 | var int var_counter = 0;
|
---|
6 |
|
---|
7 | ############
|
---|
8 | ### MAIN ###
|
---|
9 | ############
|
---|
10 |
|
---|
11 | func void main(void)
|
---|
12 | {
|
---|
13 | gl_fog_red = 0
|
---|
14 | gl_fog_blue = 0
|
---|
15 | gl_fog_green = 0
|
---|
16 | gl_fog_start = .995
|
---|
17 | gs_farclipplane_set 5000
|
---|
18 | ui_suppress_prompt = 1
|
---|
19 | chr_auto_aim_dist = 0
|
---|
20 | start
|
---|
21 | }
|
---|
22 |
|
---|
23 | #############
|
---|
24 | ### START ###
|
---|
25 | #############
|
---|
26 |
|
---|
27 | func void start(string ai_name)
|
---|
28 | {
|
---|
29 | fork deactivate_stuff
|
---|
30 | if(save_point eq 0) save_point = 1
|
---|
31 | if(save_point eq 1) fork intro
|
---|
32 | if(save_point eq 2) restore_game
|
---|
33 | sleep 5
|
---|
34 | fork sp_all
|
---|
35 | }
|
---|
36 |
|
---|
37 | func void deactivate_stuff(void)
|
---|
38 | {
|
---|
39 | #not used
|
---|
40 | trigvolume_enable Cut_dog 0
|
---|
41 | trigvolume_enable trigger_volume_07 0
|
---|
42 | trigvolume_enable trigger_volume_11 0
|
---|
43 | trigvolume_enable trigger_volume_12 0
|
---|
44 | trigvolume_enable trigger_volume_14 0
|
---|
45 | trigvolume_enable trigger_volume_15 0
|
---|
46 | #used
|
---|
47 | trigvolume_enable Cut_outro 0
|
---|
48 | trigvolume_enable shut_off_vault_music 0
|
---|
49 | trigvolume_enable ninja_ambush_bot_trig 0
|
---|
50 | trigvolume_enable ninja_ambush_top_trig 0
|
---|
51 | }
|
---|
52 |
|
---|
53 | func void you_lose(string ai_name)
|
---|
54 | {
|
---|
55 | fade_out 0 0 0 30
|
---|
56 | sleep 30
|
---|
57 | lose
|
---|
58 | }
|
---|
59 |
|
---|
60 | ####################################
|
---|
61 | ### SEVERAL TIMES USED FUNCTIONS ###
|
---|
62 | ####################################
|
---|
63 |
|
---|
64 | func void sp_all(void)
|
---|
65 | {
|
---|
66 | co_message_display = 0
|
---|
67 | if(save_point eq 1) save_game 1 autosave
|
---|
68 | if(save_point eq 2) save_game 2 autosave
|
---|
69 | sleep 180
|
---|
70 | co_message_display = 1
|
---|
71 | }
|
---|
72 |
|
---|
73 | func void remove_ai(void)
|
---|
74 | {
|
---|
75 | ai2_kill
|
---|
76 | sleep 60
|
---|
77 | powerup_reset
|
---|
78 | weapon_reset
|
---|
79 | sleep 240
|
---|
80 | corpse_reset
|
---|
81 | }
|
---|
82 |
|
---|
83 | func void music_stop(void)
|
---|
84 | {
|
---|
85 | sound_music_stop mus_main02
|
---|
86 | sound_music_stop mus_lz
|
---|
87 | sound_music_stop mus_heart
|
---|
88 | sound_music_stop mus_main02_hd
|
---|
89 | }
|
---|
90 |
|
---|
91 | #tv13, tv14, tv15, tv19 and tv 20
|
---|
92 | func void spawn_outside_left_snipers(string ai_name)
|
---|
93 | {
|
---|
94 | ai2_spawn flOUTSIDE_A_sniper_1
|
---|
95 | ai2_spawn flOUTSIDE_A_sniper_2
|
---|
96 | ai2_spawn flOUTSIDE_B_sniper_1
|
---|
97 | ai2_spawn flOUTSIDE_C_sniper_1
|
---|
98 | }
|
---|
99 |
|
---|
100 | #tv16, tv17 and tv18
|
---|
101 | func void spawn_outside_right_snipers(string ai_name)
|
---|
102 | {
|
---|
103 | ai2_spawn flOUTSIDE_D_sniper_1
|
---|
104 | ai2_spawn flOUTSIDE_D_sniper_2
|
---|
105 | ai2_spawn flOUTSIDE_E_sniper_1
|
---|
106 | ai2_spawn flOUTSIDE_E_sniper_2
|
---|
107 | }
|
---|
108 |
|
---|
109 | ##########
|
---|
110 | ### SP1 ###
|
---|
111 | ##########
|
---|
112 |
|
---|
113 | func void intro(void)
|
---|
114 | {
|
---|
115 | particle lock99_locklight01 do start
|
---|
116 | ai2_spawn IntroSec1
|
---|
117 | ai2_spawn IntroSec2
|
---|
118 | ai2_spawn neutral_1
|
---|
119 | ai2_spawn fl2_secguard_1
|
---|
120 | powerup_spawn ammo 131
|
---|
121 | powerup_spawn hypo 132
|
---|
122 | objective_set 1 silent
|
---|
123 | target_set 127 30
|
---|
124 | sleep 1
|
---|
125 | sound_music_start mus_main02_hd 1.0
|
---|
126 | }
|
---|
127 |
|
---|
128 | #lose func of IntroSec2
|
---|
129 | func void die_for_art_1(string ai_name)
|
---|
130 | {
|
---|
131 | die_for_art_2
|
---|
132 | }
|
---|
133 |
|
---|
134 | #lose func of IntroSec1
|
---|
135 | func void die_for_art_2(string ai_name)
|
---|
136 | {
|
---|
137 | var_counter = var_counter + 1
|
---|
138 | if(var_counter eq 2) music_stop
|
---|
139 | }
|
---|
140 |
|
---|
141 | ### GROUND FLOOR ###
|
---|
142 |
|
---|
143 | #tv7 - after door 59
|
---|
144 | func void save_game_1(string ai_name)
|
---|
145 | {
|
---|
146 | ai2_spawn fl1_secguard_1
|
---|
147 | ai2_spawn fl1_secguard_2
|
---|
148 | ai2_spawn fl1_secguard_4
|
---|
149 | }
|
---|
150 |
|
---|
151 | #hit func of neutral_1
|
---|
152 | func void do_neutral_1_run(string ai_name)
|
---|
153 | {
|
---|
154 | ai2_neutralbehavior neutral_1 none
|
---|
155 | ai2_setmovementmode neutral_1 run_noaim
|
---|
156 | ai2_dopath neutral_1 neutral_1_run
|
---|
157 | ai2_setjobstate neutral_1
|
---|
158 | }
|
---|
159 |
|
---|
160 | #console2
|
---|
161 | func void change_fl2_lights(string ai_name)
|
---|
162 | {
|
---|
163 | particle lock1_locklight01 do start
|
---|
164 | particle lock2_locklight01 do start
|
---|
165 | door_unlock 54
|
---|
166 | objective_set 2 silent
|
---|
167 | }
|
---|
168 |
|
---|
169 | ### 1ST FLOOR ###
|
---|
170 |
|
---|
171 | #tv2 - after door 67, the complete room plus all rooms behind it
|
---|
172 | func void fl2_spawn_secguard_3(string ai_name)
|
---|
173 | {
|
---|
174 | ai2_spawn fl2_secguard_3
|
---|
175 | ai2_spawn fl2_secguard_6
|
---|
176 | ai2_spawn fl2_balcony_1
|
---|
177 | }
|
---|
178 |
|
---|
179 | #tv1 - after door 75, the complete room plus all rooms behind it
|
---|
180 | func void fl2_spawn_secguard_2(string ai_name)
|
---|
181 | {
|
---|
182 | ai2_spawn fl2_secguard_2
|
---|
183 | ai2_spawn fl2_secguard_7
|
---|
184 | ai2_spawn fl2_balcony_2
|
---|
185 | ai2_spawn neutral_2
|
---|
186 | ai2_spawn neutral_4
|
---|
187 | }
|
---|
188 |
|
---|
189 | #hit func of neutral_2
|
---|
190 | func void do_neutral_2_run(string ai_name)
|
---|
191 | {
|
---|
192 | ai2_neutralbehavior neutral_2 none
|
---|
193 | ai2_dopath neutral_2 neutral_2_run
|
---|
194 | ai2_setjobstate neutral_2
|
---|
195 | }
|
---|
196 |
|
---|
197 | #console3
|
---|
198 | func void change_fl3_lights(string ai_name)
|
---|
199 | {
|
---|
200 | particle lock3_locklight01 do start
|
---|
201 | ai2_spawn fl3_mook_1
|
---|
202 | ai2_spawn fl3_mook_2
|
---|
203 | }
|
---|
204 |
|
---|
205 | ### 2ND FLOOR ###
|
---|
206 |
|
---|
207 | #tv6 - in front of door 68 and door 76
|
---|
208 | func void spawn_fl3_guards(string ai_name)
|
---|
209 | {
|
---|
210 | ai2_spawn fl3_secguard_1
|
---|
211 | ai2_spawn fl3_secguard_2
|
---|
212 | ai2_spawn fl3_secguard_6
|
---|
213 | ai2_spawn flROOF_sniper_1
|
---|
214 | ai2_spawn Roof_BOSWAT_1
|
---|
215 | ai2_spawn neutral_3
|
---|
216 | ai2_spawn neutral_6
|
---|
217 | objective_set 3 silent
|
---|
218 | var_counter = 0
|
---|
219 | }
|
---|
220 |
|
---|
221 | #hit func of neutral_3
|
---|
222 | func void do_neutral_3_run(string ai_name)
|
---|
223 | {
|
---|
224 | ai2_neutralbehavior neutral_3 none
|
---|
225 | ai2_dopath neutral_3 neutral_3_run
|
---|
226 | ai2_setjobstate neutral_3
|
---|
227 | }
|
---|
228 |
|
---|
229 | #console4
|
---|
230 | func void seclock2(string ai_name)
|
---|
231 | {
|
---|
232 | particle lock5b_locklight01 do start
|
---|
233 | console_check
|
---|
234 | }
|
---|
235 |
|
---|
236 | #console82
|
---|
237 | func void seclock3(string ai_name)
|
---|
238 | {
|
---|
239 | particle lock5c_locklight01 do start
|
---|
240 | console_check
|
---|
241 | }
|
---|
242 |
|
---|
243 | #console88
|
---|
244 | func void seclock1(string ai_name)
|
---|
245 | {
|
---|
246 | particle lock5a_locklight01 do start
|
---|
247 | console_check
|
---|
248 | }
|
---|
249 |
|
---|
250 | func void console_check(void)
|
---|
251 | {
|
---|
252 | var_counter = var_counter + 1
|
---|
253 | if(var_counter eq 1) sound_music_start mus_lz 0.75
|
---|
254 | if(var_counter eq 3)
|
---|
255 | {
|
---|
256 | music_stop
|
---|
257 | door_unlock 23
|
---|
258 | door_unlock 42
|
---|
259 | }
|
---|
260 | }
|
---|
261 |
|
---|
262 | ### ROOF ###
|
---|
263 |
|
---|
264 | #console5
|
---|
265 | func void DataArchiveUnlock(string ai_name)
|
---|
266 | {
|
---|
267 | sound_music_start mus_heart
|
---|
268 | particle lock4_locklight01 do start
|
---|
269 | door_unlock 7
|
---|
270 | ai2_spawn fl1_target_1
|
---|
271 | ai2_spawn fl2_target_2
|
---|
272 | objective_set 4 silent
|
---|
273 | target_set 267 30
|
---|
274 | trigvolume_enable shut_off_vault_music 1
|
---|
275 | }
|
---|
276 |
|
---|
277 | ### BACK TO GROUND FLOOR ###
|
---|
278 |
|
---|
279 | #tv22 - between door 7 and door 14
|
---|
280 | func void all_music_counters(void)
|
---|
281 | {
|
---|
282 | music_stop
|
---|
283 | }
|
---|
284 |
|
---|
285 | ##########
|
---|
286 | ### SP2 ###
|
---|
287 | ##########
|
---|
288 |
|
---|
289 | ### BASMENT ###
|
---|
290 |
|
---|
291 | #tv24 - after door 15 (which is on the left side)
|
---|
292 | func void save_game_2_right(string player_name)
|
---|
293 | {
|
---|
294 | save_game_2_left
|
---|
295 | }
|
---|
296 |
|
---|
297 | #tv23 - after door 5 (which is on the right side)
|
---|
298 | func void save_game_2_left(string player_name)
|
---|
299 | {
|
---|
300 | if(save_point eq 2) fork load_s2
|
---|
301 | else
|
---|
302 | {
|
---|
303 | save_game 2 autosave
|
---|
304 | fork remove_ai
|
---|
305 | }
|
---|
306 | trigvolume_enable save_trig_left 0
|
---|
307 | trigvolume_enable save_trig_right 0
|
---|
308 | ai2_spawn flBASEMENT_guard_1
|
---|
309 | ai2_spawn flBASEMENT_guard_2
|
---|
310 | console_activate 1
|
---|
311 | console_activate 6
|
---|
312 | }
|
---|
313 |
|
---|
314 | func void load_s2(void)
|
---|
315 | {
|
---|
316 | particle lock1_locklight01 do start
|
---|
317 | particle lock2_locklight01 do start
|
---|
318 | particle lock3_locklight01 do start
|
---|
319 | particle lock4_locklight01 do start
|
---|
320 | particle lock5a_locklight01 do start
|
---|
321 | particle lock5b_locklight01 do start
|
---|
322 | particle lock5c_locklight01 do start
|
---|
323 | particle lock99_locklight01 do start
|
---|
324 | door_unlock 5
|
---|
325 | door_unlock 7
|
---|
326 | door_unlock 14
|
---|
327 | door_unlock 15
|
---|
328 | door_unlock 23
|
---|
329 | door_unlock 42
|
---|
330 | door_unlock 54
|
---|
331 | door_unlock 59
|
---|
332 | door_unlock 67
|
---|
333 | door_unlock 68
|
---|
334 | door_unlock 75
|
---|
335 | door_unlock 76
|
---|
336 | trig_activate 1
|
---|
337 | trig_activate 2
|
---|
338 | console_deactivate 2
|
---|
339 | console_deactivate 3
|
---|
340 | console_deactivate 5
|
---|
341 | console_deactivate 4
|
---|
342 | console_deactivate 11
|
---|
343 | console_deactivate 82
|
---|
344 | console_deactivate 88
|
---|
345 | trigvolume_enable trigger_volume_09 0
|
---|
346 | trigvolume_enable trigger_volume_08 0
|
---|
347 | trigvolume_enable trigger_volume_02 0
|
---|
348 | trigvolume_enable trigger_volume_01 0
|
---|
349 | ai2_spawn neutral_1
|
---|
350 | ai2_spawn neutral_2
|
---|
351 | ai2_spawn neutral_3
|
---|
352 | ai2_spawn neutral_4
|
---|
353 | ai2_spawn neutral_5
|
---|
354 | ai2_spawn neutral_6
|
---|
355 | ai2_neutralbehavior neutral_1 none
|
---|
356 | ai2_neutralbehavior neutral_2 none
|
---|
357 | ai2_neutralbehavior neutral_3 none
|
---|
358 | objective_set 4 silent
|
---|
359 | target_set 267 30
|
---|
360 | }
|
---|
361 |
|
---|
362 | #console6
|
---|
363 | func void hall_1(string ai_name)
|
---|
364 | {
|
---|
365 | particle lock6_locklight01 do start
|
---|
366 | door_unlock 3
|
---|
367 | door_unlock 22
|
---|
368 | door_unlock 38
|
---|
369 | door_unlock 77
|
---|
370 | trig_deactivate 1
|
---|
371 | trig_deactivate 2
|
---|
372 | }
|
---|
373 |
|
---|
374 | #console1
|
---|
375 | func void unlock_secret_1(string ai_name)
|
---|
376 | {
|
---|
377 | console_activate 7
|
---|
378 | ai2_spawn secret_guard_1
|
---|
379 | ai2_spawn secret_guard_2
|
---|
380 | trig_activate 12
|
---|
381 | trig_activate 13
|
---|
382 | trig_activate 14
|
---|
383 | door_unlock 82
|
---|
384 | objective_set 5 silent
|
---|
385 | target_set 1030 30
|
---|
386 | }
|
---|
387 |
|
---|
388 | #tv8 - in front of door 3 and door 77
|
---|
389 | func void spawn_flRAMP_guards(string ai_name)
|
---|
390 | {
|
---|
391 | particle lock46_locklight01 do start
|
---|
392 | ai2_spawn flRAMP_guard_1
|
---|
393 | ai2_spawn flRAMP_guard_2
|
---|
394 | }
|
---|
395 |
|
---|
396 | ### BACK TO 2ND FLOOR ###
|
---|
397 |
|
---|
398 | #console7
|
---|
399 | func void unlock_secret_2(string ai_name)
|
---|
400 | {
|
---|
401 | particle lock7_locklight01 do start
|
---|
402 | door_unlock 34
|
---|
403 | door_unlock 36
|
---|
404 | trig_deactivate 12
|
---|
405 | trigvolume_enable ninja_ambush_top_trig 1
|
---|
406 | trigvolume_enable ninja_ambush_bot_trig 1
|
---|
407 | }
|
---|
408 |
|
---|
409 | #tv29 - after door 3 and door 77
|
---|
410 | #tv25 - after door 22 and door 38
|
---|
411 | func void ninja_ambush(string ai_name)
|
---|
412 | {
|
---|
413 | trigvolume_enable ninja_ambush_top_trig 0
|
---|
414 | trigvolume_enable ninja_ambush_bot_trig 0
|
---|
415 | ai2_spawn ambush_ninja_1
|
---|
416 | ai2_spawn creepy_ninja_1
|
---|
417 | ai2_spawn creepy_ninja_3
|
---|
418 | }
|
---|
419 |
|
---|
420 | ### NEXT PART OF THE BUILDING - 1ST FLOOR ###
|
---|
421 |
|
---|
422 | #console8
|
---|
423 | func void upstairs(string ai_name)
|
---|
424 | {
|
---|
425 | particle lock23_locklight01 do start
|
---|
426 | particle lock65_locklight01 do start
|
---|
427 | door_unlock 8
|
---|
428 | door_unlock 9
|
---|
429 | door_unlock 35
|
---|
430 | trig_deactivate 13
|
---|
431 | trig_deactivate 14
|
---|
432 | ai2_spawn creepy_ninja_5
|
---|
433 | ai2_spawn creepy_ninja_6
|
---|
434 | }
|
---|
435 |
|
---|
436 | ### 2ND FLOOR ###
|
---|
437 |
|
---|
438 | #tv4 - in front of door 37
|
---|
439 | func void window_ninja(string ai_name)
|
---|
440 | {
|
---|
441 | trigvolume_enable Cut_outro 0
|
---|
442 | ai2_spawn creepy_ninja_4
|
---|
443 | chr_teleport creepy_ninja_4 289
|
---|
444 | ai2_lookatme creepy_ninja_4
|
---|
445 | chr_animate creepy_ninja_4 NINJArun_kick
|
---|
446 | chr_create 1030 start
|
---|
447 | chr_neutral 1030 1
|
---|
448 | playback 1030 WindowNinjaSet
|
---|
449 | sound_music_start mus_pursuit_hd
|
---|
450 | obj_create 481 481
|
---|
451 | obj_show 481 481
|
---|
452 | env_anim 481 481
|
---|
453 | env_setanim 481 Disk02
|
---|
454 | chr_envanim 1030 WindowNinjaBox01 norotation
|
---|
455 | chr_animate 1030 NINJAlev11_window
|
---|
456 | sleep 185
|
---|
457 | sound_impulse_play glass_big
|
---|
458 | particle WindowCharge do explode
|
---|
459 | sleep 60
|
---|
460 | chr_delete 1030
|
---|
461 | ai2_spawn WindowNinjaRun
|
---|
462 | ai2_passive WindowNinjaRun 1
|
---|
463 | chr_unstoppable WindowNinjaRun 1
|
---|
464 | chr_lock_active WindowNinjaRun
|
---|
465 | playback WindowNinjaRun WindowNinjaRun
|
---|
466 | obj_kill 481 481
|
---|
467 | target_set 1030 0
|
---|
468 | sleep 210
|
---|
469 | playback WindowNinjaRun JumpNinjaSet
|
---|
470 | #sleep 10
|
---|
471 | #playback WindowNinjaRun JumpNinjaSet
|
---|
472 | }
|
---|
473 |
|
---|
474 | ### OUTSIDE ON THE ROOF ###
|
---|
475 |
|
---|
476 | #tv27 - complete roof
|
---|
477 | func void check_outro(string ai_name)
|
---|
478 | {
|
---|
479 | trigvolume_enable tv_check_outro 0
|
---|
480 | if(trigvolume_count(24) eq 0)
|
---|
481 | {
|
---|
482 | trigvolume_enable Cut_outro 1
|
---|
483 | particle obj2 create
|
---|
484 | target_set 126 30
|
---|
485 | }
|
---|
486 | else
|
---|
487 | {
|
---|
488 | sleep 60
|
---|
489 | trigvolume_enable tv_check_outro 1
|
---|
490 | }
|
---|
491 | }
|
---|
492 |
|
---|
493 | #tv28 - complete roof too; used to count the enemies inside it; see func above
|
---|
494 |
|
---|
495 | #tv21 - after the window, from the first left box to the right wall
|
---|
496 | func void FaceSet(string ai_name)
|
---|
497 | {
|
---|
498 | playback WindowNinjaRun
|
---|
499 | ai2_spawn FaceNinja
|
---|
500 | ai2_spawn FaceNinja2
|
---|
501 | playback FaceNinja FaceNinjaSet
|
---|
502 | playback FaceNinja FaceNinjaJump
|
---|
503 | }
|
---|
504 |
|
---|
505 | #tv26 - passage between the two boxes
|
---|
506 | func void JumpNinja(string ai_name)
|
---|
507 | {
|
---|
508 | chr_nocollision WindowNinjaRun 1
|
---|
509 | chr_animate WindowNinjaRun KONOKOlev11_jump -1
|
---|
510 | sleep 135
|
---|
511 | chr_delete WindowNinjaRun
|
---|
512 | }
|
---|
513 |
|
---|
514 | #tv5 - the place with the yellow flashing circle
|
---|
515 | func void outro(string ai_name)
|
---|
516 | {
|
---|
517 | fade_out 0 0 0 30
|
---|
518 | sleep 30
|
---|
519 | win
|
---|
520 | }
|
---|
521 |
|
---|
522 | #####################
|
---|
523 | ### TEXT CONSOLES ###
|
---|
524 | #####################
|
---|
525 |
|
---|
526 | func void grifftext(string chr_index)
|
---|
527 | {
|
---|
528 | text_console level_11a
|
---|
529 | console_reset 9
|
---|
530 | }
|
---|