RuneI
Class SnowBeast

source: c:\runehov\RuneI\Classes\SnowBeast.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pawn
         |
         +--RuneI.ScriptPawn
            |
            +--RuneI.SnowBeast
Direct Known Subclasses:SnowBeastBoss, SnowBeastChained, SnowBeastTrial

class SnowBeast
extends RuneI.ScriptPawn

//============================================================================= // SnowBeast. //=============================================================================
Variables
 SnowbeastJaws Jaws
 float MaxBashThrust
 bool bAngry
 bool bBiting
 bool bLunging

States
Fighting

Function Summary
 void AfterSpawningInventory()
     
//================================================
//
// AfterSpawningInventory
//
// Used to spawn additional chained weapon
//================================================
 eAttitude AttitudeToCreature(Pawn Other)
     
//------------------------------------------------
//
// AttitudeToCreature
//
//------------------------------------------------
 bool BodyPartCritical(int BodyPart)
     
//============================================================
//
// BodyPartCritical
//
//============================================================
 int BodyPartForJoint(int joint)
     
//============================================================
//
// BodyPartForJoint
//
// Returns the body part a joint is associated with
//============================================================
 int BodyPartForPolyGroup(int polygroup)
     
//============================================================
//
// BodyPartForPolyGroup
//
//============================================================
 bool BodyPartSeverable(int BodyPart)
     
//============================================================
//
// BodyPartSeverable
//
//============================================================
 void Breath()
     
//============================================================
//
// Breath
//
//============================================================
 bool CanGotoPainState()
     
//------------------------------------------------
//
// CanGotoPainState
//
// Special functionality added to keep the beast from going into pain while threatening
//------------------------------------------------
 bool CanPickup(Inventory item)
     
//================================================
//
// CanPickup
//
// Let's pawn dictate what it can pick up
//================================================
 void Destroyed()
 bool InAttackRange(Actor Other)
     
//============================================================
//
// InAttackRange
//
// When within attack range, state changes from
// charging to fighting
//============================================================
 bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
     
//------------------------------------------------
//
// JointDamaged
//
//------------------------------------------------
 void MakeTwitchable()
     
//------------------------------------------------------------
//
// MakeTwitchable
//
// TODO: Move to carcass
//------------------------------------------------------------
 Texture PainSkin(int BodyPart)
     
//============================================================
//
// PainSkin
//
// returns the pain skin for a given polygroup
//============================================================
 void PlayBackDeath(name DamageType)
 void PlayBite()
 void PlayCower(optional float)
 void PlayDeath(name DamageType)
 void PlayDrownDeath(name DamageType)
 void PlayDrowning(optional float)
 void PlayFrontHit(float tween)
 void PlayHeadDeath(name DamageType)
 void PlayHuntStop(optional float)
 void PlayJumping(optional float)
 void PlayLeftDeath(name DamageType)
 void PlayLunge()
 void PlayMoving(optional float)
 void PlayRightDeath(name DamageType)
 void PlaySwingLeft()
 void PlaySwingRight()
 void PlayThreatening(optional float)
 void PlayTurning(optional float)
 void PlayWaiting(optional float)
     
//============================================================
// Animation functions
//============================================================
 void TweenToHuntStop(float time)
 void TweenToMoving(float time)
 void TweenToWaiting(float time)


State Fighting Function Summary
 void CreatureStatue()
 void HowlSound()
     
//================================================
//
// Statue
//
//================================================
 void Timer()
     
// Determine AttackAction based upon enemy movement and position
 void ComputeLunge()
 void PickDestinationBackup()
 void PickStrafeDestination()
 void HitWall(vector HitNormal, Actor Wall)
 void Bump(Actor Other)
 void HowlSound()
 void WeaponDeactivate()
 void WeaponActivate()
 void AmbientSoundTimer()
 void EndState()
 void BeginState()



Source Code


00001	//=============================================================================
00002	// SnowBeast.
00003	//=============================================================================
00004	class SnowBeast expands ScriptPawn;
00005	
00006	
00007	/*	DESCRIPTION:
00008		
00009			Types:
00010				Normal
00011				Chained
00012				TrialPit
00013	
00014		NEEDED:
00015			Base animations: Land, Falling,
00016			Pickup/Bearhug
00017			Sounds:
00018				Shorter Breathing sound
00019				Louder Howling sound
00020				Bite Sound
00021	
00022	*/
00023	
00024	
00025	var(Sounds) sound	HowlingSound;
00026	var bool bBiting;
00027	var SnowbeastJaws Jaws;
00028	var bool bAngry;
00029	var bool bLunging;
00030	var() float	MaxBashThrust;
00031	
00032	//===================================================================
00033	//					Functions
00034	//===================================================================
00035	
00036	//------------------------------------------------
00037	//
00038	// AttitudeToCreature
00039	//
00040	//------------------------------------------------
00041	function eAttitude AttitudeToCreature(Pawn Other)
00042	{
00043		if (Other.IsA('Viking') || Other.IsA('Goblin'))
00044			return ATTITUDE_Hate;
00045		else
00046			return Super.AttitudeToCreature(Other);
00047	}
00048	
00049	//================================================
00050	//
00051	// AfterSpawningInventory
00052	//
00053	// Used to spawn additional chained weapon
00054	//================================================
00055	function AfterSpawningInventory()
00056	{
00057		local Weapon W;
00058		W = Spawn(class'snowbeastpaw');
00059		W.SetOwner(self);
00060		AttachActorToJoint(W, 21);	// Attach to left wrist
00061		InvisibleWeapon(Weapon).ChainOnWeapon(W);
00062		W.GotoState('Active');
00063	
00064		// Spawn Jaws
00065		Jaws = Spawn(class'snowbeastjaws');
00066		Jaws.SetOwner(self);
00067		AttachActorToJoint(Jaws, 9);
00068		Jaws.GotoState('Active');
00069	}
00070	
00071	function Destroyed()
00072	{
00073		if (Jaws != None)
00074			Jaws.Destroy();
00075		Super.Destroyed();
00076	}
00077	
00078	//================================================
00079	//
00080	// CanPickup
00081	//
00082	// Let's pawn dictate what it can pick up
00083	//================================================
00084	function bool CanPickup(Inventory item)
00085	{
00086		return item.IsA('SnowbeastPaw') || item.IsA('SnowbeastJaws');
00087	}
00088	
00089	//============================================================
00090	//
00091	// Breath
00092	//
00093	//============================================================
00094	function Breath()
00095	{
00096		local int joint;
00097		local vector l;
00098		local Breath B;
00099	
00100		if (HeadRegion.Zone.bWaterZone)
00101		{
00102			// Spawn Bubbles
00103			joint = JointNamed('llip');
00104			l = GetJointPos(joint);
00105			if(FRand() < 0.3)
00106			{
00107				Spawn(class'BubbleSystemOneShot',,, l,);
00108			}
00109		}
00110		else// if (Region.Zone.bCold)
00111		{	// Spawn steam breath
00112			SoundChance(BreathSound, 1.0, SLOT_Talk);
00113			joint = JointNamed('llip');
00114			l = GetJointPos(joint);
00115	
00116			B = Spawn(class'Breath',,, l,);
00117			B.ScaleMin=0.2;
00118			B.ScaleMax=1.200000;
00119		}
00120	}
00121	
00122	
00123	//============================================================
00124	//
00125	// InAttackRange
00126	//
00127	// When within attack range, state changes from
00128	// charging to fighting
00129	//============================================================
00130	function bool InAttackRange(Actor Other)
00131	{
00132		local float range;
00133		range = VSize(Location-Other.Location);
00134		if (range<CollisionRadius + Other.CollisionRadius + Max(CombatRange, MeleeRange))
00135			return true;
00136		if (bLungeAttack && FRand()<0.1 && range < LungeRange)
00137			return true;
00138		return false;
00139	}
00140	
00141	
00142	//===================================================================
00143	//					Localized Damage Functions
00144	//===================================================================
00145	
00146	//============================================================
00147	//
00148	// BodyPartSeverable
00149	//
00150	//============================================================
00151	function bool BodyPartSeverable(int BodyPart)
00152	{
00153		switch(BodyPart)
00154		{
00155			case BODYPART_HEAD:
00156				return true;
00157		}
00158		return false;
00159	}
00160	
00161	//============================================================
00162	//
00163	// BodyPartCritical
00164	//
00165	//============================================================
00166	function bool BodyPartCritical(int BodyPart)
00167	{
00168		return (BodyPart == BODYPART_HEAD);
00169	}
00170	
00171	//============================================================
00172	//
00173	// PainSkin
00174	//
00175	// returns the pain skin for a given polygroup
00176	//============================================================
00177	function Texture PainSkin(int BodyPart)
00178	{
00179		switch(BodyPart)
00180		{
00181			case BODYPART_HEAD:
00182				SkelGroupSkins[2] = Texture'creatures.snowbeastsb_bodypain';
00183				SkelGroupSkins[9] = Texture'creatures.snowbeastsb_bodypain';
00184				SkelGroupSkins[5] = Texture'creatures.snowbeastsb_bodypain';//teeth
00185				SkelGroupSkins[6] = Texture'creatures.snowbeastsb_bodypain';
00186				break;
00187			case BODYPART_TORSO:
00188				SkelGroupSkins[4] = Texture'creatures.snowbeastsb_bodypain';
00189				SkelGroupSkins[7] = Texture'creatures.snowbeastsb_bodypain';
00190				break;
00191			case BODYPART_LARM1:
00192				SkelGroupSkins[10] = Texture'creatures.snowbeastsb_armlegpain';
00193				break;
00194			case BODYPART_RARM1:
00195				SkelGroupSkins[1] = Texture'creatures.snowbeastsb_armlegpain';
00196				break;
00197			case BODYPART_LLEG1:
00198				SkelGroupSkins[8] = Texture'creatures.snowbeastsb_armlegpain';
00199				break;
00200			case BODYPART_RLEG1:
00201				SkelGroupSkins[3] = Texture'creatures.snowbeastsb_armlegpain';
00202				break;
00203		}
00204		return None;
00205	}
00206	
00207	//============================================================
00208	//
00209	// BodyPartForJoint
00210	//
00211	// Returns the body part a joint is associated with
00212	//============================================================
00213	function int BodyPartForJoint(int joint)
00214	{
00215		switch(joint)
00216		{
00217			case 3: case 5:					return BODYPART_TORSO;
00218			case 8:							return BODYPART_HEAD;
00219			case 14:						return BODYPART_RARM1;
00220			case 15:						return BODYPART_RARM2;
00221			case 19:						return BODYPART_LARM1;
00222			case 20:						return BODYPART_LARM2;
00223			case 27: case 29:				return BODYPART_RLEG1;
00224			case 31: case 33:				return BODYPART_LLEG1;
00225		}
00226		return BODYPART_BODY;
00227	}
00228	
00229	//============================================================
00230	//
00231	// BodyPartForPolyGroup
00232	//
00233	//============================================================
00234	function int BodyPartForPolyGroup(int polygroup)
00235	{
00236		switch(polygroup)
00237		{
00238			case 1: case 4: case 5:
00239			case 8:						return BODYPART_HEAD;
00240			case 2:						return BODYPART_RLEG1;
00241			case 7:						return BODYPART_LLEG1;
00242			case 9:						return BODYPART_RARM1;
00243			case 10:					return BODYPART_LARM1;
00244		}
00245		return BODYPART_BODY;
00246	}
00247	
00248	//------------------------------------------------------------
00249	//
00250	// MakeTwitchable
00251	//
00252	// TODO: Move to carcass
00253	//------------------------------------------------------------
00254	function MakeTwitchable()
00255	{
00256		local int j;
00257	
00258		// Turn all collision joints accelerative
00259		for (j=0; j<NumJoints(); j++)
00260		{
00261			if ((JointFlags[j] & JOINT_FLAG_COLLISION)==0)
00262				continue;
00263	
00264			switch(j)
00265			{
00266				case 3: case 5:
00267					break;
00268				default:
00269					JointFlags[j] = JointFlags[j] | JOINT_FLAG_ACCELERATIVE;
00270	//				SetJointRotThreshold(j, 16000);
00271	//				SetJointDampFactor(j, 0.025);
00272	//				SetAccelMagnitude(j, 8000);
00273					break;
00274			}
00275		}
00276	}
00277	
00278	//------------------------------------------------
00279	//
00280	// JointDamaged
00281	//
00282	//------------------------------------------------
00283	function bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
00284	{
00285		bAngry=true;
00286		return Super.JointDamaged(Damage, EventInstigator, HitLoc, Momentum, DamageType, joint);
00287	}
00288	
00289	//------------------------------------------------
00290	//
00291	// CanGotoPainState
00292	//
00293	// Special functionality added to keep the beast from going into pain while threatening
00294	//------------------------------------------------
00295	
00296	function bool CanGotoPainState()
00297	{
00298		if(AnimSequence == 'howl')
00299			return(false); // Don't enter pain state, if rearing up and howling
00300		else
00301			return(false);
00302	//		return(true);
00303	}
00304	
00305	
00306	//============================================================
00307	// Animation functions
00308	//============================================================
00309	function PlayWaiting(optional float tween)		{ LoopAnim  ('idl_sbeast_breathe1_an0n',1.0, tween);}
00310	function PlayMoving(optional float tween)
00311	{
00312		if (bHurrying)
00313			LoopAnim  ('run',    1.0, tween);
00314		else
00315			LoopAnim  ('walk',    1.0, tween);
00316	}
00317	function PlayJumping(optional float tween)		{ PlayAnim  ('jump',			1.0, tween);	}
00318	function PlayTurning(optional float tween)		{ PlayAnim  ('walk',			1.0, tween);	}
00319	function PlayCower(optional float tween)		{ LoopAnim  ('cower',			1.0, tween);	}
00320	function PlayHuntStop(optional float tween)		{ PlayWaiting(tween);							}
00321	function PlayThreatening(optional float tween)	{ PlayAnim  ('howl',			1.0, tween);	}
00322	
00323	function PlayFrontHit(float tween)				{ PlayAnim  ('cower',			1.0, tween);	}
00324	function PlayDrowning(optional float tween)		{ LoopAnim  ('drown',			1.0, tween);	}
00325	
00326	function PlayDeath(name DamageType)				{ PlayAnim('deathf',			1.0, 0.1);	}
00327	function PlayBackDeath(name DamageType)			{ PlayAnim('deathf',			1.0, 0.1);	}
00328	function PlayLeftDeath(name DamageType)			{ PlayAnim('death',				1.0, 0.1);	}
00329	function PlayRightDeath(name DamageType)		{ PlayAnim('deathl',			1.0, 0.1);	}
00330	function PlayHeadDeath(name DamageType)			{ PlayAnim('deathf',			1.0, 0.1);	}
00331	function PlayDrownDeath(name DamageType)		{ PlayAnim('drown_death',		1.0, 0.1);	}
00332	
00333	function TweenToWaiting(float time)				{ TweenAnim ('idl_sbeast_breathe1_an0n',    time);	}
00334	function TweenToMoving(float time)
00335	{
00336		if (bHurrying)
00337			TweenAnim ('run',    time);
00338		else
00339			TweenAnim ('walk',    time);
00340	}
00341	function TweenToHuntStop(float time)			{ TweenToWaiting(time); }
00342	
00343	function PlaySwingLeft()						{ PlayAnim('swipeL',	1.0, 0.1);	}
00344	function PlaySwingRight()						{ PlayAnim('swipeR',	1.0, 0.1);	}
00345	function PlayBite()								{ PlayAnim('bite',		1.0, 0.1);	}
00346	function PlayLunge()							{ PlayAnim('leepR',		1.0, 0.1);	}
00347	
00348	
00349	//===================================================================
00350	//					States
00351	//===================================================================
00352	
00353	//================================================
00354	//
00355	// Fighting
00356	//
00357	//================================================
00358	State Fighting
00359	{
00360		function BeginState()
00361		{
00362			LookAt(Enemy);
00363			bHurrying = true;
00364			UpdateMovementSpeed();
00365			bAvoidLedges=true;
00366			SetTimer(0.1, true);
00367			AttackAction = AA_LUNGE;
00368			bStopMoveIfCombatRange = true;
00369		}
00370	
00371		function EndState()
00372		{
00373			bBiting=false;
00374			if(Jaws != None)
00375				Jaws.FinishAttack();
00376			Super.WeaponDeactivate();
00377			bAvoidLedges=false;
00378			SetTimer(0, false);
00379			if (Weapon!=None)
00380				Weapon.FinishAttack();
00381			LookAt(None);
00382			bStopMoveIfCombatRange = false;
00383		}
00384	
00385		function AmbientSoundTimer()
00386		{
00387			PlayAmbientFightSound();
00388		}
00389	
00390		function WeaponActivate()
00391		{
00392			if (bBiting && Jaws != None)
00393				Jaws.StartAttack();
00394			else
00395				Super.WeaponActivate();
00396		}
00397	
00398		function WeaponDeactivate()
00399		{
00400			if (bBiting && Jaws != None)
00401				Jaws.FinishAttack();
00402			else
00403				Super.WeaponDeactivate();
00404		}
00405	
00406		function HowlSound()
00407		{
00408			PlaySound(HowlingSound, SLOT_None,,,, 1.0 + FRand()*0.2-0.1);
00409		}
00410	
00411		function Bump(actor Other)
00412		{
00413			local vector thrust;
00414	
00415			if (bLunging)
00416			{
00417				if (Pawn(Other)!=None)
00418				{
00419					Velocity.Z = 5;
00420					thrust = (Velocity*2*Mass + Other.Velocity*Other.Mass)/(Mass+Other.Mass);
00421					if (VSize(thrust) > MaxBashThrust)
00422						thrust = Normal(thrust)*MaxBashThrust;
00423					Pawn(Other).AddVelocity(thrust);
00424	
00425					// Do bash damage if velocity > some amount
00426					Other.JointDamaged(20, self, Other.Location, thrust, 'blunt', 0);
00427	
00428					//TODO: If velocity > some amount, knock enemy down
00429				}
00430	
00431				bLunging = false;	// Don't bash again
00432			}
00433		}
00434	
00435		function HitWall(vector HitNormal, actor Wall)
00436		{
00437			MoveTimer = -1;
00438			AttackAction = AA_WAIT;
00439			Super.HitWall(HitNormal, Wall);
00440		}
00441	
00442		function PickStrafeDestination()
00443		{		
00444			local vector V;
00445			local rotator R;
00446			local vector temp;
00447			
00448			V = Location - Enemy.Location;
00449			R = rotator(V);
00450			
00451			if (AttackAction == AA_STRAFE_LEFT)
00452				R.Yaw += 2000;
00453			else
00454				R.Yaw -= 2000;
00455	
00456			// Strafe using the enemy's XY location, but the viking's location ground plane		
00457			temp = Enemy.Location;
00458			temp.Z = Location.Z;
00459	
00460			Destination = temp + vector(R) * CombatRange;
00461		}
00462		
00463		function PickDestinationBackup()
00464		{
00465			local vector ToEnemy;
00466	
00467			ToEnemy = Normal(Enemy.Location - Location);
00468			Destination = Enemy.Location - ToEnemy * CombatRange;
00469	
00470		}
00471	
00472		function ComputeLunge()
00473		{
00474			local vector dest;
00475			local vector adjust;
00476	
00477			if (Enemy != None)
00478			{
00479				dest = Enemy.Location;
00480				dest.Z = Location.Z;
00481	
00482				adjust = Enemy.Velocity * 0.15;
00483				adjust.Z = 0;
00484						
00485				AddVelocity(CalcArcVelocity(4000, Location, dest + adjust));
00486			}
00487		}
00488	
00489		// Determine AttackAction based upon enemy movement and position
00490		function Timer()
00491		{
00492			GetEnemyProximity();
00493	
00494			LastAction = AttackAction;
00495	
00496			if(Weapon != None && InMeleeRange(Enemy) || (EnemyMovement == MOVE_CLOSER && EnemyDist < MeleeRange * 2.5))
00497			{
00498				if (EnemyIncidence == INC_LEFT)
00499				{	// Swing left
00500					AttackAction = AA_ATTACKMELEE2;
00501				}
00502				else if (EnemyIncidence == INC_RIGHT)
00503				{	// Swing right
00504					AttackAction = AA_ATTACKMELEE3;
00505				}
00506				else if (FRand() < 0.2)
00507				{	// Bite
00508					AttackAction = AA_ATTACKMELEE1;
00509				}
00510				else if (FRand() < 0.5)
00511				{
00512					AttackAction = AA_ATTACKMELEE2;
00513				}
00514				else
00515				{
00516					AttackAction = AA_ATTACKMELEE2;
00517				}
00518			}
00519			else if ((EnemyMovement == MOVE_STRAFE_LEFT || EnemyMovement == MOVE_STRAFE_RIGHT) &&
00520					!InRange(Enemy, MeleeRange * 3) && (FRand() < 0.9))
00521			{
00522				if(EnemyMovement == MOVE_STRAFE_LEFT)
00523				{
00524					AttackAction = AA_STRAFE_LEFT;
00525				}
00526				else
00527				{
00528					AttackAction = AA_STRAFE_RIGHT;
00529				}
00530			}
00531			else if(EnemyMovement == MOVE_STANDING && FRand() < 0.9)
00532			{
00533	/*			if (FRand() < 0.9)
00534				{	// Pace back and forth
00535					if (FRand() < 0.1)
00536					{	// Reverse direction
00537						bStrafeRight = !bStrafeRight;
00538					}
00539					
00540					if (bStrafeRight)
00541						AttackAction = AA_STRAFE_RIGHT;
00542					else
00543						AttackAction = AA_STRAFE_LEFT;
00544				}
00545				else*/
00546				if (!InRange(Enemy, MeleeRange) && FRand() < 0.8 && EnemyVertical == VERT_LEVEL)
00547					AttackAction = AA_LUNGE;
00548				else
00549					AttackAction = AA_WAIT;
00550			}
00551			else
00552			{
00553				AttackAction = AA_WAIT;
00554			}
00555		}
00556	
00557	Begin:
00558		if(debugstates) SLog(name@"Fighting");
00559		Acceleration = vect(0,0,0);
00560	
00561	Fight:
00562		if ( !ValidEnemy() )
00563			Goto('Finished');
00564	
00565		// Turn to face enemy
00566		if (NeedToTurn(Enemy.Location))
00567		{
00568			DesiredRotation.Yaw = rotator(Enemy.Location-Location).Yaw;
00569		}
00570	
00571		switch(AttackAction)
00572		{
00573		case AA_WAIT:
00574			PlayWaiting(0.1);
00575			Sleep(0.2);
00576			break;
00577	
00578		case AA_LUNGE:
00579			bStopMoveIfCombatRange = false;
00580			TurnTo(Enemy.Location);
00581			bLunging = true;
00582			PlayLunge();
00583			Sleep(0.2); // Sleep for a moment before leaping
00584			TurnTo(Enemy.Location);
00585			//PlaySound(BashSound, SLOT_Interact,,,, 1.0 + FRand()*0.2-0.1);
00586			ComputeLunge();		
00587			FinishAnim();
00588			WaitForLanding();
00589			Sleep(TimeBetweenAttacks);
00590			bLunging = false;
00591			bStopMoveIfCombatRange = true;
00592			break;
00593	
00594		case AA_STRAFE_LEFT:
00595			bHurrying = false;
00596			UpdateMovementSpeed();
00597			PickStrafeDestination();
00598			//PlayStrafeLeft();
00599			PlayMoving(0.1);
00600	
00601			if (EnemyMovement==MOVE_CLOSER || InRange(Enemy, MeleeRange * 2))
00602				StrafeFacing(Destination, Enemy);
00603			else
00604				MoveTo(Destination, MovementSpeed);
00605			bHurrying = true;
00606			UpdateMovementSpeed();
00607			break;
00608	
00609		case AA_STRAFE_RIGHT:
00610			bHurrying = false;
00611			UpdateMovementSpeed();
00612			PickStrafeDestination();
00613			//PlayStrafeRight();
00614			PlayMoving(0.1);
00615			if (EnemyMovement==MOVE_CLOSER || InRange(Enemy, MeleeRange * 2))
00616				StrafeFacing(Destination, Enemy);
00617			else
00618				MoveTo(Destination, MovementSpeed);
00619			bHurrying = true;
00620			UpdateMovementSpeed();
00621			break;
00622	
00623		case AA_CHARGE:
00624			PlayMoving(0.1);
00625			MoveTo(Enemy.Location - VecToEnemy * MeleeRange, MovementSpeed);
00626			break;
00627	
00628		case AA_BACKUP:
00629			bHurrying = false;
00630			UpdateMovementSpeed();
00631			DesiredRotation = rotator(Enemy.Location-Location);
00632			PlayMoving(0.1);
00633			PickDestinationBackup();
00634			StrafeFacing(Destination, Enemy);
00635			bHurrying = true;
00636			UpdateMovementSpeed();
00637			PlayWaiting();
00638			break;
00639	
00640		case AA_ATTACKMELEE1:
00641			bBiting=true;
00642			PlayBite();
00643			FinishAnim();
00644			bBiting=false;
00645			Sleep(TimeBetweenAttacks);
00646			break;
00647	
00648		case AA_ATTACKMELEE2:
00649			PlaySwingLeft();
00650			FinishAnim();
00651			Sleep(TimeBetweenAttacks);
00652			break;
00653	
00654		case AA_ATTACKMELEE3:
00655			PlaySwingRight();
00656			FinishAnim();
00657			Sleep(TimeBetweenAttacks);
00658			break;
00659		}
00660	
00661		if (InRange(Enemy, CombatRange))
00662		{
00663			Sleep(0.05);
00664			Goto('Begin');
00665		}
00666	
00667	Finished:
00668		GotoState('Charging', 'ResumeFromFighting');
00669	
00670	//	GotoState('ChewOnCorpse');
00671	}
00672	
00673	
00674	//================================================
00675	//
00676	// Statue
00677	//
00678	//================================================
00679	State() Statue
00680	{
00681	ignores HearNoise, EnemyAcquired, Bump;
00682	
00683		function HowlSound()
00684		{
00685			PlaySound(HowlingSound, SLOT_None,,,, 1.0 + FRand()*0.2-0.1);
00686		}
00687	
00688		function CreatureStatue()
00689		{
00690			SkelGroupSkins[1] = texture'statues.sb_armleg_stone';
00691			SkelGroupSkins[2] = texture'statues.sb_body_stone';
00692			SkelGroupSkins[3] = texture'statues.sb_armleg_stone';
00693			SkelGroupSkins[4] = texture'statues.sb_body_stone';
00694			SkelGroupSkins[5] = texture'statues.sb_body_stone';
00695			SkelGroupSkins[6] = texture'statues.sb_body_stone';
00696			SkelGroupSkins[7] = texture'statues.sb_body_stone';
00697			SkelGroupSkins[8] = texture'statues.sb_armleg_stone';
00698			SkelGroupSkins[9] = texture'statues.sb_body_stone';
00699			SkelGroupSkins[10] = texture'statues.sb_armleg_stone';
00700		}
00701	
00702	Wake:
00703		PlayThreatening(0.1);
00704		CreatureNormal();
00705		InventoryNormal();
00706		FinishAnim();
00707	
00708		OrderFinished();
00709		GotoState('Waiting');
00710	}
00711	
00712	defaultproperties
00713	{
00714	     HowlingSound=Sound'CreaturesSnd.SnowBeast.beastyell11'
00715	     MaxBashThrust=500.000000
00716	     bLungeAttack=True
00717	     FightOrFlight=1.000000
00718	     FightOrDefend=1.000000
00719	     HighOrLow=1.000000
00720	     LatOrVertDodge=0.500000
00721	     HighOrLowBlock=1.000000
00722	     LungeRange=250.000000
00723	     BreathSound=Sound'CreaturesSnd.SnowBeast.beastbreath05'
00724	     AcquireSound=Sound'CreaturesSnd.SnowBeast.beasthit12'
00725	     AmbientFightSounds(0)=Sound'CreaturesSnd.SnowBeast.beastamb09'
00726	     AmbientFightSounds(1)=Sound'CreaturesSnd.SnowBeast.beastdeath01'
00727	     AmbientFightSounds(2)=Sound'CreaturesSnd.SnowBeast.beasthit08'
00728	     AmbientWaitSoundDelay=10.000000
00729	     AmbientFightSoundDelay=5.000000
00730	     StartWeapon=Class'RuneI.SnowbeastPaw'
00731	     MinStopWait=0.000000
00732	     MaxStopWait=0.000000
00733	     ShadowScale=4.000000
00734	     bCanStrafe=True
00735	     bAlignToFloor=True
00736	     MeleeRange=45.000000
00737	     CombatRange=300.000000
00738	     GroundSpeed=274.000000
00739	     WaterSpeed=100.000000
00740	     AccelRate=400.000000
00741	     MaxStepHeight=30.000000
00742	     WalkingSpeed=107.000000
00743	     ClassID=7
00744	     PeripheralVision=-0.500000
00745	     Health=300
00746	     UnderWaterTime=2.000000
00747	     HitSound1=Sound'CreaturesSnd.SnowBeast.beastbreath02'
00748	     HitSound2=Sound'CreaturesSnd.SnowBeast.beasthit13'
00749	     HitSound3=Sound'CreaturesSnd.SnowBeast.beasthit15'
00750	     Die=Sound'CreaturesSnd.SnowBeast.beastdeath02'
00751	     Die2=Sound'CreaturesSnd.SnowBeast.beastyell14'
00752	     Die3=Sound'CreaturesSnd.SnowBeast.beastdeath03'
00753	     FootStepWood(0)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00754	     FootStepWood(1)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00755	     FootStepWood(2)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00756	     FootStepMetal(0)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00757	     FootStepMetal(1)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00758	     FootStepMetal(2)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00759	     FootStepStone(0)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00760	     FootStepStone(1)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00761	     FootStepStone(2)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00762	     FootStepFlesh(0)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00763	     FootStepFlesh(1)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00764	     FootStepFlesh(2)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00765	     FootStepIce(0)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00766	     FootStepIce(1)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00767	     FootStepIce(2)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00768	     FootStepEarth(0)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00769	     FootStepEarth(1)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00770	     FootStepEarth(2)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00771	     FootStepSnow(0)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00772	     FootStepSnow(1)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00773	     FootStepSnow(2)=Sound'CreaturesSnd.SnowBeast.beastfootstep07'
00774	     LandSoundWood=Sound'CreaturesSnd.SnowBeast.beastfootstep01'
00775	     LandSoundMetal=Sound'CreaturesSnd.SnowBeast.beastfootstep01'
00776	     LandSoundStone=Sound'CreaturesSnd.SnowBeast.beastfootstep01'
00777	     LandSoundFlesh=Sound'CreaturesSnd.SnowBeast.beastfootstep01'
00778	     LandSoundIce=Sound'CreaturesSnd.SnowBeast.beastfootstep01'
00779	     LandSoundSnow=Sound'CreaturesSnd.SnowBeast.beastfootstep01'
00780	     LandSoundEarth=Sound'CreaturesSnd.SnowBeast.beastfootstep01'
00781	     WeaponJoint=rwrist
00782	     bCanLook=True
00783	     MaxBodyAngle=(Yaw=12743)
00784	     MaxHeadAngle=(Yaw=9102)
00785	     LookDegPerSec=150.000000
00786	     MaxMouthRot=7000
00787	     MaxMouthRotRate=65535
00788	     DeathRadius=55.000000
00789	     DeathHeight=15.000000
00790	     bLeadEnemy=True
00791	     bStasis=False
00792	     AnimSequence=IDL_SBEAST_breathe1_AN0N
00793	     CollisionRadius=40.000000
00794	     CollisionHeight=47.000000
00795	     Mass=400.000000
00796	     Buoyancy=350.000000
00797	     RotationRate=(Pitch=0,Roll=0)
00798	     Skeletal=SkelModel'creatures.SnowBeast'
00799	}

End Source Code