Matchmode: Teams Ready/Not Ready goes by cvar MM_team1/2

This commit is contained in:
Daniel Simoes 2002-02-04 00:11:12 +00:00
parent b2fa2f2d3b
commit a68414cfa8
7 changed files with 57 additions and 30 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.43 2002/02/04 00:11:12 slicer
// Matchmode: Teams Ready/Not Ready goes by cvar MM_team1/2
//
// Revision 1.42 2002/01/30 07:37:25 niceass
// EnableBreath added for mappers (TA thing)
//
@ -1440,6 +1443,9 @@ extern vmCvar_t cg_enableBreath;
extern cheat_cvar cheats[30];
// JBravo: To signal cgame that lca is in progress
extern vmCvar_t RQ3_lca;
//Slicer: matchmode team status cvars
extern vmCvar_t MM_team1;
extern vmCvar_t MM_team2;
//
// cg_main.c

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.38 2002/02/04 00:11:12 slicer
// Matchmode: Teams Ready/Not Ready goes by cvar MM_team1/2
//
// Revision 1.37 2002/01/30 07:37:25 niceass
// EnableBreath added for mappers (TA thing)
//
@ -234,6 +237,9 @@ vmCvar_t cg_enableDust;
cheat_cvar cheats[30];
// JBravo: lca in progress cvar
vmCvar_t RQ3_lca;
//Slicer: matchmode team status cvars
vmCvar_t MM_team1;
vmCvar_t MM_team2;
// NiceAss: Taken out of the missionpack
vmCvar_t cg_enableBreath;
@ -383,7 +389,10 @@ static cvarTable_t cvarTable[] = { // bk001129
{ &cg_oldPlasma, "cg_oldPlasma", "1", CVAR_ARCHIVE},
{ &cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE},
// JBravo: added
{ &RQ3_lca, "RQ3_lca", "0", 0}
{ &RQ3_lca, "RQ3_lca", "0", 0},
//Slicer: Team Status Cvars for MM
{ &MM_team1, "MM_team1", "0", 0},
{ &MM_team2, "MM_team2", "0", 0}
// { &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE }
};

View file

@ -5,8 +5,8 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.30 2002/02/03 21:23:51 slicer
// More Matchmode code and fixed 2 bugs in TP
// Revision 1.31 2002/02/04 00:10:49 slicer
// Matchmode: Teams Ready/Not Ready goes by cvar MM_team1/2
//
// Revision 1.28 2002/02/01 01:00:36 slicer
// Adding Matchmode: just a few basics and files...
@ -1527,10 +1527,10 @@ void ClientDisconnect( int clientNum ) {
if(g_gametype.integer) {
switch(ent->client->pers.captain ) {
case TEAM_RED:
level.team1ready = qfalse;
trap_Cvar_Set("MM_team1", "0");
break;
case TEAM_BLUE:
level.team2ready = qfalse;
trap_Cvar_Set("MM_team2", "0");
break;
}
}

View file

@ -5,8 +5,8 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.46 2002/02/03 21:23:51 slicer
// More Matchmode code and fixed 2 bugs in TP
// Revision 1.47 2002/02/04 00:10:49 slicer
// Matchmode: Teams Ready/Not Ready goes by cvar MM_team1/2
//
// Revision 1.43 2002/02/02 16:34:02 slicer
// Matchmode..
@ -713,10 +713,10 @@ void SetTeam( gentity_t *ent, char *s ) {
// client->sess.savedTeam = team;
switch(ent->client->pers.captain) {
case TEAM_RED:
level.team1ready = qfalse;
trap_Cvar_Set("MM_team1", "0");
break;
case TEAM_BLUE:
level.team2ready = qfalse;
trap_Cvar_Set("MM_team2", "0");
break;
}
}

View file

@ -5,8 +5,8 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.41 2002/02/02 20:39:09 slicer
// Matchmode: Adding Captains
// Revision 1.42 2002/02/04 00:10:49 slicer
// Matchmode: Teams Ready/Not Ready goes by cvar MM_team1/2
//
// Revision 1.40 2002/02/01 01:00:36 slicer
// Adding Matchmode: just a few basics and files...
@ -615,8 +615,6 @@ typedef struct {
#endif
// Slicer: Matchmode
float matchTime;
qboolean team1ready;
qboolean team2ready;
// JBravo adding TP
int lights_camera_action;
qboolean team_round_going;
@ -1070,6 +1068,9 @@ extern vmCvar_t g_RQ3_roundtimelimit; // JBravo: Time pr. round
extern vmCvar_t g_RQ3_tgren; // JBravo: no. of team grenades
extern vmCvar_t g_RQ3_limchasecam; // JBravo: 0 = no chasecam limit, 1 = limited to same team.
extern vmCvar_t RQ3_lca; // JBravo: cvar to signal cgame that LCA is in progress
//Slicer: Team Status Cvars for MM
extern vmCvar_t MM_team1;
extern vmCvar_t MM_team2;
void trap_Printf( const char *fmt );
void trap_Error( const char *fmt );

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.20 2002/02/04 00:10:49 slicer
// Matchmode: Teams Ready/Not Ready goes by cvar MM_team1/2
//
// Revision 1.19 2002/01/31 23:51:18 slicer
// Adding Matchmode: just a few basics and files...
//
@ -113,6 +116,9 @@ vmCvar_t g_RQ3_roundtimelimit;
vmCvar_t g_RQ3_tgren;
vmCvar_t g_RQ3_limchasecam;
vmCvar_t RQ3_lca;
//Slicer: Team Status Cvars for MM
vmCvar_t MM_team1;
vmCvar_t MM_team2;
#ifdef MISSIONPACK
vmCvar_t g_obeliskHealth;
vmCvar_t g_obeliskRegenPeriod;
@ -231,7 +237,10 @@ static cvarTable_t gameCvarTable[] = {
{ &g_RQ3_roundtimelimit, "g_RQ3_roundtimelimit", "2", 0, 0, qtrue},
{ &g_RQ3_tgren, "g_RQ3_tgren", "0", 0, 0, qtrue},
{ &g_RQ3_limchasecam, "g_RQ3_limchasecam", "0", 0, 0, qtrue},
{ &RQ3_lca, "RQ3_lca", "0", CVAR_SYSTEMINFO, 0, qfalse}
{ &RQ3_lca, "RQ3_lca", "0", CVAR_SYSTEMINFO, 0, qfalse},
//Slicer: Team Status Cvars for MM
{ &MM_team1, "MM_team1", "0", CVAR_SYSTEMINFO, 0, qfalse},
{ &MM_team2, "MM_team2", "0", CVAR_SYSTEMINFO, 0, qfalse}
};
@ -584,8 +593,8 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
// Slicer: reset matchmode vars
if(g_matchmode.integer) {
level.matchTime = 0;
level.team1ready = qfalse;
level.team2ready = qfalse;
trap_Cvar_Set("MM_team1", "0");
trap_Cvar_Set("MM_team2", "0");
}
if ( trap_Cvar_VariableIntegerValue( "bot_enable" ) ) {

View file

@ -61,13 +61,13 @@ void MM_Captain_f( gentity_t *ent ) {
return;
}
if(ent->client->pers.captain == TEAM_RED) {
level.team1ready = qfalse;
trap_Cvar_Set("MM_team1", "0");
trap_SendServerCommand( -1, va("print \"%s is no longer %s's Captain.\n\"",
ent->client->pers.netname,"Red Team"));// Teams will have names in the future..
ent->client->pers.captain = TEAM_FREE;
}
else if(ent->client->pers.captain == TEAM_BLUE) {
level.team2ready = qfalse;
trap_Cvar_Set("MM_team2", "0");
trap_SendServerCommand( -1, va("print \"%s is no longer %s's Captain.\n\"",
ent->client->pers.netname,"Blue Team"));// Teams will have names in the future..
ent->client->pers.captain = TEAM_FREE;
@ -89,22 +89,24 @@ void MM_Ready_f(gentity_t *ent) {
if(ent->client->pers.captain != TEAM_FREE) {
if(ent->client->sess.savedTeam == TEAM_RED) {
if(level.team1ready)
level.team1ready = qfalse;
trap_SendServerCommand( -1, va("cp \"%s is%s Ready.\n\"",
"Red Team",MM_team1.integer == 0 ? "": "no longer"));
if(MM_team1.integer)
trap_Cvar_Set("MM_Team1", "0");
else
level.team1ready = qtrue;
trap_SendServerCommand( -1, va("cp \"%s is %s Ready.\n\"",
"Red Team",level.team1ready ? "": "no longer"));
//trap_SendServerCommand( -1, va("print \"%s is %s Ready.\n\"",
//"Red Team",level.team1ready ? "": "no longer"));
trap_Cvar_Set("MM_Team1", "1");
}
else {
if(level.team2ready)
level.team2ready = qfalse;
trap_SendServerCommand( -1, va("cp \"%s is%s Ready.\n\"",
"Blue Team",MM_team2.integer == 0 ? "": " no longer"));
if(MM_team2.integer)
trap_Cvar_Set("MM_Team2", "0");
else
level.team2ready = qtrue;
trap_SendServerCommand( -1, va("cp \"%s is %s Ready.\n\"",
"Red Team", level.team2ready ? "": "no longer"));
trap_Cvar_Set("MM_Team2", "1");
}
}
else