SarkBall
Class SarkBallBotSnowBeast

source: c:\runehov\SarkBall\Classes\SarkBallBotSnowBeast.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pawn
         |
         +--RuneI.ScriptPawn
            |
            +--SarkBall.SarkBallBot
               |
               +--SarkBall.SarkBallBotSnowBeast
Direct Known Subclasses:None

class SarkBallBotSnowBeast
extends SarkBall.SarkBallBot

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 SnowbeastJaws Jaws
 float MaxBashThrust
 bool bAngry
 bool bBiting
 bool bLunging

States
Fighting

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

End Source Code