From a0fe9e8415b9d603f21d0b9da8436331f31e2817 Mon Sep 17 00:00:00 2001 From: EggleEgg <125359838+EggleEgg@users.noreply.github.com> Date: Sun, 30 Nov 2025 18:04:44 +0100 Subject: [PATCH] Shootpattern allow replacing per bullet (ammo type support) (#11402) --- core/src/mindustry/entities/bullet/BulletType.java | 3 +++ core/src/mindustry/world/blocks/defense/turrets/Turret.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 22746e9c40..7a834f9385 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -15,6 +15,7 @@ import mindustry.content.*; import mindustry.ctype.*; import mindustry.entities.*; import mindustry.entities.part.*; +import mindustry.entities.pattern.*; import mindustry.game.EventType.*; import mindustry.game.*; import mindustry.gen.*; @@ -72,6 +73,8 @@ public class BulletType extends Content implements Cloneable{ public Effect despawnEffect = Fx.hitBulletSmall; /** Effect created when shooting. */ public Effect shootEffect = Fx.shootSmall; + /** Pattern used to shoot this bullet. If null, uses turret's default pattern. */ + public @Nullable ShootPattern shootPattern = null; /** Effect created when charging starts; only usable in single-shot weapons with a firstShotDelay / shotDelay. */ public Effect chargeEffect = Fx.none; /** Extra smoke effect created when shooting. */ diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index ddbbad72b4..992f41f2ba 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -705,7 +705,9 @@ public class Turret extends ReloadTurret{ type.chargeEffect.at(bulletX, bulletY, rotation); } - shoot.shoot(barrelCounter, (xOffset, yOffset, angle, delay, mover) -> { + ShootPattern pattern = type.shootPattern != null ? type.shootPattern : shoot; + + pattern.shoot(barrelCounter, (xOffset, yOffset, angle, delay, mover) -> { queuedBullets++; int barrel = barrelCounter;