RuneI
Class ZombieClaw

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

class ZombieClaw
extends RuneI.InvisibleWeapon

//============================================================================= // ZombieClaw. //=============================================================================

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	// ZombieClaw.
00003	//=============================================================================
00004	class ZombieClaw 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				i = Rand(NumFleshSounds);
00049				PlaySound(HitFlesh[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00050				break;
00051			case MATTER_WOOD:
00052				i = Rand(NumWoodSounds);
00053				PlaySound(HitWood[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00054				break;
00055			case MATTER_STONE:
00056				Spawn(class'HitStone',,, HitLoc, rotator(HitNorm));
00057				i = Rand(NumStoneSounds);
00058				PlaySound(HitStone[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00059				break;
00060			case MATTER_METAL:
00061				i = Rand(NumMetalSounds);
00062				PlaySound(HitMetal[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00063				break;
00064			case MATTER_EARTH:
00065				i = Rand(NumEarthSounds);
00066				PlaySound(HitDirt[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00067				break;
00068			case MATTER_BREAKABLEWOOD:
00069				PlaySound(HitBreakableWood, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00070				break;
00071			case MATTER_BREAKABLESTONE:
00072				PlaySound(HitBreakableStone, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00073				break;
00074			case MATTER_WEAPON:
00075				PlaySound(HitWeapon, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00076				break;
00077			case MATTER_SHIELD:
00078				PlaySound(HitShield, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00079				break;
00080			case MATTER_ICE:
00081				break;
00082			case MATTER_WATER:
00083				break;
00084		}
00085	}
00086	
00087	defaultproperties
00088	{
00089	     Damage=5
00090	     DamageType=Sever
00091	     ThroughAir(0)=Sound'CreaturesSnd.Zombie.zombiearm01'
00092	     ThroughAir(1)=Sound'CreaturesSnd.Zombie.zombiearm02'
00093	     ThroughAir(2)=Sound'CreaturesSnd.Zombie.zombiearm01'
00094	     HitFlesh(0)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00095	     HitFlesh(1)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00096	     HitWood(0)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00097	     HitWood(1)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00098	     HitStone(0)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00099	     HitStone(1)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00100	     HitStone(2)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00101	     HitMetal(0)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00102	     HitMetal(1)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00103	     HitMetal(2)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00104	     HitDirt(0)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00105	     HitDirt(1)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00106	     HitDirt(2)=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00107	     HitShield=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00108	     HitWeapon=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00109	     HitBreakableWood=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00110	     HitBreakableStone=Sound'CreaturesSnd.Zombie.zombiearmimp01'
00111	     SwipeClass=Class'RuneI.WeaponSwipePurple'
00112	     DrawType=DT_SkeletalMesh
00113	     Skeletal=SkelModel'weapons.InvisibleShort'
00114	}

End Source Code