Sync with rpgxef-repo

This commit is contained in:
Walter Julius Hennecke 2012-12-18 19:06:11 +01:00
parent 91bdb0db87
commit 401ba34b51
11 changed files with 440 additions and 1295 deletions

View file

@ -915,5 +915,8 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand("selfdestruct");
trap_AddCommand("shipdamage");
trap_AddCommand("shiphealth");
/* precacheFile */
trap_AddCommand("generatePrecacheFile");
}

View file

@ -20,8 +20,6 @@ qboolean CG_LoadUsablesStrings( void );
extern void FX_InitSinTable(void);
//extern lensReflec_s lensReflec[10];
int cg_liftEnts[MAX_CLIENTS];
int cg_numAnims;
int cg_numSndAnims;
@ -49,7 +47,7 @@ int vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int a
case CG_CONSOLE_COMMAND:
return CG_ConsoleCommand();
case CG_DRAW_ACTIVE_FRAME:
CG_DrawActiveFrame( arg0, arg1, arg2 );
CG_DrawActiveFrame( arg0, (stereoFrame_t)arg1, (qboolean)arg2 );
return 0;
case CG_CROSSHAIR_PLAYER:
return CG_CrosshairPlayer();
@ -118,7 +116,6 @@ vmCvar_t cg_zoomFov;
vmCvar_t cg_thirdPerson;
vmCvar_t cg_thirdPersonRange;
vmCvar_t cg_thirdPersonAngle;
//RPG-X: TiM - Cool JKA CVARs
vmCvar_t cg_thirdPersonVertOffset;
vmCvar_t cg_thirdPersonHorzOffset;
vmCvar_t cg_thirdPersonAlpha;
@ -199,15 +196,6 @@ vmCvar_t cg_debugLua;
vmCvar_t cg_logLua;
#endif
//RPG-X | Phenix | 05/02/2006
//Ban System (and it's backup cvars)
//vmCvar_t cg_playerID;
//vmCvar_t s_mhz; //Part A + 562
//vmCvar_t cg_fow; //Part B + 333
//vmCvar_t cl_avgPacket; //Part C + 99
//vmCvar_t cg_rewardsSize;//Part D + 120
typedef struct {
vmCvar_t *vmCvar;
char *cvarName;
@ -217,15 +205,12 @@ typedef struct {
static cvarTable_t cvarTable[] = {
{ &cg_ignore, "cg_ignore", "0", 0 }, // used for debugging
//{ &s_mhz, "s_mhz", "0", CVAR_ARCHIVE | CVAR_ROM | CVAR_NORESTART }, //RPG-X | Phenix | 05/02/2006
{ &cg_autoswitch, "cg_autoswitch", "1", CVAR_ARCHIVE },
{ &cg_drawGun, "cg_drawGun", "1", CVAR_ARCHIVE },
{ &cg_zoomFov, "cg_zoomfov", "22.5", CVAR_ARCHIVE },
{ &cg_fov, "cg_fov", "80", CVAR_ARCHIVE },
//{ &cg_fow, "cg_fow", "0", CVAR_ARCHIVE | CVAR_ROM | CVAR_NORESTART }, //RPG-X | Phenix | 05/02/2006
{ &cg_viewsize, "cg_viewsize", "100", CVAR_ARCHIVE },
{ &cg_stereoSeparation, "cg_stereoSeparation", "0.4", CVAR_ARCHIVE },
//{ &s_mhz, "s_mhz", "0", CVAR_ARCHIVE | CVAR_ROM | CVAR_NORESTART }, //RPG-X | Phenix | 05/02/2006
{ &cg_shadows, "cg_shadows", "1", CVAR_ARCHIVE },
{ &cg_gibs, "cg_gibs", "0", CVAR_ARCHIVE }, //no gibs in trek
{ &cg_draw2D, "cg_draw2D", "1", CVAR_ARCHIVE },
@ -239,7 +224,6 @@ static cvarTable_t cvarTable[] = {
{ &cg_drawCrosshair, "cg_drawCrosshair", "1", CVAR_ARCHIVE },
{ &cg_drawCrosshairNames, "cg_drawCrosshairNames", "1", CVAR_ARCHIVE },
{ &cg_drawRewards, "cg_drawRewards", "1", CVAR_ARCHIVE },
//{ &cg_rewardsSize, "cg_rewardsSize", "0", CVAR_ARCHIVE | CVAR_ROM | CVAR_NORESTART }, //RPG-X | Phenix | 05/02/2006
{ &cg_crosshairSize, "cg_crosshairSize", "24", CVAR_ARCHIVE },
{ &cg_crosshairHealth, "cg_crosshairHealth", "1", CVAR_ARCHIVE },
{ &cg_crosshairX, "cg_crosshairX", "0", CVAR_ARCHIVE },
@ -299,10 +283,8 @@ static cvarTable_t cvarTable[] = {
{ &cg_buildScript, "com_buildScript", "0", 0 }, // force loading of all possible data amd error on failures
{ &cg_paused, "cl_paused", "0", CVAR_ROM },
//{ &cl_avgPacket, "cl_avgPacket", "0", CVAR_ARCHIVE | CVAR_ROM | CVAR_NORESTART }, //RPG-X | Phenix | 05/02/2006
{ &cg_synchronousClients, "g_synchronousClients", "0", 0 }, // communicated by systeminfo
{ &ui_playerClass, "ui_playerClass", "noclass", CVAR_ARCHIVE /*| CVAR_ROM | CVAR_USERINFO*/ },
//{ &ui_playerclass, "ui_playerclass", "0", 0 }, // player class
{ &ui_playerRank, "ui_playerRank", "crewman", CVAR_ARCHIVE /*| CVAR_ROM | CVAR_USERINFO*/ },
{ &cg_disablekillmsgs, "cg_disablekillmsgs", "0", CVAR_ARCHIVE },
@ -337,12 +319,6 @@ static cvarTable_t cvarTable[] = {
//RPG-X | GSIO01 | 11/05/2009
{ &rpg_forceFieldSet, "rpg_forceFieldSet", "1", CVAR_ARCHIVE | CVAR_LATCH },
//{ &cg_chatBGColor, "cg_chatBGColor", "", CVAR_ARCHIVE }
//{ &cg_defaultModel, "cg_defaultModel", DEFAULT_PLAYER, CVAR_ARCHIVE },
//{ &cg_playerID, "cg_playerID", "0", CVAR_ARCHIVE | CVAR_ROM | CVAR_NORESTART }
// grp cvars
{ &grp_berp, "grp_berp", "0", CVAR_ARCHIVE | CVAR_LATCH },
@ -354,7 +330,66 @@ static cvarTable_t cvarTable[] = {
};
static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] );
#define CVAR_TABLE_SIZE sizeof( cvarTable ) / sizeof( cvarTable[0] )
/*
=======================
CG_PrecacheRemapShaders
=======================
*/
void CG_PrecacheRemapShaders(void) {
char filepath[MAX_QPATH];
fileHandle_t f;
int len;
char* data;
char* ptr;
char* token;
qhandle_t shader;
COM_StripExtension(cgs.mapname, filepath);
Com_sprintf(filepath, MAX_QPATH, "%s.precache", filepath);
len = trap_FS_FOpenFile(filepath, &f, FS_READ);
if(!f) {
CG_Printf("No precache file ...\n");
return;
}
data = (char *)malloc(sizeof(char)*(len+1));
if(!data) {
trap_FS_FCloseFile(f);
CG_Printf(S_COLOR_RED "Error - could not allocate %d byte of memory.\n", sizeof(char)*(len+1));
return;
}
trap_FS_Read(data, len, f);
trap_FS_FCloseFile(f);
//CG_Printf("Precaching texture files ...");
CG_Printf("Precaching texture files ...");
COM_BeginParseSession();
ptr = data;
token = COM_Parse(&ptr);
while(token != NULL) {
if(!token[0]) break;
if(!strcmp(token, "END")) break;
CG_Printf("\t%s ... ", token);
shader = trap_R_RegisterShader(token);
if(!shader) {
CG_Printf(S_COLOR_RED "FAIL\n");
} else {
CG_Printf("OK\n");
}
token = COM_Parse(&ptr);
}
free(data);
}
/*
=================
@ -366,14 +401,14 @@ void CG_RegisterCvars( void ) {
cvarTable_t *cv;
char var[MAX_TOKEN_CHARS];
for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) {
for ( i = 0, cv = cvarTable ; i < CVAR_TABLE_SIZE ; i++, cv++ ) {
trap_Cvar_Register( cv->vmCvar, cv->cvarName,
cv->defaultString, cv->cvarFlags );
}
// see if we are also running the server on this machine
trap_Cvar_VariableStringBuffer( "sv_running", var, sizeof( var ) );
cgs.localServer = atoi( var );
cgs.localServer = (qboolean)atoi( var );
}
@ -386,7 +421,7 @@ void CG_UpdateCvars( void ) {
int i;
cvarTable_t *cv;
for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ )
for ( i = 0, cv = cvarTable ; i < CVAR_TABLE_SIZE ; i++, cv++ )
{
trap_Cvar_Update( cv->vmCvar );
}
@ -447,42 +482,6 @@ void QDECL CG_Printf( const char *msg, ... ) {
}
}
//CVAR background
/*if ( cg_chatBGColor.string[0] )
{
char *bgColor;
char *rimColor;
int rgb[3];
int i;
Q_strlwr( cg_chatBGColor.string );
bgColor = cg_chatBGColor.string;
if ( *bgColor == '#' )
{
bgColor[7]='\0';
bgColor++;
for ( i=0; i < 3; i++ )
{
if ( *bgColor >= 'a' && *bgColor <='f' )
rgb[i] = 16 * ( 10 + (int)(*bgColor - 'a'));
else
rgb[i] = 16 * atoi(bgColor[0]);
bgColor++;
if ( *bgColor >= 'a' && *bgColor <='f' )
rgb[i] += ( 10 + (int)(*bgColor - 'a'));
else
rgb[i] += atoi(bgColor[0]);
}
}
}*/
trap_Print( text );
}
@ -613,51 +612,34 @@ static void CG_RegisterSounds( void )
cgs.media.count1Sound = trap_S_RegisterSound( "sound/voice/computer/misc/one.wav" );
cgs.media.countFightSound = trap_S_RegisterSound( "sound/voice/computer/misc/fight.wav" );
cgs.media.countPrepareSound = trap_S_RegisterSound( "sound/voice/computer/misc/prepare.wav" );
cgs.media.interfaceSnd1 = trap_S_RegisterSound( "sound/interface/button4.wav" );
cgs.media.useNothingSound = trap_S_RegisterSound( "sound/items/use_nothing.wav" );
cgs.media.teleInSound = trap_S_RegisterSound( "sound/world/transin.wav" );
cgs.media.transportSound = trap_S_RegisterSound( "sound/world/transporter.wav" );
cgs.media.respawnSound = trap_S_RegisterSound( "sound/items/respawn1.wav" );
cgs.media.talkSound = trap_S_RegisterSound( "sound/interface/communicator.wav" );
//cgs.media.landSound = trap_S_RegisterSound( "sound/player/land1.wav");
//RPG-X | GSIO01 | 20/05/2009:
cgs.media.landSound[LANDSOUND_NORMAL] = trap_S_RegisterSound("sound/player/land1.wav");
cgs.media.landSound[LANDSOUND_GRASS] = trap_S_RegisterSound("sound/player/footsteps/grass_jump.wav");
cgs.media.landSound[LANDSOUND_GRAVEL] = trap_S_RegisterSound("sound/player/footsteps/gravel_jump.wav");
cgs.media.landSound[LANDSOUND_SNOW] = trap_S_RegisterSound("sound/player/footsteps/snow_jump.wav");
cgs.media.landSound[LANDSOUND_WOOD] = trap_S_RegisterSound("sound/player/footsteps/wood_jump.wav");
cgs.media.splatSound = trap_S_RegisterSound( "sound/weapons/bodyfall.wav");
cgs.media.watrInSound = trap_S_RegisterSound( "sound/player/watr_in.wav");
cgs.media.watrOutSound = trap_S_RegisterSound( "sound/player/watr_out.wav");
cgs.media.watrUnSound = trap_S_RegisterSound( "sound/player/watr_un.wav");
cgs.media.jumpPadSound = trap_S_RegisterSound ("sound/items/damage3.wav" );
cgs.media.disintegrateSound = trap_S_RegisterSound( "sound/weapons/prifle/disint.wav" );
cgs.media.disintegrate2Sound = trap_S_RegisterSound( "sound/weapons/prifle/disint2.wav" );
cgs.media.playerExplodeSound = trap_S_RegisterSound( "sound/weapons/explosions/fireball.wav" );
cgs.media.phaserEmptySound = trap_S_RegisterSound("sound/weapons/phaser/phaserempty.wav");
//RPG-X: RedTechie - Load sound for shake cmd
cgs.media.ShakeSound = trap_S_RegisterSound("sound/shake.wav");
cgs.media.tedTextSound = trap_S_RegisterSound( "sound/interface/tedtext.wav" );
//RPG-X | Phenix | 13/02/2005
for (i=0 ; i<N00bSoundCount ; i++) {
Com_sprintf (name, sizeof(name), "sound/n00bs/insult%i.wav", i+1);
cgs.media.N00bSound[i] = trap_S_RegisterSound (name);
}
//RPG-X | Phenix | 08/06/2005
cgs.media.AdminMsgSound = trap_S_RegisterSound("sound/interface/button2.wav");
for (i=0 ; i<4 ; i++) {
@ -685,7 +667,6 @@ static void CG_RegisterSounds( void )
Com_sprintf (name, sizeof(name), "sound/player/footsteps/clank%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_METAL][i] = trap_S_RegisterSound (name);
//RPG-X | GSIO01 | 20.05.2009 | START MOD
Com_sprintf (name, sizeof(name), "sound/player/footsteps/wood%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_WOOD][i] = trap_S_RegisterSound(name);
@ -697,7 +678,6 @@ static void CG_RegisterSounds( void )
Com_sprintf (name, sizeof(name), "sound/player/footsteps/snow%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_SNOW][i] = trap_S_RegisterSound(name);
//RPG-X | GSIO01 | 20.05.2009 | END MOD
}
cg.loadLCARSStage = 2; // Loading bar stage 2
@ -723,31 +703,22 @@ static void CG_RegisterSounds( void )
cgs.gameSounds[i] = trap_S_RegisterSound( soundName );
}
// FIXME: only needed with item
//cgs.media.flightSound = trap_S_RegisterSound( "sound/items/flight.wav" );
cgs.media.medkitSound = trap_S_RegisterSound ("sound/items/use_medkit.wav");
//cgs.media.quadSound = trap_S_RegisterSound("sound/items/damage3.wav");
cgs.media.grenadeExplodeSound = trap_S_RegisterSound(SOUND_DIR "glauncher/explode.wav");//detpack
cgs.media.metalChunkSound = trap_S_RegisterSound( "sound/weapons/explosions/metalexplode.wav" );
cgs.media.glassChunkSound = trap_S_RegisterSound( "sound/weapons/explosions/glassbreak1.wav" );
cgs.media.woodChunkSound = trap_S_RegisterSound( "sound/weapons/explosions/metalexplode.wav" );
cgs.media.stoneChunkSound = trap_S_RegisterSound( "sound/weapons/explosions/metalexplode.wav" );
// cgs.media.sfx_rockexp = trap_S_RegisterSound ("sound/weapons/rocket/rocklx1a.wav");
// trek sounds
//TiM : Q flash
cgs.media.qFlash = trap_S_RegisterSound( "sound/world/q_flash.wav" );
cgs.media.envSparkSound1 = trap_S_RegisterSound ("sound/ambience/spark1.wav");
cgs.media.envSparkSound2 = trap_S_RegisterSound ("sound/ambience/spark2.wav");
cgs.media.envSparkSound3 = trap_S_RegisterSound ("sound/ambience/spark3.wav");
cgs.media.defaultPickupSound = trap_S_RegisterSound ("sound/items/n_health.wav");
cgs.media.invulnoProtectSound = trap_S_RegisterSound("sound/items/protect3.wav");
//cgs.media.regenSound = trap_S_RegisterSound("sound/items/regen.wav");
cgs.media.waterDropSound1 = trap_S_RegisterSound("sound/ambience/waterdrop1.wav");
cgs.media.waterDropSound2 = trap_S_RegisterSound("sound/ambience/waterdrop2.wav");
cgs.media.waterDropSound3 = trap_S_RegisterSound("sound/ambience/waterdrop3.wav");
@ -760,7 +731,6 @@ static void CG_RegisterSounds( void )
cgs.media.zoomEnd116 = trap_S_RegisterSound( "sound/weapons/tr116/powerdown.wav" );
cgs.media.tr116Chirp = trap_S_RegisterSound( "sound/weapons/tr116/chirp.wav" );
cgs.media.tr116Whir = trap_S_RegisterSound( "sound/weapons/tr116/whir.wav" );
cgs.media.surfaceExpSound[0] = trap_S_RegisterSound("sound/weapons/explosions/explode8.wav");
cgs.media.surfaceExpSound[1] = trap_S_RegisterSound("sound/weapons/explosions/explode9.wav");
cgs.media.surfaceExpSound[2] = trap_S_RegisterSound("sound/weapons/explosions/explode14.wav");
@ -770,72 +740,6 @@ static void CG_RegisterSounds( void )
cgs.media.bigSurfExpSound = trap_S_RegisterSound("sound/weapons/explosions/explode12.wav");
}
//===================================================================================
/*static void PrecacheAwardsAssets()
{
// kef -- precaching bot victory sounds (e.g. Desperado_wins.wav) in PlayerModel_BuildList()
// TiM -- commenting out every asset RPG-X won't use. Honestly, this'll speed up load time A LOT
trap_R_RegisterShaderNoMip("menu/medals/medal_efficiency");
trap_R_RegisterShaderNoMip("menu/medals/medal_sharpshooter");
trap_R_RegisterShaderNoMip("menu/medals/medal_untouchable");
trap_R_RegisterShaderNoMip("menu/medals/medal_logistics");
trap_R_RegisterShaderNoMip("menu/medals/medal_tactician");
trap_R_RegisterShaderNoMip("menu/medals/medal_demolitionist");
trap_R_RegisterShaderNoMip("menu/medals/medal_ace");
trap_R_RegisterShaderNoMip("menu/medals/medal_teammvp");
trap_R_RegisterShaderNoMip("menu/medals/medal_section31");
trap_S_RegisterSound("sound/voice/computer/misc/effic.wav");
trap_S_RegisterSound("sound/voice/computer/misc/sharp.wav");
trap_S_RegisterSound("sound/voice/computer/misc/untouch.wav");
trap_S_RegisterSound("sound/voice/computer/misc/log.wav");
trap_S_RegisterSound("sound/voice/computer/misc/tact.wav");
trap_S_RegisterSound("sound/voice/computer/misc/demo.wav");
trap_S_RegisterSound("sound/voice/computer/misc/ace.wav");
trap_S_RegisterSound("sound/voice/computer/misc/sec31.wav");
trap_R_RegisterShaderNoMip("menu/medals/medal_teammvp");
trap_R_RegisterShaderNoMip("menu/medals/medal_teamdefender");
trap_R_RegisterShaderNoMip("menu/medals/medal_teamwarrior");
trap_R_RegisterShaderNoMip("menu/medals/medal_teamcarrier");
trap_R_RegisterShaderNoMip("menu/medals/medal_teaminterceptor");
trap_R_RegisterShaderNoMip("menu/medals/medal_teambravery");
trap_S_RegisterSound("sound/voice/computer/misc/mvp.wav");
trap_S_RegisterSound("sound/voice/computer/misc/defender.wav");
trap_S_RegisterSound("sound/voice/computer/misc/warrior.wav");
trap_S_RegisterSound("sound/voice/computer/misc/carrier.wav");
trap_S_RegisterSound("sound/voice/computer/misc/intercept.wav");
trap_S_RegisterSound("sound/voice/computer/misc/bravery.wav");
trap_R_RegisterShaderNoMip("menu/medals/medal_ace");
trap_R_RegisterShaderNoMip("menu/medals/medal_expert");
trap_R_RegisterShaderNoMip("menu/medals/medal_master");
trap_R_RegisterShaderNoMip("menu/medals/medal_champion");
trap_S_RegisterSound("sound/voice/computer/misc/ace.wav");
trap_S_RegisterSound("sound/voice/computer/misc/expert.wav");
trap_S_RegisterSound("sound/voice/computer/misc/master.wav");
trap_S_RegisterSound("sound/voice/computer/misc/champion.wav");
trap_S_RegisterSound("sound/voice/computer/misc/commendations.wav");
trap_S_RegisterSound("sound/voice/computer/misc/progcomp.wav");
trap_S_RegisterSound("sound/voice/computer/misc/2nd.wav");
trap_S_RegisterSound("sound/voice/computer/misc/3rd.wav");
trap_S_RegisterSound("sound/voice/computer/misc/notPlace.wav");
trap_S_RegisterSound( "sound/voice/computer/misc/youwin.wav" );
trap_S_RegisterSound( "sound/voice/computer/misc/blueteam_wins.wav" );
trap_S_RegisterSound( "sound/voice/computer/misc/redteam_wins.wav" );
trap_S_RegisterSound( "sound/voice/computer/misc/teamstied.wav" );
trap_S_RegisterSound( "sound/voice/computer/misc/yourteam_wins.wav" );
trap_R_RegisterShader("icons/icon_ready_on");
trap_R_RegisterShader("icons/icon_ready_off");
}*/
/*
=================
CG_RegisterGraphics
@ -846,7 +750,7 @@ This function may execute for a couple of minutes with a slow disk.
static void CG_RegisterGraphics( void ) {
int i;
char items[MAX_ITEMS+1];
//char temp_skin[100];
static char *sb_nums[11] = {
"gfx/2d/numbers/zero",
"gfx/2d/numbers/one",
@ -894,99 +798,27 @@ static void CG_RegisterGraphics( void ) {
cgs.media.smallnumberShaders[i] = trap_R_RegisterShaderNoMip( sb_t_nums[i] );
}
/*cgs.media.botSkillShaders[0] = trap_R_RegisterShaderNoMip( "menu/art/skill1.tga" );
cgs.media.botSkillShaders[1] = trap_R_RegisterShaderNoMip( "menu/art/skill2.tga" );
cgs.media.botSkillShaders[2] = trap_R_RegisterShaderNoMip( "menu/art/skill3.tga" );
cgs.media.botSkillShaders[3] = trap_R_RegisterShaderNoMip( "menu/art/skill4.tga" );
cgs.media.botSkillShaders[4] = trap_R_RegisterShaderNoMip( "menu/art/skill5.tga" );*/
//cgs.media.pClassShaders[PC_NOCLASS] = trap_R_RegisterShaderNoMip( "menu/art/pc_noclass.tga" );//PC_NOCLASS,//default
//cgs.media.pClassShaders[PC_SECURITY] = trap_R_RegisterShaderNoMip( "menu/art/pc_security.tga" );//PC_NOCLASS,//default
//cgs.media.pClassShaders[PC_COMMAND] = trap_R_RegisterShaderNoMip( "menu/art/pc_command.tga" );//PC_NOCLASS,//default
//cgs.media.pClassShaders[PC_ENGINEER] = trap_R_RegisterShaderNoMip( "menu/art/pc_engineer.tga" );//PC_NOCLASS,//default
//cgs.media.pClassShaders[PC_ALIEN] = trap_R_RegisterShaderNoMip( "menu/art/pc_alien.tga" );//PC_NOCLASS,//default
//cgs.media.pClassShaders[PC_SCIENCE] = trap_R_RegisterShaderNoMip( "menu/art/pc_science.tga" );//PC_NOCLASS,//default
//cgs.media.pClassShaders[PC_MEDICAL] = trap_R_RegisterShaderNoMip( "menu/art/pc_medical.tga" );//PC_NOCLASS,//default
//cgs.media.pClassShaders[PC_ALPHAOMEGA22] = trap_R_RegisterShaderNoMip( "menu/art/pc_security.tga" );//PC_NOCLASS,//default
//cgs.media.pClassShaders[PC_ADMIN] = trap_R_RegisterShaderNoMip( "menu/art/pc_security.tga" );//PC_NOCLASS,//default
//TiM
/*if ( cgs.pModSpecialties || cg_buildScript.integer )
{
cgs.media.pClassShaders[PC_INFILTRATOR] = trap_R_RegisterShaderNoMip( "menu/art/pc_infiltrator.tga" );//PC_INFILTRATOR,//fast, low attack
cgs.media.pClassShaders[PC_SNIPER] = trap_R_RegisterShaderNoMip( "menu/art/pc_sniper.tga" );//PC_SNIPER,//sneaky, snipe only
cgs.media.pClassShaders[PC_HEAVY] = trap_R_RegisterShaderNoMip( "menu/art/pc_heavy.tga" );//PC_HEAVY,//slow, heavy attack
cgs.media.pClassShaders[PC_DEMO] = trap_R_RegisterShaderNoMip( "menu/art/pc_demo.tga" );//PC_DEMO,//go boom
cgs.media.pClassShaders[PC_MEDIC] = trap_R_RegisterShaderNoMip( "menu/art/pc_medic.tga" );//PC_MEDIC,//heal
cgs.media.pClassShaders[PC_TECH] = trap_R_RegisterShaderNoMip( "menu/art/pc_tech.tga" );//PC_TECH,//operate
}*/
//TiM
/*if ( cgs.pModActionHero || cg_buildScript.integer )
{
cgs.media.pClassShaders[PC_ACTIONHERO] = trap_R_RegisterShaderNoMip( "menu/art/pc_hero.tga" );//PC_ACTIONHERO,//has everything
cgs.media.heroSpriteShader = trap_R_RegisterShader( "sprites/class_hero" );
}*/
//TiM
/*if ( cgs.pModAssimilation || cg_buildScript.integer )
{//borg beam
cgs.media.whiteLaserShader = trap_R_RegisterShader( "gfx/effects/whitelaser" );
cgs.media.borgEyeFlareShader = trap_R_RegisterShader( "gfx/misc/borgeyeflare" );
cgs.media.pClassShaders[PC_BORG] = trap_R_RegisterShaderNoMip( "menu/art/pc_borg.tga" );//PC_BORG,//special weapons, slower, adapting shields
cgs.media.borgIconShader = trap_R_RegisterShaderNoMip( "icons/icon_borg.tga" );
cgs.media.borgQueenIconShader = trap_R_RegisterShaderNoMip( "icons/icon_borgqueen.tga" );
}*/
//TiM : For the ST style long beam effectszor
cgs.media.transportShader = trap_R_RegisterShader( "powerups/beamEffect" );
//GSIO01: shaders for additional transport fx
cgs.media.transportKlingon = trap_R_RegisterShader( "gfx/effects/tKlingon" );
cgs.media.transportRomulan = trap_R_RegisterShader( "gfx/effects/tRom" );
cgs.media.transportCardassian = trap_R_RegisterShader( "gfx/effects/tCardi" );
cgs.media.deferShader = trap_R_RegisterShaderNoMip( "gfx/2d/defer.tga" );
//No more elimination - TiM
//cgs.media.eliminatedShader = trap_R_RegisterShaderNoMip( "gfx/2d/eliminated.tga" );
cgs.media.deferShader = trap_R_RegisterShaderNoMip( "gfx/2d/defer.tga" );
cgs.media.smokePuffRageProShader = trap_R_RegisterShader( "smokePuffRagePro" );
cgs.media.lagometerShader = trap_R_RegisterShader("lagometer" );
cgs.media.connectionShader = trap_R_RegisterShader( "disconnected" );
cgs.media.waterBubbleShader = trap_R_RegisterShader( "waterBubble" );
//cgs.media.selectShader = trap_R_RegisterShader( "gfx/2d/select" );
/*for ( i = 0 ; i < NUM_CROSSHAIRS ; i++ ) {
cgs.media.crosshairShader[i] = trap_R_RegisterShaderNoMip( va("gfx/2d/crosshair%c", 'a'+i) );
}*/
//LASER
cgs.media.laserShader = trap_R_RegisterShader( "sprites/laser" );
cgs.media.backTileShader = trap_R_RegisterShader( "gfx/2d/backtile" );
//cgs.media.noammoShader = trap_R_RegisterShader( "icons/noammo" );
// powerup shaders
/*cgs.media.quadShader = trap_R_RegisterShader("powerups/quad" );
cgs.media.quadWeaponShader = trap_R_RegisterShader("powerups/quadWeapon" );
cgs.media.battleSuitShader = trap_R_RegisterShader("powerups/battleSuit" );
cgs.media.battleWeaponShader = trap_R_RegisterShader("powerups/battleWeapon" );
cgs.media.invisShader = trap_R_RegisterShader("powerups/invisibility" );
cgs.media.regenShader = trap_R_RegisterShader("powerups/regen" );
cgs.media.hastePuffShader = trap_R_RegisterShader("hasteSmokePuff" );
cgs.media.flightPuffShader = trap_R_RegisterShader("flightSmokePuff" );
cgs.media.borgFullBodyShieldShader = trap_R_RegisterShader( "gfx/effects/borgfullbodyshield" );
cgs.media.borgFlareShader = trap_R_RegisterShader( "gfx/misc/borgflare" );*/
cgs.media.disruptorShader = trap_R_RegisterShader( "powerups/disrupt");
cgs.media.explodeShellShader = trap_R_RegisterShader( "powerups/explode");
cgs.media.quantumDisruptorShader = trap_R_RegisterShader( "powerups/quantum_disruptor_hm");
cgs.media.borgFullBodyShieldShader = trap_R_RegisterShader( "gfx/effects/borgfullbodyshield2" );
//cgs.media.seekerModel = trap_R_RegisterModel("models/powerups/trek/flyer.md3" );
//cgs.media.holoDoorModel = trap_R_RegisterModel("models/mapobjects/podium/hm_room.md3" );
// Used in any explosion-oriented death.
for (i = 0; i < NUM_CHUNKS; i++)
{
@ -999,8 +831,6 @@ static void CG_RegisterGraphics( void ) {
cgs.media.teleportEffectModel = trap_R_RegisterModel( "models/misc/telep.md3" );
cgs.media.teleportEffectShader = trap_R_RegisterShader( "playerTeleport" );
//cgs.media.doorbox = trap_R_RegisterModel( "models/mapobjects/podium/hm_room.md3");
//RPG-X TiM : the bolton assets
cgs.media.phaserHolster = trap_R_RegisterModel( "models/boltOns/phaser_holster.md3");
cgs.media.phaserHolsterInner = trap_R_RegisterModel( "models/boltOns/phaser_holster_inner.md3");
@ -1038,24 +868,10 @@ static void CG_RegisterGraphics( void ) {
break;
}
//RPG-X END
//cgs.media.shieldDamageShaderBlue = trap_R_RegisterShader( "gfx/misc/blue_dmgshield" );
//cgs.media.shieldActivateShaderRed = trap_R_RegisterShader( "gfx/misc/red_portashield" );
//cgs.media.shieldDamageShaderRed = trap_R_RegisterShader( "gfx/misc/red_dmgshield" );
cgs.media.weaponPlaceholderShader = trap_R_RegisterShader("powerups/placeholder" );
cgs.media.rezOutShader = trap_R_RegisterShader("powerups/rezout");
cgs.media.electricBodyShader = trap_R_RegisterShader("gfx/misc/electric");
/*cgs.media.medalImpressive = trap_R_RegisterShaderNoMip( "medal_impressive" );
cgs.media.medalExcellent = trap_R_RegisterShaderNoMip( "medal_excellent" );
cgs.media.medalFirstStrike = trap_R_RegisterShaderNoMip( "medal_firststrike" );
cgs.media.medalAce = trap_R_RegisterShaderNoMip( "medal_ace" );
cgs.media.medalExpert = trap_R_RegisterShaderNoMip( "medal_expert" );
cgs.media.medalMaster = trap_R_RegisterShaderNoMip( "medal_master" );
cgs.media.medalChampion = trap_R_RegisterShaderNoMip( "medal_champion" );*/
//RPG-X: RedTechie - Scoreboard Endcaps
cgs.media.scoreboardtopleft = trap_R_RegisterShaderNoMip( "menu/common/rpgx_sb_topleft");
@ -1066,11 +882,6 @@ static void CG_RegisterGraphics( void ) {
//RPG-X: RedTechie - Healthbar Curves
cgs.media.healthendcap = trap_R_RegisterShaderNoMip("gfx/interface/rpgx_healthbar_endcap");
cgs.media.healthbigcurve = trap_R_RegisterShaderNoMip("gfx/interface/rpgx_healthbar_leftcorner");
//TiM: New Healthbar Graphics
//cgs.media.healthSineWave = trap_R_RegisterShaderNoMip( "menu/healthbar/sinewave" );
//RPG-X: RedTechie - Cloak Sprite
//cgs.media.cloakspriteShader = trap_R_RegisterShader("sprites/cloak");
cgs.media.scoreboardEndcap = trap_R_RegisterShaderNoMip( "menu/common/halfround_r_24");
cgs.media.corner_12_24 = trap_R_RegisterShaderNoMip( "menu/common/corner_ll_24_12");
@ -1109,26 +920,6 @@ static void CG_RegisterGraphics( void ) {
//It's possible to use one set of textures, and use Alpha channels to vary
//the color thru the code... wouldn't that be better?
cgs.media.radarShader = trap_R_RegisterShader( "gfx/radar/radar" );
/*cgs.media.rd_up = trap_R_RegisterShader( "gfx/radar/rd_up" );
cgs.media.rd_down = trap_R_RegisterShader( "gfx/radar/rd_down" );
cgs.media.rd_level = trap_R_RegisterShader( "gfx/radar/rd_level" );
cgs.media.rd_red_up = trap_R_RegisterShader( "gfx/radar/rd_red_up" );
cgs.media.rd_red_down = trap_R_RegisterShader( "gfx/radar/rd_red_down" );
cgs.media.rd_red_level = trap_R_RegisterShader( "gfx/radar/rd_red_level" );
cgs.media.rd_blue_up = trap_R_RegisterShader( "gfx/radar/rd_blue_up" );
cgs.media.rd_blue_down = trap_R_RegisterShader( "gfx/radar/rd_blue_down" );
cgs.media.rd_blue_level = trap_R_RegisterShader( "gfx/radar/rd_blue_level" );
cgs.media.rd_white_up = trap_R_RegisterShader( "gfx/radar/rd_white_up" );
cgs.media.rd_white_down = trap_R_RegisterShader( "gfx/radar/rd_white_down" );
cgs.media.rd_white_level = trap_R_RegisterShader( "gfx/radar/rd_white_level" );
cgs.media.rd_teal_up = trap_R_RegisterShader( "gfx/radar/rd_teal_up" );
cgs.media.rd_teal_down = trap_R_RegisterShader( "gfx/radar/rd_teal_down" );
cgs.media.rd_teal_level = trap_R_RegisterShader( "gfx/radar/rd_teal_level" );
cgs.media.rd_black_up = trap_R_RegisterShader( "gfx/radar/rd_black_up" );
cgs.media.rd_black_down = trap_R_RegisterShader( "gfx/radar/rd_black_down" );
cgs.media.rd_black_level = trap_R_RegisterShader( "gfx/radar/rd_black_level" );
cgs.media.rd_injured_up = trap_R_RegisterShader( "gfx/radar/injured_up" );
cgs.media.rd_injured_down = trap_R_RegisterShader( "gfx/radar/injured_down" );*/
cgs.media.rd_injured_level = trap_R_RegisterShader( "gfx/radar/injured_level" );
cgs.media.radarMain = trap_R_RegisterShaderNoMip( "gfx/radar/radar_icon" );
@ -1174,24 +965,6 @@ static void CG_RegisterGraphics( void ) {
}
}
//TiM: Do the same for all tricorder string names
/*or ( i = 1; i < MAX_TRIC_STRINGS; i++ ) {
const char *strName;
strName = CG_ConfigString( CS_TRIC_STRINGS+i );
if ( !strName[0] ) {
break;
}
//Com_Printf( S_COLOR_RED "USABLE MESSAGE IN CG: %s\n", strName );
//Com_sprintf( cgs.tricStrings[i], MAX_TOKEN_CHARS, "%s", strName );
//cgs.tricStrings[i] = (char *)strName;
//Com_Printf( S_COLOR_RED "%s\n", cgs.tricStrings[i] );
Q_strncpyz( cgs.tricStrings[i], strName, MAX_TOKEN_CHARS );
}*/
cg.loadLCARSStage = 7; // Loading bar stage 7
CG_LoadingString( "Interface" );
@ -1221,10 +994,8 @@ static void CG_RegisterGraphics( void ) {
cgs.media.fireShader = trap_R_RegisterShader( "gfx/misc/rpgflames" );
cgs.media.smokeShader = trap_R_RegisterShader( "gfx/misc/smoke" );
cgs.media.explosionModel = trap_R_RegisterModel ( "models/weaphits/explosion.md3" );
//cgs.media.electricalExplosionFastShader = trap_R_RegisterShader( "electricalExplosionFast" );
cgs.media.electricalExplosionSlowShader = trap_R_RegisterShader( "electricalExplosionSlow" );
cgs.media.surfaceExplosionShader = trap_R_RegisterShader( "surfaceExplosion" );
//cgs.media.purpleParticleShader = trap_R_RegisterShader( "gfx/misc/purpleparticle" );
cgs.media.blueParticleShader = trap_R_RegisterShader( "gfx/misc/blueparticle" );
cgs.media.ltblueParticleShader = trap_R_RegisterShader( "gfx/misc/ltblueparticle" );
cgs.media.yellowParticleShader = trap_R_RegisterShader( "gfx/misc/yellowparticle" );
@ -1235,15 +1006,10 @@ static void CG_RegisterGraphics( void ) {
cgs.media.redRing2Shader = trap_R_RegisterShader( "gfx/misc/red_ring2" );
cgs.media.nukeModel = trap_R_RegisterModel ( "models/weaphits/nuke.md3" );
cgs.media.bigShockShader = trap_R_RegisterShader( "gfx/misc/bigshock" );
//cgs.media.IMODMarkShader = trap_R_RegisterShader( "gfx/damage/burnmark2" );
cgs.media.plasmaShader = trap_R_RegisterShader( "gfx/misc/plasmanew" );
cgs.media.bolt2Shader = trap_R_RegisterShader( "gfx/effects/electrica" );
//cgs.media.holoOuchShader = trap_R_RegisterShader( "powerups/holoOuch" );
cgs.media.painBlobShader = trap_R_RegisterShader( "gfx/misc/painblob" );
cgs.media.painShieldBlobShader = trap_R_RegisterShader( "gfx/misc/painshieldblob" );
//cgs.media.shieldBlobShader = trap_R_RegisterShader( "gfx/misc/shieldblob" );
//cgs.media.halfShieldShader = trap_R_RegisterShader( "halfShieldShell" );
//cgs.media.holoDecoyShader = trap_R_RegisterShader( "powerups/holodecoy" );
cgs.media.trans1Shader = trap_R_RegisterShader( "gfx/misc/trans1" );
cgs.media.trans2Shader = trap_R_RegisterShader( "gfx/misc/trans2" );
//TiM
@ -1257,8 +1023,6 @@ static void CG_RegisterGraphics( void ) {
cgs.media.regenDecal = trap_R_RegisterShader( "gfx/effects/regen_decal" );
//cgs.media.blueParticleStreakShader = trap_R_RegisterShader( "gfx/misc/blueparticle_anamorphic" );
//RPG-X | GSIO01 | 11/05/2009:
cgs.media.quantumGlow = trap_R_RegisterShader( "gfx/fx/quantum_glow" );
cgs.media.quantumRays = trap_R_RegisterShader( "gfx/fx/quantum_rays" );
@ -1282,11 +1046,6 @@ static void CG_RegisterGraphics( void ) {
cgs.media.zoomMaskShader = trap_R_RegisterShader( "gfx/misc/zoom_mask2" );
cgs.media.zoomMask116Shader = trap_R_RegisterShader( "gfx/misc/zoom_mask_tr116");
cgs.media.zoomGlow116Shader = trap_R_RegisterShader( "gfx/misc/zoom_tr116_flash" );
/*cgs.media.zoomBarShader = trap_R_RegisterShader( "gfx/2d/zoom_ctrl" );
cgs.media.zoomArrowShader = trap_R_RegisterShader( "gfx/2d/arrow" );
cgs.media.ammoslider = trap_R_RegisterShaderNoMip( "gfx/interface/ammobar" );
cgs.media.zoomInsertShader = trap_R_RegisterShaderNoMip( "gfx/misc/zoom_insert" );*/
cgs.media.testDetpackShader3 = trap_R_RegisterShader( "gfx/misc/detpack3" );
cgs.media.testDetpackRingShader1 = trap_R_RegisterShader( "gfx/misc/detpackring1" );
@ -1296,114 +1055,8 @@ static void CG_RegisterGraphics( void ) {
cgs.media.testDetpackRingShader5 = trap_R_RegisterShader( "gfx/misc/detpackring5" );
cgs.media.testDetpackRingShader6 = trap_R_RegisterShader( "gfx/misc/detpackring6" );
//RPG-X (J2J) Rank Images for Score Board
//TiM: WHHHHHHHHHHYYYYYYYYYYYYYYYYYYYYYYYYYYYYY!!!!!!!!!!?!?!?!
//Seriously... too many shader slots... T_T
/*********************************************************/
//Civillian / N/A
/*cgs.media.ri_Civ = trap_R_RegisterShader("icons/rankinsignias/Civ-Blank");
//Red (Command)
cgs.media.ri_Crewman[0] = trap_R_RegisterShader("icons/rankinsignias/R-S1-Blank");
cgs.media.ri_Cadet1[0] = trap_R_RegisterShader("icons/rankinsignias/R-AC1");
cgs.media.ri_Cadet2[0] = trap_R_RegisterShader("icons/rankinsignias/R-AC2");
cgs.media.ri_Cadet3[0] = trap_R_RegisterShader("icons/rankinsignias/R-AC3");
cgs.media.ri_Cadet4[0] = trap_R_RegisterShader("icons/rankinsignias/R-AC4");
cgs.media.ri_Ensign[0] = trap_R_RegisterShader("icons/rankinsignias/R-0");
cgs.media.ri_Ltjg[0] = trap_R_RegisterShader("icons/rankinsignias/R-01");
cgs.media.ri_Lt[0] = trap_R_RegisterShader("icons/rankinsignias/R-00");
cgs.media.ri_Ltcmdr[0] = trap_R_RegisterShader("icons/rankinsignias/R-001");
cgs.media.ri_Cmdr[0] = trap_R_RegisterShader("icons/rankinsignias/R-000");
cgs.media.ri_Capt[0] = trap_R_RegisterShader("icons/rankinsignias/R-0000");
cgs.media.ri_Cmmdr[0] = trap_R_RegisterShader("icons/rankinsignias/R-A0");
cgs.media.ri_Admr2[0] = trap_R_RegisterShader("icons/rankinsignias/R-A00");
cgs.media.ri_Admr3[0] = trap_R_RegisterShader("icons/rankinsignias/R-A000");
cgs.media.ri_Admr4[0] = trap_R_RegisterShader("icons/rankinsignias/R-A0000");
cgs.media.ri_Admr5[0] = trap_R_RegisterShader("icons/rankinsignias/R-A00000");
//Gold (Engineering / Security)
cgs.media.ri_Crewman[1] = trap_R_RegisterShader("icons/rankinsignias/Y-S1-Blank");
cgs.media.ri_Cadet1[1] = trap_R_RegisterShader("icons/rankinsignias/Y-AC1");
cgs.media.ri_Cadet2[1] = trap_R_RegisterShader("icons/rankinsignias/Y-AC2");
cgs.media.ri_Cadet3[1] = trap_R_RegisterShader("icons/rankinsignias/Y-AC3");
cgs.media.ri_Cadet4[1] = trap_R_RegisterShader("icons/rankinsignias/Y-AC4");
cgs.media.ri_Ensign[1] = trap_R_RegisterShader("icons/rankinsignias/Y-0");
cgs.media.ri_Ltjg[1] = trap_R_RegisterShader("icons/rankinsignias/Y-01");
cgs.media.ri_Lt[1] = trap_R_RegisterShader("icons/rankinsignias/Y-00");
cgs.media.ri_Ltcmdr[1] = trap_R_RegisterShader("icons/rankinsignias/Y-001");
cgs.media.ri_Cmdr[1] = trap_R_RegisterShader("icons/rankinsignias/Y-000");
cgs.media.ri_Capt[1] = trap_R_RegisterShader("icons/rankinsignias/Y-0000");
cgs.media.ri_Cmmdr[1] = trap_R_RegisterShader("icons/rankinsignias/Y-A0");
cgs.media.ri_Admr2[1] = trap_R_RegisterShader("icons/rankinsignias/Y-A00");
cgs.media.ri_Admr3[1] = trap_R_RegisterShader("icons/rankinsignias/Y-A000");
cgs.media.ri_Admr4[1] = trap_R_RegisterShader("icons/rankinsignias/Y-A0000");
cgs.media.ri_Admr5[1] = trap_R_RegisterShader("icons/rankinsignias/Y-A00000");
//Teal (Science / Medical)
cgs.media.ri_Crewman[2] = trap_R_RegisterShader("icons/rankinsignias/T-S1-Blank");
cgs.media.ri_Cadet1[2] = trap_R_RegisterShader("icons/rankinsignias/T-AC1");
cgs.media.ri_Cadet2[2] = trap_R_RegisterShader("icons/rankinsignias/T-AC2");
cgs.media.ri_Cadet3[2] = trap_R_RegisterShader("icons/rankinsignias/T-AC3");
cgs.media.ri_Cadet4[2] = trap_R_RegisterShader("icons/rankinsignias/T-AC4");
cgs.media.ri_Ensign[2] = trap_R_RegisterShader("icons/rankinsignias/T-0");
cgs.media.ri_Ltjg[2] = trap_R_RegisterShader("icons/rankinsignias/T-01");
cgs.media.ri_Lt[2] = trap_R_RegisterShader("icons/rankinsignias/T-00");
cgs.media.ri_Ltcmdr[2] = trap_R_RegisterShader("icons/rankinsignias/T-001");
cgs.media.ri_Cmdr[2] = trap_R_RegisterShader("icons/rankinsignias/T-000");
cgs.media.ri_Capt[2] = trap_R_RegisterShader("icons/rankinsignias/T-0000");
cgs.media.ri_Cmmdr[2] = trap_R_RegisterShader("icons/rankinsignias/T-A0");
cgs.media.ri_Admr2[2] = trap_R_RegisterShader("icons/rankinsignias/T-A00");
cgs.media.ri_Admr3[2] = trap_R_RegisterShader("icons/rankinsignias/T-A000");
cgs.media.ri_Admr4[2] = trap_R_RegisterShader("icons/rankinsignias/T-A0000");
cgs.media.ri_Admr5[2] = trap_R_RegisterShader("icons/rankinsignias/T-A00000");
//Marine Class
cgs.media.ri_Crewman[3] = trap_R_RegisterShader("icons/rankinsignias/G-S1-Blank");
cgs.media.ri_Cadet1[3] = trap_R_RegisterShader("icons/rankinsignias/G-AC1");
cgs.media.ri_Cadet2[3] = trap_R_RegisterShader("icons/rankinsignias/G-AC2");
cgs.media.ri_Cadet3[3] = trap_R_RegisterShader("icons/rankinsignias/G-AC3");
cgs.media.ri_Cadet4[3] = trap_R_RegisterShader("icons/rankinsignias/G-AC4");
cgs.media.ri_Ensign[3] = trap_R_RegisterShader("icons/rankinsignias/G-2Lt");
cgs.media.ri_Ltjg[3] = trap_R_RegisterShader("icons/rankinsignias/G-1Lt");
cgs.media.ri_Lt[3] = trap_R_RegisterShader("icons/rankinsignias/G-MCapt");
cgs.media.ri_Ltcmdr[3] = trap_R_RegisterShader("icons/rankinsignias/G-Maj");
cgs.media.ri_Cmdr[3] = trap_R_RegisterShader("icons/rankinsignias/G-LtCol");
cgs.media.ri_Capt[3] = trap_R_RegisterShader("icons/rankinsignias/G-Col");
cgs.media.ri_Cmmdr[3] = trap_R_RegisterShader("icons/rankinsignias/G-GX");
cgs.media.ri_Admr2[3] = trap_R_RegisterShader("icons/rankinsignias/G-GXX");
cgs.media.ri_Admr3[3] = trap_R_RegisterShader("icons/rankinsignias/G-GXXX");
cgs.media.ri_Admr4[3] = trap_R_RegisterShader("icons/rankinsignias/G-GXXXX");
cgs.media.ri_Admr5[3] = trap_R_RegisterShader("icons/rankinsignias/G-GXXXXX");*/
/***************************************************************************/
//RPG-X: J2J - CrossHairs
/* for(i = 0; i < 15; i++)
{
cgs.media.crosshair[i] = trap_R_RegisterShader(va("icons/CrossHairs/ch%i",i+1));
}*/
cgs.media.crosshairSheet = trap_R_RegisterShaderNoMip( "gfx/2d/rpgx_crosshairs" );
/*
01 Phaser
02 PRifle
03 Scav
04 alien
05 imod
06 tr116
07 granede
08 photon
09 dermal
10 hypo
11 medkit
12 engkit
13 engtool
14 padd
15 tricorder
*/
/***************************************************************************/
//PH34R T3H L3NZFL4R3!!!!
@ -1411,13 +1064,7 @@ static void CG_RegisterGraphics( void ) {
if ( cg_dynamiclensflares.integer ) {
cgs.media.flareCore = trap_R_RegisterShaderNoMip("gfx/effects/flares/flare_core");
cgs.media.flareStreak = trap_R_RegisterShaderNoMip("gfx/effects/flares/flare_streak");
cgs.media.flareHaze = trap_R_RegisterShaderNoMip("gfx/effects/flares/flare_haze");
/*cgs.media.flareChroma = trap_R_RegisterShaderNoMip("gfx/effects/flares/flare_chromadisc");
cgs.media.flareRadial = trap_R_RegisterShaderNoMip("gfx/effects/flares/flare_radial");
cgs.media.flareStraight = trap_R_RegisterShaderNoMip("gfx/effects/flares/flare_straight");
cgs.media.flareInverseRad = trap_R_RegisterShaderNoMip("gfx/effects/flares/flare_inverseradial");*/
cgs.media.flareHaze = trap_R_RegisterShaderNoMip("gfx/effects/flares/flare_haze");
for ( i=0; i<10; i++ ) {
lensReflec[i].graphic = trap_R_RegisterShaderNoMip( lensReflec[i].file );
@ -1426,14 +1073,8 @@ static void CG_RegisterGraphics( void ) {
//TiM - for Prifle improved FX
cgs.media.orangeStarShader = trap_R_RegisterShaderNoMip( "gfx/misc/orangestar" );
cgs.media.qFlashSprite = trap_R_RegisterShaderNoMip( "gfx/effects/qflash" );
//TiM: Save asset space
/*if (cg_buildScript.integer)
{
PrecacheAwardsAssets();
}*/
}
/*
@ -1576,7 +1217,6 @@ void CG_Init( int serverMessageNum, int serverCommandSequence ) {
cgs.media.charsetPropTiny = trap_R_RegisterShaderNoMip("gfx/2d/chars_tiny");
cgs.media.charsetProp = trap_R_RegisterShaderNoMip("gfx/2d/chars_medium");
cgs.media.charsetPropBig = trap_R_RegisterShaderNoMip("gfx/2d/chars_big");
// cgs.media.charsetPropGlow = trap_R_RegisterShaderNoMip( "menu/art/font1_prop_glo.tga" );
cgs.media.charsetPropB = trap_R_RegisterShaderNoMip( "gfx/2d/chars_medium.tga" );
CG_RegisterCvars();
@ -1657,7 +1297,7 @@ void CG_Init( int serverMessageNum, int serverCommandSequence ) {
//missing models when someone get killed and weapons are dropped
for(i = 0; i < WP_NUM_WEAPONS; i++) {
CG_RegisterWeapon(i);
}
}
// To get the interface timing started
cg.interfaceStartupTime = 0;
@ -1684,15 +1324,13 @@ void CG_Init( int serverMessageNum, int serverCommandSequence ) {
if ( cgs.scannablePanels )
CG_LoadUsablesStrings();
//TiM Finally, init class data received from Server
//TiM2 - Separated this out so class data has to be locally accessed now
//CG_ParseClassData();
/* shader remapping */
CG_ShaderStateChanged();
if(grp_berp.integer)
CG_Printf(S_COLOR_YELLOW "GSIO01 and Ubergames greet Brave Explorers.\n");
CG_PrecacheRemapShaders();
}
/*
@ -1703,9 +1341,7 @@ Called before every level change or subsystem restart
=================
*/
void CG_Shutdown( void ) {
// some mods may need to do cleanup work here,
// like closing files or archiving session data
//trap_Cvar_Set ("rpg_playIntro", "0");
}
@ -1992,7 +1628,6 @@ qboolean CG_LoadClasses( void )
for ( i = 0; i < 3; i++ )
{
cgs.classData[numClasses].radarColor[i] = (int)Com_Clamp( 0, 255, (int)temp[i] );
//G_Printf( S_COLOR_RED "g_classData[numClasses].color[%i] = %i\n", i, g_classData[numClasses].color[i] );
}
continue;

View file

@ -109,12 +109,12 @@ void CG_ParseServerinfo( void ) {
char *mapname;
info = CG_ConfigString( CS_SERVERINFO );
cgs.gametype = atoi( Info_ValueForKey( info, "g_gametype" ) );
cgs.pModAssimilation = atoi( Info_ValueForKey( info, "g_pModAssimilation" ) );
cgs.pModDisintegration = atoi( Info_ValueForKey( info, "g_pModDisintegration" ) );
cgs.pModActionHero = atoi( Info_ValueForKey( info, "g_pModActionHero" ) );
cgs.pModSpecialties = atoi( Info_ValueForKey( info, "g_pModSpecialties" ) );
cgs.pModElimination = atoi( Info_ValueForKey( info, "g_pModElimination" ) );
cgs.gametype = (gametype_t)atoi( Info_ValueForKey( info, "g_gametype" ) );
cgs.pModAssimilation = (qboolean)atoi( Info_ValueForKey( info, "g_pModAssimilation" ) );
cgs.pModDisintegration = (qboolean)atoi( Info_ValueForKey( info, "g_pModDisintegration" ) );
cgs.pModActionHero = (qboolean)atoi( Info_ValueForKey( info, "g_pModActionHero" ) );
cgs.pModSpecialties = (qboolean)atoi( Info_ValueForKey( info, "g_pModSpecialties" ) );
cgs.pModElimination = (qboolean)atoi( Info_ValueForKey( info, "g_pModElimination" ) );
cgs.dmflags = atoi( Info_ValueForKey( info, "dmflags" ) );
cgs.teamflags = atoi( Info_ValueForKey( info, "teamflags" ) );
cgs.fraglimit = atoi( Info_ValueForKey( info, "fraglimit" ) );

View file

@ -24,7 +24,7 @@ UpdateTournamentInfo
void UpdateTournamentInfo( void ) {
int i = 0, j = 0, k = 0;
gentity_t *player = NULL, *ent = NULL;
gentity_t *player = NULL;
int playerClientNum;
int n;
char msg[AWARDS_MSG_LENGTH], msg2[AWARDS_MSG_LENGTH];
@ -37,7 +37,7 @@ void UpdateTournamentInfo( void ) {
gclient_t *cl = NULL;
gclient_t *cl2= NULL;
int secondPlaceTied=0;
memset(msg, 0, AWARDS_MSG_LENGTH);
memset(msg2, 0, AWARDS_MSG_LENGTH);
@ -48,26 +48,13 @@ void UpdateTournamentInfo( void ) {
cl2= &level.clients[level.sortedClients[2]];
if (cl->ps.persistant[PERS_SCORE] == cl2->ps.persistant[PERS_SCORE])
secondPlaceTied=1;
winningTeam = level.clients[0].ps.persistant[PERS_RANK]+1;
if ( winningTeam != TEAM_BLUE && winningTeam != TEAM_RED )
{//tie or not a team game
winningTeam = 0;
}
// In team game, we want to represent the highest scored client from the WINNING team.
for (i = 0; i < level.maxclients; i++)
{
ent = &g_entities[i];
if (ent && ent->client &&
(ent->client->sess.sessionTeam != TEAM_SPECTATOR) &&
CalculateTeamMVPByRank(ent))
{
// found the winning team's MVP
mvpNum = i;
break;
}
}
if (mvpNum < 0)
{//ah, crap no MVP, pick the first player on the winning team
for (i = 0; i < level.maxclients; i++ )
@ -137,10 +124,6 @@ void UpdateTournamentInfo( void ) {
strcpy(msg2, msg);
Com_sprintf( msg, sizeof(msg), "%s 0", msg2);
}
else
{
CalculateAwards(player, msg);
}
// now supply...
//
@ -276,8 +259,8 @@ static void CelebrateStart( gentity_t *player )
player->nextthink = level.time + TIMER_GESTURE;
player->think = CelebrateStop;*/
// We don't want the taunt sound effect because it interfears with the computer voice giving awards
// FIXME: just get timing right?
// We don't want the taunt sound effect because it interfears with the computer voice giving awards
// FIXME: just get timing right?
//FIXME: why does this get lost now?
BG_AddPredictableEventToPlayerstate( EV_TAUNT, 0, &player->client->ps );
}
@ -386,8 +369,6 @@ SpawnModelsOnVictoryPads
void SpawnModelsOnVictoryPads( void ) {
gentity_t *player;
gentity_t *podium;
int i = 0;
gentity_t *ent = &g_entities[0];
podium1 = NULL;
podium2 = NULL;
@ -396,27 +377,9 @@ void SpawnModelsOnVictoryPads( void ) {
podium = SpawnPodium();
// SPAWN PLAYER ON TOP MOST PODIUM
if (g_gametype.integer > GT_SINGLE_PLAYER)
{
// In team game, we want to represent the highest scored client from the WINNING team.
for (i = 0; i < level.maxclients; i++)
{
ent = &g_entities[i];
if (ent->client && CalculateTeamMVPByRank(ent))
{
// found the winning team's MVP
break;
}
}
player = SpawnModelOnVictoryPad( podium, offsetFirst, ent,
level.clients[ level.sortedClients[0] ].ps.persistant[PERS_RANK] &~ RANK_TIED_FLAG );
}
else
{
player = SpawnModelOnVictoryPad( podium, offsetFirst, &g_entities[level.sortedClients[0]],
level.clients[ level.sortedClients[0] ].ps.persistant[PERS_RANK] &~ RANK_TIED_FLAG );
}
player = SpawnModelOnVictoryPad( podium, offsetFirst, &g_entities[level.sortedClients[0]],
level.clients[ level.sortedClients[0] ].ps.persistant[PERS_RANK] &~ RANK_TIED_FLAG );
if ( player ) {
player->nextthink = level.time + 2000;
player->think = CelebrateStart;
@ -429,7 +392,7 @@ void SpawnModelsOnVictoryPads( void ) {
{
if ( level.numNonSpectatorClients > 1 ) {
player = SpawnModelOnVictoryPad( podium, offsetSecond, &g_entities[level.sortedClients[1]],
level.clients[ level.sortedClients[1] ].ps.persistant[PERS_RANK] &~ RANK_TIED_FLAG );
level.clients[ level.sortedClients[1] ].ps.persistant[PERS_RANK] &~ RANK_TIED_FLAG );
if ( player ) {
podium2 = player;
}

View file

@ -53,13 +53,14 @@ void DeathmatchScoreboardMessage( gentity_t *ent ) {
} else {
ping = cl->ps.ping < 999 ? cl->ps.ping : 999;
}
// TODO ajust me some things here might not be needed anymore
Com_sprintf (entry, sizeof(entry),
" %i %i %i %i %i %i %i %i %i %i %i", level.sortedClients[i],
cl->ps.persistant[PERS_SCORE], ping, (level.time - cl->pers.enterTime)/60000,
scoreFlags, g_entities[level.sortedClients[i]].s.powerups,
GetWorstEnemyForClient(level.sortedClients[i]),
GetMaxDeathsForClient(level.sortedClients[i]),
GetFavoriteWeaponForClient(level.sortedClients[i]),
0,
0,
0,
cl->ps.persistant[PERS_KILLED],
((g_entities[cl->ps.clientNum].r.svFlags&SVF_ELIMINATED)!=0) );
j = strlen(entry);
@ -721,7 +722,7 @@ qboolean SetTeam( gentity_t *ent, char *s ) {
if ( !Q_stricmp( s, "spectator" ) || !Q_stricmp( s, "s" ) ) {
team = TEAM_SPECTATOR;
specState = SPECTATOR_FREE;
client->noclip = 1;
client->noclip = (qboolean)1;
} else if ( g_gametype.integer >= GT_TEAM ) {
// if running a team game, assign player to one of the teams
specState = SPECTATOR_NOT;
@ -4087,14 +4088,14 @@ static void Cmd_BeamToPlayer_f( gentity_t *ent ) {
int startPoint;
int totalCount;
int offsetRA[8][2] = { { 1, 0 }, //offsets for each beam test location
{ 1, -1 },
{ 0, -1 },
{ -1, -1 },
{ -1, 0 },
{ -1, 1 },
{ 0, 1 },
{ 1, 1 }
};
{ 1, -1 },
{ 0, -1 },
{ -1, -1 },
{ -1, 0 },
{ -1, 1 },
{ 0, 1 },
{ 1, 1 }
};
int viewAngleHeading[8] = { 180, 135, 90, 45, 0, -45, -90, -135 };
qboolean everyone = qfalse;
@ -5780,7 +5781,7 @@ Harry Young | 25/07/2012
*/
static void Cmd_selfdestruct_f(gentity_t *ent) {
gentity_t *destructEnt, *safezone=NULL;
char arg[16], arg2[16], arg3[16], arg4[16], arg5[16], arg6[16], arg7[16], arg8[16];
char arg[16], arg2[16], arg6[16], arg7[16], arg8[16];
double ETAmin, ETAsec;
if(!ent || !ent->client)
return;
@ -5788,12 +5789,9 @@ static void Cmd_selfdestruct_f(gentity_t *ent) {
//Trapping all potential args here.
trap_Argv(1, arg, sizeof(arg));
trap_Argv(2, arg2, sizeof(arg2));
trap_Argv(3, arg3, sizeof(arg3));
trap_Argv(4, arg4, sizeof(arg4));
trap_Argv(5, arg5, sizeof(arg5));
trap_Argv(6, arg6, sizeof(arg6));
trap_Argv(7, arg7, sizeof(arg7));
trap_Argv(8, arg8, sizeof(arg8));
trap_Argv(3, arg6, sizeof(arg6));
trap_Argv(4, arg7, sizeof(arg7));
trap_Argv(5, arg8, sizeof(arg8));
//There is one subcommand that is clear for general use: selfdestruct remaining
//If we're going for this skip admincheck
@ -5830,9 +5828,6 @@ static void Cmd_selfdestruct_f(gentity_t *ent) {
destructEnt = G_Spawn();
destructEnt->classname = "target_selfdestruct";
destructEnt->wait = atoi(arg2);
destructEnt->count = atoi(arg3);
destructEnt->n00bCount = atoi(arg4);
destructEnt->health = atoi(arg5);
destructEnt->flags = atoi(arg6);
destructEnt->bluename = G_NewString(arg7);
destructEnt->target = G_NewString(arg8);
@ -5840,26 +5835,20 @@ static void Cmd_selfdestruct_f(gentity_t *ent) {
destructEnt->spawnflags = 1; //tells ent to free once aborted.
//we need to check a few things here to make sure the entity works properly. Else we free it.
if ( destructEnt->wait > 0 || destructEnt->count > 0 || destructEnt->n00bCount > 0 || destructEnt->health > 0 ){
G_CallSpawn(destructEnt); //Spawn-Function will also manage init, so we need to call that.
} else { //sth's wrong so lets tell them what is.
G_PrintfClient(ent, "^1ERROR: The following arguments are missing:");
if ( destructEnt->wait == 0 )
G_PrintfClient(ent, "^1-duration must not be 0.");
if ( destructEnt->count == 0 )
G_PrintfClient(ent, "^1-intervall must not be 0.");
if ( destructEnt->n00bCount == 0 )
G_PrintfClient(ent, "^1-intervall-60 must not be 0.");
if ( destructEnt->health == 0 )
G_PrintfClient(ent, "^1-intervall-10 must not be 0.");
if ( destructEnt->wait <= 0 ){
G_PrintfClient(ent, "^1ERROR: duration must not be 0. Removing entity.");
while((safezone = G_Find(safezone, FOFS(classname), "target_safezone")) != NULL){
if(!destructEnt->bluename && safezone->spawnflags & 2){
G_PrintfClient(ent, "^1-safezone must be given for maps consisting of multiple ships/stations (like rpg_runabout). For a list of safezonesuse the safezonelist command.");
G_PrintfClient(ent, "^1ERROR: safezone must be given for maps consisting of multiple ships/stations (like rpg_runabout). For a list of safezonesuse the safezonelist command. Removing entity.");
destructEnt->wait = 0; //we'll use this next to free the ent
break;
}
}
G_PrintfClient(ent, "^1Removing entity.");
G_FreeEntity(destructEnt);
if(destructEnt->wait <= 0)
G_FreeEntity(destructEnt);
else
G_CallSpawn(destructEnt);
return;
}
} else if (!Q_stricmp(arg, "remaining")) {
@ -5870,6 +5859,9 @@ static void Cmd_selfdestruct_f(gentity_t *ent) {
return;
}
if(destructEnt->flags == 1)
return; //we simply don't need this while there is a visible countdown.
//we need the remaining time in minutes and seconds from that entity. Just ask them off and have the command do the math.
ETAsec = floor(modf((( floor(destructEnt->damage / 1000) - floor(level.time / 1000) ) / 60), &ETAmin)*60); //break it apart, put off the minutes and return the floored secs
if (!Q_stricmp(arg2, "global")) //a relevant OP has requestet a global announcement so let's give it
@ -5885,22 +5877,18 @@ static void Cmd_selfdestruct_f(gentity_t *ent) {
}
destructEnt->use(destructEnt, NULL, NULL); // Use-Function will simply manage the abort
} else {
//maybe hook up a setup UI here later.
G_PrintfClient(ent, "^1ERROR: Invalid or no command-Argument. Arguments are start, remaining and abort");
G_PrintfClient(ent, "^3Usage: selfdestruct start duration intervall intervall-60 intervall-10 audio [safezone] [target]");
G_PrintfClient(ent, "^3Usage: selfdestruct start duration audio [safezone] [target]");
G_PrintfClient(ent, "duration: total countdown-duration in seconds. Must not be 0.");
G_PrintfClient(ent, "intervall: intervall of audio warnings up to T-60 seconds in seconds. Must not be 0.");
G_PrintfClient(ent, "intervall-60: intervall of audio warnings within T-60 seconds in seconds. Must not be 0.");
G_PrintfClient(ent, "intervall-10: intervall of audio warnings within T-10 seconds in seconds. Must not be 0.");
G_PrintfClient(ent, "audio: set this 0 if you do want a muted countdown, else set this 1.");
G_PrintfClient(ent, "safezone: safezone to toggle unsafe at T-50ms. Only for maps with multiple ships (like rpg_runabout). Set NULL to skip.");
G_PrintfClient(ent, "target: Optional Argument for Effects to fire once the countdown hist 0. The entity will automatically shake everyones screen and kill all clienst outside an active target_safezone.");
G_PrintfClient(ent, "^2Hint: Make sure your duration and intervalls are synced up. There is a failsave for the countdown to hit it's mark however there is nothing to make sure that you don't get your warnings at unexpected times...");
G_PrintfClient(ent, "^2Try this for example: selfdestruct start 131 10 10 1 1");
G_PrintfClient(ent, "\nFor a fluid countdown (each sec displayed) try extremeselfdestruct");
G_PrintfClient(ent, "\n^3Usage: selfdestruct remaining");
G_PrintfClient(ent, "This will give out the remaining countdown-time to you only even if the count is muted. It is free to use for any client.");
G_PrintfClient(ent, "\n^3Usage: selfdestruct remaining global");
G_PrintfClient(ent, "This will give out the remaining countdown-time to all clients even if the count is muted.");
G_PrintfClient(ent, "This will give out the remaining countdown-time to all clients even if the count is muted. Calling this is restricted to admins");
G_PrintfClient(ent, "\n^3Usage: selfdestruct abort");
G_PrintfClient(ent, "This will abort any self destruct running");
return;
@ -6055,7 +6043,6 @@ GSIO01 | 12/05/2009
*/
static void Cmd_admin_centerprint_f(gentity_t *ent) {
char *arg;
gentity_t *destructEnt;
if ( trap_Argc () < 1 ) {
return;
@ -6079,12 +6066,6 @@ static void Cmd_admin_centerprint_f(gentity_t *ent) {
return; // not fully in game yet
}
destructEnt = G_Find(NULL, FOFS(classname), "target_selfdestruct");
if( destructEnt || destructEnt->spawnflags & 2){ //if we have a selfdestruct that occupies the Center disallow
trap_SendServerCommand( ent-g_entities, va("print \"ERROR: You can not centerprint while a selfdestruct occupies that slot.\n\" ") );
return;
}
arg = ConcatArgs( 1 );
if ( !arg[0] ) { //if user added no args (ie wanted the parameters)
@ -7083,17 +7064,17 @@ static void Cmd_UiTransporterLoc_f(gentity_t *ent) {
if(locTarget) {
if(locTarget->sound1to2) {
#ifndef SQL
#ifndef SQL
if ( !IsAdmin( ent ) ) {
G_PrintfClient(ent, "Destination is a restricted location.\n");
return;
}
#else
#else
if ( !IsAdmin( ent ) || !G_Sql_UserDB_CheckRight(ent->client->uid, SQLF_BEAM) ) {
G_PrintfClient(ent, "Destination is a restricted location.\n");
return;
}
#endif
#endif
}
trTrigger->target_ent = locTarget;
trTrigger->count = 0;
@ -7365,6 +7346,123 @@ void Cmd_CamtestEnd_f(gentity_t *ent) {
}
// END CCAM
typedef struct rShader_s {
char *s;
} rShader_s;
void addShaderToList(list_p list, char *shader) {
rShader_s* s = (rShader_s *)malloc(sizeof(rShader_s));
rShader_s* t;
list_iter_p i;
if(s == NULL) return;
if(shader[0] == 0) return;
if(list == NULL) return;
s->s = strdup(shader);
if(s->s == NULL) {
free(s);
return;
}
i = list_iterator(list, FRONT);
if(i == NULL) {
free(s->s);
free(s);
return;
}
for(t = (rShader_s *)list_next(i); t != NULL; t = (rShader_s *)list_next(i)) {
if(!strcmp(shader, t->s)) {
return;
}
}
list_add(list, s, sizeof(rShader_s));
}
extern target_alert_Shaders_s alertShaders;
void Cmd_GeneratePrecacheFile(gentity_t *ent) {
int i;
char info[MAX_INFO_STRING];
char file[MAX_QPATH];
list_p shaders;
list_iter_p iter;
qboolean first = qtrue;
fileHandle_t f;
rShader_s* s;
trap_GetServerinfo(info, MAX_INFO_STRING);
Com_sprintf(file, MAX_QPATH, "maps/%s.precache", Info_ValueForKey(info, "mapname"));
trap_FS_FOpenFile(file, &f, FS_APPEND);
if(!f) {
G_Printf(S_COLOR_RED "[Error] - Could not create/open 'maps/%s.precache'\n", file);
return;
}
shaders = create_list();
if(!shaders) {
G_Printf(S_COLOR_RED "[Error] - Could not create shader list.\n");
trap_FS_FCloseFile(f);
return;
}
G_Printf("Generating precache file '%s' ...\n", file);
for(i = 0; i < alertShaders.numShaders; i++) {
addShaderToList(shaders, alertShaders.blueShaders[i]);
addShaderToList(shaders, alertShaders.greenShaders[i]);
addShaderToList(shaders, alertShaders.redShaders[i]);
addShaderToList(shaders, alertShaders.yellowShaders[i]);
}
for(i = 0; i < MAX_GENTITIES; i++) {
if(!g_entities[i].inuse) continue;
if(g_entities[i].classname != NULL && !strcmp(g_entities[i].classname, "target_turbolift")) {
if(g_entities[i].falsename != NULL && g_entities[i].falsename[0] != 0) {
addShaderToList(shaders, g_entities[i].falsename);
}
if(g_entities[i].truename != NULL && g_entities[i].truename[0] != 0) {
addShaderToList(shaders, g_entities[i].truename);
}
continue;
}
if(g_entities[i].targetShaderNewName != NULL && g_entities[i].targetShaderNewName[0] != 0) {
addShaderToList(shaders, g_entities[i].targetShaderNewName);
}
}
iter = list_iterator(shaders, FRONT);
if(iter == NULL) {
trap_FS_FCloseFile(f);
destroy_list(shaders);
return;
}
for(s = (rShader_s *)list_next(iter); s != NULL; s = (rShader_s *)list_next(iter)) {
G_Printf("\t%s\n", s->s);
if(first) {
trap_FS_Write("\"", 1, f);
trap_FS_Write(s->s, strlen(s->s), f);
trap_FS_Write("\"", 1, f);
first = qfalse;
} else {
trap_FS_Write("\n\"", 2, f);
trap_FS_Write(s->s, strlen(s->s), f);
trap_FS_Write("\"", 1, f);
}
}
trap_FS_Write("\n\"END\"", 6, f);
G_Printf("Done.\n");
if(shaders != NULL) {
destroy_list(shaders);
}
trap_FS_FCloseFile(f);
}
/*
=================
G_Client_Command
@ -7625,6 +7723,9 @@ void G_Client_Command( int clientNum )
else if (Q_stricmp(cmd, "camtestend") == 0)
Cmd_CamtestEnd_f(ent);
// END CCAM
else if (Q_stricmp (cmd, "generatePrecacheFile") == 0) {
Cmd_GeneratePrecacheFile(ent);
}
else if (Q_strncmp (cmd, "\n", 1) == 0 || Q_strncmp (cmd, " ", 1) == 0 || Q_strncmp (cmd, "\0", 1) == 0) // sorry
(void)(0);
else

View file

@ -884,13 +884,14 @@ void SP_fx_electrical_explosion( gentity_t *ent )
trap_LinkEntity( ent );
}
/*QUAKED fx_phaser (0 0 1) (-8 -8 -8) (8 8 8) NO_SOUND DISRUPTOR
/*QUAKED fx_phaser (0 0 1) (-8 -8 -8) (8 8 8) NO_SOUND DISRUPTOR LOCKED
-----DESCRIPTION-----
A phaser effect for use as a ship's weapon.
-----SPAWNFLAGS-----
1: NO_SOUND - will not play it's sound
2: DISRUPTOR - will display a green disruptor beam
4: LOCKED - will be locked at spawn
-----KEYS-----
"target" - endpoint
@ -903,8 +904,9 @@ A phaser effect for use as a ship's weapon.
#define PHASER_FX_UNLINKED 999
void phaser_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
if(ent->count == PHASER_FX_UNLINKED)
return;
if(ent->count == PHASER_FX_UNLINKED) return;
if(ent->flags & FL_LOCKED) return;
if(ent->spawnflags & 2)
{
G_AddEvent(ent, EV_FX_DISRUPTOR, 0);
@ -919,11 +921,13 @@ void phaser_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
void phaser_link(gentity_t *ent) {
gentity_t *target = NULL;
target = G_Find(target, FOFS(targetname), ent->target);
if(!target) {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Enity-Error] Could not find target %s for fx_phaser at %s!\n", ent->target, vtos(ent->r.currentOrigin)););
G_FreeEntity(ent);
return;
}
VectorCopy(target->s.origin, ent->s.origin2);
SnapVector(ent->s.origin2);
ent->use = phaser_use;
@ -936,23 +940,34 @@ void SP_fx_phaser(gentity_t *ent) {
char *sound;
int impact;
ent->count = PHASER_FX_UNLINKED;
if(!ent->target) {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] fx_phaser at %s without target!\n", vtos(ent->r.currentOrigin)););
return;
}
G_SpawnFloat("scale", "20", &scale);
ent->s.angles[0] = scale;
G_SpawnFloat("delay", "1", &scale);
ent->s.angles[1] = scale * 1000;
G_SpawnString("customSnd", "sound/pos_b/phaser.wav", &sound);
if(!(ent->spawnflags & 1))
if(!(ent->spawnflags & 1)) {
ent->s.time = G_SoundIndex(sound);
else
} else {
ent->s.time = G_SoundIndex("NULL");
if(ent->wait)
}
if(ent->wait) {
ent->s.time2 = ent->wait * 1000;
else
} else {
ent->s.time2 = 3000;
}
if(ent->spawnflags & 4) {
ent->flags |= FL_LOCKED;
}
G_SpawnInt("impact", "0", & impact);
ent->s.angles[2] = impact;
ent->think = phaser_link;
@ -960,13 +975,14 @@ void SP_fx_phaser(gentity_t *ent) {
trap_LinkEntity(ent);
}
/*QUAKED fx_torpedo (0 0 1) (-8 -8 -8) (8 8 8) QUANTUM NO_SOUND
/*QUAKED fx_torpedo (0 0 1) (-8 -8 -8) (8 8 8) QUANTUM NO_SOUND LOCKED
-----DESCRIPTION-----
A torpedo effect for use as a ship's weapon.
-----SPAWNFLAGS-----
1: QUANTUM - set this flag if you whant an quantum fx instead of an photon fx
2: NO_SOUND - Will not play it's sound
4: LOCKED - will be locked at spawn
-----KEYS-----
"target" - used for the calculation of the direction
@ -984,6 +1000,8 @@ void fx_torpedo_think(gentity_t *ent) {
}
void fx_torpedo_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
if(ent->flags & FL_LOCKED) return;
if(ent->count > 0) {
ent->count--;
trap_SendServerCommand(activator-g_entities, va("print \"Torpedos: %i of %i left.\n\"", ent->count, ent->damage));
@ -993,6 +1011,7 @@ void fx_torpedo_use(gentity_t *ent, gentity_t *other, gentity_t *activator) {
G_AddEvent(ent, EV_GENERAL_SOUND, ent->n00bCount);
return;
}
G_AddEvent(ent, EV_FX_TORPEDO, ent->spawnflags);
ent->use = 0;
ent->think = fx_torpedo_think;
@ -1024,6 +1043,10 @@ void fx_torpedo_link(gentity_t *ent) {
ent->damage = ent->count;
}
if(ent->spawnflags & 4) {
ent->flags |= FL_LOCKED;
}
ent->s.angles2[0] = ent->speed ? ent->speed : 2.5;
ent->use = fx_torpedo_use;

View file

@ -697,6 +697,9 @@ typedef struct {
list_p selfdestructSafeZones;
list_p locations;
list_p timedMessages;
// override rpg_calcLiftTravelDuration
int overrideCalcLiftTravelDuration;
} level_locals_t;
@ -1250,14 +1253,6 @@ void QDECL G_LogExit( const char *string );
*/
void QDECL G_ClearClientLog(int client);
void CalculateAwards(gentity_t *ent, char *msg);
qboolean CalculateTeamMVPByRank(gentity_t *ent);
int GetMaxDeathsForClient(int nClient);
int GetMaxKillsForClient(int nClient);
int GetFavoriteTargetForClient(int nClient);
int GetWorstEnemyForClient(int nClient);
int GetFavoriteWeaponForClient(int nClient);
/*----------------------------------------------------------------------------------------*/
//TiM - Delayed Transport Beam
@ -2107,4 +2102,13 @@ struct timedMessage_s {
char* message;
} timedMessage_s;
/* alert shaders */
typedef struct {
char *greenShaders[10];
char *redShaders[10];
char *yellowShaders[10];
char *blueShaders[10];
int numShaders;
} target_alert_Shaders_s;
#endif //_G_LOCAL_H_

View file

@ -912,721 +912,6 @@ void G_LogWeaponOutput(void)
#endif //LOGGING_WEAPONS
}
// did this player earn the sharpshooter award?
qboolean CalculateSharpshooter(gentity_t *ent, int *frags)
{
#ifdef LOGGING_WEAPONS
int i = 0, nBestPlayer = -1, nKills = 0, nMostKills = 0,
playTime = (level.time - ent->client->pers.enterTime)/60000;
gentity_t *player = NULL;
// if this guy didn't get one kill per minute, reject him right now
if ( ((float)(G_WeaponLogKills[ent-g_entities][MOD_CRIFLE_ALT]))/((float)(playTime)) < 1.0 )
{
return qfalse;
}
for (i = 0; i < g_maxclients.integer; i++)
{
nKills = 0;
player = g_entities + i;
if (!player->inuse)
continue;
nKills = G_WeaponLogKills[i][MOD_CRIFLE_ALT];
if (nKills > nMostKills)
{
nMostKills = nKills;
nBestPlayer = i;
}
}
if (-1 == nBestPlayer)
{
return qfalse;
}
if (nBestPlayer == ent->s.number)
{
*frags = nMostKills;
return qtrue;
}
#endif // LOGGING_WEAPONS
return qfalse;
}
// did this player earn the untouchable award?
qboolean CalculateUntouchable(gentity_t *ent)
{
#ifdef LOGGING_WEAPONS
int playTime;
playTime = (level.time - ent->client->pers.enterTime)/60000;
//------------------------------------------------------ MUST HAVE ACHIEVED 2 KILLS PER MINUTE
if ( ((float)ent->client->pers.teamState.frags)/((float)(playTime)) < 2.0 || playTime==0)
return qfalse;
//------------------------------------------------------ MUST HAVE ACHIEVED 2 KILLS PER MINUTE
// if this guy was never killed... Award Away!!!
if (ent->client->ps.persistant[PERS_KILLED]==0)
return qtrue;
#endif // LOGGING_WEAPONS
return qfalse;
}
// did this player earn the logistics award?
qboolean CalculateLogistics(gentity_t *ent, int *stuffUsed)
{
#ifdef LOGGING_WEAPONS
int i = 0, j = 0, nBestPlayer = -1, nStuffUsed = 0, nMostStuffUsed = 0,
nDifferent = 0, nMostDifferent = 0;
gentity_t *player = NULL;
for (i = 0; i < g_maxclients.integer; i++)
{
nStuffUsed = 0;
nDifferent = 0;
player = g_entities + i;
if (!player->inuse)
continue;
for (j = HI_NONE+1; j < HI_NUM_HOLDABLE; j++)
{
if (G_WeaponLogPowerups[i][j])
{
nDifferent++;
}
nStuffUsed += G_WeaponLogPowerups[i][j];
}
for (j = PW_NONE+1; j < PW_NUM_POWERUPS; j++)
{
if (G_WeaponLogItems[i][j])
{
nDifferent++;
}
nStuffUsed += G_WeaponLogItems[i][j];
}
if ( (nDifferent >= 4) && (nDifferent >= nMostDifferent) )
{
if (nStuffUsed > nMostStuffUsed)
{
nMostDifferent = nDifferent;
nMostStuffUsed = nStuffUsed;
nBestPlayer = i;
}
}
}
if (-1 == nBestPlayer)
{
return qfalse;
}
if (nBestPlayer == ent->s.number)
{
*stuffUsed = nMostDifferent;
return qtrue;
}
#endif // LOGGING_WEAPONS
return qfalse;
}
// did this player earn the tactician award?
qboolean CalculateTactician(gentity_t *ent, int *kills)
{
#ifdef LOGGING_WEAPONS
int i = 0, nBestPlayer = -1, nKills = 0, nMostKills = 0;
int person = 0, weapon = 0;
gentity_t *player = NULL;
int wasPickedUpBySomeone[WP_NUM_WEAPONS];
int killsWithWeapon[WP_NUM_WEAPONS];
int playTime = (level.time - ent->client->pers.enterTime)/60000;
//------------------------------------------------------ MUST HAVE ACHIEVED 2 KILLS PER MINUTE
if (playTime<0.3)
return qfalse;
if ( ((float)ent->client->pers.teamState.frags)/((float)(playTime)) < 2.0 )
return qfalse;
//------------------------------------------------------ MUST HAVE ACHIEVED 2 KILLS PER MINUTE
//------------------------------------------------------ FOR EVERY WEAPON, ADD UP TOTAL PICKUPS
for (weapon = 0; weapon<WP_NUM_WEAPONS; weapon++)
wasPickedUpBySomeone[weapon] = 0; // CLEAR
for (person=0; person<g_maxclients.integer; person++)
{
for (weapon = 0; weapon<WP_NUM_WEAPONS; weapon++)
{
if (G_WeaponLogPickups[person][weapon]>0)
wasPickedUpBySomeone[weapon]++;
}
}
//------------------------------------------------------ FOR EVERY WEAPON, ADD UP TOTAL PICKUPS
//------------------------------------------------------ FOR EVERY PERSON, CHECK FOR CANDIDATE
for (person=0; person<g_maxclients.integer; person++)
{
player = g_entities + person;
if (!player->inuse) continue;
nKills = 0; // This Persons's Kills
for (weapon=0; weapon<WP_NUM_WEAPONS; weapon++)
killsWithWeapon[weapon] = 0; // CLEAR
for (i=0; i<MOD_MAX; i++)
{
weapon = weaponFromMOD[i]; // Select Weapon
killsWithWeapon[weapon] += G_WeaponLogKills[person][i]; // Store Num Kills With Weapon
}
weapon=WP_5; // Start At Phaser
// keep looking through weapons if weapon is not on map, or if it is and we used it
while( weapon<WP_NUM_WEAPONS && (!wasPickedUpBySomeone[weapon] || killsWithWeapon[weapon]>0) )
{
weapon++;
if(weapon>=WP_NUM_WEAPONS) {
break;
}
nKills+=killsWithWeapon[weapon]; // Update the number of kills
}
//
// At this point we have either successfully gone through every weapon on the map and saw it had
// been used, or we found one that WAS on the map and was NOT used
//
// so we look to see if the weapon==Max (i.e. we used every one) and then we check to see
// if we got the most kills out of anyone else who did this.
//
if (weapon>=WP_NUM_WEAPONS && nKills>nMostKills)
{
// WE ARE A TACTICION CANDIDATE
nMostKills = nKills;
nBestPlayer = person;
}
}
//------------------------------------------------------ FOR EVERY PERSON, CHECK FOR CANDIDATE
//Now, if we are the best player, return true and the number of kills we got
if (nBestPlayer == ent->s.number)
{
*kills = nMostKills;
return qtrue;
}
#endif // LOGGING_WEAPONS
return qfalse;
}
// did this player earn the demolitionist award?
qboolean CalculateDemolitionist(gentity_t *ent, int *kills)
{
#ifdef LOGGING_WEAPONS
int i = 0, nBestPlayer = -1, nKills = 0, nMostKills = 0,
playTime = (level.time - ent->client->pers.enterTime)/60000;
gentity_t *player = NULL;
for (i = 0; i < g_maxclients.integer; i++)
{
nKills = 0;
player = g_entities + i;
if (!player->inuse)
continue;
nKills = G_WeaponLogKills[i][MOD_GRENADE];
nKills += G_WeaponLogKills[i][MOD_GRENADE_SPLASH];
nKills += G_WeaponLogKills[i][MOD_GRENADE_ALT_SPLASH];
nKills += G_WeaponLogKills[i][MOD_QUANTUM];
nKills += G_WeaponLogKills[i][MOD_QUANTUM_SPLASH];
nKills += G_WeaponLogKills[i][MOD_QUANTUM_ALT];
nKills += G_WeaponLogKills[i][MOD_QUANTUM_ALT_SPLASH];
nKills += G_WeaponLogKills[i][MOD_DETPACK];
// if this guy didn't get two explosive kills per minute, reject him right now
if ( ((float)nKills)/((float)(playTime)) < 2.0 )
{
continue;
}
if (nKills > nMostKills)
{
nMostKills = nKills;
nBestPlayer = i;
}
}
if (-1 == nBestPlayer)
{
return qfalse;
}
if (nBestPlayer == ent->s.number)
{
*kills = nMostKills;
return qtrue;
}
#endif // LOGGING_WEAPONS
return qfalse;
}
int CalculateStreak(gentity_t *ent)
{
/* TODO: remove me */
return 0;
}
qboolean CalculateTeamMVP(gentity_t *ent)
{
int i = 0, nBestPlayer = -1, nScore = 0, nHighestScore = 0,
team = ent->client->ps.persistant[PERS_TEAM];
gentity_t *player = NULL;
for (i = 0; i < g_maxclients.integer; i++)
{
nScore = 0;
player = g_entities + i;
if (!player->inuse || (player->client->ps.persistant[PERS_TEAM] != team))
continue;
nScore = player->client->ps.persistant[PERS_SCORE];
if (nScore > nHighestScore)
{
nHighestScore = nScore;
nBestPlayer = i;
}
}
if (-1 == nBestPlayer)
{
return qfalse;
}
if (nBestPlayer == ent->s.number)
{
return qtrue;
}
return qfalse;
}
qboolean CalculateTeamMVPByRank(gentity_t *ent)
{
playerState_t *ps = &ent->client->ps;
int i = 0, nBestPlayer = -1, nScore = 0, nHighestScore = 0,
team = ps->persistant[PERS_RANK]+1;
qboolean bTied = (qboolean)(team == 3);
gentity_t *player = NULL;
for (i = 0; i < g_maxclients.integer; i++)
{
nScore = 0;
player = g_entities + i;
if (!player->inuse)
continue;
if (!bTied)
{
if (ps->persistant[PERS_TEAM] != team)
{
continue;
}
}
nScore = ps->persistant[PERS_SCORE];
if (nScore > nHighestScore)
{
nHighestScore = nScore;
nBestPlayer = i;
}
}
if (-1 == nBestPlayer)
{
return qfalse;
}
if (nBestPlayer == ent->s.number)
{
return qtrue;
}
return qfalse;
}
qboolean CalculateTeamDefender(gentity_t *ent)
{
int i = 0, nBestPlayer = -1, nScore = 0, nHighestScore = 0,
team = ent->client->ps.persistant[PERS_TEAM];
gentity_t *player = NULL;
for (i = 0; i < g_maxclients.integer; i++)
{
nScore = 0;
player = g_entities + i;
if (!player->inuse || (player->client->ps.persistant[PERS_TEAM] != team))
continue;
nScore = player->client->pers.teamState.basedefense;
if (nScore > nHighestScore)
{
nHighestScore = nScore;
nBestPlayer = i;
}
}
if (-1 == nBestPlayer)
{
return qfalse;
}
if (nBestPlayer == ent->s.number)
{
return qtrue;
}
return qfalse;
}
qboolean CalculateTeamWarrior(gentity_t *ent)
{
int i = 0, nBestPlayer = -1, nScore = 0, nHighestScore = 0,
team = ent->client->ps.persistant[PERS_TEAM];
gentity_t *player = NULL;
for (i = 0; i < g_maxclients.integer; i++)
{
nScore = 0;
player = g_entities + i;
if (!player->inuse || (player->client->ps.persistant[PERS_TEAM] != team))
continue;
nScore = player->client->pers.teamState.frags;
if (nScore > nHighestScore)
{
nHighestScore = nScore;
nBestPlayer = i;
}
}
if (-1 == nBestPlayer)
{
return qfalse;
}
if (nBestPlayer == ent->s.number)
{
return qtrue;
}
return qfalse;
}
qboolean CalculateTeamCarrier(gentity_t *ent)
{
int i = 0, nBestPlayer = -1, nScore = 0, nHighestScore = 0,
team = ent->client->ps.persistant[PERS_TEAM];
gentity_t *player = NULL;
for (i = 0; i < g_maxclients.integer; i++)
{
nScore = 0;
player = g_entities + i;
if (!player->inuse || (player->client->ps.persistant[PERS_TEAM] != team))
continue;
nScore = player->client->pers.teamState.captures;
if (nScore > nHighestScore)
{
nHighestScore = nScore;
nBestPlayer = i;
}
}
if (-1 == nBestPlayer)
{
return qfalse;
}
if (nBestPlayer == ent->s.number)
{
return qtrue;
}
return qfalse;
}
qboolean CalculateTeamInterceptor(gentity_t *ent)
{
int i = 0, nBestPlayer = -1, nScore = 0, nHighestScore = 0,
team = ent->client->ps.persistant[PERS_TEAM];
gentity_t *player = NULL;
for (i = 0; i < g_maxclients.integer; i++)
{
nScore = 0;
player = g_entities + i;
if (!player->inuse || (player->client->ps.persistant[PERS_TEAM] != team))
continue;
nScore = player->client->pers.teamState.flagrecovery;
nScore += player->client->pers.teamState.fragcarrier;
if (nScore > nHighestScore)
{
nHighestScore = nScore;
nBestPlayer = i;
}
}
if (-1 == nBestPlayer)
{
return qfalse;
}
if (nBestPlayer == ent->s.number)
{
return qtrue;
}
return qfalse;
}
qboolean CalculateTeamRedShirt(gentity_t *ent)
{
int i = 0, nBestPlayer = -1, nScore = 0, nHighestScore = 0,
team = ent->client->ps.persistant[PERS_TEAM];
gentity_t *player = NULL;
for (i = 0; i < g_maxclients.integer; i++)
{
nScore = 0;
player = g_entities + i;
if (!player->inuse || (player->client->ps.persistant[PERS_TEAM] != team))
continue;
nScore = player->client->ps.persistant[PERS_KILLED];
nScore -= player->client->pers.teamState.suicides; // suicides don't count, you big cheater.
if (nScore > nHighestScore)
{
nHighestScore = nScore;
nBestPlayer = i;
}
}
if (-1 == nBestPlayer)
{
return qfalse;
}
if (nBestPlayer == ent->s.number)
{
return qtrue;
}
return qfalse;
}
int CalculateTeamAward(gentity_t *ent)
{
int teamAwards = 0;
if (CalculateTeamMVP(ent))
{
teamAwards |= (1<<TEAM_MVP);
}
if (GT_CTF == g_gametype.integer)
{
if (CalculateTeamDefender(ent))
{
teamAwards |= (1<<TEAM_DEFENDER);
}
if (CalculateTeamWarrior(ent))
{
teamAwards |= (1<<TEAM_WARRIOR);
}
if (CalculateTeamCarrier(ent))
{
teamAwards |= (1<<TEAM_CARRIER);
}
if (CalculateTeamInterceptor(ent))
{
teamAwards |= (1<<TEAM_INTERCEPTOR);
}
}
if ( !teamAwards && CalculateTeamRedShirt(ent) )
{//if you got nothing else and died a lot, at least get bravery
teamAwards |= (1<<TEAM_BRAVERY);
}
return teamAwards;
}
qboolean CalculateSection31Award(gentity_t *ent)
{
int i = 0;
gentity_t *player = NULL;
for (i = 0; i < g_maxclients.integer; i++)
{
player = g_entities + i;
if (!player->inuse)
continue;
return qtrue;
}
return qfalse;
}
void CalculateAwards(gentity_t *ent, char *msg)
{
#ifdef LOGGING_WEAPONS
char buf1[AWARDS_MSG_LENGTH], buf2[AWARDS_MSG_LENGTH];
int awardFlags = 0, stuffUsed = 0, kills = 0, streak = 0, teamAwards = 0;
memset(buf1, 0, AWARDS_MSG_LENGTH);
memset(buf2, 0, AWARDS_MSG_LENGTH);
if (CalculateSharpshooter(ent, &kills))
{
awardFlags |= (1<<AWARD_SHARPSHOOTER);
strcpy(buf2, buf1);
Com_sprintf(buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, kills);
}
if (CalculateUntouchable(ent))
{
awardFlags |= (1<<AWARD_UNTOUCHABLE);
strcpy(buf2, buf1);
Com_sprintf(buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, 0);
}
if (CalculateLogistics(ent, &stuffUsed))
{
awardFlags |= (1<<AWARD_LOGISTICS);
strcpy(buf2, buf1);
Com_sprintf(buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, stuffUsed);
}
if (CalculateTactician(ent, &kills))
{
awardFlags |= (1<<AWARD_TACTICIAN);
strcpy(buf2, buf1);
Com_sprintf(buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, kills);
}
if (CalculateDemolitionist(ent, &kills))
{
awardFlags |= (1<<AWARD_DEMOLITIONIST);
strcpy(buf2, buf1);
Com_sprintf(buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, kills);
}
streak = CalculateStreak(ent);
if (streak)
{
awardFlags |= (1<<AWARD_STREAK);
strcpy(buf2, buf1);
Com_sprintf(buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, streak);
}
if (g_gametype.integer >= GT_TEAM)
{
teamAwards = CalculateTeamAward(ent);
if (teamAwards)
{
awardFlags |= (1<<AWARD_TEAM);
strcpy(buf2, buf1);
Com_sprintf(buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, teamAwards);
}
}
if (CalculateSection31Award(ent))
{
awardFlags |= (1<<AWARD_SECTION31);
strcpy(buf2, buf1);
Com_sprintf(buf1, AWARDS_MSG_LENGTH, "%s %d", buf2, 0);
}
Q_strncpyz(buf2, msg, sizeof(buf2));
Com_sprintf( msg, AWARDS_MSG_LENGTH, "%s %d%s", buf2, awardFlags, buf1);
#endif // LOGGING_WEAPONS
}
int GetMaxDeathsForClient(int nClient)
{
int i = 0, nMostDeaths = 0;
if ((nClient < 0) || (nClient >= MAX_CLIENTS))
{
return 0;
}
for (i = 0; i < MAX_CLIENTS; i++)
{
if (G_WeaponLogFrags[i][nClient] > nMostDeaths)
{
nMostDeaths = G_WeaponLogFrags[i][nClient];
}
}
return nMostDeaths;
}
int GetMaxKillsForClient(int nClient)
{
int i = 0, nMostKills = 0;
if ((nClient < 0) || (nClient >= MAX_CLIENTS))
{
return 0;
}
for (i = 0; i < MAX_CLIENTS; i++)
{
if (G_WeaponLogFrags[nClient][i] > nMostKills)
{
nMostKills = G_WeaponLogFrags[nClient][i];
}
}
return nMostKills;
}
int GetFavoriteTargetForClient(int nClient)
{
int i = 0, nMostKills = 0, nFavoriteTarget = -1;
if ((nClient < 0) || (nClient >= MAX_CLIENTS))
{
return 0;
}
for (i = 0; i < MAX_CLIENTS; i++)
{
if (G_WeaponLogFrags[nClient][i] > nMostKills)
{
nMostKills = G_WeaponLogFrags[nClient][i];
nFavoriteTarget = i;
}
}
return nFavoriteTarget;
}
int GetWorstEnemyForClient(int nClient)
{
int i = 0, nMostDeaths = 0, nWorstEnemy = -1;
if ((nClient < 0) || (nClient >= MAX_CLIENTS))
{
return 0;
}
for (i = 0; i < MAX_CLIENTS; i++)
{
// If there is a tie for most deaths, we want to choose anybody else
// over the client... I.E. Most deaths should not tie with yourself and
// have yourself show up...
if ( G_WeaponLogFrags[i][nClient] > nMostDeaths ||
(G_WeaponLogFrags[i][nClient]== nMostDeaths && i!=nClient && nMostDeaths!=0) )
{
nMostDeaths = G_WeaponLogFrags[i][nClient];
nWorstEnemy = i;
}
}
return nWorstEnemy;
}
int GetFavoriteWeaponForClient(int nClient)
{
int i = 0, nMostKills = 0, fav=0, weapon=WP_5;
int killsWithWeapon[WP_NUM_WEAPONS];
// First thing we need to do is cycle through all the MOD types and convert
// number of kills to a single weapon.
//----------------------------------------------------------------
for (weapon=0; weapon<WP_NUM_WEAPONS; weapon++)
killsWithWeapon[weapon] = 0; // CLEAR
for (i=MOD_PHASER; i<=MOD_BORG_ALT; i++)
{
weapon = weaponFromMOD[i]; // Select Weapon
killsWithWeapon[weapon] += G_WeaponLogKills[nClient][i]; // Store Num Kills With Weapon
}
// now look through our list of kills per weapon and pick the biggest
//----------------------------------------------------------------
nMostKills=0;
for (weapon=WP_5; weapon<WP_NUM_WEAPONS; weapon++)
{
if (killsWithWeapon[weapon]>nMostKills)
{
nMostKills = killsWithWeapon[weapon];
fav = weapon;
}
}
return fav;
}
// kef -- if a client leaves the game, clear out all counters he may have set
void QDECL G_ClearClientLog(int client)
{

View file

@ -459,7 +459,7 @@ static cvarTable_t gameCvarTable[] = {
{ &rpg_forceFieldColor, "rpg_forceFieldColor", "0", CVAR_ARCHIVE, 0, qfalse },
{ &rpg_allowRemodulation, "rpg_allowRemodulation", "1", CVAR_ARCHIVE, 0, qfalse },
{ &rpg_forceFieldFreq, "rpg_forceFieldFreq", "0", CVAR_ARCHIVE, 0, qfalse },
{ &rpg_calcLiftTravelDuration, "rpg_calcLiftTravelDuration", "0", CVAR_ARCHIVE, 0, qfalse },
{ &rpg_calcLiftTravelDuration, "rpg_calcLiftTravelDuration", "1", CVAR_ARCHIVE, 0, qfalse },
{ &rpg_liftDurationModifier, "rpg_liftDurationModifier" , "0.5", CVAR_ARCHIVE, 0, qfalse },
{ &rpg_altTricorderDelay, "rpg_altTricorderDelay", "1000", CVAR_ARCHIVE, 0, qfalse },
{ &rpg_borgMoveThroughFields, "rpg_borgMoveThroughFields", "0", CVAR_ARCHIVE, 0, qfalse },
@ -605,25 +605,36 @@ void QDECL G_Error( const char *fmt, ... ) {
}
stringID_table_t WeaponTable[] = {
{ ENUM2STRING(WP_2) },
{ ENUM2STRING(WP_3) },
{ ENUM2STRING(WP_4) },
{ ENUM2STRING(WP_5) },
{ ENUM2STRING(WP_6) },
{ ENUM2STRING(WP_7) },
{ ENUM2STRING(WP_8) },
{ ENUM2STRING(WP_9) },
{ ENUM2STRING(WP_10) },
{ ENUM2STRING(WP_11) },
{ ENUM2STRING(WP_12) },
{ ENUM2STRING(WP_13) },
{ ENUM2STRING(WP_14) },
{ ENUM2STRING(WP_15) },
{ "WP_TRICORDER", WP_2 },
{ "WP_PADD", WP_3 },
{ "WP_COFFEE", WP_4 },
{ "WP_PHASER", WP_5 },
{ "WP_COMPRESSION_RIFLE", WP_6 },
{ "WP_TR116", WP_7 },
{ "WP_GRENADE_LAUNCHER", WP_8 },
{ "WP_QUANTUM_BURST", WP_9 },
{ "WP_DISRUPTOR", WP_10 },
{ "WP_MEDKIT", WP_11 },
{ "WP_VOYAGER_HYPO", WP_12 },
{ "WP_DERMAL_REGEN", WP_13 },
{ "WP_TOOLKIT", WP_14 },
{ "WP_HYPERSPANNER", WP_15 },
{ NULL, -1 }
};
@ -963,17 +974,16 @@ static void G_LoadTimedMessages(void) {
}
msg->message = strdup(token);
G_Printf("------------------------------------------------>'%s'\n", token);
list_add(level.timedMessages, msg, sizeof(timedMessage_s));
} else {
if(token[0] == '}') {
break;
}
G_Printf("G_LoadTimedMessages - invalid token '%s'\n", token);
SkipRestOfLine(&textPtr);
continue;
}
if(token[0] == '}') {
break;
}
}
trap_FS_FCloseFile(f);
@ -1734,6 +1744,8 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
G_Printf ("gamename: %s\n", GAMEVERSION);
G_Printf ("gamedate: %s\n", __DATE__);
level.overrideCalcLiftTravelDuration = 0;
init_tonextint(qtrue);
srand( randomSeed );

View file

@ -1133,7 +1133,7 @@ static void target_turbolift_endMove ( gentity_t *ent )
}
// check for shader remaps
if(rpg_calcLiftTravelDuration.integer) {
if(rpg_calcLiftTravelDuration.integer || level.overrideCalcLiftTravelDuration) {
if((ent->truename && otherLift->truename) || (ent->falsename && otherLift->falsename)) {
f = level.time * 0.001;
AddRemap(ent->targetShaderName, ent->targetShaderName, f);
@ -1403,7 +1403,7 @@ static void target_turbolift_startMove ( gentity_t *ent )
}
// check for shader remaps
if(rpg_calcLiftTravelDuration.integer) {
if(rpg_calcLiftTravelDuration.integer || level.overrideCalcLiftTravelDuration) {
if(time2 < 0 && ent->truename && otherLift->truename) {
f = level.time * 0.001;
AddRemap(ent->targetShaderName, ent->truename, f);
@ -1540,7 +1540,7 @@ static void target_turbolift_use( gentity_t *self, gentity_t *other, gentity_t *
return;
}
trap_SendServerCommand( activator-g_entities, "lift" );
trap_SendServerCommand( activator-g_entities, va("lift %d", self->health) );
}
extern void BG_LanguageFilename(char *baseName,char *baseExtension,char *finalName);
@ -1578,6 +1578,7 @@ For the angles, the entity's angle must be aimed at the main set of doors to the
"targetShaderName" - lights off shader
"falsename" - lights up
"truename" - lights down
"override" - if set to 1 overrides rpg_calcLiftTravelDuration
-----LUA-----
Retrofit:
@ -1676,6 +1677,11 @@ void SP_target_turbolift ( gentity_t *self )
G_SpawnFloat( "wait", "3000", &self->wait );
G_SpawnInt( "waitEnd", "1000", &self->sound1to2 );
G_SpawnInt("override", "0", &i);
if(i) {
level.overrideCalcLiftTravelDuration = i;
}
if(!self->tmpEntity)
trap_SetBrushModel( self, self->model );
self->r.contents = CONTENTS_TRIGGER; // replaces the -1 from trap_SetBrushModel
@ -1852,15 +1858,8 @@ shader remapping:
You can remap multiple shaders by separating them with \n.
Example: "greenshader" "textures/alert/green1\ntextures/alert/green2"
*/
typedef struct {
char *greenShaders[10];
char *redShaders[10];
char *yellowShaders[10];
char *blueShaders[10];
int numShaders;
} target_alert_Shaders_s;
static target_alert_Shaders_s alertShaders;
target_alert_Shaders_s alertShaders;
void target_alert_remapShaders(int target_condition) {
float f = 0;

120
ui/ui_sql.c Normal file
View file

@ -0,0 +1,120 @@
/**********************************************************************
UI_sql.C
User interface trigger from within game
**********************************************************************/
#include "ui_local.h"
typedef struct {
menuframework_s menu;
char *username;
char *password;
} sql_t;
sql_t s_sql;
#define ID_QUIT 10
#define ID_LOGIN 11
/*
=================
M_sql_Event
=================
*/
static void M_sql_Event(void *ptr, int notification) {
int id;
id = ((menucommon_s*)ptr)->id;
switch (id)
{
case ID_QUIT:
if(notification == QM_ACTIVATED) {
UI_PopMenu();
}
break;
case ID_LOGIN:
if(notification == QM_ACTIVATED) {
// do login
}
break;
default:
break;
}
}
/*
=================
sqlMenu_Key
=================
*/
sfxHandle_t sqlMenu_Key (int key)
{
return ( Menu_DefaultKey( &s_sql.menu, key ) );
}
extern qhandle_t leftRound;
extern qhandle_t corner_ul_24_60;
extern qhandle_t corner_ll_12_60;
/*
=================
M_sqlMenu_Graphics
=================
*/
static void M_sqlMenu_Graphics (void)
{
// TODO
}
/*
===============
UI_sqlMenu_Cache
===============
*/
void UI_sqlMenu_Cache (void)
{
leftRound = trap_R_RegisterShaderNoMip("menu/common/halfroundl_24.tga");
corner_ul_24_60 = trap_R_RegisterShaderNoMip("menu/common/corner_ul_24_60.tga");
corner_ll_12_60 = trap_R_RegisterShaderNoMip("menu/common/corner_ll_12_60.tga");
}
/*
===============
msdMenu_Init
===============
*/
void sqlMenu_Init(void)
{
/*s_sql.menu.nitems = 0;
s_sql.menu.draw = sqlMenu_Draw;
s_sql.menu.key = sqlMenu_Key;
s_sql.menu.wrapAround = qtrue;
s_sql.menu.descX = MENU_DESC_X;
s_sql.menu.descY = MENU_DESC_Y;
s_sql.menu.titleX = MENU_TITLE_X;
s_sql.menu.titleY = MENU_TITLE_Y;
s_sql.quitmenu.generic.type = MTYPE_BITMAP;
s_sql.quitmenu.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_sql.quitmenu.generic.x = 490;
s_sql.quitmenu.generic.y = 380;
s_sql.quitmenu.generic.name = GRAPHIC_BUTTONLEFT;
s_sql.quitmenu.generic.id = ID_QUIT;
s_sql.quitmenu.generic.callback = M_sql_Event;
s_sql.quitmenu.width = MENU_BUTTON_MED_WIDTH-20;
s_sql.quitmenu.height = PROP_BIG_HEIGHT;
s_sql.quitmenu.color = CT_DKPURPLE1;
s_sql.quitmenu.color2 = CT_LTPURPLE1;
s_sql.quitmenu.textX = MENU_BUTTON_TEXT_X;
s_sql.quitmenu.textY = 12;
s_sql.quitmenu.textEnum = MBT_RETURNMENU;
s_sql.quitmenu.textcolor = CT_BLACK;
s_sql.quitmenu.textcolor2 = CT_WHITE;
s_sql.quitmenu.textStyle = UI_TINYFONT;
Menu_AddItem( &s_sql.menu, &s_sql.quitmenu );*/
}