Drill multipliers for regular drills and beam drills (#8339)
* Drill multipliers for other drills * h
This commit is contained in:
@@ -42,6 +42,9 @@ public class BeamDrill extends Block{
|
|||||||
/** How many times faster the drill will progress when boosted by an optional consumer. */
|
/** How many times faster the drill will progress when boosted by an optional consumer. */
|
||||||
public float optionalBoostIntensity = 2.5f;
|
public float optionalBoostIntensity = 2.5f;
|
||||||
|
|
||||||
|
/** Multipliers of drill speed for each item. Defaults to 1. */
|
||||||
|
public ObjectFloatMap<Item> drillMultipliers = new ObjectFloatMap<>();
|
||||||
|
|
||||||
public Color sparkColor = Color.valueOf("fd9e81"), glowColor = Color.white;
|
public Color sparkColor = Color.valueOf("fd9e81"), glowColor = Color.white;
|
||||||
public float glowIntensity = 0.2f, pulseIntensity = 0.07f;
|
public float glowIntensity = 0.2f, pulseIntensity = 0.07f;
|
||||||
public float glowScl = 3f;
|
public float glowScl = 3f;
|
||||||
@@ -161,7 +164,7 @@ public class BeamDrill extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(item != null){
|
if(item != null){
|
||||||
float width = drawPlaceText(Core.bundle.formatFloat("bar.drillspeed", 60f / drillTime * count, 2), x, y, valid);
|
float width = drawPlaceText(Core.bundle.formatFloat("bar.drillspeed", 60f / getDrillTime(item) * count, 2), x, y, valid);
|
||||||
if(!multiple){
|
if(!multiple){
|
||||||
float dx = x * tilesize + offset - width/2f - 4f, dy = y * tilesize + offset + size * tilesize / 2f + 5, s = iconSmall / 4f;
|
float dx = x * tilesize + offset - width/2f - 4f, dy = y * tilesize + offset + size * tilesize / 2f + 5, s = iconSmall / 4f;
|
||||||
Draw.mixcol(Color.darkGray, 1f);
|
Draw.mixcol(Color.darkGray, 1f);
|
||||||
@@ -194,6 +197,10 @@ public class BeamDrill extends Block{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float getDrillTime(Item item){
|
||||||
|
return drillTime / drillMultipliers.get(item, 1f);
|
||||||
|
}
|
||||||
|
|
||||||
public class BeamDrillBuild extends Building{
|
public class BeamDrillBuild extends Building{
|
||||||
public Tile[] facing = new Tile[size];
|
public Tile[] facing = new Tile[size];
|
||||||
public Point2[] lasers = new Point2[size];
|
public Point2[] lasers = new Point2[size];
|
||||||
@@ -227,6 +234,7 @@ public class BeamDrill extends Block{
|
|||||||
updateFacing();
|
updateFacing();
|
||||||
|
|
||||||
float multiplier = Mathf.lerp(1f, optionalBoostIntensity, optionalEfficiency);
|
float multiplier = Mathf.lerp(1f, optionalBoostIntensity, optionalEfficiency);
|
||||||
|
float drillTime = getDrillTime(lastItem);
|
||||||
boostWarmup = Mathf.lerpDelta(boostWarmup, optionalEfficiency, 0.1f);
|
boostWarmup = Mathf.lerpDelta(boostWarmup, optionalEfficiency, 0.1f);
|
||||||
lastDrillSpeed = (facingAmount * multiplier * timeScale) / drillTime;
|
lastDrillSpeed = (facingAmount * multiplier * timeScale) / drillTime;
|
||||||
|
|
||||||
|
|||||||
@@ -31,9 +31,6 @@ public class BurstDrill extends Drill{
|
|||||||
public Sound drillSound = Sounds.drillImpact;
|
public Sound drillSound = Sounds.drillImpact;
|
||||||
public float drillSoundVolume = 0.6f, drillSoundPitchRand = 0.1f;
|
public float drillSoundVolume = 0.6f, drillSoundPitchRand = 0.1f;
|
||||||
|
|
||||||
/** Multipliers of drill speed for each item. Defaults to 1. */
|
|
||||||
public ObjectFloatMap<Item> drillMultipliers = new ObjectFloatMap<>();
|
|
||||||
|
|
||||||
public BurstDrill(String name){
|
public BurstDrill(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ public class Drill extends Block{
|
|||||||
/** Chance the update effect will appear. */
|
/** Chance the update effect will appear. */
|
||||||
public float updateEffectChance = 0.02f;
|
public float updateEffectChance = 0.02f;
|
||||||
|
|
||||||
|
/** Multipliers of drill speed for each item. Defaults to 1. */
|
||||||
|
public ObjectFloatMap<Item> drillMultipliers = new ObjectFloatMap<>();
|
||||||
|
|
||||||
public boolean drawRim = false;
|
public boolean drawRim = false;
|
||||||
public boolean drawSpinSprite = true;
|
public boolean drawSpinSprite = true;
|
||||||
public Color heatColor = Color.valueOf("ff5512");
|
public Color heatColor = Color.valueOf("ff5512");
|
||||||
@@ -160,7 +163,7 @@ public class Drill extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float getDrillTime(Item item){
|
public float getDrillTime(Item item){
|
||||||
return drillTime + hardnessDrillMultiplier * item.hardness;
|
return (drillTime + hardnessDrillMultiplier * item.hardness) / drillMultipliers.get(item, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user