void CBliinkPlayerShared::SetJumping( bool bJumping ) { m_bJumping = bJumping; if ( IsSniperZoomed() ) { ForceUnzoom(); } }
void CSDKPlayerShared::StartGoingProne( void ) { // make the prone sound CPASFilter filter( m_pOuter->GetAbsOrigin() ); filter.UsePredictionRules(); m_pOuter->EmitSound( filter, m_pOuter->entindex(), "Player.GoProne" ); // slow to prone speed m_flGoProneTime = m_pOuter->GetCurrentTime() + TIME_TO_PRONE; m_flUnProneTime = 0.0f; //reset if ( IsSniperZoomed() ) ForceUnzoom(); }
void CSDKPlayerShared::StartRolling(bool bFromDive) { if (!CanRoll()) return; if (bFromDive) m_pOuter->Instructor_LessonLearned("rollafterdive"); m_bRolling = true; m_bRollingFromDive = bFromDive; ForceUnzoom(); m_vecRollDirection = m_pOuter->GetAbsVelocity(); m_vecRollDirection.GetForModify().NormalizeInPlace(); m_flRollTime = m_pOuter->GetCurrentTime(); }
void CSDKPlayerShared::SetProne( bool bProne, bool bNoAnimation /* = false */ ) { m_bProne = bProne; m_bProneSliding = false; m_flDisallowUnProneTime = -1; if (bNoAnimation) { m_flGoProneTime = 0; m_flUnProneTime = 0; } if (!bProne) // forceunzoom for going prone is in StartGoingProne { ForceUnzoom(); m_pOuter->ReadyWeapon(); } }
void CDODPlayerShared::SetProne( bool bProne, bool bNoAnimation /* = false */ ) { m_bProne = bProne; if ( bNoAnimation ) { m_flGoProneTime = 0; m_flUnProneTime = 0; // cancel the view animation! m_bForceProneChange = true; } if ( !bProne /*&& IsSniperZoomed()*/ ) // forceunzoom for going prone is in StartGoingProne { ForceUnzoom(); } }
void CSDKPlayerShared::StartSliding(bool bDiveSliding) { if (!CanSlide()) return; m_pOuter->UseStyleCharge(SKILL_ATHLETIC, 5); PlayStartSlideSound(); m_bSliding = true; m_bDiveSliding = bDiveSliding; SetAirSliding(false); ForceUnzoom(); m_vecSlideDirection = m_pOuter->GetAbsVelocity(); m_vecSlideDirection.GetForModify().NormalizeInPlace(); m_flSlideTime = m_pOuter->GetCurrentTime(); m_flUnSlideTime = 0; m_bMustDuckFromSlide = false; }
Vector CSDKPlayerShared::StartDiving() { if (!CanDive()) return m_pOuter->GetAbsVelocity(); m_flDiveTime = m_pOuter->GetCurrentTime(); m_flDiveLerped = 0; m_flDiveToProneLandTime = -1; m_pOuter->UseStyleCharge(SKILL_ATHLETIC, 5); CPASFilter filter( m_pOuter->GetAbsOrigin() ); filter.UsePredictionRules(); m_pOuter->EmitSound( filter, m_pOuter->entindex(), "Player.GoDive" ); m_bDiving = true; m_bRollAfterDive = true; #ifdef GAME_DLL m_pOuter->OnDive(); #endif ForceUnzoom(); m_vecDiveDirection = m_pOuter->GetAbsVelocity(); m_vecDiveDirection.GetForModify().z = 0; m_vecDiveDirection.GetForModify().NormalizeInPlace(); m_pOuter->DoAnimationEvent(PLAYERANIMEVENT_DIVE); bool bWasOnGround = m_pOuter->GetFlags() & FL_ONGROUND; m_pOuter->SetGroundEntity(NULL); m_pOuter->Instructor_LessonLearned("dive"); Assert (m_pOuter->m_Shared.m_flRunSpeed); float flSpeedFraction = RemapValClamped(m_pOuter->GetAbsVelocity().Length()/m_pOuter->m_Shared.m_flRunSpeed, 0, 1, 0.2f, 1); float flDiveHeight = sdk_dive_height.GetFloat(); float y = m_pOuter->EyeAngles ().x; float arc = da_acro_dive_arc.GetFloat (); if (y > arc) flDiveHeight *= 0.33; else if (y < -arc) flDiveHeight *= 1.66; if (!bWasOnGround) flDiveHeight = sdk_dive_height_high.GetFloat(); float flRatio = sdk_dive_height_adrenaline.GetFloat()/flDiveHeight; float flModifier = (flRatio - 1)/2; flDiveHeight = ModifySkillValue (flDiveHeight, flModifier, SKILL_ATHLETIC); flRatio = sdk_dive_gravity_adrenaline.GetFloat()/sdk_dive_gravity.GetFloat(); flModifier = (flRatio - 1)/2; m_pOuter->SetGravity(ModifySkillValue(sdk_dive_gravity.GetFloat(), flModifier, SKILL_ATHLETIC)); ConVarRef sdk_dive_speed("sdk_dive_speed"); flRatio = sdk_dive_speed_adrenaline.GetFloat()/sdk_dive_speed.GetFloat(); flModifier = (flRatio - 1)/2; return m_vecDiveDirection.Get() * (ModifySkillValue(sdk_dive_speed.GetFloat(), flModifier, SKILL_ATHLETIC) * flSpeedFraction) + Vector(0, 0, flDiveHeight); }