home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / sgqcver2 / feign.qc < prev    next >
Encoding:
Text File  |  1996-08-17  |  1.8 KB  |  48 lines

  1. void() FakeBackpack =
  2. {
  3.     local entity    item;
  4.  
  5.     item = spawn();
  6.         item.origin = self.origin + '40 40 -24';
  7.     item.velocity_z = 300;
  8.         item.velocity_x = -100 + (random() * 200);
  9.         item.velocity_y = -100 + (random() * 200);
  10.     item.flags = FL_ITEM;
  11.         item.solid = SOLID_SLIDEBOX;
  12.         item.movetype = MOVETYPE_TOSS;
  13.     setmodel (item, "progs/backpack.mdl");
  14.     setsize (item, '-16 -16 0', '16 16 56');
  15.         item.touch = FakeBackpackTouch;
  16.     item.nextthink = time + 120;    // remove after 2 minutes
  17.     item.think = SUB_Remove;
  18. };
  19.  
  20. void() feign =
  21. {
  22.         if ( !(self.flags & FL_ISFEIGN) )              // If not already, feign death
  23.         {
  24.                 player_feigna1 ();      // death animation
  25.                 FakeBackpack();         // throw fake backpack
  26.                 setsize (self , '-16 -16 -4' , '16 16 4');      // change bounding box so you're shorter
  27.                 self.view_ofs = '0 0 2';        // put view near ground
  28.                 DeathSound();           // yell like you're dying
  29.                 self.oldweapon = self.weapon;   
  30.                 self.weapon = 0;
  31.                 self.oldweaponmodel = self.weaponmodel;
  32.                 self.weaponmodel = "";
  33.                 self.movetype = MOVETYPE_TOSS;
  34.                 self.flags = self.flags | FL_ISFEIGN;
  35.         }
  36.         else                    // otherwise, get up
  37.         {
  38.                 self.movetype = MOVETYPE_WALK;
  39.                 setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
  40.                 self.view_ofs = '0 0 22';
  41.                 self.weaponmodel = self.oldweaponmodel;
  42.                 self.weapon = self.oldweapon;
  43.                 self.oldweapon = 0;
  44.                 self.flags = self.flags - (self.flags & FL_ISFEIGN);
  45.                 player_upa1();
  46.         }
  47. };
  48.