Slag centrifuge implementation
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user