‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_globallogic.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\array_shared;
4 #using scripts\shared\callbacks_shared;
5 #using scripts\shared\clientfield_shared;
6 #using scripts\shared\system_shared;
7 #using scripts\shared\util_shared;
8 #using scripts\shared\visionset_mgr_shared;
9 #using scripts\shared\weapons\_hive_gun;
10 #using scripts\shared\weapons\_weaponobjects;
11 
12 #insert scripts\mp\gametypes\_globallogic.gsh;
13 
14 #insert scripts\shared\shared.gsh;
15 #insert scripts\shared\version.gsh;
16 
17 #precache( "client_fx", "weapon/fx_hero_annhilatr_death_blood" );
18 #precache( "client_fx", "weapon/fx_hero_pineapple_death_blood" );
19 
20 #namespace globallogic;
21 
22 ‪REGISTER_SYSTEM( "globallogic", &‪__init__, "visionset_mgr" )
23 
24 function ‪__init__()
25 {
27 
28  //handles actor and player corpse case
29  ‪clientfield::register( "world", "game_ended", ‪VERSION_SHIP, 1, "int", &‪game_ended, true, true );
30  ‪clientfield::register( "world", "post_game", ‪VERSION_SHIP, 1, "int", &‪post_game, true, true );
31  RegisterClientField("playercorpse", "firefly_effect", ‪VERSION_SHIP, 2, "int", &‪firefly_effect_cb, false);
32  RegisterClientField("playercorpse", "annihilate_effect", ‪VERSION_SHIP, 1, "int", &‪annihilate_effect_cb, false);
33  RegisterClientField("playercorpse", "pineapplegun_effect", ‪VERSION_SHIP, 1, "int", &‪pineapplegun_effect_cb, false);
34  RegisterClientField("actor", "annihilate_effect", ‪VERSION_SHIP, 1, "int", &‪annihilate_effect_cb, false);
35  RegisterClientField("actor", "pineapplegun_effect", ‪VERSION_SHIP, 1, "int", &‪pineapplegun_effect_cb, false);
36 
37  level._effect[ "annihilate_explosion" ] = "weapon/fx_hero_annhilatr_death_blood";
38  level._effect[ "pineapplegun_explosion" ] = "weapon/fx_hero_pineapple_death_blood";
39 
40  level.gameEnded = false;
41  level.postGame = false;
42 }
43 
44 
45 function ‪game_ended(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
46 {
47  if( newVal && !level.gameEnded )
48  {
49  level notify("game_ended");
50  level.gameEnded = true;
51  }
52 }
53 
54 function ‪post_game(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
55 {
56  if( newVal && !level.postGame )
57  {
58  level notify("post_game");
59  level.postGame = true;
60  }
61 }
62 
63 function ‪firefly_effect_cb(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
64 {
65  if( bNewEnt && newVal)
66  {
67  self thread ‪hive_gun::gib_corpse( localClientNum, newVal );
68  }
69 }
70 
71 
72 function ‪annihilate_effect_cb(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
73 {
74 
75  if(newVal && !oldVal)
76  {
77  where = self GetTagOrigin( "J_SpineLower" );
78  if (!isdefined(where))
79  where = self.origin ;
80  where = where + (0,0,-40);
81 
82  character_index = self GetCharacterBodyType();
83  fields = GetCharacterFields( character_index, CurrentSessionMode() );
84  if ( fields.fullbodyexplosion != "" )
85  {
87  {
88  Playfx( localClientNum, fields.fullbodyexplosion, where );
89  }
90  Playfx( localClientNum, "explosions/fx_exp_grenade_default", where );
91  }
92  }
93 }
94 
95 
96 function ‪pineapplegun_effect_cb(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
97 {
98  if(newVal && !oldVal)
99  {
100  where = self GetTagOrigin( "J_SpineLower" );
101  if (!isdefined(where))
102  where = self.origin;
103 
104  if ( IsDefined( level._effect[ "pineapplegun_explosion" ] ) )
105  {
106  Playfx( localClientNum, level._effect["pineapplegun_explosion"], where );
107  }
108 
109  }
110 }
111 
112 #define PLANT_FIRST_SOUND .25
113 #define PLANT_SOUND_INTERVAL .15
114 
115 function ‪watch_plant_sound( localClientNum )
116 {
117  self endon ( "entityshutdown" );
118 
119  while( 1 )
120  {
121  self waittill ( "start_plant_sound" );
122  self thread ‪play_plant_sound( localClientNum );
123  }
124 }
125 
126 function ‪play_plant_sound( localClientNum )
127 {
128  self notify ( "play_plant_sound" );
129  self endon ( "play_plant_sound" );
130  self endon ( "entityshutdown" );
131  self endon ( "stop_plant_sound" );
132 
133  player = GetLocalPlayer( localClientNum );
134  plantWeapon = GetWeapon( "briefcase_bomb" );
135  defuseWeapon = GetWeapon( "briefcase_bomb_defuse" );
136 
138 
139  while( 1 )
140  {
141  if ( !isdefined( player ) ) // this happens when the player has not initially spawned in
142  {
143  return;
144  }
145 
146  if( ( player.weapon != plantWeapon ) && ( player.weapon != defuseWeapon ) )
147  {
148  return;
149  }
150 
151  if( ( player != self ) || IsThirdPerson( localClientNum ) )
152  {
153  self PlaySound( localClientNum, "fly_bomb_buttons_npc" );
154  }
155 
157  }
158 }
159 
160 
‪is_gib_restricted_build
‪function is_gib_restricted_build()
Definition: util_shared.csc:1305
‪firefly_effect_cb
‪function firefly_effect_cb(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _globallogic.csc:63
‪MPINTRO_VISIONSET_ALIAS
‪#define MPINTRO_VISIONSET_ALIAS
Definition: _globallogic.gsh:1
‪watch_plant_sound
‪function watch_plant_sound(localClientNum)
Definition: _globallogic.csc:115
‪is_mature
‪function is_mature()
Definition: util_shared.csc:1300
‪gib_corpse
‪function gib_corpse(localClientNum, value)
Definition: _hive_gun.csc:230
‪VERSION_SHIP
‪#define VERSION_SHIP
Definition: version.gsh:36
‪annihilate_effect_cb
‪function annihilate_effect_cb(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _globallogic.csc:72
‪__init__
‪function __init__()
Definition: _globallogic.csc:24
‪register_visionset_info
‪function register_visionset_info(name, version, lerp_step_count, visionset_from, visionset_to, visionset_type=VSMGR_VISIONSET_TYPE_NAKED)
Definition: visionset_mgr_shared.csc:50
‪play_plant_sound
‪function play_plant_sound(localClientNum)
Definition: _globallogic.csc:126
‪PLANT_FIRST_SOUND
‪#define PLANT_FIRST_SOUND
Definition: _globallogic.csc:112
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪game_ended
‪function game_ended(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _globallogic.csc:45
‪PLANT_SOUND_INTERVAL
‪#define PLANT_SOUND_INTERVAL
Definition: _globallogic.csc:113
‪MPINTRO_VISIONSET_NAME
‪#define MPINTRO_VISIONSET_NAME
Definition: _globallogic.gsh:4
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪MPINTRO_VISIONSET_STEPS
‪#define MPINTRO_VISIONSET_STEPS
Definition: _globallogic.gsh:3
‪post_game
‪function post_game(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _globallogic.csc:54
‪pineapplegun_effect_cb
‪function pineapplegun_effect_cb(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _globallogic.csc:96