RuneI
Class DecalBlood

source: c:\runehov\RuneI\Classes\DecalBlood.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Decal
         |
         +--RuneI.DecalBlood
Direct Known Subclasses:DecalBlood2, DecalBlood3, DecalBlood4, DecalBlood5

class DecalBlood
extends Engine.Decal

//============================================================================= // DecalBlood. //=============================================================================
Variables
 float GrowForTime
 float TimePassed
 bStartedLife, bImportant


Function Summary
 
simulated
PostBeginPlay()
 
simulated
Timer()



Source Code


00001	//=============================================================================
00002	// DecalBlood.
00003	//=============================================================================
00004	class DecalBlood expands Decal;
00005	
00006	var bool bAttached, bStartedLife, bImportant;
00007	var float TimePassed;
00008	var float GrowForTime;
00009	
00010	simulated function PostBeginPlay()
00011	{
00012		if (class'GameInfo'.Default.bLowGore || (Level.bDropDetail && (FRand() < 0.35)) )
00013		{	// Can destroy this here because it's not replicated to client
00014			Destroy();
00015			return;
00016		}
00017	
00018		if(Owner != None)
00019			DrawScale = Owner.DrawScale * 0.4;
00020	
00021		Super.PostBeginPlay();
00022		SetTimer(1.0, false);
00023	}
00024	
00025	simulated function Timer()
00026	{
00027		// Check for nearby players, if none then destroy self
00028	
00029		if ( !bAttached )
00030		{
00031			Destroy();
00032			return;
00033		}
00034	
00035		if ( !bStartedLife )
00036		{
00037			RemoteRole = ROLE_None;
00038			bStartedLife = true;
00039			if ( Level.bDropDetail )
00040				SetTimer(5.0 + 2 * FRand(), false);
00041			else
00042				SetTimer(18.0 + 5 * FRand(), false);
00043			return;
00044		}
00045		if ( Level.bDropDetail && (MultiDecalLevel < 6) )
00046		{
00047			if ( (Level.TimeSeconds - LastRenderedTime > 0.35)
00048				|| (!bImportant && (FRand() < 0.2)) )
00049				Destroy();
00050			else
00051			{
00052				SetTimer(1.0, true);
00053				return;
00054			}
00055		}
00056		else if ( Level.TimeSeconds - LastRenderedTime < 1 )
00057		{
00058			SetTimer(5.0, true);
00059			return;
00060		}
00061		Destroy();
00062	}
00063	
00064	defaultproperties
00065	{
00066	     bAttached=True
00067	     GrowForTime=4.000000
00068	     bBloodyDecal=True
00069	     Style=STY_Modulated
00070	     Texture=Texture'BloodFX.blood02_b'
00071	}

End Source Code