Adding Matchmode: just a few basics and files...

This commit is contained in:
Daniel Simoes 2002-01-31 23:55:05 +00:00
parent f2f94ee636
commit c6719e61da
6 changed files with 50 additions and 0 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.39 2002/01/31 23:51:18 slicer
// Adding Matchmode: just a few basics and files...
//
// Revision 1.38 2002/01/31 02:55:58 blaze
// some basic work with the trains/elevators
//
@ -37,6 +40,8 @@
#include "bg_public.h"
#include "g_public.h"
//Slicer: MatchMode
#include "g_matchmode.h"
//==================================================================
// the "gameversion" client command will print this plus compile date
@ -603,6 +608,10 @@ typedef struct {
#ifdef MISSIONPACK
int portalSequence;
#endif
// Slicer: Matchmode
float matchTime;
qboolean team1ready;
qboolean team2ready;
// JBravo adding TP
int lights_camera_action;
qboolean team_round_going;
@ -1035,6 +1044,8 @@ extern vmCvar_t g_enableDust;
extern vmCvar_t g_enableBreath;
extern vmCvar_t g_singlePlayer;
extern vmCvar_t g_proxMineTimeout;
//Slicer: Matchmode
extern vmCvar_t g_matchmode;
//Blaze: Reaction cvars
extern vmCvar_t g_rxn_knifelimit;
extern vmCvar_t g_RQ3_maxWeapons;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.19 2002/01/31 23:51:18 slicer
// Adding Matchmode: just a few basics and files...
//
// Revision 1.18 2002/01/31 02:25:31 jbravo
// Adding limchasecam.
//
@ -89,6 +92,8 @@ vmCvar_t pmove_fixed;
vmCvar_t pmove_msec;
vmCvar_t g_rankings;
vmCvar_t g_listEntity;
//Slicer: Matchmode
vmCvar_t g_matchmode;
//Blaze: Reaction cvars
vmCvar_t g_rxn_knifelimit;
vmCvar_t g_RQ3_maxWeapons;
@ -207,6 +212,8 @@ static cvarTable_t gameCvarTable[] = {
{ &pmove_msec, "pmove_msec", "8", CVAR_SYSTEMINFO, 0, qfalse},
{ &g_rankings, "g_rankings", "0", 0, 0, qfalse},
//Slicer: Matchmode
{ &g_matchmode, "g_matchmode", "0", CVAR_SERVERINFO | CVAR_USERINFO | CVAR_LATCH, 0, qfalse },
//Blaze: Reaction stuff
// Elder: these are explicit values set every time the game initializes
{ &g_RQ3_ejectBlood, "g_RQ3_ejectBlood", "0", CVAR_ARCHIVE | CVAR_NORESTART,0, qfalse},
@ -574,6 +581,12 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
level.team_round_going = 0;
level.fps = trap_Cvar_VariableIntegerValue( "sv_fps" );
}
// Slicer: reset matchmode vars
if(g_matchmode.integer) {
level.matchTime = 0;
level.team1ready = qfalse;
level.team2ready = qfalse;
}
if ( trap_Cvar_VariableIntegerValue( "bot_enable" ) ) {
BotAISetup( restart );
@ -1990,6 +2003,9 @@ void G_RunFrame( int levelTime ) {
if ( g_gametype.integer == GT_TEAMPLAY ) {
CheckTeamRules();
}
// Slicer: matchmode
if(g_matchmode.integer )
MM_RunFrame();
// check team votes
CheckTeamVote( TEAM_RED );

View file

@ -0,0 +1,19 @@
#include "g_local.h"
/* Slicer - This will work on all MatchMode Aspects..
timers, votes, etc etc. Called on each Frame*/
void MM_RunFrame(void) {
int fps;
fps = trap_Cvar_VariableIntegerValue( "sv_fps" );
switch(g_gametype.integer) {
//Each Type has different ways of dealing things..
case(GT_TEAMPLAY):
if(level.team_game_going) // This will need changes..
level.matchTime += 1/fps;
break;
}
}

View file

@ -0,0 +1 @@
void MM_RunFrame( void );

View file

@ -51,6 +51,8 @@ set cc=call ..\compile.bat
@if errorlevel 1 goto quit
%cc% ../g_items.c
@if errorlevel 1 goto quit
%cc% ../g_matchmode.c
@if errorlevel 1 goto quit
%cc% ../g_mem.c
@if errorlevel 1 goto quit
%cc% ../g_misc.c

View file

@ -21,6 +21,7 @@ g_client
g_cmds
g_combat
g_items
g_matchmode
g_mem
g_misc
g_missile