Impact reactor

This commit is contained in:
Anuken 2019-02-03 11:22:53 -05:00
parent f5028a4937
commit 62d8cb0b25
14 changed files with 21 additions and 35 deletions

View File

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 151 B

View File

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

View File

Before

Width:  |  Height:  |  Size: 210 B

After

Width:  |  Height:  |  Size: 210 B

View File

Before

Width:  |  Height:  |  Size: 174 B

After

Width:  |  Height:  |  Size: 174 B

View File

Before

Width:  |  Height:  |  Size: 187 B

After

Width:  |  Height:  |  Size: 187 B

View File

Before

Width:  |  Height:  |  Size: 169 B

After

Width:  |  Height:  |  Size: 169 B

View File

Before

Width:  |  Height:  |  Size: 481 B

After

Width:  |  Height:  |  Size: 481 B

View File

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 243 B

View File

@ -579,6 +579,7 @@ block.battery-large.name = Large Battery
block.combustion-generator.name = Combustion Generator
block.turbine-generator.name = Turbine Generator
block.differential-generator.name = Differential Generator
block.impact-reactor.name = Impact Reactor
block.mechanical-drill.name = Mechanical Drill
block.pneumatic-drill.name = Pneumatic Drill
block.laser-drill.name = Laser Drill

View File

@ -60,7 +60,7 @@ public class Blocks implements ContentList{
//power
combustionGenerator, thermalGenerator, turbineGenerator, differentialGenerator, rtgGenerator, solarPanel, largeSolarPanel, thoriumReactor,
fusionReactor, battery, batteryLarge, powerNode, powerNodeLarge, surgeTower,
impactReactor, battery, batteryLarge, powerNode, powerNodeLarge, surgeTower,
//production
mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, plasmaDrill, waterExtractor, oilExtractor, cultivator,
@ -408,12 +408,10 @@ public class Blocks implements ContentList{
requirements(Category.crafting, ItemStack.with(Items.lead, 60, Items.titanium, 40));
hasItems = true;
hasPower = true;
hasLiquids = true;
output = Items.blastCompound;
size = 2;
consumes.liquid(Liquids.oil, 0.05f);
consumes.item(Items.pyratite, 1);
consumes.items(new ItemStack(Items.pyratite, 1), new ItemStack(Items.biomatter, 1));
consumes.power(0.40f);
}};
@ -884,13 +882,14 @@ public class Blocks implements ContentList{
consumes.liquid(Liquids.cryofluid, maxLiquidUse);
}};
fusionReactor = new ImpactGenerator("fusion-reactor"){{
impactReactor = new ImpactReactor("impact-reactor"){{
requirements(Category.power, ItemStack.with(Items.lead, 800, Items.silicon, 600, Items.graphite, 600, Items.thorium, 200, Items.surgealloy, 400, Items.metaglass, 200));
size = 4;
health = 900;
powerProduction = 70f;
//consumes.power(20f);
consumes.liquid(Liquids.water, 0.5f);
consumes.power(20f);
consumes.item(Items.blastCompound);
consumes.liquid(Liquids.water, 0.3f);
}};
//endregion power

View File

@ -477,7 +477,7 @@ public class Zones implements ContentList{
}};
*/
nuclearComplex = new Zone("nuclearComplex", new MapGenerator("nuclearProductionComplex")
nuclearComplex = new Zone("nuclearComplex", new MapGenerator("nuclearProductionComplex", 1)
.drops(ItemStack.with(Items.copper, 2000, Items.lead, 1500, Items.silicon, 1000, Items.graphite, 1000, Items.thorium, 200, Items.titanium, 2000, Items.metaglass, 1000))
.decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.01))){{
deployCost = ItemStack.with(Items.copper, 3000, Items.lead, 2000, Items.silicon, 1000, Items.metaglass, 500);

View File

@ -1,24 +0,0 @@
package io.anuke.mindustry.world.blocks.power;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.Liquid;
public class ImpactGenerator extends TurbineGenerator{
public ImpactGenerator(String name){
super(name);
minItemEfficiency = 0.5f;
minLiquidEfficiency = 0.5f;
randomlyExplode = false;
}
@Override
protected float getItemEfficiency(Item item){
return item.explosiveness;
}
@Override
protected float getLiquidEfficiency(Liquid liquid){
return liquid.explosiveness;
}
}

View File

@ -14,14 +14,17 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
public class FusionReactor extends PowerGenerator{
public class ImpactReactor extends PowerGenerator{
protected int timerUse = timers++;
protected int plasmas = 4;
protected float warmupSpeed = 0.001f;
protected float useTime = 60f;
protected Color plasma1 = Color.valueOf("ffd06b"), plasma2 = Color.valueOf("ff361b");
protected Color ind1 = Color.valueOf("858585"), ind2 = Color.valueOf("fea080");
public FusionReactor(String name){
public ImpactReactor(String name){
super(name);
hasPower = true;
hasLiquids = true;
@ -37,6 +40,10 @@ public class FusionReactor extends PowerGenerator{
if(entity.cons.valid()){
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, warmupSpeed);
if(entity.timer.get(timerUse, useTime)){
entity.items.remove(consumes.item(), consumes.itemAmount());
}
}else{
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, 0.01f);
}

View File

@ -167,7 +167,10 @@ public class PowerGraph{
tile.entity.power.graph = this;
all.add(tile);
if(tile.block().outputsPower && tile.block().consumesPower){
if(tile.block().outputsPower && tile.block().consumesPower && !tile.block().consumes.get(ConsumePower.class).isBuffered){
producers.add(tile);
consumers.add(tile);
}else if(tile.block().outputsPower && tile.block().consumesPower){
batteries.add(tile);
}else if(tile.block().outputsPower){
producers.add(tile);