summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2002-09-16 01:24:12 +0000
committerTim Angus <tim@ngus.net>2002-09-16 01:24:12 +0000
commit8ecf6d9e5d2a03e965647ac264940f8cd34eef0a (patch)
tree579d5c88e7d3d3b767e39d3cdd3e40ebc974bf75 /src/cgame
parenteb401f8e27491f048ca0095a3e2f984e2e3a151b (diff)
* Added global header tremulous.h in preparation for balancing
* Constants propogated throughout the source * Various random fixes and tweaks
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_drawtools.c2
-rw-r--r--src/cgame/cg_ents.c2
-rw-r--r--src/cgame/cg_main.c16
-rw-r--r--src/cgame/cg_predict.c2
-rw-r--r--src/cgame/cg_scanner.c30
-rw-r--r--src/cgame/cg_view.c14
-rw-r--r--src/cgame/cg_weapons.c18
7 files changed, 40 insertions, 44 deletions
diff --git a/src/cgame/cg_drawtools.c b/src/cgame/cg_drawtools.c
index 31f7f2e3..d5df1f42 100644
--- a/src/cgame/cg_drawtools.c
+++ b/src/cgame/cg_drawtools.c
@@ -328,7 +328,7 @@ void CG_GetColorForHealth( int health, int armor, vec4_t hcolor )
}
count = armor;
- max = health * ARMOR_PROTECTION / ( 1.0 - ARMOR_PROTECTION );
+ max = health;
if( max < count )
count = max;
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c
index c4b287aa..deaf9c56 100644
--- a/src/cgame/cg_ents.c
+++ b/src/cgame/cg_ents.c
@@ -292,7 +292,7 @@ static void CG_Missile( centity_t *cent )
RotateAroundDirection( ent.axis, cg.time / 4 );
- fraction = (float)s1->generic1 / (float)LC_TOTAL_CHARGE;
+ fraction = (float)s1->generic1 / (float)LCANON_TOTAL_CHARGE;
VectorScale( ent.axis[ 0 ], fraction, ent.axis[ 0 ] );
VectorScale( ent.axis[ 1 ], fraction, ent.axis[ 1 ] );
VectorScale( ent.axis[ 2 ], fraction, ent.axis[ 2 ] );
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index e19f67d8..e0b4936d 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -564,7 +564,6 @@ called during a precache command
static void CG_RegisterSounds( void )
{
int i;
- char items[ MAX_ITEMS + 1 ];
char name[ MAX_QPATH ];
const char *soundName;
@@ -623,9 +622,6 @@ static void CG_RegisterSounds( void )
cgs.media.footsteps[ FOOTSTEP_METAL ][ i ] = trap_S_RegisterSound( name, qfalse );
}
- // only register the items that the server says we need
- strcpy( items, CG_ConfigString( CS_ITEMS ) );
-
for( i = 1 ; i < MAX_SOUNDS ; i++ )
{
soundName = CG_ConfigString( CS_SOUNDS + i );
@@ -669,7 +665,6 @@ 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 ];
static char *sb_nums[ 11 ] =
{
"gfx/2d/numbers/zero_32b",
@@ -782,9 +777,6 @@ static void CG_RegisterGraphics( void )
memset( cg_weapons, 0, sizeof( cg_weapons ) );
memset( cg_upgrades, 0, sizeof( cg_upgrades ) );
- // only register the items that the server says we need
- strcpy( items, CG_ConfigString( CS_ITEMS) );
-
// wall marks
cgs.media.bulletMarkShader = trap_R_RegisterShader( "gfx/damage/bullet_mrk" );
cgs.media.burnMarkShader = trap_R_RegisterShader( "gfx/damage/burn_med_mrk" );
@@ -1502,6 +1494,12 @@ static void CG_RunCinematicFrame( int handle )
trap_CIN_RunCinematic( handle );
}
+//TA: hack to prevent warning
+static qboolean CG_OwnerDrawVisible( int parameter )
+{
+ return qfalse;
+}
+
/*
=================
CG_LoadHudMenu
@@ -1531,7 +1529,7 @@ void CG_LoadHudMenu( )
cgDC.registerFont = &trap_R_RegisterFont;
cgDC.ownerDrawItem = &CG_OwnerDraw;
cgDC.getValue = &CG_GetValue;
- cgDC.ownerDrawVisible = NULL; //&CG_OwnerDrawVisible;
+ cgDC.ownerDrawVisible = &CG_OwnerDrawVisible;
cgDC.runScript = &CG_RunMenuScript;
cgDC.getTeamColor = &CG_GetTeamColor;
cgDC.setCVar = trap_Cvar_Set;
diff --git a/src/cgame/cg_predict.c b/src/cgame/cg_predict.c
index 6f55f1ce..a8285306 100644
--- a/src/cgame/cg_predict.c
+++ b/src/cgame/cg_predict.c
@@ -414,7 +414,7 @@ void CG_PredictPlayerState( void )
if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR )
cg_pmove.tracemask &= ~CONTENTS_BODY; // spectators can fly through bodies
- cg_pmove.noFootsteps = ( cgs.dmflags & DF_NO_FOOTSTEPS ) > 0;
+ cg_pmove.noFootsteps = 0;
// save the state before the pmove so we can detect transitions
oldPlayerState = cg.predictedPlayerState;
diff --git a/src/cgame/cg_scanner.c b/src/cgame/cg_scanner.c
index 4135eec9..1c730dd7 100644
--- a/src/cgame/cg_scanner.c
+++ b/src/cgame/cg_scanner.c
@@ -13,8 +13,6 @@
#include "cg_local.h"
-#define RANGE 1000.0f
-
#define XPOS 0.0f
#define YPOS 0.0f
#define WIDTH 640.0f
@@ -30,9 +28,9 @@ static void CG_DrawBlips( vec3_t origin, vec4_t colour )
vec3_t up = { 0, 0, 1 };
RotatePointAroundVector( drawOrigin, up, origin, -cg.refdefViewAngles[ 1 ] - 90 );
- drawOrigin[ 0 ] /= ( 2 * RANGE / WIDTH );
- drawOrigin[ 1 ] /= ( 2 * RANGE / HEIGHT );
- drawOrigin[ 2 ] /= ( 2 * RANGE / WIDTH );
+ drawOrigin[ 0 ] /= ( 2 * HELMET_RANGE / WIDTH );
+ drawOrigin[ 1 ] /= ( 2 * HELMET_RANGE / HEIGHT );
+ drawOrigin[ 2 ] /= ( 2 * HELMET_RANGE / WIDTH );
trap_R_SetColor( colour );
@@ -51,7 +49,7 @@ static void CG_DrawBlips( vec3_t origin, vec4_t colour )
trap_R_SetColor( NULL );
}
-#define RANGE2 1000.0f
+#define ALIENSENSE_RANGE 1000.0f
#define XPOS2 20.0f
#define YPOS2 20.0f
@@ -129,7 +127,7 @@ void CG_AlienSense( void )
VectorClear( relOrigin );
VectorSubtract( cg.ep.humanBuildablePos[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < RANGE2 )
+ if( VectorLength( relOrigin ) < ALIENSENSE_RANGE )
CG_DrawDir( relOrigin, buildable );
}
@@ -139,7 +137,7 @@ void CG_AlienSense( void )
VectorClear( relOrigin );
VectorSubtract( cg.ep.humanClientPos[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < RANGE2 )
+ if( VectorLength( relOrigin ) < ALIENSENSE_RANGE )
CG_DrawDir( relOrigin, client );
}
}
@@ -167,7 +165,7 @@ void CG_Scanner( void )
VectorClear( relOrigin );
VectorSubtract( cg.ep.humanBuildablePos[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] < 0 ) )
+ if( VectorLength( relOrigin ) < HELMET_RANGE && ( relOrigin[ 2 ] < 0 ) )
CG_DrawBlips( relOrigin, hIbelow );
}
@@ -177,7 +175,7 @@ void CG_Scanner( void )
VectorClear( relOrigin );
VectorSubtract( cg.ep.alienBuildablePos[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] < 0 ) )
+ if( VectorLength( relOrigin ) < HELMET_RANGE && ( relOrigin[ 2 ] < 0 ) )
CG_DrawBlips( relOrigin, aIbelow );
}
@@ -187,7 +185,7 @@ void CG_Scanner( void )
VectorClear( relOrigin );
VectorSubtract( cg.ep.humanClientPos[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] < 0 ) )
+ if( VectorLength( relOrigin ) < HELMET_RANGE && ( relOrigin[ 2 ] < 0 ) )
CG_DrawBlips( relOrigin, hIbelow );
}
@@ -197,7 +195,7 @@ void CG_Scanner( void )
VectorClear( relOrigin );
VectorSubtract( cg.ep.alienClientPos[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] < 0 ) )
+ if( VectorLength( relOrigin ) < HELMET_RANGE && ( relOrigin[ 2 ] < 0 ) )
CG_DrawBlips( relOrigin, aIbelow );
}
@@ -209,7 +207,7 @@ void CG_Scanner( void )
VectorClear( relOrigin );
VectorSubtract( cg.ep.humanBuildablePos[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] > 0 ) )
+ if( VectorLength( relOrigin ) < HELMET_RANGE && ( relOrigin[ 2 ] > 0 ) )
CG_DrawBlips( relOrigin, hIabove );
}
@@ -219,7 +217,7 @@ void CG_Scanner( void )
VectorClear( relOrigin );
VectorSubtract( cg.ep.alienBuildablePos[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] > 0 ) )
+ if( VectorLength( relOrigin ) < HELMET_RANGE && ( relOrigin[ 2 ] > 0 ) )
CG_DrawBlips( relOrigin, aIabove );
}
@@ -229,7 +227,7 @@ void CG_Scanner( void )
VectorClear( relOrigin );
VectorSubtract( cg.ep.humanClientPos[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] > 0 ) )
+ if( VectorLength( relOrigin ) < HELMET_RANGE && ( relOrigin[ 2 ] > 0 ) )
CG_DrawBlips( relOrigin, hIabove );
}
@@ -239,7 +237,7 @@ void CG_Scanner( void )
VectorClear( relOrigin );
VectorSubtract( cg.ep.alienClientPos[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] > 0 ) )
+ if( VectorLength( relOrigin ) < HELMET_RANGE && ( relOrigin[ 2 ] > 0 ) )
CG_DrawBlips( relOrigin, aIabove );
}
}
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c
index afe9c979..89f25029 100644
--- a/src/cgame/cg_view.c
+++ b/src/cgame/cg_view.c
@@ -486,7 +486,7 @@ static void CG_OffsetFirstPersonView( void )
AngleVectors( angles, forward, NULL, NULL );
VectorNormalize( forward );
- fraction1 = (float)( cg.time - cg.weapon2Time ) / POUNCE_TIME;
+ fraction1 = (float)( cg.time - cg.weapon2Time ) / (float)DRAGOON_POUNCE_TIME;
if( fraction1 > 1.0f )
fraction1 = 1.0f;
@@ -556,8 +556,8 @@ static void CG_OffsetFirstPersonView( void )
float fraction = sin( ( (float)cg.time / 1000.0f ) * M_PI * 2 * PCLOUD_ROLL_FREQUENCY );
float pitchFraction = sin( ( (float)cg.time / 1000.0f ) * M_PI * 5 * PCLOUD_ROLL_FREQUENCY );
- fraction *= 1.0f - ( ( cg.time - cg.firstPoisonedTime ) / (float)PCLOUD_TIME );
- pitchFraction *= 1.0f - ( ( cg.time - cg.firstPoisonedTime ) / (float)PCLOUD_TIME );
+ fraction *= 1.0f - ( ( cg.time - cg.firstPoisonedTime ) / (float)HYDRA_PCLOUD_TIME );
+ pitchFraction *= 1.0f - ( ( cg.time - cg.firstPoisonedTime ) / (float)HYDRA_PCLOUD_TIME );
angles[ ROLL ] += fraction * PCLOUD_ROLL_AMPLITUDE;
angles[ YAW ] += fraction * PCLOUD_ROLL_AMPLITUDE;
@@ -602,7 +602,7 @@ static void CG_OffsetFirstPersonView( void )
//bit closer to the ground
mins[ 2 ] = -1.0f;
- deltaTime = cg.time - ( cg.firstKnockedTime + (int)( (float)KOVER_TIME / 5.0f ) );
+ deltaTime = cg.time - ( cg.firstKnockedTime + (int)( (float)BMOFO_KOVER_TIME / 5.0f ) );
if( deltaTime < 0 )
{
@@ -625,7 +625,7 @@ static void CG_OffsetFirstPersonView( void )
CG_Trace( &tr, baseOrigin, mins, maxs, origin, cg.predictedPlayerState.clientNum, MASK_SOLID );
VectorCopy( tr.endpos, origin );
- rollFraction = (float)deltaTime / ( (float)KOVER_TIME / 6.0f );
+ rollFraction = (float)deltaTime / ( (float)BMOFO_KOVER_TIME / 6.0f );
if( rollFraction > 1.0f )
rollFraction = 1.0f;
@@ -655,7 +655,7 @@ static void CG_OffsetFirstPersonView( void )
deltaTime = cg.time - cg.firstGetUpTime;
- rollFraction = (float)deltaTime / (float)GETUP_TIME;
+ rollFraction = (float)deltaTime / (float)BMOFO_GETUP_TIME;
if( rollFraction > 1.0f )
rollFraction = 1.0f;
@@ -872,7 +872,7 @@ static int CG_CalcFov( void )
{
phase = cg.time / 1000.0 * PCLOUD_ZOOM_FREQUENCY * M_PI * 2;
v = PCLOUD_ZOOM_AMPLITUDE * sin( phase );
- v *= 1.0f - ( ( cg.time - cg.firstPoisonedTime ) / (float)PCLOUD_TIME );
+ v *= 1.0f - ( ( cg.time - cg.firstPoisonedTime ) / (float)HYDRA_PCLOUD_TIME );
fov_x += v;
fov_y += v;
}
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index e715e544..e8c6aedf 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -99,7 +99,7 @@ void CG_TeslaTrail( vec3_t start, vec3_t end, int srcENum, int destENum )
refEntity_t *re;
//add a bunch of bolt segments
- le = CG_AllocLocalEntity();
+ le = CG_AllocLocalEntity( );
re = &le->refEntity;
le->leType = LE_LIGHTNING_BOLT;
@@ -141,8 +141,7 @@ void CG_AlienZap( vec3_t start, vec3_t end, int srcENum, int destENum )
le->destENum = destENum;
le->vOffset = -4;
- //FIXME: share with server
- le->maxRange = 200;
+ le->maxRange = CHIMERA_AREAZAP_RANGE;
VectorCopy( start, re->origin );
VectorCopy( end, re->oldorigin );
@@ -563,7 +562,7 @@ static void CG_LightningBolt( centity_t *cent, vec3_t origin )
VectorMA( muzzlePoint, 14, forward, muzzlePoint );
// project forward by the lightning range
- VectorMA( muzzlePoint, LIGHTNING_RANGE, forward, endPoint );
+ VectorMA( muzzlePoint, TESLAGEN_RANGE, forward, endPoint );
// see if it hit a wall
CG_Trace( &trace, muzzlePoint, vec3_origin, vec3_origin, endPoint,
@@ -673,6 +672,7 @@ static void CG_PoisonCloud( centity_t *cent, int firstPoisonTime )
cent->poisonTime = cg.time + POISONCLOUD_GAP;
}
+#define FIREBALL_GAP 15 //basically as fast as possible yet regular
/*
===============
@@ -697,7 +697,7 @@ static void CG_FlameTrail( centity_t *cent )
{
AngleVectors( cg.refdefViewAngles, forward, right, up );
VectorCopy( cg.refdef.vieworg, muzzlePoint );
- VectorScale( cg.predictedPlayerState.velocity, FIREBALL_LAG, pVelocity );
+ VectorScale( cg.predictedPlayerState.velocity, FLAMER_LAG, pVelocity );
}
else
{
@@ -706,10 +706,10 @@ static void CG_FlameTrail( centity_t *cent )
//FIXME: this is gonna look weird when crouching
muzzlePoint[ 2 ] += DEFAULT_VIEWHEIGHT;
- VectorScale( cent->currentState.pos.trDelta, FIREBALL_LAG, pVelocity );
+ VectorScale( cent->currentState.pos.trDelta, FLAMER_LAG, pVelocity );
}
- VectorMA( pVelocity, FIREBALL_SPEED, forward, velocity );
+ VectorMA( pVelocity, FLAMER_SPEED, forward, velocity );
//FIXME: tweak these numbers when (if?) the flamer model is done
VectorMA( muzzlePoint, 24.0f, forward, muzzlePoint );
@@ -718,7 +718,7 @@ static void CG_FlameTrail( centity_t *cent )
CG_LaunchSprite( muzzlePoint, velocity, vec3_origin, 0.0f,
0.1f, 4.0f, 40.0f, 255.0f, 255.0f,
- rand( ) % 360, cg.time, cg.time, FIREBALL_LIFETIME,
+ rand( ) % 360, cg.time, cg.time, FLAMER_LIFETIME,
cgs.media.flameShader[ 0 ], qfalse, qfalse );
//set next ball time
@@ -1012,7 +1012,7 @@ void CG_AddViewWeapon( playerState_t *ps )
if( ps->weapon == WP_LUCIFER_CANON && ps->stats[ STAT_MISC ] > 0 )
{
- float fraction = (float)ps->stats[ STAT_MISC ] / (float)LC_TOTAL_CHARGE;
+ float fraction = (float)ps->stats[ STAT_MISC ] / (float)LCANON_TOTAL_CHARGE;
VectorMA( hand.origin, random( ) * fraction, cg.refdef.viewaxis[ 0 ], hand.origin );
VectorMA( hand.origin, random( ) * fraction, cg.refdef.viewaxis[ 1 ], hand.origin );