‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_helicopter_gunner.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\clientfield_shared;
4 #using scripts\shared\system_shared;
5 #using scripts\shared\util_shared;
6 #using scripts\shared\visionset_mgr_shared;
7 
8 #insert scripts\shared\shared.gsh;
9 #insert scripts\mp\killstreaks\_killstreaks.gsh;
10 
11 #insert scripts\shared\version.gsh;
12 
13 #namespace helicopter_gunner;
14 
15 ‪REGISTER_SYSTEM( "helicopter_gunner", &‪__init__, undefined )
16 
17 function ‪__init__()
18 {
21  ‪clientfield::register( "toplayer", "vtol_update_client", ‪VERSION_SHIP, 1, "counter", &‪update_client, !‪CF_HOST_ONLY, !‪CF_CALLBACK_ZERO_ON_NEW_ENT );
23 
25 }
26 
27 function ‪turret_destroyed_0( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
28 {
29 }
30 
31 function ‪turret_destroyed_1( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
32 {
33 }
34 
35 function ‪update_turret_destroyed( localClientNum, ui_model_name, new_value )
36 {
37  part_destroyed_ui_model = GetUIModel( GetUIModelForController( localClientNum ), ui_model_name );
38 
39  if ( isdefined( part_destroyed_ui_model ) )
40  SetUIModelValue( part_destroyed_ui_model, new_value );
41 }
42 
43 function ‪update_client( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
44 {
45  veh = GetPlayerVehicle( self );
46  if( isdefined( veh ) )
47  {
48  ‪update_turret_destroyed( localClientNum, "vehicle.partDestroyed.0", veh ‪clientfield::get( "vtol_turret_destroyed_0" ) );
49  ‪update_turret_destroyed( localClientNum, "vehicle.partDestroyed.1", veh ‪clientfield::get( "vtol_turret_destroyed_1" ) );
50  }
51 }
52 
53 function ‪fog_bank_2_callback(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
54 {
55  if ( oldVal != newVal )
56  {
57  if ( newVal == 1 )
58  {
59  SetLitFogBank( localClientNum, -1, 1, 0);
60  }
61  else
62  {
63  SetLitFogBank( localClientNum, -1, 0, 0);
64  }
65  }
66 }
‪turret_destroyed_0
‪function turret_destroyed_0(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _helicopter_gunner.csc:27
‪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
‪update_client
‪function update_client(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _helicopter_gunner.csc:43
‪get
‪function get(kvp_value, kvp_key="targetname")
Definition: struct.csc:13
‪__init__
‪function __init__()
Definition: _helicopter_gunner.csc:17
‪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
‪fog_bank_2_callback
‪function fog_bank_2_callback(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _helicopter_gunner.csc:53
‪turret_destroyed_1
‪function turret_destroyed_1(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _helicopter_gunner.csc:31
‪CF_HOST_ONLY
‪#define CF_HOST_ONLY
Definition: version.gsh:102
‪MOTHERSHIP_VISIONSET_FILE
‪#define MOTHERSHIP_VISIONSET_FILE
Definition: _killstreaks.gsh:343
‪update_turret_destroyed
‪function update_turret_destroyed(localClientNum, ui_model_name, new_value)
Definition: _helicopter_gunner.csc:35
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪MOTHERSHIP_VISIONSET_ALIAS
‪#define MOTHERSHIP_VISIONSET_ALIAS
Definition: _killstreaks.gsh:338
‪register
‪function register()
Definition: _ai_tank.gsc:126