WIP breach turret

This commit is contained in:
Anuken
2021-10-23 14:35:37 -04:00
parent 553333b656
commit 693e420074
10 changed files with 89 additions and 7 deletions
@@ -81,6 +81,7 @@ public class Turret extends ReloadTurret{
protected Vec2 tr = new Vec2();
protected Vec2 tr2 = new Vec2();
public @Nullable String basePrefix;
public @Load(value = "@-base", fallback = "block-@size") TextureRegion baseRegion;
public @Load("@-heat") TextureRegion heatRegion;
public float elevation = -1f;
@@ -130,6 +131,15 @@ public class Turret extends ReloadTurret{
super.init();
}
@Override
public void load(){
super.load();
if(basePrefix != null){
baseRegion = Core.atlas.find(basePrefix + "-block-" + size);
}
}
@Override
public TextureRegion[] icons(){
return new TextureRegion[]{baseRegion, region};
@@ -65,7 +65,7 @@ public class Duct extends Block implements Autotiler{
@Override
public boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){
return otherblock.outputsItems() && blendsArmored(tile, rotation, otherx, othery, otherrot, otherblock);
return (otherblock.outputsItems() && blendsArmored(tile, rotation, otherx, othery, otherrot, otherblock)) || (lookingAt(tile, rotation, otherx, othery, otherblock) && otherblock.hasItems);
}
@Override
@@ -93,7 +93,7 @@ public class Duct extends Block implements Autotiler{
//draw extra ducts facing this one for tiling purposes
for(int i = 0; i < 4; i++){
if((blending & (1 << i)) != 0 && !(i == 0 && nextc != null)){
if((blending & (1 << i)) != 0){
int dir = r - i;
float rot = i == 0 ? rotation : (dir)*90;
drawAt(x + Geometry.d4x(dir) * tilesize*0.75f, y + Geometry.d4y(dir) * tilesize*0.75f, 0, rot, i != 0 ? SliceMode.bottom : SliceMode.top);