mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-06 02:40:23 -08:00
Fixed #11399
This commit is contained in:
parent
7130b6155c
commit
15efb721a0
2 changed files with 10 additions and 5 deletions
|
|
@ -24,21 +24,25 @@ public class Lightning{
|
||||||
private static boolean bhit = false;
|
private static boolean bhit = false;
|
||||||
private static int lastSeed = 0;
|
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. */
|
/** 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){
|
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. */
|
/** 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){
|
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);
|
random.setSeed(seed);
|
||||||
hit.clear();
|
hit.clear();
|
||||||
|
|
||||||
BulletType hitCreate = hitter == null || hitter.type.lightningType == null ? Bullets.damageLightning : hitter.type.lightningType;
|
|
||||||
Seq<Vec2> lines = new Seq<>();
|
Seq<Vec2> lines = new Seq<>();
|
||||||
bhit = false;
|
bhit = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.annotations.Annotations.*;
|
import mindustry.annotations.Annotations.*;
|
||||||
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.entities.bullet.*;
|
import mindustry.entities.bullet.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
@ -64,7 +65,7 @@ public class ShockMine extends Block{
|
||||||
|
|
||||||
public void triggered(){
|
public void triggered(){
|
||||||
for(int i = 0; i < tendrils; i++){
|
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){
|
if(bullet != null){
|
||||||
for(int i = 0; i < shots; i++){
|
for(int i = 0; i < shots; i++){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue