Botpack
Class MaleBotPlus

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

class MaleBotPlus
extends Botpack.HumanBotPlus

//============================================================================= // MaleBotPlus. //=============================================================================

Function Summary
 void PlayDecap()
 void PlayDying(name DamageType, vector HitLoc)
 void PlayGutHit(float tweentime)
 void PlayHeadHit(float tweentime)
 void PlayLeftHit(float tweentime)
 void PlayRightHit(float tweentime)
 void PlayVictoryDance()



Source Code


00001	//=============================================================================
00002	// MaleBotPlus.
00003	//=============================================================================
00004	class MaleBotPlus extends HumanBotPlus
00005		abstract;
00006	
00007	function PlayVictoryDance()
00008	{
00009		local float decision;
00010	
00011		decision = FRand();
00012	
00013		if ( decision < 0.4 )
00014			PlayAnim('Victory1',0.7, 0.2);
00015		else if ( decision < 0.7 )
00016			PlayAnim('Thrust',0.7, 0.2);
00017		else
00018			PlayAnim('Taunt1',0.7, 0.2);
00019	}
00020	
00021	function PlayDying(name DamageType, vector HitLoc)
00022	{
00023		BaseEyeHeight = Default.BaseEyeHeight;
00024		PlayDyingSound();
00025				
00026		if ( DamageType == 'Suicided' )
00027		{
00028			PlayAnim('Dead8',, 0.1);
00029			return;
00030		}
00031	
00032		// check for head hit
00033		if ( (DamageType == 'Decapitated') && !Level.Game.bVeryLowGore )
00034		{
00035			PlayDecap();
00036			return;
00037		}
00038	
00039		if ( FRand() < 0.15 )
00040		{
00041			PlayAnim('Dead2',,0.1);
00042			return;
00043		}
00044	
00045		// check for big hit
00046		if ( (Velocity.Z > 250) && (FRand() < 0.75) )
00047		{
00048			if ( FRand() < 0.5 )
00049				PlayAnim('Dead1',,0.1);
00050			else
00051				PlayAnim('Dead11',, 0.1);
00052			return;
00053		}
00054	
00055		// check for repeater death
00056		if ( (Health > -10) && ((DamageType == 'shot') || (DamageType == 'zapped')) )
00057		{
00058			PlayAnim('Dead9',, 0.1);
00059			return;
00060		}
00061			
00062		if ( (HitLoc.Z - Location.Z > 0.7 * CollisionHeight) && !Level.Game.bVeryLowGore )
00063		{
00064			if ( FRand() < 0.5 )
00065				PlayDecap();
00066			else
00067				PlayAnim('Dead7',, 0.1);
00068			return;
00069		}
00070		
00071		if ( Region.Zone.bWaterZone || (FRand() < 0.5) ) //then hit in front or back
00072			PlayAnim('Dead3',, 0.1);
00073		else
00074			PlayAnim('Dead8',, 0.1);
00075	}
00076	
00077	function PlayDecap()
00078	{
00079		local carcass carc;
00080	
00081		PlayAnim('Dead4',, 0.1);
00082		if ( Level.NetMode != NM_Client )
00083		{
00084			carc = Spawn(class 'UT_HeadMale',,, Location + CollisionHeight * vect(0,0,0.8), Rotation + rot(3000,0,16384) );
00085			if (carc != None)
00086			{
00087				carc.Initfor(self);
00088				carc.Velocity = Velocity + VSize(Velocity) * VRand();
00089				carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
00090			}
00091		}
00092	}
00093	
00094	function PlayGutHit(float tweentime)
00095	{
00096		if ( (AnimSequence == 'GutHit') || (AnimSequence == 'Dead2') )
00097		{
00098			if (FRand() < 0.5)
00099				TweenAnim('LeftHit', tweentime);
00100			else
00101				TweenAnim('RightHit', tweentime);
00102		}
00103		else if ( FRand() < 0.6 )
00104			TweenAnim('GutHit', tweentime);
00105		else
00106			TweenAnim('Dead8', tweentime);
00107	
00108	}
00109	
00110	function PlayHeadHit(float tweentime)
00111	{
00112		if ( (AnimSequence == 'HeadHit') || (AnimSequence == 'Dead7') )
00113			TweenAnim('GutHit', tweentime);
00114		else if ( FRand() < 0.6 )
00115			TweenAnim('HeadHit', tweentime);
00116		else
00117			TweenAnim('Dead7', tweentime);
00118	}
00119	
00120	function PlayLeftHit(float tweentime)
00121	{
00122		if ( (AnimSequence == 'LeftHit') || (AnimSequence == 'Dead9') )
00123			TweenAnim('GutHit', tweentime);
00124		else if ( FRand() < 0.6 )
00125			TweenAnim('LeftHit', tweentime);
00126		else 
00127			TweenAnim('Dead9', tweentime);
00128	}
00129	
00130	function PlayRightHit(float tweentime)
00131	{
00132		if ( (AnimSequence == 'RightHit') || (AnimSequence == 'Dead1') )
00133			TweenAnim('GutHit', tweentime);
00134		else if ( FRand() < 0.6 )
00135			TweenAnim('RightHit', tweentime);
00136		else
00137			TweenAnim('Dead1', tweentime);
00138	}
00139	
00140	defaultproperties
00141	{
00142	     CarcassType=Class'Botpack.TMale1Carcass'
00143	     drown=Sound'Botpack.MaleSounds.(All).drownM02'
00144	     breathagain=Sound'Botpack.MaleSounds.(All).gasp02'
00145	     HitSound3=Sound'Botpack.MaleSounds.(All).injurM04'
00146	     HitSound4=Sound'Botpack.MaleSounds.(All).injurH5'
00147	     Deaths(0)=Sound'Botpack.MaleSounds.(All).deathc1'
00148	     Deaths(1)=Sound'Botpack.MaleSounds.(All).deathc51'
00149	     Deaths(2)=Sound'Botpack.MaleSounds.(All).deathc3'
00150	     Deaths(3)=Sound'Botpack.MaleSounds.(All).deathc4'
00151	     Deaths(4)=Sound'Botpack.MaleSounds.(All).deathc53'
00152	     Deaths(5)=Sound'Botpack.MaleSounds.(All).deathc53'
00153	     GaspSound=Sound'Botpack.MaleSounds.(All).hgasp1'
00154	     UWHit1=Sound'Botpack.MaleSounds.(All).UWinjur41'
00155	     UWHit2=Sound'Botpack.MaleSounds.(All).UWinjur42'
00156	     LandGrunt=Sound'Botpack.MaleSounds.(All).land01'
00157	     JumpSound=Sound'Botpack.MaleSounds.(All).jump1'
00158	     VoicePackMetaClass="BotPack.VoiceMale"
00159	     HitSound1=Sound'Botpack.MaleSounds.(All).injurL2'
00160	     HitSound2=Sound'Botpack.MaleSounds.(All).injurL04'
00161	     Die=Sound'Botpack.MaleSounds.(All).deathc1'
00162	}

End Source Code