-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcity_of_mars_v2_sq_endgame.gsc
1610 lines (1371 loc) · 46.5 KB
/
city_of_mars_v2_sq_endgame.gsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Developed by Ultimateman
Release: 07/22/2022
Part of City Of Mars Mod for Black Ops II Plutonium
*/
#include common_scripts\utility;
#include maps\_utility;
#include maps\_anim;
///////////////////////////////////////
#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\zombies\_zm_utility;
#include maps\mp\gametypes_zm\_hud_util;
#include maps\mp\gametypes_zm\_hud_message;
#include maps\mp\zombies\_zm_weapons;
#include maps\mp\zombies\_zm_net;
#include maps\mp\zombies\_zm_unitrigger;
#include maps\mp\zombies\_zm;
#include maps\mp\gametypes_zm\_spawning;
#include maps\mp\zombies\_load;
#include maps\mp\zombies\_zm_clone;
#include maps\mp\zombies\_zm_ai_basic;
#include maps\mp\animscripts\shared;
#include maps\mp\zombies\_zm_audio;
#include maps\mp\zombies\_zm_zonemgr;
#include maps\mp\zm_alcatraz_travel;
#include maps\mp\gametypes_zm\_zm_gametype;
#include maps\mp\zombies\_zm_equipment;
#include maps\mp\zombies\_zm_perks;
#include maps\mp\_visionset_mgr;
#include maps\mp\zombies\_zm_laststand;
#include maps\mp\gametypes_zm\_hud;
#include maps\mp\zombies\_zm_powerups;
#include maps\mp\zombies\_zm_magicbox;
//MYOWN ABOVE
#include maps\mp\zm_alcatraz_grief_cellblock;
#include maps\mp\zm_alcatraz_weap_quest;
#include maps\mp\zombies\_zm_weap_tomahawk;
#include maps\mp\zombies\_zm_weap_blundersplat;
#include maps\mp\zombies\_zm_magicbox_prison;
#include maps\mp\zm_prison_ffotd;
#include maps\mp\zm_prison_fx;
#include maps\mp\zm_alcatraz_gamemodes;
#include maps\mp\zombies\_zm_stats;
#include maps\mp\gametypes_zm\_spawnlogic;
#include maps\mp\animscripts\traverse\shared;
#include maps\mp\animscripts\utility;
#include maps\mp\_createfx;
#include maps\mp\_music;
#include maps\mp\_busing;
#include maps\mp\_script_gen;
#include maps\mp\gametypes_zm\_globallogic_audio;
#include maps\mp\gametypes_zm\_tweakables;
#include maps\mp\_challenges;
#include maps\mp\gametypes_zm\_weapons;
#include maps\mp\_demo;
#include maps\mp\gametypes_zm\_globallogic_utils;
#include maps\mp\gametypes_zm\_spectating;
#include maps\mp\gametypes_zm\_globallogic_spawn;
#include maps\mp\gametypes_zm\_globallogic_ui;
#include maps\mp\gametypes_zm\_hostmigration;
#include maps\mp\gametypes_zm\_globallogic_score;
#include maps\mp\gametypes_zm\_globallogic;
#include maps\mp\zombies\_zm_ai_faller;
#include maps\mp\zombies\_zm_spawner;
#include maps\mp\zombies\_zm_pers_upgrades_functions;
#include maps\mp\zombies\_zm_pers_upgrades;
#include maps\mp\zombies\_zm_score;
#include maps\mp\animscripts\zm_run;
#include maps\mp\animscripts\zm_death;
#include maps\mp\zombies\_zm_blockers;
#include maps\p\animscripts\zm_shared;
#include maps\mp\animscripts\zm_utility;
#include maps\mp\zombies\_zm_power;
#include maps\mp\zombies\_zm_server_throttle;
#include maps\mp\zombies\_zm_melee_weapon;
#include maps\mp\zombies\_zm_audio_announcer;
#include maps\mp\zombies\_zm_ai_dogs;
#include codescripts\character;
#include maps\mp\zombies\_zm_buildables;
#include maps\mp\zombies\_zm_game_module;
#include maps\mp\zm_transit_buildables;
#include maps\mp\zm_transit;
#include maps\mp\zombies\_zm_magicbox_lock;
#include maps\mp\zombies\_zm_afterlife;
#include maps\mp\zombies\_zm_ai_brutus;
#include maps\mp\zm_alcatraz_craftables;
#include maps\mp\zombies\_zm_craftables;
#include maps\mp\zm_alcatraz_utility;
#include maps\mp\zm_alcatraz_traps;
#include maps\mp\zm_prison;
#include maps\mp\zm_alcatraz_sq;
#include maps\mp\zm_prison_sq_bg;
#include maps\mp\zm_prison_spoon;
#include maps\mp\zm_prison_achievement;
/*=====================================================================================================================================================================*/
#include maps\mp\zm_nuked_perks;
#include maps\mp\zombies\_zm_game_module;
#include maps\mp\animscripts\zm_death;
#include maps\mp\zombies\_zm_perks;
#include maps\mp\zombies\_zm_weapons;
#include maps\mp\zombies\_zm_utility;
#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\zombies\_zm_ffotd;
#include maps\mp\zombies\_zm_utility;
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\zm_nuked;
init()
{
level thread initiate_killer_rocket();
level._effect[ "explosion" ] = loadfx( "explosions/fx_zm_nuked_exp_perk_impact_ext" );
level thread flagger();
//flag_clear( "spawn_zombies" );
precacheshader( "black" );
level.huds_active = 0;
precacheshader( "zombies_rank_5_ded" );
level.transit_fire = "fx_zmb_tranzit_fire_lrg";
level.nuke_fire = "fx_zmb_nuke_fire_md";
level.players_alive = 0;
level thread end_game_button();
setdvar( "g_speed", 196 );
level._endgame_active = false;
//level thread zombies_in_pain_restart();
//level.zombie_ai_limit = 32;
//bullettypetracer only pitch, fix
//level thread skiptoNade();
//test extra gib fxs while shooting zombies
//moved to city_of_mars_v2_main.gsc
//level.callbackactordamage = ::callback_actorr();
}
skiptoNade()
{
level endon( "end_game" );
flag_wait( "initial_blackscreen_passed" );
cur_gun = level.players[ 0 ] getCurrentWeapon();
level.players[0] takeweapon( cur_gun );
level.players[ 0 ] giveweapon( "galil_zm" );
level.players[ 0 ] giveMaxAmmo( "galil_zm" );
wait 10;
//level notify( "callitquits" );
level.someone_used_teleporter = true;
wait 0.05;
wait 50;
level notify( "bunker_melee" );
}
/*
zombies_in_pain_restart()
{
level endon( "end_game" );
flag_wait( "initial_blackscreen_passed" );
while( true )
{
level thread zombies_in_pain();
level waittill( "restart_round" );
}
}
zombies_in_pain()
{
level endon( "end_game" );
level endon( "restart_round" );
wait 7;
//def_health = ::ai_calculate_health( level.round_number );
iprintlnbold( "ZOMBIES HEALTH IS NOW " + def_health );
has_not_gibbed = true;
while( true )
{
specific_zombie = getAIArray( level.zombie_team );
for( i = 0; i < all_zombies.size; i++ )
{
if( specific_zombie[ i ].health < level.zombie_health )
{
specific_zombie[ i ] thread doGibbing();
specific_zombie[ i ].has_not_gibbed = false;
}
wait 0.05;
}
wait 0.05;
}
}
doGibbing()
{
level endon( "end_game" );
self endon( "death" );
while ( true )
{
playfx( level._effect[ "zombie_gib" ], self getTagOrigin( "J_Shoulder_LE" ) );
wait randomfloatrange( 0.05, 0.1 );
playfx( level._effect[ "headshot" ], self gettagorigin( "J_Head" ) );
wait randomfloatrange( 0.1, 0.17 );
playfx( level._effect[ "zombie_guts_explosion" ], self gettagorigin( "J_Shoulder_LE" ) );
playfx( level._effect[ "zombie_gib" ], self gettagorigin( "J_SpineLower" ) );
wait randomintrange( 1, 2 );
}
}
*/
flagger() //important, reset back the crazy viewmodel amplitudes set by the final stand battle in end game
{
level endon("end_game" );
flag_wait( "initial_blackscreen_passed" );
foreach( player in level.players )
{
player setclientdvar( "cg_useColorControl", 0 );
player setclientdvar( "cg_colorscale", "1 1 1" );
player setclientdvar( "cg_colortemp", 6500 );
player setclientdvar( "cg_colorHue", 0 );
player setclientdvar( "cg_colorSaturation", 1 );
player setclientdvar( "r_watersheetingfx_enable", 0 );
player setclientdvar( "r_dof_tweak", 0 );
player setclientdvar( "bg_viewbobAmplitudeDucked", "0.0075, 0.0075" );
player setclientdvar( "bg_viewbobAmplitudeduckedads", "0.0075, 0.0075" );
player setclientdvar( "bg_viewbobAmplituderoll", 1.5 );
player setclientdvar( "bg_viewbobAmplitudestanding", "0.007, 0.007" );
player setclientdvar( "bg_viewbobAmplitudestandingads", "0.007, 0.007" );
player setclientdvar( "bg_weaponbobAmplitudeducked", " 0.045, 0.025" );
player setclientdvar( "bg_weaponbobAmplituderoll", 1.5 );
player setclientdvar( "bg_weaponbobAmplitudeStanding", " 0.055, 0.025" );
player setclientdvar( "bg_weaponbobMax", 8 );
}
}
set_coloring()
{
level endon( "end_game" );
self endon( "disconnect" );
sky_int = 6.2;
wait 3;
for ( i = 0; i < 56; i++ )
{
sky_int += 0.05;
self setclientdvar( "r_sky_intensity_factor0", sky_int );
wait 0.05;
}
if ( sky_int != 9 )
{
self setclientdvar( "r_sky_intensity_factor0", 9 );
}
self thread set_darkening();
wait 0.1;
self_exp = 4.8;
for( i = 0; i < 28; i++ )
{
self_exp += 0.1;
self setclientdvar( "r_exposurevalue", self_exp );
wait 0.08;
}
}
player_is_hit()
{
level endon( "end_game" );
wait 2;
for( s = 0; s < level.players.size; s++ )
{
level.players[ s ] setstance( "prone" );
level.players[ s ] freezecontrols( true );
level.players[ s ] allowSprint( false );
level.players[ s ] setclientdvar( "bg_viewbobAmplitudeDucked", " 0.002, 0.002 " );
level.players[ s ] setclientdvar( "bg_viewbobAmplitudeduckedads", " 1, 0.008 " );
level.players[ s ] setclientdvar( "bg_viewbobAmplituderoll", 20 );
level.players[ s ] setclientdvar( "bg_viewbobAmplitudestanding", " 1, 0.008 " );
level.players[ s ] setclientdvar( "bg_viewbobAmplitudestandingads", " 1, 0.02 " );
level.players[ s ] setclientdvar( "bg_weaponbobAmplitudeducked", " 0.2, 0.02 " );
level.players[ s ] setclientdvar( "bg_weaponbobAmplituderoll", 3 );
level.players[ s ] setclientdvar( "bg_weaponbobAmplitudeStanding", " 0.3, 0.09 " );
level.players[ s ] setclientdvar( "bg_weaponbobMax", 30 );
level.players[ s ] setclientdvar( "com_maxfps", 200 );
}
wait 1;
if( level.players.size == 1 )
{
setdvar( "g_speed", 85 );
player thread solo_game_end_notifier();
}
else if ( level.players.size > 1 )
{
setdvar( "g_speed", 85 );
}
wait 3;
level thread allowmove();
}
mover()
{
level endon( "end_game" );
while( true )
{
self MoveZ(15, 4, 0.1, 0.1 );
self rotateYaw( 360, 4 );
self rotatePitch( 360, 4 );
wait 4;
self MoveZ(-15, 4, 0.1, 0.1 );
self rotateYaw( 360, 4 );
self rotatePitch( 360, 4 );
wait 4;
}
}
end_game_button()
{
level endon( "end_game" );
flag_wait( "initial_blackscreen_passed" );
level waittill( "reward_the_weapons" );
fxorg = ( -873.572, 171.989, -20 );
trigloc = ( -873.572, 171.989, -55 );
end_fx = spawn( "script_model", fxorg );
end_fx setmodel( "tag_origin" ); //
end_fx.angles = ( 0, 0, 0 );
wait 0.05;
playfxontag( level._effect[ "powerup_on" ], end_fx, "tag_origin" );
wait 0.05;
playfxontag( level._effect[ "fx_fire_fireplace_md" ], end_fx, "tag_origin" );
end_fx thread mover();
wait 0.05;
end_trig = spawn( "trigger_radius", trigloc, 30, 30, 30 );
end_trig setcursorhint( "HINT_NOICON" );
level thread LowerMessage( "ender", "^3Launch final rocket ^7 ^2[^7 All players must hold ^3[{+activate}] ^7at the same time ^2]" );
end_trig setLowerMessage( end_trig, "ender" );
//logic behind counting the presses & resetting it's state after a failure
is_pressing = 0;
while ( true )
{
for( i = 0; i < level.players.size; i++ )
{
if( level.players[ i ] isTouching( end_trig ) && level.players[ i ] useButtonPressed() )
{
is_pressing++;
}
else
{
is_pressing = is_pressing;
}
}
wait 0.05;
if( is_pressing >= level.players.size )
{
//level notify( "do_endgame" ); , original notify start in the bracket tree
level notify( "beep_talker" );
PlaySoundAtPosition( "zmb_box_poof", trigloc );
playfx( level._effect[ "fx_zombie_powerup_wave" ], end_fx.origin );
wait 0.05;
end_fx delete();
end_trig delete();
wait 2;
level notify( "do_endgame" );
wait 0.1;
break;
}
else if ( is_pressing < level.players.size )
{
is_pressing = 0;
}
wait 0.05;
}
}
LowerMessage( ref, text )
{
if( !IsDefined( level.zombie_hints ) )
{
level.zombie_hints = [];
}
PrecacheString( text );
level.zombie_hints[ ref ] = text;
}
setLowerMessage( ent, default_ref )
{
if( IsDefined( ent.script_hint ) )
{
self SetHintString( get_zombie_hint( ent.script_hint ) );
}
else
{
self SetHintString( get_zombie_hint( default_ref ) );
}
}
blackout_players()
{
level endon( "end_game" );
//fix tomorrow!!!
level.fade_out_overlay = NewHudElem();
level.fade_out_overlay.x = 0;
level.fade_out_overlay.y = 0;
level.fade_out_overlay.horzAlign = "fullscreen";
level.fade_out_overlay.vertAlign = "fullscreen";
level.fade_out_overlay.foreground = false;
//level.fade_out_overlay.sort = 50;
level.fade_out_overlay SetShader( "black", 640, 480 );
level.fade_out_overlay.alpha = 0;
level.fade_out_overlay fadeOverTime( 5 );
level.fade_out_overlay.alpha = 1;
//iprintlnbold( "FADE IN DONE" );
wait 3.4;
for( i = 0; i < level.players.size; i++ )
{
level.players[ i ] SetClientUIVisibilityFlag( "hud_visible", false );
}
level thread flame_fx_burning();
wait 3.6;
level.fade_out_overlay.alpha = 1;
level thread disableAndEnable_everything(); //some callbacks to v2_main
level.fade_out_overlay fadeOverTime( 7.5 );
level.fade_out_overlay.alpha = 0;
//iprintlnbold( "FADE OUT DONE" );
wait 3.8;
level notify( "start_fading" );
wait 3.8;
level.fade_out_overlay destroy_hud();
}
allowmove()
{
level endon( "end_game" );
level waittill( "start_fading" );
foreach( player in level.players )
{
player setStance( "stand" );
player freezeControls( false );
player allowStand( true );
player allowCrouch( true );
player allowProne( true );
player allowjump( false );
}
}
set_darkening()
{
level endon( "end_game" );
self endon( "disconnect" );
self setclientdvar( "cg_colorHue", 359 );
wait 0.3;
self setclientdvar( "cg_useColorControl", 1 );
wait 0.05;
self thread setColorTemp(); //cg_colorTemp
self thread setColorHue(); //cg_colorHue
wait 1;
self thread setDeSaturation(); //cg_saturation --
self thread setColorScale(); //cg_colorScale
}
setColorScale()
{
level endon( "end_game" );
self endon( "disconnect" );
a = 1;
b = 1;
c = 1;
self setclientdvar( "cg_colorscale", "1 1 1" );
wait 0.2;
self setclientdvar( "cg_colorscale", "1 1 0.95" );
wait 0.2;
self setclientdvar( "cg_colorscale", "1 1 0.9" );
wait 0.2;
self setclientdvar( "cg_colorscale", "1 1 0.85" );
wait 0.2;
self setclientdvar( "cg_colorscale", "1 1 0.8" );
wait 0.2;
self setclientdvar( "cg_colorscale", "1 1 0.75" );
wait 0.2;
self setclientdvar( "cg_colorscale", "1 1 0.7" );
wait 0.2;
self setclientdvar( "cg_colorscale", "1 1 0.65" );
wait 0.2;
self setclientdvar( "cg_colorscale", "1 1 0.6" );
wait 0.2;
self setclientdvar( "cg_colorscale", "1 1 0.55" );
wait 0.2;
self setclientdvar( "cg_colorscale", "1 1 0.5" );
wait 0.1;
self setclientdvar( "cg_colorscale", "1 1 0.45" );
wait 0.1;
self setclientdvar( "cg_colorscale", "1 1 0.4" );
wait 0.1;
self setclientdvar( "cg_colorscale", "1 1 0.35" );
wait 0.1;
self setclientdvar( "cg_colorscale", "1 1 0.3" );
}
setDeSaturation()
{
level endon( "end_game" );
self endon( "disconnect" );
self_desat = 1;
while ( true )
{
self_desat -= 0.05;
self setclientdvar( "cg_colorSaturation", self_desat );
wait 0.1;
if ( self_desat <= 0.8 )
{
self setclientdvar( "cg_colorsaturation", 0.8 );
wait 0.1;
break;
}
}
}
setColorHue()
{
level endon( "end_game" );
self endon( "disconnect" );
self_hue = 359;
wait 0.1;
while ( true )
{
self_hue -= 0.05;
self setclientdvar( "cg_colorHue", self_hue );
wait 0.1;
if ( self_hue <= 355 )
{
self setclientdvar( "cg_colorhue", 355 );
wait 0.1;
break;
}
}
}
setColorTemp()
{
level endon( "end_game" );
self endon( "disconnect" );
self_temp = 6500;
while ( true )
{
self_temp -= 10;
self setclientdvar( "cg_colorTemp", self_temp );
wait 0.05;
if ( self_temp <= 3000 )
{
self setclientdvar( "cg_colortemp", 3000 );
wait 0.1;
break;
}
}
}
disableAndEnable_everything()
{
level endon( "end_game" );
for( f = 0; f < level.players.size; f++ )
{
level.players[ f ] setclientdvar( "cg_drawcrosshair", 0 );
level.players[ f ] SetClientUIVisibilityFlag( "hud_visible", false );
level.players[ f ] notify( "remove_static" );
level.players[ f ] setclientdvar( "r_dof_tweak", 1 );
level.players[ f ] setclientdvar( "r_dof_farstart", 200 );
level.players[ f ] setclientdvar( "r_dof_farend", 10000 );
level.players[ f ] setclientdvar( "r_dof_nearstart", 1 );
level.players[ f ] setclientdvar( "r_dof_nearend", 60 );
level.players[ f ] setclientdvar( "r_watersheetingfx_enable", 1 );
level.players[ f ] setclientdvar( "r_watersheetingfx_magnitude", 0.005 );
level.players[ f ] setclientdvar( "r_watersheetingfx_radius", 0.05 );
wait 0.05;
//level.players[ f ] setclientdvar( "r_dof_tweak", 1 );
}
level.sEnter delete();
level.sSpawn delete();
level.tEnter delete();
level.tExit delete();
level.buzz_trigger delete();
level.trigger_switch_manne delete();
level.zombie_total = 10000;
level notify( "disable_teletoheaven" ); //disable teleporter
level notify( "deathgame_remove" ); // disables certain running threads from city_of_mars_v2_main.gsc
level.hud destroy_hud();
level.hudtext destroy_hud();
level thread notify_bout_endgame();
level thread infinite_bleedout();
level thread attach_notifiers();
}
infinite_bleedout()
{
level endon( "end_game" );
setdvar( "revive_trigger_radius", "1" );
setdvar( "player_lastStandBleedoutTime", "1500" );
for( i = 0; i < level.players.size; i++ )
{
level.players[ i ] setclientdvar( "player_lastStandBleedoutTime", 1500 );
}
}
track_players()
{
level endon( "end_game" );
level.end_game_players = [];
for( i = 0; i < level.players.size; i++ )
{
ArrayInsert( level.end_game_players, "blah", i );
}
while( true )
{
level waittill( "player_downed", player );
get_random_index = RandomInt( level.end_game_players.size );
ArrayRemoveIndex( level.end_game_players, get_random_index );
if ( level.end_game_players.size <= 0 )
{
iprintlnbold( "THIS PLAYER WON + PLAYER NAME" );
}
}
}
check_if_someone_disconnects()
{
level endon( "end_game" );
level endon( "nochecksmore" );
while ( true )
{
level waittill( "disconnect", player );
rnd = randomint( level.end_game_players.size );
ArrayRemoveIndex( level.end_game_players, rnd );
if ( level.end_game_players.size < 1 )
{
wait 0.1;
break;
}
}
}
attach_notifiers()
{
if( level.players.size > 1 )
{
foreach( player in level.players )
{
player thread notifier_printers();
}
}
level.players_alive = level.players.size;
level thread track_deads();
// minus players_alive score thread upon disconnecting
// because players_alive int is first defined by level.players size
// and is only decreased by 1 if player goes down
// hence notifyondisconnect thread
// so that player_alive score gets down if player leaves so that the size stays correct
// for the declare winner check
for( f = 0; f < level.players.size; f++ )
{
level.players[ f ] thread notifyOnDisconnectt();
}
}
notifyOnDisconnectt()
{
level endon( "end_game" );
self waittill( "disconnect" );
level.players_alive--;
}
track_deads()
{
level endon( "end_game" );
while( true )
{
if ( level.players_alive <= 1 && level.players.size > 1 )
{
level thread check_dead();
wait 2;
level thread declare_the_winner();
level specific_powerup_drop( "nuke", level.winnhaname.origin + vectorScale( ( 0, 0, 1 ), 2 ) );
wait 1;
flag_clear( "spawn_zombies" );
level setclientdvar( "g_ai", 0 );
}
if ( level.players_alive <= 1 && level.players.size == 1 )
{
if( level.players[ 0 ] player_is_in_laststand() )
{
wait 3;
level notify( "end_game" );
}
}
wait 0.1;
}
}
declare_the_winner()
{
level endon( "end_game" );
level.winnah = newHudElem();
level.winnah.x = 0;
level.winnah.y = 0;
level.winnah.alignx = "center";
level.winnah.aligny = "center";
level.winnah.vertalign = "user_center";
level.winnah.horzalign = "user_center";
level.winnah.y = 25;
level.winnahs = newHudElem();
level.winnahs.x = 0;
level.winnahs.y = 0;
level.winnahs.alignx = "center";
level.winnahs.aligny = "center";
level.winnahs.vertalign = "user_center";
level.winnahs.horzalign = "user_center";
level.winnah.fontscale = 1.6;
level.winnahs.fontscale = 1.7;
level.winnahs settext( "No glory in winning the battle, ^3" + level.winnahname.name );
level.winnah settext( "^3You did it anyway.^7 Congratulations!");
level.winnah.alpha = 0;
level.winnahs.alpha = 0;
level.winnahs fadeovertime( 0.25 );
level.winnahs.alpha = 1;
wait 0.8;
level.winnah.alpha fadeovertime( 0.25 );
level.winnas.alpha = 1;
wait 3;
level.winnah fadeovertime( 2 );
level.winnah.alpha = 0;
level.winnahs fadeovertime( 2 );
level.winnahs.alpha = 0;
wait 3;
level.winnah destroy_hud();
level.winnahs destroy_hud();
level notify( "end_game" );
}
check_dead()
{
level endon( "end_game" );
for( i = 0; i < level.players.size; i++ )
{
//if( isAlive( level.players[ i ] ) )
//{
// level.winnahname = level.players[ i ].name;
//}
if( level.players[ i ] player_is_in_laststand() )
{
//level.winnahname = level.players[ i ].name;
}
else
{
level.winnahname = level.players[ i ];
}
}
}
solo_game_end_notifier()
{
self endon( "disconnect" );
hud_printer = newHudElem();
hud_printer.x = 0;
hud_printer.y = 0;
hud_printer.alignx = "center";
hud_printer.aligny = "center";
hud_printer.vertalign = "user_center";
hud_printer.horzalign = "user_center";
hud_printer.fontscale = 1.5;
hud_printer.alpha = 0;
hud_printer settext( "Test Subject ^3" + self.name + " ^7couldn't survive any longer. ^3Remaining ^7Test Subjects ^3eliminated.^7" );
level waittill( "end_game" );
hud_printer fadeOverTime( 2 );
hud_printer.alpha = 1;
wait 5;
hud_printer fadeOverTime( 1 );
hud_printer.alpha = 0;
wait 1;
hud_printer destroy_hud();
}
notifier_printers( /*pointer*/ )
{
//level endon( "end_game" );
self endon( "disconnect" );
level endon( "end_game" );
//level.to_addHUD + pointer = newHudElem();
hud_printer = newHudElem();
hud_printer.x = 0;
hud_printer.y = 0;
hud_printer.alignx = "center";
hud_printer.aligny = "center";
hud_printer.vertalign = "user_center";
hud_printer.horzalign = "user_center";
hud_printer.fontscale = 1.5;
hud_printer.alpha = 0;
hud_printer settext( "Test Subject ^3" + self.name + " ^7couldn't survive any longer. ^3Another one^7 down..." );
while( true )
{
self waittill_any( "player_downed", "player_suicide", "death" ); //end_game
wait 0.3;
if( level.players_alive <= 1 && level.players.size > 1 )
{
break;
}
PlaySoundAtPosition("zmb_clock_chime", ( 0, 0, 0 ) );
if( level.huds_active > 1 )
{
hud_printer.y = hud_printer.y * level.huds_active;
}
level.huds_active++;
hud_printer.alpha = 0;
hud_printer fadeOverTime( 0.5 );
hud_printer.alpha = 1;
wait 4;
hud_printer fadeOverTime( 0.5 );
hud_printer.alpha = 0;
wait 1;
hud_printer destroy_hud();
level.huds_active--;
level.players_alive--;
wait 1;
break;
}
}
notify_bout_endgame()
{
level endon( "end_game" );
level.end_teller = newHudElem();
level.end_teller_icon = newHudElem();
level.end_teller.x = 0;
level.end_teller.y = 0;
level.end_teller.alignx = "center";
level.end_teller.aligny = "center";
level.end_teller.vertalign = "user_center";
level.end_teller.horzalign = "user_center";
level.end_teller.alpha = 0;
level.end_teller.y = 15;
if( level.players.size > 1 )
{
level.end_teller settext( "The last ^3Test Subject^7 alive ^3wins!" );
}
else if ( level.players.size == 1 )
{
level.end_teller settext( "Your ^1perishment^7 is inevitable!" );
}
level.end_teller_icon.x = 0;
level.end_teller_icon.y = 0;
level.end_teller_icon.alignx = "center";
level.end_teller_icon.aligny = "center";
level.end_teller_icon.vertalign = "user_center";
level.end_teller_icon.horzalign = "user_center";
level.end_teller_icon.alpha = 0;
level.end_teller_icon.y = -10;
level.end_teller.fontscale = 1.8;
level.end_teller_icon.width = 25;
level.end_teller_icon.height = 25;
level.end_teller_icon setshader( "zombies_rank_5_ded" );
wait 1;
level.end_teller fadeovertime( 4 );
level.end_teller_icon fadeovertime( 4 );
level.end_teller_icon.alpha = 1;
level.end_teller.alpha = 1;
wait 5.5;
level.end_teller fadeovertime( 4 );
level.end_teller_icon fadeovertime( 4 );
level.end_teller_icon.alpha = 0;
level.end_teller.alpha = 0;
wait 6;
level.end_teller_icon destroy_hud();
level.end_teller destroy_hud();
}
flame_fx_burning()
{
level endon( "end_game" );
fireHazardLoc = [];
fireHazardLoc[ 0 ] = ( 1149.52, 161.932, 209.635 );
fireHazardLoc[ 1 ] = ( 1628.71, 603.261, -1.89408 );
fireHazardLoc[ 2 ] = ( 214.301, 81.6155, 47.4399 );
fireHazardLoc[ 3 ] = ( -386.96, -485.854, -64.9316 );
fireHazardLoc[ 4 ] = ( -685.249, 220.856, -53.1149 );
fireHazardLoc[ 5 ] = ( -1143.53, 244.431, -48.2651 );
fireHazardLoc[ 6 ] = ( -1648.7, 661.206, 42.2665 );
fireHazardLoc[ 7 ] = ( -2102.93, 601.182, -45.5931 );
fireHazardLoc[ 8 ] = ( -1003.9, 1016.6, -43.468 );
fireHazardLoc[ 9 ] = ( -611.325, 813.347, 46.6712 );
fireHazardLoc[ 10 ] = ( 129.452, 839.276, -67.9674 );
fireHazardLoc[ 11 ] = ( 455.257, 905.122, -80.4949 );
fireHazardLoc[ 12 ] = ( 337.822, -174.097, -43.5009 );
//level.transit_fire;
//level.nuke_fire;
for( i = 0; i < fireHazardLoc.size; i++ )
{
ss = randomintrange( 0, 1 );