‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_shellshock.gsc
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 #using scripts\shared\util_shared;
6 #using scripts\shared\system_shared;
7 
8 #insert scripts\shared\shared.gsh;
9 
10 #using scripts\mp\_util;
11 
12 #namespace shellshock;
13 
14 ‪REGISTER_SYSTEM( "shellshock", &‪__init__, undefined )
15 
16 function ‪__init__()
17 {
19 
20  level.shellshockOnPlayerDamage = &‪on_damage;
21 }
22 
23 function ‪init()
24 {
25 }
26 
27 function ‪on_damage( cause, ‪damage, weapon )
28 {
29  if ( self ‪util::isFlashbanged() )
30  {
31  return; // don't interrupt flashbang shellshock
32 
33  }
34 
35  if( self.health <= 0 )
36  {
37  self ‪clientfield::set_to_player("sndMelee", 0);
38  }
39 
40  if ( cause == "MOD_EXPLOSIVE" ||
41  cause == "MOD_GRENADE" ||
42  cause == "MOD_GRENADE_SPLASH" ||
43  cause == "MOD_PROJECTILE" ||
44  cause == "MOD_PROJECTILE_SPLASH" )
45  {
46  // if we are using this as a impact damage only projectile then no shellshock
47  // we should probably add a bool to the weapon to indicate that it spawn protects
48  if ( weapon.explosionradius == 0 )
49  return;
50 
51  time = 0;
52 
53  if(‪damage >= 90)
54  time = 4;
55  else if(‪damage >= 50)
56  time = 3;
57  else if(‪damage >= 25)
58  time = 2;
59  else if(‪damage > 10)
60  time = 2;
61 
62  if ( time )
63  {
64  if ( self ‪util::mayApplyScreenEffect() && self HasPerk( "specialty_flakjacket" ) == false )
65  {
66  self shellshock("frag_grenade_mp", 0.5);
67  }
68  }
69  }
70 }
71 
72 function ‪end_on_death()
73 {
74  self waittill( "death" );
75  waittillframeend;
76  self notify ( "end_explode" );
77 }
78 
80 {
81  self endon( "disconnect" );
82 
83  wait( ‪timer );
84  self notify( "end_on_timer" );
85 }
86 
87 function ‪rcbomb_earthquake(position)
88 {
89  PlayRumbleOnPosition( "grenade_rumble", position );
90  Earthquake( 0.5, 0.5, self.origin, 512 );
91 }
93 {
94  self endon ("death");
95 
96  wait (6);
97  self ‪clientfield::set_to_player("sndMelee", 0);
98  self notify ("snd_melee_end");
99 }
‪timer
‪function timer(n_time, str_endon, x, y, height)
Definition: lui_shared.gsc:163
‪end_on_death
‪function end_on_death()
Definition: _shellshock.gsc:72
‪set_to_player
‪function set_to_player(str_field_name, n_value)
Definition: clientfield_shared.gsc:58
‪reset_meleeSnd
‪function reset_meleeSnd()
Definition: _shellshock.gsc:92
‪on_start_gametype
‪function on_start_gametype(func, obj)
Definition: callbacks_shared.csc:285
‪damage
‪function damage(trap)
Definition: _zm_trap_electric.gsc:116
‪end_on_timer
‪function end_on_timer(timer)
Definition: _shellshock.gsc:79
‪__init__
‪function __init__()
Definition: _shellshock.gsc:16
‪on_damage
‪function on_damage(cause, damage, weapon)
Definition: _shellshock.gsc:27
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪init
‪function init()
Definition: _shellshock.gsc:23
‪mayApplyScreenEffect
‪function mayApplyScreenEffect()
Definition: util_shared.gsc:2613
‪isFlashbanged
‪function isFlashbanged()
Definition: _util.gsc:703
‪rcbomb_earthquake
‪function rcbomb_earthquake(position)
Definition: _shellshock.gsc:87