From 08fa53ab87e9510c714f18c5a4b52eb99599a377 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 15 Mar 2004 04:17:38 +0000 Subject: * Added knockback scaling * Balance tweaks * A load of other stuff I can't remember --- src/game/g_combat.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/game/g_combat.c') diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 675b917d..6ffe9edc 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -216,6 +216,15 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int if( attacker == self || OnSameTeam( self, attacker ) ) { AddScore( attacker, -1 ); + + //punish team kills and suicides + if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + attacker->client->ps.persistant[ PERS_CREDIT ]--; + else if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + attacker->client->ps.persistant[ PERS_CREDIT ] -= ASPAWN_VALUE; + + if( attacker->client->ps.persistant[ PERS_CREDIT ] < 0 ) + attacker->client->ps.persistant[ PERS_CREDIT ] = 0; } else { @@ -271,8 +280,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int { attacker->client->ps.persistant[ PERS_CREDIT ]++; - if( attacker->client->ps.persistant[ PERS_CREDIT ] > HUMAN_MAX_CREDITS ) - attacker->client->ps.persistant[ PERS_CREDIT ] = HUMAN_MAX_CREDITS; + if( attacker->client->ps.persistant[ PERS_CREDIT ] > ALIEN_MAX_KILLS ) + attacker->client->ps.persistant[ PERS_CREDIT ] = ALIEN_MAX_KILLS; } // Add team bonuses @@ -870,6 +879,13 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, VectorNormalize( dir ); knockback = damage; + + if( targ->client ) + { + knockback = (int)( (float)knockback * + BG_FindKnockbackScaleForClass( targ->client->ps.stats[ STAT_PCLASS ] ) ); + } + if( knockback > 200 ) knockback = 200; -- cgit