RuneI
Class Explosion

source: c:\runehov\RuneI\Classes\Explosion.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.ParticleSystem
         |
         +--RuneI.Explosion
Direct Known Subclasses:None

class Explosion
extends Engine.ParticleSystem

//============================================================================= // Explosion. //=============================================================================
Variables
 float testfloat


Function Summary
 void SystemInit()
     
// init function
 void Tick(float DeltaTime)



Source Code


00001	//=============================================================================
00002	// Explosion.
00003	//=============================================================================
00004	class Explosion expands ParticleSystem;
00005	
00006	var float testfloat;
00007	
00008	// init function
00009	function SystemInit()
00010	{
00011		local int i;
00012		local float f;
00013	
00014		for (i=0; i<ParticleCount; i++)
00015		{
00016			ParticleArray[i].Valid = True;
00017			ParticleArray[i].Velocity = (VRand()+vect(0,0,1))*10;
00018			ParticleArray[i].Alpha = vect(1,1,1)*AlphaStart;
00019			ParticleArray[i].LifeSpan = LifeSpanMin + (LifeSpanMax-LifeSpanMin)*FRand();
00020			ParticleArray[i].TextureIndex = 0;
00021			ParticleArray[i].Style = Style;
00022	
00023			switch(i)
00024			{
00025			case 0: case 1: case 2: case 3: case 4: case 5:
00026				// Large explosions
00027				f = RandRange(1.0, 1.1);
00028				ParticleArray[i].Location = Location + VRand()*10;
00029				ParticleArray[i].ScaleStartX = f;
00030				ParticleArray[i].ScaleStartY = f;
00031				ParticleArray[i].XScale = f;
00032				ParticleArray[i].YScale = f;
00033				break;
00034			default:
00035				// smaller explosions
00036				f = RandRange(0.2, 0.3);
00037				ParticleArray[i].Location = Location + VRand()*50;
00038				ParticleArray[i].ScaleStartX = f;
00039				ParticleArray[i].ScaleStartY = f;
00040				ParticleArray[i].XScale = f;
00041				ParticleArray[i].YScale = f;
00042				ParticleArray[i].Velocity *= 2;
00043				ParticleArray[i].LifeSpan *= 0.5;
00044				break;
00045			}
00046		}
00047	
00048		IsLoaded=true;
00049	}
00050	
00051	function Tick(float DeltaTime)
00052	{
00053		local int i;
00054	
00055		for (i=0; i<ParticleCount; i++)
00056		{
00057			ParticleArray[i].Alpha.Y -= DeltaTime;
00058			ParticleArray[i].Alpha.Z -= DeltaTime;
00059		}
00060	}
00061	
00062	defaultproperties
00063	{
00064	     bSystemOneShot=True
00065	     ParticleCount=16
00066	     ParticleTexture(0)=Texture'RuneFX.WaterBlood'
00067	     ShapeVector=(X=8.000000,Y=8.000000,Z=2.000000)
00068	     VelocityMin=(X=0.300000,Y=0.300000,Z=50.000000)
00069	     VelocityMax=(X=2.500000,Y=2.500000,Z=120.000000)
00070	     ScaleMin=0.700000
00071	     ScaleMax=1.100000
00072	     ScaleDeltaX=1.500000
00073	     ScaleDeltaY=1.500000
00074	     LifeSpanMin=0.500000
00075	     LifeSpanMax=1.500000
00076	     AlphaStart=10
00077	     AlphaEnd=20
00078	     bOneShot=True
00079	     bEventSystemInit=True
00080	     Style=STY_Translucent
00081	     ScaleGlow=3.000000
00082	}

End Source Code