‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
spike_charge_siegebot.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\math_shared;
5 #using scripts\shared\system_shared;
6 #using scripts\shared\util_shared;
7 
8 #insert scripts\shared\shared.gsh;
9 
10 #precache( "client_fx", "light/fx_light_red_spike_charge_os" );
11 
12 #namespace spike_charge_siegebot;
13 
14 ‪REGISTER_SYSTEM( "spike_charge_siegebot", &‪__init__, undefined )
15 
16 function ‪__init__()
17 {
18  level._effect["spike_charge_siegebot_light"] = "light/fx_light_red_spike_charge_os";
19 
20  ‪callback::add_weapon_type( "spike_charge_siegebot", &‪spawned );
21  ‪callback::add_weapon_type( "spike_charge_siegebot_theia", &‪spawned );
22  ‪callback::add_weapon_type( "siegebot_launcher_turret", &‪spawned );
23  ‪callback::add_weapon_type( "siegebot_launcher_turret_theia", &‪spawned );
24  ‪callback::add_weapon_type( "siegebot_javelin_turret", &‪spawned );
25 }
26 
27 function ‪spawned( localClientNum )
28 {
29  self thread ‪fx_think( localClientNum );
30 }
31 
32 function ‪fx_think( localClientNum )
33 {
34  self notify( "light_disable" );
35 
36  self endon( "entityshutdown" );
37  self endon( "light_disable" );
38 
39  self ‪util::waittill_dobj( localClientNum );
40 
41 // self PlaySound( localClientNum, "wpn_semtex_countdown" );
42 
43  interval = 0.3;
44 
45  for( ;; )
46  {
47  self ‪stop_light_fx( localClientNum );
48  self ‪start_light_fx( localClientNum );
49  //self fullscreen_fx( localClientNum );
50  self PlaySound( localClientNum, "wpn_semtex_alert" );
51 
52  ‪util::server_wait( localClientNum, interval, 0.01, "player_switch" );
53 
54  self ‪util::waittill_dobj( localClientNum );
55 
56  interval = ‪math::clamp( ( interval / 1.2 ), 0.08, 0.3 );
57  }
58 }
59 
60 function ‪start_light_fx( localClientNum )
61 {
62  player = GetLocalPlayer( localClientNum );
63 
64  self.fx = PlayFxOnTag( localClientNum, level._effect["spike_charge_siegebot_light"], self, "tag_fx" );
65 }
66 
67 function ‪stop_light_fx( localClientNum )
68 {
69  if ( isdefined( self.fx ) && self.fx != 0 )
70  {
71  StopFx( localClientNum, self.fx );
72  self.fx = undefined;
73  }
74 }
75 /*
76 function sticky_indicator( player, localClientNum )
77 {
78  controllerModel = GetUIModelForController( localClientNum );
79  stickyImageModel = CreateUIModel( controllerModel, "hudItems.stickyImage" );
80 
81  SetUIModelValue( stickyImageModel, "hud_icon_stuck_semtex" );
82 
83  // this is probably good enough, but the while loop is safer
84  // self util::waittill_any( "death", "detonated" );
85 
86  while( IsDefined(self ) )
87  {
88  WAIT_CLIENT_FRAME;
89  }
90 
91  SetUIModelValue( stickyImageModel, "blacktransparent" );
92 }
93 */
94 /*
95 function fullscreen_fx( localClientNum )
96 {
97  player = GetLocalPlayer( localClientNum );
98 
99  if ( isdefined( player ) )
100  {
101  if ( player GetInKillcam( localClientNum ) )
102  {
103  return;
104  }
105  else if ( player util::is_player_view_linked_to_entity( localClientNum ) )
106  {
107  return;
108  }
109  }
110 
111  if ( self util::friend_not_foe( localClientNum ) )
112  {
113  return;
114  }
115 
116  parent = self GetParentEntity();
117 
118  if ( isdefined( parent ) && parent == player )
119  {
120  parent PlayRumbleOnEntity( localClientNum, "buzz_high" );
121 
122  if ( GetDvarint( "ui_hud_hardcore" ) == 0 )
123  {
124  self thread sticky_indicator( player, localClientNum );
125  }
126  }
127 }
128 */
‪stop_light_fx
‪function stop_light_fx(localClientNum)
Definition: spike_charge_siegebot.csc:67
‪start_light_fx
‪function start_light_fx(localClientNum)
Definition: spike_charge_siegebot.csc:60
‪fx_think
‪function fx_think(localClientNum)
Definition: spike_charge_siegebot.csc:32
‪__init__
‪function __init__()
Definition: spike_charge_siegebot.csc:16
‪add_weapon_type
‪function add_weapon_type(weapontype, callback)
Definition: callbacks_shared.csc:780
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪spawned
‪function spawned(localClientNum)
Definition: spike_charge_siegebot.csc:27
‪waittill_dobj
‪function waittill_dobj(localClientNum)
Definition: util_shared.csc:1117
‪clamp
‪function clamp(val, val_min, val_max)
Definition: math_shared.csc:16
‪server_wait
‪function server_wait(localClientNum, seconds, waitBetweenChecks, level_endon)
Definition: util_shared.csc:1125