diff options
author | Tim Angus <tim@ngus.net> | 2001-06-30 16:49:06 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-06-30 16:49:06 +0000 |
commit | e832aa7a5c7f98e869b9d2bfc613a732324929cf (patch) | |
tree | 61bfc95cae2eafa4030f1b06ab3a881047a46b07 /src | |
parent | 5420c537abb7aa5c27b168a234a956cf6afec47d (diff) |
Partially implemented poisoning
Diffstat (limited to 'src')
-rw-r--r-- | src/game/bg_public.h | 1 | ||||
-rw-r--r-- | src/game/g_active.c | 7 | ||||
-rw-r--r-- | src/game/g_local.h | 1 | ||||
-rw-r--r-- | src/game/g_weapon.c | 10 |
4 files changed, 18 insertions, 1 deletions
diff --git a/src/game/bg_public.h b/src/game/bg_public.h index a4b16110..883c2957 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -258,6 +258,7 @@ typedef enum { #define SS_WALLTRANSIDING 8 #define SS_SPEEDBOOST 16 #define SS_INFESTING 32 +#define SS_POISONED 64 // player_state->persistant[] indexes diff --git a/src/game/g_active.c b/src/game/g_active.c index 66c9c279..0fc8737c 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -474,6 +474,13 @@ void ClientTimerActions( gentity_t *ent, int msec ) if( client->ps.stats[ STAT_STAMINA ] > 1000 ) client->ps.stats[ STAT_STAMINA ] = 1000; } + + if( client->ps.stats[ STAT_STATE ] & SS_POISONED ) + { + int damage = ( level.time - client->lastPoisonTime ) / 100; + + G_Damage( ent, NULL, NULL, NULL, NULL, damage, 0, MOD_VENOM ); + } } while( client->time1000 >= 1000 ) diff --git a/src/game/g_local.h b/src/game/g_local.h index 34d7bbfd..a7b96e18 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -331,6 +331,7 @@ struct gclient_s { int lastInfestTime; //TA: to keep track of how long infests take gentity_t *infestBody; //TA: body that is being infested. must be persistant + int lastPoisonTime; }; #define MAX_LOCDAMAGE_TEXT 8192 diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 98f39453..9e6db0ab 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -649,7 +649,15 @@ qboolean CheckVenomAttack( gentity_t *ent ) { if( traceEnt->client && traceEnt->client->ps.stats[ STAT_PTEAM ] == PTE_DROIDS ) return qfalse; - G_Damage( traceEnt, ent, ent, forward, tr.endpos, 50, 0, MOD_VENOM ); + G_Damage( traceEnt, ent, ent, forward, tr.endpos, 5, 0, MOD_VENOM ); + if( traceEnt->client ) + { + if( !( traceEnt->client->ps.stats[ STAT_STATE ] & SS_POISONED ) ) + { + traceEnt->client->ps.stats[ STAT_STATE ] |= SS_POISONED; + traceEnt->client->lastPoisonTime = level.time; + } + } return qtrue; } |