添加真实后坐力(
This commit is contained in:
parent
98d9c9e078
commit
7697968b29
4 changed files with 11 additions and 0 deletions
|
@ -20,6 +20,8 @@ public class DefaultGunData implements IDBasedData {
|
||||||
public double recoilX;
|
public double recoilX;
|
||||||
@SerializedName("RecoilY")
|
@SerializedName("RecoilY")
|
||||||
public double recoilY;
|
public double recoilY;
|
||||||
|
@SerializedName("Recoil")
|
||||||
|
public double recoil;
|
||||||
|
|
||||||
@SerializedName("DefaultZoom")
|
@SerializedName("DefaultZoom")
|
||||||
public double defaultZoom = 1.25;
|
public double defaultZoom = 1.25;
|
||||||
|
|
|
@ -301,6 +301,9 @@ public class GunData {
|
||||||
public double recoilY() {
|
public double recoilY() {
|
||||||
return defaultGunData().recoilY;
|
return defaultGunData().recoilY;
|
||||||
}
|
}
|
||||||
|
public double recoil() {
|
||||||
|
return defaultGunData().recoil;
|
||||||
|
}
|
||||||
|
|
||||||
public double weight() {
|
public double weight() {
|
||||||
return defaultGunData().weight + customWeight();
|
return defaultGunData().weight + customWeight();
|
||||||
|
|
|
@ -728,6 +728,11 @@ public class ClientEventHandler {
|
||||||
PacketDistributor.sendToServer(new ShootMessage(gunSpread, zoom, entity != null ? entity.getUUID() : UUID.randomUUID()));
|
PacketDistributor.sendToServer(new ShootMessage(gunSpread, zoom, entity != null ? entity.getUUID() : UUID.randomUUID()));
|
||||||
fireRecoilTime = 10;
|
fireRecoilTime = 10;
|
||||||
|
|
||||||
|
// 真实后座(
|
||||||
|
if (data.recoil() != 0) {
|
||||||
|
player.setDeltaMovement(player.getDeltaMovement().add(player.getViewVector(1).scale(-data.recoil())));
|
||||||
|
}
|
||||||
|
|
||||||
var gunRecoilY = data.recoilY() * 10;
|
var gunRecoilY = data.recoilY() * 10;
|
||||||
|
|
||||||
recoilY = (float) (2 * Math.random() - 1) * gunRecoilY;
|
recoilY = (float) (2 * Math.random() - 1) * gunRecoilY;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
"Spread": 5,
|
"Spread": 5,
|
||||||
"RecoilX": 0.015,
|
"RecoilX": 0.015,
|
||||||
"RecoilY": 0.02,
|
"RecoilY": 0.02,
|
||||||
|
"Recoil": 0.15,
|
||||||
"Damage": 40,
|
"Damage": 40,
|
||||||
"Headshot": 2.0,
|
"Headshot": 2.0,
|
||||||
"Velocity": 43,
|
"Velocity": 43,
|
||||||
|
|
Loading…
Add table
Reference in a new issue