调整后坐力曲线

This commit is contained in:
Atsuihsio 2024-06-05 15:30:15 +08:00
parent 409218f7bf
commit b9e66c7abc
2 changed files with 5 additions and 5 deletions

View file

@ -327,17 +327,17 @@ public class PlayerEventHandler {
recoil = recoil + 0.017 * (2.4 - recoil); recoil = recoil + 0.017 * (2.4 - recoil);
double sinRes = 0; double sinRes = 0;
sinRes = 1 * Math.sin(Math.PI * (2 * recoil - 1)) * (0.5 / (2 * recoil - 1)); sinRes = 1.1 * Math.sin(Math.PI * (2 * recoil - 1)) * (0.5 / (2 * recoil - 1));
if (sinRes < 0){ if (sinRes < 0){
sinRes = 4 * sinRes; sinRes = 3.5 * sinRes;
} }
float newPitch = ((float) (player.getXRot() - 5f * recoilY * ry * (sinRes + Mth.clamp(0.8 - recoil,0,0.8)))); float newPitch = ((float) (player.getXRot() - 5f * recoilY * ry * (sinRes + Mth.clamp(0.8 - recoil,0,0.8))));
player.setXRot(newPitch); player.setXRot(newPitch);
player.xRotO = player.getXRot(); player.xRotO = player.getXRot();
float newYaw = ((float) (player.getYRot() - 5f * recoilYaw * recoilX * rx * sinRes)); float newYaw = ((float) (player.getYRot() - 4f * recoilYaw * recoilX * rx * sinRes));
player.setYRot(newYaw); player.setYRot(newYaw);
player.yRotO = player.getYRot(); player.yRotO = player.getYRot();
} }

View file

@ -2,8 +2,8 @@
"zoom_speed": 1.6, "zoom_speed": 1.6,
"zoom": 1.25, "zoom": 1.25,
"dev": 3.5, "dev": 3.5,
"recoil_x": 0.011, "recoil_x": 0.007,
"recoil_y": 0.004, "recoil_y": 0.007,
"damage": 4.5, "damage": 4.5,
"headshot": 1.5, "headshot": 1.5,
"velocity": 14, "velocity": 14,