home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / xtrawp19 / jasubs.qc < prev    next >
Encoding:
Text File  |  1996-08-09  |  834 b   |  35 lines

  1. void(entity inflictor, entity attacker, float damage, entity ignore, float radius) T_NewRadiusDamage =
  2. {
  3.     local    float     points;
  4.     local    entity    head;
  5.     local    vector    org;
  6.  
  7.     head = findradius(inflictor.origin, radius);
  8.     
  9.     while (head)
  10.     {
  11.         if (head != ignore)
  12.         {
  13.             if (head.takedamage)
  14.             {
  15.                 org = head.origin + (head.mins + head.maxs)*0.5;
  16.                 points = 0.5*vlen (inflictor.origin - org);
  17.                 if (points < 0)
  18.                     points = 0;
  19.                 points = damage - points;
  20.                 if (points > 0)
  21.                 {
  22.                     if (CanDamage (head, inflictor))
  23.                     {    // shambler takes half damage from all explosions
  24.                         if (head.classname == "monster_shambler")                        
  25.                             T_Damage (head, inflictor, attacker, points*0.5);
  26.                         else
  27.                             T_Damage (head, inflictor, attacker, points);
  28.                     }
  29.                 }
  30.             }
  31.         }
  32.         head = head.chain;
  33.     }
  34. };
  35.