RuneI
Class InvisibleWeapon

source: c:\runehov\RuneI\Classes\InvisibleWeapon.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Inventory
         |
         +--Engine.Weapon
            |
            +--RuneI.InvisibleWeapon
Direct Known Subclasses:CrabPincer, GoblinClaw, MechBlade, SarkClaw, SnowbeastJaws, SnowbeastPaw, TubestrikerTongue, ZombieClaw

class InvisibleWeapon
extends Engine.Weapon

//============================================================================= // InvisibleWeapon. //=============================================================================
Variables
 Weapon ChainedWeapon

States
Active, Swinging

Function Summary
 void ChainOnWeapon(Weapon W)
     
//=============================================================================
//
// ChainOnWeapon
//
//=============================================================================
 void Destroyed()
 void DisableSwipeTrail()
 void DropFrom(vector StartLocation)
     
//=============================================================================
//
// DropFrom - destroy instead of drop
//
//=============================================================================
 void EnableSwipeTrail()
     
//-----------------------------------------------------------------------------
// Chained Weapon Support
//-----------------------------------------------------------------------------
 void FinishAttack()
 void SpawnHitEffect(vector HitLoc, vector HitNorm, int LowMask, int HighMask, Actor HitActor)
     
//=============================================================================
//
// SpawnHitEffect
//
// Spawns an effect based upon what was struck
//=============================================================================
 void StartAttack()


State Active Function Summary
 void FinishAttack()
 void StartAttack()


State Swinging Function Summary
 void FinishAttack()
 void StartAttack()



Source Code


00001	//=============================================================================
00002	// InvisibleWeapon.
00003	//=============================================================================
00004	class InvisibleWeapon expands Weapon
00005		abstract;
00006	
00007	var Weapon ChainedWeapon;
00008	
00009	//=============================================================================
00010	//
00011	// SpawnHitEffect
00012	//
00013	// Spawns an effect based upon what was struck
00014	//=============================================================================
00015	function SpawnHitEffect(vector HitLoc, vector HitNorm, int LowMask, int HighMask, Actor HitActor)
00016	{	
00017		local int i,j;
00018		local EMatterType matter;
00019	
00020		// Determine what kind of matter was hit
00021		if ((HitActor.Skeletal != None) && (LowMask!=0 || HighMask!=0))
00022		{
00023			for (j=0; j<HitActor.NumJoints(); j++)
00024			{
00025				if (((j <  32) && ((LowMask  & (1 <<  j      )) != 0)) ||
00026					((j >= 32) && (j < 64) && ((HighMask & (1 << (j - 32))) != 0)) )
00027				{	// Joint j was hit
00028					matter = HitActor.MatterForJoint(j);
00029					break;
00030				}
00031			}
00032		}
00033		else if(HitActor.IsA('LevelInfo'))
00034		{	
00035			matter = HitActor.MatterTrace(HitLoc, Owner.Location, WeaponSweepExtent);
00036		}
00037		else
00038		{
00039			matter = HitActor.MatterForJoint(0);
00040		}
00041	
00042		// Create effects
00043		PlayHitMatterSound(matter);
00044	}
00045	
00046	
00047	//=============================================================================
00048	//
00049	// ChainOnWeapon
00050	//
00051	//=============================================================================
00052	function ChainOnWeapon(Weapon W)
00053	{
00054		ChainedWeapon = W;
00055	}
00056	
00057	//=============================================================================
00058	//
00059	// DropFrom - destroy instead of drop
00060	//
00061	//=============================================================================
00062	function DropFrom(vector StartLocation)
00063	{
00064		Destroy();
00065	}
00066	
00067	function Destroyed()
00068	{
00069		if (ChainedWeapon != None)
00070		{
00071			ChainedWeapon.Destroy();
00072			ChainedWeapon=None;
00073		}
00074		Super.Destroyed();
00075	}
00076		
00077	
00078	//-----------------------------------------------------------------------------
00079	// Chained Weapon Support
00080	//-----------------------------------------------------------------------------
00081	
00082	function EnableSwipeTrail()
00083	{
00084		Super.EnableSwipeTrail();
00085		if (ChainedWeapon!=None)
00086			ChainedWeapon.EnableSwipeTrail();
00087	}
00088	
00089	function DisableSwipeTrail()
00090	{
00091		Super.DisableSwipeTrail();
00092		if (ChainedWeapon!=None)
00093			ChainedWeapon.DisableSwipeTrail();
00094	}
00095	
00096	function StartAttack()
00097	{
00098		Super.StartAttack();
00099		if (ChainedWeapon!=None)
00100			ChainedWeapon.StartAttack();
00101	}
00102	function FinishAttack()
00103	{
00104		Super.FinishAttack();
00105		if (ChainedWeapon!=None)
00106			ChainedWeapon.FinishAttack();
00107	}
00108	
00109	state Swinging
00110	{
00111		function StartAttack()
00112		{
00113			Super.StartAttack();
00114			if (ChainedWeapon!=None)
00115				ChainedWeapon.StartAttack();
00116		}
00117		function FinishAttack()
00118		{
00119			Super.FinishAttack();
00120			if (ChainedWeapon!=None)
00121				ChainedWeapon.FinishAttack();
00122		}
00123	}
00124	
00125	state Active
00126	{
00127		function StartAttack()
00128		{
00129			Super.StartAttack();
00130			if (ChainedWeapon!=None)
00131				ChainedWeapon.StartAttack();
00132		}
00133		function FinishAttack()
00134		{
00135			Super.FinishAttack();
00136			if (ChainedWeapon!=None)
00137				ChainedWeapon.FinishAttack();
00138		}
00139	}
00140	
00141	defaultproperties
00142	{
00143	     MeleeType=MELEE_HAMMER
00144	     Damage=10
00145	     DamageType=Blunt
00146	     ExtendedLength=20.000000
00147	     SweepVector=(Y=-1.000000)
00148	     A_Taunt=S3_taunt
00149	     DrawType=DT_None
00150	     bSweepable=False
00151	}

End Source Code