Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

WVEradicatorV2.EradicatorShell


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
/******************************************************************************
EradicatorShell

Creation date: 2011-08-22 16:32
Last change: $Id$
Copyright © 2011, Wormbo
Website: http://www.koehler-homepage.de/Wormbo/
Feel free to reuse this code. Send me a note if you found it helpful or want
to report bugs/provide improvements.
Please ask for permission first, if you intend to make money off reused code.
******************************************************************************/

class EradicatorShell extends ONSMortarShell;


#exec audio import file=Sounds\ShellBrakingExplode1.wav
#exec audio import file=Sounds\ShellBrakingExplode2.wav
#exec audio import file=Sounds\ShellFragmentExplode1.wav
#exec audio import file=Sounds\ShellFragmentExplode2.wav


var Sound AirExplosionSound;
var class<Projectile> ChildProjectileClass;
var float SpreadFactor;
var Emitter SmokeTrail;


simulated function PostBeginPlay()
{
	if (!PhysicsVolume.bWaterVolume && Level.NetMode != NM_DedicatedServer)
		Trail = Spawn(class'FlakShellTrail', self);

	Super(Projectile).PostBeginPlay();
}

simulated function Timer()
{
	local int i, j;
	local Projectile Child;
	local float Mag;
	local vector CurrentVelocity, X, Y, Z;

	if (Level.NetMode != NM_DedicatedServer)
		Spawn(class'ONSArtilleryShellSplit', self, , Location, Rotation);
	
	CurrentVelocity = 0.85 * Velocity;
	GetAxes(rotator(CurrentVelocity), X, Y, Z);

	// one shell in each of 9 zones
	for (i = -1; i < 2; i++)
	{
		for (j= -1; j < 2; j++)
		{
			if (Abs(i) + Abs(j) > 1)
				Mag = 0.7;
			else
				Mag = 1.0;
			Child = Spawn(ChildProjectileClass, self,, Location);
			if (Child != None)
			{
				Child.Velocity = CurrentVelocity + SpreadFactor * (X * (FRand() - 0.5) + Mag * (Y * (RandRange(0.3, 1.0) * i) + Z * (RandRange(0.3, 1.0) * j)));
				Child.InstigatorController = InstigatorController;
			}
		}
	}
	ExplodeInAir();
}

simulated function SpawnEffects(vector HitLocation, vector HitNormal)
{
	local PlayerController PC;

	PlaySound(ImpactSound, SLOT_None, 2.0);
	if (EffectIsRelevant(Location, false))
	{
		PC = Level.GetLocalPlayerController();
		if (PC.ViewTarget != None && VSize(PC.ViewTarget.Location - Location) < 3000)
			Spawn(ExplosionEffectClass,,, HitLocation + HitNormal * 16);
		Spawn(ExplosionEffectClass,,, HitLocation + HitNormal * 16);
		if (ExplosionDecal != None && Level.NetMode != NM_DedicatedServer)
			Spawn(ExplosionDecal, self,, HitLocation, rotator(-HitNormal));
	}
}

simulated function ExplodeInAir()
{
	bExploded = true;
	PlaySound(AirExplosionSound, SLOT_None, 2.0);
	if (Level.NetMode != NM_DedicatedServer)
		Spawn(AirExplosionEffectClass);

	Explode(Location, Normal(Velocity));
		Destroy();
}


//=============================================================================
// Default values
//=============================================================================

defaultproperties
{
	Begin Object Class=ProceduralSound Name=ShellBrakingExplode1P
		BaseSound = Sound'ShellBrakingExplode1'
		PitchModification = -10
		PitchVariance = 20
	End Object
	
	Begin Object Class=ProceduralSound Name=ShellBrakingExplode2P
		BaseSound = Sound'ShellBrakingExplode2'
		PitchModification = -10
		PitchVariance = 20
	End Object
	
	Begin Object Class=SoundGroup Name=ShellBrakingExplodeSound
		Sounds = (Sound'ShellBrakingExplode1P',Sound'ShellBrakingExplode2P')
	End Object
	
	AirExplosionSound = Sound'ShellBrakingExplodeSound';
	ImpactSound = Sound'ShellFragmentExplodeSound';
	ExplosionEffectClass = class'EradicatorAirExplosion';
	AirExplosionEffectClass = class'EradicatorAirExplosion';
	AmbientSound = None;
	MyDamageType = class'DamTypeEradicatorShell';
	ChildProjectileClass = class'EradicatorShellChild';
	SpreadFactor = 400.0;
	TransientSoundRadius = 500.0;
}


Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: So 29.12.2013 13:11:48.000 - Creation time: Do 14.8.2014 09:58:38.549 - Created with UnCodeX