MISSIONPACK removal: cgame project.

This commit is contained in:
Artem Kharytoniuk
2016-07-09 18:19:43 +03:00
parent ce736c68e2
commit 6fc72c1d9e
15 changed files with 6 additions and 3323 deletions

View File

@@ -24,10 +24,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// executed by a key binding
#include "cg_local.h"
#ifdef MISSIONPACK
extern menuDef_t *menuScoreboard;
#endif
void CG_TargetCommand_f( void ) {
@@ -84,10 +80,6 @@ static void CG_Viewpos_f (void) {
static void CG_ScoresDown_f( void ) {
#ifdef MISSIONPACK
CG_BuildSpectatorString();
#endif
if ( cg.scoresRequestTime + 2000 < cg.time ) {
// the scores are more than two seconds out of data,
// so request new ones
@@ -114,71 +106,6 @@ static void CG_ScoresUp_f( void ) {
}
}
#ifdef MISSIONPACK
extern menuDef_t *menuScoreboard;
void Menu_Reset(); // FIXME: add to right include file
static void CG_LoadHud_f( void) {
char buff[1024];
const char *hudSet;
memset(buff, 0, sizeof(buff));
String_Init();
Menu_Reset();
trap_Cvar_VariableStringBuffer("cg_hudFiles", buff, sizeof(buff));
hudSet = buff;
if (hudSet[0] == '\0') {
hudSet = "ui/hud.txt";
}
CG_LoadMenus(hudSet);
menuScoreboard = NULL;
}
static void CG_scrollScoresDown_f( void) {
if (menuScoreboard && cg.scoreBoardShowing) {
Menu_ScrollFeeder(menuScoreboard, FEEDER_SCOREBOARD, qtrue);
Menu_ScrollFeeder(menuScoreboard, FEEDER_REDTEAM_LIST, qtrue);
Menu_ScrollFeeder(menuScoreboard, FEEDER_BLUETEAM_LIST, qtrue);
}
}
static void CG_scrollScoresUp_f( void) {
if (menuScoreboard && cg.scoreBoardShowing) {
Menu_ScrollFeeder(menuScoreboard, FEEDER_SCOREBOARD, qfalse);
Menu_ScrollFeeder(menuScoreboard, FEEDER_REDTEAM_LIST, qfalse);
Menu_ScrollFeeder(menuScoreboard, FEEDER_BLUETEAM_LIST, qfalse);
}
}
static void CG_spWin_f( void) {
trap_Cvar_Set("cg_cameraOrbit", "2");
trap_Cvar_Set("cg_cameraOrbitDelay", "35");
trap_Cvar_Set("cg_thirdPerson", "1");
trap_Cvar_Set("cg_thirdPersonAngle", "0");
trap_Cvar_Set("cg_thirdPersonRange", "100");
CG_AddBufferedSound(cgs.media.winnerSound);
//trap_S_StartLocalSound(cgs.media.winnerSound, CHAN_ANNOUNCER);
CG_CenterPrint("YOU WIN!", SCREEN_HEIGHT * .30, 0);
}
static void CG_spLose_f( void) {
trap_Cvar_Set("cg_cameraOrbit", "2");
trap_Cvar_Set("cg_cameraOrbitDelay", "35");
trap_Cvar_Set("cg_thirdPerson", "1");
trap_Cvar_Set("cg_thirdPersonAngle", "0");
trap_Cvar_Set("cg_thirdPersonRange", "100");
CG_AddBufferedSound(cgs.media.loserSound);
//trap_S_StartLocalSound(cgs.media.loserSound, CHAN_ANNOUNCER);
CG_CenterPrint("YOU LOSE...", SCREEN_HEIGHT * .30, 0);
}
#endif
static void CG_TellTarget_f( void ) {
int clientNum;
char command[128];
@@ -239,173 +166,6 @@ static void CG_VoiceTellAttacker_f( void ) {
trap_SendClientCommand( command );
}
#ifdef MISSIONPACK
static void CG_NextTeamMember_f( void ) {
CG_SelectNextPlayer();
}
static void CG_PrevTeamMember_f( void ) {
CG_SelectPrevPlayer();
}
// ASS U ME's enumeration order as far as task specific orders, OFFENSE is zero, CAMP is last
//
static void CG_NextOrder_f( void ) {
clientInfo_t *ci = cgs.clientinfo + cg.snap->ps.clientNum;
if (ci) {
if (!ci->teamLeader && sortedTeamPlayers[cg_currentSelectedPlayer.integer] != cg.snap->ps.clientNum) {
return;
}
}
if (cgs.currentOrder < TEAMTASK_CAMP) {
cgs.currentOrder++;
if (cgs.currentOrder == TEAMTASK_RETRIEVE) {
if (!CG_OtherTeamHasFlag()) {
cgs.currentOrder++;
}
}
if (cgs.currentOrder == TEAMTASK_ESCORT) {
if (!CG_YourTeamHasFlag()) {
cgs.currentOrder++;
}
}
} else {
cgs.currentOrder = TEAMTASK_OFFENSE;
}
cgs.orderPending = qtrue;
cgs.orderTime = cg.time + 3000;
}
static void CG_ConfirmOrder_f (void ) {
trap_SendConsoleCommand(va("cmd vtell %d %s\n", cgs.acceptLeader, VOICECHAT_YES));
trap_SendConsoleCommand("+button5; wait; -button5");
if (cg.time < cgs.acceptOrderTime) {
trap_SendClientCommand(va("teamtask %d\n", cgs.acceptTask));
cgs.acceptOrderTime = 0;
}
}
static void CG_DenyOrder_f (void ) {
trap_SendConsoleCommand(va("cmd vtell %d %s\n", cgs.acceptLeader, VOICECHAT_NO));
trap_SendConsoleCommand("+button6; wait; -button6");
if (cg.time < cgs.acceptOrderTime) {
cgs.acceptOrderTime = 0;
}
}
static void CG_TaskOffense_f (void ) {
if (cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF) {
trap_SendConsoleCommand(va("cmd vsay_team %s\n", VOICECHAT_ONGETFLAG));
} else {
trap_SendConsoleCommand(va("cmd vsay_team %s\n", VOICECHAT_ONOFFENSE));
}
trap_SendClientCommand(va("teamtask %d\n", TEAMTASK_OFFENSE));
}
static void CG_TaskDefense_f (void ) {
trap_SendConsoleCommand(va("cmd vsay_team %s\n", VOICECHAT_ONDEFENSE));
trap_SendClientCommand(va("teamtask %d\n", TEAMTASK_DEFENSE));
}
static void CG_TaskPatrol_f (void ) {
trap_SendConsoleCommand(va("cmd vsay_team %s\n", VOICECHAT_ONPATROL));
trap_SendClientCommand(va("teamtask %d\n", TEAMTASK_PATROL));
}
static void CG_TaskCamp_f (void ) {
trap_SendConsoleCommand(va("cmd vsay_team %s\n", VOICECHAT_ONCAMPING));
trap_SendClientCommand(va("teamtask %d\n", TEAMTASK_CAMP));
}
static void CG_TaskFollow_f (void ) {
trap_SendConsoleCommand(va("cmd vsay_team %s\n", VOICECHAT_ONFOLLOW));
trap_SendClientCommand(va("teamtask %d\n", TEAMTASK_FOLLOW));
}
static void CG_TaskRetrieve_f (void ) {
trap_SendConsoleCommand(va("cmd vsay_team %s\n", VOICECHAT_ONRETURNFLAG));
trap_SendClientCommand(va("teamtask %d\n", TEAMTASK_RETRIEVE));
}
static void CG_TaskEscort_f (void ) {
trap_SendConsoleCommand(va("cmd vsay_team %s\n", VOICECHAT_ONFOLLOWCARRIER));
trap_SendClientCommand(va("teamtask %d\n", TEAMTASK_ESCORT));
}
static void CG_TaskOwnFlag_f (void ) {
trap_SendConsoleCommand(va("cmd vsay_team %s\n", VOICECHAT_IHAVEFLAG));
}
static void CG_TauntKillInsult_f (void ) {
trap_SendConsoleCommand("cmd vsay kill_insult\n");
}
static void CG_TauntPraise_f (void ) {
trap_SendConsoleCommand("cmd vsay praise\n");
}
static void CG_TauntTaunt_f (void ) {
trap_SendConsoleCommand("cmd vtaunt\n");
}
static void CG_TauntDeathInsult_f (void ) {
trap_SendConsoleCommand("cmd vsay death_insult\n");
}
static void CG_TauntGauntlet_f (void ) {
trap_SendConsoleCommand("cmd vsay kill_guantlet\n");
}
static void CG_TaskSuicide_f (void ) {
int clientNum;
char command[128];
clientNum = CG_CrosshairPlayer();
if ( clientNum == -1 ) {
return;
}
Com_sprintf( command, 128, "tell %i suicide", clientNum );
trap_SendClientCommand( command );
}
/*
==================
CG_TeamMenu_f
==================
*/
/*
static void CG_TeamMenu_f( void ) {
if (trap_Key_GetCatcher() & KEYCATCH_CGAME) {
CG_EventHandling(CGAME_EVENT_NONE);
trap_Key_SetCatcher(0);
} else {
CG_EventHandling(CGAME_EVENT_TEAMMENU);
//trap_Key_SetCatcher(KEYCATCH_CGAME);
}
}
*/
/*
==================
CG_EditHud_f
==================
*/
/*
static void CG_EditHud_f( void ) {
//cls.keyCatchers ^= KEYCATCH_CGAME;
//VM_Call (cgvm, CG_EVENT_HANDLING, (cls.keyCatchers & KEYCATCH_CGAME) ? CGAME_EVENT_EDITHUD : CGAME_EVENT_NONE);
}
*/
#endif
/*
==================
CG_StartOrbit_f
@@ -471,32 +231,6 @@ static consoleCommand_t commands[] = {
{ "vtell_target", CG_VoiceTellTarget_f },
{ "vtell_attacker", CG_VoiceTellAttacker_f },
{ "tcmd", CG_TargetCommand_f },
#ifdef MISSIONPACK
{ "loadhud", CG_LoadHud_f },
{ "nextTeamMember", CG_NextTeamMember_f },
{ "prevTeamMember", CG_PrevTeamMember_f },
{ "nextOrder", CG_NextOrder_f },
{ "confirmOrder", CG_ConfirmOrder_f },
{ "denyOrder", CG_DenyOrder_f },
{ "taskOffense", CG_TaskOffense_f },
{ "taskDefense", CG_TaskDefense_f },
{ "taskPatrol", CG_TaskPatrol_f },
{ "taskCamp", CG_TaskCamp_f },
{ "taskFollow", CG_TaskFollow_f },
{ "taskRetrieve", CG_TaskRetrieve_f },
{ "taskEscort", CG_TaskEscort_f },
{ "taskSuicide", CG_TaskSuicide_f },
{ "taskOwnFlag", CG_TaskOwnFlag_f },
{ "tauntKillInsult", CG_TauntKillInsult_f },
{ "tauntPraise", CG_TauntPraise_f },
{ "tauntTaunt", CG_TauntTaunt_f },
{ "tauntDeathInsult", CG_TauntDeathInsult_f },
{ "tauntGauntlet", CG_TauntGauntlet_f },
{ "spWin", CG_spWin_f },
{ "spLose", CG_spLose_f },
{ "scoresDown", CG_scrollScoresDown_f },
{ "scoresUp", CG_scrollScoresUp_f },
#endif
{ "startOrbit", CG_StartOrbit_f },
//{ "camera", CG_Camera_f },
{ "loaddeferred", CG_LoadDeferredPlayers }

View File

@@ -25,15 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
#ifdef MISSIONPACK
#include "../ui/ui_shared.h"
// used for scoreboard
extern displayContextDef_t cgDC;
menuDef_t *menuScoreboard = NULL;
#else
int drawTeamOverlayModificationCount = -1;
#endif
int sortedTeamPlayers[TEAM_MAXOVERLAY];
int numSortedTeamPlayers;
@@ -42,165 +34,6 @@ char systemChat[256];
char teamChat1[256];
char teamChat2[256];
#ifdef MISSIONPACK
int CG_Text_Width(const char *text, float scale, int limit) {
int count,len;
float out;
glyphInfo_t *glyph;
float useScale;
// FIXME: see ui_main.c, same problem
// const unsigned char *s = text;
const char *s = text;
fontInfo_t *font = &cgDC.Assets.textFont;
if (scale <= cg_smallFont.value) {
font = &cgDC.Assets.smallFont;
} else if (scale > cg_bigFont.value) {
font = &cgDC.Assets.bigFont;
}
useScale = scale * font->glyphScale;
out = 0;
if (text) {
len = (int)strlen(text);
if (limit > 0 && len > limit) {
len = limit;
}
count = 0;
while (s && *s && count < len) {
if ( Q_IsColorString(s) ) {
s += 2;
continue;
} else {
glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build
out += glyph->xSkip;
s++;
count++;
}
}
}
return out * useScale;
}
int CG_Text_Height(const char *text, float scale, int limit) {
int len, count;
float max;
glyphInfo_t *glyph;
float useScale;
// TTimo: FIXME
// const unsigned char *s = text;
const char *s = text;
fontInfo_t *font = &cgDC.Assets.textFont;
if (scale <= cg_smallFont.value) {
font = &cgDC.Assets.smallFont;
} else if (scale > cg_bigFont.value) {
font = &cgDC.Assets.bigFont;
}
useScale = scale * font->glyphScale;
max = 0;
if (text) {
len = (int)strlen(text);
if (limit > 0 && len > limit) {
len = limit;
}
count = 0;
while (s && *s && count < len) {
if ( Q_IsColorString(s) ) {
s += 2;
continue;
} else {
glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build
if (max < glyph->height) {
max = glyph->height;
}
s++;
count++;
}
}
}
return max * useScale;
}
void CG_Text_PaintChar(float x, float y, float width, float height, float scale, float s, float t, float s2, float t2, qhandle_t hShader) {
float w, h;
w = width * scale;
h = height * scale;
CG_AdjustFrom640( &x, &y, &w, &h );
trap_R_DrawStretchPic( x, y, w, h, s, t, s2, t2, hShader );
}
void CG_Text_Paint(float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style) {
int len, count;
vec4_t newColor;
glyphInfo_t *glyph;
float useScale;
fontInfo_t *font = &cgDC.Assets.textFont;
if (scale <= cg_smallFont.value) {
font = &cgDC.Assets.smallFont;
} else if (scale > cg_bigFont.value) {
font = &cgDC.Assets.bigFont;
}
useScale = scale * font->glyphScale;
if (text) {
// TTimo: FIXME
// const unsigned char *s = text;
const char *s = text;
trap_R_SetColor( color );
memcpy(&newColor[0], &color[0], sizeof(vec4_t));
len = (int)strlen(text);
if (limit > 0 && len > limit) {
len = limit;
}
count = 0;
while (s && *s && count < len) {
glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build
//int yadj = Assets.textFont.glyphs[text[i]].bottom + Assets.textFont.glyphs[text[i]].top;
//float yadj = scale * (Assets.textFont.glyphs[text[i]].imageHeight - Assets.textFont.glyphs[text[i]].height);
if ( Q_IsColorString( s ) ) {
memcpy( newColor, g_color_table[ColorIndex(*(s+1))], sizeof( newColor ) );
newColor[3] = color[3];
trap_R_SetColor( newColor );
s += 2;
continue;
} else {
float yadj = useScale * glyph->top;
if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) {
int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2;
colorBlack[3] = newColor[3];
trap_R_SetColor( colorBlack );
CG_Text_PaintChar(x + ofs, y - yadj + ofs,
glyph->imageWidth,
glyph->imageHeight,
useScale,
glyph->s,
glyph->t,
glyph->s2,
glyph->t2,
glyph->glyph);
colorBlack[3] = 1.0;
trap_R_SetColor( newColor );
}
CG_Text_PaintChar(x, y - yadj,
glyph->imageWidth,
glyph->imageHeight,
useScale,
glyph->s,
glyph->t,
glyph->s2,
glyph->t2,
glyph->glyph);
// CG_DrawPic(x, y - yadj, scale * cgDC.Assets.textFont.glyphs[text[i]].imageWidth, scale * cgDC.Assets.textFont.glyphs[text[i]].imageHeight, cgDC.Assets.textFont.glyphs[text[i]].glyph);
x += (glyph->xSkip * useScale) + adjust;
s++;
count++;
}
}
trap_R_SetColor( NULL );
}
}
#endif
/*
==============
CG_DrawField
@@ -208,7 +41,6 @@ CG_DrawField
Draws large numbers for status bar and powerups
==============
*/
#ifndef MISSIONPACK
static void CG_DrawField (int x, int y, int width, int value) {
char num[16], *ptr;
int l;
@@ -262,7 +94,6 @@ static void CG_DrawField (int x, int y, int width, int value) {
l--;
}
}
#endif // MISSIONPACK
/*
================
@@ -422,8 +253,6 @@ CG_DrawStatusBarHead
================
*/
#ifndef MISSIONPACK
static void CG_DrawStatusBarHead( float x ) {
vec3_t angles;
float size, stretch;
@@ -474,7 +303,6 @@ static void CG_DrawStatusBarHead( float x ) {
CG_DrawHead( x, 480 - size, size, size,
cg.snap->ps.clientNum, angles );
}
#endif // MISSIONPACK
/*
================
@@ -482,11 +310,9 @@ CG_DrawStatusBarFlag
================
*/
#ifndef MISSIONPACK
static void CG_DrawStatusBarFlag( float x, int team ) {
CG_DrawFlagModel( x, 480 - ICON_SIZE, ICON_SIZE, ICON_SIZE, team, qfalse );
}
#endif // MISSIONPACK
/*
================
@@ -521,7 +347,6 @@ CG_DrawStatusBar
================
*/
#ifndef MISSIONPACK
static void CG_DrawStatusBar( void ) {
int color;
centity_t *cent;
@@ -530,9 +355,7 @@ static void CG_DrawStatusBar( void ) {
vec4_t hcolor;
vec3_t angles;
vec3_t origin;
#ifdef MISSIONPACK
qhandle_t handle;
#endif
static float colors[4][4] = {
// { 0.2, 1.0, 0.2, 1.0 } , { 1.0, 0.2, 0.2, 1.0 }, {0.5, 0.5, 0.5, 1} };
{ 1.0f, 0.69f, 0.0f, 1.0f }, // normal
@@ -580,20 +403,7 @@ static void CG_DrawStatusBar( void ) {
CG_Draw3DModel( 370 + CHAR_WIDTH*3 + TEXT_ICON_SPACE, 432, ICON_SIZE, ICON_SIZE,
cgs.media.armorModel, 0, origin, angles );
}
#ifdef MISSIONPACK
if( cgs.gametype == GT_HARVESTER ) {
origin[0] = 90;
origin[1] = 0;
origin[2] = -10;
angles[YAW] = ( cg.time & 2047 ) * 360 / 2048.0;
if( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE ) {
handle = cgs.media.redCubeModel;
} else {
handle = cgs.media.blueCubeModel;
}
CG_Draw3DModel( 640 - (TEXT_ICON_SPACE + ICON_SIZE), 416, ICON_SIZE, ICON_SIZE, handle, 0, origin, angles );
}
#endif
//
// ammo
//
@@ -663,31 +473,7 @@ static void CG_DrawStatusBar( void ) {
}
}
#ifdef MISSIONPACK
//
// cubes
//
if( cgs.gametype == GT_HARVESTER ) {
value = ps->generic1;
if( value > 99 ) {
value = 99;
}
trap_R_SetColor( colors[0] );
CG_DrawField (640 - (CHAR_WIDTH*2 + TEXT_ICON_SPACE + ICON_SIZE), 432, 2, value);
trap_R_SetColor( NULL );
// if we didn't draw a 3D icon, draw a 2D icon for armor
if ( !cg_draw3dIcons.integer && cg_drawIcons.integer ) {
if( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE ) {
handle = cgs.media.redCubeIcon;
} else {
handle = cgs.media.blueCubeIcon;
}
CG_DrawPic( 640 - (TEXT_ICON_SPACE + ICON_SIZE), 432, ICON_SIZE, ICON_SIZE, handle );
}
}
#endif
}
#endif
/*
===========================================================================================
@@ -1053,7 +839,6 @@ CG_DrawScores
Draw the small two score display
=================
*/
#ifndef MISSIONPACK
static float CG_DrawScores( float y ) {
const char *s;
int s1, s2, score;
@@ -1122,19 +907,6 @@ static float CG_DrawScores( float y ) {
}
}
#ifdef MISSIONPACK
if ( cgs.gametype == GT_1FCTF ) {
// Display flag status
item = BG_FindItemForPowerup( PW_NEUTRALFLAG );
if (item) {
y1 = y - BIGCHAR_HEIGHT - 8;
if( cgs.flagStatus >= 0 && cgs.flagStatus <= 3 ) {
CG_DrawPic( x, y1-4, w, BIGCHAR_HEIGHT+8, cgs.media.flagShader[cgs.flagStatus] );
}
}
}
#endif
if ( cgs.gametype >= GT_CTF ) {
v = cgs.capturelimit;
} else {
@@ -1212,14 +984,12 @@ static float CG_DrawScores( float y ) {
return y1 - 8;
}
#endif // MISSIONPACK
/*
================
CG_DrawPowerups
================
*/
#ifndef MISSIONPACK
static float CG_DrawPowerups( float y ) {
int sorted[MAX_POWERUPS];
int sortedTime[MAX_POWERUPS];
@@ -1313,7 +1083,6 @@ static float CG_DrawPowerups( float y ) {
return y;
}
#endif // MISSIONPACK
/*
=====================
@@ -1321,7 +1090,6 @@ CG_DrawLowerRight
=====================
*/
#ifndef MISSIONPACK
static void CG_DrawLowerRight( void ) {
float y;
@@ -1334,14 +1102,12 @@ static void CG_DrawLowerRight( void ) {
y = CG_DrawScores( y );
y = CG_DrawPowerups( y );
}
#endif // MISSIONPACK
/*
===================
CG_DrawPickupItem
===================
*/
#ifndef MISSIONPACK
static int CG_DrawPickupItem( int y ) {
int value;
float *fadeColor;
@@ -1366,7 +1132,6 @@ static int CG_DrawPickupItem( int y ) {
return y;
}
#endif // MISSIONPACK
/*
=====================
@@ -1374,7 +1139,6 @@ CG_DrawLowerLeft
=====================
*/
#ifndef MISSIONPACK
static void CG_DrawLowerLeft( void ) {
float y;
@@ -1387,7 +1151,6 @@ static void CG_DrawLowerLeft( void ) {
y = CG_DrawPickupItem( y );
}
#endif // MISSIONPACK
//===========================================================================================
@@ -1397,7 +1160,6 @@ static void CG_DrawLowerLeft( void ) {
CG_DrawTeamInfo
=================
*/
#ifndef MISSIONPACK
static void CG_DrawTeamInfo( void ) {
int w, h;
int i, len;
@@ -1463,14 +1225,12 @@ static void CG_DrawTeamInfo( void ) {
}
}
}
#endif // MISSIONPACK
/*
===================
CG_DrawHoldableItem
===================
*/
#ifndef MISSIONPACK
static void CG_DrawHoldableItem( void ) {
int value;
@@ -1481,27 +1241,6 @@ static void CG_DrawHoldableItem( void ) {
}
}
#endif // MISSIONPACK
#ifdef MISSIONPACK
/*
===================
CG_DrawPersistantPowerup
===================
*/
#if 0 // sos001208 - DEAD
static void CG_DrawPersistantPowerup( void ) {
int value;
value = cg.snap->ps.stats[STAT_PERSISTANT_POWERUP];
if ( value ) {
CG_RegisterItemVisuals( value );
CG_DrawPic( 640-ICON_SIZE, (SCREEN_HEIGHT-ICON_SIZE)/2 - ICON_SIZE, ICON_SIZE, ICON_SIZE, cg_items[ value ].icon );
}
}
#endif
#endif // MISSIONPACK
/*
===================
@@ -1698,13 +1437,8 @@ static void CG_DrawLagometer( void ) {
//
// draw the graph
//
#ifdef MISSIONPACK
x = 640 - 48;
y = 480 - 144;
#else
x = 640 - 48;
y = 480 - 48;
#endif
trap_R_SetColor( NULL );
CG_DrawPic( x, y, 48, 48, cgs.media.lagometerShader );
@@ -1838,9 +1572,6 @@ static void CG_DrawCenterString( void ) {
char *start;
int l;
int x, y, w;
#ifdef MISSIONPACK // bk010221 - unused else
int h;
#endif
float *color;
if ( !cg.centerPrintTime ) {
@@ -1869,13 +1600,6 @@ static void CG_DrawCenterString( void ) {
}
linebuffer[l] = 0;
#ifdef MISSIONPACK
w = CG_Text_Width(linebuffer, 0.5, 0);
h = CG_Text_Height(linebuffer, 0.5, 0);
x = (SCREEN_WIDTH - w) / 2;
CG_Text_Paint(x, y + h, 0.5, color, linebuffer, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE);
y += h + 6;
#else
w = cg.centerPrintCharWidth * CG_DrawStrlen( linebuffer );
x = ( SCREEN_WIDTH - w ) / 2;
@@ -1884,7 +1608,7 @@ static void CG_DrawCenterString( void ) {
cg.centerPrintCharWidth, (int)(cg.centerPrintCharWidth * 1.5), 0 );
y += cg.centerPrintCharWidth * 1.5;
#endif
while ( *start && ( *start != '\n' ) ) {
start++;
}
@@ -2036,14 +1760,8 @@ static void CG_DrawCrosshairNames( void ) {
}
name = cgs.clientinfo[ cg.crosshairClientNum ].name;
#ifdef MISSIONPACK
color[3] *= 0.5f;
w = CG_Text_Width(name, 0.3f, 0);
CG_Text_Paint( 320 - w / 2, 190, 0.3f, color, name, 0, 0, ITEM_TEXTSTYLE_SHADOWED);
#else
w = CG_DrawStrlen( name ) * BIGCHAR_WIDTH;
CG_DrawBigString( 320 - w / 2, 170, name, color[3] * 0.5f );
#endif
trap_R_SetColor( NULL );
}
@@ -2088,15 +1806,8 @@ static void CG_DrawVote(void) {
if ( sec < 0 ) {
sec = 0;
}
#ifdef MISSIONPACK
s = va("VOTE(%i):%s yes:%i no:%i", sec, cgs.voteString, cgs.voteYes, cgs.voteNo);
CG_DrawSmallString( 0, 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( 0, 58, s, 1.0F );
#endif
}
/*
@@ -2136,72 +1847,7 @@ static void CG_DrawTeamVote(void) {
static qboolean CG_DrawScoreboard() {
#ifdef MISSIONPACK
static qboolean firstTime = qtrue;
float fade, *fadeColor;
if (menuScoreboard) {
menuScoreboard->window.flags &= ~WINDOW_FORCED;
}
if (cg_paused.integer) {
cg.deferredPlayerLoading = 0;
firstTime = qtrue;
return qfalse;
}
// should never happen in Team Arena
if (cgs.gametype == GT_SINGLE_PLAYER && cg.predictedPlayerState.pm_type == PM_INTERMISSION ) {
cg.deferredPlayerLoading = 0;
firstTime = qtrue;
return qfalse;
}
// don't draw scoreboard during death while warmup up
if ( cg.warmup && !cg.showScores ) {
return qfalse;
}
if ( cg.showScores || cg.predictedPlayerState.pm_type == PM_DEAD || cg.predictedPlayerState.pm_type == PM_INTERMISSION ) {
fade = 1.0;
fadeColor = colorWhite;
} else {
fadeColor = CG_FadeColor( cg.scoreFadeTime, FADE_TIME );
if ( !fadeColor ) {
// next time scoreboard comes up, don't print killer
cg.deferredPlayerLoading = 0;
cg.killerName[0] = 0;
firstTime = qtrue;
return qfalse;
}
fade = *fadeColor;
}
if (menuScoreboard == NULL) {
if ( cgs.gametype >= GT_TEAM ) {
menuScoreboard = Menus_FindByName("teamscore_menu");
} else {
menuScoreboard = Menus_FindByName("score_menu");
}
}
if (menuScoreboard) {
if (firstTime) {
CG_SetScoreSelection(menuScoreboard);
firstTime = qfalse;
}
Menu_Paint(menuScoreboard, qtrue);
}
// load any models that have been deferred
if ( ++cg.deferredPlayerLoading > 10 ) {
CG_LoadDeferredPlayers();
}
return qtrue;
#else
return CG_DrawOldScoreboard();
#endif
}
/*
@@ -2211,17 +1857,10 @@ CG_DrawIntermission
*/
static void CG_DrawIntermission( void ) {
// int key;
#ifdef MISSIONPACK
//if (cg_singlePlayer.integer) {
// CG_DrawCenterString();
// return;
//}
#else
if ( cgs.gametype == GT_SINGLE_PLAYER ) {
CG_DrawCenterString();
return;
}
#endif
cg.scoreFadeTime = cg.time;
cg.scoreBoardShowing = CG_DrawScoreboard();
}
@@ -2284,48 +1923,6 @@ static void CG_DrawAmmoWarning( void ) {
CG_DrawBigString(320 - w / 2, 64, s, 1.0F);
}
#ifdef MISSIONPACK
/*
=================
CG_DrawProxWarning
=================
*/
static void CG_DrawProxWarning( void ) {
char s [32];
int w;
static int proxTime;
static int proxCounter;
static int proxTick;
if( !(cg.snap->ps.eFlags & EF_TICKING ) ) {
proxTime = 0;
return;
}
if (proxTime == 0) {
proxTime = cg.time + 5000;
proxCounter = 5;
proxTick = 0;
}
if (cg.time > proxTime) {
proxTick = proxCounter--;
proxTime = cg.time + 1000;
}
if (proxTick != 0) {
Com_sprintf(s, sizeof(s), "INTERNAL COMBUSTION IN: %i", proxTick);
} else {
Com_sprintf(s, sizeof(s), "YOU HAVE BEEN MINED");
}
w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH;
CG_DrawBigStringColor( 320 - w / 2, 64 + BIGCHAR_HEIGHT, s, g_color_table[ColorIndex(COLOR_RED)] );
}
#endif
/*
=================
CG_DrawWarmup
@@ -2369,10 +1966,6 @@ static void CG_DrawWarmup( void ) {
if ( ci1 && ci2 ) {
s = va( "%s vs %s", ci1->name, ci2->name );
#ifdef MISSIONPACK
w = CG_Text_Width(s, 0.6f, 0);
CG_Text_Paint(320 - w / 2, 60, 0.6f, colorWhite, s, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE);
#else
w = CG_DrawStrlen( s );
if ( w > 640 / GIANT_WIDTH ) {
cw = 640 / w;
@@ -2381,7 +1974,6 @@ static void CG_DrawWarmup( void ) {
}
CG_DrawStringExt( 320 - w * cw/2, 20,s, colorWhite,
qfalse, qtrue, cw, (int)(cw * 1.5f), 0 );
#endif
}
} else {
if ( cgs.gametype == GT_FFA ) {
@@ -2390,21 +1982,9 @@ static void CG_DrawWarmup( void ) {
s = "Team Deathmatch";
} else if ( cgs.gametype == GT_CTF ) {
s = "Capture the Flag";
#ifdef MISSIONPACK
} else if ( cgs.gametype == GT_1FCTF ) {
s = "One Flag CTF";
} else if ( cgs.gametype == GT_OBELISK ) {
s = "Overload";
} else if ( cgs.gametype == GT_HARVESTER ) {
s = "Harvester";
#endif
} else {
s = "";
}
#ifdef MISSIONPACK
w = CG_Text_Width(s, 0.6f, 0);
CG_Text_Paint(320 - w / 2, 90, 0.6f, colorWhite, s, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE);
#else
w = CG_DrawStrlen( s );
if ( w > 640 / GIANT_WIDTH ) {
cw = 640 / w;
@@ -2413,7 +1993,6 @@ static void CG_DrawWarmup( void ) {
}
CG_DrawStringExt( 320 - w * cw/2, 25,s, colorWhite,
qfalse, qtrue, cw, (int)(cw * 1.1f), 0 );
#endif
}
sec = ( sec - cg.time ) / 1000;
@@ -2458,45 +2037,17 @@ static void CG_DrawWarmup( void ) {
break;
}
#ifdef MISSIONPACK
w = CG_Text_Width(s, scale, 0);
CG_Text_Paint(320 - w / 2, 125, scale, colorWhite, s, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE);
#else
w = CG_DrawStrlen( s );
CG_DrawStringExt( 320 - w * cw/2, 70, s, colorWhite,
qfalse, qtrue, cw, (int)(cw * 1.5), 0 );
#endif
}
//==================================================================================
#ifdef MISSIONPACK
/*
=================
CG_DrawTimedMenus
=================
*/
void CG_DrawTimedMenus() {
if (cg.voiceTime) {
int t = cg.time - cg.voiceTime;
if ( t > 2500 ) {
Menus_CloseByName("voiceMenu");
trap_Cvar_Set("cl_conXOffset", "0");
cg.voiceTime = 0;
}
}
}
#endif
/*
=================
CG_Draw2D
=================
*/
static void CG_Draw2D( void ) {
#ifdef MISSIONPACK
if (cgs.orderPending && cg.time > cgs.orderTime) {
CG_CheckOrderPending();
}
#endif
// if we are taking a levelshot for the menu, don't draw anything
if ( cg.levelShot ) {
return;
@@ -2523,37 +2074,17 @@ static void CG_Draw2D( void ) {
} else {
// don't draw any status if dead or the scoreboard is being explicitly shown
if ( !cg.showScores && cg.snap->ps.stats[STAT_HEALTH] > 0 ) {
#ifdef MISSIONPACK
if ( cg_drawStatus.integer ) {
Menu_PaintAll();
CG_DrawTimedMenus();
}
#else
CG_DrawStatusBar();
#endif
CG_DrawAmmoWarning();
#ifdef MISSIONPACK
CG_DrawProxWarning();
#endif
CG_DrawCrosshair();
CG_DrawCrosshairNames();
CG_DrawWeaponSelect();
#ifndef MISSIONPACK
CG_DrawHoldableItem();
#else
//CG_DrawPersistantPowerup();
#endif
CG_DrawReward();
}
if ( cgs.gametype >= GT_TEAM ) {
#ifndef MISSIONPACK
CG_DrawTeamInfo();
#endif
}
}
@@ -2561,19 +2092,10 @@ static void CG_Draw2D( void ) {
CG_DrawTeamVote();
CG_DrawLagometer();
#ifdef MISSIONPACK
if (!cg_paused.integer) {
CG_DrawUpperRight();
}
#else
CG_DrawUpperRight();
#endif
#ifndef MISSIONPACK
CG_DrawLowerRight();
CG_DrawLowerLeft();
#endif
if ( !CG_DrawFollow() ) {
CG_DrawWarmup();
@@ -2588,10 +2110,7 @@ static void CG_Draw2D( void ) {
static void CG_DrawTourneyScoreboard() {
#ifdef MISSIONPACK
#else
CG_DrawOldTourneyScoreboard();
#endif
}
/*

View File

@@ -180,198 +180,14 @@ void CG_SpawnEffect( vec3_t org ) {
re->reType = RT_MODEL;
re->shaderTime = cg.time / 1000.0f;
#ifndef MISSIONPACK
re->customShader = cgs.media.teleportEffectShader;
#endif
re->hModel = cgs.media.teleportEffectModel;
AxisClear( re->axis );
VectorCopy( org, re->origin );
#ifdef MISSIONPACK
re->origin[2] += 16;
#else
re->origin[2] -= 24;
#endif
}
#ifdef MISSIONPACK
/*
===============
CG_LightningBoltBeam
===============
*/
void CG_LightningBoltBeam( vec3_t start, vec3_t end ) {
localEntity_t *le;
refEntity_t *beam;
le = CG_AllocLocalEntity();
le->leFlags = 0;
le->leType = LE_SHOWREFENTITY;
le->startTime = cg.time;
le->endTime = cg.time + 50;
beam = &le->refEntity;
VectorCopy( start, beam->origin );
// this is the end point
VectorCopy( end, beam->oldorigin );
beam->reType = RT_LIGHTNING;
beam->customShader = cgs.media.lightningShader;
}
/*
==================
CG_KamikazeEffect
==================
*/
void CG_KamikazeEffect( vec3_t org ) {
localEntity_t *le;
refEntity_t *re;
le = CG_AllocLocalEntity();
le->leFlags = 0;
le->leType = LE_KAMIKAZE;
le->startTime = cg.time;
le->endTime = cg.time + 3000;//2250;
le->lifeRate = 1.0 / ( le->endTime - le->startTime );
le->color[0] = le->color[1] = le->color[2] = le->color[3] = 1.0;
VectorClear(le->angles.trBase);
re = &le->refEntity;
re->reType = RT_MODEL;
re->shaderTime = cg.time / 1000.0f;
re->hModel = cgs.media.kamikazeEffectModel;
VectorCopy( org, re->origin );
}
/*
==================
CG_ObeliskExplode
==================
*/
void CG_ObeliskExplode( vec3_t org, int entityNum ) {
localEntity_t *le;
vec3_t origin;
// create an explosion
VectorCopy( org, origin );
origin[2] += 64;
le = CG_MakeExplosion( origin, vec3_origin,
cgs.media.dishFlashModel,
cgs.media.rocketExplosionShader,
600, qtrue );
le->light = 300;
le->lightColor[0] = 1;
le->lightColor[1] = 0.75;
le->lightColor[2] = 0.0;
}
/*
==================
CG_ObeliskPain
==================
*/
void CG_ObeliskPain( vec3_t org ) {
float r;
sfxHandle_t sfx;
// hit sound
r = rand() & 3;
if ( r < 2 ) {
sfx = cgs.media.obeliskHitSound1;
} else if ( r == 2 ) {
sfx = cgs.media.obeliskHitSound2;
} else {
sfx = cgs.media.obeliskHitSound3;
}
trap_S_StartSound ( org, ENTITYNUM_NONE, CHAN_BODY, sfx );
}
/*
==================
CG_InvulnerabilityImpact
==================
*/
void CG_InvulnerabilityImpact( vec3_t org, vec3_t angles ) {
localEntity_t *le;
refEntity_t *re;
int r;
sfxHandle_t sfx;
le = CG_AllocLocalEntity();
le->leFlags = 0;
le->leType = LE_INVULIMPACT;
le->startTime = cg.time;
le->endTime = cg.time + 1000;
le->lifeRate = 1.0 / ( le->endTime - le->startTime );
le->color[0] = le->color[1] = le->color[2] = le->color[3] = 1.0;
re = &le->refEntity;
re->reType = RT_MODEL;
re->shaderTime = cg.time / 1000.0f;
re->hModel = cgs.media.invulnerabilityImpactModel;
VectorCopy( org, re->origin );
AnglesToAxis( angles, re->axis );
r = rand() & 3;
if ( r < 2 ) {
sfx = cgs.media.invulnerabilityImpactSound1;
} else if ( r == 2 ) {
sfx = cgs.media.invulnerabilityImpactSound2;
} else {
sfx = cgs.media.invulnerabilityImpactSound3;
}
trap_S_StartSound (org, ENTITYNUM_NONE, CHAN_BODY, sfx );
}
/*
==================
CG_InvulnerabilityJuiced
==================
*/
void CG_InvulnerabilityJuiced( vec3_t org ) {
localEntity_t *le;
refEntity_t *re;
vec3_t angles;
le = CG_AllocLocalEntity();
le->leFlags = 0;
le->leType = LE_INVULJUICED;
le->startTime = cg.time;
le->endTime = cg.time + 10000;
le->lifeRate = 1.0 / ( le->endTime - le->startTime );
le->color[0] = le->color[1] = le->color[2] = le->color[3] = 1.0;
re = &le->refEntity;
re->reType = RT_MODEL;
re->shaderTime = cg.time / 1000.0f;
re->hModel = cgs.media.invulnerabilityJuicedModel;
VectorCopy( org, re->origin );
VectorClear(angles);
AnglesToAxis( angles, re->axis );
trap_S_StartSound (org, ENTITYNUM_NONE, CHAN_BODY, cgs.media.invulnerabilityJuicedSound );
}
#endif
/*
==================
CG_ScorePlum

View File

@@ -326,44 +326,11 @@ 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
trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin, cgs.media.weaponHoverSound );
#endif
}
#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
// add to refresh list
trap_R_AddRefEntityToScene(&ent);
#ifdef MISSIONPACK
if ( item->giType == IT_WEAPON && wi->barrelModel ) {
refEntity_t barrel;
memset( &barrel, 0, sizeof( barrel ) );
barrel.hModel = wi->barrelModel;
VectorCopy( ent.lightingOrigin, barrel.lightingOrigin );
barrel.shadowPlane = ent.shadowPlane;
barrel.renderfx = ent.renderfx;
CG_PositionRotatedEntityOnTag( &barrel, &ent, wi->weaponModel, "tag_barrel" );
AxisCopy( ent.axis, barrel.axis );
barrel.nonNormalizedAxes = ent.nonNormalizedAxes;
trap_R_AddRefEntityToScene( &barrel );
}
#endif
// accompanying rings / spheres for powerups
if ( !cg_simpleItems.integer )
{
@@ -473,14 +440,6 @@ static void CG_Missile( centity_t *cent ) {
ent.hModel = weapon->missileModel;
ent.renderfx = weapon->missileRenderfx | RF_NOSHADOW;
#ifdef MISSIONPACK
if ( cent->currentState.weapon == WP_PROX_LAUNCHER ) {
if (s1->generic1 == TEAM_BLUE) {
ent.hModel = cgs.media.blueProxMine;
}
}
#endif
// convert direction of travel into axis
if ( VectorNormalize2( s1->pos.trDelta, ent.axis[0] ) == 0 ) {
ent.axis[0][2] = 1;
@@ -490,12 +449,6 @@ static void CG_Missile( centity_t *cent ) {
if ( s1->pos.trType != TR_STATIONARY ) {
RotateAroundDirection( ent.axis, cg.time / 4 );
} else {
#ifdef MISSIONPACK
if ( s1->weapon == WP_PROX_LAUNCHER ) {
AnglesToAxis( cent->lerpAngles, ent.axis );
}
else
#endif
{
RotateAroundDirection( ent.axis, s1->time );
}
@@ -777,15 +730,7 @@ CG_TeamBase
*/
static void CG_TeamBase( centity_t *cent ) {
refEntity_t model;
#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;
@@ -803,124 +748,6 @@ static void CG_TeamBase( centity_t *cent ) {
}
trap_R_AddRefEntityToScene( &model );
}
#ifdef MISSIONPACK
else if ( cgs.gametype == GT_OBELISK ) {
// show the obelisk
memset(&model, 0, sizeof(model));
model.reType = RT_MODEL;
VectorCopy( cent->lerpOrigin, model.lightingOrigin );
VectorCopy( cent->lerpOrigin, model.origin );
AnglesToAxis( cent->currentState.angles, model.axis );
model.hModel = cgs.media.overloadBaseModel;
trap_R_AddRefEntityToScene( &model );
// if hit
if ( cent->currentState.frame == 1) {
// show hit model
// modelindex2 is the health value of the obelisk
c = cent->currentState.modelindex2;
model.shaderRGBA[0] = 0xff;
model.shaderRGBA[1] = c;
model.shaderRGBA[2] = c;
model.shaderRGBA[3] = 0xff;
//
model.hModel = cgs.media.overloadEnergyModel;
trap_R_AddRefEntityToScene( &model );
}
// if respawning
if ( cent->currentState.frame == 2) {
if ( !cent->miscTime ) {
cent->miscTime = cg.time;
}
t = cg.time - cent->miscTime;
h = (cg_obeliskRespawnDelay.integer - 5) * 1000;
//
if (t > h) {
c = (float) (t - h) / h;
if (c > 1)
c = 1;
}
else {
c = 0;
}
// show the lights
AnglesToAxis( cent->currentState.angles, model.axis );
//
model.shaderRGBA[0] = c * 0xff;
model.shaderRGBA[1] = c * 0xff;
model.shaderRGBA[2] = c * 0xff;
model.shaderRGBA[3] = c * 0xff;
model.hModel = cgs.media.overloadLightsModel;
trap_R_AddRefEntityToScene( &model );
// show the target
if (t > h) {
if ( !cent->muzzleFlashTime ) {
trap_S_StartSound (cent->lerpOrigin, ENTITYNUM_NONE, CHAN_BODY, cgs.media.obeliskRespawnSound);
cent->muzzleFlashTime = 1;
}
VectorCopy(cent->currentState.angles, angles);
angles[YAW] += (float) 16 * acos(1-c) * 180 / M_PI;
AnglesToAxis( angles, model.axis );
VectorScale( model.axis[0], c, model.axis[0]);
VectorScale( model.axis[1], c, model.axis[1]);
VectorScale( model.axis[2], c, model.axis[2]);
model.shaderRGBA[0] = 0xff;
model.shaderRGBA[1] = 0xff;
model.shaderRGBA[2] = 0xff;
model.shaderRGBA[3] = 0xff;
//
model.origin[2] += 56;
model.hModel = cgs.media.overloadTargetModel;
trap_R_AddRefEntityToScene( &model );
}
else {
//FIXME: show animated smoke
}
}
else {
cent->miscTime = 0;
cent->muzzleFlashTime = 0;
// modelindex2 is the health value of the obelisk
c = cent->currentState.modelindex2;
model.shaderRGBA[0] = 0xff;
model.shaderRGBA[1] = c;
model.shaderRGBA[2] = c;
model.shaderRGBA[3] = 0xff;
// show the lights
model.hModel = cgs.media.overloadLightsModel;
trap_R_AddRefEntityToScene( &model );
// show the target
model.origin[2] += 56;
model.hModel = cgs.media.overloadTargetModel;
trap_R_AddRefEntityToScene( &model );
}
}
else if ( cgs.gametype == GT_HARVESTER ) {
// show harvester model
memset(&model, 0, sizeof(model));
model.reType = RT_MODEL;
VectorCopy( cent->lerpOrigin, model.lightingOrigin );
VectorCopy( cent->lerpOrigin, model.origin );
AnglesToAxis( cent->currentState.angles, model.axis );
if ( cent->currentState.modelindex == TEAM_RED ) {
model.hModel = cgs.media.harvesterModel;
model.customSkin = cgs.media.harvesterRedSkin;
}
else if ( cent->currentState.modelindex == TEAM_BLUE ) {
model.hModel = cgs.media.harvesterModel;
model.customSkin = cgs.media.harvesterBlueSkin;
}
else {
model.hModel = cgs.media.harvesterNeutralModel;
model.customSkin = 0;
}
trap_R_AddRefEntityToScene( &model );
}
#endif
}
/*

View File

@@ -24,11 +24,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
// for the voice chats
#ifdef MISSIONPACK // bk001205
#include "../../ui/menudef.h"
#endif
//==========================================================================
/*
===================
@@ -151,11 +146,6 @@ static void CG_Obituary( entityState_t *ent ) {
if (attacker == target) {
gender = ci->gender;
switch (mod) {
#ifdef MISSIONPACK
case MOD_KAMIKAZE:
message = "goes out with a bang";
break;
#endif
case MOD_GRENADE_SPLASH:
if ( gender == GENDER_FEMALE )
message = "tripped on her own grenade";
@@ -183,17 +173,6 @@ static void CG_Obituary( entityState_t *ent ) {
case MOD_BFG_SPLASH:
message = "should have used a smaller gun";
break;
#ifdef MISSIONPACK
case MOD_PROXIMITY_MINE:
if( gender == GENDER_FEMALE ) {
message = "found her prox mine";
} else if ( gender == GENDER_NEUTER ) {
message = "found it's prox mine";
} else {
message = "found his prox mine";
}
break;
#endif
default:
if ( gender == GENDER_FEMALE )
message = "killed herself";
@@ -221,14 +200,7 @@ static void CG_Obituary( entityState_t *ent ) {
} else {
s = va("You fragged %s", targetName );
}
#ifdef MISSIONPACK
if (!(cg_singlePlayerActive.integer && cg_cameraOrbit.integer)) {
CG_CenterPrint( s, SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );
}
#else
CG_CenterPrint( s, SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );
#endif
// print the text message as well
}
@@ -294,26 +266,6 @@ static void CG_Obituary( entityState_t *ent ) {
message = "was blasted by";
message2 = "'s BFG";
break;
#ifdef MISSIONPACK
case MOD_NAIL:
message = "was nailed by";
break;
case MOD_CHAINGUN:
message = "got lead poisoning from";
message2 = "'s Chaingun";
break;
case MOD_PROXIMITY_MINE:
message = "was too close to";
message2 = "'s Prox Mine";
break;
case MOD_KAMIKAZE:
message = "falls to";
message2 = "'s Kamikaze blast";
break;
case MOD_JUICED:
message = "was juiced by";
break;
#endif
case MOD_TELEFRAG:
message = "tried to invade";
message2 = "'s personal space";
@@ -381,17 +333,6 @@ static void CG_UseItem( centity_t *cent ) {
}
trap_S_StartSound (NULL, es->number, CHAN_BODY, cgs.media.medkitSound );
break;
#ifdef MISSIONPACK
case HI_KAMIKAZE:
break;
case HI_PORTAL:
break;
case HI_INVULNERABILITY:
trap_S_StartSound (NULL, es->number, CHAN_BODY, cgs.media.useInvulnerabilitySound );
break;
#endif
}
}
@@ -625,32 +566,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
DEBUGNAME("EV_TAUNT");
trap_S_StartSound (NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*taunt.wav" ) );
break;
#ifdef MISSIONPACK
case EV_TAUNT_YES:
DEBUGNAME("EV_TAUNT_YES");
CG_VoiceChatLocal(SAY_TEAM, qfalse, es->number, COLOR_CYAN, VOICECHAT_YES);
break;
case EV_TAUNT_NO:
DEBUGNAME("EV_TAUNT_NO");
CG_VoiceChatLocal(SAY_TEAM, qfalse, es->number, COLOR_CYAN, VOICECHAT_NO);
break;
case EV_TAUNT_FOLLOWME:
DEBUGNAME("EV_TAUNT_FOLLOWME");
CG_VoiceChatLocal(SAY_TEAM, qfalse, es->number, COLOR_CYAN, VOICECHAT_FOLLOWME);
break;
case EV_TAUNT_GETFLAG:
DEBUGNAME("EV_TAUNT_GETFLAG");
CG_VoiceChatLocal(SAY_TEAM, qfalse, es->number, COLOR_CYAN, VOICECHAT_ONGETFLAG);
break;
case EV_TAUNT_GUARDBASE:
DEBUGNAME("EV_TAUNT_GUARDBASE");
CG_VoiceChatLocal(SAY_TEAM, qfalse, es->number, COLOR_CYAN, VOICECHAT_ONDEFENSE);
break;
case EV_TAUNT_PATROL:
DEBUGNAME("EV_TAUNT_PATROL");
CG_VoiceChatLocal(SAY_TEAM, qfalse, es->number, COLOR_CYAN, VOICECHAT_ONPATROL);
break;
#endif
case EV_WATER_TOUCH:
DEBUGNAME("EV_WATER_TOUCH");
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.watrInSound );
@@ -686,22 +601,6 @@ 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
switch (item->giTag ) {
case PW_SCOUT:
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.scoutSound );
break;
case PW_GUARD:
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.guardSound );
break;
case PW_DOUBLER:
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.doublerSound );
break;
case PW_AMMOREGEN:
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.ammoregenSound );
break;
}
#endif
} else {
trap_S_StartSound (NULL, es->number, CHAN_AUTO, trap_S_RegisterSound( item->pickup_sound, qfalse ) );
}
@@ -852,48 +751,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.hgrenb2aSound );
}
break;
#ifdef MISSIONPACK
case EV_PROXIMITY_MINE_STICK:
DEBUGNAME("EV_PROXIMITY_MINE_STICK");
if( es->eventParm & SURF_FLESH ) {
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.wstbimplSound );
} else if( es->eventParm & SURF_METALSTEPS ) {
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.wstbimpmSound );
} else {
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.wstbimpdSound );
}
break;
case EV_PROXIMITY_MINE_TRIGGER:
DEBUGNAME("EV_PROXIMITY_MINE_TRIGGER");
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.wstbactvSound );
break;
case EV_KAMIKAZE:
DEBUGNAME("EV_KAMIKAZE");
CG_KamikazeEffect( cent->lerpOrigin );
break;
case EV_OBELISKEXPLODE:
DEBUGNAME("EV_OBELISKEXPLODE");
CG_ObeliskExplode( cent->lerpOrigin, es->eventParm );
break;
case EV_OBELISKPAIN:
DEBUGNAME("EV_OBELISKPAIN");
CG_ObeliskPain( cent->lerpOrigin );
break;
case EV_INVUL_IMPACT:
DEBUGNAME("EV_INVUL_IMPACT");
CG_InvulnerabilityImpact( cent->lerpOrigin, cent->currentState.angles );
break;
case EV_JUICED:
DEBUGNAME("EV_JUICED");
CG_InvulnerabilityJuiced( cent->lerpOrigin );
break;
case EV_LIGHTNINGBOLT:
DEBUGNAME("EV_LIGHTNINGBOLT");
CG_LightningBoltBeam(es->origin2, es->pos.trBase);
break;
#endif
case EV_SCOREPLUM:
DEBUGNAME("EV_SCOREPLUM");
CG_ScorePlum( cent->currentState.otherEntityNum, cent->lerpOrigin, cent->currentState.time );
@@ -1006,19 +863,9 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
}
else {
if (cgs.clientinfo[cg.clientNum].team == TEAM_BLUE) {
#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.yourTeamTookTheFlagSound );
else
#endif
CG_AddBufferedSound( cgs.media.enemyTookYourFlagSound );
}
else if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) {
#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.enemyTookTheFlagSound );
else
#endif
CG_AddBufferedSound( cgs.media.yourTeamTookEnemyFlagSound );
}
}
@@ -1029,19 +876,9 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
}
else {
if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) {
#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.yourTeamTookTheFlagSound );
else
#endif
CG_AddBufferedSound( cgs.media.enemyTookYourFlagSound );
}
else if (cgs.clientinfo[cg.clientNum].team == TEAM_BLUE) {
#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.enemyTookTheFlagSound );
else
#endif
CG_AddBufferedSound( cgs.media.yourTeamTookEnemyFlagSound );
}
}
@@ -1072,11 +909,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case GTS_TEAMS_ARE_TIED:
CG_AddBufferedSound( cgs.media.teamsTiedSound );
break;
#ifdef MISSIONPACK
case GTS_KAMIKAZE:
trap_S_StartLocalSound(cgs.media.kamikazeFarSound, CHAN_ANNOUNCER);
break;
#endif
default:
break;
}

View File

@@ -250,17 +250,6 @@ void CG_DrawInformation( void ) {
case GT_CTF:
s = "Capture The Flag";
break;
#ifdef MISSIONPACK
case GT_1FCTF:
s = "One Flag CTF";
break;
case GT_OBELISK:
s = "Overload";
break;
case GT_HARVESTER:
s = "Harvester";
break;
#endif
default:
s = "Unknown Gametype";
break;

View File

@@ -31,10 +31,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// If you absolutely need something stored, it can either be kept
// by the server in the server stored userinfos, or stashed in a cvar.
#ifdef MISSIONPACK
#define CG_FONT_THRESHOLD 0.1
#endif
#define POWERUP_BLINKS 5
#define POWERUP_BLINK_TIME 1000
@@ -84,13 +80,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define TEAM_OVERLAY_MAXLOCATION_WIDTH 16
#define DEFAULT_MODEL "sarge"
#ifdef MISSIONPACK
#define DEFAULT_TEAM_MODEL "james"
#define DEFAULT_TEAM_HEAD "*james"
#else
#define DEFAULT_TEAM_MODEL "sarge"
#define DEFAULT_TEAM_HEAD "sarge"
#endif
#define DEFAULT_REDTEAM_NAME "Stroggs"
#define DEFAULT_BLUETEAM_NAME "Pagans"
@@ -226,12 +217,6 @@ typedef enum {
LE_FADE_RGB,
LE_SCALE_FADE,
LE_SCOREPLUM,
#ifdef MISSIONPACK
LE_KAMIKAZE,
LE_INVULIMPACT,
LE_INVULJUICED,
LE_SHOWREFENTITY
#endif
} leType_t;
typedef enum {
@@ -681,18 +666,6 @@ typedef struct {
qhandle_t blueFlagBaseModel;
qhandle_t neutralFlagBaseModel;
#ifdef MISSIONPACK
qhandle_t overloadBaseModel;
qhandle_t overloadTargetModel;
qhandle_t overloadLightsModel;
qhandle_t overloadEnergyModel;
qhandle_t harvesterModel;
qhandle_t harvesterRedSkin;
qhandle_t harvesterBlueSkin;
qhandle_t harvesterNeutralModel;
#endif
qhandle_t armorModel;
qhandle_t armorIcon;
@@ -741,10 +714,6 @@ typedef struct {
qhandle_t plasmaBallShader;
qhandle_t waterBubbleShader;
qhandle_t bloodTrailShader;
#ifdef MISSIONPACK
qhandle_t nailPuffShader;
qhandle_t blueProxMine;
#endif
qhandle_t numberShaders[11];
@@ -790,21 +759,7 @@ typedef struct {
// special effects models
qhandle_t teleportEffectModel;
qhandle_t teleportEffectShader;
#ifdef MISSIONPACK
qhandle_t kamikazeEffectModel;
qhandle_t kamikazeShockWave;
qhandle_t kamikazeHeadModel;
qhandle_t kamikazeHeadTrail;
qhandle_t guardPowerupModel;
qhandle_t scoutPowerupModel;
qhandle_t doublerPowerupModel;
qhandle_t ammoRegenPowerupModel;
qhandle_t invulnerabilityImpactModel;
qhandle_t invulnerabilityJuicedModel;
qhandle_t medkitUsageModel;
qhandle_t dustPuffShader;
qhandle_t heartShader;
#endif
qhandle_t invulnerabilityPowerupModel;
// scoreboard headers
@@ -837,30 +792,7 @@ typedef struct {
sfxHandle_t sfx_railg;
sfxHandle_t sfx_rockexp;
sfxHandle_t sfx_plasmaexp;
#ifdef MISSIONPACK
sfxHandle_t sfx_proxexp;
sfxHandle_t sfx_nghit;
sfxHandle_t sfx_nghitflesh;
sfxHandle_t sfx_nghitmetal;
sfxHandle_t sfx_chghit;
sfxHandle_t sfx_chghitflesh;
sfxHandle_t sfx_chghitmetal;
sfxHandle_t kamikazeExplodeSound;
sfxHandle_t kamikazeImplodeSound;
sfxHandle_t kamikazeFarSound;
sfxHandle_t useInvulnerabilitySound;
sfxHandle_t invulnerabilityImpactSound1;
sfxHandle_t invulnerabilityImpactSound2;
sfxHandle_t invulnerabilityImpactSound3;
sfxHandle_t invulnerabilityJuicedSound;
sfxHandle_t obeliskHitSound1;
sfxHandle_t obeliskHitSound2;
sfxHandle_t obeliskHitSound3;
sfxHandle_t obeliskRespawnSound;
sfxHandle_t winnerSound;
sfxHandle_t loserSound;
sfxHandle_t youSuckSound;
#endif
sfxHandle_t gibSound;
sfxHandle_t gibBounce1Sound;
sfxHandle_t gibBounce2Sound;
@@ -946,24 +878,6 @@ typedef struct {
sfxHandle_t countFightSound;
sfxHandle_t countPrepareSound;
#ifdef MISSIONPACK
// new stuff
qhandle_t patrolShader;
qhandle_t assaultShader;
qhandle_t campShader;
qhandle_t followShader;
qhandle_t defendShader;
qhandle_t teamLeaderShader;
qhandle_t retrieveShader;
qhandle_t escortShader;
qhandle_t flagShaders[3];
sfxHandle_t countPrepareTeamSound;
sfxHandle_t ammoregenSound;
sfxHandle_t doublerSound;
sfxHandle_t guardSound;
sfxHandle_t scoutSound;
#endif
qhandle_t cursor;
qhandle_t selectCursor;
qhandle_t sizeCursor;
@@ -1170,19 +1084,6 @@ extern vmCvar_t cg_oldRail;
extern vmCvar_t cg_oldRocket;
extern vmCvar_t cg_oldPlasma;
extern vmCvar_t cg_trueLightning;
#ifdef MISSIONPACK
extern vmCvar_t cg_redTeamName;
extern vmCvar_t cg_blueTeamName;
extern vmCvar_t cg_currentSelectedPlayer;
extern vmCvar_t cg_currentSelectedPlayerName;
extern vmCvar_t cg_singlePlayer;
extern vmCvar_t cg_enableDust;
extern vmCvar_t cg_enableBreath;
extern vmCvar_t cg_singlePlayerActive;
extern vmCvar_t cg_recordSPDemo;
extern vmCvar_t cg_recordSPDemoName;
extern vmCvar_t cg_obeliskRespawnDelay;
#endif
//
// cg_main.c
@@ -1399,14 +1300,6 @@ localEntity_t *CG_SmokePuff( const vec3_t p,
qhandle_t hShader );
void CG_BubbleTrail( vec3_t start, vec3_t end, float spacing );
void CG_SpawnEffect( vec3_t org );
#ifdef MISSIONPACK
void CG_KamikazeEffect( vec3_t org );
void CG_ObeliskExplode( vec3_t org, int entityNum );
void CG_ObeliskPain( vec3_t org );
void CG_InvulnerabilityImpact( vec3_t org, vec3_t angles );
void CG_InvulnerabilityJuiced( vec3_t org );
void CG_LightningBoltBeam( vec3_t start, vec3_t end );
#endif
void CG_ScorePlum( int client, vec3_t org, int score );
void CG_GibPlayer( vec3_t playerOrigin );

View File

@@ -536,181 +536,6 @@ static void CG_AddSpriteExplosion( localEntity_t *le ) {
}
#ifdef MISSIONPACK
/*
====================
CG_AddKamikaze
====================
*/
void CG_AddKamikaze( localEntity_t *le ) {
refEntity_t *re;
refEntity_t shockwave;
float c;
vec3_t test, axis[3];
int t;
re = &le->refEntity;
t = cg.time - le->startTime;
VectorClear( test );
AnglesToAxis( test, axis );
if (t > KAMI_SHOCKWAVE_STARTTIME && t < KAMI_SHOCKWAVE_ENDTIME) {
if (!(le->leFlags & LEF_SOUND1)) {
// trap_S_StartSound (re->origin, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.kamikazeExplodeSound );
trap_S_StartLocalSound(cgs.media.kamikazeExplodeSound, CHAN_AUTO);
le->leFlags |= LEF_SOUND1;
}
// 1st kamikaze shockwave
memset(&shockwave, 0, sizeof(shockwave));
shockwave.hModel = cgs.media.kamikazeShockWave;
shockwave.reType = RT_MODEL;
shockwave.shaderTime = re->shaderTime;
VectorCopy(re->origin, shockwave.origin);
c = (float)(t - KAMI_SHOCKWAVE_STARTTIME) / (float)(KAMI_SHOCKWAVE_ENDTIME - KAMI_SHOCKWAVE_STARTTIME);
VectorScale( axis[0], c * KAMI_SHOCKWAVE_MAXRADIUS / KAMI_SHOCKWAVEMODEL_RADIUS, shockwave.axis[0] );
VectorScale( axis[1], c * KAMI_SHOCKWAVE_MAXRADIUS / KAMI_SHOCKWAVEMODEL_RADIUS, shockwave.axis[1] );
VectorScale( axis[2], c * KAMI_SHOCKWAVE_MAXRADIUS / KAMI_SHOCKWAVEMODEL_RADIUS, shockwave.axis[2] );
shockwave.nonNormalizedAxes = qtrue;
if (t > KAMI_SHOCKWAVEFADE_STARTTIME) {
c = (float)(t - KAMI_SHOCKWAVEFADE_STARTTIME) / (float)(KAMI_SHOCKWAVE_ENDTIME - KAMI_SHOCKWAVEFADE_STARTTIME);
}
else {
c = 0;
}
c *= 0xff;
shockwave.shaderRGBA[0] = 0xff - c;
shockwave.shaderRGBA[1] = 0xff - c;
shockwave.shaderRGBA[2] = 0xff - c;
shockwave.shaderRGBA[3] = 0xff - c;
trap_R_AddRefEntityToScene( &shockwave );
}
if (t > KAMI_EXPLODE_STARTTIME && t < KAMI_IMPLODE_ENDTIME) {
// explosion and implosion
c = ( le->endTime - cg.time ) * le->lifeRate;
c *= 0xff;
re->shaderRGBA[0] = le->color[0] * c;
re->shaderRGBA[1] = le->color[1] * c;
re->shaderRGBA[2] = le->color[2] * c;
re->shaderRGBA[3] = le->color[3] * c;
if( t < KAMI_IMPLODE_STARTTIME ) {
c = (float)(t - KAMI_EXPLODE_STARTTIME) / (float)(KAMI_IMPLODE_STARTTIME - KAMI_EXPLODE_STARTTIME);
}
else {
if (!(le->leFlags & LEF_SOUND2)) {
// trap_S_StartSound (re->origin, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.kamikazeImplodeSound );
trap_S_StartLocalSound(cgs.media.kamikazeImplodeSound, CHAN_AUTO);
le->leFlags |= LEF_SOUND2;
}
c = (float)(KAMI_IMPLODE_ENDTIME - t) / (float) (KAMI_IMPLODE_ENDTIME - KAMI_IMPLODE_STARTTIME);
}
VectorScale( axis[0], c * KAMI_BOOMSPHERE_MAXRADIUS / KAMI_BOOMSPHEREMODEL_RADIUS, re->axis[0] );
VectorScale( axis[1], c * KAMI_BOOMSPHERE_MAXRADIUS / KAMI_BOOMSPHEREMODEL_RADIUS, re->axis[1] );
VectorScale( axis[2], c * KAMI_BOOMSPHERE_MAXRADIUS / KAMI_BOOMSPHEREMODEL_RADIUS, re->axis[2] );
re->nonNormalizedAxes = qtrue;
trap_R_AddRefEntityToScene( re );
// add the dlight
trap_R_AddLightToScene( re->origin, c * 1000.0, 1.0, 1.0, c );
}
if (t > KAMI_SHOCKWAVE2_STARTTIME && t < KAMI_SHOCKWAVE2_ENDTIME) {
// 2nd kamikaze shockwave
if (le->angles.trBase[0] == 0 &&
le->angles.trBase[1] == 0 &&
le->angles.trBase[2] == 0) {
le->angles.trBase[0] = random() * 360;
le->angles.trBase[1] = random() * 360;
le->angles.trBase[2] = random() * 360;
}
else {
c = 0;
}
memset(&shockwave, 0, sizeof(shockwave));
shockwave.hModel = cgs.media.kamikazeShockWave;
shockwave.reType = RT_MODEL;
shockwave.shaderTime = re->shaderTime;
VectorCopy(re->origin, shockwave.origin);
test[0] = le->angles.trBase[0];
test[1] = le->angles.trBase[1];
test[2] = le->angles.trBase[2];
AnglesToAxis( test, axis );
c = (float)(t - KAMI_SHOCKWAVE2_STARTTIME) / (float)(KAMI_SHOCKWAVE2_ENDTIME - KAMI_SHOCKWAVE2_STARTTIME);
VectorScale( axis[0], c * KAMI_SHOCKWAVE2_MAXRADIUS / KAMI_SHOCKWAVEMODEL_RADIUS, shockwave.axis[0] );
VectorScale( axis[1], c * KAMI_SHOCKWAVE2_MAXRADIUS / KAMI_SHOCKWAVEMODEL_RADIUS, shockwave.axis[1] );
VectorScale( axis[2], c * KAMI_SHOCKWAVE2_MAXRADIUS / KAMI_SHOCKWAVEMODEL_RADIUS, shockwave.axis[2] );
shockwave.nonNormalizedAxes = qtrue;
if (t > KAMI_SHOCKWAVE2FADE_STARTTIME) {
c = (float)(t - KAMI_SHOCKWAVE2FADE_STARTTIME) / (float)(KAMI_SHOCKWAVE2_ENDTIME - KAMI_SHOCKWAVE2FADE_STARTTIME);
}
else {
c = 0;
}
c *= 0xff;
shockwave.shaderRGBA[0] = 0xff - c;
shockwave.shaderRGBA[1] = 0xff - c;
shockwave.shaderRGBA[2] = 0xff - c;
shockwave.shaderRGBA[3] = 0xff - c;
trap_R_AddRefEntityToScene( &shockwave );
}
}
/*
===================
CG_AddInvulnerabilityImpact
===================
*/
void CG_AddInvulnerabilityImpact( localEntity_t *le ) {
trap_R_AddRefEntityToScene( &le->refEntity );
}
/*
===================
CG_AddInvulnerabilityJuiced
===================
*/
void CG_AddInvulnerabilityJuiced( localEntity_t *le ) {
int t;
t = cg.time - le->startTime;
if ( t > 3000 ) {
le->refEntity.axis[0][0] = (float) 1.0 + 0.3 * (t - 3000) / 2000;
le->refEntity.axis[1][1] = (float) 1.0 + 0.3 * (t - 3000) / 2000;
le->refEntity.axis[2][2] = (float) 0.7 + 0.3 * (2000 - (t - 3000)) / 2000;
}
if ( t > 5000 ) {
le->endTime = 0;
CG_GibPlayer( le->refEntity.origin );
}
else {
trap_R_AddRefEntityToScene( &le->refEntity );
}
}
/*
===================
CG_AddRefEntity
===================
*/
void CG_AddRefEntity( localEntity_t *le ) {
if (le->endTime < cg.time) {
CG_FreeLocalEntity( le );
return;
}
trap_R_AddRefEntityToScene( &le->refEntity );
}
#endif
/*
===================
CG_AddScorePlum
@@ -862,21 +687,6 @@ void CG_AddLocalEntities( void ) {
case LE_SCOREPLUM:
CG_AddScorePlum( le );
break;
#ifdef MISSIONPACK
case LE_KAMIKAZE:
CG_AddKamikaze( le );
break;
case LE_INVULIMPACT:
CG_AddInvulnerabilityImpact( le );
break;
case LE_INVULJUICED:
CG_AddInvulnerabilityJuiced( le );
break;
case LE_SHOWREFENTITY:
CG_AddRefEntity( le );
break;
#endif
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -656,18 +656,6 @@ static void CG_LoadClientInfo( clientInfo_t *ci ) {
char teamname[MAX_QPATH];
teamname[0] = 0;
#ifdef MISSIONPACK
if( cgs.gametype >= GT_TEAM) {
if( ci->team == TEAM_BLUE ) {
Q_strncpyz(teamname, cg_blueTeamName.string, sizeof(teamname) );
} else {
Q_strncpyz(teamname, cg_redTeamName.string, sizeof(teamname) );
}
}
if( teamname[0] ) {
strcat( teamname, "/" );
}
#endif
modelloaded = qtrue;
if ( !CG_RegisterClientModelname( ci, ci->modelName, ci->skinName, ci->headModelName, ci->headSkinName, teamname ) ) {
if ( cg_buildScript.integer ) {
@@ -1522,94 +1510,6 @@ static void CG_HasteTrail( centity_t *cent ) {
smoke->leType = LE_SCALE_FADE;
}
#ifdef MISSIONPACK
/*
===============
CG_BreathPuffs
===============
*/
static void CG_BreathPuffs( centity_t *cent, refEntity_t *head) {
clientInfo_t *ci;
vec3_t up, origin;
int contents;
ci = &cgs.clientinfo[ cent->currentState.number ];
if (!cg_enableBreath.integer) {
return;
}
if ( cent->currentState.number == cg.snap->ps.clientNum && !cg.renderingThirdPerson) {
return;
}
if ( cent->currentState.eFlags & EF_DEAD ) {
return;
}
contents = trap_CM_PointContents( head->origin, 0 );
if ( contents & ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ) {
return;
}
if ( ci->breathPuffTime > cg.time ) {
return;
}
VectorSet( up, 0, 0, 8 );
VectorMA(head->origin, 8, head->axis[0], origin);
VectorMA(origin, -4, head->axis[2], origin);
CG_SmokePuff( origin, up, 16, 1, 1, 1, 0.66f, 1500, cg.time, cg.time + 400, LEF_PUFF_DONT_SCALE, cgs.media.shotgunSmokePuffShader );
ci->breathPuffTime = cg.time + 2000;
}
/*
===============
CG_DustTrail
===============
*/
static void CG_DustTrail( centity_t *cent ) {
int anim;
localEntity_t *dust;
vec3_t end, vel;
trace_t tr;
if (!cg_enableDust.integer)
return;
if ( cent->dustTrailTime > cg.time ) {
return;
}
anim = cent->pe.legs.animationNumber & ~ANIM_TOGGLEBIT;
if ( anim != LEGS_LANDB && anim != LEGS_LAND ) {
return;
}
cent->dustTrailTime += 40;
if ( cent->dustTrailTime < cg.time ) {
cent->dustTrailTime = cg.time;
}
VectorCopy(cent->currentState.pos.trBase, end);
end[2] -= 64;
CG_Trace( &tr, cent->currentState.pos.trBase, NULL, NULL, end, cent->currentState.number, MASK_PLAYERSOLID );
if ( !(tr.surfaceFlags & SURF_DUST) )
return;
VectorCopy( cent->currentState.pos.trBase, end );
end[2] -= 16;
VectorSet(vel, 0, 0, -30);
dust = CG_SmokePuff( end, vel,
24,
.8f, .8f, 0.7f, 0.33f,
500,
cg.time,
0,
0,
cgs.media.dustPuffShader );
}
#endif
/*
===============
CG_TrailItem
@@ -1753,74 +1653,6 @@ static void CG_PlayerFlag( centity_t *cent, qhandle_t hSkin, refEntity_t *torso
}
#ifdef MISSIONPACK // bk001204
/*
===============
CG_PlayerTokens
===============
*/
static void CG_PlayerTokens( centity_t *cent, int renderfx ) {
int tokens, i, j;
float angle;
refEntity_t ent;
vec3_t dir, origin;
skulltrail_t *trail;
trail = &cg.skulltrails[cent->currentState.number];
tokens = cent->currentState.generic1;
if ( !tokens ) {
trail->numpositions = 0;
return;
}
if ( tokens > MAX_SKULLTRAIL ) {
tokens = MAX_SKULLTRAIL;
}
// add skulls if there are more than last time
for (i = 0; i < tokens - trail->numpositions; i++) {
for (j = trail->numpositions; j > 0; j--) {
VectorCopy(trail->positions[j-1], trail->positions[j]);
}
VectorCopy(cent->lerpOrigin, trail->positions[0]);
}
trail->numpositions = tokens;
// move all the skulls along the trail
VectorCopy(cent->lerpOrigin, origin);
for (i = 0; i < trail->numpositions; i++) {
VectorSubtract(trail->positions[i], origin, dir);
if (VectorNormalize(dir) > 30) {
VectorMA(origin, 30, dir, trail->positions[i]);
}
VectorCopy(trail->positions[i], origin);
}
memset( &ent, 0, sizeof( ent ) );
if( cgs.clientinfo[ cent->currentState.clientNum ].team == TEAM_BLUE ) {
ent.hModel = cgs.media.redCubeModel;
} else {
ent.hModel = cgs.media.blueCubeModel;
}
ent.renderfx = renderfx;
VectorCopy(cent->lerpOrigin, origin);
for (i = 0; i < trail->numpositions; i++) {
VectorSubtract(origin, trail->positions[i], ent.axis[0]);
ent.axis[0][2] = 0;
VectorNormalize(ent.axis[0]);
VectorSet(ent.axis[2], 0, 0, 1);
CrossProduct(ent.axis[0], ent.axis[2], ent.axis[1]);
VectorCopy(trail->positions[i], ent.origin);
angle = (((cg.time + 500 * MAX_SKULLTRAIL - 500 * i) / 16) & 255) * (M_PI * 2) / 255;
ent.origin[2] += sin(angle) * 10;
trap_R_AddRefEntityToScene( &ent );
VectorCopy(trail->positions[i], origin);
}
}
#endif
/*
===============
CG_PlayerPowerups
@@ -2235,14 +2067,6 @@ void CG_Player( centity_t *cent ) {
int renderfx;
qboolean shadow;
float shadowPlane;
#ifdef MISSIONPACK
refEntity_t skull;
refEntity_t powerup;
int t;
float c;
float angle;
vec3_t dir, angles;
#endif
// the client number is stored in clientNum. It can't be derived
// from the entity number, because a single client may have
@@ -2296,11 +2120,7 @@ void CG_Player( centity_t *cent ) {
renderfx |= RF_SHADOW_PLANE;
}
renderfx |= RF_LIGHTING_ORIGIN; // use the same origin for all
#ifdef MISSIONPACK
if( cgs.gametype == GT_HARVESTER ) {
CG_PlayerTokens( cent, renderfx );
}
#endif
//
// add the legs
//
@@ -2340,210 +2160,6 @@ void CG_Player( centity_t *cent ) {
CG_AddRefEntityWithPowerups( &torso, &cent->currentState, ci->team );
#ifdef MISSIONPACK
if ( cent->currentState.eFlags & EF_KAMIKAZE ) {
memset( &skull, 0, sizeof(skull) );
VectorCopy( cent->lerpOrigin, skull.lightingOrigin );
skull.shadowPlane = shadowPlane;
skull.renderfx = renderfx;
if ( cent->currentState.eFlags & EF_DEAD ) {
// one skull bobbing above the dead body
angle = ((cg.time / 7) & 255) * (M_PI * 2) / 255;
if (angle > M_PI * 2)
angle -= (float)M_PI * 2;
dir[0] = sin(angle) * 20;
dir[1] = cos(angle) * 20;
angle = ((cg.time / 4) & 255) * (M_PI * 2) / 255;
dir[2] = 15 + sin(angle) * 8;
VectorAdd(torso.origin, dir, skull.origin);
dir[2] = 0;
VectorCopy(dir, skull.axis[1]);
VectorNormalize(skull.axis[1]);
VectorSet(skull.axis[2], 0, 0, 1);
CrossProduct(skull.axis[1], skull.axis[2], skull.axis[0]);
skull.hModel = cgs.media.kamikazeHeadModel;
trap_R_AddRefEntityToScene( &skull );
skull.hModel = cgs.media.kamikazeHeadTrail;
trap_R_AddRefEntityToScene( &skull );
}
else {
// three skulls spinning around the player
angle = ((cg.time / 4) & 255) * (M_PI * 2) / 255;
dir[0] = cos(angle) * 20;
dir[1] = sin(angle) * 20;
dir[2] = cos(angle) * 20;
VectorAdd(torso.origin, dir, skull.origin);
angles[0] = sin(angle) * 30;
angles[1] = (angle * 180 / M_PI) + 90;
if (angles[1] > 360)
angles[1] -= 360;
angles[2] = 0;
AnglesToAxis( angles, skull.axis );
/*
dir[2] = 0;
VectorInverse(dir);
VectorCopy(dir, skull.axis[1]);
VectorNormalize(skull.axis[1]);
VectorSet(skull.axis[2], 0, 0, 1);
CrossProduct(skull.axis[1], skull.axis[2], skull.axis[0]);
*/
skull.hModel = cgs.media.kamikazeHeadModel;
trap_R_AddRefEntityToScene( &skull );
// flip the trail because this skull is spinning in the other direction
VectorInverse(skull.axis[1]);
skull.hModel = cgs.media.kamikazeHeadTrail;
trap_R_AddRefEntityToScene( &skull );
angle = ((cg.time / 4) & 255) * (M_PI * 2) / 255 + M_PI;
if (angle > M_PI * 2)
angle -= (float)M_PI * 2;
dir[0] = sin(angle) * 20;
dir[1] = cos(angle) * 20;
dir[2] = cos(angle) * 20;
VectorAdd(torso.origin, dir, skull.origin);
angles[0] = cos(angle - 0.5 * M_PI) * 30;
angles[1] = 360 - (angle * 180 / M_PI);
if (angles[1] > 360)
angles[1] -= 360;
angles[2] = 0;
AnglesToAxis( angles, skull.axis );
/*
dir[2] = 0;
VectorCopy(dir, skull.axis[1]);
VectorNormalize(skull.axis[1]);
VectorSet(skull.axis[2], 0, 0, 1);
CrossProduct(skull.axis[1], skull.axis[2], skull.axis[0]);
*/
skull.hModel = cgs.media.kamikazeHeadModel;
trap_R_AddRefEntityToScene( &skull );
skull.hModel = cgs.media.kamikazeHeadTrail;
trap_R_AddRefEntityToScene( &skull );
angle = ((cg.time / 3) & 255) * (M_PI * 2) / 255 + 0.5 * M_PI;
if (angle > M_PI * 2)
angle -= (float)M_PI * 2;
dir[0] = sin(angle) * 20;
dir[1] = cos(angle) * 20;
dir[2] = 0;
VectorAdd(torso.origin, dir, skull.origin);
VectorCopy(dir, skull.axis[1]);
VectorNormalize(skull.axis[1]);
VectorSet(skull.axis[2], 0, 0, 1);
CrossProduct(skull.axis[1], skull.axis[2], skull.axis[0]);
skull.hModel = cgs.media.kamikazeHeadModel;
trap_R_AddRefEntityToScene( &skull );
skull.hModel = cgs.media.kamikazeHeadTrail;
trap_R_AddRefEntityToScene( &skull );
}
}
if ( cent->currentState.powerups & ( 1 << PW_GUARD ) ) {
memcpy(&powerup, &torso, sizeof(torso));
powerup.hModel = cgs.media.guardPowerupModel;
powerup.frame = 0;
powerup.oldframe = 0;
powerup.customSkin = 0;
trap_R_AddRefEntityToScene( &powerup );
}
if ( cent->currentState.powerups & ( 1 << PW_SCOUT ) ) {
memcpy(&powerup, &torso, sizeof(torso));
powerup.hModel = cgs.media.scoutPowerupModel;
powerup.frame = 0;
powerup.oldframe = 0;
powerup.customSkin = 0;
trap_R_AddRefEntityToScene( &powerup );
}
if ( cent->currentState.powerups & ( 1 << PW_DOUBLER ) ) {
memcpy(&powerup, &torso, sizeof(torso));
powerup.hModel = cgs.media.doublerPowerupModel;
powerup.frame = 0;
powerup.oldframe = 0;
powerup.customSkin = 0;
trap_R_AddRefEntityToScene( &powerup );
}
if ( cent->currentState.powerups & ( 1 << PW_AMMOREGEN ) ) {
memcpy(&powerup, &torso, sizeof(torso));
powerup.hModel = cgs.media.ammoRegenPowerupModel;
powerup.frame = 0;
powerup.oldframe = 0;
powerup.customSkin = 0;
trap_R_AddRefEntityToScene( &powerup );
}
if ( cent->currentState.powerups & ( 1 << PW_INVULNERABILITY ) ) {
if ( !ci->invulnerabilityStartTime ) {
ci->invulnerabilityStartTime = cg.time;
}
ci->invulnerabilityStopTime = cg.time;
}
else {
ci->invulnerabilityStartTime = 0;
}
if ( (cent->currentState.powerups & ( 1 << PW_INVULNERABILITY ) ) ||
cg.time - ci->invulnerabilityStopTime < 250 ) {
memcpy(&powerup, &torso, sizeof(torso));
powerup.hModel = cgs.media.invulnerabilityPowerupModel;
powerup.customSkin = 0;
// always draw
powerup.renderfx &= ~RF_THIRD_PERSON;
VectorCopy(cent->lerpOrigin, powerup.origin);
if ( cg.time - ci->invulnerabilityStartTime < 250 ) {
c = (float) (cg.time - ci->invulnerabilityStartTime) / 250;
}
else if (cg.time - ci->invulnerabilityStopTime < 250 ) {
c = (float) (250 - (cg.time - ci->invulnerabilityStopTime)) / 250;
}
else {
c = 1;
}
VectorSet( powerup.axis[0], c, 0, 0 );
VectorSet( powerup.axis[1], 0, c, 0 );
VectorSet( powerup.axis[2], 0, 0, c );
trap_R_AddRefEntityToScene( &powerup );
}
t = cg.time - ci->medkitUsageTime;
if ( ci->medkitUsageTime && t < 500 ) {
memcpy(&powerup, &torso, sizeof(torso));
powerup.hModel = cgs.media.medkitUsageModel;
powerup.customSkin = 0;
// always draw
powerup.renderfx &= ~RF_THIRD_PERSON;
VectorClear(angles);
AnglesToAxis(angles, powerup.axis);
VectorCopy(cent->lerpOrigin, powerup.origin);
powerup.origin[2] += -24 + (float) t * 80 / 500;
if ( t > 400 ) {
c = (float) (t - 1000) * 0xff / 100;
powerup.shaderRGBA[0] = 0xff - c;
powerup.shaderRGBA[1] = 0xff - c;
powerup.shaderRGBA[2] = 0xff - c;
powerup.shaderRGBA[3] = 0xff - c;
}
else {
powerup.shaderRGBA[0] = 0xff;
powerup.shaderRGBA[1] = 0xff;
powerup.shaderRGBA[2] = 0xff;
powerup.shaderRGBA[3] = 0xff;
}
trap_R_AddRefEntityToScene( &powerup );
}
#endif // MISSIONPACK
//
// add the head
//
@@ -2562,12 +2178,6 @@ void CG_Player( centity_t *cent ) {
CG_AddRefEntityWithPowerups( &head, &cent->currentState, ci->team );
#ifdef MISSIONPACK
CG_BreathPuffs(cent, &head);
CG_DustTrail(cent);
#endif
//
// add the gun / barrel / flash
//

View File

@@ -52,9 +52,6 @@ void CG_CheckAmmo( void ) {
case WP_GRENADE_LAUNCHER:
case WP_RAILGUN:
case WP_SHOTGUN:
#ifdef MISSIONPACK
case WP_PROX_LAUNCHER:
#endif
total += cg.snap->ps.ammo[i] * 1000;
break;
default:
@@ -307,17 +304,7 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) {
if ( ps->persistant[PERS_HITS] > ops->persistant[PERS_HITS] ) {
armor = ps->persistant[PERS_ATTACKEE_ARMOR] & 0xff;
health = ps->persistant[PERS_ATTACKEE_ARMOR] >> 8;
#ifdef MISSIONPACK
if (armor > 50 ) {
trap_S_StartLocalSound( cgs.media.hitSoundHighArmor, CHAN_LOCAL_SOUND );
} else if (armor || health > 100) {
trap_S_StartLocalSound( cgs.media.hitSoundLowArmor, CHAN_LOCAL_SOUND );
} else {
trap_S_StartLocalSound( cgs.media.hitSound, CHAN_LOCAL_SOUND );
}
#else
trap_S_StartLocalSound( cgs.media.hitSound, CHAN_LOCAL_SOUND );
#endif
} else if ( ps->persistant[PERS_HITS] < ops->persistant[PERS_HITS] ) {
trap_S_StartLocalSound( cgs.media.hitTeamSound, CHAN_LOCAL_SOUND );
}
@@ -343,43 +330,19 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) {
//Com_Printf("capture\n");
}
if (ps->persistant[PERS_IMPRESSIVE_COUNT] != ops->persistant[PERS_IMPRESSIVE_COUNT]) {
#ifdef MISSIONPACK
if (ps->persistant[PERS_IMPRESSIVE_COUNT] == 1) {
sfx = cgs.media.firstImpressiveSound;
} else {
sfx = cgs.media.impressiveSound;
}
#else
sfx = cgs.media.impressiveSound;
#endif
pushReward(sfx, cgs.media.medalImpressive, ps->persistant[PERS_IMPRESSIVE_COUNT]);
reward = qtrue;
//Com_Printf("impressive\n");
}
if (ps->persistant[PERS_EXCELLENT_COUNT] != ops->persistant[PERS_EXCELLENT_COUNT]) {
#ifdef MISSIONPACK
if (ps->persistant[PERS_EXCELLENT_COUNT] == 1) {
sfx = cgs.media.firstExcellentSound;
} else {
sfx = cgs.media.excellentSound;
}
#else
sfx = cgs.media.excellentSound;
#endif
pushReward(sfx, cgs.media.medalExcellent, ps->persistant[PERS_EXCELLENT_COUNT]);
reward = qtrue;
//Com_Printf("excellent\n");
}
if (ps->persistant[PERS_GAUNTLET_FRAG_COUNT] != ops->persistant[PERS_GAUNTLET_FRAG_COUNT]) {
#ifdef MISSIONPACK
if (ops->persistant[PERS_GAUNTLET_FRAG_COUNT] == 1) {
sfx = cgs.media.firstHumiliationSound;
} else {
sfx = cgs.media.humiliationSound;
}
#else
sfx = cgs.media.humiliationSound;
#endif
pushReward(sfx, cgs.media.medalGauntlet, ps->persistant[PERS_GAUNTLET_FRAG_COUNT]);
reward = qtrue;
//Com_Printf("guantlet frag\n");

View File

@@ -281,16 +281,7 @@ static void CG_TouchItem( centity_t *cent ) {
// Special case for flags.
// We don't predict touching our own flag
#ifdef MISSIONPACK
if( cgs.gametype == GT_1FCTF ) {
if( item->giTag != PW_NEUTRALFLAG ) {
return;
}
}
if( cgs.gametype == GT_CTF || cgs.gametype == GT_HARVESTER ) {
#else
if( cgs.gametype == GT_CTF ) {
#endif
if (cg.predictedPlayerState.persistant[PERS_TEAM] == TEAM_RED &&
item->giTag == PW_REDFLAG)
return;

View File

@@ -157,17 +157,6 @@ static void CG_DrawClientScore( int y, score_t *score, float *color, float fade,
CG_DrawHead( headx, y, 16, 16, score->client, headAngles );
}
#ifdef MISSIONPACK
// draw the team task
if ( ci->teamTask != TEAMTASK_NONE ) {
if ( ci->teamTask == TEAMTASK_OFFENSE ) {
CG_DrawPic( headx + 48, y, 16, 16, cgs.media.assaultShader );
}
else if ( ci->teamTask == TEAMTASK_DEFENSE ) {
CG_DrawPic( headx + 48, y, 16, 16, cgs.media.defendShader );
}
}
#endif
// draw the score line
if ( score->ping == -1 ) {
Com_sprintf(string, sizeof(string),

View File

@@ -46,18 +46,6 @@ static const orderTask_t validOrders[] = {
static const int numValidOrders = sizeof(validOrders) / sizeof(orderTask_t);
#ifdef MISSIONPACK // bk001204
static int CG_ValidOrder(const char *p) {
int i;
for (i = 0; i < numValidOrders; i++) {
if (Q_stricmp(p, validOrders[i].order) == 0) {
return validOrders[i].taskNum;
}
}
return -1;
}
#endif
/*
=================
CG_ParseScores
@@ -101,10 +89,6 @@ static void CG_ParseScores( void ) {
cg.scores[i].team = cgs.clientinfo[cg.scores[i].client].team;
}
#ifdef MISSIONPACK
CG_SetScoreSelection(NULL);
#endif
}
/*
@@ -179,11 +163,6 @@ static void CG_ParseWarmup( void ) {
if ( warmup == 0 && cg.warmup ) {
} else if ( warmup > 0 && cg.warmup <= 0 ) {
#ifdef MISSIONPACK
if (cgs.gametype >= GT_CTF && cgs.gametype <= GT_HARVESTER) {
trap_S_StartLocalSound( cgs.media.countPrepareTeamSound, CHAN_ANNOUNCER );
} else
#endif
{
trap_S_StartLocalSound( cgs.media.countPrepareSound, CHAN_ANNOUNCER );
}
@@ -210,12 +189,6 @@ void CG_SetConfigValues( void ) {
cgs.redflag = s[0] - '0';
cgs.blueflag = s[1] - '0';
}
#ifdef MISSIONPACK
else if( cgs.gametype == GT_1FCTF ) {
s = CG_ConfigString( CS_FLAGSTATUS );
cgs.flagStatus = s[0] - '0';
}
#endif
cg.warmup = atoi( CG_ConfigString( CS_WARMUP ) );
}
@@ -302,9 +275,6 @@ static void CG_ConfigStringModified( void ) {
cgs.voteModified = qtrue;
} else if ( num == CS_VOTE_STRING ) {
Q_strncpyz( cgs.voteString, str, sizeof( cgs.voteString ) );
#ifdef MISSIONPACK
trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER );
#endif //MISSIONPACK
} else if ( num >= CS_TEAMVOTE_TIME && num <= CS_TEAMVOTE_TIME + 1) {
cgs.teamVoteTime[num-CS_TEAMVOTE_TIME] = atoi( str );
cgs.teamVoteModified[num-CS_TEAMVOTE_TIME] = qtrue;
@@ -316,9 +286,6 @@ static void CG_ConfigStringModified( void ) {
cgs.teamVoteModified[num-CS_TEAMVOTE_NO] = qtrue;
} else if ( num >= CS_TEAMVOTE_STRING && num <= CS_TEAMVOTE_STRING + 1) {
Q_strncpyz( cgs.teamVoteString[num-CS_TEAMVOTE_STRING], str, sizeof( cgs.teamVoteString ) );
#ifdef MISSIONPACK
trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER );
#endif
} else if ( num == CS_INTERMISSION ) {
cg.intermissionStarted = atoi( str );
} else if ( num >= CS_MODELS && num < CS_MODELS+MAX_MODELS ) {
@@ -336,11 +303,6 @@ static void CG_ConfigStringModified( void ) {
cgs.redflag = str[0] - '0';
cgs.blueflag = str[1] - '0';
}
#ifdef MISSIONPACK
else if( cgs.gametype == GT_1FCTF ) {
cgs.flagStatus = str[0] - '0';
}
#endif
}
else if ( num == CS_SHADERSTATE ) {
CG_ShaderStateChanged();
@@ -464,14 +426,6 @@ static void CG_MapRestart( void ) {
trap_S_StartLocalSound( cgs.media.countFightSound, CHAN_ANNOUNCER );
CG_CenterPrint( "FIGHT!", 120, GIANTCHAR_WIDTH*2 );
}
#ifdef MISSIONPACK
if (cg_singlePlayerActive.integer) {
trap_Cvar_Set("ui_matchStartTime", va("%i", cg.time));
if (cg_recordSPDemo.integer && cg_recordSPDemoName.string && *cg_recordSPDemoName.string) {
trap_SendConsoleCommand(va("set g_synchronousclients 1 ; record %s \n", cg_recordSPDemoName.string));
}
}
#endif
trap_Cvar_Set("cg_thirdPerson", "0");
}
@@ -805,32 +759,6 @@ CG_PlayVoiceChat
=================
*/
void CG_PlayVoiceChat( bufferedVoiceChat_t *vchat ) {
#ifdef MISSIONPACK
// if we are going into the intermission, don't start any voices
if ( cg.intermissionStarted ) {
return;
}
if ( !cg_noVoiceChats.integer ) {
trap_S_StartLocalSound( vchat->snd, CHAN_VOICE);
if (vchat->clientNum != cg.snap->ps.clientNum) {
int orderTask = CG_ValidOrder(vchat->cmd);
if (orderTask > 0) {
cgs.acceptOrderTime = cg.time + 5000;
Q_strncpyz(cgs.acceptVoice, vchat->cmd, sizeof(cgs.acceptVoice));
cgs.acceptTask = orderTask;
cgs.acceptLeader = vchat->clientNum;
}
// see if this was an order
CG_ShowResponseHead();
}
}
if (!vchat->voiceOnly && !cg_noVoiceText.integer) {
CG_AddToTeamChat( vchat->message );
CG_Printf( "%s\n", vchat->message );
}
voiceChatBuffer[cg.voiceChatBufferOut].snd = 0;
#endif
}
/*
@@ -839,17 +767,6 @@ CG_PlayBufferedVoieChats
=====================
*/
void CG_PlayBufferedVoiceChats( void ) {
#ifdef MISSIONPACK
if ( cg.voiceChatTime < cg.time ) {
if (cg.voiceChatBufferOut != cg.voiceChatBufferIn && voiceChatBuffer[cg.voiceChatBufferOut].snd) {
//
CG_PlayVoiceChat(&voiceChatBuffer[cg.voiceChatBufferOut]);
//
cg.voiceChatBufferOut = (cg.voiceChatBufferOut + 1) % MAX_VOICECHATBUFFER;
cg.voiceChatTime = cg.time + 1000;
}
}
#endif
}
/*
@@ -858,19 +775,6 @@ CG_AddBufferedVoiceChat
=====================
*/
void CG_AddBufferedVoiceChat( bufferedVoiceChat_t *vchat ) {
#ifdef MISSIONPACK
// if we are going into the intermission, don't start any voices
if ( cg.intermissionStarted ) {
return;
}
memcpy(&voiceChatBuffer[cg.voiceChatBufferIn], vchat, sizeof(bufferedVoiceChat_t));
cg.voiceChatBufferIn = (cg.voiceChatBufferIn + 1) % MAX_VOICECHATBUFFER;
if (cg.voiceChatBufferIn == cg.voiceChatBufferOut) {
CG_PlayVoiceChat( &voiceChatBuffer[cg.voiceChatBufferOut] );
cg.voiceChatBufferOut++;
}
#endif
}
/*
@@ -879,47 +783,6 @@ CG_VoiceChatLocal
=================
*/
void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color, const char *cmd ) {
#ifdef MISSIONPACK
char *chat;
voiceChatList_t *voiceChatList;
clientInfo_t *ci;
sfxHandle_t snd;
bufferedVoiceChat_t vchat;
// if we are going into the intermission, don't start any voices
if ( cg.intermissionStarted ) {
return;
}
if ( clientNum < 0 || clientNum >= MAX_CLIENTS ) {
clientNum = 0;
}
ci = &cgs.clientinfo[ clientNum ];
cgs.currentVoiceClient = clientNum;
voiceChatList = CG_VoiceChatListForClient( clientNum );
if ( CG_GetVoiceChat( voiceChatList, cmd, &snd, &chat ) ) {
//
if ( mode == SAY_TEAM || !cg_teamChatsOnly.integer ) {
vchat.clientNum = clientNum;
vchat.snd = snd;
vchat.voiceOnly = voiceOnly;
Q_strncpyz(vchat.cmd, cmd, sizeof(vchat.cmd));
if ( mode == SAY_TELL ) {
Com_sprintf(vchat.message, sizeof(vchat.message), "[%s]: %c%c%s", ci->name, Q_COLOR_ESCAPE, color, chat);
}
else if ( mode == SAY_TEAM ) {
Com_sprintf(vchat.message, sizeof(vchat.message), "(%s): %c%c%s", ci->name, Q_COLOR_ESCAPE, color, chat);
}
else {
Com_sprintf(vchat.message, sizeof(vchat.message), "%s: %c%c%s", ci->name, Q_COLOR_ESCAPE, color, chat);
}
CG_AddBufferedVoiceChat(&vchat);
}
}
#endif
}
/*
@@ -928,26 +791,6 @@ CG_VoiceChat
=================
*/
void CG_VoiceChat( int mode ) {
#ifdef MISSIONPACK
const char *cmd;
int clientNum, color;
qboolean voiceOnly;
voiceOnly = atoi(CG_Argv(1));
clientNum = atoi(CG_Argv(2));
color = atoi(CG_Argv(3));
cmd = CG_Argv(4);
if (cg_noTaunt.integer != 0) {
if (!strcmp(cmd, VOICECHAT_KILLINSULT) || !strcmp(cmd, VOICECHAT_TAUNT) || \
!strcmp(cmd, VOICECHAT_DEATHINSULT) || !strcmp(cmd, VOICECHAT_KILLGAUNTLET) || \
!strcmp(cmd, VOICECHAT_PRAISE)) {
return;
}
}
CG_VoiceChatLocal( mode, voiceOnly, clientNum, color, cmd );
#endif
}
/*
@@ -998,15 +841,6 @@ static void CG_ServerCommand( void ) {
if ( !strcmp( cmd, "print" ) ) {
CG_Printf( "%s", CG_Argv(1) );
#ifdef MISSIONPACK
cmd = CG_Argv(1); // yes, this is obviously a hack, but so is the way we hear about
// votes passing or failing
if ( !Q_stricmpn( cmd, "vote failed", 11 ) || !Q_stricmpn( cmd, "team vote failed", 16 )) {
trap_S_StartLocalSound( cgs.media.voteFailed, CHAN_ANNOUNCER );
} else if ( !Q_stricmpn( cmd, "vote passed", 11 ) || !Q_stricmpn( cmd, "team vote passed", 16 ) ) {
trap_S_StartLocalSound( cgs.media.votePassed, CHAN_ANNOUNCER );
}
#endif
return;
}

View File

@@ -172,41 +172,6 @@ static void CG_ShotgunEjectBrass( centity_t *cent ) {
}
}
#ifdef MISSIONPACK
/*
==========================
CG_NailgunEjectBrass
==========================
*/
static void CG_NailgunEjectBrass( centity_t *cent ) {
localEntity_t *smoke;
vec3_t origin;
vec3_t v[3];
vec3_t offset;
vec3_t xoffset;
vec3_t up;
AnglesToAxis( cent->lerpAngles, v );
offset[0] = 0;
offset[1] = -12;
offset[2] = 24;
xoffset[0] = offset[0] * v[0][0] + offset[1] * v[1][0] + offset[2] * v[2][0];
xoffset[1] = offset[0] * v[0][1] + offset[1] * v[1][1] + offset[2] * v[2][1];
xoffset[2] = offset[0] * v[0][2] + offset[1] * v[1][2] + offset[2] * v[2][2];
VectorAdd( cent->lerpOrigin, xoffset, origin );
VectorSet( up, 0, 0, 64 );
smoke = CG_SmokePuff( origin, up, 32, 1, 1, 1, 0.33f, 700, cg.time, 0, 0, cgs.media.smokePuffShader );
// use the optimized local entity add
smoke->leType = LE_SCALE_FADE;
}
#endif
/*
==========================
CG_RailTrail
@@ -384,75 +349,6 @@ static void CG_RocketTrail( centity_t *ent, const weaponInfo_t *wi ) {
}
#ifdef MISSIONPACK
/*
==========================
CG_NailTrail
==========================
*/
static void CG_NailTrail( centity_t *ent, const weaponInfo_t *wi ) {
int step;
vec3_t origin, lastPos;
int t;
int startTime, contents;
int lastContents;
entityState_t *es;
vec3_t up;
localEntity_t *smoke;
if ( cg_noProjectileTrail.integer ) {
return;
}
up[0] = 0;
up[1] = 0;
up[2] = 0;
step = 50;
es = &ent->currentState;
startTime = ent->trailTime;
t = step * ( (startTime + step) / step );
BG_EvaluateTrajectory( &es->pos, cg.time, origin );
contents = CG_PointContents( origin, -1 );
// if object (e.g. grenade) is stationary, don't toss up smoke
if ( es->pos.trType == TR_STATIONARY ) {
ent->trailTime = cg.time;
return;
}
BG_EvaluateTrajectory( &es->pos, ent->trailTime, lastPos );
lastContents = CG_PointContents( lastPos, -1 );
ent->trailTime = cg.time;
if ( contents & ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ) {
if ( contents & lastContents & CONTENTS_WATER ) {
CG_BubbleTrail( lastPos, origin, 8 );
}
return;
}
for ( ; t <= ent->trailTime ; t += step ) {
BG_EvaluateTrajectory( &es->pos, t, lastPos );
smoke = CG_SmokePuff( lastPos, up,
wi->trailRadius,
1, 1, 1, 0.33f,
wi->wiTrailTime,
t,
0,
0,
cgs.media.nailPuffShader );
// use the optimized local entity add
smoke->leType = LE_SCALE_FADE;
}
}
#endif
/*
==========================
CG_NailTrail
@@ -709,20 +605,6 @@ void CG_RegisterWeapon( int weaponNum ) {
weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/melee/fstrun.wav", qfalse );
break;
#ifdef MISSIONPACK
case WP_CHAINGUN:
weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/vulcan/wvulfire.wav", qfalse );
weaponInfo->loopFireSound = qtrue;
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/vulcan/vulcanf1b.wav", qfalse );
weaponInfo->flashSound[1] = trap_S_RegisterSound( "sound/weapons/vulcan/vulcanf2b.wav", qfalse );
weaponInfo->flashSound[2] = trap_S_RegisterSound( "sound/weapons/vulcan/vulcanf3b.wav", qfalse );
weaponInfo->flashSound[3] = trap_S_RegisterSound( "sound/weapons/vulcan/vulcanf4b.wav", qfalse );
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
break;
#endif
case WP_MACHINEGUN:
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse );
@@ -754,18 +636,6 @@ void CG_RegisterWeapon( int weaponNum ) {
cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" );
break;
#ifdef MISSIONPACK
case WP_PROX_LAUNCHER:
weaponInfo->missileModel = trap_R_RegisterModel( "models/weaphits/proxmine.md3" );
weaponInfo->missileTrailFunc = CG_GrenadeTrail;
weaponInfo->wiTrailTime = 700;
weaponInfo->trailRadius = 32;
MAKERGB( weaponInfo->flashDlightColor, 1, 0.70f, 0 );
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/proxmine/wstbfire.wav", qfalse );
cgs.media.grenadeExplosionShader = trap_R_RegisterShader( "grenadeExplosion" );
break;
#endif
case WP_GRENADE_LAUNCHER:
weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/grenade1.md3" );
weaponInfo->missileTrailFunc = CG_GrenadeTrail;
@@ -776,19 +646,6 @@ void CG_RegisterWeapon( int weaponNum ) {
cgs.media.grenadeExplosionShader = trap_R_RegisterShader( "grenadeExplosion" );
break;
#ifdef MISSIONPACK
case WP_NAILGUN:
weaponInfo->ejectBrassFunc = CG_NailgunEjectBrass;
weaponInfo->missileTrailFunc = CG_NailTrail;
// weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/nailgun/wnalflit.wav", qfalse );
weaponInfo->trailRadius = 16;
weaponInfo->wiTrailTime = 250;
weaponInfo->missileModel = trap_R_RegisterModel( "models/weaphits/nail.md3" );
MAKERGB( weaponInfo->flashDlightColor, 1, 0.75f, 0 );
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/nailgun/wnalfire.wav", qfalse );
break;
#endif
case WP_PLASMAGUN:
// weaponInfo->missileModel = cgs.media.invulnerabilityPowerupModel;
weaponInfo->missileTrailFunc = CG_PlasmaTrail;
@@ -1174,11 +1031,6 @@ static float CG_MachinegunSpinAngle( centity_t *cent ) {
cent->pe.barrelTime = cg.time;
cent->pe.barrelAngle = AngleMod( angle );
cent->pe.barrelSpinning = !!(cent->currentState.eFlags & EF_FIRING);
#ifdef MISSIONPACK
if ( cent->currentState.weapon == WP_CHAINGUN && !cent->pe.barrelSpinning ) {
trap_S_StartSound( NULL, cent->currentState.number, CHAN_WEAPON, trap_S_RegisterSound( "sound/weapons/vulcan/wvulwind.wav", qfalse ) );
}
#endif
}
return angle;
@@ -1781,19 +1633,6 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im
switch ( weapon ) {
default:
#ifdef MISSIONPACK
case WP_NAILGUN:
if( soundType == IMPACTSOUND_FLESH ) {
sfx = cgs.media.sfx_nghitflesh;
} else if( soundType == IMPACTSOUND_METAL ) {
sfx = cgs.media.sfx_nghitmetal;
} else {
sfx = cgs.media.sfx_nghit;
}
mark = cgs.media.holeMarkShader;
radius = 12;
break;
#endif
case WP_LIGHTNING:
// no explosion at LG impact, it is added with the beam
r = rand() & 3;
@@ -1807,17 +1646,6 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im
mark = cgs.media.holeMarkShader;
radius = 12;
break;
#ifdef MISSIONPACK
case WP_PROX_LAUNCHER:
mod = cgs.media.dishFlashModel;
shader = cgs.media.grenadeExplosionShader;
sfx = cgs.media.sfx_proxexp;
mark = cgs.media.burnMarkShader;
radius = 64;
light = 300;
isSprite = qtrue;
break;
#endif
case WP_GRENADE_LAUNCHER:
mod = cgs.media.dishFlashModel;
shader = cgs.media.grenadeExplosionShader;
@@ -1876,32 +1704,6 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im
sfx = 0;
radius = 4;
break;
#ifdef MISSIONPACK
case WP_CHAINGUN:
mod = cgs.media.bulletFlashModel;
if( soundType == IMPACTSOUND_FLESH ) {
sfx = cgs.media.sfx_chghitflesh;
} else if( soundType == IMPACTSOUND_METAL ) {
sfx = cgs.media.sfx_chghitmetal;
} else {
sfx = cgs.media.sfx_chghit;
}
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
radius = 8;
break;
#endif
case WP_MACHINEGUN:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
@@ -1968,11 +1770,6 @@ void CG_MissileHitPlayer( int weapon, vec3_t origin, vec3_t dir, int entityNum )
switch ( weapon ) {
case WP_GRENADE_LAUNCHER:
case WP_ROCKET_LAUNCHER:
#ifdef MISSIONPACK
case WP_NAILGUN:
case WP_CHAINGUN:
case WP_PROX_LAUNCHER:
#endif
CG_MissileHitWall( weapon, 0, origin, dir, IMPACTSOUND_FLESH );
break;
default: