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

86
.gitignore vendored Normal file → Executable file
View file

@ -1,38 +1,48 @@
*.mak *.mak
*.mak.vpc_crc *.mak.vpc_crc
*.vpc_crc *.vpc_crc
*.vpc.* *.vpc.*
*.project *.project
*obj_* *obj_*
.waf* .waf*
.lock-waf* .lock-waf*
__pycache__ __pycache__
*.pyc *.pyc
.vs/ .vs/
Debug/ Debug/
Debug_*/ Debug_*/
Release/ Release/
Release_*/ Release_*/
*.tlog/ *.tlog/
*.obj *.obj
*.pch *.pch
*.log *.log
*.idb *.idb
*.pdb *.pdb
*.rc *.rc
*.vcxproj* *.vcxproj*
*.sln *.sln
*.dll* *.dll*
*.exp *.exp
*.ilk *.exe
ValveETWProviderEvents.h *.ilk
game/client/*/client.lib ValveETWProviderEvents.h
game/server/*/server.lib game/client/*/client.lib
.DS_Store game/server/*/server.lib
build*/ .DS_Store
.cache/ build*/
.ccache/ .cache/
waf3*/ .ccache/
.vscode/ waf3*/
.depproj/ .vscode/
source-engine.sln .depproj/
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;
} }
} }