aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/items
diff options
context:
space:
mode:
authorSteelux <70096037+Steelux8@users.noreply.github.com>2022-04-08 17:31:56 +0100
committerGitHub <noreply@github.com>2022-04-08 18:31:56 +0200
commitfd88780087aef8e5c65a40db15f7e4f36f997ef3 (patch)
tree17e1f96eccc1a5ae302eeb3320d5bb2e10fe2ce3 /src/main/java/gregtech/api/items
parent1a7e8f13d7253d1b14dab2eeb99d406234e2485f (diff)
downloadGT5-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/api/items')
-rw-r--r--src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java33
1 files changed, 16 insertions, 17 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);