This commit is contained in:
Anuken
2020-08-18 13:09:12 -04:00
parent fffdd1ca86
commit 4d83221c76
7 changed files with 31 additions and 12 deletions

View File

@@ -83,7 +83,7 @@ public class Puddles{
(liquid.flammability > 0.3f && dest.temperature > 0.7f)){ //flammable liquid + hot liquid (liquid.flammability > 0.3f && dest.temperature > 0.7f)){ //flammable liquid + hot liquid
Fires.create(tile); Fires.create(tile);
if(Mathf.chance(0.006 * amount)){ if(Mathf.chance(0.006 * amount)){
Call.createBullet(Bullets.fireball, Team.derelict, x, y, Mathf.random(360f), -1f, 1f, 1f); Bullets.fireball.createNet(Team.derelict, x, y, Mathf.random(360f), -1f, 1f, 1f);
} }
}else if(dest.temperature > 0.7f && liquid.temperature < 0.55f){ //cold liquid poured onto hot Puddle }else if(dest.temperature > 0.7f && liquid.temperature < 0.55f){ //cold liquid poured onto hot Puddle
if(Mathf.chance(0.5f * amount)){ if(Mathf.chance(0.5f * amount)){

View File

@@ -270,7 +270,7 @@ public abstract class BulletType extends Content{
} }
public void createNet(Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl){ public void createNet(Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl){
Call.createBullet(this, team, x, y, damage, angle, velocityScl, lifetimeScl); Call.createBullet(this, team, x, y, angle, damage, velocityScl, lifetimeScl);
} }
@Remote(called = Loc.server, unreliable = true) @Remote(called = Loc.server, unreliable = true)

View File

@@ -1070,6 +1070,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
return true; return true;
} }
public boolean canPickup(){
return true;
}
public void removeFromProximity(){ public void removeFromProximity(){
onProximityRemoved(); onProximityRemoved();
tmpTiles.clear(); tmpTiles.clear();

View File

@@ -126,7 +126,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
if(tile != null && tile.team() == unit.team && pay.payloads().size < unit.type().payloadCapacity if(tile != null && tile.team() == unit.team && pay.payloads().size < unit.type().payloadCapacity
&& unit.within(tile, tilesize * tile.block.size * 1.2f)){ && unit.within(tile, tilesize * tile.block.size * 1.2f)){
//pick up block directly //pick up block directly
if(tile.block().buildVisibility != BuildVisibility.hidden && tile.block().size <= 2){ if(tile.block().buildVisibility != BuildVisibility.hidden && tile.block().size <= 2 && tile.canPickup()){
pay.pickup(tile); pay.pickup(tile);
}else{ //pick up block payload }else{ //pick up block payload
Payload current = tile.getPayload(); Payload current = tile.getPayload();

View File

@@ -84,7 +84,7 @@ public class Door extends Wall{
if(type == LAccess.enabled){ if(type == LAccess.enabled){
boolean shouldOpen = !Mathf.zero(p1); boolean shouldOpen = !Mathf.zero(p1);
if(open == shouldOpen || (Units.anyEntities(tile) && !shouldOpen) || !timer(timerToggle, 60f)){ if(open == shouldOpen || (Units.anyEntities(tile) && !shouldOpen) || !origin().timer(timerToggle, 60f)){
return; return;
} }
@@ -92,6 +92,10 @@ public class Door extends Wall{
} }
} }
public DoorBuild origin(){
return chained.isEmpty() ? this : chained.first();
}
public void effect(){ public void effect(){
(open ? closefx : openfx).at(this); (open ? closefx : openfx).at(this);
} }
@@ -130,7 +134,7 @@ public class Door extends Wall{
@Override @Override
public void tapped(Player player){ public void tapped(Player player){
if((Units.anyEntities(tile) && open) || !timer(timerToggle, 40f)){ if((Units.anyEntities(tile) && open) || !origin().timer(timerToggle, 50f)){
return; return;
} }

View File

@@ -43,12 +43,14 @@ public class LogicDisplay extends Block{
public void draw(){ public void draw(){
super.draw(); super.draw();
if(buffer == null){ Draw.draw(Draw.z(), () -> {
buffer = new FrameBuffer(displaySize, displaySize); if(buffer == null){
//clear the buffer - some OSs leave garbage in it buffer = new FrameBuffer(displaySize, displaySize);
buffer.begin(Pal.darkerMetal); //clear the buffer - some OSs leave garbage in it
buffer.end(); buffer.begin(Pal.darkerMetal);
} buffer.end();
}
});
if(!commands.isEmpty()){ if(!commands.isEmpty()){
Draw.draw(Draw.z(), () -> { Draw.draw(Draw.z(), () -> {
@@ -86,7 +88,11 @@ public class LogicDisplay extends Block{
}); });
} }
Draw.rect(Draw.wrap(buffer.getTexture()), x, y, buffer.getWidth() * Draw.scl, -buffer.getHeight() * Draw.scl); Draw.draw(Draw.z(), () -> {
if(buffer != null){
Draw.rect(Draw.wrap(buffer.getTexture()), x, y, buffer.getWidth() * Draw.scl, -buffer.getHeight() * Draw.scl);
}
});
} }
} }

View File

@@ -39,5 +39,10 @@ public abstract class StorageBlock extends Block{
linkedCore.drawSelect(); linkedCore.drawSelect();
} }
} }
@Override
public boolean canPickup(){
return linkedCore != null;
}
} }
} }