void() DropMine =
{
	local entity    item;

	if (self.ammo_rockets < 10)
		{
                sprint (self,"Not enough rockets\n");                
		return;
		}

	self.ammo_rockets=self.ammo_rockets+-10;
	W_SetCurrentAmmo;
        sprint (self,"Leg it!\n");
	item = spawn();
	item.origin = self.origin - '0 0 24';
		
	item.flags = FL_ITEM;
	item.solid = SOLID_TRIGGER;
	item.movetype = MOVETYPE_TOSS;
	setmodel (item, "progs/backpack.mdl");
	setsize (item, '-16 -16 0', '16 16 56');
        item.owner=self; 
	item.nextthink = time + 2.5;    // remove after 2 minutes
	item.think = MineStart;
};
void()  MineStart=
{
sprint(self.owner,"Armed\n");
self.touch=MineTouch;
self.nextthink=time+300;
self.think=MineTouch;
};
void() MineTouch =
{
	if (other == self.owner)
		return;         // don't explode on owner
	sound (self, CHAN_WEAPON, "mine.wav", 1, ATTN_NORM);  // bounce sound
	self.touch=MineNull;
	self.nextthink = time + 0.5;
	self.think=MineExplode;
};
void() MineNull =
{
};
void() MineExplode =
{
	T_RadiusDamage (self, self.owner, 300, world);
	T_RadiusDamage (self, self.owner, 300, world);
	T_RadiusDamage (self, self.owner, 300, world);
	T_RadiusDamage (self, self.owner, 300, world);
	WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
	WriteByte (MSG_BROADCAST, TE_EXPLOSION);
	WriteCoord (MSG_BROADCAST, self.origin_x);
	WriteCoord (MSG_BROADCAST, self.origin_y);
	WriteCoord (MSG_BROADCAST, self.origin_z);
	BecomeExplosion ();
};
