RuneI
Class Gong

source: c:\runehov\RuneI\Classes\Gong.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Decoration
         |
         +--RuneI.DecorationRune
            |
            +--RuneI.Instrument
               |
               +--RuneI.Gong
Direct Known Subclasses:None

class Gong
extends RuneI.Instrument

//============================================================================= // Gong. //=============================================================================

Function Summary
 name GetUseAnim()
     
//============================================================================
//
// GetUseAnim
//
// Returns the animation that the player (or a viking) should play when
// this item is 'used'. 
//============================================================================
 bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
 
simulated
JointTouchedBy(Actor Other, int joint)
 void PlayInstrument(Actor Musician)
 bool UseTrigger(Actor Other)
     
//============================================================================
//
// UseTrigger
//
//============================================================================



Source Code


00001	//=============================================================================
00002	// Gong.
00003	//=============================================================================
00004	class Gong expands Instrument;
00005	
00006	
00007	var(Sounds) Sound HitGong;
00008	
00009	
00010	simulated event GetAccelJointParms(int joint, out float DampFactor, out float RotThreshold)
00011	{
00012		DampFactor = 0.025;
00013		RotThreshold = 2000;
00014	}
00015	
00016	simulated event float GetAccelJointMagnitude(int joint)
00017	{
00018		return 10000;
00019	}
00020	
00021	function PlayInstrument(actor Musician)
00022	{
00023		Super.PlayInstrument(Musician);
00024		PlaySound(HitGong, SLOT_Misc,,,, FRand()*0.5 + 0.8);
00025	}
00026	
00027	function bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
00028	{
00029		local vector vel;
00030	
00031		vel = Momentum * 0.05;
00032		ApplyJointForce(3, vel);
00033	
00034		PlayInstrument(EventInstigator);
00035	
00036		return false;
00037	}
00038	
00039	simulated function JointTouchedBy(actor Other, int joint)
00040	{
00041		local vector vel;
00042	
00043		if (joint == 3)
00044		{
00045			vel = Other.Velocity * 0.25;
00046			ApplyJointForce(joint, vel);
00047		}
00048	}
00049	
00050	//============================================================================
00051	//
00052	// GetUseAnim
00053	//
00054	// Returns the animation that the player (or a viking) should play when
00055	// this item is 'used'. 
00056	//============================================================================
00057	
00058	function name GetUseAnim()
00059	{
00060		return('Neutral_kick'); // TEMP:  Using neutral_kick until we have proper instrument anims
00061	}
00062	
00063	//============================================================================
00064	//
00065	// UseTrigger
00066	//
00067	//============================================================================
00068	
00069	function bool UseTrigger(actor Other)
00070	{
00071		local vector v;
00072	
00073		v = Other.Location - Location;
00074	
00075		ApplyJointForce(3, v * 2);
00076		PlayInstrument(Other);
00077		return true;
00078	}
00079	
00080	defaultproperties
00081	{
00082	     HitGong=Sound'OtherSnd.Instruments.gong03'
00083	     bStatic=False
00084	     DrawType=DT_SkeletalMesh
00085	     CollisionRadius=55.000000
00086	     CollisionHeight=61.000000
00087	     bCollideActors=True
00088	     bCollideWorld=True
00089	     bBlockActors=True
00090	     bBlockPlayers=True
00091	     bJointsBlock=True
00092	     bJointsTouch=True
00093	     Skeletal=SkelModel'objects.Gong'
00094	}

End Source Code