コード例 #1
0
ファイル: tp_msgs.c プロジェクト: Classic-Fortress/client
GLOBAL void TP_Msg_Report_f (void)
{
	extern cvar_t tp_name_lg, tp_name_rl, tp_name_gl, tp_name_sng, tp_name_ssg;
	MSGPART powerup = "";
	MSGPART armor_health = "$colored_armor/%h";
	MSGPART location = "$[{%l}$]";
	MSGPART weapon = "";
	MSGPART rl = ""; // note we need by "rl" "lg" and "weapon" for the case that player has both
	MSGPART lg = "";
	MSGPART cells = "";
	MSGPART extra_cells = ""; //"extra" MSGPART needed to we can put these after %l
	MSGPART rockets = "";
	MSGPART extra_rockets = "";
	MSGPART ammo = "";
 
	if (DEAD()) {
		TP_Msg_Lost_f();
		return;
	}
	
	if (HAVE_POWERUP())
		powerup = "$colored_powerups ";
 
	if	(HAVE_RL() && HAVE_LG()) {
		rl = tp_name_rl.string;
		rockets = ":$rockets ";
		lg = tp_name_lg.string;
		cells = ":$cells ";
	}
	else if (HAVE_RL()) {
		rl = tp_name_rl.string;
		rockets = ":$rockets ";
	}
	else if (HAVE_LG()) {
		lg = tp_name_lg.string;
		cells = ":$cells ";
	}
	else if (HAVE_GL()) {
		weapon = tp_name_gl.string;
		ammo = ":$rockets ";
	}
	else if (HAVE_SNG()) {
		weapon = tp_name_sng.string;
		ammo = ":$nails ";
	}
	else if (HAVE_SSG()) {
		weapon = tp_name_ssg.string;
		ammo = ":$shells ";
	}
	
	// extra rockets and cells
	if (!HAVE_RL() && HAVE_ROCKETS())
		extra_rockets = " {&cf13r&cfff}:$rockets"; // see below comment
	if (!HAVE_LG() && HAVE_CELLS())
		extra_cells = " {&c2aac&cfff}:$cells"; //the "r" and "c" are hard-coded to have the same colors as tp_name_rl and tp_name_lg. Not sure if this is a good idea
											  //since the user can change those colors and then it won't match up
 	 
	TP_Send_TeamSay("%s%s %s%s%s%s%s%s%s%s%s", powerup, armor_health, weapon, ammo, rl, rockets, lg, cells, location, extra_rockets, extra_cells);
}
コード例 #2
0
ファイル: tp_msgs.c プロジェクト: qqshka/ezquake-source
GLOBAL void TP_Msg_Report_f (void)
{
	MSGPART powerup = "";
	MSGPART armor_health = "";
	MSGPART location = "";
	MSGPART weap_ammo = "";
	MSGPART extra_ammo = "";
 
	if (DEAD()) // no matter what, if dead report lost (how could you be coming if you're dead?)
		{
		TP_Msg_Lost_f();
		return;
		}
	
	if (HAVE_POWERUP())
		powerup = "$colored_short_powerups ";
	else
		powerup = "";
 
    if		(HAVE_RL() && HAVE_LG())	weap_ammo = " " tp_ib_name_rlg ":$rockets/$cells";
    else if (HAVE_RL())					weap_ammo = " " tp_ib_name_rl ":$rockets";
    else if (HAVE_LG())					weap_ammo = " " tp_ib_name_lg ":$cells";
	else if (HAVE_GL())					weap_ammo = " " tp_ib_name_gl ":$rockets";
	else if (HAVE_SNG())				weap_ammo = " " tp_ib_name_sng ":$nails";
	else if (HAVE_SSG())				weap_ammo = " " tp_ib_name_ssg;
    else								weap_ammo = "";

	if (!HAVE_LG() && HAVE_CELLS()) {
		extra_ammo = " c:$cells";
	}
 
	armor_health = "$colored_armor/%h";
	location = "$[{%l}$]";
	 
	TP_Send_TeamSay("%s%s %s%s%s", powerup, armor_health, location, weap_ammo, extra_ammo);
}