RuneI
Class ZTargetDecal

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

class ZTargetDecal
extends Engine.Decal


Variables
 vector OldOwnerLocation


Function Summary
 void AttachToSurface()
     
//var FadeShadow FadeShadow;
 void Destroyed()
     
/*
 void Timer()
     
{
	Super.Destroyed();

	if ( FadeShadow != None )
		FadeShadow.Destroy();
}
*/



Source Code


00001	class ZTargetDecal expands Decal;
00002	
00003	var vector OldOwnerLocation;
00004	//var FadeShadow FadeShadow;
00005	
00006	function AttachToSurface()
00007	{
00008	}
00009	/*
00010	function Destroyed()
00011	{
00012		Super.Destroyed();
00013	
00014		if ( FadeShadow != None )
00015			FadeShadow.Destroy();
00016	}
00017	*/
00018	function Timer()
00019	{
00020		DetachDecal();
00021		OldOwnerLocation = vect(0,0,0);
00022	}
00023				
00024	event Update(Actor L)
00025	{
00026		local Actor HitActor;
00027		local Vector HitNormal,HitLocation, ShadowStart, ShadowDir;
00028	
00029		if ( !Level.bHighDetailMode )
00030			return;
00031	
00032		SetTimer(0.25, false);
00033		if ( OldOwnerLocation == Owner.Location )
00034			return;
00035	
00036		OldOwnerLocation = Owner.Location;
00037	
00038		DetachDecal();
00039	
00040		if ( Owner.Style == STY_Translucent )
00041			return;
00042	
00043		ShadowDir = vect(0.1,0.1,0);
00044	
00045		ShadowStart = Owner.Location + Owner.CollisionRadius * ShadowDir;
00046		HitActor = Trace(HitLocation, HitNormal, ShadowStart - vect(0,0,300), ShadowStart, false);
00047	
00048		if ( HitActor == None )
00049			return;
00050	
00051		SetLocation(HitLocation);
00052		SetRotation(rotator(HitNormal));
00053		AttachDecal(10, ShadowDir);
00054	}
00055	
00056	defaultproperties
00057	{
00058	     MultiDecalLevel=3
00059	     Style=STY_Translucent
00060	     Texture=Texture'RuneFX2.Target'
00061	}

End Source Code