Logic fixes / Bigger erekir sectors

This commit is contained in:
Anuken
2022-02-13 11:09:27 -05:00
parent 3039a404eb
commit d72153c67a
15 changed files with 147 additions and 31 deletions

View File

@@ -105,6 +105,8 @@ public class Block extends UnlockableContent implements Senseable{
public boolean breakable;
/** whether to add this block to brokenblocks */
public boolean rebuildable = true;
/** if true, this logic-related block can only be used with privileged processors (or is one itself) */
public boolean privileged = false;
/** whether this block can only be placed on water */
public boolean requiresWater = false;
/** whether this block can be placed on any liquids, anywhere */

View File

@@ -369,6 +369,11 @@ public class Tile implements Position, QuadTreeObject, Displayable{
setFloorNet(floor, Blocks.air);
}
/** set()-s this tile, except it's synced across the network */
public void setOverlayNet(Block overlay){
Call.setOverlay(this, overlay);
}
public short overlayID(){
return overlay.id;
}
@@ -699,6 +704,11 @@ public class Tile implements Position, QuadTreeObject, Displayable{
tile.setOverlay(overlay);
}
@Remote(called = Loc.server)
public static void setOverlay(Tile tile, Block overlay){
tile.setOverlay(overlay);
}
@Remote(called = Loc.server)
public static void removeTile(Tile tile){
tile.remove();

View File

@@ -34,7 +34,6 @@ public class LogicBlock extends Block{
public int maxInstructionScale = 5;
public int instructionsPerTick = 1;
public float range = 8 * 10;
public boolean privileged;
public LogicBlock(String name){
super(name);
@@ -535,7 +534,7 @@ public class LogicBlock extends Block{
}
public boolean validLink(Building other){
return other != null && other.isValid() && (privileged || (other.team == team && other.within(this, range + other.block.size*tilesize/2f))) && !(other instanceof ConstructBuild);
return other != null && other.isValid() && (privileged || (!other.block.privileged && other.team == team && other.within(this, range + other.block.size*tilesize/2f))) && !(other instanceof ConstructBuild);
}
@Override

View File

@@ -33,6 +33,22 @@ public class MemoryBlock extends Block{
return false;
}
@Override
public boolean collide(Bullet other){
return !privileged;
}
@Override
public boolean displayable(){
return !privileged;
}
@Override
public void damage(float damage){
if(privileged) return;
super.damage(damage);
}
@Override
public void write(Writes write){
super.write(write);