diff options
author | Steelux <70096037+Steelux8@users.noreply.github.com> | 2022-04-08 17:31:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 18:31:56 +0200 |
commit | fd88780087aef8e5c65a40db15f7e4f36f997ef3 (patch) | |
tree | 17e1f96eccc1a5ae302eeb3320d5bb2e10fe2ce3 /src/main/java/gregtech | |
parent | 1a7e8f13d7253d1b14dab2eeb99d406234e2485f (diff) | |
download | GT5-Unofficial-fd88780087aef8e5c65a40db15f7e4f36f997ef3.tar.gz GT5-Unofficial-fd88780087aef8e5c65a40db15f7e4f36f997ef3.tar.bz2 GT5-Unofficial-fd88780087aef8e5c65a40db15f7e4f36f997ef3.zip |
Loose Mode Turbine Changes (#1000)
* Loose Mode Turbine Changes
- Changed Steam loose mode efficiency and optimal flow to improve this mode, especially on the lategame turbines. Efficiency was capped at 75% regardless of the regular value, with this change setting it to always be a percentage of the tight mode efficiency, down to 60% for those lategame turbines, and a maximum of 90% of the tight mode value for the lowest efficiency turbines.
- Also changed the optimal flow calculation to grant a larger optimal flow in loose mode than it was before the change, for all turbines except the highest efficiency ones;
- Improved the tooltip for these turbines, updating to these new values, fixing a typo and showing the EU/t for steam at optimal flow, in both modes.
* Fixed Weird Spacing
* Update GT_MetaGenerated_Tool.java
* Remove Duplicate Formula for Loose Mode
Diffstat (limited to 'src/main/java/gregtech')
-rw-r--r-- | src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java | 33 | ||||
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java | 47 |
2 files changed, 53 insertions, 27 deletions
diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java index ea5ef281d3..19295c2c43 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java +++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java @@ -54,6 +54,7 @@ import java.util.concurrent.ConcurrentHashMap; import static gregtech.api.enums.GT_Values.MOD_ID_FR; import static gregtech.api.enums.GT_Values.MOD_ID_RC; +import static gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine_Steam.calculateLooseFlow; /** * This is an example on how you can create a Tool ItemStack, in this case a Bismuth Wrench: @@ -350,28 +351,26 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements int tOffset = getElectricStats(aStack) != null ? 2 : 1; if (tStats != null) { if (tStats instanceof GT_Tool_Turbine) { + + int aBaseEff=(int)(5+getToolCombatDamage(aStack))*1000; int aOptFlow=GT_Utility.safeInt((long)Math.max(Float.MIN_NORMAL, ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed * 50)); - aList.add(tOffset + 0, EnumChatFormatting.WHITE + String.format(transItem("001", "Durability: %s/%s"), "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ", " " + tMaxDamage) + EnumChatFormatting.GRAY); + aList.add(tOffset + 0, EnumChatFormatting.WHITE + String.format(transItem("001", "Durability: %s/%s"), "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ", " " + tMaxDamage) + EnumChatFormatting.GRAY); aList.add(tOffset + 1, EnumChatFormatting.WHITE + String.format(transItem("002", "%s lvl %s"), tMaterial.mLocalizedName + EnumChatFormatting.YELLOW, "" + getHarvestLevel(aStack, "")) + EnumChatFormatting.GRAY); aList.add(tOffset + 2, EnumChatFormatting.WHITE + String.format(transItem("005", "Turbine Efficiency: %s"), "" + EnumChatFormatting.BLUE + (50.0F + (10.0F * getToolCombatDamage(aStack)))) + EnumChatFormatting.GRAY); - aList.add(tOffset + 3, EnumChatFormatting.WHITE + String.format(transItem("006", "Optimal Steam flow: %sL/sec"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY)); + aList.add(tOffset + 3, EnumChatFormatting.WHITE + String.format(transItem("006", "Optimal Steam flow: %sL/t"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * (1000 / 20)) + EnumChatFormatting.GRAY)); + aList.add(tOffset + 4, EnumChatFormatting.WHITE + String.format(transItem("900", "Energy from Optimal Steam Flow: %sEU/t"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * (1000 / 20)) * (50.0F + (10.0F * getToolCombatDamage(aStack))) / 200 + EnumChatFormatting.GRAY)); { - int aBaseEff=(int)(5+getToolCombatDamage(aStack))*1000; - int aOptFlowLoose=aOptFlow*4; - if(aBaseEff>10000){ - aOptFlowLoose*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f); - aBaseEff=7500; - }else if(aBaseEff>7500){ - aOptFlowLoose*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f); - aBaseEff*=0.75f; - }else{ - aBaseEff*=0.75f; - } - aList.add(tOffset + 4, EnumChatFormatting.GRAY + String.format(transItem("500", "Turbine Efficiency (Loose): %s"), "" + EnumChatFormatting.BLUE + aBaseEff/100f) + EnumChatFormatting.DARK_GRAY); - aList.add(tOffset + 5, EnumChatFormatting.GRAY + String.format(transItem("501", "Optimal Steam flow (Loose): %s L/t"), "" + EnumChatFormatting.GOLD + aOptFlowLoose + EnumChatFormatting.DARK_GRAY)); + long[] calculatedFlow = calculateLooseFlow(aOptFlow, aBaseEff); + long aOptFlowLoose = calculatedFlow[0]; + long aBaseEffLoose = calculatedFlow[1]; + + aList.add(tOffset + 5, EnumChatFormatting.GRAY + String.format(transItem("500", "Turbine Efficiency (Loose): %s"), "" + EnumChatFormatting.BLUE + aBaseEffLoose / 100 + EnumChatFormatting.DARK_GRAY)); + aList.add(tOffset + 6, EnumChatFormatting.GRAY + String.format(transItem("501", "Optimal Steam flow (Loose): %s L/t"), "" + EnumChatFormatting.GOLD + aOptFlowLoose + EnumChatFormatting.DARK_GRAY)); + aList.add(tOffset + 7, EnumChatFormatting.GRAY + String.format(transItem("901", "Energy from Optimal Steam Flow (Loose): %s EU/t"), "" + EnumChatFormatting.GOLD + (aOptFlowLoose / 10000) * (aBaseEffLoose / 2) + EnumChatFormatting.DARK_GRAY)); + } - aList.add(tOffset + 6, EnumChatFormatting.WHITE + String.format(transItem("007", "Optimal Gas flow(EU burnvalue per tick): %sEU/t"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 50) + EnumChatFormatting.GRAY)); - aList.add(tOffset + 7, EnumChatFormatting.WHITE + String.format(transItem("008", "Optimal Plasma flow(Plasma energyvalue per tick): %sEU/t"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 2000) + EnumChatFormatting.GRAY)); + aList.add(tOffset + 8, EnumChatFormatting.WHITE + String.format(transItem("007", "Energy from Optimal Gas Flow: %sEU/t"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 50) * (50.0F + (10.0F * getToolCombatDamage(aStack))) / 100 + EnumChatFormatting.GRAY)); + aList.add(tOffset + 9, EnumChatFormatting.WHITE + String.format(transItem("008", "Energy from Optimal Plasma Flow: %sEU/t"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 2000) * (50.0F + (10.0F * getToolCombatDamage(aStack))) * (1.05 / 100) + EnumChatFormatting.GRAY)); } else { aList.add(tOffset + 0, EnumChatFormatting.WHITE + String.format(transItem("001", "Durability: %s/%s"), "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ", " " + tMaxDamage) + EnumChatFormatting.GRAY); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index 4d11bdaef5..86ed51e879 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -95,16 +95,9 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { if (looseFit) { - aOptFlow *= 4; - if (aBaseEff > 10000) { - aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7500) / 10000F) * 20f); - aBaseEff = 7500; - } else if (aBaseEff > 7500) { - aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7500) / 10000F) * 20f); - aBaseEff *= 0.75f; - } else { - aBaseEff *= 0.75f; - } + long[] calculatedFlow = calculateLooseFlow(aOptFlow, aBaseEff); + aOptFlow = GT_Utility.safeInt(calculatedFlow[0]); + aBaseEff = GT_Utility.safeInt(calculatedFlow[1]); } int tEU = 0; int totalFlow = 0; // Byproducts are based on actual flow @@ -144,6 +137,40 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg return tEU; } + public static long[] calculateLooseFlow(int aOptFlow, int aBaseEff) { + aOptFlow *= 4; + if(aBaseEff>=26000) { + aOptFlow *= Math.pow(1.1f, ((aBaseEff - 8000) / 10000F) * 20f); + aBaseEff *= 0.6f; + }else if(aBaseEff>22000) { + aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7000) / 10000F) * 20f); + aBaseEff *= 0.65f; + }else if(aBaseEff>18000) { + aOptFlow *= Math.pow(1.1f, ((aBaseEff - 6000) / 10000F) * 20f); + aBaseEff *= 0.70f; + }else if(aBaseEff>14000) { + aOptFlow *= Math.pow(1.1f, ((aBaseEff - 5000) / 10000F) * 20f); + aBaseEff *= 0.75f; + }else if(aBaseEff>10000) { + aOptFlow *= Math.pow(1.1f, ((aBaseEff - 4000) / 10000F) * 20f); + aBaseEff *= 0.8f; + }else if(aBaseEff>6000) { + aOptFlow *= Math.pow(1.1f, ((aBaseEff - 3000) / 10000F) * 20f); + aBaseEff *= 0.85f; + }else{ + aBaseEff *= 0.9f; + } + + if (aBaseEff % 100 != 0){ + aBaseEff -= aBaseEff % 100; + } + + long[] looseFlow = new long[2]; + looseFlow[0] = GT_Utility.safeInt(aOptFlow); + looseFlow[1] = GT_Utility.safeInt(aBaseEff); + return looseFlow; + } + @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { |