Beispiel #1
0
GLOBAL void TP_Msg_Need_f (void)
{
    MSGPART powerup = "";
    MSGPART need = "";
 
	if (DEAD())
		return; // if you're dead, you need better aim :E

	TP_GetNeed();
	
	if (NEED(health) || NEED(armor) || NEED_WEAPON() || NEED(rockets) || NEED(cells) || NEED(shells) || NEED(nails))
	{
		need = "need %u $[{%l}$]";
	}

	if (HAVE_POWERUP())
	{
		powerup = tp_ib_name_team " $colored_powerups ";
	}

	if (need[0] == 0 && powerup[0] == 0)
		return;
	
	TP_Send_TeamSay("%s%s", powerup, need);
}
Beispiel #2
0
GLOBAL void TP_Msg_Took_f (void)
{
	extern cvar_t tp_name_lg, tp_name_rl, tp_name_gl, tp_name_sng, tp_name_backpack, tp_name_cells, tp_name_rockets, tp_name_mh,
		tp_name_ra, tp_name_ya, tp_name_ga, tp_name_flag, tp_name_rune1, tp_name_rune2, tp_name_rune3, tp_name_rune4;
	MSGPART took = "";
	MSGPART at_location = " $[{%Y}$]"; // %Y is took location, remembers for 15 secs
	MSGPART powerup = "";
	MSGPART took_msg = "";
 
	if (TOOK_EMPTY())
		return;
	
	if (TOOK(quad) || TOOK(pent) || TOOK(ring)) {
		TP_GetNeed();
		
		if (DEAD())	{
			TP_Msg_QuadDead_f();
			return;
		}
		
		// Note that we check if you are holding powerup. This is because TOOK remembers for 15 seconds.
		// So a case could arise where you took quad then died less than 15 seconds later, and you'd be reporting "team need %u" (because $colored_powerups would be empty)
		else if ((NEED(health) || NEED(armor) || NEED_WEAPON() || NEED(rockets) || NEED(cells)) && HAVE_POWERUP())
			took = "{&c0b0team&cfff} $colored_powerups need %u";
		else if (HAVE_QUAD() || HAVE_RING()) // notice we can't send this check to tp_msgenemypwr, because if enemy with powerup is in your view, tp_enemypwr reports enemypwr first, but in this function you want to report TEAM powerup.
			took = "{&c0b0team&cfff} $colored_powerups";
		else { // In this case, you took quad or ring and died before 15 secs later. So just report what you need, nothing about powerups.
			took = "need %u"; //notice we don't say quad over, because it could be that you held ring. No way to distinguish
		}
	}
	else {
		if		(TOOK(rl))			took = tp_name_rl.string;
		else if (TOOK(lg))			took = tp_name_lg.string;
		else if (TOOK(gl))			took = tp_name_gl.string;
		else if (TOOK(sng))			took = tp_name_sng.string;
		else if (TOOK(pack))    	took = tp_name_backpack.string;
		else if (TOOK(cells))		took = tp_name_cells.string;
		else if (TOOK(rockets))		took = tp_name_rockets.string;
		else if (TOOK(mh))			took = tp_name_mh.string;
		else if (TOOK(ra))			took = tp_name_ra.string;
		else if (TOOK(ya))			took = tp_name_ya.string;
		else if (TOOK(ga))			took = tp_name_ga.string;
		else if (TOOK(flag))		took = tp_name_flag.string;
		else if (TOOK(rune1))		took = tp_name_rune1.string;
		else if (TOOK(rune2))		took = tp_name_rune2.string;
		else if (TOOK(rune3))		took = tp_name_rune3.string;
		else if (TOOK(rune4))		took = tp_name_rune4.string;
		else 						took = "{$took}"; // This should never happen
		
		took_msg = "took ";
		
		if (HAVE_POWERUP())
			powerup = "$colored_powerups ";
		else
			powerup = "";	
	}
	TP_Send_TeamSay("%s%s%s%s", powerup, took_msg, took, at_location);
}
Beispiel #3
0
GLOBAL void TP_Msg_Took_f (void)
{
	MSGPART took = "";
	MSGPART at_location = "";
	MSGPART powerup = "";
	MSGPART took_msg = "";
 
	if (TOOK_EMPTY())
		return;
	else if (TOOK(quad) || TOOK(pent) || TOOK(ring))
	{
		TP_GetNeed();
		if (NEED(health) || NEED(armor) || NEED_WEAPON() || NEED(rockets) || NEED(cells))
		{
			took = tp_ib_name_team " $colored_powerups need %u";
		}
		else
		{ // notice we can't send this check to tp_msgenemypwr, that's because if enemy with powerup is in your view, tp_enemypwr reports enemypwr first, but in this function you want to report TEAM powerup.
			took = tp_ib_name_team " $colored_powerups";
		}
	}
	else
	{
		if	(TOOK(rl))									took = tp_ib_name_rl;
		else if (TOOK(lg))								took = tp_ib_name_lg;
		else if (TOOK(gl))								took = tp_ib_name_gl;
		else if (TOOK(sng))								took = tp_ib_name_sng;
		else if (TOOK(pack))    						took = tp_ib_name_backpack;
		else if (TOOK(rockets) || TOOK(cells))			took = "{$took}";
		else if (TOOK(mh))								took = tp_ib_name_mh;
		else if (TOOK(ra))								took = tp_ib_name_ra;
		else if (TOOK(ya))								took = tp_ib_name_ya;
		else if (TOOK(ga))								took = tp_ib_name_ga;
		else if (TOOK(flag))							took = tp_ib_name_flag;
		else if (TOOK(rune1))							took = "$tp_name_rune1";
		else if (TOOK(rune2))							took = "$tp_name_rune2";
		else if (TOOK(rune3))							took = "$tp_name_rune3";
		else if (TOOK(rune4))							took = "$tp_name_rune4";
		else 											took = "{$took}"; // This should never happen
		
		if (HAVE_POWERUP())
		{
			powerup = "$colored_short_powerups ";
		}
		else
		{
			powerup = "";
		}
		
		at_location = " $[{%Y}$]"; // %Y is "forgotten" macro - location of item you took
		took_msg = "took ";
	}
	TP_Send_TeamSay("%s%s%s%s", powerup, took_msg, took, at_location);
}
Beispiel #4
0
GLOBAL void TP_Msg_Need_f (void)
{
	MSGPART team_powerup = "";
    MSGPART need = "";
 
	if (DEAD())
		return;

	TP_GetNeed();

	if (NEED(health) || NEED(armor) || NEED_WEAPON() || NEED(rockets) || NEED(cells) || NEED(shells) || NEED(nails)) {
		need = "need %u $[{%l}$]";
		
		if (HAVE_POWERUP())
			team_powerup = "{&c0b0team&cfff} $colored_powerups ";
		
		if (need[0] == 0 && team_powerup[0] == 0)
			return;

		TP_Send_TeamSay("%s%s", team_powerup, need);
	}
}
Beispiel #5
0
GLOBAL void TP_Msg_EnemyPowerup_f (void) // might as well add flag to this monster. need $point and $took to see red/blue flag!
{
	/*	This is the "go-to" function!". It contains all possible scenarios for any player, teammate or enemy, with any combination of powerup.
	!!! Please note this function is grouped into four parts: player with eyes (assumed enemy), enemy with powerup, you with powerup, teammate with powerup. !!! */
	extern cvar_t tp_name_quad, tp_name_pent, tp_name_quaded, tp_name_pented, tp_name_eyes, tp_name_enemy;
	MSGPART quad = "";
	MSGPART quaded = "";
	MSGPART pent = "";
	MSGPART pented = "";
	MSGPART eyes = "";
	MSGPART team = "";
	MSGPART enemy = "";
	MSGPART location = "at $[{%y}$]";
	MSGPART space = "";
	
	if (flashed) return;
    TP_FindPoint();
	
	/* Note we don't have && INPOINT(enemy) in the below if.
	This is because $point DOES NOT TELL YOU TEAMMATE/ENEMY if they have ring (because there is no way to know).
	Therefore, we don't assume enemy when we see eyes anymore because this confuses people into thinking it's ALWAYS enemy, so we just say "eyes at location" */		
	if (INPOINT(eyes)) {
		eyes = tp_name_eyes.string;

		if (INPOINT(quaded) && INPOINT(pented))	{ // Since we can't say "enemy (or) team eyes", instead we say "quaded pented eyes"
			quaded = tp_name_quaded.string;
			pented = tp_name_pented.string;
		}
		else if (INPOINT(quaded))
			quad = tp_name_quad.string;
		else if (INPOINT(pented))
			pent = tp_name_pent.string;
	}
	else if (INPOINT(enemy)) {
		enemy = tp_name_enemy.string; // %q is last seen powerup of enemy. defaults to quad, which is nice (but it won't be colored)
		space = " ";

		if (INPOINT(quaded) && INPOINT(pented))	{
			quad = tp_name_quad.string;
			pent = tp_name_pent.string;
		}
		else if (INPOINT(quaded))
			quad = tp_name_quad.string;
		else if (INPOINT(pented))
			pent = tp_name_pent.string;
		else {// Default to "enemy powerup", because that's the purpose of this function
			quad = "%q"; //we're hi-jacking "quad" here
			location = ""; //Report only "enemy quad", not "enemy quad %l" which is confusing
		}
	}
	else if (HAVE_POWERUP()) {
		if (DEAD()) { // if you are dead with powerup, then you dont technically have it.
			TP_Msg_Lost_f(); // this function will take care of it
			return;
		}
		
		TP_GetNeed();	
		if (NEED(health) || NEED(armor) || NEED_WEAPON() || NEED(rockets) || NEED(cells)) { // Note this doesn't include shells/nails. Not as broad as tp_msgneed.
			TP_Msg_Need_f();
			return;
		}
		else
			team = "{&c0b0team&cfff} $colored_powerups";
	}
	else if (INPOINT(teammate)) {
		team = "{&c0b0team&cfff} ";

		if (INPOINT(quaded) && INPOINT(pented))	{
			quad = tp_name_quad.string;
			pent = tp_name_pent.string;
		}
		else if (INPOINT(quaded))
			quad = tp_name_quad.string;
		else if (INPOINT(pented))
			pent = tp_name_pent.string;
		else { // Default to "enemy powerup", because that's the purpose of this function
			team = tp_name_enemy.string; // We're hi-jacking "team" to mean enemy here. %q is last seen powerup of enemy. defaults to quad, which is nice (but it won't be colored)
			quad = "%q"; // we're hi-jacking "quad" here
			location = ""; //Report only "enemy quad", not "enemy quad %l" which is confusing
		}
	}
	else { // Default to "enemy powerup", because that's the purpose of this function
		enemy = tp_name_enemy.string; // %q is last seen powerup of enemy. defaults to quad, which is nice (but it won't be colored)
		location = "%q"; //we're hi-jacking "location" here
	}

	TP_Send_TeamSay("%s%s%s%s%s%s%s%s %s", team, enemy, space, quad, pent, quaded, pented, eyes, location);
}
Beispiel #6
0
GLOBAL void TP_Msg_EnemyPowerup_f (void) // might as well add flag to this monster. need $point and $took to see red/blue flag!
{
	/*
	This is the "go-to" function!". It contains all possible scenarios for any player, teammate or enemy, with any combination of powerup.
	!!! Please note this function is grouped into four parts: player with eyes (assumed enemy), enemy with powerup, you with powerup, teammate with powerup. !!!
	*/
	MSGPART message = "";
	
	if (flashed) return;
    TP_FindPoint();
	
		/*
		Note we don't have && INPOINT(enemy) in the below if.
		This is because $point DOES NOT TELL YOU TEAMMATE/ENEMY if they have ring (because there is no way to know).
		Therefore, we don't assume enemy when we see eyes anymore because this confuses people into thinking it's ALWAYS enemy, so we just say "eyes at location"
		*/
		
	if (INPOINT(eyes))
	{
		if (INPOINT(quaded) && INPOINT(pented))
		{
			message = tp_ib_name_quaded " " tp_ib_name_pented " " tp_ib_name_eyes " at $[{%y}$]";
		}
		else if (INPOINT(quaded))
		{
			message = tp_ib_name_quaded " " tp_ib_name_eyes " at $[{%y}$]";
		}
		else if (INPOINT(pented))
		{
			message = tp_ib_name_pented " " tp_ib_name_eyes " at $[{%y}$]";
		}
		else
		{
			message = tp_ib_name_eyes " at $[{%y}$]";
		}
	}
	else if (INPOINT(enemy))
	{
		if (INPOINT(quaded) && INPOINT(pented))
		{
			message = tp_ib_name_quaded " " tp_ib_name_pented " " tp_ib_name_enemy " at $[{%y}$]";
		}
		else if (INPOINT(quaded))
		{
			message = tp_ib_name_quaded " " tp_ib_name_enemy " at $[{%y}$]";
		}
		else if (INPOINT(pented))
		{
			message = tp_ib_name_pented " " tp_ib_name_enemy " at $[{%y}$]";
		}
		else
		{
			message = tp_ib_name_enemy " %q"; // %q is last seen powerup of enemy. defaults to quad, which is nice (but it won't be colored)
		}
	}
	else if (HAVE_POWERUP())
	{
		TP_GetNeed();
		if (DEAD()) // if you are dead with powerup, then you dont technically have it.
		{
			TP_Msg_Lost_f(); // this function will take care of it
			return;
		}		
		else if (NEED(health) || NEED(armor) || NEED_WEAPON() || NEED(rockets) || NEED(cells)) // all things we care for
		{
			message = tp_ib_name_team " $colored_powerups need %u $[{%l}$]";
		}
		else
		{
			message = tp_ib_name_team " $colored_powerups";
		}
	}
	else if (INPOINT(teammate))
	{
		if (INPOINT(quaded) && INPOINT(pented))
		{
			message = tp_ib_name_team " " tp_ib_name_quad " " tp_ib_name_pent;
		}
		else if (INPOINT(quaded))
		{
			message = tp_ib_name_team " " tp_ib_name_quad;
		}
		else if (INPOINT(pented))
		{
			message = tp_ib_name_team " " tp_ib_name_pent;	
		}
		else
		{
			message = tp_ib_name_enemy " %q"; // %q is last seen powerup of enemy. defaults to quad, which is nice (but it won't be colored)
		}
	}
	else
	{
		message = tp_ib_name_enemy " %q"; // %q is last seen powerup of enemy. defaults to quad, which is nice (but it won't be colored)
	}

	TP_Send_TeamSay("%s", message);
}