Core.Object | +--Engine.Actor | +--Engine.Decal | +--Botpack.PlayerShadow
Actor
OldLight
vector
OldOwnerLocation
void
AttachToSurface()
//var FadeShadow FadeShadow;
Destroyed()
/*
Timer()
{ Super.Destroyed(); if ( FadeShadow != None ) FadeShadow.Destroy(); } */
00001 class PlayerShadow expands Decal; 00002 00003 var vector OldOwnerLocation; 00004 var Actor OldLight; 00005 //var FadeShadow FadeShadow; 00006 00007 function AttachToSurface() 00008 { 00009 } 00010 /* 00011 function Destroyed() 00012 { 00013 Super.Destroyed(); 00014 00015 if ( FadeShadow != None ) 00016 FadeShadow.Destroy(); 00017 } 00018 */ 00019 function Timer() 00020 { 00021 DetachDecal(); 00022 OldOwnerLocation = vect(0,0,0); 00023 } 00024 00025 event Update(Actor L) 00026 { 00027 local Actor HitActor; 00028 local Vector HitNormal,HitLocation, ShadowStart, ShadowDir; 00029 00030 if ( !Level.bHighDetailMode ) 00031 return; 00032 00033 SetTimer(0.08, false); 00034 if ( OldOwnerLocation == Owner.Location ) 00035 return; 00036 00037 OldOwnerLocation = Owner.Location; 00038 00039 DetachDecal(); 00040 00041 if ( Owner.Style == STY_Translucent ) 00042 return; 00043 00044 if ( L == None ) 00045 ShadowDir = vect(0.1,0.1,0); 00046 else 00047 { 00048 ShadowDir = Normal(Owner.Location - L.Location); 00049 /* 00050 if ( OldLight != L ) 00051 { 00052 if ( FadeShadow == None ) 00053 FadeShadow = spawn(class'FadeShadow',self); 00054 00055 FadeShadow.LightSource = OldLight; 00056 } 00057 OldLight = L; 00058 */ 00059 if ( ShadowDir.Z > 0 ) 00060 ShadowDir.Z *= -1; 00061 } 00062 00063 00064 ShadowStart = Owner.Location + Owner.CollisionRadius * ShadowDir; 00065 HitActor = Trace(HitLocation, HitNormal, ShadowStart - vect(0,0,300), ShadowStart, false); 00066 00067 if ( HitActor == None ) 00068 return; 00069 00070 SetLocation(HitLocation); 00071 SetRotation(rotator(HitNormal)); 00072 AttachDecal(10, ShadowDir); 00073 } 00074 00075 defaultproperties 00076 { 00077 MultiDecalLevel=3 00078 Texture=Texture'Botpack.energymark' 00079 DrawScale=0.500000 00080 }