Adjusted some values for m82a1

This commit is contained in:
Kamay Xutax 2024-09-07 05:33:20 +02:00
parent 17e392f0ee
commit eeed4b8ada
2 changed files with 66 additions and 53 deletions

10
.gitignore vendored Normal file → Executable file
View file

@ -24,6 +24,7 @@ Release_*/
*.sln *.sln
*.dll* *.dll*
*.exp *.exp
*.exe
*.ilk *.ilk
ValveETWProviderEvents.h ValveETWProviderEvents.h
game/client/*/client.lib game/client/*/client.lib
@ -36,3 +37,12 @@ waf3*/
.vscode/ .vscode/
.depproj/ .depproj/
source-engine.sln source-engine.sln
gamedata/css_enhanced/game/cstrike/cfg/config.cfg
gamedata/css_enhanced/game/bin/*.lib
gamedata/css_enhanced/game/cstrike/bin/*.lib
gamedata/css_enhanced/game/cstrike/downladlists/*
gamedata/css_enhanced/game/cstrike/download/*
*.cache
*.tmp
*.lst
gamedata/css_enhanced/game/cstrike/textwindow_temp.html

View file

@ -110,7 +110,7 @@ void CWeaponM82A1::Spawn()
void CWeaponM82A1::SecondaryAttack() void CWeaponM82A1::SecondaryAttack()
{ {
const float kZoomTime = 0.2f; static constexpr float kZoomTime = 0.2f;
CCSPlayer *pPlayer = GetPlayerOwner(); CCSPlayer *pPlayer = GetPlayerOwner();
@ -122,27 +122,27 @@ void CWeaponM82A1::SecondaryAttack()
if ( pPlayer->GetFOV() == pPlayer->GetDefaultFOV() ) if ( pPlayer->GetFOV() == pPlayer->GetDefaultFOV() )
{ {
pPlayer->SetFOV( pPlayer, FOVValues[FOV_SCOPE_1], kZoomTime ); m_iLastZoom = FOVValues[FOV_SCOPE_1];
m_weaponMode = Secondary_Mode; m_weaponMode = Secondary_Mode;
m_fAccuracyPenalty += GetCSWpnData().m_fInaccuracyAltSwitch; m_fAccuracyPenalty += GetCSWpnData().m_fInaccuracyAltSwitch;
} }
else if ( pPlayer->GetFOV() == FOVValues[FOV_SCOPE_1] ) else if ( pPlayer->GetFOV() == FOVValues[FOV_SCOPE_1] )
{ {
pPlayer->SetFOV( pPlayer, FOVValues[FOV_SCOPE_2], kZoomTime ); m_iLastZoom = FOVValues[FOV_SCOPE_2];
m_weaponMode = Secondary_Mode; m_weaponMode = Secondary_Mode;
} }
else if ( pPlayer->GetFOV() == FOVValues[FOV_SCOPE_2] ) else if ( pPlayer->GetFOV() == FOVValues[FOV_SCOPE_2] )
{ {
pPlayer->SetFOV( pPlayer, FOVValues[FOV_SCOPE_3], kZoomTime ); m_iLastZoom = FOVValues[FOV_SCOPE_3];
m_weaponMode = Secondary_Mode; m_weaponMode = Secondary_Mode;
} }
else else
{ {
pPlayer->SetFOV( pPlayer, pPlayer->GetDefaultFOV(), kZoomTime ); m_iLastZoom = pPlayer->GetDefaultFOV();
m_weaponMode = Primary_Mode; m_weaponMode = Primary_Mode;
} }
m_iLastZoom = pPlayer->GetFOV(); pPlayer->SetFOV( pPlayer, m_iLastZoom, kZoomTime );
#ifndef CLIENT_DLL #ifndef CLIENT_DLL
// If this isn't guarded, the sound will be emitted twice, once by the server and once by the client. // If this isn't guarded, the sound will be emitted twice, once by the server and once by the client.
@ -170,7 +170,7 @@ void CWeaponM82A1::SecondaryAttack()
#endif #endif
m_flNextSecondaryAttack = gpGlobals->curtime + 0.4f; m_flNextSecondaryAttack = gpGlobals->curtime + 0.4f;
m_zoomFullyActiveTime = gpGlobals->curtime + 0.2f; m_zoomFullyActiveTime = gpGlobals->curtime + kZoomTime;
} }
@ -229,10 +229,13 @@ void CWeaponM82A1::PrimaryAttack()
#endif #endif
} }
QAngle angle = pPlayer->GetPunchAngle();
RandomSeed( pPlayer->GetPredictionRandomSeed() ); RandomSeed( pPlayer->GetPredictionRandomSeed() );
angle.x -= 15 + RandomFloat( 2, 8 );
angle.y -= static_cast< float >( RandomInt( -1, 1 ) ) * RandomFloat( 2, 4 ); QAngle angle = pPlayer->GetPunchAngle();
angle.x -= 15 + RandomFloat( 5, 10 );
angle.y -= static_cast< float >( RandomInt( -1, 1 ) ) * RandomFloat( 2, 5 );
pPlayer->SetPunchAngle( angle ); pPlayer->SetPunchAngle( angle );
} }
@ -269,7 +272,7 @@ float CWeaponM82A1::GetMaxSpeed() const
else else
{ {
// Slower speed when zoomed in. // Slower speed when zoomed in.
return 100; return 90;
} }
} }