diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_active.c | 2 | ||||
-rw-r--r-- | src/game/g_buildable.c | 2 | ||||
-rw-r--r-- | src/game/g_client.c | 4 | ||||
-rw-r--r-- | src/game/g_cmds.c | 27 | ||||
-rw-r--r-- | src/game/g_local.h | 2 | ||||
-rw-r--r-- | src/game/tremulous.h | 4 |
6 files changed, 29 insertions, 12 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c index 3cc01607..1ce30162 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -500,7 +500,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) { client->charging = qfalse; //should already be off, just making sure - client->ps.stats[ STAT_MISC ] += 100; + client->ps.stats[ STAT_MISC ] += (int)( 100 * (float)BMOFO_CHARGE_CHARGE_RATIO ); if( client->ps.stats[ STAT_MISC ] > BMOFO_CHARGE_TIME ) client->ps.stats[ STAT_MISC ] = BMOFO_CHARGE_TIME; diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 75284a09..c5478aff 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -470,7 +470,7 @@ void ASpawn_Think( gentity_t *self ) VectorSet( maxs, MAX_ALIEN_BBOX, MAX_ALIEN_BBOX, MAX_ALIEN_BBOX ); VectorCopy( self->s.origin, origin ); - displacement = ( self->r.maxs[ 2 ] + MAX_ALIEN_BBOX ) * M_ROOT3 + 1.0f; + displacement = ( self->r.maxs[ 2 ] + MAX_ALIEN_BBOX ) * M_ROOT3; VectorMA( origin, displacement, self->s.origin2, origin ); //only suicide if at rest diff --git a/src/game/g_client.c b/src/game/g_client.c index 688b730e..29b94512 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -303,7 +303,7 @@ gentity_t *SelectAlienSpawnPoint( void ) continue; VectorCopy( spot->s.origin, origin ); - displacement = ( spot->r.maxs[ 2 ] + MAX_ALIEN_BBOX ) * M_ROOT3 + 1.0f; + displacement = ( spot->r.maxs[ 2 ] + MAX_ALIEN_BBOX ) * M_ROOT3; VectorMA( origin, displacement, spot->s.origin2, origin ); trap_Trace( &tr, origin, mins, maxs, origin, spot->s.number, MASK_SHOT ); @@ -466,7 +466,7 @@ gentity_t *SelectTremulousSpawnPoint( int team, vec3_t origin, vec3_t angles ) BG_FindBBoxForBuildable( BA_A_SPAWN, spawnMins, spawnMaxs ); //TA: really a *safe* extreme upper limit - displacement = ( spawnMaxs[ 2 ] + MAX_ALIEN_BBOX + 1.0f ) * M_ROOT3; + displacement = ( spawnMaxs[ 2 ] + MAX_ALIEN_BBOX ) * M_ROOT3; VectorMA( origin, displacement, spot->s.origin2, origin ); } else if( team == PTE_HUMANS ) diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 2fb5febd..3039b1ee 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -919,6 +919,7 @@ void Cmd_SetViewpos_f( gentity_t *ent ) TeleportPlayer( ent, origin, angles ); } +#define EVOLVE_TRACE_HEIGHT 128.0f /* ================= @@ -942,6 +943,7 @@ void Cmd_Class_f( gentity_t *ent ) int numLevels; vec3_t fromMins, fromMaxs, toMins, toMaxs; + vec3_t temp; clientNum = ent->client - level.clients; trap_Argv( 1, s, sizeof( s ) ); @@ -978,7 +980,8 @@ void Cmd_Class_f( gentity_t *ent ) return; } - numLevels = BG_ClassCanEvolveFromTo( ent->client->ps.stats[ STAT_PCLASS ], ent->client->pers.classSelection, + numLevels = BG_ClassCanEvolveFromTo( ent->client->ps.stats[ STAT_PCLASS ], + ent->client->pers.classSelection, (short)ent->client->ps.persistant[ PERS_CREDIT ], 0 ); BG_FindBBoxForClass( ent->client->ps.stats[ STAT_PCLASS ], @@ -989,11 +992,20 @@ void Cmd_Class_f( gentity_t *ent ) VectorCopy( ent->s.pos.trBase, infestOrigin ); infestOrigin[ 2 ] += ( fabs( toMins[ 2 ] ) - fabs( fromMins[ 2 ] ) ) + 1; + VectorCopy( infestOrigin, temp ); + temp[ 2 ] += EVOLVE_TRACE_HEIGHT; - trap_Trace( &tr, infestOrigin, toMins, toMaxs, infestOrigin, ent->s.number, MASK_SHOT ); + //compute a place up in the air to start the real trace + trap_Trace( &tr, infestOrigin, toMins, toMaxs, temp, ent->s.number, MASK_SHOT ); + VectorCopy( infestOrigin, temp ); + temp[ 2 ] += ( EVOLVE_TRACE_HEIGHT * tr.fraction ) - 1.0f; + + //trace down to the ground so that we can evolve on slopes + trap_Trace( &tr, temp, toMins, toMaxs, infestOrigin, ent->s.number, MASK_SHOT ); + VectorCopy( tr.endpos, infestOrigin ); //check there is room to evolve - if( tr.fraction == 1.0f ) + if( !tr.startsolid ) { //...check we can evolve to that class if( numLevels && BG_FindStagesForClass( ent->client->pers.classSelection, g_alienStage.integer ) ) @@ -1009,7 +1021,8 @@ void Cmd_Class_f( gentity_t *ent ) else { ent->client->pers.classSelection = PCL_NONE; - trap_SendServerCommand( ent-g_entities, va( "print \"You cannot evolve from your current class\n\"" ) ); + trap_SendServerCommand( ent-g_entities, + va( "print \"You cannot evolve from your current class\n\"" ) ); return; } } @@ -1032,7 +1045,8 @@ void Cmd_Class_f( gentity_t *ent ) if( allowedClasses[ i ] == ent->client->pers.classSelection && BG_FindStagesForClass( ent->client->pers.classSelection, g_alienStage.integer ) ) { - if( ( spawn = SelectTremulousSpawnPoint( ent->client->pers.teamSelection, spawn_origin, spawn_angles ) ) && + if( ( spawn = SelectTremulousSpawnPoint( ent->client->pers.teamSelection, + spawn_origin, spawn_angles ) ) && level.numAlienSpawns > 0 ) //sanity check { ent->client->sess.sessionTeam = TEAM_FREE; @@ -1081,7 +1095,8 @@ void Cmd_Class_f( gentity_t *ent ) return; } - if( ( spawn = SelectTremulousSpawnPoint( ent->client->pers.teamSelection, spawn_origin, spawn_angles ) ) && + if( ( spawn = SelectTremulousSpawnPoint( ent->client->pers.teamSelection, + spawn_origin, spawn_angles ) ) && level.numHumanSpawns > 0 ) //sanity check { ent->client->sess.sessionTeam = TEAM_FREE; diff --git a/src/game/g_local.h b/src/game/g_local.h index ba1ff47d..ad4044e2 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -546,7 +546,7 @@ void G_Physics( gentity_t *ent, int msec ); // #define M_ROOT3 1.732050808f -#define MAX_ALIEN_BBOX 20 +#define MAX_ALIEN_BBOX 25 typedef enum { diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 42dc922f..acfc4608 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -81,7 +81,9 @@ #define BMOFO_REGEN_RANGE 200.0f #define BMOFO_REGEN_MOD 2.0f #define BMOFO_CHARGE_SPEED 2.0f -#define BMOFO_CHARGE_TIME 2000 +#define BMOFO_CHARGE_TIME 3000 +#define BMOFO_CHARGE_CHARGE_TIME 1000 +#define BMOFO_CHARGE_CHARGE_RATIO (BMOFO_CHARGE_TIME/BMOFO_CHARGE_CHARGE_TIME) #define BMOFO_CHARGE_REPEAT 500 #define BMOFO_CHARGE_DMG ADM(200) |