source: AE/packages/VanillaBSL/IGMD/power_II/power2_spawn.bsl@ 617

Last change on this file since 617 was 407, checked in by gumby, 15 years ago

rename ahoy

File size: 11.9 KB
Line 
1### POWER PLANT II LEVEL LOGIC ###
2
3### START, SAVE & OBJECTIVES ###
4
5var int inside_final_cutscene = 0;
6
7func void start(string ai_name)
8{
9 particle save3_locklight01 do start
10
11 if (save_point eq 0)
12 {
13 my_save_point = 0
14 trigvolume_enable trigger_volume_07 0
15 particle_room1_start
16 particle doorA_locklight01 do stop
17 ai2_spawn ambush_striker_10
18 ai2_spawn ambush_striker_11
19 set_objective_1
20 chr_invincible ShinShin 1
21 chr_unstoppable ShinShin 1
22 }
23 if (save_point eq 1)
24 {
25 my_save_point = 1;
26 dprint restore1_active
27 trigvolume_enable room3_particle_control 0
28 door_lock 3
29 particle Shindoor_locklight01 do stop
30 particle room4 do start
31 ai2_spawn A3_n05
32 restore_game
33 set_objective_3
34 }
35 if (save_point eq 2)
36 {
37 my_save_point = 2;
38 dprint restore2_active
39 particle doorA_locklight01 do stop
40 particle doorB_locklight01 do start
41 door_lock 15
42 trigvolume_enable save2 0
43 ai2_spawn vat_bot_1
44 ai2_spawn vat_bot_2
45 ai2_spawn vat_bot_3
46 ai2_spawn vat_bot_4
47 ai2_spawn vat_bot_5
48 chr_weapon_immune(vat_bot_1);
49 chr_weapon_immune(vat_bot_2);
50 chr_weapon_immune(vat_bot_3);
51 chr_weapon_immune(vat_bot_4);
52 chr_weapon_immune(vat_bot_5);
53 restore_game
54 set_objective_4
55 sound_music_start atm_cl12 0.75
56 }
57 if (save_point eq 3)
58 {
59 my_save_point = 3;
60 dprint restore3_active
61 particle save3_locklight01 do stop
62 door_lock 23
63 door_lock 28
64 ai2_spawn E1_sr28
65 ai2_spawn E1_sr30
66 ai2_spawn E1_sb29
67 ai2_spawn ambush_comguy_1
68 ai2_spawn E1_n31
69 ai2_spawn E1_n32
70 ai2_spawn E1_n37
71 trigvolume_enable save_point3 0
72 trigvolume_enable p11b_vol 0
73 restore_game
74 pipe3_start
75 set_objective_5
76 }
77}
78
79func void you_lose(string ai_name)
80{
81 sleep 240
82 fade_out 0 0 0 180
83 sleep 240
84 lose
85}
86
87func void you_win(int char_index)
88{
89 outro
90 win
91}
92
93func void new_save1(string ai_name)
94{
95 if (my_save_point ne 1)
96 {
97 save_game 1 autosave
98 }
99}
100
101func void save_point_1(string ai_name)
102{
103 dprint savegame_1
104 door_lock 3
105 particle Shindoor_locklight01 do stop
106}
107
108func void save_point_2(string ai_name)
109{
110 dprint savegame_2
111 save_game 2 autosave
112}
113
114func void save_point_3(string ai_name)
115{
116 dprint savegame_3
117 save_game 3 autosave
118}
119
120func void set_objective_1(string ai_name)
121{
122 dprint set_objective1
123 objective_set(1)
124}
125
126func void set_objective_2(string ai_name)
127{
128 dprint set_objective2
129 objective_set(2)
130 target_set(7020,60.00)
131}
132
133func void set_objective_3(string ai_name)
134{
135 dprint set_objective3
136 objective_set(3)
137 target_set(0,0)
138}
139
140func void set_objective_4(string ai_name)
141{
142 dprint set_objective4
143 objective_set(4)
144 trigvolume_enable setobjective_4 0
145}
146
147func void set_objective_5(string ai_name)
148{
149 dprint set_objective5
150 objective_set(5)
151 trigvolume_enable setobjective_5 0
152}
153
154### MUSIC ###
155
156var int music_counter;
157
158func void music_force_stop(void)
159{
160 sleep 4500
161 if (0 ne music_counter)
162 {
163 dprint music_force_stop
164 music_counter = 0
165 all_music_counters
166 }
167}
168
169func void music_script_start(void)
170{
171 music_counter = 2
172}
173
174func void striker_lullaby_1(string ai_name)
175{
176 dprint striker_lullaby1
177 music_counter = music_counter - 1
178 if (music_counter eq 0)
179 {
180 all_music_counters();
181 }
182}
183
184func void striker_lullaby_2(string ai_name)
185{
186 dprint striker_lullaby2
187 music_counter = music_counter - 1
188 if (music_counter eq 0)
189 {
190 all_music_counters();
191 }
192}
193
194func void all_music_counters(void)
195{
196 dprint ELVIS_HAS_LEFT_THE_BUILDING
197 sound_music_stop mus_trt
198 sound_music_stop mus_sad1
199 sound_music_stop atm_cl10
200 sound_music_stop atm_ft66
201 sound_music_stop atm_cl09
202 sound_music_stop atm_cl11
203 sound_music_stop mus_xtr2
204 sound_music_stop mus_lz
205}
206
207### TEXT CONSOLES ###
208
209func void level10a(string chr_index)
210{
211 dprint text10a
212 text_console level_10a
213 console_reset 2
214}
215
216func void level10b(string chr_index)
217{
218 dprint text10b
219 text_console level_10b
220 console_reset 7
221}
222
223### GAMEPLAY PROGRESSION ###
224
225# STRIKER BACKUPS
226func void backup_1(string ai_name)
227{
228 dprint backup1
229 ai2_spawn backup_striker1
230 particle blast1_locklight01 do start
231 door_unlock 1
232 door_open 1
233}
234
235func void backup_2(string ai_name)
236{
237 dprint backup2
238 ai2_spawn backup_striker2
239 particle blast2_locklight01 do start
240 door_unlock 2
241 door_open 2
242}
243
244
245# COME TO ME
246func void come_to_me(string ai_name)
247{
248 dprint go_to_konoko
249 ai2_dopath ambush_striker1 come_to_me 1
250 ai2_dopath ambush_striker2 come_to_me 1
251 ai2_dopath A1_t02 come_to_me 1
252 ai2_dopath A1_sr01 come_to_me 1
253 ai2_dopath ambush_striker1 come_to_me 1
254 ai2_dopath ambush_striker2 come_to_me 1
255}
256
257# SHIN CUTSCENE CHECK
258func void shin_check(string ai_name)
259{
260 var int inside_count;
261 dprint shin_cutscene_check
262 trigvolume_enable trigger_volume_03 0
263
264 inside_count = trigvolume_count(32);
265
266 if (inside_count ne 0)
267 {
268 sleep 60
269 trigvolume_enable trigger_volume_03 1
270 }
271
272 if (inside_count eq 0)
273 {
274 Shin
275 }
276}
277
278func void t43(string ai_name)
279{
280 dprint konoko_dies
281 inroom = 1
282}
283
284func void t43b(string ai_name)
285{
286 dprint konoko_lives
287 inroom = 0
288}
289
290func void delete_script(string ai_name)
291{
292 dprint dead_or_not
293 chr_delete ai_name
294}
295
296func void shin_dies(void)
297{
298 dprint KABOOM
299 particle ShinBomb do explode
300 fade_out 1 1 1 30
301 if (inroom eq 1)
302 {
303 chr_set_health 0 0
304 }
305
306 trigvolume_kill 64
307
308 chr_delete ShinShin
309 fade_in 60
310 door_lock 3
311 particle Shindoor_locklight01 do stop
312 set_objective_3
313}
314
315func void p1(string ai_name)
316{
317 dprint p1_trigger_entered
318 sound_music_stop mus_trt
319 sound_music_start atm_cl09 1.0
320 ai2_spawn A1_sr01
321 ai2_lookatme A1_sr01
322 ai2_spawn A1_t02
323 ai2_lookatme A1_t02
324 sleep 120
325 door_lock 1
326 door_lock 2
327}
328
329func void open_ambush1(string ai_name)
330{
331 dprint ambush_1
332 particle blast1_locklight01 do start
333 door_unlock 1
334 ai2_spawn ambush_striker1
335}
336
337func void open_ambush2(string ai_name)
338{
339 dprint ambush_2
340 particle blast2_locklight01 do start
341 door_unlock 2
342 ai2_spawn ambush_striker2
343}
344
345func void p2(string ai_name)
346{
347 dprint p2
348 ai2_spawn A2_r03
349 playback A2_r03 redjump
350 ai2_lookatme A2_r03
351 ai2_spawn aerial_red_2
352 ai2_passive aerial_red_2 1
353 playback aerial_red_2 redjump2
354 ai2_passive aerial_red_2 0
355 ai2_lookatme aerial_red_2
356 ai2_spawn red_guard_1
357 ai2_dopath A1_sr01 patrol_31
358 ai2_dopath A1_t02 patrol_31
359 ai2_setjobstate A1_sr01
360 ai2_setjobstate A1_t02 patrol_31
361 sleep 120
362}
363
364func void p5(string ai_name)
365{
366 dprint p5
367 ai2_spawn A3_n05
368 ai2_spawn A3_sb06
369 ai2_spawn A4_n07
370}
371
372func void p6(string ai_name)
373{
374 dprint p6
375 ai2_spawn A4_sr08
376 ai2_spawn B1_c07
377}
378
379func void enableP7(string ai_name)
380{
381 dprint enableP7
382 trigvolume_enable trigger_volume_07 1
383}
384
385func void do_console_1(string ai_name)
386{
387 dprint do_console
388 ai2_doalarm A3_n05 1
389}
390
391func void p8(string ai_name)
392{
393 dprint p8
394 ai2_spawn B2_sb09
395 ai2_spawn B2_n10
396 trigvolume_enable trigger_volume_07 0
397 trigvolume_enable trigger_volume_08 0
398}
399
400func void p9(string ai_name)
401{
402 dprint p9
403 ai2_spawn C1_c16
404 ai2_spawn C1_t11
405 ai2_spawn C1_sb12
406 ai2_spawn C1_t13
407 ai2_spawn C2_sg15
408 ai2_spawn C2_sr17
409 ai2_spawn C2_sb14
410 ai2_spawn C2_t19
411 particle room1 stop
412}
413
414func void red_ambush(string ai_name)
415{
416 dprint ambush_red
417 ai2_spawn ambush_red_1
418}
419
420func void p10(string ai_name)
421{
422 dprint p10
423 ai2_spawn D1_sr20
424 ai2_spawn D1_sb21
425}
426
427func void p11(string ai_name)
428{
429 dprint p11
430 particle room6 do start
431 pipe3_start
432}
433func void p11b(string ai_name)
434{
435 dprint p11b
436 particle room6 do stop
437}
438
439func void striker_guards(string ai_name)
440{
441 dprint spawn_strikers
442 ai2_spawn striker_guard_1
443 ai2_spawn striker_guard_2
444}
445
446func void spawn_EC_guards(string ai_name)
447{
448 dprint spawn_guards
449 ai2_spawn E1_sb29
450 ai2_spawn E1_c33
451 ai2_spawn E1_c40
452 ai2_spawn E1_f34
453 ai2_spawn E1_f40
454 ai2_spawn E1_f35
455}
456
457func void final_guards(string ai_name)
458{
459 dprint last_guards_activated
460 ai2_spawn final_guard_1
461 ai2_spawn final_guard_2
462}
463
464func void p12(string ai_name)
465{
466 dprint p12
467 ai2_spawn D2_sb26
468 playback D2_sb26 piperun
469 ai2_spawn pipe_guard_1
470 ai2_spawn pipe_guard_2
471}
472
473func void p13(string ai_name)
474{
475 dprint p13
476 ai2_spawn E1_sr28
477 ai2_spawn E1_sb29
478 ai2_spawn E1_sr30
479 ai2_spawn ambush_comguy_1
480 ai2_spawn E1_n31
481 ai2_spawn E1_n32
482 ai2_spawn E1_n37
483 particle elev1_locklight01 do stop
484 particle elev2_locklight01 do stop
485}
486
487func void p14(string ai_name)
488{
489 dprint p14
490 chr_teleport 0 105
491 ai2_spawn F_r40
492 particle pipe3 do start
493}
494
495func void p36(string ai_name)
496{
497 dprint spawned_muro_runner_p36
498 ai2_spawn muro_runner
499 ai2_spawn muro_runner2
500}
501
502func void p39(string ai_name)
503{
504 dprint p39
505 ai2_spawn F_r40
506}
507
508func void cross_fire(string ai_name)
509{
510 dprint crossfire
511 ai2_spawn D2_sg24
512 ai2_spawn D2_f25
513}
514
515func void tctf_control(string ai_name)
516{
517 dprint tctfcontrol_start
518 sound_music_start mus_amasian 1.0
519 input 0
520 letterbox 1
521 door_unlock 38
522 ai2_spawn E2_sr38
523 ai2_spawn E2_sr39
524 particle elev1_locklight01 do start
525 particle elev2_locklight01 do start
526 cm_interpolate tctf_3 0
527 cm_interpolate_block tctf_1 300
528 cm_interpolate_block tctf_2 150
529 sleep 180
530 cm_reset
531 letterbox 0
532 input 1
533 door_unlock 37
534}
535
536func void warnbigroom(string ai_name)
537{
538 dprint warnbigroom
539 ai2_tripalarm 1
540}
541
542func void zap_cinematic(string ai_name)
543{
544 dprint doorA
545 input 0
546 begin_cutscene
547 sound_music_start atm_cl12 0.75
548 particle zap1 create
549 particle zap1 start
550 cm_interpolate zap_cinematic1 0
551 cm_interpolate_block zap_cinematic3 700
552 sleep 750
553 cm_interpolate zap_cinematic4 0
554 sleep 60
555 particle doorA_locklight01 do start
556 sleep 150
557 door_unlock 15
558 cm_reset
559 end_cutscene
560 input 1
561 ai2_spawn vat_bot_1
562 ai2_spawn vat_bot_2
563 ai2_spawn vat_bot_3
564 ai2_spawn vat_bot_4
565 ai2_spawn vat_bot_5
566 chr_weapon_immune(vat_bot_1);
567 chr_weapon_immune(vat_bot_2);
568 chr_weapon_immune(vat_bot_3);
569 chr_weapon_immune(vat_bot_4);
570 chr_weapon_immune(vat_bot_5);
571 particle doorB_locklight01 do start
572}
573
574func void change_patrol_1(string ai_name)
575{
576 dprint change_patrol
577 ai2_dopath vat_bot_2 vat_bot_2b 1
578}
579
580func void change_patrol_2(string ai_name)
581{
582 dprint change_patrol
583 ai2_dopath vat_bot_3 vat_bot_3b 1
584}
585
586func void change_patrol_3(string ai_name)
587{
588 dprint change_patrol
589 ai2_dopath vat_bot_5 vat_bot_5b 1
590}
591
592func void spark_sound_off(string ai_name)
593{
594 dprint spark_music_off
595 sound_music_stop atm_cl12
596}
597
598# YOUR DEATH IS ASSURED
599func void dont_even_try_it(string ai_name)
600{
601 chr_set_health 0 0
602}
603
604### SPECIAL PARTICLES ###
605
606func void killmuro(string ai_name)
607{
608 dprint killedmuro
609 chr_delete muro_runner
610 chr_delete muro_runner2
611 sound_music_stop atm_cl11
612 ai2_spawn A4_n07
613}
614
615func void pipe1a(string ai_name)
616{
617 dprint pipe1_discharged
618 ai2_passive A3_n05 1
619 particle room4 do stop
620 timer_start 30 pipe1b
621 sound_music_start atm_cl11
622}
623
624func void pipe1b(void)
625{
626 dprint pipe1_recharged
627 particle room4 do start
628 console_reset 1
629
630 pipe1_music_off();
631}
632
633func void pipe1_music_off(void)
634{
635 dprint pipe1_music_off
636 sound_music_stop atm_cl11
637}
638
639func void pipe2a(void)
640{
641 dprint pipe2_discharged
642 particle room6 do stop
643 timer_start 29 pipe2b
644 sound_music_start atm_cl11
645}
646
647func void pipe2b(void)
648{
649 dprint pipe2_recharged
650 particle room6 do start
651 console_reset 8
652
653 pipe2_music_off();
654}
655
656func void pipe2_music_off(void)
657{
658 dprint pipe2_music_off
659 sound_music_stop atm_cl11
660}
661
662func void pipe3(void)
663{
664 dprint pipe_discharged
665 timer_start 19 pipe3b
666 sound_music_volume mus_amasian 0.0 2.0
667 particle pipe3 kill
668 sound_music_start atm_cl11
669 sound_music_stop mus_amasian
670}
671
672func void pipe3b(void)
673{
674 if (inside_final_cutscene eq 0)
675 {
676 dprint pipe_recharged
677 particle pipe3 create
678 particle pipe3 do start
679 console_reset 15
680 }
681}
682
683func void final_cutscene_trumps_particles(void)
684{
685 inside_final_cutscene = 1;
686 particle pipe3 kill
687}
688
689### Level scripted by Joseph ###
Note: See TracBrowser for help on using the repository browser.