home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / eatgibs / eatgibs.pat next >
Encoding:
Text File  |  1996-08-06  |  3.2 KB  |  111 lines

  1. diff -ur --new-file v101qc/items.qc eatgibs/items.qc
  2. --- v101qc/items.qc     Wed Jul 24 23:51:22 1996
  3. +++ eatgibs/items.qc    Tue Aug  6 20:07:44 1996
  4. @@ -1338,3 +1338,55 @@
  5.      item.nextthink = time + 120;    // remove after 2 minutes
  6.      item.think = SUB_Remove;
  7.  };
  8. +
  9. +void() EatGibs =
  10. +{
  11. +// only a player can pick it up
  12. +        if (other.classname != "player")
  13. +        return;
  14. +    if (other.health <= 0)
  15. +        return;
  16. +// only eat gibs if desparate
  17. +        if (other.health >= 50)
  18. +                return;
  19. +
  20. +// heal a random amount of 10% health
  21. +        if (!T_Heal(other, random() * 10, 0))
  22. +                return;
  23. +
  24. +        sprint(other, "Yummy gibs!\n");
  25. +
  26. +// gibs touch sound
  27. +    sound(other, CHAN_ITEM, "zombie/z_miss.wav", 1, ATTN_NORM);
  28. +
  29. +        stuffcmd (other, "bf\n");
  30. +
  31. +        remove (self);
  32. +
  33. +};
  34. +
  35. +void() EatHead =
  36. +{
  37. +// only a player can pick it up
  38. +        if (other.classname != "player")
  39. +        return;
  40. +    if (other.health <= 0)
  41. +        return;
  42. +// only eat head if desparate
  43. +        if (other.health >= 50)
  44. +                return;
  45. +
  46. +// heal 15%
  47. +        if (!T_Heal(other, 15, 0))
  48. +                return;
  49. +
  50. +        sprint(other, "Tasty brains!\n");
  51. +
  52. +// head touch sound
  53. +        sound(other, CHAN_ITEM, "demon/dhit2.wav", 1, ATTN_NORM);
  54. +
  55. +        stuffcmd (other, "bf\n");
  56. +
  57. +        remove (self);
  58. +
  59. +};
  60. diff -ur --new-file v101qc/player.qc eatgibs/player.qc
  61. --- v101qc/player.qc    Wed Jul 24 23:51:22 1996
  62. +++ eatgibs/player.qc    Tue Aug  6 16:48:50 1996
  63. @@ -466,7 +466,7 @@
  64.      setsize (new, '0 0 0', '0 0 0');
  65.      new.velocity = VelocityForDamage (dm);
  66.      new.movetype = MOVETYPE_BOUNCE;
  67. -    new.solid = SOLID_NOT;
  68. +        new.solid = SOLID_TRIGGER;
  69.      new.avelocity_x = random()*600;
  70.      new.avelocity_y = random()*600;
  71.      new.avelocity_z = random()*600;
  72. @@ -475,6 +475,7 @@
  73.      new.nextthink = time + 10 + random()*10;
  74.      new.frame = 0;
  75.      new.flags = 0;
  76. +        new.touch = EatGibs;
  77.  };
  78.  
  79.  void(string gibname, float dm) ThrowHead =
  80. @@ -484,13 +485,14 @@
  81.      self.nextthink = -1;
  82.      self.movetype = MOVETYPE_BOUNCE;
  83.      self.takedamage = DAMAGE_NO;
  84. -    self.solid = SOLID_NOT;
  85. +        self.solid = SOLID_TRIGGER;
  86.      self.view_ofs = '0 0 8';
  87.      setsize (self, '-16 -16 0', '16 16 56');
  88.      self.velocity = VelocityForDamage (dm);
  89.      self.origin_z = self.origin_z - 24;
  90.      self.flags = self.flags - (self.flags & FL_ONGROUND);
  91.      self.avelocity = crandom() * '0 600 0';
  92. +        self.touch = EatHead;
  93.  };
  94.  
  95.  
  96. diff -ur --new-file v101qc/world.qc eatgibs/world.qc
  97. --- v101qc/world.qc     Wed Jul 24 23:51:24 1996
  98. +++ eatgibs/world.qc    Tue Aug  6 20:10:30 1996
  99. @@ -190,7 +190,10 @@
  100.      precache_sound ("misc/h2ohit1.wav");        // landing splash
  101.  
  102.  // setup precaches allways needed
  103. -    precache_sound ("items/itembk2.wav");        // item respawn sound
  104. +        precache_sound ("demon/dhit2.wav");             // for eatin' heads
  105. +        precache_sound ("zombie/z_miss.wav");           // for eatin' gibs
  106. +
  107. +        precache_sound ("items/itembk2.wav");           // item respawn sound
  108.      precache_sound ("player/plyrjmp8.wav");        // player jump
  109.      precache_sound ("player/land.wav");            // player landing
  110.      precache_sound ("player/land2.wav");        // player hurt landing
  111.