Internal changes for surface-less floors

This commit is contained in:
Anuken
2020-10-08 14:44:02 -04:00
parent 6aa1144429
commit f14d631ff9
11 changed files with 21 additions and 13 deletions

View File

@@ -180,7 +180,7 @@ public class ConstructBlock extends Block{
public void onDestroyed(){
Fx.blockExplosionSmoke.at(tile);
if(!tile.floor().solid && !tile.floor().isLiquid){
if(!tile.floor().solid && tile.floor().hasSurface()){
Effect.rubble(x, y, size);
}
}

View File

@@ -166,6 +166,11 @@ public class Floor extends Block{
return new TextureRegion[]{Core.atlas.find(Core.atlas.has(name) ? name : name + "1")};
}
/** @return whether this floor has a valid surface on which to place things, e.g. scorch marks. */
public boolean hasSurface(){
return !isLiquid && !solid;
}
public boolean isDeep(){
return drownTime > 0;
}