Slag-based incinerator

This commit is contained in:
Anuken
2021-11-22 14:48:26 -05:00
parent d218480f6f
commit 947864269b
8 changed files with 128 additions and 9 deletions

View File

@@ -60,7 +60,7 @@ public class Blocks implements ContentList{
//crafting
siliconSmelter, siliconCrucible, siliconArcFurnace, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer,
melter, separator, disassembler, sporePress, pulverizer, incinerator, coalCentrifuge,
electrolyzer, oxidationChamber, slagHeater, heatReactor, carbideCrucible, slagCentrifuge, surgeCrucible, cyanogenSynthesizer,
electrolyzer, oxidationChamber, slagHeater, slagIncinerator, heatReactor, carbideCrucible, slagCentrifuge, surgeCrucible, cyanogenSynthesizer, phaseSynthesizer,
cellSynthesisChamber,
//sandbox
@@ -105,7 +105,7 @@ public class Blocks implements ContentList{
duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, foreshadow, spectre, meltdown, segment, parallax, tsunami,
//turrets - erekir
breach, fracture,
breach, fracture, sublimate,
//units
commandCenter,
@@ -120,10 +120,8 @@ public class Blocks implements ContentList{
message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell, memoryBank,
//campaign
launchPad, interplanetaryAccelerator,
launchPad, interplanetaryAccelerator
//nuclear?
nuclearWarhead, warheadAssembler, ballisticSilo //TODO
;
/** @deprecated use the blocks with proper names */
@@ -1022,6 +1020,12 @@ public class Blocks implements ContentList{
consumes.power(0.5f / 60f);
}};
slagIncinerator = new ItemIncinerator("slag-incinerator"){{
requirements(Category.crafting, with(Items.tungsten, 15));
size = 1;
consumes.liquid(Liquids.slag, 2f / 60f);
}};
heatReactor = new HeatProducer("heat-reactor"){{
//TODO quadvent?
//TODO coolant?
@@ -1149,6 +1153,39 @@ public class Blocks implements ContentList{
liquidCapacity = 40f;
}};
//TODO bad name
phaseSynthesizer = new HeatCrafter("phase-synthesizer"){{
requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 60, Items.carbide, 30));
size = 3;
itemCapacity = 30;
heatRequirement = 8f;
craftTime = 60f * 5f;
liquidCapacity = 80f * 5;
ambientSound = Sounds.techloop;
ambientSoundVolume = 0.07f;
outputItem = new ItemStack(Items.phaseFabric, 1);
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawCircles(){{
color = Color.valueOf("ffc073").a(0.24f);
strokeMax = 2.5f;
radius = 10f;
amount = 3;
}}, new DrawLiquidRegion(Liquids.slag), new DrawBlock(), new DrawHeatInput(), new DrawHeatRegion(){{
heatColor = Color.valueOf("ff6060ff");
}}, new DrawHeatRegion("-vents"){{
heatColor.a = 1f;
}});
iconOverride = new String[]{"-bottom", ""};
consumes.items(with(Items.thorium, 1, Items.sand, 4));
consumes.liquid(Liquids.ozone, 4f / 60f);
consumes.power(10f);
}};
//TODO needs to be completely redone from the ground up
cellSynthesisChamber = new LiquidConverter("cell-synthesis-chamber"){{
//TODO booster mechanics?
@@ -2641,6 +2678,13 @@ public class Blocks implements ContentList{
limitRange();
}};
//TODO bad name
if(false)
sublimate = new ContinuousTurret("sublimate"){{
//TODO requirements
requirements(Category.turret, with(Items.tungsten, 35, Items.silicon, 35), true);
}};
//endregion
//region units

View File

@@ -1687,17 +1687,22 @@ public class Fx{
generatespark = new Effect(18, e -> {
randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> {
float len = e.fout() * 4f;
color(Pal.orangeSpark, Color.gray, e.fin());
Fill.circle(e.x + x, e.y + y, len/2f);
Fill.circle(e.x + x, e.y + y, e.fout() * 4f /2f);
});
}),
fuelburn = new Effect(23, e -> {
randLenVectors(e.id, 5, e.fin() * 9f, (x, y) -> {
float len = e.fout() * 4f;
color(Color.lightGray, Color.gray, e.fin());
Fill.circle(e.x + x, e.y + y, len/2f);
Fill.circle(e.x + x, e.y + y, e.fout() * 2f);
});
}),
incinerateSlag = new Effect(34, e -> {
randLenVectors(e.id, 4, e.finpow() * 5f, (x, y) -> {
color(Pal.slagOrange, Color.gray, e.fin());
Fill.circle(e.x + x, e.y + y, e.fout() * 1.7f);
});
}),

View File

@@ -0,0 +1,68 @@
package mindustry.world.blocks.production;
import arc.graphics.g2d.*;
import arc.math.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.meta.*;
/** Incinerator that accepts only items and optionally requires a liquid, e.g. slag. */
public class ItemIncinerator extends Block{
public Effect effect = Fx.incinerateSlag;
public float effectChance = 0.2f;
public @Load("@-liquid") TextureRegion liquidRegion;
public @Load("@-top") TextureRegion topRegion;
public ItemIncinerator(String name){
super(name);
update = true;
solid = true;
}
@Override
public TextureRegion[] icons(){
return new TextureRegion[]{region, topRegion};
}
public class ItemIncineratorBuild extends Building{
@Override
public void updateTile(){
}
@Override
public BlockStatus status(){
return consValid() ? BlockStatus.active : BlockStatus.noInput;
}
@Override
public void draw(){
super.draw();
if(liquidRegion.found()){
Drawf.liquid(liquidRegion, x, y, liquids.currentAmount() / liquidCapacity, liquids.current().color);
}
if(topRegion.found()){
Draw.rect(topRegion, x, y);
}
}
@Override
public void handleItem(Building source, Item item){
if(Mathf.chance(effectChance)){
effect.at(x, y);
}
}
@Override
public boolean acceptItem(Building source, Item item){
return consValid();
}
}
}