Changed several more resources

This commit is contained in:
Anuken
2019-01-02 18:49:04 -05:00
28 changed files with 4979 additions and 4219 deletions

View File

@@ -6,7 +6,7 @@ import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Liquid;
public class Liquids implements ContentList{
public static Liquid water, lava, oil, cryofluid;
public static Liquid water, slag, oil, cryofluid;
@Override
public void load(){
@@ -24,34 +24,28 @@ public class Liquids implements ContentList{
}
};
lava = new Liquid("lava", Color.valueOf("e37341")){
{
temperature = 1f;
viscosity = 0.8f;
tier = 2;
effect = StatusEffects.melting;
}
};
slag = new Liquid("slag", Color.valueOf("e37341")){{
temperature = 1f;
viscosity = 0.8f;
tier = 2;
effect = StatusEffects.melting;
}};
oil = new Liquid("oil", Color.valueOf("313131")){
{
viscosity = 0.7f;
flammability = 0.6f;
explosiveness = 0.6f;
heatCapacity = 0.7f;
tier = 1;
effect = StatusEffects.tarred;
}
};
oil = new Liquid("oil", Color.valueOf("313131")){{
viscosity = 0.7f;
flammability = 0.6f;
explosiveness = 0.6f;
heatCapacity = 0.7f;
tier = 1;
effect = StatusEffects.tarred;
}};
cryofluid = new Liquid("cryofluid", Color.SKY){
{
heatCapacity = 0.9f;
temperature = 0.25f;
tier = 1;
effect = StatusEffects.freezing;
}
};
cryofluid = new Liquid("cryofluid", Color.SKY){{
heatCapacity = 0.9f;
temperature = 0.25f;
tier = 1;
effect = StatusEffects.freezing;
}};
}
@Override

View File

@@ -27,11 +27,11 @@ public class Recipes implements ContentList{
new Recipe(defense, DefenseBlocks.copperWall, new ItemStack(Items.copper, 12)).setAlwaysUnlocked(true);
new Recipe(defense, DefenseBlocks.copperWallLarge, new ItemStack(Items.copper, 12 * 4)).setAlwaysUnlocked(true);
new Recipe(defense, DefenseBlocks.denseAlloyWall, new ItemStack(Items.densealloy, 12));
new Recipe(defense, DefenseBlocks.denseAlloyWallLarge, new ItemStack(Items.densealloy, 12 * 4));
new Recipe(defense, DefenseBlocks.denseAlloyWall, new ItemStack(Items.titanium, 12));
new Recipe(defense, DefenseBlocks.denseAlloyWallLarge, new ItemStack(Items.titanium, 12 * 4));
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.densealloy, 12), new ItemStack(Items.silicon, 8));
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.densealloy, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.titanium, 12), new ItemStack(Items.silicon, 8));
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.titanium, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
new Recipe(defense, DefenseBlocks.thoriumWall, new ItemStack(Items.thorium, 12));
new Recipe(defense, DefenseBlocks.thoriumWallLarge, new ItemStack(Items.thorium, 12 * 4));
@@ -42,19 +42,19 @@ public class Recipes implements ContentList{
new Recipe(defense, DefenseBlocks.surgeWall, new ItemStack(Items.surgealloy, 12));
new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4));
new Recipe(effect, StorageBlocks.container, new ItemStack(Items.densealloy, 200));
new Recipe(effect, StorageBlocks.vault, new ItemStack(Items.densealloy, 500), new ItemStack(Items.thorium, 250));
new Recipe(effect, StorageBlocks.container, new ItemStack(Items.titanium, 200));
new Recipe(effect, StorageBlocks.vault, new ItemStack(Items.titanium, 500), new ItemStack(Items.thorium, 250));
new Recipe(effect, StorageBlocks.core,
new ItemStack(Items.copper, 2000), new ItemStack(Items.densealloy, 2000),
new ItemStack(Items.copper, 2000), new ItemStack(Items.titanium, 2000),
new ItemStack(Items.silicon, 1750), new ItemStack(Items.thorium, 1000),
new ItemStack(Items.surgealloy, 500), new ItemStack(Items.phasefabric, 750)
);
//projectors
new Recipe(effect, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 180));
new Recipe(effect, DefenseBlocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(effect, DefenseBlocks.forceProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(effect, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.titanium, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 180));
new Recipe(effect, DefenseBlocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.titanium, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(effect, DefenseBlocks.forceProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.titanium, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(effect, DefenseBlocks.shockMine, new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 25))
.setDependencies(Items.blastCompound);

View File

@@ -90,20 +90,6 @@ public class Blocks extends BlockList implements ContentList{
minimapColor = Color.valueOf("506eb4");
}};
lava = new Floor("lava"){{
drownTime = 100f;
liquidColor = Color.valueOf("ed5334");
speedMultiplier = 0.2f;
damageTaken = 0.5f;
status = StatusEffects.melting;
statusIntensity = 0.8f;
variants = 0;
liquidDrop = Liquids.lava;
isLiquid = true;
cacheLayer = CacheLayer.lava;
minimapColor = Color.valueOf("ed5334");
}};
tar = new Floor("tar"){{
drownTime = 150f;
liquidColor = Color.valueOf("292929");
@@ -119,14 +105,12 @@ public class Blocks extends BlockList implements ContentList{
stone = new Floor("stone"){{
hasOres = true;
drops = new ItemStack(Items.stone, 1);
blends = block -> block != this && !(block instanceof OreBlock);
minimapColor = Color.valueOf("323232");
playerUnmineable = true;
}};
blackstone = new Floor("blackstone"){{
drops = new ItemStack(Items.stone, 1);
minimapColor = Color.valueOf("252525");
playerUnmineable = true;
hasOres = true;

View File

@@ -12,23 +12,10 @@ import io.anuke.mindustry.world.blocks.production.*;
public class CraftingBlocks extends BlockList implements ContentList{
public static Block arcsmelter, siliconsmelter, plastaniumCompressor, phaseWeaver, alloySmelter,
pyratiteMixer, blastMixer,
cryofluidmixer, melter, separator, centrifuge, biomatterCompressor, pulverizer, solidifier, incinerator;
cryofluidmixer, melter, separator, biomatterCompressor, pulverizer, solidifier, incinerator;
@Override
public void load(){
arcsmelter = new PowerSmelter("arc-smelter"){{
health = 90;
craftEffect = BlockFx.smeltsmoke;
result = Items.densealloy;
craftTime = 30f;
size = 2;
useFlux = true;
fluxNeeded = 2;
consumes.items(new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2));
consumes.power(0.1f);
}};
siliconsmelter = new PowerSmelter("silicon-smelter"){{
health = 90;
@@ -127,42 +114,21 @@ public class CraftingBlocks extends BlockList implements ContentList{
melter = new PowerCrafter("melter"){{
health = 200;
outputLiquid = Liquids.lava;
outputLiquid = Liquids.slag;
outputLiquidAmount = 1f;
itemCapacity = 20;
craftTime = 10f;
size = 2;
hasLiquids = hasPower = true;
consumes.power(0.1f);
consumes.item(Items.stone, 1);
consumes.item(Items.scrap, 1);
}};
separator = new Separator("separator"){{
results = new ItemStack[]{
new ItemStack(null, 10),
new ItemStack(Items.sand, 10),
new ItemStack(Items.stone, 9),
new ItemStack(Items.copper, 4),
new ItemStack(Items.lead, 2),
new ItemStack(Items.coal, 2),
new ItemStack(Items.titanium, 1),
};
filterTime = 40f;
itemCapacity = 40;
health = 50;
consumes.item(Items.stone, 2);
consumes.liquid(Liquids.water, 0.3f);
}};
centrifuge = new Separator("centrifuge"){{
results = new ItemStack[]{
new ItemStack(null, 13),
new ItemStack(Items.sand, 12),
new ItemStack(Items.stone, 11),
new ItemStack(Items.copper, 5),
new ItemStack(Items.lead, 3),
new ItemStack(Items.coal, 3),
new ItemStack(Items.titanium, 2),
new ItemStack(Items.thorium, 1)
};
@@ -177,9 +143,8 @@ public class CraftingBlocks extends BlockList implements ContentList{
spinnerSpeed = 3f;
size = 2;
consumes.item(Items.stone, 2);
consumes.power(0.2f);
consumes.liquid(Liquids.water, 0.5f);
consumes.power(0.1f);
consumes.liquid(Liquids.slag, 0.2f);
}};
biomatterCompressor = new Compressor("biomattercompressor"){{
@@ -209,18 +174,6 @@ public class CraftingBlocks extends BlockList implements ContentList{
consumes.power(0.05f);
}};
solidifier = new GenericCrafter("solidifer"){{
liquidCapacity = 21f;
craftTime = 14;
output = Items.stone;
itemCapacity = 20;
health = 80;
craftEffect = BlockFx.purifystone;
hasLiquids = hasItems = true;
consumes.liquid(Liquids.lava, 1f);
}};
incinerator = new Incinerator("incinerator"){{
health = 90;
}};

View File

@@ -84,13 +84,13 @@ public class TurretBlocks extends BlockList implements ContentList{
}};
lancer = new ChargeTurret("lancer"){{
range = 90f;
chargeTime = 60f;
range = 170f;
chargeTime = 50f;
chargeMaxDelay = 30f;
chargeEffects = 7;
shootType = AmmoTypes.lancerLaser;
recoil = 2f;
reload = 100f;
reload = 120f;
cooldown = 0.03f;
powerUsed = 20f;
powerCapacity = 60f;
@@ -107,13 +107,13 @@ public class TurretBlocks extends BlockList implements ContentList{
arc = new PowerTurret("arc"){{
shootType = AmmoTypes.arc;
reload = 85f;
shootShake = 1f;
reload = 20f;
shootShake = 0f;
shootCone = 40f;
rotatespeed = 8f;
powerUsed = 10f;
powerUsed = 3f;
powerCapacity = 30f;
range = 150f;
range = 50f;
shootEffect = ShootFx.lightningShoot;
heatColor = Color.RED;
recoil = 1f;

View File

@@ -142,11 +142,11 @@ public class TurretBullets extends BulletList implements ContentList{
}
};
lancerLaser = new BulletType(0.001f, 140){
lancerLaser = new BulletType(0.001f, 60){
Color[] colors = {Palette.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Palette.lancerLaser, Color.WHITE};
float[] tscales = {1f, 0.7f, 0.5f, 0.2f};
float[] lenscales = {1f, 1.1f, 1.13f, 1.14f};
float length = 100f;
float length = 170f;
{
hiteffect = BulletFx.hitLancer;
@@ -315,7 +315,7 @@ public class TurretBullets extends BulletList implements ContentList{
}
};
arc = new BulletType(0.001f, 26){
arc = new BulletType(0.001f, 8){
{
lifetime = 1;
despawneffect = Fx.none;

View File

@@ -34,41 +34,6 @@ public abstract class Platform {
Core.input.setOnscreenKeyboardVisible(false);
};
Core.input.getTextInput(input);
/*
Dialog dialog = new Dialog("", "dialog");
dialog.setFillParent(true);
dialog.content().top();
dialog.content().defaults().height(65f);
TextField[] use = {null};
dialog.content().addImageButton("icon-copy", "clear", 16*3, () -> use[0].copy())
.visible(() -> !use[0].getSelection().isEmpty()).width(65f);
dialog.content().addImageButton("icon-paste", "clear", 16*3, () ->
use[0].paste(Core.app.getClipboard().getContents(), false))
.visible(() -> Core.app.getClipboard() != null && Core.app.getClipboard().getContents() != null && !Core.app.getClipboard().getContents().isEmpty()).width(65f);
TextField to = dialog.content().addField(field.getText(), t-> {}).pad(15).width(250f).get();
to.setMaxLength(maxLength);
to.keyDown(KeyCode.ENTER, () -> dialog.content().find("okb").fireClick());
use[0] = to;
dialog.content().addButton("$text.ok", () -> {
field.clearText();
field.appendText(to.getText());
field.change();
dialog.hide();
Core.input.setOnscreenKeyboardVisible(false);
}).width(90f).name("okb");
dialog.show();
Time.runTask(1f, () -> {
to.setCursorPosition(to.getText().length());
Core.scene.setKeyboardFocus(to);
Core.input.setOnscreenKeyboardVisible(true);
});*/
});
}
/**Update discord RPC.*/

View File

@@ -297,7 +297,7 @@ public class Renderer implements ApplicationListener{
public void clampScale(){
float s = io.anuke.arc.scene.ui.layout.Unit.dp.scl(1f);
targetscale = Mathf.clamp(targetscale, Math.round(s * 1), Math.round(s * 6));
targetscale = Mathf.clamp(targetscale, Math.round(s * 2), Math.round(s * 6));
}
public void takeMapScreenshot(){

View File

@@ -22,7 +22,7 @@ public class OperationStack{
stack.add(action);
if(stack.size > maxSize){
stack.removeAt(0);
stack.remove(0);
}
}

View File

@@ -656,7 +656,7 @@ public class MobileInput extends InputHandler implements GestureListener{
PlaceRequest request = removals.get(i);
if(request.scale <= 0.0001f){
removals.removeAt(i);
removals.remove(i);
i--;
}
}

View File

@@ -23,7 +23,7 @@ public class BackgroundFragment extends Fragment{
Draw.shader();
boolean portrait = Core.graphics.getWidth() < Core.graphics.getHeight();
float logoscl = (int) Unit.dp.scl(1) * (portrait ? 0.5f : 0.75f);
float logoscl = (int) Unit.dp.scl(1);
TextureRegion logo = Core.atlas.find("logotext");
float logow = logo.getWidth() * logoscl;
float logoh = logo.getHeight() * logoscl;

View File

@@ -32,7 +32,7 @@ public class LoadingFragment extends Fragment{
public void setButton(Runnable listener){
button.visible(true);
button.getListeners().removeAt(button.getListeners().size - 1);
button.getListeners().remove(button.getListeners().size - 1);
button.clicked(listener);
}

View File

@@ -31,7 +31,7 @@ public interface SelectionTrait{
ImageButton button = cont.addImageButton("white", "clear-toggle", 24, () -> {}).group(group).get();
button.changed(() -> consumer.accept(button.isChecked() ? item : null));
button.getStyle().imageUp = new TextureRegionDrawable(item.region);
button.setChecked(holder.get() == item);
button.update(() -> button.setChecked(holder.get() == item));
if(i++ % 4 == 3){
cont.row();

View File

@@ -2,20 +2,19 @@ package io.anuke.mindustry.world.blocks.production;
import io.anuke.arc.Core;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.production.GenericCrafter.GenericCrafterEntity;
import io.anuke.mindustry.world.consumers.ConsumeItem;
import io.anuke.mindustry.world.meta.BlockStat;
import io.anuke.mindustry.world.meta.values.ItemFilterValue;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Mathf;
/**
* Extracts a random list of items from an input item and an input liquid.
@@ -41,9 +40,6 @@ public class Separator extends Block{
solid = true;
hasItems = true;
hasLiquids = true;
consumes.item(Items.stone);
consumes.liquid(Liquids.water, 0.1f);
}
@Override
@@ -103,7 +99,7 @@ public class Separator extends Block{
int count = 0;
Item item = null;
//TODO possible desync since items are random
//TODO guaranteed desync since items are random
for(ItemStack stack : results){
if(i >= count && i < count + stack.amount){
item = stack.item;
@@ -112,8 +108,11 @@ public class Separator extends Block{
count += stack.amount;
}
entity.items.remove(consumes.item(), consumes.itemAmount());
if(item != null){
if(consumes.has(ConsumeItem.class)){
entity.items.remove(consumes.item(), consumes.itemAmount());
}
if(item != null && entity.items.get(item) < itemCapacity){
offloading = true;
offloadNear(tile, item);
offloading = false;

View File

@@ -86,7 +86,7 @@ public class CommandCenter extends Block{
for(UnitCommand cmd : UnitCommand.values()){
buttons.addImageButton("command-" + cmd.name(), "clear-toggle", 8*3, () -> Call.onCommandCenterSet(players[0], tile, cmd))
.size(38f).checked(entity.command == cmd).group(group);
.size(38f).group(group).update(b -> b.setChecked(entity.command == cmd));
}
table.add(buttons);
table.row();