home *** CD-ROM | disk | FTP | other *** search
/ Superpower (Alt) / SUPERPOWER.iso / q / patch / mbq705 / abomb3.qcn < prev    next >
Encoding:
Text File  |  1996-08-06  |  1010 b   |  42 lines

  1. void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
  2.  
  3. void(entity inflictor, entity attacker, float damage, entity ignore) T_ABombDamage =
  4. {
  5.     local    float     points;
  6.     local    entity    head;
  7.     local    vector    org;
  8.  
  9.     head = findradius(inflictor.origin, damage+40);
  10.     
  11.     while (head)
  12.     {
  13.         if (head != ignore)
  14.         {
  15.             if (head.takedamage)
  16.             {
  17. /*                org = head.origin + (head.mins + head.maxs)*0.5;
  18.  *                points = 0.5*vlen (inflictor.origin - org);
  19.  *                if (points < 0)
  20.  *                    points = 0;
  21.  *                points = damage - points;
  22.  */
  23.                 points = damage;
  24.                 if (head == attacker)
  25.                     points = attacker.health - 1;
  26. //                    points = points * 0.5;
  27.                 if (points > 0)
  28.                 {
  29. //                    if (CanDamage (head, inflictor))
  30. //                    {       // don't kill oldone (might crash)
  31.                         if (head.classname == "monster_oldone")
  32.                             T_Damage (head, inflictor, attacker, 1);
  33.                         else
  34.                             T_Damage (head, inflictor, attacker, points);
  35. //                    }
  36.                 }
  37.             }
  38.         }
  39.         head = head.chain;
  40.     }
  41. };
  42.