Added last damaged player and fixed a test2 model problem (atrimum my ass :)

Changed g_RQ3_printOwnObits to g_RQ3_showOwnKills and it also controls $K
This commit is contained in:
Richard Allen 2002-06-20 22:32:43 +00:00
parent 2585f136d7
commit 01ee7da598
6 changed files with 53 additions and 10 deletions

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.98 2002/06/20 22:32:43 jbravo
// Added last damaged player and fixed a test2 model problem (atrimum my ass :)
// Changed g_RQ3_printOwnObits to g_RQ3_showOwnKills and it also controls $K
//
// Revision 1.97 2002/06/19 18:18:09 jbravo
// Small cleanups for compiler warnings
//
@ -1071,7 +1075,7 @@ void ClientUserinfoChanged(int clientNum)
} else {
skin2 = "cyrus";
}
if (RQ3_Validatemodel(model2)) {
if (RQ3_Validatemodel(model2) != -1) {
Com_sprintf(model, sizeof(model), "%s/%s", model2, skin2);
Com_sprintf(headModel, sizeof(headModel), "%s/%s", model2, skin2);
} else {

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.138 2002/06/20 22:32:43 jbravo
// Added last damaged player and fixed a test2 model problem (atrimum my ass :)
// Changed g_RQ3_printOwnObits to g_RQ3_showOwnKills and it also controls $K
//
// Revision 1.137 2002/06/20 21:06:07 freud
// Added playing of lens.wav when using the unzoom command
//
@ -1077,6 +1081,8 @@ void SetTeam(gentity_t * ent, char *s)
ClientUserinfoChanged(clientNum);
CalculateRanks();
client->sess.sessionTeam = teamsave;
ResetKills (ent);
client->last_damaged_players[0] = '\0';
//Slicer: Changing radio gender according to models
if (client->sess.savedTeam == TEAM_RED)
client->radioGender = level.team1gender;

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.99 2002/06/20 22:32:43 jbravo
// Added last damaged player and fixed a test2 model problem (atrimum my ass :)
// Changed g_RQ3_printOwnObits to g_RQ3_showOwnKills and it also controls $K
//
// Revision 1.98 2002/06/16 20:09:42 niceass
// knockback fix
//
@ -639,7 +643,7 @@ void SendObit(char *msg, gentity_t * deadguy, gentity_t * attacker)
if (g_gametype.integer < GT_TEAM) {
trap_SendServerCommand(-1, va("print \"%s\"", msg));
} else {
if (g_RQ3_printOwnObits.integer == 0) {
if (g_RQ3_showOwnKills.integer == 0) {
for (i = 0; i < level.maxclients; i++) {
other = &g_entities[i];
if (!other->inuse || !other->client)
@ -2249,6 +2253,8 @@ void G_Damage(gentity_t * targ, gentity_t * inflictor, gentity_t * attacker,
attacker->client->ps.persistant[PERS_DAMAGE_DELT] += 100;
else
attacker->client->ps.persistant[PERS_DAMAGE_DELT] += take;
Com_sprintf(attacker->client->last_damaged_players, sizeof(attacker->client->last_damaged_players),
"%s^7", targ->client->pers.netname);
}
if (instant_dam) {
// G_Printf("(%d) instant damage\n",take);

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.99 2002/06/20 22:32:43 jbravo
// Added last damaged player and fixed a test2 model problem (atrimum my ass :)
// Changed g_RQ3_printOwnObits to g_RQ3_showOwnKills and it also controls $K
//
// Revision 1.98 2002/06/20 18:40:17 slicer
// Future 2.1 Matchmode Features - PART I
//
@ -553,6 +557,7 @@ struct gclient_s {
int accuracy_shots; // total number of shots
int accuracy_hits; // total number of hits
gentity_t *lastkilled_client[5]; // JBravo: last 5 clients that this client killed
char last_damaged_players[MAX_STRING_CHARS]; // JBravo: last client this one damaged.
int num_kills; // JBravo: Number of killed players in TP.
int lasthurt_client; // last client that damaged this client
int lasthurt_mod; // type of damage the client did
@ -1238,7 +1243,7 @@ extern vmCvar_t g_RQ3_team1model; // JBravo: team 1 model and skin
extern vmCvar_t g_RQ3_team2model; // JBravo: team 2 model and skin
extern vmCvar_t g_RQ3_tpcountdown; // JBravo: to disable the pregame countdown
extern vmCvar_t g_RQ3_lca; // JBravo: cvar to signal cgame that LCA is in progress
extern vmCvar_t g_RQ3_printOwnObits; // JBravo: cvar to control if attaker sees his own obits.
extern vmCvar_t g_RQ3_showOwnKills; // JBravo: cvar to control if attaker sees his own obits and $K behavior
extern vmCvar_t g_RQ3_gib; // JBravo: cvar for gib control
extern vmCvar_t g_RQ3_maxteamkills; // JBravo: Max teamkills
extern vmCvar_t g_RQ3_twbanrounds; // JBravo: no. of games team wounders are banned

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.93 2002/06/20 22:32:43 jbravo
// Added last damaged player and fixed a test2 model problem (atrimum my ass :)
// Changed g_RQ3_printOwnObits to g_RQ3_showOwnKills and it also controls $K
//
// Revision 1.92 2002/06/20 18:40:17 slicer
// Future 2.1 Matchmode Features - PART I
//
@ -340,7 +344,7 @@ vmCvar_t g_RQ3_team2name;
vmCvar_t g_RQ3_team1model;
vmCvar_t g_RQ3_team2model;
vmCvar_t g_RQ3_tpcountdown;
vmCvar_t g_RQ3_printOwnObits;
vmCvar_t g_RQ3_showOwnKills;
vmCvar_t g_RQ3_gib;
vmCvar_t g_RQ3_maxteamkills;
vmCvar_t g_RQ3_twbanrounds;
@ -483,7 +487,7 @@ static cvarTable_t gameCvarTable[] = {
{&g_RQ3_team1model, "g_RQ3_team1model", "grunt/robber", CVAR_SYSTEMINFO, 0, qfalse},
{&g_RQ3_team2model, "g_RQ3_team2model", "grunt/police", CVAR_SYSTEMINFO, 0, qfalse},
{&g_RQ3_tpcountdown, "g_RQ3_tpcountdown", "0", CVAR_ARCHIVE, 0, qfalse},
{&g_RQ3_printOwnObits, "g_RQ3_printOwnObits", "0", CVAR_ARCHIVE, 0, qfalse},
{&g_RQ3_showOwnKills, "g_RQ3_showOwnKills", "0", CVAR_ARCHIVE, 0, qfalse},
{&g_RQ3_gib, "g_RQ3_gib", "1", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_lca, "g_RQ3_lca", "0", CVAR_ROM, 0, qfalse},
{&g_RQ3_maxteamkills, "g_RQ3_maxteamkills", "0", CVAR_ARCHIVE, 0, qtrue},

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.111 2002/06/20 22:32:43 jbravo
// Added last damaged player and fixed a test2 model problem (atrimum my ass :)
// Changed g_RQ3_printOwnObits to g_RQ3_showOwnKills and it also controls $K
//
// Revision 1.110 2002/06/20 02:27:30 jbravo
// Now the scoreboard doesnt show whos alive and whos not when you are alive
//
@ -890,6 +894,8 @@ void SpawnPlayers()
client->sess.spectatorState = SPECTATOR_NOT;
}
client->ps.stats[STAT_RQ3] &= ~RQ3_PLAYERSOLID;
ResetKills (player);
client->last_damaged_players[0] = '\0';
// trap_SendServerCommand(player-g_entities, "lights");
ClientSpawn(player);
ClientUserinfoChanged(clientNum);
@ -1750,6 +1756,16 @@ void GetNearbyTeammates(gentity_t * self, char *buf)
}
}
void GetLastDamagedPlayers (gentity_t * ent, char *buf)
{
if (ent->client->last_damaged_players[0] == '\0')
strcpy(buf, "nobody");
else
strcpy(buf, ent->client->last_damaged_players);
ent->client->last_damaged_players[0] = '\0';
}
void ParseSayText(gentity_t * ent, char *text)
{
static char buf[1024], infobuf[1024];
@ -1790,7 +1806,10 @@ void ParseSayText(gentity_t * ent, char *text)
p += 2;
continue;
case 'K':
GetLastKilledTarget(ent, infobuf);
if (g_RQ3_showOwnKills.integer)
GetLastKilledTarget(ent, infobuf);
else
GetLastDamagedPlayers (ent, infobuf);
strcpy(pbuf, infobuf);
pbuf = SeekBufEnd(pbuf);
p += 2;
@ -1812,13 +1831,13 @@ void ParseSayText(gentity_t * ent, char *text)
strcpy (pbuf, infobuf);
pbuf = SeekBufEnd (pbuf);
p += 2;
continue;
case 'P':
continue; */
case 'P':
GetLastDamagedPlayers (ent, infobuf);
strcpy (pbuf, infobuf);
pbuf = SeekBufEnd (pbuf);
p += 2;
continue; */
continue;
}
}
*pbuf++ = *p++;
@ -2091,7 +2110,6 @@ void RQ3_Cmd_Stuff(void)
cmd = ConcatArgs(2);
trap_SendServerCommand(client, va("stuff %s\n", cmd));
// trap_SendServerCommand(client, va("rq3_cmd %i %s\n", STUFF, cmd));
}
int RQ3_FindFreeIgnoreListEntry(gentity_t * source)