UnrealShare
Class MaleBot

source: e:\games\UnrealTournament\UnrealShare\Classes\MaleBot.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pawn
         |
         +--UnrealShare.Bots
            |
            +--UnrealShare.HumanBot
               |
               +--UnrealShare.MaleBot
Direct Known Subclasses:MaleOneBot, MaleTwoBot, MaleThreeBot

class MaleBot
extends UnrealShare.HumanBot

//============================================================================= // MaleBot. //=============================================================================

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



Source Code


00001	//=============================================================================
00002	// MaleBot.
00003	//=============================================================================
00004	class MaleBot extends HumanBot
00005		abstract;
00006	
00007	#exec AUDIO IMPORT FILE="Sounds\Male\deathc1.WAV" NAME="MDeath1" GROUP="Male"
00008	#exec AUDIO IMPORT FILE="Sounds\Male\deathc3.WAV" NAME="MDeath3" GROUP="Male"
00009	#exec AUDIO IMPORT FILE="Sounds\Male\deathc4.WAV" NAME="MDeath4" GROUP="Male"
00010	#exec AUDIO IMPORT FILE="Sounds\Male\injurL2.WAV" NAME="MInjur1" GROUP="Male"
00011	#exec AUDIO IMPORT FILE="Sounds\Male\injurL04.WAV" NAME="MInjur2" GROUP="Male"
00012	#exec AUDIO IMPORT FILE="Sounds\Male\injurM04.WAV" NAME="MInjur3" GROUP="Male"
00013	#exec AUDIO IMPORT FILE="Sounds\Male\injurH5.WAV" NAME="MInjur4" GROUP="Male"
00014	#exec AUDIO IMPORT FILE="Sounds\Male\drownM02.WAV" NAME="MDrown1" GROUP="Male"
00015	#exec AUDIO IMPORT FILE="Sounds\Male\gasp02.WAV" NAME="MGasp1" GROUP="Male"
00016	#exec AUDIO IMPORT FILE="Sounds\Male\hgasp1.WAV" NAME="MGasp2" GROUP="Male"
00017	#exec AUDIO IMPORT FILE="Sounds\Male\jump1.WAV" NAME="MJump1" GROUP="Male"
00018	#exec AUDIO IMPORT FILE="Sounds\Male\UWinjur41.WAV" NAME="MUWHit1" GROUP="Male"
00019	#exec AUDIO IMPORT FILE="Sounds\Male\UWinjur42.WAV" NAME="MUWHit2" GROUP="Male"
00020	#exec AUDIO IMPORT FILE="Sounds\Male\lland01.WAV" NAME="lland01" GROUP="Male"
00021	
00022	function PlayDying(name DamageType, vector HitLoc)
00023	{
00024		local vector X,Y,Z, HitVec, HitVec2D;
00025		local float dotp;
00026		local carcass carc;
00027	
00028		BaseEyeHeight = Default.BaseEyeHeight;
00029		PlayDyingSound();
00030				
00031		if ( FRand() < 0.15 )
00032		{
00033			PlayAnim('Dead2',0.7,0.1);
00034			return;
00035		}
00036	
00037		// check for big hit
00038		if ( (Velocity.Z > 250) && (FRand() < 0.7) )
00039		{
00040			if ( ((hitLoc.Z > Location.Z) && (FRand() < 0.65)) && !Level.Game.bVeryLowGore )
00041			{
00042				PlayAnim('Dead5',0.7,0.1);
00043				if ( Level.NetMode != NM_Client )
00044				{
00045					carc = Spawn(class 'MaleHead',,, Location + CollisionHeight * vect(0,0,0.8), Rotation + rot(3000,0,16384) );
00046					if (carc != None)
00047					{
00048						carc.Initfor(self);
00049						carc.Velocity = Velocity + VSize(Velocity) * VRand();
00050						carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
00051					}
00052					carc = Spawn(class 'CreatureChunks');
00053					if (carc != None)
00054					{
00055						carc.Mesh = mesh 'CowBody1';
00056						carc.Initfor(self);
00057						carc.Velocity = Velocity + VSize(Velocity) * VRand();
00058						carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
00059					}
00060					carc = Spawn(class 'Arm1',,, Location + CollisionHeight * vect(0,0,0.8), Rotation + rot(3000,0,16384) );
00061					if (carc != None)
00062					{
00063						carc.Initfor(self);
00064						carc.Velocity = Velocity + VSize(Velocity) * VRand();
00065						carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
00066					}
00067				}
00068			}
00069			else
00070				PlayAnim('Dead1', 0.7, 0.1);
00071			return;
00072		}
00073	
00074		// check for head hit
00075		if ( ((DamageType == 'Decapitated') || (HitLoc.Z - Location.Z > 0.6 * CollisionHeight))
00076			 && !Level.Game.bVeryLowGore )
00077		{
00078			DamageType = 'Decapitated';
00079			PlayAnim('Dead4', 0.7, 0.1);
00080			if ( Level.NetMode != NM_Client )
00081			{
00082				carc = Spawn(class 'MaleHead',,, Location + CollisionHeight * vect(0,0,0.8), Rotation + rot(3000,0,16384) );
00083				if (carc != None)
00084				{
00085					carc.Initfor(self);
00086					carc.Velocity = Velocity + VSize(Velocity) * VRand();
00087					carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
00088				}
00089			}
00090			return;
00091		}
00092	
00093		GetAxes(Rotation,X,Y,Z);
00094		X.Z = 0;
00095		HitVec = Normal(HitLoc - Location);
00096		HitVec2D= HitVec;
00097		HitVec2D.Z = 0;
00098		dotp = HitVec2D dot X;
00099		
00100		if (Abs(dotp) > 0.71) //then hit in front or back
00101			PlayAnim('Dead3', 0.7, 0.1);
00102		else
00103		{
00104			dotp = HitVec dot Y;
00105			if (dotp > 0.0)
00106				PlayAnim('Dead6', 0.7, 0.1);
00107			else
00108				PlayAnim('Dead7', 0.7, 0.1);
00109		}
00110	}
00111	
00112	function PlayGutHit(float tweentime)
00113	{
00114		if ( (AnimSequence == 'GutHit') || (AnimSequence == 'Dead2') )
00115		{
00116			if (FRand() < 0.5)
00117				TweenAnim('LeftHit', tweentime);
00118			else
00119				TweenAnim('RightHit', tweentime);
00120		}
00121		else if ( FRand() < 0.6 )
00122			TweenAnim('GutHit', tweentime);
00123		else
00124			TweenAnim('Dead2', tweentime);
00125	
00126	}
00127	
00128	function PlayHeadHit(float tweentime)
00129	{
00130		if ( (AnimSequence == 'HeadHit') || (AnimSequence == 'Dead3') )
00131			TweenAnim('GutHit', tweentime);
00132		else if ( FRand() < 0.6 )
00133			TweenAnim('HeadHit', tweentime);
00134		else
00135			TweenAnim('Dead3', tweentime);
00136	}
00137	
00138	function PlayLeftHit(float tweentime)
00139	{
00140		if ( (AnimSequence == 'LeftHit') || (AnimSequence == 'Dead6') )
00141			TweenAnim('GutHit', tweentime);
00142		else if ( FRand() < 0.6 )
00143			TweenAnim('LeftHit', tweentime);
00144		else 
00145			TweenAnim('Dead6', tweentime);
00146	}
00147	
00148	function PlayRightHit(float tweentime)
00149	{
00150		if ( (AnimSequence == 'RightHit') || (AnimSequence == 'Dead1') )
00151			TweenAnim('GutHit', tweentime);
00152		else if ( FRand() < 0.6 )
00153			TweenAnim('RightHit', tweentime);
00154		else
00155			TweenAnim('Dead1', tweentime);
00156	}
00157	
00158	defaultproperties
00159	{
00160	     CarcassType=Class'UnrealShare.MaleBody'
00161	     drown=Sound'UnrealShare.Male.MDrown1'
00162	     breathagain=Sound'UnrealShare.Male.MGasp1'
00163	     HitSound3=Sound'UnrealShare.Male.MInjur3'
00164	     HitSound4=Sound'UnrealShare.Male.MInjur4'
00165	     Die2=Sound'UnrealShare.Male.MDeath3'
00166	     Die3=Sound'UnrealShare.Male.MDeath3'
00167	     Die4=Sound'UnrealShare.Male.MDeath4'
00168	     GaspSound=Sound'UnrealShare.Male.MGasp2'
00169	     UWHit1=Sound'UnrealShare.Male.MUWHit1'
00170	     UWHit2=Sound'UnrealShare.Male.MUWHit2'
00171	     LandGrunt=Sound'UnrealShare.Male.lland01'
00172	     JumpSound=Sound'UnrealShare.Male.MJump1'
00173	     HitSound1=Sound'UnrealShare.Male.MInjur1'
00174	     HitSound2=Sound'UnrealShare.Male.MInjur2'
00175	     Die=Sound'UnrealShare.Male.MDeath1'
00176	}

End Source Code