Buildable beam link block
This commit is contained in:
@@ -2487,11 +2487,12 @@ public class Blocks{
|
||||
}};
|
||||
|
||||
beamLink = new LongPowerNode("beam-link"){{
|
||||
requirements(Category.power, BuildVisibility.editorOnly, with());
|
||||
requirements(Category.power, with(Items.beryllium, 250, Items.silicon, 250, Items.oxide, 150, Items.carbide, 75, Items.surgeAlloy, 75, Items.phaseFabric, 75));
|
||||
size = 3;
|
||||
maxNodes = 1;
|
||||
laserRange = 1000f;
|
||||
laserRange = 500f;
|
||||
autolink = false;
|
||||
sameBlockConnection = true;
|
||||
laserColor2 = Color.valueOf("ffd9c2");
|
||||
laserScale = 0.8f;
|
||||
scaledHealth = 130;
|
||||
|
||||
@@ -160,7 +160,9 @@ public class ErekirTechTree{
|
||||
});
|
||||
|
||||
node(beamTower, Seq.with(new OnSector(peaks)), () -> {
|
||||
node(beamLink, Seq.with(new OnSector(crossroads)), () -> {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -485,6 +485,7 @@ public class SerpuloTechTree{
|
||||
node(mycelialBastion, Seq.with(
|
||||
new Research(atrax),
|
||||
new Research(spiroct),
|
||||
new Research(arkyid),
|
||||
new Research(multiplicativeReconstructor),
|
||||
new Research(exponentialReconstructor)
|
||||
), () -> {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class PowerNode extends PowerBlock{
|
||||
public @Load(value = "@-laser-end", fallback = "laser-end") TextureRegion laserEnd;
|
||||
public float laserRange = 6;
|
||||
public int maxNodes = 3;
|
||||
public boolean autolink = true, drawRange = true;
|
||||
public boolean autolink = true, drawRange = true, sameBlockConnection = false;
|
||||
public float laserScale = 0.25f;
|
||||
public Color laserColor1 = Color.white;
|
||||
public Color laserColor2 = Pal.powerLight;
|
||||
@@ -341,7 +341,7 @@ public class PowerNode extends PowerBlock{
|
||||
}
|
||||
|
||||
public boolean linkValid(Building tile, Building link, boolean checkMaxNodes){
|
||||
if(tile == link || link == null || !link.block.hasPower || !link.block.connectedPower || tile.team != link.team) return false;
|
||||
if(tile == link || link == null || !link.block.hasPower || !link.block.connectedPower || tile.team != link.team || (sameBlockConnection && tile.block != link.block)) return false;
|
||||
|
||||
if(overlaps(tile, link, laserRange * tilesize) || (link.block instanceof PowerNode node && overlaps(link, tile, node.laserRange * tilesize))){
|
||||
if(checkMaxNodes && link.block instanceof PowerNode node){
|
||||
|
||||
Reference in New Issue
Block a user