Added many new block types, changed land unit AI, bugfixes

This commit is contained in:
Anuken
2018-03-26 20:26:36 -04:00
parent f049706539
commit 707e57e72d
83 changed files with 1054 additions and 672 deletions

View File

@@ -53,17 +53,18 @@ public class Recipes {
new Recipe(weapon, WeaponBlocks.missileturret, stack(Items.steel, 70), stack(Items.titanium, 50), stack(Items.densealloy, 55)),
new Recipe(weapon, WeaponBlocks.fornaxcannon, stack(Items.steel, 70), stack(Items.titanium, 50), stack(Items.densealloy, 55)),
new Recipe(crafting, ProductionBlocks.smelter, stack(Items.iron, 40)),
new Recipe(crafting, ProductionBlocks.alloysmelter, stack(Items.titanium, 50), stack(Items.steel, 50)),
new Recipe(crafting, ProductionBlocks.coalextractor, stack(Items.steel, 10), stack(Items.iron, 10)),
new Recipe(crafting, ProductionBlocks.titaniumextractor, stack(Items.steel, 30), stack(Items.iron, 30)),
new Recipe(crafting, ProductionBlocks.oilrefinery, stack(Items.steel, 15), stack(Items.iron, 15)),
new Recipe(crafting, ProductionBlocks.stoneformer, stack(Items.steel, 10), stack(Items.iron, 10)),
new Recipe(crafting, ProductionBlocks.lavasmelter, stack(Items.steel, 30), stack(Items.titanium, 15)),
new Recipe(crafting, ProductionBlocks.siliconextractor, stack(Items.steel, 30), stack(Items.titanium, 15)),
new Recipe(crafting, ProductionBlocks.cryofluidmixer, stack(Items.steel, 30), stack(Items.titanium, 15)),
new Recipe(crafting, ProductionBlocks.weaponFactory, stack(Items.steel, 60), stack(Items.iron, 60)).setDesktop(),
//new Recipe(crafting, ProductionBlocks.centrifuge, stack(Item.steel, 30), stack(Item.iron, 30)),
new Recipe(crafting, CraftingBlocks.smelter, stack(Items.iron, 40)),
new Recipe(crafting, CraftingBlocks.alloysmelter, stack(Items.titanium, 50), stack(Items.steel, 50)),
new Recipe(crafting, CraftingBlocks.powersmelter, stack(Items.steel, 30), stack(Items.iron, 30)),
new Recipe(crafting, CraftingBlocks.extractor, stack(Items.steel, 10), stack(Items.iron, 10)),
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.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.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.cryofluidmixer, stack(Items.steel, 30), stack(Items.titanium, 15)),
new Recipe(crafting, CraftingBlocks.weaponFactory, stack(Items.steel, 60), stack(Items.iron, 60)).setDesktop(),
//new Recipe(production, ProductionBlocks.stonedrill, stack(Item.stone, 12)),
new Recipe(production, ProductionBlocks.irondrill, stack(Items.iron, 25)),
@@ -106,6 +107,9 @@ public class Recipes {
new Recipe(liquid, LiquidBlocks.fluxpump, stack(Items.steel, 10), stack(Items.densealloy, 5)),
new Recipe(units, UnitBlocks.flierFactory, stack(Items.steel, 10)),
new Recipe(units, UnitBlocks.walkerFactory, stack(Items.steel, 10)),
new Recipe(units, DebugBlocks.itemSource, stack(Items.steel, 10)).setDebug(),
new Recipe(units, DebugBlocks.powerVoid, stack(Items.steel, 10)).setDebug(),
new Recipe(units, DebugBlocks.powerInfinite, stack(Items.steel, 10), stack(Items.densealloy, 5)).setDebug()
);

View File

@@ -0,0 +1,150 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.resource.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.production.*;
public class CraftingBlocks {
public static final Block
smelter = new Smelter("smelter") {{
health = 70;
inputs = new Item[]{Items.iron};
fuel = Items.coal;
result = Items.steel;
craftTime = 25f;
}},
alloysmelter = new Smelter("alloysmelter") {{
health = 90;
inputs = new Item[]{Items.titanium, Items.steel};
fuel = Items.coal;
result = Items.densealloy;
burnDuration = 45f;
craftTime = 25f;
}},
powersmelter = new PowerSmelter("powersmelter") {{
health = 90;
inputs = new ItemStack[]{new ItemStack(Items.titanium, 4), new ItemStack(Items.thorium, 4)};
result = Items.densealloy;
burnDuration = 45f;
craftTime = 25f;
size = 2;
}},
cryofluidmixer = new LiquidMixer("cryofluidmixer") {{
health = 200;
inputLiquid = Liquids.water;
outputLiquid = Liquids.cryofluid;
inputItem = Items.titanium;
liquidPerItem = 50f;
itemCapacity = 50;
powerUse = 0.1f;
size = 2;
}},
//TODO implement melter
melter = new LiquidMixer("melter") {{
health = 200;
inputLiquid = Liquids.water;
outputLiquid = Liquids.cryofluid;
inputItem = Items.titanium;
liquidPerItem = 50f;
itemCapacity = 50;
powerUse = 0.1f;
size = 2;
}},
separator = new Filtrator("separator") {{
liquid = Liquids.water;
item = Items.stone;
results = new Item[]{
null, null, null, null, null,
Items.stone, Items.stone, Items.stone, Items.stone,
Items.iron, Items.iron, Items.iron,
Items.lead, Items.lead,
Items.coal, Items.coal,
Items.titanium
};
liquidUse = 0.1f;
filterTime = 40f;
health = 50;
}},
extractor = new GenericCrafter("extractor") {{
inputItem = new ItemStack(Items.stone, 6);
inputLiquid = Liquids.water;
liquidUse = 0.1f;
output = Items.coal;
health = 50;
craftTime = 50;
hasInventory = hasLiquids = true;
}},
centrifuge = new GenericCrafter("centrifuge") {{
inputItem = new ItemStack(Items.stone, 6);
inputLiquid = Liquids.water;
liquidUse = 0.1f;
output = Items.coal;
health = 50;
craftTime = 50;
hasInventory = hasLiquids = true;
size = 2;
}},
plasticFormer = new GenericCrafter("plasticformer") {{
inputLiquid = Liquids.oil;
liquidUse = 0.1f;
liquidCapacity = 60f;
powerUse = 0.05f;
craftTime = 70f;
output = Items.plastic;
size = 2;
health = 320;
hasPower = hasLiquids = true;
}},
biomassCompressor = new PowerCrafter("biomasscompressor") {{
input = new ItemStack(Items.biomatter, 1);
liquidCapacity = 60f;
powerUse = 0.05f;
craftTime = 10f;
outputLiquid = Liquids.oil;
outputLiquidAmount = 0.4f;
size = 2;
health = 320;
hasLiquids = true;
}},
oilRefinery = new GenericCrafter("oilrefinery") {{
inputLiquid = Liquids.oil;
liquidUse = 0.1f;
liquidCapacity = 56f;
output = Items.coal;
health = 80;
craftEffect = Fx.purifyoil;
hasInventory = hasLiquids = true;
}},
stoneFormer = new GenericCrafter("stoneformer") {{
inputLiquid = Liquids.lava;
liquidUse = 0.1f;
liquidCapacity = 21f;
craftTime = 12;
output = Items.stone;
health = 80;
craftEffect = Fx.purifystone;
}},
weaponFactory = new WeaponFactory("weaponfactory") {{
size = 2;
health = 250;
}};
}

View File

@@ -1,8 +1,10 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.types.PowerBlock;
import io.anuke.mindustry.world.blocks.types.distribution.Sorter;
import io.anuke.mindustry.world.blocks.types.power.PowerDistributor;
public class DebugBlocks {
@@ -24,5 +26,19 @@ public class DebugBlocks {
super.update(tile);
tile.entity.power.amount = powerCapacity;
}
},
itemSource = new Sorter("itemsource"){
@Override
public void update(Tile tile) {
SorterEntity entity = tile.entity();
entity.inventory.items[entity.sortItem.id] = 1;
tryDump(tile, entity.sortItem);
}
@Override
public boolean acceptItem(Item item, Tile tile, Tile source){
return false;
}
};
}

View File

@@ -2,118 +2,14 @@ package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.production.*;
import io.anuke.mindustry.world.blocks.types.production.Drill;
import io.anuke.mindustry.world.blocks.types.production.GenericDrill;
import io.anuke.mindustry.world.blocks.types.production.SolidPump;
public class ProductionBlocks {
public static final Block
smelter = new Smelter("smelter") {{
health = 70;
inputs = new Item[]{Items.iron};
fuel = Items.coal;
result = Items.steel;
craftTime = 25f;
}},
alloysmelter = new Smelter("alloysmelter") {{
health = 90;
inputs = new Item[]{Items.titanium, Items.steel};
fuel = Items.coal;
result = Items.densealloy;
burnDuration = 45f;
craftTime = 25f;
}},
powersmelter = new PowerSmelter("powersmelter") {{
/*
health = 90;
inputs = new Item[]{Item.titanium, Item.steel};
fuel = Item.coal;
results = Item.dirium;
burnDuration = 45f;
craftTime = 25f;
size = 2;*/
}},
cryofluidmixer = new LiquidMixer("cryofluidmixer") {{
health = 200;
inputLiquid = Liquids.water;
outputLiquid = Liquids.cryofluid;
inputItem = Items.titanium;
liquidPerItem = 50f;
itemCapacity = 50;
powerUse = 0.1f;
size = 2;
}},
coalextractor = new LiquidCrafter("coalextractor") {{
input = Items.stone;
inputAmount = 6;
inputLiquid = Liquids.water;
liquidAmount = 19f;
output = Items.coal;
health = 50;
purifyTime = 50;
health = 60;
}},
titaniumextractor = new LiquidCrafter("titaniumextractor") {{
input = Items.stone;
inputAmount = 8;
inputLiquid = Liquids.water;
liquidAmount = 40f;
liquidCapacity = 41f;
purifyTime = 60;
output = Items.titanium;
health = 70;
}},
oilrefinery = new LiquidCrafter("oilrefinery") {{
inputLiquid = Liquids.oil;
liquidAmount = 55f;
liquidCapacity = 56f;
purifyTime = 65;
output = Items.coal;
health = 80;
craftEffect = Fx.purifyoil;
}},
stoneformer = new LiquidCrafter("stoneformer") {{
input = null;
inputLiquid = Liquids.lava;
liquidAmount = 16f;
liquidCapacity = 21f;
purifyTime = 12;
output = Items.stone;
health = 80;
craftEffect = Fx.purifystone;
}},
lavasmelter = new LiquidCrafter("lavasmelter") {{
input = Items.iron;
inputAmount = 1;
inputLiquid = Liquids.lava;
liquidAmount = 40f;
liquidCapacity = 41f;
purifyTime = 30;
output = Items.steel;
health = 80;
craftEffect = Fx.purifystone;
}},
siliconextractor = new LiquidCrafter("siliconextractor") {{
input = Items.stone;
inputAmount = 5;
inputLiquid = Liquids.water;
liquidAmount = 18.99f;
output = Items.silicon;
health = 50;
purifyTime = 50;
}},
stonedrill = new Drill("stonedrill") {{
resource = Blocks.stone;
result = Items.stone;
@@ -206,10 +102,5 @@ public class ProductionBlocks {
size = 2;
hasLiquids = true;
hasPower = true;
}},
weaponFactory = new WeaponFactory("weaponfactory") {{
size = 2;
health = 250;
}};
}

View File

@@ -16,5 +16,14 @@ public class UnitBlocks {
requirements = new ItemStack[]{
new ItemStack(Items.stone, 5)
};
}},
walkerFactory = new UnitFactory("walkerfactory"){{
type = UnitTypes.scout;
produceTime = 20;
size = 2;
requirements = new ItemStack[]{
new ItemStack(Items.stone, 1)
};
}};
}