1 #using scripts\codescripts\struct;
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\clientfield_shared;
5 #using scripts\shared\duplicaterender_mgr;
6 #using scripts\shared\system_shared;
7 #using scripts\shared\util_shared;
8 #using scripts\shared\postfx_shared;
9 #using scripts\shared\visionset_mgr_shared;
11 #using scripts\shared\abilities\_ability_player;
12 #using scripts\shared\abilities\_ability_power;
13 #using scripts\shared\abilities\_ability_util;
15 #using scripts\shared\_burnplayer;
17 #insert scripts\shared\duplicaterender.gsh;
18 #insert scripts\shared\shared.gsh;
19 #insert scripts\shared\version.gsh;
20 #insert scripts\shared\abilities\_ability_util.gsh;
21 #insert scripts\shared\abilities\gadgets\_gadget_heat_wave.gsh;
23 #define VICTIM_FX_PUMP_DURATION 1
24 #define HEATWAVE_EXPLOSION_FX "player/fx_plyr_heat_wave"
25 #define HEATWAVE_EXPLOSION_1P_FX "player/fx_plyr_heat_wave_1p"
26 #define HEATWAVE_EXPLOSION_DISTORTION_VOLUME_FX "player/fx_plyr_heat_wave_distortion_volume"
27 #define HEATWAVE_EXPLOSION_DISTORTION_VOLUME_AIR_FX "player/fx_plyr_heat_wave_distortion_volume_air"
28 #define HEATWAVE_VICTIM_TAGFXSET "ability_hero_heat_wave_player_impact"
30 #define HEATWAVE_ACTIVATE_POSTFX "pstfx_heat_pulse"
32 #define EXPLOSION_RADIUS 400
33 #define CENTER_OFFSET_Z 30
34 #define FX_PER_FRAME 2 // This does more traces accordingly.
36 #precache( "client_fx", HEATWAVE_EXPLOSION_FX );
37 #precache( "client_fx", HEATWAVE_EXPLOSION_1P_FX );
38 #precache( "client_fx", HEATWAVE_EXPLOSION_DISTORTION_VOLUME_FX );
39 #precache( "client_fx", HEATWAVE_EXPLOSION_DISTORTION_VOLUME_AIR_FX );
40 #precache( "client_tagfxset", HEATWAVE_VICTIM_TAGFXSET );
50 level.debug_heat_wave_traces = GetDvarInt(
"scr_debug_heat_wave_traces", 0 );
58 function update_activate( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
66 function update_victim( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
70 self endon(
"entityshutdown" );
73 self PlayRumbleOnEntity( localClientNum,
"heat_wave_damage" );
78 function set_heatwave_fx( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
84 self thread
aoe_fx( localClientNum );
90 if( !isDefined(
self.heatWaveFx ) )
95 foreach( fx
in self.heatWaveFx )
97 StopFx( localClientNum, fx );
103 self endon (
"entityshutdown" );
123 if (
trace[
"fraction"] < 1.0 )
135 if (
trace[
"fraction"] < 1.0 )
146 currentPitch = startPitch;
147 for ( yaw_level = 0; yaw_level < yaw_count.size; yaw_level++ )
149 currentPitch = pitch_vals[yaw_level];
150 do_fx( localClientNum, center, yaw_count[yaw_level], currentPitch );
154 function do_fx( localClientNum, center, yaw_count, pitch )
156 currentYaw = RandomInt( 360 );
157 for( fxCount = 0; fxCount < yaw_count; fxCount++ )
159 randomOffsetPitch = RandomInt( 5 ) - 2.5;
160 randomOffsetYaw = RandomInt( 30 ) - 15;
161 angles = ( pitch + randomOffsetPitch, currentYaw + randomOffsetYaw, 0 );
162 traceDir = AnglesToForward( angles );
163 currentYaw += 360 / yaw_count;
165 trace = bullettrace( center, fx_position,
false,
self );
167 angles = ( 0, RandomInt( 360 ), 0 );
168 forward = AnglesToForward( angles );
170 if (
trace[
"fraction"] < 1.0 )
174 normal =
trace[
"normal"];
175 if ( LengthSquared( normal ) == 0 )
177 normal = -1 * traceDir;
179 right = ( normal[2] * -1, normal[1] * -1, normal[0] );
180 if( LengthSquared( VectorCross( forward, normal ) ) == 0 )
182 forward = VectorCross( right, forward );
188 if( LengthSquared( VectorCross( forward, traceDir * -1 ) ) == 0 )
190 forward = VectorCross( right, forward );