UnrealShare
Class Male

source: e:\games\UnrealTournament\UnrealShare\Classes\Male.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pawn
         |
         +--Engine.PlayerPawn
            |
            +--UnrealShare.UnrealIPlayer
               |
               +--UnrealShare.Human
                  |
                  +--UnrealShare.Male
Direct Known Subclasses:MaleOne, MaleTwo, MaleThree

class Male
extends UnrealShare.Human

//============================================================================= // Male. //=============================================================================

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	// Male.
00003	//=============================================================================
00004	class Male extends Human
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 ( DamageType == 'Suicided' )
00032		{
00033			PlayAnim('Dead7', 0.7, 0.1);
00034			return;
00035		}
00036	
00037		if ( FRand() < 0.15 )
00038		{
00039			PlayAnim('Dead2',0.7,0.1);
00040			return;
00041		}
00042	
00043		// check for big hit
00044		if ( (Velocity.Z > 250) && (FRand() < 0.7) && ((Level.Game == None) || !Level.Game.bVeryLowGore) )
00045		{
00046			if ( (hitLoc.Z > Location.Z) && (FRand() < 0.65) )
00047			{
00048				PlayAnim('Dead5',0.7,0.1);
00049				if ( Level.NetMode != NM_Client )
00050				{
00051					carc = Spawn(class 'MaleHead',,, Location + CollisionHeight * vect(0,0,0.8), Rotation + rot(3000,0,16384) );
00052					if (carc != None)
00053					{
00054						carc.Initfor(self);
00055						carc.Velocity = Velocity + VSize(Velocity) * VRand();
00056						carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
00057						ViewTarget = carc;
00058					}
00059					carc = Spawn(class 'CreatureChunks');
00060					if (carc != None)
00061					{
00062						carc.Mesh = mesh 'CowBody1';
00063						carc.Initfor(self);
00064						carc.Velocity = Velocity + VSize(Velocity) * VRand();
00065						carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
00066					}
00067					carc = Spawn(class 'Arm1',,, Location + CollisionHeight * vect(0,0,0.8), Rotation + rot(3000,0,16384) );
00068					if (carc != None)
00069					{
00070						carc.Initfor(self);
00071						carc.Velocity = Velocity + VSize(Velocity) * VRand();
00072						carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
00073					}
00074				}
00075			}
00076			else
00077				PlayAnim('Dead1', 0.7, 0.1);
00078			return;
00079		}
00080	
00081		// check for head hit
00082		if ( ((DamageType == 'Decapitated') || (HitLoc.Z - Location.Z > 0.6 * CollisionHeight))
00083			 && !Level.Game.bVeryLowGore )
00084		{
00085			DamageType = 'Decapitated';
00086			PlayAnim('Dead4', 0.7, 0.1);
00087			if ( Level.NetMode != NM_Client )
00088			{
00089				carc = Spawn(class 'MaleHead',,, Location + CollisionHeight * vect(0,0,0.8), Rotation + rot(3000,0,16384) );
00090				if (carc != None)
00091				{
00092					carc.Initfor(self);
00093					carc.Velocity = Velocity + VSize(Velocity) * VRand();
00094					carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
00095					ViewTarget = carc;
00096				}
00097			}
00098			return;
00099		}
00100	
00101		GetAxes(Rotation,X,Y,Z);
00102		X.Z = 0;
00103		HitVec = Normal(HitLoc - Location);
00104		HitVec2D= HitVec;
00105		HitVec2D.Z = 0;
00106		dotp = HitVec2D dot X;
00107		
00108		if (Abs(dotp) > 0.71) //then hit in front or back
00109			PlayAnim('Dead3', 0.7, 0.1);
00110		else
00111		{
00112			dotp = HitVec dot Y;
00113			if (dotp > 0.0)
00114				PlayAnim('Dead6', 0.7, 0.1);
00115			else
00116				PlayAnim('Dead7', 0.7, 0.1);
00117		}
00118	}
00119	
00120	function PlayGutHit(float tweentime)
00121	{
00122		if ( (AnimSequence == 'GutHit') || (AnimSequence == 'Dead2') )
00123		{
00124			if (FRand() < 0.5)
00125				TweenAnim('LeftHit', tweentime);
00126			else
00127				TweenAnim('RightHit', tweentime);
00128		}
00129		else if ( FRand() < 0.6 )
00130			TweenAnim('GutHit', tweentime);
00131		else
00132			TweenAnim('Dead2', tweentime);
00133	
00134	}
00135	
00136	function PlayHeadHit(float tweentime)
00137	{
00138		if ( (AnimSequence == 'HeadHit') || (AnimSequence == 'Dead3') )
00139			TweenAnim('GutHit', tweentime);
00140		else if ( FRand() < 0.6 )
00141			TweenAnim('HeadHit', tweentime);
00142		else
00143			TweenAnim('Dead3', tweentime);
00144	}
00145	
00146	function PlayLeftHit(float tweentime)
00147	{
00148		if ( (AnimSequence == 'LeftHit') || (AnimSequence == 'Dead6') )
00149			TweenAnim('GutHit', tweentime);
00150		else if ( FRand() < 0.6 )
00151			TweenAnim('LeftHit', tweentime);
00152		else 
00153			TweenAnim('Dead6', tweentime);
00154	}
00155	
00156	function PlayRightHit(float tweentime)
00157	{
00158		if ( (AnimSequence == 'RightHit') || (AnimSequence == 'Dead1') )
00159			TweenAnim('GutHit', tweentime);
00160		else if ( FRand() < 0.6 )
00161			TweenAnim('RightHit', tweentime);
00162		else
00163			TweenAnim('Dead1', tweentime);
00164	}
00165	
00166	defaultproperties
00167	{
00168	     drown=Sound'UnrealShare.Male.MDrown1'
00169	     breathagain=Sound'UnrealShare.Male.MGasp1'
00170	     HitSound3=Sound'UnrealShare.Male.MInjur3'
00171	     HitSound4=Sound'UnrealShare.Male.MInjur4'
00172	     Die2=Sound'UnrealShare.Male.MDeath3'
00173	     Die3=Sound'UnrealShare.Male.MDeath3'
00174	     Die4=Sound'UnrealShare.Male.MDeath4'
00175	     GaspSound=Sound'UnrealShare.Male.MGasp2'
00176	     UWHit1=Sound'UnrealShare.Male.MUWHit1'
00177	     UWHit2=Sound'UnrealShare.Male.MUWHit2'
00178	     LandGrunt=Sound'UnrealShare.Male.lland01'
00179	     CarcassType=Class'UnrealShare.MaleBody'
00180	     JumpSound=Sound'UnrealShare.Male.MJump1'
00181	     HitSound1=Sound'UnrealShare.Male.MInjur1'
00182	     HitSound2=Sound'UnrealShare.Male.MInjur2'
00183	     Die=Sound'UnrealShare.Male.MDeath1'
00184	}

End Source Code