source: nikanabo/current/bsl/onilight/IGMD/state/state.bsl@ 791

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