diff --git a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CMisc/CMisc.cpp b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CMisc/CMisc.cpp index 9da0b68..642f542 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CMisc/CMisc.cpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CMisc/CMisc.cpp @@ -328,6 +328,29 @@ static CMisc g_CMisc{}; auto CMisc::OnRender() -> void { + if ( !Settings::Misc::Watermark && !Settings::Misc::Speedometer ) + return; + + auto& pFont = GetFontManager()->m_VerdanaFont; + float Y = 8.f; + + if ( Settings::Misc::Speedometer ) + { + auto* pLocalPawn = GetCL_Players()->GetLocalPlayerPawn(); + + if ( pLocalPawn && pLocalPawn->IsAlive() ) + { + const float flSpeed = pLocalPawn->m_vecVelocity().Length2D() * 0.05f; + + char szBuffer[ 64 ]; + std::snprintf( szBuffer , sizeof szBuffer , XorStr( "%.0f u/s" ) , flSpeed ); + + pFont.DrawString( 8 , Y , ImColor( 255 , 255 , 255 ) , FW1_LEFT , "%s" , szBuffer ); + } + + Y += pFont.GetFontSize(); + } + if ( !Settings::Misc::Watermark ) return; @@ -339,7 +362,7 @@ auto CMisc::OnRender() -> void std::snprintf( szBuffer , sizeof szBuffer , XorStr( "Evicted | FPS: %.0f | %02d:%02d:%02d" ) , ImGui::GetIO().Framerate , tm.tm_hour , tm.tm_min , tm.tm_sec ); - GetFontManager()->m_VerdanaFont.DrawString( 8 , 8 , ImColor( 255 , 255 , 0 ) , FW1_LEFT , "%s" , szBuffer ); + pFont.DrawString( 8 , Y , ImColor( 255 , 255 , 0 ) , FW1_LEFT , "%s" , szBuffer ); } auto CMisc::OnClientOutput() -> void @@ -470,9 +493,16 @@ auto CMisc::OnCreateMove( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void if ( bHoldingJump ) { if ( bOnGround ) - pUserCmd->button_states.buttonstate1 |= IN_JUMP; + { + if ( Settings::Misc::PerfectBhop ) + GetCL_Bypass()->SetJump( pUserCmd , true ); + else + pUserCmd->button_states.buttonstate1 |= IN_JUMP; + } else + { pUserCmd->button_states.buttonstate1 &= ~IN_JUMP; + } } } } @@ -517,9 +547,15 @@ auto CMisc::RunMovement( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void if ( Settings::Misc::JumpBug ) { if ( !bOnGround && pLocalPawn->m_flFallVelocity() > 430.f ) + { + pUserCmd->button_states.buttonstate1 &= ~IN_DUCK; GetCL_Bypass()->SetJump( pUserCmd , true ); + } } + if ( Settings::Misc::EdgeBug ) + RunEdgeBug( pInput , pUserCmd , pLocalPawn , bOnGround ); + if ( Settings::Misc::EdgeJump ) { if ( m_bWasOnGround && !bOnGround ) @@ -529,6 +565,12 @@ auto CMisc::RunMovement( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void } } + if ( Settings::Misc::JumpCrouch ) + { + if ( bOnGround && ( pUserCmd->button_states.buttonstate1 & IN_JUMP ) ) + pUserCmd->button_states.buttonstate1 |= IN_DUCK; + } + if ( Settings::Misc::LongJump ) { if ( !bOnGround ) @@ -886,6 +928,100 @@ auto CMisc::RotateMoveToYaw( CBaseUserCmdPB* pBaseCmd , const float flTargetYaw pBaseCmd->set_leftmove( std::clamp( -flCorrectedSide , -1.f , 1.f ) ); } +auto CMisc::RunEdgeBug( CCSGOInput* pInput , CUserCmd* pUserCmd , C_CSPlayerPawn* pLocalPawn , bool bOnGround ) -> void +{ + if ( bOnGround ) + return; + + if ( !pUserCmd || !pLocalPawn ) + return; + + const Vector3 Velocity = pLocalPawn->m_vecVelocity(); + + if ( Velocity.m_z >= 0.f ) + return; + + constexpr float k_Pi = 3.14159265358979f; + constexpr float k_TickInterval = 1.f / 64.f; + constexpr float k_HalfWidth = 16.f; + constexpr float k_ProbeDist = 32.f; + + const Vector3 vOrigin = pLocalPawn->m_vOldOrigin(); + + const Vector3 vNextPos + { + vOrigin.m_x + Velocity.m_x * k_TickInterval, + vOrigin.m_y + Velocity.m_y * k_TickInterval, + vOrigin.m_z + Velocity.m_z * k_TickInterval + }; + + const float flVelocityYaw = std::atan2f( Velocity.m_y , Velocity.m_x ) * ( 180.f / k_Pi ); + + const Vector3 vOffsets[] + { + Vector3( 0.f , 0.f , 0.f ), + Vector3( k_HalfWidth , k_HalfWidth , 0.f ), + Vector3( k_HalfWidth , -k_HalfWidth , 0.f ), + Vector3( -k_HalfWidth , k_HalfWidth , 0.f ), + Vector3( -k_HalfWidth , -k_HalfWidth , 0.f ) + }; + + Ray_t Ray; + CGameTrace GameTrace; + CTraceFilter Filter( 0x1C1003 , pLocalPawn , 3 , 15 ); + + Vector3 vEdgeNormal; + + bool bFoundEdge = false; + + for ( const auto& vOffset : vOffsets ) + { + const Vector3 vProbeStart + { + vNextPos.m_x + vOffset.m_x, + vNextPos.m_y + vOffset.m_y, + vNextPos.m_z + }; + + // Ground probe straight down below this corner. + Ray.Start = vProbeStart; + Ray.End = vProbeStart; + Ray.End.m_z -= k_ProbeDist; + + if ( !IGamePhysicsQuery_TraceShape( SDK::Pointers::CVPhys2World() , Ray , Ray.Start , Ray.End , &Filter , &GameTrace ) ) + continue; + + const float flGroundFraction = GameTrace.flFraction; + + // Wall probe in the direction of travel at the same height. + Ray.Start = vProbeStart; + Ray.Start.m_z -= 2.f; + Ray.End = Ray.Start; + Ray.End.m_x += std::cosf( flVelocityYaw * ( k_Pi / 180.f ) ) * k_ProbeDist; + Ray.End.m_y += std::sinf( flVelocityYaw * ( k_Pi / 180.f ) ) * k_ProbeDist; + + if ( !IGamePhysicsQuery_TraceShape( SDK::Pointers::CVPhys2World() , Ray , Ray.Start , Ray.End , &Filter , &GameTrace ) ) + continue; + + // Open ground below + wall ahead = pixel / edge surface. + if ( flGroundFraction > 0.9f && GameTrace.flFraction < 0.95f ) + { + bFoundEdge = true; + vEdgeNormal = GameTrace.vecNormal; + break; + } + } + + if ( !bFoundEdge ) + return; + + // Only assist when the edge is below us (steep / vertical-ish face). + if ( vEdgeNormal.m_z > 0.7f ) + return; + + GetCL_Bypass()->SetJump( pUserCmd , true ); +} + auto CMisc::RunTriggerbot( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void { auto Reset = [ & ]() diff --git a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CMisc/CMisc.hpp b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CMisc/CMisc.hpp index 08774f8..132856a 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CMisc/CMisc.hpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CMisc/CMisc.hpp @@ -42,6 +42,7 @@ private: auto RunAutoStrafe( CCSGOInput* pInput , CUserCmd* pUserCmd , C_CSPlayerPawn* pLocalPawn , bool bOnGround ) -> void; auto RunNullStrafe( CCSGOInput* pInput , CUserCmd* pUserCmd , C_CSPlayerPawn* pLocalPawn , bool bOnGround ) -> void; auto RunSubtickStrafe( CCSGOInput* pInput , CUserCmd* pUserCmd , C_CSPlayerPawn* pLocalPawn , bool bOnGround ) -> void; + auto RunEdgeBug( CCSGOInput* pInput , CUserCmd* pUserCmd , C_CSPlayerPawn* pLocalPawn , bool bOnGround ) -> void; auto RotateMoveToYaw( CBaseUserCmdPB* pBaseCmd , const float flTargetYaw , const float flViewYaw ) -> void; private: diff --git a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.cpp b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.cpp index f43abce..31ede1a 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.cpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.cpp @@ -332,15 +332,19 @@ auto CAndromedaMenu::RenderMiscPanel() -> void ImGui::SeparatorText( "Movement" ); Checkbox( "Bunnyhop" , Settings::Misc::Bunnyhop ); + Checkbox( "Perfect Bhop" , Settings::Misc::PerfectBhop ); Checkbox( "Auto-Strafe" , Settings::Misc::AutoStrafe ); Checkbox( "Null-Strafe" , Settings::Misc::NullStrafe ); Checkbox( "SubTick-Strafe" , Settings::Misc::SubtickStrafe ); Checkbox( "JumpBug" , Settings::Misc::JumpBug ); + Checkbox( "EdgeBug" , Settings::Misc::EdgeBug ); Checkbox( "EdgeJump" , Settings::Misc::EdgeJump ); + Checkbox( "JumpCrouch" , Settings::Misc::JumpCrouch ); Checkbox( "Fast-Stop" , Settings::Misc::FastStop ); Checkbox( "LongJump" , Settings::Misc::LongJump ); Checkbox( "Pixel Surf" , Settings::Misc::PixelSurf ); Checkbox( "Slow Walk" , Settings::Misc::SlowWalk ); + Checkbox( "Speedometer" , Settings::Misc::Speedometer ); Checkbox( "No Flash" , Settings::Misc::NoFlash ); ImGui::SeparatorText( "Camera" ); diff --git a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Settings/Settings.hpp b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Settings/Settings.hpp index 8cb2e6a..c4ca382 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Settings/Settings.hpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Settings/Settings.hpp @@ -44,11 +44,14 @@ namespace Settings namespace Misc { inline auto Bunnyhop = false; + inline auto PerfectBhop = false; inline auto AutoStrafe = false; inline auto NullStrafe = false; inline auto SubtickStrafe = false; inline auto JumpBug = false; + inline auto EdgeBug = false; inline auto EdgeJump = false; + inline auto JumpCrouch = false; inline auto FastStop = false; inline auto LongJump = false; inline auto PixelSurf = false; @@ -60,6 +63,7 @@ namespace Settings inline auto Watermark = true; inline auto Hitmarker = true; inline auto HitSound = true; + inline auto Speedometer = false; } namespace Triggerbot {