diff options
author | MaeJong <mewiceclair@gmail.com> | 2017-05-13 23:40:37 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-05-14 21:51:45 +0200 |
commit | 721a2ec972e00f97c7e115dc1f39d8f75dc47f4b (patch) | |
tree | f02e3c26dfc74288efee1e7de51640005d6c3a08 /src/game/g_weapon.c | |
parent | 06e5fe54ee5d9107e2917c5f3dedcc976b7ff996 (diff) |
Basilisk boosts the aliens it gases
Duration is defined in tremulous.h and defaults to 5000 (5 secs):
LEVEL1_PCLOUD_BOOST_TIME
"Tödliche, mein Führer."
Diffstat (limited to 'src/game/g_weapon.c')
-rw-r--r-- | src/game/g_weapon.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index e02dd21..bc1491b 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -1015,7 +1015,7 @@ void poisonCloud( gentity_t *ent ) vec3_t range = { LEVEL1_PCLOUD_RANGE, LEVEL1_PCLOUD_RANGE, LEVEL1_PCLOUD_RANGE }; vec3_t mins, maxs; int i, num; - gentity_t *humanPlayer; + gentity_t *targ; trace_t tr; VectorAdd( ent->client->ps.origin, range, maxs ); @@ -1025,30 +1025,41 @@ void poisonCloud( gentity_t *ent ) num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); for( i = 0; i < num; i++ ) { - humanPlayer = &g_entities[ entityList[ i ] ]; + targ = &g_entities[ entityList[ i ] ]; - if( humanPlayer->client && humanPlayer->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + if( targ->client && targ->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) { - if( BG_InventoryContainsUpgrade( UP_HELMET, humanPlayer->client->ps.stats ) ) + if( BG_InventoryContainsUpgrade( UP_HELMET, targ->client->ps.stats ) ) continue; - if( BG_InventoryContainsUpgrade( UP_BATTLESUIT, humanPlayer->client->ps.stats ) ) + if( BG_InventoryContainsUpgrade( UP_BATTLESUIT, targ->client->ps.stats ) ) continue; - trap_Trace( &tr, muzzle, NULL, NULL, humanPlayer->s.origin, humanPlayer->s.number, MASK_SOLID ); + trap_Trace( &tr, muzzle, NULL, NULL, targ->s.origin, targ->s.number, MASK_SOLID ); //can't see target from here if( tr.fraction < 1.0f ) continue; - if( !( humanPlayer->client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED ) ) + if( !( targ->client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED ) ) { - humanPlayer->client->ps.stats[ STAT_STATE ] |= SS_POISONCLOUDED; - humanPlayer->client->lastPoisonCloudedTime = level.time; - humanPlayer->client->lastPoisonCloudedClient = ent; - trap_SendServerCommand( humanPlayer->client->ps.clientNum, "poisoncloud" ); + targ->client->ps.stats[ STAT_STATE ] |= SS_POISONCLOUDED; + targ->client->lastPoisonCloudedTime = level.time; + targ->client->lastPoisonCloudedClient = ent; + trap_SendServerCommand( targ->client->ps.clientNum, "poisoncloud" ); } } + + if( targ->client && targ->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + { + trap_Trace( &tr, muzzle, NULL, NULL, targ->s.origin, targ->s.number, MASK_SOLID ); + + if( tr.fraction < 1.0f ) + continue; + + targ->client->ps.stats[ STAT_STATE ] |= SS_BOOSTED; + targ->client->lastBoostedTime = MAX( targ->client->lastBoostedTime, level.time - BOOST_TIME + LEVEL1_PCLOUD_BOOST_TIME ); + } } G_UnlaggedOff( ); } |