From fcf1bdd7010695babc6ce5255a78a9291eef4931 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 3 Jun 2021 21:49:58 -0400 Subject: [PATCH] Shock mine team region --- .../blocks/defense/shock-mine-team-top.png | Bin 0 -> 152 bytes core/src/mindustry/mod/Mods.java | 3 ++- .../mindustry/world/blocks/defense/ShockMine.java | 14 ++++++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 core/assets-raw/sprites/blocks/defense/shock-mine-team-top.png diff --git a/core/assets-raw/sprites/blocks/defense/shock-mine-team-top.png b/core/assets-raw/sprites/blocks/defense/shock-mine-team-top.png new file mode 100644 index 0000000000000000000000000000000000000000..58597159bf4ec14176cd2b1c0f55111a3ac7f995 GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}L7py-ArY-_ zuQ+l6Rk;Md{a3!N)Uica^zopr0N@)iF8}}l literal 0 HcmV?d00001 diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 073c30f1b6..91dabc5482 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -607,7 +607,8 @@ public class Mods implements Loadable{ if(mod.root.child("content").exists()){ Fi contentRoot = mod.root.child("content"); for(ContentType type : ContentType.all){ - Fi folder = contentRoot.child(type.name().toLowerCase(Locale.ROOT) + "s"); + String lower = type.name().toLowerCase(Locale.ROOT); + Fi folder = contentRoot.child(lower + (lower.endsWith("s") ? "" : "s")); if(folder.exists()){ for(Fi file : folder.findAll(f -> f.extension().equals("json") || f.extension().equals("hjson"))){ runs.add(new LoadRun(type, file, mod)); diff --git a/core/src/mindustry/world/blocks/defense/ShockMine.java b/core/src/mindustry/world/blocks/defense/ShockMine.java index 00c805ac48..6cdcac7c3d 100644 --- a/core/src/mindustry/world/blocks/defense/ShockMine.java +++ b/core/src/mindustry/world/blocks/defense/ShockMine.java @@ -3,6 +3,7 @@ package mindustry.world.blocks.defense; import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.*; +import mindustry.annotations.Annotations.*; import mindustry.entities.*; import mindustry.gen.*; import mindustry.graphics.*; @@ -17,6 +18,8 @@ public class ShockMine extends Block{ public int length = 10; public int tendrils = 6; public Color lightningColor = Pal.lancerLaser; + public float teamAlpha = 0.3f; + public @Load("@-team-top") TextureRegion teamRegion; public ShockMine(String name){ super(name); @@ -24,7 +27,6 @@ public class ShockMine extends Block{ destructible = true; solid = false; targetable = false; - rebuildable = false; } public class ShockMineBuild extends Building{ @@ -37,12 +39,16 @@ public class ShockMine extends Block{ @Override public void draw(){ super.draw(); - Draw.color(team.color); - Draw.alpha(0.22f); - Fill.rect(x, y, 2f, 2f); + Draw.color(team.color, teamAlpha); + Draw.rect(teamRegion, x, y); Draw.color(); } + @Override + public void drawCracks(){ + + } + @Override public void unitOn(Unit unit){ if(enabled && unit.team != team && timer(timerDamage, cooldown)){