‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_glaive.gsc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\math_shared;
4 #using scripts\shared\statemachine_shared;
5 #using scripts\shared\clientfield_shared;
6 #using scripts\shared\system_shared;
7 #using scripts\shared\array_shared;
8 #using scripts\shared\util_shared;
9 
10 #using scripts\shared\vehicle_shared;
11 #using scripts\shared\vehicle_death_shared;
12 #using scripts\shared\vehicle_ai_shared;
13 
14 #using scripts\shared\ai\systems\blackboard;
15 #using scripts\shared\ai\blackboard_vehicle;
16 #using scripts\shared\animation_shared;
17 #using scripts\shared\ai\systems\gib;
18 #using scripts\shared\ai\zombie_utility;
19 #using scripts\shared\ai\margwa;
20 
21 #insert scripts\shared\shared.gsh;
22 #insert scripts\shared\statemachine.gsh;
23 #insert scripts\shared\version.gsh;
24 #insert scripts\shared\archetype_shared\archetype_shared.gsh;
25 #insert scripts\shared\ai\utility.gsh;
26 #insert scripts\shared\ai\systems\gib.gsh;
27 #insert scripts\shared\vehicles\_glaive.gsh;
28 
29 #namespace glaive;
30 
31 ‪REGISTER_SYSTEM( "glaive", &‪__init__, undefined )
32 
33 #using_animtree( "generic" );
34 
35 #define SWORD_MODE_MINPOWER 0.0
36 
37 function ‪__init__()
38 {
39  vehicle::add_main_callback( "glaive", &‪glaive_initialize );
41 }
42 
44 {
45  self useanimtree( #animtree );
46 
47  //Target_Set( self, ( 0, 0, 0 ) );
48 
49  self.health = self.healthdefault;
50 
52 
53  //self EnableAimAssist();
54  self SetNearGoalNotifyDist( ‪GLAIVE_NEAR_GOAL_DIST );
55 
56  self SetHoverParams( 0, 0, 40 );
57  self playloopsound( "wpn_sword2_looper" );
58 
59  if ( isdefined( self.scriptbundlesettings ) )
60  {
61  self.settings = ‪struct::get_script_bundle( "vehiclecustomsettings", self.scriptbundlesettings );
62  }
63 
64  // AI SPECIFIC INITIALIZATION
67 
68  self.fovcosine = 0; // +/-90 degrees = 180
69  self.fovcosinebusy = 0.574; //+/- 55 degrees = 110 fov
70 
71  self.vehAirCraftCollisionEnabled = false;
72 
73  self.goalRadius = 9999999;
74  self.goalHeight = 512;
75  self SetGoal( self.origin, false, self.goalRadius, self.goalHeight );
76 
77  self.overrideVehicleDamage = &‪glaive_callback_damage;
78  self.allowFriendlyFireDamageOverride = &‪glaive_AllowFriendlyFireDamage;
79 
80  self.ignoreme = true;
81  self._glaive_settings_lifetime = self.settings.lifetime;
82 
83  //self thread vehicle_ai::nudge_collision();
84 
85  if( IsDefined( level.vehicle_initializer_cb ) )
86  {
87  [[level.vehicle_initializer_cb]]( self );
88  }
89 
91 }
92 
93 function ‪defaultRole()
94 {
96 
97  self ‪vehicle_ai::get_state_callbacks( "combat" ).update_func = &‪state_combat_update;
98  self ‪vehicle_ai::get_state_callbacks( "combat" ).enter_func = &‪state_combat_enter;
99  self ‪vehicle_ai::add_state( "slash",
100  undefined,
102  undefined );
103  /#
104  SetDvar( "debug_sword_threat_selection", 1 );
105  #/
106  //kick off target selection
107  self thread ‪glaive_target_selection();
108 
110  self.startTime = GetTime();
111 }
112 
113 //function that validates if enemies are appropriate
114 function private ‪is_enemy_valid( target )
115 {
116  if( !IsDefined( target ) )
117  {
118  return false;
119  }
120 
121  if( !IsAlive( target ) )
122  {
123  return false;
124  }
125 
126  if( ‪IS_TRUE(self.‪intermission) )
127  {
128  return false;
129  }
130 
131  if( ‪IS_TRUE( target.ignoreme ) )
132  {
133  return false;
134  }
135 
136  if( target IsNoTarget() )
137  {
138  return false;
139  }
140 
141  if( ‪IS_TRUE( target._glaive_ignoreme ) )
142  {
143  return false;
144  }
145 
146  if( IsDefined( target.archetype ) && target.archetype == ‪ARCHETYPE_MARGWA )
147  {
149  {
150  return false;
151  }
152  }
153 
154  if( IsDefined( target.archetype ) && target.archetype == ‪ARCHETYPE_ZOMBIE && !‪IS_TRUE( target.completed_emerging_into_playable_area ) )
155  {
156  return false;
157  }
158 
159  if( DistanceSquared( self.owner.origin, target.origin ) > ‪SQR( self.settings.guardradius ) )
160  {
161  return false;
162  }
163 
164  if( !SightTracePassed( self.origin, target.origin + ( 0, 0, 16 ), false, target ) )
165  {
166  return false;
167  }
168 
169  return true;
170 }
171 
172 //sets the glaive enemy
173 function private ‪get_glaive_enemy()
174 {
175  glaive_enemies = GetAITeamArray( "axis" );
176  ArraySortClosest( glaive_enemies, self.owner.origin );
177 
178  foreach( glaive_enemy in glaive_enemies )
179  {
180  if( ‪is_enemy_valid( glaive_enemy ) )
181  {
182  return glaive_enemy;
183  }
184  }
185 }
186 
187 //thread that sets the enemy if no valid one exists currently
188 function private ‪glaive_target_selection()
189 {
190  self endon( "death" );
191 
192  for( ;; )
193  {
194  //glaive should always have an owner to do target selection
195  if( !IsDefined( self.owner ) )
196  {
197  wait 0.25;
198  continue;
199  }
200 
201  if ( ‪IS_TRUE( self.ignoreall ) )
202  {
203  wait 0.25;
204  continue;
205  }
206 
207  /#
208  //debug sword threat selection
209  if( GetDvarInt( "debug_sword_threat_selection", 0 ) )
210  {
211  if( IsDefined( self.glaiveEnemy ) )
212  {
213  line( self.origin, self.glaiveEnemy.origin, ( 1, 0, 0 ), 1.0, false, 5 );
214  }
215  }
216  #/
217 
218  if( self ‪is_enemy_valid( self.glaiveEnemy ) )
219  {
220  wait 0.25;
221  continue;
222  }
223 
224  if( ‪IS_TRUE( self._glaive_must_return_to_owner ) )
225  {
226  wait 0.25;
227  continue;
228  }
229 
230  //decide who the enemy should be
231  target = ‪get_glaive_enemy();
232 
233  if( !isDefined( target ) )
234  {
235  self.glaiveEnemy = undefined;
236  }
237  else
238  {
239  self.glaiveEnemy = target;
240  }
241 
242  wait 0.25;
243  }
244 }
245 
247 {
248  b_is_lifetime_over = GetTime() - self.starttime > self._glaive_settings_lifetime * 1000;
249 
250  /*
251  if( isDefined( self.owner ) )
252  {
253  if( IS_TRUE( self.owner.swordpreserve) )
254  {
255  b_is_lifetime_over = false;
256  }
257  }
258  */
259 
260  if( ‪IS_TRUE( b_is_lifetime_over ) )
261  {
262  return true;
263  }
264 
265  if( self.owner.sword_power <= ‪SWORD_MODE_MINPOWER)
266  {
267  return true;
268  }
269  return false;
270 }
271 
273 {
274  if( IsDefined( self.owner ) && DistanceSquared( self.origin, self.owner.origin ) > ‪SQR( self.settings.guardradius ) )
275  {
276  return true;
277  }
278  if( IsDefined( self.owner ) && !self ‪is_enemy_valid( self.glaiveEnemy ) )
279  {
280  if( Distance2DSquared( self.origin, self.owner.origin ) > ‪SQR( 2 * ‪GLAIVE_FOLLOW_DIST ) )
281  {
282  return true;
283  }
284  if( !‪util::within_fov( self.owner.origin, self.owner.angles, self.origin, cos( ‪GLAIVE_FOV_ANGLE ) ) )
285  {
286  return true;
287  }
288  }
289  return false;
290 }
291 
292 // ----------------------------------------------
293 // State: combat
294 // ----------------------------------------------
295 function ‪state_combat_enter( params )
296 {
297  self ASMRequestSubstate( "idle@movement" );
298 }
299 
300 function ‪state_combat_update( params )
301 {
302  self endon( "change_state" );
303  self endon( "death" );
304 
305  pathfailcount = 0;
306 
307  while ( !isdefined( self.owner ) )
308  {
309  wait 0.1;
310 
311  if ( !isdefined( self.owner ) )
312  {
313  self.owner = GetPlayers( self.team )[0];
314  }
315  }
316 
317  for( ;; )
318  {
319  if( self ‪should_go_to_owner() || ‪IS_TRUE( self._glaive_must_return_to_owner ) )
320  {
321  self._glaive_must_return_to_owner = true;
322  //make sure the glaive kills its last enemy before returning
323  if( !IsAlive( self.glaiveEnemy ) )
324  {
325  self ‪go_to_owner();
326  }
327  }
328  if( self ‪should_go_to_near_owner() )
329  {
330  self ‪go_to_near_owner();
331  }
332  else if( IsDefined( self.glaiveEnemy ) )
333  {
334  foundpath = false;
335 
336  targetPos = ‪vehicle_ai::GetTargetPos( self.glaiveEnemy, true );
337 
338  //special location for margwa
339  if( IsDefined( self.glaiveEnemy.archetype ) && self.glaiveEnemy.archetype == ‪ARCHETYPE_MARGWA )
340  {
341  targetPos = self.glaiveEnemy GetTagOrigin( ‪GLAIVE_MARGWA_AIM_TAG );
342  }
343 
344  //add a little prediction to help the sword track better
345  targetPos = targetPos + ( self.glaiveEnemy GetVelocity() * 0.4 );
346 
347  if ( isdefined( targetPos ) )
348  {
349  if( Distance2DSquared( self.origin, self.glaiveEnemy.origin ) < ‪SQR( ‪GLAIVE_MELEE_DIST ) )
350  {
351  self ‪vehicle_ai::set_state( "slash" );
352  }
353  else if( IsDefined( self.owner ) && self ‪is_enemy_valid( self.glaiveEnemy ) && self ‪check_glaive_playable_area_conditions() )
354  {
356 
357  queryResult = PositionQuery_Source_Navigation( targetPos, 0, ‪GLAIVE_MOVE_DIST_MAX, ‪GLAIVE_MOVE_DIST_HEIGHT, ‪GLAIVE_RADIUS * 0.4, self );
358 
359  if( IsDefined( self.glaiveEnemy ) )
360  {
361  PositionQuery_Filter_Sight( queryResult, targetPos, self GetEye() - self.origin, self, 0, self.glaiveEnemy );
362  }
363 
364  if( ‪IS_TRUE( queryResult.centerOnNav ) )
365  {
366  foreach ( point in queryResult.data )
367  {
368  if ( ‪IS_TRUE( point.visibility ) )
369  {
370  self.current_pathto_pos = point.origin;
371 
372  foundpath = self SetVehGoalPos( self.current_pathto_pos, true, true );
373  if ( foundpath )
374  {
375  //start playing locomotion
376  self ASMRequestSubstate( "forward@movement" );
377  self ‪util::waittill_any( "near_goal", "goal" );
378  //movement done go back to idle
379  self ASMRequestSubstate( "idle@movement" );
380  break;
381  }
382  }
383  }
384  }
385  else
386  {
387  //special case for the elementals on the ground
388  foreach ( point in queryResult.data )
389  {
390  if ( ‪IS_TRUE( point.visibility ) )
391  {
392  self.current_pathto_pos = point.origin;
393 
394  foundpath = self SetVehGoalPos( self.current_pathto_pos, true, false );
395  if ( foundpath )
396  {
397  //start playing locomotion
398  self ASMRequestSubstate( "forward@movement" );
399  self ‪util::waittill_any( "near_goal", "goal" );
400  //movement done go back to idle
401  self ASMRequestSubstate( "idle@movement" );
402  break;
403  }
404  }
405  }
406  }
407  }
408  }
409 
410  if ( !foundpath && self ‪is_enemy_valid( self.glaiveEnemy ) )
411  {
413 
414  pathfailcount++;
415 
416  if ( pathfailcount > 3 )
417  {
418  if ( isdefined( self.owner ) )
419  {
420  self ‪go_to_near_owner();
421  }
422  }
423  wait 0.1;
424  }
425  else
426  {
427  pathfailcount = 0;
428  }
429  }
430 
431  wait 0.2;
432  }
433 }
434 
436 {
437  if( IsDefined( self.glaiveEnemy.archetype ) && self.glaiveEnemy.archetype != ‪ARCHETYPE_ZOMBIE )
438  {
439  return true;
440  }
441  else if( IsDefined( self.glaiveEnemy.archetype ) && self.glaiveEnemy.archetype == ‪ARCHETYPE_ZOMBIE && ‪IS_TRUE( self.glaiveEnemy.completed_emerging_into_playable_area ) )
442  {
443  return true;
444  }
445 
446  return false;
447 }
448 
450 {
451  // try to path straight to a nearby position on the nav volume
452  queryResult = PositionQuery_Source_Navigation( self.origin, 0, 100, ‪GLAIVE_MOVE_DIST_HEIGHT, ‪GLAIVE_RADIUS * 0.4, self );
453 
454  multiplier = 2;
455  while ( queryResult.data.size < 1 )
456  {
457  queryResult = PositionQuery_Source_Navigation( self.origin, 0, 100 * multiplier, ‪GLAIVE_MOVE_DIST_HEIGHT * multiplier, ‪GLAIVE_RADIUS * multiplier, self );
458  multiplier += 2;
459  }
460 
461  if ( queryResult.data.size && !queryResult.centerOnNav )
462  {
463  best_point = undefined;
464  best_score = 999999;
465 
466  foreach ( point in queryResult.data )
467  {
468  point.score = Abs( point.origin[2] - queryResult.origin[2] );
469 
470  if ( point.score < best_score )
471  {
472  best_score = point.score;
473  best_point = point;
474  }
475  }
476 
477  if( IsDefined( best_point ) )
478  {
479  //force it to move to favorable point
480  self SetNearGoalNotifyDist( 2 );
481 
482  point = best_point;
483 
484  self.current_pathto_pos = point.origin;
485 
486  foundpath = self SetVehGoalPos( self.current_pathto_pos, true, false );
487  if( foundpath )
488  {
489  self ‪util::waittill_any( "goal", "near_goal" );
490  }
491 
492  self SetNearGoalNotifyDist( ‪GLAIVE_NEAR_GOAL_DIST );
493  }
494  }
495 }
496 
497 function ‪chooseSwordAnim( enemy )
498 {
499  self endon( "change_state" );
500  self endon( "death" );
501 
502  sword_anim = "o_zombie_zod_sword_projectile_melee_synced_a";
503  self._glaive_linkToTag = "tag_origin";
504 
505  if( IsDefined( enemy.archetype ) )
506  {
507  switch( enemy.archetype )
508  {
509  case ‪ARCHETYPE_PARASITE:
510  sword_anim = "o_zombie_zod_sword_projectile_melee_parasite_synced_a";
511  break;
512  case ‪ARCHETYPE_RAPS:
513  sword_anim = "o_zombie_zod_sword_projectile_melee_elemental_synced_a";
514  break;
515  case ‪ARCHETYPE_MARGWA:
516  sword_anim = "o_zombie_zod_sword_projectile_melee_margwa_m_synced_a";
517  self._glaive_linkToTag = "tag_sync";
518  break;
519  }
520  }
521 
522  return sword_anim;
523 }
524 
525 function ‪state_slash_update( params )
526 {
527  self endon( "change_state" );
528  self endon( "death" );
529 
530  enemy = self.glaiveEnemy;
531  should_reevaluate_target = false;
532  sword_anim = self ‪chooseSwordAnim( enemy );
533 
534  self AnimScripted( "anim_notify", enemy GetTagOrigin( self._glaive_linkToTag ), enemy GetTagAngles( self._glaive_linkToTag ), sword_anim, "normal", undefined, undefined, 0.3, 0.3 );
535 
537  self waittill( "anim_notify" );
538 
539  if( IsAlive( enemy ) && IsDefined( enemy.archetype ) && enemy.archetype == ‪ARCHETYPE_MARGWA )
540  {
541  if ( IsDefined( enemy.chop_actor_cb ) )
542  {
543  should_reevaluate_target = true;
544  enemy._glaive_ignoreme = true;
545  enemy thread ‪glaive_ignore_cooldown( GLAIVE_IGNORE_ENT_COOLDOWN );
546  self.owner [[ enemy.chop_actor_cb ]]( enemy, self, self.weapon );
547  }
548  }
549  else
550  {
551  target_enemies = GetAITeamArray( "axis" );
552  foreach( target in target_enemies )
553  {
554  if( Distance2DSquared( self.origin, target.origin ) < ‪SQR( 128 ) )
555  {
556  if( IsDefined( target.archetype ) && target.archetype == ‪ARCHETYPE_MARGWA )
557  {
558  continue;
559  }
560  target DoDamage( target.health + 100, self.origin, self.owner, self, "none", "MOD_UNKNOWN", 0, self.weapon );
561  self playsound( "wpn_sword2_imp" );
562  if( IsActor( target ) )
563  {
565  target StartRagdoll();
566  target LaunchRagdoll( 100 * VectorNormalize( target.origin - self.origin ) );
567  }
568  }
569  }
570  }
571 
572  self waittill( "anim_notify", notetrack );
573  while ( !isdefined( notetrack ) || notetrack != "end" )
574  {
575  self waittill( "anim_notify", notetrack );
576  }
577 
579 
580  if( should_reevaluate_target )
581  {
582  //decide who the enemy should be
583  target = ‪get_glaive_enemy();
584  self.glaiveEnemy = target;
585  }
586 
587  self ‪vehicle_ai::set_state( "combat" );
588 }
589 
590 function ‪glaive_ignore_cooldown( duration )
591 {
592  self endon( "death" );
593 
594  wait( duration );
595 
596  self._glaive_ignoreme = undefined;
597 }
598 
600 {
601  self endon( "near_owner" );
602 
603  self thread ‪back_to_near_owner_check();
604 
605  starttime = GetTime();
606 
607  //start playing locomotion animation
608  self ASMRequestSubstate( "forward@movement" );
609 
610  while ( GetTime() - starttime < self._glaive_settings_lifetime * 1000 * 0.1 )
611  {
613 
614  ownerTargetPos = ‪vehicle_ai::GetTargetPos( self.owner, true ) - ( 0, 0, 4 ); //slightly below eye level
615 
616  //get a desired target little ahead of the owner
617  ownerForwardVec = AnglesToForward( self.owner.angles );
618  targetPos = ownerTargetPos + ‪GLAIVE_FOLLOW_DIST * ownerForwardVec;
619 
620  //get search center
621  searchCenter = self GetClosestPointOnNavVolume( ownerTargetPos );
622  if( IsDefined( searchCenter ) )
623  {
624  queryResult = PositionQuery_Source_Navigation( searchCenter, 0, ‪GLAIVE_MOVE_DIST_MAX + ‪GLAIVE_FOLLOW_DIST, ‪GLAIVE_MOVE_DIST_HEIGHT * 0.5, ‪GLAIVE_RADIUS * 0.6, self );
625 
626  foundPath = false;
627 
628  foreach ( point in queryResult.data )
629  {
630  ADD_POINT_SCORE( point, "score", -DistanceSquared( point.origin, targetPos ) );
631  }
632 
634  self ‪vehicle_ai::PositionQuery_DebugScores( queryResult );
635 
636  foreach( point in queryResult.data )
637  {
638  self.current_pathto_pos = point.origin;
639  foundpath = self SetVehGoalPos( self.current_pathto_pos, true, true );
640  if ( foundpath )
641  {
642  break;
643  }
644  }
645 
646  if( !foundpath )
647  {
648  self.current_pathto_pos = searchCenter;
649  self SetVehGoalPos( self.current_pathto_pos, true, true );
650  }
651  }
652 
653  wait 1;
654  }
655  //probably reached owner, go into idle
656  self ASMRequestSubstate( "idle@movement" );
657 }
658 
659 function ‪go_to_owner()
660 {
661  self thread ‪back_to_owner_check();
662 
663  starttime = GetTime();
664 
665  //start playing locomotion animation
666  self ASMRequestSubstate( "forward@movement" );
667 
668  while ( GetTime() - starttime < self._glaive_settings_lifetime * 1000 * 0.3 )
669  {
671 
672  targetPos = ‪vehicle_ai::GetTargetPos( self.owner, true );
673  queryResult = PositionQuery_Source_Navigation( targetPos, 0, ‪GLAIVE_MOVE_DIST_MAX, ‪GLAIVE_MOVE_DIST_HEIGHT, ‪GLAIVE_RADIUS * 0.4, self );
674 
675  foundPath = false;
676  trace_count = 0;
677  foreach ( point in queryResult.data )
678  {
679  if( SightTracePassed( self.origin, point.origin, false, undefined ) )
680  {
681  trace_count++;
682  if( trace_count > 3 )
683  {
684  ‪WAIT_SERVER_FRAME; //this is to ensure we don't do more than 3 bullet traces a server frame
685  trace_count = 0;
686  }
687  if( !BulletTracePassed( self.origin, point.origin, false, self ) )
688  {
689  continue;
690  }
691  }
692  else
693  {
694  continue;
695  }
696 
697  self.current_pathto_pos = point.origin;
698  foundpath = self SetVehGoalPos( self.current_pathto_pos, true, true );
699  if ( foundpath )
700  {
701  break;
702  }
703  }
704 
705  if ( !foundPath )
706  {
707  foreach ( point in queryResult.data )
708  {
709  self.current_pathto_pos = point.origin;
710  foundpath = self SetVehGoalPos( self.current_pathto_pos, true, false );
711  if ( foundpath )
712  {
713  break;
714  }
715  }
716  }
717 
718  wait 1;
719  }
720 
721  if ( isdefined( self.owner ) )
722  {
723  self.origin = self.owner.origin + ( 0, 0, ‪GLAIVE_MELEE_DIST * 0.5 );
724  }
725  self notify( "returned_to_owner" );
726 
727  wait 2;
728 }
729 
731 {
732  self endon( "death" );
733 
734  while ( isdefined( self.owner ) && ( Abs( self.origin[2] - self.owner.origin[2] ) > ‪SQR( ‪GLAIVE_MELEE_DIST ) || Distance2DSquared( self.origin, self.owner.origin ) > ‪SQR( ‪GLAIVE_MELEE_DIST ) ) )
735  {
736  wait 0.1;
737  }
738 
739  self notify( "returned_to_owner" );
740 }
741 
743 {
744  self endon( "death" );
745 
746  while ( isdefined( self.owner ) && ( Abs( self.origin[2] - self.owner.origin[2] ) > ‪SQR( 2 * ‪GLAIVE_FOLLOW_DIST ) || Distance2DSquared( self.origin, self.owner.origin ) > ‪SQR( 2 * ‪GLAIVE_FOLLOW_DIST ) || !‪util::within_fov( self.owner.origin, self.owner.angles, self.origin, cos( ‪GLAIVE_FOV_ANGLE ) ) ) )
747  {
748  wait 0.1;
749  }
750 
751  //reached owner, go into idle
752  self ASMRequestSubstate( "idle@movement" );
753  self notify( "near_owner" );
754 }
755 
756 function ‪glaive_AllowFriendlyFireDamage( eInflictor, eAttacker, sMeansOfDeath, weapon )
757 {
758  return false;
759 }
760 
761 function ‪glaive_callback_damage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, weapon, vPoint, vDir, sHitLoc, vDamageOrigin, psOffsetTime, damageFromUnderneath, modelIndex, partName, vSurfaceNormal )
762 {
763  return 1;
764 }
‪GLAIVE_RADIUS
‪#define GLAIVE_RADIUS
Definition: _glaive.gsh:2
‪add_state
‪function add_state(name, enter_func, update_func, exit_func, reenter_func)
Definition: statemachine_shared.gsc:59
‪set_state
‪function set_state(name, state_params)
Definition: statemachine_shared.gsc:133
‪go_to_owner
‪function go_to_owner()
Definition: _glaive.gsc:659
‪back_to_near_owner_check
‪function back_to_near_owner_check()
Definition: _glaive.gsc:742
‪glaive_callback_damage
‪function glaive_callback_damage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, weapon, vPoint, vDir, sHitLoc, vDamageOrigin, psOffsetTime, damageFromUnderneath, modelIndex, partName, vSurfaceNormal)
Definition: _glaive.gsc:761
‪intermission
‪function intermission()
Definition: _zm.gsc:6542
‪GLAIVE_BLOOD_FX
‪#define GLAIVE_BLOOD_FX
Definition: _glaive.gsh:19
‪VERSION_SHIP
‪#define VERSION_SHIP
Definition: version.gsh:36
‪defaultRole
‪function defaultRole()
Definition: _glaive.gsc:93
‪back_to_owner_check
‪function back_to_owner_check()
Definition: _glaive.gsc:730
‪GLAIVE_MOVE_DIST_MAX
‪#define GLAIVE_MOVE_DIST_MAX
Definition: _glaive.gsh:10
‪within_fov
‪function within_fov(start_origin, start_angles, end_origin, fov)
Definition: _util.gsc:56
‪GetTargetPos
‪function GetTargetPos(target, geteye)
Definition: vehicle_ai_shared.gsc:115
‪IS_TRUE
‪#define IS_TRUE(__a)
Definition: shared.gsh:251
‪GLAIVE_FOLLOW_DIST
‪#define GLAIVE_FOLLOW_DIST
Definition: _glaive.gsh:15
‪SQR
‪#define SQR(__var)
Definition: shared.gsh:293
‪ARCHETYPE_PARASITE
‪#define ARCHETYPE_PARASITE
Definition: archetype_shared.gsh:38
‪check_glaive_playable_area_conditions
‪function check_glaive_playable_area_conditions()
Definition: _glaive.gsc:435
‪StartInitialState
‪function StartInitialState(defaultState="combat")
Definition: vehicle_ai_shared.gsc:866
‪should_go_to_near_owner
‪function should_go_to_near_owner()
Definition: _glaive.gsc:272
‪go_to_near_owner
‪function go_to_near_owner()
Definition: _glaive.gsc:599
‪friendly_fire_shield
‪function friendly_fire_shield()
Definition: vehicle_shared.gsc:2194
‪glaive_target_selection
‪function private glaive_target_selection()
Definition: _glaive.gsc:188
‪margwaCanDamageAnyHead
‪function margwaCanDamageAnyHead()
Definition: margwa.gsc:1233
‪init_state_machine_for_role
‪function init_state_machine_for_role(rolename)
Definition: vehicle_ai_shared.gsc:1034
‪PositionQuery_DebugScores
‪function PositionQuery_DebugScores(queryResult)
Definition: vehicle_ai_shared.gsc:2010
‪waittill_any
‪function waittill_any(str_notify1, str_notify2, str_notify3, str_notify4, str_notify5)
Definition: util_shared.csc:375
‪__init__
‪function __init__()
Definition: _glaive.gsc:37
‪ARCHETYPE_RAPS
‪#define ARCHETYPE_RAPS
Definition: archetype_shared.gsh:33
‪PositionQuery_PostProcess_SortScore
‪function PositionQuery_PostProcess_SortScore(queryResult, descending=true)
Definition: vehicle_ai_shared.gsc:2097
‪GLAIVE_FOV_ANGLE
‪#define GLAIVE_FOV_ANGLE
Definition: _glaive.gsh:8
‪GLAIVE_MELEE_DIST
‪#define GLAIVE_MELEE_DIST
Definition: _glaive.gsh:14
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪state_slash_update
‪function state_slash_update(params)
Definition: _glaive.gsc:525
‪state_combat_enter
‪function state_combat_enter(params)
Definition: _glaive.gsc:295
‪GLAIVE_MOVE_DIST_HEIGHT
‪#define GLAIVE_MOVE_DIST_HEIGHT
Definition: _glaive.gsh:11
‪ARCHETYPE_ZOMBIE
‪#define ARCHETYPE_ZOMBIE
Definition: archetype_shared.gsh:10
‪is_enemy_valid
‪function private is_enemy_valid(target)
Definition: _glaive.gsc:114
‪chooseSwordAnim
‪function chooseSwordAnim(enemy)
Definition: _glaive.gsc:497
‪state_combat_update
‪function state_combat_update(params)
Definition: _glaive.gsc:300
‪RegisterVehicleBlackBoardAttributes
‪function RegisterVehicleBlackBoardAttributes()
Definition: blackboard_vehicle.gsc:24
‪glaive_initialize
‪function glaive_initialize()
Definition: _glaive.gsc:43
‪set
‪function set(str_field_name, n_value)
Definition: clientfield_shared.gsc:34
‪gib_random_parts
‪function gib_random_parts()
Definition: zombie_utility.gsc:2979
‪GLAIVE_NEAR_GOAL_DIST
‪#define GLAIVE_NEAR_GOAL_DIST
Definition: _glaive.gsh:17
‪CreateBlackBoardForEntity
‪function CreateBlackBoardForEntity(entity)
Definition: blackboard.gsc:77
‪go_back_on_navvolume
‪function go_back_on_navvolume()
Definition: _glaive.gsc:449
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪GLAIVE_MARGWA_AIM_TAG
‪#define GLAIVE_MARGWA_AIM_TAG
Definition: _glaive.gsh:21
‪get_script_bundle
‪function get_script_bundle(str_type, str_name)
Definition: struct.csc:45
‪SWORD_MODE_MINPOWER
‪#define SWORD_MODE_MINPOWER
Definition: _glaive.gsc:35
‪ARCHETYPE_MARGWA
‪#define ARCHETYPE_MARGWA
Definition: archetype_shared.gsh:16
‪glaive_AllowFriendlyFireDamage
‪function glaive_AllowFriendlyFireDamage(eInflictor, eAttacker, sMeansOfDeath, weapon)
Definition: _glaive.gsc:756
‪get_state_callbacks
‪function get_state_callbacks(statename)
Definition: vehicle_ai_shared.gsc:927
‪should_go_to_owner
‪function should_go_to_owner()
Definition: _glaive.gsc:246
‪get_glaive_enemy
‪function private get_glaive_enemy()
Definition: _glaive.gsc:173
‪glaive_ignore_cooldown
‪function glaive_ignore_cooldown(duration)
Definition: _glaive.gsc:590
‪WAIT_SERVER_FRAME
‪#define WAIT_SERVER_FRAME
Definition: shared.gsh:265