‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_helicopter_gunner.gsc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\audio_shared;
4 #using scripts\shared\callbacks_shared;
5 #using scripts\shared\challenges_shared;
6 #using scripts\shared\clientfield_shared;
7 #using scripts\shared\killstreaks_shared;
8 #using scripts\shared\scoreevents_shared;
9 #using scripts\shared\util_shared;
10 #using scripts\shared\_oob;
11 #using scripts\shared\popups_shared;
12 #using scripts\shared\vehicle_shared;
13 #using scripts\shared\weapons\_heatseekingmissile;
14 #using scripts\shared\weapons\_weaponobjects;
15 #using scripts\shared\weapons\_hacker_tool;
16 #using scripts\shared\visionset_mgr_shared;
17 
18 #using scripts\mp\_util;
19 #using scripts\mp\gametypes\_globallogic;
20 #using scripts\mp\gametypes\_globallogic_audio;
21 #using scripts\mp\gametypes\_spawning;
22 #using scripts\mp\killstreaks\_airsupport;
23 #using scripts\mp\killstreaks\_helicopter;
24 #using scripts\mp\killstreaks\_killstreak_bundles;
25 #using scripts\mp\killstreaks\_killstreak_detect;
26 #using scripts\mp\killstreaks\_killstreak_hacking;
27 #using scripts\mp\killstreaks\_killstreakrules;
28 #using scripts\mp\killstreaks\_killstreaks;
29 #using scripts\mp\teams\_teams;
30 #using scripts\mp\killstreaks\_remote_weapons;
31 
32 #insert scripts\mp\_hacker_tool.gsh;
33 #insert scripts\mp\killstreaks\_killstreaks.gsh;
34 #insert scripts\shared\clientfields.gsh;
35 #insert scripts\shared\shared.gsh;
36 #insert scripts\shared\version.gsh;
37 
38 #precache( "string", "KILLSTREAK_EARNED_HELICOPTER_GUNNER" );
39 #precache( "string", "KILLSTREAK_HELICOPTER_GUNNER_NOT_AVAILABLE" );
40 #precache( "string", "KILLSTREAK_HELICOPTER_GUNNER_INBOUND" );
41 #precache( "string", "KILLSTREAK_HELICOPTER_GUNNER_HACKED" );
42 #precache( "string", "KILLSTREAK_DESTROYED_HELICOPTER_GUNNER" );
43 #precache( "string", "KILLSTREAK_HELICOPTER_GUNNER_DAMAGED" );
44 #precache( "eventstring", "mpl_killstreak_osprey_strt" );
45 
46 #namespace helicopter_gunner;
47 #define HELICOPTER_GUNNER_NAME "helicopter_gunner"
48 #define HELICOPTER_GUNNER_WEAPON_NAME "helicopter_player_gunner"
49 #define HELICOPTER_GUNNER_ASSISTANT_NAME "helicopter_gunner_assistant"
50 #define INVENTORY_HELICOPTER_GUNNER_ASSISTANT_NAME "inventory_helicopter_gunner_assistant"
51 
52 #define INVALID_ASSISTANT_SEAT_INDEX -1
53 #define HELICOPTER_LEAVE_DELAY 2.0
54 
55 #define REALLY_LONG_TIME_MS 9009009
56 
57 function ‪init()
58 {
59  ‪killstreaks::register( ‪HELICOPTER_GUNNER_NAME, ‪HELICOPTER_GUNNER_WEAPON_NAME, "killstreak_helicopter_player_gunner", "helicopter_used", &‪ActivateMainGunner, true );
60  ‪killstreaks::register_strings( ‪HELICOPTER_GUNNER_NAME, &"KILLSTREAK_EARNED_HELICOPTER_GUNNER", &"KILLSTREAK_HELICOPTER_GUNNER_NOT_AVAILABLE", &"KILLSTREAK_HELICOPTER_GUNNER_INBOUND", undefined, &"KILLSTREAK_HELICOPTER_GUNNER_HACKED" );
61  ‪killstreaks::register_dialog( ‪HELICOPTER_GUNNER_NAME, "mpl_killstreak_osprey_strt", "helicopterGunnerDialogBundle", "helicopterGunnerPilotDialogBundle", "friendlyHelicopterGunner", "enemyHelicopterGunner", "enemyHelicopterGunnerMultiple", "friendlyHelicopterGunnerHacked", "enemyHelecopterGunnerHacked", "requestHelicopterGunner", "threatHelicopterGunner" );
62  ‪killstreaks::register_alt_weapon( ‪HELICOPTER_GUNNER_NAME, "helicopter_gunner_turret_rockets" );
63  ‪killstreaks::register_alt_weapon( ‪HELICOPTER_GUNNER_NAME, "helicopter_gunner_turret_primary" );
64  ‪killstreaks::register_alt_weapon( ‪HELICOPTER_GUNNER_NAME, "helicopter_gunner_turret_secondary" );
65  ‪killstreaks::register_alt_weapon( ‪HELICOPTER_GUNNER_NAME, "helicopter_gunner_turret_tertiary" );
67 
69  ‪killstreaks::register_strings( ‪HELICOPTER_GUNNER_ASSISTANT_NAME, &"KILLSTREAK_EARNED_HELICOPTER_GUNNER", &"KILLSTREAK_HELICOPTER_GUNNER_NOT_AVAILABLE", &"KILLSTREAK_HELICOPTER_GUNNER_INBOUND", undefined, &"KILLSTREAK_HELICOPTER_GUNNER_HACKED" );
70  ‪killstreaks::register_dialog( ‪HELICOPTER_GUNNER_ASSISTANT_NAME, "mpl_killstreak_osprey_strt", "helicopterGunnerDialogBundle", "helicopterGunnerPilotDialogBundle", "friendlyHelicopterGunner", "enemyHelicopterGunner", "enemyHelicopterGunnerMultiple", "friendlyHelicopterGunnerHacked", "enemyHelecopterGunnerHacked", "requestHelicopterGunner", "threatHelicopterGunner" );
72 
73  // TODO: Move to killstreak data
74  level.killstreaks[‪HELICOPTER_GUNNER_NAME].threatOnKill = true;
75 
82 
83  ‪clientfield::register( "vehicle", "vtol_turret_destroyed_0", ‪VERSION_SHIP, 1, "int" );
84  ‪clientfield::register( "vehicle", "vtol_turret_destroyed_1", ‪VERSION_SHIP, 1, "int" );
85  ‪clientfield::register( "vehicle", "mothership", ‪VERSION_SHIP, 1, "int" );
86  ‪clientfield::register( "toplayer", "vtol_update_client", ‪VERSION_SHIP, 1, "counter" );
87  ‪clientfield::register( "toplayer", "fog_bank_2", ‪VERSION_SHIP, 1, "int" );
88 
90 
91  level thread ‪WaitForGameEndThread();
92 
93  level.vtol = undefined;
94 }
95 
97 {
98  if( !isdefined( self.entNum ) )
99  {
100  self.entNum = self getEntityNumber();
101  }
102 }
103 
105 {
106  player = self;
108 }
109 
111 {
112  foreach( player in level.players )
113  {
114  if( isdefined( player.sessionstate ) && player.sessionstate == "playing" )
116  }
117 }
118 
120 {
121  if( !isdefined( player ) )
122  return;
123 
124  heli_team = undefined;
125  if( isdefined( level.vtol ) && isdefined( level.vtol.owner ) && !level.vtol.shuttingDown && ( level.vtol.totalRocketHits < ‪HELICOPTER_GUNNER_HELICOPTER_MISSILES_TO_DESTROY ) )
126  heli_team = level.vtol.owner.team;
127 
128  if( isdefined( heli_team ) && ( player.team == heli_team ) )
129  {
130  if( ( ‪GetFirstAvailableSeat( player ) != ‪INVALID_ASSISTANT_SEAT_INDEX ) && !isdefined( level.vtol.usage[player.entNum] ) )
131  {
133  player ‪killstreaks::give( ‪INVENTORY_HELICOPTER_GUNNER_ASSISTANT_NAME, undefined, undefined, true, true );
134  return;
135  }
136  }
137 
140 }
141 
142 function ‪ActivateMainGunner( killstreakType )
143 {
144  player = self;
145 
146  while( isdefined( level.vtol ) && level.vtol.shuttingdown )
147  {
149  return false;
150  }
151 
152  player ‪util::freeze_player_controls( true );
153 
154  ‪result = player ‪SpawnHeliGunner();
155 
156  player ‪util::freeze_player_controls( false );
157 
158  if( level.gameEnded )
159  return true;
160 
161  if( !isdefined( ‪result ) )
162  return false;
163 
164  return ‪result;
165 }
166 
167 function ‪ActivateSupportGunner( killstreakType )
168 {
169  player = self;
170 
171  if( isdefined( level.vtol ) && level.vtol.shuttingdown )
172  return false;
173 
174  if( isdefined( level.vtol.usage[player.entNum] ) )
175  return false;
176 
177  player ‪util::freeze_player_controls( true );
178 
179  ‪result = player ‪EnterHelicopter( false );
180 
181  player ‪util::freeze_player_controls( false );
182 
183  return ‪result;
184 }
185 
186 function ‪GetFirstAvailableSeat( player )
187 {
188  if( isdefined( level.vtol ) && ( !level.vtol.shuttingDown ) && ( level.vtol.team == player.team ) && ( level.vtol.owner != player ) )
189  {
190  for( i = 0; i < ‪HELICOPTER_GUNNER_ASSISTANT_SEAT_COUNT; i++ )
191  {
192  if( !isdefined( level.vtol.assistants[i].occupant ) && !level.vtol.assistants[i].destroyed )
193  {
194  return i;
195  }
196  }
197  }
198 
200 }
201 
202 function ‪InitHelicopterSeat( index, destroyTag )
203 {
204  level.vtol.assistants[index] = SpawnStruct();
205  assistant = level.vtol.assistants[index];
206 
207  assistant.occupant = undefined;
208  assistant.destroyed = false;
209  assistant.rocketHits = 0;
210  assistant.targetTag = destroyTag;
211 
212  assistant.targetEnt = ‪spawn( "script_model", ( 0, 0, 0 ) );
213  assistant.targetEnt.useVTOLTime = true;
214  assistant.targetEnt SetModel( "p7_dogtags_enemy" ); // hack to send ent to clients for targeting
215  assistant.targetEnt LinkTo( level.vtol, assistant.targetTag, ( 0, 0, 0 ), ( 0, 0, 0 ) );
216  assistant.targetEnt.team = level.vtol.team;
217  Target_Set( assistant.targetEnt, ( 0, 0, 0 ) );
218  Target_SetAllowHighSteering( assistant.targetEnt, true );
219  assistant.targetEnt.parent = level.vtol;
220 
221  level.vtol ‪vehicle::add_to_target_group( assistant.targetEnt );
222 }
223 
224 function ‪HackedPreFunction( hacker )
225 {
226  heliGunner = self;
227  heliGunner.owner unlink();
228  level.vtol ‪clientfield::set( "vehicletransition", 0 );
229  ‪visionset_mgr::deactivate( "visionset", ‪MOTHERSHIP_VISIONSET_ALIAS, heliGunner.owner );
230  heliGunner.owner SetModelLodBias( 0 );
231  heliGunner.owner ‪clientfield::set_to_player( "fog_bank_2", 0 );
232  heliGunner.owner ‪clientfield::set_to_player( "toggle_flir_postfx", 0 );
233  heliGunner.owner notify( "gunner_left" );
234  heliGunner.owner ‪killstreaks::clear_using_remote();
235  heliGunner.owner ‪killstreaks::unhide_compass();
238 
239  foreach( assistant in heliGunner.assistants )
240  {
241  if( isdefined( assistant.occupant ) )
242  assistant.occupant iPrintLnBold( &"KILLSTREAK_HELICOPTER_GUNNER_DAMAGED" );
243  ‪LeaveHelicopter( assistant.occupant, false );
244  }
245 
246  heliGunner MakeVehicleUnusable();
247 }
248 
249 function ‪HackedPostFunction( hacker )
250 {
251  heliGunner = self;
252  heliGunner ‪clientfield::set( "enemyvehicle", ENEMY_VEHICLE_HACKED );
253  heliGunner MakeVehicleUsable();
254  heliGunner UseVehicle( hacker, 0 );
255  level.vtol ‪clientfield::set( "vehicletransition", 1 );
256  heliGunner thread ‪vehicle::monitor_missiles_locked_on_to_me( hacker );
257  heliGunner thread ‪vehicle::monitor_damage_as_occupant( hacker );
258 
259  hacker thread ‪WatchVisionSwitchThread();
261  heliGunner thread ‪WatchPlayerExitRequestThread( hacker );
263  hacker SetModelLodBias( ‪VAL( level.mothership_lod_bias, 8 ) );
264  heliGunner.owner GiveDedicatedShadow( level.vtol );
265  heliGunner.owner ‪clientfield::set_to_player( "fog_bank_2", 1 );
266 
267  hacker thread ‪WatchPlayerTeamChangeThread( heliGunner );
269 
270  if ( heliGunner.killstreak_timer_started )
271  {
272  heliGunner.killstreak_duration = heliGunner ‪killstreak_hacking::get_hacked_timeout_duration_ms();
273  heliGunner.killstreak_end_time = hacker ‪killstreak_hacking::set_vehicle_drivable_time_starting_now( heliGunner );
274  heliGunner.killstreakEndTime = int( heliGunner.killstreak_end_time );
275  }
276  else
277  {
278  heliGunner.killstreak_timer_start_using_hacked_time = true;
279  }
280 }
281 
283 {
284  player = self;
285  player endon( "disconnect" );
286  level endon( "game_ended" );
287 
288  if( !isdefined( level.heli_paths ) || !level.heli_paths.size )
289  return false;
290 
291  if( !isdefined( level.Heli_primary_path ) || !level.heli_primary_path.size )
292  return false;
293 
294  if( ‪IS_TRUE( player.isPlanting ) || ‪IS_TRUE( player.isDefusing ) || player ‪util::isUsingRemote() || player IsWallRunning() || player ‪oob::IsOutOfBounds() )
295  return false;
296 
297  killstreak_id = player ‪killstreakrules::killstreakStart( ‪HELICOPTER_GUNNER_NAME, player.team, undefined, true );
298  if( killstreak_id == ‪INVALID_KILLSTREAK_ID )
299  return false;
300 
301  startNode = level.heli_primary_path[0];
302 
303  level.vtol = SpawnVehicle( ‪HELICOPTER_GUNNER_VEHICLE_NAME, startnode.origin, startnode.angles, "dynamic_spawn_ai" );
304  level.vtol ‪killstreaks::configure_team( ‪HELICOPTER_GUNNER_NAME, killstreak_id, player, "helicopter" );
306  level.vtol.killstreak_id = killstreak_id;
307  level.vtol.destroyFunc = &‪DeleteHelicopterCallback;
308  level.vtol.hardpointType = ‪HELICOPTER_GUNNER_NAME;
309  level.vtol ‪clientfield::set( "enemyvehicle", ‪ENEMY_VEHICLE_ACTIVE );
310  level.vtol ‪clientfield::set( "vtol_turret_destroyed_0", 0 );
311  level.vtol ‪clientfield::set( "vtol_turret_destroyed_1", 0 );
312  level.vtol ‪clientfield::set( "mothership", 1 );
313  level.vtol ‪vehicle::init_target_group();
314  level.vtol.killstreak_timer_started = false;
315  level.vtol.allowdeath = false;
316 
317  level.vtol.playerMovedRecently = false;
318  level.vtol.soundmod = "default_loud";
319  level.vtol hacker_tool::registerwithhackertool(‪HELICOPTER_GUNNER_HACKER_TOOL_RADIUS, ‪HELICOPTER_GUNNER_HACKER_TOOL_DURATION );
320 
321  level.vtol.assistants = [];
322  level.vtol.usage = [];
323 
326 
327  level.destructible_callbacks["turret_destroyed"] = &‪VTOLDestructibleCallback;
328  level.destructible_callbacks["turret1_destroyed"] = &‪VTOLDestructibleCallback;
329  level.destructible_callbacks["turret2_destroyed"] = &‪VTOLDestructibleCallback;
330 
331  level.vtol.shuttingDown = false;
332  level.vtol thread ‪PlayLockOnSoundsThread( player, level.vtol );
333 
334  level.vtol thread ‪helicopter::wait_for_killed();
335  level.vtol thread ‪wait_for_bda_dialog();
336 
337  level.vtol.maxhealth = ‪HELICOPTER_GUNNER_HELICOPTER_HEALTH;
339 
340  if ( isdefined( tableHealth ) )
341  {
342  level.vtol.maxhealth = tableHealth;
343  }
344  level.vtol.original_health = level.vtol.maxhealth;
345  level.vtol.health = level.vtol.maxhealth;
346 
347  level.vtol SetCanDamage( true );
349  level.vtol thread ‪WatchMissilesThread();
350 
351  attack_nodes = GetEntArray( "heli_attack_area", "targetname" );
352  if( attack_nodes.size )
353  {
354  level.vtol thread ‪HelicopterThinkThread( startNode, attack_nodes );
355  player thread ‪WatchLocationChangeThread( attack_nodes );
356  }
357  else
358  {
359  level.vtol thread ‪helicopter::heli_fly( startNode, 0.0, ‪HELICOPTER_GUNNER_NAME );
360  }
361 
362  level.vtol.totalRocketHits = 0;
363  level.vtol.turretRocketHits = 0;
364  level.vtol.targetEnt = undefined;
365 
366  level.vtol.overrideVehicleDamage = &‪HelicopterGunnerDamageOverride;
367  level.vtol.hackedHealthUpdateCallback = &‪HelicopterGunner_hacked_health_callback;
368  level.vtol.DetonateViaEMP = &‪helicopteDetonateViaEMP;
369 
370  player thread ‪killstreaks::play_killstreak_start_dialog( ‪HELICOPTER_GUNNER_NAME, player.team, killstreak_id );
371  level.vtol ‪killstreaks::play_pilot_dialog_on_owner( "arrive", ‪HELICOPTER_GUNNER_NAME, killstreak_id );
372 
373  player AddWeaponStat( GetWeapon( ‪HELICOPTER_GUNNER_WEAPON_NAME ), "used", 1 );
374 
375  level.vtol thread ‪WaitForVTOLShutdownThread();
376 
377  ‪result = player ‪EnterHelicopter( true );
378 
379  return ‪result;
380 }
381 
383 {
384  helicopter = self;
385 
386  if ( helicopter.shuttingDown == true )
387  {
388  return;
389  }
390 
391 // Not sure what design wants here.
392 // for( seatIndex = 0; seatIndex < HELICOPTER_GUNNER_ASSISTANT_SEAT_COUNT; seatIndex++ )
393 // {
394 // assistant = helicopter.assistants[seatIndex];
395 // if( !assistant.destroyed )
396 // {
397 // damage = 1000;
398 // helicopter.noDamageFeedback = 1;
399 // helicopter DoDamage( damage, assistant.targetEnt.origin, undefined, undefined, undefined, "MOD_UNKNOWN", 0, undefined, seatIndex + 8 );
400 // helicopter.noDamageFeedback = 0;
401 //
402 // SupportTurretDestroyed( helicopter, seatIndex );
403 // }
404 // }
405 // helicopter AllowMainTurretLockon();
406 
408  assert( isdefined( hackedHealth ) );
409  if ( helicopter.health > hackedhealth )
410  {
411  helicopter.health = hackedhealth;
412  }
413 }
414 
415 
417 {
418  level waittill( "game_ended" );
419  if( isdefined( level.vtol ) && isdefined( level.vtol.owner ))
420  ‪LeaveHelicopter( level.vtol.owner, true );
421 }
422 
424 {
425  helicopter = self;
426  helicopter waittill( "vtol_shutdown", attacker );
427 
428  if( isdefined( attacker ) )
429  {
430  LUINotifyEvent( &"player_callout", 2, &"KILLSTREAK_DESTROYED_HELICOPTER_GUNNER", attacker.entnum );
431  }
432 
433  if( isdefined( helicopter.targetEnt ) )
434  {
435  Target_Remove( helicopter.targetEnt );
436  helicopter.targetEnt Delete();
437  helicopter.targetEnt = undefined;
438  }
439 
440  for( seatIndex = 0; seatIndex < ‪HELICOPTER_GUNNER_ASSISTANT_SEAT_COUNT; seatIndex++ )
441  {
442  assistant = level.vtol.assistants[seatIndex];
443  if( isdefined( assistant.targetEnt ) )
444  {
445  Target_Remove( assistant.targetEnt );
446  assistant.targetEnt Delete();
447  assistant.targetEnt = undefined;
448  }
449  }
450 
451  ‪killstreakrules::killstreakStop( ‪HELICOPTER_GUNNER_NAME, helicopter.originalTeam, helicopter.killstreak_id );
452 
453  ‪LeaveHelicopter( level.vtol.owner, true );
454 
455  level.vtol = undefined;
456 
457  helicopter delete();
458 }
459 
461 {
462  helicopter = self;
463  helicopter notify( "vtol_shutdown", undefined );
464 }
465 
467 {
468  for( i = 0; i < ‪HELICOPTER_GUNNER_ASSISTANT_SEAT_COUNT; i++ )
469  {
470  if( isdefined(level.vtol.assistants[i].occupant ) )
471  {
472  level.vtol.assistants[i].occupant ‪killstreaks::play_pilot_dialog( "timeout", ‪HELICOPTER_GUNNER_NAME, undefined, level.vtol.killstreak_id );
473  }
474  }
475 
476  ‪LeaveHelicopter( level.vtol.owner, true );
477 }
478 
479 function ‪WatchPlayerTeamChangeThread( helicopter )
480 {
481  helicopter notify( "mothership_team_change" );
482  helicopter endon ( "mothership_team_change" );
483 
484  assert( IsPlayer( self ) );
485  player = self;
486 
487  player endon( "gunner_left" );
488 
489  player ‪util::waittill_any( "joined_team", "disconnect", "joined_spectators" );
490 
491  ownerLeft = helicopter.ownerEntNum == player.entNum;
492 
493  player thread ‪LeaveHelicopter( player, ownerLeft ); // need to thread to prevent endon( "gunner_left" ) to terminate the LeaveHelicopter
494 
495  if( ownerLeft )
496  helicopter notify( "vtol_shutdown", undefined );
497 }
498 
500 {
501  player notify( "WatchPlayerExitRequestThread_singleton" );
502  player endon ( "WatchPlayerExitRequestThread_singleton" );
503  assert( IsPlayer( player ) );
504  mothership = self;
505 
506  level endon( "game_ended" );
507  player endon( "disconnect" );
508  player endon( "gunner_left" );
509 
510  owner = mothership.ownerEntNum == player.entNum;
511 
512  while( true )
513  {
514  timeUsed = 0;
515  while( player UseButtonPressed() )
516  {
517  timeUsed += 0.05;
518  if( timeUsed > 0.25 )
519  {
520  mothership ‪killstreaks::play_pilot_dialog_on_owner( "remoteOperatorRemoved", ‪HELICOPTER_GUNNER_NAME, level.vtol.killstreak_id );
521  player thread ‪LeaveHelicopter( player, owner ); // need to thread this so that endon( "gunner_left" ) does not self termniate in LeaveHelicopter()
522  return;
523  }
525  }
527  }
528 }
529 
530 function ‪EnterHelicopter( isOwner )
531 {
532  assert( IsPlayer( self ) );
533  player = self;
534 
536  if( !isOwner )
537  {
538  seatIndex = ‪GetFirstAvailableSeat( player );
539  if( seatIndex == ‪INVALID_ASSISTANT_SEAT_INDEX )
540  {
541  return false;
542  }
543  level.vtol.assistants[ seatIndex ].occupant = player;
544  }
545 
546  level.vtol.occupied = true; // needed for killcam to function properly
547 
549  player.ignoreEMPJammed = true;
551  player.ignoreEMPJammed = false;
552  if( ‪result != "success" )
553  {
554  if( ‪result != "disconnect" )
555  {
557  }
558 
559  if( !isOwner )
560  level.vtol.assistants[ seatIndex ].occupant = undefined;
561 
562  if( isOwner )
563  {
564  level.vtol.failed2enter = true;
565  level.vtol notify( "vtol_shutdown" );
566  }
567 
568  return false;
569  }
570 
571  if( isOwner )
572  {
573  level.vtol UseVehicle( player, 0 );
574  level.vtol ‪clientfield::set( "vehicletransition", 1 );
575  }
576  else
577  {
578  if( level.vtol.shuttingdown )
579  {
581  return false;
582  }
583  level.vtol UseVehicle( player, seatIndex + ‪HELICOPTER_GUNNER_ASSISTANT_SEAT_START_INDEX );
584  level.vtol ‪clientfield::set( "vehicletransition", 1 );
585 
586  level.vtol ‪killstreaks::play_pilot_dialog_on_owner( "remoteOperatorAdd", ‪HELICOPTER_GUNNER_NAME, level.vtol.killstreak_id );
587  }
588 
589  killcament = ‪spawn( "script_model", ( 0, 0, 0 ) );
590  killcament SetModel( "tag_origin" );
591  killcament.angles = ( 0, 0, 0 );
592  killcament SetWeapon( GetWeapon( "helicopter_gunner_turret_primary" ) );
593  killcament linkto( level.vtol, "tag_barrel", ( 370, 0, 25 ), ( 0, 0, 0 ) );
594  level.vtol.killcament = killcament;
595 
596  level.vtol.usage[player.entNum] = 1;
597 
598  level.vtol thread ‪audio::sndUpdateVehicleContext(true);
599 
600  level.vtol thread ‪vehicle::monitor_missiles_locked_on_to_me( player );
601  level.vtol thread ‪vehicle::monitor_damage_as_occupant( player );
602 
603  if ( level.vtol.killstreak_timer_started )
604  {
605  player ‪vehicle::set_vehicle_drivable_time( level.vtol.killstreak_duration, level.vtol.killstreak_end_time );
606  }
607  else
608  {
610  }
611 
612  ‪update_client_for_player( player );
613 
615 
616  player thread ‪WatchVisionSwitchThread();
617  level.vtol thread ‪WatchPlayerExitRequestThread( player );
618  player thread ‪WatchPlayerTeamChangeThread( level.vtol );
619 
621  player SetModelLodBias( ‪VAL( level.mothership_lod_bias, 8 ) );
622  player GiveDedicatedShadow( level.vtol );
623  player ‪clientfield::set_to_player( "fog_bank_2", 1 );
624 
626  {
627  player thread ‪HideCompassAfterWait( 0.1 ); // need to do this due to the way this scorestreak starts up
628  }
629 
630  return true;
631 }
632 
633 function ‪HideCompassAfterWait( waittime )
634 {
635  self endon( "death" );
636  self endon( "disconnect" );
637 
638  wait waittime;
639 
641 }
642 
643 function ‪MainTurretDestroyed( helicopter, eAttacker, weapon )
644 {
645  helicopter.owner iPrintLnBold( &"KILLSTREAK_HELICOPTER_GUNNER_DAMAGED" );
646 
647  if ( isdefined(helicopter.targetEnt))
648  {
649  Target_Remove( helicopter.targetEnt );
650  helicopter.targetEnt Delete();
651  helicopter.targetEnt = undefined;
652  }
653  helicopter.shuttingDown = true;
655 
656  eAttacker = self [[ level.figure_out_attacker ]]( eAttacker );
657  if( !isdefined( helicopter.destroyScoreEventGiven ) && isdefined( eAttacker ) && ( !isdefined( helicopter.owner ) || helicopter.owner ‪util::IsEnemyPlayer( eAttacker ) ) )
658  {
659  LUINotifyEvent( &"player_callout", 2, &"KILLSTREAK_HELICOPTER_GUNNER_DAMAGED", eAttacker.entnum );
660  ‪challenges::destroyedAircraft( eAttacker, weapon, true );
661  eAttacker ‪challenges::addFlySwatterStat( weapon, helicopter );
662  ‪scoreevents::processScoreEvent( "destroyed_vtol_mothership", eAttacker, helicopter.owner, weapon );
663  helicopter ‪killstreaks::play_destroyed_dialog_on_owner( ‪HELICOPTER_GUNNER_NAME, helicopter.killstreak_id );
664  helicopter.destroyScoreEventGiven = 1;
665  }
666 
667  helicopter thread ‪PerformLeaveHelicopterFromDamage();
668 }
669 
670 function ‪wait_for_bda_dialog( killstreakId )
671 {
672  self endon( "vtol_shutdown" );
673 
674  while(true)
675  {
676  self waittill( "bda_dialog", dialogKey );
677 
678  for( i = 0; i < ‪HELICOPTER_GUNNER_ASSISTANT_SEAT_COUNT; i++ )
679  {
680  if( isdefined( level.vtol.assistants[i].occupant ) )
681  {
682  level.vtol.assistants[i].occupant ‪killstreaks::play_pilot_dialog( dialogKey, ‪HELICOPTER_GUNNER_NAME, killstreakId, self.pilotIndex );
683  }
684  }
685  }
686 }
687 
688 function ‪SupportTurretDestroyed( helicopter, seatIndex )
689 {
690  assistant = helicopter.assistants[seatIndex];
691  if( !assistant.destroyed )
692  {
693  Target_Remove( assistant.targetEnt );
695 
696  assistant.targetEnt Delete();
697  assistant.targetEnt = undefined;
698  assistant.destroyed = true;
699 
700  if ( isdefined( helicopter.owner ) && isdefined( helicopter.hardpointType ) )
701  {
702  helicopter ‪killstreaks::play_pilot_dialog_on_owner( "weaponDestroyed", helicopter.hardpointType, helicopter.killstreak_id );
703  }
704 
705  if( isdefined( assistant.occupant ) )
706  {
707  assistant.occupant ‪globallogic_audio::flush_killstreak_dialog_on_player( helicopter.killstreak_id );
708  assistant.occupant ‪killstreaks::play_pilot_dialog( "weaponDestroyed", helicopter.hardpointType, undefined, helicopter.pilotIndex );
710  ‪LeaveHelicopter( assistant.occupant, false );
711  }
712  }
713 
714  // update destroyed states
715 
716  if ( seatIndex == 0 )
717  {
718  level.vtol ‪clientfield::set( "vtol_turret_destroyed_0", 1 );
720  }
721  else if ( seatIndex == 1 )
722  {
723  level.vtol ‪clientfield::set( "vtol_turret_destroyed_1", 1 );
725  }
726 }
727 
729 {
730  vtol = self;
731 
732  ‪update_client_for_player( vtol.owner );
733 
734  foreach( assistant in vtol.assistants )
735  {
736  ‪update_client_for_player( assistant.occupant );
737  }
738 }
739 
740 function ‪update_client_for_player( player )
741 {
742  if ( isdefined( player ) )
743  {
744  player ‪clientfield::increment_to_player( "vtol_update_client", 1 );
745  }
746 }
747 
748 function ‪VTOLDestructibleCallback( brokenNotify, eAttacker, weapon )
749 {
750  helicopter = self;
751 
752  helicopter endon ( "delete" );
753  helicopter endon ( "vtol_shutdown" );
754 
755  notifies = [];
756  notifies[0] = "turret1_destroyed";
757  notifies[1] = "turret2_destroyed";
758 
759  for( seatIndex = 0; seatIndex < ‪HELICOPTER_GUNNER_ASSISTANT_SEAT_COUNT; seatIndex++ )
760  {
761  if( brokenNotify == notifies[seatIndex] )
762  {
763  ‪SupportTurretDestroyed( helicopter, seatIndex );
764  break;
765  }
766  }
767 
768  if( brokenNotify == "turret_destroyed" )
769  {
770  ‪MainTurretDestroyed( helicopter, eAttacker, weapon );
771  return;
772  }
773 
774  helicopter ‪AllowMainTurretLockon();
775 }
776 
778 {
779  helicopter = self;
780 
781  // allow lockon on the main turrets
782  if( helicopter.assistants[0].destroyed && helicopter.assistants[1].destroyed )
783  {
784  if( !isdefined( helicopter.targetEnt ) )
785  {
786  helicopter.targetEnt = ‪spawn( "script_model", ( 0, 0, 0 ) );
787  helicopter.targetEnt SetModel( "p7_dogtags_enemy" ); // hack to send ent to clients for targeting
788  helicopter.targetEnt LinkTo( level.vtol, "tag_barrel", ( 0, 0, 0 ), ( 0, 0, 0 ) );
789  helicopter.targetEnt.parent = level.vtol;
790  helicopter.targetEnt.team = level.vtol.team;
791  Target_Set( helicopter.targetEnt, ( 0, 0, 0 ) );
792  helicopter.targetEnt.useVTOLTime = true;
793  Target_SetAllowHighSteering( helicopter.targetEnt, true );
794 
795  level.vtol ‪vehicle::add_to_target_group( helicopter.targetEnt );
796  }
797  }
798 }
799 
800 function ‪LeaveHelicopter( player, ownerLeft )
801 {
802  if( !isdefined( level.vtol ) || level.vtol.completely_shutdown === true )
803  return;
804 
805  if( isdefined( player ) )
806  {
809  }
810 
811  if( isdefined( player ) && isdefined( level.vtol ) && isdefined( level.vtol.owner ) )
812  {
813  if( isdefined( player.usingvehicle ) && player.usingvehicle )
814  {
815  player unlink();
816  level.vtol ‪clientfield::set( "vehicletransition", 0 );
817 
818  if( ownerLeft )
820  else
822  }
823  }
824 
825  if( ownerLeft )
826  {
827  level.vtol.shuttingDown = true;
828  foreach( assistant in level.vtol.assistants )
829  {
830  if( isdefined( assistant.occupant ) )
831  {
832  assistant.occupant iPrintLnBold( &"KILLSTREAK_HELICOPTER_GUNNER_DAMAGED" );
833  ‪LeaveHelicopter( assistant.occupant, false );
834  }
835  }
836 
837  level.vtol.occupied = false;
838  level.vtol.hardpointType = ‪HELICOPTER_GUNNER_NAME;
839  level.vtol thread ‪helicopter::heli_leave();
840  level.vtol thread ‪audio::sndUpdateVehicleContext(false);
841  }
842  else
843  {
844  if( isdefined( player ) )
845  {
846  player ‪globallogic_audio::flush_killstreak_dialog_on_player( level.vtol.killstreak_id );
847 
848  foreach( assistant in level.vtol.assistants )
849  {
850  if( isdefined( assistant.occupant ) && assistant.occupant == player )
851  {
852  assistant.occupant = undefined;
853  break;
854  }
855  }
856  }
857  }
858 
859  if( isdefined( player ) )
860  {
861  player ‪clientfield::set_to_player( "toggle_flir_postfx", 0 );
863  player SetModelLodBias( 0 );
864  player GiveDedicatedShadow( player );
865 
866  player ‪clientfield::set_to_player( "fog_bank_2", 0 );
868 
869  player notify( "gunner_left" );
870 
872 
873  if( level.gameEnded )
874  player ‪util::freeze_player_controls( true );
875  }
876 
878 
879  if ( ownerLeft )
880  level.vtol.completely_shutdown = true;
881 }
882 
883 function ‪vtol_shake()
884 {
885  if( isdefined( level.vtol ) && isdefined( level.vtol.owner ) )
886  {
887  org = level.vtol GetTagOrigin( "tag_barrel" );
888 
889  magnitude = 0.3;
890  duration = 2;
891  radius = 500;
892  v_pos = self.origin;
893  Earthquake( magnitude, duration, org, 500 );
894  }
895 }
896 
897 
898 function ‪HelicopterGunnerDamageOverride( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, weapon, vPoint, vDir, sHitLoc, vDamageOrigin, psOffsetTime, damageFromUnderneath, modelIndex, partName, vSurfaceNormal )
899 {
900  helicopter = self;
901 
902  if( sMeansOfDeath == "MOD_TRIGGER_HURT" )
903  return 0;
904 
905  if( helicopter.shuttingDown )
906  return 0;
907 
908  iDamage = self ‪killstreaks::OnDamagePerWeapon( ‪HELICOPTER_GUNNER_NAME, eAttacker, iDamage, iDFlags, sMeansOfDeath, weapon, level.vtol.maxhealth, undefined, level.vtol.maxhealth*0.4, undefined, 0, undefined, true, 1.0 );
909  if( iDamage == 0 )
910  return 0;
911 
912  // handle rocket damage
913  handleAsRocketDamage = ( ( sMeansOfDeath == "MOD_PROJECTILE" ) || ( sMeansOfDeath == "MOD_EXPLOSIVE" ) );
914  if ( weapon.statIndex == level.weaponShotgunEnergy.statIndex || weapon.statIndex == level.weaponPistolEnergy.statIndex || weapon.statIndex == level.weaponSmgNailGun.statIndex )
915  handleAsRocketDamage = false;
916 
917  if( handleAsRocketDamage )
918  {
919  updateInventory = 1;
920 
921  missileTarget = eInflictor missile_gettarget();
922 
923  ‪vtol_shake();
924 
925  rocketHit = 1.0;
926  if ( weapon.statIndex == level.weaponLauncherMulti.statIndex )
927  rocketHit = 0.5;
928 
929  helicopter.totalRocketHits += rocketHit;
930 
931  if( isdefined( missileTarget ) )
932  {
933  // handle rocket damage to the support turrets
934  for( seatIndex = 0; seatIndex < ‪HELICOPTER_GUNNER_ASSISTANT_SEAT_COUNT; seatIndex++ )
935  {
936  assistant = helicopter.assistants[seatIndex];
937 
938  if( !assistant.destroyed && ( assistant.targetEnt == missileTarget ) )
939  {
940  assistant.rocketHits += rocketHit;
941 
942  if ( assistant.rocketHits >= 2 )
943  {
944  helicopter DoDamage( iDamage, assistant.targetEnt.origin, eAttacker, eInflictor, sHitLoc, "MOD_UNKNOWN", 0, weapon, seatIndex + 8 );
945  iDamage = 0;
946  ‪SupportTurretDestroyed( helicopter, seatIndex );
947  }
948  }
949  }
950 
951  // handle rocket damage to the main turrets
952  if( isdefined( helicopter.targetEnt ) && ( helicopter.targetEnt == missileTarget ) )
953  {
954  helicopter.turretRocketHits += rocketHit;
955 
956  // main turret need 2 rockets
957  if( helicopter.turretRocketHits >= 2 )
958  {
959  Target_Remove( helicopter.targetEnt );
960  helicopter.targetEnt Delete();
961  helicopter.targetEnt = undefined;
962  }
963  }
964  }
965 
966  // allow lockon on the main turret
967  if( helicopter.assistants[0].destroyed && helicopter.assistants[1].destroyed && ( !isdefined( helicopter.targetEnt ) ) )
968  {
969  helicopter.targetEnt = ‪spawn( "script_model", ( 0, 0, 0 ) );
970  helicopter.targetEnt SetModel( "p7_dogtags_enemy" ); // hack to send ent to clients for targeting
971  helicopter.targetEnt LinkTo( level.vtol, "tag_barrel", ( 0, 0, 0 ), ( 0, 0, 0 ) );
972  helicopter.targetEnt.parent = level.vtol;
973  helicopter.targetEnt.team = level.vtol.team;
974  Target_Set( helicopter.targetEnt, ( 0, 0, 0 ) );
975  helicopter.targetEnt.useVTOLTime = true;
976  Target_SetAllowHighSteering( helicopter.targetEnt, true );
977  }
978 
979  if( helicopter.totalRocketHits >= ‪HELICOPTER_GUNNER_HELICOPTER_MISSILES_TO_DESTROY )
980  {
981  ‪MainTurretDestroyed( helicopter, eAttacker, weapon );
982  updateInventory = 0;
983  }
984 
985  if ( updateInventory )
987  }
988 
989  if( iDamage >= level.vtol.health && !helicopter.shuttingDown )
990  {
991  helicopter.shuttingDown = true;
993 
994  if ( !isdefined( helicopter.destroyScoreEventGiven ) && isdefined( eAttacker ) && ( !isdefined( helicopter.owner ) || helicopter.owner ‪util::IsEnemyPlayer( eAttacker ) ) )
995  {
996  eAttacker = self [[ level.figure_out_attacker ]]( eAttacker );
997  LUINotifyEvent( &"player_callout", 2, &"KILLSTREAK_HELICOPTER_GUNNER_DAMAGED", eAttacker.entnum );
998  ‪scoreevents::processScoreEvent( "destroyed_vtol_mothership", eAttacker, helicopter.owner, weapon );
999  helicopter ‪killstreaks::play_destroyed_dialog_on_owner( ‪HELICOPTER_GUNNER_NAME, helicopter.killstreak_id );
1000  helicopter.destroyScoreEventGiven = 1;
1001  }
1002 
1003  helicopter thread ‪PerformLeaveHelicopterFromDamage();
1004  }
1005 
1006  if( helicopter.shuttingDown )
1007  {
1008  if( iDamage >= helicopter.health )
1009  iDamage = helicopter.health - 1; // keep it alive. We want it to go away not explode
1010  }
1011 
1013  return iDamage;
1014 }
1015 
1017 {
1018  helicopter = self;
1019  helicopter endon( "death" );
1020 
1021  if ( self.leave_by_damage_initiated === true )
1022  return;
1023 
1024  self.leave_by_damage_initiated = true;
1025 
1026  helicopter thread ‪remote_weapons::do_static_fx();
1027  failsafe_timeout = 5.0;
1028  helicopter ‪util::waittill_any_timeout( failsafe_timeout, "static_fx_done" );
1029  ‪LeaveHelicopter( helicopter.owner, true );
1030 }
1031 
1032 function ‪helicopteDetonateViaEMP( attacker, weapon )
1033 {
1034  ‪MainTurretDestroyed( level.vtol, attacker, weapon );
1035 }
1036 
1037 function ‪MissileCleanupThread( missile )
1038 {
1039  targetEnt = self;
1040 
1041  targetEnt endon( "delete" );
1042  targetEnt endon( "death" );
1043 
1044  missile ‪util::waittill_any( "death", "delete" );
1045 
1046  targetEnt Delete();
1047 }
1048 
1050 {
1051  helicopter = self;
1052  player = helicopter.owner;
1053 
1054  player endon( "disconnect" );
1055  player endon( "gunner_left" );
1056 
1057  heliMissile = GetWeapon( "helicopter_gunner_turret_rockets" );
1058 
1059  while( true )
1060  {
1061  player waittill( "missile_fire", missile );
1062 
1063  trace_origin = level.vtol GetTagOrigin( "tag_flash" );
1064  trace_direction = level.vtol GetTagAngles( "tag_barrel" );
1065  trace_direction = AnglesToForward( trace_direction ) * 8000;
1066  ‪trace = BulletTrace( trace_origin, trace_origin + trace_direction, false, level.vtol );
1067  end_origin = ‪trace["position"];
1068 
1069  missiles = getentarray( "rocket", "classname" );
1070 
1071  /#
1072  //Box( end_origin, (-4, -4, 0 ), ( 4, 4, 1000 ), 0, ( 0, 0.7, 0 ), 0.6, false, 9999999 );
1073  #/
1074 
1075  foreach( missile in missiles )
1076  {
1077  if( missile.item == heliMissile )
1078  {
1079  targetEnt = ‪Spawn( "script_model", end_origin );
1080  missile Missile_SetTarget( targetEnt );
1081  targetEnt thread ‪MissileCleanupThread( missile );
1082  }
1083  }
1084 
1085  // setup the "reload" time for the player's vehicle HUD
1086  weapon_wait_duration_ms = Int( heliMissile.fireTime * 1000 );
1087  player SetVehicleWeaponWaitDuration( weapon_wait_duration_ms );
1088  player SetVehicleWeaponWaitEndTime( GetTime() + weapon_wait_duration_ms );
1089  }
1090 }
1091 
1093 {
1094  assert( IsPlayer( self ) );
1095  player = self;
1096 
1097  player endon( "disconnect" );
1098  player endon( "gunner_left" );
1099 
1100  inverted = false;
1101  player ‪clientfield::set_to_player( "toggle_flir_postfx", 2 );
1102 
1103  while( true )
1104  {
1105  if( player JumpButtonPressed() )
1106  {
1107  if( inverted )
1108  {
1109  player ‪clientfield::set_to_player( "toggle_flir_postfx", 2 );
1110  player PlaySoundToPlayer( "mpl_cgunner_flir_off", player );
1111  }
1112  else
1113  {
1114  player ‪clientfield::set_to_player( "toggle_flir_postfx", 1 );
1115  player PlaySoundToPlayer( "mpl_cgunner_flir_on", player );
1116  }
1117 
1118  inverted = !inverted;
1119 
1120  while( player JumpButtonPressed() )
1122  }
1123 
1125  }
1126 }
1127 
1128 function ‪PlayLockOnSoundsThread( player, heli )
1129 {
1130  player endon( "disconnect" );
1131  player endon( "gunner_left" );
1132 
1133  heli endon( "death" );
1134  heli endon ( "crashing" );
1135  heli endon ( "leaving" );
1136 
1137  heli.lockSounds = ‪spawn( "script_model", heli.origin );
1138  wait ( 0.1 );
1139  heli.lockSounds LinkTo( heli, "tag_player" );
1140 
1141  while( true )
1142  {
1143  heli waittill( "locking on" );
1144 
1145  while( true )
1146  {
1147  if( ‪EnemyIsLocking( heli ) )
1148  {
1149  heli.lockSounds PlaySoundToPlayer( "uin_alert_lockon", player );
1150  wait ( 0.125 );
1151  }
1152 
1153  if( ‪EnemyLockedOn( heli ) )
1154  {
1155  heli.lockSounds PlaySoundToPlayer( "uin_alert_lockon", player );
1156  wait ( 0.125 );
1157  }
1158 
1159  if( !‪EnemyIsLocking( heli ) && !‪EnemyLockedOn( heli ) )
1160  {
1161  heli.lockSounds StopSounds();
1162  break;
1163  }
1164  }
1165  }
1166 }
1167 
1168 function ‪EnemyIsLocking( heli )
1169 {
1170  return ( isdefined( heli.locking_on ) && heli.locking_on );
1171 }
1172 
1173 function ‪EnemyLockedOn( heli )
1174 {
1175  return ( isdefined( heli.locked_on ) && heli.locked_on );
1176 }
1177 
1178 function ‪HelicopterThinkThread( startNode, destNodes )
1179 {
1180  self notify( "flying");
1181  self endon( "flying" );
1182 
1183  self endon ( "death" );
1184  self endon ( "crashing" );
1185  self endon ( "leaving" );
1186 
1187  nextnode = getent( startNode.target, "targetname" );
1188  assert( isdefined( nextnode ), "Next node in path is undefined, but has targetname" );
1189  self SetSpeed( 150, 80 );
1190  self setvehgoalpos( nextnode.origin + ( 0, 0, ‪HELICOPTER_GUNNER_Z_OFFSET ), 1 );
1191  self waittill( "near_goal" );
1192 
1193  firstpass = true;
1194  //while( true )
1195  {
1196  if( !self.playerMovedRecently )
1197  {
1198  node = self ‪UpdateAreaNodes( destNodes, false );
1199  level.vtol.currentNode = node;
1200  targetNode = getEnt( node.target, "targetname" );
1201 
1202  ‪TravelToNode( targetNode );
1203 
1204  if( isdefined( targetNode.script_airspeed ) && isdefined( targetNode.script_accel ) )
1205  {
1206  heli_speed = targetNode.script_airspeed;
1207  heli_accel = targetNode.script_accel;
1208  }
1209  else
1210  {
1211  heli_speed = 150+randomInt(20);
1212  heli_accel = 40+randomInt(10);
1213  }
1214 
1215  self SetSpeed( heli_speed, heli_accel );
1216  self setvehgoalpos( targetNode.origin + ( 0, 0, ‪HELICOPTER_GUNNER_Z_OFFSET ), 1 );
1217  self setgoalyaw( targetNode.angles[ 1 ] + ‪HELICOPTER_GUNNER_ANGLE_OFFSET );
1218  }
1219 
1221  {
1222  self waittill( "near_goal" );
1224  }
1225  else if( !isdefined( targetNode.script_delay ) )
1226  {
1227  self waittill( "near_goal" );
1228  waitTime = 10 + randomInt( 5 );
1229  }
1230  else
1231  {
1232  self waittillmatch( "goal" );
1233  waitTime = targetNode.script_delay;
1234  }
1235 
1236  if( firstpass )
1237  {
1238  self.killstreak_duration = ( ( self.killstreak_timer_start_using_hacked_time === true ) ? self ‪killstreak_hacking::get_hacked_timeout_duration_ms() : ‪HELICOPTER_GUNNER_DURATION );
1239  self.killstreak_end_time = GetTime() + self.killstreak_duration;
1240  self.killstreakEndTime = int( self.killstreak_end_time );
1241  self thread ‪killstreaks::WaitForTimeout( ‪HELICOPTER_GUNNER_NAME, self.killstreak_duration, &‪OnTimeoutCallback, "delete", "death" );
1242  self.killstreak_timer_started = true;
1243  self ‪UpdateDrivableTimeForAllOccupants( self.killstreak_duration, self.killstreak_end_time );
1244 
1245  firstpass = false;
1246  }
1247 
1248  wait( waitTime );
1249  }
1250 }
1251 
1252 function ‪UpdateDrivableTimeForAllOccupants( duration_ms, end_time_ms ) // self == vtol
1253 {
1254  if ( isdefined( self.owner ) )
1255  {
1256  self.owner ‪vehicle::set_vehicle_drivable_time( duration_ms, end_time_ms );
1257  }
1258 
1259  for( i = 0; i < ‪HELICOPTER_GUNNER_ASSISTANT_SEAT_COUNT; i++ )
1260  {
1261  if( isdefined( self.assistants[i].occupant ) && !self.assistants[i].destroyed )
1262  {
1263  self.assistants[i].occupant ‪vehicle::set_vehicle_drivable_time( duration_ms, end_time_ms );
1264  }
1265  }
1266 }
1267 
1268 function ‪WatchLocationChangeThread( destNodes )
1269 {
1270  player = self;
1271 
1272  player endon( "disconnect" );
1273  player endon( "gunner_left" );
1274 
1275  helicopter = level.vtol;
1276 
1277  helicopter endon ( "delete" );
1278  helicopter endon ( "vtol_shutdown" );
1279 
1280  player.moves = 0;
1281  helicopter waittill ( "near_goal" );
1282  helicopter waittill ( "goal" );
1283 
1284  while( true )
1285  {
1286  if( self SecondaryOffhandButtonPressed() )
1287  {
1288  player.moves++;
1289  player thread ‪SetPlayerMovedRecentlyThread();
1290  node = self ‪UpdateAreaNodes( destNodes, true );
1291  helicopter.currentNode = node;
1292  targetNode = getEnt( node.target, "targetname" );
1293 
1294  player playlocalsound ( "mpl_cgunner_nav" );
1295  helicopter ‪TravelToNode( targetNode );
1296 
1297  if( isdefined( targetNode.script_airspeed ) && isdefined( targetNode.script_accel ) )
1298  {
1299  heli_speed = targetNode.script_airspeed;
1300  heli_accel = targetNode.script_accel;
1301  }
1302  else
1303  {
1304  heli_speed = 80+randomInt(20);
1305  heli_accel = 40+randomInt(10);
1306  }
1307 
1308  helicopter SetSpeed( heli_speed, heli_accel );
1309  helicopter setvehgoalpos( targetNode.origin + ( 0, 0, ‪HELICOPTER_GUNNER_Z_OFFSET ), 1 );
1310  helicopter setgoalyaw( targetNode.angles[ 1 ] + ‪HELICOPTER_GUNNER_ANGLE_OFFSET );
1311 
1312  helicopter waittill( "goal" );
1313 
1314  // wait for the button to release:
1315  while ( self SecondaryOffhandButtonPressed() )
1316  {
1318  }
1319  }
1320 
1322  }
1323 }
1324 
1326 {
1327  player = self;
1328 
1329  player endon( "disconnect" );
1330  player endon( "gunner_left" );
1331 
1332  helicopter = level.vtol;
1333 
1334  helicopter endon ( "delete" );
1335  helicopter endon ( "vtol_shutdown" );
1336 
1337  myMove = self.moves;
1338  level.vtol.playerMovedRecently = true;
1339  wait ( 100 );
1340 
1341  //only remove the flag if I am still the most recent move
1342  if( myMove == self.moves && isdefined( level.vtol ) )
1343  {
1344  level.vtol.playerMovedRecently = false;
1345  }
1346 }
1347 
1348 function ‪UpdateAreaNodes( areaNodes, forceMove )
1349 {
1350  validEnemies = [];
1351 
1352  foreach( node in areaNodes )
1353  {
1354  node.validPlayers = [];
1355  node.nodeScore = 0;
1356  }
1357 
1358  foreach( player in level.players )
1359  {
1360  if( !isAlive( player ) )
1361  {
1362  continue;
1363  }
1364 
1365  if( player.team == self.team )
1366  {
1367  continue;
1368  }
1369 
1370  foreach( node in areaNodes )
1371  {
1372  if( distanceSquared( player.origin, node.origin ) > 1048576 )
1373  {
1374  continue;
1375  }
1376 
1377  node.validPlayers[node.validPlayers.size] = player;
1378  }
1379  }
1380 
1381  bestNode = undefined;
1382  foreach ( node in areaNodes )
1383  {
1384  if( isdefined( level.vtol.currentNode ) && ( node == level.vtol.currentNode ) )
1385  {
1386  continue;
1387  }
1388 
1389  heliNode = getEnt( node.target, "targetname" );
1390  foreach( player in node.validPlayers )
1391  {
1392  node.nodeScore += 1;
1393 
1394  if( bulletTracePassed( player.origin + (0,0,32), heliNode.origin, false, player ) )
1395  {
1396  node.nodeScore += 3;
1397  }
1398  }
1399 
1400  if( forceMove && ( distance( level.vtol.origin, heliNode.origin ) < 200 ) )
1401  {
1402  node.nodeScore = -1;
1403  }
1404 
1405  if( !isdefined( bestNode ) || ( node.nodeScore > bestNode.nodeScore ) )
1406  {
1407  bestNode = node;
1408  }
1409  }
1410 
1411  return bestNode;
1412 }
1413 
1414 function ‪TravelToNode( goalNode )
1415 {
1416  originOffets = ‪GetOriginOffsets( goalNode );
1417 
1418  if( originOffets["start"] != self.origin )
1419  {
1420  if( isdefined( goalNode.script_airspeed ) && isdefined( goalNode.script_accel ) )
1421  {
1422  heli_speed = goalNode.script_airspeed;
1423  heli_accel = goalNode.script_accel;
1424  }
1425  else
1426  {
1427  heli_speed = 30 + randomInt(20);
1428  heli_accel = 15 + randomInt(15);
1429  }
1430 
1431  self SetSpeed( heli_speed, heli_accel );
1432  self setvehgoalpos( originOffets["start"] + (0,0,30), 0 );
1433  self setgoalyaw( goalNode.angles[ 1 ] + ‪HELICOPTER_GUNNER_ANGLE_OFFSET );
1434 
1435  self waittill ( "goal" );
1436  }
1437 
1438  if( originOffets["end"] != goalNode.origin )
1439  {
1440  if( isdefined( goalNode.script_airspeed ) && isdefined( goalNode.script_accel ) )
1441  {
1442  heli_speed = goalNode.script_airspeed;
1443  heli_accel = goalNode.script_accel;
1444  }
1445  else
1446  {
1447  heli_speed = 30+randomInt(20);
1448  heli_accel = 15+randomInt(15);
1449  }
1450 
1451  self SetSpeed( heli_speed, heli_accel );
1452  self setvehgoalpos( originOffets["end"] + (0,0,30), 0 );
1453  self setgoalyaw( goalNode.angles[ 1 ] + ‪HELICOPTER_GUNNER_ANGLE_OFFSET );
1454 
1455  self waittill ( "goal" );
1456  }
1457 }
1458 
1459 function ‪GetOriginOffsets( goalNode )
1460 {
1461  startOrigin = self.origin;
1462  endOrigin = goalNode.origin;
1463 
1464  numTraces = 0;
1465  maxTraces = 40;
1466 
1467  traceOffset = (0,0,-196);
1468 
1469  traceOrigin = BulletTrace( startOrigin+traceOffset, endOrigin+traceOffset, false, self );
1470 
1471  while( DistanceSquared( traceOrigin[ "position" ], endOrigin+traceOffset ) > 10 && numTraces < maxTraces )
1472  {
1473  /#println( "trace failed: " + DistanceSquared( traceOrigin[ "position" ], endOrigin+traceOffset ) );#/
1474 
1475  if( startOrigin[2] < endOrigin[2] )
1476  {
1477  startOrigin += (0,0,128);
1478  }
1479  else if( startOrigin[2] > endOrigin[2] )
1480  {
1481  endOrigin += (0,0,128);
1482  }
1483  else
1484  {
1485  startOrigin += (0,0,128);
1486  endOrigin += (0,0,128);
1487  }
1488 
1489  numTraces++;
1490  traceOrigin = BulletTrace( startOrigin+traceOffset, endOrigin+traceOffset, false, self );
1491  }
1492 
1493  offsets = [];
1494  offsets["start"] = startOrigin;
1495  offsets["end"] = endOrigin;
1496  return offsets;
1497 }
‪init_ride_killstreak
‪function init_ride_killstreak(streak, always_allow=false)
Definition: _killstreaks.gsc:2237
‪monitor_missiles_locked_on_to_me
‪function monitor_missiles_locked_on_to_me(player, wait_time=0.1)
Definition: vehicle_shared.gsc:3617
‪processScoreEvent
‪function processScoreEvent(event, player, victim, weapon)
Definition: scoreevents_shared.gsc:19
‪HELICOPTER_GUNNER_ASSISTANT_1_TARGET_TAG
‪#define HELICOPTER_GUNNER_ASSISTANT_1_TARGET_TAG
Definition: _killstreaks.gsh:255
‪activate
‪function activate()
Definition: traps_shared.gsc:655
‪wait_for_bda_dialog
‪function wait_for_bda_dialog(killstreakId)
Definition: _helicopter_gunner.gsc:670
‪hide_compass
‪function hide_compass()
Definition: _killstreaks.gsc:2456
‪init
‪function init()
Definition: _helicopter_gunner.gsc:57
‪get_hacked_timeout_duration_ms
‪function get_hacked_timeout_duration_ms()
Definition: _killstreak_hacking.gsc:122
‪WaitForTimeout
‪function WaitForTimeout(killstreak, duration, callback, endCondition1, endCondition2, endCondition3)
Definition: _killstreaks.gsc:2913
‪GetFirstAvailableSeat
‪function GetFirstAvailableSeat(player)
Definition: _helicopter_gunner.gsc:186
‪HELICOPTER_GUNNER_FORCED_WAIT
‪#define HELICOPTER_GUNNER_FORCED_WAIT
Definition: _killstreaks.gsh:246
‪HELICOPTER_GUNNER_HELICOPTER_MISSILES_TO_DESTROY
‪#define HELICOPTER_GUNNER_HELICOPTER_MISSILES_TO_DESTROY
Definition: _killstreaks.gsh:259
‪do_static_fx
‪function do_static_fx()
Definition: _remote_weapons.gsc:522
‪update_client_for_player
‪function update_client_for_player(player)
Definition: _helicopter_gunner.gsc:740
‪set_to_player
‪function set_to_player(str_field_name, n_value)
Definition: clientfield_shared.gsc:58
‪ramp_in_out_thread_per_player_death_shutdown
‪function ramp_in_out_thread_per_player_death_shutdown(player, ramp_in, full_period, ramp_out)
Definition: visionset_mgr_shared.gsc:385
‪stop_monitor_missiles_locked_on_to_me
‪function stop_monitor_missiles_locked_on_to_me()
Definition: vehicle_shared.gsc:3640
‪InitHelicopterSeat
‪function InitHelicopterSeat(index, destroyTag)
Definition: _helicopter_gunner.gsc:202
‪MissileTarget_ProximityDetonateIncomingMissile
‪function MissileTarget_ProximityDetonateIncomingMissile(endon1, endon2, allowDirectDamage)
Definition: _heatseekingmissile.gsc:1085
‪HELICOPTER_GUNNER_HELICOPTER_HEALTH
‪#define HELICOPTER_GUNNER_HELICOPTER_HEALTH
Definition: _killstreaks.gsh:258
‪WaitForVTOLShutdownThread
‪function WaitForVTOLShutdownThread()
Definition: _helicopter_gunner.gsc:423
‪on_joined_team
‪function on_joined_team()
Definition: _battlechatter.gsc:133
‪HELICOPTER_GUNNER_NAME
‪#define HELICOPTER_GUNNER_NAME
Definition: _helicopter_gunner.gsc:47
‪VERSION_SHIP
‪#define VERSION_SHIP
Definition: version.gsh:36
‪MissileCleanupThread
‪function MissileCleanupThread(missile)
Definition: _helicopter_gunner.gsc:1037
‪IsOutOfBounds
‪function IsOutOfBounds()
Definition: _oob.gsc:74
‪play_killstreak_start_dialog
‪function play_killstreak_start_dialog(killstreakType, team, killstreakId)
Definition: _killstreaks.gsc:1905
‪HELICOPTER_GUNNER_WEAPON_NAME
‪#define HELICOPTER_GUNNER_WEAPON_NAME
Definition: _helicopter_gunner.gsc:48
‪heli_fly
‪function heli_fly(currentnode, startwait, hardpointType)
Definition: _helicopter.gsc:2176
‪remove_from_target_group
‪function remove_from_target_group(target_ent)
Definition: vehicle_shared.gsc:3610
‪VAL
‪#define VAL(__var, __default)
Definition: shared.gsh:272
‪play_pilot_dialog_on_owner
‪function play_pilot_dialog_on_owner(dialogKey, killstreakType, killstreakId)
Definition: _killstreaks.gsc:2010
‪OnDamagePerWeapon
‪function OnDamagePerWeapon(killstreak_ref, attacker, damage, flags, type, weapon, max_health, destroyed_callback, low_health, low_health_callback, emp_damage, emp_callback, allow_bullet_damage, chargeLevel)
Definition: _killstreaks.gsc:2667
‪EnemyLockedOn
‪function EnemyLockedOn(heli)
Definition: _helicopter_gunner.gsc:1173
‪HELICOPTER_LEAVE_DELAY
‪#define HELICOPTER_LEAVE_DELAY
Definition: _helicopter_gunner.gsc:53
‪WatchPlayerExitRequestThread
‪function WatchPlayerExitRequestThread(player)
Definition: _helicopter_gunner.gsc:499
‪trace
‪function trace(from, to, target)
Definition: grapple.gsc:369
‪HideCompassAfterWait
‪function HideCompassAfterWait(waittime)
Definition: _helicopter_gunner.gsc:633
‪addFlySwatterStat
‪function addFlySwatterStat(weapon, aircraft)
Definition: challenges_shared.gsc:86
‪ENEMY_VEHICLE_ACTIVE
‪#define ENEMY_VEHICLE_ACTIVE
Definition: _hacker_tool.gsh:2
‪HELICOPTER_GUNNER_ASSISTANT_SEAT_START_INDEX
‪#define HELICOPTER_GUNNER_ASSISTANT_SEAT_START_INDEX
Definition: _killstreaks.gsh:253
‪vtol_shake
‪function vtol_shake()
Definition: _helicopter_gunner.gsc:883
‪UpdateKillstreakInventory
‪function UpdateKillstreakInventory(player)
Definition: _helicopter_gunner.gsc:119
‪freeze_player_controls
‪function freeze_player_controls(b_frozen=true)
Definition: util_shared.gsc:2474
‪UpdateAllKillstreakInventory
‪function UpdateAllKillstreakInventory()
Definition: _helicopter_gunner.gsc:110
‪spawn
‪function spawn(v_origin=(0, 0, 0), v_angles=(0, 0, 0))
Definition: struct.csc:23
‪ActivateSupportGunner
‪function ActivateSupportGunner(killstreakType)
Definition: _helicopter_gunner.gsc:167
‪waittill_any_timeout
‪function waittill_any_timeout(n_timeout, string1, string2, string3, string4, string5)
Definition: util_shared.csc:423
‪IS_TRUE
‪#define IS_TRUE(__a)
Definition: shared.gsh:251
‪on_disconnect
‪function on_disconnect()
Definition: _wager.gsc:88
‪HackedPreFunction
‪function HackedPreFunction(hacker)
Definition: _helicopter_gunner.gsc:224
‪REALLY_LONG_TIME_MS
‪#define REALLY_LONG_TIME_MS
Definition: _helicopter_gunner.gsc:55
‪heli_leave
‪function heli_leave()
Definition: _helicopter.gsc:2120
‪HELICOPTER_GUNNER_HIDE_COMPASS_ON_REMOTE_CONTROL
‪#define HELICOPTER_GUNNER_HIDE_COMPASS_ON_REMOTE_CONTROL
Definition: _killstreaks.gsh:332
‪HelicopterGunnerDamageOverride
‪function HelicopterGunnerDamageOverride(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, weapon, vPoint, vDir, sHitLoc, vDamageOrigin, psOffsetTime, damageFromUnderneath, modelIndex, partName, vSurfaceNormal)
Definition: _helicopter_gunner.gsc:898
‪DeleteHelicopterCallback
‪function DeleteHelicopterCallback()
Definition: _helicopter_gunner.gsc:460
‪PerformLeaveHelicopterFromDamage
‪function PerformLeaveHelicopterFromDamage()
Definition: _helicopter_gunner.gsc:1016
‪sndUpdateVehicleContext
‪function sndUpdateVehicleContext(added)
Definition: audio_shared.gsc:74
‪play_pilot_dialog
‪function play_pilot_dialog(dialogKey, killstreakType, killstreakId, pilotIndex)
Definition: _killstreaks.gsc:2024
‪WaitForGameEndThread
‪function WaitForGameEndThread()
Definition: _helicopter_gunner.gsc:416
‪isUsingRemote
‪function isUsingRemote()
Definition: util_shared.gsc:2705
‪IsEnemyPlayer
‪function IsEnemyPlayer(player)
Definition: util_shared.csc:1220
‪SetPlayerMovedRecentlyThread
‪function SetPlayerMovedRecentlyThread()
Definition: _helicopter_gunner.gsc:1325
‪WatchMissilesThread
‪function WatchMissilesThread()
Definition: _helicopter_gunner.gsc:1049
‪wait_for_killed
‪function wait_for_killed()
Definition: _helicopter.gsc:1183
‪set_killstreak_delay_killcam
‪function set_killstreak_delay_killcam(killstreak_name)
Definition: _killstreaks.gsc:2446
‪GetOriginOffsets
‪function GetOriginOffsets(goalNode)
Definition: _helicopter_gunner.gsc:1459
‪set_vehicle_drivable_time
‪function set_vehicle_drivable_time(duration_ms, end_time_ms)
Definition: vehicle_shared.gsc:3703
‪SpawnHeliGunner
‪function SpawnHeliGunner()
Definition: _helicopter_gunner.gsc:282
‪on_spawned
‪function on_spawned(func, obj)
Definition: callbacks_shared.csc:245
‪destroyedAircraft
‪function destroyedAircraft(attacker, weapon, playerControlled)
Definition: challenges_shared.gsc:1405
‪WatchVisionSwitchThread
‪function WatchVisionSwitchThread()
Definition: _helicopter_gunner.gsc:1092
‪monitor_damage_as_occupant
‪function monitor_damage_as_occupant(player)
Definition: vehicle_shared.gsc:3722
‪play_destroyed_dialog_on_owner
‪function play_destroyed_dialog_on_owner(killstreakType, killstreakId)
Definition: _killstreaks.gsc:1982
‪isKillstreakAllowed
‪function isKillstreakAllowed(hardpointType, team)
Definition: _killstreakrules.gsc:352
‪set_team_kill_penalty_scale
‪function set_team_kill_penalty_scale(killstreakType, scale, isInventory)
Definition: _killstreaks.gsc:404
‪setUsingRemote
‪function setUsingRemote(remoteName, set_killstreak_delay_killcam=true)
Definition: _util.gsc:569
‪flush_killstreak_dialog_on_player
‪function flush_killstreak_dialog_on_player(killstreakId)
Definition: _globallogic_audio.gsc:179
‪LeaveHelicopter
‪function LeaveHelicopter(player, ownerLeft)
Definition: _helicopter_gunner.gsc:800
‪increment_to_player
‪function increment_to_player(str_field_name, n_increment_count=1)
Definition: clientfield_shared.gsc:169
‪waittill_any
‪function waittill_any(str_notify1, str_notify2, str_notify3, str_notify4, str_notify5)
Definition: util_shared.csc:375
‪deactivate
‪function deactivate()
Definition: traps_shared.gsc:649
‪get_max_health
‪function get_max_health(killstreakType)
Definition: _killstreak_bundles.gsc:188
‪PlayLockOnSoundsThread
‪function PlayLockOnSoundsThread(player, heli)
Definition: _helicopter_gunner.gsc:1128
‪AllowMainTurretLockon
‪function AllowMainTurretLockon()
Definition: _helicopter_gunner.gsc:777
‪EnterHelicopter
‪function EnterHelicopter(isOwner)
Definition: _helicopter_gunner.gsc:530
‪OnPlayerConnect
‪function OnPlayerConnect()
Definition: _helicopter_gunner.gsc:96
‪SupportTurretDestroyed
‪function SupportTurretDestroyed(helicopter, seatIndex)
Definition: _helicopter_gunner.gsc:688
‪register_dialog
‪function register_dialog(killstreakType, informDialog, taacomDialogBundleKey, pilotDialogArrayKey, startDialogKey, enemyStartDialogKey, enemyStartMultipleDialogKey, hackedDialogKey, hackedStartDialogKey, requestDialogKey, threatDialogKey, isInventory)
Definition: _killstreaks.gsc:239
‪INVALID_KILLSTREAK_ID
‪#define INVALID_KILLSTREAK_ID
Definition: _killstreaks.gsh:2
‪on_player_killed
‪function on_player_killed()
Definition: _friendicons.gsc:44
‪unhide_compass
‪function unhide_compass()
Definition: _killstreaks.gsc:2461
‪set_vehicle_drivable_time_starting_now
‪function set_vehicle_drivable_time_starting_now(killstreak, duration_ms=(-1))
Definition: _killstreak_hacking.gsc:140
‪UpdateAreaNodes
‪function UpdateAreaNodes(areaNodes, forceMove)
Definition: _helicopter_gunner.gsc:1348
‪OnTimeoutCallback
‪function OnTimeoutCallback()
Definition: _helicopter_gunner.gsc:466
‪add_to_target_group
‪function add_to_target_group(target_ent)
Definition: vehicle_shared.gsc:3603
‪Spawn
‪function Spawn(parent, onDeathCallback)
Definition: _flak_drone.gsc:427
‪HackedPostFunction
‪function HackedPostFunction(hacker)
Definition: _helicopter_gunner.gsc:249
‪register_strings
‪function register_strings(killstreakType, receivedText, notUsableText, inboundText, inboundNearPlayerText, hackedText, utilizesAirspace=true, isInventory=false)
Definition: _killstreaks.gsc:223
‪killstreakStop
‪function killstreakStop(hardpointType, team, id)
Definition: _killstreakrules.gsc:293
‪get_hacked_health
‪function get_hacked_health(killstreakType)
Definition: _killstreak_bundles.gsc:202
‪register_info
‪function register_info(type, name, version, lerp_step_count)
Definition: visionset_mgr_shared.csc:334
‪WatchPlayerTeamChangeThread
‪function WatchPlayerTeamChangeThread(helicopter)
Definition: _helicopter_gunner.gsc:479
‪UpdatePlayerState
‪function UpdatePlayerState()
Definition: _helicopter_gunner.gsc:104
‪HELICOPTER_GUNNER_VEHICLE_NAME
‪#define HELICOPTER_GUNNER_VEHICLE_NAME
Definition: _killstreaks.gsh:250
‪on_joined_spectate
‪function on_joined_spectate(func, obj)
Definition: callbacks_shared.gsc:290
‪update_client_for_driver_and_occupants
‪function update_client_for_driver_and_occupants()
Definition: _helicopter_gunner.gsc:728
‪HelicopterThinkThread
‪function HelicopterThinkThread(startNode, destNodes)
Definition: _helicopter_gunner.gsc:1178
‪has_killstreak
‪function has_killstreak(killstreak)
Definition: _killstreaks.gsc:1050
‪VTOLDestructibleCallback
‪function VTOLDestructibleCallback(brokenNotify, eAttacker, weapon)
Definition: _helicopter_gunner.gsc:748
‪killstreakStart
‪function killstreakStart(hardpointType, team, hacked, displayTeamMessage)
Definition: _killstreakrules.gsc:184
‪MOTHERSHIP_VISIONSET_ALIAS
‪#define MOTHERSHIP_VISIONSET_ALIAS
Definition: _killstreaks.gsh:338
‪set
‪function set(str_field_name, n_value)
Definition: clientfield_shared.gsc:34
‪HelicopterGunner_hacked_health_callback
‪function HelicopterGunner_hacked_health_callback()
Definition: _helicopter_gunner.gsc:382
‪HELICOPTER_GUNNER_Z_OFFSET
‪#define HELICOPTER_GUNNER_Z_OFFSET
Definition: _killstreaks.gsh:249
‪helicopteDetonateViaEMP
‪function helicopteDetonateViaEMP(attacker, weapon)
Definition: _helicopter_gunner.gsc:1032
‪take
‪function take(killstreak)
Definition: _killstreaks.gsc:568
‪HELICOPTER_GUNNER_ASSISTANT_SEAT_COUNT
‪#define HELICOPTER_GUNNER_ASSISTANT_SEAT_COUNT
Definition: _killstreaks.gsh:252
‪configure_team
‪function configure_team(killstreakType, killstreakId, owner, influencerType, configureTeamPreFunction, configureTeamPostFunction, isHacked=false)
Definition: _killstreaks.gsc:2806
‪TravelToNode
‪function TravelToNode(goalNode)
Definition: _helicopter_gunner.gsc:1414
‪HELICOPTER_GUNNER_ASSISTANT_NAME
‪#define HELICOPTER_GUNNER_ASSISTANT_NAME
Definition: _helicopter_gunner.gsc:49
‪HELICOPTER_GUNNER_DURATION
‪#define HELICOPTER_GUNNER_DURATION
Definition: _killstreaks.gsh:251
‪register_alt_weapon
‪function register_alt_weapon(killstreakType, weaponName, isInventory)
Definition: _killstreaks.gsc:318
‪ActivateMainGunner
‪function ActivateMainGunner(killstreakType)
Definition: _helicopter_gunner.gsc:142
‪clear_using_remote
‪function clear_using_remote(immediate, skipNotify)
Definition: _killstreaks.gsc:2403
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪HELICOPTER_GUNNER_ANGLE_OFFSET
‪#define HELICOPTER_GUNNER_ANGLE_OFFSET
Definition: _killstreaks.gsh:245
‪INVENTORY_HELICOPTER_GUNNER_ASSISTANT_NAME
‪#define INVENTORY_HELICOPTER_GUNNER_ASSISTANT_NAME
Definition: _helicopter_gunner.gsc:50
‪HELICOPTER_GUNNER_HACKER_TOOL_RADIUS
‪#define HELICOPTER_GUNNER_HACKER_TOOL_RADIUS
Definition: _killstreaks.gsh:256
‪init_target_group
‪function init_target_group()
Definition: vehicle_shared.gsc:3598
‪enable_hacking
‪function enable_hacking(killstreakName, preHackFunction, postHackFunction)
Definition: _killstreak_hacking.gsc:22
‪give
‪function give(killstreakType, streak, suppressNotification, noXP, toBottom)
Definition: _killstreaks.gsc:539
‪on_connect
‪function on_connect()
Definition: _arena.gsc:20
‪stop_monitor_damage_as_occupant
‪function stop_monitor_damage_as_occupant()
Definition: vehicle_shared.gsc:3717
‪result
‪function result(death, attacker, mod, weapon)
Definition: _zm_aat_blast_furnace.gsc:46
‪MainTurretDestroyed
‪function MainTurretDestroyed(helicopter, eAttacker, weapon)
Definition: _helicopter_gunner.gsc:643
‪WatchLocationChangeThread
‪function WatchLocationChangeThread(destNodes)
Definition: _helicopter_gunner.gsc:1268
‪HELICOPTER_GUNNER_HACKER_TOOL_DURATION
‪#define HELICOPTER_GUNNER_HACKER_TOOL_DURATION
Definition: _killstreaks.gsh:257
‪EnemyIsLocking
‪function EnemyIsLocking(heli)
Definition: _helicopter_gunner.gsc:1168
‪UpdateDrivableTimeForAllOccupants
‪function UpdateDrivableTimeForAllOccupants(duration_ms, end_time_ms)
Definition: _helicopter_gunner.gsc:1252
‪INVALID_ASSISTANT_SEAT_INDEX
‪#define INVALID_ASSISTANT_SEAT_INDEX
Definition: _helicopter_gunner.gsc:52
‪HELICOPTER_GUNNER_ASSISTANT_0_TARGET_TAG
‪#define HELICOPTER_GUNNER_ASSISTANT_0_TARGET_TAG
Definition: _killstreaks.gsh:254
‪WAIT_SERVER_FRAME
‪#define WAIT_SERVER_FRAME
Definition: shared.gsh:265