void() FakeBackpack =
{
	local entity	item;

	item = spawn();
        item.origin = self.origin + '40 40 -24';
	item.velocity_z = 300;
        item.velocity_x = -100 + (random() * 200);
        item.velocity_y = -100 + (random() * 200);
	item.flags = FL_ITEM;
        item.solid = SOLID_SLIDEBOX;
        item.movetype = MOVETYPE_TOSS;
	setmodel (item, "progs/backpack.mdl");
	setsize (item, '-16 -16 0', '16 16 56');
        item.touch = FakeBackpackTouch;
	item.nextthink = time + 120;	// remove after 2 minutes
	item.think = SUB_Remove;
};

void() feign =
{
        if ( !(self.flags & FL_ISFEIGN) )              // If not already, feign death
        {
                player_feigna1 ();      // death animation
                FakeBackpack();         // throw fake backpack
                setsize (self , '-16 -16 -4' , '16 16 4');      // change bounding box so you're shorter
                self.view_ofs = '0 0 2';        // put view near ground
                DeathSound();           // yell like you're dying
                self.oldweapon = self.weapon;   
                self.weapon = 0;
                self.oldweaponmodel = self.weaponmodel;
                self.weaponmodel = "";
                self.movetype = MOVETYPE_TOSS;
                self.flags = self.flags | FL_ISFEIGN;
        }
        else                    // otherwise, get up
        {
                self.movetype = MOVETYPE_WALK;
                setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
                self.view_ofs = '0 0 22';
                self.weaponmodel = self.oldweaponmodel;
                self.weapon = self.oldweapon;
                self.oldweapon = 0;
                self.flags = self.flags - (self.flags & FL_ISFEIGN);
                player_upa1();
        }
};
