Core.Object | +--Engine.Actor | +--Engine.Light | +--XIII.MuzzleLight
int
TickCount
simulated
Flash(vector Loc)
//_____________________________________________________________________________
00001 //----------------------------------------------------------- 00002 // 00003 //----------------------------------------------------------- 00004 class MuzzleLight extends Light; 00005 00006 var int TickCount; 00007 00008 //_____________________________________________________________________________ 00009 simulated event PostBeginPlay() 00010 { 00011 // Log(Self@"postbeginplay"); 00012 Super.PostBeginPlay(); 00013 LightType=LT_None; 00014 RefreshLighting(); 00015 Disable('Tick'); 00016 } 00017 00018 //_____________________________________________________________________________ 00019 simulated function Flash(vector Loc) 00020 { 00021 // Log(Self@"flash"); 00022 SetLocation(Loc); 00023 LightType=LT_Steady; 00024 RefreshLighting(); 00025 TickCount=0; 00026 Enable('Tick'); 00027 } 00028 00029 //_____________________________________________________________________________ 00030 simulated event Tick(float dT) 00031 { 00032 // Log(Self@"tick tickcount="$TickCount); 00033 TickCount ++; 00034 if ( (TickCount > 2) || (dT > 1.0/20.0) ) // leave sfx 2 frames or only one if frame rate < 20 fps 00035 { 00036 LightType=LT_None; 00037 RefreshLighting(); 00038 Disable('Tick'); 00039 } 00040 } 00041 00042 00043 00044 defaultproperties 00045 { 00046 bDecor1Light=False 00047 bDecor2Light=False 00048 bDecor3Light=False 00049 bActorLight=True 00050 bDecor4Light=False 00051 bDecor5Light=False 00052 bDecor6Light=False 00053 bDecor7Light=False 00054 bDecor8Light=False 00055 bDecor9Light=False 00056 bDecor10Light=False 00057 bStatic=False 00058 bNoDelete=False 00059 bDynamicLight=True 00060 bTearOff=True 00061 bMovable=True 00062 bIgnoredByShadows=True 00063 RemoteRole=ROLE_None 00064 LightBrightness=255 00065 LightHue=34 00066 LightSaturation=34 00067 LightRadius=12 00068 }