‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_gadget_shield.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\clientfield_shared;
5 
6 #using scripts\shared\abilities\_ability_player;
7 #using scripts\shared\abilities\_ability_power;
8 #using scripts\shared\abilities\_ability_util;
9 
10 #insert scripts\shared\shared.gsh;
11 #insert scripts\shared\version.gsh;
12 
13 #using scripts\shared\system_shared;
14 
15 ‪REGISTER_SYSTEM( "gadget_shield", &‪__init__, undefined )
16 
17 function ‪__init__()
18 {
20 
22 }
23 
24 function ‪on_player_spawned( local_client_num )
25 {
26  self._gadget_has_shield = false;
27 }
28 
29 function ‪has_shield_changed( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
30 {
31  self._gadget_has_shield = newVal;
32 
33  ‪update_sound( localClientNum );
34 }
35 
36 function ‪update_sound( localClientNum )
37 {
38  if ( !IsDefined( self._gadget_shield_snd_ent ) )
39  {
40  self._gadget_shield_snd_ent = ‪Spawn( localClientNum, self.origin, "script_origin" );
41  }
42 
43  if ( ‪IS_TRUE(self._gadget_has_shield) )
44  {
45  self._gadget_shield_snd_ent PlayLoopSound( "gdt_energy_shield_loop", 0.5 );
46  }
47  else
48  {
49  self._gadget_shield_snd_ent StopAllLoopSounds( 0.5 );
50  }
51 }
‪on_player_spawned
‪function on_player_spawned(local_client_num)
Definition: _gadget_shield.csc:24
‪__init__
‪function __init__()
Definition: _gadget_shield.csc:17
‪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
‪has_shield_changed
‪function has_shield_changed(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _gadget_shield.csc:29
‪IS_TRUE
‪#define IS_TRUE(__a)
Definition: shared.gsh:251
‪on_spawned
‪function on_spawned(func, obj)
Definition: callbacks_shared.csc:245
‪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
‪Spawn
‪function Spawn(parent, onDeathCallback)
Definition: _flak_drone.gsc:427
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪update_sound
‪function update_sound(localClientNum)
Definition: _gadget_shield.csc:36