Shock mine team region

This commit is contained in:
Anuken 2021-06-03 21:49:58 -04:00
parent 8fc61215a5
commit fcf1bdd701
3 changed files with 12 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

View File

@ -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));

View File

@ -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)){