Fixed some inconsistencies in how damage/speed of tools is calculated in GUIs

* Fixed damage not being calculated properly in Crafting Stations
 * Fixed Crafting Stations stonebound speed calculations (they were using a different algorithm)
 * Fixed typo that made GUIs show the primary mining speed of dual harvest twice
 * Fixed Stonebound damage bonus/loss always being truncated to an int in GUIs

Conflicts:
	src/main/java/tconstruct/tools/gui/CraftingStationGui.java
	src/main/java/tconstruct/tools/gui/ToolStationGui.java
This commit is contained in:
squeek committed 2014-07-06 23:53:35 -07:00
1 parent 41ff78b75c
commit d719885de7
2 files changed
+9 -7

No files matched your search

@@ -136,7 +136,7 @@ public class CraftingStationGui extends GuiContainer
// Attack
if (categories.contains("weapon"))
{
int attack = (int) (tags.getInteger("Attack"));
int attack = (int) (tags.getInteger("Attack"))+1;
float stoneboundDamage = (float) Math.log(durability / 72f + 1) * -2 * stonebound;
attack += stoneboundDamage;
attack *= tool.getDamageModifier();
@@ -152,9 +152,10 @@ public class CraftingStationGui extends GuiContainer
if (stoneboundDamage != 0)
{
DecimalFormat df = new DecimalFormat("##.##");
heart = stoneboundDamage == 2 ? StatCollector.translateToLocal("gui.partcrafter8") : StatCollector.translateToLocal("gui.partcrafter9");
String bloss = stoneboundDamage > 0 ? StatCollector.translateToLocal("gui.toolstation4") : StatCollector.translateToLocal("gui.toolstation5");
this.fontRendererObj.drawString(bloss + (int) stoneboundDamage / 2 + heart, xSize + 8, base + offset * 10, 0xffffff);
this.fontRendererObj.drawString(bloss + df.format(stoneboundDamage / 2f) + heart, xSize + 8, base + offset * 10, 0xffffff);
offset++;
}
offset++;
@@ -217,11 +218,11 @@ public class CraftingStationGui extends GuiContainer
{
float mineSpeed = tags.getInteger("MiningSpeed") / 100f;
float mineSpeed2 = tags.getInteger("MiningSpeed2") / 100f;
float stoneboundSpeed = (float) Math.log(durability / 90f + 1) * 2 * stonebound;
float stoneboundSpeed = (float) Math.log(durability / 72f + 1) * 2 * stonebound;
DecimalFormat df = new DecimalFormat("##.##");
df.setRoundingMode(RoundingMode.DOWN);
float trueSpeed = mineSpeed + stoneboundSpeed;
float trueSpeed2 = mineSpeed + stoneboundSpeed;
float trueSpeed2 = mineSpeed2 + stoneboundSpeed;
fontRendererObj.drawString(StatCollector.translateToLocal("gui.toolstation12"), xSize + 8, base + offset * 10, 0xffffff);
offset++;
@@ -266,7 +267,7 @@ public class CraftingStationGui extends GuiContainer
float trueSpeed = mineSpeed / (heads * 100f);
float stoneboundSpeed = (float) Math.log(durability / 90f + 1) * 2 * stonebound;
float stoneboundSpeed = (float) Math.log(durability / 72f + 1) * 2 * stonebound;
DecimalFormat df = new DecimalFormat("##.##");
df.setRoundingMode(RoundingMode.DOWN);
trueSpeed += stoneboundSpeed;
@@ -231,9 +231,10 @@ public class ToolStationGui extends GuiContainer
if (stoneboundDamage != 0)
{
DecimalFormat df = new DecimalFormat("##.##");
heart = stoneboundDamage == 2 ? StatCollector.translateToLocal("gui.partcrafter8") : StatCollector.translateToLocal("gui.partcrafter9");
String bloss = stoneboundDamage > 0 ? StatCollector.translateToLocal("gui.toolstation4") : StatCollector.translateToLocal("gui.toolstation5");
this.fontRendererObj.drawString(bloss + (int) stoneboundDamage / 2 + heart, 294, base + offset * 10, 0xffffff);
this.fontRendererObj.drawString(bloss + df.format(stoneboundDamage / 2f) + heart, xSize + 8, base + offset * 10, 0xffffff);
offset++;
}
offset++;
@@ -300,7 +301,7 @@ public class ToolStationGui extends GuiContainer
DecimalFormat df = new DecimalFormat("##.##");
df.setRoundingMode(RoundingMode.DOWN);
float trueSpeed = mineSpeed + stoneboundSpeed;
float trueSpeed2 = mineSpeed + stoneboundSpeed;
float trueSpeed2 = mineSpeed2 + stoneboundSpeed;
fontRendererObj.drawString(StatCollector.translateToLocal("gui.toolstation12"), 294, base + offset * 10, 0xffffff);
offset++;