Какая ротка нужна для обхода спуки? (exp 3.1) С добавлением махов на ач, я не могу обойти. Вот шедевро код(Скажите что добавить/убрать):|
case "Плавная" -> {
Vector3d eyes = mc.player.getEyePosition(1.0F);
Vector3d legitTarget = getLegitLook(target);
Vector3d diff = legitTarget.subtract(eyes);
float targetYaw = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90);
float targetPitch = (float) (-Math.toDegrees(Math.atan2(diff.y, Math.hypot(diff.x, diff.z))));
yawDelta = MathHelper.wrapDegrees(targetYaw - rotateVector.x);
pitchDelta = MathHelper.wrapDegrees(targetPitch - rotateVector.y);
long now = System.currentTimeMillis();
long timeSinceBigRot = now - lastBigRotation;
long lookTime = now - targetLookTime;
float yawBase = rotationYawSpeed * (attack ? 1.00f : 0.44f);
float pitchBase = rotationPitchSpeed * (attack ? 1.00f : 0.39f);
float acgandom = Math.min(1.0f, timeSinceBigRot / 210f);
float fatiguIIIIe = Math.max(0.54f, 1.0f - (lookTime / 680f));
float randomnessFactor = 0.78f + random.nextFloat(-0.14f, 0.22f);
float maxYawSpeed = yawBase * acgandom * fatiguIIIIe * randomnessFactor * 0.94f;
float maxPitchSpeed = pitchBase * acgandom * fatiguIIIIe * randomnessFactor * 0.89f;
float yawStep = MathHelper.clamp(yawDelta, -maxYawSpeed, maxYawSpeed);
float pitchStep = MathHelper.clamp(pitchDelta, -maxPitchSpeed * 0.96f, maxPitchSpeed * 1.04f);
if (Math.abs(yawDelta) > 28f) {
yawStep *= (0.985f + random.nextFloat(-0.018f, 0.024f));
}
if (Math.abs(pitchDelta) > 14f) {
pitchStep *= (0.982f + random.nextFloat(-0.021f, 0.028f));
}
float yaw = rotateVector.x + yawStep;
float pitch = rotateVector.y + pitchStep;
pitch = MathHelper.clamp(pitch, -89.0f, 89.0f);
float gcd = SensUtils.getGCDValue();
if (attack && Math.abs(yawDelta) < 5.2f && Math.abs(pitchDelta) < 3.1f) {
if (random.nextFloat() < 0.48f) {
float yawFix = (yaw - rotateVector.x) % gcd;
float pitchFix = (pitch - rotateVector.y) % gcd;
if (Math.abs(yawFix) > 0.018f) yaw -= yawFix * random.nextFloat(0.58f, 0.94f);
if (Math.abs(pitchFix) > 0.013f) pitch -= pitchFix * random.nextFloat(0.55f, 0.92f);
}
}
float constantJitterYaw = (float) (random.nextFloat(-0.12f, 0.12f));
float constantJitterPitch = (float) (random.nextGaussian() * 0.07 + random.nextFloat(-0.10f, 0.10f));
yaw += constantJitterYaw;
pitch += constantJitterPitch;
pitch += random.nextFloat(-0.10f, 0.10f);
rotateVector = new Vector2f(yaw, pitch);
if (Math.abs(yawStep) > 7.2f || Math.abs(pitchStep) > 3.8f) {
lastBigRotation = now;
targetLookTime = now;
}
lastYaw = Math.abs(yawStep);
lastPitch = Math.abs(pitchStep);
if (options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = yaw;
}
}
case "Плавная" -> {
Vector3d eyes = mc.player.getEyePosition(1.0F);
Vector3d legitTarget = getLegitLook(target);
Vector3d diff = legitTarget.subtract(eyes);
float targetYaw = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90);
float targetPitch = (float) (-Math.toDegrees(Math.atan2(diff.y, Math.hypot(diff.x, diff.z))));
yawDelta = MathHelper.wrapDegrees(targetYaw - rotateVector.x);
pitchDelta = MathHelper.wrapDegrees(targetPitch - rotateVector.y);
long now = System.currentTimeMillis();
long timeSinceBigRot = now - lastBigRotation;
long lookTime = now - targetLookTime;
float yawBase = rotationYawSpeed * (attack ? 1.00f : 0.44f);
float pitchBase = rotationPitchSpeed * (attack ? 1.00f : 0.39f);
float acgandom = Math.min(1.0f, timeSinceBigRot / 210f);
float fatiguIIIIe = Math.max(0.54f, 1.0f - (lookTime / 680f));
float randomnessFactor = 0.78f + random.nextFloat(-0.14f, 0.22f);
float maxYawSpeed = yawBase * acgandom * fatiguIIIIe * randomnessFactor * 0.94f;
float maxPitchSpeed = pitchBase * acgandom * fatiguIIIIe * randomnessFactor * 0.89f;
float yawStep = MathHelper.clamp(yawDelta, -maxYawSpeed, maxYawSpeed);
float pitchStep = MathHelper.clamp(pitchDelta, -maxPitchSpeed * 0.96f, maxPitchSpeed * 1.04f);
if (Math.abs(yawDelta) > 28f) {
yawStep *= (0.985f + random.nextFloat(-0.018f, 0.024f));
}
if (Math.abs(pitchDelta) > 14f) {
pitchStep *= (0.982f + random.nextFloat(-0.021f, 0.028f));
}
float yaw = rotateVector.x + yawStep;
float pitch = rotateVector.y + pitchStep;
pitch = MathHelper.clamp(pitch, -89.0f, 89.0f);
float gcd = SensUtils.getGCDValue();
if (attack && Math.abs(yawDelta) < 5.2f && Math.abs(pitchDelta) < 3.1f) {
if (random.nextFloat() < 0.48f) {
float yawFix = (yaw - rotateVector.x) % gcd;
float pitchFix = (pitch - rotateVector.y) % gcd;
if (Math.abs(yawFix) > 0.018f) yaw -= yawFix * random.nextFloat(0.58f, 0.94f);
if (Math.abs(pitchFix) > 0.013f) pitch -= pitchFix * random.nextFloat(0.55f, 0.92f);
}
}
float constantJitterYaw = (float) (random.nextFloat(-0.12f, 0.12f));
float constantJitterPitch = (float) (random.nextGaussian() * 0.07 + random.nextFloat(-0.10f, 0.10f));
yaw += constantJitterYaw;
pitch += constantJitterPitch;
pitch += random.nextFloat(-0.10f, 0.10f);
rotateVector = new Vector2f(yaw, pitch);
if (Math.abs(yawStep) > 7.2f || Math.abs(pitchStep) > 3.8f) {
lastBigRotation = now;
targetLookTime = now;
}
lastYaw = Math.abs(yawStep);
lastPitch = Math.abs(pitchStep);
if (options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = yaw;
}
}