mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-09 15:27:45 +07:00
Adjustable generateEffect
randomness (#5901)
This commit is contained in:
@ -29,6 +29,7 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
|||||||
public float maxLiquidGenerate = 0.4f;
|
public float maxLiquidGenerate = 0.4f;
|
||||||
|
|
||||||
public Effect generateEffect = Fx.generatespark;
|
public Effect generateEffect = Fx.generatespark;
|
||||||
|
public float generateEffectRnd = 3f;
|
||||||
public Effect explodeEffect = Fx.generatespark;
|
public Effect explodeEffect = Fx.generatespark;
|
||||||
public Color heatColor = Color.valueOf("ff9b59");
|
public Color heatColor = Color.valueOf("ff9b59");
|
||||||
public @Load("@-top") TextureRegion topRegion;
|
public @Load("@-top") TextureRegion topRegion;
|
||||||
@ -128,12 +129,12 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
|||||||
productionEfficiency = baseLiquidEfficiency * used / maximumPossible;
|
productionEfficiency = baseLiquidEfficiency * used / maximumPossible;
|
||||||
|
|
||||||
if(used > 0.001f && Mathf.chance(0.05 * delta())){
|
if(used > 0.001f && Mathf.chance(0.05 * delta())){
|
||||||
generateEffect.at(x + Mathf.range(3f), y + Mathf.range(3f));
|
generateEffect.at(x + Mathf.range(generateEffectRnd), y + Mathf.range(generateEffectRnd));
|
||||||
}
|
}
|
||||||
}else if(hasItems){
|
}else if(hasItems){
|
||||||
// No liquids accepted or none supplied, try using items if accepted
|
// No liquids accepted or none supplied, try using items if accepted
|
||||||
if(generateTime <= 0f && items.total() > 0){
|
if(generateTime <= 0f && items.total() > 0){
|
||||||
generateEffect.at(x + Mathf.range(3f), y + Mathf.range(3f));
|
generateEffect.at(x + Mathf.range(generateEffectRnd), y + Mathf.range(generateEffectRnd));
|
||||||
Item item = items.take();
|
Item item = items.take();
|
||||||
productionEfficiency = getItemEfficiency(item);
|
productionEfficiency = getItemEfficiency(item);
|
||||||
explosiveness = item.explosiveness;
|
explosiveness = item.explosiveness;
|
||||||
|
Reference in New Issue
Block a user