Botpack
Class TBossBot

source: e:\games\UnrealTournament\Botpack\Classes\TBossBot.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pawn
         |
         +--Botpack.Bot
            |
            +--Botpack.HumanBotPlus
               |
               +--Botpack.MaleBotPlus
                  |
                  +--Botpack.TBossBot
Direct Known Subclasses:None

class TBossBot
extends Botpack.MaleBotPlus

//============================================================================= // TBossBot. //=============================================================================
Variables
 RealSkill, RealAccuracy
 bool bRatedGame


Function Summary
 void ForceMeshToExist()
 void MaybeTaunt(Pawn Other)
 void ReSetSkill()
 void SetMultiSkin(Actor SkinActor, string SkinName, string FaceName, byte TeamNum)
 void StartMatch()



Source Code


00001	//=============================================================================
00002	// TBossBot.
00003	//=============================================================================
00004	class TBossBot extends MaleBotPlus;
00005	
00006	var float RealSkill, RealAccuracy;
00007	var bool bRatedGame;
00008	
00009	function ForceMeshToExist()
00010	{
00011		Spawn(class'TBoss');
00012	}
00013	
00014	function MaybeTaunt(Pawn Other)
00015	{
00016		if ( !bRatedGame )
00017			Super.MaybeTaunt(Other);
00018	}
00019	
00020	function ReSetSkill()
00021	{
00022		local float ScaledSkill;
00023		if ( bRatedGame )
00024		{
00025			if ( DeathMatchPlus(Level.Game).RatedPlayer.PlayerReplicationInfo.Score > PlayerReplicationInfo.Score + 1 )
00026			{
00027				Skill += 1;
00028				if ( Skill > 3 )
00029				{
00030					if ( bNovice )
00031					{
00032						bNovice = false;
00033						Skill = FClamp(Skill - 4, 0, 3);
00034					}
00035					else
00036					{
00037						Skill = 3;
00038						Accuracy += 0.3;
00039					}
00040				}
00041			}
00042			else if ( DeathMatchPlus(Level.Game).RatedPlayer.PlayerReplicationInfo.Score < PlayerReplicationInfo.Score )
00043			{
00044				ScaledSkill = Skill;
00045				if ( !bNovice )
00046					ScaledSkill += 4;
00047				if ( ScaledSkill > RealSkill )
00048				{
00049					Accuracy = RealAccuracy;
00050					ScaledSkill = FMax(RealSkill, ScaledSkill - 0.5);
00051					bNovice = ( ScaledSkill < 4 );
00052					if ( !bNovice )
00053						ScaledSkill -= 4;
00054					Skill = FClamp(ScaledSkill, 0, 3);
00055				}
00056			}
00057		}
00058	
00059		Super.ReSetSkill();
00060	}
00061	
00062	function StartMatch()
00063	{
00064		local int R;
00065	
00066		RealSkill = Skill;
00067		RealAccuracy = Accuracy;
00068		if ( !bNovice )
00069			RealSkill += 4;
00070		bRatedGame = ( Level.Game.IsA('DeathMatchPlus') && DeathMatchPlus(Level.Game).bRatedGame );
00071		if ( bRatedGame )
00072		{
00073			R = Rand(7) + 6;
00074			if ( R == 10 )
00075				R = 8;
00076			SendGlobalMessage(None, 'TAUNT', R, 5);
00077		}
00078	}
00079	
00080	static function SetMultiSkin(Actor SkinActor, string SkinName, string FaceName, byte TeamNum)
00081	{
00082		local string MeshName, SkinItem, SkinPackage;
00083	
00084		MeshName = SkinActor.GetItemName(string(SkinActor.Mesh));
00085	
00086		SkinItem = SkinActor.GetItemName(SkinName);
00087		SkinPackage = Left(SkinName, Len(SkinName) - Len(SkinItem));
00088	
00089		if(SkinPackage == "")
00090		{
00091			SkinPackage="BossSkins.";
00092			SkinName=SkinPackage$SkinName;
00093		}
00094	
00095		if( TeamNum != 255 )
00096		{
00097			if(!SetSkinElement(SkinActor, 0, SkinName$"1T_"$String(TeamNum), ""))
00098			{
00099				if(!SetSkinElement(SkinActor, 0, SkinName$"1", ""))
00100				{
00101					SetSkinElement(SkinActor, 0, "BossSkins.boss1T_"$String(TeamNum), "BossSkins.boss1");
00102					SkinName="BossSkins.boss";
00103				}
00104			}
00105			SetSkinElement(SkinActor, 1, SkinName$"2T_"$String(TeamNum), SkinName$"2");
00106			SetSkinElement(SkinActor, 2, SkinName$"3T_"$String(TeamNum), SkinName$"3");
00107			SetSkinElement(SkinActor, 3, SkinName$"4T_"$String(TeamNum), SkinName$"4");
00108		}
00109		else
00110		{
00111			if(!SetSkinElement(SkinActor, 0, SkinName$"1", "BossSkins.boss1"))
00112				SkinName="BossSkins.boss";
00113	
00114			SetSkinElement(SkinActor, 1, SkinName$"2", "");
00115			SetSkinElement(SkinActor, 2, SkinName$"3", "");
00116			SetSkinElement(SkinActor, 3, SkinName$"4", "");
00117		}
00118	
00119		if( Pawn(SkinActor) != None ) 
00120			Pawn(SkinActor).PlayerReplicationInfo.TalkTexture = Texture(DynamicLoadObject(SkinName$"5Xan", class'Texture'));
00121	}
00122	
00123	defaultproperties
00124	{
00125	     CarcassType=Class'Botpack.TBossCarcass'
00126	     HitSound3=Sound'Botpack.Boss.BInjur3'
00127	     HitSound4=Sound'Botpack.Boss.BInjur4'
00128	     Deaths(0)=Sound'Botpack.Boss.BDeath1'
00129	     Deaths(1)=Sound'Botpack.Boss.BDeath1'
00130	     Deaths(2)=Sound'Botpack.Boss.BDeath3'
00131	     Deaths(3)=Sound'Botpack.Boss.BDeath4'
00132	     Deaths(4)=Sound'Botpack.Boss.BDeath3'
00133	     Deaths(5)=Sound'Botpack.Boss.BDeath4'
00134	     LandGrunt=Sound'Botpack.Boss.Bland01'
00135	     JumpSound=Sound'Botpack.Boss.BJump1'
00136	     DefaultSkinName="BossSkins.Boss"
00137	     StatusDoll=Texture'Botpack.Icons.BossDoll'
00138	     StatusBelt=Texture'Botpack.Icons.BossBelt'
00139	     VoicePackMetaClass="BotPack.VoiceBoss"
00140	     SelectionMesh="Botpack.SelectionBoss"
00141	     HitSound1=Sound'Botpack.Boss.BInjur1'
00142	     HitSound2=Sound'Botpack.Boss.BInjur2'
00143	     Die=Sound'Botpack.Boss.BDeath1'
00144	     MenuName="Boss"
00145	     VoiceType="BotPack.VoiceBotBoss"
00146	     Mesh=LodMesh'Botpack.Boss'
00147	}

End Source Code