Overlay testing

This commit is contained in:
Anuken
2019-04-12 23:03:34 -04:00
parent c0e425cf46
commit 816ae84005
25 changed files with 3527 additions and 3274 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -608,6 +608,8 @@ liquid.temperature = [LIGHT_GRAY]Temperature: {0}
block.grass.name = Grass
block.salt.name = Salt
block.saltrocks.name = Salt Rocks
block.pebbles.name = Pebbles
block.sandrocks.name = Sand Rocks
block.spore-pine.name = Spore Pine
block.sporerocks.name = Spore Rocks

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 505 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 KiB

After

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 KiB

After

Width:  |  Height:  |  Size: 712 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 350 KiB

View File

@ -33,9 +33,10 @@ public class Blocks implements ContentList{
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,
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,
darkPanel1, darkPanel2, darkPanel3, darkPanel4, darkPanel5, darkPanel6, darkMetal,
pebbles,
//ores
oreCopper, oreLead, oreScrap, oreCoal, oreTitanium, oreThorium,
@ -300,6 +301,9 @@ public class Blocks implements ContentList{
variants = 2;
}};
saltRocks = new StaticWall("saltrocks"){{
}};
sporePine = new StaticWall("spore-pine"){{
variants = 0;
}};
@ -376,6 +380,8 @@ public class Blocks implements ContentList{
darkMetal = new StaticWall("dark-metal"){{
}};
pebbles = new OverlayFloor("pebbles");
//endregion
//region ore

View File

@ -13,7 +13,7 @@ public class Zones implements ContentList{
public static Zone
groundZero, desertWastes,
craters, frozenForest, ruinousShores, stainedMountains,
overgrowth, infestedIslands,
saltFlats, overgrowth, infestedIslands,
desolateRift, nuclearComplex;
@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)){{
startingItems = ItemStack.list(Items.copper, 200);
conditionWave = 10;

View File

@ -234,7 +234,7 @@ public abstract class InputHandler implements InputProcessor{
boolean canMine(Tile tile){
return !Core.scene.hasMouse()
&& 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())
&& tile.block() == Blocks.air && player.dst(tile.worldx(), tile.worldy()) <= Player.mineDistance;
}

View File

@ -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){
Block[] blocks = {Blocks.darkPanel3};
int secSize = 20;

View File

@ -34,10 +34,11 @@ public class DesertWastesGenerator extends BasicGenerator{
distort(tiles, 20f, 4f);
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);
tech(tiles);
overlay(tiles, Blocks.sand, Blocks.pebbles, 5, 0.8f, 30f, 0.6f);
//scatter(tiles, Blocks.sandRocks, Blocks.creeptree, 1f);
tiles[endX][endY].setBlock(Blocks.spawn);

View File

@ -11,7 +11,6 @@ import io.anuke.arc.scene.event.Touchable;
import io.anuke.arc.scene.style.TextureRegionDrawable;
import io.anuke.arc.scene.ui.*;
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.entities.type.TileEntity;
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. */
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;
}
}

View File

@ -18,7 +18,7 @@ import static io.anuke.mindustry.Vars.tilesize;
public class Floor extends Block{
/** number of different variant regions to use */
public int variants;
public int variants = 3;
/** edge fallback, used mainly for ores */
public String edge = "stone";
/** Multiplies unit velocity by this when walked on. */
@ -61,7 +61,6 @@ public class Floor extends Block{
public Floor(String name){
super(name);
variants = 3;
}
@Override

View File

@ -170,7 +170,7 @@ public class Generators{
});
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.weapon.load();