RuneI
Class CrabPincer

source: c:\runehov\RuneI\Classes\CrabPincer.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Inventory
         |
         +--Engine.Weapon
            |
            +--RuneI.InvisibleWeapon
               |
               +--RuneI.CrabPincer
Direct Known Subclasses:None

class CrabPincer
extends RuneI.InvisibleWeapon

//============================================================================= // CrabPincer. //=============================================================================

Function Summary
 void SpawnHitEffect(vector HitLoc, vector HitNorm, int LowMask, int HighMask, Actor HitActor)
     
//=============================================================================
//
// SpawnHitEffect
//
// Spawns an effect based upon what was struck
//=============================================================================



Source Code


00001	//=============================================================================
00002	// CrabPincer.
00003	//=============================================================================
00004	class CrabPincer expands InvisibleWeapon;
00005	
00006	
00007	//=============================================================================
00008	//
00009	// SpawnHitEffect
00010	//
00011	// Spawns an effect based upon what was struck
00012	//=============================================================================
00013	function SpawnHitEffect(vector HitLoc, vector HitNorm, int LowMask, int HighMask, Actor HitActor)
00014	{	
00015		local int i,j;
00016		local EMatterType matter;
00017	
00018		// Determine what kind of matter was hit
00019		if ((HitActor.Skeletal != None) && (LowMask!=0 || HighMask!=0))
00020		{
00021			for (j=0; j<HitActor.NumJoints(); j++)
00022			{
00023				if (((j <  32) && ((LowMask  & (1 <<  j      )) != 0)) ||
00024					((j >= 32) && (j < 64) && ((HighMask & (1 << (j - 32))) != 0)) )
00025				{	// Joint j was hit
00026					matter = HitActor.MatterForJoint(j);
00027					break;
00028				}
00029			}
00030		}
00031		else if(HitActor.IsA('LevelInfo'))
00032		{	
00033			matter = HitActor.MatterTrace(HitLoc, Owner.Location, WeaponSweepExtent);
00034		}
00035		else
00036		{
00037			matter = HitActor.MatterForJoint(0);
00038		}
00039	
00040		// Create effects
00041		switch(matter)
00042		{
00043			case MATTER_FLESH:
00044				if(HitActor.IsA('Sark') || HitActor.IsA('SarkRagnar'))
00045					Spawn(class'SarkBloodMist',,, HitLoc, rotator(HitNorm)); // Sark blood
00046				else
00047					Spawn(class'BloodMist',,, HitLoc, rotator(HitNorm));
00048	
00049				i = Rand(NumFleshSounds);
00050				PlaySound(HitFlesh[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00051				break;
00052			case MATTER_WOOD:
00053				i = Rand(NumWoodSounds);
00054				PlaySound(HitWood[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00055				break;
00056			case MATTER_STONE:
00057				Spawn(class'HitStone',,, HitLoc, rotator(HitNorm));
00058				i = Rand(NumStoneSounds);
00059				PlaySound(HitStone[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00060				break;
00061			case MATTER_METAL:
00062				i = Rand(NumMetalSounds);
00063				PlaySound(HitMetal[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00064				break;
00065			case MATTER_EARTH:
00066				i = Rand(NumEarthSounds);
00067				PlaySound(HitDirt[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00068				break;
00069			case MATTER_BREAKABLEWOOD:
00070				PlaySound(HitBreakableWood, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00071				break;
00072			case MATTER_BREAKABLESTONE:
00073				PlaySound(HitBreakableStone, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00074				break;
00075			case MATTER_WEAPON:
00076				PlaySound(HitWeapon, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00077				break;
00078			case MATTER_SHIELD:
00079				PlaySound(HitShield, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00080				break;
00081			case MATTER_ICE:
00082				break;
00083			case MATTER_WATER:
00084				break;
00085		}
00086	}
00087	
00088	defaultproperties
00089	{
00090	     Damage=15
00091	     DamageType=Sever
00092	     ThroughAir(0)=Sound'CreaturesSnd.Crab.crabarm01'
00093	     ThroughAir(1)=Sound'CreaturesSnd.Crab.crabarm02'
00094	     ThroughAir(2)=Sound'CreaturesSnd.Crab.crabattack03'
00095	     HitFlesh(0)=Sound'WeaponsSnd.ImpFlesh.impfleshaxe10'
00096	     HitFlesh(1)=Sound'WeaponsSnd.ImpFlesh.impfleshaxe10'
00097	     HitFlesh(2)=Sound'WeaponsSnd.ImpFlesh.impfleshaxe10'
00098	     HitWood(0)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00099	     HitWood(1)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00100	     HitWood(2)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00101	     HitStone(0)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00102	     HitStone(1)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00103	     HitStone(2)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00104	     HitMetal(0)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00105	     HitMetal(1)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00106	     HitMetal(2)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00107	     HitDirt(0)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00108	     HitDirt(1)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00109	     HitDirt(2)=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00110	     HitShield=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00111	     HitWeapon=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00112	     HitBreakableWood=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00113	     HitBreakableStone=Sound'WeaponsSnd.ImpFlesh.impactflesh03'
00114	     SwipeClass=Class'RuneI.WeaponSwipePurple'
00115	     DrawType=DT_SkeletalMesh
00116	     Skeletal=SkelModel'weapons.InvisibleShort'
00117	}

End Source Code