Botpack
Class RatedMatchInfo

source: e:\games\UnrealTournament\Botpack\Classes\RatedMatchInfo.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--Botpack.RatedMatchInfo
Direct Known Subclasses:RatedMatchAS1, RatedMatchAS2, RatedMatchAS3, RatedMatchAS4, RatedMatchAS5, RatedMatchAS6, RatedMatchASTUT, RatedMatchChal1, RatedMatchChal2, RatedMatchChal3, RatedMatchChal4, RatedMatchCTF1, RatedMatchCTF10, RatedMatchCTF11, RatedMatchCTF2, RatedMatchCTF3, RatedMatchCTF4, RatedMatchCTF5, RatedMatchCTF6, RatedMatchCTF7, RatedMatchCTF8, RatedMatchCTF9, RatedMatchCTFDemo1, RatedMatchCTFTUT, RatedMatchDM1, RatedMatchDM10, RatedMatchDM11, RatedMatchDM12, RatedMatchDM13, RatedMatchDM2, RatedMatchDM3, RatedMatchDM4, RatedMatchDM5, RatedMatchDM6, RatedMatchDM7, RatedMatchDM7G, RatedMatchDM8, RatedMatchDM9, RatedMatchDM9G, RatedMatchDMDemo1, RatedMatchDMDemo2, RatedMatchDMDemo3, RatedMatchDMDemo4, RatedMatchDMTUT, RatedMatchDOM1, RatedMatchDOM10, RatedMatchDOM2, RatedMatchDOM3, RatedMatchDOM4, RatedMatchDOM5, RatedMatchDOM6, RatedMatchDOM7, RatedMatchDOM8, RatedMatchDOM9, RatedMatchDOMDemo1, RatedMatchDOMTUT

class RatedMatchInfo
extends Engine.Info

//============================================================================= // RatedMatchInfo. // used in single player game - cannot modify // player team (bots 0 to 7) are set up in default properties of this base class // enemy teams are set up in default properties of sub-classes //=============================================================================
Variables
 string Bio[8]
           how much to modify base difficulty for this match (0 to 5)
 float BotAccuracy[8]
           how much to modify base difficulty for this match (0 to 5)
 string BotClasses[8]
           how much to modify base difficulty for this match (0 to 5)
 string BotClassifications[8]
           how much to modify base difficulty for this match (0 to 5)
 string BotFaces[8]
           how much to modify base difficulty for this match (0 to 5)
 byte BotJumpy[8]
           how much to modify base difficulty for this match (0 to 5)
 string BotNames[8]
           how much to modify base difficulty for this match (0 to 5)
 float BotSkills[8]
           how much to modify base difficulty for this match (0 to 5)
 string BotSkins[8]
           how much to modify base difficulty for this match (0 to 5)
 int BotTeams[8]
           how much to modify base difficulty for this match (0 to 5)
 float Camping[8]
           how much to modify base difficulty for this match (0 to 5)
 float CombatStyle[8]
           how much to modify base difficulty for this match (0 to 5)
 int CurrentAlly
           how much to modify base difficulty for this match (0 to 5)
 int CurrentNum
           how much to modify base difficulty for this match (0 to 5)
 class EnemyTeam
           how much to modify base difficulty for this match (0 to 5)
 string FavoriteWeapon[8]
           how much to modify base difficulty for this match (0 to 5)
 float ModifiedDifficulty
           how much to modify base difficulty for this match (0 to 5)
 int NumAllies
           number of allied bots
 int NumBots
           total number of bots
 float StrafingAbility[8]
           how much to modify base difficulty for this match (0 to 5)


Function Summary
 int ChooseBotInfo(optional bool, optional bool)
 string GetBotClassName(int n, optional bool, optional bool, optional PlayerPawn)
 string GetBotClassification(int n, optional bool, optional bool, optional PlayerPawn)
 string GetBotDesc(int n, optional bool, optional bool, optional PlayerPawn)
 string GetBotFace(int n, optional bool, optional bool, optional PlayerPawn)
 string GetBotName(int n, optional bool, optional bool, optional PlayerPawn)
 string GetBotSkin(int n, optional bool, optional bool, optional PlayerPawn)
 int GetBotTeam(int n, optional bool, optional bool, optional PlayerPawn)
 string GetTeamBio(optional bool, optional PlayerPawn)
 string GetTeamName(optional bool, optional PlayerPawn)
 Texture GetTeamSymbol(optional bool, optional PlayerPawn)
 void Individualize(Bot NewBot, int n, int NumBots, optional bool, optional bool)



Source Code


00001	//=============================================================================
00002	// RatedMatchInfo.
00003	// used in single player game - cannot modify
00004	// player team (bots 0 to 7) are set up in default properties of this base class
00005	// enemy teams are set up in default properties of sub-classes
00006	//=============================================================================
00007	class RatedMatchInfo extends Info;
00008	
00009	var() int						NumBots;			// total number of bots
00010	var() int						NumAllies;			// number of allied bots
00011	
00012	var() float						ModifiedDifficulty;	// how much to modify base difficulty for this match (0 to 5)
00013	
00014	var() class<RatedTeamInfo>		EnemyTeam;
00015	
00016	var() localized string			BotNames[8];
00017	var() localized string			BotClassifications[8];
00018	var() int						BotTeams[8];
00019	var() float						BotSkills[8];
00020	var() float						BotAccuracy[8];
00021	var() float						CombatStyle[8];
00022	var() float						Camping[8];
00023	var() string					FavoriteWeapon[8];
00024	var() string 					BotClasses[8];
00025	var() string 					BotSkins[8];
00026	var() string 					BotFaces[8];
00027	var() localized string			Bio[8];
00028	var() byte						BotJumpy[8];
00029	var() float						StrafingAbility[8];
00030	
00031	var int							CurrentNum;
00032	var int							CurrentAlly;
00033	
00034	function string GetTeamName(optional bool bEnemy, optional PlayerPawn RatedPlayer)
00035	{
00036		local LadderInventory LadderObj;
00037	
00038		if (bEnemy)
00039		{
00040			LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00041	
00042			if (EnemyTeam == LadderObj.Team)
00043				return class'RatedTeamInfoS'.Default.TeamName;
00044			else
00045				return EnemyTeam.Default.TeamName;
00046		} else {
00047			LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00048			return LadderObj.Team.Default.TeamName;
00049		}
00050	}
00051	
00052	function string GetTeamBio(optional bool bEnemy, optional PlayerPawn RatedPlayer)
00053	{
00054		local LadderInventory LadderObj;
00055	
00056		if (bEnemy)
00057		{
00058			LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00059	
00060			if (EnemyTeam == LadderObj.Team)
00061				return class'RatedTeamInfoS'.Default.TeamBio;
00062			else
00063				return EnemyTeam.Default.TeamBio;
00064		} else {
00065			LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00066			return LadderObj.Team.Default.TeamBio;
00067		}
00068	}
00069	
00070	function texture GetTeamSymbol(optional bool bEnemy, optional PlayerPawn RatedPlayer)
00071	{
00072		local LadderInventory LadderObj;
00073	
00074		if (bEnemy)
00075		{
00076			LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00077	
00078			if (EnemyTeam == LadderObj.Team)
00079				return class'RatedTeamInfoS'.Default.TeamSymbol;
00080			else
00081				return EnemyTeam.Default.TeamSymbol;
00082		} else {
00083			LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00084			return LadderObj.Team.Default.TeamSymbol;
00085		}
00086	}
00087	
00088	function string GetBotName(int n, optional bool bTeamGame, optional bool bEnemy, optional PlayerPawn RatedPlayer)
00089	{
00090		local LadderInventory LadderObj;
00091	
00092		if (!bTeamGame)
00093			return Default.BotNames[n];
00094		else {
00095			if (bEnemy)
00096			{
00097				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00098	
00099				if (EnemyTeam == LadderObj.Team)
00100					return class'RatedTeamInfoS'.Default.BotNames[n];
00101				else
00102					return EnemyTeam.Default.BotNames[n];
00103			} else {
00104				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00105				return LadderObj.Team.Default.BotNames[n];
00106			}
00107		}
00108	}
00109	
00110	function string GetBotDesc(int n, optional bool bTeamGame, optional bool bEnemy, optional PlayerPawn RatedPlayer)
00111	{
00112		local LadderInventory LadderObj;
00113	
00114		if (!bTeamGame)
00115			return Default.Bio[n];
00116		else {
00117			if (bEnemy)
00118			{
00119				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00120	
00121				if (EnemyTeam == LadderObj.Team)
00122					return class'RatedTeamInfoS'.Default.BotBio[n];
00123				else
00124					return EnemyTeam.Default.BotBio[n];
00125			} else {
00126				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00127				return LadderObj.Team.Default.BotBio[n];
00128			}
00129		}
00130	}
00131	
00132	function string GetBotClassification(int n, optional bool bTeamGame, optional bool bEnemy, optional PlayerPawn RatedPlayer)
00133	{
00134		local LadderInventory LadderObj;
00135	
00136		if (!bTeamGame)
00137			return Default.BotClassifications[n];
00138		else {
00139			if (bEnemy)
00140			{
00141				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00142	
00143				if (EnemyTeam == LadderObj.Team)
00144					return class'RatedTeamInfoS'.Default.BotClassifications[n];
00145				else
00146					return EnemyTeam.Default.BotClassifications[n];
00147			} else {
00148				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00149				return LadderObj.Team.Default.BotClassifications[n];
00150			}
00151		}
00152	}
00153	
00154	function int GetBotTeam(int n, optional bool bTeamGame, optional bool bEnemy, optional PlayerPawn RatedPlayer)
00155	{
00156		return Default.BotTeams[n];
00157	}
00158	
00159	function string GetBotSkin(int n, optional bool bTeamGame, optional bool bEnemy, optional PlayerPawn RatedPlayer)
00160	{
00161		local LadderInventory LadderObj;
00162	
00163		if (!bTeamGame)
00164			return Default.BotSkins[n];
00165		else {
00166			if (bEnemy)
00167			{
00168				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00169	
00170				if (EnemyTeam == LadderObj.Team)
00171					return class'RatedTeamInfoS'.Default.BotSkins[n];
00172				else
00173					return EnemyTeam.Default.BotSkins[n];
00174			} else {
00175				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00176				return LadderObj.Team.Default.BotSkins[n];
00177			}
00178		}
00179	}
00180	
00181	function string GetBotFace(int n, optional bool bTeamGame, optional bool bEnemy, optional PlayerPawn RatedPlayer)
00182	{
00183		local LadderInventory LadderObj;
00184	
00185		if (!bTeamGame)
00186			return Default.BotFaces[n];
00187		else {
00188			if (bEnemy)
00189			{
00190				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00191	
00192				if (EnemyTeam == LadderObj.Team)
00193					return class'RatedTeamInfoS'.Default.BotFaces[n];
00194				else
00195					return EnemyTeam.Default.BotFaces[n];
00196			} else {
00197				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00198				return LadderObj.Team.Default.BotFaces[n];			
00199			}
00200		}
00201	}
00202	
00203	function string GetBotClassName(int n, optional bool bTeamGame, optional bool bEnemy, optional PlayerPawn RatedPlayer)
00204	{
00205		local LadderInventory LadderObj;
00206	
00207		if (!bTeamGame)
00208			return Default.BotClasses[n];
00209		else {
00210			if (bEnemy)
00211			{
00212				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00213			
00214				if (EnemyTeam == LadderObj.Team)
00215					return class'RatedTeamInfoS'.Default.BotClasses[n];
00216				else
00217					return EnemyTeam.Default.BotClasses[n];
00218			} else {
00219				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00220				return LadderObj.Team.Default.BotClasses[n];
00221			}
00222		}
00223	}
00224	
00225	function class<bot> GetBotClass(int n, optional bool bTeamGame, optional bool bEnemy, optional PlayerPawn RatedPlayer)
00226	{
00227		local LadderInventory LadderObj;
00228	
00229		if (!bTeamGame)
00230			return class<bot>( DynamicLoadObject(BotClasses[n], class'Class') );
00231		else {
00232			if (bEnemy)
00233			{
00234				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00235	
00236				if (EnemyTeam == LadderObj.Team)
00237					return class<bot>( DynamicLoadObject(class'RatedTeamInfoS'.Default.BotClasses[n], class'Class') );
00238				else
00239					return class<bot>( DynamicLoadObject(EnemyTeam.Default.BotClasses[n], class'Class') );
00240			} else {
00241				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00242	
00243				return class<bot>( DynamicLoadObject(LadderObj.Team.Default.BotClasses[n], class'Class') );
00244			}
00245		}
00246	}
00247	
00248	function int ChooseBotInfo(optional bool bTeamGame, optional bool bEnemy)
00249	{
00250		if (!bTeamGame)
00251		{
00252			return CurrentNum++;
00253		} else {
00254			if (bEnemy)
00255				return CurrentNum++;
00256			else
00257				return CurrentAlly++;
00258		}
00259	}
00260	
00261	function Individualize(bot NewBot, int n, int NumBots, optional bool bTeamGame, optional bool bEnemy)
00262	{
00263		local LadderInventory LadderObj;
00264		local PlayerPawn RatedPlayer;
00265		local RatedTeamInfo RTI;
00266	
00267		if ( (n<0) || (n>7) )
00268		{
00269			log("Accessed RatedMatchInfo out of range!");
00270			return;
00271		}
00272	
00273		if (!bTeamGame)
00274		{
00275			NewBot.Static.SetMultiSkin(NewBot, BotSkins[n], BotFaces[n], BotTeams[n]);
00276	
00277			// Set bot's name.
00278			Level.Game.ChangeName( NewBot, BotNames[n], false );
00279			if ( BotNames[n] != NewBot.PlayerReplicationInfo.PlayerName )
00280				Level.Game.ChangeName( NewBot, "Bot", false);
00281	
00282			// Set Bot Team
00283			if ( BotTeams[n] == 0 )
00284				NewBot.PlayerReplicationInfo.Team = DeathMatchPlus(Level.Game).RatedPlayer.PlayerReplicationInfo.Team;
00285			else if ( DeathMatchPlus(Level.Game).RatedPlayer.PlayerReplicationInfo.Team == 0 )
00286				NewBot.PlayerReplicationInfo.Team = 1;
00287			else
00288				NewBot.PlayerReplicationInfo.Team = 1;
00289	
00290			// adjust bot skill
00291			RatedPlayer = DeathMatchPlus(Level.Game).RatedPlayer;
00292			LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00293			NewBot.InitializeSkill(LadderObj.TournamentDifficulty + ModifiedDifficulty + BotSkills[n]);
00294	
00295			if ( (FavoriteWeapon[n] != "") && (FavoriteWeapon[n] != "None") )
00296				NewBot.FavoriteWeapon = class<Weapon>(DynamicLoadObject(FavoriteWeapon[n],class'Class'));
00297			NewBot.CombatStyle = NewBot.Default.CombatStyle + 0.7 * CombatStyle[n];
00298			NewBot.BaseAggressiveness = 0.5 * (NewBot.Default.Aggressiveness + NewBot.CombatStyle);
00299			NewBot.CampingRate = Camping[n];
00300			NewBot.bJumpy = ( BotJumpy[n] != 0 );
00301			NewBot.PlayerReplicationInfo.VoiceType = class<VoicePack>(DynamicLoadObject(NewBot.VoiceType, class'Class'));
00302			NewBot.StrafingAbility = StrafingAbility[n];
00303		} 
00304		else 
00305		{
00306			if ( bEnemy )
00307			{
00308				RatedPlayer = DeathMatchPlus(Level.Game).RatedPlayer;
00309				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00310	
00311				if (EnemyTeam == LadderObj.Team)
00312					RTI = Spawn(class'RatedTeamInfoS');
00313				else
00314					RTI = Spawn(EnemyTeam);
00315				RTI.Individualize(NewBot, n, NumBots, bEnemy, LadderObj.TournamentDifficulty + ModifiedDifficulty);
00316			} 
00317			else 
00318			{
00319				RatedPlayer = DeathMatchPlus(Level.Game).RatedPlayer;
00320				LadderObj = LadderInventory(RatedPlayer.FindInventoryType(class'LadderInventory'));
00321				RTI = Spawn(LadderObj.Team);
00322				RTI.Individualize(NewBot, n, NumBots, bEnemy, LadderObj.TournamentDifficulty + ModifiedDifficulty);
00323			}
00324		}
00325	}
00326	
00327	defaultproperties
00328	{
00329	}

End Source Code