mirror of
https://git.code.sf.net/p/quake/game-source
synced 2024-11-14 00:11:00 +00:00
5b81f01e3b
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. :)
46 lines
1.1 KiB
C++
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;
|
|
|
|
}
|
|
|
|
};
|