Core.Object | +--Engine.Actor | +--Engine.Decal | +--Botpack.FadeShadow
Actor
LightSource
Vector
OldOwnerLocation
void
AttachToSurface()
Destroyed()
Tick(float DeltaTime)
00001 class FadeShadow expands Decal; 00002 00003 #exec TEXTURE IMPORT NAME=fshadow FILE=TEXTURES\DECALS\shadow_2.PCX LODSET=2 ALPHATRICK=1 00004 00005 var Actor LightSource; 00006 var Vector OldOwnerLocation; 00007 00008 function AttachToSurface() 00009 { 00010 } 00011 00012 function Destroyed() 00013 { 00014 Super.Destroyed(); 00015 00016 //if ( PlayerShadow(Owner) != None ) 00017 // PlayerShadow(Owner).FadeShadow = None; 00018 } 00019 00020 function Tick(float DeltaTime) 00021 { 00022 local Actor HitActor, L; 00023 local Vector HitNormal,HitLocation, ShadowStart, ShadowDir; 00024 00025 if ( (Owner == None) || (Owner.Owner == None) ) 00026 { 00027 Destroy(); 00028 return; 00029 } 00030 00031 ScaleGlow -= DeltaTime; 00032 00033 if ( OldOwnerLocation == Owner.Owner.Location ) 00034 return; 00035 OldOwnerLocation = Owner.Owner.Location; 00036 00037 DetachDecal(); 00038 00039 if ( Owner.Owner.bHidden || (Owner.Owner.Mesh == None) ) 00040 { 00041 Destroy(); 00042 return; 00043 } 00044 00045 if ( ScaleGlow < 0.05 ) 00046 { 00047 Destroy(); 00048 return; 00049 } 00050 if ( LightSource == None ) 00051 return; 00052 00053 ShadowDir = Normal(Owner.Owner.Location - LightSource.Location); 00054 00055 if ( ShadowDir.Z > 0 ) 00056 ShadowDir.Z *= -1; 00057 00058 ShadowStart = Owner.Owner.Location + Owner.Owner.CollisionRadius * ShadowDir; 00059 HitActor = Trace(HitLocation, HitNormal, ShadowStart - vect(0,0,300), ShadowStart, false); 00060 00061 if ( HitActor == None ) 00062 return; 00063 00064 SetLocation(HitLocation); 00065 SetRotation(rotator(HitNormal)); 00066 AttachDecal(10, ShadowDir); 00067 } 00068 00069 defaultproperties 00070 { 00071 MultiDecalLevel=3 00072 LifeSpan=1.000000 00073 Texture=Texture'Botpack.fshadow' 00074 DrawScale=0.650000 00075 }