prozac-qfcc/ctf.qc

82 lines
1.8 KiB
C++
Raw Normal View History

#include "defs.qh"
2001-07-17 05:58:10 +00:00
/*
TeamFortress 1.38 - 11/12/96
TeamFortress Software
Functions for CTF Support
*/
// Functions in this file
void() TeamFortress_CTF_FlagInfo;
//=========================================================================
// Display the whereabouts of the flags
void() TeamFortress_CTF_FlagInfo =
{
local entity te;
// Flag 1
te = Finditem(CTF_FLAG1);
if (te.goal_state == TFGS_ACTIVE)
2001-07-17 05:58:10 +00:00
{
if (self == te.owner)
{
sprint(self, PRINT_HIGH, "You have the enemy flag. ");
2001-07-17 05:58:10 +00:00
}
else
{
sprint(self, PRINT_HIGH, te.owner.netname);
sprint(self, PRINT_HIGH, " has");
2001-07-17 05:58:10 +00:00
if (self.team_no == 1)
sprint(self, PRINT_HIGH, " your flag. ");
2001-07-17 05:58:10 +00:00
else
sprint(self, PRINT_HIGH, " the enemy flag. ");
2001-07-17 05:58:10 +00:00
}
}
else if (te.origin != te.oldorigin)
{
if (self.team_no == 1)
sprint(self, PRINT_HIGH, "Your flag is lying about. ");
2001-07-17 05:58:10 +00:00
else
sprint(self, PRINT_HIGH, "The enemy flag is lying about. ");
2001-07-17 05:58:10 +00:00
}
else
{
if (self.team_no == 1)
sprint(self, PRINT_HIGH, "Your flag is in your base. ");
2001-07-17 05:58:10 +00:00
else
sprint(self, PRINT_HIGH, "The enemy flag is in their base. ");
2001-07-17 05:58:10 +00:00
}
// Flag 2
te = Finditem(CTF_FLAG2);
if (te.goal_state == TFGS_ACTIVE)
2001-07-17 05:58:10 +00:00
{
if (self == te.owner)
sprint(self, PRINT_HIGH, "You have the enemy flag.\n");
2001-07-17 05:58:10 +00:00
else
{
sprint(self, PRINT_HIGH, te.owner.netname);
sprint(self, PRINT_HIGH, " has");
2001-07-17 05:58:10 +00:00
if (self.team_no == 2)
sprint(self, PRINT_HIGH, " your flag.\n");
2001-07-17 05:58:10 +00:00
else
sprint(self, PRINT_HIGH, " the enemy flag.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (te.origin != te.oldorigin)
{
if (self.team_no == 2)
sprint(self, PRINT_HIGH, "Your flag is lying about.\n");
2001-07-17 05:58:10 +00:00
else
sprint(self, PRINT_HIGH, "The enemy flag is lying about.\n");
2001-07-17 05:58:10 +00:00
}
else
{
if (self.team_no == 2)
sprint(self, PRINT_HIGH, "Your flag is in your base.\n");
2001-07-17 05:58:10 +00:00
else
sprint(self, PRINT_HIGH, "The enemy flag is in their base.\n");
2001-07-17 05:58:10 +00:00
}
};