Update 0.01 G

This commit is contained in:
JJ
2025-11-24 23:09:38 -05:00
parent eb7c682443
commit a83a7009ac
7 changed files with 162 additions and 65 deletions
+15 -10
View File
@@ -6,16 +6,25 @@ namespace Lua
{
internal static class RecoilEngine
{
// AA0077
private const int VK_LBUTTON = 0x01;
// AA0078
private const int VK_RBUTTON = 0x02;
// AA0079
private static readonly Random _rng = new Random();
// AA0080
private static bool _jitterActive = false;
// AA0081
private static int _jitterStart = 0;
// AA0082
private static int _lastJitterEnd = 0;
// AA0083
private static double _remainderX, _remainderY;
// AA0084
private static double _jitterMultiplierX, _jitterMultiplierY;
// AA0085
public static void Start(MainWindow window)
{
while (true)
@@ -30,13 +39,11 @@ namespace Lua
_jitterActive = false;
}
Thread.Sleep(2);
}
}
// AA0086
private static void HandleRecoilTick()
{
if (!Utils.IsPressed(VK_LBUTTON)) return;
@@ -51,6 +58,7 @@ namespace Lua
ApplyRecoil(recoil);
}
// AA0087
private static void HandleJitter(int now)
{
if (!ConfigLoader.jitterEnabled) return;
@@ -60,8 +68,8 @@ namespace Lua
_jitterActive = true;
_jitterStart = now;
// Set small random jitter multipliers
_jitterMultiplierX = (_rng.NextDouble() - 0.5) * 0.2; // ±0.1
// AA0088
_jitterMultiplierX = (_rng.NextDouble() - 0.5) * 0.2;
_jitterMultiplierY = (_rng.NextDouble() - 0.5) * 0.2;
}
@@ -73,24 +81,22 @@ namespace Lua
}
}
// AA0089
private static void ApplyRecoil((double recoilX, double recoilY) recoil)
{
// Apply base recoil first
double moveX = recoil.recoilX;
double moveY = recoil.recoilY;
// Apply optional multiplier for jitter
moveX += recoil.recoilX * _jitterMultiplierX;
moveY += recoil.recoilY * _jitterMultiplierY;
// Apply any global scaling
// AA0090
if (ConfigLoader.debitFlag1)
{
moveX *= 1.282;
moveY *= 1.351;
}
// Add remainder for precision
moveX += _remainderX;
moveY += _remainderY;
@@ -102,6 +108,5 @@ namespace Lua
Utils.MoveMouse(ix, iy);
}
}
}