Added massive amount of partially-unfinished content to recipe menu

This commit is contained in:
Anuken
2018-06-30 20:59:05 -04:00
parent cb6090c773
commit cc5910f997
92 changed files with 1015 additions and 785 deletions

View File

@@ -36,7 +36,7 @@ public class AmmoTypes implements ContentList {
smokeEffect = Fx.none;
}};
bombIncendiary = new AmmoType(Items.thermite, WeaponBullets.bombIncendiary, 3) {{
bombIncendiary = new AmmoType(Items.pyratite, WeaponBullets.bombIncendiary, 3) {{
shootEffect = Fx.none;
smokeEffect = Fx.none;
}};
@@ -46,7 +46,7 @@ public class AmmoTypes implements ContentList {
smokeEffect = Fx.none;
}};
flamerThermite = new AmmoType(Items.thermite, TurretBullets.basicFlame, 3) {{
flamerThermite = new AmmoType(Items.pyratite, TurretBullets.basicFlame, 3) {{
shootEffect = ShootFx.shootSmallFlame;
}};
@@ -82,7 +82,7 @@ public class AmmoTypes implements ContentList {
reloadMultiplier = 1.4f;
}};
bulletThermite = new AmmoType(Items.thermite, StandardBullets.tracer, 3) {{
bulletThermite = new AmmoType(Items.pyratite, StandardBullets.tracer, 3) {{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
inaccuracy = 3f;
@@ -100,7 +100,7 @@ public class AmmoTypes implements ContentList {
smokeEffect = ShootFx.shootSmallSmoke;
}};
flakPlastic = new AmmoType(Items.plasteel, FlakBullets.plastic, 5) {{
flakPlastic = new AmmoType(Items.plastanium, FlakBullets.plastic, 5) {{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}};
@@ -117,7 +117,7 @@ public class AmmoTypes implements ContentList {
smokeEffect = ShootFx.shootBigSmoke2;
}};
missileIncindiary = new AmmoType(Items.thermite, MissileBullets.incindiary, 1) {{
missileIncindiary = new AmmoType(Items.pyratite, MissileBullets.incindiary, 1) {{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}};
@@ -139,7 +139,7 @@ public class AmmoTypes implements ContentList {
smokeEffect = ShootFx.shootBigSmoke2;
}};
artilleryPlastic = new AmmoType(Items.plasteel, ArtilleryBullets.plastic, 1) {{
artilleryPlastic = new AmmoType(Items.plastanium, ArtilleryBullets.plastic, 1) {{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}};
@@ -149,7 +149,7 @@ public class AmmoTypes implements ContentList {
smokeEffect = ShootFx.shootBigSmoke2;
}};
artilleryIncindiary = new AmmoType(Items.thermite, ArtilleryBullets.incindiary, 1) {{
artilleryIncindiary = new AmmoType(Items.pyratite, ArtilleryBullets.incindiary, 1) {{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}};

View File

@@ -8,8 +8,8 @@ import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemType;
public class Items implements ContentList{
public static Item stone, tungsten, lead, coal, carbide, titanium, thorium, silicon, plasteel, phasematter, surgealloy,
biomatter, sand, blastCompound, thermite;
public static Item stone, tungsten, lead, coal, carbide, titanium, thorium, silicon, plastanium, phasematter, surgealloy,
biomatter, sand, blastCompound, pyratite;
@Override
public void load() {
@@ -54,7 +54,7 @@ public class Items implements ContentList{
type = ItemType.material;
}};
plasteel = new Item("plasteel", Color.valueOf("e9ead3")) {{
plastanium = new Item("plastanium", Color.valueOf("e9ead3")) {{
type = ItemType.material;
flammability = 0.1f;
explosiveness = 0.1f;
@@ -82,7 +82,7 @@ public class Items implements ContentList{
explosiveness = 0.6f;
}};
thermite = new Item("thermite", Color.valueOf("ff795e")) {{
pyratite = new Item("pyratite", Color.valueOf("ff795e")) {{
flammability = 0.7f;
explosiveness = 0.2f;
}};

View File

@@ -12,7 +12,12 @@ public class Liquids implements ContentList {
@Override
public void load() {
none = new Liquid("none", Color.CLEAR);
none = new Liquid("none", Color.CLEAR){
@Override
public boolean isHidden(){
return true;
}
};
water = new Liquid("water", Color.valueOf("486acd")) {
{

View File

@@ -31,25 +31,27 @@ public class Recipes implements ContentList{
new Recipe(weapon, TurretBlocks.scorch, new ItemStack(Items.tungsten, 50), new ItemStack(Items.carbide, 20));
new Recipe(weapon, TurretBlocks.hail, new ItemStack(Items.tungsten, 60), new ItemStack(Items.carbide, 35));
new Recipe(weapon, TurretBlocks.lancer, new ItemStack(Items.tungsten, 25), new ItemStack(Items.lead, 25), new ItemStack(Items.silicon, 25));
//TODO arc turret broken
//new Recipe(weapon, TurretBlocks.arc, new ItemStack(Items.tungsten, 25), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 30));
new Recipe(weapon, TurretBlocks.lancer, new ItemStack(Items.tungsten, 50), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 90));
new Recipe(weapon, TurretBlocks.wave, new ItemStack(Items.carbide, 60), new ItemStack(Items.titanium, 70), new ItemStack(Items.lead, 150));
new Recipe(weapon, TurretBlocks.swarmer, new ItemStack(Items.carbide, 70), new ItemStack(Items.titanium, 70), new ItemStack(Items.plastanium, 90), new ItemStack(Items.silicon, 60), new ItemStack(Items.phasematter, 60));
new Recipe(weapon, TurretBlocks.salvo, new ItemStack(Items.tungsten, 160), new ItemStack(Items.carbide, 190), new ItemStack(Items.thorium, 130));
new Recipe(weapon, TurretBlocks.ripple, new ItemStack(Items.tungsten, 170), new ItemStack(Items.carbide, 220), new ItemStack(Items.thorium, 120));
//DISTRIBUTION
new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.lead, 1));
new Recipe(distribution, DistributionBlocks.titaniumconveyor, new ItemStack(Items.lead, 2), new ItemStack(Items.titanium, 1));
new Recipe(distribution, DistributionBlocks.phaseConveyor, new ItemStack(Items.phasematter, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.carbide, 20));
//starter tungsten transporation
//starter lead transporation
new Recipe(distribution, DistributionBlocks.junction, new ItemStack(Items.lead, 2));
new Recipe(distribution, DistributionBlocks.splitter, new ItemStack(Items.lead, 2));
new Recipe(distribution, DistributionBlocks.router, new ItemStack(Items.lead, 6));
//advanced carbide transporation
new Recipe(distribution, DistributionBlocks.router, new ItemStack(Items.carbide, 2), new ItemStack(Items.tungsten, 2));
new Recipe(distribution, DistributionBlocks.splitter, new ItemStack(Items.carbide, 2), new ItemStack(Items.tungsten, 2));
new Recipe(distribution, DistributionBlocks.multiplexer, new ItemStack(Items.carbide, 8), new ItemStack(Items.tungsten, 8));
new Recipe(distribution, DistributionBlocks.sorter, new ItemStack(Items.carbide, 4), new ItemStack(Items.tungsten, 4));
new Recipe(distribution, DistributionBlocks.overflowgate, new ItemStack(Items.carbide, 4), new ItemStack(Items.tungsten, 8));
new Recipe(distribution, DistributionBlocks.bridgeconveyor, new ItemStack(Items.carbide, 8), new ItemStack(Items.tungsten, 8));
new Recipe(distribution, DistributionBlocks.overflowGate, new ItemStack(Items.carbide, 4), new ItemStack(Items.tungsten, 8));
new Recipe(distribution, DistributionBlocks.bridgeConveyor, new ItemStack(Items.carbide, 8), new ItemStack(Items.tungsten, 8));
//CRAFTING
@@ -58,20 +60,22 @@ public class Recipes implements ContentList{
new Recipe(crafting, CraftingBlocks.arcsmelter, new ItemStack(Items.tungsten, 90), new ItemStack(Items.carbide, 60), new ItemStack(Items.lead, 50));
new Recipe(crafting, CraftingBlocks.siliconsmelter, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 50));
//other crafting
new Recipe(crafting, CraftingBlocks.phaseweaver, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 240), new ItemStack(Items.thorium, 150));
//TODO implement alloy smelter
// new Recipe(crafting, CraftingBlocks.alloySmelter, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 160), new ItemStack(Items.thorium, 140));
//advanced fabrication
new Recipe(crafting, CraftingBlocks.plastaniumCompressor, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 230), new ItemStack(Items.carbide, 120), new ItemStack(Items.titanium, 160));
new Recipe(crafting, CraftingBlocks.phaseWeaver, new ItemStack(Items.silicon, 260), new ItemStack(Items.lead, 240), new ItemStack(Items.thorium, 150));
// new Recipe(crafting, CraftingBlocks.plasteelcompressor, new ItemStack(Items.silicon, 60), new ItemStack(Items.lead, 170), new ItemStack(Items.titanium, 170));
//TODO implement alloy smelter
//new Recipe(crafting, CraftingBlocks.alloySmelter, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 160), new ItemStack(Items.thorium, 140));
//misc
new Recipe(crafting, CraftingBlocks.pulverizer, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 50));
//new Recipe(crafting, CraftingBlocks.thermiteMixer, new ItemStack(Items.tungsten, 100), new ItemStack(Items.lead, 50));
//new Recipe(crafting, CraftingBlocks.blastMixer, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 60), new ItemStack(Items.carbide, 40));
new Recipe(crafting, CraftingBlocks.cryofluidmixer, new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 90));
new Recipe(crafting, CraftingBlocks.pyratiteMixer, new ItemStack(Items.tungsten, 100), new ItemStack(Items.lead, 50));
new Recipe(crafting, CraftingBlocks.blastMixer, new ItemStack(Items.lead, 60), new ItemStack(Items.carbide, 40));
new Recipe(crafting, CraftingBlocks.cryofluidmixer, new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 80), new ItemStack(Items.thorium, 90));
new Recipe(crafting, CraftingBlocks.solidifier, new ItemStack(Items.carbide, 30), new ItemStack(Items.tungsten, 20));
new Recipe(crafting, CraftingBlocks.melter, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 70), new ItemStack(Items.carbide, 90));
new Recipe(crafting, CraftingBlocks.incinerator, new ItemStack(Items.carbide, 10), new ItemStack(Items.lead, 30));
//processing
@@ -80,20 +84,28 @@ public class Recipes implements ContentList{
new Recipe(crafting, CraftingBlocks.centrifuge, new ItemStack(Items.tungsten, 130), new ItemStack(Items.carbide, 130), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 50));
//POWER
new Recipe(power, PowerBlocks.powernode, new ItemStack(Items.tungsten, 2), new ItemStack(Items.lead, 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.batteryLarge, new ItemStack(Items.carbide, 40), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 30));
new Recipe(power, PowerBlocks.powerNode, new ItemStack(Items.tungsten, 2), new ItemStack(Items.lead, 6))
.setDependencies(PowerBlocks.combustionGenerator);
new Recipe(power, PowerBlocks.powerNodeLarge, new ItemStack(Items.carbide, 10), new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 6))
.setDependencies(PowerBlocks.powerNode);
new Recipe(power, PowerBlocks.battery, new ItemStack(Items.tungsten, 8), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 4))
.setDependencies(PowerBlocks.powerNode);
new Recipe(power, PowerBlocks.batteryLarge, new ItemStack(Items.carbide, 40), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 30))
.setDependencies(PowerBlocks.powerNode);
//generators
new Recipe(power, PowerBlocks.combustiongenerator, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 30));
new Recipe(power, PowerBlocks.turbinegenerator, new ItemStack(Items.tungsten, 70), new ItemStack(Items.carbide, 50), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 60));
//generators - combustion
new Recipe(power, PowerBlocks.combustionGenerator, new ItemStack(Items.tungsten, 50), new ItemStack(Items.lead, 30));
new Recipe(power, PowerBlocks.turbineGenerator, new ItemStack(Items.tungsten, 70), new ItemStack(Items.carbide, 50), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 60));
//generators - solar
new Recipe(power, PowerBlocks.solarPanel, new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 30));
new Recipe(power, PowerBlocks.largeSolarPanel, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 290), new ItemStack(Items.phasematter, 30));
//new Recipe(distribution, StorageBlocks.core, new ItemStack(Items.carbide, 50));
new Recipe(distribution, StorageBlocks.unloader, new ItemStack(Items.carbide, 40), new ItemStack(Items.silicon, 50));
new Recipe(distribution, StorageBlocks.sortedunloader, new ItemStack(Items.carbide, 40), new ItemStack(Items.silicon, 70));
new Recipe(distribution, StorageBlocks.vault, new ItemStack(Items.carbide, 300), new ItemStack(Items.thorium, 250));
new Recipe(distribution, StorageBlocks.vault, new ItemStack(Items.carbide, 500), new ItemStack(Items.thorium, 350));
//DRILLS, PRODUCERS
new Recipe(production, ProductionBlocks.tungstenDrill, new ItemStack(Items.tungsten, 30));
@@ -102,7 +114,7 @@ public class Recipes implements ContentList{
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.oilextractor, new ItemStack(Items.tungsten, 90), new ItemStack(Items.carbide, 150), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 100));
new Recipe(production, ProductionBlocks.oilextractor, new ItemStack(Items.tungsten, 300), new ItemStack(Items.carbide, 350), new ItemStack(Items.lead, 230), new ItemStack(Items.thorium, 230), new ItemStack(Items.silicon, 150));
//UNITS
@@ -111,27 +123,35 @@ public class Recipes implements ContentList{
new Recipe(units, UpgradeBlocks.dartFactory, new ItemStack(Items.lead, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240))
.setDesktop(); //dart is desktop only, because it's the starter mobile ship
new Recipe(units, UpgradeBlocks.deltaFactory, new ItemStack(Items.carbide, 160), new ItemStack(Items.silicon, 220), new ItemStack(Items.titanium, 250)).setDesktop();
new Recipe(units, UpgradeBlocks.tridentFactory, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200));
new Recipe(units, UpgradeBlocks.deltaFactory, new ItemStack(Items.carbide, 160), new ItemStack(Items.silicon, 220), new ItemStack(Items.titanium, 250))
.setDesktop();
//new Recipe(units, UpgradeBlocks.deltaFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30));
//actual unit related stuff
new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.tungsten, 50), new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 130));
new Recipe(units, UnitBlocks.fabricatorFactory, new ItemStack(Items.carbide, 70), new ItemStack(Items.thorium, 100), new ItemStack(Items.lead, 150), new ItemStack(Items.silicon, 300));
new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 30));
new Recipe(units, UnitBlocks.resupplyPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 30));
//LIQUIDS
new Recipe(liquid, LiquidBlocks.conduit, new ItemStack(Items.lead, 1));
new Recipe(liquid, LiquidBlocks.conduit, new ItemStack(Items.lead, 1))
.setDependencies(CraftingBlocks.smelter);
new Recipe(liquid, LiquidBlocks.pulseConduit, new ItemStack(Items.titanium, 1), new ItemStack(Items.lead, 1));
new Recipe(liquid, LiquidBlocks.phaseConduit, new ItemStack(Items.phasematter, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.titanium, 20));
new Recipe(liquid, LiquidBlocks.pulseconduit, new ItemStack(Items.titanium, 1), new ItemStack(Items.lead, 1));
new Recipe(liquid, LiquidBlocks.liquidrouter, new ItemStack(Items.carbide, 4), new ItemStack(Items.lead, 4));
new Recipe(liquid, LiquidBlocks.liquidRouter, new ItemStack(Items.carbide, 4), new ItemStack(Items.lead, 4));
new Recipe(liquid, LiquidBlocks.liquidtank, new ItemStack(Items.titanium, 50), new ItemStack(Items.lead, 50), new ItemStack(Items.carbide, 20));
new Recipe(liquid, LiquidBlocks.liquidjunction, new ItemStack(Items.carbide, 4), new ItemStack(Items.lead, 4));
new Recipe(liquid, LiquidBlocks.bridgeconduit, new ItemStack(Items.carbide, 8), new ItemStack(Items.lead, 8));
//new Recipe(liquid, LiquidBlocks.laserconduit, new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 2), new ItemStack(Items.phasematter, 10));
new Recipe(liquid, LiquidBlocks.liquidJunction, new ItemStack(Items.carbide, 4), new ItemStack(Items.lead, 4));
new Recipe(liquid, LiquidBlocks.bridgeConduit, new ItemStack(Items.carbide, 8), new ItemStack(Items.lead, 8));
new Recipe(liquid, LiquidBlocks.mechanicalPump, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 20));
new Recipe(liquid, LiquidBlocks.mechanicalPump, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 20))
.setDependencies(CraftingBlocks.smelter);
new Recipe(liquid, LiquidBlocks.rotaryPump, new ItemStack(Items.tungsten, 140), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 40), new ItemStack(Items.titanium, 70));
//DEBUG
new Recipe(units, DebugBlocks.itemSource, new ItemStack(Items.carbide, 10)).setDebug();
@@ -139,12 +159,9 @@ public class Recipes implements ContentList{
new Recipe(units, DebugBlocks.liquidSource, new ItemStack(Items.carbide, 10)).setDebug();
new Recipe(units, DebugBlocks.powerVoid, new ItemStack(Items.carbide, 10)).setDebug();
new Recipe(units, DebugBlocks.powerInfinite, new ItemStack(Items.carbide, 10), new ItemStack(Items.surgealloy, 5)).setDebug();
//new Recipe(liquid, LiquidBlocks.rotaryPump, new ItemStack(Items.carbide, 10), new ItemStack(Items.surgealloy, 5));
//new Recipe(liquid, LiquidBlocks.thermalPump, new ItemStack(Items.carbide, 10), new ItemStack(Items.surgealloy, 5));
/*
new Recipe(production, ProductionBlocks.laserdrill, new ItemStack(Items.titanium, 40), new ItemStack(Items.surgealloy, 40));
new Recipe(production, ProductionBlocks.nucleardrill, new ItemStack(Items.titanium, 40), new ItemStack(Items.surgealloy, 40));
new Recipe(production, ProductionBlocks.plasmadrill, new ItemStack(Items.titanium, 40), new ItemStack(Items.surgealloy, 40));
new Recipe(production, ProductionBlocks.cultivator, new ItemStack(Items.titanium, 40), new ItemStack(Items.surgealloy, 40));
@@ -153,8 +170,7 @@ public class Recipes implements ContentList{
//new Recipe(distribution, DistributionBlocks.laserconveyor, new ItemStack(Items.carbide, 5));
//new Recipe(distribution, DistributionBlocks.massdriver, new ItemStack(Items.carbide, 1));
//new Recipe(distribution, DistributionBlocks.massDriver, new ItemStack(Items.carbide, 1));
/*
@@ -186,13 +202,13 @@ public class Recipes implements ContentList{
new Recipe(crafting, CraftingBlocks.alloysmelter, new ItemStack(Items.titanium, 50), new ItemStack(Items.carbide, 50));
new Recipe(crafting, CraftingBlocks.alloyfuser, new ItemStack(Items.carbide, 30), new ItemStack(Items.tungsten, 30));
new Recipe(crafting, CraftingBlocks.phaseweaver, new ItemStack(Items.carbide, 30), new ItemStack(Items.tungsten, 30));
new Recipe(crafting, CraftingBlocks.phaseWeaver, new ItemStack(Items.carbide, 30), new ItemStack(Items.tungsten, 30));
new Recipe(crafting, CraftingBlocks.separator, new ItemStack(Items.carbide, 30), new ItemStack(Items.tungsten, 30));
new Recipe(crafting, CraftingBlocks.centrifuge, new ItemStack(Items.carbide, 30), new ItemStack(Items.tungsten, 30));
new Recipe(crafting, CraftingBlocks.siliconsmelter, new ItemStack(Items.carbide, 30), new ItemStack(Items.tungsten, 30));
new Recipe(crafting, CraftingBlocks.oilRefinery, new ItemStack(Items.carbide, 15), new ItemStack(Items.tungsten, 15));
new Recipe(crafting, CraftingBlocks.biomatterCompressor, new ItemStack(Items.carbide, 15), new ItemStack(Items.tungsten, 15));
new Recipe(crafting, CraftingBlocks.plasteelcompressor, new ItemStack(Items.carbide, 30), new ItemStack(Items.titanium, 15));
new Recipe(crafting, CraftingBlocks.plastaniumCompressor, new ItemStack(Items.carbide, 30), new ItemStack(Items.titanium, 15));
new Recipe(crafting, CraftingBlocks.cryofluidmixer, new ItemStack(Items.carbide, 30), new ItemStack(Items.titanium, 15));
new Recipe(crafting, CraftingBlocks.pulverizer, new ItemStack(Items.carbide, 10), new ItemStack(Items.tungsten, 10));
new Recipe(crafting, CraftingBlocks.stoneFormer, new ItemStack(Items.carbide, 10), new ItemStack(Items.tungsten, 10));
@@ -210,29 +226,29 @@ public class Recipes implements ContentList{
new Recipe(production, ProductionBlocks.waterextractor, new ItemStack(Items.titanium, 40), new ItemStack(Items.surgealloy, 40));
new Recipe(production, ProductionBlocks.oilextractor, new ItemStack(Items.titanium, 40), new ItemStack(Items.surgealloy, 40));
new Recipe(power, PowerBlocks.powernode, new ItemStack(Items.carbide, 3), new ItemStack(Items.tungsten, 3));
new Recipe(power, PowerBlocks.powernodelarge, new ItemStack(Items.carbide, 3), new ItemStack(Items.tungsten, 3));
new Recipe(power, PowerBlocks.powerNode, new ItemStack(Items.carbide, 3), new ItemStack(Items.tungsten, 3));
new Recipe(power, PowerBlocks.powerNodeLarge, new ItemStack(Items.carbide, 3), new ItemStack(Items.tungsten, 3));
new Recipe(power, PowerBlocks.battery, new ItemStack(Items.carbide, 5), new ItemStack(Items.tungsten, 5));
new Recipe(power, PowerBlocks.batteryLarge, new ItemStack(Items.carbide, 5), new ItemStack(Items.tungsten, 5));
new Recipe(power, PowerBlocks.combustiongenerator, new ItemStack(Items.tungsten, 1));
new Recipe(power, PowerBlocks.combustionGenerator, new ItemStack(Items.tungsten, 1));
new Recipe(power, PowerBlocks.turbinegenerator, new ItemStack(Items.tungsten, 1));
new Recipe(power, PowerBlocks.thermalgenerator, new ItemStack(Items.carbide, 1));
new Recipe(power, PowerBlocks.rtgenerator, new ItemStack(Items.titanium, 1), new ItemStack(Items.carbide, 1));
new Recipe(power, PowerBlocks.solarpanel, new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 20));
new Recipe(power, PowerBlocks.largesolarpanel, new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 20));
new Recipe(power, PowerBlocks.turbineGenerator, new ItemStack(Items.tungsten, 1));
new Recipe(power, PowerBlocks.thermalGenerator, new ItemStack(Items.carbide, 1));
new Recipe(power, PowerBlocks.rtgGenerator, new ItemStack(Items.titanium, 1), new ItemStack(Items.carbide, 1));
new Recipe(power, PowerBlocks.solarPanel, new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 20));
new Recipe(power, PowerBlocks.largeSolarPanel, new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 20));
new Recipe(power, PowerBlocks.nuclearReactor, new ItemStack(Items.titanium, 40), new ItemStack(Items.surgealloy, 40), new ItemStack(Items.carbide, 50));
new Recipe(power, PowerBlocks.fusionReactor, new ItemStack(Items.titanium, 40), new ItemStack(Items.surgealloy, 40), new ItemStack(Items.carbide, 50));
new Recipe(distribution, PowerBlocks.warpgate, new ItemStack(Items.carbide, 1));
new Recipe(distribution, PowerBlocks.warpGate, new ItemStack(Items.carbide, 1));
new Recipe(liquid, LiquidBlocks.conduit, new ItemStack(Items.carbide, 1));
new Recipe(liquid, LiquidBlocks.pulseconduit, new ItemStack(Items.titanium, 1), new ItemStack(Items.carbide, 1));
new Recipe(liquid, LiquidBlocks.liquidrouter, new ItemStack(Items.carbide, 2));
new Recipe(liquid, LiquidBlocks.pulseConduit, new ItemStack(Items.titanium, 1), new ItemStack(Items.carbide, 1));
new Recipe(liquid, LiquidBlocks.liquidRouter, new ItemStack(Items.carbide, 2));
new Recipe(liquid, LiquidBlocks.liquidtank, new ItemStack(Items.carbide, 2));
new Recipe(liquid, LiquidBlocks.liquidjunction, new ItemStack(Items.carbide, 2));
new Recipe(liquid, LiquidBlocks.bridgeconduit, new ItemStack(Items.titanium, 2), new ItemStack(Items.carbide, 2));
new Recipe(liquid, LiquidBlocks.laserconduit, new ItemStack(Items.titanium, 2), new ItemStack(Items.carbide, 2));
new Recipe(liquid, LiquidBlocks.liquidJunction, new ItemStack(Items.carbide, 2));
new Recipe(liquid, LiquidBlocks.bridgeConduit, new ItemStack(Items.titanium, 2), new ItemStack(Items.carbide, 2));
new Recipe(liquid, LiquidBlocks.phaseConduit, new ItemStack(Items.titanium, 2), new ItemStack(Items.carbide, 2));
new Recipe(liquid, LiquidBlocks.mechanicalPump, new ItemStack(Items.carbide, 10));
new Recipe(liquid, LiquidBlocks.rotaryPump, new ItemStack(Items.carbide, 10), new ItemStack(Items.surgealloy, 5));

View File

@@ -7,7 +7,7 @@ import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
public class UnitTypes implements ContentList {
public static UnitType drone, scout, vtol, monsoon, titan;
public static UnitType drone, scout, vtol, monsoon, titan, fabricator;
@Override
public void load() {
@@ -44,7 +44,6 @@ public class UnitTypes implements ContentList {
maxVelocity = 2.1f;
drag = 0.01f;
isFlying = true;
reload = 7;
}};
monsoon = new UnitType("monsoon", Monsoon.class, Monsoon::new){{
@@ -53,9 +52,23 @@ public class UnitTypes implements ContentList {
maxVelocity = 1.5f;
drag = 0.01f;
isFlying = true;
reload = 7;
weapon = Weapons.bomber;
}};
fabricator = new UnitType("fabricator", Fabricator.class, Fabricator::new){{
isFlying = true;
drag = 0.01f;
speed = 0.2f;
maxVelocity = 0.6f;
ammoCapacity = 0;
range = 70f;
itemCapacity = 70;
health = 120;
health = 45;
buildPower = 0.9f;
minePower = 1.1f;
healSpeed = 0.3f;
}};
}
@Override

View File

@@ -11,9 +11,9 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.production.*;
public class CraftingBlocks extends BlockList implements ContentList {
public static Block smelter, arcsmelter, siliconsmelter, plasteelcompressor, phaseweaver, alloysmelter, alloyfuser,
thermiteMixer, blastMixer,
cryofluidmixer, melter, separator, centrifuge, biomatterCompressor, pulverizer, oilRefinery, stoneFormer, incinerator;
public static Block smelter, arcsmelter, siliconsmelter, plastaniumCompressor, phaseWeaver, alloysmelter, alloyfuser,
pyratiteMixer, blastMixer,
cryofluidmixer, melter, separator, centrifuge, biomatterCompressor, pulverizer, oilRefinery, solidifier, incinerator;
@Override
public void load() {
@@ -52,14 +52,14 @@ public class CraftingBlocks extends BlockList implements ContentList {
flameColor = Color.valueOf("ffef99");
}};
plasteelcompressor = new PlasteelCompressor("plasteel-compressor") {{
plastaniumCompressor = new PlasteelCompressor("plastanium-compressor") {{
inputLiquid = Liquids.oil;
inputItem = new ItemStack(Items.carbide, 1);
liquidUse = 0.3f;
liquidCapacity = 60f;
powerUse = 0.5f;
craftTime = 80f;
output = Items.plasteel;
output = Items.plastanium;
itemCapacity = 30;
size = 2;
health = 320;
@@ -68,7 +68,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
updateEffect = BlockFx.plasticburn;
}};
phaseweaver = new PhaseWeaver("phase-weaver") {{
phaseWeaver = new PhaseWeaver("phase-weaver") {{
health = 90;
craftEffect = BlockFx.smeltsmoke;
inputs = new ItemStack[]{new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)};
@@ -81,7 +81,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
alloysmelter = new PowerSmelter("alloy-smelter") {{
health = 90;
craftEffect = BlockFx.smeltsmoke;
inputs = new ItemStack[]{new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.plasteel, 2)};
inputs = new ItemStack[]{new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.plastanium, 2)};
result = Items.surgealloy;
powerUse = 0.3f;
craftTime = 50f;
@@ -94,7 +94,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
alloyfuser = new PowerSmelter("alloy-fuser") {{
health = 90;
craftEffect = BlockFx.smeltsmoke;
inputs = new ItemStack[]{new ItemStack(Items.titanium, 3), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.plasteel, 2)};
inputs = new ItemStack[]{new ItemStack(Items.titanium, 3), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.plastanium, 2)};
result = Items.surgealloy;
powerUse = 0.4f;
craftTime = 30f;
@@ -121,19 +121,19 @@ public class CraftingBlocks extends BlockList implements ContentList {
hasPower = true;
inputLiquid = Liquids.oil;
liquidUse = 0.05f;
inputItem = new ItemStack(Items.thermite, 1);
inputItem = new ItemStack(Items.pyratite, 1);
output = Items.blastCompound;
powerUse = 0.04f;
size = 2;
}};
thermiteMixer = new PowerSmelter("thermite-mixer") {{
pyratiteMixer = new PowerSmelter("pyratite-mixer") {{
itemCapacity = 20;
hasItems = true;
hasPower = true;
inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2)};
result = Items.thermite;
result = Items.pyratite;
powerUse = 0.02f;
size = 2;
@@ -231,7 +231,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
hasItems = hasLiquids = hasPower = true;
}};
stoneFormer = new GenericCrafter("stoneformer") {{
solidifier = new GenericCrafter("solidifer") {{
inputLiquid = Liquids.lava;
liquidUse = 1f;
liquidCapacity = 21f;

View File

@@ -6,7 +6,7 @@ import io.anuke.mindustry.world.blocks.distribution.*;
public class DistributionBlocks extends BlockList implements ContentList{
public static Block conveyor, titaniumconveyor, router, multiplexer, junction,
bridgeconveyor, laserconveyor, sorter, splitter, overflowgate, massdriver;
bridgeConveyor, phaseConveyor, sorter, splitter, overflowGate, massDriver;
@Override
public void load() {
@@ -33,12 +33,12 @@ public class DistributionBlocks extends BlockList implements ContentList{
capacity = 32;
}};
bridgeconveyor = new BufferedItemBridge("bridgeconveyor") {{
bridgeConveyor = new BufferedItemBridge("bridge-conveyor") {{
range = 3;
hasPower = false;
}};
laserconveyor = new ItemBridge("laserconveyor") {{
phaseConveyor = new ItemBridge("phase-conveyor") {{
range = 7;
}};
@@ -46,9 +46,9 @@ public class DistributionBlocks extends BlockList implements ContentList{
splitter = new Splitter("splitter");
overflowgate = new OverflowGate("overflowgate");
overflowGate = new OverflowGate("overflow-gate");
massdriver = new MassDriver("mass-driver"){{
massDriver = new MassDriver("mass-driver"){{
size = 3;
itemCapacity = 80;
range = 300f;

View File

@@ -6,18 +6,20 @@ import io.anuke.mindustry.world.blocks.distribution.*;
import io.anuke.mindustry.world.blocks.production.Pump;
public class LiquidBlocks extends BlockList implements ContentList{
public static Block mechanicalPump, rotaryPump, thermalPump, conduit, pulseconduit, liquidrouter, liquidtank, liquidjunction, bridgeconduit, laserconduit;
public static Block mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidtank, liquidJunction, bridgeConduit, phaseConduit;
@Override
public void load() {
mechanicalPump = new Pump("mechanical-pump") {{
shadow = "shadow-round-1";
pumpAmount = 0.1f;
tier = 0;
}};
rotaryPump = new Pump("rotary-pump") {{
pumpAmount = 0.2f;
shadow = "shadow-rounded-2";
pumpAmount = 0.25f;
powerUse = 0.015f;
liquidCapacity = 30f;
size = 2;
@@ -36,30 +38,30 @@ public class LiquidBlocks extends BlockList implements ContentList{
health = 45;
}};
pulseconduit = new Conduit("pulseconduit") {{
pulseConduit = new Conduit("pulse-conduit") {{
liquidCapacity = 16f;
liquidFlowFactor = 4.9f;
health = 65;
health = 90;
}};
liquidrouter = new LiquidRouter("liquidrouter") {{
liquidRouter = new LiquidRouter("liquid-router") {{
liquidCapacity = 40f;
}};
liquidtank = new LiquidRouter("liquidtank") {{
liquidtank = new LiquidRouter("liquid-tank") {{
size = 3;
liquidCapacity = 1500f;
health = 500;
}};
liquidjunction = new LiquidJunction("liquidjunction");
liquidJunction = new LiquidJunction("liquid-junction");
bridgeconduit = new LiquidExtendingBridge("bridgeconduit") {{
bridgeConduit = new LiquidExtendingBridge("bridge-conduit") {{
range = 3;
hasPower = false;
}};
laserconduit = new LiquidBridge("laserconduit") {{
phaseConduit = new LiquidBridge("phase-conduit") {{
range = 7;
}};
}

View File

@@ -7,17 +7,18 @@ import io.anuke.mindustry.world.blocks.distribution.WarpGate;
import io.anuke.mindustry.world.blocks.power.*;
public class PowerBlocks extends BlockList implements ContentList {
public static Block combustiongenerator, thermalgenerator, turbinegenerator, rtgenerator, solarpanel, largesolarpanel,
nuclearReactor, fusionReactor, battery, batteryLarge, powernode, powernodelarge, warpgate;
public static Block combustionGenerator, thermalGenerator, turbineGenerator, rtgGenerator, solarPanel, largeSolarPanel,
nuclearReactor, fusionReactor, battery, batteryLarge, powerNode, powerNodeLarge, warpGate;
@Override
public void load() {
combustiongenerator = new BurnerGenerator("combustion-generator") {{
powerOutput = 0.04f;
combustionGenerator = new BurnerGenerator("combustion-generator") {{
powerOutput = 0.06f;
powerCapacity = 40f;
itemDuration = 50f;
}};
thermalgenerator = new LiquidHeatGenerator("thermal-generator") {{
thermalGenerator = new LiquidHeatGenerator("thermal-generator") {{
maxLiquidGenerate = 0.5f;
powerPerLiquid = 0.08f;
powerCapacity = 40f;
@@ -25,25 +26,26 @@ public class PowerBlocks extends BlockList implements ContentList {
size = 2;
}};
turbinegenerator = new TurbineGenerator("turbine-generator") {{
powerOutput = 0.04f;
turbineGenerator = new TurbineGenerator("turbine-generator") {{
powerOutput = 0.15f;
powerCapacity = 40f;
itemDuration = 40f;
size = 2;
}};
rtgenerator = new DecayGenerator("rtg-generator") {{
rtgGenerator = new DecayGenerator("rtg-generator") {{
powerCapacity = 40f;
powerOutput = 0.02f;
itemDuration = 500f;
}};
solarpanel = new SolarGenerator("solar-panel") {{
generation = 0.003f;
solarPanel = new SolarGenerator("solar-panel") {{
generation = 0.0045f;
}};
largesolarpanel = new SolarGenerator("large-solar-panel") {{
largeSolarPanel = new SolarGenerator("solar-panel-large") {{
size = 3;
generation = 0.012f;
generation = 0.055f;
}};
nuclearReactor = new NuclearReactor("nuclear-reactor") {{
@@ -65,11 +67,11 @@ public class PowerBlocks extends BlockList implements ContentList {
powerCapacity = 2000f;
}};
powernode = new PowerDistributor("power-node") {{
powerNode = new PowerDistributor("power-node") {{
shadow = "shadow-round-1";
}};
powernodelarge = new PowerDistributor("power-node-large") {{
powerNodeLarge = new PowerDistributor("power-node-large") {{
size = 2;
powerSpeed = 1f;
maxNodes = 5;
@@ -77,7 +79,7 @@ public class PowerBlocks extends BlockList implements ContentList {
shadow = "shadow-round-2";
}};
warpgate = new WarpGate("warpgate");
warpGate = new WarpGate("warp-gate");
}
}

View File

@@ -24,6 +24,7 @@ public class TurretBlocks extends BlockList implements ContentList {
range = 80f;
shootCone = 15f;
ammoUseEffect = ShootFx.shellEjectSmall;
health = 80;
}};
/*
scatter = new BurstTurret("scatter") {{
@@ -44,6 +45,7 @@ public class TurretBlocks extends BlockList implements ContentList {
recoil = 2f;
range = 200f;
inaccuracy = 5f;
health = 120;
}};
scorch = new LiquidTurret("scorch") {{
@@ -52,6 +54,7 @@ public class TurretBlocks extends BlockList implements ContentList {
reload = 5f;
shootCone = 50f;
ammoUseEffect = ShootFx.shellEjectSmall;
health = 140;
drawer = (tile, entity) -> Draw.rect(entity.target != null ? name + "-shoot" : name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
}};
@@ -65,6 +68,7 @@ public class TurretBlocks extends BlockList implements ContentList {
shootCone = 50f;
shootEffect = ShootFx.shootLiquid;
range = 70f;
health = 360;
drawer = (tile, entity) -> {
Draw.rect(name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
@@ -93,6 +97,7 @@ public class TurretBlocks extends BlockList implements ContentList {
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
heatColor = Color.RED;
size = 2;
health = 320;
}};
arc = new LaserTurret("arc") {{
@@ -113,6 +118,7 @@ public class TurretBlocks extends BlockList implements ContentList {
swarmer = new ItemTurret("swarmer") {{
ammoTypes = new AmmoType[]{AmmoTypes.missileExplosive, AmmoTypes.missileIncindiary, AmmoTypes.missileSurge};
size = 2;
health = 380;
}};
salvo = new ItemTurret("salvo") {{
@@ -139,11 +145,15 @@ public class TurretBlocks extends BlockList implements ContentList {
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90);
}
};
health = 430;
}};
ripple = new ArtilleryTurret("ripple") {{
ammoTypes = new AmmoType[]{AmmoTypes.artilleryCarbide, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryPlastic, AmmoTypes.artilleryThorium};
size = 3;
health = 550;
}};
cyclone = new ItemTurret("cyclone") {{

View File

@@ -8,11 +8,11 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.units.*;
public class UnitBlocks extends BlockList implements ContentList {
public static Block resupplyPoint, repairPoint, droneFactory, dropPoint, reconstructor, overdriveProjector, shieldProjector;
public static Block resupplyPoint, repairPoint, droneFactory, fabricatorFactory, dropPoint, reconstructor, overdriveProjector, shieldProjector;
@Override
public void load() {
droneFactory = new UnitFactory("dronefactory") {{
droneFactory = new UnitFactory("drone-factory") {{
type = UnitTypes.drone;
produceTime = 800;
size = 2;
@@ -21,17 +21,27 @@ public class UnitBlocks extends BlockList implements ContentList {
};
}};
resupplyPoint = new ResupplyPoint("resupplypoint") {{
fabricatorFactory = new UnitFactory("fabricator-factory") {{
type = UnitTypes.fabricator;
produceTime = 1600;
size = 2;
powerUse = 0.2f;
requirements = new ItemStack[]{
new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80)
};
}};
resupplyPoint = new ResupplyPoint("resupply-point") {{
shadow = "shadow-round-1";
itemCapacity = 30;
}};
dropPoint = new DropPoint("droppoint") {{
dropPoint = new DropPoint("drop-point") {{
shadow = "shadow-round-1";
itemCapacity = 40;
}};
repairPoint = new RepairPoint("repairpoint") {{
repairPoint = new RepairPoint("repair-point") {{
shadow = "shadow-round-1";
repairSpeed = 0.1f;
}};
@@ -40,7 +50,7 @@ public class UnitBlocks extends BlockList implements ContentList {
size = 2;
}};
overdriveProjector = new OverdriveProjector("overdriveprojector") {{
overdriveProjector = new OverdriveProjector("overdrive-projector") {{
size = 2;
}};

View File

@@ -35,13 +35,13 @@ public class UnitType implements UnlockableContent{
public boolean isFlying;
public float drag = 0.1f;
public float maxVelocity = 5f;
public float reload = 40f;
public float retreatPercent = 0.2f;
public float armor = 0f;
public float carryWeight = 1f;
public int ammoCapacity = 100;
public int itemCapacity = 30;
public int mineLevel = 2;
public float buildPower = 0.3f, minePower = 0.7f, healSpeed = 0.1f;
public Weapon weapon = Weapons.blaster;
public float weaponOffsetX, weaponOffsetY;

View File

@@ -41,7 +41,6 @@ import static io.anuke.mindustry.Vars.*;
public class Drone extends FlyingUnit implements BuilderTrait {
protected static ObjectSet<Item> toMine;
protected static float healSpeed = 0.1f;
protected static float discoverRange = 120f;
protected static boolean initialized;
@@ -89,12 +88,12 @@ public class Drone extends FlyingUnit implements BuilderTrait {
@Override
public float getBuildPower(Tile tile) {
return 0.3f;
return type.buildPower;
}
@Override
public float getMinePower() {
return 0.7f;
return type.minePower;
}
@Override
@@ -292,7 +291,7 @@ public class Drone extends FlyingUnit implements BuilderTrait {
circle(type.range);
}else{
TileEntity entity = (TileEntity) target;
entity.health += healSpeed * Timers.delta();
entity.health += type.healSpeed * Timers.delta();
entity.health = Mathf.clamp(entity.health, 0, entity.tile.block().health);
}
}

View File

@@ -0,0 +1,5 @@
package io.anuke.mindustry.entities.units.types;
public class Fabricator extends Drone {
}

View File

@@ -2,7 +2,7 @@ package io.anuke.mindustry.game;
import com.badlogic.gdx.utils.Array;
/**Base interface for an unlockable content type.*/
/**Base interface for a content type that is loaded in {@link io.anuke.mindustry.core.ContentLoader}.*/
public interface Content {
/**Returns the type name of this piece of content.
@@ -12,8 +12,7 @@ public interface Content {
/**Returns a list of all instances of this content.*/
Array<? extends Content> getAll();
/**Called after all content is created. Use for loading texture regions and other data.
* Do not use to load regions!*/
/**Called after all content is created. Do not use to load regions or texture data!*/
default void init(){}
/**Called after all content is created, only on non-headless versions.

View File

@@ -25,11 +25,13 @@ public class ContentDatabase {
return set.contains(content.getContentName());
}
/**Makes this piece of content 'unlocked'.
* If this piece of content is already unlocked, nothing changes.
/**Makes this piece of content 'unlocked', if possible.
* If this piece of content is already unlocked or cannot be unlocked due to dependencies, nothing changes.
* Results are not saved until you call {@link #save()}.
* @return whether or not this content was newly unlocked.*/
public boolean unlockContent(UnlockableContent content){
if(!content.canBeUnlocked()) return false;
if(!unlocked.containsKey(content.getContentTypeName())){
unlocked.put(content.getContentTypeName(), new ObjectSet<>());
}
@@ -38,6 +40,7 @@ public class ContentDatabase {
//fire unlock event so other classes can use it
if(ret){
content.onUnlock();
Events.fire(UnlockEvent.class, content);
dirty = true;
}

View File

@@ -3,6 +3,8 @@ package io.anuke.mindustry.game;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import io.anuke.ucore.scene.ui.layout.Table;
import static io.anuke.mindustry.Vars.control;
/**Base interface for an unlockable content type.*/
public interface UnlockableContent extends Content{
@@ -22,4 +24,29 @@ public interface UnlockableContent extends Content{
/**Called when this content is unlocked. Use this to unlock other related content.*/
default void onUnlock(){}
/**Whether this content is always hidden in the content info dialog.*/
default boolean isHidden(){
return false;
}
/**Lists the content that must be unlocked in order for this specific content to become unlocked. May return null.*/
default UnlockableContent[] getDependencies(){
return null;
}
/**Returns whether dependencies are satisfied for unlocking this content.*/
default boolean canBeUnlocked(){
UnlockableContent[] depend = getDependencies();
if(depend == null){
return true;
}else{
for(UnlockableContent cont : depend){
if(!control.database().isUnlocked(cont)){
return false;
}
}
return true;
}
}
}

View File

@@ -115,7 +115,7 @@ public class WaveCreator{
unitAmount = 4;
groupAmount = 2;
effect = StatusEffects.overdrive;
items = new ItemStack(Items.thermite, 100);
items = new ItemStack(Items.pyratite, 100);
end = 130;
}},
@@ -139,7 +139,7 @@ public class WaveCreator{
new SpawnGroup(UnitTypes.monsoon){{
begin = 53;
ammoItem = Items.thermite;
ammoItem = Items.pyratite;
unitAmount = 2;
unitScaling = 3;
spacing = 4;

View File

@@ -34,6 +34,8 @@ public class Liquid implements UnlockableContent{
public StatusEffect effect = StatusEffects.none;
/**Pump tier. Controls which pumps can use this liquid.*/
public int tier;
/**Displayed icon.*/
public TextureRegion iconRegion;
public Liquid(String name, Color color) {
this.name = name;
@@ -44,6 +46,11 @@ public class Liquid implements UnlockableContent{
Liquid.liquids.add(this);
}
@Override
public void load() {
iconRegion = Draw.region("icon-liquid-" + name);
}
@Override
public void displayInfo(Table table) {
ContentDisplay.displayLiquid(table, this);
@@ -56,7 +63,7 @@ public class Liquid implements UnlockableContent{
@Override
public TextureRegion getContentIcon() {
return Draw.region("liquid-icon");
return iconRegion;
}
@Override

View File

@@ -36,6 +36,9 @@ public class Recipe implements UnlockableContent{
public boolean desktopOnly = false, debugOnly = false;
private Block[] dependencies;
private Recipe[] recipeDependencies;
public Recipe(Category category, Block result, ItemStack... requirements){
this.id = lastid ++;
this.result = result;
@@ -55,6 +58,11 @@ public class Recipe implements UnlockableContent{
recipeMap.put(result, this);
}
public Recipe setDependencies(Block... blocks){
this.dependencies = blocks;
return this;
}
public Recipe setDesktop(){
desktopOnly = true;
return this;
@@ -115,6 +123,19 @@ public class Recipe implements UnlockableContent{
}
}
@Override
public UnlockableContent[] getDependencies() {
if(dependencies == null){
return null;
}else if(recipeDependencies == null){
recipeDependencies = new Recipe[dependencies.length];
for (int i = 0; i < recipeDependencies.length; i++) {
recipeDependencies[i] = Recipe.getByResult(dependencies[i]);
}
}
return recipeDependencies;
}
@Override
public Array<? extends Content> getAll() {
return allRecipes;

View File

@@ -32,8 +32,6 @@ public class UnlocksDialog extends FloatingDialog {
OrderedMap<String, Array<Content>> allContent = ContentLoader.getContentMap();
//allContent.orderedKeys().reverse();
for(String key : allContent.orderedKeys()){
Array<Content> array = allContent.get(key);
if(array.size == 0 || !(array.first() instanceof UnlockableContent)) continue;
@@ -48,9 +46,13 @@ public class UnlocksDialog extends FloatingDialog {
int maxWidth = 14;
int size = 8*6;
int count = 0;
for (int i = 0; i < array.size; i++) {
UnlockableContent unlock = (UnlockableContent)array.get(i);
if(unlock.isHidden()) continue;
Image image = control.database().isUnlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-locked");
list.add(image).size(size).pad(3);
@@ -62,7 +64,7 @@ public class UnlocksDialog extends FloatingDialog {
}}));
}
if((i+1) % maxWidth == 0){
if((++count) % maxWidth == 0){
list.row();
}
}

View File

@@ -69,7 +69,7 @@ public class Block extends BaseBlock implements Content{
/**whether this floor can be placed on.*/
public boolean placeableOn = true;
/**tile entity health*/
public int health = 40;
public int health = -1;
/**base block explosiveness*/
public float baseExplosiveness = 0f;
/**whether to display a different shadow per variant*/
@@ -161,6 +161,11 @@ public class Block extends BaseBlock implements Content{
/**Called after all blocks are created.*/
@Override
public void init(){
//initialize default health based on size
if(health == -1){
health = size*size*40;
}
setStats();
setBars();
}

View File

@@ -1,21 +1,50 @@
package io.anuke.mindustry.world.blocks.production;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.meta.BlockStat;
import io.anuke.mindustry.world.meta.StatUnit;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.graphics.Draw;
public class Fracker extends SolidPump {
protected Liquid inputLiquid;
protected float inputLiquidUse;
protected float inputCapacity = 20f;
protected Item inputItem = Items.sand;
protected float itemUseTime = 100f;
protected TextureRegion liquidRegion;
protected TextureRegion rotatorRegion;
protected TextureRegion topRegion;
public Fracker(String name) {
super(name);
hasItems = true;
}
@Override
public void load() {
super.load();
liquidRegion = Draw.region(name + "-liquid");
rotatorRegion = Draw.region(name + "-rotator");
topRegion = Draw.region(name + "-top");
}
@Override
public void setStats() {
super.setStats();
stats.add(BlockStat.inputItem, inputItem);
stats.add(BlockStat.inputLiquid, inputLiquid);
stats.add(BlockStat.liquidUse, 60f *inputLiquidUse, StatUnit.liquidSecond);
}
@Override
public void draw(Tile tile) {
FrackerEntity entity = tile.entity();
@@ -24,11 +53,11 @@ public class Fracker extends SolidPump {
Draw.color(tile.entity.liquids.liquid.color);
Draw.alpha(tile.entity.liquids.amount/liquidCapacity);
Draw.rect(name + "-liquid", tile.drawx(), tile.drawy());
Draw.rect(liquidRegion, tile.drawx(), tile.drawy());
Draw.color();
Draw.rect(name + "-rotator", tile.drawx(), tile.drawy(), entity.pumpTime);
Draw.rect(name + "-top", tile.drawx(), tile.drawy());
Draw.rect(rotatorRegion, tile.drawx(), tile.drawy(), entity.pumpTime);
Draw.rect(topRegion, tile.drawx(), tile.drawy());
}
@Override
@@ -40,31 +69,32 @@ public class Fracker extends SolidPump {
public void update(Tile tile) {
FrackerEntity entity = tile.entity();
if(entity.input >= inputLiquidUse * Timers.delta()){
while(entity.accumulator > itemUseTime && entity.items.hasItem(inputItem, 1)){
entity.items.removeItem(inputItem, 1);
entity.accumulator -= itemUseTime;
}
if(entity.input >= inputLiquidUse * Timers.delta() && entity.accumulator < itemUseTime){
super.update(tile);
entity.input -= inputLiquidUse * Timers.delta();
entity.accumulator += Timers.delta();
}else{
tryDumpLiquid(tile);
}
}
@Override
public void handleLiquid(Tile tile, Tile source, Liquid liquid, float amount) {
public float handleAuxLiquid(Tile tile, Tile source, Liquid liquid, float amount) {
if(liquid != inputLiquid){
super.handleLiquid(tile, source, liquid, amount);
return 0f;
}else{
FrackerEntity entity = tile.entity();
entity.input += amount;
float accepted = Math.min(inputCapacity - entity.input, amount);
entity.input += accepted;
return accepted;
}
}
@Override
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount) {
FrackerEntity entity = tile.entity();
return (liquid == inputLiquid && entity.input < inputLiquidUse) || super.acceptLiquid(tile, source, liquid, amount);
}
@Override
public TileEntity getEntity() {
return new FrackerEntity();
@@ -72,5 +102,6 @@ public class Fracker extends SolidPump {
public static class FrackerEntity extends SolidPumpEntity{
public float input;
public float accumulator;
}
}

View File

@@ -6,6 +6,8 @@ import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.LiquidBlock;
import io.anuke.mindustry.world.meta.BlockStat;
import io.anuke.mindustry.world.meta.StatUnit;
import io.anuke.ucore.core.Timers;
public class LiquidMixer extends LiquidBlock{
@@ -24,6 +26,15 @@ public class LiquidMixer extends LiquidBlock{
solid = true;
}
@Override
public void setStats() {
super.setStats();
stats.add(BlockStat.liquidOutput, outputLiquid);
stats.add(BlockStat.powerUse, powerUse * 60f, StatUnit.powerSecond);
stats.add(BlockStat.inputItem, inputItem);
}
@Override
public void update(Tile tile){
float used = Math.min(Timers.delta() * powerUse, tile.entity.power.amount);