Beispiel #1
0
qboolean CalculateSection31Award(gentity_t *ent)
{
	int			i = 0, frags = 0, efficiency = 0;
	gentity_t	*player = NULL;

	for (i = 0; i < sv_maxclients.integer; i++)
	{
		player = g_entities + i;
		if (!player->inuse)
			continue;
//
//	kef -- heh.
//
//		if (strcmp("JaxxonPhred", ent->client->pers.netname))
//		{
//			continue;
//		}
		CalculateEfficiency(ent, &efficiency);
		if (!CalculateSharpshooter(ent, &frags) ||
			!CalculateUntouchable(ent) ||
			/*(CalculateStreak(ent) < STREAK_CHAMPION) ||*/
			(efficiency < 75))
		{
			continue;
		}
		return qtrue;
	}
	return qfalse;
}
Beispiel #2
0
void CalculateAwards( gentity_t *ent, char *msg ) {
#ifdef LOGGING_WEAPONS
	char		buf1[AWARDS_MSG_LENGTH], buf2[AWARDS_MSG_LENGTH];
	int			awardFlags = 0, efficiency = 0, stuffUsed = 0, kills = 0, streak = 0, teamAwards = 0;

	memset( buf1, 0, AWARDS_MSG_LENGTH );
	memset( buf2, 0, AWARDS_MSG_LENGTH );
	if ( CalculateEfficiency( ent, &efficiency ) ) {
		awardFlags |= (1 << AWARD_EFFICIENCY);
		Com_sprintf( buf1, AWARDS_MSG_LENGTH, " %d", efficiency );
	}
	if ( CalculateSharpshooter( ent, &kills ) ) {
		awardFlags |= (1 << AWARD_SHARPSHOOTER);
		strcpy( buf2, buf1 );
		Com_sprintf( buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, kills );
	}
	if ( CalculateUntouchable( ent ) ) {
		awardFlags |= (1 << AWARD_UNTOUCHABLE);
		strcpy( buf2, buf1 );
		Com_sprintf( buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, 0 );
	}
	if ( CalculateLogistics( ent, &stuffUsed ) ) {
		awardFlags |= (1 << AWARD_LOGISTICS);
		strcpy( buf2, buf1 );
		Com_sprintf( buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, stuffUsed );
	}
	if ( CalculateTactician( ent, &kills ) ) {
		awardFlags |= (1 << AWARD_TACTICIAN);
		strcpy( buf2, buf1 );
		Com_sprintf( buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, kills );
	}
	if ( CalculateDemolitionist( ent, &kills ) ) {
		awardFlags |= (1 << AWARD_DEMOLITIONIST);
		strcpy( buf2, buf1 );
		Com_sprintf( buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, kills );
	}
	streak = CalculateStreak( ent );
	if ( streak ) {
		awardFlags |= (1 << AWARD_STREAK);
		strcpy( buf2, buf1 );
		Com_sprintf( buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, streak );
	}
	if ( level.gametype >= GT_TEAM ) {
		teamAwards = CalculateTeamAward( ent );
		if ( teamAwards ) {
			awardFlags |= (1 << AWARD_TEAM);
			strcpy( buf2, buf1 );
			Com_sprintf( buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, teamAwards );
		}
	}
	if ( CalculateSection31Award( ent ) ) {
		awardFlags |= (1 << AWARD_SECTION31);
		strcpy( buf2, buf1 );
		Com_sprintf( buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, 0 );
	}
	strcpy( buf2, msg );
	Com_sprintf( msg, AWARDS_MSG_LENGTH, "%s %d%s", buf2, awardFlags, buf1 );
#endif // LOGGING_WEAPONS
}
Beispiel #3
0
qboolean CalculateSection31Award(gentity_t *ent)
{
	int			i = 0, frags = 0, efficiency = 0;
	gentity_t	*player = NULL;

	for (i = 0; i < g_maxclients.integer; i++)
	{
		player = g_entities + i;
		if (!player->inuse)
			continue;

		CalculateEfficiency(ent, &efficiency);
		if (!CalculateSharpshooter(ent, &frags) ||
			!CalculateUntouchable(ent) ||
			(efficiency < 75))
		{
			continue;
		}
		return qtrue;
	}
	return qfalse;
}