Vent condenser block
|
Before Width: | Height: | Size: 12 KiB |
BIN
core/assets-raw/sprites/blocks/production/electric-heater.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 223 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 825 B |
BIN
core/assets-raw/sprites/blocks/production/vent-condenser.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 998 B |
BIN
core/assets-raw/sprites/effects/square-shadow.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
@@ -477,3 +477,6 @@
|
|||||||
63229=horde|block-horde-ui
|
63229=horde|block-horde-ui
|
||||||
63228=small-deconstructor|block-small-deconstructor-ui
|
63228=small-deconstructor|block-small-deconstructor-ui
|
||||||
63227=barrier-projector|block-barrier-projector-ui
|
63227=barrier-projector|block-barrier-projector-ui
|
||||||
|
63226=eletric-heater|block-eletric-heater-ui
|
||||||
|
63225=vent-condenser|block-vent-condenser-ui
|
||||||
|
63224=electric-heater|block-electric-heater-ui
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ public class Blocks{
|
|||||||
melter, separator, disassembler, sporePress, pulverizer, incinerator, coalCentrifuge,
|
melter, separator, disassembler, sporePress, pulverizer, incinerator, coalCentrifuge,
|
||||||
|
|
||||||
//erekir
|
//erekir
|
||||||
siliconArcFurnace, electrolyzer, oxidationChamber, atmosphericConcentrator, slagHeater, slagIncinerator, heatReactor,
|
siliconArcFurnace, electrolyzer, oxidationChamber, atmosphericConcentrator, electricHeater, slagIncinerator,
|
||||||
carbideCrucible, slagCentrifuge, surgeCrucible, cyanogenSynthesizer, phaseSynthesizer,
|
carbideCrucible, slagCentrifuge, surgeCrucible, cyanogenSynthesizer, phaseSynthesizer, heatReactor,
|
||||||
cellSynthesisChamber,
|
cellSynthesisChamber,
|
||||||
|
|
||||||
//sandbox
|
//sandbox
|
||||||
@@ -104,7 +104,7 @@ public class Blocks{
|
|||||||
|
|
||||||
//power - erekir
|
//power - erekir
|
||||||
//TODO rename chemicalCombustionChamber
|
//TODO rename chemicalCombustionChamber
|
||||||
turbineCondenser, chemicalCombustionChamber, pyrolysisGenerator,
|
turbineCondenser, ventCondenser, chemicalCombustionChamber, pyrolysisGenerator,
|
||||||
beamNode, beamTower,
|
beamNode, beamTower,
|
||||||
|
|
||||||
//production
|
//production
|
||||||
@@ -1055,7 +1055,7 @@ public class Blocks{
|
|||||||
|
|
||||||
outputItem = new ItemStack(Items.oxide, 1);
|
outputItem = new ItemStack(Items.oxide, 1);
|
||||||
|
|
||||||
consumes.liquid(Liquids.ozone, 2f / 60f);
|
consumes.liquid(Liquids.ozone, 1f / 60f);
|
||||||
consumes.item(Items.beryllium);
|
consumes.item(Items.beryllium);
|
||||||
consumes.power(1f);
|
consumes.power(1f);
|
||||||
|
|
||||||
@@ -1069,15 +1069,13 @@ public class Blocks{
|
|||||||
heatOutput = 5f;
|
heatOutput = 5f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
slagHeater = new HeatProducer("slag-heater"){{
|
electricHeater = new HeatProducer("electric-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 DrawLiquidTile(Liquids.slag, 9f), new DrawHeatOutput(true));
|
drawer = new DrawMulti(new DrawHeatOutput(true));
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
drawer.iconOverride = new String[]{""};
|
||||||
size = 2;
|
size = 2;
|
||||||
craftTime = 60f * 1f;
|
|
||||||
heatOutput = 2f;
|
heatOutput = 2f;
|
||||||
consumes.liquid(Liquids.slag, 20f / 60f);
|
|
||||||
consumes.power(0.5f / 60f);
|
consumes.power(0.5f / 60f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1087,20 +1085,6 @@ public class Blocks{
|
|||||||
consumes.liquid(Liquids.slag, 2f / 60f);
|
consumes.liquid(Liquids.slag, 2f / 60f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
heatReactor = new HeatProducer("heat-reactor"){{
|
|
||||||
//TODO gas/liquid requirement?
|
|
||||||
requirements(Category.crafting, with(Items.oxide, 70, Items.graphite, 20, Items.carbide, 10, Items.thorium, 80));
|
|
||||||
size = 3;
|
|
||||||
craftTime = 60f * 10f;
|
|
||||||
|
|
||||||
craftEffect = new RadialEffect(Fx.heatReactorSmoke, 4, 90f, 7f);
|
|
||||||
|
|
||||||
itemCapacity = 20;
|
|
||||||
consumes.item(Items.thorium, 3);
|
|
||||||
consumes.liquid(Liquids.nitrogen, 1f / 60f);
|
|
||||||
outputItem = new ItemStack(Items.fissileMatter, 1);
|
|
||||||
}};
|
|
||||||
|
|
||||||
carbideCrucible = new HeatCrafter("carbide-crucible"){{
|
carbideCrucible = new HeatCrafter("carbide-crucible"){{
|
||||||
requirements(Category.crafting, with(Items.tungsten, 90, Items.thorium, 70, Items.oxide, 50));
|
requirements(Category.crafting, with(Items.tungsten, 90, Items.thorium, 70, Items.oxide, 50));
|
||||||
craftEffect = Fx.none;
|
craftEffect = Fx.none;
|
||||||
@@ -1256,6 +1240,20 @@ public class Blocks{
|
|||||||
consumes.power(8f);
|
consumes.power(8f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
heatReactor = new HeatProducer("heat-reactor"){{
|
||||||
|
//TODO gas/liquid requirement?
|
||||||
|
requirements(Category.crafting, with(Items.oxide, 70, Items.graphite, 20, Items.carbide, 10, Items.thorium, 80));
|
||||||
|
size = 3;
|
||||||
|
craftTime = 60f * 10f;
|
||||||
|
|
||||||
|
craftEffect = new RadialEffect(Fx.heatReactorSmoke, 4, 90f, 7f);
|
||||||
|
|
||||||
|
itemCapacity = 20;
|
||||||
|
consumes.item(Items.thorium, 3);
|
||||||
|
consumes.liquid(Liquids.nitrogen, 1f / 60f);
|
||||||
|
outputItem = new ItemStack(Items.fissileMatter, 1);
|
||||||
|
}};
|
||||||
|
|
||||||
//TODO needs to be completely redone from the ground up
|
//TODO needs to be completely redone from the ground up
|
||||||
if(false)
|
if(false)
|
||||||
cellSynthesisChamber = new LiquidConverter("cell-synthesis-chamber"){{
|
cellSynthesisChamber = new LiquidConverter("cell-synthesis-chamber"){{
|
||||||
@@ -2017,7 +2015,7 @@ public class Blocks{
|
|||||||
spinSpeed = 0.6f;
|
spinSpeed = 0.6f;
|
||||||
spinners = true;
|
spinners = true;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
liquidOutput = new LiquidStack(Liquids.water, 10f / 60f / 9f);
|
outputLiquid = new LiquidStack(Liquids.water, 10f / 60f / 9f);
|
||||||
liquidCapacity = 20f;
|
liquidCapacity = 20f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -2132,23 +2130,6 @@ public class Blocks{
|
|||||||
consumes.liquid(Liquids.water, 0.1f).boost();
|
consumes.liquid(Liquids.water, 0.1f).boost();
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//TODO should be crusher or something
|
|
||||||
impactDrill = new BurstDrill("impact-drill"){{
|
|
||||||
requirements(Category.production, with(Items.silicon, 60, Items.beryllium, 90, Items.graphite, 50));
|
|
||||||
drillTime = 60f * 12f;
|
|
||||||
size = 4;
|
|
||||||
hasPower = true;
|
|
||||||
tier = 6;
|
|
||||||
drillEffect = new MultiEffect(Fx.mineImpact, Fx.drillSteam);
|
|
||||||
shake = 4f;
|
|
||||||
itemCapacity = 40;
|
|
||||||
|
|
||||||
consumes.power(3f);
|
|
||||||
consumes.liquid(Liquids.water, 0.2f);
|
|
||||||
}};
|
|
||||||
|
|
||||||
//TODO higher tier impact drill, 5x5
|
|
||||||
|
|
||||||
waterExtractor = new SolidPump("water-extractor"){{
|
waterExtractor = new SolidPump("water-extractor"){{
|
||||||
requirements(Category.production, with(Items.metaglass, 30, Items.graphite, 30, Items.lead, 30, Items.copper, 30));
|
requirements(Category.production, with(Items.metaglass, 30, Items.graphite, 30, Items.lead, 30, Items.copper, 30));
|
||||||
result = Liquids.water;
|
result = Liquids.water;
|
||||||
@@ -2200,6 +2181,31 @@ public class Blocks{
|
|||||||
consumes.liquid(Liquids.water, 0.15f);
|
consumes.liquid(Liquids.water, 0.15f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
//TODO output heat
|
||||||
|
ventCondenser = new AttributeCrafter("vent-condenser"){{
|
||||||
|
requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 60));
|
||||||
|
attribute = Attribute.vent;
|
||||||
|
displayEfficiencyScale = 1f / 9f;
|
||||||
|
minEfficiency = 9f - 0.0001f;
|
||||||
|
displayEfficiency = false;
|
||||||
|
craftEffect = Fx.turbinegenerate;
|
||||||
|
drawer = new DrawMulti(new DrawBlock(), new DrawRegion("-rotator-blur"){{
|
||||||
|
spinSprite = true;
|
||||||
|
drawPlan = false;
|
||||||
|
rotateSpeed = 6f;
|
||||||
|
}});
|
||||||
|
drawer.iconOverride = new String[]{"", "-rotator"};
|
||||||
|
ignoreLiquidFullness = true;
|
||||||
|
craftTime = 30f;
|
||||||
|
size = 3;
|
||||||
|
ambientSound = Sounds.hum;
|
||||||
|
ambientSoundVolume = 0.06f;
|
||||||
|
hasLiquids = true;
|
||||||
|
outputLiquid = new LiquidStack(Liquids.water, 30f / 60f / 9f);
|
||||||
|
consumes.power(0.5f);
|
||||||
|
liquidCapacity = 20f;
|
||||||
|
}};
|
||||||
|
|
||||||
cliffCrusher = new WallCrafter("cliff-crusher"){{
|
cliffCrusher = new WallCrafter("cliff-crusher"){{
|
||||||
requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 20));
|
requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 20));
|
||||||
|
|
||||||
@@ -2236,6 +2242,23 @@ public class Blocks{
|
|||||||
consumes.liquid(Liquids.hydrogen, 2f / 60f).boost();
|
consumes.liquid(Liquids.hydrogen, 2f / 60f).boost();
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
//TODO should be crusher or something
|
||||||
|
impactDrill = new BurstDrill("impact-drill"){{
|
||||||
|
requirements(Category.production, with(Items.silicon, 60, Items.beryllium, 90, Items.graphite, 50));
|
||||||
|
drillTime = 60f * 12f;
|
||||||
|
size = 4;
|
||||||
|
hasPower = true;
|
||||||
|
tier = 6;
|
||||||
|
drillEffect = new MultiEffect(Fx.mineImpact, Fx.drillSteam);
|
||||||
|
shake = 4f;
|
||||||
|
itemCapacity = 40;
|
||||||
|
|
||||||
|
consumes.power(3f);
|
||||||
|
consumes.liquid(Liquids.water, 0.2f);
|
||||||
|
}};
|
||||||
|
|
||||||
|
//TODO higher tier impact drill, 5x5
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
//region storage
|
//region storage
|
||||||
|
|
||||||
@@ -2891,15 +2914,22 @@ public class Blocks{
|
|||||||
consumes.liquid(Liquids.hydrogen, 1.5f / 60f);
|
consumes.liquid(Liquids.hydrogen, 1.5f / 60f);
|
||||||
shots = 1;
|
shots = 1;
|
||||||
|
|
||||||
//TODO cool reload animation
|
draw = new DrawTurret("reinforced-"){{
|
||||||
draw = new DrawTurret("reinforced-");
|
parts.addAll(new RegionPart("-glow"){{
|
||||||
|
drawRegion = false;
|
||||||
|
heatColor = Color.valueOf("768a9a");
|
||||||
|
useReload = false;
|
||||||
|
useProgressHeat = true;
|
||||||
|
}});
|
||||||
|
}};
|
||||||
shootShake = 1f;
|
shootShake = 1f;
|
||||||
shootLength = 5f;
|
shootLength = 4f;
|
||||||
outlineColor = Pal.darkOutline;
|
outlineColor = Pal.darkOutline;
|
||||||
size = 2;
|
size = 2;
|
||||||
envEnabled |= Env.space;
|
envEnabled |= Env.space;
|
||||||
reloadTime = 25f;
|
reloadTime = 25f;
|
||||||
restitution = 0.1f;
|
restitution = 0.1f;
|
||||||
|
cooldown = 0.04f;
|
||||||
recoilAmount = 2.5f;
|
recoilAmount = 2.5f;
|
||||||
range = 90;
|
range = 90;
|
||||||
shootCone = 15f;
|
shootCone = 15f;
|
||||||
|
|||||||
@@ -75,27 +75,29 @@ public class ErekirTechTree{
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
node(siliconArcFurnace, () -> {
|
node(ventCondenser, () -> {
|
||||||
node(electrolyzer, () -> {
|
node(siliconArcFurnace, () -> {
|
||||||
node(oxidationChamber, () -> {
|
node(electrolyzer, () -> {
|
||||||
node(atmosphericConcentrator, () -> {
|
node(oxidationChamber, () -> {
|
||||||
node(cyanogenSynthesizer, () -> {
|
node(electricHeater, () -> {
|
||||||
|
node(atmosphericConcentrator, () -> {
|
||||||
|
node(cyanogenSynthesizer, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
node(carbideCrucible, () -> {
|
node(carbideCrucible, () -> {
|
||||||
node(surgeCrucible, () -> {
|
node(surgeCrucible, () -> {
|
||||||
node(phaseSynthesizer, () -> {
|
node(phaseSynthesizer, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
node(slagIncinerator, () -> {
|
node(slagIncinerator, () -> {
|
||||||
//when is this actually needed?
|
|
||||||
node(slagHeater, () -> {
|
|
||||||
node(slagCentrifuge, () -> {
|
node(slagCentrifuge, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package mindustry.content;
|
package mindustry.content;
|
||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
|
import arc.scene.style.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.ctype.*;
|
import mindustry.ctype.*;
|
||||||
import mindustry.game.Objectives.*;
|
import mindustry.game.Objectives.*;
|
||||||
|
import mindustry.gen.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
|
|
||||||
/** Class for storing a list of TechNodes with some utility tree builder methods; context dependent. See {@link SerpuloTechTree#load} source for example usage. */
|
/** Class for storing a list of TechNodes with some utility tree builder methods; context dependent. See {@link SerpuloTechTree#load} source for example usage. */
|
||||||
@@ -75,6 +77,8 @@ public class TechTree{
|
|||||||
public static class TechNode{
|
public static class TechNode{
|
||||||
/** Depth in tech tree. */
|
/** Depth in tech tree. */
|
||||||
public int depth;
|
public int depth;
|
||||||
|
/** Icon displayed in tech tree selector. */
|
||||||
|
public @Nullable Drawable icon;
|
||||||
/** Name for root node - used in tech tree selector. */
|
/** Name for root node - used in tech tree selector. */
|
||||||
public @Nullable String name;
|
public @Nullable String name;
|
||||||
/** Requirement node. */
|
/** Requirement node. */
|
||||||
@@ -111,6 +115,10 @@ public class TechTree{
|
|||||||
all.add(this);
|
all.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Drawable icon(){
|
||||||
|
return icon == null ? Icon.tree : icon;
|
||||||
|
}
|
||||||
|
|
||||||
public String localizedName(){
|
public String localizedName(){
|
||||||
return Core.bundle.get("techtree." + name);
|
return Core.bundle.get("techtree." + name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -995,7 +995,7 @@ public class UnitTypes{
|
|||||||
accel = 0.08f;
|
accel = 0.08f;
|
||||||
drag = 0.016f;
|
drag = 0.016f;
|
||||||
flying = true;
|
flying = true;
|
||||||
hitSize = 9f;
|
hitSize = 10f;
|
||||||
targetAir = false;
|
targetAir = false;
|
||||||
engineOffset = 7.8f;
|
engineOffset = 7.8f;
|
||||||
range = 140f;
|
range = 140f;
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
public boolean createWreck = true;
|
public boolean createWreck = true;
|
||||||
public boolean useUnitCap = true;
|
public boolean useUnitCap = true;
|
||||||
public boolean destructibleWreck = true;
|
public boolean destructibleWreck = true;
|
||||||
|
public boolean squareShadow = false;
|
||||||
public float groundLayer = Layer.groundUnit;
|
public float groundLayer = Layer.groundUnit;
|
||||||
public float payloadCapacity = 8;
|
public float payloadCapacity = 8;
|
||||||
public float aimDst = -1f;
|
public float aimDst = -1f;
|
||||||
@@ -496,7 +497,13 @@ public class UnitType extends UnlockableContent{
|
|||||||
legBaseRegion = Core.atlas.find(name + "-leg-base", name + "-leg");
|
legBaseRegion = Core.atlas.find(name + "-leg-base", name + "-leg");
|
||||||
baseRegion = Core.atlas.find(name + "-base");
|
baseRegion = Core.atlas.find(name + "-base");
|
||||||
cellRegion = Core.atlas.find(name + "-cell", Core.atlas.find("power-cell"));
|
cellRegion = Core.atlas.find(name + "-cell", Core.atlas.find("power-cell"));
|
||||||
softShadowRegion = Core.atlas.find("circle-shadow");
|
//when linear filtering is on, it's acceptable to use the relatively low-res 'particle' region
|
||||||
|
softShadowRegion =
|
||||||
|
squareShadow ? Core.atlas.find("square-shadow") :
|
||||||
|
hitSize <= 10f || (Core.settings != null && Core.settings.getBool("linear", true)) ?
|
||||||
|
Core.atlas.find("particle") :
|
||||||
|
Core.atlas.find("circle-shadow");
|
||||||
|
|
||||||
outlineRegion = Core.atlas.find(name + "-outline");
|
outlineRegion = Core.atlas.find(name + "-outline");
|
||||||
shadowRegion = fullIcon;
|
shadowRegion = fullIcon;
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
titleTable.clear();
|
titleTable.clear();
|
||||||
titleTable.button(b -> {
|
titleTable.button(b -> {
|
||||||
//TODO custom icon here.
|
//TODO custom icon here.
|
||||||
b.image(Icon.tree).padRight(8).size(iconMed);
|
b.imageDraw(() -> root.node.icon()).padRight(8).size(iconMed);
|
||||||
b.add().growX();
|
b.add().growX();
|
||||||
b.label(() -> root.node.localizedName()).color(Pal.accent);
|
b.label(() -> root.node.localizedName()).color(Pal.accent);
|
||||||
b.add().growX();
|
b.add().growX();
|
||||||
|
|||||||
80
core/src/mindustry/world/blocks/heat/HeatConductor.java
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
package mindustry.world.blocks.heat;
|
||||||
|
|
||||||
|
import arc.graphics.g2d.*;
|
||||||
|
import arc.util.*;
|
||||||
|
import mindustry.entities.units.*;
|
||||||
|
import mindustry.gen.*;
|
||||||
|
import mindustry.graphics.*;
|
||||||
|
import mindustry.ui.*;
|
||||||
|
import mindustry.world.*;
|
||||||
|
import mindustry.world.draw.*;
|
||||||
|
|
||||||
|
public class HeatConductor extends Block{
|
||||||
|
public float visualMaxHeat = 10f;
|
||||||
|
public DrawBlock drawer = new DrawBlock();
|
||||||
|
|
||||||
|
public HeatConductor(String name){
|
||||||
|
super(name);
|
||||||
|
update = solid = rotate = true;
|
||||||
|
size = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBars(){
|
||||||
|
super.setBars();
|
||||||
|
|
||||||
|
bars.add("heat", (HeatConductorBuild entity) -> new Bar("bar.heat", Pal.lightOrange, () -> entity.heat / visualMaxHeat));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void load(){
|
||||||
|
super.load();
|
||||||
|
|
||||||
|
drawer.load(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawRequestRegion(BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
|
drawer.drawPlan(this, plan, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextureRegion[] icons(){
|
||||||
|
return drawer.finalIcons(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class HeatConductorBuild extends Building implements HeatBlock{
|
||||||
|
public float heat = 0f;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(){
|
||||||
|
drawer.drawBase(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawLight(){
|
||||||
|
super.drawLight();
|
||||||
|
drawer.drawLights(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTile(){
|
||||||
|
heat = calculateHeat(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float warmup(){
|
||||||
|
return heat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float heat(){
|
||||||
|
return heat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float heatFrac(){
|
||||||
|
return heat / visualMaxHeat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,7 +22,7 @@ public class ThermalGenerator extends PowerGenerator{
|
|||||||
public float displayEfficiencyScale = 1f;
|
public float displayEfficiencyScale = 1f;
|
||||||
public boolean spinners = false;
|
public boolean spinners = false;
|
||||||
public boolean displayEfficiency = true;
|
public boolean displayEfficiency = true;
|
||||||
public @Nullable LiquidStack liquidOutput;
|
public @Nullable LiquidStack outputLiquid;
|
||||||
public Attribute attribute = Attribute.heat;
|
public Attribute attribute = Attribute.heat;
|
||||||
|
|
||||||
public @Load("@-rotator") TextureRegion rotatorRegion;
|
public @Load("@-rotator") TextureRegion rotatorRegion;
|
||||||
@@ -34,7 +34,7 @@ public class ThermalGenerator extends PowerGenerator{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
if(liquidOutput != null){
|
if(outputLiquid != null){
|
||||||
outputsLiquid = true;
|
outputsLiquid = true;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
}
|
}
|
||||||
@@ -49,8 +49,8 @@ public class ThermalGenerator extends PowerGenerator{
|
|||||||
|
|
||||||
stats.add(Stat.tiles, attribute, floating, size * size * displayEfficiencyScale, !displayEfficiency);
|
stats.add(Stat.tiles, attribute, floating, size * size * displayEfficiencyScale, !displayEfficiency);
|
||||||
|
|
||||||
if(liquidOutput != null){
|
if(outputLiquid != null){
|
||||||
stats.add(Stat.output, StatValues.liquid(liquidOutput.liquid, liquidOutput.amount * size * size * 60f, true));
|
stats.add(Stat.output, StatValues.liquid(outputLiquid.liquid, outputLiquid.amount * size * size * 60f, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,10 +88,10 @@ public class ThermalGenerator extends PowerGenerator{
|
|||||||
|
|
||||||
spinRotation += productionEfficiency * spinSpeed;
|
spinRotation += productionEfficiency * spinSpeed;
|
||||||
|
|
||||||
if(liquidOutput != null){
|
if(outputLiquid != null){
|
||||||
float added = Math.min(productionEfficiency * delta() * liquidOutput.amount, liquidCapacity - liquids.get(liquidOutput.liquid));
|
float added = Math.min(productionEfficiency * delta() * outputLiquid.amount, liquidCapacity - liquids.get(outputLiquid.liquid));
|
||||||
liquids.add(liquidOutput.liquid, added);
|
liquids.add(outputLiquid.liquid, added);
|
||||||
dumpLiquid(liquidOutput.liquid);
|
dumpLiquid(outputLiquid.liquid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package mindustry.world.blocks.production;
|
package mindustry.world.blocks.production;
|
||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
|
import mindustry.game.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
import mindustry.world.*;
|
||||||
import mindustry.world.meta.*;
|
import mindustry.world.meta.*;
|
||||||
|
|
||||||
/** A crafter that gains efficiency from attribute tiles. */
|
/** A crafter that gains efficiency from attribute tiles. */
|
||||||
@@ -11,6 +13,9 @@ public class AttributeCrafter extends GenericCrafter{
|
|||||||
public float baseEfficiency = 1f;
|
public float baseEfficiency = 1f;
|
||||||
public float boostScale = 1f;
|
public float boostScale = 1f;
|
||||||
public float maxBoost = 1f;
|
public float maxBoost = 1f;
|
||||||
|
public float minEfficiency = -1f;
|
||||||
|
public float displayEfficiencyScale = 1f;
|
||||||
|
public boolean displayEfficiency = true;
|
||||||
|
|
||||||
public AttributeCrafter(String name){
|
public AttributeCrafter(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@@ -18,6 +23,10 @@ public class AttributeCrafter extends GenericCrafter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
|
super.drawPlace(x, y, rotation, valid);
|
||||||
|
|
||||||
|
if(!displayEfficiency) return;
|
||||||
|
|
||||||
drawPlaceText(Core.bundle.format("bar.efficiency",
|
drawPlaceText(Core.bundle.format("bar.efficiency",
|
||||||
(int)((baseEfficiency + Math.min(maxBoost, boostScale * sumAttribute(attribute, x, y))) * 100f)), x, y, valid);
|
(int)((baseEfficiency + Math.min(maxBoost, boostScale * sumAttribute(attribute, x, y))) * 100f)), x, y, valid);
|
||||||
}
|
}
|
||||||
@@ -28,11 +37,17 @@ public class AttributeCrafter extends GenericCrafter{
|
|||||||
|
|
||||||
bars.add("efficiency", (AttributeCrafterBuild entity) ->
|
bars.add("efficiency", (AttributeCrafterBuild entity) ->
|
||||||
new Bar(() ->
|
new Bar(() ->
|
||||||
Core.bundle.format("bar.efficiency", (int)(entity.efficiencyScale() * 100)),
|
Core.bundle.format("bar.efficiency", (int)(entity.efficiencyScale() * 100 * displayEfficiencyScale)),
|
||||||
() -> Pal.lightOrange,
|
() -> Pal.lightOrange,
|
||||||
entity::efficiencyScale));
|
entity::efficiencyScale));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlaceOn(Tile tile, Team team, int rotation){
|
||||||
|
//make sure there's enough efficiency at this location
|
||||||
|
return tile.getLinkedTilesAs(this, tempTiles).sumf(other -> other.floor().attributes.get(attribute)) > minEfficiency;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public class GenericCrafter extends Block{
|
|||||||
|
|
||||||
/** if true, crafters with multiple liquid outputs will dump excess when there's still space for at least one liquid type */
|
/** 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 boolean dumpExtraLiquid = true;
|
||||||
|
public boolean ignoreLiquidFullness = false;
|
||||||
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;
|
||||||
@@ -115,10 +116,6 @@ public class GenericCrafter extends Block{
|
|||||||
super.init();
|
super.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawPlanBase(BuildPlan req, Eachable<BuildPlan> list){
|
|
||||||
super.drawRequestRegion(req, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawRequestRegion(BuildPlan plan, Eachable<BuildPlan> list){
|
public void drawRequestRegion(BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
drawer.drawPlan(this, plan, list);
|
drawer.drawPlan(this, plan, list);
|
||||||
@@ -164,7 +161,7 @@ public class GenericCrafter extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(outputLiquids != null){
|
if(outputLiquids != null && !ignoreLiquidFullness){
|
||||||
boolean allFull = true;
|
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){
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public class DrawRegion extends DrawBlock{
|
|||||||
public TextureRegion region;
|
public TextureRegion region;
|
||||||
public String suffix = "";
|
public String suffix = "";
|
||||||
public boolean spinSprite = false;
|
public boolean spinSprite = false;
|
||||||
|
public boolean drawPlan = true;
|
||||||
public float rotateSpeed, x, y;
|
public float rotateSpeed, x, y;
|
||||||
/** Any number <=0 disables layer changes. */
|
/** Any number <=0 disables layer changes. */
|
||||||
public float layer = -1;
|
public float layer = -1;
|
||||||
@@ -38,6 +39,7 @@ public class DrawRegion extends DrawBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
|
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
|
if(!drawPlan) return;
|
||||||
Draw.rect(region, plan.drawx(), plan.drawy());
|
Draw.rect(region, plan.drawx(), plan.drawy());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ public class DrawTurret extends DrawBlock{
|
|||||||
progress = interp.apply(progress);
|
progress = interp.apply(progress);
|
||||||
|
|
||||||
for(int i = 0; i < regions.length; i++){
|
for(int i = 0; i < regions.length; i++){
|
||||||
|
//can be null if drawRegion == false
|
||||||
var region = regions[i];
|
var region = regions[i];
|
||||||
float sign = i == 1 ? -1 : 1;
|
float sign = i == 1 ? -1 : 1;
|
||||||
Tmp.v1.set((x + moveX * progress) * sign, y + moveY * progress).rotate((build.rotation - 90));
|
Tmp.v1.set((x + moveX * progress) * sign, y + moveY * progress).rotate((build.rotation - 90));
|
||||||
@@ -218,6 +219,8 @@ public class DrawTurret extends DrawBlock{
|
|||||||
regions = new TextureRegion[]{Core.atlas.find(block.name + suffix)};
|
regions = new TextureRegion[]{Core.atlas.find(block.name + suffix)};
|
||||||
outlines = new TextureRegion[]{Core.atlas.find(block.name + suffix + "-outline")};
|
outlines = new TextureRegion[]{Core.atlas.find(block.name + suffix + "-outline")};
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
regions = new TextureRegion[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
heat = Core.atlas.find(block.name + suffix + "-heat");
|
heat = Core.atlas.find(block.name + suffix + "-heat");
|
||||||
|
|||||||