//=============================================================================
// SacredCow.
//=============================================================================
class SacredCow expands Cow;

#exec TEXTURE IMPORT NAME=JCow2 FILE=MODELS\NaliCow2.PCX GROUP=Skins 

function eAttitude AttitudeTo(Pawn Other)
{
	if ( Other.IsA('Cow') )
		return ATTITUDE_Friendly;
	else if ( Other.Team != Team )
		return ATTITUDE_Fear;
	else if ( Hated == Other )
		return ATTITUDE_Fear;
	else
		return ATTITUDE_Friendly;
}

function Grow()
{
	local float OldRad, OldHeight;

	Health = FMin(200, Health + 15);
	Mass = FMin(200, Mass + 10);
	if ( CollisionRadius < 48 )
	{
		OldRad = CollisionRadius;
		OldHeight = CollisionHeight;
		SetCollisionSize( FMin(CollisionRadius *1.1, 72), FMin(CollisionHeight * 1.1, 48) );
		if ( !SetLocation(Location) )
			SetCollisionSize(OldRad, OldHeight);
		else
		{
			DrawScale = FMin(1.50, DrawScale * 1.1);
			GroundSpeed = Default.GroundSpeed * DrawScale;
		}
	} 
}

function Carcass SpawnCarcass()
{
	local carcass carc;
	carc = CallParent.SpawnCarcass();
	if ( SacredCowCarcass(carc) != None )
		SacredCowCarcass(carc).team = team;
	else if ( Level.Game.IsA('KilltheCowGame') )
		KilltheCowGame(Level.Game).AddTeamCow(Team);
		
	return carc;
}
