Thermal -> AttributeSmelter

This commit is contained in:
Anuken 2020-06-03 12:19:27 -04:00
parent 9b65151718
commit 3d98de34eb
5 changed files with 13 additions and 13 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -485,7 +485,7 @@ public class Blocks implements ContentList{
consumes.power(0.50f);
}};
siliconCrucible = new ThermalSmelter("silicon-crucible"){{
siliconCrucible = new AttributeSmelter("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);
@ -495,7 +495,7 @@ public class Blocks implements ContentList{
hasLiquids = false;
flameColor = Color.valueOf("ffef99");
itemCapacity = 30;
heatBoostScale = 0.15f;
boostScale = 0.15f;
consumes.items(new ItemStack(Items.coal, 3), new ItemStack(Items.sand, 6), new ItemStack(Items.pyratite, 1));
consumes.power(4f);

View File

@ -5,21 +5,21 @@ import mindustry.graphics.*;
import mindustry.ui.*;
import mindustry.world.meta.*;
/** A smelter that gains efficiency from heat tiles. */
public class ThermalSmelter extends GenericSmelter{
/** A smelter that gains efficiency from attribute tiles. */
public class AttributeSmelter extends GenericSmelter{
public Attribute attribute = Attribute.heat;
public float baseEfficiency = 1f;
public float heatBoostScale = 1f;
public float boostScale = 1f;
public float maxHeatBoost = 1f;
public ThermalSmelter(String name){
public AttributeSmelter(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);
(int)((baseEfficiency + Math.min(maxHeatBoost, boostScale * sumAttribute(attribute, x, y))) * 100f)), x, y, valid);
}
@Override
@ -37,22 +37,22 @@ public class ThermalSmelter extends GenericSmelter{
public void setStats(){
super.setStats();
stats.add(BlockStat.tiles, attribute, heatBoostScale);
stats.add(BlockStat.tiles, attribute, boostScale);
}
public class HeatedSmelterEntity extends SmelterEntity{
public float heat = 0.0f;
public class AttributeSmelterEntity extends SmelterEntity{
public float attrsum;
@Override
public float efficiency(){
return (baseEfficiency + Math.min(maxHeatBoost, heatBoostScale * heat)) * super.efficiency();
return (baseEfficiency + Math.min(maxHeatBoost, boostScale * attrsum)) * super.efficiency();
}
@Override
public void placed(){
super.placed();
heat = sumAttribute(attribute, tile.x, tile.y);
attrsum = sumAttribute(attribute, tile.x, tile.y);
}
}
}

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=aa4a38bc30126833c245cd07cab0f19ebb43e10c
archash=1fc9e8ef5ecca01e058eab1ff4d7fd673aa5431d