diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2015-04-08 21:45:16 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2015-04-08 21:45:16 +0200 |
commit | ee25f4aadf87fa2852bb345062eeecea9e86d1dc (patch) | |
tree | b7dd37970f250812a67c750d63b901c38fbee35f /src/game/bg_pmove.c | |
parent | 0f4407b328c59f132ee5bbf31004d31b81dc3b3b (diff) |
Revert human physics to vq3.
Diffstat (limited to 'src/game/bg_pmove.c')
-rw-r--r-- | src/game/bg_pmove.c | 165 |
1 files changed, 0 insertions, 165 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 476e195..bdddfc3 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -406,57 +406,6 @@ static float PM_CmdScale( usercmd_t *cmd ) if( pm->ps->stats[ STAT_TEAM ] == TEAM_HUMANS && pm->ps->pm_type == PM_NORMAL ) { - qboolean wasSprinting; - qboolean sprint; - wasSprinting = sprint = pm->ps->stats[ STAT_STATE ] & SS_SPEEDBOOST; - - if( pm->ps->persistant[ PERS_STATE ] & PS_SPRINTTOGGLE ) - { - if( cmd->buttons & BUTTON_SPRINT && - !( pm->ps->pm_flags & PMF_SPRINTHELD ) ) - { - sprint = !sprint; - pm->ps->pm_flags |= PMF_SPRINTHELD; - } - else if( pm->ps->pm_flags & PMF_SPRINTHELD && - !( cmd->buttons & BUTTON_SPRINT ) ) - pm->ps->pm_flags &= ~PMF_SPRINTHELD; - } - else - sprint = cmd->buttons & BUTTON_SPRINT; - - if( sprint ) - pm->ps->stats[ STAT_STATE ] |= SS_SPEEDBOOST; - else if( wasSprinting && !sprint ) - pm->ps->stats[ STAT_STATE ] &= ~SS_SPEEDBOOST; - - // Walk overrides sprint. We keep the state that we want to be sprinting - // (above), but don't apply the modifier, and in g_active we skip taking - // the stamina too. - if( sprint && !( cmd->buttons & BUTTON_WALKING ) ) - modifier *= HUMAN_SPRINT_MODIFIER; - else - modifier *= HUMAN_JOG_MODIFIER; - - if( cmd->forwardmove < 0 ) - { - //can't run backwards - modifier *= HUMAN_BACK_MODIFIER; - } - else if( cmd->rightmove ) - { - //can't move that fast sideways - modifier *= HUMAN_SIDE_MODIFIER; - } - - //must have have stamina to jump - if( pm->ps->stats[ STAT_STAMINA ] < STAMINA_SLOW_LEVEL + STAMINA_JUMP_TAKE ) - cmd->upmove = 0; - - //slow down once stamina depletes - if( pm->ps->stats[ STAT_STAMINA ] <= STAMINA_SLOW_LEVEL ) - modifier *= (float)( pm->ps->stats[ STAT_STAMINA ] + STAMINA_MAX ) / (float)(STAMINA_SLOW_LEVEL + STAMINA_MAX); - if( pm->ps->stats[ STAT_STATE ] & SS_CREEPSLOWED ) { if( BG_InventoryContainsUpgrade( UP_LIGHTARMOUR, pm->ps->stats ) || @@ -957,10 +906,6 @@ static qboolean PM_CheckJump( void ) pm->ps->stats[ STAT_MISC ] > 0 ) return qfalse; - if( ( pm->ps->stats[ STAT_TEAM ] == TEAM_HUMANS ) && - ( pm->ps->stats[ STAT_STAMINA ] < STAMINA_SLOW_LEVEL + STAMINA_JUMP_TAKE ) ) - return qfalse; - //no bunny hopping off a dodge if( pm->ps->stats[ STAT_TEAM ] == TEAM_HUMANS && pm->ps->pm_time ) @@ -999,10 +944,6 @@ static qboolean PM_CheckJump( void ) pml.walking = qfalse; pm->ps->pm_flags |= PMF_JUMP_HELD; - // take some stamina off - if( pm->ps->stats[ STAT_TEAM ] == TEAM_HUMANS ) - pm->ps->stats[ STAT_STAMINA ] -= STAMINA_JUMP_TAKE; - pm->ps->groundEntityNum = ENTITYNUM_NONE; // jump away from wall @@ -1084,108 +1025,6 @@ static qboolean PM_CheckWaterJump( void ) return qtrue; } - -/* -================== -PM_CheckDodge - -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, sideModifier; - int i; - - if( pm->ps->stats[ STAT_TEAM ] != TEAM_HUMANS ) - return qfalse; - - // Landed a dodge - if( ( pm->ps->pm_flags & PMF_CHARGE ) && - pm->ps->groundEntityNum != ENTITYNUM_NONE ) - { - pm->ps->pm_flags = ( pm->ps->pm_flags & ~PMF_CHARGE ) | PMF_TIME_LAND; - pm->ps->pm_time = HUMAN_DODGE_TIMEOUT; - } - - // Reasons why we can't start a dodge or sprint - if( pm->ps->pm_type != PM_NORMAL || pm->ps->stats[ STAT_STAMINA ] < STAMINA_SLOW_LEVEL + STAMINA_DODGE_TAKE || - ( pm->ps->pm_flags & PMF_DUCKED ) ) - return qfalse; - - // Can't dodge forward - if( pm->cmd.forwardmove > 0 ) - return qfalse; - - // Reasons why we can't start a dodge only - if( pm->ps->pm_flags & ( PMF_TIME_LAND | PMF_CHARGE ) || - pm->ps->groundEntityNum == ENTITYNUM_NONE || - !( pm->cmd.buttons & BUTTON_DODGE ) ) - return qfalse; - - // Dodge direction specified with movement keys - if( ( !pm->cmd.rightmove && !pm->cmd.forwardmove ) || pm->cmd.upmove ) - return qfalse; - - AngleVectors( pm->ps->viewangles, NULL, right, NULL ); - forward[ 0 ] = -right[ 1 ]; - forward[ 1 ] = right[ 0 ]; - forward[ 2 ] = 0.0f; - - // Dodge magnitude is based on the jump magnitude scaled by the modifiers - 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 * sideModifier, right, velocity ); - } - - if( pm->cmd.forwardmove ) - { - if( pm->cmd.forwardmove < 0 ) - VectorNegate( forward, forward ); - VectorMA( velocity, jump * sideModifier, forward, velocity ); - } - - velocity[ 2 ] = jump * HUMAN_DODGE_UP_MODIFIER; - - // Make sure client has minimum velocity - for( i = 0; i < 3; i++ ) - { - if( ( velocity[ i ] < 0.0f && - pm->ps->velocity[ i ] > velocity[ i ] ) || - ( velocity[ i ] > 0.0f && - pm->ps->velocity[ i ] < velocity[ i ] ) ) - pm->ps->velocity[ i ] = velocity[ i ]; - } - - // Jumped away - pml.groundPlane = qfalse; - pml.walking = qfalse; - pm->ps->groundEntityNum = ENTITYNUM_NONE; - pm->ps->pm_flags |= PMF_CHARGE; - pm->ps->stats[ STAT_STAMINA ] -= STAMINA_DODGE_TAKE; - pm->ps->legsAnim = ( ( pm->ps->legsAnim & ANIM_TOGGLEBIT ) ^ - ANIM_TOGGLEBIT ) | LEGS_JUMP; - PM_AddEvent( EV_JUMP ); - - return qtrue; -} - /* =================== PM_WaterJumpMove @@ -2909,9 +2748,6 @@ static void PM_Footsteps( void ) bobmove *= BG_Class( pm->ps->stats[ STAT_CLASS ] )->bobCycle; - if( pm->ps->stats[ STAT_STATE ] & SS_SPEEDBOOST ) - bobmove *= HUMAN_SPRINT_MODIFIER; - // check for footstep / splash sounds old = pm->ps->bobCycle; pm->ps->bobCycle = (int)( old + bobmove * pml.msec ) & 255; @@ -4169,7 +4005,6 @@ void PmoveSingle( pmove_t *pmove ) PM_DeadMove( ); PM_DropTimers( ); - PM_CheckDodge( ); if( pm->ps->pm_type == PM_JETPACK ) PM_JetPackMove( ); |