1 #insert scripts\shared\shared.gsh;
2 #insert scripts\shared\version.gsh;
4 #using scripts\codescripts\struct;
5 #using scripts\shared\clientfield_shared;
6 #using scripts\shared\system_shared;
7 #using scripts\shared\vehicles\_raps;
8 #using scripts\shared\util_shared;
9 #using scripts\shared\vehicle_shared;
11 #insert scripts\mp\killstreaks\_killstreaks.gsh;
13 #precache( "client_fx", RAPS_HELI_DEATH_TRAIL_FX );
17 #define RAPS_WHOOSH_BEFORE_IMPACT_TIME ( 0.15 )
18 #define RAPS_HALF_GRAVITY ( 386.088 / 2.0 )
30 function heli_low_health_fx( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
35 self endon(
"entityshutdown" );
47 self endon(
"entityshutdown" );
64 self endon(
"entityshutdown" );
66 self notify(
"monitor_drop_landing_entity_singleton" );
67 self endon(
"monitor_drop_landing_entity_singleton" );
69 a_trace = BulletTrace(
self.origin + ( 0, 0, -200 ),
self.origin + ( 0, 0, -5000 ),
false,
self,
true );
70 v_ground = a_trace[
"position" ];
75 if( isdefined( v_ground ) )
78 not_close_enough_to_ground =
true;
80 while( not_close_enough_to_ground )
82 velocity =
self GetVelocity();
84 whoosh_distance_squared = whoosh_distance * whoosh_distance;
86 distance_squared = DistanceSquared(
self.origin, v_ground );
88 not_close_enough_to_ground = ( distance_squared > whoosh_distance_squared );
90 if ( not_close_enough_to_ground )
92 wait ( ( distance_squared > whoosh_distance_squared * 4 ) ? 0.1 : 0.05 );
96 self playsound( localClientNum,
"veh_raps_first_land" );
100 while( ( DistanceSquared(
self.origin, v_ground ) > 24 * 24 ) || ( velocity[2] <= 0.0 ) )
102 velocity =
self GetVelocity();
108 if ( isdefined( bundle ) && isdefined( bundle.ksDropDeployLandSurfaceFxTable ) && isdefined( a_trace[
"surfacetype" ] ) )
110 fx_to_play = GetFXFromSurfaceTable( bundle.ksDropDeployLandSurfaceFxTable, a_trace[
"surfacetype" ] );
111 if ( isdefined( fx_to_play ) )
113 PlayFX( localClientNum, fx_to_play,
self.origin );
117 if ( isdefined( bundle ) && isdefined( bundle.ksDropDeployLandFx ) )
118 PlayFX( localClientNum, bundle.ksDropDeployLandFx,
self.origin );
120 PlayRumbleOnPosition( localClientNum,
"raps_land",
self.origin );