RuneI
Class SnowbeastJaws

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

class SnowbeastJaws
extends RuneI.InvisibleWeapon

//============================================================================= // SnowbeastJaws. //=============================================================================

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	// SnowbeastJaws.
00003	//=============================================================================
00004	class SnowbeastJaws 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	     DamageType=Sever
00091	     ExtendedLength=30.000000
00092	     ThroughAir(0)=Sound'CreaturesSnd.SnowBeast.beastbite01'
00093	     HitFlesh(0)=Sound'CreaturesSnd.SnowBeast.beastflesh02'
00094	     SwipeClass=Class'RuneI.WeaponSwipePurple'
00095	     DrawType=DT_SkeletalMesh
00096	     Skeletal=SkelModel'weapons.InvisibleShort'
00097	}

End Source Code