Scrapped reaper segments
This commit is contained in:
@@ -35,7 +35,7 @@ import java.util.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class Block extends UnlockableContent{
|
||||
public static final int crackRegions = 8, maxCrackSize = 5;
|
||||
public static final int crackRegions = 8, maxCrackSize = 9;
|
||||
|
||||
public boolean hasItems;
|
||||
public boolean hasLiquids;
|
||||
|
||||
@@ -75,8 +75,8 @@ public class PayloadConveyor extends Block{
|
||||
//differing sizes
|
||||
(accept.block().size > size &&
|
||||
(rotation() % 2 == 0 ? //check orientation
|
||||
Math.abs(accept.y() - y) <= accept.block().size * tilesize - size * tilesize : //check Y alignment
|
||||
Math.abs(accept.x() - x) <= accept.block().size * tilesize - size * tilesize //check X alignment
|
||||
Math.abs(accept.y() - y) <= (accept.block().size * tilesize - size * tilesize)/2f : //check Y alignment
|
||||
Math.abs(accept.x() - x) <= (accept.block().size * tilesize - size * tilesize)/2f //check X alignment
|
||||
)))){
|
||||
next = accept;
|
||||
}else{
|
||||
|
||||
@@ -71,7 +71,7 @@ public class BlockLoader extends PayloadAcceptor{
|
||||
|
||||
//draw input
|
||||
for(int i = 0; i < 4; i++){
|
||||
if(blends(this, i) && i != rotation()){
|
||||
if(blends(i) && i != rotation()){
|
||||
Draw.rect(inRegion, x, y, i * 90);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,11 +30,20 @@ public class PayloadAcceptor extends Block{
|
||||
int size = tile.block().size;
|
||||
Tilec accept = tile.nearby(Geometry.d4(direction).x * size, Geometry.d4(direction).y * size);
|
||||
return accept != null &&
|
||||
accept.block().size == size &&
|
||||
accept.block().outputsPayload &&
|
||||
//block must either be facing this one, or not be rotating
|
||||
|
||||
//if size is the same, block must either be facing this one, or not be rotating
|
||||
((accept.block().size == size &&
|
||||
((accept.tileX() + Geometry.d4(accept.rotation()).x * size == tile.tileX() && accept.tileY() + Geometry.d4(accept.rotation()).y * size == tile.tileY())
|
||||
|| !accept.block().rotate || (accept.block().rotate && !accept.block().outputFacing));
|
||||
|| !accept.block().rotate || (accept.block().rotate && !accept.block().outputFacing))) ||
|
||||
|
||||
//if the other block is smaller, check alignment
|
||||
(accept.block().size < size &&
|
||||
(accept.rotation() % 2 == 0 ? //check orientation; make sure it's aligned properly with this block.
|
||||
Math.abs(accept.y() - tile.y()) <= (size * tilesize - accept.block().size * tilesize)/2f : //check Y alignment
|
||||
Math.abs(accept.x() - tile.x()) <= (size * tilesize - accept.block().size * tilesize)/2f //check X alignment
|
||||
)) && (!accept.block().rotate || accept.front() == tile || !accept.block().outputFacing) //make sure it's facing this block
|
||||
);
|
||||
}
|
||||
|
||||
public class PayloadAcceptorEntity<T extends Payload> extends TileEntity{
|
||||
@@ -63,6 +72,10 @@ public class PayloadAcceptor extends Block{
|
||||
return t;
|
||||
}
|
||||
|
||||
public boolean blends(int direction){
|
||||
return PayloadAcceptor.blends(this, direction);
|
||||
}
|
||||
|
||||
public void updatePayload(){
|
||||
if(payload != null){
|
||||
payload.set(x + payVector.x, y + payVector.y, payRotation);
|
||||
|
||||
@@ -13,7 +13,7 @@ import mindustry.ui.*;
|
||||
import mindustry.world.blocks.payloads.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
import static mindustry.Vars.state;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class Reconstructor extends UnitBlock{
|
||||
public float constructTime = 60 * 2;
|
||||
@@ -63,7 +63,7 @@ public class Reconstructor extends UnitBlock{
|
||||
|
||||
//draw input
|
||||
for(int i = 0; i < 4; i++){
|
||||
if(blends(this, i) && i != rotation()){
|
||||
if(blends(i) && i != rotation()){
|
||||
Draw.rect(inRegion, x, y, i * 90);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user