From 579aef4ace388ca8cf184943dbc239b66ca517d3 Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Sun, 2 Mar 2025 21:33:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BF=E7=94=B2=E5=BC=B9=E7=A9=BF=E9=80=8F?= =?UTF-8?q?=E7=B3=BB=E6=95=B0>1=E6=97=B6=E5=AF=B9=E8=BD=BD=E5=85=B7?= =?UTF-8?q?=E9=80=A0=E6=88=90=E9=A2=9D=E5=A4=96=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 | 9 +++++++++ 1 file changed, 9 insertions(+) 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 f973002a4..609ef96da 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java @@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.block.BarbedWireBlock; import com.atsuishio.superbwarfare.entity.ICustomKnockback; import com.atsuishio.superbwarfare.entity.TargetEntity; +import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity; import com.atsuishio.superbwarfare.init.*; import com.atsuishio.superbwarfare.item.Transcript; import com.atsuishio.superbwarfare.network.message.ClientIndicatorMessage; @@ -724,10 +725,18 @@ public class ProjectileEntity extends Projectile implements IEntityAdditionalSpa entity.hurt(ModDamageTypes.causeGunFireHeadshotDamage(this.level().registryAccess(), this, this.shooter), normalDamage * this.headShot); entity.invulnerableTime = 0; entity.hurt(ModDamageTypes.causeGunFireHeadshotAbsoluteDamage(this.level().registryAccess(), this, this.shooter), absoluteDamage * this.headShot); + entity.invulnerableTime = 0; + } else { entity.hurt(ModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), normalDamage); entity.invulnerableTime = 0; entity.hurt(ModDamageTypes.causeGunFireAbsoluteDamage(this.level().registryAccess(), this, this.shooter), absoluteDamage); + 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); + } } }