RuneI
Class LightningPowerup

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

class LightningPowerup
extends RuneI.Electricity

//============================================================================= // LightningPowerup. //=============================================================================
Variables
 int DamagePerSecond
 Effects Flash
 float TimeElapsed


Function Summary
 void Tick(float DeltaTime)



Source Code


00001	//=============================================================================
00002	// LightningPowerup.
00003	//=============================================================================
00004	class LightningPowerup expands Electricity;
00005	
00006	var() int DamagePerSecond;
00007	var float TimeElapsed;
00008	var Effects Flash;
00009	
00010	
00011	function Tick(float DeltaTime)
00012	{
00013		TimeElapsed += DeltaTime;
00014	
00015		if (TimeElapsed > 1)
00016		{
00017			if (Base != None)
00018			{
00019				if (Pawn(Base)!=None && Pawn(Base).Health > 0)
00020				{
00021					Base.JointDamaged(DamagePerSecond, Instigator, Base.Location, vect(0,0,0), 'fire', 0);
00022					if (Pawn(Base).Health <= 0)
00023					{
00024						if (Flash != None)
00025							Flash.Destroy();
00026						Destroy();
00027					}
00028				}
00029	
00030				// Create flash if it doesn't exist yet
00031				if (Flash == None)
00032				{
00033					Flash = Spawn(class'FlashCycle', Owner,, Base.Location);
00034					Flash.SetBase(Base);
00035				}
00036			}
00037			
00038			TimeElapsed = 0;
00039		}
00040	}
00041	
00042	defaultproperties
00043	{
00044	     DamagePerSecond=10
00045	}

End Source Code