RuneI
Class SnowBeastChained

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

class SnowBeastChained
extends RuneI.SnowBeast

//============================================================================= // SnowBeastChained. //=============================================================================

Function Summary
 void BeginState()
     
/*
Scripting now being used
State() ChainedUp
{
ignores KilledBy, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, LongFall, PainTimer, CheckForEnemies;

	
 bool DamageBodyPart(int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType, int bodypart)
     
	{
		GotoState('ChainedUp', 'Cower');
		return false;
	}

	
 void EndState()
     
	{
		SetTimer(0.5, false);
		SpeechTime=0.5;
	}

	
 void EnemyAcquired()
     
	{
		if (Enemy != None)
		{
			GotoState('ChainedUp', 'Angry');
		}
		SetTimer(RandRange(0.2, 5.0), false);
	}

	
 void EnemyNotVisible()
     
	{
		LookAt(Enemy);
	}

	
 bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
     
	{
		Enemy = None;
	}

	
 bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
     
	{
		Enemy = None;
	}

	
 Texture PainSkin(int BodyPart)
     
//============================================================
//
// PainSkin
//
// returns the pain skin for a given polygroup
//============================================================
 void SeePlayer(Actor seen)
     
// Can't turn head this far
			LookToward(GetJointPos(JointNamed('rwrist')),true);
			break;
		case 2:
			LookAt(thePlayer, true);
			break;
		}
		SpeechTime = RandRange(0.25, 2);
	}

	
 void SpeechTimer()
     
	{
		Jaws.FinishAttack();
	}

	
 void Timer()
     
	{
		if (PlayerPawn(seen)!=None)
			theplayer = PlayerPawn(seen);

		Super.SeePlayer(seen);
	}

	
 void WeaponActivate()
     
	{
		SetTimer(0, false);
		SpeechTime=0;
		SetMovementPhysics();
	}

	
 void WeaponDeactivate()
     
	{
		Jaws.StartAttack();
	}

	



Source Code


00001	//=============================================================================
00002	// SnowBeastChained.
00003	//=============================================================================
00004	class SnowBeastChained expands SnowBeast;
00005	
00006	
00007	/*	DESCRIPTION:
00008			This version is chained up until freed by destroying chains.
00009	*/
00010	
00011	//var PlayerPawn thePlayer;
00012	
00013	
00014	//============================================================
00015	//
00016	// PainSkin
00017	//
00018	// returns the pain skin for a given polygroup
00019	//============================================================
00020	function Texture PainSkin(int BodyPart)
00021	{
00022		switch(BodyPart)
00023		{
00024			case BODYPART_HEAD:
00025				SkelGroupSkins[1] = Texture'creatures.snowbeasttb_bodypain';
00026				SkelGroupSkins[8] = Texture'creatures.snowbeasttb_bodypain';
00027				SkelGroupSkins[4] = Texture'creatures.snowbeasttb_bodypain';//teeth
00028				SkelGroupSkins[5] = Texture'creatures.snowbeasttb_bodypain';
00029				break;
00030			case BODYPART_TORSO:
00031				SkelGroupSkins[3] = Texture'creatures.snowbeasttb_bodypain';
00032				SkelGroupSkins[6] = Texture'creatures.snowbeasttb_bodypain';
00033				break;
00034			case BODYPART_LARM1:
00035				SkelGroupSkins[10] = Texture'creatures.snowbeasttb_armlegpain';
00036				break;
00037			case BODYPART_RARM1:
00038				SkelGroupSkins[9] = Texture'creatures.snowbeasttb_armlegpain';
00039				break;
00040			case BODYPART_LLEG1:
00041				SkelGroupSkins[7] = Texture'creatures.snowbeasttb_armlegpain';
00042				break;
00043			case BODYPART_RLEG1:
00044				SkelGroupSkins[2] = Texture'creatures.snowbeasttb_armlegpain';
00045				break;
00046		}
00047		return None;
00048	}
00049	
00050	function bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
00051	{
00052		return false;
00053	}
00054	
00055	/*
00056	Scripting now being used
00057	State() ChainedUp
00058	{
00059	ignores KilledBy, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, LongFall, PainTimer, CheckForEnemies;
00060	
00061		function BeginState()
00062		{
00063			SetTimer(0.5, false);
00064			SpeechTime=0.5;
00065		}
00066	
00067		function EndState()
00068		{
00069			SetTimer(0, false);
00070			SpeechTime=0;
00071			SetMovementPhysics();
00072		}
00073	
00074		function WeaponActivate()
00075		{
00076			Jaws.StartAttack();
00077		}
00078	
00079		function WeaponDeactivate()
00080		{
00081			Jaws.FinishAttack();
00082		}
00083	
00084		function SpeechTimer()
00085		{
00086			switch(Rand(3))
00087			{
00088			case 0:
00089				LookToward(GetJointPos(JointNamed('lwrist')),true);
00090				break;
00091			case 1:	// Can't turn head this far
00092				LookToward(GetJointPos(JointNamed('rwrist')),true);
00093				break;
00094			case 2:
00095				LookAt(thePlayer, true);
00096				break;
00097			}
00098			SpeechTime = RandRange(0.25, 2);
00099		}
00100	
00101		function SeePlayer(actor seen)
00102		{
00103			if (PlayerPawn(seen)!=None)
00104				theplayer = PlayerPawn(seen);
00105	
00106			Super.SeePlayer(seen);
00107		}
00108	
00109		function Timer()
00110		{
00111			if (Enemy != None)
00112			{
00113				GotoState('ChainedUp', 'Angry');
00114			}
00115			SetTimer(RandRange(0.2, 5.0), false);
00116		}
00117	
00118		function EnemyAcquired()
00119		{
00120			LookAt(Enemy);
00121		}
00122	
00123		function EnemyNotVisible()
00124		{
00125			Enemy = None;
00126		}
00127	
00128		function bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
00129		{
00130			GotoState('ChainedUp', 'Cower');
00131			return false;
00132		}
00133	
00134		function bool DamageBodyPart(int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType, int bodypart)
00135		{
00136			GotoState('ChainedUp', 'Angry');
00137			return Super.DamageBodyPart(Damage, EventInstigator, HitLocation, Momentum, DamageType, BodyPart);
00138		}
00139	
00140	Cower:
00141		LoopAnim('cower', 1.0, 0.1);
00142		Sleep(2.0);
00143		FinishAnim();
00144		Goto('Wait');
00145	
00146	Angry:
00147		if (ActorInSector(Enemy, ANGLE_45))
00148		{	// Straight ahead
00149			PlayBite();
00150			FinishAnim();
00151		}
00152		else
00153		{	// Roar
00154		}
00155		Goto('Wait');
00156	
00157	Begin:
00158	Wait:
00159		PlayWaiting(0.2);
00160	}
00161	*/
00162	
00163	defaultproperties
00164	{
00165	     bIsBoss=True
00166	     ReducedDamageType=All
00167	     AttitudeToPlayer=ATTITUDE_Ignore
00168	     bRotateTorso=False
00169	     SkelMesh=2
00170	}

End Source Code