From 15efb721a07b40d4a2d4b066aefd60f02e92f52c Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 30 Nov 2025 11:10:13 -0500 Subject: [PATCH] Fixed #11399 --- core/src/mindustry/entities/Lightning.java | 12 ++++++++---- .../mindustry/world/blocks/defense/ShockMine.java | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/entities/Lightning.java b/core/src/mindustry/entities/Lightning.java index 0bd26d7ceb..48e42b4e5f 100644 --- a/core/src/mindustry/entities/Lightning.java +++ b/core/src/mindustry/entities/Lightning.java @@ -24,21 +24,25 @@ public class Lightning{ private static boolean bhit = false; private static int lastSeed = 0; + /** Create a lighting branch at a location. Use Team.derelict to damage everyone. */ + public static void create(BulletType bulletCreated, Team team, Color color, float damage, float x, float y, float targetAngle, int length){ + createLightningInternal(null, bulletCreated, lastSeed++, team, color, damage, x, y, targetAngle, length); + } + /** Create a lighting branch at a location. Use Team.derelict to damage everyone. */ public static void create(Team team, Color color, float damage, float x, float y, float targetAngle, int length){ - createLightningInternal(null, lastSeed++, team, color, damage, x, y, targetAngle, length); + createLightningInternal(null, Bullets.damageLightning, lastSeed++, team, color, damage, x, y, targetAngle, length); } /** Create a lighting branch at a location. Uses bullet parameters. */ public static void create(Bullet bullet, Color color, float damage, float x, float y, float targetAngle, int length){ - createLightningInternal(bullet, lastSeed++, bullet.team, color, damage, x, y, targetAngle, length); + createLightningInternal(bullet, bullet == null || bullet.type.lightningType == null ? Bullets.damageLightning : bullet.type.lightningType, lastSeed++, bullet.team, color, damage, x, y, targetAngle, length); } - private static void createLightningInternal(@Nullable Bullet hitter, int seed, Team team, Color color, float damage, float x, float y, float rotation, int length){ + private static void createLightningInternal(@Nullable Bullet hitter, BulletType hitCreate, int seed, Team team, Color color, float damage, float x, float y, float rotation, int length){ random.setSeed(seed); hit.clear(); - BulletType hitCreate = hitter == null || hitter.type.lightningType == null ? Bullets.damageLightning : hitter.type.lightningType; Seq lines = new Seq<>(); bhit = false; diff --git a/core/src/mindustry/world/blocks/defense/ShockMine.java b/core/src/mindustry/world/blocks/defense/ShockMine.java index 78a2abfd01..3f257acc35 100644 --- a/core/src/mindustry/world/blocks/defense/ShockMine.java +++ b/core/src/mindustry/world/blocks/defense/ShockMine.java @@ -5,6 +5,7 @@ import arc.graphics.g2d.*; import arc.math.*; import arc.util.*; import mindustry.annotations.Annotations.*; +import mindustry.content.*; import mindustry.entities.*; import mindustry.entities.bullet.*; import mindustry.gen.*; @@ -64,7 +65,7 @@ public class ShockMine extends Block{ public void triggered(){ for(int i = 0; i < tendrils; i++){ - Lightning.create(team, lightningColor, damage, x, y, Mathf.random(360f), length); + Lightning.create(Bullets.damageLightningGround, team, lightningColor, damage, x, y, Mathf.random(360f), length); } if(bullet != null){ for(int i = 0; i < shots; i++){