home *** CD-ROM | disk | FTP | other *** search
- void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
-
- void(entity inflictor, entity attacker, float damage, entity ignore) T_ABombDamage =
- {
- local float points;
- local entity head;
- local vector org;
-
- head = findradius(inflictor.origin, damage+40);
-
- while (head)
- {
- if (head != ignore)
- {
- if (head.takedamage)
- {
- /* org = head.origin + (head.mins + head.maxs)*0.5;
- * points = 0.5*vlen (inflictor.origin - org);
- * if (points < 0)
- * points = 0;
- * points = damage - points;
- */
- points = damage;
- if (head == attacker)
- points = attacker.health - 1;
- // points = points * 0.5;
- if (points > 0)
- {
- // if (CanDamage (head, inflictor))
- // { // don't kill oldone (might crash)
- if (head.classname == "monster_oldone")
- T_Damage (head, inflictor, attacker, 1);
- /* experimental code... */
- else if (head.classname == "player")
- {
- T_Damage (head, inflictor, attacker, points);
- stuffcmd (head, "gamma 0.01\n");
- stuffcmd (head, "wait\n");
- stuffcmd (head, "gamma 0.03\n");
- stuffcmd (head, "wait\n");
- stuffcmd (head, "gamma 0.05\n");
- stuffcmd (head, "wait\n");
- stuffcmd (head, "gamma 0.1\n");
- stuffcmd (head, "wait\n");
- stuffcmd (head, "gamma 0.2\n");
- stuffcmd (head, "wait\n");
- stuffcmd (head, "gamma 0.3\n");
- stuffcmd (head, "wait\n");
- stuffcmd (head, "gamma 0.4\n");
- stuffcmd (head, "wait\n");
- stuffcmd (head, "gamma 0.5\n");
- stuffcmd (head, "wait\n");
- stuffcmd (head, "gamma 0.6\n");
- stuffcmd (head, "wait\n");
- stuffcmd (head, "gamma 0.7\n");
- }
- /* end of experimental code */
- else
- T_Damage (head, inflictor, attacker, points);
- // }
- }
- }
- }
- head = head.chain;
- }
- };
-