RuneI
Class RuneSpheres

source: c:\runehov\RuneI\Classes\RuneSpheres.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.ParticleSystem
         |
         +--RuneI.RuneSpheres
Direct Known Subclasses:RuneSpheresBerserker, RuneSpheresBerserker2, RuneSpheresHealth, RuneSpheresPower, RuneSpheresPower2

class RuneSpheres
extends Engine.ParticleSystem

//============================================================================= // RuneSpheres. //=============================================================================
Variables
 float ElapsedTime
 float MaxDeviation


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



Source Code


00001	//=============================================================================
00002	// RuneSpheres.
00003	//=============================================================================
00004	class RuneSpheres expands ParticleSystem;
00005	
00006	var float ElapsedTime;
00007	var float MaxDeviation;
00008	
00009	
00010	// init function
00011	simulated function SystemInit()
00012	{
00013		local int i;
00014		local float f;
00015	
00016		ElapsedTime = RandRange(0.0, 5.0);
00017		for (i=0; i<ParticleCount; i++)
00018		{
00019			ParticleArray[i].Valid = True;
00020			ParticleArray[i].Velocity = vect(0,0,0);
00021			ParticleArray[i].Alpha = vect(1,1,1)*AlphaStart;
00022			ParticleArray[i].LifeSpan = LifeSpanMin + (LifeSpanMax-LifeSpanMin)*FRand();
00023			ParticleArray[i].TextureIndex = 0;
00024			ParticleArray[i].Style = Style;
00025	
00026			if (bRelativeToSystem)
00027				ParticleArray[i].Location = vect(0,0,0);
00028			else
00029				ParticleArray[i].Location = Location;
00030	
00031			// small sparks
00032			f = 0.25;
00033			ParticleArray[i].ScaleStartX = f;
00034			ParticleArray[i].ScaleStartY = f;
00035			ParticleArray[i].XScale = f;
00036			ParticleArray[i].YScale = f;
00037		}
00038	
00039		IsLoaded=true;
00040	}
00041	
00042	simulated function Tick(float DeltaTime)
00043	{
00044		local int i;
00045	
00046		ElapsedTime += DeltaTime;
00047		for (i=0; i<ParticleCount; i++)
00048		{
00049			ParticleArray[i].Location = Location +
00050				(vect(1,0,0) * Sin(ElapsedTime*(i+0.5)) * MaxDeviation) +
00051				(vect(0,1,0) * Cos(ElapsedTime*(i+0.5)) * MaxDeviation) +
00052				(vect(0,0,1) * (Sin(ElapsedTime)+1) * (i*0.05) * MaxDeviation);
00053		}
00054	}
00055	
00056	defaultproperties
00057	{
00058	     MaxDeviation=20.000000
00059	     ParticleCount=10
00060	     ParticleTexture(0)=Texture'RuneFX.Spark1'
00061	     ShapeVector=(X=8.000000,Y=8.000000,Z=2.000000)
00062	     VelocityMin=(X=0.300000,Y=0.300000,Z=50.000000)
00063	     VelocityMax=(X=2.500000,Y=2.500000,Z=120.000000)
00064	     ScaleMin=0.250000
00065	     ScaleMax=0.250000
00066	     ScaleDeltaX=1.000000
00067	     ScaleDeltaY=1.000000
00068	     LifeSpanMin=999999.000000
00069	     LifeSpanMax=999999.000000
00070	     AlphaStart=10
00071	     AlphaEnd=10
00072	     bEventSystemInit=True
00073	     RemoteRole=ROLE_SimulatedProxy
00074	     Style=STY_Translucent
00075	     ScaleGlow=3.000000
00076	}

End Source Code