diff --git a/build.gradle b/build.gradle index 59385ba..9ada601 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'forge' apply plugin: 'scala' version = "1.0.4" -ext.bdlibver = "1.2.0.35" +ext.bdlibver = "1.2.0.36" ext.versuffix = "mc164" if (project.hasProperty('buildnum')) { diff --git a/resources/assets/gendustry/gendustry-recipes.cfg b/resources/assets/gendustry/gendustry-recipes.cfg index 4a4a507..2883639 100644 --- a/resources/assets/gendustry/gendustry-recipes.cfg +++ b/resources/assets/gendustry/gendustry-recipes.cfg @@ -44,25 +44,35 @@ SRS => gendustry:PowerModule AGA Q = I:netherquartz +L = I:dyePowder@4 // Lapis ifMod "BuildCraft|Silicon" { - Y = buildcraft.BuildCraftSilicon[redstoneChipset] @ 4 // BC has no proper item interface? + Y = buildcraft.BuildCraftSilicon[redstoneChipset] @ 4 // Pulsating + Z = buildcraft.BuildCraftSilicon[redstoneChipset] @ 2 // Golden DQD QYQ => gendustry:GeneticsProcessor DQD + DLD + LZL => gendustry:EnvProcessor + DLD + // alternative recipe, cheaper but takes a lot of power assembly: D*2, Y, Q*2, 100000 mj => gendustry:GeneticsProcessor + assembly: D*2, Z, L*2, 150000 mj => gendustry:EnvProcessor } else { Y = I:enderPearl DQD RYR => gendustry:GeneticsProcessor DQD -} + DLD + LGL => gendustry:EnvProcessor + DLD +} TgT R_R => gendustry:UpgradeFrame @@ -181,12 +191,6 @@ BJB SXS => gendustry:"upgrade.prod" BAB -Z = I:blazePowder - -AZA -QXQ => gendustry:"upgrade.hell" -AZA - F = I:fermentedSpiderEye FLF @@ -197,11 +201,35 @@ I_I _X_ => gendustry:"upgrade.territory" I_I +_Z_ +RXR => gendustry:"upgrade.stabilizer" +_R_ + L = gendustry:ClimateModule R = I:reeds S = B:sand N = B:hellrock O = I:snowball +Z = I:blazePowder +E = gendustry:EnvProcessor +V = B:vine +s = B:grass + +ALA +ZXZ => gendustry:"upgrade.hell" +AEA + +ALA +SXS => gendustry:"upgrade.desert" +AEA + +ALA +VXV => gendustry:"upgrade.jungle" +AEA + +ALA +sXs => gendustry:"upgrade.plains" +AEA SSS BXB => gendustry:"upgrade.dryer" diff --git a/resources/assets/gendustry/gendustry-tuning.cfg b/resources/assets/gendustry/gendustry-tuning.cfg index 0245697..9ed9254 100644 --- a/resources/assets/gendustry/gendustry-tuning.cfg +++ b/resources/assets/gendustry/gendustry-tuning.cfg @@ -156,8 +156,9 @@ cfg Upgrades { // id is used in saves, changing it will brake any upgrades that already exist // max is the maximum number installed in a single apiary // valid modifiers: - // * Boolean: sealed, selfLighted, sunlightSimulated, hellish, automated, collectingPollen + // * Boolean: sealed, selfLighted, sunlightSimulated, automated, collectingPollen // * Numeric: lifespan, territory, mutation, production, flowering, geneticDecay, energy, temperature, humidity + // * String: biomeOverride cfg prod { id = 0 @@ -240,7 +241,7 @@ cfg Upgrades { id = 13 max = 1 energy *= 1.5 - hellish = Y + biomeOverride = Hell } cfg auto { @@ -256,6 +257,34 @@ cfg Upgrades { energy *= 1.25 collectingPollen = Y } + + cfg desert { + id = 16 + max = 1 + energy *= 1.20 + biomeOverride = Desert + } + + cfg plains { + id = 17 + max = 1 + energy *= 1.20 + biomeOverride = Plains + } + + cfg jungle { + id = 18 + max = 1 + energy *= 1.20 + biomeOverride = Jungle + } + + cfg stabilizer { + id = 19 + max = 1 + energy *= 2 + geneticDecay *= 0 + } } cfg Power { diff --git a/resources/assets/gendustry/lang/en_US.lang b/resources/assets/gendustry/lang/en_US.lang index 3433d09..6f18849 100644 --- a/resources/assets/gendustry/lang/en_US.lang +++ b/resources/assets/gendustry/lang/en_US.lang @@ -15,6 +15,7 @@ item.gendustry.MutagenTank.name=Mutagen Tank item.gendustry.BeeReceptacle.name=Bee Receptacle item.gendustry.PowerModule.name=Power Module item.gendustry.GeneticsProcessor.name=Genetics Processor +item.gendustry.EnvProcessor.name=Enviromental Processor item.gendustry.UpgradeFrame.name=Upgrade Frame item.gendustry.ClimateModule.name=Climate Control Module item.gendustry.Labware.name=Genetics Labware @@ -53,13 +54,17 @@ gendustry.upgrades.territory.name=Territory Upgrade gendustry.upgrades.sealing.name=Seal Upgrade gendustry.upgrades.light.name=Light Upgrade gendustry.upgrades.sky.name=Open Sky Upgrade -gendustry.upgrades.hell.name=Hell Upgrade +gendustry.upgrades.hell.name=Hell Emulation Upgrade gendustry.upgrades.auto.name=Automation Upgrade gendustry.upgrades.humidifier.name=Humidifier Upgrade gendustry.upgrades.dryer.name=Dryer Upgrade gendustry.upgrades.heater.name=Heater Upgrade gendustry.upgrades.sieve.name=Sieve Upgrade gendustry.upgrades.cooler.name=Cooler Upgrade +gendustry.upgrades.desert.name=Desert Emulation Upgrade +gendustry.upgrades.plains.name=Plains Emulation Upgrade +gendustry.upgrades.jungle.name=Jungle Emulation Upgrade +gendustry.upgrades.stabilizer.name=Genetic Stabilizer Upgrade # ==== GUI AND TOOLTIPS ==== @@ -86,7 +91,7 @@ gendustry.label.mutatron.death=Death chance (ignoble): %s%% gendustry.label.mutatron.degrade=Degrade chance (pristine): %s%% gendustry.label.mod.automated=* Automation -gendustry.label.mod.hellish=* Hell Environment Simulation +gendustry.label.mod.biome=* Biome Override: %s gendustry.label.mod.sealed=* Rain Protection gendustry.label.mod.selflighted=* Internal Lighting gendustry.label.mod.sky=* Open Sky Simulation diff --git a/resources/assets/gendustry/textures/items/envprocessor.png b/resources/assets/gendustry/textures/items/envprocessor.png new file mode 100644 index 0000000..ed593db Binary files /dev/null and b/resources/assets/gendustry/textures/items/envprocessor.png differ diff --git a/resources/assets/gendustry/textures/items/envsprocessor.psd b/resources/assets/gendustry/textures/items/envsprocessor.psd new file mode 100644 index 0000000..79e6cd4 Binary files /dev/null and b/resources/assets/gendustry/textures/items/envsprocessor.psd differ diff --git a/resources/assets/gendustry/textures/items/upgrades/desert.png b/resources/assets/gendustry/textures/items/upgrades/desert.png new file mode 100644 index 0000000..2b4e279 Binary files /dev/null and b/resources/assets/gendustry/textures/items/upgrades/desert.png differ diff --git a/resources/assets/gendustry/textures/items/upgrades/jungle.png b/resources/assets/gendustry/textures/items/upgrades/jungle.png new file mode 100644 index 0000000..3dc2d16 Binary files /dev/null and b/resources/assets/gendustry/textures/items/upgrades/jungle.png differ diff --git a/resources/assets/gendustry/textures/items/upgrades/plains.png b/resources/assets/gendustry/textures/items/upgrades/plains.png new file mode 100644 index 0000000..abe5830 Binary files /dev/null and b/resources/assets/gendustry/textures/items/upgrades/plains.png differ diff --git a/resources/assets/gendustry/textures/items/upgrades/stabilizer.png b/resources/assets/gendustry/textures/items/upgrades/stabilizer.png new file mode 100644 index 0000000..06bd893 Binary files /dev/null and b/resources/assets/gendustry/textures/items/upgrades/stabilizer.png differ diff --git a/resources/assets/gendustry/textures/items/upgrades/upgrades.psd b/resources/assets/gendustry/textures/items/upgrades/upgrades.psd index c113085..b28be91 100644 Binary files a/resources/assets/gendustry/textures/items/upgrades/upgrades.psd and b/resources/assets/gendustry/textures/items/upgrades/upgrades.psd differ diff --git a/src/net/bdew/gendustry/api/ApiaryModifiers.java b/src/net/bdew/gendustry/api/ApiaryModifiers.java index 4cf07fd..264f3d6 100644 --- a/src/net/bdew/gendustry/api/ApiaryModifiers.java +++ b/src/net/bdew/gendustry/api/ApiaryModifiers.java @@ -9,6 +9,8 @@ package net.bdew.gendustry.api; +import net.minecraft.world.biome.BiomeGenBase; + public class ApiaryModifiers { public float territory = 1; @@ -29,10 +31,11 @@ public class ApiaryModifiers { public boolean isSealed = false; public boolean isSelfLighted = false; public boolean isSunlightSimulated = false; - public boolean isHellish = false; public boolean isAutomated = false; public boolean isCollectingPollen = false; + public BiomeGenBase biomeOverride = null; + public float energy = 1; public float temperature = 0; diff --git a/src/net/bdew/gendustry/config/Items.scala b/src/net/bdew/gendustry/config/Items.scala index afe63c5..c4d1688 100644 --- a/src/net/bdew/gendustry/config/Items.scala +++ b/src/net/bdew/gendustry/config/Items.scala @@ -32,6 +32,7 @@ object Items extends ItemManager(Config.IDs) { regSimpleItem("BeeReceptacle") regSimpleItem("PowerModule") regSimpleItem("GeneticsProcessor") + regSimpleItem("EnvProcessor") regSimpleItem("UpgradeFrame") regSimpleItem("ClimateModule") diff --git a/src/net/bdew/gendustry/machines/apiary/TileApiary.scala b/src/net/bdew/gendustry/machines/apiary/TileApiary.scala index 6644a65..7d8f369 100644 --- a/src/net/bdew/gendustry/machines/apiary/TileApiary.scala +++ b/src/net/bdew/gendustry/machines/apiary/TileApiary.scala @@ -207,7 +207,7 @@ with IBeeHousing { def isSealed = mods.isSealed def isSelfLighted = mods.isSelfLighted def isSunlightSimulated = mods.isSunlightSimulated - def isHellish = mods.isHellish + def isHellish = mods.biomeOverride == BiomeGenBase.hell // IBeeHousing def setQueen(itemstack: ItemStack) = setInventorySlotContents(0, itemstack) @@ -216,19 +216,21 @@ with IBeeHousing { def getDrone = getStackInSlot(slots.drone) def canBreed = true + def getModifiedBiome = if (mods.biomeOverride == null) getBiome else mods.biomeOverride + // IHousing def setErrorState(state: Int) = errorState := state def getOwnerName = owner def getXCoord = xCoord def getYCoord = yCoord def getZCoord = zCoord - def getBiomeId = if (mods.isHellish) BiomeGenBase.hell.biomeID else getBiome.biomeID - def getTemperature: EnumTemperature = { - if (mods.isHellish || EnumTemperature.isBiomeHellish(getBiome.biomeID)) - return EnumTemperature.HELLISH - return EnumTemperature.getFromValue(getBiome.temperature + mods.temperature) - } - def getHumidity = EnumHumidity.getFromValue(getBiome.rainfall + mods.humidity) + def getBiomeId = getModifiedBiome.biomeID + def getTemperature = + if (EnumTemperature.isBiomeHellish(getModifiedBiome)) + EnumTemperature.HELLISH + else + EnumTemperature.getFromValue(getModifiedBiome.temperature + mods.temperature) + def getHumidity = EnumHumidity.getFromValue(getModifiedBiome.rainfall + mods.humidity) def getErrorOrdinal = errorState def addProduct(product: ItemStack, all: Boolean): Boolean = { var p = product diff --git a/src/net/bdew/gendustry/machines/apiary/upgrades/ItemApiaryUpgrade.scala b/src/net/bdew/gendustry/machines/apiary/upgrades/ItemApiaryUpgrade.scala index 51365e1..a707754 100644 --- a/src/net/bdew/gendustry/machines/apiary/upgrades/ItemApiaryUpgrade.scala +++ b/src/net/bdew/gendustry/machines/apiary/upgrades/ItemApiaryUpgrade.scala @@ -45,8 +45,8 @@ class ItemApiaryUpgrade(id: Int) extends Item(id) with IApiaryUpgrade { if (mods.isAutomated) l.add(Misc.toLocal(Gendustry.modId + ".label.mod.automated")) - if (mods.isHellish) - l.add(Misc.toLocal(Gendustry.modId + ".label.mod.hellish")) + if (mods.biomeOverride != null) + l.add(Misc.toLocalF(Gendustry.modId + ".label.mod.biome", mods.biomeOverride.biomeName)) if (mods.isSealed) l.add(Misc.toLocal(Gendustry.modId + ".label.mod.sealed")) if (mods.isSelfLighted) diff --git a/src/net/bdew/gendustry/machines/apiary/upgrades/Upgrades.scala b/src/net/bdew/gendustry/machines/apiary/upgrades/Upgrades.scala index 5e74cde..4a77836 100644 --- a/src/net/bdew/gendustry/machines/apiary/upgrades/Upgrades.scala +++ b/src/net/bdew/gendustry/machines/apiary/upgrades/Upgrades.scala @@ -15,6 +15,7 @@ import net.bdew.gendustry.config.{Items, Tuning} import net.bdew.lib.recipes.gencfg.{EntryStr, ConfigSection} import cpw.mods.fml.common.registry.GameRegistry import net.minecraft.item.ItemStack +import net.bdew.lib.Misc object Upgrades { val map = collection.mutable.Map.empty[Int, Upgrade] @@ -27,7 +28,7 @@ object Upgrades { } } - def makeMod(upg: String, n: String, e: EntryModifier): ModFunc = { + def makeNumMod(upg: String, n: String, e: EntryModifier): ModFunc = { val calc: (Float, Int) => Float = e match { case EntryModifierAdd(v) => (x, n) => x + v * n case EntryModifierSub(v) => (x, n) => x - v * n @@ -48,14 +49,16 @@ object Upgrades { } } - def makeBoolMod(upg: String, n: String, b: Boolean): ModFunc = n match { - case "sealed" => (a, n) => a.isSealed = b - case "selfLighted" => (a, n) => a.isSelfLighted = b - case "sunlightSimulated" => (a, n) => a.isSunlightSimulated = b - case "hellish" => (a, n) => a.isHellish = b - case "automated" => (a, n) => a.isAutomated = b - case "collectingPollen" => (a, n) => a.isCollectingPollen = b - case x => sys.error("Unknown boolean upgrade modifier '%s' in upgrade '%s'".format(x, upg)) + def str2bool(s: String) = Tuning.trueVals.contains(s.toLowerCase) + + def makeStrMod(upg: String, n: String, v: String): ModFunc = n match { + case "sealed" => (a, n) => a.isSealed = str2bool(v) + case "selfLighted" => (a, n) => a.isSelfLighted = str2bool(v) + case "sunlightSimulated" => (a, n) => a.isSunlightSimulated = str2bool(v) + case "automated" => (a, n) => a.isAutomated = str2bool(v) + case "collectingPollen" => (a, n) => a.isCollectingPollen = str2bool(v) + case "biomeOverride" => (a, n) => a.biomeOverride = Misc.getBiomeByName(v) + case x => sys.error("Unknown string upgrade modifier '%s' in upgrade '%s'".format(x, upg)) } def init() { @@ -63,8 +66,8 @@ object Upgrades { val id = sect.getInt("id") val max = sect.getInt("max") val mods = sect.flatMap({ - case (pname, EntryStr(_)) => Some(makeBoolMod(name, pname, sect.getBoolean(pname))) - case (pname, x: EntryModifier) => Some(makeMod(name, pname, x)) + case (pname, EntryStr(v)) => Some(makeStrMod(name, pname, v)) + case (pname, x: EntryModifier) => Some(makeNumMod(name, pname, x)) case ("id", _) | ("max", _) => None case (pname, v) => sys.error("Unknown upgrade modifier '%s' - %s in upgrade '%s'".format(pname, v, name)) })