XIII
Class DamageVolume

source: C:\XIII\XIII\Classes\DamageVolume.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Brush
         |
         +--Engine.Volume
            |
            +--XIII.DamageVolume
Direct Known Subclasses:None

class DamageVolume
extends Engine.Volume

//============================================================================= // DamageVolume. //=============================================================================
Variables
 int DamagePerSec
 class DamageType
 bool LevelModification


Source Code


00001	//=============================================================================
00002	// DamageVolume.
00003	//=============================================================================
00004	class DamageVolume extends Volume;
00005	
00006	VAR class<XIIIDamageType> DamageType;
00007	VAR int DamagePerSec;
00008	VAR bool LevelModification;
00009	
00010	EVENT Timer( )
00011	{
00012		LOCAL int i;
00013	
00014		for ( i=0; i<Touching.Length; i++ )
00015		{
00016			if ( !LevelModification && Touching[i].IsA( 'XIIIPlayerPawn' ) )
00017				Touching[i].TakeDamage( DamagePerSec*1.5/((1+Level.Game.Difficulty)*0.15+Level.AdjustDifficulty/100), none, Touching[i].Location, vect(0,0,0), DamageType );
00018			else
00019				Touching[i].TakeDamage( DamagePerSec, none, Touching[i].Location, vect(0,0,0), DamageType );
00020		}
00021	}	
00022	
00023	STATE() STA_Lets_Burn
00024	{
00025		EVENT BeginState( )
00026		{
00027			SetTimer( 1.0, true );
00028		}
00029	}
00030	
00031	STATE() STA_TriggerTurnOn
00032	{
00033		EVENT Trigger( Actor Other, Pawn EventInstigator )
00034		{
00035			SetTimer( 1.0, true );
00036			Disable( 'Trigger');
00037		}
00038	}
00039	
00040	
00041	defaultproperties
00042	{
00043	     DamageType=Class'XIII.DTFire'
00044	     DamagePerSec=2
00045	     bStatic=False
00046	     InitialState="STA_Lets_Burn"
00047	}

End Source Code