home *** CD-ROM | disk | FTP | other *** search
/ Superpower (Alt) / SUPERPOWER.iso / q / patch / mbq705 / abomb3.qc < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.9 KB  |  67 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. /* experimental code... */
  34.                         else if (head.classname == "player")
  35.                         {
  36.                             T_Damage (head, inflictor, attacker, points);
  37.                             stuffcmd (head, "gamma 0.01\n");
  38.                             stuffcmd (head, "wait\n");
  39.                             stuffcmd (head, "gamma 0.03\n");
  40.                             stuffcmd (head, "wait\n");
  41.                             stuffcmd (head, "gamma 0.05\n");
  42.                             stuffcmd (head, "wait\n");
  43.                             stuffcmd (head, "gamma 0.1\n");
  44.                             stuffcmd (head, "wait\n");
  45.                             stuffcmd (head, "gamma 0.2\n");
  46.                             stuffcmd (head, "wait\n");
  47.                             stuffcmd (head, "gamma 0.3\n");
  48.                             stuffcmd (head, "wait\n");
  49.                             stuffcmd (head, "gamma 0.4\n");
  50.                             stuffcmd (head, "wait\n");
  51.                             stuffcmd (head, "gamma 0.5\n");
  52.                             stuffcmd (head, "wait\n");
  53.                             stuffcmd (head, "gamma 0.6\n");
  54.                             stuffcmd (head, "wait\n");
  55.                             stuffcmd (head, "gamma 0.7\n");
  56.                         }
  57. /* end of experimental code */
  58.                         else
  59.                             T_Damage (head, inflictor, attacker, points);
  60. //                    }
  61.                 }
  62.             }
  63.         }
  64.         head = head.chain;
  65.     }
  66. };
  67.