mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-13 16:37:47 +00:00
Live players dont get fraglines, except their own. Cleanups and some
hacks to get bots to stop using knives only.
This commit is contained in:
parent
9441a6f1a0
commit
47112a4cca
5 changed files with 138 additions and 145 deletions
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.43 2002/03/18 12:25:10 jbravo
|
||||||
|
// Live players dont get fraglines, except their own. Cleanups and some
|
||||||
|
// hacks to get bots to stop using knives only.
|
||||||
|
//
|
||||||
// Revision 1.42 2002/03/17 01:44:39 jbravo
|
// Revision 1.42 2002/03/17 01:44:39 jbravo
|
||||||
// Fixed the "xxx died" fraglines, did some code cleanups andalmost fixed
|
// Fixed the "xxx died" fraglines, did some code cleanups andalmost fixed
|
||||||
// DM. Only DM problem I can see is that bots are invisible.
|
// DM. Only DM problem I can see is that bots are invisible.
|
||||||
|
@ -107,15 +111,12 @@ CG_Obituary
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
static void CG_Obituary( entityState_t *ent ) {
|
static void CG_Obituary( entityState_t *ent ) {
|
||||||
int mod;
|
int mod, target, attacker;
|
||||||
int n; //Elder: for random messages
|
int n; //Elder: for random messages
|
||||||
int target, attacker;
|
char *message, *message2;
|
||||||
char *message;
|
|
||||||
char *message2;
|
|
||||||
const char *targetInfo;
|
const char *targetInfo;
|
||||||
const char *attackerInfo;
|
const char *attackerInfo;
|
||||||
char targetName[32];
|
char targetName[32], attackerName[32];
|
||||||
char attackerName[32];
|
|
||||||
gender_t gender;
|
gender_t gender;
|
||||||
clientInfo_t *ci;
|
clientInfo_t *ci;
|
||||||
|
|
||||||
|
@ -123,12 +124,12 @@ static void CG_Obituary( entityState_t *ent ) {
|
||||||
attacker = ent->otherEntityNum2;
|
attacker = ent->otherEntityNum2;
|
||||||
mod = ent->eventParm;
|
mod = ent->eventParm;
|
||||||
|
|
||||||
if ( target < 0 || target >= MAX_CLIENTS ) {
|
if (target < 0 || target >= MAX_CLIENTS) {
|
||||||
CG_Error( "CG_Obituary: target out of range" );
|
CG_Error("CG_Obituary: target out of range");
|
||||||
}
|
}
|
||||||
ci = &cgs.clientinfo[target];
|
ci = &cgs.clientinfo[target];
|
||||||
|
|
||||||
if ( attacker < 0 || attacker >= MAX_CLIENTS ) {
|
if (attacker < 0 || attacker >= MAX_CLIENTS) {
|
||||||
attacker = ENTITYNUM_WORLD;
|
attacker = ENTITYNUM_WORLD;
|
||||||
attackerInfo = NULL;
|
attackerInfo = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@ -202,15 +203,6 @@ static void CG_Obituary( entityState_t *ent ) {
|
||||||
else
|
else
|
||||||
message = "didn't throw his grenade far enough";
|
message = "didn't throw his grenade far enough";
|
||||||
break;
|
break;
|
||||||
/*
|
|
||||||
if ( gender == GENDER_FEMALE )
|
|
||||||
message = "tripped on her own grenade";
|
|
||||||
else if ( gender == GENDER_NEUTER )
|
|
||||||
message = "tripped on its own grenade";
|
|
||||||
else
|
|
||||||
message = "tripped on his own grenade";
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
case MOD_ROCKET_SPLASH:
|
case MOD_ROCKET_SPLASH:
|
||||||
if ( gender == GENDER_FEMALE )
|
if ( gender == GENDER_FEMALE )
|
||||||
message = "blew herself up";
|
message = "blew herself up";
|
||||||
|
@ -253,9 +245,9 @@ static void CG_Obituary( entityState_t *ent ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Blaze: This allows for the falling damage message to pass through if someone attacked them
|
//Blaze: This allows for the falling damage message to pass through if someone attacked them
|
||||||
if (!(attacker == ENTITYNUM_WORLD || attacker ==target)) message = NULL;
|
if (!(attacker == ENTITYNUM_WORLD || attacker == target)) message = NULL;
|
||||||
if (message) {
|
if (message) {
|
||||||
CG_Printf( "%s %s.\n", targetName, message);
|
CG_Printf("%s %s.\n", targetName, message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +362,7 @@ static void CG_Obituary( entityState_t *ent ) {
|
||||||
break;
|
break;
|
||||||
case MOD_PISTOL:
|
case MOD_PISTOL:
|
||||||
message = "was shot by";
|
message = "was shot by";
|
||||||
message2 = "'s Mark 23 Pistol";
|
message2 = "'s Mark 23 Pistol";
|
||||||
break;
|
break;
|
||||||
case MOD_M4:
|
case MOD_M4:
|
||||||
message = "was shot by";
|
message = "was shot by";
|
||||||
|
@ -386,26 +378,20 @@ static void CG_Obituary( entityState_t *ent ) {
|
||||||
break;
|
break;
|
||||||
case MOD_M3:
|
case MOD_M3:
|
||||||
n = rand() % 2 + 1;
|
n = rand() % 2 + 1;
|
||||||
if (n == 1)
|
if (n == 1) {
|
||||||
{
|
|
||||||
message = "accepts";
|
message = "accepts";
|
||||||
message2 = "'s M3 Super 90 Assault Shotgun in hole-y matrimony";
|
message2 = "'s M3 Super 90 Assault Shotgun in hole-y matrimony";
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
message = "is full of buckshot from";
|
message = "is full of buckshot from";
|
||||||
message2 = "'s M3 Super 90 Assault Shotgun";
|
message2 = "'s M3 Super 90 Assault Shotgun";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MOD_HANDCANNON:
|
case MOD_HANDCANNON:
|
||||||
n = rand() % 2 + 1;
|
n = rand() % 2 + 1;
|
||||||
if (n == 1)
|
if (n == 1) {
|
||||||
{
|
|
||||||
message = "ate";
|
message = "ate";
|
||||||
message2 = "'s sawed-off 12 gauge";
|
message2 = "'s sawed-off 12 gauge";
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
message = "is full of buckshot from";
|
message = "is full of buckshot from";
|
||||||
message2 = "'s sawed off shotgun";
|
message2 = "'s sawed off shotgun";
|
||||||
}
|
}
|
||||||
|
@ -415,17 +401,14 @@ static void CG_Obituary( entityState_t *ent ) {
|
||||||
break;
|
break;
|
||||||
case MOD_KICK:
|
case MOD_KICK:
|
||||||
n = rand() % 3 + 1;
|
n = rand() % 3 + 1;
|
||||||
if (n == 1)
|
if (n == 1) {
|
||||||
{
|
|
||||||
if (gender == GENDER_NEUTER)
|
if (gender == GENDER_NEUTER)
|
||||||
message = "got its ass kicked by";
|
message = "got its ass kicked by";
|
||||||
else if (gender == GENDER_FEMALE)
|
else if (gender == GENDER_FEMALE)
|
||||||
message = "got her ass kicked by";
|
message = "got her ass kicked by";
|
||||||
else
|
else
|
||||||
message = "got his ass kicked by";
|
message = "got his ass kicked by";
|
||||||
}
|
} else if (n == 2) {
|
||||||
else if (n == 2)
|
|
||||||
{
|
|
||||||
message = "couldn't remove";
|
message = "couldn't remove";
|
||||||
if (gender == GENDER_NEUTER)
|
if (gender == GENDER_NEUTER)
|
||||||
message2 = "'s boot from its ass";
|
message2 = "'s boot from its ass";
|
||||||
|
@ -433,9 +416,7 @@ static void CG_Obituary( entityState_t *ent ) {
|
||||||
message2 = "'s boot from her ass";
|
message2 = "'s boot from her ass";
|
||||||
else
|
else
|
||||||
message2 = "'s boot from his ass";
|
message2 = "'s boot from his ass";
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
if (gender == GENDER_NEUTER)
|
if (gender == GENDER_NEUTER)
|
||||||
message = "had a Bruce Lee put on it by";
|
message = "had a Bruce Lee put on it by";
|
||||||
else if (gender == GENDER_FEMALE)
|
else if (gender == GENDER_FEMALE)
|
||||||
|
@ -462,9 +443,12 @@ static void CG_Obituary( entityState_t *ent ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// JBravo: live players dont get fraglines.
|
||||||
if (message) {
|
if (message) {
|
||||||
CG_Printf( "%s %s %s%s\n",
|
if (target != attacker && (cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR ||
|
||||||
targetName, message, attackerName, message2);
|
cg.snap->ps.clientNum == attacker))
|
||||||
|
CG_Printf( "%s %s %s%s\n",
|
||||||
|
targetName, message, attackerName, message2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -482,14 +466,10 @@ CG_Obituary_Head
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
static void CG_Obituary_Head( entityState_t *ent ) {
|
static void CG_Obituary_Head( entityState_t *ent ) {
|
||||||
int mod;
|
int mod, target, attacker;
|
||||||
int target, attacker;
|
char *message, *message2;
|
||||||
char *message;
|
const char *targetInfo, *attackerInfo;
|
||||||
char *message2;
|
char targetName[32], attackerName[32];
|
||||||
const char *targetInfo;
|
|
||||||
const char *attackerInfo;
|
|
||||||
char targetName[32];
|
|
||||||
char attackerName[32];
|
|
||||||
gender_t gender;
|
gender_t gender;
|
||||||
clientInfo_t *ci;
|
clientInfo_t *ci;
|
||||||
|
|
||||||
|
@ -497,30 +477,30 @@ static void CG_Obituary_Head( entityState_t *ent ) {
|
||||||
attacker = ent->otherEntityNum2;
|
attacker = ent->otherEntityNum2;
|
||||||
mod = ent->eventParm;
|
mod = ent->eventParm;
|
||||||
|
|
||||||
if ( target < 0 || target >= MAX_CLIENTS ) {
|
if (target < 0 || target >= MAX_CLIENTS) {
|
||||||
CG_Error( "CG_Obituary: target out of range" );
|
CG_Error("CG_Obituary: target out of range");
|
||||||
}
|
}
|
||||||
ci = &cgs.clientinfo[target];
|
ci = &cgs.clientinfo[target];
|
||||||
|
|
||||||
if ( attacker < 0 || attacker >= MAX_CLIENTS ) {
|
if (attacker < 0 || attacker >= MAX_CLIENTS) {
|
||||||
attacker = ENTITYNUM_WORLD;
|
attacker = ENTITYNUM_WORLD;
|
||||||
attackerInfo = NULL;
|
attackerInfo = NULL;
|
||||||
} else {
|
} else {
|
||||||
attackerInfo = CG_ConfigString( CS_PLAYERS + attacker );
|
attackerInfo = CG_ConfigString(CS_PLAYERS + attacker);
|
||||||
}
|
}
|
||||||
|
|
||||||
targetInfo = CG_ConfigString( CS_PLAYERS + target );
|
targetInfo = CG_ConfigString(CS_PLAYERS + target);
|
||||||
if ( !targetInfo ) {
|
if (!targetInfo) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof(targetName) - 2);
|
Q_strncpyz(targetName, Info_ValueForKey(targetInfo, "n"), sizeof(targetName) - 2);
|
||||||
strcat( targetName, S_COLOR_WHITE );
|
strcat(targetName, S_COLOR_WHITE);
|
||||||
|
|
||||||
message2 = "";
|
message2 = "";
|
||||||
|
|
||||||
// check for single client messages
|
// check for single client messages
|
||||||
|
|
||||||
switch( mod ) {
|
switch(mod) {
|
||||||
case MOD_SUICIDE:
|
case MOD_SUICIDE:
|
||||||
message = "suicides";
|
message = "suicides";
|
||||||
break;
|
break;
|
||||||
|
@ -564,17 +544,17 @@ static void CG_Obituary_Head( entityState_t *ent ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(attacker == ENTITYNUM_WORLD || attacker ==target)) message = NULL;
|
if (!(attacker == ENTITYNUM_WORLD || attacker == target)) message = NULL;
|
||||||
if (message) {
|
if (message) {
|
||||||
CG_Printf( "%s %s.\n", targetName, message);
|
CG_Printf( "%s %s.\n", targetName, message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for kill messages from the current clientNum
|
// check for kill messages from the current clientNum
|
||||||
if ( attacker == cg.snap->ps.clientNum ) {
|
if (attacker == cg.snap->ps.clientNum) {
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
if ( cgs.gametype < GT_TEAM ) {
|
if (cgs.gametype < GT_TEAM) {
|
||||||
s = va("You fragged %s\n%s place with %i", targetName,
|
s = va("You fragged %s\n%s place with %i", targetName,
|
||||||
CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ),
|
CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ),
|
||||||
cg.snap->ps.persistant[PERS_SCORE] );
|
cg.snap->ps.persistant[PERS_SCORE] );
|
||||||
|
@ -587,7 +567,6 @@ static void CG_Obituary_Head( entityState_t *ent ) {
|
||||||
CG_CenterPrint( s, SCREEN_HEIGHT * 0.25, (BIGCHAR_WIDTH+SMALLCHAR_WIDTH)*.5 );
|
CG_CenterPrint( s, SCREEN_HEIGHT * 0.25, (BIGCHAR_WIDTH+SMALLCHAR_WIDTH)*.5 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// check for double client messages
|
// check for double client messages
|
||||||
if ( !attackerInfo ) {
|
if ( !attackerInfo ) {
|
||||||
attacker = ENTITYNUM_WORLD;
|
attacker = ENTITYNUM_WORLD;
|
||||||
|
@ -601,7 +580,7 @@ static void CG_Obituary_Head( entityState_t *ent ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( attacker != ENTITYNUM_WORLD ) {
|
if (attacker != ENTITYNUM_WORLD) {
|
||||||
switch (mod) {
|
switch (mod) {
|
||||||
case MOD_PISTOL:
|
case MOD_PISTOL:
|
||||||
if (gender == GENDER_FEMALE)
|
if (gender == GENDER_FEMALE)
|
||||||
|
@ -625,17 +604,14 @@ static void CG_Obituary_Head( entityState_t *ent ) {
|
||||||
message2 = "'s akimbo Mark 23 pistols";
|
message2 = "'s akimbo Mark 23 pistols";
|
||||||
break;
|
break;
|
||||||
case MOD_SNIPER:
|
case MOD_SNIPER:
|
||||||
if (cg.refdef.fov_x < 90)
|
if (cg.refdef.fov_x < 90) {
|
||||||
{
|
|
||||||
if (gender == GENDER_NEUTER)
|
if (gender == GENDER_NEUTER)
|
||||||
message = "saw the sniper bullet go through its scope thanks to";
|
message = "saw the sniper bullet go through its scope thanks to";
|
||||||
else if (gender == GENDER_FEMALE)
|
else if (gender == GENDER_FEMALE)
|
||||||
message = "saw the sniper bullet go through her scope thanks to";
|
message = "saw the sniper bullet go through her scope thanks to";
|
||||||
else
|
else
|
||||||
message = "saw the sniper bullet go through his scope thanks to";
|
message = "saw the sniper bullet go through his scope thanks to";
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
message = "caught a sniper bullet between the eyes from";
|
message = "caught a sniper bullet between the eyes from";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -675,9 +651,12 @@ static void CG_Obituary_Head( entityState_t *ent ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// JBravo: live players dont get fraglines.
|
||||||
if (message) {
|
if (message) {
|
||||||
CG_Printf( "%s %s %s%s\n",
|
if (target != attacker && (cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR ||
|
||||||
targetName, message, attackerName, message2);
|
cg.snap->ps.clientNum == attacker))
|
||||||
|
CG_Printf( "%s %s %s%s\n",
|
||||||
|
targetName, message, attackerName, message2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -696,14 +675,10 @@ CG_Obituary_Chest
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
static void CG_Obituary_Chest( entityState_t *ent ) {
|
static void CG_Obituary_Chest( entityState_t *ent ) {
|
||||||
int mod;
|
int mod, target, attacker;
|
||||||
int target, attacker;
|
char *message, *message2;
|
||||||
char *message;
|
const char *targetInfo, *attackerInfo;
|
||||||
char *message2;
|
char targetName[32], attackerName[32];
|
||||||
const char *targetInfo;
|
|
||||||
const char *attackerInfo;
|
|
||||||
char targetName[32];
|
|
||||||
char attackerName[32];
|
|
||||||
gender_t gender;
|
gender_t gender;
|
||||||
clientInfo_t *ci;
|
clientInfo_t *ci;
|
||||||
|
|
||||||
|
@ -859,9 +834,12 @@ static void CG_Obituary_Chest( entityState_t *ent ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// JBravo: live players dont get fraglines.
|
||||||
if (message) {
|
if (message) {
|
||||||
CG_Printf( "%s %s %s%s\n",
|
if (target != attacker && (cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR ||
|
||||||
targetName, message, attackerName, message2);
|
cg.snap->ps.clientNum == attacker))
|
||||||
|
CG_Printf( "%s %s %s%s\n",
|
||||||
|
targetName, message, attackerName, message2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -879,14 +857,10 @@ CG_Obituary_Stomach
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
static void CG_Obituary_Stomach( entityState_t *ent ) {
|
static void CG_Obituary_Stomach( entityState_t *ent ) {
|
||||||
int mod;
|
int mod, target, attacker;
|
||||||
int target, attacker;
|
char *message, *message2;
|
||||||
char *message;
|
const char *targetInfo, *attackerInfo;
|
||||||
char *message2;
|
char targetName[32], attackerName[32];
|
||||||
const char *targetInfo;
|
|
||||||
const char *attackerInfo;
|
|
||||||
char targetName[32];
|
|
||||||
char attackerName[32];
|
|
||||||
gender_t gender;
|
gender_t gender;
|
||||||
clientInfo_t *ci;
|
clientInfo_t *ci;
|
||||||
|
|
||||||
|
@ -1052,9 +1026,12 @@ static void CG_Obituary_Stomach( entityState_t *ent ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// JBravo: live players dont get fraglines.
|
||||||
if (message) {
|
if (message) {
|
||||||
CG_Printf( "%s %s %s%s\n",
|
if (target != attacker && (cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR ||
|
||||||
targetName, message, attackerName, message2);
|
cg.snap->ps.clientNum == attacker))
|
||||||
|
CG_Printf( "%s %s %s%s\n",
|
||||||
|
targetName, message, attackerName, message2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1245,9 +1222,12 @@ static void CG_Obituary_Legs( entityState_t *ent ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// JBravo: live players dont get fraglines.
|
||||||
if (message) {
|
if (message) {
|
||||||
CG_Printf( "%s %s %s%s\n",
|
if (target != attacker && (cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR ||
|
||||||
targetName, message, attackerName, message2);
|
cg.snap->ps.clientNum == attacker))
|
||||||
|
CG_Printf( "%s %s %s%s\n",
|
||||||
|
targetName, message, attackerName, message2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.8 2002/03/18 12:25:10 jbravo
|
||||||
|
// Live players dont get fraglines, except their own. Cleanups and some
|
||||||
|
// hacks to get bots to stop using knives only.
|
||||||
|
//
|
||||||
// Revision 1.7 2002/01/11 20:20:58 jbravo
|
// Revision 1.7 2002/01/11 20:20:58 jbravo
|
||||||
// Adding TP to main branch
|
// Adding TP to main branch
|
||||||
//
|
//
|
||||||
|
@ -1577,7 +1581,9 @@ void BotChooseWeapon(bot_state_t *bs) {
|
||||||
else {
|
else {
|
||||||
newweaponnum = trap_BotChooseBestFightWeapon(bs->ws, bs->inventory);
|
newweaponnum = trap_BotChooseBestFightWeapon(bs->ws, bs->inventory);
|
||||||
if (bs->weaponnum != newweaponnum) bs->weaponchange_time = FloatTime();
|
if (bs->weaponnum != newweaponnum) bs->weaponchange_time = FloatTime();
|
||||||
bs->weaponnum = newweaponnum;
|
// JBravo: test hack
|
||||||
|
// bs->weaponnum = newweaponnum;
|
||||||
|
bs->weaponnum = WP_PISTOL;
|
||||||
//BotAI_Print(PRT_MESSAGE, "bs->weaponnum = %d\n", bs->weaponnum);
|
//BotAI_Print(PRT_MESSAGE, "bs->weaponnum = %d\n", bs->weaponnum);
|
||||||
trap_EA_SelectWeapon(bs->client, bs->weaponnum);
|
trap_EA_SelectWeapon(bs->client, bs->weaponnum);
|
||||||
}
|
}
|
||||||
|
@ -1629,7 +1635,8 @@ void BotCheckItemPickup(bot_state_t *bs, int *oldinventory) {
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
int offence, leader;
|
int offence, leader;
|
||||||
|
|
||||||
if (gametype <= GT_TEAM)
|
// if (gametype <= GT_TEAM)
|
||||||
|
if (gametype <= GT_TEAMPLAY)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
offence = -1;
|
offence = -1;
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.6 2002/03/18 12:25:10 jbravo
|
||||||
|
// Live players dont get fraglines, except their own. Cleanups and some
|
||||||
|
// hacks to get bots to stop using knives only.
|
||||||
|
//
|
||||||
// Revision 1.5 2002/01/11 19:48:29 jbravo
|
// Revision 1.5 2002/01/11 19:48:29 jbravo
|
||||||
// Formatted the source in non DOS format.
|
// Formatted the source in non DOS format.
|
||||||
//
|
//
|
||||||
|
@ -1978,6 +1982,8 @@ void BotTeamAI(bot_state_t *bs) {
|
||||||
//give orders
|
//give orders
|
||||||
switch(gametype) {
|
switch(gametype) {
|
||||||
case GT_TEAM:
|
case GT_TEAM:
|
||||||
|
// JBravo
|
||||||
|
case GT_TEAMPLAY:
|
||||||
{
|
{
|
||||||
if (bs->numteammates != numteammates || bs->forceorders) {
|
if (bs->numteammates != numteammates || bs->forceorders) {
|
||||||
bs->teamgiveorders_time = FloatTime();
|
bs->teamgiveorders_time = FloatTime();
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.52 2002/03/18 12:25:10 jbravo
|
||||||
|
// Live players dont get fraglines, except their own. Cleanups and some
|
||||||
|
// hacks to get bots to stop using knives only.
|
||||||
|
//
|
||||||
// Revision 1.51 2002/03/17 03:35:29 jbravo
|
// Revision 1.51 2002/03/17 03:35:29 jbravo
|
||||||
// More radio tewaks and cleanups.
|
// More radio tewaks and cleanups.
|
||||||
//
|
//
|
||||||
|
@ -694,60 +698,49 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
// broadcast the death event to everyone
|
// broadcast the death event to everyone
|
||||||
// Elder: use appropriate obit event and update statistics tracking
|
// Elder: use appropriate obit event and update statistics tracking
|
||||||
if ((self->client->lasthurt_location & LOCATION_HEAD) == LOCATION_HEAD ||
|
if ((self->client->lasthurt_location & LOCATION_HEAD) == LOCATION_HEAD ||
|
||||||
(self->client->lasthurt_location & LOCATION_FACE) == LOCATION_FACE)
|
(self->client->lasthurt_location & LOCATION_FACE) == LOCATION_FACE) {
|
||||||
{
|
|
||||||
// head kill
|
// head kill
|
||||||
if (level.team_round_going)
|
if (level.team_round_going) {
|
||||||
{
|
|
||||||
self->client->pers.records[REC_HEADDEATHS]++;
|
self->client->pers.records[REC_HEADDEATHS]++;
|
||||||
if (attacker && attacker->client) attacker->client->pers.records[REC_HEADKILLS]++;
|
if (attacker && attacker->client) attacker->client->pers.records[REC_HEADKILLS]++;
|
||||||
}
|
}
|
||||||
ent = G_TempEntity(self->r.currentOrigin, EV_OBITUARY_HEAD);
|
ent = G_TempEntity(self->r.currentOrigin, EV_OBITUARY_HEAD);
|
||||||
}
|
}
|
||||||
else if ((self->client->lasthurt_location & LOCATION_CHEST) == LOCATION_CHEST ||
|
else if ((self->client->lasthurt_location & LOCATION_CHEST) == LOCATION_CHEST ||
|
||||||
(self->client->lasthurt_location & LOCATION_SHOULDER) == LOCATION_SHOULDER)
|
(self->client->lasthurt_location & LOCATION_SHOULDER) == LOCATION_SHOULDER) {
|
||||||
{
|
|
||||||
// chest kill
|
// chest kill
|
||||||
if (level.team_round_going)
|
if (level.team_round_going) {
|
||||||
{
|
|
||||||
self->client->pers.records[REC_CHESTDEATHS]++;
|
self->client->pers.records[REC_CHESTDEATHS]++;
|
||||||
if (attacker && attacker->client) attacker->client->pers.records[REC_CHESTKILLS]++;
|
if (attacker && attacker->client) attacker->client->pers.records[REC_CHESTKILLS]++;
|
||||||
}
|
}
|
||||||
ent = G_TempEntity(self->r.currentOrigin, EV_OBITUARY_CHEST);
|
ent = G_TempEntity(self->r.currentOrigin, EV_OBITUARY_CHEST);
|
||||||
}
|
}
|
||||||
else if ((self->client->lasthurt_location & LOCATION_STOMACH) == LOCATION_STOMACH ||
|
else if ((self->client->lasthurt_location & LOCATION_STOMACH) == LOCATION_STOMACH ||
|
||||||
(self->client->lasthurt_location & LOCATION_GROIN) == LOCATION_GROIN)
|
(self->client->lasthurt_location & LOCATION_GROIN) == LOCATION_GROIN) {
|
||||||
{
|
|
||||||
// stomach kill
|
// stomach kill
|
||||||
if (level.team_round_going)
|
if (level.team_round_going) {
|
||||||
{
|
self->client->pers.records[REC_STOMACHDEATHS]++;
|
||||||
self->client->pers.records[REC_STOMACHDEATHS]++;
|
|
||||||
if (attacker && attacker->client) attacker->client->pers.records[REC_STOMACHKILLS]++;
|
if (attacker && attacker->client) attacker->client->pers.records[REC_STOMACHKILLS]++;
|
||||||
}
|
}
|
||||||
ent = G_TempEntity(self->r.currentOrigin, EV_OBITUARY_STOMACH);
|
ent = G_TempEntity(self->r.currentOrigin, EV_OBITUARY_STOMACH);
|
||||||
}
|
}
|
||||||
else if ((self->client->lasthurt_location & LOCATION_LEG) == LOCATION_LEG ||
|
else if ((self->client->lasthurt_location & LOCATION_LEG) == LOCATION_LEG ||
|
||||||
(self->client->lasthurt_location & LOCATION_FOOT) == LOCATION_FOOT)
|
(self->client->lasthurt_location & LOCATION_FOOT) == LOCATION_FOOT) {
|
||||||
{
|
|
||||||
// leg kill
|
// leg kill
|
||||||
if (level.team_round_going)
|
if (level.team_round_going) {
|
||||||
{
|
self->client->pers.records[REC_LEGDEATHS]++;
|
||||||
self->client->pers.records[REC_LEGDEATHS]++;
|
|
||||||
if (attacker && attacker->client) attacker->client->pers.records[REC_LEGKILLS]++;
|
if (attacker && attacker->client) attacker->client->pers.records[REC_LEGKILLS]++;
|
||||||
}
|
}
|
||||||
ent = G_TempEntity(self->r.currentOrigin, EV_OBITUARY_LEGS);
|
ent = G_TempEntity(self->r.currentOrigin, EV_OBITUARY_LEGS);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// non-location/world kill
|
// non-location/world kill
|
||||||
ent = G_TempEntity(self->r.currentOrigin, EV_OBITUARY);
|
ent = G_TempEntity(self->r.currentOrigin, EV_OBITUARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Elder: Statistics tracking
|
// Elder: Statistics tracking
|
||||||
//Blaze: make sure the game is in progress before recording stats
|
//Blaze: make sure the game is in progress before recording stats
|
||||||
if (level.team_round_going) {
|
if (level.team_round_going) {
|
||||||
switch (meansOfDeath)
|
switch (meansOfDeath) {
|
||||||
{
|
|
||||||
case MOD_KNIFE:
|
case MOD_KNIFE:
|
||||||
if (attacker && attacker->client)
|
if (attacker && attacker->client)
|
||||||
attacker->client->pers.records[REC_KNIFESLASHKILLS]++;
|
attacker->client->pers.records[REC_KNIFESLASHKILLS]++;
|
||||||
|
@ -807,22 +800,20 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
// JBravo: adding a default here to catch potential bugs
|
// JBravo: adding a default here to catch potential bugs
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}//SWITCH
|
}
|
||||||
}//IF
|
}
|
||||||
ent->s.eventParm = meansOfDeath;
|
ent->s.eventParm = meansOfDeath;
|
||||||
ent->s.otherEntityNum = self->s.number;
|
ent->s.otherEntityNum = self->s.number;
|
||||||
ent->s.otherEntityNum2 = killer;
|
ent->s.otherEntityNum2 = killer;
|
||||||
ent->r.svFlags = SVF_BROADCAST; // send to everyone
|
ent->r.svFlags = SVF_BROADCAST; // send to everyone
|
||||||
self->enemy = attacker;
|
self->enemy = attacker;
|
||||||
if (level.team_round_going)
|
if (level.team_round_going) {
|
||||||
{
|
self->client->ps.persistant[PERS_KILLED]++;
|
||||||
self->client->ps.persistant[PERS_KILLED]++;
|
//Blaze: Give the attacker 1 kill
|
||||||
//Blaze: Give the attacker 1 kill
|
attacker->client->pers.records[REC_KILLS]++;
|
||||||
attacker->client->pers.records[REC_KILLS]++;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (attacker && attacker->client) {
|
if (attacker && attacker->client) {
|
||||||
// attacker->client->lastkilled_client = self->s.number;
|
|
||||||
// JBravo: Add multiple last killed system.
|
// JBravo: Add multiple last killed system.
|
||||||
AddKilledPlayer(attacker, self);
|
AddKilledPlayer(attacker, self);
|
||||||
ResetKills(self);
|
ResetKills(self);
|
||||||
|
@ -830,10 +821,10 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
if (attacker == self || OnSameTeam (self, attacker)) {
|
if (attacker == self || OnSameTeam (self, attacker)) {
|
||||||
if (level.team_round_going) {
|
if (level.team_round_going) {
|
||||||
AddScore(attacker, self->r.currentOrigin, -1);
|
AddScore(attacker, self->r.currentOrigin, -1);
|
||||||
//If the kill was a TK, remove 1 from REC_KILLS to negate the one given earlyier
|
//If the kill was a TK, remove 1 from REC_KILLS to negate the one given earlyier
|
||||||
attacker->client->pers.records[REC_KILLS]--;
|
attacker->client->pers.records[REC_KILLS]--;
|
||||||
//Also, increment the TK's record
|
//Also, increment the TK's record
|
||||||
attacker->client->pers.records[REC_TEAMKILLS]++;
|
attacker->client->pers.records[REC_TEAMKILLS]++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Increase number of kills this life for attacker
|
// Increase number of kills this life for attacker
|
||||||
|
@ -915,12 +906,11 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
// Unless we are in teamplay
|
// Unless we are in teamplay
|
||||||
if (meansOfDeath == MOD_SUICIDE) {
|
if (meansOfDeath == MOD_SUICIDE) {
|
||||||
// Elder: Statistics tracking
|
// Elder: Statistics tracking
|
||||||
if (level.team_round_going)
|
if (level.team_round_going) {
|
||||||
{
|
self->client->pers.records[REC_SUICIDES]++;
|
||||||
self->client->pers.records[REC_SUICIDES]++;
|
self->client->pers.records[REC_KILLS]--;
|
||||||
self->client->pers.records[REC_KILLS]--;
|
}
|
||||||
}
|
AddScore(self, self->r.currentOrigin, -1);
|
||||||
AddScore(self, self->r.currentOrigin, -1);
|
|
||||||
if (g_gametype.integer != GT_TEAMPLAY) {
|
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||||
if ( self->client->ps.powerups[PW_NEUTRALFLAG] ) { // only happens in One Flag CTF
|
if ( self->client->ps.powerups[PW_NEUTRALFLAG] ) { // only happens in One Flag CTF
|
||||||
Team_ReturnFlag( TEAM_FREE );
|
Team_ReturnFlag( TEAM_FREE );
|
||||||
|
@ -983,7 +973,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
// JBravo: make clients that are following this one stop following.
|
// JBravo: make clients that are following this one stop following.
|
||||||
if (client->sess.spectatorClient == self->s.number) {
|
if (client->sess.spectatorClient == self->s.number) {
|
||||||
if (g_gametype.integer == GT_TEAMPLAY) {
|
if (g_gametype.integer == GT_TEAMPLAY) {
|
||||||
StopFollowing(follower);
|
// StopFollowing(follower);
|
||||||
|
Cmd_FollowCycle_f(follower, 1);
|
||||||
} else {
|
} else {
|
||||||
Cmd_Score_f(g_entities + i);
|
Cmd_Score_f(g_entities + i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.38 2002/03/18 12:25:10 jbravo
|
||||||
|
// Live players dont get fraglines, except their own. Cleanups and some
|
||||||
|
// hacks to get bots to stop using knives only.
|
||||||
|
//
|
||||||
// Revision 1.37 2002/03/17 16:38:57 jbravo
|
// Revision 1.37 2002/03/17 16:38:57 jbravo
|
||||||
// Colored nicks fucked up the string in $K messages.
|
// Colored nicks fucked up the string in $K messages.
|
||||||
//
|
//
|
||||||
|
@ -780,6 +784,11 @@ void EquipPlayer (gentity_t *ent)
|
||||||
ent->client->ps.generic1 = ((ent->client->ps.generic1 & ANIM_TOGGLEBIT) ^
|
ent->client->ps.generic1 = ((ent->client->ps.generic1 & ANIM_TOGGLEBIT) ^
|
||||||
ANIM_TOGGLEBIT) | WP_ANIM_ACTIVATE;
|
ANIM_TOGGLEBIT) | WP_ANIM_ACTIVATE;
|
||||||
}
|
}
|
||||||
|
if (ent->r.svFlags & SVF_BOT) {
|
||||||
|
ent->client->ps.stats[STAT_WEAPONS] = ( 1 << WP_PISTOL );
|
||||||
|
ent->client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_KNIFE );
|
||||||
|
ent->client->uniqueWeapons = 0;
|
||||||
|
}
|
||||||
ent->client->ps.weaponstate = WEAPON_RAISING;
|
ent->client->ps.weaponstate = WEAPON_RAISING;
|
||||||
|
|
||||||
ent->client->ps.stats[STAT_HOLDABLE_ITEM] = BG_FindItemForHoldable( ent->client->teamplayItem ) - bg_itemlist;
|
ent->client->ps.stats[STAT_HOLDABLE_ITEM] = BG_FindItemForHoldable( ent->client->teamplayItem ) - bg_itemlist;
|
||||||
|
|
Loading…
Reference in a new issue