Cyanogen synthesis retexture
This commit is contained in:
@@ -8,8 +8,9 @@ import arc.util.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
//TODO make non-standalone?
|
||||
public class DrawArcSmelter extends DrawBlock{
|
||||
public TextureRegion top, bottom;
|
||||
public TextureRegion bottom;
|
||||
public Color flameColor = Color.valueOf("f58349"), midColor = Color.valueOf("f2d585");
|
||||
public float flameRad = 1f, circleSpace = 2f, flameRadiusScl = 3f, flameRadiusMag = 0.3f, circleStroke = 1.5f;
|
||||
|
||||
@@ -17,7 +18,7 @@ public class DrawArcSmelter extends DrawBlock{
|
||||
public int particles = 25;
|
||||
public float particleLife = 40f, particleRad = 7f, particleStroke = 1.1f, particleLen = 3f;
|
||||
public boolean drawCenter = true;
|
||||
public boolean drawBottom = true, drawTop = true, drawRegion = true;
|
||||
public boolean drawBottom = true, drawRegion = true;
|
||||
public Blending blending = Blending.additive;
|
||||
|
||||
@Override
|
||||
@@ -53,17 +54,15 @@ public class DrawArcSmelter extends DrawBlock{
|
||||
}
|
||||
|
||||
if(drawRegion) Draw.rect(build.block.region, build.x, build.y);
|
||||
if(drawTop && top.found()) Draw.rect(top, build.x, build.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(Block block){
|
||||
top = Core.atlas.find(block.name + "-top");
|
||||
bottom = Core.atlas.find(block.name + "-bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureRegion[] icons(Block block){
|
||||
return new TextureRegion[]{bottom, block.region, top};
|
||||
return new TextureRegion[]{bottom, block.region};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public class DrawBubbles extends DrawBlock{
|
||||
public int amount = 12, sides = 8;
|
||||
public float strokeMin = 0.2f, spread = 3f, timeScl = 30f;
|
||||
public float recurrence = 6f, radius = 3f;
|
||||
public boolean fill = false;
|
||||
|
||||
public DrawBubbles(Color color){
|
||||
this.color = color;
|
||||
@@ -37,8 +38,13 @@ public class DrawBubbles extends DrawBlock{
|
||||
float life = 1f - ((Time.time / timeScl + rand.random(recurrence)) % recurrence);
|
||||
|
||||
if(life > 0){
|
||||
Lines.stroke(build.warmup() * (life + strokeMin));
|
||||
Lines.poly(build.x + x, build.y + y, sides, (1f - life) * radius);
|
||||
float rad = (1f - life) * radius;
|
||||
if(fill){
|
||||
Fill.circle(build.x + x, build.y + y, rad);
|
||||
}else{
|
||||
Lines.stroke(build.warmup() * (life + strokeMin));
|
||||
Lines.poly(build.x + x, build.y + y, sides, rad);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package mindustry.world.draw;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.math.Interp.*;
|
||||
import arc.util.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
public class DrawCrucible extends DrawBlock{
|
||||
public TextureRegion top, bottom;
|
||||
public Color flameColor = Color.valueOf("f58349"), midColor = Color.valueOf("f2d585");
|
||||
public float flameRad = 1f, circleSpace = 2f, flameRadiusScl = 10f, flameRadiusMag = 0.6f, circleStroke = 1.5f;
|
||||
|
||||
@@ -21,7 +20,6 @@ public class DrawCrucible extends DrawBlock{
|
||||
|
||||
@Override
|
||||
public void drawBase(Building build){
|
||||
Draw.rect(bottom, build.x, build.y);
|
||||
|
||||
if(build.warmup() > 0f && flameColor.a > 0.001f){
|
||||
Lines.stroke(circleStroke * build.warmup());
|
||||
@@ -53,19 +51,8 @@ public class DrawCrucible extends DrawBlock{
|
||||
Draw.blend();
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
Draw.rect(build.block.region, build.x, build.y);
|
||||
if(top.found()) Draw.rect(top, build.x, build.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(Block block){
|
||||
top = Core.atlas.find(block.name + "-top");
|
||||
bottom = Core.atlas.find(block.name + "-bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureRegion[] icons(Block block){
|
||||
return new TextureRegion[]{bottom, block.region, top};
|
||||
}
|
||||
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ import mindustry.world.blocks.production.HeatCrafter.*;
|
||||
|
||||
/** Not standalone. */
|
||||
public class DrawHeatRegion extends DrawBlock{
|
||||
public Color heatColor = new Color(1f, 0.22f, 0.22f, 0.8f);
|
||||
public float heatPulse = 0.3f, heatPulseScl = 10f;
|
||||
public Color color = new Color(1f, 0.22f, 0.22f, 0.8f);
|
||||
public float pulse = 0.3f, pulseScl = 10f;
|
||||
|
||||
public TextureRegion heat;
|
||||
public String suffix = "-glow";
|
||||
@@ -30,7 +30,7 @@ public class DrawHeatRegion extends DrawBlock{
|
||||
Draw.z(Layer.blockAdditive);
|
||||
if(build instanceof HeatCrafterBuild hc && hc.heat > 0){
|
||||
Draw.blend(Blending.additive);
|
||||
Draw.color(heatColor, Mathf.clamp(hc.heat / hc.heatRequirement()) * (heatColor.a * (1f - heatPulse + Mathf.absin(heatPulseScl, heatPulse))));
|
||||
Draw.color(color, Mathf.clamp(hc.heat / hc.heatRequirement()) * (color.a * (1f - pulse + Mathf.absin(pulseScl, pulse))));
|
||||
Draw.rect(heat, build.x, build.y);
|
||||
Draw.blend();
|
||||
Draw.color();
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package mindustry.world.draw;
|
||||
|
||||
import arc.util.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.liquid.*;
|
||||
|
||||
/** Not standalone. */
|
||||
public class DrawLiquidTile extends DrawBlock{
|
||||
public Liquid drawLiquid;
|
||||
public float padding;
|
||||
public float alpha = 1f;
|
||||
|
||||
public DrawLiquidTile(Liquid drawLiquid, float padding){
|
||||
this.drawLiquid = drawLiquid;
|
||||
this.padding = padding;
|
||||
}
|
||||
|
||||
public DrawLiquidTile(Liquid drawLiquid){
|
||||
this.drawLiquid = drawLiquid;
|
||||
}
|
||||
|
||||
public DrawLiquidTile(){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){}
|
||||
|
||||
@Override
|
||||
public void drawBase(Building build){
|
||||
Liquid drawn = drawLiquid != null ? drawLiquid : build.liquids.current();
|
||||
LiquidBlock.drawTiledFrames(build.block.size, build.x, build.y, padding, drawn, build.liquids.get(drawn) / build.block.liquidCapacity * alpha);
|
||||
}
|
||||
}
|
||||
+5
-2
@@ -8,12 +8,13 @@ import arc.util.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
/** Not standalone. */
|
||||
public class DrawParticlesIn extends DrawBlock{
|
||||
public class DrawParticles extends DrawBlock{
|
||||
public Color color = Color.valueOf("f2d585");
|
||||
|
||||
public float alpha = 0.5f;
|
||||
public int particles = 30;
|
||||
public float particleLife = 70f, particleRad = 7f, particleSize = 3f, fadeMargin = 0.4f, rotateScl = 3f;
|
||||
public boolean reverse = false;
|
||||
public Interp particleInterp = new PowIn(1.5f);
|
||||
public Interp particleSizeInterp = Interp.slope;
|
||||
public Blending blending = Blending.normal;
|
||||
@@ -30,7 +31,9 @@ public class DrawParticlesIn extends DrawBlock{
|
||||
float base = (Time.time / particleLife);
|
||||
rand.setSeed(build.id);
|
||||
for(int i = 0; i < particles; i++){
|
||||
float fin = (rand.random(1f) + base) % 1f, fout = 1f - fin;
|
||||
float fin = (rand.random(2f) + base) % 1f;
|
||||
if(reverse) fin = 1f - fin;
|
||||
float fout = 1f - fin;
|
||||
float angle = rand.random(360f) + (Time.time / rotateScl) % 360f;
|
||||
float len = particleRad * particleInterp.apply(fout);
|
||||
Draw.alpha(a * (1f - Mathf.curve(fin, 1f - fadeMargin)));
|
||||
Reference in New Issue
Block a user