1 #using scripts\codescripts\struct;
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\clientfield_shared;
5 #using scripts\shared\flag_shared;
6 #using scripts\shared\flagsys_shared;
7 #using scripts\shared\system_shared;
8 #using scripts\shared\util_shared;
9 #using scripts\shared\weapons\_weaponobjects;
10 #using scripts\shared\visionset_mgr_shared;
12 #using scripts\shared\abilities\_ability_gadgets;
13 #using scripts\shared\abilities\_ability_player;
14 #using scripts\shared\abilities\_ability_power;
15 #using scripts\shared\abilities\_ability_util;
17 #using scripts\shared\_burnplayer;
19 #insert scripts\shared\shared.gsh;
20 #insert scripts\shared\version.gsh;
21 #insert scripts\shared\abilities\_ability_util.gsh;
22 #insert scripts\shared\abilities\gadgets\_gadget_heat_wave.gsh;
24 #define HEATWAVE_DAMAGE_RATIO .2
25 #define HEATWAVE_EFFECT_DURATION 2.5
26 #define HEATWAVE_GRACE_PERIOD 0
27 #define HEATWAVE_TRACE_Z_OFFSET 50
28 #define HEATWAVE_FX_HEIGHT -30
29 #define HEATWAVE_DURATION 250
30 #define HEATWAVE_SPEED 2000
31 #define HEATWAVE_GLASS_DAMAGE 400
32 #define HEATWAVE_PROJECTILE_TRACE_Z 29
53 if ( !IsDefined( level.vsmgr_prio_visionset_heatwave_activate ) )
58 if ( !IsDefined( level.vsmgr_prio_visionset_heatwave_charred ) )
79 return self GadgetIsActive( slot );
85 return self GadgetFlickering( slot );
115 self._heat_wave_stuned_end = 0;
116 self._heat_wave_stunned_by = undefined;
122 self endon (
"disconnect" );
123 self waittill(
"death" );
125 if (
self IsRemoteControlling() ==
false )
134 self PlayRumbleOnEntity(
"heat_wave_activate" );
142 self endon (
"death" );
143 self endon (
"disconnect" );
164 if ( IsDefined( time ) )
166 timeStr =
"^3" +
", time: " + time;
169 if ( GetDvarInt(
"scr_cpower_debug_prints" ) > 0 )
170 self IPrintlnBold(
"Gadget Heat Wave: " + status + timeStr );
175 if( !IsPlayer( entity ) )
180 if(
self GetEntityNumber() == entity GetEntityNumber() )
185 if ( !IsAlive( entity ) )
206 if ( !BulletTracePassed( heatwave.origin, entityPoint,
true,
self, undefined,
false,
true ) )
217 if( isDefined( fxOrg ) )
219 fxOrg StopLoopSound();
220 fxOrg PlaySound(
"gdt_heatwave_dissipate" );
228 if ( direction == (0,0,0) )
232 dirVec = VectorNormalize( direction );
233 angles = VectorToAngles( dirVec );
235 fxOrg.angles = angles;
236 fxOrg setowner(
self );
237 fxOrg SetModel(
"tag_origin" );
239 fxOrg PlayLoopSound(
"gdt_heatwave_3p_loop" );
240 fxOrg.soundMod =
"heatwave";
241 fxOrg.hitsomething =
false;
248 heatwave = spawnStruct();
249 heatwave.radius = weapon.gadget_shockfield_radius;
250 heatwave.origin =
self geteye();
251 heatwave.direction = AnglesToForward(
self GetPlayerAngles() );
252 heatwave.up = AnglesToUp(
self GetPlayerAngles() );
253 heatwave.fxOrg =
heat_wave_fx( heatwave.origin, heatwave.direction );
260 self endon(
"disconnect" );
262 self notify (
"heat_wave_think" );
263 self endon(
"heat_wave_think" );
264 self.heroAbilityActive =
true;
274 self.heroAbilityActive =
false;
276 self notify(
"heat_wave_think_finished" );
281 self endon(
"disconnect" );
282 self endon(
"heat_wave_think" );
289 entities = GetDamageableEntArray( heatwave.origin, heatwave.radius,
true );
290 foreach( entity
in entities )
292 if( isDefined( entity._heat_wave_damaged_time ) && ( entity._heat_wave_damaged_time +
HEATWAVE_DURATION + 1 > getTime() ) )
301 else if( !isPlayer( entity ) )
303 entity DoDamage( 1, heatwave.origin,
self,
self,
"none",
"MOD_BURNED", 0, weapon );
311 if ( IsAlive(
self ) &&
IS_TRUE( burnedEnemy ) && isdefined( level.playGadgetSuccess ) )
313 self [[ level.playGadgetSuccess ]]( weapon,
"heatwaveSuccessDelay" );
322 if( (
self.team == entity.team ) )
324 burned_enemy =
false;
325 switch ( level.friendlyfire )
361 self endon(
"disconnect" );
362 self endon(
"heat_wave_think" );
368 if ( level.missileEntities.size < 1 )
374 for ( index=0; index < level.missileEntities.size; index++ )
378 grenade = level.missileEntities[index];
380 if ( !isdefined (grenade ) )
383 if ( grenade.weapon.isTacticalInsertion )
389 switch( grenade.model )
391 case "t6_wpn_grenade_supply_projectile":
395 if ( !isdefined( grenade.owner ) )
397 grenade.owner = GetMissileOwner( grenade );
400 if ( isdefined( grenade.owner ))
402 if ( level.teamBased )
404 if ( grenade.owner.team == owner.team )
411 if ( grenade.owner == owner )
417 grenadeDistanceSquared = DistanceSquared( grenade.origin, heatwave.origin );
419 if ( grenadeDistanceSquared < ( heatwave.radius * heatwave.radius ))
421 if ( BulletTracePassed( grenade.origin, heatwave.origin + ( 0, 0,
HEATWAVE_PROJECTILE_TRACE_Z ),
false, owner, grenade,
false,
true ) )
434 projPosition = projectile.origin;
435 playFX( level.trophyDetonationFX, projPosition );
436 projectile notify (
"trophy_destroyed" );
437 self RadiusDamage( projPosition, 128, 105, 10,
self,
"MOD_BURNED", weapon );
445 entity DoDamage(
damage,
self.origin + ( 0, 0, 30 ),
self, heatwave.fxOrg, 0,
"MOD_BURNED", 0, weapon );
446 entity setdoublejumpenergy( 0 );
450 entity resetdoublejumprechargetime();
452 entity._heat_wave_stuned_end = getTime() + ( shellshock_duration * 1000 );
453 DEFAULT( entity._heat_wave_stunned_by, [] );
454 entity._heat_wave_stunned_by[
self.clientid] = entity._heat_wave_stuned_end;
455 entity shellshock(
"heat_wave", shellshock_duration,
true );
462 self endon (
"disconnect");
463 self endon (
"death");
472 self endon (
"disconnect" );
473 self endon (
"death" );
475 self._heat_wave_damaged_time = getTime();
482 fire_sound_ent =
spawn(
"script_origin",
self.origin );
483 fire_sound_ent linkto(
self,
"tag_origin", (0,0,0), (0,0,0) );
484 fire_sound_ent playloopsound (
"mpl_heatwave_burn_loop");
485 wait( shellshock_duration );
487 if ( isdefined( fire_sound_ent ) )
489 fire_sound_ent StopLoopSound( .5 );
491 fire_sound_ent
delete();