‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
zombie_death.csc
Go to the documentation of this file.
1 
2 #using scripts\codescripts\struct;
3 #using scripts\shared\util_shared;
4 
5 #insert scripts\shared\shared.gsh;
6 
7 #precache( "client_fx", "zombie/fx_fire_torso_zmb" );
8 
9 function autoexec ‪init_fire_fx()
10 {
12  ‪DEFAULT(level._effect,[]);
13  level._effect["character_fire_death_sm"] = "zombie/fx_fire_torso_zmb";
14  level._effect["character_fire_death_torso"] = "zombie/fx_fire_torso_zmb";
15 }
16 
17 
18 function ‪on_fire_timeout( localClientNum )
19 {
20  self endon ("death");
21  self endon( "entityshutdown" );
22 
23  // about the length of the flame fx
24  wait 12;
25 
26  if (isdefined(self) && IsAlive(self))
27  {
28  self.is_on_fire = false;
29  self notify ("stop_flame_damage");
30  }
31 
32 }
33 
34 
35 function ‪flame_death_fx( localClientNum )
36 {
37  self endon( "death" );
38  self endon( "entityshutdown" );
39 
40  if ( ‪IS_TRUE(self.is_on_fire) )
41  {
42  return;
43  }
44 
45  self.is_on_fire = true;
46 
47  self thread ‪on_fire_timeout();
48 
49  if( isdefined( level._effect ) && isdefined( level._effect["character_fire_death_torso"] ) )
50  {
51  fire_tag = "j_spinelower";
52 
53  if( !isDefined( self GetTagOrigin( fire_tag))) //allows effect to play on parasite and insanity elementals
54  {
55  fire_tag = "tag_origin";
56  }
57 
58  if ( !isDefined( self.isdog) || !self.isdog )
59  {
60  PlayFxOnTag( localClientNum, level._effect["character_fire_death_torso"], self, fire_tag );
61  }
62  }
63  else
64  {
65 /#
66  println( "^3ANIMSCRIPT WARNING: You are missing level._effect[\"character_fire_death_torso\"], please set it in your levelname_fx.gsc. Use \"env/fire/fx_fire_player_torso\"" );
67 #/
68  }
69 
70  if( isdefined( level._effect ) && isdefined( level._effect["character_fire_death_sm"] ) )
71  {
72  if( self.archetype !== "parasite" && self.archetype !== "raps" )
73  {
74  wait 1;
75 
76  tagArray = [];
77  tagArray[0] = "J_Elbow_LE";
78  tagArray[1] = "J_Elbow_RI";
79  tagArray[2] = "J_Knee_RI";
80  tagArray[3] = "J_Knee_LE";
81  tagArray = ‪randomize_array( tagArray );
82 
83  PlayFxOnTag( localClientNum, level._effect["character_fire_death_sm"], self, tagArray[0] );
84 
85  wait 1;
86 
87  tagArray[0] = "J_Wrist_RI";
88  tagArray[1] = "J_Wrist_LE";
89  if( !‪IS_TRUE(self.missinglegs) )
90  {
91  tagArray[2] = "J_Ankle_RI";
92  tagArray[3] = "J_Ankle_LE";
93  }
94  tagArray = ‪randomize_array( tagArray );
95 
96  PlayFxOnTag( localClientNum, level._effect["character_fire_death_sm"], self, tagArray[0] );
97  PlayFxOnTag( localClientNum, level._effect["character_fire_death_sm"], self, tagArray[1] );
98  }
99  }
100  else
101  {
102 /#
103  println( "^3ANIMSCRIPT WARNING: You are missing level._effect[\"character_fire_death_sm\"], please set it in your levelname_fx.gsc. Use \"env/fire/fx_fire_zombie_md\"" );
104 #/
105  }
106 }
107 
108 
109 // MikeD( 9/30/2007 ): Taken from maps\_utility "array_randomize:, for some reason maps\_utility is included in a animscript
110 // somewhere, but I can't call it within in this... So I made a new one.
112 {
113  for( i = 0; i < ‪array.size; i++ )
114  {
115  j = RandomInt( ‪array.size );
116  temp = ‪array[i];
117  ‪array[i] = ‪array[j];
118  ‪array[j] = temp;
119  }
120  return ‪array;
121 }
‪on_fire_timeout
‪function on_fire_timeout(localClientNum)
Definition: zombie_death.csc:18
‪randomize_array
‪function randomize_array(array)
Definition: zombie_death.csc:111
‪IS_TRUE
‪#define IS_TRUE(__a)
Definition: shared.gsh:251
‪DEFAULT
‪#define DEFAULT(__var, __default)
Definition: shared.gsh:270
‪array
‪function filter array
Definition: array_shared.csc:16
‪flame_death_fx
‪function flame_death_fx(localClientNum)
Definition: zombie_death.csc:35
‪WAIT_CLIENT_FRAME
‪#define WAIT_CLIENT_FRAME
Definition: shared.gsh:266
‪init_fire_fx
‪function autoexec init_fire_fx()
Definition: zombie_death.csc:9