summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2018-12-04 21:47:14 +0100
committernavewindre <boneyaard@gmail.com>2018-12-04 21:47:14 +0100
commit68dbb976714f884e29e0abe1adc0bf2fa624e00b (patch)
tree55cec805ab36797f4d30b86431d83cb5e4454a50
parent8f4543089c3e33c1dc9dc1fb5979c205ed66e2e0 (diff)
dad
-rw-r--r--cheat/internal_rewrite/ragebot_antiaim.cpp2
-rw-r--r--cheat/internal_rewrite/visual.hpp1
-rw-r--r--cheat/internal_rewrite/visual_local.cpp80
-rw-r--r--cheat/internal_rewrite/visual_player.cpp3
4 files changed, 85 insertions, 1 deletions
diff --git a/cheat/internal_rewrite/ragebot_antiaim.cpp b/cheat/internal_rewrite/ragebot_antiaim.cpp
index 33cc046..8cba797 100644
--- a/cheat/internal_rewrite/ragebot_antiaim.cpp
+++ b/cheat/internal_rewrite/ragebot_antiaim.cpp
@@ -563,7 +563,7 @@ namespace features
break;
case 3: {
constexpr static double rate = 360.0 / 1.618033988749895;
- aim_angle.y += ( -jitter * 0.5f ) + ( std::fmod( g_csgo.m_globals->m_curtime * rate, jitter + 1.f ) );
+ aim_angle.y += ( -jitter * 0.5f ) + ( std::fmod( g_csgo.m_globals->m_curtime * ( ( 1.f - ( 90.f - jitter ) / 90.f ) * rate ), jitter + 1.f ) );
break;
}
default: break;
diff --git a/cheat/internal_rewrite/visual.hpp b/cheat/internal_rewrite/visual.hpp
index 4d0e996..fd11743 100644
--- a/cheat/internal_rewrite/visual.hpp
+++ b/cheat/internal_rewrite/visual.hpp
@@ -42,6 +42,7 @@ namespace features
void draw_local( );
void draw_players( );
void draw_world( );
+ void do_christmas( );
void draw_hits( );
void spectator_list( );
diff --git a/cheat/internal_rewrite/visual_local.cpp b/cheat/internal_rewrite/visual_local.cpp
index 927486a..e6c6d4b 100644
--- a/cheat/internal_rewrite/visual_local.cpp
+++ b/cheat/internal_rewrite/visual_local.cpp
@@ -9,12 +9,92 @@
namespace features
{
+ class flake {
+ public:
+ vec2_t pos;
+ float time;
+ float speed;
+ float fall_ang;
+ float fall_time;
+ int size;
+ };
+
+ void c_visuals::do_christmas( ) {
+ int screen_w, screen_h;
+ g_csgo.m_engine( )->GetScreenSize( screen_w, screen_h );
+
+ const float degree_offset = 80.f;
+
+ static std::vector< flake > flakes;
+ static float last_time = 0.f;
+ float curtime = g_csgo.m_globals->m_curtime;
+
+ if( std::abs( last_time - curtime ) > 1.f )
+ flakes.clear( );
+
+ auto num_new = math::random_number( 0, 2 );
+
+ for( size_t i{ }; i < num_new; ++i ) {
+ int rand_x = math::random_number( 0, screen_w - 100 );
+ int rand_ang = math::random_number( -30.f, 15.f );
+ int rand_size = math::random_number( 1, 4 );
+ int rand_speed = math::random_number( 1.5f, 6.f );
+
+ flake new_flake;
+ new_flake.pos = { ( float )( rand_x ), 0.f };
+ new_flake.fall_ang = rand_ang + degree_offset;
+ new_flake.fall_time = 0.f;
+ new_flake.size = rand_size;
+ new_flake.speed = rand_speed;
+ new_flake.time = curtime;
+
+ flakes.push_back( new_flake );
+ }
+
+ for( size_t i{ }; i < flakes.size( ) && !flakes.empty( ); ++i ) {
+ auto* it = &flakes.at( i );
+
+ float ang = it->fall_ang;
+
+ float x = cos( DEG2RAD( ang ) );
+ float y = sin( DEG2RAD( ang ) );
+
+ float alpha = 1.f;
+ if( it->pos.y + it->size / 2 >= screen_h - 1 ) {
+ if( !it->fall_time )
+ it->fall_time = curtime;
+
+ float totaltime = it->speed / 3.f;
+ float endtime = it->fall_time + totaltime;
+
+ float delta = ( endtime - curtime ) / totaltime;
+ if( delta < 0.f ) {
+ flakes.erase( flakes.begin( ) + i );
+ continue;
+ }
+
+ delta = std::clamp( delta, 0.f, 1.f );
+ alpha = delta;
+ }
+ else {
+ it->pos.x += x * it->speed;
+ it->pos.y += y * it->speed;
+ }
+
+ for( size_t i{ }; i <= it->size; ++i )
+ draw_circle( ( float )it->pos.x, ( float )it->pos.y, i, clr_t( 255, 255, 255, alpha * 255 ) );
+ }
+
+ last_time = g_csgo.m_globals->m_curtime;
+ }
+
void c_visuals::draw_local( ) {
int screen_w, screen_h;
g_csgo.m_engine( )->GetScreenSize( screen_w, screen_h );
int cur_pos{ };
+ //do_christmas( );
draw_shots( );
grenade_prediction( );
draw_spread( );
diff --git a/cheat/internal_rewrite/visual_player.cpp b/cheat/internal_rewrite/visual_player.cpp
index cb99fb7..2bcc6d3 100644
--- a/cheat/internal_rewrite/visual_player.cpp
+++ b/cheat/internal_rewrite/visual_player.cpp
@@ -1149,6 +1149,9 @@ namespace features
draw_local( );
}
+ if( !g_ctx.m_local || ( g_ctx.m_local && !g_ctx.m_local->is_valid( ) ) )
+ do_christmas( );
+
if( !g_ctx.m_local )
return;