区分MP5弹鼓和弹匣的换弹动画,添加光棱坦克水下阻力,调整数值

This commit is contained in:
Atsuishio 2025-05-29 21:13:31 +08:00 committed by Light_Quanta
parent bd021dcf8a
commit 2c3c1d3b54
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
6 changed files with 1432 additions and 18 deletions

View file

@ -165,7 +165,7 @@ public class RpgRocketEntity extends FastThrowableProjectile implements GeoEntit
if (ExplosionConfig.EXPLOSION_DESTROY.get()) { if (ExplosionConfig.EXPLOSION_DESTROY.get()) {
float hardness = this.level().getBlockState(BlockPos.containing(x, y, z)).getBlock().defaultDestroyTime(); float hardness = this.level().getBlockState(BlockPos.containing(x, y, z)).getBlock().defaultDestroyTime();
if (hardness <= 50 && hardness != -1) { if (hardness <= 10 && hardness != -1) {
BlockPos blockPos = BlockPos.containing(x, y, z); BlockPos blockPos = BlockPos.containing(x, y, z);
Block.dropResources(this.level().getBlockState(blockPos), this.level(), BlockPos.containing(x, y, z), null); Block.dropResources(this.level().getBlockState(blockPos), this.level(), BlockPos.containing(x, y, z), null);
this.level().destroyBlock(blockPos, true); this.level().destroyBlock(blockPos, true);

View file

@ -178,14 +178,16 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo
float f0 = 0.54f + 0.25f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90; float f0 = 0.54f + 0.25f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90;
this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.05 * getDeltaMovement().dot(getViewVector(1))))); this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.05 * getDeltaMovement().dot(getViewVector(1)))));
this.setDeltaMovement(this.getDeltaMovement().multiply(f0, 0.99, f0)); this.setDeltaMovement(this.getDeltaMovement().multiply(f0, 0.99, f0));
} else if (this.isInWater()) {
float f1 = 0.61f + 0.08f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90;
this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.04 * getDeltaMovement().dot(getViewVector(1)))));
this.setDeltaMovement(this.getDeltaMovement().multiply(f1, 0.85, f1));
} else { } else {
this.setDeltaMovement(this.getDeltaMovement().multiply(0.99, 0.99, 0.99)); this.setDeltaMovement(this.getDeltaMovement().multiply(0.99, 0.99, 0.99));
} }
if (this.isInWater()) {
float f1 = (float) (0.7f - (0.04f * Math.min(getSubmergedHeight(this), this.getBbHeight())) + 0.08f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90);
this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.04 * getDeltaMovement().dot(getViewVector(1)))));
this.setDeltaMovement(this.getDeltaMovement().multiply(f1, 0.85, f1));
}
if (this.level() instanceof ServerLevel serverLevel && this.isInWater() && this.getDeltaMovement().length() > 0.1) { if (this.level() instanceof ServerLevel serverLevel && this.isInWater() && this.getDeltaMovement().length() > 0.1) {
sendParticle(serverLevel, ParticleTypes.CLOUD, this.getX() + 0.5 * this.getDeltaMovement().x, this.getY() + getSubmergedHeight(this) - 0.2, this.getZ() + 0.5 * this.getDeltaMovement().z, (int) (2 + 4 * this.getDeltaMovement().length()), 0.65, 0, 0.65, 0, true); sendParticle(serverLevel, ParticleTypes.CLOUD, this.getX() + 0.5 * this.getDeltaMovement().x, this.getY() + getSubmergedHeight(this) - 0.2, this.getZ() + 0.5 * this.getDeltaMovement().z, (int) (2 + 4 * this.getDeltaMovement().length()), 0.65, 0, 0.65, 0, true);
sendParticle(serverLevel, ParticleTypes.BUBBLE_COLUMN_UP, this.getX() + 0.5 * this.getDeltaMovement().x, this.getY() + getSubmergedHeight(this) - 0.2, this.getZ() + 0.5 * this.getDeltaMovement().z, (int) (2 + 10 * this.getDeltaMovement().length()), 0.65, 0, 0.65, 0, true); sendParticle(serverLevel, ParticleTypes.BUBBLE_COLUMN_UP, this.getX() + 0.5 * this.getDeltaMovement().x, this.getY() + getSubmergedHeight(this) - 0.2, this.getZ() + 0.5 * this.getDeltaMovement().z, (int) (2 + 10 * this.getDeltaMovement().length()), 0.65, 0, 0.65, 0, true);

View file

@ -61,7 +61,7 @@ public class RpgItem extends GunItem implements GeoItem {
var data = GunData.from(stack); var data = GunData.from(stack);
if (data.reload.empty()) { if (data.reload.empty()) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.rpg.reload")); return event.setAndContinue(RawAnimation.begin().thenPlayAndHold("animation.rpg.reload"));
} }
if (player.isSprinting() && player.onGround() && ClientEventHandler.cantSprint == 0 && ClientEventHandler.drawTime < 0.01) { if (player.isSprinting() && player.onGround() && ClientEventHandler.cantSprint == 0 && ClientEventHandler.drawTime < 0.01) {

View file

@ -46,14 +46,23 @@ public class Mp5Item extends GunItem implements GeoItem {
if (player == null) return PlayState.STOP; if (player == null) return PlayState.STOP;
ItemStack stack = player.getMainHandItem(); ItemStack stack = player.getMainHandItem();
if (!(stack.getItem() instanceof GunItem)) return PlayState.STOP; if (!(stack.getItem() instanceof GunItem)) return PlayState.STOP;
boolean drum = GunData.from(stack).attachment.get(AttachmentType.MAGAZINE) == 2;
if (GunData.from(stack).reload.empty()) { if (GunData.from(stack).reload.empty()) {
if (drum) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_empty_drum"));
} else {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_empty")); return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_empty"));
} }
}
if (GunData.from(stack).reload.normal()) { if (GunData.from(stack).reload.normal()) {
if (drum) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_normal_drum"));
} else {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_normal")); return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mp5.reload_normal"));
} }
}
if (player.isSprinting() && player.onGround() && ClientEventHandler.cantSprint == 0 && ClientEventHandler.drawTime < 0.01) { if (player.isSprinting() && player.onGround() && ClientEventHandler.cantSprint == 0 && ClientEventHandler.drawTime < 0.01) {
if (ClientEventHandler.tacticalSprint) { if (ClientEventHandler.tacticalSprint) {

View file

@ -12,7 +12,7 @@
"Velocity": 4, "Velocity": 4,
"Magazine": 1, "Magazine": 1,
"Weight": 7, "Weight": 7,
"EmptyReloadTime": 103, "EmptyReloadTime": 107,
"RPM": 120, "RPM": 120,
"AmmoType": "superbwarfare:rocket", "AmmoType": "superbwarfare:rocket",
"AvailablePerks": [ "AvailablePerks": [