source: nikanabo/current/bsl/original/IGMD/EnvWarehouse/warehouse_train2.bsl@ 853

Last change on this file since 853 was 185, checked in by geyser, 17 years ago
File size: 19.8 KB
RevLine 
[185]1func void cheater(void)
2{
3 invincible=1
4 omnipotent=1
5 lock_keys keys_all
6 chr_teleport 0 7023
7}
8###################################
9# variables used in train2 scipts #
10###################################
11
12#used to see if PPK combo was successful
13var int combo_did;
14
15#used to determine when to activate or deactivate blocking drone, current script comments out the usefulness of this variable
16var int count_block;
17
18#determines if reload in ballistics or cell
19var int reload=0;
20
21#makes sure reloading cells doesn't play before player has even picked up the rifle
22var int droid_active;
23
24#sees if you already reloaded ballistics ammo before the system had a chance to prompt you to do so
25var int already_reloaded;
26
27#sees if you already reloaded cell ammo before system prompted you to do so.
28var int already_reloaded2;
29
30#counts number of reload prompts necessary, if you reloaded more than one time, you lose rating points
31var int had_to_reload;
32
33#determines when inside the target shooting function
34var int inside_target_function;
35
36#determines when inside ammo reload function
37var int inside_ammo_function = 0;
38
39#determines when not to display block droid message
40var int block_off;
41
42################################
43# fight training scripts below #
44################################
45
46#########################
47# punch and kick script #
48#########################
49func void train_fighting(string ai_name)
50{
51 how_far_along = 4;
52 music_stop
53 particle obj3 kill
54 particle obj4 kill
55 trig_deactivate 1
56 trig_deactivate 2
57 trig_deactivate 3
58 message_remove c01_50_23
59 message_remove jump_encourage
60 message_remove jump_encourage2
61 sleep 60
62 sound_dialog_play_interrupt c00_01_64shinatama
63 message_remove
64 message begin_fight 240
65 sleep 240
66# PUNCH-KICK
67 lock_keys keys_attack
68 message xpunch
69 chr_wait_animtype 0 punch
70 sleep 60
71 message_remove xpunch
72 sleep 60
73 message xkick
74 chr_wait_animtype 0 kick
75 sleep 60
76 message_remove xkick
77 sleep 60
78
79 if (how_far_along eq 4)
80 {
81 #throw two punches
82 sound_dialog_play_block c00_01_65shinatama
83 message punch
84 chr_wait_animtype 0 punch2
85 message_remove punch
86 sleep 60
87 message c01_50_27 180
88 sound_dialog_play_interrupt c00_01_66shinatama
89 sound_dialog_play_block pause
90 sleep 40
91 }
92
93 if (how_far_along eq 4)
94 {
95# more combo
96 sound_dialog_play_block c00_01_67shinatama
97 sound_dialog_play_block pause
98 sleep 60
99 }
100
101 if (how_far_along eq 4)
102 {
103# FIRST COMBO
104 message c01_50_29
105 fork combo_wait
106 chr_wait_animtype 0 ppk
107 combo_did = 1;
108 sleep 60
109 message_remove c01_50_29
110 message_remove c01_50_29b
111 sleep 60
112 sound_dialog_play_interrupt c00_01_07shinatama
113 message xppk 180
114 sleep 180
115 }
116 if(combo_did eq 1)
117 {
118 if (how_far_along eq 4)
119 {
120# try linking for more combos
121 sound_dialog_play_block c00_01_69shinatama
122 sound_dialog_play_block pause
123 sleep 240
124 }
125
126 if (how_far_along eq 4)
127 {
128# you're now ready to train with a sparring partner
129 sound_dialog_play_block c00_01_70shinatama
130 sound_dialog_play_block pause
131 sleep 30
132 }
133 if (how_far_along eq 4)
134 {
135# proceed to the next room
136 sound_dialog_play_block c00_01_71shinatama
137 message xspar2
138 ai2_spawn dum_hit_flash
139 chr_lock_active dum_hit_flash
140 chr_death_lock dum_hit_flash 1
141 door_unlock 99
142 particle door2_locklight02 do start
143 }
144 }
145}
146
147func void combo_wait(string ai_name)
148{
149 sleep 600
150 if (combo_did eq 0)
151 {
152 dprint rating
153 rating = rating + 1
154 rating
155 message_remove c01_50_29
156 sound_dialog_play_block c00_01_68shinatama
157 sleep 60
158 }
159 if (combo_did eq 0)
160 {
161 message c01_50_29b 240
162 sleep 240
163 }
164 if (combo_did eq 0)
165 {
166 message c01_50_29
167 }
168
169# if(combo_did eq 0)
170# {
171# if (how_far_along eq 4)
172# {
173# try linking for more combos
174# sound_dialog_play_block c00_01_69shinatama
175# sound_dialog_play_block pause
176# sleep 240
177# }
178#
179# if (how_far_along eq 4)
180# {
181# you're now ready to train with a sparring partner
182# sound_dialog_play_block c00_01_70shinatama
183# sound_dialog_play_block pause
184# sleep 30
185# }
186# if (how_far_along eq 4)
187# {
188# proceed to the next room
189# sound_dialog_play_block c00_01_71shinatama
190# message xspar2
191# ai2_spawn dum_hit_flash
192# chr_lock_active dum_hit_flash
193# chr_death_lock dum_hit_flash 1
194# door_unlock 99
195# particle door2_locklight02 do start
196# }
197# }
198}
199
200##################################
201# train player about hit flashes #
202##################################
203func void train_hit_flash(string ai_name)
204{
205 particle steam stop
206 music_train2
207 how_far_along = 6;
208 message_remove xspar2
209 sleep 60
210# try hitting this dummy
211 sound_dialog_play_block c00_01_77shinatama
212 message start_hit
213 ai2_makeignoreplayer dum_hit_flash 1
214}
215
216func void hurt_dummy1(string ai_name)
217{
218 message_remove start_hit
219 sleep 60
220 door_lock 99
221 particle door2_locklight02 do stop
222# dynamic hit flashes
223 message c01_50_35 300
224 sleep 240
225 ai2_dopath dum_hit_flash patrol_dum_hit_flash
226 ai2_setjobstate dum_hit_flash
227 sleep 60
228# more dynamic hit flashes blue
229 message blueflash 300
230 sleep 240
231 ai2_dopath dum_hit_flash patrol_dum_hit_flash
232 ai2_setjobstate dum_hit_flash
233 sleep 60
234 message c01_50_37 300
235 sleep 240
236 ai2_dopath dum_hit_flash patrol_dum_hit_flash
237 ai2_setjobstate dum_hit_flash
238 sleep 60
239# more dynamic hit flashes
240 message c01_50_38 300
241 sleep 240
242 ai2_dopath dum_hit_flash patrol_dum_hit_flash
243 ai2_setjobstate dum_hit_flash
244# move on to the next room to learn how to perform the most dangerous attacks.
245 sleep 60
246 sound_dialog_play_block c00_01_78shinatama
247 message goto_throw
248 sleep 60
249 door_unlock 100
250 particle door3_locklight02 do start
251 ai2_spawn dum_train_throw
252 chr_lock_active dum_train_throw
253 chr_death_lock dum_train_throw 1
254 ai2_makeignoreplayer dum_train_throw 1
255}
256
257###################################
258# train player to throw opponents #
259###################################
260func void lockthrow(void)
261{
262 door_lock 100
263 particle door3_locklight02 do stop
264}
265
266func void train_throw(string ai_name)
267{
268 how_far_along = 7;
269 message_remove goto_throw
270 sleep 60
271 if (how_far_along eq 7)
272 {
273# FIRST THROW
274 sound_dialog_play_block c00_01_79shinatama
275 message c01_50_41
276 chr_wait_animtype 0 throw_forward_punch throw_forward_kick run_throw_forward_punch run_throw_forward_kick
277 message_remove c01_50_41
278 sleep 60
279 }
280
281 if (how_far_along eq 7)
282 {
283# more throws
284 sound_dialog_play_block c00_01_80shinatama
285 ai2_dopath dum_train_throw patrol_train_throw2
286 ai2_setjobstate dum_train_throw
287 sleep 180
288 ai2_dopath dum_train_throw patrol_train_throw2
289 ai2_setjobstate dum_train_throw
290 sleep 180
291 message xthrow1 360
292 ai2_dopath dum_train_throw patrol_train_throw2
293 ai2_setjobstate dum_train_throw
294 sleep 180
295 ai2_dopath dum_train_throw patrol_train_throw2
296 ai2_setjobstate dum_train_throw
297 sleep 180
298 ai2_dopath dum_train_throw patrol_train_throw2
299 ai2_setjobstate dum_train_throw
300 sleep 180
301 message xthrow2 360
302 ai2_dopath dum_train_throw patrol_train_throw2
303 ai2_setjobstate dum_train_throw
304 sleep 180
305 ai2_dopath dum_train_throw patrol_train_throw2
306 ai2_setjobstate dum_train_throw
307 sleep 180
308 ai2_dopath dum_train_throw patrol_train_throw2
309 ai2_setjobstate dum_train_throw
310 sleep 180
311 ai2_dopath dum_train_throw patrol_train_throw2
312 ai2_setjobstate dum_train_throw
313 }
314
315 if (how_far_along eq 7)
316 {
317# Proceed to the next room and try blocking the training dummy'sleep 240 attacks.
318 message goto_block
319 sleep 60
320 door_unlock 101
321 particle door4_locklight02 do start
322 particle door4b_locklight02 do start
323 ai2_spawn dum_train_block
324 ai2_makeignoreplayer dum_train_block 1
325 chr_invincible char_0 1
326 }
327
328}
329
330###############################
331# train player to block blows #
332###############################
333func void train_block(string ai_name)
334{
335#introduce blocking
336 how_far_along = 5;
337 message_remove goto_block
338# dummy attack
339 sound_dialog_play_block c00_01_72shinatama
340 sound_dialog_play_block pause
341 sound_dialog_play_block c00_01_73shinatama
342 if(count_block eq 0)
343 {
344 message c01_50_33
345 }
346}
347
348func void train_block2(string ai_name)
349{
350 ai2_makeignoreplayer dum_train_block 0
351 ai2_dopath dum_train_block patrol_56b
352 ai2_setjobstate dum_train_block
353 message_remove c01_50_33
354 if(count_block eq 0)
355 {
356 count_block = 1
357 door_lock 101
358 door_close 101
359 particle door4_locklight02 do stop
360 chr_delete dum_train_throw
361 chr_delete dum_hit_flash
362 chr_delete demo1
363 chr_delete demo2
364 chr_delete demo3
365 if (how_far_along eq 5)
366 {
367# more blocking
368 sleep 60
369 message c01_50_32 300
370 sound_dialog_play_block c00_01_74shinatama
371 sound_dialog_play_pause
372 sleep 30
373 sound_dialog_play_block c00_01_75shinatama
374 message xblocking2 300
375 sound_dialog_play_pause
376 sleep 30
377 sound_dialog_play_block c00_01_76shinatama
378 }
379 sleep 120
380 # message_remove xdronedeactive
381 ai2_makeignoreplayer dum_train_block 1
382 ai2_dopath dum_train_block patrol_56b
383 ai2_setjobstate dum_train_block
384 sound_dialog_play_block c00_01_83shinatama
385 sound_dialog_play_block pause
386 door_unlock 102
387 particle door5_locklight02 do start
388 message goto_shoot
389 chr_inv_reset 0
390 music_stop
391 sleep 60
392 dprint spawn_shoot
393 ai2_spawn dum_train_shoot
394 ai2_spawn dum_train_shoot2
395 ai2_passive dum_train_shoot 1
396 ai2_passive dum_train_shoot2 1
397 chr_invincible dum_train_shoot 1
398 chr_invincible dum_train_shoot2 1
399 chr_invincible char_0 0
400 console_deactivate 12
401 trigvolume_enable tv75 0
402 trigvolume_enable tv74 0
403 }
404}
405
406func void disable_tv46(void)
407{
408 message_remove c01_50_33
409 trigvolume_enable trigger_volume_46 0
410}
411
412##################################
413# put drones back on their spots #
414##################################
415func void flash_path(string ai_name)
416{
417 sleep 90
418 ai2_dopath dum_hit_flash patrol_dum_hit_flash
419}
420
421func void throw_path(string ai_name)
422{
423 sleep 90
424 ai2_dopath dum_train_throw patrol_train_throw2
425}
426
427func void block_path(string ai_name)
428{
429 if(block_off eq 0)
430 {
431 block_off = 1;
432 message xdronedeactive 180
433 }
434 ai2_makeignoreplayer dum_train_block 1
435 ai2_dopath dum_train_block patrol_56
436 sleep 180
437 block_off = 0;
438}
439
440func void block_path2(string ai_name)
441{
442
443 ai2_makeignoreplayer dum_train_block 1
444 ai2_dopath dum_train_block patrol_56
445}
446######################################################
447# regenerate first two training dummies as necessary #
448######################################################
449
450func void regen1(string ai_name)
451{
452 dprint regen1
453 message_remove blueflash
454 message_remove c01_50_37
455 message_remove c01_50_38
456 sleep 60
457 message xregen1 180
458 sleep 180
459 chr_set_health dum_hit_flash 50
460 ai2_dopath dum_hit_flash patrol_dum_hit_flash
461 ai2_setjobstate dum_hit_flash
462}
463
464func void regen2(string ai_name)
465{
466 dprint regen2
467 sleep 60
468 message xregen1 180
469 sleep 180
470 chr_set_health dum_train_throw 50
471 ai2_dopath dum_hit_flash patrol_train_throw2
472 ai2_setjobstate dum_train_throw
473}
474
475#########################
476# train player to shoot #
477#########################
478func void train_shoot(string ai_name)
479{
480# message_remove xdroneactive
481 message_remove xdronedeactive
482 particle g_tap1 create
483 sleep 7
484 weapon_spawn w1_tap 7042
485 wp_disable_fade=1
486 how_far_along = 8;
487 message_remove goto_shoot
488 sleep 60
489 ai2_dopath dum_train_throw patrol_train_throw
490 ai2_setjobstate dum_train_throw
491
492 if (how_far_along eq 8)
493 {
494 lock_keys keys_inventory
495 lock_keys keys_reload
496# approach weapons
497 sound_dialog_play_block c00_01_84shinatama
498 sound_dialog_play_pause
499 chr_wait_animtype char_0 Pickup_Pistol Pickup_Pistol_Mid
500 door_lock 102
501 particle door5_locklight02 do stop
502 trigvolume_enable tv75 1
503 trigvolume_enable tv74 1
504 ui_show_element left 1
505 sleep 60
506 message c01_50_54
507# hit targets
508 sound_dialog_play_block c00_01_85shinatama
509 chr_wait_animtype char_0 Autopistol_Recoil
510 sleep 120
511 message_remove c01_50_54
512 sleep 60
513 message c01_50_53 300
514 sleep 300
515 }
516}
517
518func void enter_ammo_function(void)
519{
520 dprint enter_ammo_function
521 inside_ammo_function = 1;
522}
523
524func void exit_ammo_function(void)
525{
526 dprint exit_ammo_function
527 inside_ammo_function = 0;
528}
529
530func void need_ammo(string ai_name)
531{
532 trigvolume_enable tv74 0
533
534 sleep 67
535 var int empty_weapon = chr_has_empty_weapon(char_0);
536
537 dprint trying_ammo_function
538
539 if (inside_ammo_function eq 0)
540 {
541 dprint doing_ammo_function
542 enter_ammo_function();
543
544 if(empty_weapon eq 1)
545 {
546 sleep 15
547 if(reload eq 0)
548 {
549 message_remove xkeepshoot
550 already_reloaded = 0;
551 sound_dialog_play_block c00_01_87shinatama
552 message c01_50_61
553 # generate powerup
554 particle g_tap1 create
555 sleep 7
556 powerup_spawn ammo 7042
557 particle g_tap2 create
558 sleep 7
559 powerup_spawn ammo 7043
560 chr_wait_animtype char_0 Pickup_Object_Mid Pickup_Object
561 fork remove_reload_message
562 # sleep 60
563 message_remove c01_50_61
564 sleep 90
565 if(already_reloaded eq 0)
566 {
567 message xreload
568 chr_wait_animtype char_0 reload_pistol
569 increase_rating()
570 message_remove xreload
571 sleep 90
572 }
573 message xkeepshoot
574 }
575 if(reload eq 1)
576 {
577 if(droid_active eq 1)
578 {
579 message c01_50_62
580 # generate powerup
581 particle g_phr1 create
582 sleep 7
583 powerup_spawn cell 7044
584 particle g_phr2 create
585 sleep 7
586 powerup_spawn cell 7045
587 chr_wait_animtype char_0 Pickup_Object_Mid Pickup_Object
588 # sleep 60
589 message_remove c01_50_62
590 fork remove_reload_message2
591 if(already_reloaded2 eq 0)
592 {
593 sleep 90
594 message xreload
595 chr_wait_animtype char_0 reload_rifle
596 dprint rating
597 increase_rating()
598 message_remove xreload
599 }
600 }
601 }
602 }
603
604 exit_ammo_function();
605 }
606
607 sleep 60
608 trigvolume_enable tv74 1
609}
610
611func void increase_rating(void)
612{
613 dprint rating
614 if(had_to_reload ne 0)
615 {
616
617 rating = rating + 1;
618 }
619 had_to_reload = had_to_reload + 1;
620}
621
622func void remove_reload_message(void)
623{
624 chr_wait_animtype char_0 reload_pistol
625 already_reloaded = 1;
626}
627
628func void remove_reload_message2(void)
629{
630 chr_wait_animtype char_0 reload_rifle
631 already_reloaded2 = 1;
632}
633
634func void enter_target_function(void)
635{
636 dprint enter_target_function
637 inside_target_function = 1;
638}
639
640func void exit_target_function(void)
641{
642 dprint exit_target_function
643 inside_target_function = 0;
644}
645
646func void targets_are_gone(void)
647{
648 reload=1;
649 message_remove xkeepshoot
650 trigvolume_enable tv75 0
651 sleep 7
652 particle g_phr1 create
653 sleep7
654 weapon_spawn w3_phr 7045
655 sound_dialog_play_block c00_01_86shinatama
656 sound_dialog_play_block pause
657 message_remove
658 #plasma, switch weapons
659 sound_dialog_play_block c00_01_88shinatama
660 chr_wait_animtype char_0 Pickup_Rifle Pickup_Rifle_Mid
661 droid_active = 1;
662 sleep 30
663 #activate drone, hit it
664 chr_invincible dum_train_shoot 0
665 ai2_passive dum_train_shoot 0
666 sound_dialog_play_block c00_01_89shinatama
667 ai2_dopath dum_train_shoot patrol_train_shoot
668 ai2_setjobstate dum_train_shoot
669}
670
671func void targets_are_not_gone(void)
672{
673 # CB: turn off the trigger volume and sleep for a second
674 # so as not to cause hideous performance loss
675 trigvolume_enable tv75 0
676 sleep 60
677 trigvolume_enable tv75 1
678}
679
680func void targets_gone(string ai_name)
681{
682 if(inside_target_function eq 0)
683 {
684 enter_target_function()
685
686 var int num_broken = env_broken(3001, 3018);
687
688 if (num_broken eq 18)
689 {
690 targets_are_gone();
691 }
692
693 if (num_broken < 18)
694 {
695 targets_are_not_gone();
696 }
697
698 exit_target_function
699 }
700}
701
702func void droid1_gone(string ai_name)
703{
704 if (how_far_along eq 8)
705 {
706 chr_invincible dum_train_shoot2 0
707# now side to side
708 sound_dialog_play_block c00_01_90shinatama
709 sound_dialog_play_block pause
710 sleep 30
711 ai2_passive dum_train_shoot2 0
712 ai2_dopath dum_train_shoot2 patrol_train_shoot2
713 ai2_setjobstate dum_train_shoot2
714 }
715}
716
717func void droid2_gone(string ai_name)
718{
719 if (how_far_along eq 8)
720 {
721 reload = 2;
722 droid_active = 0;
723 message_remove
724 cinematic_start (SHINnametag, 180, 180, 15, 1, 20, false)
725# great, done training
726 chr_changeteam char_0 Syndicate
727 music_train3
728 if(rating eq 0)
729 {
730 message poopy
731
732 }
733 if(rating eq 1)
734 {
735 message poopy2
736
737 }
738 if(rating eq 2)
739 {
740 message poopy3
741
742 }
743 if(rating eq 3)
744 {
745 message poopy4
746
747 }
748 if(rating eq 4)
749 {
750 message poopy5
751
752 }
753 if(rating eq 5)
754 {
755 message poopy6
756
757 }
758 if(rating > 5)
759 {
760 message poopy7
761
762 }
763 sound_dialog_play_block c00_01_91shinatama
764 sound_dialog_play_block pause
765 sleep 40
766 sound_dialog_play_block c00_01_81shinatama
767 sound_dialog_play_block pause
768 message_remove
769 sleep 40
770 sound_dialog_play_block c00_01_82shinatama
771 sound_dialog_play_block pause
772 cinematic_stop (SHINnametag, 15, 20)
773 message xf1 400
774 sleep 400
775 message xlastreview
776 particle obj_lastreview create
777 console_activate 12
778 wp_disable_fade=0
779 }
780}
781
782func void lastreview(string ai_name)
783{
784 music_stop
785 particle obj_lastreview kill
786 message_remove
787 message_remove xlastreview
788 text_console level_1f
789 lock_keys keys_all
790 sleep 60
791 dprint swing
792 swing
793 ui_suppress_prompt=0
794}
795
796######################################
797# training scripts used in warehouse #
798######################################
799# note: health function 'yhealth' is in the level_script file #
800
801func void train_fathealth(string ai_name)
802{
803 chr_wait_animtype char_0 Pickup_Object
804 if(trigvolume_count (80) eq 1)
805 {
806 sleep 90
807 message xtabhypo 300
808 sound_dialog_play_block c00_01_93shinatama
809 sound_dialog_play_block pause
810 sleep 40
811 sound_dialog_play_block c00_01_94shinatama
812 }
813}
814
815func void intro_enemies(string ai_name)
816{
817 dprint intro_enemies
818 how_far_along = 11;
819
820 music_firstfight
821
822 if (how_far_along eq 11)
823 {
824 ai2_spawn Bay2_Thug_1
825 ai2_spawn Bay2_Thug_2
826 }
827
828 if (how_far_along eq 11)
829 {
830# enemies
831 message c01_50_84 240
832 sleep 360
833 }
834}
835
836func void train_alarm(string ai_name)
837{
838 how_far_along = 13;
839
840 if (how_far_along eq 13)
841 {
842 ai2_spawn Bay4_Comguy_1
843# alarm
844 sleep 180
845 message c01_50_88 240
846 sleep 240
847 }
848
849 if (how_far_along eq 13)
850 {
851# alarm
852 message c01_50_89 240
853 sleep 240
854 }
855
856# if (how_far_along eq 13)
857# {
858# alarm
859# message c01_50_90 240
860# sleep 240
861# }
862}
863
864func void train_neutral(string ai_name)
865{
866 how_far_along = 14;
867 target_set(92,15.0)
868 if (how_far_along eq 14)
869 {
870# neutrals
871 message c01_50_91 240
872 sleep 240
873 sound_dialog_play_block c00_01_97shinatama
874 }
875}
876
877func void train_timer(string ai_name)
878{
879 how_far_along = 15;
880
881 if(how_far_along eq 15)
882 {
883 target_set(96,15.0)
884 timer_start 180 OutroLose
885 sound_dialog_play_block c00_01_95shinatama
886 sleep 180
887 objective_set(4)
888 sound_dialog_play_block pause
889 music_timer
890 }
891
892 if (how_far_along eq 15)
893 {
894 sleep 60
895 message timer_text 300
896 sleep 360
897 message timer_text2 240
898 }
899}
900
901############################
902# warn about alarm console #
903############################
904func void alarm_warning(string ai_name)
905{
906 if(count_alarm eq 0)
907 {
908 message alarm_warn 300
909 }
910 count_alarm = 1;
911}
912
913func void alarm_warningb(string ai_name)
914{
915 count_alarm = 0;
916}
917
918#############################
919# consoles and compass hint #
920#############################
921func void console_jump(string ai_name)
922{
923 text_console level_1g
924 console_reset 18
925}
926
927func void console_escape(string ai_name)
928{
929 text_console level_1h
930 console_reset 17
931}
932
933func void console_attack(string ai_name)
934{
935 text_console level_1i
936 console_reset 16
937}
938
939func void console_flash(string ai_name)
940{
941 text_console level_1j
942 console_reset 15
943}
944
945func void console_throw(string ai_name)
946{
947 text_console level_1k
948 console_reset 14
949}
950
951func void console_block(string ai_name)
952{
953 text_console level_1l
954 console_reset 13
955}
956
957func void t77(string ai_name)
958{
959 message xarrow 400
960}
Note: See TracBrowser for help on using the repository browser.