From 899a1ddd1f2e63a9d422d33589fa79cb87cc4347 Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Fri, 14 Feb 2025 01:27:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=98=B2=E5=BE=A1=E5=A1=94?= =?UTF-8?q?=E5=87=8F=E4=BC=A4=E6=AF=94=E4=BE=8B=EF=BC=8C=E5=AD=90=E5=BC=B9?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E5=AF=B9=E7=94=9F=E7=89=A9=E9=80=A0=E6=88=90?= =?UTF-8?q?=E7=88=86=E5=A4=B4=E4=BC=A4=E5=AE=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/projectile/ProjectileEntity.java | 11 ++++------- .../entity/vehicle/LaserTowerEntity.java | 12 ++++++------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java index d88fa10c8..f973002a4 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java @@ -2,9 +2,8 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.block.BarbedWireBlock; -import com.atsuishio.superbwarfare.entity.*; -import com.atsuishio.superbwarfare.entity.vehicle.DroneEntity; -import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity; +import com.atsuishio.superbwarfare.entity.ICustomKnockback; +import com.atsuishio.superbwarfare.entity.TargetEntity; import com.atsuishio.superbwarfare.init.*; import com.atsuishio.superbwarfare.item.Transcript; import com.atsuishio.superbwarfare.network.message.ClientIndicatorMessage; @@ -217,12 +216,10 @@ public class ProjectileEntity extends Projectile implements IEntityAdditionalSpa boolean legShot = false; float eyeHeight = entity.getEyeHeight(); float bodyHeight = entity.getBbHeight(); - if ((eyeHeight - 0.35) < hitBoxPos.y && hitBoxPos.y < (eyeHeight + 0.4) && - !(entity instanceof C4Entity || entity instanceof ClaymoreEntity || entity instanceof MortarEntity || entity instanceof IArmedVehicleEntity || entity instanceof DroneEntity)) { + if ((eyeHeight - 0.35) < hitBoxPos.y && hitBoxPos.y < (eyeHeight + 0.4) && entity instanceof LivingEntity) { headshot = true; } - if (hitBoxPos.y < (0.33 * bodyHeight) && !(entity instanceof C4Entity || entity instanceof ClaymoreEntity || entity instanceof MortarEntity || - entity instanceof IArmedVehicleEntity || entity instanceof DroneEntity)) { + if (hitBoxPos.y < (0.33 * bodyHeight) && entity instanceof LivingEntity) { legShot = true; } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java index 10d5b6a04..b6a6779f4 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java @@ -144,7 +144,7 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, public boolean hurt(DamageSource source, float amount) { super.hurt(source, amount); if (this.level() instanceof ServerLevel serverLevel) { - sendParticle(serverLevel, ModParticleTypes.FIRE_STAR.get(), this.getX(), this.getY() + 2.5, this.getZ(), 4, 0.2, 0.2, 0.2, 0.2, false); + sendParticle(serverLevel, ModParticleTypes.FIRE_STAR.get(), this.getX(), this.getY() + 0.8, this.getZ(), 4, 0.1, 0.1, 0.1, 0.2, false); } if (source.is(DamageTypes.ARROW)) { @@ -191,17 +191,17 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, amount *= 0.6f; } if (source.is(ModTags.DamageTypes.PROJECTILE)) { - amount *= 0.08f; - } - if (source.is(ModTags.DamageTypes.PROJECTILE_ABSOLUTE)) { amount *= 0.5f; } + if (source.is(ModTags.DamageTypes.PROJECTILE_ABSOLUTE)) { + amount *= 0.8f; + } if (source.is(ModDamageTypes.VEHICLE_STRIKE)) { - amount *= 5f; + amount *= 2f; } this.level().playSound(null, this.getOnPos(), ModSounds.HIT.get(), SoundSource.PLAYERS, 1, 1); - this.hurt(Math.max(amount - 2, 0), source.getEntity(), false); + this.hurt(Math.max(amount - 1, 0), source.getEntity(), true); return true; }