diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/bg_pmove.c | 16 | ||||
-rw-r--r-- | src/game/tremulous.h | 1 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 0b9ea7bd..e49bf4c2 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -909,7 +909,7 @@ Checks the dodge key and starts a human dodge or sprint static qboolean PM_CheckDodge( void ) { vec3_t right, forward, velocity = { 0.0f, 0.0f, 0.0f }; - float jump; + float jump, sideModifier; int i; if( pm->ps->stats[ STAT_TEAM ] != TEAM_HUMANS ) @@ -951,20 +951,30 @@ static qboolean PM_CheckDodge( void ) jump = BG_Class( pm->ps->stats[ STAT_CLASS ] )->jumpMagnitude; if( pm->cmd.rightmove && pm->cmd.forwardmove ) jump *= ( 0.5f * M_SQRT2 ); + + // Weaken dodge if slowed + if( ( pm->ps->stats[ STAT_STATE ] & SS_SLOWLOCKED ) || + ( pm->ps->stats[ STAT_STATE ] & SS_CREEPSLOWED ) || + ( pm->ps->eFlags & EF_POISONCLOUDED ) ) + sideModifier = HUMAN_DODGE_SLOWED_MODIFIER; + else + sideModifier = HUMAN_DODGE_SIDE_MODIFIER; // The dodge sets minimum velocity if( pm->cmd.rightmove ) { if( pm->cmd.rightmove < 0 ) VectorNegate( right, right ); - VectorMA( velocity, jump * HUMAN_DODGE_SIDE_MODIFIER, right, velocity ); + VectorMA( velocity, jump * sideModifier, right, velocity ); } + if( pm->cmd.forwardmove ) { if( pm->cmd.forwardmove < 0 ) VectorNegate( forward, forward ); - VectorMA( velocity, jump * HUMAN_DODGE_SIDE_MODIFIER, forward, velocity ); + VectorMA( velocity, jump * sideModifier, forward, velocity ); } + velocity[ 2 ] = jump * HUMAN_DODGE_UP_MODIFIER; // Make sure client has minimum velocity diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 4903edf2..2224af02 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -625,6 +625,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define HUMAN_BACK_MODIFIER 0.8f #define HUMAN_SIDE_MODIFIER 0.9f #define HUMAN_DODGE_SIDE_MODIFIER 2.9f +#define HUMAN_DODGE_SLOWED_MODIFIER 1.0f //changeme norf #define HUMAN_DODGE_UP_MODIFIER 0.5f #define HUMAN_DODGE_TIMEOUT 500 #define HUMAN_LAND_FRICTION 3.0f |