‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_raps.csc
Go to the documentation of this file.
1 #insert scripts\shared\shared.gsh;
2 #insert scripts\shared\version.gsh;
3 #using scripts\codescripts\struct;
4 
5 #using scripts\shared\clientfield_shared;
6 #using scripts\shared\system_shared;
7 #using scripts\shared\vehicle_shared;
8 
9 #namespace raps;
10 
11 function autoexec ‪main()
12 {
13  // clientfield setup
15 }
16 
17 function ‪adjust_side_death_dir_if_trace_fail( origin, side_dir, fxlength, up_dir )
18 {
19  ‪end = origin + side_dir * fxlength;
20  ‪trace = BulletTrace( origin, ‪end, false, self, true );
21 
22  if ( ‪trace["fraction"] < 1.0 )
23  {
24  new_side_dir = VectorNormalize( side_dir + up_dir );
25  ‪end = origin + new_side_dir * fxlength;
26  new_trace = BulletTrace( origin, ‪end, false, self, true );
27  if ( new_trace["fraction"] > ‪trace["fraction"] )
28  {
29  side_dir = new_side_dir;
30  }
31  }
32 
33  return side_dir;
34 }
35 
36 function ‪do_side_death_fx(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
37 {
38  self endon( "entityshutdown" );
39 
40  ‪vehicle::wait_for_DObj( localClientNum );
41 
42  radius = 1;
43  fxlength = 40;
44  fxtag = "tag_body";
45 
46  if( newVal && !bInitialSnap )
47  {
48  if(!isdefined(self.settings))
49  {
50  self.settings = ‪struct::get_script_bundle( "vehiclecustomsettings", self.scriptbundlesettings );
51  }
52 
53  forward_direction = AnglesToForward( self.angles );
54  up_direction = AnglesToUp( self.angles );
55 
56  origin = self GetTagOrigin( fxtag );
57  if ( !isdefined( origin ) )
58  {
59  origin = self.origin + (0,0,15);
60  }
61 
62  right_direction = VectorCross(forward_direction, up_direction);
63  right_direction = VectorNormalize(right_direction);
64  right_start = origin + right_direction * radius;
65  right_direction = ‪adjust_side_death_dir_if_trace_fail( right_start, right_direction, fxlength, up_direction );
66 
67  left_direction = -right_direction;
68  left_start = origin + left_direction * radius;
69  left_direction = ‪adjust_side_death_dir_if_trace_fail( left_start, left_direction, fxlength, up_direction );
70 
71  if( isdefined( self.settings.sideExplosionFx ) )
72  {
73  playfx(localClientNum, self.settings.sideExplosionFx, right_start, right_direction );
74  playfx(localClientNum, self.settings.sideExplosionFx, left_start, left_direction );
75  }
76 
77  if( isdefined( self.settings.killedexplosionfx ) )
78  {
79  playfx(localClientNum, self.settings.killedexplosionfx, origin, (0,0,1) );
80  }
81 
82  self PlaySound( localClientNum, self.deathfxsound );
83 
84  if ( isdefined( self.deathquakescale ) && self.deathquakescale > 0 )
85  {
86  self Earthquake( self.deathquakescale, self.deathquakeduration, origin, self.deathquakeradius );
87  }
88  }
89 }
‪main
‪function autoexec main()
Definition: _raps.csc:11
‪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
‪wait_for_DObj
‪function wait_for_DObj(localClientNum)
Definition: vehicle_shared.csc:387
‪trace
‪function trace(from, to, target)
Definition: grapple.gsc:369
‪adjust_side_death_dir_if_trace_fail
‪function adjust_side_death_dir_if_trace_fail(origin, side_dir, fxlength, up_dir)
Definition: _raps.csc:17
‪do_side_death_fx
‪function do_side_death_fx(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _raps.csc:36
‪end
‪function end(final)
Definition: _killcam.gsc:511
‪CF_HOST_ONLY
‪#define CF_HOST_ONLY
Definition: version.gsh:102
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪get_script_bundle
‪function get_script_bundle(str_type, str_name)
Definition: struct.csc:45