Added armored conveyors
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
@@ -801,6 +801,8 @@ block.hail.name = Hail
|
|||||||
block.lancer.name = Lancer
|
block.lancer.name = Lancer
|
||||||
block.conveyor.name = Conveyor
|
block.conveyor.name = Conveyor
|
||||||
block.titanium-conveyor.name = Titanium Conveyor
|
block.titanium-conveyor.name = Titanium Conveyor
|
||||||
|
block.armored-conveyor.name = Armored Conveyor
|
||||||
|
block.armored-conveyor.description = Moves items at the same speed as titanium conveyors, but possesses more armor. Does not accept inputs from the sides from anything but other conveyors.
|
||||||
block.junction.name = Junction
|
block.junction.name = Junction
|
||||||
block.router.name = Router
|
block.router.name = Router
|
||||||
block.distributor.name = Distributor
|
block.distributor.name = Distributor
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 722 B After Width: | Height: | Size: 725 B |
|
Before Width: | Height: | Size: 677 KiB After Width: | Height: | Size: 684 KiB |
|
Before Width: | Height: | Size: 258 KiB After Width: | Height: | Size: 259 KiB |
|
Before Width: | Height: | Size: 583 KiB After Width: | Height: | Size: 578 KiB |
@@ -58,7 +58,7 @@ public class Blocks implements ContentList{
|
|||||||
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mender, mendProjector, overdriveProjector, forceProjector, shockMine,
|
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mender, mendProjector, overdriveProjector, forceProjector, shockMine,
|
||||||
|
|
||||||
//transport
|
//transport
|
||||||
conveyor, titaniumConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, router, overflowGate, massDriver,
|
conveyor, titaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, router, overflowGate, massDriver,
|
||||||
|
|
||||||
//liquids
|
//liquids
|
||||||
mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidTank, liquidJunction, bridgeConduit, phaseConduit,
|
mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidTank, liquidJunction, bridgeConduit, phaseConduit,
|
||||||
@@ -906,6 +906,12 @@ public class Blocks implements ContentList{
|
|||||||
speed = 0.08f;
|
speed = 0.08f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
armoredConveyor = new ArmoredConveyor("armored-conveyor"){{
|
||||||
|
requirements(Category.distribution, ItemStack.with(Items.metaglass, 1, Items.thorium, 1));
|
||||||
|
health = 180;
|
||||||
|
speed = 0.08f;
|
||||||
|
}};
|
||||||
|
|
||||||
junction = new Junction("junction"){{
|
junction = new Junction("junction"){{
|
||||||
requirements(Category.distribution, ItemStack.with(Items.copper, 1), true);
|
requirements(Category.distribution, ItemStack.with(Items.copper, 1), true);
|
||||||
speed = 26;
|
speed = 26;
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ public class Tile implements Position, TargetTrait{
|
|||||||
return Pos.get(x, y);
|
return Pos.get(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public byte relativeTo(Tile tile){
|
||||||
|
return relativeTo(tile.x, tile.y);
|
||||||
|
}
|
||||||
|
|
||||||
/** Return relative rotation to a coordinate. Returns -1 if the coordinate is not near this tile. */
|
/** Return relative rotation to a coordinate. Returns -1 if the coordinate is not near this tile. */
|
||||||
public byte relativeTo(int cx, int cy){
|
public byte relativeTo(int cx, int cy){
|
||||||
if(x == cx && y == cy - 1) return 1;
|
if(x == cx && y == cy - 1) return 1;
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package io.anuke.mindustry.world.blocks.distribution;
|
||||||
|
|
||||||
|
import io.anuke.arc.math.*;
|
||||||
|
import io.anuke.mindustry.type.*;
|
||||||
|
import io.anuke.mindustry.world.*;
|
||||||
|
|
||||||
|
public class ArmoredConveyor extends Conveyor{
|
||||||
|
|
||||||
|
public ArmoredConveyor(String name){
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||||
|
return super.acceptItem(item, tile, source) && (source.block() instanceof Conveyor || Edges.getFacingEdge(source, tile).relativeTo(tile) == tile.rotation());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean blends(Tile tile, int direction){
|
||||||
|
Tile other = tile.getNearby(Mathf.mod(tile.rotation() - direction, 4));
|
||||||
|
if(other != null) other = other.link();
|
||||||
|
|
||||||
|
return other != null && other.block().outputsItems()
|
||||||
|
&& ((tile.getNearby(tile.rotation()) == other) || ((!other.block().rotate && Edges.getFacingEdge(other, tile).relativeTo(tile) == tile.rotation()) || (other.block().rotate && other.getNearby(other.rotation()) == tile)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -127,12 +127,12 @@ public class Conveyor extends Block{
|
|||||||
draw.region = regions[blendbits][0];
|
draw.region = regions[blendbits][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean blends(int rotation, int offset, int prevX, int prevY, int prevRotation){
|
protected boolean blends(int rotation, int offset, int prevX, int prevY, int prevRotation){
|
||||||
Point2 left = Geometry.d4(rotation - offset);
|
Point2 left = Geometry.d4(rotation - offset);
|
||||||
return left.equals(prevX, prevY) && prevRotation == Mathf.mod(rotation + offset, 4);
|
return left.equals(prevX, prevY) && prevRotation == Mathf.mod(rotation + offset, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean blends(Tile tile, int direction){
|
protected boolean blends(Tile tile, int direction){
|
||||||
Tile other = tile.getNearby(Mathf.mod(tile.rotation() - direction, 4));
|
Tile other = tile.getNearby(Mathf.mod(tile.rotation() - direction, 4));
|
||||||
if(other != null) other = other.link();
|
if(other != null) other = other.link();
|
||||||
|
|
||||||
|
|||||||