Пример #1
0
GLOBAL void TP_Msg_Point_f (void)
{
	extern cvar_t tp_name_quad, tp_name_pent, tp_name_ring, tp_name_lg, tp_name_rl, tp_name_gl, tp_name_sng, tp_name_backpack,
		tp_name_ra, tp_name_ya, tp_name_ga, tp_name_cells, tp_name_rockets, tp_name_nails, tp_name_shells, tp_name_mh,
		tp_name_flag, tp_name_disp,	tp_name_sentry, tp_name_rune1, tp_name_rune2, tp_name_rune3, tp_name_rune4, tp_name_teammate, tp_name_enemy;
	MSGPART point = "";	
	MSGPART at_location = "at $[{%y}$] {%E}";
	MSGPART enemy = "";
	MSGPART powerup = "";
 
    if (flashed) // for teamfortres.
			return;

    TP_FindPoint();

	if (POINT_EMPTY())
		return;
	else if (INPOINT(eyes) || INPOINT(quaded) || INPOINT (pented)) {
		TP_Msg_EnemyPowerup_f(); // we use tp_enemypwr because it checks for all cases of player + powerup =)
		return;
	}

	// if you see something other than a player with powerup
	if (INPOINT(enemy))	{
		point = "{%E}";
		enemy = tp_name_enemy.string;
		at_location = " at $[{%y}$]"; // here we change at_location (remove {%E} at the end) because our point says how many enemies we have.
	}
	else if (INPOINT(teammate))	{
		if (tp_name_teammate.string[0]) // This will print the nick of your teammate if tp_name_teammate "" (not set). Else, it will print the value for tp_name_teammate
			point = tp_name_teammate.string;
		else
			point = va ("{&c0b0%s&cfff}", Macro_PointName());
	}
	else if (INPOINTPOWERUP() || INPOINTWEAPON() || INPOINTARMOR() || INPOINTAMMO() || INPOINT(pack) || INPOINT(mh) || INPOINT(flag) || INPOINT (disp) || INPOINT(sentry) || INPOINT(runes)) {
		if		(INPOINT(quad))		point = tp_name_quad.string;
		else if (INPOINT(pent))		point = tp_name_pent.string;
		else if (INPOINT(ring))		point = tp_name_ring.string;
		
		else if (INPOINT(rl))		point = tp_name_rl.string;
		else if (INPOINT(lg))		point = tp_name_lg.string;
		else if (INPOINT(gl))		point = tp_name_gl.string;
		else if (INPOINT(sng))		point = tp_name_sng.string;
		else if (INPOINT(pack))		point = tp_name_backpack.string;
		
		else if (INPOINT(ra))		point = tp_name_ra.string;
		else if (INPOINT(ya))		point = tp_name_ya.string;
		else if (INPOINT(ga))		point = tp_name_ga.string;
		
		else if (INPOINT(rockets)) 	point = tp_name_rockets.string;
		else if (INPOINT(cells)) 	point = tp_name_cells.string;
		else if (INPOINT(nails)) 	point = tp_name_nails.string;
		else if (INPOINT(shells)) 	point = tp_name_shells.string;
		
		else if (INPOINT(mh))		point = tp_name_mh.string;
		
		//TF. Note we can't tell whether they are enemy or team flag/disp/sent
		else if (INPOINT(flag))		point = tp_name_flag.string;
		else if (INPOINT(disp))		point = tp_name_disp.string;
		else if (INPOINT(sentry))	point = tp_name_sentry.string;
		
		//ctf, other
		else if (INPOINT(rune1))	point = tp_name_rune1.string;
		else if (INPOINT(rune2))	point = tp_name_rune2.string;
		else if (INPOINT(rune3))	point = tp_name_rune3.string;
		else if (INPOINT(rune4))	point = tp_name_rune4.string;
	}
	else point = "{$point}"; // this should never happen

	TP_Send_TeamSay("%s%s %s%s", powerup, point, enemy, at_location);
}
Пример #2
0
GLOBAL void TP_Msg_Point_f (void)
{
	MSGPART point = "";
	MSGPART at_location = "";
	MSGPART powerup = "";
 
    if (flashed) return;
    TP_FindPoint();

	if (POINT_EMPTY())
		return;
	else if (INPOINT(eyes) || INPOINT(quaded) || INPOINT (pented)) // anyone with powerup
	{
		TP_Msg_EnemyPowerup_f(); // we use tp_enemypwr because it checks for all cases of player + powerup =)
		return;
	}
	else
	{
		at_location = "at $[{%y}$] %E"; // this has to be established at the beginning because it's the same for all cases except when you see enemy.
	
		if (INPOINT(enemy))
		{
			point = "%E " tp_ib_name_enemy;
			at_location = "at $[{%y}$]"; // here we change at_location because our point says how many enemies we have.
		}
		else if (INPOINT(teammate))
		{
			if (tp_name_teammate.string[0])
				point = tp_ib_name_teammate;
			else
				point = va ("{&c0b0%s&cfff}", Macro_PointName());
		}
		else if (INPOINTPOWERUP() || INPOINTWEAPON() || INPOINTARMOR() || INPOINTAMMO() || INPOINT(pack) || INPOINT(mh) || INPOINT(flag) || INPOINT (disp) || INPOINT(sentry) || INPOINT(runes)) // How can I do if INPONIT(anything) or if INPOINT() not empty?
		//  flag, disp, sent, rune
		{
			if (INPOINT(quad))			point = tp_ib_name_quad;
			else if (INPOINT(pent))		point = tp_ib_name_pent;
			else if (INPOINT(ring))		point = tp_ib_name_ring;
			
			else if (INPOINT(rl))		point = tp_ib_name_rl;
			else if (INPOINT(lg))		point = tp_ib_name_lg;
			else if (INPOINT(gl))		point = tp_ib_name_gl;
			else if (INPOINT(sng))		point = tp_ib_name_sng;
			else if (INPOINT(pack))		point = tp_ib_name_backpack;
			
			else if (INPOINT(ra))		point = tp_ib_name_ra;
			else if (INPOINT(ya))		point = tp_ib_name_ya;
			else if (INPOINT(ga))		point = tp_ib_name_ga;
			
			else if (INPOINT(rockets)) 	point = "{$point}";
			else if (INPOINT(cells)) 	point = "{$point}";
			else if (INPOINT(nails)) 	point = "{$point}";
			
			else if (INPOINT(mh))		point = tp_ib_name_mh;
			
			//TF
			else if (INPOINT(flag))		point = tp_ib_name_flag; // note we cannot tell if it's enemy or team flag (needs fix!)
			else if (INPOINT(disp))		point = "{$point}";	// note we cannot tell if it's enemy or team disp
			else if (INPOINT(sentry))	point = "{$point}"; // note we cannot tell if it's enemy or team sent
			
			//ctf, other
			else if (INPOINT(rune1))	point = "$tp_name_rune1";
			else if (INPOINT(rune2))	point = "$tp_name_rune2";
			else if (INPOINT(rune3))	point = "$tp_name_rune3";
			else if (INPOINT(rune4))	point = "$tp_name_rune4";
		}
		else point = "{$point}"; // this should never happen
	}
	
	/* I think it is confusing to include this in the message, it will look like this for example: "Up2: Q pack at [loc]". Not sure if letting teammates know we have quad is important!
		if (HAVE_POWERUP())
			powerup = "$colored_short_powerups ";
		else
			powerup = "";
	*/

	//led(1) item(2) at loc(3)
	TP_Send_TeamSay("%s%s %s", powerup, point, at_location);
}