diff options
author | Paweł Redman <trem.redman@gmail.com> | 2014-01-19 11:44:43 +0100 |
---|---|---|
committer | Paweł Redman <trem.redman@gmail.com> | 2014-01-19 11:44:43 +0100 |
commit | f9a8b76c0f912cea66eacf71162a3090fda698d8 (patch) | |
tree | 02b97139346540ba9b1d324f5717ee4bc37f332c /src/game/g_active.c | |
parent | 0f00273fe1b2c7044dd23512408632eae6e0dca6 (diff) |
0.1.6
Diffstat (limited to 'src/game/g_active.c')
-rw-r--r-- | src/game/g_active.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c index 05bda16..1fa0caa 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -168,6 +168,19 @@ void P_WorldEffects( gentity_t *ent ) ent->client->airOutTime = level.time + 12000; ent->damage = 2; } +} + +void P_WorldEffects_Fast( gentity_t *ent ) +{ + int waterlevel; + + if( ent->client->noclip ) + { + ent->client->airOutTime = level.time + 12000; // don't need air + return; + } + + waterlevel = ent->waterlevel; // // check for sizzle damage (move to pmove?) @@ -175,26 +188,24 @@ void P_WorldEffects( gentity_t *ent ) if( waterlevel && ( ent->watertype & ( CONTENTS_LAVA | CONTENTS_SLIME ) ) ) { - if( ent->health > 0 && - ent->pain_debounce_time <= level.time ) + if( ent->health > 0 ) { if( ent->watertype & CONTENTS_LAVA ) { G_Damage( ent, NULL, NULL, NULL, NULL, - 30 * waterlevel, 0, MOD_LAVA ); + 3 * waterlevel, 0, MOD_LAVA ); } if( ent->watertype & CONTENTS_SLIME ) { G_Damage( ent, NULL, NULL, NULL, NULL, - 10 * waterlevel, 0, MOD_SLIME ); + 1 * waterlevel, 0, MOD_SLIME ); } } } } - /* =============== G_SetClientSound @@ -629,6 +640,8 @@ void ClientTimerActions( gentity_t *ent, int msec ) weapon_t weapon = BG_GetPlayerWeapon( &client->ps ); client->time100 -= 100; + + P_WorldEffects_Fast( ent ); // Restore or subtract stamina if( stopped || client->ps.pm_type == PM_JETPACK ) @@ -757,13 +770,16 @@ void ClientTimerActions( gentity_t *ent, int msec ) if( ent->client->bioresHealTimer >= 100 ) { int delta; - + delta = ent->client->bioresHealTimer / 100; ent->health = MAX( MIN( ent->health+delta, ent->client->ps.stats[ STAT_MAX_HEALTH ] ), 1 ); - + ent->client->bioresHealTimer %= 100; } - + + ent->client->ps.stats[ STAT_SHAKE ] *= 0.77f; + if( ent->client->ps.stats[ STAT_SHAKE ] < 0 ) + ent->client->ps.stats[ STAT_SHAKE ] = 0; } while( client->time1000 >= 1000 ) |