Botpack
Class QuakeCam

source: e:\games\UnrealTournament\Botpack\Classes\QuakeCam.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Keypoint
         |
         +--Botpack.SpectatorCam
            |
            +--Botpack.QuakeCam
Direct Known Subclasses:None

class QuakeCam
extends Botpack.SpectatorCam

//============================================================================= // QuakeCam. //=============================================================================
Variables
 float magnitude


Function Summary
 void BecomeViewTarget()
 void Timer()



Source Code


00001	//=============================================================================
00002	// QuakeCam.
00003	//=============================================================================
00004	class QuakeCam extends SpectatorCam;
00005	
00006	var() float magnitude;
00007	
00008	function BecomeViewTarget()
00009	{
00010		SetTimer(0.5, false);
00011	}
00012	
00013	function Timer()
00014	{
00015		local Pawn P;
00016		local PlayerPawn V;
00017		local bool bFound;
00018	
00019		for ( P=Level.PawnList; P!=None; P=P.NextPawn )
00020		{
00021			V = PlayerPawn(P);
00022			if ( (V != None) && (V.Viewtarget == self) )
00023			{
00024				bFound = true;
00025				V.BaseEyeHeight = FMin(V.Default.BaseEyeHeight, V.BaseEyeHeight * (0.5 + FRand()));
00026				V.ShakeView(1, magnitude, 0.015 * magnitude);
00027			}
00028		}
00029	
00030		if ( bFound )
00031			SetTimer(0.5, false);
00032	}
00033	
00034	defaultproperties
00035	{
00036	     magnitude=2000.000000
00037	     bStatic=False
00038	}

End Source Code