mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-10 07:11:36 +00:00
Adding TP to main branch
This commit is contained in:
parent
7ea950aa1b
commit
4ef01cfc37
28 changed files with 503 additions and 187 deletions
|
@ -45,7 +45,8 @@ GOBJ = \
|
|||
$(GDIRNAME)/g_weapon.o \
|
||||
$(GDIRNAME)/g_fileio.o \
|
||||
$(GDIRNAME)/ai_vcmd.o \
|
||||
$(GDIRNAME)/rxn_game.o
|
||||
$(GDIRNAME)/rxn_game.o \
|
||||
$(GDIRNAME)/g_teamplay.o
|
||||
|
||||
CGOBJ = \
|
||||
$(CGDIRNAME)/cg_main.o \
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.23 2002/01/11 20:20:57 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.22 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -677,8 +680,9 @@ static consoleCommand_t commands[] = {
|
|||
{ "weapnext", CG_NextWeapon_f },
|
||||
{ "weapprev", CG_PrevWeapon_f },
|
||||
{ "weapon", CG_Weapon_f }, // Elder: it's for RQ3 and Q3A
|
||||
{ "dropitem", CG_DropItem_f },
|
||||
{ "dropweapon", CG_DropWeapon_f }, // Elder: added to reset zoom then goto server
|
||||
// JBravo: adding the drop command and unregistering the other two
|
||||
// { "dropitem", CG_DropItem_f },
|
||||
// { "dropweapon", CG_DropWeapon_f }, // Elder: added to reset zoom then goto server
|
||||
{ "bandage", CG_Bandage_f }, // Elder: added to reset zoom then goto server
|
||||
{ "specialweapon", CG_SpecialWeapon_f }, // Elder: select special weapon
|
||||
{ "tell_target", CG_TellTarget_f },
|
||||
|
@ -794,8 +798,9 @@ void CG_InitConsoleCommands( void ) {
|
|||
trap_AddCommand ("bandage");
|
||||
//trap_AddCommand ("drop"); // XRAY FMJ weap drop cmd - Elder: not used
|
||||
//Elder: added to give drop weapon auto-complete
|
||||
trap_AddCommand ("dropweapon");
|
||||
trap_AddCommand ("dropitem");
|
||||
// JBravo: no need for tab completion for those two
|
||||
// trap_AddCommand ("dropweapon");
|
||||
// trap_AddCommand ("dropitem");
|
||||
//Blaze: to get weapon stats
|
||||
trap_AddCommand ("playerstats");
|
||||
//Elder: try this
|
||||
|
@ -805,4 +810,7 @@ void CG_InitConsoleCommands( void ) {
|
|||
//trap_AddCommand ("messagemode2");
|
||||
trap_AddCommand ("playerorigin");
|
||||
trap_AddCommand ("irvision");
|
||||
// JBravo: adding choose and drop commands.
|
||||
trap_AddCommand ("choose");
|
||||
trap_AddCommand ("drop");
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.19 2002/01/11 20:20:57 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.18 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -2613,6 +2616,9 @@ static void CG_DrawWarmup( void ) {
|
|||
s = "Free For All";
|
||||
} else if ( cgs.gametype == GT_TEAM ) {
|
||||
s = "Team Deathmatch";
|
||||
// JBravo adding teamplay
|
||||
} else if ( cgs.gametype == GT_TEAMPLAY ) {
|
||||
s = "RQ3 Teamplay";
|
||||
} else if ( cgs.gametype == GT_CTF ) {
|
||||
s = "Capture the Flag";
|
||||
#ifdef MISSIONPACK
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.33 2002/01/11 20:20:57 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.32 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -2173,7 +2176,22 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
|
|||
case RQ3_SOUND_KNIFEDEATH:
|
||||
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.knifeDeathSound);
|
||||
break;
|
||||
|
||||
// JBravo: LCA soundevents.
|
||||
case RQ3_SOUND_LIGHTS:
|
||||
if ( es->number == cg.snap->ps.clientNum )
|
||||
CG_AddBufferedSound(cgs.media.lightsSound);
|
||||
break;
|
||||
case RQ3_SOUND_CAMERA:
|
||||
if ( es->number == cg.snap->ps.clientNum )
|
||||
CG_AddBufferedSound(cgs.media.cameraSound);
|
||||
break;
|
||||
case RQ3_SOUND_ACTION:
|
||||
if ( es->number == cg.snap->ps.clientNum )
|
||||
CG_AddBufferedSound(cgs.media.actionSound);
|
||||
break;
|
||||
case RQ3_SOUND_COUNTDOWN:
|
||||
trap_S_StartLocalSound( cgs.media.lca10_0Sound, CHAN_ANNOUNCER );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.11 2002/01/11 20:20:57 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.10 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -277,6 +280,10 @@ void CG_DrawInformation( void ) {
|
|||
case GT_TEAM:
|
||||
s = "Team Deathmatch";
|
||||
break;
|
||||
// JBravo: teamplay stuff.
|
||||
case GT_TEAMPLAY:
|
||||
s = "RQ3 Teamplay";
|
||||
break;
|
||||
case GT_CTF:
|
||||
s = "Capture The Flag";
|
||||
break;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.39 2002/01/11 20:20:57 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.38 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -1167,7 +1170,11 @@ typedef struct {
|
|||
//sfxHandle_t wstbimpmSound;
|
||||
//sfxHandle_t wstbimpdSound;
|
||||
//sfxHandle_t wstbactvSound;
|
||||
|
||||
// JBravo: LCA sounds
|
||||
sfxHandle_t lightsSound;
|
||||
sfxHandle_t cameraSound;
|
||||
sfxHandle_t actionSound;
|
||||
sfxHandle_t lca10_0Sound;
|
||||
} cgMedia_t;
|
||||
|
||||
|
||||
|
@ -1410,6 +1417,9 @@ extern vmCvar_t cg_obeliskRespawnDelay;
|
|||
//Blaze: Cheat cvars
|
||||
extern cheat_cvar cheats[30];
|
||||
|
||||
// JBravo: To signal cgame that lca is in progress
|
||||
extern vmCvar_t RQ3_lca;
|
||||
|
||||
//
|
||||
// cg_main.c
|
||||
//
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.35 2002/01/11 20:20:57 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.34 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -224,6 +227,8 @@ vmCvar_t cg_obeliskRespawnDelay;
|
|||
#endif
|
||||
//Blaze: cheat struct
|
||||
cheat_cvar cheats[30];
|
||||
// JBravo: lca in progress cvar
|
||||
vmCvar_t RQ3_lca;
|
||||
|
||||
typedef struct {
|
||||
vmCvar_t *vmCvar;
|
||||
|
@ -367,7 +372,9 @@ static cvarTable_t cvarTable[] = { // bk001129
|
|||
{ &cg_oldRail, "cg_oldRail", "1", CVAR_ARCHIVE},
|
||||
{ &cg_oldRocket, "cg_oldRocket", "1", CVAR_ARCHIVE},
|
||||
{ &cg_oldPlasma, "cg_oldPlasma", "1", CVAR_ARCHIVE},
|
||||
{ &cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE}
|
||||
{ &cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE},
|
||||
// JBravo: added
|
||||
{ &RQ3_lca, "RQ3_lca", "0", 0}
|
||||
// { &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE }
|
||||
};
|
||||
|
||||
|
@ -619,6 +626,12 @@ static void CG_RegisterSounds( void ) {
|
|||
#ifdef MISSIONPACK
|
||||
cgs.media.countPrepareTeamSound = trap_S_RegisterSound( "sound/feedback/prepare_team.wav", qtrue );
|
||||
#endif
|
||||
// JBravo: registering the LCA sounds.
|
||||
cgs.media.lightsSound = trap_S_RegisterSound( "sound/lca/lights.wav", qtrue );
|
||||
cgs.media.cameraSound = trap_S_RegisterSound( "sound/lca/camera.wav", qtrue );
|
||||
cgs.media.actionSound = trap_S_RegisterSound( "sound/lca/action.wav", qtrue );
|
||||
cgs.media.lca10_0Sound = trap_S_RegisterSound( "sound/lca/10_0.wav", qtrue );
|
||||
|
||||
|
||||
if ( cgs.gametype >= GT_TEAM || cg_buildScript.integer ) {
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.6 2002/01/11 20:20:57 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.5 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -1188,6 +1191,9 @@ const char *CG_GameTypeString() {
|
|||
return "Free For All";
|
||||
} else if ( cgs.gametype == GT_TEAM ) {
|
||||
return "Team Deathmatch";
|
||||
// JBravo: Client gametype mapping for teamplay
|
||||
} else if ( cgs.gametype == GT_TEAMPLAY ) {
|
||||
return "RQ3 Teamplay";
|
||||
} else if ( cgs.gametype == GT_CTF ) {
|
||||
return "Capture the Flag";
|
||||
} else if ( cgs.gametype == GT_1FCTF ) {
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.12 2002/01/11 20:20:57 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.11 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -459,6 +462,12 @@ void CG_PredictPlayerState( void ) {
|
|||
if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR ) {
|
||||
cg_pmove.tracemask &= ~CONTENTS_BODY; // spectators can fly through bodies
|
||||
}
|
||||
|
||||
// JBravo: fixing telefragging and shit during spawing (Thanks NiceAss! :)
|
||||
if (RQ3_lca.integer) {
|
||||
cg_pmove.tracemask &= ~CONTENTS_BODY;
|
||||
}
|
||||
|
||||
cg_pmove.noFootsteps = ( cgs.dmflags & DF_NO_FOOTSTEPS ) > 0;
|
||||
|
||||
// save the state before the pmove so we can detect transitions
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.14 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.13 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -457,6 +460,9 @@ static void CG_MapRestart( void ) {
|
|||
// we really should clear more parts of cg here and stop sounds
|
||||
|
||||
// play the "fight" sound if this is a restart without warmup
|
||||
// JBravo: unless we are in teamplay mode.
|
||||
if ( cgs.gametype == GT_TEAMPLAY )
|
||||
return;
|
||||
if ( cg.warmup == 0 /* && cgs.gametype == GT_TOURNAMENT */) {
|
||||
trap_S_StartLocalSound( cgs.media.countFightSound, CHAN_ANNOUNCER );
|
||||
CG_CenterPrint( "FIGHT!", 120, GIANTCHAR_WIDTH*2 );
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.7 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.6 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -429,4 +432,4 @@ qboolean trap_GetEntityToken( char *buffer, int bufferSize ) {
|
|||
|
||||
qboolean trap_R_inPVS( const vec3_t p1, const vec3_t p2 ) {
|
||||
return syscall( CG_R_INPVS, p1, p2 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.7 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.6 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -4475,7 +4478,8 @@ void BotAIBlocked(bot_state_t *bs, bot_moveresult_t *moveresult, int activate) {
|
|||
#ifdef OBSTACLEDEBUG
|
||||
ClientName(bs->client, netname, sizeof(netname));
|
||||
BotAI_Print(PRT_MESSAGE, "%s: I'm blocked by model %d\n", netname, entinfo.modelindex);
|
||||
#endif OBSTACLEDEBUG
|
||||
// JBravo: silencing a compiler warning by commenting out text after endif
|
||||
#endif /* OBSTACLEDEBUG */
|
||||
// if blocked by a bsp model and the bot wants to activate it
|
||||
if (activate && entinfo.modelindex > 0 && entinfo.modelindex <= max_bspmodelindex) {
|
||||
// find the bsp entity which should be activated in order to get the blocking entity out of the way
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.54 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.53 2002/01/11 19:48:29 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -22,6 +25,9 @@
|
|||
#include "bg_public.h"
|
||||
#include "bg_local.h"
|
||||
|
||||
// JBravo: the famous LCA cvar
|
||||
extern vmCvar_t RQ3_lca;
|
||||
|
||||
pmove_t *pm;
|
||||
pml_t pml;
|
||||
|
||||
|
@ -1865,6 +1871,7 @@ PM_BeginWeaponChange
|
|||
===============
|
||||
*/
|
||||
static void PM_BeginWeaponChange( int weapon ) {
|
||||
//G_Printf("CHANGING WEAP TO: %i\n", weapon);
|
||||
if ( weapon <= WP_NONE || weapon >= WP_NUM_WEAPONS ) {
|
||||
return;
|
||||
}
|
||||
|
@ -2681,6 +2688,7 @@ static void PM_Weapon( void ) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//Elder: drop the primed grenade if bandaging
|
||||
/*
|
||||
if ( pm->ps->weapon == WP_GRENADE &&
|
||||
|
@ -2732,6 +2740,11 @@ static void PM_Weapon( void ) {
|
|||
}
|
||||
}
|
||||
|
||||
// JBravo: no shooting during LCA
|
||||
if ( RQ3_lca.integer) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( pm->ps->weaponstate == WEAPON_RAISING &&
|
||||
!( ( pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE) && pm->ps->stats[STAT_BURST]) ) {
|
||||
pm->ps->weaponstate = WEAPON_READY;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.43 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.42 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -155,6 +158,14 @@
|
|||
#define RQ3_HANDCANNON_AMMO 2
|
||||
#define RQ3_GRENADE_AMMO 1 //Elder: shouldn't need this value
|
||||
|
||||
// JBravo: extra ammo for the guns in Teamplay.
|
||||
#define RQ3_SSG3000_EXTRA_AMMO 10
|
||||
#define RQ3_MP5_EXTRA_AMMO 1
|
||||
#define RQ3_M3_EXTRA_AMMO 7
|
||||
#define RQ3_M4_EXTRA_AMMO 1
|
||||
#define RQ3_AKIMBO_EXTRA_AMMO 2
|
||||
#define RQ3_HANDCANNON_EXTRA_AMMO 12
|
||||
|
||||
//Elder: confused?
|
||||
|
||||
//Elder: from Action source, but changed defined names a bit
|
||||
|
@ -182,6 +193,11 @@ typedef enum {
|
|||
RQ3_SOUND_KNIFEDEATH,
|
||||
RQ3_SOUND_LCA, //lights, camera, action!
|
||||
RQ3_SOUND_KEVLARHIT,
|
||||
// JBravo: LCA sounds
|
||||
RQ3_SOUND_LIGHTS,
|
||||
RQ3_SOUND_CAMERA,
|
||||
RQ3_SOUND_ACTION,
|
||||
RQ3_SOUND_COUNTDOWN,
|
||||
|
||||
RQ3_SOUND_TOTAL
|
||||
} rq3_sounds_t;
|
||||
|
@ -360,6 +376,7 @@ typedef enum {
|
|||
//-- team games go after this --
|
||||
|
||||
GT_TEAM, // team deathmatch
|
||||
GT_TEAMPLAY, // JBravo: The teamplay mode itself.
|
||||
GT_CTF, // capture the flag
|
||||
GT_1FCTF,
|
||||
GT_OBELISK,
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.42 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.41 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -1119,11 +1122,9 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
// sanity check the command time to prevent speedup cheating
|
||||
if ( ucmd->serverTime > level.time + 200 ) {
|
||||
ucmd->serverTime = level.time + 200;
|
||||
// G_Printf("serverTime <<<<<\n" );
|
||||
}
|
||||
if ( ucmd->serverTime < level.time - 1000 ) {
|
||||
ucmd->serverTime = level.time - 1000;
|
||||
// G_Printf("serverTime >>>>>\n" );
|
||||
}
|
||||
|
||||
msec = ucmd->serverTime - client->ps.commandTime;
|
||||
|
@ -1199,29 +1200,11 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
client->ps.speed *= 1.3;
|
||||
}
|
||||
|
||||
// Let go of the hook if we aren't firing
|
||||
//Blaze: No Hook in reaction
|
||||
/*
|
||||
if ( client->ps.weapon == WP_GRAPPLING_HOOK &&
|
||||
client->hook && !( ucmd->buttons & BUTTON_ATTACK ) ) {
|
||||
Weapon_HookFree(client->hook);
|
||||
}
|
||||
*/
|
||||
|
||||
// set up for pmove
|
||||
oldEventSequence = client->ps.eventSequence;
|
||||
|
||||
memset (&pm, 0, sizeof(pm));
|
||||
|
||||
// check for the hit-scan gauntlet, don't let the action
|
||||
// go through as an attack unless it actually hits something
|
||||
// Blaze: no need for the gauntlet check
|
||||
/*
|
||||
if ( client->ps.weapon == WP_GAUNTLET && !( ucmd->buttons & BUTTON_TALK ) &&
|
||||
( ucmd->buttons & BUTTON_ATTACK ) && client->ps.weaponTime <= 0 ) {
|
||||
pm.gauntletHit = CheckGauntletAttack( ent );
|
||||
}
|
||||
*/
|
||||
if ( ent->flags & FL_FORCE_GESTURE ) {
|
||||
ent->flags &= ~FL_FORCE_GESTURE;
|
||||
ent->client->pers.cmd.buttons |= BUTTON_GESTURE;
|
||||
|
@ -1267,6 +1250,13 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
else {
|
||||
pm.tracemask = MASK_PLAYERSOLID;
|
||||
}
|
||||
|
||||
// JBravo: fixing telefragging and shit during spawnig. (Thanks NiceAss! :)
|
||||
if (g_gametype.integer == GT_TEAMPLAY && level.lights_camera_action)
|
||||
{
|
||||
pm.tracemask = MASK_PLAYERSOLID & ~CONTENTS_BODY;
|
||||
}
|
||||
|
||||
pm.trace = trap_Trace;
|
||||
pm.pointcontents = trap_PointContents;
|
||||
pm.debugLevel = g_debugMove.integer;
|
||||
|
@ -1392,7 +1382,8 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
client->latched_buttons |= client->buttons & ~client->oldbuttons;
|
||||
|
||||
// check for respawning
|
||||
if ( client->ps.stats[STAT_HEALTH] <= 0 ) {
|
||||
// JBravo: we dont want to respawn players untill next round if teamplay.
|
||||
if ( client->ps.stats[STAT_HEALTH] <= 0 && g_gametype.integer != GT_TEAMPLAY ) {
|
||||
// wait for the attack button to be pressed
|
||||
if ( level.time > client->respawnTime ) {
|
||||
// forcerespawn is to prevent users from waiting out powerups
|
||||
|
@ -1403,7 +1394,8 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
}
|
||||
|
||||
// pressing attack or use is the normal respawn method
|
||||
if ( ucmd->buttons & ( BUTTON_ATTACK | BUTTON_USE_HOLDABLE ) ) {
|
||||
// JBravo: unless we are in Teamplay mode.
|
||||
if ( (ucmd->buttons & ( BUTTON_ATTACK | BUTTON_USE_HOLDABLE)) && g_gametype.integer != GT_TEAMPLAY ) {
|
||||
respawn( ent );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.25 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.24 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -20,6 +23,9 @@
|
|||
#include "zcam.h"
|
||||
#endif /* __ZCAM__ */
|
||||
|
||||
// JBravo: fixme. Hack to use SelectInitialSpawnPoint() in ClientSpawn.
|
||||
gentity_t *SelectInitialSpawnPoint( vec3_t origin, vec3_t angles );
|
||||
|
||||
#define RQ3_NONAMEPLAYER "Nameless"
|
||||
|
||||
// g_client.c -- client functions that don't happen every frame
|
||||
|
@ -947,7 +953,8 @@ int G_SendCheatVars(int clientNum)
|
|||
return qfalse;
|
||||
}
|
||||
Q_strncpyz( cheatVar, token, sizeof( cheatVar ) );
|
||||
if ( !strcmp(token, NULL)) return qtrue;
|
||||
// Fix from hal9000. Was NULL in that strcmp
|
||||
if ( !strcmp(token, "")) return qtrue;
|
||||
token = COM_Parse( &text_p );
|
||||
if ( !token ) break;
|
||||
lowval = atof( token );
|
||||
|
@ -1041,7 +1048,7 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) {
|
|||
trap_SendServerCommand( -1, va("print \"%s" S_COLOR_WHITE " connected\n\"", client->pers.netname) );
|
||||
}
|
||||
|
||||
if ( g_gametype.integer >= GT_TEAM &&
|
||||
if ( g_gametype.integer >= GT_TEAM && g_gametype.integer != GT_TEAMPLAY &&
|
||||
client->sess.sessionTeam != TEAM_SPECTATOR ) {
|
||||
BroadcastTeamChange( client, -1 );
|
||||
}
|
||||
|
@ -1069,7 +1076,6 @@ and on transition between teams, but doesn't happen on respawns
|
|||
void ClientBegin( int clientNum ) {
|
||||
gentity_t *ent;
|
||||
gclient_t *client;
|
||||
//gentity_t *tent;
|
||||
int flags;
|
||||
|
||||
ent = g_entities + clientNum;
|
||||
|
@ -1100,18 +1106,14 @@ void ClientBegin( int clientNum ) {
|
|||
// locate ent at a spawn point
|
||||
ClientSpawn( ent );
|
||||
|
||||
if ( client->sess.sessionTeam != TEAM_SPECTATOR ) {
|
||||
// send event
|
||||
//Elder: removed
|
||||
//tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_IN );
|
||||
//tent->s.clientNum = ent->s.clientNum;
|
||||
// JBravo: if teamplay and the client has not been on teams, make them a spectator.
|
||||
if ( g_gametype.integer == GT_TEAMPLAY && client->sess.savedTeam != TEAM_RED && client->sess.savedTeam != TEAM_BLUE ) {
|
||||
client->sess.sessionTeam = TEAM_SPECTATOR;
|
||||
}
|
||||
|
||||
//Elder: moved after ClientSpawn call
|
||||
//Elder: added to initialize weaponmodes
|
||||
if ( client->sess.sessionTeam != TEAM_SPECTATOR ) {
|
||||
client->ps.persistant[PERS_WEAPONMODES] |= RQ3_GRENSHORT; //set to short range
|
||||
client->ps.persistant[PERS_WEAPONMODES] |= RQ3_KNIFEMODE; //set to slash attack
|
||||
//Elder: debug
|
||||
//G_Printf("In clientbegin- PERS_WEAPONMODES: %d\n", ent->client->ps.persistant[PERS_WEAPONMODES]);
|
||||
|
||||
if ( g_gametype.integer != GT_TOURNAMENT ) {
|
||||
trap_SendServerCommand( -1, va("print \"%s" S_COLOR_WHITE " entered the game\n\"", client->pers.netname) );
|
||||
|
@ -1123,6 +1125,13 @@ void ClientBegin( int clientNum ) {
|
|||
CalculateRanks();
|
||||
//Blaze: load in the cvar.cfg file and send off the values to the currently connecting client.
|
||||
|
||||
// JBravo: default weapons
|
||||
|
||||
if (g_gametype.integer == GT_TEAMPLAY) {
|
||||
client->teamplayWeapon = WP_MP5;
|
||||
client->teamplayItem = HI_KEVLAR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1147,32 +1156,34 @@ void ClientSpawn(gentity_t *ent) {
|
|||
int savedPing;
|
||||
// char *savedAreaBits;
|
||||
int accuracy_hits, accuracy_shots;
|
||||
/*
|
||||
int knifeShots = 0;
|
||||
int knifeHits = 0;
|
||||
int mk23Shots = 0;
|
||||
int mk23Hits = 0;
|
||||
int m4Shots =0;
|
||||
int m4Hits = 0;
|
||||
int mp5Shots = 0;
|
||||
int mp5Hits = 0;
|
||||
int m3Shots = 0;
|
||||
int m3Hits = 0;
|
||||
int hcShots = 0;
|
||||
int hcHits = 0;
|
||||
int ssgShots = 0;
|
||||
int ssgHits = 0;
|
||||
int akimboShots = 0;
|
||||
int akimboHits = 0;
|
||||
int grenShots = 0;
|
||||
int grenHits = 0;
|
||||
*/
|
||||
int eventSequence;
|
||||
int savedWeapon, savedItem; // JBravo: to save weapon/item info
|
||||
char userinfo[MAX_INFO_STRING];
|
||||
|
||||
index = ent - g_entities;
|
||||
client = ent->client;
|
||||
|
||||
// JBravo: Check if team spawnpoints have been located. If not find a spot for each team ala AQ2.
|
||||
if (g_gametype.integer == GT_TEAMPLAY) {
|
||||
if (!level.spawnPointsLocated) {
|
||||
client->pers.initialSpawn = qfalse;
|
||||
do {
|
||||
level.team1spawnpoint = SelectInitialSpawnPoint(level.team1spawn_origin, level.team1spawn_angles);
|
||||
if ((level.team1spawnpoint->flags & FL_NO_BOTS) && (ent->r.svFlags & SVF_BOT)) {
|
||||
continue;
|
||||
}
|
||||
if ((level.team1spawnpoint->flags & FL_NO_HUMANS) && !(ent->r.svFlags & SVF_BOT)) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
} while ( 1 );
|
||||
level.team2spawnpoint = SelectRandomFurthestSpawnPoint(level.team1spawnpoint->s.origin,
|
||||
level.team2spawn_origin, level.team2spawn_angles);
|
||||
level.spawnPointsLocated = qtrue;
|
||||
}
|
||||
}
|
||||
// End JBravo.
|
||||
|
||||
// find a spawn point
|
||||
// do it before setting health back up, so farthest
|
||||
// ranging doesn't count this client
|
||||
|
@ -1185,6 +1196,20 @@ void ClientSpawn(gentity_t *ent) {
|
|||
client->sess.sessionTeam,
|
||||
client->pers.teamState.state,
|
||||
spawn_origin, spawn_angles);
|
||||
// JBravo: If we are in Teamplay mode, use the teamspawnpoints.
|
||||
} else if (g_gametype.integer == GT_TEAMPLAY ) {
|
||||
if (client->sess.sessionTeam == TEAM_RED) {
|
||||
client->sess.spawnPoint = level.team1spawnpoint;
|
||||
spawnPoint = level.team1spawnpoint;
|
||||
VectorCopy (level.team1spawn_angles, spawn_angles);
|
||||
VectorCopy (level.team1spawn_origin, spawn_origin);
|
||||
} else {
|
||||
client->sess.spawnPoint = level.team2spawnpoint;
|
||||
spawnPoint = level.team2spawnpoint;
|
||||
VectorCopy (level.team2spawn_angles, spawn_angles);
|
||||
VectorCopy (level.team2spawn_origin, spawn_origin);
|
||||
}
|
||||
// End JBravo.
|
||||
} else {
|
||||
do {
|
||||
// the first spawn should be at a good looking spot
|
||||
|
@ -1230,32 +1255,22 @@ void ClientSpawn(gentity_t *ent) {
|
|||
// savedAreaBits = client->areabits;
|
||||
accuracy_hits = client->accuracy_hits;
|
||||
accuracy_shots = client->accuracy_shots;
|
||||
/*
|
||||
knifeShots = client->knifeShots;
|
||||
knifeHits = client->knifeHits;
|
||||
mk23Shots = client->mk23Shots;
|
||||
mk23Hits = client->mk23Hits;
|
||||
m4Shots = client->m4Shots;
|
||||
m4Hits = client->m4Hits;
|
||||
mp5Shots = client->mp5Shots;
|
||||
mp5Hits = client->mp5Hits;
|
||||
m3Shots = client->m3Shots;
|
||||
m3Hits = client->m3Hits;
|
||||
hcShots = client->hcShots;
|
||||
hcHits = client->hcHits;
|
||||
akimboShots = client->akimboShots;
|
||||
akimboHits = client->akimboHits;
|
||||
grenShots = client->grenShots;
|
||||
grenHits = client->grenHits;
|
||||
*/
|
||||
|
||||
for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) {
|
||||
persistant[i] = client->ps.persistant[i];
|
||||
}
|
||||
eventSequence = client->ps.eventSequence;
|
||||
|
||||
// JBravo: save weapon/item info
|
||||
savedWeapon = client->teamplayWeapon;
|
||||
savedItem = client->teamplayItem;
|
||||
|
||||
memset (client, 0, sizeof(*client)); // bk FIXME: Com_Memset?
|
||||
|
||||
// JBravo: restore weapon/item info
|
||||
client->teamplayWeapon = savedWeapon;
|
||||
client->teamplayItem = savedItem;
|
||||
|
||||
client->pers = saved;
|
||||
client->sess = savedSess;
|
||||
client->ps.ping = savedPing;
|
||||
|
@ -1306,25 +1321,12 @@ void ClientSpawn(gentity_t *ent) {
|
|||
#endif /* __ZCAM__ */
|
||||
|
||||
//Blaze: changed WP_MACHINEGUN to WP_PISTOL, makes the base weapon you start with the pistol
|
||||
// JBravo: Not in TP
|
||||
if(g_gametype.integer != GT_TEAMPLAY) {
|
||||
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_PISTOL );
|
||||
//Blaze: Set starting amo for the machine gun, different in teamplay and dm, we can remove this
|
||||
/*
|
||||
|
||||
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_MACHINEGUN );
|
||||
if ( g_gametype.integer == GT_TEAM ) {
|
||||
client->ps.ammo[WP_MACHINEGUN] = 50;
|
||||
} else {
|
||||
client->ps.ammo[WP_MACHINEGUN] = 100;
|
||||
}
|
||||
*/
|
||||
|
||||
// Begin Duffman
|
||||
// Initial amount of ammo when spawning, this will be changed when weapons are added.
|
||||
//Blaze: Changed from WP_MACHINEGUN to WP_PISTOL
|
||||
//Elder: changed to Ammo function instead of Reload
|
||||
client->ps.ammo[WP_PISTOL] = ClipAmountForAmmo(WP_PISTOL);
|
||||
client->numClips[WP_PISTOL] = 0;
|
||||
// End Duffman
|
||||
client->ps.ammo[WP_PISTOL] = ClipAmountForAmmo(WP_PISTOL);
|
||||
}
|
||||
|
||||
//Blaze: Changed WP_GAUNTLET to WP_KNIFE
|
||||
client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_KNIFE );
|
||||
|
@ -1355,9 +1357,11 @@ void ClientSpawn(gentity_t *ent) {
|
|||
|
||||
// force the base weapon up
|
||||
//Blaze: Changed WP_MACHINEGUN to WP_PISTOL
|
||||
// JBravo: we dont want the endless pistol in TP
|
||||
if(g_gametype.integer != GT_TEAMPLAY) {
|
||||
client->ps.weapon = WP_PISTOL;
|
||||
client->ps.weaponstate = WEAPON_READY;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Blaze: Set the opendoor flag to 0
|
||||
|
@ -1400,6 +1404,10 @@ void ClientSpawn(gentity_t *ent) {
|
|||
|
||||
// select the highest weapon number available, after any
|
||||
// spawn given items have fired
|
||||
// JBravo: Lets make sure we have the right weapons
|
||||
if (g_gametype.integer == GT_TEAMPLAY) {
|
||||
EquipPlayer(ent);
|
||||
} else {
|
||||
client->ps.weapon = 1;
|
||||
for ( i = WP_NUM_WEAPONS - 1 ; i > 0 ; i-- ) {
|
||||
if ( i == WP_KNIFE )
|
||||
|
@ -1410,6 +1418,7 @@ void ClientSpawn(gentity_t *ent) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// run a client frame to drop exactly to the floor,
|
||||
// initialize animations and other things
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.39 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.38 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -526,12 +529,24 @@ Let everyone know about a team change
|
|||
*/
|
||||
void BroadcastTeamChange( gclient_t *client, int oldTeam )
|
||||
{
|
||||
// JBravo: change team names if teamplay
|
||||
|
||||
if ( client->sess.sessionTeam == TEAM_RED ) {
|
||||
if ( g_gametype.integer == GT_TEAMPLAY ) {
|
||||
trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " joined team 1.\n\"",
|
||||
client->pers.netname) );
|
||||
} else {
|
||||
trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " joined the red team.\n\"",
|
||||
client->pers.netname) );
|
||||
}
|
||||
} else if ( client->sess.sessionTeam == TEAM_BLUE ) {
|
||||
if ( g_gametype.integer == GT_TEAMPLAY ) {
|
||||
trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " joined team 2.\n\"",
|
||||
client->pers.netname));
|
||||
} else {
|
||||
trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " joined the blue team.\n\"",
|
||||
client->pers.netname));
|
||||
}
|
||||
} else if ( client->sess.sessionTeam == TEAM_SPECTATOR && oldTeam != TEAM_SPECTATOR ) {
|
||||
trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " joined the spectators.\n\"",
|
||||
client->pers.netname));
|
||||
|
@ -552,7 +567,7 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
int clientNum;
|
||||
spectatorState_t specState;
|
||||
int specClient;
|
||||
int teamLeader;
|
||||
int teamLeader, teamsave;
|
||||
|
||||
//
|
||||
// see what change is requested
|
||||
|
@ -573,15 +588,19 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
team = TEAM_SPECTATOR;
|
||||
specState = SPECTATOR_FOLLOW;
|
||||
specClient = -2;
|
||||
} else if ( !Q_stricmp( s, "spectator" ) || !Q_stricmp( s, "s" ) ) {
|
||||
|
||||
// JBravo: adding aliases none for spectator, 1 for team red and 2 for team blue.
|
||||
} else if ( !Q_stricmp( s, "spectator" ) || !Q_stricmp( s, "s" ) || !Q_stricmp( s, "none" ) ) {
|
||||
team = TEAM_SPECTATOR;
|
||||
specState = SPECTATOR_FREE;
|
||||
} else if ( g_gametype.integer >= GT_TEAM ) {
|
||||
// if running a team game, assign player to one of the teams
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
specState = SPECTATOR_NOT;
|
||||
if ( !Q_stricmp( s, "red" ) || !Q_stricmp( s, "r" ) ) {
|
||||
}
|
||||
if ( !Q_stricmp( s, "red" ) || !Q_stricmp( s, "r" ) || !Q_stricmp( s, "1") ) {
|
||||
team = TEAM_RED;
|
||||
} else if ( !Q_stricmp( s, "blue" ) || !Q_stricmp( s, "b" ) ) {
|
||||
} else if ( !Q_stricmp( s, "blue" ) || !Q_stricmp( s, "b" ) || !Q_stricmp( s, "2" ) ) {
|
||||
team = TEAM_BLUE;
|
||||
} else {
|
||||
// pick the team with the least number of players
|
||||
|
@ -626,8 +645,18 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
//
|
||||
// decide if we will allow the change
|
||||
//
|
||||
// JBravo: we use the savedTeam var because the player meight be dead.
|
||||
if ( g_gametype.integer == GT_TEAMPLAY ) {
|
||||
oldTeam = client->sess.savedTeam;
|
||||
} else {
|
||||
oldTeam = client->sess.sessionTeam;
|
||||
if ( team == oldTeam && team != TEAM_SPECTATOR ) {
|
||||
}
|
||||
if ( team == oldTeam ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// JBravo: we want it to be OK to change from FREE to SPECTATOR without dieing.
|
||||
if ( oldTeam == TEAM_FREE && team == TEAM_SPECTATOR ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -642,24 +671,37 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
|
||||
// he starts at 'base'
|
||||
client->pers.teamState.state = TEAM_BEGIN;
|
||||
if ( oldTeam != TEAM_SPECTATOR ) {
|
||||
|
||||
// JBravo: if player is changing from FREE or SPECT. there is no need for violence.
|
||||
if ( oldTeam != TEAM_SPECTATOR && oldTeam != TEAM_FREE ) {
|
||||
// Kill him (makes sure he loses flags, etc)
|
||||
ent->flags &= ~FL_GODMODE;
|
||||
ent->client->ps.stats[STAT_HEALTH] = ent->health = 0;
|
||||
player_die (ent, ent, ent, 100000, MOD_SUICIDE);
|
||||
|
||||
}
|
||||
|
||||
// JBravo: lets set the correct var here.
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
client->sess.sessionTeam = team;
|
||||
} else if ( !client->sess.teamSpawn ) {
|
||||
client->sess.savedTeam = team;
|
||||
} else {
|
||||
client->sess.sessionTeam = team;
|
||||
}
|
||||
|
||||
// they go to the end of the line for tournements
|
||||
if ( team == TEAM_SPECTATOR ) {
|
||||
client->sess.spectatorTime = level.time;
|
||||
}
|
||||
|
||||
client->sess.sessionTeam = team;
|
||||
client->sess.spectatorState = specState;
|
||||
client->sess.spectatorClient = specClient;
|
||||
|
||||
client->sess.teamLeader = qfalse;
|
||||
if ( team == TEAM_RED || team == TEAM_BLUE ) {
|
||||
|
||||
// JBravo: no teamleader crap in teamplay mode.
|
||||
if ((team == TEAM_RED || team == TEAM_BLUE) && g_gametype.integer != GT_TEAMPLAY ) {
|
||||
teamLeader = TeamLeader( team );
|
||||
// if there is no team leader or the team leader is a bot and this client is not a bot
|
||||
if ( teamLeader == -1 || ( !(g_entities[clientNum].r.svFlags & SVF_BOT) && (g_entities[teamLeader].r.svFlags & SVF_BOT) ) ) {
|
||||
|
@ -667,14 +709,30 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
}
|
||||
}
|
||||
// make sure there is a team leader on the team the player came from
|
||||
if ( oldTeam == TEAM_RED || oldTeam == TEAM_BLUE ) {
|
||||
|
||||
// JBravo: no teamleader crap in teamplay mode.
|
||||
if ((oldTeam == TEAM_RED || oldTeam == TEAM_BLUE) && g_gametype.integer != GT_TEAMPLAY) {
|
||||
CheckTeamLeader( oldTeam );
|
||||
}
|
||||
|
||||
// JBravo: to avoid messages when players are killed and move to spectator team.
|
||||
if ( client->sess.savedTeam != TEAM_RED && client->sess.savedTeam != TEAM_BLUE && g_gametype.integer != GT_TEAMPLAY ) {
|
||||
BroadcastTeamChange( client, oldTeam );
|
||||
}
|
||||
|
||||
// get and distribute relevent paramters
|
||||
|
||||
// JBravo: save sessionTeam and then set it correctly for the call to ClientUserinfoChanged
|
||||
// so the scoreboard will be correct. Also check for uneven teams.
|
||||
if (g_gametype.integer == GT_TEAMPLAY) {
|
||||
CheckForUnevenTeams(ent);
|
||||
teamsave = client->sess.sessionTeam;
|
||||
client->sess.sessionTeam = client->sess.savedTeam;
|
||||
ClientUserinfoChanged( clientNum );
|
||||
client->sess.sessionTeam = teamsave;
|
||||
} else {
|
||||
ClientUserinfoChanged( clientNum );
|
||||
}
|
||||
|
||||
ClientBegin( clientNum );
|
||||
}
|
||||
|
@ -706,6 +764,19 @@ void Cmd_Team_f( gentity_t *ent ) {
|
|||
char s[MAX_TOKEN_CHARS];
|
||||
|
||||
if ( trap_Argc() != 2 ) {
|
||||
|
||||
// JBravo: lets keep the teamnames right.
|
||||
if( g_gametype.integer == GT_TEAMPLAY ) {
|
||||
oldTeam = ent->client->sess.savedTeam;
|
||||
switch ( oldTeam ) {
|
||||
case TEAM_BLUE:
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Team 2\n\"" );
|
||||
break;
|
||||
case TEAM_RED:
|
||||
trap_SendServerCommand( ent-g_entities, "print \"Team 1\n\"" );
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
oldTeam = ent->client->sess.sessionTeam;
|
||||
switch ( oldTeam ) {
|
||||
case TEAM_BLUE:
|
||||
|
@ -721,6 +792,7 @@ void Cmd_Team_f( gentity_t *ent ) {
|
|||
trap_SendServerCommand( ent-g_entities, "print \"Spectator team\n\"" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -805,7 +877,8 @@ void Cmd_FollowCycle_f( gentity_t *ent, int dir ) {
|
|||
ent->client->sess.losses++;
|
||||
}
|
||||
// first set them to spectator
|
||||
if ( ent->client->sess.spectatorState == SPECTATOR_NOT ) {
|
||||
// JBravo: Unless we are in teamplay. No need to mess with teams.
|
||||
if ( ent->client->sess.spectatorState == SPECTATOR_NOT && g_gametype.integer != GT_TEAMPLAY ) {
|
||||
SetTeam( ent, "spectator" );
|
||||
}
|
||||
|
||||
|
@ -1273,6 +1346,9 @@ static const char *gameNames[] = {
|
|||
"Tournament",
|
||||
"Single Player",
|
||||
"Team Deathmatch",
|
||||
|
||||
// JBravo: duh ;)
|
||||
"RQ3 teamplay",
|
||||
"Capture the Flag",
|
||||
"One Flag CTF",
|
||||
"Overload",
|
||||
|
@ -2587,6 +2663,11 @@ void ClientCommand( int clientNum ) {
|
|||
else if (Q_stricmp (cmd, "unzoom") == 0)
|
||||
Cmd_Unzoom (ent);
|
||||
// end hawkins
|
||||
// JBravo: adding the choose and drop commands.
|
||||
else if (Q_stricmp (cmd, "choose") == 0)
|
||||
RQ3_Cmd_Choose_f (ent);
|
||||
else if (Q_stricmp (cmd, "drop") == 0)
|
||||
RQ3_Cmd_Drop_f (ent);
|
||||
else if (Q_stricmp (cmd, "dropweapon") == 0) // XRAY FMJ
|
||||
Cmd_DropWeapon_f( ent );
|
||||
//Elder: stuff for dropping items
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.35 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.34 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -567,14 +570,9 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
}
|
||||
// Hawkins put spread back and zoom out
|
||||
|
||||
//Elder: this wouldn't happen if you copy and paste carefully
|
||||
//ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_LOW;
|
||||
//ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_MED;
|
||||
|
||||
//Elder: remove zoom bits
|
||||
Cmd_Unzoom(self);
|
||||
self->client->bleeding = 0;
|
||||
//targ->client->bleedcount = 0;
|
||||
self->client->bleed_remain = 0;
|
||||
//Elder: added;
|
||||
self->client->ps.stats[STAT_RQ3] &= ~RQ3_BANDAGE_WORK;
|
||||
|
@ -592,10 +590,13 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
return;
|
||||
}
|
||||
|
||||
// JBravo: lets not bother with those CTF functions in Teamplay
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
// check for an almost capture
|
||||
CheckAlmostCapture( self, attacker );
|
||||
// check for a player that almost brought in cubes
|
||||
CheckAlmostScored( self, attacker );
|
||||
}
|
||||
|
||||
//Blaze: No Hook
|
||||
// if (self->client && self->client->hook)
|
||||
|
@ -686,26 +687,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
switch ( meansOfDeath )
|
||||
{
|
||||
case MOD_KNIFE:
|
||||
/*
|
||||
if (attacker && attacker->client)
|
||||
{
|
||||
if ( attacker->client->ps.persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE )
|
||||
{
|
||||
attacker->client->pers.records[REC_KNIFESLASHKILLS]++;
|
||||
self->client->pers.records[REC_KNIFESLASHDEATHS]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
attacker->client->pers.records[REC_KNIFETHROWKILLS]++;
|
||||
self->client->pers.records[REC_KNIFETHROWDEATHS]++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// just count it as a slash death if no attacker
|
||||
self->client->pers.records[REC_KNIFESLASHDEATHS]++;
|
||||
}
|
||||
*/
|
||||
if (attacker && attacker->client)
|
||||
attacker->client->pers.records[REC_KNIFESLASHKILLS]++;
|
||||
self->client->pers.records[REC_KNIFESLASHDEATHS]++;
|
||||
|
@ -779,9 +760,13 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
AddScore( attacker, self->r.currentOrigin, -1 );
|
||||
} else {
|
||||
// Increase number of kills this life for attacker
|
||||
// JBravo: unless we are in teamplay
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
attacker->client->killStreak++;
|
||||
}
|
||||
// DM reward scoring, should add an if statement to get around this when
|
||||
// we add teamplay.
|
||||
// Done ;)
|
||||
if (attacker->client->killStreak < 4)
|
||||
AddScore( attacker, self->r.currentOrigin, 1 );
|
||||
else if (attacker->client->killStreak < 8)
|
||||
|
@ -850,13 +835,17 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
}
|
||||
|
||||
// Add team bonuses
|
||||
// JBravo: unless we are in teamplay
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
Team_FragBonuses(self, inflictor, attacker);
|
||||
}
|
||||
|
||||
// if I committed suicide, the flag does not fall, it returns.
|
||||
// Unless we are in teamplay
|
||||
if (meansOfDeath == MOD_SUICIDE) {
|
||||
// Elder: Statistics tracking
|
||||
self->client->pers.records[REC_SUICIDES]++;
|
||||
|
||||
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||
if ( self->client->ps.powerups[PW_NEUTRALFLAG] ) { // only happens in One Flag CTF
|
||||
Team_ReturnFlag( TEAM_FREE );
|
||||
self->client->ps.powerups[PW_NEUTRALFLAG] = 0;
|
||||
|
@ -870,6 +859,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
self->client->ps.powerups[PW_BLUEFLAG] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if client is in a nodrop area, don't drop anything (but return CTF flags!)
|
||||
contents = trap_PointContents( self->r.currentOrigin, -1 );
|
||||
|
@ -877,6 +867,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
TossClientItems( self );
|
||||
}
|
||||
else {
|
||||
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||
if ( self->client->ps.powerups[PW_NEUTRALFLAG] ) { // only happens in One Flag CTF
|
||||
Team_ReturnFlag( TEAM_FREE );
|
||||
}
|
||||
|
@ -886,6 +877,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
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] )
|
||||
//{
|
||||
|
@ -947,7 +939,10 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
|
||||
// don't allow respawn until the death anim is done
|
||||
// g_forcerespawn may force spawning at some later time
|
||||
// JBravo: we dont want automatic respawning of players in teamplay
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
self->client->respawnTime = level.time + 1700;
|
||||
}
|
||||
|
||||
// remove powerups
|
||||
memset( self->client->ps.powerups, 0, sizeof(self->client->ps.powerups) );
|
||||
|
@ -1007,6 +1002,16 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
|
||||
trap_LinkEntity (self);
|
||||
|
||||
// JBravo: Save the dead players team status, and respawn his as a spectator.
|
||||
if( g_gametype.integer == GT_TEAMPLAY ) {
|
||||
CopyToBodyQue (self);
|
||||
self->client->weaponCount[self->client->ps.weapon] = 0;
|
||||
self->client->ps.stats[STAT_WEAPONS] = 0;
|
||||
self->client->sess.savedTeam = self->client->sess.sessionTeam;
|
||||
self->client->sess.sessionTeam = TEAM_SPECTATOR;
|
||||
ClientSpawn( self );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1307,7 +1312,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
int max;
|
||||
int bleeding = 0; // damage causes bleeding
|
||||
int instant_dam = 1;
|
||||
|
||||
vec3_t bulletPath;
|
||||
vec3_t bulletAngle;
|
||||
|
||||
|
@ -1331,6 +1335,11 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
if (!targ->takedamage) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_gametype.integer == GT_TEAMPLAY && level.lights_camera_action) {
|
||||
return; // JBravo: No dmg during LCA
|
||||
}
|
||||
|
||||
// the intermission has allready been qualified for, so don't
|
||||
// allow any extra scoring
|
||||
if ( level.intermissionQueued ) {
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.29 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.28 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -312,17 +315,6 @@ int Pickup_Weapon (gentity_t *ent, gentity_t *other, int bandolierFactor) {
|
|||
} else {
|
||||
quantity = ent->item->quantity;
|
||||
}
|
||||
/* Elder: commented out
|
||||
// dropped items and teamplay weapons always have full ammo
|
||||
if ( ! (ent->flags & FL_DROPPED_ITEM) && g_gametype.integer != GT_TEAM ) {
|
||||
// respawning rules
|
||||
// drop the quantity if the already have over the minimum
|
||||
if ( other->client->ps.ammo[ ent->item->giTag ] < quantity ) {
|
||||
quantity = quantity - other->client->ps.ammo[ ent->item->giTag ];
|
||||
} else {
|
||||
quantity = 1; // only add a single shot
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
// add the weapon if not knife or pistol
|
||||
|
@ -437,32 +429,6 @@ int Pickup_Weapon (gentity_t *ent, gentity_t *other, int bandolierFactor) {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if ( other->client->pers.hadUniqueWeapon[ent->item->giTag] == qfalse ||
|
||||
!(ent->flags & FL_THROWN_ITEM) ) {
|
||||
other->client->ps.ammo[ent->item->giTag] = ammotoadd;
|
||||
//Elder: add extra handcannon clips if it's "fresh"
|
||||
if (ent->item->giTag == WP_HANDCANNON) {
|
||||
other->client->numClips[ WP_HANDCANNON ] += 5;
|
||||
other->client->numClips[ WP_M3 ] += 5;
|
||||
if (other->client->numClips[ WP_HANDCANNON ] > 13) {
|
||||
other->client->numClips[ WP_HANDCANNON ] = 14;
|
||||
other->client->numClips[ WP_M3 ] = 14;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// End Duffman
|
||||
|
||||
|
||||
|
||||
//Blaze: No hook
|
||||
/*
|
||||
if (ent->item->giTag == WP_GRAPPLING_HOOK)
|
||||
other->client->ps.ammo[ent->item->giTag] = -1; // unlimited ammo
|
||||
*/
|
||||
|
||||
// team deathmatch has slow weapon respawns
|
||||
if ( g_gametype.integer == GT_TEAM ) {
|
||||
return g_weaponTeamRespawn.integer;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.34 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.33 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -266,11 +269,14 @@ typedef struct {
|
|||
// MUST be dealt with in G_InitSessionData() / G_ReadSessionData() / G_WriteSessionData()
|
||||
typedef struct {
|
||||
team_t sessionTeam;
|
||||
team_t savedTeam; // JBravo: Used to hold the real team status of a player.
|
||||
int spectatorTime; // for determining next-in-line to play
|
||||
spectatorState_t spectatorState;
|
||||
int spectatorClient; // for chasecam and follow mode
|
||||
int wins, losses; // tournament stats
|
||||
qboolean teamLeader; // true when this client is a team leader
|
||||
gentity_t *spawnPoint; // JBravo: This players spawnpoint
|
||||
qboolean teamSpawn; // JBravo: This player is being spawned with his team.
|
||||
} clientSession_t;
|
||||
|
||||
//
|
||||
|
@ -475,6 +481,9 @@ struct gclient_s {
|
|||
#ifdef __ZCAM__
|
||||
struct camera_s *camera;
|
||||
#endif /* __ZCAM__ */
|
||||
// JBravo adding TP stuff
|
||||
int teamplayWeapon;
|
||||
int teamplayItem;
|
||||
};
|
||||
|
||||
|
||||
|
@ -572,6 +581,22 @@ typedef struct {
|
|||
#ifdef MISSIONPACK
|
||||
int portalSequence;
|
||||
#endif
|
||||
// JBravo adding TP
|
||||
int lights_camera_action;
|
||||
qboolean team_round_going;
|
||||
int holding_on_tie_check;
|
||||
int team_round_countdown;
|
||||
qboolean team_game_going;
|
||||
int rulecheckfrequency;
|
||||
int current_round_length;
|
||||
qboolean spawnPointsLocated;
|
||||
gentity_t *team1spawnpoint;
|
||||
gentity_t *team2spawnpoint;
|
||||
vec3_t team1spawn_origin;
|
||||
vec3_t team1spawn_angles;
|
||||
vec3_t team2spawn_origin;
|
||||
vec3_t team2spawn_angles;
|
||||
int fps;
|
||||
} level_locals_t;
|
||||
//
|
||||
// rxn_game.c
|
||||
|
@ -784,6 +809,9 @@ void SetClientViewAngle( gentity_t *ent, vec3_t angle );
|
|||
gentity_t *SelectSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles );
|
||||
//Elder: added because I use it in g_main.c and g_items.c for item spawning
|
||||
gentity_t *SelectRandomDeathmatchSpawnPoint( void );
|
||||
// JBravo: need this for teamspawning
|
||||
gentity_t *SelectRandomFurthestSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles );
|
||||
gentity_t *SelectInitialSpawnPoint( vec3_t origin, vec3_t angles );
|
||||
void CopyToBodyQue( gentity_t *ent );
|
||||
void respawn (gentity_t *ent);
|
||||
void BeginIntermission (void);
|
||||
|
@ -924,6 +952,8 @@ void BotTestAAS(vec3_t origin);
|
|||
|
||||
#include "g_team.h" // teamplay specific stuff
|
||||
|
||||
// JBravo: Functions from g_teamplay.c
|
||||
#include "g_teamplay.h"
|
||||
|
||||
extern level_locals_t level;
|
||||
extern gentity_t g_entities[MAX_GENTITIES];
|
||||
|
@ -993,6 +1023,11 @@ extern vmCvar_t g_RQ3_messageMaxWarnings; // Max warning count
|
|||
extern vmCvar_t g_RQ3_messageWarnTime; // Time for warning; 0 for no-penalty warning
|
||||
extern vmCvar_t g_RQ3_messageBanTime; // Time for ban; 0 to kick
|
||||
extern vmCvar_t g_RQ3_messageProtect; // Elder: 0 disable, non-zero enable
|
||||
// JBravo
|
||||
extern vmCvar_t g_RQ3_roundlimit; // JBravo: No. of rounds pr. map
|
||||
extern vmCvar_t g_RQ3_roundtimelimit; // JBravo: Time pr. round
|
||||
extern vmCvar_t g_RQ3_tgren; // JBravo: no. of team grenades
|
||||
extern vmCvar_t RQ3_lca; // JBravo: cvar to signal cgame that LCA is in progress
|
||||
|
||||
void trap_Printf( const char *fmt );
|
||||
void trap_Error( const char *fmt );
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.16 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.15 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -92,6 +95,11 @@ vmCvar_t g_RQ3_messageMaxWarnings;
|
|||
vmCvar_t g_RQ3_messageWarnTime;
|
||||
vmCvar_t g_RQ3_messageBanTime;
|
||||
vmCvar_t g_RQ3_messageProtect;
|
||||
// JBravo: adding TP cvars
|
||||
vmCvar_t g_RQ3_roundlimit;
|
||||
vmCvar_t g_RQ3_roundtimelimit;
|
||||
vmCvar_t g_RQ3_tgren;
|
||||
vmCvar_t RQ3_lca;
|
||||
#ifdef MISSIONPACK
|
||||
vmCvar_t g_obeliskHealth;
|
||||
vmCvar_t g_obeliskRegenPeriod;
|
||||
|
@ -202,7 +210,12 @@ static cvarTable_t gameCvarTable[] = {
|
|||
{ &g_RQ3_messageMaxWarnings, "sv_RQ3_messageMaxWarnings", SAY_MAX_WARNINGS, 0, 0, qfalse },
|
||||
{ &g_RQ3_messageWarnTime, "sv_RQ3_messageWarnTime", SAY_WARNING_TIME, 0, 0, qfalse },
|
||||
{ &g_RQ3_messageBanTime, "sv_RQ3_messageBanTime", SAY_BAN_TIME, 0, 0, qfalse },
|
||||
{ &g_RQ3_messageProtect, "sv_RQ3_messageProtect", "1", CVAR_SERVERINFO, 0, qtrue}
|
||||
{ &g_RQ3_messageProtect, "sv_RQ3_messageProtect", "1", CVAR_SERVERINFO, 0, qtrue},
|
||||
// JBravo: still with the TP cvars
|
||||
{ &g_RQ3_roundlimit, "g_RQ3_roundlimit", "0", 0, 0, qtrue},
|
||||
{ &g_RQ3_roundtimelimit, "g_RQ3_roundtimelimit", "2", 0, 0, qtrue},
|
||||
{ &g_RQ3_tgren, "g_RQ3_tgren", "0", 0, 0, qtrue},
|
||||
{ &RQ3_lca, "RQ3_lca", "0", CVAR_SYSTEMINFO, 0, qfalse}
|
||||
|
||||
};
|
||||
|
||||
|
@ -517,7 +530,10 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
|
|||
}
|
||||
|
||||
//Elder: spawn unique items.
|
||||
// JBravo: unless we are in Teamplay
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
RQ3_StartUniqueItems();
|
||||
}
|
||||
|
||||
// Elder: force sv_floodprotect to 0 -- remove when we finish
|
||||
// recoding the weapon command and any other commands that may
|
||||
|
@ -538,6 +554,18 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
|
|||
G_SoundIndex( "sound/player/gurp2.wav" );
|
||||
}
|
||||
|
||||
// JBravo: reset teamplay stuff.
|
||||
if( g_gametype.integer == GT_TEAMPLAY ) {
|
||||
level.team_round_countdown = 0;
|
||||
level.rulecheckfrequency = 0;
|
||||
level.lights_camera_action = 0;
|
||||
level.holding_on_tie_check = 0;
|
||||
level.current_round_length = 0;
|
||||
level.team_game_going = 0;
|
||||
level.team_round_going = 0;
|
||||
level.fps = trap_Cvar_VariableIntegerValue( "sv_fps" );
|
||||
}
|
||||
|
||||
if ( trap_Cvar_VariableIntegerValue( "bot_enable" ) ) {
|
||||
BotAISetup( restart );
|
||||
BotAILoadMap( restart );
|
||||
|
@ -1815,7 +1843,7 @@ void G_RunFrame( int levelTime ) {
|
|||
//gentity_t *xr_drop;
|
||||
//int temp;
|
||||
int msec;
|
||||
int start, end;
|
||||
int start, end;
|
||||
|
||||
// if we are waiting for the level to restart, do nothing
|
||||
if ( level.restarted ) {
|
||||
|
@ -1833,7 +1861,7 @@ int start, end;
|
|||
//
|
||||
// go through all allocated objects
|
||||
//
|
||||
start = trap_Milliseconds();
|
||||
start = trap_Milliseconds();
|
||||
ent = &g_entities[0];
|
||||
for (i=0 ; i<level.num_entities ; i++, ent++) {
|
||||
if ( !ent->inuse ) {
|
||||
|
@ -1910,15 +1938,15 @@ start = trap_Milliseconds();
|
|||
}
|
||||
|
||||
if ( i < MAX_CLIENTS ) {
|
||||
G_RunClient( ent );
|
||||
G_RunClient( ent ); // Basicly calls ClientThink_real()
|
||||
continue;
|
||||
}
|
||||
|
||||
G_RunThink( ent );
|
||||
}
|
||||
end = trap_Milliseconds();
|
||||
end = trap_Milliseconds();
|
||||
|
||||
start = trap_Milliseconds();
|
||||
start = trap_Milliseconds();
|
||||
// perform final fixups on the players
|
||||
ent = &g_entities[0];
|
||||
for (i=0 ; i < level.maxclients ; i++, ent++ ) {
|
||||
|
@ -1926,20 +1954,34 @@ start = trap_Milliseconds();
|
|||
ClientEndFrame( ent );
|
||||
}
|
||||
}
|
||||
end = trap_Milliseconds();
|
||||
end = trap_Milliseconds();
|
||||
|
||||
// see if it is time to do a tournement restart
|
||||
// JBravo: no need if teamplay
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
CheckTournament();
|
||||
}
|
||||
|
||||
// see if it is time to end the level
|
||||
// JBravo: no need if teamplay
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
CheckExitRules();
|
||||
}
|
||||
|
||||
// update to team status?
|
||||
// JBravo: no need if teamplay
|
||||
if ( g_gametype.integer != GT_TEAMPLAY ) {
|
||||
CheckTeamStatus();
|
||||
}
|
||||
|
||||
// cancel vote if timed out
|
||||
CheckVote();
|
||||
|
||||
// JBravo: this is the main function in g_teamplay that does everything
|
||||
if ( g_gametype.integer == GT_TEAMPLAY ) {
|
||||
CheckTeamRules();
|
||||
}
|
||||
|
||||
// check team votes
|
||||
CheckTeamVote( TEAM_RED );
|
||||
CheckTeamVote( TEAM_BLUE );
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.8 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.7 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -330,12 +333,16 @@ qboolean G_CallSpawn( gentity_t *ent ) {
|
|||
else if (!strcmp(ent->classname,"ammo_grenades")) ent->classname = "weapon_grenade";
|
||||
*/
|
||||
// check item spawn functions
|
||||
|
||||
// JBravo: No weapons and items on the maps in teamplay
|
||||
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||
for ( item=bg_itemlist+1 ; item->classname ; item++ ) {
|
||||
if ( !strcmp(item->classname, ent->classname) ) {
|
||||
G_SpawnItem( ent, item );
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check normal spawn functions
|
||||
for ( s=spawns ; s->name ; s++ ) {
|
||||
|
@ -452,7 +459,8 @@ void G_SpawnGEntityFromSpawnVars( void ) {
|
|||
int i;
|
||||
gentity_t *ent;
|
||||
char *s, *value, *gametypeName;
|
||||
static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"};
|
||||
// JBravo: added teamplay
|
||||
static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "teamplay", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"};
|
||||
|
||||
// get the next free entity
|
||||
ent = G_Spawn();
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.8 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.7 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -551,6 +554,11 @@ void G_KillBox (gentity_t *ent) {
|
|||
gentity_t *hit;
|
||||
vec3_t mins, maxs;
|
||||
|
||||
// JBravo attempting to stop telefrags
|
||||
if (g_gametype.integer == GT_TEAMPLAY) { // && level.lights_camera_action) {
|
||||
return;
|
||||
}
|
||||
|
||||
VectorAdd( ent->client->ps.origin, ent->r.mins, mins );
|
||||
VectorAdd( ent->client->ps.origin, ent->r.maxs, maxs );
|
||||
num = trap_EntitiesInBox( mins, maxs, touch, MAX_GENTITIES );
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.34 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.33 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -67,6 +70,9 @@ qboolean JumpKick( gentity_t *ent )
|
|||
//Elder: for kick sound
|
||||
qboolean kickSuccess;
|
||||
|
||||
if ( g_gametype.integer == GT_TEAMPLAY && level.lights_camera_action ) {
|
||||
return qfalse; // JBravo: No kicking during LCA
|
||||
}
|
||||
// set aiming directions
|
||||
AngleVectors (ent->client->ps.viewangles, forward, right, up);
|
||||
CalcMuzzlePoint ( ent, forward, right, up, muzzle );
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.13 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.12 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -262,6 +265,8 @@ cr_line credits[] = { // edit this as necessary for your credits
|
|||
{ "JUZ'S SLIPGATE", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
|
||||
{ "QUAKE3WORLD FORUMS (MOD PROGRAMMING)", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
|
||||
{ "WANG (ATF)", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
|
||||
{ "TOMAS EDWARDSSON (FREUD)", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
|
||||
{ "JOHANN THORIRSSON (VONDIKALL)", UI_LEFT|UI_SMALLFONT, &color_maintext, FIXEDWIDTH },
|
||||
|
||||
// Fex for the public board
|
||||
{ "", UI_CENTER|UI_SMALLFONT, &color_blue, FIXEDWIDTH },
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.8 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.7 2002/01/11 19:48:31 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -110,6 +113,7 @@ static const char *servertype_items[] = {
|
|||
"All",
|
||||
"Free For All",
|
||||
"Team Deathmatch",
|
||||
"RQ3 Teamplay", // JBravo: added Teamplay
|
||||
"Tournament",
|
||||
"Capture the Flag",
|
||||
0
|
||||
|
@ -129,6 +133,7 @@ static char* gamenames[] = {
|
|||
"1v1", // tournament
|
||||
"SP ", // single player
|
||||
"Team DM", // team deathmatch
|
||||
"RQ3 Teamplay", // JBravo: teamplay
|
||||
"CTF", // capture the flag
|
||||
"One Flag CTF", // one flag ctf
|
||||
"OverLoad", // Overload
|
||||
|
@ -506,7 +511,7 @@ static void ArenaServers_UpdateMenu( void ) {
|
|||
break;
|
||||
|
||||
case GAMES_TEAMPLAY:
|
||||
if( servernodeptr->gametype != GT_TEAM ) {
|
||||
if( servernodeptr->gametype != GT_TEAM || servernodeptr->gametype != GT_TEAMPLAY ) { // JBravo: Hmm ?
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.7 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.6 2002/01/11 19:48:31 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -104,11 +107,13 @@ static const char *gametype_items[] = {
|
|||
"Team Deathmatch",
|
||||
"Tournament",
|
||||
"Capture the Flag",
|
||||
"RQ3 Teamplay",
|
||||
0
|
||||
};
|
||||
|
||||
static int gametype_remap[] = {GT_FFA, GT_TEAM, GT_TOURNAMENT, GT_CTF};
|
||||
static int gametype_remap2[] = {0, 2, 0, 1, 3};
|
||||
// JBravo: adding teamplay to the starserver UI so the right maps appear
|
||||
static int gametype_remap[] = {GT_FFA, GT_TEAM, GT_TOURNAMENT, GT_CTF, GT_TEAMPLAY};
|
||||
static int gametype_remap2[] = {0, 2, 0, 1, 4, 3};
|
||||
|
||||
|
||||
static void UI_ServerOptionsMenu( qboolean multiplayer );
|
||||
|
@ -147,6 +152,12 @@ static int GametypeBits( char *string ) {
|
|||
continue;
|
||||
}
|
||||
|
||||
// JBravo: handle teamplay
|
||||
if( Q_stricmp( token, "teamplay" ) == 0 ) {
|
||||
bits |= 1 << GT_TEAMPLAY;
|
||||
continue;
|
||||
}
|
||||
|
||||
if( Q_stricmp( token, "team" ) == 0 ) {
|
||||
bits |= 1 << GT_TEAM;
|
||||
continue;
|
||||
|
@ -839,6 +850,13 @@ static void ServerOptions_Start( void ) {
|
|||
trap_Cvar_SetValue( "ui_team_friendlt", friendlyfire );
|
||||
break;
|
||||
|
||||
// JBravo: teamplay
|
||||
case GT_TEAMPLAY:
|
||||
trap_Cvar_SetValue( "ui_team_fraglimit", fraglimit );
|
||||
trap_Cvar_SetValue( "ui_team_timelimit", timelimit );
|
||||
trap_Cvar_SetValue( "ui_team_friendlt", friendlyfire );
|
||||
break;
|
||||
|
||||
case GT_CTF:
|
||||
trap_Cvar_SetValue( "ui_ctf_fraglimit", fraglimit );
|
||||
trap_Cvar_SetValue( "ui_ctf_timelimit", timelimit );
|
||||
|
@ -1106,7 +1124,7 @@ static void ServerOptions_InitBotNames( void ) {
|
|||
if( s_serveroptions.gametype >= GT_TEAM ) {
|
||||
Q_strncpyz( s_serveroptions.playerNameBuffers[1], "grunt", 16 );
|
||||
Q_strncpyz( s_serveroptions.playerNameBuffers[2], "major", 16 );
|
||||
if( s_serveroptions.gametype == GT_TEAM ) {
|
||||
if( s_serveroptions.gametype == GT_TEAM || s_serveroptions.gametype == GT_TEAMPLAY ) {
|
||||
Q_strncpyz( s_serveroptions.playerNameBuffers[3], "visor", 16 );
|
||||
}
|
||||
else {
|
||||
|
@ -1118,7 +1136,7 @@ static void ServerOptions_InitBotNames( void ) {
|
|||
Q_strncpyz( s_serveroptions.playerNameBuffers[6], "sarge", 16 );
|
||||
Q_strncpyz( s_serveroptions.playerNameBuffers[7], "grunt", 16 );
|
||||
Q_strncpyz( s_serveroptions.playerNameBuffers[8], "major", 16 );
|
||||
if( s_serveroptions.gametype == GT_TEAM ) {
|
||||
if( s_serveroptions.gametype == GT_TEAM || s_serveroptions.gametype == GT_TEAMPLAY ) {
|
||||
Q_strncpyz( s_serveroptions.playerNameBuffers[9], "visor", 16 );
|
||||
}
|
||||
else {
|
||||
|
@ -1210,6 +1228,13 @@ static void ServerOptions_SetMenuItems( void ) {
|
|||
s_serveroptions.friendlyfire.curvalue = (int)Com_Clamp( 0, 1, trap_Cvar_VariableValue( "ui_team_friendly" ) );
|
||||
break;
|
||||
|
||||
// JBravo: teamplay
|
||||
case GT_TEAMPLAY:
|
||||
Com_sprintf( s_serveroptions.fraglimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 999, trap_Cvar_VariableValue( "ui_team_fraglimit" ) ) );
|
||||
Com_sprintf( s_serveroptions.timelimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 999, trap_Cvar_VariableValue( "ui_team_timelimit" ) ) );
|
||||
s_serveroptions.friendlyfire.curvalue = (int)Com_Clamp( 0, 1, trap_Cvar_VariableValue( "ui_team_friendly" ) );
|
||||
break;
|
||||
|
||||
case GT_CTF:
|
||||
Com_sprintf( s_serveroptions.flaglimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 100, trap_Cvar_VariableValue( "ui_ctf_capturelimit" ) ) );
|
||||
Com_sprintf( s_serveroptions.timelimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 999, trap_Cvar_VariableValue( "ui_ctf_timelimit" ) ) );
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.6 2002/01/11 20:20:58 jbravo
|
||||
// Adding TP to main branch
|
||||
//
|
||||
// Revision 1.5 2002/01/11 19:48:33 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -171,6 +174,7 @@ void TeamMain_MenuInit( void ) {
|
|||
|
||||
default:
|
||||
case GT_TEAM:
|
||||
case GT_TEAMPLAY: // JBravo: Hmm ?
|
||||
case GT_CTF:
|
||||
s_teammain.joingame.generic.flags |= QMF_GRAYED;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue