Botpack
Class Stealth

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

class Stealth
extends Engine.Mutator

//============================================================================= // Stealth. // All players get invisibility //=============================================================================

Function Summary
 bool AlwaysKeep(Actor Other)
 bool CheckReplacement(Actor Other, out byte)
 void ModifyPlayer(Pawn Other)



Source Code


00001	//=============================================================================
00002	// Stealth.
00003	// All players get invisibility
00004	//=============================================================================
00005	
00006	class Stealth expands Mutator;
00007	
00008	function bool AlwaysKeep(Actor Other)
00009	{
00010		if ( Other.IsA('UT_Stealth') )
00011			return true;
00012		if ( NextMutator != None )
00013			return ( NextMutator.AlwaysKeep(Other) );
00014		return false;
00015	}
00016	
00017	function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
00018	{
00019		local inventory inv;
00020	
00021		if ( Other.bIsPawn && Pawn(Other).bIsPlayer	)
00022		{
00023			inv = Spawn(class'UT_Stealth');
00024			if( inv != None )
00025			{
00026				inv.charge = 9999999999;
00027				inv.bHeldItem = true;
00028				inv.RespawnTime = 0.0;
00029				inv.GiveTo(Pawn(Other));
00030				inv.Activate();
00031			}
00032		}
00033		if ( Other.IsA('UT_Invisibility') && !Other.IsA('UT_Stealth') )
00034			return false;
00035	
00036		bSuperRelevant = 0;
00037		return true;
00038	}
00039	
00040	function ModifyPlayer(Pawn Other)
00041	{
00042		// called by Gameinfo.RestartPlayer()
00043		local Inventory Inv;
00044	
00045		Inv = Other.FindInventoryType(class'UT_Stealth');
00046		if ( Inv != None )
00047			Inv.Charge = 9999999;
00048		else
00049		{
00050			inv = Spawn(class'UT_Stealth');
00051			if( inv != None )
00052			{
00053				inv.charge = 9999999;
00054				inv.bHeldItem = true;
00055				inv.RespawnTime = 0.0;
00056				inv.GiveTo(Other);
00057				inv.Activate();
00058			}
00059		}
00060		if ( NextMutator != None )
00061			NextMutator.ModifyPlayer(Other);
00062	}
00063	
00064	defaultproperties
00065	{
00066	}

End Source Code