Slag centrifuge implementation

This commit is contained in:
Anuken 2021-11-21 11:59:35 -05:00
parent 4fcd873f65
commit 0014c7a525
18 changed files with 44 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 508 B

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 B

After

Width:  |  Height:  |  Size: 518 B

View File

@ -453,3 +453,4 @@
63253=cyanogen-synthesizer|block-cyanogen-synthesizer-ui
63252=cyanogen|liquid-cyanogen-ui
63251=gallium|liquid-gallium-ui
63250=slag-centrifuge|block-slag-centrifuge-ui

Binary file not shown.

View File

@ -1039,20 +1039,37 @@ public class Blocks implements ContentList{
}};
//TODO implement - is this even necessary?
if(false)
slagCentrifuge = new GenericCrafter("slag-centrifuge"){{
requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 60, Items.oxide, 40));
consumes.power(2f / 60f);
size = 3;
consumes.item(Items.sand, 1);
consumes.liquid(Liquids.slag, 40f / 60f);
liquidCapacity = 80f;
consumes.liquid(Liquids.slag, 40f / 60f);
outputLiquid = new LiquidStack(Liquids.gallium, 1f);
var drawers = Seq.with(new DrawRegion("-bottom"), new DrawLiquidRegion(Liquids.slag){{ alpha = 0.7f; }});
for(int i = 0; i < 5; i++){
int fi = i;
drawers.add(new DrawGlowRegion(-1f){{
glowIntensity = 0.3f;
rotateSpeed = 3f / (1f + fi/1.4f);
alpha = 0.4f;
color = new Color(1f, 0.5f, 0.5f, 1f);
}});
}
drawer = new DrawMulti(drawers.and(new DrawBlock()));
iconOverride = new String[]{"-bottom", ""};
craftTime = 60f * 2f;
outputLiquid = new LiquidStack(Liquids.gallium, 2f);
outputItem = new ItemStack(Items.scrap, 1);
}};
//TODO "crucible" is getting old
//TODO should have a useful turret ammo byproduct?
//original: consumes.items(with(Items.copper, 3, Items.lead, 4, Items.titanium, 2, Items.silicon, 3));
surgeCrucible = new HeatCrafter("surge-crucible"){{
@ -1107,6 +1124,8 @@ public class Blocks implements ContentList{
particleLife = 140f;
}});
iconOverride = new String[]{"-bottom", "", "-top"};
size = 3;
outputLiquid = new LiquidStack(Liquids.cyanogen, 3f);

View File

@ -38,7 +38,7 @@ public class BeamDrill extends Block{
public Color sparkColor = Color.valueOf("fd9e81"), glowColor = Color.white;
public float glowIntensity = 0.2f, pulseIntensity = 0.07f;
public float glowScl = 3f;
public int sparks = 8;
public int sparks = 7;
public float sparkRange = 10f, sparkLife = 27f, sparkRecurrence = 4f, sparkSpread = 45f, sparkSize = 3.5f;
public Color heatColor = new Color(1f, 0.35f, 0.35f, 0.9f);

View File

@ -15,20 +15,28 @@ public class DrawGlowRegion extends DrawBlock{
public Blending blending = Blending.additive;
public String suffix = "-glow";
public float alpha = 0.9f, glowScale = 10f, glowIntensity = 0.5f;
public float rotateSpeed = 0f;
public float layer = Layer.blockAdditive;
public Color color = Color.red.cpy();
public TextureRegion top;
public TextureRegion region;
public DrawGlowRegion(){
}
public DrawGlowRegion(float layer){
this.layer = layer;
}
@Override
public void drawBase(Building build){
if(build.warmup() <= 0.001f) return;
float z = Draw.z();
Draw.z(layer);
if(layer > 0) Draw.z(layer);
Draw.blend(blending);
Draw.color(color);
Draw.alpha((Mathf.absin(build.totalProgress(), glowScale, alpha) * glowIntensity + 1f - glowIntensity) * build.warmup() * alpha);
Draw.rect(top, build.x, build.y);
Draw.rect(region, build.x, build.y, build.totalProgress() * rotateSpeed);
Draw.reset();
Draw.blend();
Draw.z(z);
@ -36,7 +44,7 @@ public class DrawGlowRegion extends DrawBlock{
@Override
public void load(Block block){
top = Core.atlas.find(block.name + suffix);
region = Core.atlas.find(block.name + suffix);
}
@Override

View File

@ -14,6 +14,7 @@ public class DrawLiquidRegion extends DrawBlock{
public Liquid drawLiquid;
public TextureRegion liquid;
public String suffix = "-liquid";
public float alpha = 1f;
public DrawLiquidRegion(Liquid drawLiquid){
this.drawLiquid = drawLiquid;
@ -31,7 +32,7 @@ public class DrawLiquidRegion extends DrawBlock{
Liquid drawn = drawLiquid != null ? drawLiquid : build.liquids.current();
Drawf.liquid(liquid, build.x, build.y,
build.liquids.get(drawn) / build.block.liquidCapacity,
drawn.color
Tmp.c1.set(drawn.color).a(drawn.color.a * alpha)
);
}

View File

@ -1,6 +1,7 @@
package mindustry.world.draw;
import arc.graphics.g2d.*;
import arc.struct.*;
import arc.util.*;
import mindustry.entities.units.*;
import mindustry.gen.*;
@ -19,6 +20,10 @@ public class DrawMulti extends DrawBlock{
this.drawers = drawers;
}
public DrawMulti(Seq<DrawBlock> drawers){
this.drawers = drawers.toArray(DrawBlock.class);
}
@Override
public void drawBase(Building build){
for(var draw : drawers){