game-source/ParoxysmII/source/nq/targid.qc
Jeff Teunissen 5b81f01e3b Okay, this is the first import of my recovered (thanks, Despair!) PoxII tree.
It works, and is playable, but you need to symlink source/config.qw to
source/config.qw -- otherwise it won't build a qwprogs.dat for you. :)
2003-10-22 09:24:50 +00:00

46 lines
1.1 KiB
C++

// POX - v1.1 target identifier ala Quake3 - displays the name of players who cross your sight
// by Frank Condello (POX) - http://www.planetquake.com/paroxysm/ - pox@planetquake.com
// requires visible float return from ai.qc
// Short and sweet....
void() ID_CheckTarget =
{
local vector org;
local entity spot;
//Lost target, or target died
if (self.target_id_same < time || self.last_target_id.health < 1 || !visible(self.last_target_id))
self.last_target_id = world;
traceline (self.origin , (self.origin+(v_forward * 800)) , FALSE , self);
org = trace_endpos;
spot = findradius(org, 200);
while (spot)
{
if ((spot.classname == "player") && spot.takedamage)
{
//Same target as last time
if (self.target_id_same > time && spot == self.last_target_id)
{
self.target_id_finished = time + 1.3;
self.target_id_same = time + 3;
return;
}
else if (spot != self && visible (spot) )//Found new Target
{
self.last_target_id = spot;
self.target_id_finished = time + 1.5;
self.target_id_same = time + 3;
centerprint (self, self.last_target_id.netname);
return;
}
}
spot = spot.chain;
}
};