mirror of
https://github.com/Q3Rally-Team/q3rally.git
synced 2024-11-21 19:41:36 +00:00
prepare new Gametype 4-Teams-CTF
still needs tweaking
This commit is contained in:
parent
cdfd626658
commit
c9856b0dce
20 changed files with 246 additions and 72 deletions
|
@ -391,6 +391,10 @@ void CG_DrawFlagModel( float x, float y, float w, float h, int team, qboolean fo
|
||||||
handle = cgs.media.redFlagModel;
|
handle = cgs.media.redFlagModel;
|
||||||
} else if( team == TEAM_BLUE ) {
|
} else if( team == TEAM_BLUE ) {
|
||||||
handle = cgs.media.blueFlagModel;
|
handle = cgs.media.blueFlagModel;
|
||||||
|
} else if( team == TEAM_GREEN) {
|
||||||
|
handle = cgs.media.greenFlagModel;
|
||||||
|
} else if( team == TEAM_YELLOW ) {
|
||||||
|
handle = cgs.media.yellowFlagModel;
|
||||||
} else if( team == TEAM_FREE ) {
|
} else if( team == TEAM_FREE ) {
|
||||||
handle = cgs.media.neutralFlagModel;
|
handle = cgs.media.neutralFlagModel;
|
||||||
} else {
|
} else {
|
||||||
|
@ -404,6 +408,10 @@ void CG_DrawFlagModel( float x, float y, float w, float h, int team, qboolean fo
|
||||||
item = BG_FindItemForPowerup( PW_REDFLAG );
|
item = BG_FindItemForPowerup( PW_REDFLAG );
|
||||||
} else if( team == TEAM_BLUE ) {
|
} else if( team == TEAM_BLUE ) {
|
||||||
item = BG_FindItemForPowerup( PW_BLUEFLAG );
|
item = BG_FindItemForPowerup( PW_BLUEFLAG );
|
||||||
|
} else if( team == TEAM_GREEN ) {
|
||||||
|
item = BG_FindItemForPowerup( PW_GREENFLAG );
|
||||||
|
} else if( team == TEAM_YELLOW ) {
|
||||||
|
item = BG_FindItemForPowerup( PW_YELLOWFLAG );
|
||||||
} else if( team == TEAM_FREE ) {
|
} else if( team == TEAM_FREE ) {
|
||||||
item = BG_FindItemForPowerup( PW_NEUTRALFLAG );
|
item = BG_FindItemForPowerup( PW_NEUTRALFLAG );
|
||||||
} else {
|
} else {
|
||||||
|
@ -640,6 +648,10 @@ static void CG_DrawStatusBar( void ) {
|
||||||
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_RED );
|
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_RED );
|
||||||
} else if( cg.predictedPlayerState.powerups[PW_BLUEFLAG] ) {
|
} else if( cg.predictedPlayerState.powerups[PW_BLUEFLAG] ) {
|
||||||
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_BLUE );
|
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_BLUE );
|
||||||
|
} else if( cg.predictedPlayerState.powerups[PW_GREENFLAG] ) {
|
||||||
|
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_GREEN );
|
||||||
|
} else if( cg.predictedPlayerState.powerups[PW_YELLOWFLAG] ) {
|
||||||
|
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_YELLOW );
|
||||||
} else if( cg.predictedPlayerState.powerups[PW_NEUTRALFLAG] ) {
|
} else if( cg.predictedPlayerState.powerups[PW_NEUTRALFLAG] ) {
|
||||||
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_FREE );
|
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_FREE );
|
||||||
}
|
}
|
||||||
|
@ -847,6 +859,10 @@ static void CG_DrawRallyStatusBar( void ) {
|
||||||
CG_DrawStatusBarFlag( 495, TEAM_RED);
|
CG_DrawStatusBarFlag( 495, TEAM_RED);
|
||||||
else if (cg.predictedPlayerState.powerups[PW_BLUEFLAG])
|
else if (cg.predictedPlayerState.powerups[PW_BLUEFLAG])
|
||||||
CG_DrawStatusBarFlag( 495, TEAM_BLUE);
|
CG_DrawStatusBarFlag( 495, TEAM_BLUE);
|
||||||
|
else if (cg.predictedPlayerState.powerups[PW_GREENFLAG])
|
||||||
|
CG_DrawStatusBarFlag( 495, TEAM_GREEN);
|
||||||
|
else if (cg.predictedPlayerState.powerups[PW_YELLOWFLAG])
|
||||||
|
CG_DrawStatusBarFlag( 495, TEAM_YELLOW);
|
||||||
else if (cg_entities[cg.snap->ps.clientNum].finishRaceTime &&
|
else if (cg_entities[cg.snap->ps.clientNum].finishRaceTime &&
|
||||||
cg_entities[cg.snap->ps.clientNum].currentPosition == 1){
|
cg_entities[cg.snap->ps.clientNum].currentPosition == 1){
|
||||||
|
|
||||||
|
@ -1179,17 +1195,17 @@ static void CG_DrawRallyPowerups( void ) {
|
||||||
active++;
|
active++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw the icons and timers
|
// draw the icons and timers TRYOUT: bug #71
|
||||||
|
|
||||||
for ( i = 0 ; i < active ; i++ ) {
|
for ( i = 0 ; i < active ; i++ ) {
|
||||||
item = BG_FindItemForPowerup( sorted[i] );
|
item = BG_FindItemForPowerup( sorted[i] );
|
||||||
|
|
||||||
color = 1;
|
color = 1;
|
||||||
|
|
||||||
CG_FillRect( 402, 476 - 30, 90, 24, bg_color );
|
CG_FillRect( 495, 476 - 30, 90, 24, bg_color );
|
||||||
|
|
||||||
trap_R_SetColor( colors[color] );
|
trap_R_SetColor( colors[color] );
|
||||||
CG_DrawField( 424 + CHAR_WIDTH, 476 - 28, 2, sortedTime[ i ] / 1000 );
|
CG_DrawField( 517 + CHAR_WIDTH, 476 - 28, 2, sortedTime[ i ] / 1000 );
|
||||||
|
|
||||||
t = ps->powerups[ sorted[i] ];
|
t = ps->powerups[ sorted[i] ];
|
||||||
if ( t - cg.time >= POWERUP_BLINKS * POWERUP_BLINK_TIME ) {
|
if ( t - cg.time >= POWERUP_BLINKS * POWERUP_BLINK_TIME ) {
|
||||||
|
@ -1216,7 +1232,7 @@ static void CG_DrawRallyPowerups( void ) {
|
||||||
size = 19;
|
size = 19;
|
||||||
}
|
}
|
||||||
|
|
||||||
CG_DrawPic( 408, 476 - 27, size, size, trap_R_RegisterShader( item->icon ) );
|
CG_DrawPic( 503, 476 - 27, size, size, trap_R_RegisterShader( item->icon ) );
|
||||||
}
|
}
|
||||||
trap_R_SetColor( NULL );
|
trap_R_SetColor( NULL );
|
||||||
}
|
}
|
||||||
|
|
|
@ -827,6 +827,8 @@ typedef struct {
|
||||||
|
|
||||||
qhandle_t redFlagFlapSkin;
|
qhandle_t redFlagFlapSkin;
|
||||||
qhandle_t blueFlagFlapSkin;
|
qhandle_t blueFlagFlapSkin;
|
||||||
|
qhandle_t greenFlagFlapSkin;
|
||||||
|
qhandle_t yellowFlagFlapSkin;
|
||||||
qhandle_t neutralFlagFlapSkin;
|
qhandle_t neutralFlagFlapSkin;
|
||||||
|
|
||||||
qhandle_t redFlagBaseModel;
|
qhandle_t redFlagBaseModel;
|
||||||
|
|
|
@ -1130,6 +1130,8 @@ static void CG_RegisterGraphics( void ) {
|
||||||
|
|
||||||
cgs.media.redFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/red.skin" );
|
cgs.media.redFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/red.skin" );
|
||||||
cgs.media.blueFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/blue.skin" );
|
cgs.media.blueFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/blue.skin" );
|
||||||
|
cgs.media.greenFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/green.skin" );
|
||||||
|
cgs.media.yellowFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/yellow.skin" );
|
||||||
cgs.media.neutralFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/white.skin" );
|
cgs.media.neutralFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/white.skin" );
|
||||||
|
|
||||||
cgs.media.redFlagBaseModel = trap_R_RegisterModel( "models/mapobjects/flagbase/red_base.md3" );
|
cgs.media.redFlagBaseModel = trap_R_RegisterModel( "models/mapobjects/flagbase/red_base.md3" );
|
||||||
|
@ -1910,6 +1912,10 @@ static const char *CG_FeederItemText(float feederID, int index, int column, qhan
|
||||||
team = TEAM_RED;
|
team = TEAM_RED;
|
||||||
} else if (feederID == FEEDER_BLUETEAM_LIST) {
|
} else if (feederID == FEEDER_BLUETEAM_LIST) {
|
||||||
team = TEAM_BLUE;
|
team = TEAM_BLUE;
|
||||||
|
} else if (feederID == FEEDER_GREENTEAM_LIST) {
|
||||||
|
team = TEAM_GREEN;
|
||||||
|
} else if (feederID == FEEDER_YELLOWTEAM_LIST) {
|
||||||
|
team = TEAM_YELLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
info = CG_InfoFromScoreIndex(index, team, &scoreIndex);
|
info = CG_InfoFromScoreIndex(index, team, &scoreIndex);
|
||||||
|
@ -1926,6 +1932,10 @@ static const char *CG_FeederItemText(float feederID, int index, int column, qhan
|
||||||
*handle = cg_items[ ITEM_INDEX(item) ].icon;
|
*handle = cg_items[ ITEM_INDEX(item) ].icon;
|
||||||
} else if ( info->powerups & ( 1 << PW_BLUEFLAG ) ) {
|
} else if ( info->powerups & ( 1 << PW_BLUEFLAG ) ) {
|
||||||
item = BG_FindItemForPowerup( PW_BLUEFLAG );
|
item = BG_FindItemForPowerup( PW_BLUEFLAG );
|
||||||
|
} else if ( info->powerups & ( 1 << PW_GREENFLAG ) ) {
|
||||||
|
item = BG_FindItemForPowerup( PW_GREENFLAG );
|
||||||
|
} else if ( info->powerups & ( 1 << PW_YELLOWFLAG ) ) {
|
||||||
|
item = BG_FindItemForPowerup( PW_YELLOWFLAG );
|
||||||
*handle = cg_items[ ITEM_INDEX(item) ].icon;
|
*handle = cg_items[ ITEM_INDEX(item) ].icon;
|
||||||
} else {
|
} else {
|
||||||
if ( info->botSkill > 0 && info->botSkill <= 5 ) {
|
if ( info->botSkill > 0 && info->botSkill <= 5 ) {
|
||||||
|
|
|
@ -2416,7 +2416,6 @@ static void CG_PlayerPowerups( centity_t *cent, refEntity_t *torso ) {
|
||||||
trap_R_AddLightToScene( cent->lerpOrigin, 200 + (rand()&31), 0.2f, 0.2f, 1.0 );
|
trap_R_AddLightToScene( cent->lerpOrigin, 200 + (rand()&31), 0.2f, 0.2f, 1.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* finish in 0.5
|
|
||||||
|
|
||||||
// greenflag
|
// greenflag
|
||||||
if ( powerups & ( 1 << PW_GREENFLAG ) ) {
|
if ( powerups & ( 1 << PW_GREENFLAG ) ) {
|
||||||
|
@ -2440,8 +2439,6 @@ static void CG_PlayerPowerups( centity_t *cent, refEntity_t *torso ) {
|
||||||
trap_R_AddLightToScene( cent->lerpOrigin, 200 + (rand()&31), 1.0, 1.0, 0.2f );
|
trap_R_AddLightToScene( cent->lerpOrigin, 200 + (rand()&31), 1.0, 1.0, 0.2f );
|
||||||
}
|
}
|
||||||
|
|
||||||
// end finish in 0.5
|
|
||||||
*/
|
|
||||||
|
|
||||||
// neutralflag
|
// neutralflag
|
||||||
if ( powerups & ( 1 << PW_NEUTRALFLAG ) ) {
|
if ( powerups & ( 1 << PW_NEUTRALFLAG ) ) {
|
||||||
|
|
|
@ -437,6 +437,8 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) {
|
||||||
if ( cgs.gametype > GT_TEAM ) {
|
if ( cgs.gametype > GT_TEAM ) {
|
||||||
if ((ps->powerups[PW_REDFLAG] != ops->powerups[PW_REDFLAG] && ps->powerups[PW_REDFLAG]) ||
|
if ((ps->powerups[PW_REDFLAG] != ops->powerups[PW_REDFLAG] && ps->powerups[PW_REDFLAG]) ||
|
||||||
(ps->powerups[PW_BLUEFLAG] != ops->powerups[PW_BLUEFLAG] && ps->powerups[PW_BLUEFLAG]) ||
|
(ps->powerups[PW_BLUEFLAG] != ops->powerups[PW_BLUEFLAG] && ps->powerups[PW_BLUEFLAG]) ||
|
||||||
|
(ps->powerups[PW_GREENFLAG] != ops->powerups[PW_GREENFLAG] && ps->powerups[PW_GREENFLAG]) ||
|
||||||
|
(ps->powerups[PW_YELLOWFLAG] != ops->powerups[PW_YELLOWFLAG] && ps->powerups[PW_YELLOWFLAG]) ||
|
||||||
(ps->powerups[PW_NEUTRALFLAG] != ops->powerups[PW_NEUTRALFLAG] && ps->powerups[PW_NEUTRALFLAG]) )
|
(ps->powerups[PW_NEUTRALFLAG] != ops->powerups[PW_NEUTRALFLAG] && ps->powerups[PW_NEUTRALFLAG]) )
|
||||||
{
|
{
|
||||||
trap_S_StartLocalSound( cgs.media.youHaveFlagSound, CHAN_ANNOUNCER );
|
trap_S_StartLocalSound( cgs.media.youHaveFlagSound, CHAN_ANNOUNCER );
|
||||||
|
|
|
@ -494,6 +494,12 @@ static void CG_TouchItem( centity_t *cent ) {
|
||||||
if (cg.predictedPlayerState.persistant[PERS_TEAM] == TEAM_BLUE &&
|
if (cg.predictedPlayerState.persistant[PERS_TEAM] == TEAM_BLUE &&
|
||||||
item->giType == IT_TEAM && item->giTag == PW_BLUEFLAG)
|
item->giType == IT_TEAM && item->giTag == PW_BLUEFLAG)
|
||||||
return;
|
return;
|
||||||
|
if (cg.predictedPlayerState.persistant[PERS_TEAM] == TEAM_GREEN &&
|
||||||
|
item->giType == IT_TEAM && item->giTag == PW_GREENFLAG)
|
||||||
|
return;
|
||||||
|
if (cg.predictedPlayerState.persistant[PERS_TEAM] == TEAM_YELLOW &&
|
||||||
|
item->giType == IT_TEAM && item->giTag == PW_YELLOWFLAG)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// grab it
|
// grab it
|
||||||
|
|
|
@ -143,6 +143,20 @@ static void CG_DrawClientScore( int y, score_t *score, float *color, float fade,
|
||||||
else {
|
else {
|
||||||
CG_DrawFlagModel( iconx, y, 16, 16, TEAM_BLUE, qfalse );
|
CG_DrawFlagModel( iconx, y, 16, 16, TEAM_BLUE, qfalse );
|
||||||
}
|
}
|
||||||
|
} else if ( ci->powerups & ( 1 << PW_GREENFLAG ) ) {
|
||||||
|
if( largeFormat ) {
|
||||||
|
CG_DrawFlagModel( iconx, y - ( 32 - BIGCHAR_HEIGHT ) / 2, 32, 32, TEAM_GREEN, qfalse );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CG_DrawFlagModel( iconx, y, 16, 16, TEAM_GREEN, qfalse );
|
||||||
|
}
|
||||||
|
} else if ( ci->powerups & ( 1 << PW_YELLOWFLAG ) ) {
|
||||||
|
if( largeFormat ) {
|
||||||
|
CG_DrawFlagModel( iconx, y - ( 32 - BIGCHAR_HEIGHT ) / 2, 32, 32, TEAM_YELLOW, qfalse );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CG_DrawFlagModel( iconx, y, 16, 16, TEAM_YELLOW, qfalse );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// STONELANCE - draw flag beside winner
|
// STONELANCE - draw flag beside winner
|
||||||
else if (cg_entities[score->client].finishRaceTime &&
|
else if (cg_entities[score->client].finishRaceTime &&
|
||||||
|
|
|
@ -135,6 +135,8 @@ int BotCTFCarryingFlag(bot_state_t *bs) {
|
||||||
|
|
||||||
if (bs->inventory[INVENTORY_REDFLAG] > 0) return CTF_FLAG_RED;
|
if (bs->inventory[INVENTORY_REDFLAG] > 0) return CTF_FLAG_RED;
|
||||||
else if (bs->inventory[INVENTORY_BLUEFLAG] > 0) return CTF_FLAG_BLUE;
|
else if (bs->inventory[INVENTORY_BLUEFLAG] > 0) return CTF_FLAG_BLUE;
|
||||||
|
else if (bs->inventory[INVENTORY_GREENFLAG] > 0) return CTF_FLAG_GREEN;
|
||||||
|
else if (bs->inventory[INVENTORY_YELLOWFLAG] > 0) return CTF_FLAG_YELLOW;
|
||||||
return CTF_FLAG_NONE;
|
return CTF_FLAG_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,6 +231,10 @@ qboolean EntityCarriesFlag(aas_entityinfo_t *entinfo) {
|
||||||
return qtrue;
|
return qtrue;
|
||||||
if ( entinfo->powerups & ( 1 << PW_BLUEFLAG ) )
|
if ( entinfo->powerups & ( 1 << PW_BLUEFLAG ) )
|
||||||
return qtrue;
|
return qtrue;
|
||||||
|
if ( entinfo->powerups & ( 1 << PW_GREENFLAG ) )
|
||||||
|
return qtrue;
|
||||||
|
if ( entinfo->powerups & ( 1 << PW_YELLOWFLAG ) )
|
||||||
|
return qtrue;
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
if ( entinfo->powerups & ( 1 << PW_NEUTRALFLAG ) )
|
if ( entinfo->powerups & ( 1 << PW_NEUTRALFLAG ) )
|
||||||
return qtrue;
|
return qtrue;
|
||||||
|
@ -1799,6 +1805,8 @@ void BotUpdateInventory(bot_state_t *bs) {
|
||||||
#endif
|
#endif
|
||||||
bs->inventory[INVENTORY_REDFLAG] = bs->cur_ps.powerups[PW_REDFLAG] != 0;
|
bs->inventory[INVENTORY_REDFLAG] = bs->cur_ps.powerups[PW_REDFLAG] != 0;
|
||||||
bs->inventory[INVENTORY_BLUEFLAG] = bs->cur_ps.powerups[PW_BLUEFLAG] != 0;
|
bs->inventory[INVENTORY_BLUEFLAG] = bs->cur_ps.powerups[PW_BLUEFLAG] != 0;
|
||||||
|
bs->inventory[INVENTORY_GREENFLAG] = bs->cur_ps.powerups[PW_GREENFLAG] != 0;
|
||||||
|
bs->inventory[INVENTORY_YELLOWFLAG] = bs->cur_ps.powerups[PW_YELLOWFLAG] != 0;
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
bs->inventory[INVENTORY_NEUTRALFLAG] = bs->cur_ps.powerups[PW_NEUTRALFLAG] != 0;
|
bs->inventory[INVENTORY_NEUTRALFLAG] = bs->cur_ps.powerups[PW_NEUTRALFLAG] != 0;
|
||||||
if (BotTeam(bs) == TEAM_RED) {
|
if (BotTeam(bs) == TEAM_RED) {
|
||||||
|
|
|
@ -183,9 +183,13 @@ void BotMapScripts(bot_state_t *bs);
|
||||||
#define CTF_FLAG_NONE 0
|
#define CTF_FLAG_NONE 0
|
||||||
#define CTF_FLAG_RED 1
|
#define CTF_FLAG_RED 1
|
||||||
#define CTF_FLAG_BLUE 2
|
#define CTF_FLAG_BLUE 2
|
||||||
|
#define CTF_FLAG_GREEN 3
|
||||||
|
#define CTF_FLAG_YELLOW 4
|
||||||
//CTF skins
|
//CTF skins
|
||||||
#define CTF_SKIN_REDTEAM "red"
|
#define CTF_SKIN_REDTEAM "red"
|
||||||
#define CTF_SKIN_BLUETEAM "blue"
|
#define CTF_SKIN_BLUETEAM "blue"
|
||||||
|
#define CTF_SKIN_GREENTEAM "green"
|
||||||
|
#define CTF_SKIN_YELLOWTEAM "yellow"
|
||||||
|
|
||||||
extern int gametype; //game type
|
extern int gametype; //game type
|
||||||
extern int maxclients; //maximum number of clients
|
extern int maxclients; //maximum number of clients
|
||||||
|
|
|
@ -882,6 +882,39 @@ Only in CTF games
|
||||||
/* sounds */ ""
|
/* sounds */ ""
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/*QUAKED team_CTF_greenflag (0 1 0) (-16 -16 -16) (16 16 16)
|
||||||
|
Only in CTF games
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
"team_CTF_greenflag",
|
||||||
|
NULL,
|
||||||
|
{ "models/flags/b_flag.md3",
|
||||||
|
NULL, NULL, NULL },
|
||||||
|
/* icon */ "icons/iconf_green1",
|
||||||
|
/* pickup */ "Green Flag",
|
||||||
|
0,
|
||||||
|
IT_TEAM,
|
||||||
|
PW_GREENFLAG,
|
||||||
|
/* precache */ "",
|
||||||
|
/* sounds */ ""
|
||||||
|
},
|
||||||
|
|
||||||
|
/*QUAKED team_CTF_yellowflag (1 1 0) (-16 -16 -16) (16 16 16)
|
||||||
|
Only in CTF games
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
"team_CTF_yellowflag",
|
||||||
|
NULL,
|
||||||
|
{ "models/flags/b_flag.md3",
|
||||||
|
NULL, NULL, NULL },
|
||||||
|
/* icon */ "icons/iconf_yell1",
|
||||||
|
/* pickup */ "Yellow Flag",
|
||||||
|
0,
|
||||||
|
IT_TEAM,
|
||||||
|
PW_YELLOWFLAG,
|
||||||
|
/* precache */ "",
|
||||||
|
/* sounds */ ""
|
||||||
|
},
|
||||||
// Q3Rally Code Start
|
// Q3Rally Code Start
|
||||||
|
|
||||||
/*QUAKED team_DOMINATION_sigil_red
|
/*QUAKED team_DOMINATION_sigil_red
|
||||||
|
@ -1505,7 +1538,23 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const play
|
||||||
(item->giTag == PW_REDFLAG && ent->modelindex2) ||
|
(item->giTag == PW_REDFLAG && ent->modelindex2) ||
|
||||||
(item->giTag == PW_REDFLAG && ps->powerups[PW_BLUEFLAG]) )
|
(item->giTag == PW_REDFLAG && ps->powerups[PW_BLUEFLAG]) )
|
||||||
return qtrue;
|
return qtrue;
|
||||||
} else if (ps->persistant[PERS_TEAM] == TEAM_BLUE) {
|
}
|
||||||
|
|
||||||
|
else if (ps->persistant[PERS_TEAM] == TEAM_BLUE) {
|
||||||
|
if (item->giTag == PW_REDFLAG ||
|
||||||
|
(item->giTag == PW_BLUEFLAG && ent->modelindex2) ||
|
||||||
|
(item->giTag == PW_BLUEFLAG && ps->powerups[PW_REDFLAG]) )
|
||||||
|
return qtrue;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (ps->persistant[PERS_TEAM] == TEAM_BLUE) {
|
||||||
|
if (item->giTag == PW_REDFLAG ||
|
||||||
|
(item->giTag == PW_BLUEFLAG && ent->modelindex2) ||
|
||||||
|
(item->giTag == PW_BLUEFLAG && ps->powerups[PW_REDFLAG]) )
|
||||||
|
return qtrue;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (ps->persistant[PERS_TEAM] == TEAM_BLUE) {
|
||||||
if (item->giTag == PW_REDFLAG ||
|
if (item->giTag == PW_REDFLAG ||
|
||||||
(item->giTag == PW_BLUEFLAG && ent->modelindex2) ||
|
(item->giTag == PW_BLUEFLAG && ent->modelindex2) ||
|
||||||
(item->giTag == PW_BLUEFLAG && ps->powerups[PW_REDFLAG]) )
|
(item->giTag == PW_BLUEFLAG && ps->powerups[PW_REDFLAG]) )
|
||||||
|
|
|
@ -405,8 +405,8 @@ typedef enum {
|
||||||
|
|
||||||
PW_REDFLAG,
|
PW_REDFLAG,
|
||||||
PW_BLUEFLAG,
|
PW_BLUEFLAG,
|
||||||
// PW_GREENFLAG,
|
PW_GREENFLAG,
|
||||||
// PW_YELLOWFLAG,
|
PW_YELLOWFLAG,
|
||||||
PW_NEUTRALFLAG,
|
PW_NEUTRALFLAG,
|
||||||
|
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
|
|
|
@ -803,6 +803,12 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
|
||||||
} else if ( ent->client->ps.powerups[ PW_BLUEFLAG ] ) {
|
} else if ( ent->client->ps.powerups[ PW_BLUEFLAG ] ) {
|
||||||
item = BG_FindItemForPowerup( PW_BLUEFLAG );
|
item = BG_FindItemForPowerup( PW_BLUEFLAG );
|
||||||
j = PW_BLUEFLAG;
|
j = PW_BLUEFLAG;
|
||||||
|
} else if ( ent->client->ps.powerups[ PW_GREENFLAG ] ) {
|
||||||
|
item = BG_FindItemForPowerup( PW_GREENFLAG );
|
||||||
|
j = PW_GREENFLAG;
|
||||||
|
} else if ( ent->client->ps.powerups[ PW_YELLOWFLAG ] ) {
|
||||||
|
item = BG_FindItemForPowerup( PW_YELLOWFLAG );
|
||||||
|
j = PW_YELLOWFLAG;
|
||||||
} else if ( ent->client->ps.powerups[ PW_NEUTRALFLAG ] ) {
|
} else if ( ent->client->ps.powerups[ PW_NEUTRALFLAG ] ) {
|
||||||
item = BG_FindItemForPowerup( PW_NEUTRALFLAG );
|
item = BG_FindItemForPowerup( PW_NEUTRALFLAG );
|
||||||
j = PW_NEUTRALFLAG;
|
j = PW_NEUTRALFLAG;
|
||||||
|
|
|
@ -415,6 +415,8 @@ void CheckAlmostCapture( gentity_t *self, gentity_t *attacker ) {
|
||||||
// if this player was carrying a flag
|
// if this player was carrying a flag
|
||||||
if ( self->client->ps.powerups[PW_REDFLAG] ||
|
if ( self->client->ps.powerups[PW_REDFLAG] ||
|
||||||
self->client->ps.powerups[PW_BLUEFLAG] ||
|
self->client->ps.powerups[PW_BLUEFLAG] ||
|
||||||
|
self->client->ps.powerups[PW_GREENFLAG] ||
|
||||||
|
self->client->ps.powerups[PW_YELLOWFLAG] ||
|
||||||
self->client->ps.powerups[PW_NEUTRALFLAG] ) {
|
self->client->ps.powerups[PW_NEUTRALFLAG] ) {
|
||||||
// get the goal flag this player should have been going for
|
// get the goal flag this player should have been going for
|
||||||
if ( g_gametype.integer == GT_CTF ) {
|
if ( g_gametype.integer == GT_CTF ) {
|
||||||
|
@ -631,6 +633,14 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
Team_ReturnFlag( TEAM_BLUE );
|
Team_ReturnFlag( TEAM_BLUE );
|
||||||
self->client->ps.powerups[PW_BLUEFLAG] = 0;
|
self->client->ps.powerups[PW_BLUEFLAG] = 0;
|
||||||
}
|
}
|
||||||
|
else if ( self->client->ps.powerups[PW_GREENFLAG] ) { // only happens in standard CTF
|
||||||
|
Team_ReturnFlag( TEAM_GREEN );
|
||||||
|
self->client->ps.powerups[PW_GREENFLAG] = 0;
|
||||||
|
}
|
||||||
|
else if ( self->client->ps.powerups[PW_YELLOWFLAG] ) { // only happens in standard CTF
|
||||||
|
Team_ReturnFlag( TEAM_YELLOW );
|
||||||
|
self->client->ps.powerups[PW_YELLOWFLAG] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TossClientItems( self );
|
TossClientItems( self );
|
||||||
|
|
|
@ -479,6 +479,14 @@ static void PortalTouch( gentity_t *self, gentity_t *other, trace_t *trace) {
|
||||||
Drop_Item( other, BG_FindItemForPowerup( PW_BLUEFLAG ), 0 );
|
Drop_Item( other, BG_FindItemForPowerup( PW_BLUEFLAG ), 0 );
|
||||||
other->client->ps.powerups[PW_BLUEFLAG] = 0;
|
other->client->ps.powerups[PW_BLUEFLAG] = 0;
|
||||||
}
|
}
|
||||||
|
else if ( other->client->ps.powerups[PW_GREENFLAG] ) { // only happens in standard CTF
|
||||||
|
Drop_Item( other, BG_FindItemForPowerup( PW_GREENFLAG ), 0 );
|
||||||
|
other->client->ps.powerups[PW_GREENFLAG] = 0;
|
||||||
|
}
|
||||||
|
else if ( other->client->ps.powerups[PW_YELLOWFLAG] ) { // only happens in standard CTF
|
||||||
|
Drop_Item( other, BG_FindItemForPowerup( PW_YELLOWFLAG ), 0 );
|
||||||
|
other->client->ps.powerups[PW_YELLOWFLAG] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// find the destination
|
// find the destination
|
||||||
destination = NULL;
|
destination = NULL;
|
||||||
|
|
|
@ -898,7 +898,7 @@ void G_RankPickupPowerup( int self, int powerup )
|
||||||
}
|
}
|
||||||
|
|
||||||
// ctf flags are treated as powerups
|
// ctf flags are treated as powerups
|
||||||
if( (powerup == PW_REDFLAG) || (powerup == PW_BLUEFLAG) )
|
if( (powerup == PW_REDFLAG) || (powerup == PW_BLUEFLAG) || (powerup == PW_GREENFLAG) || (powerup == PW_YELLOWFLAG) )
|
||||||
{
|
{
|
||||||
trap_RankReportInt( self, -1, QGR_KEY_FLAG_PICKUP, 1, 1 );
|
trap_RankReportInt( self, -1, QGR_KEY_FLAG_PICKUP, 1, 1 );
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -74,6 +74,10 @@ void Use_target_remove_powerups( gentity_t *ent, gentity_t *other, gentity_t *ac
|
||||||
Team_ReturnFlag( TEAM_RED );
|
Team_ReturnFlag( TEAM_RED );
|
||||||
} else if( activator->client->ps.powerups[PW_BLUEFLAG] ) {
|
} else if( activator->client->ps.powerups[PW_BLUEFLAG] ) {
|
||||||
Team_ReturnFlag( TEAM_BLUE );
|
Team_ReturnFlag( TEAM_BLUE );
|
||||||
|
} else if( activator->client->ps.powerups[PW_GREENFLAG] ) {
|
||||||
|
Team_ReturnFlag( TEAM_GREEN );
|
||||||
|
} else if( activator->client->ps.powerups[PW_YELLOWFLAG] ) {
|
||||||
|
Team_ReturnFlag( TEAM_YELLOW );
|
||||||
} else if( activator->client->ps.powerups[PW_NEUTRALFLAG] ) {
|
} else if( activator->client->ps.powerups[PW_NEUTRALFLAG] ) {
|
||||||
Team_ReturnFlag( TEAM_FREE );
|
Team_ReturnFlag( TEAM_FREE );
|
||||||
}
|
}
|
||||||
|
|
|
@ -457,6 +457,12 @@ void Team_CheckDroppedItem( gentity_t *dropped ) {
|
||||||
else if( dropped->item->giTag == PW_BLUEFLAG ) {
|
else if( dropped->item->giTag == PW_BLUEFLAG ) {
|
||||||
Team_SetFlagStatus( TEAM_BLUE, FLAG_DROPPED );
|
Team_SetFlagStatus( TEAM_BLUE, FLAG_DROPPED );
|
||||||
}
|
}
|
||||||
|
else if( dropped->item->giTag == PW_GREENFLAG ) {
|
||||||
|
Team_SetFlagStatus( TEAM_GREEN, FLAG_DROPPED );
|
||||||
|
}
|
||||||
|
else if( dropped->item->giTag == PW_YELLOWFLAG ) {
|
||||||
|
Team_SetFlagStatus( TEAM_YELLOW, FLAG_DROPPED );
|
||||||
|
}
|
||||||
else if( dropped->item->giTag == PW_NEUTRALFLAG ) {
|
else if( dropped->item->giTag == PW_NEUTRALFLAG ) {
|
||||||
Team_SetFlagStatus( TEAM_FREE, FLAG_DROPPED );
|
Team_SetFlagStatus( TEAM_FREE, FLAG_DROPPED );
|
||||||
}
|
}
|
||||||
|
@ -707,10 +713,17 @@ void Team_CheckHurtCarrier(gentity_t *targ, gentity_t *attacker)
|
||||||
if (!targ->client || !attacker->client)
|
if (!targ->client || !attacker->client)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (targ->client->sess.sessionTeam == TEAM_RED)
|
if (targ->client->sess.sessionTeam == TEAM_RED || targ->client->sess.sessionTeam == TEAM_GREEN || targ->client->sess.sessionTeam == TEAM_YELLOW)
|
||||||
flag_pw = PW_BLUEFLAG;
|
flag_pw = PW_BLUEFLAG;
|
||||||
else
|
else if
|
||||||
|
(targ->client->sess.sessionTeam == TEAM_BLUE || targ->client->sess.sessionTeam == TEAM_GREEN || targ->client->sess.sessionTeam == TEAM_YELLOW)
|
||||||
flag_pw = PW_REDFLAG;
|
flag_pw = PW_REDFLAG;
|
||||||
|
else if
|
||||||
|
(targ->client->sess.sessionTeam == TEAM_GREEN || targ->client->sess.sessionTeam == TEAM_RED || targ->client->sess.sessionTeam == TEAM_BLUE)
|
||||||
|
flag_pw = PW_YELLOWFLAG;
|
||||||
|
else if
|
||||||
|
(targ->client->sess.sessionTeam == TEAM_BLUE || targ->client->sess.sessionTeam == TEAM_RED || targ->client->sess.sessionTeam == TEAM_YELLOW)
|
||||||
|
flag_pw = PW_GREENFLAG;
|
||||||
|
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
if (g_gametype.integer == GT_1FCTF) {
|
if (g_gametype.integer == GT_1FCTF) {
|
||||||
|
@ -865,6 +878,12 @@ void Team_FreeEntity( gentity_t *ent ) {
|
||||||
}
|
}
|
||||||
else if( ent->item->giTag == PW_BLUEFLAG ) {
|
else if( ent->item->giTag == PW_BLUEFLAG ) {
|
||||||
Team_ReturnFlag( TEAM_BLUE );
|
Team_ReturnFlag( TEAM_BLUE );
|
||||||
|
}
|
||||||
|
else if( ent->item->giTag == PW_GREENFLAG ) {
|
||||||
|
Team_ReturnFlag( TEAM_GREEN );
|
||||||
|
}
|
||||||
|
else if( ent->item->giTag == PW_YELLOWFLAG ) {
|
||||||
|
Team_ReturnFlag( TEAM_YELLOW );
|
||||||
}
|
}
|
||||||
else if( ent->item->giTag == PW_NEUTRALFLAG ) {
|
else if( ent->item->giTag == PW_NEUTRALFLAG ) {
|
||||||
Team_ReturnFlag( TEAM_FREE );
|
Team_ReturnFlag( TEAM_FREE );
|
||||||
|
@ -889,6 +908,12 @@ void Team_DroppedFlagThink(gentity_t *ent) {
|
||||||
else if( ent->item->giTag == PW_BLUEFLAG ) {
|
else if( ent->item->giTag == PW_BLUEFLAG ) {
|
||||||
team = TEAM_BLUE;
|
team = TEAM_BLUE;
|
||||||
}
|
}
|
||||||
|
else if( ent->item->giTag == PW_GREENFLAG ) {
|
||||||
|
team = TEAM_GREEN;
|
||||||
|
}
|
||||||
|
else if( ent->item->giTag == PW_YELLOWFLAG ) {
|
||||||
|
team = TEAM_YELLOW;
|
||||||
|
}
|
||||||
else if( ent->item->giTag == PW_NEUTRALFLAG ) {
|
else if( ent->item->giTag == PW_NEUTRALFLAG ) {
|
||||||
team = TEAM_FREE;
|
team = TEAM_FREE;
|
||||||
}
|
}
|
||||||
|
@ -915,11 +940,18 @@ int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#endif
|
#endif
|
||||||
if (cl->sess.sessionTeam == TEAM_RED) {
|
if (cl->sess.sessionTeam == TEAM_RED || cl->sess.sessionTeam == TEAM_GREEN || cl->sess.sessionTeam == TEAM_YELLOW) {
|
||||||
enemy_flag = PW_BLUEFLAG;
|
enemy_flag = PW_BLUEFLAG;
|
||||||
} else {
|
}
|
||||||
|
else if (cl->sess.sessionTeam == TEAM_RED || cl->sess.sessionTeam == TEAM_BLUE || cl->sess.sessionTeam == TEAM_GREEN) {
|
||||||
|
enemy_flag = PW_YELLOWFLAG;
|
||||||
|
}
|
||||||
|
else if (cl->sess.sessionTeam == TEAM_BLUE || cl->sess.sessionTeam == TEAM_GREEN || cl->sess.sessionTeam == TEAM_YELLOW) {
|
||||||
enemy_flag = PW_REDFLAG;
|
enemy_flag = PW_REDFLAG;
|
||||||
}
|
}
|
||||||
|
else if (cl->sess.sessionTeam == TEAM_RED || cl->sess.sessionTeam == TEAM_BLUE || cl->sess.sessionTeam == TEAM_YELLOW) {
|
||||||
|
enemy_flag = PW_GREENFLAG;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ent->flags & FL_DROPPED_ITEM ) {
|
if ( ent->flags & FL_DROPPED_ITEM ) {
|
||||||
// hey, it's not home. return it by teleporting it back
|
// hey, it's not home. return it by teleporting it back
|
||||||
|
@ -1043,8 +1075,12 @@ int Team_TouchEnemyFlag( gentity_t *ent, gentity_t *other, int team ) {
|
||||||
|
|
||||||
if (team == TEAM_RED)
|
if (team == TEAM_RED)
|
||||||
cl->ps.powerups[PW_REDFLAG] = INT_MAX; // flags never expire
|
cl->ps.powerups[PW_REDFLAG] = INT_MAX; // flags never expire
|
||||||
else
|
else if (team == TEAM_BLUE)
|
||||||
cl->ps.powerups[PW_BLUEFLAG] = INT_MAX; // flags never expire
|
cl->ps.powerups[PW_BLUEFLAG] = INT_MAX; // flags never expire
|
||||||
|
else if (team == TEAM_GREEN)
|
||||||
|
cl->ps.powerups[PW_GREENFLAG] = INT_MAX; // flags never expire
|
||||||
|
else if (team == TEAM_YELLOW)
|
||||||
|
cl->ps.powerups[PW_YELLOWFLAG] = INT_MAX; // flags never expire
|
||||||
|
|
||||||
Team_SetFlagStatus( team, FLAG_TAKEN );
|
Team_SetFlagStatus( team, FLAG_TAKEN );
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
|
|
|
@ -74,15 +74,17 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#define INVENTORY_AMMOREGEN 46
|
#define INVENTORY_AMMOREGEN 46
|
||||||
#define INVENTORY_REDFLAG 47
|
#define INVENTORY_REDFLAG 47
|
||||||
#define INVENTORY_BLUEFLAG 48
|
#define INVENTORY_BLUEFLAG 48
|
||||||
#define INVENTORY_NEUTRALFLAG 49
|
#define INVENTORY_GREENFLAG 49
|
||||||
#define INVENTORY_REDCUBE 50
|
#define INVENTORY_YELLOWFLAG 50
|
||||||
#define INVENTORY_BLUECUBE 51
|
#define INVENTORY_NEUTRALFLAG 51
|
||||||
|
#define INVENTORY_REDCUBE 52
|
||||||
|
#define INVENTORY_BLUECUBE 53
|
||||||
//rally rearfire weapons
|
//rally rearfire weapons
|
||||||
#define INVENTORY_RWP_SMOKE 52
|
#define INVENTORY_RWP_SMOKE 54
|
||||||
#define INVENTORY_RWP_OIL 53
|
#define INVENTORY_RWP_OIL 55
|
||||||
#define INVENTORY_RWP_MINE 54
|
#define INVENTORY_RWP_MINE 56
|
||||||
#define INVENTORY_RWP_FLAME 55
|
#define INVENTORY_RWP_FLAME 57
|
||||||
#define INVENTORY_RWP_BIO 56
|
#define INVENTORY_RWP_BIO 58
|
||||||
//enemy stuff
|
//enemy stuff
|
||||||
#define ENEMY_HORIZONTAL_DIST 200
|
#define ENEMY_HORIZONTAL_DIST 200
|
||||||
#define ENEMY_HEIGHT 201
|
#define ENEMY_HEIGHT 201
|
||||||
|
|
|
@ -70,7 +70,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#define BASETA "missionpack"
|
#define BASETA "missionpack"
|
||||||
|
|
||||||
#ifndef PRODUCT_VERSION
|
#ifndef PRODUCT_VERSION
|
||||||
#define PRODUCT_VERSION "v0.5 r605"
|
#define PRODUCT_VERSION "v0.5 r606"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
q3rallycode.ppr
BIN
q3rallycode.ppr
Binary file not shown.
Loading…
Reference in a new issue