Botpack
Class UTIntro

source: e:\games\UnrealTournament\Botpack\Classes\UTIntro.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--Engine.GameInfo
            |
            +--Botpack.TournamentGameInfo
               |
               +--Botpack.UTIntro
Direct Known Subclasses:LadderLoadGame, LadderNewGame, LadderTransition, TrophyGame

class UTIntro
extends Botpack.TournamentGameInfo

//============================================================================= // UTIntro. //=============================================================================
Variables
 string CityIntroHUDClass
 int TickCount
 bool bOpened

States
Startup

Function Summary
 void AcceptInventory(Pawn PlayerPawn)
     
/* AcceptInventory()
Examine the passed player's inventory, and accept or discard each item
* AcceptInventory needs to gracefully handle the case of some inventory
being accepted but other inventory not being accepted (such as the default
weapon).  There are several things that can go wrong: A weapon's
AmmoType not being accepted but the weapon being accepted -- the weapon
should be killed off. Or the player's selected inventory item, active
weapon, etc. not being accepted, leaving the player weaponless or leaving
the HUD inventory rendering messed up (AcceptInventory should pick another
applicable weapon/item as current).
*/
 float PlaySpawnEffect(Inventory Inv)
 void PlayTeleportEffect(Actor Incoming, bool bOut, bool bSound)
 bool SetPause(BOOL bPause, PlayerPawn P)


State Startup Function Summary
 bool CanSpectate(Pawn Viewer, Actor ViewTarget)
 void Tick(float DeltaTime)



Source Code


00001	//=============================================================================
00002	// UTIntro.
00003	//=============================================================================
00004	class UTIntro extends TournamentGameInfo;
00005	
00006	var bool bOpened;
00007	var int TickCount;
00008	
00009	var config string CityIntroHUDClass;
00010	
00011	event PreBeginPlay()
00012	{
00013		if( CityIntroHUDClass!="" && Left(string(Level), 9) ~="cityintro" )
00014		{
00015			HUDType = class<HUD>( DynamicLoadObject(CityIntroHUDClass, class'Class') );
00016			Log("Using CityIntro HUD: "$HUDType);
00017		}		
00018		Super.PreBeginPlay();
00019	}
00020	
00021	event playerpawn Login
00022	(
00023		string Portal,
00024		string Options,
00025		out string Error,
00026		class<playerpawn> SpawnClass
00027	)
00028	{
00029		local PlayerPawn NewPlayer;
00030		local SpectatorCam Cam;
00031	
00032		// Don't allow player to be a spectator
00033		if( !SpawnClass.Default.bCollideActors )
00034			SpawnClass = class'TMale2';
00035	
00036		bRatedGame = true;
00037		NewPlayer = Super.Login(Portal, Options, Error, SpawnClass);
00038		bRatedGame = false;
00039		NewPlayer.bHidden = True;
00040	
00041		foreach AllActors(class'SpectatorCam', Cam) 
00042			NewPlayer.ViewTarget = Cam;
00043	
00044		return NewPlayer;
00045	}
00046	
00047	/* AcceptInventory()
00048	Examine the passed player's inventory, and accept or discard each item
00049	* AcceptInventory needs to gracefully handle the case of some inventory
00050	being accepted but other inventory not being accepted (such as the default
00051	weapon).  There are several things that can go wrong: A weapon's
00052	AmmoType not being accepted but the weapon being accepted -- the weapon
00053	should be killed off. Or the player's selected inventory item, active
00054	weapon, etc. not being accepted, leaving the player weaponless or leaving
00055	the HUD inventory rendering messed up (AcceptInventory should pick another
00056	applicable weapon/item as current).
00057	*/
00058	function AcceptInventory(pawn PlayerPawn)
00059	{
00060		local inventory Inv;
00061		local LadderInventory LadderObj;
00062	
00063		// DeathMatchPlus accepts LadderInventory
00064		for( Inv=PlayerPawn.Inventory; Inv!=None; Inv=Inv.Inventory )
00065		{
00066			if (Inv.IsA('LadderInventory'))
00067			{
00068				LadderObj = LadderInventory(Inv);
00069			} 
00070			else 	
00071				Inv.Destroy();
00072		}
00073		PlayerPawn.Weapon = None;
00074		PlayerPawn.SelectedItem = None;
00075	}
00076	
00077	function PlayTeleportEffect( actor Incoming, bool bOut, bool bSound)
00078	{
00079	}
00080	
00081	function float PlaySpawnEffect(inventory Inv)
00082	{
00083	}
00084	
00085	function bool SetPause( BOOL bPause, PlayerPawn P )
00086	{
00087		return False;
00088	}
00089	
00090	auto state Startup
00091	{
00092		function Tick(float DeltaTime)
00093		{
00094			local Pawn P;
00095	
00096			if( Level.LevelAction == LEVACT_Connecting )
00097			{
00098				bOpened = True;
00099				Disable('Tick');
00100				return;
00101			}
00102	
00103			TickCount++;
00104			if(TickCount < 2)
00105				return;
00106	
00107			if (DemoBuild == 1 && !bOpened )
00108			{
00109				for ( P=Level.PawnList; P!=None; P=P.NextPawn )
00110				{
00111					if ( P.IsA('PlayerPawn') && (PlayerPawn(P) != None)
00112						&& (PlayerPawn(P).Player != None)
00113						&& (TournamentConsole(PlayerPawn(P).Player.Console) != None) 
00114						&& PlayerPawn(P).ProgressMessage[0] == "")
00115						TournamentConsole(PlayerPawn(P).Player.Console).LaunchUWindow();
00116				}
00117			}
00118			bOpened = True;
00119			Disable('Tick');
00120		}
00121	}
00122	
00123	function bool CanSpectate( pawn Viewer, actor ViewTarget )
00124	{
00125		return false;
00126	}
00127	
00128	defaultproperties
00129	{
00130	     bGameEnded=True
00131	     bCanViewOthers=False
00132	     DefaultWeapon=None
00133	     RulesMenuType="UTMenu.UTRulesSClient"
00134	     SettingsMenuType="UTMenu.UTRulesSClient"
00135	     GameUMenuType="UTMenu.UTGameMenu"
00136	     MultiplayerUMenuType="UTMenu.UTMultiplayerMenu"
00137	     GameOptionsMenuType="UTMenu.UTOptionsMenu"
00138	     HUDType=Class'Botpack.CHNullHUD'
00139	}

End Source Code