diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/bg_public.h | 1 | ||||
-rw-r--r-- | src/game/g_active.c | 4 | ||||
-rw-r--r-- | src/game/g_buildable.c | 8 | ||||
-rw-r--r-- | src/game/g_cmds.c | 33 | ||||
-rw-r--r-- | src/game/g_local.h | 5 |
5 files changed, 34 insertions, 17 deletions
diff --git a/src/game/bg_public.h b/src/game/bg_public.h index c4239e6d..a6b152b0 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -243,6 +243,7 @@ typedef enum { #define SS_BLOBLOCKED 128 #define SS_POISONED 256 #define SS_HOVELING 512 +#define SS_BOOSTED 1024 #define SB_VALID_TOGGLEBIT 16384 diff --git a/src/game/g_active.c b/src/game/g_active.c index 7e79b777..b9a6712c 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -849,6 +849,10 @@ void ClientThink_real( gentity_t *ent ) { client->lastLockTime + 5000 < level.time ) client->ps.stats[ STAT_STATE ] &= ~SS_BLOBLOCKED; + if( client->ps.stats[ STAT_STATE ] & SS_BOOSTED && + client->lastBoostedTime + 20000 < level.time ) + client->ps.stats[ STAT_STATE ] &= ~SS_BOOSTED; + client->ps.gravity = g_gravity.value; // set speed diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 57aa0b55..41ed5d3f 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -620,7 +620,7 @@ void AHovel_Use( gentity_t *self, gentity_t *other, gentity_t *activator ) VectorInverse( inverseNormal ); vectoangles( inverseNormal, hovelAngles ); - VectorCopy( activator->s.pos.trBase, activator->hovelOrigin ); + VectorCopy( activator->s.pos.trBase, activator->client->hovelOrigin ); G_SetOrigin( activator, hovelOrigin ); VectorCopy( hovelOrigin, activator->client->ps.origin ); @@ -660,7 +660,11 @@ Called when an alien touches a booster */ void ABooster_Touch( gentity_t *self, gentity_t *other, trace_t *trace ) { - G_Printf( "%d is touching me\n", other->s.number ); + if( !( other->client->ps.stats[ STAT_STATE ] & SS_BOOSTED ) ) + { + other->client->ps.stats[ STAT_STATE ] |= SS_BOOSTED; + other->client->lastBoostedTime = level.time; + } } diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index aea70bcb..8c5be1a4 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1564,7 +1564,9 @@ void Cmd_Class_f( gentity_t *ent ) clientNum = ent->client - level.clients; trap_Argv( 1, s, sizeof( s ) ); - if( ent->client->pers.pteam == PTE_ALIENS ) + if( ent->client->pers.pteam == PTE_ALIENS && + !( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) && + !( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) ) { //if we are not currently spectating, we are attempting evolution if( ent->client->pers.pclass != PCL_NONE ) @@ -1702,19 +1704,22 @@ void Cmd_Destroy_f( gentity_t *ent ) trace_t tr; gentity_t *traceEnt; - AngleVectors( ent->client->ps.viewangles, forward, NULL, NULL ); - VectorMA( ent->client->ps.origin, 50, forward, end ); - - trap_Trace( &tr, ent->client->ps.origin, NULL, NULL, end, ent->s.number, MASK_PLAYERSOLID ); - traceEnt = &g_entities[ tr.entityNum ]; + if( !( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) && + !( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) ) + { + AngleVectors( ent->client->ps.viewangles, forward, NULL, NULL ); + VectorMA( ent->client->ps.origin, 50, forward, end ); - if( tr.fraction < 1.0 && - ( traceEnt->s.eType == ET_BUILDABLE ) && - ( traceEnt->biteam == ent->client->pers.pteam ) && - ( ( ent->client->ps.weapon >= WP_ABUILD ) && - ( ent->client->ps.weapon <= WP_HBUILD ) ) ) - G_Damage( traceEnt, ent, ent, forward, tr.endpos, 10000, 0, MOD_SUICIDE ); + trap_Trace( &tr, ent->client->ps.origin, NULL, NULL, end, ent->s.number, MASK_PLAYERSOLID ); + traceEnt = &g_entities[ tr.entityNum ]; + if( tr.fraction < 1.0 && + ( traceEnt->s.eType == ET_BUILDABLE ) && + ( traceEnt->biteam == ent->client->pers.pteam ) && + ( ( ent->client->ps.weapon >= WP_ABUILD ) && + ( ent->client->ps.weapon <= WP_HBUILD ) ) ) + G_Damage( traceEnt, ent, ent, forward, tr.endpos, 10000, 0, MOD_SUICIDE ); + } } @@ -2119,7 +2124,9 @@ void Cmd_Build_f( gentity_t *ent ) buildable = BG_FindBuildNumForName( s ); if( buildable != BA_NONE && - ( 1 << ent->client->ps.weapon ) & BG_FindBuildWeaponForBuildable( buildable ) ) + ( 1 << ent->client->ps.weapon ) & BG_FindBuildWeaponForBuildable( buildable ) && + !( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) && + !( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) ) { dist = BG_FindBuildDistForClass( ent->client->ps.stats[ STAT_PCLASS ] ); diff --git a/src/game/g_local.h b/src/game/g_local.h index 0ed7e9e0..47acc355 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -186,8 +186,6 @@ struct gentity_s { vec4_t animation; //TA: animated map objects vec3_t turretAim; //TA: aim vector for turrets - - vec3_t hovelOrigin; //TA: player origin before entering hovel }; typedef enum { @@ -342,9 +340,12 @@ struct gclient_s { int lastPoisonTime; int lastGrabTime; //TA: yuck yuck hack urgh int lastLockTime; //TA: " " + int lastBoostedTime; int pouncePayload; //TA: amount of damage pounce attack will do qboolean allowedToPounce; + + vec3_t hovelOrigin; //TA: player origin before entering hovel }; #define MAX_LOCDAMAGE_TEXT 8192 |