Implemented shore map / New blocks / Bugfixes
|
Before Width: | Height: | Size: 103 B |
|
Before Width: | Height: | Size: 94 B |
|
Before Width: | Height: | Size: 101 B |
BIN
core/assets-raw/sprites/blocks/environment/dunerocks-large.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
core/assets-raw/sprites/blocks/environment/dunerocks1.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
core/assets-raw/sprites/blocks/environment/dunerocks2.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 992 B After Width: | Height: | Size: 987 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 990 B After Width: | Height: | Size: 983 B |
|
Before Width: | Height: | Size: 74 B |
|
Before Width: | Height: | Size: 1.1 KiB |
BIN
core/assets-raw/sprites/blocks/walls/scrap-wall-large.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
core/assets-raw/sprites/blocks/walls/scrap-wall1.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
core/assets-raw/sprites/blocks/walls/scrap-wall2.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
core/assets-raw/sprites/blocks/walls/scrap-wall3.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
@@ -522,7 +522,7 @@ block.tar.name = Tar
|
|||||||
block.blackstone.name = Black Stone
|
block.blackstone.name = Black Stone
|
||||||
block.stone.name = Stone
|
block.stone.name = Stone
|
||||||
block.dirt.name = Dirt
|
block.dirt.name = Dirt
|
||||||
block.sand.name = Sand
|
block.sand.name = Dark Sand
|
||||||
block.ice.name = Ice
|
block.ice.name = Ice
|
||||||
block.snow.name = Snow
|
block.snow.name = Snow
|
||||||
block.grass.name = Grass
|
block.grass.name = Grass
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 980 KiB After Width: | Height: | Size: 1009 KiB |
@@ -159,6 +159,7 @@ public class Pathfinder{
|
|||||||
|
|
||||||
if(other != null && (path.weights[dx][dy] > cost + other.cost || path.searches[dx][dy] < path.search)
|
if(other != null && (path.weights[dx][dy] > cost + other.cost || path.searches[dx][dy] < path.search)
|
||||||
&& passable(other, team)){
|
&& passable(other, team)){
|
||||||
|
if(other.cost < 0) throw new IllegalArgumentException("Tile cost cannot be negative! " + other);
|
||||||
path.frontier.addFirst(world.tile(dx, dy));
|
path.frontier.addFirst(world.tile(dx, dy));
|
||||||
path.weights[dx][dy] = cost + other.cost;
|
path.weights[dx][dy] = cost + other.cost;
|
||||||
path.searches[dx][dy] = (short)path.search;
|
path.searches[dx][dy] = (short)path.search;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import java.io.IOException;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class WaveSpawner{
|
public class WaveSpawner{
|
||||||
private static final float shockwaveBase = 350f, shockwaveRand = 10f, maxShockwaveDst = shockwaveBase + shockwaveRand;
|
private static final float shockwaveBase = 380f, shockwaveRand = 50f, maxShockwaveDst = shockwaveBase + shockwaveRand;
|
||||||
private Array<SpawnGroup> groups;
|
private Array<SpawnGroup> groups;
|
||||||
private Array<FlyerSpawn> flySpawns = new Array<>();
|
private Array<FlyerSpawn> flySpawns = new Array<>();
|
||||||
private Array<GroundSpawn> groundSpawns = new Array<>();
|
private Array<GroundSpawn> groundSpawns = new Array<>();
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class Blocks implements ContentList{
|
|||||||
//environment
|
//environment
|
||||||
air, part, spawn, deepwater, water, tar, stone, craters, charr, sand, ice, snow,
|
air, part, spawn, deepwater, water, tar, stone, craters, charr, sand, ice, snow,
|
||||||
grass, holostone, rocks, icerocks, cliffs, pine, whiteTree, whiteTreeDead, sporeCluster,
|
grass, holostone, rocks, icerocks, cliffs, pine, whiteTree, whiteTreeDead, sporeCluster,
|
||||||
iceSnow,
|
iceSnow, sandWater, dunerocks,
|
||||||
|
|
||||||
//crafting
|
//crafting
|
||||||
siliconSmelter, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer,
|
siliconSmelter, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer,
|
||||||
@@ -46,6 +46,7 @@ public class Blocks implements ContentList{
|
|||||||
powerVoid, powerSource, itemSource, liquidSource, itemVoid,
|
powerVoid, powerSource, itemSource, liquidSource, itemVoid,
|
||||||
|
|
||||||
//defense
|
//defense
|
||||||
|
scrapWall, scrapWallLarge,
|
||||||
copperWall, copperWallLarge, titaniumWall, titaniumWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
|
copperWall, copperWallLarge, titaniumWall, titaniumWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
|
||||||
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, overdriveProjector, forceProjector, shockMine,
|
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, overdriveProjector, forceProjector, shockMine,
|
||||||
|
|
||||||
@@ -158,6 +159,18 @@ public class Blocks implements ContentList{
|
|||||||
minimapColor = Color.valueOf("323232");
|
minimapColor = Color.valueOf("323232");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
sandWater = new Floor("sand-water"){{
|
||||||
|
liquidColor = Color.valueOf("596ab8");
|
||||||
|
speedMultiplier = 0.8f;
|
||||||
|
variants = 0;
|
||||||
|
status = StatusEffects.wet;
|
||||||
|
statusDuration = 50f;
|
||||||
|
liquidDrop = Liquids.water;
|
||||||
|
isLiquid = true;
|
||||||
|
cacheLayer = CacheLayer.water;
|
||||||
|
minimapColor = Color.valueOf("506eb4");
|
||||||
|
}};
|
||||||
|
|
||||||
sand = new Floor("sand"){{
|
sand = new Floor("sand"){{
|
||||||
itemDrop = Items.sand;
|
itemDrop = Items.sand;
|
||||||
minimapColor = Color.valueOf("988a67");
|
minimapColor = Color.valueOf("988a67");
|
||||||
@@ -202,6 +215,10 @@ public class Blocks implements ContentList{
|
|||||||
variants = 2;
|
variants = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
dunerocks = new StaticWall("dunerocks"){{
|
||||||
|
variants = 2;
|
||||||
|
}};
|
||||||
|
|
||||||
pine = new StaticWall("pine"){{
|
pine = new StaticWall("pine"){{
|
||||||
//fillsTile = false;
|
//fillsTile = false;
|
||||||
variants = 0;
|
variants = 0;
|
||||||
@@ -433,6 +450,16 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
int wallHealthMultiplier = 3;
|
int wallHealthMultiplier = 3;
|
||||||
|
|
||||||
|
scrapWall = new Wall("scrap-wall"){{
|
||||||
|
health = 80;
|
||||||
|
variants = 3;
|
||||||
|
}};
|
||||||
|
|
||||||
|
scrapWallLarge = new Wall("scrap-wall-large"){{
|
||||||
|
health = 80 * 4;
|
||||||
|
size = 2;
|
||||||
|
}};
|
||||||
|
|
||||||
copperWall = new Wall("copper-wall"){{
|
copperWall = new Wall("copper-wall"){{
|
||||||
requirements(Category.defense, ItemStack.with(Items.copper, 12));
|
requirements(Category.defense, ItemStack.with(Items.copper, 12));
|
||||||
health = 80 * wallHealthMultiplier;
|
health = 80 * wallHealthMultiplier;
|
||||||
@@ -440,7 +467,6 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
copperWallLarge = new Wall("copper-wall-large"){{
|
copperWallLarge = new Wall("copper-wall-large"){{
|
||||||
requirements(Category.defense, ItemStack.with(Items.copper, 12 * 4));
|
requirements(Category.defense, ItemStack.with(Items.copper, 12 * 4));
|
||||||
requirements(Category.defense, ItemStack.with(Items.copper, 12));
|
|
||||||
health = 80 * 4 * wallHealthMultiplier;
|
health = 80 * 4 * wallHealthMultiplier;
|
||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -168,16 +168,61 @@ public class Zones implements ContentList{
|
|||||||
}};
|
}};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
ruinousShores = new Zone("ruinousShores", new MapGenerator("ruinousShores")){{ //TODO implement
|
ruinousShores = new Zone("ruinousShores", new MapGenerator("ruinousShores", 1)){{ //TODO implement
|
||||||
deployCost = ItemStack.with(Items.copper, 300);
|
deployCost = ItemStack.with(Items.copper, 600, Items.graphite, 50);
|
||||||
startingItems = ItemStack.with(Items.copper, 200);
|
startingItems = ItemStack.with(Items.copper, 400);
|
||||||
conditionWave = 15;
|
conditionWave = 20;
|
||||||
|
launchPeriod = 20;
|
||||||
zoneRequirements = new Zone[]{frozenForest};
|
zoneRequirements = new Zone[]{frozenForest};
|
||||||
blockRequirements = new Block[]{Blocks.copperWall};
|
itemRequirements = ItemStack.with(Items.lead, 6000, Items.graphite, 2000);
|
||||||
|
blockRequirements = new Block[]{Blocks.graphitePress, Blocks.combustionGenerator};
|
||||||
rules = () -> new Rules(){{
|
rules = () -> new Rules(){{
|
||||||
waves = true;
|
waves = true;
|
||||||
waveTimer = true;
|
waveTimer = true;
|
||||||
waveSpacing = 60 * 80;
|
waveSpacing = 60 * 60;
|
||||||
|
spawns = Array.with(
|
||||||
|
new SpawnGroup(UnitTypes.wraith){{
|
||||||
|
unitScaling = 2;
|
||||||
|
spacing = 2;
|
||||||
|
end = 10;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new SpawnGroup(UnitTypes.dagger){{
|
||||||
|
begin = 2;
|
||||||
|
spacing = 2;
|
||||||
|
unitScaling = 2;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new SpawnGroup(UnitTypes.wraith){{
|
||||||
|
begin = 10;
|
||||||
|
unitScaling = 0.5f;
|
||||||
|
unitAmount = 6;
|
||||||
|
spacing = 10;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new SpawnGroup(UnitTypes.crawler){{
|
||||||
|
begin = 5;
|
||||||
|
unitScaling = 1;
|
||||||
|
spacing = 5;
|
||||||
|
unitAmount = 1;
|
||||||
|
effect = StatusEffects.overdrive;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new SpawnGroup(UnitTypes.crawler){{
|
||||||
|
begin = 22;
|
||||||
|
unitScaling = 1;
|
||||||
|
spacing = 20;
|
||||||
|
unitScaling = 0.5f;
|
||||||
|
unitAmount = 10;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new SpawnGroup(UnitTypes.dagger){{
|
||||||
|
begin = 11;
|
||||||
|
spacing = 2;
|
||||||
|
unitScaling = 2;
|
||||||
|
unitAmount = 2;
|
||||||
|
}}
|
||||||
|
);
|
||||||
}};
|
}};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -84,10 +84,11 @@ public class BlockRenderer{
|
|||||||
|
|
||||||
public void drawFog(){
|
public void drawFog(){
|
||||||
float ww = world.width() * tilesize, wh = world.height() * tilesize;
|
float ww = world.width() * tilesize, wh = world.height() * tilesize;
|
||||||
float u = (camera.position.x - camera.width/2f) / ww,
|
float x = camera.position.x + tilesize/2f, y = camera.position.y + tilesize/2f;
|
||||||
v = (camera.position.y - camera.height/2f) / wh,
|
float u = (x - camera.width/2f) / ww,
|
||||||
u2 = (camera.position.x + camera.width/2f) / ww,
|
v = (y - camera.height/2f) / wh,
|
||||||
v2 = (camera.position.y + camera.height/2f) / wh;
|
u2 = (x + camera.width/2f) / ww,
|
||||||
|
v2 = (y + camera.height/2f) / wh;
|
||||||
|
|
||||||
Tmp.tr1.set(fog.getTexture());
|
Tmp.tr1.set(fog.getTexture());
|
||||||
Tmp.tr1.set(u, v2, u2, v);
|
Tmp.tr1.set(u, v2, u2, v);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public enum Binding implements KeyBind{
|
|||||||
dash(KeyCode.SHIFT_LEFT),
|
dash(KeyCode.SHIFT_LEFT),
|
||||||
drop_unit(KeyCode.SHIFT_LEFT),
|
drop_unit(KeyCode.SHIFT_LEFT),
|
||||||
gridMode(KeyCode.SPACE),
|
gridMode(KeyCode.SPACE),
|
||||||
gridModeShift(KeyCode.SHIFT_LEFT),
|
gridModeShift(KeyCode.ALT_LEFT),
|
||||||
zoom_hold(KeyCode.CONTROL_LEFT, "view"),
|
zoom_hold(KeyCode.CONTROL_LEFT, "view"),
|
||||||
zoom(new Axis(KeyCode.SCROLL)),
|
zoom(new Axis(KeyCode.SCROLL)),
|
||||||
zoom_minimap(new Axis(KeyCode.MINUS, KeyCode.PLUS)),
|
zoom_minimap(new Axis(KeyCode.MINUS, KeyCode.PLUS)),
|
||||||
|
|||||||
@@ -90,8 +90,10 @@ public class MapGenerator extends Generator{
|
|||||||
int newX = Mathf.clamp((int)(simplex.octaveNoise2D(1, 1, 1.0 / scl, x, y) * distortion + x), 0, data.width()-1);
|
int newX = Mathf.clamp((int)(simplex.octaveNoise2D(1, 1, 1.0 / scl, x, y) * distortion + x), 0, data.width()-1);
|
||||||
int newY = Mathf.clamp((int)(simplex.octaveNoise2D(1, 1, 1.0 / scl, x + 9999, y + 9999) * distortion + y), 0, data.height()-1);
|
int newY = Mathf.clamp((int)(simplex.octaveNoise2D(1, 1, 1.0 / scl, x + 9999, y + 9999) * distortion + y), 0, data.height()-1);
|
||||||
|
|
||||||
if(tile.block() instanceof StaticWall
|
if((tile.block() instanceof StaticWall
|
||||||
&& tiles[newX][newY].block() instanceof StaticWall){
|
&& tiles[newX][newY].block() instanceof StaticWall)
|
||||||
|
|| tile.block() == Blocks.air
|
||||||
|
|| tiles[newX][newY].block() == Blocks.air){
|
||||||
tile.setBlock(tiles[newX][newY].block());
|
tile.setBlock(tiles[newX][newY].block());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void buildButton(Zone zone, TextButton button){
|
void buildButton(Zone zone, TextButton button){
|
||||||
button.setDisabled(() -> !canUnlock(zone) || !data.hasItems(zone.itemRequirements));
|
button.setDisabled(() -> !canUnlock(zone) || !data.hasItems(zone.deployCost));
|
||||||
button.clicked(() -> {
|
button.clicked(() -> {
|
||||||
if(!data.isUnlocked(zone)){
|
if(!data.isUnlocked(zone)){
|
||||||
data.removeItems(zone.itemRequirements);
|
data.removeItems(zone.itemRequirements);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.world;
|
|||||||
|
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.Array;
|
||||||
import io.anuke.arc.function.Consumer;
|
import io.anuke.arc.function.Consumer;
|
||||||
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.math.geom.Geometry;
|
import io.anuke.arc.math.geom.Geometry;
|
||||||
import io.anuke.arc.math.geom.Point2;
|
import io.anuke.arc.math.geom.Point2;
|
||||||
import io.anuke.arc.math.geom.Position;
|
import io.anuke.arc.math.geom.Position;
|
||||||
@@ -330,11 +331,11 @@ public class Tile implements Position, TargetTrait{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(target().synthetic()){
|
if(target().synthetic()){
|
||||||
cost += target().block().health / 10f;
|
cost += Mathf.clamp(target().block().health / 10f, 0, 28);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(floor.isLiquid){
|
if(floor.isLiquid){
|
||||||
cost += 100f;
|
cost += 80;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
package io.anuke.mindustry.world.blocks.defense;
|
package io.anuke.mindustry.world.blocks.defense;
|
||||||
|
|
||||||
|
import io.anuke.arc.Core;
|
||||||
|
import io.anuke.arc.graphics.g2d.Draw;
|
||||||
|
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||||
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.meta.BlockGroup;
|
import io.anuke.mindustry.world.meta.BlockGroup;
|
||||||
|
|
||||||
public class Wall extends Block{
|
public class Wall extends Block{
|
||||||
|
protected int variants = 0;
|
||||||
|
|
||||||
public Wall(String name){
|
public Wall(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@@ -12,6 +18,34 @@ public class Wall extends Block{
|
|||||||
group = BlockGroup.walls;
|
group = BlockGroup.walls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void load(){
|
||||||
|
super.load();
|
||||||
|
|
||||||
|
if(variants != 0){
|
||||||
|
variantRegions = new TextureRegion[variants];
|
||||||
|
|
||||||
|
for(int i = 0; i < variants; i++){
|
||||||
|
variantRegions[i] = Core.atlas.find(name + (i + 1));
|
||||||
|
}
|
||||||
|
region = variantRegions[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Tile tile){
|
||||||
|
if(variants == 0){
|
||||||
|
Draw.rect(region, tile.drawx(), tile.drawy());
|
||||||
|
}else{
|
||||||
|
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.drawx(), tile.drawy());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextureRegion[] generateIcons(){
|
||||||
|
return new TextureRegion[]{Core.atlas.find(Core.atlas.has(name) ? name : name + "1")};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canReplace(Block other){
|
public boolean canReplace(Block other){
|
||||||
return super.canReplace(other) && health > other.health;
|
return super.canReplace(other) && health > other.health;
|
||||||
|
|||||||
@@ -160,14 +160,16 @@ public class Generators {
|
|||||||
try{
|
try{
|
||||||
Image image = ImagePacker.get(floor.generateIcons()[0]);
|
Image image = ImagePacker.get(floor.generateIcons()[0]);
|
||||||
Image edge = ImagePacker.get("edge-stencil-" + floor.edgeStyle);
|
Image edge = ImagePacker.get("edge-stencil-" + floor.edgeStyle);
|
||||||
|
Image result = new Image(edge.width(), edge.height());
|
||||||
|
|
||||||
for(int x = 0; x < edge.width(); x++){
|
for(int x = 0; x < edge.width(); x++){
|
||||||
for(int y = 0; y < edge.height(); y++){
|
for(int y = 0; y < edge.height(); y++){
|
||||||
edge.draw(x, y, edge.getColor(x, y).mul(image.getColor(x % image.width(), y % image.height())));
|
result.draw(x, y, edge.getColor(x, y).mul(image.getColor(x % image.width(), y % image.height())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
edge.save(floor.name + "-edge");
|
result.save(floor.name + "-edge");
|
||||||
|
|
||||||
}catch(Exception ignored){}
|
}catch(Exception ignored){}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||