removed the odd domination gametype. will add a better one.

This commit is contained in:
q3rally 2011-03-07 19:44:22 +00:00
parent 56c4df2264
commit d95bb06399
14 changed files with 56 additions and 3115 deletions

View file

@ -535,34 +535,6 @@ void CG_DrawTeamBackground( int x, int y, int w, int h, float alpha, int team )
trap_R_SetColor( NULL );
}
/*
=======================
CG_DrawSigilHUD
=======================
*/
void CG_DrawSigilHUD( void ) {
int i, x=480, y=0;
for (i=0; i<MAX_SIGILS; i++) {
switch ( cgs.sigil[i] )
{
case SIGIL_ISWHITE:
CG_DrawPic( x, y, 18, 18, cgs.media.sigilShader );
break;
case SIGIL_ISRED:
CG_DrawPic( x, y, 18, 18, cgs.media.redFlagShader[0] );
break;
case SIGIL_ISBLUE:
CG_DrawPic( x, y, 18, 18, cgs.media.blueFlagShader[0] );
break;
}
x+= 19;
}
}
/*
================
CG_DrawStatusBar

View file

@ -263,10 +263,7 @@ void CG_DrawInformation( void ) {
case GT_CTF:
s = "Capture The Flag";
break;
// Q3Rally Code Start
case GT_DOMINATION:
s = "Domination";
break;
/*
#ifdef MISSIONPACK
case GT_1FCTF:

View file

@ -1275,7 +1275,6 @@ typedef struct {
// Q3Rally Code END
int redflag, blueflag; // flag status from configstrings
int flagStatus;
int sigil[MAX_SIGILS];
qboolean newHud;

View file

@ -2141,9 +2141,6 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum ) {
cgs.redflag = cgs.blueflag = -1; // For compatibily, default to unset for
cgs.flagStatus = -1;
// Q3Rally Code Start
cgs.sigil[0] = cgs.sigil[1] = cgs.sigil[2] = -1; // Sigil Reset
// Q3Rally Code END
// old servers
// get the rendering configuration from the client system

View file

@ -264,13 +264,6 @@ void CG_SetConfigValues( void ) {
cgs.blueflag = s[1] - '0';
}
else if ( cgs.gametype == GT_DOMINATION ) {
s = CG_ConfigString( CS_SIGILSTATUS );
cgs.sigil[0] = s[0] - '0';
cgs.sigil[1] = s[1] - '0';
cgs.sigil[2] = s[2] - '0';
}
#ifdef MISSIONPACK
else if( cgs.gametype == GT_1FCTF ) {
s = CG_ConfigString( CS_FLAGSTATUS );
@ -412,13 +405,6 @@ static void CG_ConfigStringModified( void ) {
#endif
}
else if ( num == CS_SIGILSTATUS ) {
if ( cgs.gametype == GT_DOMINATION ) {
cgs.sigil[0] = str[0] - '0';
cgs.sigil[1] = str[1] - '1';
cgs.sigil[2] = str[2] - '2';
}
}
else if ( num == CS_SHADERSTATE ) {
CG_ShaderStateChanged();

View file

@ -889,60 +889,6 @@ Only in CTF games
/* sounds */ ""
},
// Q3Rally Code Start
/*QUAKED team_DOMINATION_sigil_red
Only in Domination games
*/
{
"team_DOMINATION_sigil_red",
NULL,
{ "models/flags/r_flag.md3",
0, 0, 0 },
/* icon */ "icons/iconf_red1",
/* pickup */ "Flag",
0,
IT_SIGIL,
PW_SIGILRED,
/* precache */ "",
/* sounds */ ""
},
/*QUAKED team_DOMINATION_sigil_blue
Only in Domination games
*/
{
"team_DOMINATION_sigil_blue",
NULL,
{ "models/flags/b_flag.md3",
0, 0, 0 },
/* icon */ "icons/iconf_blu1",
/* pickup */ "Flag",
0,
IT_SIGIL,
PW_SIGILBLUE,
/* precache */ "",
/* sounds */ ""
},
/*QUAKED team_DOMINATION_sigil
Only in Domination games
*/
{
"team_DOMINATION_sigil",
NULL,
{ "models/flags/n_flag.md3",
0, 0, 0 },
/* icon */ "icons/iconf_neutral1",
/* pickup */ "Flag",
0,
IT_SIGIL,
PW_SIGILWHITE,
/* precache */ "",
/* sounds */ ""
},
// Q3Rally Code END
#ifdef MISSIONPACK
/*QUAKED holdable_kamikaze (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
@ -1493,17 +1439,6 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const play
#endif
return qfalse;
// Q3Rally Code Start
case IT_SIGIL:
// red team cannot touch a red sigil
if (ps->persistant[PERS_TEAM] == TEAM_RED && ent->powerups == PW_SIGILRED)
return qfalse;
// blue team cannot touch a blue sigil
else if (ps->persistant[PERS_TEAM] == TEAM_BLUE && ent->powerups == PW_SIGILBLUE)
return qfalse;
else
return qtrue;
// Q3Rally Code END
case IT_HOLDABLE:
// can only hold one item at a time

View file

@ -151,7 +151,6 @@ typedef enum {
GT_TEAM_RACING, // team racing
GT_TEAM_RACING_DM, // team racing with weapons
GT_CTF, // capture the flag
GT_DOMINATION, // domination
// Q3Rally Code END
GT_MAX_GAME_TYPE
} gametype_t;

View file

@ -803,17 +803,7 @@ void G_CheckTeamItems( void ) {
G_Printf( S_COLOR_YELLOW "WARNING: No team_CTF_blueflag in map" );
}
}
// Q3Rally Code Start
if ( g_gametype.integer == GT_DOMINATION )
{
gitem_t *item;
// check for at least one sigil
item = BG_FindItem( "Flag" );
if ( !item || !itemRegistered[item - bg_itemlist] )
G_Printf( S_COLOR_YELLOW "WARNING: No team_DOMINATION_sigil in map" );
}
// Q3Rally Code END
#ifdef MISSIONPACK
if( g_gametype.integer == GT_1FCTF ) {
gitem_t *item;

View file

@ -493,7 +493,7 @@ void G_SpawnGEntityFromSpawnVars( void ) {
// UPDATE : change these
// STONELANCE
// static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"};
static char *gametypeNames[] = {"racing", "racing_dm", "single", "derby", "dm", "team", "team_racing", "team_racing_dm", "ctf", "domination"};
static char *gametypeNames[] = {"racing", "racing_dm", "single", "derby", "dm", "team", "team_racing", "team_racing_dm", "ctf"};
// END
// get the next free entity
@ -819,10 +819,6 @@ void G_SpawnEntitiesFromString( void ) {
while( G_ParseSpawnVars() ) {
G_SpawnGEntityFromSpawnVars();
}
// make sure Domination maps have a 3rd sigil
if (g_gametype.integer == GT_DOMINATION)
G_ValidateSigils();
level.spawning = qfalse; // any future calls to G_Spawn*() will be errors

View file

@ -44,9 +44,7 @@ typedef struct teamgame_s {
int blueTakenTime;
int redObeliskAttackedTime;
int blueObeliskAttackedTime;
// Q3Rally Code Start
domination_sigil_t sigil[MAX_SIGILS];
// Q3Rally Code END
} teamgame_t;
teamgame_t teamgame;
@ -69,17 +67,6 @@ void Team_InitGame( void ) {
Team_SetFlagStatus( TEAM_BLUE, FLAG_ATBASE );
break;
// Q3Rally Code Start
case GT_DOMINATION:
Init_Sigils();
teamgame.sigil[0].status = teamgame.sigil[1].status = teamgame.sigil[2].status = -1; // Invalid to force update
Team_SetSigilStatus( 0, SIGIL_ISWHITE );
Team_SetSigilStatus( 1, SIGIL_ISWHITE );
Team_SetSigilStatus( 2, SIGIL_ISWHITE );
break;
// Q3Rally Code END
#ifdef MISSIONPACK
case GT_1FCTF:
@ -230,152 +217,12 @@ qboolean OnSameTeam( gentity_t *ent1, gentity_t *ent2 ) {
return qfalse;
}
// Q3Rally Code Start
static char dominationSigilStatusRemap[] = { '0', '1', '2' };
// Q3Rally Code END
static char ctfFlagStatusRemap[] = { '0', '1', '*', '*', '2' };
static char oneFlagStatusRemap[] = { '0', '1', '2', '3', '4' };
// Q3Rally Code Start
/*
========================
Init_Sigils
========================
*/
void Init_Sigils( void ) {
gentity_t *point = NULL;
int sigilNum = 0;
for (point = g_entities; point < &g_entities[level.num_entities] ;
point++)
{
if (!point->inuse)
continue;
if (!strcmp(point->classname, "team_Domination_sigil")) {
teamgame.sigil[sigilNum].entity = point;
sigilNum++;
}
if ( sigilNum == 2 )
return;
}
}
/*
===============================
Team_SetSigilStatus
===============================
*/
void Team_SetSigilStatus( int sigilNum, sigilStatus_t status ) {
qboolean modified = qfalse;
// update only the sigil modified
if( teamgame.sigil[sigilNum].status != status );
teamgame.sigil[sigilNum].status = status;
modified = qtrue;
if( modified ) {
char st[4];
//send all 3 sigils' status to the configstring
st[0] = dominationSigilStatusRemap[teamgame.sigil[0].status];
st[1] = dominationSigilStatusRemap[teamgame.sigil[1].status];
st[2] = dominationSigilStatusRemap[teamgame.sigil[2].status];
st[3] = 0;
trap_SetConfigstring( CS_SIGILSTATUS, st );
}
}
/*
==============================
ValidateSigilsInMap
==============================
*/
#define FRADIUS 800
void ValidateSigilsInMap( gentity_t *ent )
{
vec3_t start, end, temp, mins, maxs, tvec, offset = {FRADIUS, FRADIUS, FRADIUS};
int numEnts, i, touch[MAX_GENTITIES], dist = FRADIUS;
gentity_t *tent, *targ;
float vlen;
qboolean foundItem = qfalse, foundPreferredItem = qfalse;
gitem_t *item;
// if 3rd sigil exists, this function doesn´t need to run
if (teamgame.sigil[2].entity)
return;
VectorCopy(teamgame.sigil[0].entity->r.currentOrigin, start);
VectorCopy(teamgame.sigil[1].entity->r.currentOrigin, end);
VectorSubtract(start, end, temp);
VectorScale(temp, 0.5, temp);
VectorAdd(end, temp, temp);
VectorCopy(temp, mins);
VectorCopy(temp, maxs);
VectorAdd(maxs, offset, maxs);
VectorScale(offset, -1, offset);
VectorAdd(mins, offset, mins);
numEnts = trap_EntitiesInBox( mins, maxs, touch, MAX_GENTITIES );
for ( i=0 ; i<numEnts ; i++ )
{
tent = &g_entities[touch[i]];
if (!tent->item)
continue;
if (!(tent->item->giType == IT_HEALTH || tent->item->giType == IT_ARMOR || tent->item->giType == IT_WEAPON))
continue;
VectorSubtract(temp, tent->r.currentOrigin, tvec);
vlen = abs(VectorLength(tvec));
if (vlen > FRADIUS)
continue;
if ( (foundItem && !foundPreferredItem) && (tent->item->giType == IT_HEALTH || tent->item->giType == IT_ARMOR) ) {
foundPreferredItem = qtrue;
dist = abs(VectorLength(tvec));
targ = tent;
} else {
if ( vlen < dist ) {
if (tent->item->giType == IT_HEALTH || tent->item->giType == IT_ARMOR || (tent->item->giType == IT_WEAPON && !foundPreferredItem ) ) {
foundItem = qtrue;
dist = abs(VectorLength(tvec));
targ = tent;
if (tent->item->giType == IT_HEALTH || tent->item->giType == IT_ARMOR)
foundPreferredItem = qtrue;
}
}
}
}
if (foundItem)
{
item = BG_FindItemForPowerup(PW_SIGILWHITE);
targ->s.modelindex = item - bg_itemlist;
targ->classname = item->classname;
targ->item = item;
targ->r.svFlags = SVF_BROADCAST;
targ->s.powerups = PW_SIGILWHITE;
teamgame.sigil[2].entity = targ;
}
// kill the entity that does the spawn conversions
G_FreeEntity(ent);
}
// Q3Rally Code END
void Team_SetFlagStatus( int team, flagStatus_t status ) {
qboolean modified = qfalse;
@ -1090,67 +937,6 @@ int Pickup_Team( gentity_t *ent, gentity_t *other ) {
return Team_TouchEnemyFlag( ent, other, team );
}
// Q3Rally Code Start
/*
===================
Sigil_Think
===================
*/
void Sigil_Think( gentity_t *ent ) {
team_t team;
team = (ent->s.powerups == PW_SIGILRED) ? TEAM_RED : TEAM_BLUE;
ent->count = 0;
level.teamScores[team]++;
ent->nextthink = level.time + 10000;
// refresh scoreboard
CalculateRanks();
}
/*
====================================
Sigil_Touch
====================================
*/
int Sigil_Touch( gentity_t *ent, gentity_t *other ) {
gclient_t *cl = other->client;
int sigilNum = 0;
if (!cl)
return 0;
if (ent->count && ent->nextthink < level.time + 1500) // protect against overflows by not counting
return 0;
// find the index of the sigil reffered by ent
while ( sigilNum < MAX_SIGILS && teamgame.sigil[sigilNum].entity != ent )
sigilNum++;
if ( cl->sess.sessionTeam == TEAM_RED && ent->s.powerups != PW_SIGILRED )
{
Team_SetSigilStatus(sigilNum, SIGIL_ISRED);
ent->nextthink = level.time - (level.time % 4000) + 4000;
ent->think = Sigil_Think;
ent->s.powerups = PW_SIGILRED;
ent->s.modelindex = ITEM_INDEX( BG_FindItemForPowerup( PW_SIGILRED ) );
ent->count = 1;
}
else if ( cl->sess.sessionTeam == TEAM_BLUE && ent->s.powerups != PW_SIGILBLUE )
{
Team_SetSigilStatus(sigilNum, SIGIL_ISBLUE);
ent->nextthink = level.time - (level.time % 4000) + 4000;
ent->think = Sigil_Think;
ent->s.powerups = PW_SIGILBLUE;
ent->s.modelindex = ITEM_INDEX( BG_FindItemForPowerup( PW_SIGILBLUE ) );
ent->count = 1;
}
return 0;
}
// Q3Rally Code END
/*
===========
Team_GetLocation

View file

@ -152,7 +152,6 @@ static const char *servertype_items[] = {
"Team Racing Deathmatch",
"Team Deathmatch",
"Capture the Flag",
"Domination",
// END
0
};
@ -190,7 +189,6 @@ static char* gamenames[] = {
"TRace DM",
"Team DM", // team deathmatch
"CTF", // capture the flag
"Domination", // domination
// END
"???", // unknown
0
@ -1290,9 +1288,6 @@ static void ArenaServers_StartRefresh( void )
strcpy( myargs, " ctf" );
break;
case GAMES_DOMINATION:
strcpy( myargs, " domination" );
break;
}

View file

@ -144,7 +144,6 @@ static const char *gametype_items[] = {
"Team Racing Deathmatch",
// END
"Capture the Flag",
"Domination",
0
};

View file

@ -142,7 +142,6 @@ static const char *servertype_items[] = {
"Team Racing Deathmatch",
"Team Deathmatch",
"Capture the Flag",
"Domination",
// END
0
};
@ -180,7 +179,6 @@ static char* gamenames[] = {
"TRace DM",
"Team DM", // team deathmatch
"CTF", // capture the flag
"Domination", // domination
// END
"???", // unknown
0
@ -1203,9 +1201,6 @@ static void ArenaServers_StartRefresh( void )
strcpy( myargs, " ctf" );
break;
case GAMES_DOMINATION:
strcpy( myargs, " domination" );
break;
}

File diff suppressed because it is too large Load diff