summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorMaeJong <mewiceclair@gmail.com>2017-05-13 23:40:37 +0200
committerPaweł Redman <pawel.redman@gmail.com>2017-05-14 21:51:45 +0200
commit721a2ec972e00f97c7e115dc1f39d8f75dc47f4b (patch)
treef02e3c26dfc74288efee1e7de51640005d6c3a08 /src/game
parent06e5fe54ee5d9107e2917c5f3dedcc976b7ff996 (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')
-rw-r--r--src/game/g_weapon.c33
-rw-r--r--src/game/tremulous.h1
2 files changed, 23 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( );
}
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index 239bb46..e1fd836 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -69,6 +69,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define LEVEL1_PCLOUD_RANGE 200.0f
#define LEVEL1_PCLOUD_REPEAT 2000
#define LEVEL1_PCLOUD_TIME 10000
+#define LEVEL1_PCLOUD_BOOST_TIME 5000
#define LEVEL2_CLAW_DMG ADM(40)
#define LEVEL2_CLAW_RANGE 96.0f