Botpack
Class BioFear

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

class BioFear
extends Engine.Triggers

//============================================================================= // BioFear. // Creatures will tend to back away when entering this spot // To be effective, there should also not be any paths going through the area //=============================================================================
Variables
 bool bInitiallyActive


Function Summary
 void Touch(Actor Other)



Source Code


00001	//=============================================================================
00002	// BioFear.
00003	// Creatures will tend to back away when entering this spot
00004	// To be effective, there should also not be any paths going through the area
00005	//=============================================================================
00006	class BioFear extends Triggers;
00007	
00008	var() bool bInitiallyActive;
00009	
00010	function Touch( actor Other )
00011	{
00012		local Bot B;
00013	
00014		if ( Other.bIsPawn )
00015		{
00016			B = Bot(Other);
00017			if ( B == None )
00018				return;
00019	
00020			if ( B.bNovice )
00021			{
00022				if ( FRand() > 0.4 + 0.1 * B.Skill )
00023					return;
00024			}
00025			else if ( FRand() > 0.7 + 0.1 * B.Skill )
00026				return;
00027			B.FearThisSpot(self);
00028			if ( CollisionRadius < 120 )
00029				Destroy();
00030			else
00031				SetCollisionSize(CollisionRadius - 25, CollisionHeight);
00032		}
00033	}
00034	
00035	defaultproperties
00036	{
00037	     RemoteRole=ROLE_None
00038	     CollisionRadius=200.000000
00039	}

End Source Code