Improve telepad power usage curve and add configs for values

This commit is contained in:
tterrag1098 committed 2015-05-18 20:45:16 -04:00
1 parent 6215e39410
commit a9c73b70d4
2 files changed
+15 -2

No files matched your search

@@ -468,6 +468,8 @@ public final class Config {
public static boolean telepadLockDimension = true;
public static boolean telepadLockCoords = true;
public static int telepadPowerCoefficient = 100000;
public static int telepadPowerInterdimensional = 100000;
public static float inventoryPanelPowerPerMB = 800.0f;
public static float inventoryPanelScanCostPerSlot = 0.1f;
@@ -1266,6 +1268,10 @@ public final class Config {
"If true, the dimension cannot be set via the GUI, the coord selector must be used.").getBoolean();
telepadLockCoords = config.get(sectionTelepad.name, "lockCoords", telepadLockCoords,
"If true, the coordinates cannot be set via the GUI, the coord selector must be used.").getBoolean();
telepadPowerCoefficient = config.get(sectionTelepad.name, "powerCoefficient", telepadPowerCoefficient,
"Power for a teleport is calculated by the formula:\npower = [this value] * ln(0.005*distance + 1)").getInt();
telepadPowerInterdimensional = config.get(sectionTelepad.name, "powerInterdimensional", telepadPowerInterdimensional,
"The amount of RF required for an interdimensional teleport.").getInt();
inventoryPanelPowerPerMB = config.getFloat("powerPerMB", sectionInventoryPanel.name, inventoryPanelPowerPerMB, 1.0f, 10000.0f,
"Internal power generated per mB. The default of 800/mB matches the RF generation of the Zombie generator. A panel tries to refill only once every second - setting this value too low slows down the scanning speed.");
@@ -343,9 +343,11 @@ public class TileTelePad extends TileTravelAnchor implements IInternalPowerRecei
private int calculateTeleportPower() {
if (worldObj.provider.dimensionId == targetDim) {
this.maxPower = new BlockCoord(this).distance(target) * 1000;
int distance = new BlockCoord(this).distance(target);
double base = Math.log((0.005 * distance) + 1);
this.maxPower = (int) (base * Config.telepadPowerCoefficient);
} else {
this.maxPower = 100000;
this.maxPower = Config.telepadPowerInterdimensional;
}
return this.maxPower;
}
@@ -390,6 +392,11 @@ public class TileTelePad extends TileTravelAnchor implements IInternalPowerRecei
public float getProgress() {
return ((float) powerUsed) / ((float) maxPower);
}
@Override
protected int getProgressUpdateFreq() {
return 1;
}
@Override
public void setProgress(float progress) {