From 3702facb3ddf2b56773d44b76d57bae1cb240f11 Mon Sep 17 00:00:00 2001 From: Steelux <70096037+Steelux8@users.noreply.github.com> Date: Fri, 24 Jun 2022 18:12:43 +0100 Subject: Boost XL Turbine Speed and Allow TecTech Hatches (#207) * Implement Higher Speed Mode and Tectech Hatches - Added the option to use Tectech Dynamo Hatches on XL turbines; - Tweaked the current speed from 18x to the 16x that Alkalus told me was intended (not 100% sure about this, breaks current setups somewhat but my testing gave a higher value than intended); - Added Fast Mode, which can be switched into to triple the multi's speed to 48x, but with greatly accelerated (12x) turbine damage and maintenance problems; - Integrated Loose Mode into the mode changing for Steam and SH Steam XL Turbines, so that any combination is possible; - Added information to the tooltip to clarify the numbers and speed. * Clarified Loose Mode Settings in Tooltip --- .../turbines/GT_MTE_LargeTurbine_Plasma.java | 2 +- .../turbines/GT_MTE_LargeTurbine_SHSteam.java | 18 ++++- .../turbines/GT_MTE_LargeTurbine_Steam.java | 16 ++++- .../GregtechMetaTileEntity_LargerTurbineBase.java | 80 +++++++++++++++++++--- 4 files changed, 101 insertions(+), 15 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java index 02ae2b1b4f..3cdd3a2b9f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java @@ -107,7 +107,7 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur float aTotalBaseEff = 0; float aTotalOptimalFlow = 0; ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine(); - for (int i=0;i<18;i++) { + for (int i=0;i 1000) { mRuntime = 0; - if (getBaseMetaTileEntity().getRandomNumber(6000) == 0) { + + if (getBaseMetaTileEntity().getRandomNumber(6000) < maintenanceThreshold) { switch (getBaseMetaTileEntity().getRandomNumber(6)) { case 0: mWrench = false; @@ -583,7 +606,9 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM } } for (GT_MetaTileEntity_Hatch_Turbine aHatch : getFullTurbineAssemblies()) { - aHatch.damageTurbine(mEUt, damageFactorLow, damageFactorHigh); + for (int i = 0; i < turbineDamageMultiplier; i++) { + aHatch.damageTurbine(mEUt, damageFactorLow, damageFactorHigh); + } } } return true; @@ -681,7 +706,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM public boolean polluteEnvironment(int aPollutionLevel) { if (this.requiresMufflers()) { - mPollution += aPollutionLevel; + mPollution += aPollutionLevel * pollutionMultiplier; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { if (isValidMetaTileEntity(tHatch)) { if (mPollution >= 10000) { @@ -699,17 +724,50 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM } @Override public long maxAmperesOut() { - return 16; + // This should not be a hard limit, due to TecTech dynamos + if (mFastMode) { + return 64; + } + else { + return 16; + } } + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setBoolean("mFastMode", mFastMode); + super.saveNBTData(aNBT); + } + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mFastMode = aNBT.getBoolean("mFastMode"); + super.loadNBTData(aNBT); + } @Override public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (!KeyboardUtils.isShiftKeyDown()) { - //super.onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ); + mFastMode = Utils.invertBoolean(mFastMode); + if (mFastMode){ + PlayerUtils.messagePlayer(aPlayer, "Running in Fast (48x) Mode."); + speedMultiplier = 48; + maintenanceThreshold = 12; + pollutionMultiplier = 3; + turbineDamageMultiplier = 12; } else { - /* + PlayerUtils.messagePlayer(aPlayer, "Running in Slow (16x) Mode."); + speedMultiplier = 16; + maintenanceThreshold = 1; + pollutionMultiplier = 1; + turbineDamageMultiplier = 1; + } + } + + /*if (!KeyboardUtils.isShiftKeyDown()) { + super.onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ); + } + else { + this.mIsAnimated = Utils.invertBoolean(mIsAnimated); if (this.mIsAnimated) { PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture."); @@ -724,8 +782,8 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM } } } - */} - } + } + }*/ @Override public final ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { -- cgit