summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cgame/cg_ents.c4
-rw-r--r--src/cgame/cg_main.c2
-rw-r--r--src/cgame/cg_particles.c7
-rw-r--r--src/cgame/cg_players.c5
-rw-r--r--src/game/bg_misc.c35
-rw-r--r--src/game/bg_pmove.c2
-rw-r--r--src/game/bg_public.h3
-rw-r--r--src/game/g_cmds.c10
-rw-r--r--src/game/g_combat.c20
-rw-r--r--src/game/g_weapon.c18
-rw-r--r--src/game/q_math.c13
-rw-r--r--src/game/tremulous.h14
12 files changed, 113 insertions, 20 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c
index 09ec1bfe..01314df0 100644
--- a/src/cgame/cg_ents.c
+++ b/src/cgame/cg_ents.c
@@ -398,6 +398,10 @@ static void CG_Missile( centity_t *cent )
ent.radius = wi->wim[ weaponMode ].missileSpriteSize;
ent.rotation = 0;
ent.customShader = wi->wim[ weaponMode ].missileSprite;
+ ent.shaderRGBA[ 0 ] = 0xFF;
+ ent.shaderRGBA[ 1 ] = 0xFF;
+ ent.shaderRGBA[ 2 ] = 0xFF;
+ ent.shaderRGBA[ 3 ] = 0xFF;
}
else
{
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index bda93826..1b11f17e 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -894,7 +894,7 @@ void CG_BuildSpectatorString( void )
for( i = 0; i < MAX_CLIENTS; i++ )
{
if( cgs.clientinfo[ i ].infoValid && cgs.clientinfo[ i ].team == PTE_NONE )
- Q_strcat( cg.spectatorList, sizeof( cg.spectatorList ), va( "%s ", cgs.clientinfo[ i ].name ) );
+ Q_strcat( cg.spectatorList, sizeof( cg.spectatorList ), va( "%s " S_COLOR_WHITE, cgs.clientinfo[ i ].name ) );
}
i = strlen( cg.spectatorList );
diff --git a/src/cgame/cg_particles.c b/src/cgame/cg_particles.c
index 28787bd0..cc7c4722 100644
--- a/src/cgame/cg_particles.c
+++ b/src/cgame/cg_particles.c
@@ -337,7 +337,7 @@ static particleEjector_t *CG_SpawnNewParticleEjector( baseParticleEjector_t *bpe
pe->nextEjectionTime = cg.time +
(int)CG_RandomiseValue( (float)bpe->eject.delay, bpe->eject.delayRandFrac );
pe->count = pe->totalParticles =
- (int)CG_RandomiseValue( (float)bpe->totalParticles, bpe->totalParticlesRandFrac );
+ (int)round( CG_RandomiseValue( (float)bpe->totalParticles, bpe->totalParticlesRandFrac ) );
pe->valid = qtrue;
@@ -1744,7 +1744,10 @@ static void CG_EvaluateParticlePhysics( particle_t *p )
VectorMA( p->origin, deltaTime, p->velocity, newOrigin );
p->lastEvalTime = cg.time;
- CG_Trace( &trace, p->origin, mins, maxs, newOrigin, -1, CONTENTS_SOLID );
+ if( !ps->attachment.centValid )
+ CG_Trace( &trace, p->origin, mins, maxs, newOrigin, -1, CONTENTS_SOLID );
+ else
+ CG_Trace( &trace, p->origin, mins, maxs, newOrigin, ps->attachment.centNum, CONTENTS_SOLID );
//not hit anything or not a collider
if( trace.fraction == 1.0f || bounce == 0.0f )
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index 65a34d2e..1ea8d30d 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -2225,7 +2225,10 @@ void CG_Player( centity_t *cent )
//
// add the gun / barrel / flash
//
- CG_AddPlayerWeapon( &torso, NULL, cent );
+ if( !ci->nonsegmented )
+ CG_AddPlayerWeapon( &torso, NULL, cent );
+ else
+ CG_AddPlayerWeapon( &legs, NULL, cent );
CG_PlayerUpgrades( cent, &torso );
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 167ce0d5..ec8f2df6 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -1423,6 +1423,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
100.0f, //float stopSpeed;
270.0f, //float jumpMagnitude;
+ 1.0f, //float knockbackScale;
{ PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ];
0, //int cost;
0 //int value;
@@ -1460,6 +1461,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
100.0f, //float stopSpeed;
130.0f, //float jumpMagnitude;
+ 1.0f, //float knockbackScale;
{ PCL_A_B_LEV1, PCL_A_O_BASE, PCL_NONE }, //int children[ 3 ];
ABUILDER_COST, //int cost;
ABUILDER_VALUE //int value;
@@ -1497,6 +1499,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
100.0f, //float stopSpeed;
270.0f, //float jumpMagnitude;
+ 1.0f, //float knockbackScale;
{ PCL_A_O_BASE, PCL_NONE, PCL_NONE }, //int children[ 3 ];
ABUILDER_UPG_COST, //int cost;
ABUILDER_UPG_VALUE //int value;
@@ -1535,6 +1538,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
400.0f, //float stopSpeed;
250.0f, //float jumpMagnitude;
+ 2.0f, //float knockbackScale;
{ PCL_A_O_LEV1, PCL_NONE, PCL_NONE }, //int children[ 3 ];
SOLDIER_COST, //int cost;
SOLDIER_VALUE //int value;
@@ -1573,6 +1577,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
300.0f, //float stopSpeed;
270.0f, //float jumpMagnitude;
+ 1.2f, //float knockbackScale;
{ PCL_A_O_LEV2, PCL_A_O_LEV1_UPG, PCL_NONE }, //int children[ 3 ];
HYDRA_COST, //int cost;
HYDRA_VALUE //int value;
@@ -1611,6 +1616,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
300.0f, //float stopSpeed;
270.0f, //float jumpMagnitude;
+ 1.1f, //float knockbackScale;
{ PCL_A_O_LEV2, PCL_NONE, PCL_NONE }, //int children[ 3 ];
HYDRA_UPG_COST, //int cost;
HYDRA_UPG_VALUE //int value;
@@ -1649,6 +1655,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
100.0f, //float stopSpeed;
400.0f, //float jumpMagnitude;
+ 0.8f, //float knockbackScale;
{ PCL_A_O_LEV3, PCL_A_O_LEV2_UPG, PCL_NONE }, //int children[ 3 ];
CHIMERA_COST, //int cost;
CHIMERA_VALUE //int value;
@@ -1687,6 +1694,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
100.0f, //float stopSpeed;
400.0f, //float jumpMagnitude;
+ 0.7f, //float knockbackScale;
{ PCL_A_O_LEV3, PCL_NONE, PCL_NONE }, //int children[ 3 ];
CHIMERA_UPG_COST, //int cost;
CHIMERA_UPG_VALUE //int value;
@@ -1725,6 +1733,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
200.0f, //float stopSpeed;
270.0f, //float jumpMagnitude;
+ 0.5f, //float knockbackScale;
{ PCL_A_O_LEV4, PCL_A_O_LEV3_UPG, PCL_NONE }, //int children[ 3 ];
DRAGOON_COST, //int cost;
DRAGOON_VALUE //int value;
@@ -1763,6 +1772,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
200.0f, //float stopSpeed;
270.0f, //float jumpMagnitude;
+ 0.4f, //float knockbackScale;
{ PCL_A_O_LEV4, PCL_NONE, PCL_NONE }, //int children[ 3 ];
DRAGOON_UPG_COST, //int cost;
DRAGOON_UPG_VALUE //int value;
@@ -1801,6 +1811,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
100.0f, //float stopSpeed;
170.0f, //float jumpMagnitude;
+ 0.1f, //float knockbackScale;
{ PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ];
BMOFO_COST, //int cost;
BMOFO_VALUE //int value;
@@ -1839,6 +1850,7 @@ classAttributes_t bg_classList[ ] =
6.0f, //float friction;
100.0f, //float stopSpeed;
220.0f, //float jumpMagnitude;
+ 1.0f, //float knockbackScale;
{ PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ];
0, //int cost;
0 //int value;
@@ -1855,7 +1867,7 @@ classAttributes_t bg_classList[ ] =
"bsuit", ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), { 0, 0, 0 }, { 0, 0, 0, },
{ 0, 0, 0, }, { 0, 0, 0, }, { 0, 0, 0, }, 0.0f, 0, 0, 0, 0.0f, 0, 0, WP_NONE, 0.0f, 0,
- 0.0f, 1.0f, 0, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 270.0f, { PCL_NONE, PCL_NONE, PCL_NONE }, 0, 0
+ 0.0f, 1.0f, 0, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 270.0f, 1.0f, { PCL_NONE, PCL_NONE, PCL_NONE }, 0, 0
}
};
@@ -2445,6 +2457,27 @@ float BG_FindJumpMagnitudeForClass( int pclass )
/*
==============
+BG_FindKnockbackScaleForClass
+==============
+*/
+float BG_FindKnockbackScaleForClass( int pclass )
+{
+ int i;
+
+ for( i = 0; i < bg_numPclasses; i++ )
+ {
+ if( bg_classList[ i ].classNum == pclass )
+ {
+ return bg_classList[ i ].knockbackScale;
+ }
+ }
+
+ Com_Printf( S_COLOR_YELLOW "WARNING: fallthrough in BG_FindKnockbackScaleForClass\n" );
+ return 1.0f;
+}
+
+/*
+==============
BG_FindSteptimeForClass
==============
*/
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 1ab23c62..3c3983ea 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -2767,7 +2767,7 @@ static void PM_Weapon( void )
}
// check for end of clip
- if( ( !ammo && clips ) || pm->ps->pm_flags & PMF_WEAPON_RELOAD )
+ if( ( !ammo || pm->ps->pm_flags & PMF_WEAPON_RELOAD ) && clips )
{
pm->ps->pm_flags &= ~PMF_WEAPON_RELOAD;
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 02ffad71..6a119b27 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -904,6 +904,7 @@ typedef struct
float friction;
float stopSpeed;
float jumpMagnitude;
+ float knockbackScale;
int children[ 3 ];
int cost;
@@ -1131,6 +1132,7 @@ float BG_FindAirAccelerationForClass( int pclass );
float BG_FindFrictionForClass( int pclass );
float BG_FindStopSpeedForClass( int pclass );
float BG_FindJumpMagnitudeForClass( int pclass );
+float BG_FindKnockbackScaleForClass( int pclass );
int BG_FindSteptimeForClass( int pclass );
qboolean BG_ClassHasAbility( int pclass, int ability );
weapon_t BG_FindStartWeaponForClass( int pclass );
@@ -1254,3 +1256,4 @@ float VectorDistance( vec3_t v1, vec3_t v2 );
float VectorMinComponent( vec3_t v );
float VectorMaxComponent( vec3_t v );
+float round( float v );
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index b2d56731..8630329b 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -466,7 +466,7 @@ void Cmd_Team_f( gentity_t *ent )
if( g_teamForceBalance.integer && level.numAlienClients > level.numHumanClients )
{
//FIXME: pleasant dialog
- trap_SendServerCommand( ent-g_entities, "The alien team has too many players\n" );
+ trap_SendServerCommand( ent-g_entities, "print \"The alien team has too many players\n\"" );
return;
}
@@ -477,7 +477,7 @@ void Cmd_Team_f( gentity_t *ent )
if( g_teamForceBalance.integer && level.numHumanClients > level.numAlienClients )
{
//FIXME: pleasant dialog
- trap_SendServerCommand( ent-g_entities, "The human team has too many players\n" );
+ trap_SendServerCommand( ent-g_entities, "print \"The human team has too many players\n\"" );
return;
}
@@ -1821,6 +1821,12 @@ void G_StopFollowing( gentity_t *ent )
ent->client->sess.sessionTeam = TEAM_SPECTATOR;
ent->client->sess.spectatorState = SPECTATOR_FREE;
ent->client->ps.pm_flags &= ~PMF_FOLLOW;
+
+ ent->client->ps.stats[ STAT_STATE ] &= ~SS_WALLCLIMBING;
+ ent->client->ps.stats[ STAT_STATE ] &= ~SS_WALLCLIMBINGCEILING;
+ ent->client->ps.eFlags &= ~EF_WALLCLIMB;
+ ent->client->ps.viewangles[ PITCH ] = 0.0f;
+
ent->r.svFlags &= ~SVF_BOT;
ent->client->ps.clientNum = ent - g_entities;
}
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 675b917d..6ffe9edc 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -216,6 +216,15 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
if( attacker == self || OnSameTeam( self, attacker ) )
{
AddScore( attacker, -1 );
+
+ //punish team kills and suicides
+ if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
+ attacker->client->ps.persistant[ PERS_CREDIT ]--;
+ else if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
+ attacker->client->ps.persistant[ PERS_CREDIT ] -= ASPAWN_VALUE;
+
+ if( attacker->client->ps.persistant[ PERS_CREDIT ] < 0 )
+ attacker->client->ps.persistant[ PERS_CREDIT ] = 0;
}
else
{
@@ -271,8 +280,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
{
attacker->client->ps.persistant[ PERS_CREDIT ]++;
- if( attacker->client->ps.persistant[ PERS_CREDIT ] > HUMAN_MAX_CREDITS )
- attacker->client->ps.persistant[ PERS_CREDIT ] = HUMAN_MAX_CREDITS;
+ if( attacker->client->ps.persistant[ PERS_CREDIT ] > ALIEN_MAX_KILLS )
+ attacker->client->ps.persistant[ PERS_CREDIT ] = ALIEN_MAX_KILLS;
}
// Add team bonuses
@@ -870,6 +879,13 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
VectorNormalize( dir );
knockback = damage;
+
+ if( targ->client )
+ {
+ knockback = (int)( (float)knockback *
+ BG_FindKnockbackScaleForClass( targ->client->ps.stats[ STAT_PCLASS ] ) );
+ }
+
if( knockback > 200 )
knockback = 200;
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index 850ccd72..4b6f45d6 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -435,10 +435,22 @@ void painSawFire( gentity_t *ent )
traceEnt = &g_entities[ tr.entityNum ];
// send blood impact
- if( traceEnt->takedamage && traceEnt->client )
+ if( traceEnt->takedamage )
{
- tent = G_TempEntity( tr.endpos, EV_MISSILE_HIT );
- tent->s.otherEntityNum = traceEnt->s.number;
+ vec3_t temp;
+
+ //hack to get the particle system to line up with the weapon
+ VectorCopy( tr.endpos, temp );
+ temp[ 2 ] -= 10.0f;
+
+ if( traceEnt->client )
+ {
+ tent = G_TempEntity( temp, EV_MISSILE_HIT );
+ tent->s.otherEntityNum = traceEnt->s.number;
+ }
+ else
+ tent = G_TempEntity( temp, EV_MISSILE_MISS );
+
tent->s.eventParm = DirToByte( tr.plane.normal );
tent->s.weapon = ent->s.weapon;
tent->s.generic1 = ent->s.generic1; //weaponMode
diff --git a/src/game/q_math.c b/src/game/q_math.c
index 1cfe25cc..cbc7fdac 100644
--- a/src/game/q_math.c
+++ b/src/game/q_math.c
@@ -1465,3 +1465,16 @@ float VectorMinComponent( vec3_t v )
return smallest;
}
+
+/*
+===============
+round
+===============
+*/
+float round( float v )
+{
+ if( v >= 0.5f )
+ return ceil( v );
+ else
+ return floor( v );
+}
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index a7b943ff..7d2c423b 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -52,7 +52,7 @@
#define HYDRA_GRAB_TIME 1000
#define HYDRA_PCLOUD_DMG ADM(5)
#define HYDRA_PCLOUD_RANGE 200.0f
-#define HYDRA_PCLOUD_REPEAT 1000
+#define HYDRA_PCLOUD_REPEAT 2000
#define HYDRA_PCLOUD_TIME 10000
#define CHIMERA_CLAW_DMG ADM(50)
@@ -243,7 +243,7 @@
#define HIVE_CREEPSIZE 120
#define HIVE_RANGE 400.0f
#define HIVE_REPEAT 10000
-#define HIVE_DMG 30
+#define HIVE_DMG 20
#define HIVE_SPEED 230.0f
#define HIVE_DIR_CHANGE_PERIOD 500
@@ -263,7 +263,7 @@
#define OVERMIND_BT 30000
#define OVERMIND_HEALTH ABHM(1000)
#define OVERMIND_REGEN 10
-#define OVERMIND_SPLASHDAMAGE 100
+#define OVERMIND_SPLASHDAMAGE 15
#define OVERMIND_SPLASHRADIUS 300
#define OVERMIND_CREEPSIZE 120
#define OVERMIND_ATTACK_RANGE 150.0f
@@ -307,7 +307,7 @@
*
*/
-#define HUMAN_WDMG_MODIFIER 1.05f
+#define HUMAN_WDMG_MODIFIER 1.1f
#define HDM(d) ((int)((float)d*HUMAN_WDMG_MODIFIER))
#define BLASTER_REPEAT 600
@@ -361,12 +361,12 @@
#define PRIFLE_PRICE 400
#define PRIFLE_CLIPS 50
-#define PRIFLE_SPAWNCLIPS 3
-#define PRIFLE_MAXCLIPS 3
+#define PRIFLE_SPAWNCLIPS 2
+#define PRIFLE_MAXCLIPS 2
#define PRIFLE_REPEAT 100
#define PRIFLE_RELOAD 2000
#define PRIFLE_DMG HDM(10)
-#define PRIFLE_SPEED 1500
+#define PRIFLE_SPEED 1000
#define FLAMER_PRICE 450
#define FLAMER_GAS 80