diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 1817432fe..dd3277c02 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -340,6 +340,7 @@ container.generator=Atomreaktor tile.red_wire_coated.name=Geschirmtes rotes Kupferkabel tile.machine_deuterium.name=Deuteriumextraktor container.machine_deuterium=Deuteriumextraktor +tile.machine_battery_potato.name=Kartoffelbatterieblock tile.machine_battery.name=Energiespeicherblock tile.machine_lithium_battery.name=Li-Ion-Energiespeicherblock tile.machine_schrabidium_battery.name=Schrabidium-Energiespeicherblock diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 136b8d349..68b0df274 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -340,6 +340,7 @@ container.generator=Nuclear Reactor tile.red_wire_coated.name=Coated Red Copper Cable tile.machine_deuterium.name=Deuterium Extractor container.machine_deuterium=Deuterium Extractor +tile.machine_battery_potato.name=Potato Battery Block tile.machine_battery.name=Energy Storage Block tile.machine_lithium_battery.name=Li-Ion Energy Storage Block tile.machine_schrabidium_battery.name=Schrabidium Energy Storage Block diff --git a/com/hbm/blocks/test/TestEventTester.java b/com/hbm/blocks/test/TestEventTester.java index ef44a897d..2ea621ca9 100644 --- a/com/hbm/blocks/test/TestEventTester.java +++ b/com/hbm/blocks/test/TestEventTester.java @@ -201,6 +201,7 @@ public class TestEventTester extends Block { //RED FLUSHES ALL RAD //STE PRINTS RAD CHUNKS //URA PRINTS TOTAL RAD + //THO SETS RAD TO 1000000 if(worldObj.getBlock(x1, y1 - 1, z1) == ModBlocks.block_aluminium) { @@ -245,6 +246,15 @@ public class TestEventTester extends Block { System.out.println(r); } + if(worldObj.getBlock(x1, y1 - 1, z1) == ModBlocks.block_thorium) { + + Chunk chunk = worldObj.getChunkFromBlockCoords(x1, z1); + + data.setRadForCoord(chunk.xPosition, chunk.zPosition, 1000000); + + System.out.println(data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition)); + } + } } diff --git a/com/hbm/entity/effect/EntityFalloutRain.java b/com/hbm/entity/effect/EntityFalloutRain.java index fbefacf42..97e7fa790 100644 --- a/com/hbm/entity/effect/EntityFalloutRain.java +++ b/com/hbm/entity/effect/EntityFalloutRain.java @@ -5,7 +5,9 @@ import java.util.List; import com.hbm.blocks.ModBlocks; import com.hbm.explosion.NukeEnvironmentalEffect; import com.hbm.lib.Library; +import com.hbm.main.MainRegistry; import com.hbm.potion.HbmPotion; +import com.hbm.saveddata.AuxSavedData; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -17,6 +19,7 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class EntityFalloutRain extends Entity { @@ -41,7 +44,7 @@ public class EntityFalloutRain extends Entity { if(!worldObj.isRemote) { - for(int i = 0; i < 256; i++) { + for(int i = 0; i < MainRegistry.fSpeed; i++) { Vec3 vec = Vec3.createVectorHelper(radProgress, 0, 0); double circum = radProgress * 2 * Math.PI * 2; @@ -66,8 +69,19 @@ public class EntityFalloutRain extends Entity { radProgress++; } - if(radProgress > getScale()) + if(radProgress > getScale()) { this.setDead(); + } + } + + if(this.isDead) { + if(MainRegistry.rain > 0 && getScale() > 150) { + worldObj.getWorldInfo().setRaining(true); + worldObj.getWorldInfo().setThundering(true); + worldObj.getWorldInfo().setRainTime(MainRegistry.rain); + worldObj.getWorldInfo().setThunderTime(MainRegistry.rain); + AuxSavedData.setThunder(worldObj, MainRegistry.rain); + } } } } @@ -82,6 +96,11 @@ public class EntityFalloutRain extends Entity { if(b.getMaterial() == Material.air) continue; + if(b.isFlammable(worldObj, x, y, z, ForgeDirection.UP)) { + if(rand.nextInt(5) == 0) + worldObj.setBlock(x, y + 1, z, Blocks.fire); + } + if (b == Blocks.leaves || b == Blocks.leaves2) { worldObj.setBlock(x, y, z, Blocks.air); } diff --git a/com/hbm/entity/logic/EntityNukeExplosionMK4.java b/com/hbm/entity/logic/EntityNukeExplosionMK4.java index da08541c2..5e3dce3a9 100644 --- a/com/hbm/entity/logic/EntityNukeExplosionMK4.java +++ b/com/hbm/entity/logic/EntityNukeExplosionMK4.java @@ -65,7 +65,7 @@ public class EntityNukeExplosionMK4 extends Entity { if(explosion == null) { explosion = new ExplosionNukeRay(worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, this.strength, this.count, this.speed, this.length); - MainRegistry.logger.info("START: " + System.currentTimeMillis()); + //MainRegistry.logger.info("START: " + System.currentTimeMillis()); /*if(!worldObj.isRemote) for(int x = (int) (posX - 1); x <= (int) (posX + 1); x++) @@ -83,12 +83,12 @@ public class EntityNukeExplosionMK4 extends Entity { } else if(explosion.getStoredSize() > 0) { //if(!worldObj.isRemote) //MainRegistry.logger.info(explosion.getProgress() + " / " + count / length); - explosion.processTip(1024); + explosion.processTip(MainRegistry.mk4); } else if(fallout) { - MainRegistry.logger.info("STOP: " + System.currentTimeMillis()); + //MainRegistry.logger.info("STOP: " + System.currentTimeMillis()); - EntityFalloutRain fallout = new EntityFalloutRain(this.worldObj, (int)(this.length * 0.9) * 2 * MainRegistry.falloutDura / 10); + EntityFalloutRain fallout = new EntityFalloutRain(this.worldObj); fallout.posX = this.posX; fallout.posY = this.posY; fallout.posZ = this.posZ; diff --git a/com/hbm/items/weapon/ItemAmmo.java b/com/hbm/items/weapon/ItemAmmo.java index 95b419671..162cbca58 100644 --- a/com/hbm/items/weapon/ItemAmmo.java +++ b/com/hbm/items/weapon/ItemAmmo.java @@ -152,6 +152,7 @@ public class ItemAmmo extends Item { if(this == ModItems.ammo_rocket_nuclear) { list.add(EnumChatFormatting.BLUE + "+ Nuclear"); list.add(EnumChatFormatting.RED + "- Very highly increased wear"); + list.add(EnumChatFormatting.RED + "- Decreased projectile speed"); } //40mm GRENADES diff --git a/com/hbm/lib/RefStrings.java b/com/hbm/lib/RefStrings.java index 3dc775caf..da0160318 100644 --- a/com/hbm/lib/RefStrings.java +++ b/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (3043)"; + public static final String VERSION = "1.0.27 BETA (3048)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index fca14d358..eff7b71c0 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -588,6 +588,7 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.gas_duct), 16), new Object[] { "SIS", " ", "SIS", 'S', "plateSteel", 'I', "plateCopper" })); //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_deuterium), 1), new Object[] { "TIT", "RFR", "CCC", 'T', ModItems.tank_steel, 'I', "ingotTitanium", 'R', ModItems.wire_red_copper, 'F', Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 'C', ModItems.coil_tungsten })); //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_battery), 1), new Object[] { "TST", "RIR", "TLT", 'T', "ingotTungsten", 'I', "ingotRedstoneAlloy", 'R', ModItems.wire_red_copper, 'S', "blockSulfur", 'L', "blockLead" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_battery_potato, 1), new Object[] { "PCP", "WRW", "PCP", 'P', ItemBattery.getEmptyBattery(ModItems.battery_potato), 'C', "ingotCopper", 'R', Blocks.redstone_block, 'W', "plankWood" })); //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_battery), 1), new Object[] { "TLT", "RIR", "TST", 'T', "ingotTungsten", 'I', "ingotRedstoneAlloy", 'R', ModItems.wire_red_copper, 'S', "blockSulfur", 'L', "blockLead" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_coal_off, 1), new Object[] { "STS", "SCS", "SFS", 'S', "ingotSteel", 'T', ModItems.tank_steel, 'C', "ingotRedstoneAlloy", 'F', Blocks.furnace })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_boiler_off, 1), new Object[] { "SPS", "TFT", "SPS", 'S', "ingotSteel", 'P', ModItems.board_copper, 'T', ModItems.tank_steel, 'F', Blocks.furnace })); @@ -903,6 +904,7 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_rocket_emp, 1), new Object[] { "G", "R", 'G', "dustDiamond", 'R', ModItems.ammo_rocket })); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_rocket_shrapnel, 1), new Object[] { "G", "R", 'G', ModItems.pellet_buckshot, 'R', ModItems.ammo_rocket }); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_rocket_glare, 1), new Object[] { "GGG", "GRG", "GGG", 'G', Items.redstone, 'R', ModItems.ammo_rocket }); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_rocket_nuclear, 1), new Object[] { " P ", "NRN", " P ", 'P', ModItems.nugget_pu239, 'N', "plateDenseLead", 'R', ModItems.ammo_rocket })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_grenade, 2), new Object[] { " T ", "GCI", " P ", 'T', Items.gunpowder, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', "plateIron" })); GameRegistry.addRecipe(new ItemStack(ModItems.ammo_grenade_he, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', Blocks.tnt }); diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index e89819f38..47188403b 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -533,7 +533,8 @@ public class MainRegistry public static int blastSpeed = 1024; public static int falloutRange = 100; - public static int falloutDura = 100; + public static int fSpeed = 256; + //public static int falloutDura = 100; public static int radioStructure = 500; public static int antennaStructure = 250; @@ -561,6 +562,12 @@ public class MainRegistry public static int radarAltitude = 55; public static int ciwsHitrate = 50; + public static int mk4 = 1024; + public static int rain = 0; + public static int cont = 0; + public static int fogRad = 100; + public static int fogCh = 20; + public static int generalOverride = 0; public static int polaroidID = 1; @@ -1694,206 +1701,238 @@ public class MainRegistry Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); - enableDebugMode = config.get(Configuration.CATEGORY_GENERAL, "1.00_enableDebugMode", false).getBoolean(false); - enableMycelium = config.get(Configuration.CATEGORY_GENERAL, "1.01_enableMyceliumSpread", false).getBoolean(false); - enablePlutoniumOre = config.get(Configuration.CATEGORY_GENERAL, "1.02_enablePlutoniumNetherOre", false).getBoolean(false); - enableDungeons = config.get(Configuration.CATEGORY_GENERAL, "1.03_enableDungeonSpawn", true).getBoolean(true); - enableMDOres = config.get(Configuration.CATEGORY_GENERAL, "1.04_enableOresInModdedDimensions", true).getBoolean(true); - enableMines = config.get(Configuration.CATEGORY_GENERAL, "1.05_enableLandmineSpawn", true).getBoolean(true); - enableRad = config.get(Configuration.CATEGORY_GENERAL, "1.06_enableRadHotspotSpawn", true).getBoolean(true); - enableNITAN = config.get(Configuration.CATEGORY_GENERAL, "1.07_enableNITANChestSpawn", true).getBoolean(true); - enableNukeClouds = config.get(Configuration.CATEGORY_GENERAL, "1.08_enableMushroomClouds", true).getBoolean(true); - enableAutoCleanup = config.get(Configuration.CATEGORY_GENERAL, "1.09_enableAutomaticRadCleanup", false).getBoolean(false); - enableMeteorStrikes = config.get(Configuration.CATEGORY_GENERAL, "1.10_enableMeteorStrikes", true).getBoolean(true); - enableMeteorShowers = config.get(Configuration.CATEGORY_GENERAL, "1.11_enableMeteorShowers", true).getBoolean(true); - enableMeteorTails = config.get(Configuration.CATEGORY_GENERAL, "1.12_enableMeteorTails", true).getBoolean(true); - enableSpecialMeteors = config.get(Configuration.CATEGORY_GENERAL, "1.13_enableSpecialMeteors", false).getBoolean(false); - enableBomberShortMode = config.get(Configuration.CATEGORY_GENERAL, "1.14_enableBomberShortMode", false).getBoolean(false); - enableVaults = config.get(Configuration.CATEGORY_GENERAL, "1.15_enableVaultSpawn", true).getBoolean(true); - enableRads = config.get(Configuration.CATEGORY_GENERAL, "1.16_enableNewRadiation", true).getBoolean(true); - enableCataclysm = config.get(Configuration.CATEGORY_GENERAL, "1.17_enableCataclysm", false).getBoolean(false); - Property PuraniumSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.00_uraniumSpawnrate", 6); + final String CATEGORY_GENERAL = "01_general"; + enableDebugMode = config.get(CATEGORY_GENERAL, "1.00_enableDebugMode", false).getBoolean(false); + enableMycelium = config.get(CATEGORY_GENERAL, "1.01_enableMyceliumSpread", false).getBoolean(false); + enablePlutoniumOre = config.get(CATEGORY_GENERAL, "1.02_enablePlutoniumNetherOre", false).getBoolean(false); + enableDungeons = config.get(CATEGORY_GENERAL, "1.03_enableDungeonSpawn", true).getBoolean(true); + enableMDOres = config.get(CATEGORY_GENERAL, "1.04_enableOresInModdedDimensions", true).getBoolean(true); + enableMines = config.get(CATEGORY_GENERAL, "1.05_enableLandmineSpawn", true).getBoolean(true); + enableRad = config.get(CATEGORY_GENERAL, "1.06_enableRadHotspotSpawn", true).getBoolean(true); + enableNITAN = config.get(CATEGORY_GENERAL, "1.07_enableNITANChestSpawn", true).getBoolean(true); + enableNukeClouds = config.get(CATEGORY_GENERAL, "1.08_enableMushroomClouds", true).getBoolean(true); + enableAutoCleanup = config.get(CATEGORY_GENERAL, "1.09_enableAutomaticRadCleanup", false).getBoolean(false); + enableMeteorStrikes = config.get(CATEGORY_GENERAL, "1.10_enableMeteorStrikes", true).getBoolean(true); + enableMeteorShowers = config.get(CATEGORY_GENERAL, "1.11_enableMeteorShowers", true).getBoolean(true); + enableMeteorTails = config.get(CATEGORY_GENERAL, "1.12_enableMeteorTails", true).getBoolean(true); + enableSpecialMeteors = config.get(CATEGORY_GENERAL, "1.13_enableSpecialMeteors", false).getBoolean(false); + enableBomberShortMode = config.get(CATEGORY_GENERAL, "1.14_enableBomberShortMode", false).getBoolean(false); + enableVaults = config.get(CATEGORY_GENERAL, "1.15_enableVaultSpawn", true).getBoolean(true); + enableRads = config.get(CATEGORY_GENERAL, "1.16_enableNewRadiation", true).getBoolean(true); + enableCataclysm = config.get(CATEGORY_GENERAL, "1.17_enableCataclysm", false).getBoolean(false); + + final String CATEGORY_OREGEN = "02_ores"; + Property PuraniumSpawn = config.get(CATEGORY_OREGEN, "2.00_uraniumSpawnrate", 6); PuraniumSpawn.comment = "Ammount of uranium ore veins per chunk"; uraniumSpawn = PuraniumSpawn.getInt(); - Property PtitaniumSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.01_titaniumSpawnrate", 8); + Property PtitaniumSpawn = config.get(CATEGORY_OREGEN, "2.01_titaniumSpawnrate", 8); PtitaniumSpawn.comment = "Ammount of titanium ore veins per chunk"; titaniumSpawn = PtitaniumSpawn.getInt(); - Property PsulfurSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.02_sulfurSpawnrate", 5); + Property PsulfurSpawn = config.get(CATEGORY_OREGEN, "2.02_sulfurSpawnrate", 5); PsulfurSpawn.comment = "Ammount of sulfur ore veins per chunk"; sulfurSpawn = PsulfurSpawn.getInt(); - Property PaluminiumSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.03_aluminiumSpawnrate", 7); + Property PaluminiumSpawn = config.get(CATEGORY_OREGEN, "2.03_aluminiumSpawnrate", 7); PaluminiumSpawn.comment = "Ammount of aluminium ore veins per chunk"; aluminiumSpawn = PaluminiumSpawn.getInt(); - Property PcopperSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.04_copperSpawnrate", 12); + Property PcopperSpawn = config.get(CATEGORY_OREGEN, "2.04_copperSpawnrate", 12); PcopperSpawn.comment = "Ammount of copper ore veins per chunk"; copperSpawn = PcopperSpawn.getInt(); - Property PFluoriteSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.05_fluoriteSpawnrate", 6); + Property PFluoriteSpawn = config.get(CATEGORY_OREGEN, "2.05_fluoriteSpawnrate", 6); PFluoriteSpawn.comment = "Ammount of fluorite ore veins per chunk"; fluoriteSpawn = PFluoriteSpawn.getInt(); - Property PNiterSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.06_niterSpawnrate", 6); + Property PNiterSpawn = config.get(CATEGORY_OREGEN, "2.06_niterSpawnrate", 6); PNiterSpawn.comment = "Ammount of niter ore veins per chunk"; niterSpawn = PNiterSpawn.getInt(); - Property PtungstenSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.07_tungstenSpawnrate", 10); + Property PtungstenSpawn = config.get(CATEGORY_OREGEN, "2.07_tungstenSpawnrate", 10); PtungstenSpawn.comment = "Ammount of tungsten ore veins per chunk"; tungstenSpawn = PtungstenSpawn.getInt(); - Property PleadSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.08_leadSpawnrate", 6); + Property PleadSpawn = config.get(CATEGORY_OREGEN, "2.08_leadSpawnrate", 6); PleadSpawn.comment = "Ammount of lead ore veins per chunk"; leadSpawn = PleadSpawn.getInt(); - Property PberylliumSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.09_berylliumSpawnrate", 6); + Property PberylliumSpawn = config.get(CATEGORY_OREGEN, "2.09_berylliumSpawnrate", 6); PberylliumSpawn.comment = "Ammount of beryllium ore veins per chunk"; berylliumSpawn = PberylliumSpawn.getInt(); - Property PthoriumSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.10_thoriumSpawnrate", 7); + Property PthoriumSpawn = config.get(CATEGORY_OREGEN, "2.10_thoriumSpawnrate", 7); PthoriumSpawn.comment = "Ammount of thorium ore veins per chunk"; thoriumSpawn = PthoriumSpawn.getInt(); - Property propGadget = config.get(Configuration.CATEGORY_GENERAL, "3.00_gadgetRadius", 150); + final String CATEGORY_NUKES = "03_nukes"; + Property propGadget = config.get(CATEGORY_NUKES, "3.00_gadgetRadius", 150); propGadget.comment = "Radius of the Gadget"; gadgetRadius = propGadget.getInt(); - Property propBoy = config.get(Configuration.CATEGORY_GENERAL, "3.01_boyRadius", 120); + Property propBoy = config.get(CATEGORY_NUKES, "3.01_boyRadius", 120); propBoy.comment = "Radius of Little Boy"; boyRadius = propBoy.getInt(); - Property propMan = config.get(Configuration.CATEGORY_GENERAL, "3.02_manRadius", 175); + Property propMan = config.get(CATEGORY_NUKES, "3.02_manRadius", 175); propMan.comment = "Radius of Fat Man"; manRadius = propMan.getInt(); - Property propMike = config.get(Configuration.CATEGORY_GENERAL, "3.03_mikeRadius", 250); + Property propMike = config.get(CATEGORY_NUKES, "3.03_mikeRadius", 250); propMike.comment = "Radius of Ivy Mike"; mikeRadius = propMike.getInt(); - Property propTsar = config.get(Configuration.CATEGORY_GENERAL, "3.04_tsarRadius", 500); + Property propTsar = config.get(CATEGORY_NUKES, "3.04_tsarRadius", 500); propTsar.comment = "Radius of the Tsar Bomba"; tsarRadius = propTsar.getInt(); - Property propPrototype = config.get(Configuration.CATEGORY_GENERAL, "3.05_prototypeRadius", 150); + Property propPrototype = config.get(CATEGORY_NUKES, "3.05_prototypeRadius", 150); propPrototype.comment = "Radius of the Prototype"; prototypeRadius = propPrototype.getInt(); - Property propFleija = config.get(Configuration.CATEGORY_GENERAL, "3.06_fleijaRadius", 50); + Property propFleija = config.get(CATEGORY_NUKES, "3.06_fleijaRadius", 50); propFleija.comment = "Radius of F.L.E.I.J.A."; fleijaRadius = propFleija.getInt(); - Property propMissile = config.get(Configuration.CATEGORY_GENERAL, "3.07_missileRadius", 100); + Property propMissile = config.get(CATEGORY_NUKES, "3.07_missileRadius", 100); propMissile.comment = "Radius of the nuclear missile"; missileRadius = propMissile.getInt(); - Property propMirv = config.get(Configuration.CATEGORY_GENERAL, "3.08_mirvRadius", 100); + Property propMirv = config.get(CATEGORY_NUKES, "3.08_mirvRadius", 100); propMirv.comment = "Radius of a MIRV"; mirvRadius = propMirv.getInt(); - Property propFatman = config.get(Configuration.CATEGORY_GENERAL, "3.09_fatmanRadius", 35); + Property propFatman = config.get(CATEGORY_NUKES, "3.09_fatmanRadius", 35); propFatman.comment = "Radius of the Fatman Launcher"; fatmanRadius = propFatman.getInt(); - Property propNuka = config.get(Configuration.CATEGORY_GENERAL, "3.10_nukaRadius", 25); + Property propNuka = config.get(CATEGORY_NUKES, "3.10_nukaRadius", 25); propNuka.comment = "Radius of the nuka grenade"; nukaRadius = propNuka.getInt(); - Property propASchrab = config.get(Configuration.CATEGORY_GENERAL, "3.11_aSchrabRadius", 20); + Property propASchrab = config.get(CATEGORY_NUKES, "3.11_aSchrabRadius", 20); propASchrab.comment = "Radius of dropped anti schrabidium"; aSchrabRadius = propASchrab.getInt(); - Property propSolinium = config.get(Configuration.CATEGORY_GENERAL, "3.12_soliniumRadius", 75); + Property propSolinium = config.get(CATEGORY_NUKES, "3.12_soliniumRadius", 75); propSolinium.comment = "Radius of the blue rinse"; soliniumRadius = propSolinium.getInt(); - Property propN2 = config.get(Configuration.CATEGORY_GENERAL, "3.13_n2Radius", 130); + Property propN2 = config.get(CATEGORY_NUKES, "3.13_n2Radius", 130); propN2.comment = "Radius of the N2 mine"; n2Radius = propN2.getInt(); - Property propRadio = config.get(Configuration.CATEGORY_GENERAL, "4.00_radioSpawn", 500); + final String CATEGORY_DUNGEON = "04_dungeons"; + Property propRadio = config.get(CATEGORY_DUNGEON, "4.00_radioSpawn", 500); propRadio.comment = "Spawn radio station on every nTH chunk"; radioStructure = propRadio.getInt(); - Property propAntenna = config.get(Configuration.CATEGORY_GENERAL, "4.01_antennaSpawn", 250); + Property propAntenna = config.get(CATEGORY_DUNGEON, "4.01_antennaSpawn", 250); propAntenna.comment = "Spawn antenna on every nTH chunk"; antennaStructure = propAntenna.getInt(); - Property propAtom = config.get(Configuration.CATEGORY_GENERAL, "4.02_atomSpawn", 500); + Property propAtom = config.get(CATEGORY_DUNGEON, "4.02_atomSpawn", 500); propAtom.comment = "Spawn power plant on every nTH chunk"; atomStructure = propAtom.getInt(); - Property propVertibird = config.get(Configuration.CATEGORY_GENERAL, "4.03_vertibirdSpawn", 500); + Property propVertibird = config.get(CATEGORY_DUNGEON, "4.03_vertibirdSpawn", 500); propVertibird.comment = "Spawn vertibird on every nTH chunk"; vertibirdStructure = propVertibird.getInt(); - Property propDungeon = config.get(Configuration.CATEGORY_GENERAL, "4.04_dungeonSpawn", 64); + Property propDungeon = config.get(CATEGORY_DUNGEON, "4.04_dungeonSpawn", 64); propDungeon.comment = "Spawn library dungeon on every nTH chunk"; dungeonStructure = propDungeon.getInt(); - Property propRelay = config.get(Configuration.CATEGORY_GENERAL, "4.05_relaySpawn", 500); + Property propRelay = config.get(CATEGORY_DUNGEON, "4.05_relaySpawn", 500); propRelay.comment = "Spawn relay on every nTH chunk"; relayStructure = propRelay.getInt(); - Property propSatellite = config.get(Configuration.CATEGORY_GENERAL, "4.06_satelliteSpawn", 500); + Property propSatellite = config.get(CATEGORY_DUNGEON, "4.06_satelliteSpawn", 500); propSatellite.comment = "Spawn satellite dish on every nTH chunk"; satelliteStructure = propSatellite.getInt(); - Property propBunker = config.get(Configuration.CATEGORY_GENERAL, "4.07_bunkerSpawn", 1000); + Property propBunker = config.get(CATEGORY_DUNGEON, "4.07_bunkerSpawn", 1000); propBunker.comment = "Spawn bunker on every nTH chunk"; bunkerStructure = propBunker.getInt(); - Property propSilo = config.get(Configuration.CATEGORY_GENERAL, "4.08_siloSpawn", 1000); + Property propSilo = config.get(CATEGORY_DUNGEON, "4.08_siloSpawn", 1000); propSilo.comment = "Spawn missile silo on every nTH chunk"; siloStructure = propSilo.getInt(); - Property propFactory = config.get(Configuration.CATEGORY_GENERAL, "4.09_factorySpawn", 1000); + Property propFactory = config.get(CATEGORY_DUNGEON, "4.09_factorySpawn", 1000); propFactory.comment = "Spawn factory on every nTH chunk"; factoryStructure = propFactory.getInt(); - Property propDud = config.get(Configuration.CATEGORY_GENERAL, "4.10_dudSpawn", 500); + Property propDud = config.get(CATEGORY_DUNGEON, "4.10_dudSpawn", 500); propDud.comment = "Spawn dud on every nTH chunk"; dudStructure = propDud.getInt(); - Property propSpaceship = config.get(Configuration.CATEGORY_GENERAL, "4.11_spaceshipSpawn", 1000); + Property propSpaceship = config.get(CATEGORY_DUNGEON, "4.11_spaceshipSpawn", 1000); propSpaceship.comment = "Spawn spaceship on every nTH chunk"; spaceshipStructure = propSpaceship.getInt(); - Property propBarrel = config.get(Configuration.CATEGORY_GENERAL, "4.12_barrelSpawn", 5000); + Property propBarrel = config.get(CATEGORY_DUNGEON, "4.12_barrelSpawn", 5000); propBarrel.comment = "Spawn waste tank on every nTH chunk"; barrelStructure = propBarrel.getInt(); - Property propBroadcaster = config.get(Configuration.CATEGORY_GENERAL, "4.13_broadcasterSpawn", 5000); + Property propBroadcaster = config.get(CATEGORY_DUNGEON, "4.13_broadcasterSpawn", 5000); propBroadcaster.comment = "Spawn corrupt broadcaster on every nTH chunk"; broadcaster = propBroadcaster.getInt(); - Property propMines = config.get(Configuration.CATEGORY_GENERAL, "4.14_landmineSpawn", 64); + Property propMines = config.get(CATEGORY_DUNGEON, "4.14_landmineSpawn", 64); propMines.comment = "Spawn AP landmine on every nTH chunk"; minefreq = propMines.getInt(); - Property propRad = config.get(Configuration.CATEGORY_GENERAL, "4.15_radHotsoptSpawn", 5000); + Property propRad = config.get(CATEGORY_DUNGEON, "4.15_radHotsoptSpawn", 5000); propRad.comment = "Spawn radiation hotspot on every nTH chunk"; radfreq = propRad.getInt(); - Property propVault = config.get(Configuration.CATEGORY_GENERAL, "4.16_vaultSpawn", 2500); + Property propVault = config.get(CATEGORY_DUNGEON, "4.16_vaultSpawn", 2500); propVault.comment = "Spawn locked safe on every nTH chunk"; vaultfreq = propVault.getInt(); - Property propMeteorStrikeChance = config.get(Configuration.CATEGORY_GENERAL, "5.00_meteorStrikeChance", 20 * 60 * 180); + final String CATEGORY_METEOR = "05_meteors"; + Property propMeteorStrikeChance = config.get(CATEGORY_METEOR, "5.00_meteorStrikeChance", 20 * 60 * 180); propMeteorStrikeChance.comment = "The probability of a meteor spawning (an average of once every nTH ticks)"; meteorStrikeChance = propMeteorStrikeChance.getInt(); - Property propMeteorShowerChance = config.get(Configuration.CATEGORY_GENERAL, "5.01_meteorShowerChance", 20 * 60 * 5); + Property propMeteorShowerChance = config.get(CATEGORY_METEOR, "5.01_meteorShowerChance", 20 * 60 * 5); propMeteorShowerChance.comment = "The probability of a meteor spawning during meteor shower (an average of once every nTH ticks)"; meteorShowerChance = propMeteorShowerChance.getInt(); - Property propMeteorShowerDuration = config.get(Configuration.CATEGORY_GENERAL, "5.02_meteorShowerDuration", 6000); + Property propMeteorShowerDuration = config.get(CATEGORY_METEOR, "5.02_meteorShowerDuration", 6000); propMeteorShowerDuration.comment = "Max duration of meteor shower in ticks"; meteorShowerDuration = propMeteorShowerDuration.getInt(); - Property propLimitExplosionLifespan = config.get(Configuration.CATEGORY_GENERAL, "6.00_limitExplosionLifespan", 0); + final String CATEGORY_NUKE = "06_explosions"; + Property propLimitExplosionLifespan = config.get(CATEGORY_NUKE, "6.00_limitExplosionLifespan", 0); propLimitExplosionLifespan.comment = "How long an explosion can be unloaded until it dies in seconds. Based of system time. 0 disables the effect"; limitExplosionLifespan = propLimitExplosionLifespan.getInt(); - Property propBlastSpeed = config.get(Configuration.CATEGORY_GENERAL, "6.01_blastSpeed", 1024); - propBlastSpeed.comment = "Base speed of all detonations (Blocks / tick)"; + //explosion speed + Property propBlastSpeed = config.get(CATEGORY_NUKE, "6.01_blastSpeed", 1024); + propBlastSpeed.comment = "Base speed of MK3 system (old and schrabidium) detonations (Blocks / tick)"; blastSpeed = propBlastSpeed.getInt(); - Property propFalloutRange = config.get(Configuration.CATEGORY_GENERAL, "6.02_falloutRange", 100); + //fallout range + Property propFalloutRange = config.get(CATEGORY_NUKE, "6.02_falloutRange", 100); propFalloutRange.comment = "Radius of fallout area (base radius * value in percent)"; falloutRange = propFalloutRange.getInt(); - Property propFalloutDura = config.get(Configuration.CATEGORY_GENERAL, "6.03_falloutDuration", 100); - propFalloutDura.comment = "Duration of fallout (base duration * value in percent)"; - falloutDura = propFalloutDura.getInt(); + //fallout speed + Property falloutRangeProp = config.get(CATEGORY_NUKE, "6.03_falloutRange", 100); + falloutRangeProp.comment = "Radius of fallout area (base radius * value in percent)"; + falloutRange = falloutRangeProp.getInt(); + //new explosion speed + Property falloutSpeed = config.get(CATEGORY_NUKE, "6.04_falloutSpeed", 256); + falloutSpeed.comment = "Blocks processed per tick by the fallout rain"; + fSpeed = falloutSpeed.getInt(); + //afterrain duration + Property radRain = config.get(CATEGORY_NUKE, "6.05_falloutRainDuration", 0); + radRain.comment = "Duration of the thunderstorm after fallout in ticks (only large explosions)"; + rain = radRain.getInt(); + //afterrain radiation + Property rainCont = config.get(CATEGORY_NUKE, "6.06_falloutRainRadiation", 0); + rainCont.comment = "Radiation in 100th RADs created by fallout rain"; + cont = rainCont.getInt(); + //fog threshold + Property fogThresh = config.get(CATEGORY_NUKE, "6.07_fogThreshold", 100); + fogThresh.comment = "Radiation in RADs required for fog to spawn"; + fogRad = fogThresh.getInt(); + //fog chance + Property fogChance = config.get(CATEGORY_NUKE, "6.08_fogChance", 10); + fogChance.comment = "1:n chance of fog spawning every second"; + fogCh = fogChance.getInt(); - Property propRadarRange = config.get(Configuration.CATEGORY_GENERAL, "7.00_radarRange", 1000); + final String CATEGORY_MISSILE = "07_missile_machines"; + Property propRadarRange = config.get(CATEGORY_MISSILE, "7.00_radarRange", 1000); propRadarRange.comment = "Range of the radar, 50 will result in 100x100 block area covered"; radarRange = propRadarRange.getInt(); - Property propRadarBuffer = config.get(Configuration.CATEGORY_GENERAL, "7.01_radarBuffer", 30); + Property propRadarBuffer = config.get(CATEGORY_MISSILE, "7.01_radarBuffer", 30); propRadarBuffer.comment = "How high entities have to be above the radar to be detected"; radarBuffer = propRadarBuffer.getInt(); - Property propRadarAltitude = config.get(Configuration.CATEGORY_GENERAL, "7.02_radarAltitude", 55); + Property propRadarAltitude = config.get(CATEGORY_MISSILE, "7.02_radarAltitude", 55); propRadarAltitude.comment = "Y height required for the radar to work"; radarAltitude = propRadarAltitude.getInt(); - Property propCiwsHitrate = config.get(Configuration.CATEGORY_GENERAL, "7.03_ciwsAccuracy", 50); + Property propCiwsHitrate = config.get(CATEGORY_MISSILE, "7.03_ciwsAccuracy", 50); propCiwsHitrate.comment = "Additional modifier for CIWS accuracy"; ciwsHitrate = propRadarAltitude.getInt(); - Property propTaintID = config.get(Configuration.CATEGORY_GENERAL, "8.00_taintPotionID", 62); + final String CATEGORY_POTION = "08_potion_effects"; + Property propTaintID = config.get(CATEGORY_POTION, "8.00_taintPotionID", 62); propTaintID.comment = "What potion ID the taint effect will have"; taintID = propTaintID.getInt(); - Property propRadiationID = config.get(Configuration.CATEGORY_GENERAL, "8.01_radiationPotionID", 63); + Property propRadiationID = config.get(CATEGORY_POTION, "8.01_radiationPotionID", 63); propRadiationID.comment = "What potion ID the radiation effect will have"; radiationID = propRadiationID.getInt(); - Property propBangID = config.get(Configuration.CATEGORY_GENERAL, "8.02_bangPotionID", 64); + Property propBangID = config.get(CATEGORY_POTION, "8.02_bangPotionID", 64); propBangID.comment = "What potion ID the B93 timebomb effect will have"; bangID = propBangID.getInt(); - Property propMutationID = config.get(Configuration.CATEGORY_GENERAL, "8.03_mutationPotionID", 65); + Property propMutationID = config.get(CATEGORY_POTION, "8.03_mutationPotionID", 65); propMutationID.comment = "What potion ID the taint mutation effect will have"; mutationID = propMutationID.getInt(); - Property propRadxID = config.get(Configuration.CATEGORY_GENERAL, "8.04_radxPotionID", 66); + Property propRadxID = config.get(CATEGORY_POTION, "8.04_radxPotionID", 66); propRadxID.comment = "What potion ID the Rad-X effect will have"; radxID = propRadxID.getInt(); - Property propLeadID = config.get(Configuration.CATEGORY_GENERAL, "8.05_leadPotionID", 67); + Property propLeadID = config.get(CATEGORY_POTION, "8.05_leadPotionID", 67); propLeadID.comment = "What potion ID the lead poisoning effect will have"; leadID = propLeadID.getInt(); @@ -1918,6 +1957,7 @@ public class MainRegistry vaultfreq = setDef(vaultfreq, 1000); meteorStrikeChance = setDef(meteorStrikeChance, 1000); meteorShowerChance = setDef(meteorShowerChance, 1000); + fogCh = setDef(fogCh, 20); } private static int setDef(int value, int def) { diff --git a/com/hbm/main/ModEventHandler.java b/com/hbm/main/ModEventHandler.java index fd495cf2a..813d00f70 100644 --- a/com/hbm/main/ModEventHandler.java +++ b/com/hbm/main/ModEventHandler.java @@ -15,6 +15,7 @@ import com.hbm.lib.RefStrings; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.RadSurveyPacket; import com.hbm.potion.HbmPotion; +import com.hbm.saveddata.AuxSavedData; import com.hbm.saveddata.RadEntitySavedData; import com.hbm.saveddata.RadiationSavedData; @@ -37,6 +38,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.event.entity.EntityEvent.EnteringChunk; @@ -156,6 +158,12 @@ public class ModEventHandler } if(event.world != null && !event.world.isRemote && MainRegistry.enableRads) { + + int thunder = AuxSavedData.getThunder(event.world); + + if(thunder > 0) + AuxSavedData.setThunder(event.world, thunder - 1); + if(!event.world.loadedEntityList.isEmpty()) { RadiationSavedData data = RadiationSavedData.getData(event.world); @@ -199,6 +207,14 @@ public class ModEventHandler if(!entity.isPotionActive(HbmPotion.mutation)) Library.applyRadData(entity, rad / 2); } + + if(entity.worldObj.isRaining() && MainRegistry.cont > 0 && AuxSavedData.getThunder(entity.worldObj) > 0 && + entity.worldObj.canBlockSeeTheSky(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ))) { + + if(!entity.isPotionActive(HbmPotion.mutation)) { + Library.applyRadData(entity, MainRegistry.cont * 0.005F); + } + } } float eRad = eData.getRadFromEntity(entity); diff --git a/com/hbm/render/entity/FogRenderer.java b/com/hbm/render/entity/FogRenderer.java index 837f8bf80..e7a457b58 100644 --- a/com/hbm/render/entity/FogRenderer.java +++ b/com/hbm/render/entity/FogRenderer.java @@ -24,7 +24,7 @@ public class FogRenderer extends Render { GL11.glPushMatrix(); GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_); GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_LIGHTING); //GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glScalef(7.5F, 7.5F, 7.5F); @@ -84,6 +84,7 @@ public class FogRenderer extends Render { } GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_LIGHTING); //GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(true); diff --git a/com/hbm/saveddata/AuxSavedData.java b/com/hbm/saveddata/AuxSavedData.java new file mode 100644 index 000000000..608cd3368 --- /dev/null +++ b/com/hbm/saveddata/AuxSavedData.java @@ -0,0 +1,129 @@ +package com.hbm.saveddata; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.WorldSavedData; + +public class AuxSavedData extends WorldSavedData { + + public List data = new ArrayList(); + + private World worldObj; + + public AuxSavedData(String p_i2141_1_) { + super(p_i2141_1_); + } + + public AuxSavedData(World p_i1678_1_) + { + super("hbmauxdata"); + this.worldObj = p_i1678_1_; + this.markDirty(); + } + + static class DataPair { + + String key = ""; + int value; + + public DataPair() { } + + public DataPair(String s, int i) { + key = s; + value = i; + } + + void readFromNBT(NBTTagCompound nbt, int i) { + this.key = nbt.getString("aux_key_" + i); + this.value = nbt.getInteger("aux_val_" + i); + } + + void writeToNBT(NBTTagCompound nbt, int i) { + nbt.setString("aux_key_" + i, key); + nbt.setInteger("aux_val_" + i, value); + } + + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + + int count = nbt.getInteger("dCount"); + + for(int i = 0; i < count; i++) { + DataPair struct = new DataPair(); + struct.readFromNBT(nbt, i); + + data.add(struct); + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + + nbt.setInteger("dCount", data.size()); + + for(int i = 0; i < data.size(); i++) { + data.get(i).writeToNBT(nbt, i); + } + } + + public static AuxSavedData getData(World worldObj) { + + AuxSavedData data = (AuxSavedData)worldObj.perWorldStorage.loadData(AuxSavedData.class, "hbmauxdata"); + if(data == null) { + worldObj.perWorldStorage.setData("hbmauxdata", new AuxSavedData(worldObj)); + + data = (AuxSavedData)worldObj.perWorldStorage.loadData(AuxSavedData.class, "hbmauxdata"); + } + + return data; + } + + public static void setThunder(World world, int dura) { + AuxSavedData data = getData(world); + + if(data.data == null) { + data.data = new ArrayList(); + data.data.add(new DataPair("thunder", dura)); + + } else { + + DataPair thunder = null; + + for(DataPair pair : data.data) { + if(pair.key.equals("thunder")) { + thunder = pair; + break; + } + } + + if(thunder == null) { + data.data.add(new DataPair("thunder", dura)); + } else { + thunder.value = dura; + } + } + + data.markDirty(); + } + + public static int getThunder(World world) { + + AuxSavedData data = getData(world); + + if(data == null) + return 0; + + for(DataPair pair : data.data) { + if(pair.key.equals("thunder")) { + return pair.value; + } + } + + return 0; + } +} diff --git a/com/hbm/saveddata/RadiationSavedData.java b/com/hbm/saveddata/RadiationSavedData.java index 45fdc6dca..6e6c81223 100644 --- a/com/hbm/saveddata/RadiationSavedData.java +++ b/com/hbm/saveddata/RadiationSavedData.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import com.hbm.entity.particle.EntityFogFX; +import com.hbm.main.MainRegistry; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; @@ -107,11 +108,11 @@ public class RadiationSavedData extends WorldSavedData { struct.radiation = 0; } - if(struct.radiation > 100 && worldObj != null && worldObj.rand.nextInt(10) == 0 && worldObj.getChunkFromChunkCoords(struct.chunkX, struct.chunkY).isChunkLoaded) { + if(struct.radiation > MainRegistry.fogRad && worldObj != null && worldObj.rand.nextInt(MainRegistry.fogCh) == 0 && worldObj.getChunkFromChunkCoords(struct.chunkX, struct.chunkY).isChunkLoaded) { int x = struct.chunkX * 16 + worldObj.rand.nextInt(16); int z = struct.chunkY * 16 + worldObj.rand.nextInt(16); - int y = worldObj.getHeightValue(x, z) + worldObj.rand.nextInt(10); + int y = worldObj.getHeightValue(x, z) + worldObj.rand.nextInt(5); EntityFogFX fog = new EntityFogFX(worldObj); fog.setPosition(x, y, z);