diff options
author | Tim Angus <tim@ngus.net> | 2005-12-08 19:25:25 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2005-12-08 19:25:25 +0000 |
commit | 10107e224bbaa2a39cd1296905d27e4d927cf207 (patch) | |
tree | 02c7175e4994c75951ca6e22a4d6ca0716a4af76 /src/game/g_combat.c | |
parent | 6bd236bb4e5c59e8f767188c11d205383acafe63 (diff) |
* 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
Diffstat (limited to 'src/game/g_combat.c')
-rw-r--r-- | src/game/g_combat.c | 72 |
1 files changed, 47 insertions, 25 deletions
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; + } } } } |