Новичок
-
Автор темы
- #1
Код:
void DoDistort( ) {
bool do_distort = true;
bool cant_distort = g_menu.main.antiaim.manual_ignorance.get( 1 ) && ( g_hvh.m_left || g_hvh.m_back || g_hvh.m_right || g_hvh.m_forward );
// stand.
if( g_cl.m_speed < 0.1f && g_cl.m_ground ) {
if( g_menu.main.antiaim.distort_disablers.get( 0 ) )
do_distort = false;
}
// move.
if( g_cl.m_speed > 0.1f && g_cl.m_ground || g_input.GetKeyState( g_menu.main.movement.fakewalk.get( ) ) ) {
if( g_menu.main.antiaim.distort_disablers.get( 1 ) )
do_distort = false;
}
// air.
else if( g_menu.main.antiaim.distort_disablers.get( 2 ) && !g_cl.m_ground ) {
do_distort = false;
}
if( !cant_distort && do_distort ) {
static auto interval_per_tick_sim{ g_csgo.m_globals->m_interval };
bool change_dist_dir{};
static bool change_dir{};
interval_per_tick_sim += g_csgo.m_globals->m_interval;
if( interval_per_tick_sim >= 1.f )
interval_per_tick_sim = 0.f;
static auto final_wish_ang{ g_cl.m_cmd->m_view_angles.y };
static auto angle = g_cl.m_cmd->m_view_angles.y;
const auto distortion_speed = ( g_menu.main.antiaim.dir_distort_speed.get( ) * 3.f ) / 100.f;
const auto distortion = std::sin( ( g_csgo.m_globals->m_curtime * distortion_speed ) * math::pi );
const auto dist_factor = ( g_menu.main.antiaim.dir_distort_range.get( ) / 100.f ) * 120.f;
auto total_distortion = dist_factor * distortion;
if( g_menu.main.antiaim.shift_distortion.get( ) ) {
if( g_hvh.m_lby_counter_updated == g_hvh.m_lby_counter
|| ( g_hvh.m_lby_counter_updated = g_hvh.m_lby_counter, ++g_hvh.m_lby_on_same_pos, g_hvh.m_lby_on_same_pos < g_menu.main.antiaim.shift_await.get( ) ) ) {
change_dist_dir = change_dir;
}
else {
g_hvh.m_lby_on_same_pos = 0;
change_dist_dir = change_dir == false;
change_dir = !change_dir;
}
auto shift_factor_mult = g_menu.main.antiaim.dir_shift_range.get( ) / 100.f;
if( !change_dist_dir ) {
shift_factor_mult *= -1.f;
}
total_distortion = ( shift_factor_mult + distortion ) * dist_factor;
}
if( g_menu.main.antiaim.force_turn.get( ) ) {
const auto distortion_speed_updated = std::exp( distortion_speed * interval_per_tick_sim );
auto final_distortion_angle = distortion_speed_updated * ( ( g_menu.main.antiaim.dir_distort_range.get( ) * 120.f ) / 100.f );
auto additional_delta{ 0.f };
if( change_dir )
additional_delta = 60.f;
else {
additional_delta = -60.f;
final_distortion_angle *= -1.f;
}
final_wish_ang = ( additional_delta + angle ) + final_distortion_angle;
}
else {
final_wish_ang = angle + total_distortion;
}
final_wish_ang = math::NormalizeYaw( final_wish_ang );
g_cl.m_cmd->m_view_angles.y = final_wish_ang;
}
}
s/o @lil_chief_keef
Последнее редактирование: