From c6719e61dae5e051ec29fce761b6493a09540b7d Mon Sep 17 00:00:00 2001 From: Daniel Simoes Date: Thu, 31 Jan 2002 23:55:05 +0000 Subject: [PATCH] Adding Matchmode: just a few basics and files... --- reaction/game/g_local.h | 11 +++++++++++ reaction/game/g_main.c | 16 ++++++++++++++++ reaction/game/g_matchmode.c | 19 +++++++++++++++++++ reaction/game/g_matchmode.h | 1 + reaction/game/game.bat | 2 ++ reaction/game/game.q3asm | 1 + 6 files changed, 50 insertions(+) create mode 100644 reaction/game/g_matchmode.c create mode 100644 reaction/game/g_matchmode.h diff --git a/reaction/game/g_local.h b/reaction/game/g_local.h index a94b21d4..f6e11242 100644 --- a/reaction/game/g_local.h +++ b/reaction/game/g_local.h @@ -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; diff --git a/reaction/game/g_main.c b/reaction/game/g_main.c index 7f24aa32..9de50bea 100644 --- a/reaction/game/g_main.c +++ b/reaction/game/g_main.c @@ -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 ); diff --git a/reaction/game/g_matchmode.c b/reaction/game/g_matchmode.c new file mode 100644 index 00000000..f74ce14c --- /dev/null +++ b/reaction/game/g_matchmode.c @@ -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; + + } + +} \ No newline at end of file diff --git a/reaction/game/g_matchmode.h b/reaction/game/g_matchmode.h new file mode 100644 index 00000000..91126857 --- /dev/null +++ b/reaction/game/g_matchmode.h @@ -0,0 +1 @@ +void MM_RunFrame( void ); diff --git a/reaction/game/game.bat b/reaction/game/game.bat index 31e80193..af59053e 100755 --- a/reaction/game/game.bat +++ b/reaction/game/game.bat @@ -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 diff --git a/reaction/game/game.q3asm b/reaction/game/game.q3asm index 6143ede3..ab516bc5 100644 --- a/reaction/game/game.q3asm +++ b/reaction/game/game.q3asm @@ -21,6 +21,7 @@ g_client g_cmds g_combat g_items +g_matchmode g_mem g_misc g_missile