Cyanogen synthesis retexture
|
Before Width: | Height: | Size: 177 B |
|
Before Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 257 B |
|
Before Width: | Height: | Size: 242 B |
|
After Width: | Height: | Size: 462 B |
|
After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 326 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 258 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 233 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 410 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 467 B |
|
Before Width: | Height: | Size: 442 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 159 B |
|
Before Width: | Height: | Size: 756 B After Width: | Height: | Size: 1.1 KiB |
@@ -810,7 +810,7 @@ bar.capacity = Capacity: {0}
|
|||||||
bar.unitcap = {0} {1}/{2}
|
bar.unitcap = {0} {1}/{2}
|
||||||
bar.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
bar.heat = Heat
|
bar.heat = Heat
|
||||||
bar.heatpercent = Heat: {0}
|
bar.heatpercent = Heat: {0} ({1}%)
|
||||||
bar.power = Power
|
bar.power = Power
|
||||||
bar.progress = Build Progress
|
bar.progress = Build Progress
|
||||||
bar.input = Input
|
bar.input = Input
|
||||||
|
|||||||
@@ -461,3 +461,4 @@
|
|||||||
63245=reinforced-container|block-reinforced-container-ui
|
63245=reinforced-container|block-reinforced-container-ui
|
||||||
63244=reinforced-vault|block-reinforced-vault-ui
|
63244=reinforced-vault|block-reinforced-vault-ui
|
||||||
63243=nitrogen|liquid-nitrogen-ui
|
63243=nitrogen|liquid-nitrogen-ui
|
||||||
|
63242=atmospheric-concentrator|block-atmospheric-concentrator-ui
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package mindustry.content;
|
package mindustry.content;
|
||||||
|
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
|
import arc.math.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import mindustry.*;
|
import mindustry.*;
|
||||||
import mindustry.ctype.*;
|
import mindustry.ctype.*;
|
||||||
@@ -965,7 +966,7 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
drawer = new DrawMulti(
|
drawer = new DrawMulti(
|
||||||
new DrawRegion("-bottom"),
|
new DrawRegion("-bottom"),
|
||||||
new DrawLiquidRegion(Liquids.water),
|
new DrawLiquidTile(Liquids.water, 2f),
|
||||||
new DrawBubbles(Color.valueOf("7693e3")){{
|
new DrawBubbles(Color.valueOf("7693e3")){{
|
||||||
sides = 10;
|
sides = 10;
|
||||||
recurrence = 3f;
|
recurrence = 3f;
|
||||||
@@ -975,7 +976,6 @@ public class Blocks implements ContentList{
|
|||||||
}},
|
}},
|
||||||
new DrawRegion(),
|
new DrawRegion(),
|
||||||
new DrawLiquidOutputs(),
|
new DrawLiquidOutputs(),
|
||||||
new DrawRegion("-top"),
|
|
||||||
new DrawGlowRegion(){{
|
new DrawGlowRegion(){{
|
||||||
alpha = 0.7f;
|
alpha = 0.7f;
|
||||||
color = Color.valueOf("c4bdf3");
|
color = Color.valueOf("c4bdf3");
|
||||||
@@ -984,23 +984,33 @@ public class Blocks implements ContentList{
|
|||||||
}}
|
}}
|
||||||
);
|
);
|
||||||
|
|
||||||
iconOverride = new String[]{"-bottom", "", "-top"};
|
iconOverride = new String[]{"-bottom", ""};
|
||||||
outputLiquids = LiquidStack.with(Liquids.ozone, 2f * craftTime / 60, Liquids.hydrogen, 3f * craftTime / 60);
|
outputLiquids = LiquidStack.with(Liquids.ozone, 2f * craftTime / 60, Liquids.hydrogen, 3f * craftTime / 60);
|
||||||
liquidOutputDirections = new int[]{1, 3};
|
liquidOutputDirections = new int[]{1, 3};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
if(false)
|
|
||||||
atmosphericConcentrator = new HeatCrafter("atmospheric-concentrator"){{
|
atmosphericConcentrator = new HeatCrafter("atmospheric-concentrator"){{
|
||||||
requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 30));
|
requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 30));
|
||||||
size = 3;
|
size = 3;
|
||||||
craftTime = 60f;
|
craftTime = 10f;
|
||||||
|
hasLiquids = true;
|
||||||
|
|
||||||
liquidCapacity = 50f;
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.nitrogen, 4.1f), new DrawBlock(), new DrawHeatInput(),
|
||||||
|
new DrawParticles(){{
|
||||||
|
color = Color.valueOf("d4f0ff");
|
||||||
|
alpha = 0.6f;
|
||||||
|
particleSize = 4f;
|
||||||
|
particles = 10;
|
||||||
|
particleRad = 12f;
|
||||||
|
particleLife = 140f;
|
||||||
|
}});
|
||||||
|
|
||||||
|
liquidCapacity = 40f;
|
||||||
consumes.power(2f);
|
consumes.power(2f);
|
||||||
|
|
||||||
heatRequirement = 5f;
|
heatRequirement = 5f;
|
||||||
|
|
||||||
outputLiquid = new LiquidStack(Liquids.nitrogen, 4f / 60f);
|
outputLiquid = new LiquidStack(Liquids.nitrogen, 4f * craftTime / 60f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
oxidationChamber = new HeatProducer("oxidation-chamber"){{
|
oxidationChamber = new HeatProducer("oxidation-chamber"){{
|
||||||
@@ -1016,8 +1026,8 @@ public class Blocks implements ContentList{
|
|||||||
rotateDraw = false;
|
rotateDraw = false;
|
||||||
|
|
||||||
//TODO vent?
|
//TODO vent?
|
||||||
iconOverride = new String[]{"-bottom", "", "-top1", "-glass"};
|
iconOverride = new String[]{"-bottom", "", "-top1"};
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidRegion(), new DrawBlock(), new DrawHeatOutput(), new DrawRegion("-glass"));
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidRegion(), new DrawBlock(), new DrawHeatOutput());
|
||||||
|
|
||||||
craftTime = 60f * 3f;
|
craftTime = 60f * 3f;
|
||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
@@ -1027,8 +1037,8 @@ public class Blocks implements ContentList{
|
|||||||
slagHeater = new HeatProducer("slag-heater"){{
|
slagHeater = new HeatProducer("slag-heater"){{
|
||||||
requirements(Category.crafting, with(Items.tungsten, 30, Items.graphite, 30));
|
requirements(Category.crafting, with(Items.tungsten, 30, Items.graphite, 30));
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidRegion(Liquids.slag), new DrawRegion("-top"), new DrawHeatOutput(true));
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.slag, 9f), new DrawHeatOutput(true));
|
||||||
iconOverride = new String[]{"-bottom", "", "-top"};
|
iconOverride = new String[]{"-bottom", ""};
|
||||||
size = 2;
|
size = 2;
|
||||||
craftTime = 60f * 1f;
|
craftTime = 60f * 1f;
|
||||||
heatOutput = 2f;
|
heatOutput = 2f;
|
||||||
@@ -1043,13 +1053,16 @@ public class Blocks implements ContentList{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
heatReactor = new HeatProducer("heat-reactor"){{
|
heatReactor = new HeatProducer("heat-reactor"){{
|
||||||
//TODO quadvent?
|
//TODO gas/liquid requirement?
|
||||||
//TODO coolant?
|
|
||||||
//TODO extra output, should have other uses
|
|
||||||
requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 30));
|
requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 30));
|
||||||
size = 3;
|
size = 3;
|
||||||
craftTime = 60f * 10f;
|
craftTime = 60f * 10f;
|
||||||
consumes.item(Items.fissileMatter, 1);
|
|
||||||
|
craftEffect = new RadialEffect(Fx.heatReactorSmoke, 4, 90f, 7f);
|
||||||
|
|
||||||
|
itemCapacity = 20;
|
||||||
|
consumes.item(Items.thorium, 2);
|
||||||
|
outputItem = new ItemStack(Items.fissileMatter, 1);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
carbideCrucible = new HeatCrafter("carbide-crucible"){{
|
carbideCrucible = new HeatCrafter("carbide-crucible"){{
|
||||||
@@ -1060,7 +1073,8 @@ public class Blocks implements ContentList{
|
|||||||
size = 3;
|
size = 3;
|
||||||
itemCapacity = 20;
|
itemCapacity = 20;
|
||||||
hasPower = hasItems = true;
|
hasPower = hasItems = true;
|
||||||
drawer = new DrawMulti(new DrawCrucible(), new DrawHeatInput());
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawCrucible(), new DrawBlock(), new DrawHeatInput());
|
||||||
|
iconOverride = new String[]{"-bottom", ""};
|
||||||
ambientSound = Sounds.smelter;
|
ambientSound = Sounds.smelter;
|
||||||
ambientSoundVolume = 0.07f;
|
ambientSoundVolume = 0.07f;
|
||||||
|
|
||||||
@@ -1127,10 +1141,10 @@ public class Blocks implements ContentList{
|
|||||||
amount = 3;
|
amount = 3;
|
||||||
}}, new DrawLiquidRegion(Liquids.slag), new DrawBlock(), new DrawHeatInput(),
|
}}, new DrawLiquidRegion(Liquids.slag), new DrawBlock(), new DrawHeatInput(),
|
||||||
new DrawHeatRegion(){{
|
new DrawHeatRegion(){{
|
||||||
heatColor = Color.valueOf("ff6060ff");
|
color = Color.valueOf("ff6060ff");
|
||||||
}},
|
}},
|
||||||
new DrawHeatRegion("-vents"){{
|
new DrawHeatRegion("-vents"){{
|
||||||
heatColor.a = 1f;
|
color.a = 1f;
|
||||||
}});
|
}});
|
||||||
iconOverride = new String[]{"-bottom", ""};
|
iconOverride = new String[]{"-bottom", ""};
|
||||||
|
|
||||||
@@ -1147,17 +1161,19 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
heatRequirement = 5f;
|
heatRequirement = 5f;
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidRegion(Liquids.hydrogen), new DrawBlock(), new DrawRegion("-top"), new DrawHeatInput(),
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.cyanogen),
|
||||||
new DrawParticlesIn(){{
|
new DrawParticles(){{
|
||||||
color = Color.valueOf("d4f0ff");
|
color = Color.valueOf("89e8b6");
|
||||||
alpha = 0.6f;
|
alpha = 0.5f;
|
||||||
particleSize = 4f;
|
particleSize = 3f;
|
||||||
particles = 10;
|
particles = 10;
|
||||||
particleRad = 12f;
|
particleRad = 9f;
|
||||||
particleLife = 140f;
|
particleLife = 200f;
|
||||||
}});
|
reverse = true;
|
||||||
|
particleSizeInterp = Interp.one;
|
||||||
|
}}, new DrawBlock(), new DrawHeatInput(), new DrawHeatRegion("-heat-top"));
|
||||||
|
|
||||||
iconOverride = new String[]{"-bottom", "", "-top"};
|
iconOverride = new String[]{"-bottom", ""};
|
||||||
|
|
||||||
size = 3;
|
size = 3;
|
||||||
|
|
||||||
@@ -1165,7 +1181,7 @@ public class Blocks implements ContentList{
|
|||||||
outputLiquid = new LiquidStack(Liquids.cyanogen, 3f);
|
outputLiquid = new LiquidStack(Liquids.cyanogen, 3f);
|
||||||
craftTime = 60f * 1f;
|
craftTime = 60f * 1f;
|
||||||
|
|
||||||
consumes.liquid(Liquids.hydrogen, 3f / 60f);
|
consumes.liquids(LiquidStack.with(Liquids.hydrogen, 3f / 60f, Liquids.nitrogen, 2f / 60f));
|
||||||
consumes.item(Items.graphite);
|
consumes.item(Items.graphite);
|
||||||
consumes.power(2f);
|
consumes.power(2f);
|
||||||
}};
|
}};
|
||||||
@@ -1196,7 +1212,7 @@ public class Blocks implements ContentList{
|
|||||||
}}, new DrawMultiWeave(){{
|
}}, new DrawMultiWeave(){{
|
||||||
glowColor = new Color(1f, 0.4f, 0.4f, 0.8f);
|
glowColor = new Color(1f, 0.4f, 0.4f, 0.8f);
|
||||||
}}, new DrawBlock(), new DrawHeatInput(), new DrawHeatRegion("-vents"){{
|
}}, new DrawBlock(), new DrawHeatInput(), new DrawHeatRegion("-vents"){{
|
||||||
heatColor = new Color(1f, 0.4f, 0.3f, 1f);
|
color = new Color(1f, 0.4f, 0.3f, 1f);
|
||||||
}});
|
}});
|
||||||
iconOverride = new String[]{"-bottom", "-weave", ""};
|
iconOverride = new String[]{"-bottom", "-weave", ""};
|
||||||
|
|
||||||
|
|||||||
@@ -1368,6 +1368,21 @@ public class Fx{
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
heatReactorSmoke = new Effect(180f, e -> {
|
||||||
|
color(Color.gray);
|
||||||
|
|
||||||
|
rand.setSeed(e.id);
|
||||||
|
for(int i = 0; i < 5; i++){
|
||||||
|
float len = rand.random(6f), rot = rand.range(50f) + e.rotation;
|
||||||
|
|
||||||
|
e.scaled(e.lifetime * rand.random(0.3f, 1f), b -> {
|
||||||
|
alpha(0.9f * b.fout());
|
||||||
|
v.trns(rot, len * b.finpow());
|
||||||
|
Fill.circle(e.x + v.x, e.y + v.y, 2.4f * b.fin() + 0.6f);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
berylSpark = new Effect(21f, e -> {
|
berylSpark = new Effect(21f, e -> {
|
||||||
color(Color.white, Pal.berylShot, e.fin());
|
color(Color.white, Pal.berylShot, e.fin());
|
||||||
stroke(e.fout() * 1.1f + 0.5f);
|
stroke(e.fout() * 1.1f + 0.5f);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class Renderer implements ApplicationListener{
|
|||||||
public Seq<EnvRenderer> envRenderers = new Seq<>();
|
public Seq<EnvRenderer> envRenderers = new Seq<>();
|
||||||
public ObjectMap<String, Runnable> customBackgrounds = new ObjectMap<>();
|
public ObjectMap<String, Runnable> customBackgrounds = new ObjectMap<>();
|
||||||
public TextureRegion[] bubbles = new TextureRegion[16], splashes = new TextureRegion[12];
|
public TextureRegion[] bubbles = new TextureRegion[16], splashes = new TextureRegion[12];
|
||||||
public TextureRegion[][] fluidFrames = new TextureRegion[2][Liquid.animationFrames];
|
public TextureRegion[][] fluidFrames;
|
||||||
|
|
||||||
private @Nullable CoreBuild landCore;
|
private @Nullable CoreBuild landCore;
|
||||||
private @Nullable CoreBlock launchCoreType;
|
private @Nullable CoreBlock launchCoreType;
|
||||||
@@ -113,14 +113,7 @@ public class Renderer implements ApplicationListener{
|
|||||||
for(int i = 0; i < bubbles.length; i++) bubbles[i] = atlas.find("bubble-" + i);
|
for(int i = 0; i < bubbles.length; i++) bubbles[i] = atlas.find("bubble-" + i);
|
||||||
for(int i = 0; i < splashes.length; i++) splashes[i] = atlas.find("splash-" + i);
|
for(int i = 0; i < splashes.length; i++) splashes[i] = atlas.find("splash-" + i);
|
||||||
|
|
||||||
String[] fluidTypes = {"liquid", "gas"};
|
loadFluidFrames();
|
||||||
|
|
||||||
for(int i = 0; i < fluidTypes.length; i++){
|
|
||||||
|
|
||||||
for(int j = 0; j < Liquid.animationFrames; j++){
|
|
||||||
fluidFrames[i][j] = atlas.find("fluid-" + fluidTypes[i] + "-" + j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assets.load("sprites/clouds.png", Texture.class).loaded = t -> {
|
assets.load("sprites/clouds.png", Texture.class).loaded = t -> {
|
||||||
t.setWrap(TextureWrap.repeat);
|
t.setWrap(TextureWrap.repeat);
|
||||||
@@ -136,6 +129,26 @@ public class Renderer implements ApplicationListener{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void loadFluidFrames(){
|
||||||
|
if(fluidFrames != null) return;
|
||||||
|
|
||||||
|
fluidFrames = new TextureRegion[2][Liquid.animationFrames];
|
||||||
|
|
||||||
|
String[] fluidTypes = {"liquid", "gas"};
|
||||||
|
|
||||||
|
for(int i = 0; i < fluidTypes.length; i++){
|
||||||
|
|
||||||
|
for(int j = 0; j < Liquid.animationFrames; j++){
|
||||||
|
fluidFrames[i][j] = atlas.find("fluid-" + fluidTypes[i] + "-" + j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextureRegion[][] getFluidFrames(){
|
||||||
|
loadFluidFrames();
|
||||||
|
return fluidFrames;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
Color.white.set(1f, 1f, 1f, 1f);
|
Color.white.set(1f, 1f, 1f, 1f);
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ import static mindustry.Vars.*;
|
|||||||
import static mindustry.type.Liquid.*;
|
import static mindustry.type.Liquid.*;
|
||||||
|
|
||||||
public class Conduit extends LiquidBlock implements Autotiler{
|
public class Conduit extends LiquidBlock implements Autotiler{
|
||||||
|
static final float rotatePad = 6, hpad = rotatePad / 2f / 4f;
|
||||||
|
static final float[][] rotateOffsets = {{hpad, hpad}, {-hpad, hpad}, {-hpad, -hpad}, {hpad, -hpad}};
|
||||||
|
|
||||||
public final int timerFlow = timers++;
|
public final int timerFlow = timers++;
|
||||||
|
|
||||||
public Color botColor = Color.valueOf("565656");
|
public Color botColor = Color.valueOf("565656");
|
||||||
@@ -31,8 +34,8 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
|||||||
public @Load(value = "@-bottom-#", length = 5, fallback = "conduit-bottom-#") TextureRegion[] botRegions;
|
public @Load(value = "@-bottom-#", length = 5, fallback = "conduit-bottom-#") TextureRegion[] botRegions;
|
||||||
public @Load("@-cap") TextureRegion capRegion;
|
public @Load("@-cap") TextureRegion capRegion;
|
||||||
|
|
||||||
public @Load(value = "conduit-liquid-r#1-gas-#2", lengths = {4, animationFrames}) TextureRegion[][] rotateGasRegions;
|
/** indices: [rotation] [fluid type] [frame] */
|
||||||
public @Load(value = "conduit-liquid-r#1-liquid-#2", lengths = {4, animationFrames}) TextureRegion[][] rotateLiquidRegions;
|
public TextureRegion[][][] rotateRegions;
|
||||||
|
|
||||||
public boolean leaks = true;
|
public boolean leaks = true;
|
||||||
public @Nullable Block junctionReplacement, bridgeReplacement, rotBridgeReplacement;
|
public @Nullable Block junctionReplacement, bridgeReplacement, rotBridgeReplacement;
|
||||||
@@ -55,6 +58,44 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
|||||||
if(bridgeReplacement == null || !(bridgeReplacement instanceof ItemBridge)) bridgeReplacement = Blocks.bridgeConduit;
|
if(bridgeReplacement == null || !(bridgeReplacement instanceof ItemBridge)) bridgeReplacement = Blocks.bridgeConduit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void load(){
|
||||||
|
super.load();
|
||||||
|
|
||||||
|
rotateRegions = new TextureRegion[4][2][animationFrames];
|
||||||
|
|
||||||
|
if(renderer != null){
|
||||||
|
float pad = rotatePad;
|
||||||
|
var frames = renderer.getFluidFrames();
|
||||||
|
|
||||||
|
for(int rot = 0; rot < 4; rot++){
|
||||||
|
for(int fluid = 0; fluid < 2; fluid++){
|
||||||
|
for(int frame = 0; frame < animationFrames; frame++){
|
||||||
|
TextureRegion base = frames[fluid][frame];
|
||||||
|
TextureRegion result = new TextureRegion();
|
||||||
|
result.set(base);
|
||||||
|
|
||||||
|
if(rot == 0){
|
||||||
|
result.setX(result.getX() + pad);
|
||||||
|
result.setHeight(result.height - pad);
|
||||||
|
}else if(rot == 1){
|
||||||
|
result.setWidth(result.width - pad);
|
||||||
|
result.setHeight(result.height - pad);
|
||||||
|
}else if(rot == 2){
|
||||||
|
result.setWidth(result.width - pad);
|
||||||
|
result.setY(result.getY() + pad);
|
||||||
|
}else{
|
||||||
|
result.setX(result.getX() + pad);
|
||||||
|
result.setY(result.getY() + pad);
|
||||||
|
}
|
||||||
|
|
||||||
|
rotateRegions[rot][fluid][frame] = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawRequestRegion(BuildPlan plan, Eachable<BuildPlan> list){
|
public void drawRequestRegion(BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
int[] bits = getTiling(plan, list);
|
int[] bits = getTiling(plan, list);
|
||||||
@@ -138,17 +179,21 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
|||||||
|
|
||||||
int offset = yscl == -1 ? 3 : 0;
|
int offset = yscl == -1 ? 3 : 0;
|
||||||
|
|
||||||
//TODO move out of conduit
|
|
||||||
int frame = liquids.current().getAnimationFrame();
|
int frame = liquids.current().getAnimationFrame();
|
||||||
TextureRegion liquidr =
|
int gas = liquids.current().gas ? 1 : 0;
|
||||||
liquids.current().gas ?
|
float ox = 0f, oy = 0f;
|
||||||
(bits == 1 ? rotateGasRegions[(rotation + offset) % 4][frame] : renderer.fluidFrames[1][frame]) :
|
int wrapRot = (rotation + offset) % 4;
|
||||||
(bits == 1 ? rotateLiquidRegions[(rotation + offset) % 4][frame] : renderer.fluidFrames[0][frame]);
|
TextureRegion liquidr = bits == 1 ? rotateRegions[wrapRot][gas][frame] : renderer.fluidFrames[gas][frame];
|
||||||
|
|
||||||
|
if(bits == 1){
|
||||||
|
ox = rotateOffsets[wrapRot][0];
|
||||||
|
oy = rotateOffsets[wrapRot][1];
|
||||||
|
}
|
||||||
|
|
||||||
//the drawing state machine sure was a great design choice with no downsides or hidden behavior!!!
|
//the drawing state machine sure was a great design choice with no downsides or hidden behavior!!!
|
||||||
float xscl = Draw.xscl, yscl = Draw.yscl;
|
float xscl = Draw.xscl, yscl = Draw.yscl;
|
||||||
Draw.scl(1f, 1f);
|
Draw.scl(1f, 1f);
|
||||||
Drawf.liquid(sliced(liquidr, slice), x, y, smoothLiquid, liquids.current().color.write(Tmp.c1).a(1f));
|
Drawf.liquid(sliced(liquidr, slice), x + ox, y + oy, smoothLiquid, liquids.current().color.write(Tmp.c1).a(1f));
|
||||||
Draw.scl(xscl, yscl);
|
Draw.scl(xscl, yscl);
|
||||||
|
|
||||||
Draw.rect(sliced(topRegions[bits], slice), x, y, angle);
|
Draw.rect(sliced(topRegions[bits], slice), x, y, angle);
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ public class LiquidBlock extends Block{
|
|||||||
float squishX = rightBorder + tilesize/2f - bounds, squishY = topBorder + tilesize/2f - bounds;
|
float squishX = rightBorder + tilesize/2f - bounds, squishY = topBorder + tilesize/2f - bounds;
|
||||||
float ox = 0f, oy = 0f;
|
float ox = 0f, oy = 0f;
|
||||||
|
|
||||||
|
if(squishX >= 8 || squishY >= 8) continue;
|
||||||
|
|
||||||
//cut out the parts that don't fit inside the padding
|
//cut out the parts that don't fit inside the padding
|
||||||
if(squishX > 0){
|
if(squishX > 0){
|
||||||
toDraw.setWidth(toDraw.width - squishX * 4f);
|
toDraw.setWidth(toDraw.width - squishX * 4f);
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ public class GenericCrafter extends Block{
|
|||||||
/** Liquid output directions, specified in the same order as outputLiquids. Use -1 to dump in every direction. Rotations are relative to block. */
|
/** Liquid output directions, specified in the same order as outputLiquids. Use -1 to dump in every direction. Rotations are relative to block. */
|
||||||
public int[] liquidOutputDirections = {-1};
|
public int[] liquidOutputDirections = {-1};
|
||||||
|
|
||||||
|
/** if true, crafters with multiple liquid outputs will dump excess when there's still space for at least one liquid type */
|
||||||
|
public boolean dumpExtraLiquid = true;
|
||||||
public float craftTime = 80;
|
public float craftTime = 80;
|
||||||
public Effect craftEffect = Fx.none;
|
public Effect craftEffect = Fx.none;
|
||||||
public Effect updateEffect = Fx.none;
|
public Effect updateEffect = Fx.none;
|
||||||
@@ -109,6 +111,10 @@ public class GenericCrafter extends Block{
|
|||||||
outputLiquid = outputLiquids[0];
|
outputLiquid = outputLiquids[0];
|
||||||
}
|
}
|
||||||
outputsLiquid = outputLiquids != null;
|
outputsLiquid = outputLiquids != null;
|
||||||
|
|
||||||
|
if(outputItems != null) hasItems = true;
|
||||||
|
if(outputLiquids != null) hasLiquids = true;
|
||||||
|
|
||||||
super.init();
|
super.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,10 +175,21 @@ public class GenericCrafter extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(outputLiquids != null){
|
if(outputLiquids != null){
|
||||||
|
boolean allFull = true;
|
||||||
for(var output : outputLiquids){
|
for(var output : outputLiquids){
|
||||||
if(liquids.get(output.liquid) >= liquidCapacity - 0.001f){
|
if(liquids.get(output.liquid) >= liquidCapacity - 0.001f){
|
||||||
|
if(!dumpExtraLiquid){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
//if there's still space left, it's not full for all liquids
|
||||||
|
allFull = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//if there is no space left for any liquid, it can't reproduce
|
||||||
|
if(allFull){
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,16 +29,9 @@ public class HeatCrafter extends GenericCrafter{
|
|||||||
|
|
||||||
bars.add("heat", (HeatCrafterBuild entity) ->
|
bars.add("heat", (HeatCrafterBuild entity) ->
|
||||||
new Bar(() ->
|
new Bar(() ->
|
||||||
Core.bundle.format("bar.heatpercent", (int)entity.heat),
|
Core.bundle.format("bar.heatpercent", (int)entity.heat, (int)(entity.efficiencyScale() * 100)),
|
||||||
() -> Pal.lightOrange,
|
() -> Pal.lightOrange,
|
||||||
() -> entity.heat / heatRequirement));
|
() -> entity.heat / heatRequirement));
|
||||||
|
|
||||||
//TODO unnecessary?
|
|
||||||
bars.add("efficiency", (HeatCrafterBuild entity) ->
|
|
||||||
new Bar(() ->
|
|
||||||
Core.bundle.format("bar.efficiency", (int)(entity.efficiencyScale() * 100)),
|
|
||||||
() -> Pal.ammo,
|
|
||||||
entity::efficiencyScale));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ import arc.util.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
|
//TODO make non-standalone?
|
||||||
public class DrawArcSmelter extends DrawBlock{
|
public class DrawArcSmelter extends DrawBlock{
|
||||||
public TextureRegion top, bottom;
|
public TextureRegion bottom;
|
||||||
public Color flameColor = Color.valueOf("f58349"), midColor = Color.valueOf("f2d585");
|
public Color flameColor = Color.valueOf("f58349"), midColor = Color.valueOf("f2d585");
|
||||||
public float flameRad = 1f, circleSpace = 2f, flameRadiusScl = 3f, flameRadiusMag = 0.3f, circleStroke = 1.5f;
|
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 int particles = 25;
|
||||||
public float particleLife = 40f, particleRad = 7f, particleStroke = 1.1f, particleLen = 3f;
|
public float particleLife = 40f, particleRad = 7f, particleStroke = 1.1f, particleLen = 3f;
|
||||||
public boolean drawCenter = true;
|
public boolean drawCenter = true;
|
||||||
public boolean drawBottom = true, drawTop = true, drawRegion = true;
|
public boolean drawBottom = true, drawRegion = true;
|
||||||
public Blending blending = Blending.additive;
|
public Blending blending = Blending.additive;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -53,17 +54,15 @@ public class DrawArcSmelter extends DrawBlock{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(drawRegion) Draw.rect(build.block.region, build.x, build.y);
|
if(drawRegion) Draw.rect(build.block.region, build.x, build.y);
|
||||||
if(drawTop && top.found()) Draw.rect(top, build.x, build.y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(Block block){
|
public void load(Block block){
|
||||||
top = Core.atlas.find(block.name + "-top");
|
|
||||||
bottom = Core.atlas.find(block.name + "-bottom");
|
bottom = Core.atlas.find(block.name + "-bottom");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TextureRegion[] icons(Block block){
|
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 int amount = 12, sides = 8;
|
||||||
public float strokeMin = 0.2f, spread = 3f, timeScl = 30f;
|
public float strokeMin = 0.2f, spread = 3f, timeScl = 30f;
|
||||||
public float recurrence = 6f, radius = 3f;
|
public float recurrence = 6f, radius = 3f;
|
||||||
|
public boolean fill = false;
|
||||||
|
|
||||||
public DrawBubbles(Color color){
|
public DrawBubbles(Color color){
|
||||||
this.color = color;
|
this.color = color;
|
||||||
@@ -37,8 +38,13 @@ public class DrawBubbles extends DrawBlock{
|
|||||||
float life = 1f - ((Time.time / timeScl + rand.random(recurrence)) % recurrence);
|
float life = 1f - ((Time.time / timeScl + rand.random(recurrence)) % recurrence);
|
||||||
|
|
||||||
if(life > 0){
|
if(life > 0){
|
||||||
|
float rad = (1f - life) * radius;
|
||||||
|
if(fill){
|
||||||
|
Fill.circle(build.x + x, build.y + y, rad);
|
||||||
|
}else{
|
||||||
Lines.stroke(build.warmup() * (life + strokeMin));
|
Lines.stroke(build.warmup() * (life + strokeMin));
|
||||||
Lines.poly(build.x + x, build.y + y, sides, (1f - life) * radius);
|
Lines.poly(build.x + x, build.y + y, sides, rad);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
package mindustry.world.draw;
|
package mindustry.world.draw;
|
||||||
|
|
||||||
import arc.*;
|
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.math.Interp.*;
|
import arc.math.Interp.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
import mindustry.entities.units.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
public class DrawCrucible extends DrawBlock{
|
public class DrawCrucible extends DrawBlock{
|
||||||
public TextureRegion top, bottom;
|
|
||||||
public Color flameColor = Color.valueOf("f58349"), midColor = Color.valueOf("f2d585");
|
public Color flameColor = Color.valueOf("f58349"), midColor = Color.valueOf("f2d585");
|
||||||
public float flameRad = 1f, circleSpace = 2f, flameRadiusScl = 10f, flameRadiusMag = 0.6f, circleStroke = 1.5f;
|
public float flameRad = 1f, circleSpace = 2f, flameRadiusScl = 10f, flameRadiusMag = 0.6f, circleStroke = 1.5f;
|
||||||
|
|
||||||
@@ -21,7 +20,6 @@ public class DrawCrucible extends DrawBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawBase(Building build){
|
public void drawBase(Building build){
|
||||||
Draw.rect(bottom, build.x, build.y);
|
|
||||||
|
|
||||||
if(build.warmup() > 0f && flameColor.a > 0.001f){
|
if(build.warmup() > 0f && flameColor.a > 0.001f){
|
||||||
Lines.stroke(circleStroke * build.warmup());
|
Lines.stroke(circleStroke * build.warmup());
|
||||||
@@ -53,19 +51,8 @@ public class DrawCrucible extends DrawBlock{
|
|||||||
Draw.blend();
|
Draw.blend();
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.rect(build.block.region, build.x, build.y);
|
|
||||||
if(top.found()) Draw.rect(top, build.x, build.y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(Block block){
|
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){}
|
||||||
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};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import mindustry.world.blocks.production.HeatCrafter.*;
|
|||||||
|
|
||||||
/** Not standalone. */
|
/** Not standalone. */
|
||||||
public class DrawHeatRegion extends DrawBlock{
|
public class DrawHeatRegion extends DrawBlock{
|
||||||
public Color heatColor = new Color(1f, 0.22f, 0.22f, 0.8f);
|
public Color color = new Color(1f, 0.22f, 0.22f, 0.8f);
|
||||||
public float heatPulse = 0.3f, heatPulseScl = 10f;
|
public float pulse = 0.3f, pulseScl = 10f;
|
||||||
|
|
||||||
public TextureRegion heat;
|
public TextureRegion heat;
|
||||||
public String suffix = "-glow";
|
public String suffix = "-glow";
|
||||||
@@ -30,7 +30,7 @@ public class DrawHeatRegion extends DrawBlock{
|
|||||||
Draw.z(Layer.blockAdditive);
|
Draw.z(Layer.blockAdditive);
|
||||||
if(build instanceof HeatCrafterBuild hc && hc.heat > 0){
|
if(build instanceof HeatCrafterBuild hc && hc.heat > 0){
|
||||||
Draw.blend(Blending.additive);
|
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.rect(heat, build.x, build.y);
|
||||||
Draw.blend();
|
Draw.blend();
|
||||||
Draw.color();
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,12 +8,13 @@ import arc.util.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
/** Not standalone. */
|
/** Not standalone. */
|
||||||
public class DrawParticlesIn extends DrawBlock{
|
public class DrawParticles extends DrawBlock{
|
||||||
public Color color = Color.valueOf("f2d585");
|
public Color color = Color.valueOf("f2d585");
|
||||||
|
|
||||||
public float alpha = 0.5f;
|
public float alpha = 0.5f;
|
||||||
public int particles = 30;
|
public int particles = 30;
|
||||||
public float particleLife = 70f, particleRad = 7f, particleSize = 3f, fadeMargin = 0.4f, rotateScl = 3f;
|
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 particleInterp = new PowIn(1.5f);
|
||||||
public Interp particleSizeInterp = Interp.slope;
|
public Interp particleSizeInterp = Interp.slope;
|
||||||
public Blending blending = Blending.normal;
|
public Blending blending = Blending.normal;
|
||||||
@@ -30,7 +31,9 @@ public class DrawParticlesIn extends DrawBlock{
|
|||||||
float base = (Time.time / particleLife);
|
float base = (Time.time / particleLife);
|
||||||
rand.setSeed(build.id);
|
rand.setSeed(build.id);
|
||||||
for(int i = 0; i < particles; i++){
|
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 angle = rand.random(360f) + (Time.time / rotateScl) % 360f;
|
||||||
float len = particleRad * particleInterp.apply(fout);
|
float len = particleRad * particleInterp.apply(fout);
|
||||||
Draw.alpha(a * (1f - Mathf.curve(fin, 1f - fadeMargin)));
|
Draw.alpha(a * (1f - Mathf.curve(fin, 1f - fadeMargin)));
|
||||||
@@ -128,7 +128,7 @@ public class Generators{
|
|||||||
|
|
||||||
generate("gas-frames", () -> {
|
generate("gas-frames", () -> {
|
||||||
int frames = Liquid.animationFrames;
|
int frames = Liquid.animationFrames;
|
||||||
String[] stencils = {"fluid", "conduit-liquid-r0", "conduit-liquid-r1", "conduit-liquid-r2", "conduit-liquid-r3"};
|
String[] stencils = {"fluid"};
|
||||||
String[] types = {"liquid", "gas"};
|
String[] types = {"liquid", "gas"};
|
||||||
int typeIndex = 0;
|
int typeIndex = 0;
|
||||||
|
|
||||||
|
|||||||