Exemplo n.º 1
0
/*
============
AddScore

Adds score to both the client and his team
============
*/
void AddScore(gentity_t * ent, vec3_t origin, int score)
{
	if(!ent->client)
	{
		return;
	}
	// no scoring during pre-match warmup
	if(level.warmupTime)
	{
		return;
	}

	// Tr3B: don't draw zero skills scores
	if(score == 0)
	{
		return;
	}

	// show score plum
	ScorePlum(ent, origin, score);

	//
	ent->client->ps.persistant[PERS_SCORE] += score;
	if(g_gametype.integer == GT_TEAM)
		level.teamScores[ent->client->ps.persistant[PERS_TEAM]] += score;
	CalculateRanks();
}
Exemplo n.º 2
0
/*
============
AddScore

Adds score to both the client and his team
============
*/
void AddScore( gentity_t *ent, vec3_t origin, int score ) {
        int i;

	if ( !ent->client ) {
		return;
	}
	// no scoring during pre-match warmup
	if ( level.warmupTime ) {
		return;
	}

        //No scoring during intermission
        if ( level.intermissiontime ) {
            return;
        }
	// show score plum
        if( level.numNonSpectatorClients<3 && score < 0 && (g_gametype.integer<GT_TEAM || g_ffa_gt==1)) {
            for ( i = 0 ; i < level.maxclients ; i++ ) {
                if ( level.clients[ i ].pers.connected != CON_CONNECTED )
                    continue; //Client was not connected

                if (level.clients[i].sess.sessionTeam == TEAM_SPECTATOR)
                    continue; //Don't give anything to spectators

                if (g_entities+i == ent)
                    continue; //Don't award dead one

                level.clients[i].ps.persistant[PERS_SCORE] -= score;
                ScorePlum(ent, origin, -score);
            }
        }
        else {
            ScorePlum(ent, origin, score);
            //
            ent->client->ps.persistant[PERS_SCORE] += score;
            if ( g_gametype.integer == GT_TEAM ) {
                int team = ent->client->ps.persistant[PERS_TEAM];
                    level.teamScores[ team ] += score;
                    G_LogPrintf("TeamScore: %i %i: Team %d now has %d points\n",
                        team, level.teamScores[ team ], team, level.teamScores[ team ] );
            }
        }
        G_LogPrintf("PlayerScore: %i %i: %s now has %d points\n",
		ent->s.number, ent->client->ps.persistant[PERS_SCORE], ent->client->pers.netname, ent->client->ps.persistant[PERS_SCORE] );
	CalculateRanks();
}
Exemplo n.º 3
0
/*
============
AddScore

Adds score to both the player and his team
============
*/
void AddScore( gentity_t *ent, vec3_t origin, int score ) {
	if ( !ent->player ) {
		return;
	}
	// no scoring during pre-match warmup
	if ( level.warmupTime ) {
		return;
	}
	// show score plum
	ScorePlum(ent, origin, score);
	//
	ent->player->ps.persistant[PERS_SCORE] += score;
	if ( g_gametype.integer == GT_TEAM ) {
		AddTeamScore( origin, ent->player->ps.persistant[PERS_TEAM], score );
	}
	CalculateRanks();
}
Exemplo n.º 4
0
/*
============
AddScore

Adds score to both the client and his team
============
*/
void AddScore( gentity_t *ent, vec3_t origin, int score ) {
	if ( !ent->client ) {
		return;
	}

	if ( g_debugScore.integer )
		G_Printf("AddScore: %i\n", score);

	// show score plum
	if ( origin )
		ScorePlum(ent, origin, score);

	if ( ent->client->ps.persistant[PERS_SCORE] += score >= 0 )	//don't let score drop below 0 in entityplus
		ent->client->ps.persistant[PERS_SCORE] += score;

	//CalculateRanks();
}