Added a respawn delay for CTB

This commit is contained in:
Richard Allen 2002-07-24 02:17:38 +00:00
parent 5f83662aa5
commit 614769430f
4 changed files with 29 additions and 1 deletions

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.86 2002/07/24 02:17:38 jbravo
// Added a respawn delay for CTB
//
// Revision 1.85 2002/07/22 06:33:04 niceass // Revision 1.85 2002/07/22 06:33:04 niceass
// cleaned up the powerup code // cleaned up the powerup code
// //
@ -1182,13 +1185,20 @@ void ClientThink_real(gentity_t * ent)
// forcerespawn is to prevent users from waiting out powerups // forcerespawn is to prevent users from waiting out powerups
if (g_forcerespawn.integer > 0 && if (g_forcerespawn.integer > 0 &&
(level.time - client->respawnTime) > g_forcerespawn.integer * 1000 && (level.time - client->respawnTime) > g_forcerespawn.integer * 1000 &&
g_gametype.integer != GT_TEAMPLAY) { g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) {
respawn(ent); respawn(ent);
return; return;
} }
if (g_gametype.integer == GT_TEAMPLAY && level.time > client->respawnTime) { if (g_gametype.integer == GT_TEAMPLAY && level.time > client->respawnTime) {
MakeSpectator(ent); MakeSpectator(ent);
} }
if (g_gametype.integer == GT_CTF) {
if (level.time > client->time_of_death + (g_RQ3_ctb_respawndelay.integer * 1000)) {
respawn(ent);
} else {
return;
}
}
// pressing attack or use is the normal respawn method // pressing attack or use is the normal respawn method
// JBravo: make'em spactate // JBravo: make'em spactate
if (ucmd->buttons & (BUTTON_ATTACK | BUTTON_USE_HOLDABLE)) { if (ucmd->buttons & (BUTTON_ATTACK | BUTTON_USE_HOLDABLE)) {

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.112 2002/07/24 02:17:38 jbravo
// Added a respawn delay for CTB
//
// Revision 1.111 2002/07/20 18:26:25 jbravo // Revision 1.111 2002/07/20 18:26:25 jbravo
// FF 2 fix for CTB // FF 2 fix for CTB
// //
@ -1468,6 +1471,10 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i
} else { } else {
self->client->respawnTime = level.time + 1700; self->client->respawnTime = level.time + 1700;
} }
// JBravo: set the time of death for CTB
if (g_gametype.integer == GT_CTF) {
self->client->time_of_death = level.time;
}
// 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));

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.111 2002/07/24 02:17:38 jbravo
// Added a respawn delay for CTB
//
// Revision 1.110 2002/07/16 04:07:53 niceass // Revision 1.110 2002/07/16 04:07:53 niceass
// temporary hack solution for map rotation and ctb // temporary hack solution for map rotation and ctb
// //
@ -678,6 +681,8 @@ struct gclient_s {
int rd_lastRadio; //Code of the last radio used int rd_lastRadio; //Code of the last radio used
int rd_repCount; //Counter for the number of repeated radio msgs int rd_repCount; //Counter for the number of repeated radio msgs
float rd_repTime; //The time for the last repeated radio msg float rd_repTime; //The time for the last repeated radio msg
// JBravo: time of death for delayed CTB respawns
int time_of_death;
}; };
// JBravo: for model loading // JBravo: for model loading
@ -1294,6 +1299,7 @@ extern vmCvar_t g_RQ3_twbanrounds; // JBravo: no. of games team wounders are ban
extern vmCvar_t g_RQ3_tkbanrounds; // JBravo: no. of games team killers are banned extern vmCvar_t g_RQ3_tkbanrounds; // JBravo: no. of games team killers are banned
extern vmCvar_t g_RQ3_ppl_idletime; // JBravo: Seconds Idle before playing an insane sound extern vmCvar_t g_RQ3_ppl_idletime; // JBravo: Seconds Idle before playing an insane sound
extern vmCvar_t g_RQ3_idleaction; // JBravo: what to do with Idlers. 0 = sound, 1 = team none, 2 = kick extern vmCvar_t g_RQ3_idleaction; // JBravo: what to do with Idlers. 0 = sound, 1 = team none, 2 = kick
extern vmCvar_t g_RQ3_ctb_respawndelay; // JBravo: delay in seconds for ctb respawns
//Slicer: Team Status Cvars for MM //Slicer: Team Status Cvars for MM
//extern vmCvar_t g_RQ3_team1ready; //extern vmCvar_t g_RQ3_team1ready;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.103 2002/07/24 02:17:38 jbravo
// Added a respawn delay for CTB
//
// Revision 1.102 2002/07/19 04:29:58 niceass // Revision 1.102 2002/07/19 04:29:58 niceass
// include CTF in showing scoreboard at end of map // include CTF in showing scoreboard at end of map
// //
@ -381,6 +384,7 @@ vmCvar_t g_RQ3_twbanrounds;
vmCvar_t g_RQ3_tkbanrounds; vmCvar_t g_RQ3_tkbanrounds;
vmCvar_t g_RQ3_ppl_idletime; vmCvar_t g_RQ3_ppl_idletime;
vmCvar_t g_RQ3_idleaction; vmCvar_t g_RQ3_idleaction;
vmCvar_t g_RQ3_ctb_respawndelay;
//Slicer: Team Status Cvars for MM //Slicer: Team Status Cvars for MM
//vmCvar_t g_RQ3_team1ready; //vmCvar_t g_RQ3_team1ready;
@ -533,6 +537,7 @@ static cvarTable_t gameCvarTable[] = {
{&g_RQ3_twbanrounds, "g_RQ3_twbanrounds", "2", CVAR_ARCHIVE, 0, qtrue}, {&g_RQ3_twbanrounds, "g_RQ3_twbanrounds", "2", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_tkbanrounds, "g_RQ3_tkbanrounds", "2", CVAR_ARCHIVE, 0, qtrue}, {&g_RQ3_tkbanrounds, "g_RQ3_tkbanrounds", "2", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_ppl_idletime, "g_RQ3_ppl_idletime", "0", CVAR_ARCHIVE, 0, qtrue}, {&g_RQ3_ppl_idletime, "g_RQ3_ppl_idletime", "0", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_ctb_respawndelay, "g_RQ3_ctb_respawndelay", "5", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_idleaction, "g_RQ3_idleaction", "0", CVAR_ARCHIVE, 0, qtrue}, {&g_RQ3_idleaction, "g_RQ3_idleaction", "0", CVAR_ARCHIVE, 0, qtrue},
//Blaze: let cvar.cfg be set by the server admins //Blaze: let cvar.cfg be set by the server admins
{&g_RQ3_cvarfile, "g_RQ3_cvarfile", "cvar.cfg", CVAR_ARCHIVE, 0, qtrue}, {&g_RQ3_cvarfile, "g_RQ3_cvarfile", "cvar.cfg", CVAR_ARCHIVE, 0, qtrue},