diff options
author | Tim Angus <tim@ngus.net> | 2004-03-15 04:17:38 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2004-03-15 04:17:38 +0000 |
commit | 08fa53ab87e9510c714f18c5a4b52eb99599a377 (patch) | |
tree | 665fed9d2250c90ec87bbb4abae68a3cd653d6c2 /src/game/g_combat.c | |
parent | 0825a563b705c50de551951c4c131d0482935c45 (diff) |
* Added knockback scaling
* Balance tweaks
* A load of other stuff I can't remember
Diffstat (limited to 'src/game/g_combat.c')
-rw-r--r-- | src/game/g_combat.c | 20 |
1 files changed, 18 insertions, 2 deletions
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; |