‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_destructible.csc
Go to the documentation of this file.
1 #using scripts\shared\clientfield_shared;
2 #using scripts\shared\system_shared;
3 
4 #insert scripts\shared\shared.gsh;
5 #insert scripts\shared\clientfields.gsh;
6 #insert scripts\shared\version.gsh;
7 #insert scripts\mp\_destructible.gsh;
8 
9 #namespace destructible;
10 
11 ‪REGISTER_SYSTEM( "destructible", &‪__init__, undefined )
12 
13 function ‪__init__()
14 {
16 }
17 
18 function ‪playGrenadeRumble( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
19 {
20  PlayRumbleOnPosition( localClientNum, "grenade_rumble", self.origin );
21  GetLocalPlayer( localClientNum ) Earthquake( 0.5, 0.5, self.origin, 800 );
22 }
23 
24 function ‪doExplosion( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
25 {
26  if( newVal == 0 )
27  {
28  return;
29  }
30 
31  physics_explosion = false;
32 
33  if( newVal & ( 1 << ( ‪DESTRUCTIBLE_CLIENTFIELD_NUM_BITS - 1 ) ) )
34  {
35  physics_explosion = true;
36 
37  newVal -= ( 1 << ( ‪DESTRUCTIBLE_CLIENTFIELD_NUM_BITS - 1 ) ) ;
38  }
39 
40  physics_force = 0.3;
41 
42  if( physics_explosion )
43  {
44  PhysicsExplosionSphere( localClientNum, self.origin, newVal, newVal - 1, physics_force, 25, 400 );
45  }
46 
47  ‪playGrenadeRumble( localClientNum, self.origin );
48 }
‪__init__
‪function __init__()
Definition: _destructible.csc:13
‪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
‪DESTRUCTIBLE_CLIENTFIELD_NUM_BITS
‪#define DESTRUCTIBLE_CLIENTFIELD_NUM_BITS
Definition: _destructible.gsh:2
‪DESTRUCTIBLE_CLIENTFIELD
‪#define DESTRUCTIBLE_CLIENTFIELD
Definition: _destructible.gsh:1
‪CF_HOST_ONLY
‪#define CF_HOST_ONLY
Definition: version.gsh:102
‪doExplosion
‪function doExplosion(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _destructible.csc:24
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪playGrenadeRumble
‪function playGrenadeRumble(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _destructible.csc:18
‪register
‪function register()
Definition: _ai_tank.gsc:126