Skip to content

Commit

Permalink
cgame, game, ui: initial restore TA gamemode
Browse files Browse the repository at this point in the history
obelisk gamemode was not included in QL so models are replaced with harvester (HACK)

obelisk hud are not yet completed
  • Loading branch information
yumirak committed Mar 10, 2024
1 parent 2028b09 commit 5a9072c
Show file tree
Hide file tree
Showing 38 changed files with 595 additions and 495 deletions.
4 changes: 2 additions & 2 deletions code/botlib/be_ai_goal.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ typedef enum {

GT_TEAM, // team deathmatch
GT_CTF, // capture the flag
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
GT_1FCTF,
GT_OBELISK,
GT_HARVESTER,
#endif
//#endif
GT_MAX_GAME_TYPE
} gametype_t;

Expand Down
64 changes: 37 additions & 27 deletions code/cgame/cg_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,32 +1115,40 @@ static float CG_DrawScores( float y ) {
}
}
}
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
if ( cgs.gametype == GT_1FCTF ) {
// Display flag status
item = BG_FindItemForPowerup( PW_NEUTRALFLAG );

if (item) {
y1 = y + scoreHeight;
y1 = y;
if( cgs.flagStatus >= 0 && cgs.flagStatus <= 4 ) {
vec4_t color = {1, 1, 1, 1};
int index = 0;
if (cgs.flagStatus == FLAG_TAKEN_RED) {
color[1] = color[2] = 0;
index = 1;
} else if (cgs.flagStatus == FLAG_TAKEN_BLUE) {
color[0] = color[1] = 0;
index = 1;
} else if (cgs.flagStatus == FLAG_DROPPED) {
index = 2;
switch(cgs.flagStatus)
{
case FLAG_TAKEN_RED:
color[1] = color[2] = 0;
index = 1;
y1 = y ;
break;
case FLAG_TAKEN_BLUE:
color[0] = color[1] = 0;
index = 1;
y1 = y + scoreHeight;
default:
index = 2;
y1 = y - scoreHeight;
break;
}

trap_R_SetColor(color);
CG_DrawPic( x, y1-4, w, scoreHeight, cgs.media.flagShaders[index] );
CG_DrawPic( x - w, y1, w, scoreHeight, cgs.media.flagShaders[index] );
trap_R_SetColor(NULL);
}
}
}
#endif
//#endif
// RED
color[0] = 1.0f;
color[1] = 0.3f;
Expand Down Expand Up @@ -1715,13 +1723,13 @@ static void CG_DrawHoldableItem( void ) {
}
#endif // MISSIONPACK

#ifdef MISSIONPACK
//#ifdef MISSIONPACK
/*
===================
CG_DrawPersistantPowerup
===================
*/
#if 0 // sos001208 - DEAD
//#if 0 // sos001208 - DEAD
static void CG_DrawPersistantPowerup( void ) {
int value;

Expand All @@ -1731,8 +1739,8 @@ static void CG_DrawPersistantPowerup( void ) {
CG_DrawPic( 640-ICON_SIZE, (SCREEN_HEIGHT-ICON_SIZE)/2 - ICON_SIZE, ICON_SIZE, ICON_SIZE, cg_items[ value ].icon );
}
}
#endif
#endif // MISSIONPACK
//#endif
//#endif // MISSIONPACK


/*
Expand Down Expand Up @@ -2223,15 +2231,17 @@ static void CG_DrawVote(void) {
if ( sec < 0 ) {
sec = 0;
}
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
s = va("VOTE(%i):%s yes:%i no:%i", sec, cgs.voteString, cgs.voteYes, cgs.voteNo);
CG_DrawSmallString( cgs.screenXmin , 58, s, 1.0F );
s = "or press ESC then click Vote";
CG_DrawSmallString( 0, 58 + SMALLCHAR_HEIGHT + 2, s, 1.0F );
/*
#else
s = va("VOTE(%i):%s yes:%i no:%i", sec, cgs.voteString, cgs.voteYes, cgs.voteNo );
CG_DrawSmallString( cgs.screenXmin , 58, s, 1.0F );
#endif
*/
}

/*
Expand Down Expand Up @@ -2441,7 +2451,7 @@ static void CG_DrawAmmoWarning( void ) {
}


#ifdef MISSIONPACK
//#ifdef MISSIONPACK
/*
=================
CG_DrawProxWarning
Expand Down Expand Up @@ -2473,7 +2483,7 @@ static void CG_DrawProxWarning( void ) {
w = CG_DrawStrlen( s , UI_BIGFONT);// * BIGCHAR_WIDTH;
CG_DrawBigStringColor( 320 - w / 2, 64 + BIGCHAR_HEIGHT, s, g_color_table[ColorIndex(COLOR_RED)] );
}
#endif
//#endif


/*
Expand Down Expand Up @@ -2530,7 +2540,7 @@ static void CG_DrawWarmup( void ) {
case GT_CTF:
s = "Capture the Flag";
break;
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
case GT_1FCTF:
s = "One Flag CTF";
break;
Expand All @@ -2540,7 +2550,7 @@ static void CG_DrawWarmup( void ) {
case GT_HARVESTER:
s = "Harvester";
break;
#endif
//#endif
default:
s = "";
break;
Expand Down Expand Up @@ -2646,19 +2656,19 @@ static void CG_Draw2D(stereoFrame_t stereoFrame)

CG_DrawAmmoWarning();

#ifdef MISSIONPACK
//#ifdef MISSIONPACK
CG_DrawProxWarning();
#endif
//#endif
if(stereoFrame == STEREO_CENTER)
CG_DrawCrosshair();
CG_DrawCrosshairNames();
CG_DrawWeaponSelect();

#ifndef MISSIONPACK
//#ifndef MISSIONPACK
CG_DrawHoldableItem();
#else
//CG_DrawPersistantPowerup();
#endif
//#else
CG_DrawPersistantPowerup();
//#endif
CG_DrawReward();
}
}
Expand Down
17 changes: 7 additions & 10 deletions code/cgame/cg_ents.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,19 +704,19 @@ static void CG_Item( centity_t *cent ) {
VectorScale( ent.axis[1], 1.5, ent.axis[1] );
VectorScale( ent.axis[2], 1.5, ent.axis[2] );
ent.nonNormalizedAxes = qtrue;
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin, cgs.media.weaponHoverSound );
#endif
//#endif
}

#ifdef MISSIONPACK
//#ifdef MISSIONPACK
if ( item->giType == IT_HOLDABLE && item->giTag == HI_KAMIKAZE ) {
VectorScale( ent.axis[0], 2, ent.axis[0] );
VectorScale( ent.axis[1], 2, ent.axis[1] );
VectorScale( ent.axis[2], 2, ent.axis[2] );
ent.nonNormalizedAxes = qtrue;
}
#endif
//#endif

// add to refresh list
trap_R_AddRefEntityToScene(&ent);
Expand Down Expand Up @@ -1217,15 +1217,12 @@ CG_TeamBase
*/
static void CG_TeamBase( centity_t *cent ) {
refEntity_t model;
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
vec3_t angles;
int t, h;
float c;

if ( cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF ) {
#else
if ( cgs.gametype == GT_CTF) {
#endif
// show the flag base
memset(&model, 0, sizeof(model));
model.reType = RT_MODEL;
Expand All @@ -1243,7 +1240,7 @@ static void CG_TeamBase( centity_t *cent ) {
}
trap_R_AddRefEntityToScene( &model );
}
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
else if ( cgs.gametype == GT_OBELISK ) {
// show the obelisk
memset(&model, 0, sizeof(model));
Expand Down Expand Up @@ -1360,7 +1357,7 @@ static void CG_TeamBase( centity_t *cent ) {
}
trap_R_AddRefEntityToScene( &model );
}
#endif
//#endif
}

/*
Expand Down
44 changes: 22 additions & 22 deletions code/cgame/cg_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ static void CG_Obituary( entityState_t *ent ) {
if (attacker == target) {
gender = ci->gender;
switch (mod) {
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
case MOD_KAMIKAZE:
message = "goes out with a bang";
break;
#endif
//#endif
case MOD_GRENADE_SPLASH:
if ( gender == GENDER_FEMALE )
message = "tripped on her own grenade";
Expand Down Expand Up @@ -178,7 +178,7 @@ static void CG_Obituary( entityState_t *ent ) {
case MOD_BFG_SPLASH:
message = "should have used a smaller gun";
break;
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
case MOD_PROXIMITY_MINE:
if( gender == GENDER_FEMALE ) {
message = "found her prox mine";
Expand All @@ -188,7 +188,7 @@ static void CG_Obituary( entityState_t *ent ) {
message = "found his prox mine";
}
break;
#endif
//#endif
default:
if ( gender == GENDER_FEMALE )
message = "killed herself";
Expand Down Expand Up @@ -291,7 +291,7 @@ static void CG_Obituary( entityState_t *ent ) {
message = "was blasted by";
message2 = "'s BFG";
break;
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
case MOD_NAIL:
message = "was nailed by";
break;
Expand All @@ -310,7 +310,7 @@ static void CG_Obituary( entityState_t *ent ) {
case MOD_JUICED:
message = "was juiced by";
break;
#endif
//#endif
case MOD_HMG:
message = "was heavy machinegunned by";
break;
Expand Down Expand Up @@ -382,7 +382,7 @@ static void CG_UseItem( centity_t *cent ) {
trap_S_StartSound (NULL, es->number, CHAN_BODY, cgs.media.medkitSound );
break;

#ifdef MISSIONPACK
//#ifdef MISSIONPACK
case HI_KAMIKAZE:
break;

Expand All @@ -391,7 +391,7 @@ static void CG_UseItem( centity_t *cent ) {
case HI_INVULNERABILITY:
trap_S_StartSound (NULL, es->number, CHAN_BODY, cgs.media.useInvulnerabilitySound );
break;
#endif
//#endif
}

}
Expand Down Expand Up @@ -742,7 +742,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
if ( item->giType == IT_POWERUP || item->giType == IT_TEAM) {
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.n_healthSound );
} else if (item->giType == IT_PERSISTANT_POWERUP) {
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
switch (item->giTag ) {
case PW_SCOUT:
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.scoutSound );
Expand All @@ -757,7 +757,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.ammoregenSound );
break;
}
#endif
//#endif
} else {
trap_S_StartSound (NULL, es->number, CHAN_AUTO, trap_S_RegisterSound( item->pickup_sound, qfalse ) );
}
Expand Down Expand Up @@ -1099,19 +1099,19 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
}
else {
if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE) {
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.yourTeamTookTheFlagSound );
else
#endif
//#endif
CG_AddBufferedSound( cgs.media.enemyTookYourFlagSound );
}
else if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED) {
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.enemyTookTheFlagSound );
else
#endif
//#endif
CG_AddBufferedSound( cgs.media.yourTeamTookEnemyFlagSound );
}
}
Expand All @@ -1122,24 +1122,24 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
}
else {
if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED) {
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.yourTeamTookTheFlagSound );
else
#endif
//#endif
CG_AddBufferedSound( cgs.media.enemyTookYourFlagSound );
}
else if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE) {
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.enemyTookTheFlagSound );
else
#endif
//#endif
CG_AddBufferedSound( cgs.media.yourTeamTookEnemyFlagSound );
}
}
break;
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
case GTS_REDOBELISK_ATTACKED: // Overload: red obelisk is being attacked
if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED) {
CG_AddBufferedSound( cgs.media.yourBaseIsUnderAttackSound );
Expand All @@ -1150,7 +1150,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
CG_AddBufferedSound( cgs.media.yourBaseIsUnderAttackSound );
}
break;
#endif
//#endif

case GTS_REDTEAM_SCORED:
CG_AddBufferedSound(cgs.media.redScoredSound);
Expand All @@ -1167,11 +1167,11 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case GTS_TEAMS_ARE_TIED:
CG_AddBufferedSound( cgs.media.teamsTiedSound );
break;
#ifdef MISSIONPACK
//#ifdef MISSIONPACK
case GTS_KAMIKAZE:
trap_S_StartLocalSound(cgs.media.kamikazeFarSound, CHAN_ANNOUNCER);
break;
#endif
//#endif
default:
break;
}
Expand Down
Loading

0 comments on commit 5a9072c

Please sign in to comment.