Unhardcode Drill Effect Randomness (#6144)

* Unhardcode Drill Effect Randomness

* I should start refusing to make prs for people
This commit is contained in:
Matthew Peng
2021-10-12 19:32:58 -07:00
committed by GitHub
parent 9e01d1a69d
commit fdfe381b6e

View File

@@ -46,6 +46,8 @@ public class Drill extends Block{
public boolean drawMineItem = true;
/** Effect played when an item is produced. This is colored. */
public Effect drillEffect = Fx.mine;
/** Drill effect randomness. Block size by default. */
public float drillEffectRnd = -1f;
/** Speed the drill bit rotates at. */
public float rotateSpeed = 2f;
/** Effect randomly played while drilling. */
@@ -73,6 +75,12 @@ public class Drill extends Block{
ambientSoundVolume = 0.018f;
}
@Override
public void init(){
super.init();
if(drillEffectRnd < 0) drillEffectRnd = size;
}
@Override
public void drawRequestConfigTop(BuildPlan req, Eachable<BuildPlan> list){
if(!req.worldContext) return;
@@ -285,7 +293,7 @@ public class Drill extends Block{
progress %= delay;
drillEffect.at(x + Mathf.range(size), y + Mathf.range(size), dominantItem.color);
drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color);
}
}