//=============================================================================
// Barrel.
//=============================================================================
class Barrel expands Decoration;

#exec MESH IMPORT MESH=Barrel ANIVFILE=MODELS\Barrel_a.3D DATAFILE=MODELS\Barrel_d.3D ZEROTEX=1
#exec MESH ORIGIN MESH=Barrel X=320 Y=160 Z=95 YAW=64
#exec MESH SEQUENCE MESH=Barrel SEQ=All    STARTFRAME=0   NUMFRAMES=1
#exec MESH SEQUENCE MESH=Barrel SEQ=Still  STARTFRAME=0   NUMFRAMES=1
#exec TEXTURE IMPORT NAME=JBarrel1 FILE=MODELS\Barrel.PCX GROUP=Skins FLAGS=2
#exec MESHMAP SCALE MESHMAP=Barrel X=0.15 Y=0.15 Z=0.3
#exec MESHMAP SETTEXTURE MESHMAP=Barrel NUM=0 TEXTURE=JBarrel1


var() int Health;

Auto State Animate
{
	function HitWall (vector HitNormal, actor Wall)
	{
		if (Velocity.Z<-200) Damage(100,Pawn(Owner),HitNormal,HitNormal*10000,'shattered');	
		bBounce = False;
		Velocity = vect(0,0,0);
	}


	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,1.75,12);		
		else 
		{
			SetPhysics(PHYS_Falling);
			bBounce = True;
			Momentum.Z = 1000;
			Velocity=Momentum*0.01;
		}
	}

Begin:
}

