Crystal blocks

This commit is contained in:
Anuken
2022-01-19 21:24:02 -05:00
parent 4bee7e598b
commit 45178046d0
10 changed files with 21 additions and 2 deletions

View File

@@ -50,7 +50,7 @@ public class Blocks{
iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, grass, salt,
//boulders
shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, carbonBoulder, ferricBoulder, beryllicBoulder, yellowStoneBoulder,
arkyicBoulder, crystalCluster, vibrantCrystalCluster, crystallineBoulder, redIceBoulder,
arkyicBoulder, crystalCluster, vibrantCrystalCluster, crystalBlocks, crystallineBoulder, redIceBoulder,
metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor4, metalFloor5, basalt, magmarock, hotrock, snowWall, saltWall,
darkPanel1, darkPanel2, darkPanel3, darkPanel4, darkPanel5, darkPanel6, darkMetal,
pebbles, tendrils,
@@ -668,6 +668,13 @@ public class Blocks{
clipSize = 128f;
}};
crystalBlocks = new TallBlock("crystal-blocks"){{
variants = 3;
clipSize = 128f;
shadowAlpha = 0.5f;
shadowOffset = -2.5f;
}};
crystallineBoulder = new Prop("crystalline-boulder"){{
variants = 2;
crystallineStone.asFloor().decoration = this;

View File

@@ -221,6 +221,16 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
&& !near(x, y, 4, Blocks.crystalCluster) && !near(x, y, 4, Blocks.vibrantCrystalCluster)){
block = floor == Blocks.crystalFloor ? Blocks.vibrantCrystalCluster : Blocks.crystalCluster;
}
//TODO test, different placement
if(block == Blocks.regolithWall && rand.chance(0.16) && nearAir(x, y) && !near(x, y, 3, Blocks.crystalBlocks)){
block = Blocks.crystalBlocks;
}
//this is annoying as blocks under it can't be seen
//if(block == Blocks.air && floor == Blocks.regolith && rand.chance(0.004) && !near(x, y, 3, Blocks.crystalBlocks)){
// block = Blocks.crystalBlocks;
//}
});
//vents

View File

@@ -11,6 +11,7 @@ public class TallBlock extends Block{
public float shadowOffset = -3f;
public float layer = Layer.power + 1;
public float rotationRand = 20f;
public float shadowAlpha = 0.6f;
public TallBlock(String name){
super(name);
@@ -30,7 +31,7 @@ public class TallBlock extends Block{
float rot = Mathf.randomSeedRange(tile.pos() + 1, rotationRand);
Draw.z(Layer.power - 1);
Draw.color(0f, 0f, 0f, 0.6f);
Draw.color(0f, 0f, 0f, shadowAlpha);
Draw.rect(variants > 0 ? variantShadowRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantShadowRegions.length - 1))] : customShadowRegion,
tile.worldx() + shadowOffset, tile.worldy() + shadowOffset, rot);