Thermal -> AttributeSmelter
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user