Stacked map editor brush slider

This commit is contained in:
Anuken
2021-07-20 19:56:55 -04:00
parent 14e4203ee7
commit d506685bba
4 changed files with 12 additions and 9 deletions

View File

@@ -12,6 +12,7 @@ import mindustry.world.meta.*;
public class ThermalGenerator extends PowerGenerator{
public Effect generateEffect = Fx.none;
public float effectChance = 0.05f;
public Attribute attribute = Attribute.heat;
public ThermalGenerator(String name){
@@ -52,7 +53,7 @@ public class ThermalGenerator extends PowerGenerator{
public void updateTile(){
productionEfficiency = sum + attribute.env();
if(productionEfficiency > 0.1f && Mathf.chance(0.05 * delta())){
if(productionEfficiency > 0.1f && Mathf.chanceDelta(effectChance)){
generateEffect.at(x + Mathf.range(3f), y + Mathf.range(3f));
}
}