Content class reorganization, beginning work on unit factory

This commit is contained in:
Anuken
2018-03-25 13:12:32 -04:00
parent 59530909d6
commit 3418979f4d
106 changed files with 1772 additions and 1662 deletions

View File

@@ -0,0 +1,39 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.resource.Item;
public class Items {
public static final Item
stone = new Item("stone") {
{
material = false;
}
},
iron = new Item("iron"),
lead = new Item("lead"),
coal = new Item("coal") {
{
explosiveness = 0.2f;
flammability = 0.5f;
fluxiness = 0.5f;
material = false;
}
},
steel = new Item("steel"),
titanium = new Item("titanium"),
thorium = new Item("thorium") {
{
explosiveness = 0.1f;
}
},
silicon = new Item("silicon"),
plastic = new Item("plastic"),
densealloy = new Item("densealloy"),
biomatter = new Item("biomatter") {
{
material = false;
flammability = 0.4f;
}
};
}

View File

@@ -0,0 +1,49 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.resource.Liquid;
public class Liquids {
public static final Liquid
none = new Liquid("none", Color.CLEAR),
water = new Liquid("water", Color.ROYAL) {
{
heatCapacity = 0.4f;
}
},
plasma = new Liquid("plasma", Color.CORAL) {
{
flammability = 0.4f;
viscosity = 0.1f;
heatCapacity = 0.2f;
}
},
lava = new Liquid("lava", Color.valueOf("e37341")) {
{
temperature = 0.7f;
viscosity = 0.8f;
}
},
oil = new Liquid("oil", Color.valueOf("292929")) {
{
viscosity = 0.7f;
flammability = 0.6f;
explosiveness = 0.6f;
}
},
cryofluid = new Liquid("cryofluid", Color.SKY) {
{
heatCapacity = 0.75f;
temperature = 0.5f;
}
},
sulfuricAcid = new Liquid("sulfuricAcid", Color.YELLOW) {
{
flammability = 0.4f;
explosiveness = 0.4f;
heatCapacity = 0.4f;
}
};
}

View File

@@ -0,0 +1,10 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.resource.Mech;
public class Mechs {
public static final Mech
standard = new Mech("standard-mech", false),
standardShip = new Mech("standard-ship", true);
}

View File

@@ -0,0 +1,139 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.blocks.*;
import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.resource.ItemStack;
import io.anuke.mindustry.resource.Recipe;
import io.anuke.mindustry.resource.Section;
import io.anuke.mindustry.world.Block;
import static io.anuke.mindustry.Vars.debug;
import static io.anuke.mindustry.resource.Section.*;
public class Recipes {
private static final Array<Recipe> list = Array.with(
//new Recipe(defense, DefenseBlocks.stonewall, stack(Item.stone, 12)),
new Recipe(defense, DefenseBlocks.ironwall, stack(Items.iron, 12)),
new Recipe(defense, DefenseBlocks.steelwall, stack(Items.steel, 12)),
new Recipe(defense, DefenseBlocks.titaniumwall, stack(Items.titanium, 12)),
new Recipe(defense, DefenseBlocks.diriumwall, stack(Items.densealloy, 12)),
new Recipe(defense, DefenseBlocks.steelwalllarge, stack(Items.steel, 12*4)),
new Recipe(defense, DefenseBlocks.titaniumwalllarge, stack(Items.titanium, 12*4)),
new Recipe(defense, DefenseBlocks.diriumwall, stack(Items.densealloy, 12*4)),
new Recipe(defense, DefenseBlocks.door, stack(Items.steel, 3), stack(Items.iron, 3*4)).setDesktop(),
new Recipe(defense, DefenseBlocks.largedoor, stack(Items.steel, 3*4), stack(Items.iron, 3*4*4)).setDesktop(),
new Recipe(defense, DefenseBlocks.titaniumshieldwall, stack(Items.titanium, 16)),
new Recipe(distribution, DistributionBlocks.conveyor, stack(Items.iron, 1)),
new Recipe(distribution, DistributionBlocks.steelconveyor, stack(Items.steel, 1)),
new Recipe(distribution, DistributionBlocks.pulseconveyor, stack(Items.densealloy, 1)),
new Recipe(distribution, DistributionBlocks.router, stack(Items.iron, 2)),
new Recipe(distribution, DistributionBlocks.multiplexer, stack(Items.iron, 8)),
new Recipe(distribution, DistributionBlocks.junction, stack(Items.iron, 2)),
new Recipe(distribution, DistributionBlocks.tunnel, stack(Items.iron, 2)),
new Recipe(distribution, DistributionBlocks.sorter, stack(Items.steel, 2)),
new Recipe(distribution, DistributionBlocks.splitter, stack(Items.steel, 1)),
new Recipe(distribution, StorageBlocks.vault, stack(Items.steel, 50)),
new Recipe(distribution, StorageBlocks.core, stack(Items.steel, 50)),
new Recipe(distribution, StorageBlocks.unloader, stack(Items.steel, 5)),
new Recipe(distribution, StorageBlocks.sortedunloader, stack(Items.steel, 5)),
new Recipe(weapon, WeaponBlocks.doubleturret, stack(Items.iron, 7)),
new Recipe(weapon, WeaponBlocks.gatlingturret, stack(Items.iron, 8)),
new Recipe(weapon, WeaponBlocks.flameturret, stack(Items.iron, 12), stack(Items.steel, 9)),
new Recipe(weapon, WeaponBlocks.railgunturret, stack(Items.iron, 15), stack(Items.steel, 10)),
new Recipe(weapon, WeaponBlocks.laserturret, stack(Items.steel, 12), stack(Items.titanium, 12)),
new Recipe(weapon, WeaponBlocks.flakturret, stack(Items.steel, 25), stack(Items.titanium, 15)),
new Recipe(weapon, WeaponBlocks.teslaturret, stack(Items.steel, 20), stack(Items.titanium, 25), stack(Items.densealloy, 15)),
new Recipe(weapon, WeaponBlocks.magmaturret, stack(Items.steel, 80), stack(Items.titanium, 70), stack(Items.densealloy, 60)),
new Recipe(weapon, WeaponBlocks.chainturret, stack(Items.steel, 50), stack(Items.titanium, 25), stack(Items.densealloy, 40)),
new Recipe(weapon, WeaponBlocks.titanturret, stack(Items.steel, 70), stack(Items.titanium, 50), stack(Items.densealloy, 55)),
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(production, ProductionBlocks.stonedrill, stack(Item.stone, 12)),
new Recipe(production, ProductionBlocks.irondrill, stack(Items.iron, 25)),
new Recipe(production, ProductionBlocks.leaddrill, stack(Items.iron, 25)),
new Recipe(production, ProductionBlocks.coaldrill, stack(Items.iron, 25), stack(Items.iron, 40)),
new Recipe(production, ProductionBlocks.titaniumdrill, stack(Items.iron, 50), stack(Items.steel, 50)),
new Recipe(production, ProductionBlocks.thoriumdrill, stack(Items.iron, 40), stack(Items.steel, 40)),
new Recipe(production, ProductionBlocks.quartzextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
new Recipe(production, ProductionBlocks.cultivator, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
new Recipe(production, ProductionBlocks.laserdrill, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
new Recipe(production, ProductionBlocks.waterextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
new Recipe(production, ProductionBlocks.oilextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
new Recipe(power, PowerBlocks.coalgenerator, stack(Items.iron, 30)),
new Recipe(power, PowerBlocks.thermalgenerator, stack(Items.steel, 30)),
new Recipe(power, PowerBlocks.combustiongenerator, stack(Items.iron, 30)),
new Recipe(power, PowerBlocks.solarpanel, stack(Items.iron, 30), stack(Items.silicon, 20)),
new Recipe(power, PowerBlocks.largesolarpanel, stack(Items.iron, 30), stack(Items.silicon, 20)),
new Recipe(power, PowerBlocks.rtgenerator, stack(Items.titanium, 20), stack(Items.steel, 20)),
new Recipe(power, PowerBlocks.nuclearReactor, stack(Items.titanium, 40), stack(Items.densealloy, 40), stack(Items.steel, 50)),
new Recipe(power, PowerBlocks.powernode, stack(Items.steel, 3), stack(Items.iron, 3)),
new Recipe(power, PowerBlocks.battery, stack(Items.steel, 5), stack(Items.iron, 5)),
new Recipe(power, PowerBlocks.batteryLarge, stack(Items.steel, 5), stack(Items.iron, 5)),
new Recipe(power, PowerBlocks.shieldgenerator, stack(Items.titanium, 30), stack(Items.densealloy, 30)),
new Recipe(distribution, PowerBlocks.teleporter, stack(Items.steel, 30), stack(Items.densealloy, 40)),
new Recipe(power, PowerBlocks.repairturret, stack(Items.iron, 30)),
new Recipe(power, PowerBlocks.megarepairturret, stack(Items.iron, 20), stack(Items.steel, 30)),
new Recipe(liquid, LiquidBlocks.conduit, stack(Items.steel, 1)),
new Recipe(liquid, LiquidBlocks.pulseconduit, stack(Items.titanium, 1), stack(Items.steel, 1)),
new Recipe(liquid, LiquidBlocks.liquidrouter, stack(Items.steel, 2)),
new Recipe(liquid, LiquidBlocks.liquidtank, stack(Items.steel, 2)),
new Recipe(liquid, LiquidBlocks.liquidjunction, stack(Items.steel, 2)),
new Recipe(liquid, LiquidBlocks.conduittunnel, stack(Items.titanium, 2), stack(Items.steel, 2)),
new Recipe(liquid, LiquidBlocks.pump, stack(Items.steel, 10)),
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, DebugBlocks.powerVoid, stack(Items.steel, 10)).setDebug(),
new Recipe(units, DebugBlocks.powerInfinite, stack(Items.steel, 10), stack(Items.densealloy, 5)).setDebug()
);
private static ItemStack stack(Item item, int amount){
return new ItemStack(item, amount);
}
public static Array<Recipe> all(){
return list;
}
public static Recipe getByResult(Block block){
for(Recipe recipe : list){
if(recipe.result == block){
return recipe;
}
}
return null;
}
public static Array<Recipe> getBy(Section section, Array<Recipe> r){
for(Recipe recipe : list){
if(recipe.section == section && !(Vars.android && recipe.desktopOnly) && !(!debug && recipe.debugOnly)) {
r.add(recipe);
}
}
return r;
}
}

View File

@@ -0,0 +1,12 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.entities.units.UnitType;
import io.anuke.mindustry.entities.units.types.Flier;
import io.anuke.mindustry.entities.units.types.Scout;
public class UnitTypes {
public static final UnitType
scout = new Scout(),
flier = new Flier();
}

View File

@@ -0,0 +1,36 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.ObjectMap.Entries;
import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.resource.ItemStack;
import io.anuke.mindustry.resource.Upgrade;
import io.anuke.ucore.util.Mathf;
public class UpgradeRecipes {
private static final ObjectMap<Upgrade, ItemStack[]> recipes = Mathf.map(
Weapons.triblaster, list(stack(Items.iron, 60), stack(Items.steel, 80)),
Weapons.clustergun, list(stack(Items.iron, 300), stack(Items.steel, 80)),
Weapons.vulcan, list(stack(Items.iron, 100), stack(Items.steel, 150), stack(Items.titanium, 80)),
Weapons.beam, list(stack(Items.steel, 260), stack(Items.titanium, 160), stack(Items.densealloy, 120)),
Weapons.shockgun, list(stack(Items.steel, 240), stack(Items.titanium, 160), stack(Items.densealloy, 160))
);
private static final ItemStack[] empty = {};
public static ItemStack[] get(Upgrade upgrade){
return recipes.get(upgrade, empty);
}
public static Entries<Upgrade, ItemStack[]> getAllRecipes(){
return recipes.entries();
}
private static ItemStack[] list(ItemStack... stacks){
return stacks;
}
private static ItemStack stack(Item item, int amount){
return new ItemStack(item, amount);
}
}

View File

@@ -0,0 +1,60 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.entities.BulletType;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.resource.Weapon;
public class Weapons {
public static final Weapon
blaster = new Weapon("blaster", 12, BulletType.shot) {
{
effect = Fx.laserShoot;
length = 2f;
}
},
triblaster = new Weapon("triblaster", 16, BulletType.spread) {
{
shots = 3;
effect = Fx.spreadShoot;
roundrobin = true;
}
},
clustergun = new Weapon("clustergun", 26f, BulletType.cluster) {
{
effect = Fx.clusterShoot;
inaccuracy = 17f;
roundrobin = true;
shots = 2;
spacing = 0;
}
},
beam = new Weapon("beam", 30f, BulletType.beamlaser) {
{
effect = Fx.beamShoot;
inaccuracy = 0;
roundrobin = true;
shake = 2f;
}
},
vulcan = new Weapon("vulcan", 5, BulletType.vulcan) {
{
effect = Fx.vulcanShoot;
inaccuracy = 5;
roundrobin = true;
shake = 1f;
inaccuracy = 4f;
}
},
shockgun = new Weapon("shockgun", 36, BulletType.shockshell) {
{
shootsound = "bigshot";
effect = Fx.shockShoot;
shake = 2f;
roundrobin = true;
shots = 7;
inaccuracy = 15f;
length = 3.5f;
}
};
}

View File

@@ -0,0 +1,153 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.graphics.DrawLayer;
import io.anuke.mindustry.resource.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.types.*;
public class Blocks {
public static final Block
air = new Block("air") {
//don't draw
public void draw(Tile tile) {}
},
//player/enemy spawnpoint?
spawn = new Block("spawn"),
blockpart = new BlockPart(),
deepwater = new Floor("deepwater") {{
variants = 0;
solid = true;
liquidDrop = Liquids.water;
liquid = true;
drawLayer = DrawLayer.water;
}},
water = new Floor("water") {{
variants = 0;
solid = true;
liquidDrop = Liquids.water;
liquid = true;
drawLayer = DrawLayer.water;
}},
lava = new Floor("lava") {{
variants = 0;
solid = true;
liquidDrop = Liquids.lava;
liquid = true;
drawLayer = DrawLayer.lava;
}},
oil = new Floor("oil") {{
variants = 0;
solid = true;
liquidDrop = Liquids.oil;
liquid = true;
drawLayer = DrawLayer.oil;
}},
stone = new Floor("stone") {{
drops = new ItemStack(Items.stone, 1);
blends = block -> block != this && !(block instanceof Ore);
}},
blackstone = new Floor("blackstone") {{
drops = new ItemStack(Items.stone, 1);
}},
iron = new Ore("iron") {{
drops = new ItemStack(Items.iron, 1);
}},
lead = new Ore("lead") {{
drops = new ItemStack(Items.lead, 1);
}},
coal = new Ore("coal") {{
drops = new ItemStack(Items.coal, 1);
}},
titanium = new Ore("titanium") {{
drops = new ItemStack(Items.titanium, 1);
}},
thorium = new Ore("thorium") {{
drops = new ItemStack(Items.thorium, 1);
}},
dirt = new Floor("dirt") {
},
sand = new Floor("sand") {{
drops = new ItemStack(Items.silicon, 1);
}},
ice = new Floor("ice") {
},
snow = new Floor("snow") {
},
grass = new Floor("grass") {
},
sandblock = new StaticBlock("sandblock") {{
solid = true;
variants = 3;
}},
snowblock = new StaticBlock("snowblock") {{
solid = true;
variants = 3;
}},
stoneblock = new StaticBlock("stoneblock") {{
solid = true;
variants = 3;
}},
blackstoneblock = new StaticBlock("blackstoneblock") {{
solid = true;
variants = 3;
}},
grassblock = new StaticBlock("grassblock") {{
solid = true;
variants = 2;
}},
mossblock = new StaticBlock("mossblock") {{
solid = true;
}},
shrub = new Rock("shrub"),
rock = new Rock("rock") {{
variants = 2;
varyShadow = true;
drops = new ItemStack(Items.stone, 3);
}},
icerock = new Rock("icerock") {{
variants = 2;
varyShadow = true;
drops = new ItemStack(Items.stone, 3);
}},
blackrock = new Rock("blackrock") {{
variants = 1;
varyShadow = true;
drops = new ItemStack(Items.stone, 3);
}},
dirtblock = new StaticBlock("dirtblock") {{
solid = true;
}};
}

View File

@@ -0,0 +1,28 @@
package io.anuke.mindustry.content.blocks;
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.generation.PowerDistributor;
public class DebugBlocks {
public static final Block
powerVoid = new PowerBlock("powervoid") {
{
powerCapacity = Float.MAX_VALUE;
}
},
powerInfinite = new PowerDistributor("powerinfinite") {
{
powerCapacity = 10000f;
}
@Override
public void update(Tile tile){
super.update(tile);
tile.entity.power.amount = powerCapacity;
}
};
}

View File

@@ -0,0 +1,66 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.Wall;
import io.anuke.mindustry.world.blocks.types.defense.*;
public class DefenseBlocks {
static final int wallHealthMultiplier = 4;
public static final Block
stonewall = new Wall("stonewall") {{
health = 40 * wallHealthMultiplier;
}},
ironwall = new Wall("ironwall") {{
health = 80 * wallHealthMultiplier;
}},
steelwall = new Wall("steelwall") {{
health = 110 * wallHealthMultiplier;
}},
titaniumwall = new Wall("titaniumwall") {{
health = 150 * wallHealthMultiplier;
}},
diriumwall = new Wall("duriumwall") {{
health = 190 * wallHealthMultiplier;
}},
compositewall = new Wall("compositewall") {{
health = 270 * wallHealthMultiplier;
}},
steelwalllarge = new Wall("steelwall-large") {{
health = 110 * 4 * wallHealthMultiplier;
size = 2;
}},
titaniumwalllarge = new Wall("titaniumwall-large") {{
health = 150 * 4 * wallHealthMultiplier;
size = 2;
}},
diriumwalllarge = new Wall("duriumwall-large") {{
health = 190 * 4 * wallHealthMultiplier;
size = 2;
}},
titaniumshieldwall = new ShieldedWallBlock("titaniumshieldwall") {{
health = 150 * wallHealthMultiplier;
}},
door = new Door("door") {{
health = 90 * wallHealthMultiplier;
}},
largedoor = new Door("door-large") {{
openfx = Fx.dooropenlarge;
closefx = Fx.doorcloselarge;
health = 90 * 4 * wallHealthMultiplier;
size = 2;
}};
}

View File

@@ -0,0 +1,44 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.distribution.*;
public class DistributionBlocks{
public static final Block
conveyor = new Conveyor("conveyor"){{
health = 40;
speed = 0.02f;
}},
steelconveyor = new Conveyor("steelconveyor"){{
health = 55;
speed = 0.04f;
}},
pulseconveyor = new Conveyor("poweredconveyor"){{
health = 75;
speed = 0.09f;
}},
router = new Router("router"),
multiplexer = new Router("multiplexer"){{
size = 2;
itemCapacity = 80;
}},
junction = new Junction("junction"){{
speed = 26;
capacity = 32;
}},
tunnel = new TunnelConveyor("conveyortunnel"){{
speed = 53;
}},
sorter = new Sorter("sorter"),
splitter = new Splitter("splitter");
}

View File

@@ -0,0 +1,45 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.distribution.Conduit;
import io.anuke.mindustry.world.blocks.types.distribution.LiquidJunction;
import io.anuke.mindustry.world.blocks.types.distribution.LiquidRouter;
import io.anuke.mindustry.world.blocks.types.distribution.TunnelConduit;
import io.anuke.mindustry.world.blocks.types.production.Pump;
public class LiquidBlocks {
public static final Block
pump = new Pump("pump") {{
pumpAmount = 0.8f;
}},
fluxpump = new Pump("fluxpump") {{
pumpAmount = 1.2f;
}},
conduit = new Conduit("conduit") {{
health = 45;
}},
pulseconduit = new Conduit("pulseconduit") {{
liquidCapacity = 16f;
liquidFlowFactor = 4.9f;
health = 65;
}},
liquidrouter = new LiquidRouter("liquidrouter") {{
liquidCapacity = 40f;
}},
liquidtank = new LiquidRouter("liquidtank") {{
size = 3;
liquidCapacity = 1500f;
}},
liquidjunction = new LiquidJunction("liquidjunction"),
conduittunnel = new TunnelConduit("conduittunnel") {{
speed = 53;
}};
}

View File

@@ -0,0 +1,89 @@
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.world.Block;
import io.anuke.mindustry.world.blocks.types.defense.RepairTurret;
import io.anuke.mindustry.world.blocks.types.defense.ShieldBlock;
import io.anuke.mindustry.world.blocks.types.distribution.Teleporter;
import io.anuke.mindustry.world.blocks.types.generation.*;
public class PowerBlocks {
public static final Block
coalgenerator = new ItemPowerGenerator("coalgenerator") {{
generateItem = Items.coal;
powerOutput = 0.04f;
powerCapacity = 40f;
}},
thermalgenerator = new LiquidPowerGenerator("thermalgenerator") {{
generateLiquid = Liquids.lava;
maxLiquidGenerate = 0.5f;
powerPerLiquid = 0.08f;
powerCapacity = 40f;
generateEffect = Fx.redgeneratespark;
}},
combustiongenerator = new LiquidPowerGenerator("combustiongenerator") {{
generateLiquid = Liquids.oil;
maxLiquidGenerate = 0.4f;
powerPerLiquid = 0.12f;
powerCapacity = 40f;
}},
rtgenerator = new ItemPowerGenerator("rtgenerator") {{
generateItem = Items.thorium;
powerCapacity = 40f;
powerOutput = 0.03f;
itemDuration = 240f;
}},
solarpanel = new SolarGenerator("solarpanel") {{
generation = 0.003f;
}},
largesolarpanel = new SolarGenerator("largesolarpanel") {{
size = 3;
generation = 0.012f;
}},
nuclearReactor = new NuclearReactor("nuclearreactor") {{
size = 3;
health = 600;
breaktime *= 2.3f;
}},
repairturret = new RepairTurret("repairturret") {{
range = 30;
reload = 20f;
health = 60;
powerUsed = 0.08f;
}},
megarepairturret = new RepairTurret("megarepairturret") {{
range = 44;
reload = 12f;
health = 90;
powerUsed = 0.13f;
size = 2;
}},
shieldgenerator = new ShieldBlock("shieldgenerator") {{
health = 400;
}},
battery = new PowerGenerator("battery") {{
powerCapacity = 320f;
}},
batteryLarge = new PowerGenerator("batterylarge") {{
size = 3;
powerCapacity = 2000f;
}},
powernode = new PowerDistributor("powernode"),
teleporter = new Teleporter("teleporter");
}

View File

@@ -0,0 +1,215 @@
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.*;
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;
drillTime = 240;
}},
irondrill = new Drill("irondrill") {{
resource = Blocks.iron;
result = Items.iron;
drillTime = 360;
}},
leaddrill = new Drill("leaddrill") {{
resource = Blocks.lead;
result = Items.lead;
drillTime = 400;
}},
coaldrill = new Drill("coaldrill") {{
resource = Blocks.coal;
result = Items.coal;
drillTime = 420;
}},
thoriumdrill = new Drill("thoriumdrill") {{
resource = Blocks.thorium;
result = Items.thorium;
drillTime = 600;
}},
titaniumdrill = new Drill("titaniumdrill") {{
resource = Blocks.titanium;
result = Items.titanium;
drillTime = 540;
}},
laserdrill = new GenericDrill("laserdrill") {{
drillTime = 200;
size = 2;
powerUse = 0.2f;
hasPower = true;
}},
nucleardrill = new GenericDrill("nucleardrill") {{
drillTime = 240;
size = 3;
powerUse = 0.32f;
hasPower = true;
}},
plasmadrill = new GenericDrill("plasmadrill") {{
inputLiquid = Liquids.plasma;
drillTime = 240;
size = 4;
powerUse = 0.16f;
hasLiquids = true;
hasPower = true;
}},
quartzextractor = new GenericDrill("quartzextractor") {{
powerUse = 0.1f;
resource = Blocks.sand;
result = Items.silicon;
drillTime = 320;
size = 2;
}},
waterextractor = new SolidPump("waterextractor") {{
result = Liquids.water;
powerUse = 0.1f;
pumpAmount = 0.4f;
size = 2;
liquidCapacity = 30f;
}},
oilextractor = new SolidPump("oilextractor") {{
result = Liquids.oil;
powerUse = 0.5f;
pumpAmount = 0.4f;
size = 3;
liquidCapacity = 80f;
}},
cultivator = new GenericDrill("cultivator") {{
resource = Blocks.grass;
result = Items.biomatter;
inputLiquid = Liquids.water;
liquidUse = 0.1f;
drillTime = 300;
size = 2;
hasLiquids = true;
hasPower = true;
}},
weaponFactory = new WeaponFactory("weaponfactory") {{
size = 2;
health = 250;
}};
}

View File

@@ -0,0 +1,27 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.storage.CoreBlock;
import io.anuke.mindustry.world.blocks.types.storage.SortedUnloader;
import io.anuke.mindustry.world.blocks.types.storage.Unloader;
import io.anuke.mindustry.world.blocks.types.storage.Vault;
public class StorageBlocks {
public static final Block
core = new CoreBlock("core"){{
health = 800;
}},
vault = new Vault("vault"){{
size = 3;
}},
unloader = new Unloader("unloader"){{
speed = 5;
}},
sortedunloader = new SortedUnloader("sortedunloader"){{
speed = 5;
}};
}

View File

@@ -0,0 +1,13 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.UnitTypes;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.production.UnitFactory;
public class UnitBlocks {
public static final Block
flierFactory = new UnitFactory("flierfactory"){{
type = UnitTypes.flier;
}};
}

View File

@@ -0,0 +1,234 @@
package io.anuke.mindustry.content.blocks;
import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.entities.BulletType;
import io.anuke.mindustry.entities.effect.TeslaOrb;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.types.defense.LaserTurret;
import io.anuke.mindustry.world.blocks.types.defense.LiquidTurret;
import io.anuke.mindustry.world.blocks.types.defense.PowerTurret;
import io.anuke.mindustry.world.blocks.types.defense.Turret;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class WeaponBlocks{
public static Block
doubleturret = new Turret("doubleturret"){
{
range = 44;
reload = 13f;
bullet = BulletType.stone;
ammo = Items.stone;
health = 45;
}
@Override
protected void shoot(Tile tile){
TurretEntity entity = tile.entity();
for(int i : Mathf.signs){
tr.trns(entity.rotation, 4, -2 * i);
bullet(tile, entity.rotation);
}
}
},
gatlingturret = new Turret("gatlingturret"){
{
range = 65;
reload = 7f;
bullet = BulletType.iron;
ammo = Items.iron;
health = 65;
}
},
flameturret = new Turret("flameturret"){
{
range = 45f;
reload = 5f;
bullet = BulletType.flame;
ammo = Items.coal;
health = 90;
inaccuracy = 4f;
}
},
railgunturret = new Turret("railgunturret"){
{
shootsound = "railgun";
range = 120;
reload = 50f;
bullet = BulletType.sniper;
ammo = Items.steel;
health = 70;
shootEffect = Fx.railshot;
}
},
flakturret = new Turret("flakturret"){
{
shootsound = "bigshot";
rotatespeed = 0.2f;
range = 120;
reload = 55f;
bullet = BulletType.flak;
shots = 3;
inaccuracy = 9f;
ammo = Items.coal;
ammoMultiplier = 5;
health = 110;
shootEffect = Fx.mortarshot;
shootShake = 2f;
size = 2;
}
},
laserturret = new LaserTurret("laserturret"){
{
shootsound = "laser";
beamColor = Color.SKY;
range = 60;
reload = 4f;
damage = 10;
health = 110;
powerUsed = 0.2f;
}
},
teslaturret = new PowerTurret("teslaturret"){
{
shootsound = "tesla";
range = 70;
reload = 15f;
bullet = BulletType.shell;
health = 140;
}
@Override
public void shoot(Tile tile){
TurretEntity entity = tile.entity();
float len = 4f;
new TeslaOrb(tile.getTeam(), tile.drawx() + Angles.trnsx(entity.rotation, len), tile.drawy() + Angles.trnsy(entity.rotation, len), range, 9).add();
}
},
magmaturret = new LiquidTurret("magmaturret") {
{
shootsound = "flame2";
inaccuracy = 7f;
range = 90f;
reload = 7f;
bullet = BulletType.plasmaflame;
ammoLiquid = Liquids.lava;
liquidPerShot = 3f;
health = 180*3;
size = 2;
}
},
plasmaturret = new Turret("plasmaturret"){
{
shootsound = "flame2";
inaccuracy = 7f;
range = 60f;
reload = 3f;
bullet = BulletType.plasmaflame;
ammo = Items.coal;
health = 180;
ammoMultiplier = 40;
}
},
chainturret = new Turret("chainturret"){
{
shootsound = "bigshot";
inaccuracy = 8f;
range = 80f;
reload = 8f;
bullet = BulletType.chain;
ammo = Items.thorium;
health = 430;
size = 2;
shootCone = 9f;
ammoMultiplier = 8;
shots = 2;
shootEffect = Fx.chainshot;
}
@Override
protected void shoot(Tile tile){
TurretEntity entity = tile.entity();
float len = 8;
float space = 3.5f;
for(int i = -1; i < 1; i ++){
tr.trns(entity.rotation, len, Mathf.sign(i) * space);
bullet(tile, entity.rotation);
Effects.effect(shootEffect, tile.drawx() + tr.x,
tile.drawy() + tr.y, entity.rotation);
}
Effects.shake(1f, 1f, tile.worldx(), tile.worldy());
}
},
titanturret = new Turret("titancannon"){
{
shootsound = "blast";
range = 120f;
reload = 23f;
bullet = BulletType.titanshell;
ammo = Items.thorium;
health = 800;
ammoMultiplier = 4;
size = 3;
rotatespeed = 0.07f;
shootCone = 9f;
shootEffect = Fx.titanshot;
shootShake = 3f;
}
},
fornaxcannon = new PowerTurret("fornaxcannon") {
{
shootsound = "blast";
range = 120f;
reload = 23f;
bullet = BulletType.titanshell;
ammo = Items.thorium;
health = 800;
ammoMultiplier = 4;
size = 3;
rotatespeed = 0.07f;
shootCone = 9f;
shootEffect = Fx.titanshot;
shootShake = 3f;
}
},
missileturret = new PowerTurret("missileturret") {
{
shootsound = "blast";
range = 120f;
reload = 23f;
bullet = BulletType.titanshell;
ammo = Items.thorium;
health = 800;
ammoMultiplier = 4;
size = 2;
rotatespeed = 0.07f;
shootCone = 9f;
shootEffect = Fx.titanshot;
shootShake = 3f;
}
};
}