Skip to content

Commit

Permalink
- Give helmets and bsuits immunity to the poison cloud.
Browse files Browse the repository at this point in the history
- Apply damage from the poison cloud.
  • Loading branch information
dGr8LookinSparky committed Feb 5, 2018
1 parent 8a23a12 commit e201ae1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/game/g_active.c
Expand Up @@ -895,6 +895,11 @@ void ClientTimerActions( gentity_t *ent, int msec )
{
client->time1000 -= 1000;

//client is poison clouded
if( client->ps.eFlags & EF_POISONCLOUDED )
G_Damage( ent, client->lastPoisonCloudedClient, client->lastPoisonCloudedClient, NULL, NULL,
LEVEL1_PCLOUD_DMG, 0, MOD_LEVEL1_PCLOUD );

//client is poisoned
if( client->ps.stats[ STAT_STATE ] & SS_POISONED )
{
Expand Down
1 change: 1 addition & 0 deletions src/game/g_combat.c
Expand Up @@ -1004,6 +1004,7 @@ static qboolean G_MODHitIndication( meansOfDeath_t mod )
case MOD_DROP:
case MOD_FALLING:
case MOD_TRIGGER_HURT:
case MOD_LEVEL1_PCLOUD:
case MOD_POISON:
case MOD_HSPAWN:
case MOD_ASPAWN:
Expand Down
1 change: 1 addition & 0 deletions src/game/g_local.h
Expand Up @@ -563,6 +563,7 @@ struct gclient_s
int poisonImmunityTime;
gentity_t *lastPoisonClient;
int lastPoisonCloudedTime;
gentity_t *lastPoisonCloudedClient;
int grabExpiryTime;
int lastLockTime;
int lastSlowTime;
Expand Down
5 changes: 4 additions & 1 deletion src/game/g_weapon.c
Expand Up @@ -1268,7 +1268,9 @@ void poisonCloud( gentity_t *ent )
humanPlayer = &g_entities[ entityList[ i ] ];

if( humanPlayer->client &&
humanPlayer->client->pers.teamSelection == TEAM_HUMANS )
humanPlayer->client->pers.teamSelection == TEAM_HUMANS &&
!BG_InventoryContainsUpgrade( UP_HELMET, humanPlayer->client->ps.stats ) &&
!BG_InventoryContainsUpgrade( UP_BATTLESUIT, humanPlayer->client->ps.stats ))
{
SV_Trace( &tr, muzzle, NULL, NULL, humanPlayer->r.currentOrigin,
humanPlayer->s.number, CONTENTS_SOLID, TT_AABB );
Expand All @@ -1279,6 +1281,7 @@ void poisonCloud( gentity_t *ent )

humanPlayer->client->ps.eFlags |= EF_POISONCLOUDED;
humanPlayer->client->lastPoisonCloudedTime = level.time;
humanPlayer->client->lastPoisonCloudedClient = ent;

SV_GameSendServerCommand( humanPlayer->client->ps.clientNum,
"poisoncloud" );
Expand Down

0 comments on commit e201ae1

Please sign in to comment.