source: AE/packages/VanillaBSL/IGMD/state/state_level_logic.bsl@ 317

Last change on this file since 317 was 313, checked in by gumby, 16 years ago
File size: 11.1 KB
Line 
1#
2# state_spawn_guards.bsl
3#
4# LEVEL LOGIC
5#
6################## MUSIC TEST ################################
7func void level_start(string ai_name)
8{
9# These functions are used when the game is restored.
10
11 if (my_save_point eq 0)
12 {
13 dprint SAVE_POINT_0
14# USE THIS FUNC TO SET UP TRAINING SEQUENCE AGAIN
15
16 ai2_spawn neutral_1
17 ai2_spawn fl2_secguard_1
18 powerup_spawn ammo 131
19 powerup_spawn hypo 132
20 }
21
22 if (my_save_point eq 1)
23 {
24 dprint RESTORE_SAVE_POINT_1
25 fl1_spawn_guards
26
27 ai2_spawn neutral_1
28 ai2_spawn fl2_secguard_1
29 powerup_spawn ammo 131
30 powerup_spawn hypo 132
31
32 objective_set(1);
33 particle(lock99_locklight01, do, start);
34 console_deactivate 10
35 trigvolume_enable(trigger_volume_09, 0);
36 restore_game
37 }
38
39 if (my_save_point eq 2)
40 {
41 dprint RESTORE_SAVE_POINT_2
42
43 particle obj1 create
44 particle obj1 start
45
46 trigvolume_enable(Cut_dog, 1);
47 trigvolume_enable(trigger_volume_11, 1);
48 trigvolume_enable(trigger_volume_12, 1);
49 trigvolume_enable(trigger_volume_14, 1);
50 trigvolume_enable(trigger_volume_15, 1);
51 trigvolume_enable(trigger_volume_10, 1);
52
53 trigvolume_enable(shut_off_vault_music, 0);
54 trigvolume_enable(trigger_volume_09, 0);
55 trigvolume_enable(trigger_volume_08, 0);
56 trigvolume_enable(trigger_volume_02, 0);
57 trigvolume_enable(trigger_volume_01, 0);
58
59 trigvolume_enable(save_trig_right, 0);
60 trigvolume_enable(save_trig_left, 0);
61
62 objective_set 4 silent
63
64 target_set(267, 30.0)
65
66 #change_flGUARD_CORRIDOR_lights
67
68 door_lock(3);
69 door_lock(77);
70
71 door_unlock(15);
72 door_unlock(14);
73 door_unlock(7);
74 door_unlock(5);
75 door_unlock(75);
76 door_unlock(59);
77 door_unlock(54);
78 door_unlock(67);
79 door_unlock(68);
80 door_unlock(76);
81 door_unlock(23);
82 door_unlock(42);
83
84 trig_activate 1
85 trig_activate 2
86 #trig_activate 14
87
88 #console_activate 6
89 #console_activate 7
90 #console_activate 9
91
92 console_deactivate 11
93 console_deactivate 4
94 console_deactivate 88
95 console_deactivate 82
96 console_deactivate 5
97 console_deactivate 3
98 console_deactivate 6
99 console_deactivate 1
100 console_deactivate 2
101
102 particle lock1_locklight01 do start
103 particle lock2_locklight01 do start
104 particle lock3_locklight01 do start
105 particle lock4_locklight01 do start
106 particle lock5a_locklight01 do start
107 particle lock5b_locklight01 do start
108 particle lock5c_locklight01 do start
109 particle lock99_locklight01 do start
110
111 particle lock6_locklight01 do stop
112
113 env_shade 271 272 .4 .4 .2
114
115 restore_game
116# objective_set(3);
117 }
118}
119
120# This is an example of a save game console.
121
122func void save_game_1(string player_name)
123{
124 dprint saveit_1
125 save_game 1 autosave
126}
127
128func void save_game_2_right(string player_name)
129{
130 dprint saveit_2
131 save_game 2 autosave
132 trigvolume_enable save_trig_left 0
133}
134
135func void save_game_2_left(string player_name)
136{
137 dprint saveit_2
138 save_game 2 autosave
139 trigvolume_enable save_trig_right 0
140}
141
142##############################################################
143var int music_counter;
144
145func void music_force_stop(void)
146{
147 sleep 4500
148
149 if (0 ne music_counter)
150 {
151 dprint music_force_stop
152 music_counter = 0
153 all_music_counters
154 }
155}
156func void music_script_start(void)
157{
158 music_counter = 2
159}
160
161func void die_for_art_1(string ai_name)
162{
163 dprint DFA_1
164 music_counter = music_counter - 1
165
166 if (music_counter eq 0)
167 {
168 all_music_counters();
169 }
170
171}
172func void die_for_art_2(string ai_name)
173{
174 dprint DFA_2
175 music_counter = music_counter - 1
176
177 if (music_counter eq 0)
178 {
179 all_music_counters();
180 }
181
182}
183func void all_music_counters(void)
184{
185 dprint STOP_THE_MUSIC
186 sound_music_stop mus_main02
187 sound_music_stop mus_heart
188 sound_music_stop mus_main02_hd
189}
190
191func void fl1_spawn_guards(string ai_name)
192{
193# dprint FL1_SPAWN_GUARDS
194 ai2_spawn fl1_secguard_1
195 ai2_spawn fl1_secguard_2
196 ai2_spawn fl1_secguard_4
197 trigvolume_enable shut_off_vault_music 0
198}
199
200func void fl2_spawn_secguard_2(string ai_name)
201{
202# dprint FL2_SPAWN_GUARDS
203 ai2_spawn fl2_secguard_2
204 ai2_spawn fl2_secguard_7
205 ai2_spawn fl2_balcony_2
206
207 ai2_spawn neutral_2
208 ai2_spawn neutral_4
209}
210
211func void fl2_spawn_secguard_3(string ai_name)
212{
213# dprint FL2_SPAWN_ASSAULT_GUARDS
214 ai2_spawn fl2_secguard_3
215 ai2_spawn fl2_secguard_6
216 ai2_spawn fl2_balcony_1
217}
218
219# THESE ARE THE THIRD FLOOR/ROOF GUYS
220
221func void spawn_fl3_guards(string ai_name)
222{
223# dprint FLROOF_SPAWN_GUARDS
224 ai2_spawn fl3_secguard_1
225 ai2_spawn fl3_secguard_2
226 ai2_spawn fl3_secguard_6
227 ai2_spawn flROOF_sniper_1
228 ai2_spawn Roof_BOSWAT_1
229
230 ai2_spawn neutral_3
231 ai2_spawn neutral_6
232}
233
234# THESE ARE THE COMPUTER ROOM GUYS
235
236func void spawn_flBASEMENT_guards(string ai_name)
237{
238# dprint FLROOF_SPAWN_GUARDS
239 ai2_spawn flBASEMENT_guard_1
240 ai2_spawn flBASEMENT_guard_2
241}
242
243# THESE ARE THE COMPUTER ROOM GUYS
244
245func void spawn_flRAMP_guards(string ai_name)
246{
247# dprint FLROOF_SPAWN_GUARDS
248 ai2_spawn flRAMP_guard_1
249 ai2_spawn flRAMP_guard_2
250 trigvolume_enable ninja_ambush_top_trig 0
251 trigvolume_enable ninja_ambush_bot_trig 0
252 particle lock46_locklight01 do start
253}
254
255func void spawn_outside_left_snipers(string ai_name)
256{
257# dprint FL2_SPAWN_GUARDS
258 ai2_spawn flOUTSIDE_A_sniper_1
259 ai2_spawn flOUTSIDE_A_sniper_2
260 ai2_spawn flOUTSIDE_B_sniper_1
261 ai2_spawn flOUTSIDE_C_sniper_1
262}
263
264func void spawn_outside_right_snipers(string ai_name)
265{
266# dprint FL2_SPAWN_GUARDS
267 ai2_spawn flOUTSIDE_E_sniper_1
268 ai2_spawn flOUTSIDE_E_sniper_2
269 ai2_spawn flOUTSIDE_D_sniper_1
270 ai2_spawn flOUTSIDE_D_sniper_2
271}
272
273func void spawn_targets(string ai_name)
274{
275# dprint FL2_SPAWN_GUARDS
276 ai2_spawn fl2_target_2
277}
278
279func void do_neutral_1_run(string ai_name)
280{
281 ai2_neutralbehavior neutral_1 none
282 ai2_setmovementmode neutral_1 run_noaim
283 ai2_dopath neutral_1 neutral_1_run
284 ai2_setjobstate neutral_1
285}
286
287func void do_neutral_2_run(string ai_name)
288{
289 ai2_neutralbehavior neutral_2 none
290 ai2_dopath neutral_2 neutral_2_run
291 ai2_setjobstate neutral_2
292}
293
294func void do_neutral_3_run(string ai_name)
295{
296 ai2_neutralbehavior neutral_3 none
297 ai2_dopath neutral_3 neutral_3_run
298 ai2_setjobstate neutral_3
299}
300
301func void unlock_secret_1(string ai_name)
302{
303 input 0
304 cm_interpolate secret1 0
305 sleep 60
306 console_activate 7
307 #particle lock69a_locklight01 do start
308 sleep 150
309 cm_reset
310 input 1
311
312 ai2_spawn secret_guard_1
313 ai2_spawn secret_guard_2
314}
315
316func void unlock_secret_2(string ai_name)
317{
318 door_unlock 34
319 door_unlock 36
320
321 # CB: ensure ramp guards do not see ninja and go after him!
322 ai2_passive flRAMP_guard_1 1
323 ai2_passive flRAMP_guard_2 1
324
325 ai2_spawn cutscene_ninja_1
326 input 0
327 cm_interpolate secret2 0
328 sleep 60
329 particle lock7_locklight01 do start
330 sleep 15
331 trig_deactivate 12
332 sleep 150
333 cm_reset
334 input 1
335
336 chr_delete cutscene_ninja_1
337 ai2_passive flRAMP_guard_1 0
338 ai2_passive flRAMP_guard_2 0
339
340 trigvolume_enable ninja_ambush_top_trig 1
341 trigvolume_enable ninja_ambush_bot_trig 1
342}
343
344func void ninja_ambush(string ai_name)
345{
346 trigvolume_enable ninja_ambush_top_trig 0
347 trigvolume_enable ninja_ambush_bot_trig 0
348
349 ai2_spawn ambush_ninja_1
350 ai2_spawn creepy_ninja_1
351 ai2_spawn creepy_ninja_3
352}
353
354func void hall_1(string ai_name)
355{
356 input 0
357 cm_interpolate hall1 0
358 sleep 60
359 door_unlock 77
360 door_unlock 38
361 door_unlock 22
362 door_unlock 3
363 particle lock6_locklight01 do start
364 particle lock7_locklight01 do stop
365 sleep 150
366 cm_reset
367 input 1
368
369 trig_deactivate 1
370 trig_deactivate 2
371}
372
373func void top_1(string ai_name)
374{
375 input 0
376 #cm_interpolate hall1 0
377 sleep 60
378 door_unlock 35
379 door_unlock 38
380 door_unlock 22
381 door_unlock 3
382 particle lock6_locklight01 do start
383 sleep 150
384 cm_reset
385 input 1
386
387 trig_activate 12
388 trig_activate 13
389 trig_activate 14
390
391 trig_deactivate 1
392 trig_deactivate 2
393}
394
395func void downstairs(string ai_name)
396{
397 trig_deactivate 14
398 door_unlock 8
399 door_unlock 9
400 particle lock23_locklight01 do start
401 ai2_spawn creepy_ninja_5
402 ai2_spawn creepy_ninja_6
403}
404
405func void upstairs(string ai_name)
406{
407 trig_deactivate 13
408 door_unlock 35
409 particle lock65_locklight01 do start
410}
411
412var int door_counter=3;
413
414func void seclock_music_start(void)
415{
416 if (door_counter eq 3)
417 {
418 sound_music_start mus_lz 0.75
419 }
420}
421
422func void seclock_decrement_counter(void)
423{
424 door_counter = door_counter - 1
425
426
427 if (door_counter eq 0)
428 {
429 sound_music_stop mus_lz
430 unlock_roof();
431 }
432}
433
434func void seclock1(string ai_name)
435{
436 seclock_music_start
437
438 input 0
439 cm_interpolate security 0
440 sleep 60
441 particle lock5a_locklight01 do start
442 sleep 150
443 cm_reset
444 input 1
445
446 seclock_decrement_counter
447}
448
449func void seclock2(string ai_name)
450{
451 seclock_music_start
452
453 input 0
454 cm_interpolate security 0
455 sleep 60
456 particle lock5b_locklight01 do start
457 sleep 150
458 cm_reset
459 input 1
460
461 seclock_decrement_counter
462}
463
464func void seclock3(string ai_name)
465{
466 seclock_music_start
467
468 input 0
469 cm_interpolate security 0
470 sleep 60
471 particle lock5c_locklight01 do start
472 sleep 150
473 cm_reset
474 input 1
475
476 seclock_decrement_counter
477}
478
479func void unlock_roof(string ai_name)
480{
481 door_unlock 23
482 door_unlock 42
483}
484
485#
486# state_door_lock_lights.bsl
487#
488# SCRIPTS TO CHANGE THE LOCKED LIGHTS ON DOORS
489#
490# TURN FROM GREEN TO RED: do stop
491
492func void change_fl2_lights(string ai_name)
493{
494# dprint WHATEVER YOU WANT
495 sleep 60
496 particle lock2_locklight01 do start
497}
498
499func void change_fl3_lights(string ai_name)
500{
501 particle lock3_locklight01 do start
502 ai2_spawn fl3_mook_1
503 ai2_spawn fl3_mook_2
504}
505
506func void change_flDATA_ARCHIVE_lights(string ai_name)
507{
508 sleep 60
509 particle lock4_locklight01 do start
510}
511
512func void change_flCOMMAND_CENTER_lights(string ai_name)
513{
514 particle lock5_locklight01 do start
515}
516
517func void change_flGUARD_CORRIDOR_lights(string ai_name)
518{
519 particle lock6_locklight01 do start
520}
521
522func void change_flDIG_OFFICES_lights(string ai_name)
523{
524 particle lock7_locklight01 do start
525}
526
527
528func void grifftext(string chr_index)
529{
530 dprint text2a
531 text_console level_11a
532 console_reset 9
533}
534
535
536#
537# state_spawn_guards.bsl
538#
539# SCRIPTS TO SPAWN SECURITY GUARDS
540#
541
542func void set_objective_1(string ai_name)
543{
544# dprint WHATEVER I WANT
545 objective_set(1)
546 target_set(127, 30.0)
547}
548
549func void set_objective_2(string ai_name)
550{
551# dprint WHATEVER I WANT
552 objective_set(2)
553}
554
555func void set_objective_3(string ai_name)
556{
557# dprint WHATEVER I WANT
558 objective_set(3)
559}
560
561func void set_objective_4(string ai_name)
562{
563# dprint WHATEVER I WANT
564 objective_set(4)
565 target_set(267, 30.0)
566}
567
568func void set_objective_5(string ai_name)
569{
570# dprint WHATEVER I WANT
571 objective_set(5)
572}
573
574func void set_objective_6(string ai_name)
575{
576# dprint WHATEVER I WANT
577 objective_set(6)
578}
579
580func void set_target_1(string ai_name)
581{
582# dprint WHATEVER I WANT
583 target_set(267, 30.0)
584}
585
586func void set_target_2(string ai_name)
587{
588# dprint WHATEVER I WANT
589 target_set(1030, 30.0)
590}
591###wuscripts
592func void check_outro(string ai_name)
593{
594 trigvolume_enable tv_check_outro 0
595 if(trigvolume_count (24) eq 0)
596 {
597 trigvolume_enable Cut_outro 1
598 particle obj2 create
599 target_set(126,30.0)
600 }
601 if(trigvolume_count (24) ne 0)
602 {
603 sleep 60
604 trigvolume_enable tv_check_outro 1
605 }
606}
607
Note: See TracBrowser for help on using the repository browser.