mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-02-01 22:30:53 +00:00
Cleaning up player_die and possibly fixing the scores
This commit is contained in:
parent
166f379675
commit
4ed445fd36
1 changed files with 125 additions and 154 deletions
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.38 2002/02/05 10:45:31 jbravo
|
||||||
|
// Cleaning up player_die and possibly fixing the scores
|
||||||
|
//
|
||||||
// Revision 1.37 2002/01/31 01:53:30 jbravo
|
// Revision 1.37 2002/01/31 01:53:30 jbravo
|
||||||
// FF/no-FF fixes. g_friendlyFire 0 = no FF, 1 = FF, 2 = no FF + knockback
|
// FF/no-FF fixes. g_friendlyFire 0 = no FF, 1 = FF, 2 = no FF + knockback
|
||||||
//
|
//
|
||||||
|
@ -560,53 +563,46 @@ player_die
|
||||||
void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath ) {
|
void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath ) {
|
||||||
gentity_t *ent;
|
gentity_t *ent;
|
||||||
gentity_t *DMReward;
|
gentity_t *DMReward;
|
||||||
int anim;
|
int anim, contents, killer, i;
|
||||||
int contents;
|
|
||||||
int killer;
|
|
||||||
int i;
|
|
||||||
char *killerName, *obit;
|
char *killerName, *obit;
|
||||||
|
|
||||||
//Blaze: Stop bleeding when dead
|
//Blaze: Stop bleeding when dead
|
||||||
if ( self->client )
|
if ( self->client )
|
||||||
{
|
{
|
||||||
//Elder: drop the primed grenade
|
//Elder: drop the primed grenade
|
||||||
if (self->client->ps.weapon == WP_GRENADE &&
|
if (self->client->ps.weapon == WP_GRENADE &&
|
||||||
self->client->ps.weaponstate == WEAPON_COCKED) {
|
self->client->ps.weaponstate == WEAPON_COCKED) {
|
||||||
FireWeapon(self);
|
FireWeapon(self);
|
||||||
}
|
}
|
||||||
// Hawkins put spread back and zoom out
|
// Hawkins put spread back and zoom out
|
||||||
|
|
||||||
//Elder: remove zoom bits
|
//Elder: remove zoom bits
|
||||||
Cmd_Unzoom(self);
|
Cmd_Unzoom(self);
|
||||||
self->client->bleeding = 0;
|
self->client->bleeding = 0;
|
||||||
self->client->bleed_remain = 0;
|
self->client->bleed_remain = 0;
|
||||||
//Elder: added;
|
//Elder: added;
|
||||||
self->client->ps.stats[STAT_RQ3] &= ~RQ3_BANDAGE_WORK;
|
self->client->ps.stats[STAT_RQ3] &= ~RQ3_BANDAGE_WORK;
|
||||||
self->client->ps.stats[STAT_RQ3] &= ~RQ3_BANDAGE_NEED;
|
self->client->ps.stats[STAT_RQ3] &= ~RQ3_BANDAGE_NEED;
|
||||||
self->client->killStreak = 0;
|
self->client->killStreak = 0;
|
||||||
|
|
||||||
//Elder: stop reload attempts
|
//Elder: stop reload attempts
|
||||||
self->client->reloadAttempts = 0;
|
self->client->reloadAttempts = 0;
|
||||||
}
|
}
|
||||||
if ( self->client->ps.pm_type == PM_DEAD ) {
|
if (self->client->ps.pm_type == PM_DEAD) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( level.intermissiontime ) {
|
if (level.intermissiontime) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// JBravo: lets not bother with those CTF functions in Teamplay
|
// JBravo: lets not bother with those CTF functions in Teamplay
|
||||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||||
// check for an almost capture
|
// check for an almost capture
|
||||||
CheckAlmostCapture( self, attacker );
|
CheckAlmostCapture( self, attacker );
|
||||||
// check for a player that almost brought in cubes
|
// check for a player that almost brought in cubes
|
||||||
CheckAlmostScored( self, attacker );
|
CheckAlmostScored( self, attacker );
|
||||||
}
|
}
|
||||||
|
|
||||||
//Blaze: No Hook
|
|
||||||
// if (self->client && self->client->hook)
|
|
||||||
// Weapon_HookFree(self->client->hook);
|
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
if ((self->client->ps.eFlags & EF_TICKING) && self->activator) {
|
if ((self->client->ps.eFlags & EF_TICKING) && self->activator) {
|
||||||
self->client->ps.eFlags &= ~EF_TICKING;
|
self->client->ps.eFlags &= ~EF_TICKING;
|
||||||
|
@ -616,9 +612,9 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
#endif
|
#endif
|
||||||
self->client->ps.pm_type = PM_DEAD;
|
self->client->ps.pm_type = PM_DEAD;
|
||||||
|
|
||||||
if ( attacker ) {
|
if (attacker) {
|
||||||
killer = attacker->s.number;
|
killer = attacker->s.number;
|
||||||
if ( attacker->client ) {
|
if (attacker->client) {
|
||||||
killerName = attacker->client->pers.netname;
|
killerName = attacker->client->pers.netname;
|
||||||
} else {
|
} else {
|
||||||
killerName = "<non-client>";
|
killerName = "<non-client>";
|
||||||
|
@ -628,17 +624,17 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
killerName = "<world>";
|
killerName = "<world>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( killer < 0 || killer >= MAX_CLIENTS ) {
|
if (killer < 0 || killer >= MAX_CLIENTS) {
|
||||||
killer = ENTITYNUM_WORLD;
|
killer = ENTITYNUM_WORLD;
|
||||||
killerName = "<world>";
|
killerName = "<world>";
|
||||||
// Elder: Statistics tracking
|
// Elder: Statistics tracking
|
||||||
self->client->pers.records[REC_WORLDDEATHS]++;
|
self->client->pers.records[REC_WORLDDEATHS]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( meansOfDeath < 0 || meansOfDeath >= sizeof( modNames ) / sizeof( modNames[0] ) ) {
|
if (meansOfDeath < 0 || meansOfDeath >= sizeof(modNames) / sizeof(modNames[0])) {
|
||||||
obit = "<bad obituary>";
|
obit = "<bad obituary>";
|
||||||
} else {
|
} else {
|
||||||
obit = modNames[ meansOfDeath ];
|
obit = modNames[meansOfDeath];
|
||||||
}
|
}
|
||||||
|
|
||||||
G_LogPrintf("Kill: %i %i %i: %s killed %s by %s\n",
|
G_LogPrintf("Kill: %i %i %i: %s killed %s by %s\n",
|
||||||
|
@ -647,50 +643,50 @@ 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
|
||||||
self->client->pers.records[REC_HEADDEATHS]++;
|
self->client->pers.records[REC_HEADDEATHS]++;
|
||||||
if (attacker && attacker->client)
|
if (attacker && attacker->client)
|
||||||
attacker->client->pers.records[REC_HEADKILLS]++;
|
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
|
||||||
self->client->pers.records[REC_CHESTDEATHS]++;
|
self->client->pers.records[REC_CHESTDEATHS]++;
|
||||||
if (attacker && attacker->client)
|
if (attacker && attacker->client)
|
||||||
attacker->client->pers.records[REC_CHESTKILLS]++;
|
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
|
||||||
self->client->pers.records[REC_STOMACHDEATHS]++;
|
self->client->pers.records[REC_STOMACHDEATHS]++;
|
||||||
if (attacker && attacker->client)
|
if (attacker && attacker->client)
|
||||||
attacker->client->pers.records[REC_STOMACHKILLS]++;
|
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
|
||||||
self->client->pers.records[REC_LEGDEATHS]++;
|
self->client->pers.records[REC_LEGDEATHS]++;
|
||||||
if (attacker && attacker->client)
|
if (attacker && attacker->client)
|
||||||
attacker->client->pers.records[REC_LEGKILLS]++;
|
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
|
||||||
switch ( meansOfDeath )
|
switch (meansOfDeath)
|
||||||
{
|
{
|
||||||
case MOD_KNIFE:
|
case MOD_KNIFE:
|
||||||
if (attacker && attacker->client)
|
if (attacker && attacker->client)
|
||||||
|
@ -748,93 +744,89 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
attacker->client->pers.records[REC_KICKKILLS]++;
|
attacker->client->pers.records[REC_KICKKILLS]++;
|
||||||
self->client->pers.records[REC_KICKDEATHS]++;
|
self->client->pers.records[REC_KICKDEATHS]++;
|
||||||
break;
|
break;
|
||||||
|
// JBravo: adding a default here to catch potential bugs
|
||||||
|
default:
|
||||||
|
G_Printf("Unknown Means of Death!\n");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
self->client->ps.persistant[PERS_KILLED]++;
|
self->client->ps.persistant[PERS_KILLED]++;
|
||||||
|
|
||||||
if (attacker && attacker->client) {
|
if (attacker && attacker->client) {
|
||||||
attacker->client->lastkilled_client = self->s.number;
|
attacker->client->lastkilled_client = self->s.number;
|
||||||
|
|
||||||
if ( attacker == self || OnSameTeam (self, attacker ) ) {
|
if (attacker == self || OnSameTeam (self, attacker)) {
|
||||||
AddScore( attacker, self->r.currentOrigin, -1 );
|
AddScore(attacker, self->r.currentOrigin, -1);
|
||||||
} else {
|
} else {
|
||||||
// Increase number of kills this life for attacker
|
// Increase number of kills this life for attacker
|
||||||
// JBravo: unless we are in teamplay
|
// JBravo: unless we are in teamplay
|
||||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
if (g_gametype.integer == GT_TEAMPLAY) {
|
||||||
attacker->client->killStreak++;
|
attacker->client->killStreak = 0;
|
||||||
|
AddScore(attacker, self->r.currentOrigin, 1);
|
||||||
|
} else {
|
||||||
|
attacker->client->killStreak++;
|
||||||
}
|
}
|
||||||
// DM reward scoring, should add an if statement to get around this when
|
// DM reward scoring, should add an if statement to get around this when
|
||||||
// we add teamplay.
|
// we add teamplay.
|
||||||
// Done ;)
|
// JBravo: Done ;)
|
||||||
if (attacker->client->killStreak < 4)
|
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||||
AddScore( attacker, self->r.currentOrigin, 1 );
|
if (attacker->client->killStreak < 4)
|
||||||
else if (attacker->client->killStreak < 8)
|
AddScore(attacker, self->r.currentOrigin, 1);
|
||||||
{ AddScore( attacker, self->r.currentOrigin, 2 );
|
else if (attacker->client->killStreak < 8) {
|
||||||
DMReward = G_TempEntity(self->r.currentOrigin ,EV_DMREWARD);
|
AddScore(attacker, self->r.currentOrigin, 2);
|
||||||
DMReward->s.otherEntityNum2 = killer;
|
DMReward = G_TempEntity(self->r.currentOrigin, EV_DMREWARD);
|
||||||
DMReward->s.eventParm = attacker->client->killStreak;
|
DMReward->s.otherEntityNum2 = killer;
|
||||||
DMReward->r.svFlags = SVF_BROADCAST;
|
DMReward->s.eventParm = attacker->client->killStreak;
|
||||||
|
DMReward->r.svFlags = SVF_BROADCAST;
|
||||||
|
}
|
||||||
|
else if (attacker->client->killStreak < 16) {
|
||||||
|
AddScore(attacker, self->r.currentOrigin, 4);
|
||||||
|
DMReward = G_TempEntity(self->r.currentOrigin, EV_DMREWARD);
|
||||||
|
DMReward->s.otherEntityNum2 = killer;
|
||||||
|
DMReward->s.eventParm = attacker->client->killStreak;
|
||||||
|
DMReward->r.svFlags = SVF_BROADCAST;
|
||||||
|
}
|
||||||
|
else if (attacker->client->killStreak < 32) {
|
||||||
|
AddScore(attacker, self->r.currentOrigin, 8);
|
||||||
|
DMReward = G_TempEntity(self->r.currentOrigin, EV_DMREWARD);
|
||||||
|
DMReward->s.otherEntityNum2 = killer;
|
||||||
|
DMReward->s.eventParm = attacker->client->killStreak;
|
||||||
|
DMReward->r.svFlags = SVF_BROADCAST;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddScore(attacker, self->r.currentOrigin, 16);
|
||||||
|
DMReward = G_TempEntity(self->r.currentOrigin, EV_DMREWARD);
|
||||||
|
DMReward->s.otherEntityNum2 = killer;
|
||||||
|
DMReward->s.eventParm = attacker->client->killStreak;
|
||||||
|
DMReward->r.svFlags = SVF_BROADCAST;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (attacker->client->killStreak < 16)
|
|
||||||
{ AddScore( attacker, self->r.currentOrigin, 4 );
|
|
||||||
DMReward = G_TempEntity(self->r.currentOrigin ,EV_DMREWARD);
|
|
||||||
DMReward->s.otherEntityNum2 = killer;
|
|
||||||
DMReward->s.eventParm = attacker->client->killStreak;
|
|
||||||
DMReward->r.svFlags = SVF_BROADCAST;
|
|
||||||
}
|
|
||||||
else if (attacker->client->killStreak < 32)
|
|
||||||
{ AddScore( attacker, self->r.currentOrigin, 8 );
|
|
||||||
DMReward = G_TempEntity(self->r.currentOrigin ,EV_DMREWARD);
|
|
||||||
DMReward->s.otherEntityNum2 = killer;
|
|
||||||
DMReward->s.eventParm = attacker->client->killStreak;
|
|
||||||
DMReward->r.svFlags = SVF_BROADCAST;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ AddScore( attacker, self->r.currentOrigin, 16 );
|
|
||||||
DMReward = G_TempEntity(self->r.currentOrigin ,EV_DMREWARD);
|
|
||||||
DMReward->s.otherEntityNum2 = killer;
|
|
||||||
DMReward->s.eventParm = attacker->client->killStreak;
|
|
||||||
DMReward->r.svFlags = SVF_BROADCAST;
|
|
||||||
}
|
|
||||||
|
|
||||||
//if( meansOfDeath == MOD_GAUNTLET ) {
|
|
||||||
//Elder: changed to knife slash heh
|
//Elder: changed to knife slash heh
|
||||||
if( meansOfDeath == MOD_KNIFE ) {
|
if(meansOfDeath == MOD_KNIFE) {
|
||||||
// play humiliation on player
|
|
||||||
//Blaze: Removed because it uses the persistant stats stuff
|
|
||||||
//attacker->client->ps.persistant[PERS_GAUNTLET_FRAG_COUNT]++;
|
|
||||||
|
|
||||||
// add the sprite over the player's head
|
// add the sprite over the player's head
|
||||||
attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
|
attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
|
||||||
attacker->client->ps.eFlags |= EF_AWARD_GAUNTLET;
|
attacker->client->ps.eFlags |= EF_AWARD_GAUNTLET;
|
||||||
attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME;
|
attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME;
|
||||||
|
|
||||||
// also play humiliation on target
|
// also play humiliation on target
|
||||||
|
|
||||||
self->client->ps.persistant[PERS_PLAYEREVENTS] ^= PLAYEREVENT_GAUNTLETREWARD;
|
self->client->ps.persistant[PERS_PLAYEREVENTS] ^= PLAYEREVENT_GAUNTLETREWARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for two kills in a short amount of time
|
// check for two kills in a short amount of time
|
||||||
// if this is close enough to the last kill, give a reward sound
|
// if this is close enough to the last kill, give a reward sound
|
||||||
if ( level.time - attacker->client->lastKillTime < CARNAGE_REWARD_TIME ) {
|
if ( level.time - attacker->client->lastKillTime < CARNAGE_REWARD_TIME ) {
|
||||||
// play excellent on player
|
|
||||||
//Blaze: Removed because it uses the persistant stats stuff
|
|
||||||
//attacker->client->ps.persistant[PERS_EXCELLENT_COUNT]++;
|
|
||||||
|
|
||||||
// add the sprite over the player's head
|
// add the sprite over the player's head
|
||||||
attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
|
attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
|
||||||
attacker->client->ps.eFlags |= EF_AWARD_EXCELLENT;
|
attacker->client->ps.eFlags |= EF_AWARD_EXCELLENT;
|
||||||
attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME;
|
attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME;
|
||||||
}
|
}
|
||||||
attacker->client->lastKillTime = level.time;
|
attacker->client->lastKillTime = level.time;
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
AddScore( self, self->r.currentOrigin, -1 );
|
AddScore( self, self->r.currentOrigin, -1 );
|
||||||
|
@ -842,8 +834,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
|
|
||||||
// Add team bonuses
|
// Add team bonuses
|
||||||
// JBravo: unless we are in teamplay
|
// JBravo: unless we are in teamplay
|
||||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||||
Team_FragBonuses(self, inflictor, attacker);
|
Team_FragBonuses(self, inflictor, attacker);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if I committed suicide, the flag does not fall, it returns.
|
// if I committed suicide, the flag does not fall, it returns.
|
||||||
|
@ -852,44 +844,37 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
// Elder: Statistics tracking
|
// Elder: Statistics tracking
|
||||||
self->client->pers.records[REC_SUICIDES]++;
|
self->client->pers.records[REC_SUICIDES]++;
|
||||||
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 );
|
||||||
self->client->ps.powerups[PW_NEUTRALFLAG] = 0;
|
self->client->ps.powerups[PW_NEUTRALFLAG] = 0;
|
||||||
|
}
|
||||||
|
else if ( self->client->ps.powerups[PW_REDFLAG] ) { // only happens in standard CTF
|
||||||
|
Team_ReturnFlag( TEAM_RED );
|
||||||
|
self->client->ps.powerups[PW_REDFLAG] = 0;
|
||||||
|
}
|
||||||
|
else if ( self->client->ps.powerups[PW_BLUEFLAG] ) { // only happens in standard CTF
|
||||||
|
Team_ReturnFlag( TEAM_BLUE );
|
||||||
|
self->client->ps.powerups[PW_BLUEFLAG] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( self->client->ps.powerups[PW_REDFLAG] ) { // only happens in standard CTF
|
|
||||||
Team_ReturnFlag( TEAM_RED );
|
|
||||||
self->client->ps.powerups[PW_REDFLAG] = 0;
|
|
||||||
}
|
|
||||||
else if ( self->client->ps.powerups[PW_BLUEFLAG] ) { // only happens in standard CTF
|
|
||||||
Team_ReturnFlag( TEAM_BLUE );
|
|
||||||
self->client->ps.powerups[PW_BLUEFLAG] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if client is in a nodrop area, don't drop anything (but return CTF flags!)
|
// if client is in a nodrop area, don't drop anything (but return CTF flags!)
|
||||||
contents = trap_PointContents( self->r.currentOrigin, -1 );
|
contents = trap_PointContents( self->r.currentOrigin, -1 );
|
||||||
if ( !( contents & CONTENTS_NODROP ) ) {
|
if ( !(contents & CONTENTS_NODROP)) {
|
||||||
TossClientItems( self );
|
TossClientItems(self);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
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 );
|
||||||
|
}
|
||||||
|
else if ( self->client->ps.powerups[PW_REDFLAG] ) { // only happens in standard CTF
|
||||||
|
Team_ReturnFlag(TEAM_RED);
|
||||||
|
}
|
||||||
|
else if ( self->client->ps.powerups[PW_BLUEFLAG] ) { // only happens in standard CTF
|
||||||
|
Team_ReturnFlag(TEAM_BLUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( self->client->ps.powerups[PW_REDFLAG] ) { // only happens in standard CTF
|
|
||||||
Team_ReturnFlag(TEAM_RED);
|
|
||||||
}
|
|
||||||
else if ( self->client->ps.powerups[PW_BLUEFLAG] ) { // only happens in standard CTF
|
|
||||||
Team_ReturnFlag(TEAM_BLUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Elder: include immediate item and weapon return here -- but handled in G_RunItem?
|
|
||||||
//if ( self->client->ps.stats[STAT_HOLDABLE_ITEM] )
|
|
||||||
//{
|
|
||||||
//RQ3_ResetItem(bg_itemlist[self->client->ps.stats[STAT_HOLDABLE_ITEM]].giTag);
|
|
||||||
//self->client->ps.stats[STAT_HOLDABLE_ITEM] = 0;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
TossClientPersistantPowerups( self );
|
TossClientPersistantPowerups( self );
|
||||||
|
@ -898,70 +883,62 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Cmd_Score_f( self ); // show scores
|
Cmd_Score_f(self); // show scores
|
||||||
// send updated scores to any clients that are following this one,
|
// send updated scores to any clients that are following this one,
|
||||||
// or they would get stale scoreboards
|
// or they would get stale scoreboards
|
||||||
for ( i = 0 ; i < level.maxclients ; i++ ) {
|
for (i = 0 ; i < level.maxclients ; i++) {
|
||||||
gclient_t *client;
|
gclient_t *client;
|
||||||
|
|
||||||
client = &level.clients[i];
|
client = &level.clients[i];
|
||||||
if ( client->pers.connected != CON_CONNECTED ) {
|
if (client->pers.connected != CON_CONNECTED) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( client->sess.sessionTeam != TEAM_SPECTATOR ) {
|
if (client->sess.sessionTeam != TEAM_SPECTATOR) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( client->sess.spectatorClient == self->s.number ) {
|
if (client->sess.spectatorClient == self->s.number) {
|
||||||
Cmd_Score_f( g_entities + i );
|
Cmd_Score_f(g_entities + i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self->takedamage = qtrue; // can still be gibbed
|
self->takedamage = qtrue; // can still be gibbed
|
||||||
|
|
||||||
self->s.weapon = WP_NONE;
|
self->s.weapon = WP_NONE;
|
||||||
self->s.powerups = 0;
|
self->s.powerups = 0;
|
||||||
|
|
||||||
|
|
||||||
// Elder: HC smoke
|
// Elder: HC smoke
|
||||||
//G_Printf("player_die: damage_knockback: %i\n", self->client->damage_knockback);
|
if (meansOfDeath == MOD_HANDCANNON && self->client->damage_knockback > RQ3_HANDCANNON_KICK * 4) {
|
||||||
if (meansOfDeath == MOD_HANDCANNON && self->client->damage_knockback > RQ3_HANDCANNON_KICK * 4) //self->client->ps.stats[STAT_HEALTH] < -50)
|
|
||||||
{
|
|
||||||
//G_Printf("Smoked\n");
|
|
||||||
self->client->ps.eFlags |= EF_HANDCANNON_SMOKED;
|
self->client->ps.eFlags |= EF_HANDCANNON_SMOKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
self->r.contents = CONTENTS_CORPSE;
|
self->r.contents = CONTENTS_CORPSE;
|
||||||
|
|
||||||
self->s.angles[0] = 0;
|
self->s.angles[0] = 0;
|
||||||
self->s.angles[2] = 0;
|
self->s.angles[2] = 0;
|
||||||
LookAtKiller (self, inflictor, attacker);
|
|
||||||
|
|
||||||
VectorCopy( self->s.angles, self->client->ps.viewangles );
|
LookAtKiller (self, inflictor, attacker);
|
||||||
|
VectorCopy(self->s.angles, self->client->ps.viewangles);
|
||||||
|
|
||||||
self->s.loopSound = 0;
|
self->s.loopSound = 0;
|
||||||
|
|
||||||
self->r.maxs[2] = -8;
|
self->r.maxs[2] = -8;
|
||||||
|
|
||||||
// don't allow respawn until the death anim is done
|
// don't allow respawn until the death anim is done
|
||||||
// g_forcerespawn may force spawning at some later time
|
// g_forcerespawn may force spawning at some later time
|
||||||
// JBravo: we dont want automatic respawning of players in teamplay
|
// JBravo: we dont want automatic respawning of players in teamplay
|
||||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||||
self->client->respawnTime = level.time + 1700;
|
self->client->respawnTime = level.time + 1700;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove powerups
|
// remove powerups
|
||||||
memset( self->client->ps.powerups, 0, sizeof(self->client->ps.powerups) );
|
memset(self->client->ps.powerups, 0, sizeof(self->client->ps.powerups));
|
||||||
|
|
||||||
// never gib in a nodrop
|
// never gib in a nodrop
|
||||||
if ( (self->health <= GIB_HEALTH && !(contents & CONTENTS_NODROP) && g_blood.integer) || meansOfDeath == MOD_SUICIDE) {
|
if ((self->health <= GIB_HEALTH && !(contents & CONTENTS_NODROP) && g_blood.integer) || meansOfDeath == MOD_SUICIDE) {
|
||||||
// gib death
|
// gib death
|
||||||
GibEntity( self, killer );
|
GibEntity( self, killer );
|
||||||
} else {
|
} else {
|
||||||
// normal death
|
// normal death
|
||||||
static int i;
|
static int i;
|
||||||
|
|
||||||
switch ( i ) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
anim = BOTH_DEATH1;
|
anim = BOTH_DEATH1;
|
||||||
break;
|
break;
|
||||||
|
@ -976,20 +953,16 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
|
|
||||||
// for the no-blood option, we need to prevent the health
|
// for the no-blood option, we need to prevent the health
|
||||||
// from going to gib level
|
// from going to gib level
|
||||||
if ( self->health <= GIB_HEALTH ) {
|
if (self->health <= GIB_HEALTH) {
|
||||||
self->health = GIB_HEALTH+1;
|
self->health = GIB_HEALTH+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->client->ps.legsAnim =
|
self->client->ps.legsAnim =
|
||||||
( ( self->client->ps.legsAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | anim;
|
((self->client->ps.legsAnim & ANIM_TOGGLEBIT) ^ ANIM_TOGGLEBIT) | anim;
|
||||||
self->client->ps.torsoAnim =
|
self->client->ps.torsoAnim =
|
||||||
( ( self->client->ps.torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | anim;
|
((self->client->ps.torsoAnim & ANIM_TOGGLEBIT) ^ ANIM_TOGGLEBIT) | anim;
|
||||||
|
|
||||||
// Elder: only do death sounds if not hit in the head
|
// Elder: only do death sounds if not hit in the head
|
||||||
//G_Printf("Shot Diff: %i\n", level.time - self->client->headShotTime);
|
|
||||||
|
|
||||||
//if ((self->client->lasthurt_location & LOCATION_HEAD) != LOCATION_HEAD &&
|
|
||||||
//(self->client->lasthurt_location & LOCATION_FACE) != LOCATION_FACE &&
|
|
||||||
if (level.time - self->client->headShotTime > 400)
|
if (level.time - self->client->headShotTime > 400)
|
||||||
G_AddEvent( self, EV_DEATH1 + i, killer );
|
G_AddEvent( self, EV_DEATH1 + i, killer );
|
||||||
|
|
||||||
|
@ -1001,7 +974,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
|
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
if (self->s.eFlags & EF_KAMIKAZE) {
|
if (self->s.eFlags & EF_KAMIKAZE) {
|
||||||
Kamikaze_DeathTimer( self );
|
Kamikaze_DeathTimer(self);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1009,18 +982,16 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
trap_LinkEntity (self);
|
trap_LinkEntity (self);
|
||||||
|
|
||||||
// JBravo: Save the dead players team status, and respawn his as a spectator.
|
// JBravo: Save the dead players team status, and respawn his as a spectator.
|
||||||
if( g_gametype.integer == GT_TEAMPLAY ) {
|
if (g_gametype.integer == GT_TEAMPLAY) {
|
||||||
CopyToBodyQue (self);
|
CopyToBodyQue (self);
|
||||||
self->client->weaponCount[self->client->ps.weapon] = 0;
|
self->client->weaponCount[self->client->ps.weapon] = 0;
|
||||||
self->client->ps.stats[STAT_WEAPONS] = 0;
|
self->client->ps.stats[STAT_WEAPONS] = 0;
|
||||||
self->client->sess.savedTeam = self->client->sess.sessionTeam;
|
self->client->sess.savedTeam = self->client->sess.sessionTeam;
|
||||||
self->client->sess.sessionTeam = TEAM_SPECTATOR;
|
self->client->sess.sessionTeam = TEAM_SPECTATOR;
|
||||||
ClientSpawn( self );
|
ClientSpawn(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
CheckArmor
|
CheckArmor
|
||||||
|
|
Loading…
Reference in a new issue