From 10107e224bbaa2a39cd1296905d27e4d927cf207 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Thu, 8 Dec 2005 19:25:25 +0000 Subject: * Reduced Dragoon pounce range to 64 from 96 * Dragoon pounce now incurs 400ms wait before other weapons may be used * Trapper cost down to 8 from 10 * Hovel is now free, but only one can be built * Teslagen damage up to 9 from 7 * Non locational damage does not apply locational armour anymore; instead it averages the armour regions together * Tweaks to pain blends * Added cg_animation.c, which apparently I forgot * Added generate-infopanes.sh and infopanes.def.h --- src/game/g_combat.c | 72 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 25 deletions(-) (limited to 'src/game/g_combat.c') diff --git a/src/game/g_combat.c b/src/game/g_combat.c index e869c046..d98f74c3 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -718,7 +718,29 @@ static float G_CalcDamageModifier( vec3_t point, gentity_t *targ, gentity_t *att hitRotation = hitRotation % 360; // Keep it in the 0-359 range - if( !( dflags & DAMAGE_NO_LOCDAMAGE ) ) + if( dflags & DAMAGE_NO_LOCDAMAGE ) + { + for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) + { + float totalModifier = 0.0f; + float averageModifier = 1.0f; + + //average all of this upgrade's armour regions together + if( BG_InventoryContainsUpgrade( i, targ->client->ps.stats ) ) + { + for( j = 0; j < g_numArmourRegions[ i ]; j++ ) + totalModifier += g_armourRegions[ i ][ j ].modifier; + + if( g_numArmourRegions[ i ] ) + averageModifier = totalModifier / g_numArmourRegions[ i ]; + else + averageModifier = 1.0f; + } + + modifier *= averageModifier; + } + } + else { for( i = 0; i < g_numDamageRegions[ class ]; i++ ) { @@ -744,35 +766,35 @@ static float G_CalcDamageModifier( vec3_t point, gentity_t *targ, gentity_t *att ( targ->client->ps.pm_flags & PMF_DUCKED ) ) ) modifier *= g_damageRegions[ class ][ i ].modifier; } - } - for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) - { - if( BG_InventoryContainsUpgrade( i, targ->client->ps.stats ) ) + for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) { - for( j = 0; j < g_numArmourRegions[ i ]; j++ ) + if( BG_InventoryContainsUpgrade( i, targ->client->ps.stats ) ) { - qboolean rotationBound; - - if( g_armourRegions[ i ][ j ].minAngle > - g_armourRegions[ i ][ j ].maxAngle ) - { - rotationBound = ( hitRotation >= g_armourRegions[ i ][ j ].minAngle && - hitRotation <= 360 ) || ( hitRotation >= 0 && - hitRotation <= g_armourRegions[ i ][ j ].maxAngle ); - } - else + for( j = 0; j < g_numArmourRegions[ i ]; j++ ) { - rotationBound = ( hitRotation >= g_armourRegions[ i ][ j ].minAngle && - hitRotation <= g_armourRegions[ i ][ j ].maxAngle ); - } + qboolean rotationBound; - if( rotationBound && - hitRatio >= g_armourRegions[ i ][ j ].minHeight && - hitRatio <= g_armourRegions[ i ][ j ].maxHeight && - ( g_armourRegions[ i ][ j ].crouch == - ( targ->client->ps.pm_flags & PMF_DUCKED ) ) ) - modifier *= g_armourRegions[ i ][ j ].modifier; + if( g_armourRegions[ i ][ j ].minAngle > + g_armourRegions[ i ][ j ].maxAngle ) + { + rotationBound = ( hitRotation >= g_armourRegions[ i ][ j ].minAngle && + hitRotation <= 360 ) || ( hitRotation >= 0 && + hitRotation <= g_armourRegions[ i ][ j ].maxAngle ); + } + else + { + rotationBound = ( hitRotation >= g_armourRegions[ i ][ j ].minAngle && + hitRotation <= g_armourRegions[ i ][ j ].maxAngle ); + } + + if( rotationBound && + hitRatio >= g_armourRegions[ i ][ j ].minHeight && + hitRatio <= g_armourRegions[ i ][ j ].maxHeight && + ( g_armourRegions[ i ][ j ].crouch == + ( targ->client->ps.pm_flags & PMF_DUCKED ) ) ) + modifier *= g_armourRegions[ i ][ j ].modifier; + } } } } -- cgit