Botpack
Class TournamentMale

source: e:\games\UnrealTournament\Botpack\Classes\TournamentMale.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pawn
         |
         +--Engine.PlayerPawn
            |
            +--Botpack.TournamentPlayer
               |
               +--Botpack.TournamentMale
Direct Known Subclasses:TBoss, TMale1, TMale2

class TournamentMale
extends Botpack.TournamentPlayer

//============================================================================= // TournamentMale. //=============================================================================

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)



Source Code


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

End Source Code