Added silicon crucible

This commit is contained in:
Anuken
2020-06-03 12:11:40 -04:00
parent b786260f89
commit 3c89ccf7c3
14 changed files with 2482 additions and 2346 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -88,3 +88,4 @@ Alicila
Daniel Dusek
DeltaNedas
GioIacca9
SnakkiZXZ

View File

@@ -238,3 +238,4 @@
63506=core-silo|block-core-silo-medium
63505=data-processor|block-data-processor-medium
63504=payload-router|block-payload-router-medium
63503=silicon-crucible|block-silicon-crucible-medium

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 746 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 829 KiB

After

Width:  |  Height:  |  Size: 835 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 KiB

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 897 KiB

After

Width:  |  Height:  |  Size: 907 KiB

View File

@@ -45,7 +45,7 @@ public class Blocks implements ContentList{
oreCopper, oreLead, oreScrap, oreCoal, oreTitanium, oreThorium,
//crafting
siliconSmelter, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer,
siliconSmelter, siliconCrucible, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer,
melter, separator, sporePress, pulverizer, incinerator, coalCentrifuge,
//sandbox
@@ -485,6 +485,22 @@ public class Blocks implements ContentList{
consumes.power(0.50f);
}};
siliconCrucible = new ThermalSmelter("silicon-crucible"){{
requirements(Category.crafting, ItemStack.with(Items.titanium, 120, Items.metaglass, 80, Items.plastanium, 35, Items.silicon, 60));
craftEffect = Fx.smeltsmoke;
outputItem = new ItemStack(Items.silicon, 5);
craftTime = 140f;
size = 3;
hasPower = true;
hasLiquids = false;
flameColor = Color.valueOf("ffef99");
itemCapacity = 30;
heatBoostScale = 0.15f;
consumes.items(new ItemStack(Items.coal, 3), new ItemStack(Items.sand, 6), new ItemStack(Items.pyratite, 1));
consumes.power(4f);
}};
kiln = new GenericSmelter("kiln"){{
requirements(Category.crafting, ItemStack.with(Items.copper, 60, Items.graphite, 30, Items.lead, 30));
craftEffect = Fx.smeltsmoke;

View File

@@ -88,7 +88,7 @@ public class ForceProjector extends Block{
@Override
public void updateTile(){
boolean phaseValid = consumes.get(ConsumeType.item).valid(tile.entity);
boolean phaseValid = consumes.get(ConsumeType.item).valid(this);
phaseHeat = Mathf.lerpDelta(phaseHeat, Mathf.num(phaseValid), 0.1f);

View File

@@ -0,0 +1,58 @@
package mindustry.world.blocks.production;
import arc.*;
import mindustry.graphics.*;
import mindustry.ui.*;
import mindustry.world.meta.*;
/** A smelter that gains efficiency from heat tiles. */
public class ThermalSmelter extends GenericSmelter{
public Attribute attribute = Attribute.heat;
public float baseEfficiency = 1f;
public float heatBoostScale = 1f;
public float maxHeatBoost = 1f;
public ThermalSmelter(String name){
super(name);
}
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
drawPlaceText(Core.bundle.format("bar.efficiency",
(int)((baseEfficiency + Math.min(maxHeatBoost, heatBoostScale * sumAttribute(attribute, x, y))) * 100f)), x, y, valid);
}
@Override
public void setBars(){
super.setBars();
bars.add("efficiency", entity ->
new Bar(() ->
Core.bundle.format("bar.efficiency", (int)(entity.efficiency() * 100)),
() -> Pal.lightOrange,
entity::efficiency));
}
@Override
public void setStats(){
super.setStats();
stats.add(BlockStat.tiles, attribute, heatBoostScale);
}
public class HeatedSmelterEntity extends SmelterEntity{
public float heat = 0.0f;
@Override
public float efficiency(){
return (baseEfficiency + Math.min(maxHeatBoost, heatBoostScale * heat)) * super.efficiency();
}
@Override
public void placed(){
super.placed();
heat = sumAttribute(attribute, tile.x, tile.y);
}
}
}

View File

@@ -38,9 +38,13 @@ public class BlockStats{
}
public void add(BlockStat stat, Attribute attr){
add(stat, attr, 1f);
}
public void add(BlockStat stat, Attribute attr, float scale){
for(Block block : Vars.content.blocks()){
if(!block.isFloor() || block.asFloor().attributes.get(attr) == 0) continue;
add(stat, new FloorEfficiencyValue(block.asFloor(), block.asFloor().attributes.get(attr)));
add(stat, new FloorEfficiencyValue(block.asFloor(), block.asFloor().attributes.get(attr) * scale));
}
}