Botpack
Class TrainingDM

source: e:\games\UnrealTournament\Botpack\Classes\TrainingDM.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--Engine.GameInfo
            |
            +--Botpack.TournamentGameInfo
               |
               +--Botpack.DeathMatchPlus
                  |
                  +--Botpack.TrainingDM
Direct Known Subclasses:None

class TrainingDM
extends Botpack.DeathMatchPlus


Variables
 string DM[24]
 string KeyAlias[255]
 vector LastLocation
 rotator LastRotation
 EventIndex, SoundIndex
 PlayerPawn Trainee
 string TutMessage14Parts[2]
 string TutMessage15Parts[2]
 string TutMessage4Parts[5]
 string TutMessage6Parts[2]
 string TutMessage[24]
 bool bPause
 bool bReadyToSpawn

States
ServerTravel, FreeRunning10, ChunkTheNali, FreeRunning9, FreeRunning8, FreeRunning7, FreeRunning6, FreeRunning5, FreeRunning4, FreeRunning3, FreeRunning2, FreeRunning1

Function Summary
 void AddDefaultInventory(Pawn PlayerPawn)
 void DMTutEvent0()
 void DMTutEvent1()
 void DMTutEvent2()
 void DMTutEvent3()
 void DMTutEvent4()
 void DMTutEvent5()
 void DMTutEvent6()
 void InitRatedGame(LadderInventory LadderObj, PlayerPawn LadderPlayer)
 void LoadKeyBindings(PlayerPawn P)
 void PostBeginPlay()
 void Timer()
 void TutorialSound(string NewSound)


State ServerTravel Function Summary
 void BeginState()
 void Timer()


State FreeRunning10 Function Summary
 void EndGame(string Reason)
 bool SuccessfulGame()
 void DMTutEvent23()
 void Tick(float DeltaTime)


State ChunkTheNali Function Summary
 void DMTutEvent22()
 void DMTutEvent21()
 void Tick(float DeltaTime)


State FreeRunning9 Function Summary
 void DMTutEvent20()
 void Tick(float DeltaTime)


State FreeRunning8 Function Summary
 void DMTutEvent19()
 void Tick(float DeltaTime)


State FreeRunning7 Function Summary
 void DMTutEvent18()
 void Tick(float DeltaTime)


State FreeRunning6 Function Summary
 void DMTutEvent17()
 void Tick(float DeltaTime)


State FreeRunning5 Function Summary
 void DMTutEvent16()
 void Tick(float DeltaTime)


State FreeRunning4 Function Summary
 void DMTutEvent15()
 void Tick(float DeltaTime)


State FreeRunning3 Function Summary
 void DMTutEvent14()
 void DMTutEvent13()
 void DMTutEvent12()
 void DMTutEvent11()
 void BeginState()
 void Tick(float DeltaTime)


State FreeRunning2 Function Summary
 void DMTutEvent10()
 void DMTutEvent9()
 void DMTutEvent8()
 void BeginState()
 void Tick(float DeltaTime)


State FreeRunning1 Function Summary
 void DMTutEvent7()
 void Tick(float DeltaTime)



Source Code


00001	class TrainingDM extends DeathMatchPlus;
00002	
00003	#exec OBJ LOAD FILE=..\Sounds\TutVoiceDM.uax PACKAGE=TutVoiceDM
00004	
00005	var string DM[24];
00006	
00007	var bool bReadyToSpawn;
00008	
00009	var localized string TutMessage[24];
00010	var localized string TutMessage4Parts[5];
00011	var localized string TutMessage6Parts[2];
00012	var localized string TutMessage14Parts[2];
00013	var localized string TutMessage15Parts[2];
00014	
00015	var string KeyAlias[255];
00016	
00017	var PlayerPawn Trainee;
00018	var rotator LastRotation;
00019	var vector LastLocation;
00020	
00021	var int EventTimer, LastEvent, EventIndex, SoundIndex;
00022	var bool bPause;
00023	
00024	// Parse options for this game...
00025	event InitGame( string Options, out string Error )
00026	{
00027		Super.InitGame(Options, Error);
00028	
00029		bRatedGame = True;
00030		TimeLimit = 0;
00031		RemainingTime = 0;
00032		FragLimit = 3;
00033		bRequireReady = False;
00034		EventTimer = 3;
00035	}
00036	
00037	function InitRatedGame(LadderInventory LadderObj, PlayerPawn LadderPlayer)
00038	{
00039		Super.InitRatedGame(LadderObj, LadderPlayer);
00040		
00041		RemainingBots = 0;
00042		bRequireReady = False;
00043	}
00044	
00045	function PostBeginPlay()
00046	{
00047		local Barrel B;
00048	
00049		Super.PostBeginPlay();
00050	
00051		foreach AllActors(class'Barrel', B)
00052		{
00053			B.bHidden = True;
00054			B.SetCollision(False, False, False);
00055		}
00056	}
00057	
00058	event playerpawn Login
00059	(
00060		string Portal,
00061		string Options,
00062		out string Error,
00063		class<playerpawn> SpawnClass
00064	)
00065	{
00066		Trainee = Super.Login(Portal, Options, Error, SpawnClass);
00067		Trainee.PlayerReplicationInfo.TeamName = "Red";
00068		Trainee.PlayerReplicationInfo.Team = 0;
00069		Trainee.ReducedDamageType = 'All';
00070	
00071		return Trainee;
00072	}
00073	
00074	function TutorialSound( string NewSound )
00075	{
00076		local sound MySound;
00077	
00078		MySound = sound( DynamicLoadObject(NewSound, class'Sound') );
00079		EventTimer = GetSoundDuration( MySound ) + 2;
00080		Trainee.PlaySound(MySound, SLOT_Interface, 2.0);
00081	}
00082	
00083	function AddDefaultInventory( pawn PlayerPawn )
00084	{
00085		local Weapon NewWeapon;
00086	
00087		if (bReadyToSpawn)
00088		{
00089			if (!PlayerPawn.PlayerReplicationInfo.bIsABot)
00090				newWeapon = Spawn(class'ShockRifle');
00091			else
00092				newWeapon = Spawn(class'Enforcer');
00093	
00094			if( newWeapon != None )
00095			{
00096				newWeapon.BecomeItem();
00097				newWeapon.bHeldItem = true;
00098				PlayerPawn.AddInventory(newWeapon);
00099				newWeapon.Instigator = PlayerPawn;
00100				newWeapon.GiveAmmo(PlayerPawn);
00101				newWeapon.SetSwitchPriority(PlayerPawn);
00102				newWeapon.WeaponSet(PlayerPawn);
00103				if ( !PlayerPawn.IsA('PlayerPawn') )
00104					newWeapon.GotoState('Idle');
00105				PlayerPawn.Weapon.GotoState('DownWeapon');
00106				PlayerPawn.PendingWeapon = None;
00107				PlayerPawn.Weapon = newWeapon;
00108				newWeapon.AmmoType.AmmoAmount = 199;
00109				newWeapon.AmmoType.MaxAmmo = 199;
00110			}
00111		}
00112	}
00113	
00114	function LoadKeyBindings(PlayerPawn P)
00115	{
00116		local int i;
00117		local string k;
00118	
00119		for (i=0; i<255; i++)
00120		{
00121			k = P.ConsoleCommand( "KEYNAME "$i );
00122			KeyAlias[i] = P.ConsoleCommand( "KEYBINDING "$k );
00123		}
00124	}
00125	
00126	function Timer()
00127	{
00128		Super.Timer();
00129	
00130		if ((EventTimer == 0) || bPause)
00131			return;
00132	
00133		EventTimer--;
00134		if (EventTimer == 0)		// Event time is up, perform an event
00135		{
00136			if (EventIndex == LastEvent)	// No more events queued.
00137				return;
00138	
00139			// Call an event function appropriate for this event.
00140			switch (EventIndex)
00141			{
00142				case 0:
00143					DMTutEvent0();
00144					break;
00145				case 1:
00146					DMTutEvent1();
00147					break;
00148				case 2:
00149					DMTutEvent2();
00150					break;
00151				case 3:
00152					DMTutEvent3();
00153					break;
00154				case 4:
00155					DMTutEvent4();
00156					break;
00157				case 5:
00158					DMTutEvent5();
00159					break;
00160				case 6:
00161					DMTutEvent6();
00162					break;
00163				case 7:
00164					DMTutEvent7();
00165					break;
00166				case 8:
00167					DMTutEvent8();
00168					break;
00169				case 9:
00170					DMTutEvent9();
00171					break;
00172				case 10:
00173					DMTutEvent10();
00174					break;
00175				case 11:
00176					DMTutEvent11();
00177					break;
00178				case 12:
00179					DMTutEvent12();
00180					break;
00181				case 13:
00182					DMTutEvent13();
00183					break;
00184				case 14:
00185					DMTutEvent14();
00186					break;
00187				case 15:
00188					DMTutEvent15();
00189					break;
00190				case 16:
00191					DMTutEvent16();
00192					break;
00193				case 17:
00194					DMTutEvent17();
00195					break;
00196				case 18:
00197					DMTutEvent18();
00198					break;
00199				case 19:
00200					DMTutEvent19();
00201					break;
00202				case 20:
00203					DMTutEvent20();
00204					break;
00205				case 21:
00206					DMTutEvent21();
00207					break;
00208				case 22:
00209					DMTutEvent22();
00210					break;
00211				case 23:
00212					DMTutEvent23();
00213					break;
00214			}
00215			EventIndex++;
00216		}
00217	}
00218	
00219	function DMTutEvent0()
00220	{
00221		Trainee.ProgressTimeOut = Level.TimeSeconds;
00222		LoadKeyBindings(Trainee);
00223		TournamentConsole(Trainee.Player.Console).ShowMessage();
00224		TutorialSound(DM[0]);
00225		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[0]);
00226		SoundIndex++;
00227	
00228		Trainee.Health = 100;
00229	}
00230	
00231	function DMTutEvent1()
00232	{
00233		TutorialSound(DM[1]);
00234		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[1]);
00235		SoundIndex++;
00236	}
00237	
00238	function DMTutEvent2()
00239	{
00240		TutorialSound(DM[2]);
00241		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[2]);
00242		SoundIndex++;
00243	}
00244	
00245	function DMTutEvent3()
00246	{
00247		TutorialSound(DM[3]);
00248		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[3]);
00249		SoundIndex++;
00250	}
00251	
00252	function DMTutEvent4()
00253	{
00254		local int i;
00255		local string Message;
00256		local string ForwardKey, BackKey, LeftStrafeKey, RightStrafeKey;
00257	
00258		for (i=0; i<255; i++)
00259		{
00260			if (KeyAlias[i] ~= "MoveForward")
00261			{
00262				if (ForwardKey != "")
00263					ForwardKey = ForwardKey$","@class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00264				else
00265					ForwardKey = class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00266			}
00267			if (KeyAlias[i] ~= "MoveBackward")
00268			{
00269				if (BackKey != "")
00270					BackKey = BackKey$","@class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00271				else
00272					BackKey = class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00273			}
00274			if (KeyAlias[i] ~= "StrafeLeft")
00275			{
00276				if (LeftStrafeKey != "")
00277					LeftStrafeKey = LeftStrafeKey$","@class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00278				else
00279					LeftStrafeKey = class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00280			}
00281			if (KeyAlias[i] ~= "StrafeRight")
00282			{
00283				if (RightStrafeKey != "")
00284					RightStrafeKey = RightStrafeKey$","@class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00285				else
00286					RightStrafeKey = class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00287			}
00288		}
00289	
00290		TutorialSound(DM[4]);
00291		Message = TutMessage4Parts[0]@"["$ForwardKey$"]"@TutMessage4Parts[1]@"["$BackKey$"]"@TutMessage4Parts[2]@"["$LeftStrafeKey$"]"@TutMessage4Parts[3]@"["$RightStrafeKey$"]"$TutMessage4Parts[4];
00292		TournamentConsole(Trainee.Player.Console).AddMessage(Message);
00293		SoundIndex++;
00294	}
00295	
00296	function DMTutEvent5()
00297	{
00298		TutorialSound(DM[5]);
00299		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[5]);
00300		SoundIndex++;
00301	}
00302	
00303	function DMTutEvent6()
00304	{
00305		bPause = True;
00306		GoToState('FreeRunning1');
00307	}
00308	
00309	state FreeRunning1
00310	{
00311		function Tick(float DeltaTime)
00312		{
00313			local int i;
00314			local string Message;
00315			local string JumpKey;
00316	
00317			Super.Tick(DeltaTime);
00318	
00319			// Test for strafing and goto next state if true.
00320			if (Trainee.bWasLeft || Trainee.bWasRight)
00321			{
00322				for (i=0; i<255; i++)
00323				{
00324					if (KeyAlias[i] ~= "Jump")
00325					{
00326						if (JumpKey != "")
00327							JumpKey = JumpKey$","@class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00328						else
00329							JumpKey = class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00330					}
00331				}
00332	
00333				bPause = False;
00334	
00335				TutorialSound(DM[6]);
00336				Message = TutMessage6Parts[0]@"["$JumpKey$"]"@TutMessage6Parts[1];
00337				TournamentConsole(Trainee.Player.Console).AddMessage(Message);
00338				SoundIndex++;
00339	
00340				GotoState('');
00341			}
00342		}
00343	}
00344	
00345	function DMTutEvent7()
00346	{
00347		bPause = True;
00348		GoToState('FreeRunning2');
00349	}
00350	
00351	state FreeRunning2
00352	{
00353		function Tick(float DeltaTime)
00354		{
00355			Super.Tick(DeltaTime);
00356	
00357			// Test for jumping.
00358			if (Trainee.Location.Z != LastLocation.Z)
00359			{
00360				bPause = False;
00361	
00362				TutorialSound(DM[7]);
00363				TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[7]);
00364				SoundIndex++;
00365	
00366				GotoState('');
00367			}
00368		}
00369	
00370		function BeginState()
00371		{
00372			LastLocation = Trainee.Location;
00373		}
00374	}
00375	
00376	function DMTutEvent8()
00377	{
00378		TutorialSound(DM[8]);
00379		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[8]);
00380		SoundIndex++;
00381	}
00382	
00383	function DMTutEvent9()
00384	{
00385		TutorialSound(DM[9]);
00386		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[9]);
00387		SoundIndex++;
00388	}
00389	
00390	function DMTutEvent10()
00391	{
00392		bPause = True;
00393		GoToState('FreeRunning3');
00394	}
00395	
00396	state FreeRunning3
00397	{
00398		function Tick(float DeltaTime)
00399		{
00400			Super.Tick(DeltaTime);
00401	
00402			// Test for mouselook and goto next state if true.
00403			if (Trainee.Rotation != LastRotation)
00404			{
00405				bPause = False;
00406	
00407				TutorialSound(DM[10]);
00408				TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[10]);
00409				SoundIndex++;
00410	
00411				GotoState('');
00412			}
00413		}
00414	
00415		function BeginState()
00416		{
00417			LastRotation = Trainee.Rotation;
00418		}
00419	}
00420	
00421	function DMTutEvent11()
00422	{
00423		TutorialSound(DM[11]);
00424		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[11]);
00425		SoundIndex++;
00426	}
00427	
00428	function DMTutEvent12()
00429	{
00430		TutorialSound(DM[12]);
00431		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[12]);
00432		SoundIndex++;
00433	}
00434	
00435	function DMTutEvent13()
00436	{
00437		local Mover m;
00438		foreach AllActors(class'Mover', m)
00439			m.Trigger(Trainee, Trainee);
00440	
00441		TutorialSound(DM[13]);
00442		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[13]);
00443		SoundIndex++;
00444	}
00445	
00446	function DMTutEvent14()
00447	{
00448		bPause = True;
00449		GoToState('FreeRunning4');
00450	}
00451	
00452	state FreeRunning4
00453	{
00454		function Tick(float DeltaTime)
00455		{
00456			local int i;
00457			local string Message;
00458			local string FireKey;
00459	
00460			Super.Tick(DeltaTime);
00461	
00462			// Test for weapon pickup and move on.
00463			if (Trainee.Weapon != None)
00464			{
00465				for (i=0; i<255; i++)
00466				{
00467					if (KeyAlias[i] ~= "Fire")
00468					{
00469						if (FireKey != "")
00470							FireKey = FireKey$","@class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00471						else
00472							FireKey = class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00473					}
00474				}
00475	
00476				bPause = False;
00477	
00478				TutorialSound(DM[14]);
00479				Message = TutMessage14Parts[0]@"["$FireKey$"]"@TutMessage14Parts[1];
00480				TournamentConsole(Trainee.Player.Console).AddMessage(Message);
00481				SoundIndex++;
00482	
00483				GotoState('');
00484			}
00485		}
00486	}
00487	
00488	function DMTutEvent15()
00489	{
00490		bPause = True;
00491		GoToState('FreeRunning5');
00492	}
00493	
00494	state FreeRunning5
00495	{
00496		function Tick(float DeltaTime)
00497		{
00498			local int i;
00499			local string Message;
00500			local string FireKey;
00501	
00502			Super.Tick(DeltaTime);
00503	
00504			// Test for weapon fire and move on.
00505			if (Trainee.bFire != 0)
00506			{
00507				for (i=0; i<255; i++)
00508				{
00509					if (KeyAlias[i] ~= "AltFire")
00510					{
00511						if (FireKey != "")
00512							FireKey = FireKey$","@class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00513						else
00514							FireKey = class'UMenuCustomizeClientWindow'.default.LocalizedKeyName[i];
00515					}
00516				}
00517	
00518				bPause = False;
00519	
00520				TutorialSound(DM[15]);
00521				Message = TutMessage15Parts[0]@"["$FireKey$"]"@TutMessage15Parts[1];
00522				TournamentConsole(Trainee.Player.Console).AddMessage(Message);
00523				SoundIndex++;
00524	
00525				GotoState('');
00526			}
00527		}
00528	}
00529	
00530	function DMTutEvent16()
00531	{
00532		bPause = True;
00533		GoToState('FreeRunning6');
00534	}
00535	
00536	state FreeRunning6
00537	{
00538		function Tick(float DeltaTime)
00539		{
00540			local Weapon newWeapon;
00541	
00542			Super.Tick(DeltaTime);
00543	
00544			// Test for weapon altfire and move on.
00545			if (Trainee.bAltFire != 0)
00546			{
00547				bPause = False;
00548	
00549				TutorialSound(DM[16]);
00550				TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[16]);
00551				SoundIndex++;
00552	
00553				// Give player an enforcer.
00554				newWeapon = Spawn(class'Enforcer');
00555				if( newWeapon != None )
00556				{
00557					newWeapon.BecomeItem();
00558					newWeapon.bHeldItem = true;
00559					Trainee.AddInventory(newWeapon);
00560					newWeapon.Instigator = Trainee;
00561					newWeapon.GiveAmmo(Trainee);
00562					newWeapon.GoToState('DownWeapon');
00563					newWeapon.AmmoType.AmmoAmount = 199;
00564					newWeapon.AmmoType.MaxAmmo = 199;
00565				}
00566	
00567				GotoState('');
00568			}
00569		}
00570	}
00571	
00572	function DMTutEvent17()
00573	{
00574		bPause = True;
00575		GoToState('FreeRunning7');
00576	}
00577	
00578	state FreeRunning7
00579	{
00580		function Tick(float DeltaTime)
00581		{
00582			local Weapon newWeapon;
00583	
00584			Super.Tick(DeltaTime);
00585	
00586			// Test for switch to enforcer.
00587			if ((Trainee.Weapon != None) && (Trainee.Weapon.IsA('Enforcer')))
00588			{
00589				bPause = False;
00590	
00591				TutorialSound(DM[17]);
00592				TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[17]);
00593				SoundIndex++;
00594	
00595				// Give player an impact hammer.
00596				newWeapon = Spawn(class'ImpactHammer');
00597				if( newWeapon != None )
00598				{
00599					newWeapon.BecomeItem();
00600					newWeapon.bHeldItem = true;
00601					Trainee.AddInventory(newWeapon);
00602					newWeapon.Instigator = Trainee;
00603					newWeapon.GiveAmmo(Trainee);
00604					newWeapon.GoToState('DownWeapon');
00605				}
00606	
00607				GotoState('');
00608			}
00609		}
00610	}
00611	
00612	function DMTutEvent18()
00613	{
00614		bPause = True;
00615		GoToState('FreeRunning8');
00616	}
00617	
00618	state FreeRunning8
00619	{
00620		function Tick(float DeltaTime)
00621		{
00622			Super.Tick(DeltaTime);
00623	
00624			// Test for switch to impact hammer.
00625			if ((Trainee.Weapon != None) && (Trainee.Weapon.IsA('ImpactHammer')))
00626			{
00627				bPause = False;
00628	
00629				TutorialSound(DM[18]);
00630				TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[18]);
00631				SoundIndex++;
00632	
00633				GotoState('');
00634			}
00635		}
00636	}
00637	
00638	function DMTutEvent19()
00639	{
00640		bPause = True;
00641		GoToState('FreeRunning9');
00642	}
00643	
00644	state FreeRunning9
00645	{
00646		function Tick(float DeltaTime)
00647		{
00648			Super.Tick(DeltaTime);
00649	
00650			// Test for weapon fire and move on.
00651			if (Trainee.bFire != 0)
00652			{
00653				bPause = False;
00654	
00655				TutorialSound(DM[19]);
00656				TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[19]);
00657				SoundIndex++;
00658	
00659				GotoState('');
00660			}
00661		}
00662	}
00663	
00664	function DMTutEvent20()
00665	{
00666		local Barrel B;
00667		local string NaliClassString;
00668		local Nali MyNali;
00669	
00670		bNoMonsters = False;
00671		// Spawn a Nali
00672		foreach AllActors(class'Barrel', B)
00673		{
00674			MyNali = Spawn(class'Nali',,,B.Location + vect(0,0,100));
00675			MyNali.Health = 1;
00676			break;
00677		}
00678		bPause = True;
00679		GoToState('ChunkTheNali');
00680	}
00681	
00682	state ChunkTheNali
00683	{
00684		function Tick(float DeltaTime)
00685		{
00686			local Nali N;
00687			local int NaliCount;
00688	
00689			Super.Tick(DeltaTime);
00690	
00691			// Test for chunked Nali and move on.
00692			foreach AllActors(class'Nali', N)
00693			{
00694				NaliCount++;
00695			}
00696			if (NaliCount == 0)
00697			{
00698				Trainee.PlayerReplicationInfo.Score = 0;
00699				bPause = False;
00700	
00701				TutorialSound(DM[20]);
00702				TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[20]);
00703				SoundIndex++;
00704	
00705				GotoState('');
00706			}
00707		}
00708	}
00709	
00710	function DMTutEvent21()
00711	{
00712		local Barrel B;
00713	
00714		foreach AllActors(class'Barrel', B)
00715		{
00716			Spawn(class'EnhancedRespawn', B, , B.Location, B.Rotation);
00717			B.bHidden = False;
00718			B.SetCollision(True, True, True);
00719		}
00720	
00721		TutorialSound(DM[21]);
00722		TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[21]);
00723		SoundIndex++;
00724	}
00725	
00726	function DMTutEvent22()
00727	{
00728	
00729		bPause = True;
00730		GoToState('FreeRunning10');
00731	}
00732	
00733	state FreeRunning10
00734	{
00735		function Tick(float DeltaTime)
00736		{
00737			local int i;
00738			local Barrel B;
00739	
00740			Super.Tick(DeltaTime);
00741	
00742			// Test for barrel destroy and move on.
00743			foreach AllActors(class'Barrel', B)
00744				i++;
00745			if (i==0)
00746			{
00747				bPause = False;
00748	
00749				TutorialSound(DM[22]);
00750				TournamentConsole(Trainee.Player.Console).AddMessage(TutMessage[22]);
00751				SoundIndex++;
00752	
00753				GotoState('');
00754			}
00755		}
00756	}
00757	
00758	function DMTutEvent23()
00759	{
00760		TournamentConsole(Trainee.Player.Console).HideMessage();
00761	
00762		FragLimit = 3;
00763	
00764		bReadyToSpawn = True;
00765		bRatedGame = True;
00766	
00767		RemainingBots = 1;
00768	}
00769	
00770	function bool SuccessfulGame()
00771	{
00772		local Pawn P;
00773	
00774		for ( P=Level.PawnList; P!=None; P=P.NextPawn )
00775			if ( P.bIsPlayer && (P != RatedPlayer) )
00776				if ( P.PlayerReplicationInfo.Score >= RatedPlayer.PlayerReplicationInfo.Score )
00777					return false;
00778	
00779		return true;
00780	}
00781	
00782	function EndGame( string Reason )
00783	{
00784		Super.EndGame(Reason);
00785	
00786		if (SuccessfulGame())
00787			TutorialSound(DM[23]);
00788		else
00789			Trainee.ClientPlaySound(sound'Announcer.LostMatch', True);
00790	
00791		if (RatedGameLadderObj != None)
00792		{
00793			RatedGameLadderObj.PendingChange = 0;
00794			RatedGameLadderObj.LastMatchType = LadderTypeIndex;
00795			if (RatedGameLadderObj.DMPosition < 1)
00796			{
00797				RatedGameLadderObj.PendingChange = LadderTypeIndex;
00798				RatedGameLadderObj.PendingRank = 1;
00799				RatedGameLadderObj.PendingPosition = 1;
00800			}
00801		}
00802		GoToState('ServerTravel');
00803	}
00804	
00805	state ServerTravel
00806	{
00807		function Timer()
00808		{
00809			local string StartMap;
00810	
00811			StartMap = "UT-Logo-Map.unr"
00812				$"?Game=Botpack.LadderTransition";
00813	
00814			Trainee.ClientTravel(StartMap, TRAVEL_Absolute, True);
00815		}
00816	
00817		function BeginState()
00818		{
00819			SetTimer(9.0, true);
00820		}
00821	}
00822	
00823	defaultproperties
00824	{
00825	     DM(0)="TutVoicedm.dm00"
00826	     DM(1)="TutVoicedm.dm01"
00827	     DM(2)="TutVoicedm.dm02"
00828	     DM(3)="TutVoicedm.dm03"
00829	     DM(4)="TutVoicedm.dm04"
00830	     DM(5)="TutVoicedm.dm05"
00831	     DM(6)="TutVoicedm.dm06"
00832	     DM(7)="TutVoicedm.dm07"
00833	     DM(8)="TutVoicedm.dm08"
00834	     DM(9)="TutVoicedm.dm09"
00835	     DM(10)="TutVoicedm.dm10"
00836	     DM(11)="TutVoicedm.dm11"
00837	     DM(12)="TutVoicedm.dm12"
00838	     DM(13)="TutVoicedm.dm13"
00839	     DM(14)="TutVoicedm.dm14"
00840	     DM(15)="TutVoicedm.dm15"
00841	     DM(16)="TutVoicedm.dm16"
00842	     DM(17)="TutVoicedm.dm17"
00843	     DM(18)="TutVoicedm.dm18"
00844	     DM(19)="TutVoicedm.dm19"
00845	     DM(20)="TutVoicedm.dm20"
00846	     DM(21)="TutVoicedm.dm21"
00847	     DM(22)="TutVoicedm.dm22"
00848	     DM(23)="TutVoicedm.dm23"
00849	     TutMessage(0)="Welcome to Deathmatch combat training. Deathmatch is a sport in which you compete against other gun-wielding players in a fast paced free-for-all. The object is to destroy all of your enemies by any means necessary."
00850	     TutMessage(1)="Every time you take an enemy out you get a point, called a 'frag' in gaming lingo. You can see your frag count on the left side of the screen. At the end of the game the player with the most frags wins the match."
00851	     TutMessage(2)="Remember, if you accidentally blow yourself up or fall into lava you will lose a frag!"
00852	     TutMessage(3)="Let's learn some basics about moving around. A good deathmatch player is always moving, because a moving target is harder to hit than a stationary one."
00853	     TutMessage(4)="The forward key moves you forward while the backward key makes you backpedal. The left key causes you to strafe left, while the right key, you guessed it, strafes right."
00854	     TutMessage(5)="Strafing is extremely important in deathmatch because it allows you to move from side to side without turning and losing sight or aim of your foe. Let's try strafing left and right now."
00855	     TutMessage(6)="Another important element of moving around is jumping. Jumping allows you to reach areas of the map that are too high to walk to normally and to cross dangerous pits. Try pressing the jump button and jump around the map."
00856	     TutMessage(7)="Excellent."
00857	     TutMessage(8)="Now we're going to learn about Mouselooking. Move your mouse around and notice how your view shifts. This is how you look around and turn, known as Mouselook."
00858	     TutMessage(9)="Try turning around several times by moving the mouse left to right to see the lovely battle arena."
00859	     TutMessage(10)="Excellent. You can also look vertically to see what's occuring above and below you. In deathmatch your enemies will be attacking from above and below, so remember to always keep your eyes peeled."
00860	     TutMessage(11)="If you feel like you are looking around too quickly you can easily adjust the sensitivity of the mouse in the OPTIONS menu."
00861	     TutMessage(12)="Let's learn about offense. Remember, the only way to win at deathmatch is to destroy your foes with weaponry that you collect."
00862	     TutMessage(13)="I'm going to open the weapons locker and allow access to some guns, let's pick them up and get ready for some target practice."
00863	     TutMessage(14)="Great, now we're armed. The gun you're carrying is commonly called the 'Shock Rifle'. It, like all the weapons in the Tournament, has two firing modes. Let's try shooting the gun now. Press the fire button to emit a lethal electric beam."
00864	     TutMessage(15)="Very good. The Shock Rifle's primary fire will instantly hit the person you shoot at. In Unreal Tournament, every weapon also has an alternate firing mode. Press the alt fire button to shoot a ball of plasma at your enemy."
00865	     TutMessage(16)="Great! The alt fire on the Shock Rifle is slower moving than the primary fire, but does more damage. Its up to you to decide which attack is right for the situation. Sometimes you might be carrying more than one weapon. I've just put an 'Enforcer' sidearm in your pack. Each weapon has an associated number, as you can see at the bottom of your screen. The Enforcer is weapon number 2. Press 2 and switch to the enforcer. You can switch back to the Shock Rifle by pressing its number."
00866	     TutMessage(17)="Good, now you know how to switch weapons in battle. Every weapon in Unreal Tournament is a projectile weapon except one, the 'Impact Hammer'. Press 1 now to switch to the Impact Hammer."
00867	     TutMessage(18)="The Impact Hammer is a melee, or close combat, weapon. It requires you to be standing very close to the target to do damage. The tradeoff is that a hit will almost always kill your enemy. Press and hold the primary fire button now to charge up the impact hammer."
00868	     TutMessage(19)="Now, run up to the Nali I just spawned. When you get close enough, the Impact Hammer will release blowing him into pieces."
00869	     TutMessage(20)="Look at those gibs fly!  Great job."
00870	     TutMessage(21)="Good job. Now we're going to take out some stationary targets. Shoot all three barrels to proceed."
00871	     TutMessage(22)="Nice shootin' Tex. It's about to get harder. I'm going to release a training human opponent for you to practice on. You'll have to frag him three times to complete the tutorial. Good luck!"
00872	     TutMessage(23)="Congratulations! You have proven yourself to be a worthy Deathmatch player. Now its time to enter the Deathmatch Tournament Ladder."
00873	     TutMessage4Parts(0)="The forward key"
00874	     TutMessage4Parts(1)="moves you forward while the backward key"
00875	     TutMessage4Parts(2)="makes you backpedal. The left key"
00876	     TutMessage4Parts(3)="causes you to strafe left, while the right key"
00877	     TutMessage4Parts(4)=", you guessed it, strafes right."
00878	     TutMessage6Parts(0)="Another important element of moving around is jumping. Jumping allows you to reach areas of the map that are too high to walk to normally and to cross dangerous pits. Try pressing the jump button"
00879	     TutMessage6Parts(1)="and jump around the map."
00880	     TutMessage14Parts(0)="Great, now we're armed. The gun you're carrying is commonly called the 'Shock Rifle'. It, like all the weapons in the Tournament, has two firing modes. Let's try shooting the gun now. Press the fire button"
00881	     TutMessage14Parts(1)="to emit a lethal electric beam."
00882	     TutMessage15Parts(0)="Very good. The Shock Rifle's primary fire will instantly hit the person you shoot at. In Unreal Tournament, every weapon also has an alternate firing mode. Press the alt fire button"
00883	     TutMessage15Parts(1)="to shoot a ball of plasma at your enemy."
00884	     LastEvent=24
00885	     SingleWaitingMessage=""
00886	     bTutorialGame=True
00887	     Difficulty=0
00888	     MapPrefix="DM-Tutorial"
00889	     BeaconName="DM-Tutorial"
00890	     GameName="Combat Training: DM"
00891	     bLoggingGame=False
00892	}

End Source Code