RuneI
Class SarkClaw

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

class SarkClaw
extends RuneI.InvisibleWeapon

//============================================================================= // SarkClaw. //=============================================================================

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	// SarkClaw.
00003	//=============================================================================
00004	class SarkClaw 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=30
00091	     DamageType=Sever
00092	     ThroughAir(0)=Sound'WeaponsSnd.Swings.swing02'
00093	     HitFlesh(0)=Sound'WeaponsSnd.ImpFlesh.impfleshaxe01'
00094	     HitWood(0)=Sound'WeaponsSnd.ImpWood.impactwood06'
00095	     HitStone(0)=Sound'WeaponsSnd.ImpStone.impactstone05'
00096	     HitMetal(0)=Sound'WeaponsSnd.ImpMetal.impactcombo02'
00097	     HitDirt(0)=Sound'WeaponsSnd.ImpEarth.impactearth05'
00098	     HitShield=Sound'WeaponsSnd.Shields.shield15'
00099	     HitWeapon=Sound'WeaponsSnd.Swords.sword15'
00100	     HitBreakableWood=Sound'WeaponsSnd.ImpWood.impactwood12'
00101	     HitBreakableStone=Sound'WeaponsSnd.ImpStone.impactstone13'
00102	     SwipeClass=Class'RuneI.WeaponSwipePurple'
00103	     A_Idle=weapon1_idle
00104	     A_Forward=S1_Walk
00105	     A_Backward=weapon1_backup
00106	     A_Forward45Right=S1_Walk45Right
00107	     A_Forward45Left=S1_Walk45Left
00108	     A_Backward45Right=weapon1_backup45Right
00109	     A_Backward45Left=weapon1_backup45Left
00110	     A_StrafeRight=StrafeRight
00111	     A_StrafeLeft=StrafeLeft
00112	     A_AttackA=S1_attackA
00113	     A_AttackAReturn=S1_attackAreturn
00114	     A_AttackB=S1_attackB
00115	     A_AttackBReturn=S1_attackBreturn
00116	     A_AttackStandA=S1_StandingAttackA
00117	     A_AttackStandAReturn=S1_StandingAttackAReturn
00118	     A_AttackStandB=S1_StandingAttackB
00119	     A_AttackStandBReturn=S1_StandingAttackBReturn
00120	     A_PainFront=S1_painFront
00121	     A_PainRight=S1_painBack
00122	     DrawType=DT_SkeletalMesh
00123	     Skeletal=SkelModel'weapons.InvisibleShort'
00124	}

End Source Code