RuneI
Class MechBlade

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

class MechBlade
extends RuneI.InvisibleWeapon

//============================================================================= // MechBlade. //=============================================================================

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	// MechBlade.
00003	//=============================================================================
00004	class MechBlade 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				if(BloodTexture != None && Owner != None)
00052				{
00053					if (ChainedWeapon == None)
00054					{	// bloody right blade
00055						Owner.SkelGroupSkins[7] = BloodTexture;
00056						Owner.SkelGroupSkins[8] = BloodTexture;
00057					}
00058					else
00059					{
00060						// bloody left blade
00061						Owner.SkelGroupSkins[9] = BloodTexture;
00062						Owner.SkelGroupSkins[10] = BloodTexture;
00063					}
00064				}
00065				break;
00066			case MATTER_WOOD:
00067				i = Rand(NumWoodSounds);
00068				PlaySound(HitWood[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00069				break;
00070			case MATTER_STONE:
00071				Spawn(class'HitStone',,, HitLoc, rotator(HitNorm));
00072				i = Rand(NumStoneSounds);
00073				PlaySound(HitStone[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00074				break;
00075			case MATTER_METAL:
00076				i = Rand(NumMetalSounds);
00077				PlaySound(HitMetal[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00078				break;
00079			case MATTER_EARTH:
00080				i = Rand(NumEarthSounds);
00081				PlaySound(HitDirt[i], SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00082				break;
00083			case MATTER_BREAKABLEWOOD:
00084				PlaySound(HitBreakableWood, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00085				break;
00086			case MATTER_BREAKABLESTONE:
00087				PlaySound(HitBreakableStone, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00088				break;
00089			case MATTER_WEAPON:
00090				PlaySound(HitWeapon, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00091				break;
00092			case MATTER_SHIELD:
00093				PlaySound(HitShield, SLOT_Misc,,,, 1.0 + (FRand()-0.5)*2.0*PitchDeviation);
00094				break;
00095			case MATTER_ICE:
00096				break;
00097			case MATTER_WATER:
00098				break;
00099		}
00100	}
00101	
00102	defaultproperties
00103	{
00104	     DamageType=Sever
00105	     ThroughAir(0)=Sound'CreaturesSnd.Mech.mechblade01'
00106	     ThroughAir(1)=Sound'CreaturesSnd.Mech.mechblade02'
00107	     ThroughAir(2)=Sound'CreaturesSnd.Mech.mechblade03'
00108	     HitFlesh(0)=Sound'CreaturesSnd.Mech.mechimpactplayer'
00109	     HitFlesh(1)=Sound'CreaturesSnd.Mech.mechimpactplayer'
00110	     HitWood(0)=Sound'WeaponsSnd.ImpWood.impactwood05'
00111	     HitWood(1)=Sound'WeaponsSnd.ImpWood.impactwood06'
00112	     HitWood(2)=Sound'WeaponsSnd.ImpWood.impactwood17'
00113	     HitStone(0)=Sound'WeaponsSnd.ImpStone.impactstone05'
00114	     HitStone(1)=Sound'WeaponsSnd.ImpStone.impactstone03'
00115	     HitStone(2)=Sound'WeaponsSnd.ImpStone.impactstone15'
00116	     HitMetal(0)=Sound'WeaponsSnd.ImpMetal.impactmetal18'
00117	     HitMetal(1)=Sound'WeaponsSnd.ImpMetal.impactmetal12'
00118	     HitMetal(2)=Sound'WeaponsSnd.ImpMetal.impactmetal04'
00119	     HitDirt(0)=Sound'WeaponsSnd.ImpEarth.impactearth04'
00120	     HitDirt(1)=Sound'WeaponsSnd.ImpEarth.impactearth07'
00121	     HitDirt(2)=Sound'WeaponsSnd.ImpEarth.impactearth04'
00122	     HitShield=Sound'WeaponsSnd.Shields.shield10'
00123	     HitWeapon=Sound'WeaponsSnd.ImpMetal.impactmetal02'
00124	     HitBreakableWood=Sound'WeaponsSnd.ImpWood.impactwood05'
00125	     HitBreakableStone=Sound'WeaponsSnd.ImpStone.impactstone05'
00126	     SheathSound=Sound'WeaponsSnd.Stows.stow05'
00127	     UnsheathSound=Sound'WeaponsSnd.Stows.stow06'
00128	     PitchDeviation=0.000000
00129	     SwipeClass=Class'RuneI.WeaponSwipePurple'
00130	     DrawType=DT_SkeletalMesh
00131	     Skeletal=SkelModel'weapons.MechClaw'
00132	}

End Source Code