This commit is contained in:
Anuken 2019-12-11 15:13:45 -05:00
parent 45ce4013d0
commit fbed11e927
2 changed files with 6 additions and 1 deletions

View File

@ -24,6 +24,7 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
private static final IntIntMap totals = new IntIntMap(); private static final IntIntMap totals = new IntIntMap();
protected Queue<BuildRequest> placeQueue = new Queue<>(); protected Queue<BuildRequest> placeQueue = new Queue<>();
protected BuildRequest lastFound;
protected boolean isBreaking; protected boolean isBreaking;
protected Player playerTarget; protected Player playerTarget;
@ -57,6 +58,9 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
buildQueue().addLast(new BuildRequest(entity.tile.x, entity.tile.y)); buildQueue().addLast(new BuildRequest(entity.tile.x, entity.tile.y));
}else{ }else{
buildQueue().addLast(new BuildRequest(entity.tile.x, entity.tile.y, entity.tile.rotation(), entity.cblock)); buildQueue().addLast(new BuildRequest(entity.tile.x, entity.tile.y, entity.tile.rotation(), entity.cblock));
if(lastFound != null && lastFound.hasConfig){
buildQueue().last().configure(lastFound.config);
}
} }
} }
@ -174,6 +178,7 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
BuildEntity b = tile.ent(); BuildEntity b = tile.ent();
float dist = Math.min(b.dst(x, y) - placeDistance, 0); float dist = Math.min(b.dst(x, y) - placeDistance, 0);
if(dist / type.maxVelocity < b.buildCost * 0.9f){ if(dist / type.maxVelocity < b.buildCost * 0.9f){
lastFound = req;
target = b; target = b;
this.isBreaking = req.breaking; this.isBreaking = req.breaking;
setState(build); setState(build);

View File

@ -138,7 +138,7 @@ public class BlockRenderer implements Disposable{
Block b = content.block(block.block); Block b = content.block(block.block);
if(!camera.bounds(Tmp.r1).grow(tilesize * 2f).overlaps(Tmp.r2.setSize(b.size * tilesize).setCenter(block.x * tilesize + b.offset(), block.y * tilesize + b.offset()))) continue; if(!camera.bounds(Tmp.r1).grow(tilesize * 2f).overlaps(Tmp.r2.setSize(b.size * tilesize).setCenter(block.x * tilesize + b.offset(), block.y * tilesize + b.offset()))) continue;
Draw.alpha(0.53f * brokenFade); Draw.alpha(0.33f * brokenFade);
Draw.mixcol(Color.white, 0.2f + Mathf.absin(Time.globalTime(), 6f, 0.2f)); Draw.mixcol(Color.white, 0.2f + Mathf.absin(Time.globalTime(), 6f, 0.2f));
Draw.rect(b.icon(Cicon.full), block.x * tilesize + b.offset(), block.y * tilesize + b.offset(), b.rotate ? block.rotation * 90 : 0f); Draw.rect(b.icon(Cicon.full), block.x * tilesize + b.offset(), block.y * tilesize + b.offset(), b.rotate ? block.rotation * 90 : 0f);
} }