Added a few new recipes, balanced smelter

This commit is contained in:
Anuken
2018-06-25 12:48:35 -04:00
parent c7ec7db61a
commit fa53b1be73
3 changed files with 22 additions and 15 deletions

View File

@@ -67,7 +67,11 @@ public class Recipes implements ContentList{
new Recipe(power, PowerBlocks.powernodelarge, new ItemStack(Items.carbide, 10), new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 6)); new Recipe(power, PowerBlocks.powernodelarge, new ItemStack(Items.carbide, 10), new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 6));
new Recipe(power, PowerBlocks.battery, new ItemStack(Items.tungsten, 8), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 4)); new Recipe(power, PowerBlocks.battery, new ItemStack(Items.tungsten, 8), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 4));
new Recipe(power, PowerBlocks.batteryLarge, new ItemStack(Items.carbide, 16), new ItemStack(Items.tungsten, 16), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 20)); new Recipe(power, PowerBlocks.batteryLarge, new ItemStack(Items.carbide, 16), new ItemStack(Items.tungsten, 16), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 20));
//generators
new Recipe(power, PowerBlocks.combustiongenerator, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 30)); new Recipe(power, PowerBlocks.combustiongenerator, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 30));
//new Recipe(power, PowerBlocks.turbinegenerator, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 30));
//new Recipe(distribution, StorageBlocks.vault, new ItemStack(Items.carbide, 50)); //new Recipe(distribution, StorageBlocks.vault, new ItemStack(Items.carbide, 50));
//new Recipe(distribution, StorageBlocks.core, new ItemStack(Items.carbide, 50)); //new Recipe(distribution, StorageBlocks.core, new ItemStack(Items.carbide, 50));
@@ -77,9 +81,11 @@ public class Recipes implements ContentList{
//DRILLS, PRODUCERS //DRILLS, PRODUCERS
new Recipe(production, ProductionBlocks.tungstenDrill, new ItemStack(Items.tungsten, 30)); new Recipe(production, ProductionBlocks.tungstenDrill, new ItemStack(Items.tungsten, 30));
new Recipe(production, ProductionBlocks.carbideDrill, new ItemStack(Items.tungsten, 40), new ItemStack(Items.carbide, 40)); new Recipe(production, ProductionBlocks.carbideDrill, new ItemStack(Items.tungsten, 40), new ItemStack(Items.carbide, 40));
new Recipe(production, ProductionBlocks.laserdrill, new ItemStack(Items.tungsten, 60), new ItemStack(Items.carbide, 70), new ItemStack(Items.silicon, 60), new ItemStack(Items.carbide, 60));
new Recipe(production, ProductionBlocks.waterextractor, new ItemStack(Items.tungsten, 50), new ItemStack(Items.carbide, 50), new ItemStack(Items.lead, 40)); new Recipe(production, ProductionBlocks.waterextractor, new ItemStack(Items.tungsten, 50), new ItemStack(Items.carbide, 50), new ItemStack(Items.lead, 40));
new Recipe(production, ProductionBlocks.cultivator, new ItemStack(Items.tungsten, 20), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 20)); new Recipe(production, ProductionBlocks.cultivator, new ItemStack(Items.tungsten, 20), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 20));
new Recipe(production, ProductionBlocks.oilextractor, new ItemStack(Items.tungsten, 90), new ItemStack(Items.carbide, 150), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 100));
//UNITS //UNITS
new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30)); new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30));

View File

@@ -19,17 +19,17 @@ public class CraftingBlocks extends BlockList implements ContentList {
public void load() { public void load() {
smelter = new Smelter("smelter") {{ smelter = new Smelter("smelter") {{
health = 70; health = 70;
inputs = new Item[]{Items.tungsten}; inputs = new ItemStack[]{new ItemStack(Items.tungsten, 3)};
fuel = Items.coal; fuel = Items.coal;
result = Items.carbide; result = Items.carbide;
craftTime = 35f; craftTime = 40f;
useFlux = true; useFlux = true;
}}; }};
arcsmelter = new PowerSmelter("arc-smelter") {{ arcsmelter = new PowerSmelter("arc-smelter") {{
health = 90; health = 90;
craftEffect = BlockFx.smeltsmoke; craftEffect = BlockFx.smeltsmoke;
inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.tungsten, 1)}; inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.tungsten, 2)};
result = Items.carbide; result = Items.carbide;
powerUse = 0.1f; powerUse = 0.1f;
craftTime = 25f; craftTime = 25f;

View File

@@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.fx.BlockFx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.BarType; import io.anuke.mindustry.world.BarType;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
@@ -22,7 +23,7 @@ public class Smelter extends Block{
protected final int timerDump = timers++; protected final int timerDump = timers++;
protected final int timerCraft = timers++; protected final int timerCraft = timers++;
protected Item[] inputs; protected ItemStack[] inputs;
protected Item fuel; protected Item fuel;
protected Item result; protected Item result;
@@ -45,8 +46,8 @@ public class Smelter extends Block{
@Override @Override
public void setBars(){ public void setBars(){
for(Item item : inputs){ for(ItemStack item : inputs){
bars.add(new BlockBar(BarType.inventory, true, tile -> (float)tile.entity.items.getItem(item)/itemCapacity)); bars.add(new BlockBar(BarType.inventory, true, tile -> (float)tile.entity.items.getItem(item.item)/itemCapacity));
} }
} }
@@ -67,9 +68,9 @@ public class Smelter extends Block{
public void init() { public void init() {
super.init(); super.init();
for(Item item : inputs){ for(ItemStack item : inputs){
if(item.fluxiness >= minFlux && useFlux){ if(item.item.fluxiness >= minFlux && useFlux){
throw new IllegalArgumentException("'" + name + "' has input item '" + item.name + "', which is a flux, when useFlux is enabled. To prevent ambiguous item use, either remove this flux item from the inputs, or set useFlux to false."); throw new IllegalArgumentException("'" + name + "' has input item '" + item.item.name + "', which is a flux, when useFlux is enabled. To prevent ambiguous item use, either remove this flux item from the inputs, or set useFlux to false.");
} }
} }
} }
@@ -98,8 +99,8 @@ public class Smelter extends Block{
} }
//make sure it has all the items //make sure it has all the items
for(Item item : inputs){ for(ItemStack item : inputs){
if(!entity.items.hasItem(item)){ if(!entity.items.hasItem(item.item, item.amount)){
return; return;
} }
} }
@@ -126,8 +127,8 @@ public class Smelter extends Block{
} }
if(consumeInputs) { if(consumeInputs) {
for (Item item : inputs) { for (ItemStack item : inputs) {
entity.items.removeItem(item, 1); entity.items.removeItem(item.item, item.amount);
} }
} }
@@ -144,8 +145,8 @@ public class Smelter extends Block{
public boolean acceptItem(Item item, Tile tile, Tile source){ public boolean acceptItem(Item item, Tile tile, Tile source){
boolean isInput = false; boolean isInput = false;
for(Item req : inputs){ for(ItemStack req : inputs){
if(req == item){ if(req.item == item){
isInput = true; isInput = true;
break; break;
} }