‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
All Data Structures Files Functions Variables Macros
_zm_trap_fire.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\clientfield_shared;
4 #using scripts\shared\exploder_shared;
5 #using scripts\shared\system_shared;
6 #using scripts\shared\visionset_mgr_shared;
7 
8 #insert scripts\shared\shared.gsh;
9 #insert scripts\shared\version.gsh;
10 
11 #insert scripts\zm\_zm_traps.gsh;
12 
13 #namespace zm_trap_fire;
14 
15 ‪REGISTER_SYSTEM( "zm_trap_fire", &‪__init__, undefined )
16 
17 function ‪__init__()
18 {
19  a_traps = ‪struct::get_array( "trap_fire", "targetname" );
20  foreach( trap in a_traps )
21  {
23  }
24 }
25 
26 function ‪trap_fx_monitor( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
27 {
28  exploder_name = "trap_fire_" + fieldName;
29  if ( newVal )
30  {
31  ‪exploder::exploder( exploder_name );
32  }
33  else
34  {
35  ‪exploder::stop_exploder( exploder_name );
36  }
37 
38  fire_points = ‪struct::get_array( fieldName,"targetname" );
39 
40  foreach( point in fire_points )
41  {
42  if( !isdefined( point.script_noteworthy ) )
43  {
44  if( newVal )
45  {
46  point thread ‪fire_trap_fx();
47  }
48  else
49  {
50  point thread ‪stop_trap_fx();
51  }
52  }
53  }
54 }
55 
56 function ‪fire_trap_fx() // self == a single fire point of an electric trap
57 {
58  ang = self.angles;
59  forward = AnglesToForward(ang);
60  up = AnglesToUp(ang);
61 
62  if ( isdefined( self.loopFX ) && self.loopFX.size )
63  {
65  }
66 
67  if(!isdefined(self.loopFX))
68  {
69  self.loopFX = [];
70  }
71 
72  players = GetLocalPlayers();
73 
74  for(i = 0; i < players.size; i++)
75  {
76  self.loopFX[i] = ‪PlayFx( i, level._effect["fire_trap"], self.origin, forward, up, 0);
77  }
78 }
79 
80 function ‪stop_trap_fx() // self == a single fire point of an electric trap
81 {
82  players = GetLocalPlayers();
83 
84  for(i = 0; i < players.size; i++)
85  {
86  if ( isdefined( self.loopFX[i] ) )
87  {
88  StopFx( i, self.loopFX[i] );
89  }
90  }
91 
92  self.loopFX = [];
93 }
‪exploder
‪function exploder(exploder_id, n_localclientnumber)
Definition: exploder_shared.csc:297
‪stop_exploder
‪function stop_exploder(exploder_id, n_localclientnumber)
Definition: exploder_shared.csc:368
‪CF_CALLBACK_ZERO_ON_NEW_ENT
‪#define CF_CALLBACK_ZERO_ON_NEW_ENT
Definition: version.gsh:103
‪get_array
‪function get_array(kvp_value, kvp_key="targetname")
Definition: struct.csc:34
‪stop_trap_fx
‪function stop_trap_fx()
Definition: _zm_trap_fire.csc:80
‪trap_fx_monitor
‪function trap_fx_monitor(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _zm_trap_fire.csc:26
‪__init__
‪function __init__()
Definition: _zm_trap_fire.csc:17
‪CF_HOST_ONLY
‪#define CF_HOST_ONLY
Definition: version.gsh:102
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪VERSION_DLC5
‪#define VERSION_DLC5
Definition: version.gsh:99
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪fire_trap_fx
‪function fire_trap_fx()
Definition: _zm_trap_fire.csc:56
‪PlayFx
‪function PlayFx(name)
Definition: _counteruav.gsc:390