Discard "Rocket Arena" in favor of "OmegA Weapon Arena"

This commit is contained in:
2025-07-18 16:51:40 -03:00
parent 45159a68b7
commit e08a0e41e4
13 changed files with 187 additions and 73 deletions

View File

@@ -1119,7 +1119,7 @@ typedef struct {
//Last Man Standing
int lms_mode;
//instantgib + nexuiz style rocket arena:
//instantgib + weapon arena:
int nopickup;
//Double Domination DD

View File

@@ -269,7 +269,7 @@ static void CG_TouchItem( centity_t *cent ) {
//normally we can
canBePicked = qtrue;
//But in instantgib, rocket arena, and CTF_ELIMINATION we normally can't:
//But in instantgib, weapon arena, and CTF_ELIMINATION we normally can't:
if(cgs.nopickup || cgs.gametype == GT_CTF_ELIMINATION)
canBePicked = qfalse;

View File

@@ -361,7 +361,7 @@ void CG_ParseServerinfo( void ) {
cgs.timelimit = atoi( Info_ValueForKey( info, "timelimit" ) );
cgs.maxclients = atoi( Info_ValueForKey( info, "sv_maxclients" ) );
cgs.roundtime = atoi( Info_ValueForKey( info, "elimination_roundtime" ) );
cgs.nopickup = atoi( Info_ValueForKey( info, "g_rockets" ) ) + atoi( Info_ValueForKey( info, "g_instantgib" ) ) + atoi( Info_ValueForKey( info, "g_elimination" ) );
cgs.nopickup = atoi( Info_ValueForKey( info, "g_weaponarena" ) ) + atoi( Info_ValueForKey( info, "g_instantgib" ) ) + atoi( Info_ValueForKey( info, "g_elimination" ) );
cgs.lms_mode = atoi( Info_ValueForKey( info, "g_lms_mode" ) );
cgs.altExcellent = atoi( Info_ValueForKey( info, "g_multiKill" ) );
mapname = Info_ValueForKey( info, "mapname" );

View File

@@ -1681,16 +1681,39 @@ void BotChooseWeapon(bot_state_t *bs) {
trap_EA_SelectWeapon(bs->client, bs->weaponnum);
}
else {
if(g_instantgib.integer)
newweaponnum = WP_RAILGUN;
else if(g_rockets.integer)
newweaponnum = WP_ROCKET_LAUNCHER;
else
if ( g_instantgib.integer == 1 || g_weaponarena.integer == 7 ) {
newweaponnum = WP_RAILGUN;
} else if ( g_weaponarena.integer == 5 ) {
newweaponnum = WP_ROCKET_LAUNCHER;
} else if ( g_weaponarena.integer == 1 ) {
newweaponnum = WP_GAUNTLET;
} else if ( g_weaponarena.integer == 2 ) {
newweaponnum = WP_MACHINEGUN;
} else if ( g_weaponarena.integer == 3 ) {
newweaponnum = WP_SHOTGUN;
} else if ( g_weaponarena.integer == 4 ) {
newweaponnum = WP_GRENADE_LAUNCHER;
} else if ( g_weaponarena.integer == 6 ) {
newweaponnum = WP_LIGHTNING;
} else if ( g_weaponarena.integer == 8 ) {
newweaponnum = WP_PLASMAGUN;
} else if ( g_weaponarena.integer == 9 ) {
newweaponnum = WP_BFG;
} else if ( g_weaponarena.integer == 10 ) {
newweaponnum = WP_NAILGUN;
} else if ( g_weaponarena.integer == 11 ) {
newweaponnum = WP_PROX_LAUNCHER;
} else if ( g_weaponarena.integer == 12 ) {
newweaponnum = WP_CHAINGUN;
}
else
newweaponnum = trap_BotChooseBestFightWeapon(bs->ws, bs->inventory);
if (bs->weaponnum != newweaponnum) bs->weaponchange_time = FloatTime();
bs->weaponnum = newweaponnum;
//BotAI_Print(PRT_MESSAGE, "bs->weaponnum = %d\n", bs->weaponnum);
trap_EA_SelectWeapon(bs->client, bs->weaponnum);
if (bs->weaponnum != newweaponnum) {
bs->weaponchange_time = FloatTime();
bs->weaponnum = newweaponnum;
//BotAI_Print(PRT_MESSAGE, "bs->weaponnum = %d\n", bs->weaponnum);
trap_EA_SelectWeapon(bs->client, bs->weaponnum);
}
}
}

View File

@@ -188,7 +188,7 @@ int BotAI_GetEntityState( int entityNum, entityState_t *state ) {
memset( state, 0, sizeof(entityState_t) );
if (!ent->inuse) return qfalse;
if (!ent->r.linked) return qfalse;
if ( !(g_gametype.integer == GT_ELIMINATION || g_gametype.integer == GT_LMS ||g_instantgib.integer || g_rockets.integer || g_elimination_allgametypes.integer || g_gametype.integer==GT_CTF_ELIMINATION)
if ( !(g_gametype.integer == GT_ELIMINATION || g_gametype.integer == GT_LMS ||g_instantgib.integer || g_weaponarena.integer || g_elimination_allgametypes.integer || g_gametype.integer==GT_CTF_ELIMINATION)
&& (ent->r.svFlags & SVF_NOCLIENT) ) return qfalse;
memcpy( state, &ent->s, sizeof(entityState_t) );
return qtrue;
@@ -1509,7 +1509,7 @@ int BotAIStartFrame(int time) {
trap_BotLibUpdateEntity(i, NULL);
continue;
}
if ( !(g_gametype.integer == GT_ELIMINATION || g_gametype.integer == GT_LMS ||g_instantgib.integer || g_rockets.integer || g_elimination_allgametypes.integer || g_gametype.integer==GT_CTF_ELIMINATION)
if ( !(g_gametype.integer == GT_ELIMINATION || g_gametype.integer == GT_LMS ||g_instantgib.integer || g_weaponarena.integer || g_elimination_allgametypes.integer || g_gametype.integer==GT_CTF_ELIMINATION)
&& ent->r.svFlags & SVF_NOCLIENT) {
trap_BotLibUpdateEntity(i, NULL);
continue;

View File

@@ -1992,22 +1992,56 @@ else
// ent->health = client->ps.stats[STAT_HEALTH] = 0;
}
//Instantgib mode, replace weapons with rail (and maybe gauntlet)
//alternatively, nailgun
if(g_instantgib.integer)
{
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_RAILGUN );
client->ps.ammo[WP_RAILGUN] = -1; //Don't display any ammo
if(g_instantgib.integer>1)
{
if(g_instantgib.integer == 2) {
client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_GAUNTLET );
client->ps.ammo[WP_GAUNTLET] = -1;
}
if(g_instantgib.integer == 3) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_NAILGUN );
client->ps.ammo[WP_NAILGUN] = -1;
}
}
//nexuiz style rocket arena (rocket launcher only)
if(g_rockets.integer)
{
if (g_weaponarena.integer == 1) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_GAUNTLET );
client->ps.ammo[WP_GAUNTLET] = -1;
} else if (g_weaponarena.integer == 2) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_MACHINEGUN );
client->ps.ammo[WP_MACHINEGUN] = 999;
} else if (g_weaponarena.integer == 3) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_SHOTGUN );
client->ps.ammo[WP_SHOTGUN] = 999;
} else if (g_weaponarena.integer == 4) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_GRENADE_LAUNCHER );
client->ps.ammo[WP_GRENADE_LAUNCHER] = 999;
} else if (g_weaponarena.integer == 5) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_ROCKET_LAUNCHER );
client->ps.ammo[WP_ROCKET_LAUNCHER] = -1;
client->ps.ammo[WP_ROCKET_LAUNCHER] = 999;
} else if (g_weaponarena.integer == 6) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_LIGHTNING );
client->ps.ammo[WP_LIGHTNING] = 999;
} else if (g_weaponarena.integer == 7) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_RAILGUN );
client->ps.ammo[WP_RAILGUN] = 999;
} else if (g_weaponarena.integer == 8) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_PLASMAGUN );
client->ps.ammo[WP_PLASMAGUN] = 999;
} else if (g_weaponarena.integer == 9) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_BFG );
client->ps.ammo[WP_BFG] = 999;
} else if (g_weaponarena.integer == 10) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_NAILGUN );
client->ps.ammo[WP_NAILGUN] = 999;
} else if (g_weaponarena.integer == 11) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_PROX_LAUNCHER );
client->ps.ammo[WP_PROX_LAUNCHER] = 999;
} else if (g_weaponarena.integer == 12) {
client->ps.stats[STAT_WEAPONS] = ( 1 << WP_CHAINGUN );
client->ps.ammo[WP_CHAINGUN] = 999;
}
G_SetOrigin( ent, spawn_origin );

View File

@@ -130,9 +130,9 @@ void TossClientItems( gentity_t *self ) {
}
}
if (g_instantgib.integer || g_rockets.integer || g_gametype.integer == GT_CTF_ELIMINATION || g_elimination_allgametypes.integer){
//Nothing!
}
if (g_instantgib.integer || g_weaponarena.integer || g_gametype.integer == GT_CTF_ELIMINATION || g_elimination_allgametypes.integer) {
return;
}
else
if ( weapon >= WP_MACHINEGUN && weapon != WP_GRAPPLING_HOOK &&
self->client->ps.ammo[ weapon ] ) {

View File

@@ -343,6 +343,11 @@ void RespawnItem( gentity_t *ent ) {
//Don't spawn quad if quadfactor are 1.0 or less
if(ent->item->giType == IT_POWERUP && ent->item->giTag == PW_QUAD && g_quadfactor.value <= 1.0)
return;
//Don't spawn quad if quadfactor is more than 5.0, either
if(ent->item->giType == IT_POWERUP && ent->item->giTag == PW_QUAD && g_quadfactor.value >= 5.0) {
return;
}
// randomly select from teamed entities
if (ent->team) {
@@ -416,7 +421,7 @@ void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace) {
qboolean predict;
//instant gib
if ((g_instantgib.integer || g_rockets.integer || g_gametype.integer == GT_CTF_ELIMINATION || g_elimination_allgametypes.integer)
if ((g_instantgib.integer || g_weaponarena.integer || g_gametype.integer == GT_CTF_ELIMINATION || g_elimination_allgametypes.integer)
&& ent->item->giType != IT_TEAM)
return;
@@ -713,7 +718,7 @@ void FinishSpawningItem( gentity_t *ent ) {
// powerups don't spawn in for a while (but not in elimination)
if(g_gametype.integer != GT_ELIMINATION && g_gametype.integer != GT_CTF_ELIMINATION && g_gametype.integer != GT_LMS
&& !g_instantgib.integer && !g_elimination_allgametypes.integer && !g_rockets.integer )
&& !g_instantgib.integer && !g_elimination_allgametypes.integer && !g_weaponarena.integer )
if ( ent->item->giType == IT_POWERUP ) {
float respawn;
@@ -822,17 +827,35 @@ ClearRegisteredItems
void ClearRegisteredItems( void ) {
memset( itemRegistered, 0, sizeof( itemRegistered ) );
if(g_instantgib.integer) {
if(g_instantgib.integer || g_weaponarena.integer == 7) {
if(g_instantgib.integer & 2)
RegisterItem( BG_FindItemForWeapon( WP_GAUNTLET ) );
//RegisterItem( BG_FindItemForWeapon( WP_MACHINEGUN ) );
RegisterItem( BG_FindItemForWeapon( WP_RAILGUN ) );
}
else
if(g_rockets.integer) {
//RegisterItem( BG_FindItemForWeapon( WP_GAUNTLET ) );
//RegisterItem( BG_FindItemForWeapon( WP_MACHINEGUN ) );
if(g_weaponarena.integer == 5) {
RegisterItem( BG_FindItemForWeapon( WP_ROCKET_LAUNCHER ) );
} else if (g_weaponarena.integer == 1) {
RegisterItem( BG_FindItemForWeapon( WP_GAUNTLET ) );
} else if (g_weaponarena.integer == 2) {
RegisterItem( BG_FindItemForWeapon( WP_MACHINEGUN ) );
} else if (g_weaponarena.integer == 3) {
RegisterItem( BG_FindItemForWeapon( WP_SHOTGUN ) );
} else if (g_weaponarena.integer == 4) {
RegisterItem( BG_FindItemForWeapon( WP_GRENADE_LAUNCHER ) );
} else if (g_weaponarena.integer == 6) {
RegisterItem( BG_FindItemForWeapon( WP_LIGHTNING ) );
} else if (g_weaponarena.integer == 8) {
RegisterItem( BG_FindItemForWeapon( WP_PLASMAGUN ) );
} else if (g_weaponarena.integer == 9) {
RegisterItem( BG_FindItemForWeapon( WP_BFG ) );
} else if (g_weaponarena.integer == 10) {
RegisterItem( BG_FindItemForWeapon( WP_NAILGUN ) );
} else if (g_weaponarena.integer == 11) {
RegisterItem( BG_FindItemForWeapon( WP_PROX_LAUNCHER ) );
} else if (g_weaponarena.integer == 12) {
RegisterItem( BG_FindItemForWeapon( WP_CHAINGUN ) );
}
else
{
@@ -840,7 +863,7 @@ void ClearRegisteredItems( void ) {
RegisterItem( BG_FindItemForWeapon( WP_MACHINEGUN ) );
RegisterItem( BG_FindItemForWeapon( WP_GAUNTLET ) );
if(g_gametype.integer == GT_ELIMINATION || g_gametype.integer == GT_CTF_ELIMINATION
|| g_gametype.integer == GT_LMS || g_elimination_allgametypes.integer)
|| g_gametype.integer == GT_LMS || g_elimination_allgametypes.integer || g_weaponarena.integer == 13)
{
RegisterItem( BG_FindItemForWeapon( WP_SHOTGUN ) );
RegisterItem( BG_FindItemForWeapon( WP_GRENADE_LAUNCHER ) );
@@ -945,7 +968,7 @@ void G_SpawnItem (gentity_t *ent, gitem_t *item) {
G_SpawnFloat( "random", "0", &ent->random );
G_SpawnFloat( "wait", "0", &ent->wait );
if((item->giType == IT_TEAM && (g_instantgib.integer || g_rockets.integer) ) || (!g_instantgib.integer && !g_rockets.integer) )
if((item->giType == IT_TEAM && (g_instantgib.integer || g_weaponarena.integer) ) || (!g_instantgib.integer && !g_weaponarena.integer) )
{
//Don't load pickups in Elimination (or maybe... gives warnings)
if (g_gametype.integer != GT_ELIMINATION && g_gametype.integer != GT_CTF_ELIMINATION && g_gametype.integer != GT_LMS)
@@ -968,7 +991,7 @@ void G_SpawnItem (gentity_t *ent, gitem_t *item) {
ent->physicsBounce = 0.50; // items are bouncy
if (g_gametype.integer == GT_ELIMINATION || g_gametype.integer == GT_LMS ||
( item->giType != IT_TEAM && (g_instantgib.integer || g_rockets.integer || g_elimination_allgametypes.integer || g_gametype.integer==GT_CTF_ELIMINATION) ) ) {
( item->giType != IT_TEAM && (g_instantgib.integer || g_weaponarena.integer || g_elimination_allgametypes.integer || g_gametype.integer==GT_CTF_ELIMINATION) ) ) {
ent->s.eFlags |= EF_NODRAW; //Invisible in elimination
ent->r.svFlags |= SVF_NOCLIENT; //Don't broadcast
}

View File

@@ -1074,7 +1074,7 @@ extern vmCvar_t g_elimination_nail;
//If lockspectator: 0=no limit, 1 = cannot follow enemy, 2 = must follow friend
extern vmCvar_t g_elimination_lockspectator;
extern vmCvar_t g_rockets;
extern vmCvar_t g_weaponarena;
//new in elimination Beta2
extern vmCvar_t g_instantgib;

View File

@@ -129,7 +129,7 @@ vmCvar_t g_elimination_nail;
vmCvar_t g_elimination_lockspectator;
vmCvar_t g_rockets;
vmCvar_t g_weaponarena;
// dmn_clowns suggestions (with my idea of implementing):
vmCvar_t g_instantgib;
@@ -348,8 +348,8 @@ static cvarTable_t gameCvarTable[] = {
{ &g_persistantpowerups, "g_runes", "0", CVAR_LATCH|CVAR_ARCHIVE, 0, qfalse },
#endif
// Nexuiz style rocket arena
{ &g_rockets, "g_rockets", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_NORESTART, 0, qfalse },
// Weapon Arena
{ &g_weaponarena, "g_weaponarena", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_NORESTART, 0, qfalse },
// Instantgib and Vampire thingies
{ &g_instantgib, "g_instantgib", "0", CVAR_SERVERINFO | CVAR_LATCH, 0, qfalse },
@@ -616,7 +616,7 @@ void G_UpdateCvars( void ) {
VoteParseCustomVotes();
//Here comes the cvars that must trigger a map_restart
if (cv->vmCvar == &g_instantgib || cv->vmCvar == &g_rockets || cv->vmCvar == &g_elimination_allgametypes) {
if (cv->vmCvar == &g_instantgib || cv->vmCvar == &g_weaponarena || cv->vmCvar == &g_elimination_allgametypes) {
trap_Cvar_Set("sv_dorestart","1");
}
@@ -706,7 +706,7 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
if( g_gametype.integer == GT_SINGLE_PLAYER )
{
g_instantgib.integer = 0;
g_rockets.integer = 0;
g_weaponarena.integer = 0;
g_vampire.value = 0.0f;
}

View File

@@ -126,7 +126,7 @@ static void MessageMenu_Draw( void ) {
y = 188;
for(i=0; s_confirm.lines[i]; i++)
{
UI_DrawProportionalString( 320, y, s_confirm.lines[i], s_confirm.style, color_red );
UI_DrawProportionalString( 320, y, s_confirm.lines[i], s_confirm.style, color_white );
y += 18;
}
@@ -144,8 +144,8 @@ ConfirmMenu_Draw
*/
static void ConfirmMenu_Draw( void ) {
UI_DrawNamedPic( 142, 118, 359, 256, ART_CONFIRM_FRAME );
UI_DrawProportionalString( 320, 204, s_confirm.question, s_confirm.style, color_red );
UI_DrawProportionalString( s_confirm.slashX, 265, "/", UI_LEFT|UI_INVERSE, color_red );
UI_DrawProportionalString( 320, 204, s_confirm.question, s_confirm.style, color_white );
UI_DrawProportionalString( s_confirm.slashX, 265, "/", UI_LEFT|UI_INVERSE, color_white );
Menu_Draw( &s_confirm.menu );
@@ -212,7 +212,7 @@ void UI_ConfirmMenu_Style( const char *question, int style, void (*draw)( void )
s_confirm.yes.generic.x = l1;
s_confirm.yes.generic.y = 264;
s_confirm.yes.string = "YES";
s_confirm.yes.color = color_red;
s_confirm.yes.color = color_white;
s_confirm.yes.style = UI_LEFT;
s_confirm.no.generic.type = MTYPE_PTEXT;
@@ -222,7 +222,7 @@ void UI_ConfirmMenu_Style( const char *question, int style, void (*draw)( void )
s_confirm.no.generic.x = l3;
s_confirm.no.generic.y = 264;
s_confirm.no.string = "NO";
s_confirm.no.color = color_red;
s_confirm.no.color = color_white;
s_confirm.no.style = UI_LEFT;
Menu_AddItem( &s_confirm.menu, &s_confirm.yes );
@@ -282,7 +282,7 @@ void UI_Message( const char **lines ) {
s_confirm.yes.generic.x = l1;
s_confirm.yes.generic.y = 280;
s_confirm.yes.string = "OK";
s_confirm.yes.color = color_red;
s_confirm.yes.color = color_white;
s_confirm.yes.style = UI_LEFT;
Menu_AddItem( &s_confirm.menu, &s_confirm.yes );

View File

@@ -192,7 +192,7 @@ void InGame_MenuInit( void ) {
s_ingame.team.generic.id = ID_TEAM;
s_ingame.team.generic.callback = InGame_Event;
s_ingame.team.string = "START";
s_ingame.team.color = color_red;
s_ingame.team.color = color_white;
s_ingame.team.style = UI_CENTER|UI_SMALLFONT;
y += INGAME_MENU_VERTICAL_SPACING;
@@ -203,7 +203,7 @@ void InGame_MenuInit( void ) {
s_ingame.addbots.generic.id = ID_ADDBOTS;
s_ingame.addbots.generic.callback = InGame_Event;
s_ingame.addbots.string = "ADD BOTS";
s_ingame.addbots.color = color_red;
s_ingame.addbots.color = color_white;
s_ingame.addbots.style = UI_CENTER|UI_SMALLFONT;
if( !trap_Cvar_VariableValue( "sv_running" ) || !trap_Cvar_VariableValue( "bot_enable" ) || (trap_Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER)) {
s_ingame.addbots.generic.flags |= QMF_GRAYED;
@@ -217,7 +217,7 @@ void InGame_MenuInit( void ) {
s_ingame.removebots.generic.id = ID_REMOVEBOTS;
s_ingame.removebots.generic.callback = InGame_Event;
s_ingame.removebots.string = "REMOVE BOTS";
s_ingame.removebots.color = color_red;
s_ingame.removebots.color = color_white;
s_ingame.removebots.style = UI_CENTER|UI_SMALLFONT;
if( !trap_Cvar_VariableValue( "sv_running" ) || !trap_Cvar_VariableValue( "bot_enable" ) || (trap_Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER)) {
s_ingame.removebots.generic.flags |= QMF_GRAYED;
@@ -231,7 +231,7 @@ void InGame_MenuInit( void ) {
s_ingame.teamorders.generic.id = ID_TEAMORDERS;
s_ingame.teamorders.generic.callback = InGame_Event;
s_ingame.teamorders.string = "TEAM ORDERS";
s_ingame.teamorders.color = color_red;
s_ingame.teamorders.color = color_white;
s_ingame.teamorders.style = UI_CENTER|UI_SMALLFONT;
if( !(trap_Cvar_VariableValue( "g_gametype" ) >= GT_TEAM) || (trap_Cvar_VariableValue( "g_gametype" ) == GT_LMS ) ) {
s_ingame.teamorders.generic.flags |= QMF_GRAYED;
@@ -253,7 +253,7 @@ void InGame_MenuInit( void ) {
s_ingame.vote.generic.id = ID_VOTE;
s_ingame.vote.generic.callback = InGame_Event;
s_ingame.vote.string = "CALL VOTE";
s_ingame.vote.color = color_red;
s_ingame.vote.color = color_white;
s_ingame.vote.style = UI_CENTER|UI_SMALLFONT;
trap_GetConfigString( CS_SERVERINFO, info, MAX_INFO_STRING );
if( atoi( Info_ValueForKey(info,"g_allowVote") )==0 || trap_Cvar_VariableValue("g_gametype")==GT_SINGLE_PLAYER ) {
@@ -268,7 +268,7 @@ void InGame_MenuInit( void ) {
s_ingame.setup.generic.id = ID_SETUP;
s_ingame.setup.generic.callback = InGame_Event;
s_ingame.setup.string = "SETUP";
s_ingame.setup.color = color_red;
s_ingame.setup.color = color_white;
s_ingame.setup.style = UI_CENTER|UI_SMALLFONT;
y += INGAME_MENU_VERTICAL_SPACING;
@@ -279,7 +279,7 @@ void InGame_MenuInit( void ) {
s_ingame.server.generic.id = ID_SERVERINFO;
s_ingame.server.generic.callback = InGame_Event;
s_ingame.server.string = "SERVER INFO";
s_ingame.server.color = color_red;
s_ingame.server.color = color_white;
s_ingame.server.style = UI_CENTER|UI_SMALLFONT;
y += INGAME_MENU_VERTICAL_SPACING;
@@ -290,7 +290,7 @@ void InGame_MenuInit( void ) {
s_ingame.restart.generic.id = ID_RESTART;
s_ingame.restart.generic.callback = InGame_Event;
s_ingame.restart.string = "RESTART ARENA";
s_ingame.restart.color = color_red;
s_ingame.restart.color = color_white;
s_ingame.restart.style = UI_CENTER|UI_SMALLFONT;
if( !trap_Cvar_VariableValue( "sv_running" ) ) {
s_ingame.restart.generic.flags |= QMF_GRAYED;
@@ -304,7 +304,7 @@ void InGame_MenuInit( void ) {
s_ingame.resume.generic.id = ID_RESUME;
s_ingame.resume.generic.callback = InGame_Event;
s_ingame.resume.string = "RESUME GAME";
s_ingame.resume.color = color_red;
s_ingame.resume.color = color_white;
s_ingame.resume.style = UI_CENTER|UI_SMALLFONT;
y += INGAME_MENU_VERTICAL_SPACING;
@@ -315,7 +315,7 @@ void InGame_MenuInit( void ) {
s_ingame.leave.generic.id = ID_LEAVEARENA;
s_ingame.leave.generic.callback = InGame_Event;
s_ingame.leave.string = "LEAVE ARENA";
s_ingame.leave.color = color_red;
s_ingame.leave.color = color_white;
s_ingame.leave.style = UI_CENTER|UI_SMALLFONT;
y += INGAME_MENU_VERTICAL_SPACING;
@@ -326,7 +326,7 @@ void InGame_MenuInit( void ) {
s_ingame.quit.generic.id = ID_QUIT;
s_ingame.quit.generic.callback = InGame_Event;
s_ingame.quit.string = "EXIT GAME";
s_ingame.quit.color = color_red;
s_ingame.quit.color = color_white;
s_ingame.quit.style = UI_CENTER|UI_SMALLFONT;
Menu_AddItem( &s_ingame.menu, &s_ingame.frame );

View File

@@ -140,6 +140,25 @@ static int gametype_remap2[] = {
10,
11 }; //this works and should increment for more gametypes
static const char *s_weapon_names[] = {
"Off",
"Gauntlet",
"Machinegun",
"Shotgun",
"Grenade Launcher",
"Rocket Launcher",
"Lightning",
"Railgun",
"Plasmagun",
"BFG",
"Nailgun",
"Proximity Launcher",
"Chaingun",
"All Weapons",
NULL
};
static void UI_ServerOptionsMenu( qboolean multiplayer );
@@ -294,7 +313,7 @@ static void StartServer_Update( void ) {
// set the map name
info = UI_GetArenaInfoByNumber( s_startserver.maplist[ s_startserver.currentmap ]);
Q_strncpyz( s_startserver.mapname.string, Info_ValueForKey( info, "map" ), MAX_NAMELENGTH);
Q_strncpyz( s_startserver.mapname.string, Info_ValueForKey( info, "longname" ), MAX_NAMELENGTH);
}
Q_strupr( s_startserver.mapname.string );
@@ -388,7 +407,6 @@ static void StartServer_MenuEvent( void* ptr, int event ) {
break;
case ID_AUTONEXTMAP:
//trap_Cvar_SetValue( "cg_alwaysWeaponBar", s_preferences.alwaysweaponbar.curvalue );
trap_Cvar_SetValue( "g_autonextmap", s_startserver.autonextmap.curvalue );
break;
@@ -735,7 +753,7 @@ typedef struct {
//Here are the elimination stuff
menuradiobutton_s oneway;
menuradiobutton_s instantgib;
menuradiobutton_s rockets;
menulist_s weaponarena;
menuradiobutton_s cheats;
menulist_s lmsMode;
menulist_s botSkill;
@@ -849,7 +867,7 @@ static void ServerOptions_Start( void ) {
int pmove;
int lan;
int instantgib;
int rockets;
int weaponarena;
int cheats;
int oneway;
int lmsMode;
@@ -867,7 +885,7 @@ static void ServerOptions_Start( void ) {
lan = s_serveroptions.lan.curvalue;
pmove = s_serveroptions.pmove.curvalue;
instantgib = s_serveroptions.instantgib.curvalue;
rockets = s_serveroptions.rockets.curvalue;
weaponarena = s_serveroptions.weaponarena.curvalue;
cheats = s_serveroptions.cheats.curvalue;
oneway = s_serveroptions.oneway.curvalue;
//Sago: For some reason you need to add 1 to curvalue to get the UI to show the right thing (fixed?)
@@ -957,7 +975,7 @@ static void ServerOptions_Start( void ) {
trap_Cvar_SetValue( "sv_pure", pure );
trap_Cvar_SetValue( "sv_lanForceRate", lan );
trap_Cvar_SetValue( "g_instantgib", instantgib );
trap_Cvar_SetValue( "g_rockets", rockets );
trap_Cvar_SetValue( "g_weaponarena", weaponarena );
trap_Cvar_SetValue( "g_lms_mode", lmsMode);
trap_Cvar_SetValue( "elimination_ctf_oneway", oneway );
switch(pmove) {
@@ -1023,6 +1041,15 @@ static void ServerOptions_Start( void ) {
}
static void ServerOptions_UpdateMenuItems( void ) {
if ( s_serveroptions.instantgib.curvalue == 1 ) {
s_serveroptions.weaponarena.generic.flags |= QMF_GRAYED;
trap_Cvar_SetValue( "g_weaponarena", 0 );
} else {
s_serveroptions.weaponarena.generic.flags &= ~QMF_GRAYED;
}
}
/*
=================
ServerOptions_InitPlayerItems
@@ -1200,11 +1227,11 @@ static void ServerOptions_StatusBar_Instantgib( void* ptr ) {
/*
=================
ServerOptions_StatusBar_Allrockets
ServerOptions_StatusBar_WeaponArena
=================
*/
static void ServerOptions_StatusBar_Allrockets( void* ptr ) {
UI_DrawString( 320, 440, "Only Rocket launcher with Inf. ammo", UI_CENTER|UI_SMALLFONT, colorWhite );
static void ServerOptions_StatusBar_WeaponArena( void* ptr ) {
UI_DrawString( 320, 440, "Only one weapon with Inf. ammo", UI_CENTER|UI_SMALLFONT, colorWhite );
}
/*
@@ -1392,6 +1419,11 @@ static void ServerOptions_InitBotNames( void ) {
}
void ServerOptions_MenuDraw( void ) {
ServerOptions_UpdateMenuItems();
Menu_Draw( &s_serveroptions.menu );
}
/*
=================
ServerOptions_SetMenuItems
@@ -1478,7 +1510,7 @@ static void ServerOptions_SetMenuItems( void ) {
s_serveroptions.pure.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "sv_pure" ) );
s_serveroptions.lan.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "sv_lanforcerate" ) );
s_serveroptions.instantgib.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "g_instantgib" ) );
s_serveroptions.rockets.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "g_rockets" ) );
s_serveroptions.weaponarena.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "g_weaponarena" ) );
s_serveroptions.lmsMode.curvalue = Com_Clamp( 0, 3, trap_Cvar_VariableValue("g_lms_mode") );
s_serveroptions.oneway.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "elimination_ctf_oneway" ) );
s_serveroptions.pmove.curvalue = 0;
@@ -1574,6 +1606,7 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) {
s_serveroptions.menu.wrapAround = qtrue;
s_serveroptions.menu.fullscreen = qtrue;
s_serveroptions.menu.draw = ServerOptions_MenuDraw;
s_serveroptions.banner.generic.type = MTYPE_BTEXT;
s_serveroptions.banner.generic.x = 320;
@@ -1678,12 +1711,13 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) {
//Rockets option
y += BIGCHAR_HEIGHT+2;
s_serveroptions.rockets.generic.type = MTYPE_RADIOBUTTON;
s_serveroptions.rockets.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_serveroptions.rockets.generic.x = OPTIONS_X;
s_serveroptions.rockets.generic.y = y;
s_serveroptions.rockets.generic.name = "All rockets:";
s_serveroptions.rockets.generic.statusbar = ServerOptions_StatusBar_Allrockets;
s_serveroptions.weaponarena.generic.type = MTYPE_SPINCONTROL;
s_serveroptions.weaponarena.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_serveroptions.weaponarena.generic.x = OPTIONS_X;
s_serveroptions.weaponarena.generic.y = y;
s_serveroptions.weaponarena.generic.name = "Weapon Arena:";
s_serveroptions.weaponarena.itemnames = s_weapon_names;
s_serveroptions.weaponarena.generic.statusbar = ServerOptions_StatusBar_WeaponArena;
//Cheats option
@@ -1840,7 +1874,7 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) {
}
Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.pure );
Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.instantgib );
Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.rockets );
Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.weaponarena );
Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.cheats );
if( s_serveroptions.gametype == GT_LMS) {
Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.lmsMode );