RuneI
Class DarkDwarfLightning2

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

class DarkDwarfLightning2
extends RuneI.BeamSystem

//============================================================================= // DarkDwarfLightning2. //=============================================================================
Variables
 float amplitude


Function Summary
 void Trigger(Actor Other, Pawn EventInstigator)



Source Code


00001	//=============================================================================
00002	// DarkDwarfLightning2.
00003	//=============================================================================
00004	class DarkDwarfLightning2 expands BeamSystem;
00005	
00006	
00007	var float amplitude;
00008	
00009	function Trigger( Actor Other, Pawn EventInstigator )
00010	{
00011		amplitude += 5;
00012	
00013		if (amplitude >= 35)
00014		{	// Powerlevel 4
00015			ParticleTexture[0]=Texture'RuneFX.Beam2Red';
00016		}
00017	}
00018	
00019	
00020	//=============================================================================
00021	//
00022	// SystemTick
00023	//
00024	// Called when the particle system is ticked IF bEventSystemTick is true
00025	//=============================================================================
00026	event SystemTick(float DeltaSeconds)
00027	{
00028		local int i;
00029		local float amp;
00030		local vector v;
00031		local vector X, Y, Z;
00032		local float dist;
00033			
00034		if(Target == None)
00035		{
00036			return;
00037		}
00038		
00039		BeamTime += DeltaSeconds;
00040	
00041		if(TargetJointIndex == 0)
00042		{	
00043			v = Target.Location - Location;
00044		}
00045		else
00046		{
00047			v = Target.GetJointPos(TargetJointIndex) - Location;
00048		}
00049		
00050		dist = VSize(v) * 0.03;
00051		GetAxes(rotator(v), X, Y, Z);
00052		
00053		for(i = 0; i < NumConPts; i++)
00054		{
00055			if(i < NumConPts / 2)
00056			{
00057				amp = dist * float(i) / NumConPts;
00058			}
00059			else
00060			{
00061				amp = dist * float(NumConPts - i) / NumConPts;
00062			}
00063			
00064			ConnectionOffset[i] = Z * amp * sin(BeamTime * 20 + i * 0.5)
00065				+ Y * amp * 2 * sin(BeamTime * 15 + i * 0.5);
00066		}
00067	}
00068	
00069	defaultproperties
00070	{
00071	     Amplitude=20.000000
00072	     bSystemTicks=True
00073	     ParticleCount=30
00074	     ParticleTexture(0)=Texture'RuneFX.swipe'
00075	     AlphaStart=60
00076	     AlphaEnd=60
00077	     NumConPts=10
00078	     BeamThickness=8.000000
00079	     Style=STY_Translucent
00080	}

End Source Code