‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
All Data Structures Files Functions Variables Macros
archetype_damage_effects.csc
Go to the documentation of this file.
1 #insert scripts\shared\shared.gsh;
2 #insert scripts\shared\version.gsh;
3 #insert scripts\shared\ai\archetype_damage_effects.gsh;
4 
5 #insert scripts\shared\archetype_shared\archetype_shared.gsh;
6 
7 #using scripts\shared\clientfield_shared;
8 #using scripts\shared\array_shared;
9 #using scripts\shared\audio_shared;
10 #using scripts\shared\util_shared;
11 #using scripts\shared\math_shared;
12 
13 //firebug human torching...
14 #precache( "client_fx", "fire/fx_fire_ai_human_arm_left_loop" );
15 #precache( "client_fx", "fire/fx_fire_ai_human_arm_left_os" );
16 #precache( "client_fx", "fire/fx_fire_ai_human_arm_right_loop" );
17 #precache( "client_fx", "fire/fx_fire_ai_human_arm_right_os" );
18 #precache( "client_fx", "fire/fx_fire_ai_human_hip_left_loop" );
19 #precache( "client_fx", "fire/fx_fire_ai_human_hip_left_os" );
20 #precache( "client_fx", "fire/fx_fire_ai_human_hip_right_loop" );
21 #precache( "client_fx", "fire/fx_fire_ai_human_hip_right_os" );
22 #precache( "client_fx", "fire/fx_fire_ai_human_leg_left_loop" );
23 #precache( "client_fx", "fire/fx_fire_ai_human_leg_left_os" );
24 #precache( "client_fx", "fire/fx_fire_ai_human_leg_right_loop" );
25 #precache( "client_fx", "fire/fx_fire_ai_human_leg_right_os" );
26 #precache( "client_fx", "fire/fx_fire_ai_human_torso_loop" );
27 #precache( "client_fx", "fire/fx_fire_ai_human_torso_os" );
28 #precache( "client_fx", "fire/fx_fire_ai_human_head_loop" );
29 #precache( "client_fx", "fire/fx_fire_ai_human_head_os" );
30 
31 #precache( "client_fx", "fire/fx_fire_ai_robot_arm_left_loop" );
32 #precache( "client_fx", "fire/fx_fire_ai_robot_arm_left_os" );
33 #precache( "client_fx", "fire/fx_fire_ai_robot_arm_right_loop" );
34 #precache( "client_fx", "fire/fx_fire_ai_robot_arm_right_os" );
35 #precache( "client_fx", "fire/fx_fire_ai_robot_head_loop" );
36 #precache( "client_fx", "fire/fx_fire_ai_robot_head_os" );
37 #precache( "client_fx", "fire/fx_fire_ai_robot_leg_left_loop" );
38 #precache( "client_fx", "fire/fx_fire_ai_robot_leg_left_os" );
39 #precache( "client_fx", "fire/fx_fire_ai_robot_leg_right_loop" );
40 #precache( "client_fx", "fire/fx_fire_ai_robot_leg_right_os" );
41 #precache( "client_fx", "fire/fx_fire_ai_robot_torso_loop" );
42 #precache( "client_fx", "fire/fx_fire_ai_robot_torso_os" );
43 
44 #precache( "client_fx", "smoke/fx_smk_ai_human_arm_left_os" );
45 #precache( "client_fx", "smoke/fx_smk_ai_human_arm_right_os" );
46 #precache( "client_fx", "smoke/fx_smk_ai_human_head_os" );
47 #precache( "client_fx", "smoke/fx_smk_ai_human_hip_left_os" );
48 #precache( "client_fx", "smoke/fx_smk_ai_human_hip_right_os" );
49 #precache( "client_fx", "smoke/fx_smk_ai_human_leg_left_os" );
50 #precache( "client_fx", "smoke/fx_smk_ai_human_leg_right_os" );
51 #precache( "client_fx", "smoke/fx_smk_ai_human_torso_os" );
52 #precache( "client_fx", "smoke/fx_smk_ai_human_waist_os" );
53 
54 
55 
56 
57 
58 function autoexec ‪main()
59 {
60  // clientfield setup
62 
63  //effects caching
65 }
66 
68 {
71 }
72 
73 function ‪LoadEffects()
74 {
75  //fire fx
76  level._effect["fire_human_j_elbow_le_loop"] = "fire/fx_fire_ai_human_arm_left_loop"; // hand and forearm fires
77  level._effect["fire_human_j_elbow_ri_loop"] = "fire/fx_fire_ai_human_arm_right_loop";
78  level._effect["fire_human_j_shoulder_le_loop"] = "fire/fx_fire_ai_human_arm_left_loop"; // upper arm fires
79  level._effect["fire_human_j_shoulder_ri_loop"] = "fire/fx_fire_ai_human_arm_right_loop";
80  level._effect["fire_human_j_spine4_loop"] = "fire/fx_fire_ai_human_torso_loop"; // upper torso fires
81  level._effect["fire_human_j_hip_le_loop"] = "fire/fx_fire_ai_human_hip_left_loop"; // thigh fires
82  level._effect["fire_human_j_hip_ri_loop"] = "fire/fx_fire_ai_human_hip_right_loop";
83  level._effect["fire_human_j_knee_le_loop"] = "fire/fx_fire_ai_human_leg_left_loop"; // shin fires
84  level._effect["fire_human_j_knee_ri_loop"] = "fire/fx_fire_ai_human_leg_right_loop";
85  level._effect["fire_human_j_head_loop"] = "fire/fx_fire_ai_human_head_loop"; // head fire
86 
87  level._effect["fire_human_j_elbow_le_os"] = "fire/fx_fire_ai_human_arm_left_os"; // hand and forearm fires
88  level._effect["fire_human_j_elbow_ri_os"] = "fire/fx_fire_ai_human_arm_right_os";
89  level._effect["fire_human_j_shoulder_le_os"] = "fire/fx_fire_ai_human_arm_left_os"; // upper arm fires
90  level._effect["fire_human_j_shoulder_ri_os"] = "fire/fx_fire_ai_human_arm_right_os";
91  level._effect["fire_human_j_spine4_os"] = "fire/fx_fire_ai_human_torso_os"; // upper torso fires
92  level._effect["fire_human_j_hip_le_os"] = "fire/fx_fire_ai_human_hip_left_os"; // thigh fire
93  level._effect["fire_human_j_hip_ri_os"] = "fire/fx_fire_ai_human_hip_right_os";
94  level._effect["fire_human_j_knee_le_os"] = "fire/fx_fire_ai_human_leg_left_os"; // shin fires
95  level._effect["fire_human_j_knee_ri_os"] = "fire/fx_fire_ai_human_leg_right_os";
96  level._effect["fire_human_j_head_os"] = "fire/fx_fire_ai_human_head_os"; // head fire
97 
98  level._effect["fire_human_riotshield_j_elbow_le_loop"] = "fire/fx_fire_ai_human_arm_left_loop"; // hand and forearm fires
99  level._effect["fire_human_riotshield_j_elbow_ri_loop"] = "fire/fx_fire_ai_human_arm_right_loop";
100  level._effect["fire_human_riotshield_j_shoulder_le_loop"] = "fire/fx_fire_ai_human_arm_left_loop"; // upper arm fires
101  level._effect["fire_human_riotshield_j_shoulder_ri_loop"] = "fire/fx_fire_ai_human_arm_right_loop";
102  level._effect["fire_human_riotshield_j_spine4_loop"] = "fire/fx_fire_ai_human_torso_loop"; // upper torso fires
103  level._effect["fire_human_riotshield_j_hip_le_loop"] = "fire/fx_fire_ai_human_hip_left_loop"; // thigh fires
104  level._effect["fire_human_riotshield_j_hip_ri_loop"] = "fire/fx_fire_ai_human_hip_right_loop";
105  level._effect["fire_human_riotshield_j_knee_le_loop"] = "fire/fx_fire_ai_human_leg_left_loop"; // shin fires
106  level._effect["fire_human_riotshield_j_knee_ri_loop"] = "fire/fx_fire_ai_human_leg_right_loop";
107  level._effect["fire_human_riotshield_j_head_loop"] = "fire/fx_fire_ai_human_head_loop"; // head fire
108 
109  level._effect["fire_human_riotshield_j_elbow_le_os"] = "fire/fx_fire_ai_human_arm_left_os"; // hand and forearm fires
110  level._effect["fire_human_riotshield_j_elbow_ri_os"] = "fire/fx_fire_ai_human_arm_right_os";
111  level._effect["fire_human_riotshield_j_shoulder_le_os"] = "fire/fx_fire_ai_human_arm_left_os"; // upper arm fires
112  level._effect["fire_human_riotshield_j_shoulder_ri_os"] = "fire/fx_fire_ai_human_arm_right_os";
113  level._effect["fire_human_riotshield_j_spine4_os"] = "fire/fx_fire_ai_human_torso_os"; // upper torso fires
114  level._effect["fire_human_riotshield_j_hip_le_os"] = "fire/fx_fire_ai_human_hip_left_os"; // thigh fire
115  level._effect["fire_human_riotshield_j_hip_ri_os"] = "fire/fx_fire_ai_human_hip_right_os";
116  level._effect["fire_human_riotshield_j_knee_le_os"] = "fire/fx_fire_ai_human_leg_left_os"; // shin fires
117  level._effect["fire_human_riotshield_j_knee_ri_os"] = "fire/fx_fire_ai_human_leg_right_os";
118  level._effect["fire_human_riotshield_j_head_os"] = "fire/fx_fire_ai_human_head_os"; // head fire
119 
120  //fire fx
121  level._effect["fire_warlord_j_elbow_le_loop"] = "fire/fx_fire_ai_human_arm_left_loop"; // hand and forearm fires
122  level._effect["fire_warlord_j_elbow_ri_loop"] = "fire/fx_fire_ai_human_arm_right_loop";
123  level._effect["fire_warlord_j_shoulder_le_loop"] = "fire/fx_fire_ai_human_arm_left_loop"; // upper arm fires
124  level._effect["fire_warlord_j_shoulder_ri_loop"] = "fire/fx_fire_ai_human_arm_right_loop";
125  level._effect["fire_warlord_j_spine4_loop"] = "fire/fx_fire_ai_human_torso_loop"; // upper torso fires
126  level._effect["fire_warlord_j_hip_le_loop"] = "fire/fx_fire_ai_human_hip_left_loop"; // thigh fires
127  level._effect["fire_warlord_j_hip_ri_loop"] = "fire/fx_fire_ai_human_hip_right_loop";
128  level._effect["fire_warlord_j_knee_le_loop"] = "fire/fx_fire_ai_human_leg_left_loop"; // shin fires
129  level._effect["fire_warlord_j_knee_ri_loop"] = "fire/fx_fire_ai_human_leg_right_loop";
130  level._effect["fire_warlord_j_head_loop"] = "fire/fx_fire_ai_human_head_loop"; // head fire
131 
132  level._effect["fire_warlord_j_elbow_le_os"] = "fire/fx_fire_ai_human_arm_left_os"; // hand and forearm fires
133  level._effect["fire_warlord_j_elbow_ri_os"] = "fire/fx_fire_ai_human_arm_right_os";
134  level._effect["fire_warlord_j_shoulder_le_os"] = "fire/fx_fire_ai_human_arm_left_os"; // upper arm fires
135  level._effect["fire_warlord_j_shoulder_ri_os"] = "fire/fx_fire_ai_human_arm_right_os";
136  level._effect["fire_warlord_j_spine4_os"] = "fire/fx_fire_ai_human_torso_os"; // upper torso fires
137  level._effect["fire_warlord_j_hip_le_os"] = "fire/fx_fire_ai_human_hip_left_os"; // thigh fire
138  level._effect["fire_warlord_j_hip_ri_os"] = "fire/fx_fire_ai_human_hip_right_os";
139  level._effect["fire_warlord_j_knee_le_os"] = "fire/fx_fire_ai_human_leg_left_os"; // shin fires
140  level._effect["fire_warlord_j_knee_ri_os"] = "fire/fx_fire_ai_human_leg_right_os";
141  level._effect["fire_warlord_j_head_os"] = "fire/fx_fire_ai_human_head_os"; // head fire
142 
143 
144  //fire fx
145  level._effect["fire_zombie_j_elbow_le_os"] = "fire/fx_fire_ai_human_arm_left_os"; // hand and forearm fires
146  level._effect["fire_zombie_j_elbow_ri_os"] = "fire/fx_fire_ai_human_arm_right_os";
147  level._effect["fire_zombie_j_shoulder_le_os"] = "fire/fx_fire_ai_human_arm_left_os"; // upper arm fires
148  level._effect["fire_zombie_j_shoulder_ri_os"] = "fire/fx_fire_ai_human_arm_right_os";
149  level._effect["fire_zombie_j_spine4_os"] = "fire/fx_fire_ai_human_torso_os"; // upper torso fires
150  level._effect["fire_zombie_j_hip_le_os"] = "fire/fx_fire_ai_human_hip_left_os"; // thigh fire
151  level._effect["fire_zombie_j_hip_ri_os"] = "fire/fx_fire_ai_human_hip_right_os";
152  level._effect["fire_zombie_j_knee_le_os"] = "fire/fx_fire_ai_human_leg_left_os"; // shin fires
153  level._effect["fire_zombie_j_knee_ri_os"] = "fire/fx_fire_ai_human_leg_right_os";
154  level._effect["fire_zombie_j_head_os"] = "fire/fx_fire_ai_human_head_os"; // head fire
155 
156  //smoke fx
157  level._effect["smolder_human_j_elbow_le_os"] = "smoke/fx_smk_ai_human_arm_left_os";
158  level._effect["smolder_human_j_elbow_ri_os"] = "smoke/fx_smk_ai_human_arm_right_os";
159  level._effect["smolder_human_j_shoulder_le_os"] = "smoke/fx_smk_ai_human_arm_left_os";
160  level._effect["smolder_human_j_shoulder_ri_os"] = "smoke/fx_smk_ai_human_arm_right_os";
161  level._effect["smolder_human_j_spine4_os"] = "smoke/fx_smk_ai_human_torso_os";
162  level._effect["smolder_human_j_hip_le_os"] = "smoke/fx_smk_ai_human_hip_left_os";
163  level._effect["smolder_human_j_hip_ri_os"] = "smoke/fx_smk_ai_human_hip_right_os";
164  level._effect["smolder_human_j_knee_le_os"] = "smoke/fx_smk_ai_human_leg_left_os";
165  level._effect["smolder_human_j_knee_ri_os"] = "smoke/fx_smk_ai_human_leg_right_os";
166  level._effect["smolder_human_j_head_os"] = "smoke/fx_smk_ai_human_head_os";
167 
168 
169  // robot-specific fires
170  level._effect["fire_robot_j_elbow_le_rot_loop"] = "fire/fx_fire_ai_robot_arm_left_loop"; // hand and forearm fires
171  level._effect["fire_robot_j_elbow_ri_rot_loop"] = "fire/fx_fire_ai_robot_arm_right_loop";
172  level._effect["fire_robot_j_shoulder_le_rot_loop"] = "fire/fx_fire_ai_robot_arm_left_loop"; // upper arm fires
173  level._effect["fire_robot_j_shoulder_ri_rot_loop"] = "fire/fx_fire_ai_robot_arm_right_loop";
174  level._effect["fire_robot_j_spine4_loop"] = "fire/fx_fire_ai_robot_torso_loop"; // upper torso fires
175  level._effect["fire_robot_j_knee_le_loop"] = "fire/fx_fire_ai_robot_leg_left_loop"; // shin fires
176  level._effect["fire_robot_j_knee_ri_loop"] = "fire/fx_fire_ai_robot_leg_right_loop";
177  level._effect["fire_robot_j_head_loop"] = "fire/fx_fire_ai_robot_head_loop"; // head fire
178  level._effect["fire_robot_j_elbow_le_rot_os"] = "fire/fx_fire_ai_robot_arm_left_os"; // hand and forearm fires
179  level._effect["fire_robot_j_elbow_ri_rot_os"] = "fire/fx_fire_ai_robot_arm_right_os";
180  level._effect["fire_robot_j_shoulder_le_rot_os"] = "fire/fx_fire_ai_robot_arm_left_os"; // upper arm fires
181  level._effect["fire_robot_j_shoulder_ri_rot_os"] = "fire/fx_fire_ai_robot_arm_right_os";
182  level._effect["fire_robot_j_spine4_os"] = "fire/fx_fire_ai_robot_torso_os"; // upper torso fires
183  level._effect["fire_robot_j_knee_le_os"] = "fire/fx_fire_ai_robot_leg_left_os"; // shin fires
184  level._effect["fire_robot_j_knee_ri_os"] = "fire/fx_fire_ai_robot_leg_right_os";
185  level._effect["fire_robot_j_head_os"] = "fire/fx_fire_ai_robot_head_os"; // head fire
186 }
187 
188 //------------------------------FIRE FX------------------------------
189 
190 function private ‪_burnTag(localClientNum, tag, postfix)
191 {
192  if(isDefined(self) && self HasDObj(localClientNum) )
193  {
194  fx_to_play = undefined;
195 
196  fxname = "fire_"+self.archetype+"_"+tag+postfix;
197 
198  if( isdefined(level._effect[fxname]))
199  {
200  fx_to_play = level._effect[fxname];
201  }
202 
203  if( isdefined( self._effect ) && isdefined( self._effect[fxname]))
204  {
205  fx_to_play = self._effect[fxname];
206  }
207 
208  if( isDefined( fx_to_play ))
209  {
210  fx = PlayFXOnTag(localClientNum, fx_to_play, self, tag);
211 
212  if( ‪IS_BONUSZM && IsDefined(fx) )
213  {
214  SetFXIgnorePause( localClientNum, fx, true );
215  }
216 
217  return fx;
218  }
219  }
220 }
221 
222 function private ‪_burnStage(localClientNum, tagArray, shouldWait )
223 {
224  if(!isDefined(self))
225  return;
226 
227  self endon("entityshutdown");
228 
229  tags = array::randomize(tagArray);
230 
231  for(i=1;i<tags.size;i++)//drop random one for variance.
232  {
233  if ( tags[i] == "null" )
234  {
235  continue;
236  }
237  self.activeFX[self.activeFX.size] = self ‪_burnTag(localClientNum, tags[i],(shouldWait?"_loop":"_os") );
238  if(shouldWait)
239  {
240  wait RandomFloatRange(0.1,.3);
241  }
242  }
243  if(shouldWait)
244  {
245  wait RandomFloatRange(0,1);
246  }
247  if ( isDefined(self) )
248  self notify("burn_stage_finished");
249 }
250 
251 function private ‪_burnBody(localClientNum)
252 {
253  self endon("entityshutdown");
254 
255  self.burn_loop_sound_handle = self playloopsound( "chr_burn_npc_loop1", .2);
256  ‪timer = 10;
257 
258  boneModifier = "";
259  if ( self.archetype == "robot" )
260  {
261  boneModifier = "_rot";
262  ‪timer = 6;
263  }
264 
265  if( ‪IS_BONUSZM ) // special case for a suicidal zombie in campaign zombies
266  {
267  if( self.archetype !== ‪ARCHETYPE_ZOMBIE )
268  {
269  self thread ‪sndStopBurnLoop(‪timer);
270  }
271  }
272  else
273  {
274  self thread ‪sndStopBurnLoop(‪timer);
275  }
276 
277  stage1BurnTags = ‪array("j_elbow_le"+boneModifier, "j_elbow_ri"+boneModifier, "null");
278  stage2BurnTags = ‪array("j_shoulder_le"+boneModifier, "j_shoulder_ri"+boneModifier, "null");
279  stage3BurnTags = ‪array("j_spine4", "null");
280  stage4BurnTags = ‪array("j_hip_le", "j_hip_ri", "j_head", "null");
281  stage5BurnTags = ‪array("j_knee_le", "j_knee_ri", "null");
282 
283  matureMask = 0.0;
284  if ( ‪util::is_mature() )
285  matureMask = 1.0;
286 
287  self.activeFX = [];
288  self.activeFX[self.activeFX.size] = self thread ‪_burnStage(localClientNum, stage1BurnTags,true);
289  self MapShaderConstant( localClientNum, 0, "scriptVector0", matureMask * 0.20 );
290  self waittill("burn_stage_finished");
291  self.activeFX[self.activeFX.size] = self thread ‪_burnStage(localClientNum, stage2BurnTags,true);
292  self MapShaderConstant( localClientNum, 0, "scriptVector0", matureMask * 0.40 );
293  self waittill("burn_stage_finished");
294  self.activeFX[self.activeFX.size] = self thread ‪_burnStage(localClientNum, stage3BurnTags,true);
295  self MapShaderConstant( localClientNum, 0, "scriptVector0", matureMask * 0.60 );
296  self waittill("burn_stage_finished");
297  self.activeFX[self.activeFX.size] = self thread ‪_burnStage(localClientNum, stage4BurnTags,true);
298  self MapShaderConstant( localClientNum, 0, "scriptVector0", matureMask * 0.80 );
299  self waittill("burn_stage_finished");
300  self.activeFX[self.activeFX.size] = self thread ‪_burnStage(localClientNum, stage5BurnTags,true);
301  self MapShaderConstant( localClientNum, 0, "scriptVector0", matureMask * 1.00 );
302 }
303 
305 {
306  self ‪util::waittill_any_timeout(‪timer, "entityshutdown", "stopBurningSounds" );
307 
308  if(isDefined(self))
309  {
310  if( isdefined( self.burn_loop_sound_handle ) )
311  {
312  self stoploopsound( self.burn_loop_sound_handle );
313  }
314  }
315 }
316 
317 function private ‪_burnCorpse(localClientNum, burningDuration)
318 {
319  self endon("entityshutdown");
320 
321  ‪timer = 10;
322 
323  boneModifier = "";
324  if ( self.archetype == "robot" )
325  {
326  boneModifier = "_rot";
327  ‪timer = 3;
328  }
329 
330  stage1BurnTags = ‪array("j_elbow_le"+boneModifier, "j_elbow_ri"+boneModifier);
331  stage2BurnTags = ‪array("j_shoulder_le"+boneModifier, "j_shoulder_ri"+boneModifier);
332  stage3BurnTags = ‪array("j_spine4", "j_spinelower", "null");
333  stage4BurnTags = ‪array("j_hip_le", "j_hip_ri", "j_head");
334  stage5BurnTags = ‪array("j_knee_le", "j_knee_ri");
335 
336  self.burn_loop_sound_handle = self playloopsound( "chr_burn_npc_loop1", .2);
337  self thread ‪sndStopBurnLoop(‪timer);
338 
339  // TODO: If self is a robot, check which parts have gibbed and don't play effects on those bones.
340  // TODO: If there's a way to find out which effects were played on this archetype before it became a corpse, play only the oneshot versions of those effects.
341  self.activeFX = [];
342  self.activeFX[self.activeFX.size] = self thread ‪_burnStage(localClientNum, stage1BurnTags, false);
343  self.activeFX[self.activeFX.size] = self thread ‪_burnStage(localClientNum, stage2BurnTags, false);
344  self.activeFX[self.activeFX.size] = self thread ‪_burnStage(localClientNum, stage3BurnTags, false);
345  self.activeFX[self.activeFX.size] = self thread ‪_burnStage(localClientNum, stage4BurnTags, false);
346  self.activeFX[self.activeFX.size] = self thread ‪_burnStage(localClientNum, stage5BurnTags, false);
347 
348  matureMask = 0.0;
349  if ( ‪util::is_mature() )
350  matureMask = 1.0;
351 
352  self MapShaderConstant( localClientNum, 0, "scriptVector0", matureMask * 1.0 );
353 
354  wait 20;
355 
356  if(isDefined(self))
357  {
358  foreach(fx in self.activeFX)
359  {
360  StopFx(localClientNum,fx);
361  //wait RandomFloatRange(0.25,2); // effect timeouts are baked in, so they should all have stopped by now
362  self notify( "stopBurningSounds" );
363  }
364  if(isDefined(self))
365  self.activeFX = [];
366  }
367 }
368 
369 
370 function private ‪_smolderCorpse(localClientNum)
371 {
372  self endon("entityshutdown");
373 
374  boneModifier = "";
375  if ( self.archetype == "robot" )
376  {
377  boneModifier = "_rot";
378  }
379 
380  activeFX = [];
381  fxToPlay = [];
382  tags = ‪array("j_elbow_le"+boneModifier,"j_elbow_ri"+boneModifier,"j_shoulder_le","j_shoulder_ri","j_spine4","j_hip_le","j_hip_ri","j_knee_le","j_knee_ri","j_head");
383  num = RandomIntRange(6,10);
384  while(num)
385  {
386  fxToPlay[fxToPlay.size] = tags[RandomInt(tags.size)]; //dont care if there are dups
387  num--;
388  }
389  foreach(tag in fxToPlay)
390  {
391  fx = "smolder_"+self.archetype+tag+"_os";
392  if(isDefined(level._effect[fx]))
393  {
394  activeFX[activeFX.size] = playfxontag(localClientNum,level._effect[fx],self,tag);
395  wait RandomFloatRange(0.1,1);
396  }
397  }
398  wait 20;
399  if(isDefined(self))
400  {
401  foreach(fx in activeFX)
402  {
403  StopFx(localClientNum,fx);
404  }
405  }
406 }
407 
408 
409 function ‪actor_fire_fx(localClientNum, value, burningDuration)
410 {
411  switch(value)
412  {
413  case ‪BURN_CLEAR: //turn off burning
414  if (isDefined(self.activeFX))
415  {
416  self StopAllLoopSounds(1);
417 
418  foreach(fx in self.activeFX)
419  {
420  StopFx(localClientNum,fx);
421  }
422  }
423  self.activeFX = [];
424  break;
425  case ‪BURN_BODY: //burning
426  self thread ‪_burnBody(localClientNum);
427  break;
428  case ‪BURN_CORPSE:
429  self thread ‪_burnCorpse(localClientNum, burningDuration);
430  break;
431  case ‪BURN_SMOLDER:
432  self thread ‪_smolderCorpse(localClientNum);
433  break;
434  }
435 }
436 function ‪actor_fire_fx_state(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
437 {
438  self ‪actor_fire_fx(localClientNum, newVal, ‪FIRE_FX_MAX_DURATION);
439 }
440 
441 function ‪actor_char(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
442 {
443  matureMask = 0.0;
444  if ( ‪util::is_mature() )
445  matureMask = 1.0;
446 
447  switch(newVal)
448  {
449  case ‪CHAR_RAMP:
450  self thread ‪actorCharRampTo(localClientNum,1);
451  break;
452  case ‪CHAR_CLEAR:
453  self MapShaderConstant( localClientNum, 0, "scriptVector0", 0);
454  break;
455  case CHAR_FULL:
456  self MapShaderConstant( localClientNum, 0, "scriptVector0", matureMask * 1.0 );
457  break;
458  }
459 }
460 
461 #define CHAR_RAMP_TIME 2
462 function ‪actorCharRampTo(localClientNum,charDesired)
463 {
464  self endon("entityshutdown");
465 
466  if(!isDefined(self.curCharLevel))
467  self.curCharLevel = 0;
468 
469  matureMask = 0.0;
470  if ( ‪util::is_mature() )
471  matureMask = 1.0;
472 
473  if(!isDefined(self.charsteps))
474  {
475  assert(isDefined(charDesired));
476  self.charsteps = int(‪CHAR_RAMP_TIME / 0.01);
477  delta = charDesired - self.curCharLevel;
478  self.charinc = delta/self.charsteps;
479  }
480  while(self.charsteps)
481  {
482  self.curCharLevel = ‪math::clamp(self.curCharLevel+self.charinc,0,1);
483  self MapShaderConstant( localClientNum, 0, "scriptVector0", matureMask * self.curCharLevel );
484  self.charsteps--;
485  wait 0.01;
486  }
487 }
‪BURN_BODY
‪#define BURN_BODY
Definition: archetype_damage_effects.gsh:4
‪sndStopBurnLoop
‪function sndStopBurnLoop(timer)
Definition: archetype_damage_effects.csc:304
‪timer
‪function timer(n_time, str_endon, x, y, height)
Definition: lui_shared.gsc:163
‪is_mature
‪function is_mature()
Definition: util_shared.csc:1300
‪actor_fire_fx_state
‪function actor_fire_fx_state(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: archetype_damage_effects.csc:436
‪actorCharRampTo
‪function actorCharRampTo(localClientNum, charDesired)
Definition: archetype_damage_effects.csc:462
‪CHAR_CLEAR
‪#define CHAR_CLEAR
Definition: archetype_damage_effects.gsh:8
‪_burnCorpse
‪function private _burnCorpse(localClientNum, burningDuration)
Definition: archetype_damage_effects.csc:317
‪CF_CALLBACK_ZERO_ON_NEW_ENT
‪#define CF_CALLBACK_ZERO_ON_NEW_ENT
Definition: version.gsh:103
‪VERSION_SHIP
‪#define VERSION_SHIP
Definition: version.gsh:36
‪waittill_any_timeout
‪function waittill_any_timeout(n_timeout, string1, string2, string3, string4, string5)
Definition: util_shared.csc:423
‪_burnStage
‪function private _burnStage(localClientNum, tagArray, shouldWait)
Definition: archetype_damage_effects.csc:222
‪_smolderCorpse
‪function private _smolderCorpse(localClientNum)
Definition: archetype_damage_effects.csc:370
‪CHAR_RAMP
‪#define CHAR_RAMP
Definition: archetype_damage_effects.gsh:9
‪FIRE_FX_MAX_DURATION
‪#define FIRE_FX_MAX_DURATION
Definition: archetype_damage_effects.gsh:1
‪BURN_CLEAR
‪#define BURN_CLEAR
Definition: archetype_damage_effects.gsh:3
‪CHAR_RAMP_TIME
‪#define CHAR_RAMP_TIME
Definition: archetype_damage_effects.csc:461
‪_burnBody
‪function private _burnBody(localClientNum)
Definition: archetype_damage_effects.csc:251
‪CF_HOST_ONLY
‪#define CF_HOST_ONLY
Definition: version.gsh:102
‪array
‪function filter array
Definition: array_shared.csc:16
‪ARCHETYPE_ZOMBIE
‪#define ARCHETYPE_ZOMBIE
Definition: archetype_shared.gsh:10
‪_burnTag
‪function private _burnTag(localClientNum, tag, postfix)
Definition: archetype_damage_effects.csc:190
‪actor_fire_fx
‪function actor_fire_fx(localClientNum, value, burningDuration)
Definition: archetype_damage_effects.csc:409
‪LoadEffects
‪function LoadEffects()
Definition: archetype_damage_effects.csc:73
‪main
‪function autoexec main()
Definition: archetype_damage_effects.csc:58
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪clamp
‪function clamp(val, val_min, val_max)
Definition: math_shared.csc:16
‪IS_BONUSZM
‪#define IS_BONUSZM
Definition: shared.gsh:532
‪BURN_SMOLDER
‪#define BURN_SMOLDER
Definition: archetype_damage_effects.gsh:6
‪actor_char
‪function actor_char(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: archetype_damage_effects.csc:441
‪BURN_CORPSE
‪#define BURN_CORPSE
Definition: archetype_damage_effects.gsh:5
‪RegisterClientFields
‪function RegisterClientFields()
Definition: archetype_damage_effects.csc:67