This commit is contained in:
Anuken
2019-03-12 16:37:32 -04:00
parent 47300b42b0
commit 4d4869842e
13 changed files with 743 additions and 713 deletions

View File

@@ -35,7 +35,7 @@ public class Blocks implements ContentList{
//environment
air, part, spawn, deepwater, water, tar, stone, craters, charr, sand, ice, snow,
holostone, rocks, icerocks, cliffs, pine, whiteTree, whiteTreeDead, sporeCluster,
holostone, rocks, icerocks, cliffs, sporePine, pine, whiteTree, whiteTreeDead, sporeCluster,
iceSnow, sandWater, duneRocks, sandRocks, stainedRocks, moss, stainedRocksRed, stainedStoneRed, stainedRocksYellow, stainedStoneYellow, stainedBoulder, grass, salt,
metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor5, ignarock, magmarock, hotrock, snowrocks,
@@ -226,6 +226,10 @@ public class Blocks implements ContentList{
variants = 2;
}};
sporePine = new StaticWall("spore-pine"){{
variants = 0;
}};
pine = new StaticWall("pine"){{
variants = 0;
}};

View File

@@ -263,8 +263,7 @@ public class MobileInput extends InputHandler implements GestureListener{
//rotate button
table.addImageButton("icon-arrow", "clear-partial", 16 * 2f, () -> rotation = Mathf.mod(rotation + 1, 4))
.update(i -> i.getImage().setRotationOrigin(rotation * 90, Align.center))
.visible(() -> block != null && block.rotate);
.update(i -> i.getImage().setRotationOrigin(rotation * 90, Align.center)).visible(() -> block != null && block.rotate);
//confirm button
table.addImageButton("icon-check", "clear-partial", 16 * 2f, () -> {

View File

@@ -120,14 +120,15 @@ public abstract class SaveFileVersion{
byte floorid = stream.readByte();
byte oreid = stream.readByte();
int consecutives = stream.readUnsignedByte();
Block ore = content.block(oreid);
tiles[x][y] = new Tile(x, y, floorid, (byte)0);
tiles[x][y].setOreByte(oreid);
tiles[x][y].setOre(ore);
for(int j = i + 1; j < i + 1 + consecutives; j++){
int newx = j % width, newy = j / width;
Tile newTile = new Tile(newx, newy, floorid, (byte)0);
newTile.setOreByte(oreid);
newTile.setOre(ore);
tiles[newx][newy] = newTile;
}

View File

@@ -337,8 +337,8 @@ public class Tile implements Position, TargetTrait{
this.ore = ore;
}
public void setOre(Block floor){
setOreByte(floor.id);
public void setOre(Block block){
setOreByte(block.id);
}
public void clearOre(){

View File

@@ -110,7 +110,7 @@ public class Floor extends Block{
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy());
Floor floor = tile.oreBlock();
if(floor != Blocks.air){
if(floor != Blocks.air && floor != this){ //ore should never have itself on top, but it's possible, so prevent a crash in that case
floor.draw(tile);
}