From 5fe6c96b0181825c4b473f47ff973e71b1028800 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Mon, 7 Apr 2025 05:06:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dprojectile=E4=BC=A4=E5=AE=B3?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/projectile/ProjectileEntity.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 70e5ac5b8..2ca92d1a1 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java @@ -65,7 +65,7 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Predicate; -@SuppressWarnings({"unused", "UnusedReturnValue", "SuspiciousNameCombination"}) +@SuppressWarnings({"unused", "UnusedReturnValue"}) public class ProjectileEntity extends Projectile implements IEntityWithComplexSpawn, GeoEntity, CustomSyncMotionEntity { public static final EntityDataAccessor COLOR_R = SynchedEntityData.defineId(ProjectileEntity.class, EntityDataSerializers.FLOAT); @@ -742,13 +742,16 @@ public class ProjectileEntity extends Projectile implements IEntityWithComplexSp float headShotModifier = isHeadshot ? this.headShot : 1; if (normalDamage > 0) { - entity.hurt(ModDamageTypes.causeGunFireHeadshotDamage(this.level().registryAccess(), this, this.shooter), normalDamage * headShotModifier); + entity.hurt(isHeadshot ? ModDamageTypes.causeGunFireHeadshotDamage(this.level().registryAccess(), this, this.shooter) + : ModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), normalDamage * headShotModifier); entity.invulnerableTime = 0; } if (absoluteDamage > 0) { - entity.hurt(ModDamageTypes.causeGunFireHeadshotAbsoluteDamage(this.level().registryAccess(), this, this.shooter), absoluteDamage * headShotModifier); + entity.hurt(isHeadshot ? ModDamageTypes.causeGunFireHeadshotAbsoluteDamage(this.level().registryAccess(), this, this.shooter) + : ModDamageTypes.causeGunFireAbsoluteDamage(this.level().registryAccess(), this, this.shooter), absoluteDamage * headShotModifier); entity.invulnerableTime = 0; + // 大于1的穿甲对载具造成额外伤害 if (entity instanceof VehicleEntity vehicle && this.bypassArmorRate > 1) { vehicle.hurt(ModDamageTypes.causeGunFireAbsoluteDamage(this.level().registryAccess(), this, this.shooter), absoluteDamage * (this.bypassArmorRate - 1) * 0.5f); }