Added sprites for all new crafting blocks, fixed seprator
BIN
core/assets-raw/sprites/blocks/extra/ripples.png
Normal file
After Width: | Height: | Size: 173 B |
After Width: | Height: | Size: 491 B |
BIN
core/assets-raw/sprites/blocks/production/centrifuge.png
Normal file
After Width: | Height: | Size: 421 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
BIN
core/assets-raw/sprites/blocks/production/extractor.png
Normal file
After Width: | Height: | Size: 246 B |
BIN
core/assets-raw/sprites/blocks/production/plasticformer.png
Normal file
After Width: | Height: | Size: 410 B |
BIN
core/assets-raw/sprites/blocks/production/powersmelter.png
Normal file
After Width: | Height: | Size: 491 B |
BIN
core/assets-raw/sprites/blocks/production/separator.png
Normal file
After Width: | Height: | Size: 277 B |
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 94 KiB |
@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Mon Mar 26 20:24:57 EDT 2018
|
#Mon Mar 26 22:36:42 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=662
|
androidBuildCode=669
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.4
|
code=3.4
|
||||||
build=custom build
|
build=custom build
|
||||||
|
@ -60,7 +60,7 @@ public class Recipes {
|
|||||||
new Recipe(crafting, CraftingBlocks.separator, stack(Items.steel, 30), stack(Items.iron, 30)),
|
new Recipe(crafting, CraftingBlocks.separator, stack(Items.steel, 30), stack(Items.iron, 30)),
|
||||||
new Recipe(crafting, CraftingBlocks.centrifuge, stack(Items.steel, 30), stack(Items.iron, 30)),
|
new Recipe(crafting, CraftingBlocks.centrifuge, stack(Items.steel, 30), stack(Items.iron, 30)),
|
||||||
new Recipe(crafting, CraftingBlocks.oilRefinery, stack(Items.steel, 15), stack(Items.iron, 15)),
|
new Recipe(crafting, CraftingBlocks.oilRefinery, stack(Items.steel, 15), stack(Items.iron, 15)),
|
||||||
new Recipe(crafting, CraftingBlocks.biomassCompressor, stack(Items.steel, 15), stack(Items.iron, 15)),
|
new Recipe(crafting, CraftingBlocks.biomatterCompressor, stack(Items.steel, 15), stack(Items.iron, 15)),
|
||||||
new Recipe(crafting, CraftingBlocks.stoneFormer, stack(Items.steel, 10), stack(Items.iron, 10)),
|
new Recipe(crafting, CraftingBlocks.stoneFormer, stack(Items.steel, 10), stack(Items.iron, 10)),
|
||||||
new Recipe(crafting, CraftingBlocks.plasticFormer, stack(Items.steel, 30), stack(Items.titanium, 15)),
|
new Recipe(crafting, CraftingBlocks.plasticFormer, stack(Items.steel, 30), stack(Items.titanium, 15)),
|
||||||
new Recipe(crafting, CraftingBlocks.cryofluidmixer, stack(Items.steel, 30), stack(Items.titanium, 15)),
|
new Recipe(crafting, CraftingBlocks.cryofluidmixer, stack(Items.steel, 30), stack(Items.titanium, 15)),
|
||||||
|
@ -60,20 +60,21 @@ public class CraftingBlocks {
|
|||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
separator = new Filtrator("separator") {{
|
separator = new Separator("separator") {{
|
||||||
liquid = Liquids.water;
|
liquid = Liquids.water;
|
||||||
item = Items.stone;
|
item = Items.stone;
|
||||||
results = new Item[]{
|
results = new Item[]{
|
||||||
null, null, null, null, null,
|
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||||
Items.stone, Items.stone, Items.stone, Items.stone,
|
Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone,
|
||||||
Items.iron, Items.iron, Items.iron,
|
Items.iron, Items.iron, Items.iron, Items.iron,
|
||||||
Items.lead, Items.lead,
|
Items.lead, Items.lead,
|
||||||
Items.coal, Items.coal,
|
Items.coal, Items.coal,
|
||||||
Items.titanium
|
Items.titanium
|
||||||
};
|
};
|
||||||
|
|
||||||
liquidUse = 0.1f;
|
liquidUse = 0.2f;
|
||||||
filterTime = 40f;
|
filterTime = 40f;
|
||||||
|
itemCapacity = 40;
|
||||||
|
|
||||||
health = 50;
|
health = 50;
|
||||||
}},
|
}},
|
||||||
@ -111,7 +112,7 @@ public class CraftingBlocks {
|
|||||||
hasPower = hasLiquids = true;
|
hasPower = hasLiquids = true;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
biomassCompressor = new PowerCrafter("biomasscompressor") {{
|
biomatterCompressor = new PowerCrafter("biomattercompressor") {{
|
||||||
input = new ItemStack(Items.biomatter, 1);
|
input = new ItemStack(Items.biomatter, 1);
|
||||||
liquidCapacity = 60f;
|
liquidCapacity = 60f;
|
||||||
powerUse = 0.05f;
|
powerUse = 0.05f;
|
||||||
|
@ -11,11 +11,11 @@ public class LiquidBlocks {
|
|||||||
public static final Block
|
public static final Block
|
||||||
|
|
||||||
pump = new Pump("pump") {{
|
pump = new Pump("pump") {{
|
||||||
pumpAmount = 0.8f;
|
pumpAmount = 0.1f;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
fluxpump = new Pump("fluxpump") {{
|
fluxpump = new Pump("fluxpump") {{
|
||||||
pumpAmount = 1.2f;
|
pumpAmount = 0.2f;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
conduit = new Conduit("conduit") {{
|
conduit = new Conduit("conduit") {{
|
||||||
|
@ -12,6 +12,7 @@ import io.anuke.mindustry.io.MapTileData.TileDataMarker;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.ColorMapper;
|
import io.anuke.mindustry.world.ColorMapper;
|
||||||
import io.anuke.mindustry.world.ColorMapper.BlockPair;
|
import io.anuke.mindustry.world.ColorMapper.BlockPair;
|
||||||
|
import io.anuke.ucore.util.Log;
|
||||||
|
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
@ -137,9 +138,14 @@ public class MapIO {
|
|||||||
|
|
||||||
short blocks = stream.readShort();
|
short blocks = stream.readShort();
|
||||||
for(int i = 0; i < blocks; i ++){
|
for(int i = 0; i < blocks; i ++){
|
||||||
Block block = Block.getByName(stream.readUTF());
|
short id = stream.readShort();
|
||||||
if(block == null) block = Blocks.air;
|
String name = stream.readUTF();
|
||||||
map.put(stream.readShort(), block.id);
|
Block block = Block.getByName(name);
|
||||||
|
if(block == null){
|
||||||
|
Log.info("Map load info: No block with name {0} found.", name);
|
||||||
|
block = Blocks.air;
|
||||||
|
}
|
||||||
|
map.put(id, block.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int width = stream.readShort();
|
int width = stream.readShort();
|
||||||
|
@ -92,7 +92,7 @@ public abstract class BaseBlock {
|
|||||||
|
|
||||||
if(ofract > fract) return;
|
if(ofract > fract) return;
|
||||||
|
|
||||||
float flow = Math.min((fract - ofract) * (liquidCapacity/(1.3f + tile.entity.liquid.liquid.viscosity)),
|
float flow = Math.min((fract - ofract) * (liquidCapacity/(1.1f + tile.entity.liquid.liquid.viscosity)),
|
||||||
Math.min(tile.entity.liquid.amount/liquidFlowFactor * Math.max(Timers.delta(), 1f), tile.entity.liquid.amount));
|
Math.min(tile.entity.liquid.amount/liquidFlowFactor * Math.max(Timers.delta(), 1f), tile.entity.liquid.amount));
|
||||||
|
|
||||||
if(flow <= 0f || tile.entity.liquid.amount < flow) return;
|
if(flow <= 0f || tile.entity.liquid.amount < flow) return;
|
||||||
|
@ -25,7 +25,7 @@ public class Conveyor extends Block{
|
|||||||
private static ItemPos drawpos = new ItemPos();
|
private static ItemPos drawpos = new ItemPos();
|
||||||
private static ItemPos pos1 = new ItemPos();
|
private static ItemPos pos1 = new ItemPos();
|
||||||
private static ItemPos pos2 = new ItemPos();
|
private static ItemPos pos2 = new ItemPos();
|
||||||
private static final float itemSpace = 0.135f * 1.3f;
|
private static final float itemSpace = 0.135f * 2f;
|
||||||
private static final float offsetScl = 128f*3f;
|
private static final float offsetScl = 128f*3f;
|
||||||
private static final float itemSize = 5f;
|
private static final float itemSize = 5f;
|
||||||
private static final float minmove = 1f / (Short.MAX_VALUE - 2);
|
private static final float minmove = 1f / (Short.MAX_VALUE - 2);
|
||||||
@ -142,7 +142,7 @@ public class Conveyor extends Block{
|
|||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||||
int direction = source == null ? 0 : Math.abs(source.relativeTo(tile.x, tile.y) - tile.getRotation());
|
int direction = source == null ? 0 : Math.abs(source.relativeTo(tile.x, tile.y) - tile.getRotation());
|
||||||
float minitem = tile.<ConveyorEntity>entity().minitem;
|
float minitem = tile.<ConveyorEntity>entity().minitem;
|
||||||
return (((direction == 0) && minitem > 0.05f) ||
|
return (((direction == 0) && minitem > itemSpace) ||
|
||||||
((direction %2 == 1) && minitem > 0.52f)) && (source == null || !(source.block().rotate && (source.getRotation() + 2) % 4 == tile.getRotation()));
|
((direction %2 == 1) && minitem > 0.52f)) && (source == null || !(source.block().rotate && (source.getRotation() + 2) % 4 == tile.getRotation()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ public class GenericCrafter extends Block{
|
|||||||
public GenericCrafter(String name) {
|
public GenericCrafter(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
update = true;
|
update = true;
|
||||||
rotate = false;
|
|
||||||
solid = true;
|
solid = true;
|
||||||
health = 60;
|
health = 60;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import io.anuke.ucore.core.Timers;
|
|||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
/**Extracts a random list of items from an input item and an input liquid.*/
|
/**Extracts a random list of items from an input item and an input liquid.*/
|
||||||
public class Filtrator extends Block {
|
public class Separator extends Block {
|
||||||
protected final int timerDump = timers ++;
|
protected final int timerDump = timers ++;
|
||||||
|
|
||||||
protected Liquid liquid;
|
protected Liquid liquid;
|
||||||
@ -19,7 +19,9 @@ public class Filtrator extends Block {
|
|||||||
protected float liquidUse;
|
protected float liquidUse;
|
||||||
protected float filterTime;
|
protected float filterTime;
|
||||||
|
|
||||||
public Filtrator(String name) {
|
protected boolean offloading = false;
|
||||||
|
|
||||||
|
public Separator(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
update = true;
|
update = true;
|
||||||
solid = true;
|
solid = true;
|
||||||
@ -37,12 +39,18 @@ public class Filtrator extends Block {
|
|||||||
|
|
||||||
if(entity.liquid.amount >= liquidUsed && entity.inventory.hasItem(item)){
|
if(entity.liquid.amount >= liquidUsed && entity.inventory.hasItem(item)){
|
||||||
entity.progress += 1f/filterTime;
|
entity.progress += 1f/filterTime;
|
||||||
|
entity.liquid.amount -= liquidUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entity.progress >= 1f){
|
if(entity.progress >= 1f){
|
||||||
entity.progress = 0f;
|
entity.progress = 0f;
|
||||||
Item item = Mathf.select(results);
|
Item item = Mathf.select(results);
|
||||||
if(item != null) offloadNear(tile, item);
|
entity.inventory.removeItem(this.item, 1);
|
||||||
|
if(item != null){
|
||||||
|
offloading = true;
|
||||||
|
offloadNear(tile, item);
|
||||||
|
offloading = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entity.timer.get(timerDump, 5)){
|
if(entity.timer.get(timerDump, 5)){
|
||||||
@ -52,7 +60,7 @@ public class Filtrator extends Block {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDump(Tile tile, Tile to, Item item) {
|
public boolean canDump(Tile tile, Tile to, Item item) {
|
||||||
return item != this.item;
|
return offloading || item != this.item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|