Overlay testing
BIN
core/assets-raw/sprites/blocks/environment/pebbles1.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
core/assets-raw/sprites/blocks/environment/pebbles2.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
core/assets-raw/sprites/blocks/environment/pebbles3.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
core/assets-raw/sprites/blocks/environment/saltrocks-large.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
core/assets-raw/sprites/blocks/environment/saltrocks1.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
core/assets-raw/sprites/blocks/environment/saltrocks2.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
@@ -608,6 +608,8 @@ liquid.temperature = [LIGHT_GRAY]Temperature: {0}
|
|||||||
|
|
||||||
block.grass.name = Grass
|
block.grass.name = Grass
|
||||||
block.salt.name = Salt
|
block.salt.name = Salt
|
||||||
|
block.saltrocks.name = Salt Rocks
|
||||||
|
block.pebbles.name = Pebbles
|
||||||
block.sandrocks.name = Sand Rocks
|
block.sandrocks.name = Sand Rocks
|
||||||
block.spore-pine.name = Spore Pine
|
block.spore-pine.name = Spore Pine
|
||||||
block.sporerocks.name = Spore Rocks
|
block.sporerocks.name = Spore Rocks
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 505 B |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 279 KiB After Width: | Height: | Size: 281 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 515 KiB After Width: | Height: | Size: 511 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 723 KiB After Width: | Height: | Size: 712 KiB |
|
Before Width: | Height: | Size: 320 KiB After Width: | Height: | Size: 350 KiB |
@@ -33,9 +33,10 @@ public class Blocks implements ContentList{
|
|||||||
air, part, spawn, deepwater, water, taintedWater, tar, stone, craters, charr, sand, darksand, ice, snow, darksandTaintedWater,
|
air, part, spawn, deepwater, water, taintedWater, tar, stone, craters, charr, sand, darksand, ice, snow, darksandTaintedWater,
|
||||||
holostone, rocks, sporerocks, icerocks, cliffs, sporePine, pine, whiteTree, whiteTreeDead, sporeCluster,
|
holostone, rocks, sporerocks, icerocks, cliffs, sporePine, pine, whiteTree, whiteTreeDead, sporeCluster,
|
||||||
iceSnow, sandWater, darksandWater, duneRocks, sandRocks, moss, sporeMoss, shale, shaleRocks, shaleBoulder, grass, salt,
|
iceSnow, sandWater, darksandWater, duneRocks, sandRocks, moss, sporeMoss, shale, shaleRocks, shaleBoulder, grass, salt,
|
||||||
metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor5, ignarock, magmarock, hotrock, snowrocks, rock, snowrock,
|
metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor5, ignarock, magmarock, hotrock, snowrocks, rock, snowrock, saltRocks,
|
||||||
creeptree,
|
creeptree,
|
||||||
darkPanel1, darkPanel2, darkPanel3, darkPanel4, darkPanel5, darkPanel6, darkMetal,
|
darkPanel1, darkPanel2, darkPanel3, darkPanel4, darkPanel5, darkPanel6, darkMetal,
|
||||||
|
pebbles,
|
||||||
|
|
||||||
//ores
|
//ores
|
||||||
oreCopper, oreLead, oreScrap, oreCoal, oreTitanium, oreThorium,
|
oreCopper, oreLead, oreScrap, oreCoal, oreTitanium, oreThorium,
|
||||||
@@ -300,6 +301,9 @@ public class Blocks implements ContentList{
|
|||||||
variants = 2;
|
variants = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
saltRocks = new StaticWall("saltrocks"){{
|
||||||
|
}};
|
||||||
|
|
||||||
sporePine = new StaticWall("spore-pine"){{
|
sporePine = new StaticWall("spore-pine"){{
|
||||||
variants = 0;
|
variants = 0;
|
||||||
}};
|
}};
|
||||||
@@ -376,6 +380,8 @@ public class Blocks implements ContentList{
|
|||||||
darkMetal = new StaticWall("dark-metal"){{
|
darkMetal = new StaticWall("dark-metal"){{
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
pebbles = new OverlayFloor("pebbles");
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
//region ore
|
//region ore
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public class Zones implements ContentList{
|
|||||||
public static Zone
|
public static Zone
|
||||||
groundZero, desertWastes,
|
groundZero, desertWastes,
|
||||||
craters, frozenForest, ruinousShores, stainedMountains,
|
craters, frozenForest, ruinousShores, stainedMountains,
|
||||||
overgrowth, infestedIslands,
|
saltFlats, overgrowth, infestedIslands,
|
||||||
desolateRift, nuclearComplex;
|
desolateRift, nuclearComplex;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -46,6 +46,19 @@ public class Zones implements ContentList{
|
|||||||
}};
|
}};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
saltFlats = new Zone("saltFlats", new DesertWastesGenerator(260, 260)){{
|
||||||
|
startingItems = ItemStack.list(Items.copper, 200);
|
||||||
|
conditionWave = 10;
|
||||||
|
zoneRequirements = ZoneRequirement.with(groundZero, 10);
|
||||||
|
blockRequirements = new Block[]{Blocks.router};
|
||||||
|
resources = new Item[]{Items.copper, Items.lead, Items.coal, Items.sand};
|
||||||
|
rules = () -> new Rules(){{
|
||||||
|
waves = true;
|
||||||
|
waveTimer = true;
|
||||||
|
waveSpacing = 60 * 60 * 1.5f;
|
||||||
|
}};
|
||||||
|
}};
|
||||||
|
|
||||||
overgrowth = new Zone("overgrowth", new OvergrowthGenerator(320, 320)){{
|
overgrowth = new Zone("overgrowth", new OvergrowthGenerator(320, 320)){{
|
||||||
startingItems = ItemStack.list(Items.copper, 200);
|
startingItems = ItemStack.list(Items.copper, 200);
|
||||||
conditionWave = 10;
|
conditionWave = 10;
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ public abstract class InputHandler implements InputProcessor{
|
|||||||
boolean canMine(Tile tile){
|
boolean canMine(Tile tile){
|
||||||
return !Core.scene.hasMouse()
|
return !Core.scene.hasMouse()
|
||||||
&& tile.drop() != null && tile.drop().hardness <= player.mech.drillPower
|
&& tile.drop() != null && tile.drop().hardness <= player.mech.drillPower
|
||||||
&& !(tile.floor().playerUnmineable && tile.overlay() == Blocks.air)
|
&& !(tile.floor().playerUnmineable && tile.overlay().itemDrop == null)
|
||||||
&& player.acceptsItem(tile.drop())
|
&& player.acceptsItem(tile.drop())
|
||||||
&& tile.block() == Blocks.air && player.dst(tile.worldx(), tile.worldy()) <= Player.mineDistance;
|
&& tile.block() == Blocks.air && player.dst(tile.worldx(), tile.worldy()) <= Player.mineDistance;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,15 @@ public abstract class BasicGenerator extends RandomGenerator{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void overlay(Tile[][] tiles, Block floor, Block block, int octaves, float falloff, float scl, float threshold){
|
||||||
|
sim.setSeed(Mathf.random(99999));
|
||||||
|
pass(tiles, (x, y) -> {
|
||||||
|
if(sim.octaveNoise2D(octaves, falloff, 1f / scl, x, y) > threshold && tiles[x][y].floor() == floor){
|
||||||
|
ore = block;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void tech(Tile[][] tiles){
|
public void tech(Tile[][] tiles){
|
||||||
Block[] blocks = {Blocks.darkPanel3};
|
Block[] blocks = {Blocks.darkPanel3};
|
||||||
int secSize = 20;
|
int secSize = 20;
|
||||||
|
|||||||
@@ -34,10 +34,11 @@ public class DesertWastesGenerator extends BasicGenerator{
|
|||||||
distort(tiles, 20f, 4f);
|
distort(tiles, 20f, 4f);
|
||||||
inverseFloodFill(tiles, tiles[spawnX][spawnY], Blocks.sandRocks);
|
inverseFloodFill(tiles, tiles[spawnX][spawnY], Blocks.sandRocks);
|
||||||
|
|
||||||
noise(tiles, Blocks.salt, Blocks.sandRocks, 5, 0.6f, 200f, 0.55f);
|
noise(tiles, Blocks.salt, Blocks.saltRocks, 5, 0.6f, 200f, 0.55f);
|
||||||
noise(tiles, Blocks.darksand, Blocks.duneRocks, 5, 0.7f, 120f, 0.5f);
|
noise(tiles, Blocks.darksand, Blocks.duneRocks, 5, 0.7f, 120f, 0.5f);
|
||||||
|
|
||||||
tech(tiles);
|
tech(tiles);
|
||||||
|
overlay(tiles, Blocks.sand, Blocks.pebbles, 5, 0.8f, 30f, 0.6f);
|
||||||
//scatter(tiles, Blocks.sandRocks, Blocks.creeptree, 1f);
|
//scatter(tiles, Blocks.sandRocks, Blocks.creeptree, 1f);
|
||||||
|
|
||||||
tiles[endX][endY].setBlock(Blocks.spawn);
|
tiles[endX][endY].setBlock(Blocks.spawn);
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import io.anuke.arc.scene.event.Touchable;
|
|||||||
import io.anuke.arc.scene.style.TextureRegionDrawable;
|
import io.anuke.arc.scene.style.TextureRegionDrawable;
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.mindustry.content.Blocks;
|
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.game.EventType.UnlockEvent;
|
import io.anuke.mindustry.game.EventType.UnlockEvent;
|
||||||
@@ -337,6 +336,6 @@ public class PlacementFragment extends Fragment{
|
|||||||
|
|
||||||
/** Returns the block currently being hovered over in the world. */
|
/** Returns the block currently being hovered over in the world. */
|
||||||
Block tileDisplayBlock(){
|
Block tileDisplayBlock(){
|
||||||
return hoverTile == null ? null : hoverTile.block().synthetic() ? hoverTile.block() : hoverTile.overlay() != Blocks.air ? hoverTile.overlay() : null;
|
return hoverTile == null ? null : hoverTile.block().synthetic() ? hoverTile.block() : hoverTile.overlay().itemDrop != null ? hoverTile.overlay() : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ import static io.anuke.mindustry.Vars.tilesize;
|
|||||||
|
|
||||||
public class Floor extends Block{
|
public class Floor extends Block{
|
||||||
/** number of different variant regions to use */
|
/** number of different variant regions to use */
|
||||||
public int variants;
|
public int variants = 3;
|
||||||
/** edge fallback, used mainly for ores */
|
/** edge fallback, used mainly for ores */
|
||||||
public String edge = "stone";
|
public String edge = "stone";
|
||||||
/** Multiplies unit velocity by this when walked on. */
|
/** Multiplies unit velocity by this when walked on. */
|
||||||
@@ -61,7 +61,6 @@ public class Floor extends Block{
|
|||||||
|
|
||||||
public Floor(String name){
|
public Floor(String name){
|
||||||
super(name);
|
super(name);
|
||||||
variants = 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ public class Generators{
|
|||||||
});
|
});
|
||||||
|
|
||||||
ImagePacker.generate("unit-icons", () -> {
|
ImagePacker.generate("unit-icons", () -> {
|
||||||
content.<UnitType>getBy(ContentType.unit).each(type -> type.isFlying, type -> {
|
content.<UnitType>getBy(ContentType.unit).each(type -> !type.isFlying, type -> {
|
||||||
type.load();
|
type.load();
|
||||||
type.weapon.load();
|
type.weapon.load();
|
||||||
|
|
||||||
|
|||||||