Files
IL-GSC/BO1/PC/ZM/maps/_shellshock.gsc
2024-02-18 17:32:07 -05:00

148 lines
3.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

main( origin, duration, shock_range, nMaxDamageBase, nRanDamageBase, nMinDamageBase, nExposed, customShellShock, stanceLockDuration )
{
assertex( IsDefined( origin ), "_shellshock::main() needs a origin passed in now for coop consideration." );
if( !IsDefined( shock_range ) )
{
shock_range = 500;
}
if( !IsDefined( duration ) )
{
duration = 12;
}
else if( duration < 7 )
{
duration = 7;
}
if( !IsDefined( nMaxDamageBase ) )
{
nMaxDamageBase = 150;
}
if( !IsDefined( nRanDamageBase ) )
{
nRanDamageBase = 100;
}
if( !IsDefined( nMinDamageBase ) )
{
nMinDamageBase = 100;
}
if( !IsDefined( customShellShock ) )
{
customShellShock = "default";
}
players = maps\_utility::get_players();
for( q = 0; q < players.size; q++ )
{
if( Distancesquared( players[q].origin, origin ) < shock_range * shock_range )
{
players[q] thread shellshock_thread( duration, nMaxDamageBase, nRanDamageBase, nMinDamageBase, nExposed, customShellShock, stanceLockDuration );
}
}
}
shellshock_thread( duration, nMaxDamageBase, nRanDamageBase, nMinDamageBase, nExposed, customShellShock, stanceLockDuration )
{
origin = self GetOrigin() +( 0, 8, 2 );
range = 320;
if( IsDefined( nRanDamageBase ) && nRanDamageBase > 0 )
{
maxdamage = nMaxDamageBase + RandomInt( nRanDamageBase );
}
else
{
maxdamage = nMaxDamageBase;
}
mindamage = nMinDamageBase;
wait( 0.25 );
RadiusDamage( origin, range, maxdamage, mindamage );
Earthquake( 0.75, 2, origin, 2250 );
if( IsAlive( self ) )
{
if( IsDefined( stanceLockDuration ) && stanceLockDuration > 0 )
{
self AllowStand( false );
self AllowCrouch( false );
self AllowProne( true );
}
wait( 0.15 );
self ViewKick( 127, self.origin );
self ShellShock( customShellShock, duration );
if( !IsDefined( nExposed ) )
{
level thread playerHitable( duration );
}
if( !IsDefined( stanceLockDuration ) )
{
stanceLockDuration = 1.5;
}
wait( stanceLockDuration );
self AllowStand( true );
self AllowCrouch( true );
}
}
playerHitable( duration )
{
self.shellshocked = true;
self.ignoreme = true;
level notify( "player is shell shocked" );
level endon( "player is shell shocked" );
wait( duration - 1 );
self.shellshocked = false;
self.ignoreme = false;
}
endOnDeath()
{
self waittill( "death" );
waittillframeend;
self notify ( "end_explode" );
}
grenade_earthQuake()
{
self thread endOnDeath();
self endon( "end_explode" );
self waittill( "explode", position );
PlayRumbleOnPosition( "grenade_rumble", position );
Earthquake( 0.5, 0.5, position, 1000 );
}
c4_earthQuake()
{
self thread endOnDeath();
self endon( "end_explode" );
self waittill( "explode", position );
PlayRumbleOnPosition( "grenade_rumble", position );
Earthquake( 0.5, 0.5, position, 1000 );
}
satchel_earthQuake()
{
self thread endOnDeath();
self endon( "end_explode" );
self waittill( "explode", position );
PlayRumbleOnPosition( "grenade_rumble", position );
Earthquake( 0.5, 0.5, position, 1000 );
}
barrel_earthQuake()
{
PlayRumbleOnPosition( "grenade_rumble", self.origin );
Earthquake( 0.5, 0.5, self.origin, 1000 );
}
artillery_earthQuake()
{
PlayRumbleOnPosition( "artillery_rumble", self.origin );
earthquake( 0.7, 0.5, self.origin, 800 );
}
rocket_earthQuake()
{
self thread endOnDeath();
self endon( "end_explode" );
self waittill( "projectile_impact", weapon_name, position, explosion_radius, rocket_entity );
PlayRumbleOnPosition( "grenade_rumble", position );
Earthquake( 0.5, 0.5, position, 1000 );
}
explosive_bolt_earthQuake()
{
self thread endOnDeath();
self endon( "end_explode" );
self waittill( "explode", position );
PlayRumbleOnPosition( "grenade_rumble", position );
Earthquake( 0.5, 0.5, position, 1000 );
}