//=============================================================================
// Chest.
//=============================================================================
class Chest expands Decoration;

#exec MESH IMPORT MESH=Chest ANIVFILE=MODELS\chest_a.3D DATAFILE=MODELS\chest_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=Chest X=0 Y=0 Z=16 YAW=64
#exec MESH SEQUENCE MESH=Chest SEQ=All    STARTFRAME=0   NUMFRAMES=1
#exec MESH SEQUENCE MESH=Chest SEQ=Still  STARTFRAME=0   NUMFRAMES=1
#exec TEXTURE IMPORT NAME=JChest1 FILE=MODELS\chest.PCX GROUP=Skins
#exec MESHMAP SCALE MESHMAP=Chest X=0.05 Y=0.05 Z=0.10
#exec MESHMAP SETTEXTURE MESHMAP=Chest NUM=1 TEXTURE=JChest1  

var() int Health;
var() int FragChunks;
var() Float Fragsize;


Auto State Still
{
	function HitWall (vector HitNormal, actor Wall)
	{
		SetPhysics(PHYS_None);	
		bBounce = False;
	}

	function Damage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
						Vector momentum, name damageType)
	{
		Instigator = InstigatedBy;
		bBobbing = false;	
		if (Health<0) Return;
		Health -= NDamage;
		if (Health <0) 	
		{
			Frag(class'WoodFragments',Momentum,FragSize,FragChunks);		

		}
		else {
			SetPhysics(PHYS_Falling);
			bBounce = True;
			Momentum.Z = 1000;
			Velocity=Momentum*0.016;
		}
	}
Begin:
}

