summaryrefslogtreecommitdiff
path: root/src/game/g_client.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-08-31 03:15:00 +0000
committerTim Angus <tim@ngus.net>2005-08-31 03:15:00 +0000
commitf40ad7c74f940dd0274cd0a82248a5a4e8846eac (patch)
tree1e045cd77b9fba27a2f967544df24bbd2f475885 /src/game/g_client.c
parent426a6d2269d5087ed6a83fe271f23e2e3b12d6f6 (diff)
* Reimplemented how buildables play damage sounds to not use the event system
* Reworked the ammo/clips packing system to remove the confusion of concepts * Marauder lightning now requires aim, does damage over time and chains to other entities * Implemented the Medkit -- a means for a human to restore health and cure poison in the field * "Disable Build Warnings" replaced with "Disable Warning Dialogs" and improved * Disabled client side ET_MISSILE collision * Sped spectator move speed up * Implemented "step down" physics for all characters; no more jumping down stairs * Re-adjusted step time values * Increased frequency with which the Acid Tube deals damage * G_RadiusSelectiveDamage no longer applies locational damage * Moved some speed adjustment code into prediction; should prevent some prediction misses * Tyrant can no longer charge up forever and must pass a specific minimum charge level * Wrapped all calls to trap_SendServerCommand in order to circumvent the q3amsgboom.cfg exploit * Implemented command queueing for commands sent to clients in order to prevent overflows even sv_floodProtect is off, but not by dropping commands * Added LOS check to creep slowing * Overmind now only complains if there are 0 spawns * Spawns can no longer be built when there is no Overmind/Reactor * The spawn closest to the point of death is chosen preferably if available * Evolving no longer restores all health * "give weapons" and "give ammo" cheats removed * Fixed restoration of energy weapons bug * When selling the battery pack, max ammo is given * Fixed a bug where locational damage could sometimes scale damage to 0 * Added stage information to the end of game stats * Hacked around trap_LinkEntity to allow missiles to have a bounding box displayed * Added G_ClosestEnt * Reduced Dragoon spitball damage from 120 to 110 * Reduced Tyrant claw damage from 120 to 100 * Reduced Tyrant charge damage from 160 to 110 * Increased Barricade regeneration rate from 12 to 14 * Increased Overmind health from 500 to 750 * Decreased Overmind regeneration rate from 10 to 6 * Doubled Blaster speed from 700 to 1400 * Reduced Painsaw damage from 18 to 15 * Reduced Painsaw range from 48.0 to 40.0 * Reduced Grenade price from 300 to 200 * Reduced Shotgun repeat rate from 1200 to 1000 * Increased Shotgun damage from 6 to 7 * Increased Mass driver damage from 35 to 38 * Increased Chaingun damage from 5 to 6 * Reduced Flamer repeat rate from 300 to 200 * Extended Flamer range * Increased ammo on all human weapons * Reduced splashdamage on MG Turrets * Moved build directory from tremulous to tremulous-dev
Diffstat (limited to 'src/game/g_client.c')
-rw-r--r--src/game/g_client.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 23fca525..7c564be9 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -316,11 +316,10 @@ SelectAlienSpawnPoint
go to a random point that doesn't telefrag
================
*/
-gentity_t *SelectAlienSpawnPoint( void )
+gentity_t *SelectAlienSpawnPoint( vec3_t preference )
{
gentity_t *spot;
int count;
- int selection;
gentity_t *spots[ MAX_SPAWN_POINTS ];
if( level.numAlienSpawns <= 0 )
@@ -354,8 +353,7 @@ gentity_t *SelectAlienSpawnPoint( void )
if( !count )
return NULL;
- selection = rand() % count;
- return spots[ selection ];
+ return G_ClosestEnt( preference, spots, count );
}
@@ -366,11 +364,10 @@ SelectHumanSpawnPoint
go to a random point that doesn't telefrag
================
*/
-gentity_t *SelectHumanSpawnPoint( void )
+gentity_t *SelectHumanSpawnPoint( vec3_t preference )
{
gentity_t *spot;
int count;
- int selection;
gentity_t *spots[ MAX_SPAWN_POINTS ];
if( level.numHumanSpawns <= 0 )
@@ -404,8 +401,7 @@ gentity_t *SelectHumanSpawnPoint( void )
if( !count )
return NULL;
- selection = rand() % count;
- return spots[ selection ];
+ return G_ClosestEnt( preference, spots, count );
}
@@ -429,14 +425,14 @@ SelectTremulousSpawnPoint
Chooses a player start, deathmatch start, etc
============
*/
-gentity_t *SelectTremulousSpawnPoint( pTeam_t team, vec3_t origin, vec3_t angles )
+gentity_t *SelectTremulousSpawnPoint( pTeam_t team, vec3_t preference, vec3_t origin, vec3_t angles )
{
gentity_t *spot = NULL;
if( team == PTE_ALIENS )
- spot = SelectAlienSpawnPoint( );
+ spot = SelectAlienSpawnPoint( preference );
else if( team == PTE_HUMANS )
- spot = SelectHumanSpawnPoint( );
+ spot = SelectHumanSpawnPoint( preference );
//no available spots
if( !spot )
@@ -997,7 +993,7 @@ void ClientUserinfoChanged( int clientNum )
{
if( strcmp( oldname, client->pers.netname ) )
{
- trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " renamed to %s\n\"", oldname,
+ G_SendCommandFromServer( -1, va( "print \"%s" S_COLOR_WHITE " renamed to %s\n\"", oldname,
client->pers.netname ) );
}
}
@@ -1158,7 +1154,7 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot )
// don't do the "xxx connected" messages if they were caried over from previous level
if( firstTime )
- trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " connected\n\"", client->pers.netname ) );
+ G_SendCommandFromServer( -1, va( "print \"%s" S_COLOR_WHITE " connected\n\"", client->pers.netname ) );
// count current clients and rank for scoreboard
CalculateRanks( );
@@ -1218,10 +1214,12 @@ void ClientBegin( int clientNum )
tent->s.clientNum = ent->s.clientNum;
}
- trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " entered the game\n\"", client->pers.netname ) );
+ G_InitCommandQueue( clientNum );
+
+ G_SendCommandFromServer( -1, va( "print \"%s" S_COLOR_WHITE " entered the game\n\"", client->pers.netname ) );
// request the clients PTR code
- trap_SendServerCommand( ent - g_entities, "ptrcrequest" );
+ G_SendCommandFromServer( ent - g_entities, "ptrcrequest" );
G_LogPrintf( "ClientBegin: %i\n", clientNum );
@@ -1254,7 +1252,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles
int eventSequence;
char userinfo[ MAX_INFO_STRING ];
vec3_t up = { 0.0f, 0.0f, 1.0f };
- int ammo, clips, maxClips;
+ int maxAmmo, maxClips;
weapon_t weapon;
@@ -1387,6 +1385,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles
if( ent->client->pers.classSelection == PCL_HUMAN )
{
BG_AddWeaponToInventory( WP_BLASTER, client->ps.stats );
+ BG_AddUpgradeToInventory( UP_MEDKIT, client->ps.stats );
weapon = client->pers.humanItemSelection;
}
else if( client->sess.sessionTeam != TEAM_SPECTATOR )
@@ -1394,9 +1393,9 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles
else
weapon = WP_NONE;
- BG_FindAmmoForWeapon( weapon, &ammo, &clips, &maxClips );
+ BG_FindAmmoForWeapon( weapon, &maxAmmo, &maxClips );
BG_AddWeaponToInventory( weapon, client->ps.stats );
- BG_PackAmmoArray( weapon, client->ps.ammo, client->ps.powerups, ammo, clips, maxClips );
+ BG_PackAmmoArray( weapon, client->ps.ammo, client->ps.powerups, maxAmmo, maxClips );
ent->client->ps.stats[ STAT_PCLASS ] = ent->client->pers.classSelection;
ent->client->ps.stats[ STAT_PTEAM ] = ent->client->pers.teamSelection;
@@ -1407,6 +1406,13 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles
// health will count down towards max_health
ent->health = client->ps.stats[ STAT_HEALTH ] = client->ps.stats[ STAT_MAX_HEALTH ]; //* 1.25;
+
+ //if evolving scale health
+ if( ent == spawn )
+ {
+ ent->health *= ent->client->pers.evolveHealthFraction;
+ client->ps.stats[ STAT_HEALTH ] *= ent->client->pers.evolveHealthFraction;
+ }
//clear the credits array
for( i = 0; i < MAX_CLIENTS; i++ )