From b25820eed72833ea8842b74f43b0abe248b81984 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Wed, 26 Oct 2022 17:14:34 -0700 Subject: [PATCH] fragOnAbsorb (#7771) --- core/src/mindustry/entities/bullet/BulletType.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 5c14059cac..4846be98f0 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -141,6 +141,8 @@ public class BulletType extends Content implements Cloneable{ public boolean despawnHit = false; /** If true, this bullet will create bullets when it hits anything, not just when it despawns. */ public boolean fragOnHit = true; + /** If false, this bullet will not create fraags when absorbed by a shield. */ + public boolean fragOnAbsorb = true; /** If true, unit armor is ignored in damage calculations. Ignored for building armor. */ public boolean pierceArmor = false; /** Whether status and despawnHit should automatically be set. */ @@ -452,7 +454,7 @@ public class BulletType extends Content implements Cloneable{ } public void createFrags(Bullet b, float x, float y){ - if(fragBullet != null){ + if(fragBullet != null && (fragOnAbsorb || !b.absorbed)){ for(int i = 0; i < fragBullets; i++){ float len = Mathf.random(1f, 7f); float a = b.rotation() + Mathf.range(fragRandomSpread / 2) + fragAngle + ((i - fragBullets/2) * fragSpread);