RuneI
Class Drum

source: c:\runehov\RuneI\Classes\Drum.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Decoration
         |
         +--RuneI.DecorationRune
            |
            +--RuneI.Instrument
               |
               +--RuneI.Drum
Direct Known Subclasses:Drum1, Drum2, DrumSide

class Drum
extends RuneI.Instrument

//============================================================================= // Drum. //=============================================================================
Variables
 float LastPlayed


Function Summary
 void AddVelocity(vector NewVelocity)
 bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
 
simulated
JointTouchedBy(Actor Other, int joint)
     
/*
 void PlayInstrument(Actor Musician)
 void Trigger(Actor Other, Pawn EventInstigator)
 bool UseTrigger(Actor Other)



Source Code


00001	//=============================================================================
00002	// Drum.
00003	//=============================================================================
00004	class Drum expands Instrument
00005		abstract;
00006	
00007	var(Sounds) Sound HitDrum;
00008	var float LastPlayed;
00009	
00010	simulated event GetSpringJointParms(int joint, out float DampFactor, out float SpringConstant, out vector SpringThreshold)
00011	{
00012		DampFactor = 10;
00013		SpringConstant = 3000;
00014		SpringThreshold = vect(0,0,5);
00015	}
00016	
00017	function PlayInstrument(actor Musician)
00018	{
00019		Super.PlayInstrument(Musician);
00020	
00021		if (Level.TimeSeconds - LastPlayed > 0.5)
00022		{
00023			LastPlayed = Level.TimeSeconds;
00024			PlaySound(HitDrum, SLOT_Misc,,,, FRand()*0.5 + 0.8);
00025		}
00026	}
00027	
00028	function AddVelocity(vector NewVelocity)
00029	{	// Blast radius has no effect
00030	}
00031	
00032	function Trigger(actor Other, pawn EventInstigator)
00033	{
00034		Super.Trigger(Other, EventInstigator);
00035		ApplyJointForce(JointNamed('drum'), vect(0,0,-50));
00036	}
00037	
00038	function bool UseTrigger(actor Other)
00039	{
00040		ApplyJointForce(JointNamed('drum'), vect(0,0,-50));
00041		return Super.UseTrigger(Other);
00042	}
00043	
00044	function bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
00045	{
00046		if (DamageType == 'fire')
00047			return Super.JointDamaged(Damage, EventInstigator, HitLoc, Momentum, DamageType, joint);
00048	
00049		ApplyJointForce(JointNamed('drum'), Momentum*0.1);
00050		PlayInstrument(EventInstigator);
00051		return false;
00052	}
00053	
00054	/*
00055	simulated function JointTouchedBy(actor Other, int joint)
00056	{
00057		local vector vel;
00058		vel = Other.Velocity*0.5;
00059		ApplyJointForce(joint, vel);
00060		PlayInstrument(Other);
00061	}
00062	*/
00063	
00064	defaultproperties
00065	{
00066	     bBurnable=True
00067	     bStatic=False
00068	     DrawType=DT_SkeletalMesh
00069	     DrawScale=1.280000
00070	     LODCurve=LOD_CURVE_NONE
00071	     CollisionRadius=38.000000
00072	     CollisionHeight=18.000000
00073	     bCollideActors=True
00074	     bCollideWorld=True
00075	     bBlockActors=True
00076	     bBlockPlayers=True
00077	     bJointsTouch=True
00078	     Skeletal=SkelModel'objects.Drum'
00079	}

End Source Code