-
Notifications
You must be signed in to change notification settings - Fork 9
/
script_14d2d89964cae0b1.gsc
1241 lines (1192 loc) · 26.4 KB
/
script_14d2d89964cae0b1.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
// Decompiled by Serious. Credits to Scoba for his original tool, Cerberus, which I heavily upgraded to support remaining features, other games, and other platforms.
#using scripts\core_common\util_shared.csc;
#using scripts\core_common\clientfield_shared.csc;
#using scripts\core_common\struct.csc;
#namespace gibclientutils;
/*
Name: main
Namespace: gibclientutils
Checksum: 0xAB3427A1
Offset: 0x228
Size: 0xBC
Parameters: 0
Flags: AutoExec
*/
function autoexec main()
{
clientfield::register("actor", "gib_state", 1, 9, "int", &_gibhandler, 0, 0);
clientfield::register("playercorpse", "gib_state", 1, 15, "int", &_gibhandler, 0, 0);
level.var_ad0f5efa = [];
level thread _annihilatecorpse();
}
/*
Name: function_3aa023f1
Namespace: gibclientutils
Checksum: 0xE7027F20
Offset: 0x2F0
Size: 0x306
Parameters: 1
Flags: Linked, Private
*/
function private function_3aa023f1(name)
{
if(!isdefined(name))
{
return undefined;
}
gibdef = level.var_ad0f5efa[name];
if(isdefined(gibdef))
{
return gibdef;
}
definition = struct::get_script_bundle("gibcharacterdef", name);
if(!isdefined(definition))
{
/#
assertmsg("" + name);
#/
return undefined;
}
gibpiecelookup = [];
gibpiecelookup[2] = "annihilate";
gibpiecelookup[8] = "head";
gibpiecelookup[16] = "rightarm";
gibpiecelookup[32] = "leftarm";
gibpiecelookup[128] = "rightleg";
gibpiecelookup[256] = "leftleg";
gibpieces = [];
foreach(gibflag, gibpiece in gibpiecelookup)
{
if(!isdefined(gibpiece))
{
/#
assertmsg("" + gibflag);
#/
continue;
}
gibstruct = spawnstruct();
gibstruct.gibmodel = definition.(gibpiece + "_gibmodel");
gibstruct.gibtag = definition.(gibpiece + "_gibtag");
gibstruct.gibfx = definition.(gibpiece + "_gibfx");
gibstruct.gibfxtag = definition.(gibpiece + "_gibeffecttag");
gibstruct.gibdynentfx = definition.(gibpiece + "_gibdynentfx");
gibstruct.gibcinematicfx = definition.(gibpiece + "_gibcinematicfx");
gibstruct.gibsound = definition.(gibpiece + "_gibsound");
gibstruct.gibhidetag = definition.(gibpiece + "_gibhidetag");
gibpieces[gibflag] = gibstruct;
}
level.var_ad0f5efa[name] = gibpieces;
return gibpieces;
}
/*
Name: function_9fe14ca3
Namespace: gibclientutils
Checksum: 0x86EF1CF0
Offset: 0x600
Size: 0x366
Parameters: 2
Flags: Linked, Private
*/
function private function_9fe14ca3(entity, gibflag)
{
if(gibflag == 8)
{
part = "head";
}
else
{
if(gibflag == 16 || gibflag == 32)
{
part = "arms";
}
else if(gibflag == 128 || gibflag == 256)
{
part = "legs";
}
}
if(!isdefined(part))
{
return undefined;
}
name = entity getplayergibdef(part);
if(!isdefined(name))
{
/#
assertmsg("" + gibflag);
#/
return undefined;
}
gibdef = level.var_ad0f5efa[name];
if(isdefined(gibdef))
{
return gibdef;
}
definition = struct::get_script_bundle("playeroutfitgibdef", name);
if(!isdefined(definition))
{
/#
assertmsg("" + name);
#/
return undefined;
}
gibpiecelookup = [];
gibpiecelookup[0] = "left";
gibpiecelookup[1] = "right";
gibpieces = [];
foreach(side, gibpiece in gibpiecelookup)
{
if(!isdefined(gibpiece))
{
continue;
}
gibstruct = spawnstruct();
gibstruct.gibmodel = definition.(gibpiece + "_gibmodel");
gibstruct.gibtag = definition.(gibpiece + "_gibtag");
gibstruct.gibfx = definition.(gibpiece + "_gibfx");
gibstruct.gibfxtag = definition.(gibpiece + "_gibeffecttag");
gibstruct.gibdynentfx = definition.(gibpiece + "_gibdynentfx");
gibstruct.gibcinematicfx = definition.(gibpiece + "_gibcinematicfx");
gibstruct.gibsound = definition.(gibpiece + "_gibsound");
gibstruct.gibhidetag = definition.(gibpiece + "_gibhidetag");
gibpieces[side] = gibstruct;
}
level.var_ad0f5efa[name] = gibpieces;
return gibpieces;
}
/*
Name: function_c0099e86
Namespace: gibclientutils
Checksum: 0x4E90D68
Offset: 0x970
Size: 0xBA
Parameters: 2
Flags: Linked
*/
function function_c0099e86(entity, gibflag)
{
gibpiece = function_9fe14ca3(entity, gibflag);
if(!isdefined(gibpiece))
{
return undefined;
}
if(gibflag == 8)
{
side = 0;
}
else
{
if(gibflag == 16 || gibflag == 128)
{
side = 1;
}
else if(gibflag == 32 || gibflag == 256)
{
side = 0;
}
}
return gibpiece[side];
}
/*
Name: function_69db754
Namespace: gibclientutils
Checksum: 0x1D780E81
Offset: 0xA38
Size: 0xC8
Parameters: 2
Flags: Linked, Private
*/
function private function_69db754(entity, gibflag)
{
if(isplayer(entity) || entity isplayercorpse())
{
return function_c0099e86(entity, gibflag);
}
if(isdefined(entity.gib_data))
{
gibpieces = function_3aa023f1(entity.gib_data.gibdef);
}
else
{
gibpieces = function_3aa023f1(entity.gibdef);
}
return gibpieces[gibflag];
}
/*
Name: _annihilatecorpse
Namespace: gibclientutils
Checksum: 0xBBB1E23
Offset: 0xB08
Size: 0x240
Parameters: 0
Flags: Linked, Private
*/
function private _annihilatecorpse()
{
while(true)
{
waitresult = undefined;
waitresult = level waittill(#"corpse_explode");
localclientnum = waitresult.localclientnum;
body = waitresult.body;
origin = waitresult.position;
if(!util::is_mature() || util::is_gib_restricted_build())
{
continue;
}
if(isdefined(body) && _hasgibdef(body) && body isragdoll())
{
cliententgibhead(localclientnum, body);
cliententgibrightarm(localclientnum, body);
cliententgibleftarm(localclientnum, body);
cliententgibrightleg(localclientnum, body);
cliententgibleftleg(localclientnum, body);
}
if(isdefined(body) && _hasgibdef(body) && body.archetype == #"human")
{
if(randomint(100) >= 50)
{
continue;
}
if(isdefined(origin) && distancesquared(body.origin, origin) <= 14400)
{
body.ignoreragdoll = 1;
body _gibentity(localclientnum, 50 | 384, 1);
}
}
}
}
/*
Name: _clonegibdata
Namespace: gibclientutils
Checksum: 0x77C28495
Offset: 0xD50
Size: 0x1D6
Parameters: 3
Flags: Linked, Private
*/
function private _clonegibdata(localclientnum, entity, clone)
{
clone.gib_data = spawnstruct();
clone.gib_data.gib_state = entity.gib_state;
clone.gib_data.gibdef = entity.gibdef;
clone.gib_data.hatmodel = entity.hatmodel;
clone.gib_data.head = entity.head;
clone.gib_data.legdmg1 = entity.legdmg1;
clone.gib_data.legdmg2 = entity.legdmg2;
clone.gib_data.legdmg3 = entity.legdmg3;
clone.gib_data.legdmg4 = entity.legdmg4;
clone.gib_data.torsodmg1 = entity.torsodmg1;
clone.gib_data.torsodmg2 = entity.torsodmg2;
clone.gib_data.torsodmg3 = entity.torsodmg3;
clone.gib_data.torsodmg4 = entity.torsodmg4;
clone.gib_data.torsodmg5 = entity.torsodmg5;
}
/*
Name: _getgibbedstate
Namespace: gibclientutils
Checksum: 0xC1CC393A
Offset: 0xF30
Size: 0x76
Parameters: 2
Flags: Linked, Private
*/
function private _getgibbedstate(localclientnum, entity)
{
if(isdefined(entity.gib_data) && isdefined(entity.gib_data.gib_state))
{
return entity.gib_data.gib_state;
}
if(isdefined(entity.gib_state))
{
return entity.gib_state;
}
return 0;
}
/*
Name: _getgibbedlegmodel
Namespace: gibclientutils
Checksum: 0xF7D34AE0
Offset: 0xFB0
Size: 0x15A
Parameters: 2
Flags: Linked, Private
*/
function private _getgibbedlegmodel(localclientnum, entity)
{
gibstate = _getgibbedstate(localclientnum, entity);
rightleggibbed = gibstate & 128;
leftleggibbed = gibstate & 256;
if(rightleggibbed && leftleggibbed)
{
return (isdefined(entity.gib_data) ? entity.gib_data.legdmg4 : entity.legdmg4);
}
if(rightleggibbed)
{
return (isdefined(entity.gib_data) ? entity.gib_data.legdmg2 : entity.legdmg2);
}
if(leftleggibbed)
{
return (isdefined(entity.gib_data) ? entity.gib_data.legdmg3 : entity.legdmg3);
}
return (isdefined(entity.gib_data) ? entity.gib_data.legdmg1 : entity.legdmg1);
}
/*
Name: _getgibextramodel
Namespace: gibclientutils
Checksum: 0xDE24FDB6
Offset: 0x1118
Size: 0xCC
Parameters: 3
Flags: Linked, Private
*/
function private _getgibextramodel(localclientnumm, entity, gibflag)
{
if(gibflag == 4)
{
return (isdefined(entity.gib_data) ? entity.gib_data.hatmodel : entity.hatmodel);
}
if(gibflag == 8)
{
return (isdefined(entity.gib_data) ? entity.gib_data.head : entity.head);
}
/#
assertmsg("");
#/
}
/*
Name: _getgibbedtorsomodel
Namespace: gibclientutils
Checksum: 0x3DF54EE8
Offset: 0x11F0
Size: 0x15A
Parameters: 2
Flags: Linked, Private
*/
function private _getgibbedtorsomodel(localclientnum, entity)
{
gibstate = _getgibbedstate(localclientnum, entity);
rightarmgibbed = gibstate & 16;
leftarmgibbed = gibstate & 32;
if(rightarmgibbed && leftarmgibbed)
{
return (isdefined(entity.gib_data) ? entity.gib_data.torsodmg2 : entity.torsodmg2);
}
if(rightarmgibbed)
{
return (isdefined(entity.gib_data) ? entity.gib_data.torsodmg2 : entity.torsodmg2);
}
if(leftarmgibbed)
{
return (isdefined(entity.gib_data) ? entity.gib_data.torsodmg3 : entity.torsodmg3);
}
return (isdefined(entity.gib_data) ? entity.gib_data.torsodmg1 : entity.torsodmg1);
}
/*
Name: _gibpiecetag
Namespace: gibclientutils
Checksum: 0x1DB711C0
Offset: 0x1358
Size: 0x74
Parameters: 3
Flags: Linked, Private
*/
function private _gibpiecetag(localclientnum, entity, gibflag)
{
if(!_hasgibdef(self))
{
return;
}
gibpiece = function_69db754(entity, gibflag);
if(isdefined(gibpiece))
{
return gibpiece.gibfxtag;
}
}
/*
Name: function_ba120c50
Namespace: gibclientutils
Checksum: 0xC65F4DDD
Offset: 0x13D8
Size: 0x72
Parameters: 1
Flags: Linked, Private
*/
function private function_ba120c50(gibflags)
{
var_ec7623a6 = 0;
if(gibflags & 12)
{
var_ec7623a6 = var_ec7623a6 | 1;
}
if(gibflags & 48)
{
var_ec7623a6 = var_ec7623a6 | 2;
}
if(gibflags & 384)
{
var_ec7623a6 = var_ec7623a6 | 4;
}
return var_ec7623a6;
}
/*
Name: _gibentity
Namespace: gibclientutils
Checksum: 0x33AF80C1
Offset: 0x1458
Size: 0x42E
Parameters: 3
Flags: Linked, Private
*/
function private _gibentity(localclientnum, gibflags, shouldspawngibs)
{
entity = self;
if(!_hasgibdef(entity))
{
return;
}
currentgibflag = 2;
gibdir = undefined;
gibdirscale = undefined;
if(isplayer(entity) || entity isplayercorpse())
{
yaw_bits = (gibflags >> 9) & (8 - 1);
yaw = getanglefrombits(yaw_bits, 3);
gibdir = anglestoforward((0, yaw, 0));
}
while(gibflags >= currentgibflag)
{
if(gibflags & currentgibflag)
{
if(currentgibflag == 2)
{
if(isplayer(entity) || entity isplayercorpse())
{
var_c0c9eae3 = entity function_4976d5ee();
_playgibfx(localclientnum, entity, var_c0c9eae3[#"fx"], var_c0c9eae3[#"tag"]);
}
else
{
gibpiece = function_69db754(entity, currentgibflag);
if(isdefined(gibpiece))
{
_playgibfx(localclientnum, entity, gibpiece.gibfx, gibpiece.gibfxtag);
if(isdefined(gibpiece.gibcinematicfx))
{
if(function_92beaa28(localclientnum))
{
_playgibfx(localclientnum, entity, gibpiece.gibcinematicfx, gibpiece.gibfxtag);
}
}
_playgibsound(localclientnum, entity, gibpiece.gibsound);
}
}
entity hide();
entity.ignoreragdoll = 1;
}
else
{
gibpiece = function_69db754(entity, currentgibflag);
if(isdefined(gibpiece))
{
if(shouldspawngibs)
{
var_cd61eb7d = function_ba120c50(currentgibflag);
entity thread _gibpiece(localclientnum, entity, gibpiece.gibmodel, gibpiece.gibtag, gibpiece.gibdynentfx, gibdir, gibdirscale, var_cd61eb7d);
}
_playgibfx(localclientnum, entity, gibpiece.gibfx, gibpiece.gibfxtag);
if(isdefined(gibpiece.gibcinematicfx))
{
if(function_92beaa28(localclientnum))
{
_playgibfx(localclientnum, entity, gibpiece.gibcinematicfx, gibpiece.gibfxtag);
}
}
_playgibsound(localclientnum, entity, gibpiece.gibsound);
}
}
_handlegibcallbacks(localclientnum, entity, currentgibflag);
}
currentgibflag = currentgibflag << 1;
}
}
/*
Name: _setgibbed
Namespace: gibclientutils
Checksum: 0xC3A6C62
Offset: 0x1890
Size: 0x8A
Parameters: 3
Flags: Linked, Private
*/
function private _setgibbed(localclientnum, entity, gibflag)
{
gib_state = _getgibbedstate(localclientnum, entity) | (gibflag & (512 - 1));
if(isdefined(entity.gib_data))
{
entity.gib_data.gib_state = gib_state;
}
else
{
entity.gib_state = gib_state;
}
}
/*
Name: _gibcliententityinternal
Namespace: gibclientutils
Checksum: 0xD321F4E
Offset: 0x1928
Size: 0x1AC
Parameters: 3
Flags: Linked, Private
*/
function private _gibcliententityinternal(localclientnum, entity, gibflag)
{
if(!util::is_mature() || util::is_gib_restricted_build())
{
return;
}
if(!isdefined(entity) || !_hasgibdef(entity))
{
return;
}
if(entity.type !== "scriptmover")
{
return;
}
if(isgibbed(localclientnum, entity, gibflag))
{
return;
}
if(!_getgibbedstate(localclientnum, entity) < 16)
{
legmodel = _getgibbedlegmodel(localclientnum, entity);
entity detach(legmodel, "");
}
_setgibbed(localclientnum, entity, gibflag);
entity setmodel(_getgibbedtorsomodel(localclientnum, entity));
entity attach(_getgibbedlegmodel(localclientnum, entity), "");
entity _gibentity(localclientnum, gibflag, 1);
}
/*
Name: _gibclientextrainternal
Namespace: gibclientutils
Checksum: 0x1E21CE29
Offset: 0x1AE0
Size: 0x1DC
Parameters: 3
Flags: Linked, Private
*/
function private _gibclientextrainternal(localclientnum, entity, gibflag)
{
if(!util::is_mature() || util::is_gib_restricted_build())
{
return;
}
if(!isdefined(entity))
{
return;
}
if(entity.type !== "scriptmover")
{
return;
}
if(isgibbed(localclientnum, entity, gibflag))
{
return;
}
gibmodel = _getgibextramodel(localclientnum, entity, gibflag);
if(isdefined(gibmodel) && entity isattached(gibmodel, ""))
{
entity detach(gibmodel, "");
}
if(gibflag == 8)
{
if(isdefined((isdefined(entity.gib_data) ? entity.gib_data.torsodmg5 : entity.torsodmg5)))
{
entity attach((isdefined(entity.gib_data) ? entity.gib_data.torsodmg5 : entity.torsodmg5), "");
}
}
_setgibbed(localclientnum, entity, gibflag);
entity _gibentity(localclientnum, gibflag, 1);
}
/*
Name: _gibhandler
Namespace: gibclientutils
Checksum: 0xBF43390B
Offset: 0x1CC8
Size: 0x1B2
Parameters: 7
Flags: Linked, Private
*/
function private _gibhandler(localclientnum, oldvalue, newvalue, bnewent, binitialsnap, fieldname, wasdemojump)
{
entity = self;
if(isplayer(entity) || entity isplayercorpse())
{
if(!util::is_mature() || util::is_gib_restricted_build())
{
return;
}
}
else
{
if(isdefined(entity.maturegib) && entity.maturegib && (!util::is_mature() || !isshowgibsenabled()))
{
return;
}
if(isdefined(entity.restrictedgib) && entity.restrictedgib && !isshowgibsenabled())
{
return;
}
}
gibflags = oldvalue ^ newvalue;
shouldspawngibs = !newvalue & 1;
if(bnewent)
{
gibflags = 0 ^ newvalue;
}
entity _gibentity(localclientnum, gibflags, shouldspawngibs);
entity.gib_state = newvalue;
}
/*
Name: _gibpiece
Namespace: gibclientutils
Checksum: 0x12173CB7
Offset: 0x1E88
Size: 0x34C
Parameters: 8
Flags: Linked
*/
function _gibpiece(localclientnum, entity, gibmodel, gibtag, gibfx, gibdir, gibdirscale, var_bf41adc0)
{
if(!isdefined(gibtag) || !isdefined(gibmodel))
{
return;
}
startposition = entity gettagorigin(gibtag);
startangles = entity gettagangles(gibtag);
endposition = startposition;
endangles = startangles;
forwardvector = undefined;
if(!isdefined(startposition) || !isdefined(startangles))
{
return false;
}
if(isdefined(gibdir) && !isdefined(gibdirscale))
{
startposition = (0, 0, 0);
forwardvector = gibdir;
forwardvector = forwardvector * randomfloatrange(100, 500);
}
else
{
waitframe(1);
if(isdefined(entity))
{
endposition = entity gettagorigin(gibtag);
endangles = entity gettagangles(gibtag);
}
else
{
endposition = startposition + (anglestoforward(startangles) * 10);
endangles = startangles;
}
if(!isdefined(endposition) || !isdefined(endangles))
{
return false;
}
scale = randomfloatrange(0.6, 1);
dir = (randomfloatrange(0, 0.2), randomfloatrange(0, 0.2), randomfloatrange(0.2, 0.7));
if(isdefined(gibdir) && isdefined(gibdirscale) && gibdirscale > 0)
{
dir = gibdir + dir;
scale = gibdirscale;
}
forwardvector = vectornormalize(endposition - startposition);
forwardvector = forwardvector * scale;
forwardvector = forwardvector + dir;
}
if(isdefined(entity))
{
gibentity = createdynentandlaunch(localclientnum, gibmodel, endposition, endangles, startposition, forwardvector, gibfx, 1, !(isdefined(level.var_2f78f66c) && level.var_2f78f66c));
if(isdefined(gibentity))
{
setdynentbodyrenderoptionspacked(gibentity, entity getbodyrenderoptionspacked(), var_bf41adc0);
}
}
}
/*
Name: _handlegibcallbacks
Namespace: gibclientutils
Checksum: 0x70A0C52C
Offset: 0x21E0
Size: 0xC4
Parameters: 3
Flags: Linked, Private
*/
function private _handlegibcallbacks(localclientnum, entity, gibflag)
{
if(isdefined(entity._gibcallbacks) && isdefined(entity._gibcallbacks[gibflag]))
{
foreach(callback in entity._gibcallbacks[gibflag])
{
[[callback]](localclientnum, entity, gibflag);
}
}
}
/*
Name: _handlegibannihilate
Namespace: gibclientutils
Checksum: 0xA2335CA1
Offset: 0x22B0
Size: 0x7C
Parameters: 1
Flags: Linked, Private
*/
function private _handlegibannihilate(localclientnum)
{
entity = self;
entity endon(#"death");
entity waittillmatch({#notetrack:"gib_annihilate"}, #"_anim_notify_");
cliententgibannihilate(localclientnum, entity);
}
/*
Name: _handlegibhead
Namespace: gibclientutils
Checksum: 0xCC7F78CF
Offset: 0x2338
Size: 0x7C
Parameters: 1
Flags: Linked, Private
*/
function private _handlegibhead(localclientnum)
{
entity = self;
entity endon(#"death");
entity waittillmatch({#notetrack:"gib = \"head\""}, #"_anim_notify_");
cliententgibhead(localclientnum, entity);
}
/*
Name: _handlegibrightarm
Namespace: gibclientutils
Checksum: 0xDF41FE5C
Offset: 0x23C0
Size: 0x7C
Parameters: 1
Flags: Linked, Private
*/
function private _handlegibrightarm(localclientnum)
{
entity = self;
entity endon(#"death");
entity waittillmatch({#notetrack:"gib = \"arm_right\""}, #"_anim_notify_");
cliententgibrightarm(localclientnum, entity);
}
/*
Name: _handlegibleftarm
Namespace: gibclientutils
Checksum: 0xA7949FE5
Offset: 0x2448
Size: 0x7C
Parameters: 1
Flags: Linked, Private
*/
function private _handlegibleftarm(localclientnum)
{
entity = self;
entity endon(#"death");
entity waittillmatch({#notetrack:"gib = \"arm_left\""}, #"_anim_notify_");
cliententgibleftarm(localclientnum, entity);
}
/*
Name: _handlegibrightleg
Namespace: gibclientutils
Checksum: 0xFF595C34
Offset: 0x24D0
Size: 0x7C
Parameters: 1
Flags: Linked, Private
*/
function private _handlegibrightleg(localclientnum)
{
entity = self;
entity endon(#"death");
entity waittillmatch({#notetrack:"gib = \"leg_right\""}, #"_anim_notify_");
cliententgibrightleg(localclientnum, entity);
}
/*
Name: _handlegibleftleg
Namespace: gibclientutils
Checksum: 0xB40DB692
Offset: 0x2558
Size: 0x7C
Parameters: 1
Flags: Linked, Private
*/
function private _handlegibleftleg(localclientnum)
{
entity = self;
entity endon(#"death");
entity waittillmatch({#notetrack:"gib = \"leg_left\""}, #"_anim_notify_");
cliententgibleftleg(localclientnum, entity);
}
/*
Name: _hasgibdef
Namespace: gibclientutils
Checksum: 0x3C3641F4
Offset: 0x25E0
Size: 0x88
Parameters: 1
Flags: Linked, Private
*/
function private _hasgibdef(entity)
{
return isdefined(entity.gib_data) && isdefined(entity.gib_data.gibdef) || isdefined(entity.gibdef) || (isdefined(entity getplayergibdef("arms")) && isdefined(entity getplayergibdef("legs")));
}
/*
Name: _playgibfx
Namespace: gibclientutils
Checksum: 0xD2317F83
Offset: 0x2670
Size: 0x102
Parameters: 4
Flags: Linked
*/
function _playgibfx(localclientnum, entity, fxfilename, fxtag)
{
if(isdefined(fxfilename) && isdefined(fxtag) && entity hasdobj(localclientnum))
{
fx = util::playfxontag(localclientnum, fxfilename, entity, fxtag);
if(isdefined(fx))
{
if(isdefined(entity.team))
{
setfxteam(localclientnum, fx, entity.team);
}
if(isdefined(level.setgibfxtoignorepause) && level.setgibfxtoignorepause)
{
setfxignorepause(localclientnum, fx, 1);
}
}
return fx;
}
}
/*
Name: _playgibsound
Namespace: gibclientutils
Checksum: 0x5A68A21B
Offset: 0x2780
Size: 0x44
Parameters: 3
Flags: Linked
*/
function _playgibsound(localclientnum, entity, soundalias)
{
if(isdefined(soundalias))
{
playsound(localclientnum, soundalias, entity.origin);
}
}
/*
Name: addgibcallback
Namespace: gibclientutils
Checksum: 0x922B322
Offset: 0x27D0
Size: 0xDE
Parameters: 4
Flags: Linked
*/
function addgibcallback(localclientnum, entity, gibflag, callbackfunction)
{
/#
assert(isfunctionptr(callbackfunction));
#/
if(!isdefined(entity._gibcallbacks))
{
entity._gibcallbacks = [];
}
if(!isdefined(entity._gibcallbacks[gibflag]))
{
entity._gibcallbacks[gibflag] = [];
}
gibcallbacks = entity._gibcallbacks[gibflag];
gibcallbacks[gibcallbacks.size] = callbackfunction;
entity._gibcallbacks[gibflag] = gibcallbacks;
}
/*
Name: cliententgibannihilate
Namespace: gibclientutils
Checksum: 0x2DB5EADE
Offset: 0x28B8
Size: 0x7C
Parameters: 2
Flags: Linked
*/
function cliententgibannihilate(localclientnum, entity)
{
if(!util::is_mature() || util::is_gib_restricted_build())
{
return;
}
entity.ignoreragdoll = 1;
entity _gibentity(localclientnum, 50 | 384, 1);
}
/*
Name: cliententgibhead
Namespace: gibclientutils
Checksum: 0xF6D35110
Offset: 0x2940
Size: 0x34
Parameters: 2
Flags: Linked
*/
function cliententgibhead(localclientnum, entity)
{
_gibclientextrainternal(localclientnum, entity, 8);
}
/*
Name: cliententgibleftarm
Namespace: gibclientutils
Checksum: 0xB45E9EF4
Offset: 0x2980
Size: 0x54
Parameters: 2
Flags: Linked
*/
function cliententgibleftarm(localclientnum, entity)
{
if(isgibbed(localclientnum, entity, 16))
{
return;
}
_gibcliententityinternal(localclientnum, entity, 32);
}
/*
Name: cliententgibrightarm