Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -99,7 +99,7 @@ public class ConstructBlock extends Block{
|
||||
}
|
||||
|
||||
if(fogControl.isVisibleTile(team, tile.x, tile.y)){
|
||||
Fx.placeBlock.at(tile.drawx(), tile.drawy(), block.size);
|
||||
block.placeEffect.at(tile.drawx(), tile.drawy(), block.size);
|
||||
if(shouldPlay()) block.placeSound.at(tile, block.placePitchChange ? calcPitch(true) : 1f);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ public class DirectionalUnloader extends Block{
|
||||
public DirectionalUnloader(String name){
|
||||
super(name);
|
||||
|
||||
group = BlockGroup.transportation;
|
||||
update = true;
|
||||
solid = true;
|
||||
hasItems = true;
|
||||
|
||||
@@ -503,7 +503,7 @@ public class LogicBlock extends Block{
|
||||
if(state.rules.disableWorldProcessors && privileged) return;
|
||||
|
||||
if(enabled && executor.initialized()){
|
||||
accumulator += edelta() * ipt * efficiency;
|
||||
accumulator += edelta() * ipt;
|
||||
|
||||
if(accumulator > maxInstructionScale * ipt) accumulator = maxInstructionScale * ipt;
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public abstract class BlockProducer extends PayloadBlock{
|
||||
if(progress >= recipe.buildCost){
|
||||
consume();
|
||||
payload = new BuildPayload(recipe, team);
|
||||
Fx.placeBlock.at(x, y, payload.size() / tilesize);
|
||||
payload.block().placeEffect.at(x, y, payload.size() / tilesize);
|
||||
payVector.setZero();
|
||||
progress %= 1f;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class PayloadConveyor extends Block{
|
||||
|
||||
public PayloadConveyor(String name){
|
||||
super(name);
|
||||
group = BlockGroup.transportation;
|
||||
group = BlockGroup.payloads;
|
||||
size = 3;
|
||||
rotate = true;
|
||||
update = true;
|
||||
|
||||
@@ -24,13 +24,13 @@ import static mindustry.Vars.*;
|
||||
public class BeamDrill extends Block{
|
||||
protected Rand rand = new Rand();
|
||||
|
||||
public @Load("drill-laser") TextureRegion laser;
|
||||
public @Load("drill-laser-end") TextureRegion laserEnd;
|
||||
public @Load("drill-laser-center") TextureRegion laserCenter;
|
||||
public @Load(value = "@-beam", fallback = "drill-laser") TextureRegion laser;
|
||||
public @Load(value = "@-beam-end", fallback = "drill-laser-end") TextureRegion laserEnd;
|
||||
public @Load(value = "@-beam-center", fallback = "drill-laser-center") TextureRegion laserCenter;
|
||||
|
||||
public @Load("drill-laser-boost") TextureRegion laserBoost;
|
||||
public @Load("drill-laser-boost-end") TextureRegion laserEndBoost;
|
||||
public @Load("drill-laser-boost-center") TextureRegion laserCenterBoost;
|
||||
public @Load(value = "@-beam-boost", fallback = "drill-laser-boost") TextureRegion laserBoost;
|
||||
public @Load(value = "@-beam-boost-end", fallback = "drill-laser-boost-end") TextureRegion laserEndBoost;
|
||||
public @Load(value = "@-beam-boost-center", fallback = "drill-laser-boost-center") TextureRegion laserCenterBoost;
|
||||
|
||||
public @Load("@-top") TextureRegion topRegion;
|
||||
public @Load("@-glow") TextureRegion glowRegion;
|
||||
@@ -202,6 +202,7 @@ public class BeamDrill extends Block{
|
||||
public float time;
|
||||
public float warmup, boostWarmup;
|
||||
public float lastDrillSpeed;
|
||||
public int facingAmount;
|
||||
|
||||
@Override
|
||||
public void drawSelect(){
|
||||
@@ -222,40 +223,8 @@ public class BeamDrill extends Block{
|
||||
if(lasers[0] == null) updateLasers();
|
||||
|
||||
warmup = Mathf.approachDelta(warmup, Mathf.num(efficiency > 0), 1f / 60f);
|
||||
lastItem = null;
|
||||
boolean multiple = false;
|
||||
int dx = Geometry.d4x(rotation), dy = Geometry.d4y(rotation), facingAmount = 0;
|
||||
|
||||
//update facing tiles
|
||||
for(int p = 0; p < size; p++){
|
||||
Point2 l = lasers[p];
|
||||
Tile dest = null;
|
||||
for(int i = 0; i < range; i++){
|
||||
int rx = l.x + dx*i, ry = l.y + dy*i;
|
||||
Tile other = world.tile(rx, ry);
|
||||
if(other != null){
|
||||
if(other.solid()){
|
||||
Item drop = other.wallDrop();
|
||||
if(drop != null && drop.hardness <= tier){
|
||||
facingAmount ++;
|
||||
if(lastItem != drop && lastItem != null){
|
||||
multiple = true;
|
||||
}
|
||||
lastItem = drop;
|
||||
dest = other;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
facing[p] = dest;
|
||||
}
|
||||
|
||||
//when multiple items are present, count that as no item
|
||||
if(multiple){
|
||||
lastItem = null;
|
||||
}
|
||||
|
||||
updateFacing();
|
||||
|
||||
float multiplier = Mathf.lerp(1f, optionalBoostIntensity, optionalEfficiency);
|
||||
boostWarmup = Mathf.lerpDelta(boostWarmup, optionalEfficiency, 0.1f);
|
||||
@@ -281,7 +250,7 @@ public class BeamDrill extends Block{
|
||||
|
||||
@Override
|
||||
public boolean shouldConsume(){
|
||||
return items.total() < itemCapacity && enabled;
|
||||
return items.total() < itemCapacity && lastItem != null && enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -369,15 +338,54 @@ public class BeamDrill extends Block{
|
||||
public void onProximityUpdate(){
|
||||
//when rotated.
|
||||
updateLasers();
|
||||
updateFacing();
|
||||
}
|
||||
|
||||
void updateLasers(){
|
||||
protected void updateLasers(){
|
||||
for(int i = 0; i < size; i++){
|
||||
if(lasers[i] == null) lasers[i] = new Point2();
|
||||
nearbySide(tileX(), tileY(), rotation, i, lasers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateFacing(){
|
||||
lastItem = null;
|
||||
boolean multiple = false;
|
||||
int dx = Geometry.d4x(rotation), dy = Geometry.d4y(rotation);
|
||||
facingAmount = 0;
|
||||
|
||||
//update facing tiles
|
||||
for(int p = 0; p < size; p++){
|
||||
Point2 l = lasers[p];
|
||||
Tile dest = null;
|
||||
for(int i = 0; i < range; i++){
|
||||
int rx = l.x + dx*i, ry = l.y + dy*i;
|
||||
Tile other = world.tile(rx, ry);
|
||||
if(other != null){
|
||||
if(other.solid()){
|
||||
Item drop = other.wallDrop();
|
||||
if(drop != null && drop.hardness <= tier){
|
||||
facingAmount ++;
|
||||
if(lastItem != drop && lastItem != null){
|
||||
multiple = true;
|
||||
}
|
||||
lastItem = drop;
|
||||
dest = other;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
facing[p] = dest;
|
||||
}
|
||||
|
||||
//when multiple items are present, count that as no item
|
||||
if(multiple){
|
||||
lastItem = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte version(){
|
||||
return 1;
|
||||
|
||||
@@ -150,7 +150,7 @@ public class CoreBlock extends StorageBlock{
|
||||
//finish placement immediately when a block is replaced.
|
||||
if(previous instanceof CoreBlock){
|
||||
tile.setBlock(this, tile.team());
|
||||
Fx.placeBlock.at(tile, tile.block().size);
|
||||
tile.block().placeEffect.at(tile, tile.block().size);
|
||||
Fx.upgradeCore.at(tile.drawx(), tile.drawy(), 0f, tile.block());
|
||||
Fx.upgradeCoreBloom.at(tile, tile.block().size);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user