source: nikanabo/current/bsl/onilight/IGMD/power/power.bsl@ 828

Last change on this file since 828 was 185, checked in by geyser, 18 years ago
File size: 13.2 KB
Line 
1#################
2### VARIABLES ###
3#################
4
5var int var_counter = 0;
6var int var_counter2 = 0;
7var int var_counter3 = 0;
8
9############
10### MAIN ###
11############
12
13func void main(void)
14{
15gl_fog_red = 0
16gl_fog_blue = 0
17gl_fog_green = 0
18gl_fog_start = .995
19gs_farclipplane_set 5000
20ui_suppress_prompt = 1
21chr_auto_aim_dist = 0
22start
23}
24
25#############
26### START ###
27#############
28
29func void start(string ai_name)
30{
31fork deactivate_stuff
32if(save_point eq 0) save_point = 1
33if(save_point eq 1) fork intro
34if(save_point eq 2) restore_game
35if(save_point eq 3) fork load_s3
36if(save_point eq 4) restore_game
37if(save_point eq 5) fork load_s5
38sleep 5
39fork sp_all
40}
41
42func void deactivate_stuff(void)
43{
44#not used
45trigvolume_enable trigger_volume_08_copy 0
46trigvolume_enable trigger_volume_09 0
47trigvolume_enable trigger_volume_10_copy 0
48trigvolume_enable trigger_volume_10_copy_copy 0
49trigvolume_enable trigger_volume_11_copy 0
50trigvolume_enable trigger_volume_11_copy_copy 0
51trigvolume_enable trigger_volume_14 0
52#used
53env_show 802 0
54env_show 822 0
55particle power1 do start
56particle power2 do start
57trigvolume_enable trigger_volume_02 0
58trigvolume_enable trigger_volume_06 0
59trigvolume_enable trigger_volume_12 0
60trigvolume_enable trigger_volume_13 0
61trigvolume_enable trigger_volume_40 0
62}
63
64func void you_lose(string ai_name)
65{
66fade_out 0 0 0 30
67sleep 30
68lose
69}
70
71####################################
72### SEVERAL TIMES USED FUNCTIONS ###
73####################################
74
75func void sp_all(void)
76{
77co_message_display = 0
78if(save_point eq 1) save_game 1 autosave
79if(save_point eq 2) save_game 2 autosave
80if(save_point eq 3) save_game 3 autosave
81if(save_point eq 4) save_game 4 autosave
82if(save_point eq 5) save_game 5 autosave
83sleep 180
84co_message_display = 1
85}
86
87func void remove_ai(void)
88{
89ai2_kill
90sleep 60
91powerup_reset
92weapon_reset
93sleep 240
94corpse_reset
95}
96
97func void music_stop(void)
98{
99sound_music_stop mus_main01
100sound_music_stop mus_sad1
101sound_music_stop mus_space01
102sound_music_stop mus_asian
103sound_music_stop mus_fiteb
104}
105
106##########
107### SP1 ###
108##########
109
110func void intro(void)
111{
112playback 0 IntroKonokoSet01
113ai2_spawn A1_intro01
114ai2_spawn A1_intro02
115ai2_spawn A1_bluedoorstriker
116objective_set 1 silent
117target_set 5007 30
118sleep 1
119sound_music_start mus_main01 .75
120}
121
122#lose func of A1_intro01 and A1_intro02
123func void die_for_art(string ai_name)
124{
125var_counter = var_counter + 1
126if(var_counter eq 2) music_stop
127}
128
129#console1
130func void target02(string ai_name)
131{
132particle blue_locklight01 do start
133particle b2_locklight01 do start
134target_set 2001 30
135trigvolume_enable trigger_volume_12 1
136music_stop
137}
138
139#tv12 - in front of door 30
140func void target03(string ai_name)
141{
142ai2_spawn A1_s_red01
143ai2_spawn A1_s_red02
144target_set 5007 30
145}
146
147#called up, when A1_s_red02 gives you the hypo
148func void change_patrol(string ai_name)
149{
150ai2_dopath A1_s_red02 patrol_45
151ai2_setjobstate A1_s_red02
152}
153
154#tv4 - in front of door 31
155func void tv04(string ai_name)
156{
157ai2_spawn A2_s_tank01
158ai2_spawn A2_s_blue13
159ai2_spawn A2_s_blue01
160ai2_spawn A2_s_blue03
161ai2_spawn A2_s_red03
162ai2_spawn char_1
163ai2_spawn A2_s_tank02
164}
165
166#tv3 - in front of door 33
167func void tv03(string ai_name)
168{
169ai2_spawn A2_s_blue09
170}
171
172#tv34 - at the beginning of the first pillar, which is nearby to the room with console3
173func void tv34(string ai_name)
174{
175ai2_spawn A2_s_red04
176}
177
178#console3
179func void ontv02(string ai_name)
180{
181trigvolume_enable trigger_volume_02 1
182particle el_red1 kill
183particle el_1_locklight01 do start
184target_set 108 30
185}
186
187#called up, when A2_s_red04 gives you the w4_psm
188func void spawn_sniper1(string ai_name)
189{
190ai2_spawn sniper1
191ai2_makeignoreplayer sniper1 1
192playback_block sniper1 sniper1_jump
193ai2_makeignoreplayer sniper1 0
194ai2_dopath sniper1 patrol_52
195ai2_setjobstate sniper1
196sleep 600
197ai2_makeignoreplayer sniper1 1
198ai2_dopath sniper1 patrol_53
199ai2_setjobstate sniper1
200}
201
202#hit func of sniper1
203func void hurt_sniper1(string ai_name)
204{
205ai2_makeignoreplayer sniper1 1
206ai2_dopath sniper1 patrol_53
207ai2_setjobstate sniper1
208}
209
210#in some distance after the room with console3, in front of the elevator
211func void tv33(string ai_name)
212{
213ai2_makeignoreplayer A2_s_red04 1
214ai2_dopath A2_s_red04 patrol_54
215ai2_setjobstate A2_s_red04
216}
217
218#tv2 - flat box on the elevator platform
219func void tv02(string ai_name)
220{
221fade_out 0 0 0 30
222sleep 30
223fork remove_ai
224obj_kill 801
225playback 0 Elev1KonokoSet
226load_s2
227fade_in 30
228var_counter = 0
229}
230
231func void load_s2(void)
232{
233env_show 802 1
234ai2_spawn B1_s_blue05
235ai2_spawn B1_s_green01
236ai2_spawn new_dummy1
237ai2_spawn C1_blue22
238ai2_spawn C2_blue25
239ai2_dopath B1_s_blue05 patrol_08_blue05b
240ai2_setjobstate B1_s_blue05
241chr_teleport B1_s_blue05 1046
242objective_set 1 silent
243target_set 1083 30
244sleep 1
245sound_music_start mus_sad1 0.3
246sound_music_volume mus_sad1 0.8 2
247}
248
249##########
250### SP2 ###
251##########
252
253#tv35 - after the elevator platform
254func void s2(string ai_name)
255{
256if(save_point eq 2)
257 {
258 fork remove_ai
259 load_s2
260 }
261else save_game 2 autosave
262}
263
264#console12
265func void target06(string ai_name)
266{
267particle green_locklight01 do start
268target_set 2005 30
269trigvolume_enable trigger_volume_13 1
270}
271
272#tv13 - in front of door 34
273func void target05(string ai_name)
274{
275ai2_spawn B1_s_Red01
276target_set 133 30
277music_stop
278}
279
280#tv1 - in front of door 35
281func void tv01(string ai_name)
282{
283ai2_spawn whiteneut
284ai2_spawn C1_blue22
285ai2_spawn B2_s_blue06
286ai2_spawn B2_s_blue07
287ai2_spawn B2_s_blue08
288ai2_spawn B2_s_tank04
289}
290
291#console4
292func void target08(string ai_name)
293{
294particle white_locklight01 do start
295target_set 3001 30
296}
297
298#tv14 - in front of door 36 (the same func as tv13, so I've disabled it)
299
300#tv5 - in front of door 37
301func void tv05(string ai_name)
302{
303ai2_spawn B3_s_green02
304ai2_spawn C1_blue20
305}
306
307#tv15 - at the end of the both ways after door 37
308func void target10(string ai_name)
309{
310target_set 5008 30
311}
312
313#tv16 - at the end of the passageway to the other side
314func void target11(string ai_name)
315{
316target_set 5009 30
317}
318
319#tv42 - huge box around the complete ways to the 2nd elevator (only used as a chara counter, see next funcs)
320
321#lose func of C2_blue25 and respawn1
322func void script_respawn1(void)
323{
324if(trigvolume_count(42) eq 0)
325 {
326 var_counter2 = var_counter2 + 1
327 if(var_counter2 eq 1)
328 {
329 ai2_spawn respawn1
330 chr_giveweapon respawn1 w7_scc
331 }
332 if(var_counter2 eq 2)
333 {
334 ai2_spawn respawn1
335 chr_giveweapon respawn1 w3_phr
336 ai2_dopath patrol_08_blue05
337 ai2_setjobstate respawn1
338 }
339 if(var_counter2 eq 3)
340 {
341 ai2_spawn respawn1
342 chr_giveweapon respawn1 w2_sap
343 }
344 }
345}
346
347#lose func of C1_blue20 and respawn2
348func void script_respawn2(void)
349{
350if(trigvolume_count(42) eq 0)
351 {
352 var_counter3 = var_counter3 + 1
353 if(var_counter3 eq 1)
354 {
355 ai2_spawn respawn2
356 chr_giveweapon respawn2 w3_phr
357 }
358 if(var_counter3 eq 2)
359 {
360 ai2_spawn respawn2
361 chr_giveweapon respawn2 w2_sap
362 ai2_dopath patrol_19_blue20b
363 ai2_setjobstate respawn2
364 }
365 if(var_counter3 eq 3)
366 {
367 ai2_spawn respawn2
368 chr_giveweapon respawn2 w2_sap
369 }
370 }
371}
372
373#lose func of C1_blue22
374func void script_respawn3(void)
375{
376if(trigvolume_count(42) eq 0) ai2_spawn C1_red21
377}
378
379#tv37 - box around the place, where you find the 2nd mercury bow
380func void t37(string ai_name)
381{
382ai2_spawn new_1
383ai2_spawn new_2
384}
385
386#tv38 - about in the middle
387func void t38(string ai_name)
388{
389ai2_spawn new_3
390ai2_spawn new_4
391}
392
393#console6
394func void ontv06(string ai_name)
395{
396trigvolume_enable trigger_volume_06 1
397particle el_2_locklight01 do start
398target_set 119 30
399}
400
401##########
402### SP3 ###
403##########
404
405#tv6 - flat box on the elevator platform
406func void tv06(string ai_name)
407{
408fade_out 0 0 0 30
409sleep 30
410fork remove_ai
411load_s3
412chr_teleport 0 120
413chr_facetoflag 0 120
414fade_in 30
415if(save_point ne 3) save_game 3 autosave
416}
417
418func void load_s3(void)
419{
420if(save_point eq 3)
421 {
422 fork remove_ai
423 restore_game
424 }
425obj_kill 821
426env_show 822 1
427ai2_spawn D1_neut05
428objective_set 2 silent
429target_set 128 30
430sleep 1
431sound_music_start mus_space01 0.75
432}
433
434#console7
435func void target14(string ai_name)
436{
437particle red_locklight01 do start
438target_set 2085 30
439}
440
441#tv20 - in front of door 38
442func void tv25(string ai_name)
443{
444ai2_spawn D1_red30
445ai2_spawn D1_neut02
446ai2_spawn D2_blue60
447ai2_spawn D1_neut10
448ai2_spawn new_5
449ai2_spawn D2_blue61
450music_stop
451}
452
453#called up, after you have talked to the guy
454func void power_deactivate(void)
455{
456ai2_doalarm D1_neut02 9
457ai2_dopath D1_neut02 patrol_80
458ai2_setjobstate D1_neut02
459}
460
461#console9
462func void power_lull_1(string ai_name)
463{
464music_stop
465ai2_neutralbehavior D1_neut02 none
466target_set 125 30
467sound_music_start mus_asian .75
468particle power1 do stop
469timer_start 20 power_lull_1b
470}
471
472func void power_lull_1b(void)
473{
474music_stop
475particle power1 do start
476sleep 300
477console_reset 9
478}
479
480#tv17 - at the end of the pipe
481func void target13(string ai_name)
482{
483target_set 128 30
484}
485
486##########
487### SP4 ###
488##########
489
490#tv30 - in front of door 23
491func void s4(string ai_name)
492{
493if(save_point eq 4)
494 {
495 fork remove_ai
496 load_s4
497 }
498else save_game 4 autosave
499}
500
501func void load_s4(void)
502{
503particle red_locklight01 do start
504ai2_spawn D2_blue61
505ai2_spawn D2_blue60
506ai2_spawn new_5
507ai2_spawn D1_neut10
508trigvolume_enable trigger_volume_17 0
509trigvolume_enable trigger_volume_25 0
510trigvolume_enable trigger_volume_30 0
511objective_set 2 silent
512target_set 128 30
513}
514
515#tv39 - box around the place, where D1_neut10 gives you a hypo
516func void t39(string ai_name)
517{
518trigvolume_enable trigger_volume_40 1
519}
520
521#tv40 - in the middle between tv39 and door 22
522func void t40(string ai_name)
523{
524ai2_spawn new_6
525ai2_spawn new_7
526}
527
528#console10
529func void target17(string ai_name)
530{
531particle yellow_locklight01 do start
532target_set 3094 30
533}
534
535#tv41 - in front of door 24
536func void spawn2tube(string ai_name)
537{
538ai2_spawn D2_red62
539ai2_spawn D2_tank63
540ai2_spawn new_8
541ai2_spawn sci_maniac
542}
543
544#console11
545func void power_lull_2(string ai_name)
546{
547sound_music_start mus_asian .75
548particle power2 do stop
549ai2_spawn new_10
550ai2_spawn new_67
551ai2_spawn D3_tank65
552timer_start 20 power_lull_2b
553}
554
555func void power_lull_2b(void)
556{
557music_stop
558particle power2 do start
559sleep 300
560console_reset 11
561}
562
563#tv19 - on the pipe, in some distance in front of the platform with console13
564func void target19(string ai_name)
565{
566target_set 5010 30
567}
568
569### POSSIBILITY 1: YOU RUN TO THE END OF THE PIPE ###
570
571#tv36 - box around the place, where you find the w5_sbg
572func void t36(string ai_name)
573{
574ai2_spawn sbg_1
575ai2_spawn sbg_2
576ai2_spawn sbg_3
577}
578
579### POSSIBILITY 2: YOU JUMP TO THE PLATFORM WITH CONSOLE 13 ###
580
581#tv7 - at the beginning of the staircase
582func void tv07(string ai_name)
583{
584chr_delete new_1
585chr_delete new_2
586chr_delete new_3
587chr_delete new_4
588chr_delete new_5
589chr_delete new_6
590chr_delete new_7
591chr_delete new_8
592chr_delete sci_maniac
593chr_delete D1_blue50
594chr_delete D2_blue60
595chr_delete D2_blue61
596chr_delete D1_neut02
597chr_delete D1_neut05
598chr_delete D1_neut10
599chr_delete D1_red30
600chr_delete D2_red62
601chr_delete D3_red66
602chr_delete D2_tank63
603chr_delete D3_tank65
604ai2_spawn F_friend
605ai2_spawn F_blue73
606ai2_spawn F_blue1
607target_set 5006 30
608}
609
610##########
611### SP5 ###
612##########
613
614#console8
615func void unlock_bwhite(string ai_name)
616{
617if(save_point ne 5) save_game 5 autosave
618particle bwhite_locklight01 do start
619objective_set 3 silent
620}
621
622func void load_s5(void)
623{
624if(save_point eq 5)
625 {
626 fork remove_ai
627 restore_game
628 }
629particle bwhite_locklight01 do start
630door_unlock 4
631ai2_spawn F_blue1
632console_deactivate 8
633trigvolume_enable trigger_volume_07 0
634objective_set 3 silent
635target_set 5006 30
636var_counter = 1
637}
638
639#tv10 - in front of door 3
640func void tv10(string ai_name)
641{
642ai2_spawn F_blue69
643ai2_spawn F_blue2
644}
645
646#tv11 - in front of door 2
647func void tv11(string ai_name)
648{
649ai2_spawn F_tank70
650}
651
652#tv8 - in front of door 1
653func void tv08(string ai_name)
654{
655ai2_spawn end01
656ai2_spawn end02
657ai2_spawn end03
658sleep 60
659ai2_dopath F_tank70 patrol_5004
660ai2_setjobstate F_tank70
661ai2_dopath F_blue69 patrol_5005
662ai2_setjobstate F_blue69
663ai2_dopath F_blue2 patrol_5004
664ai2_setjobstate F_blue2
665ai2_dopath F_blue1 patrol_5006
666ai2_setjobstate F_blue1
667ai2_dopath F_blue73 patrol_5006
668ai2_setjobstate F_blue73
669ai2_attack F_tank70 char_0
670ai2_attack F_blue69 char_0
671ai2_attack F_blue2 char_0
672ai2_attack F_blue1 char_0
673ai2_attack F_blue73 char_0
674sound_music_start mus_fiteb .75
675}
676
677#tv29 - after door 1
678func void tv29(string ai_name)
679{
680sound_music_start mus_fiteb .75
681}
682
683#lose func of end01, end02, end03, F_blue1, F_blue2, F_blue69, F_blue73 and F_tank70
684func check_death(string ai_name)
685{
686var_counter = var_counter + 1
687if(var_counter eq 8)
688 {
689 fade_out 0 0 0 30
690 sleep 30
691 win
692 }
693}
694
695#####################
696### TEXT CONSOLES ###
697#####################
698
699func void console_pipe(void)
700{
701text_console level_9d
702console_reset 13
703}
704
705func void text9a(void)
706{
707text_console level_9a
708console_reset 2
709}
710
711func void text9b(void)
712{
713text_console level_9b
714console_reset 5
715}
716
717func void text9c(void)
718{
719text_console level_9c
720console_reset 14
721}
Note: See TracBrowser for help on using the repository browser.