diff --git a/src/main/java/com/hbm/blocks/gas/BlockGasRadon.java b/src/main/java/com/hbm/blocks/gas/BlockGasRadon.java index fc584b29f..df166aa03 100644 --- a/src/main/java/com/hbm/blocks/gas/BlockGasRadon.java +++ b/src/main/java/com/hbm/blocks/gas/BlockGasRadon.java @@ -2,6 +2,7 @@ package com.hbm.blocks.gas; import java.util.Random; +import com.hbm.extprop.HbmLivingProps; import com.hbm.util.ArmorUtil; import com.hbm.util.ContaminationUtil; import com.hbm.util.ContaminationUtil.ContaminationType; @@ -24,6 +25,7 @@ public class BlockGasRadon extends BlockGasBase { if(entity instanceof EntityLivingBase) { ContaminationUtil.contaminate((EntityLivingBase)entity, HazardType.RADIATION, ContaminationType.RAD_BYPASS, 0.05F); + HbmLivingProps.incrementFibrosis((EntityLivingBase)entity, 1); } } diff --git a/src/main/java/com/hbm/blocks/gas/BlockGasRadonDense.java b/src/main/java/com/hbm/blocks/gas/BlockGasRadonDense.java index 780672e67..21a24186f 100644 --- a/src/main/java/com/hbm/blocks/gas/BlockGasRadonDense.java +++ b/src/main/java/com/hbm/blocks/gas/BlockGasRadonDense.java @@ -3,6 +3,7 @@ package com.hbm.blocks.gas; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.extprop.HbmLivingProps; import com.hbm.lib.ModDamageSource; import com.hbm.potion.HbmPotion; import com.hbm.util.ArmorRegistry; @@ -40,6 +41,7 @@ public class BlockGasRadonDense extends BlockGasBase { } else { ContaminationUtil.contaminate((EntityLivingBase)entity, HazardType.RADIATION, ContaminationType.CREATIVE, 0.5F); entityLiving.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 15 * 20, 0)); + HbmLivingProps.incrementFibrosis(entityLiving, 5); } } diff --git a/src/main/java/com/hbm/blocks/gas/BlockGasRadonTomb.java b/src/main/java/com/hbm/blocks/gas/BlockGasRadonTomb.java index 308c4ea23..8dcc6bdb6 100644 --- a/src/main/java/com/hbm/blocks/gas/BlockGasRadonTomb.java +++ b/src/main/java/com/hbm/blocks/gas/BlockGasRadonTomb.java @@ -3,6 +3,7 @@ package com.hbm.blocks.gas; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.extprop.HbmLivingProps; import com.hbm.util.ContaminationUtil; import com.hbm.util.ContaminationUtil.ContaminationType; import com.hbm.util.ContaminationUtil.HazardType; @@ -52,6 +53,7 @@ public class BlockGasRadonTomb extends BlockGasBase { if(entity instanceof EntityLivingBase) { ContaminationUtil.contaminate((EntityLivingBase)entity, HazardType.RADIATION, ContaminationType.RAD_BYPASS, 0.5F); + HbmLivingProps.incrementFibrosis((EntityLivingBase)entity, 10); } } diff --git a/src/main/java/com/hbm/crafting/ConsumableRecipes.java b/src/main/java/com/hbm/crafting/ConsumableRecipes.java index 27b698d2a..e0f013374 100644 --- a/src/main/java/com/hbm/crafting/ConsumableRecipes.java +++ b/src/main/java/com/hbm/crafting/ConsumableRecipes.java @@ -116,6 +116,7 @@ public class ConsumableRecipes { GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.siox, 8), new Object[] { "dustCoal", "dustAsbestos", ModItems.nugget_bismuth })); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.xanax, 1), new Object[] { ModItems.powder_coal, ModItems.niter, ModItems.powder_bromine }); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fmn, 1), new Object[] { ModItems.powder_coal, ModItems.powder_polonium, ModItems.powder_strontium }); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.pirfenidone, 1), new Object[] {ModItems.powder_coal, ModItems.niter, ModItems.nugget_bismuth }); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.five_htp, 1), new Object[] { ModItems.powder_coal, ModItems.powder_euphemium, ModItems.canteen_fab }); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.cigarette, 16), new Object[] { "ingotAsbestos", ModItems.oil_tar, "nuggetPolonium210" })); diff --git a/src/main/java/com/hbm/extprop/HbmLivingProps.java b/src/main/java/com/hbm/extprop/HbmLivingProps.java index 19c906904..2abb20c51 100644 --- a/src/main/java/com/hbm/extprop/HbmLivingProps.java +++ b/src/main/java/com/hbm/extprop/HbmLivingProps.java @@ -35,6 +35,8 @@ public class HbmLivingProps implements IExtendedEntityProperties { public static final int maxAsbestos = 60 * 60 * 20; private int blacklung; public static final int maxBlacklung = 60 * 60 * 20; + private int Fibrosis; + public static final int maxFibrosis = 60 * 60 * 30; private float radEnv; private float radBuf; private int bombTimer; @@ -185,6 +187,7 @@ public class HbmLivingProps implements IExtendedEntityProperties { public static void incrementAsbestos(EntityLivingBase entity, int asbestos) { setAsbestos(entity, getAsbestos(entity) + asbestos); + incrementFibrosis(entity, asbestos); } @@ -204,6 +207,25 @@ public class HbmLivingProps implements IExtendedEntityProperties { public static void incrementBlackLung(EntityLivingBase entity, int blacklung) { setBlackLung(entity, getBlackLung(entity) + blacklung); + incrementFibrosis(entity, blacklung); + } + + /// PULMONARY FIBROSIS /// + public static int getFibrosis(EntityLivingBase entity) { + return getData(entity).Fibrosis; + } + + public static void setFibrosis(EntityLivingBase entity, int fibrosis) { + getData(entity).Fibrosis = fibrosis; + + if (fibrosis >= maxFibrosis) { + getData(entity).Fibrosis = 0; + entity.attackEntityFrom(ModDamageSource.asbestos, 1000); + } + } + + public static void incrementFibrosis(EntityLivingBase entity, int fibrosis) { + setFibrosis(entity, getFibrosis(entity) + fibrosis); } /// TIME BOMB /// diff --git a/src/main/java/com/hbm/handler/EntityEffectHandler.java b/src/main/java/com/hbm/handler/EntityEffectHandler.java index ab1dc9504..0e6362ce2 100644 --- a/src/main/java/com/hbm/handler/EntityEffectHandler.java +++ b/src/main/java/com/hbm/handler/EntityEffectHandler.java @@ -328,6 +328,7 @@ public class EntityEffectHandler { if(entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode) { HbmLivingProps.setBlackLung(entity, 0); HbmLivingProps.setAsbestos(entity, 0); + HbmLivingProps.setFibrosis(entity, 0); return; } else { @@ -340,8 +341,10 @@ public class EntityEffectHandler { double blacklung = Math.min(HbmLivingProps.getBlackLung(entity), HbmLivingProps.maxBlacklung); double asbestos = Math.min(HbmLivingProps.getAsbestos(entity), HbmLivingProps.maxAsbestos); + double fibrosis = Math.min(HbmLivingProps.getFibrosis(entity), HbmLivingProps.maxFibrosis); boolean coughs = blacklung / HbmLivingProps.maxBlacklung > 0.25D || asbestos / HbmLivingProps.maxAsbestos > 0.25D; + boolean bronchospasms = fibrosis / HbmLivingProps.maxFibrosis > 0.20D; if(!coughs) return; @@ -352,8 +355,9 @@ public class EntityEffectHandler { double blacklungDelta = 1D - (blacklung / (double)HbmLivingProps.maxBlacklung); double asbestosDelta = 1D - (asbestos / (double)HbmLivingProps.maxAsbestos); + double fibrosisDelta = 1D - (fibrosis / (double)HbmLivingProps.maxFibrosis); - double total = 1 - (blacklungDelta * asbestosDelta); + double total = 1 - (blacklungDelta * asbestosDelta * fibrosisDelta); int freq = Math.max((int) (1000 - 950 * total), 20); @@ -369,23 +373,29 @@ public class EntityEffectHandler { if(world.getTotalWorldTime() % freq == entity.getEntityId() % freq) { world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:player.cough", 1.0F, 1.0F); + if (new Random().nextInt(6) > 1) { + if(coughsBlood) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "vomit"); + nbt.setString("mode", "blood"); + nbt.setInteger("count", 5); + nbt.setInteger("entity", entity.getEntityId()); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); + } - if(coughsBlood) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("type", "vomit"); - nbt.setString("mode", "blood"); - nbt.setInteger("count", 5); - nbt.setInteger("entity", entity.getEntityId()); - PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); - } - - if(coughsCoal) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("type", "vomit"); - nbt.setString("mode", "smoke"); - nbt.setInteger("count", coughsALotOfCoal ? 50 : 10); - nbt.setInteger("entity", entity.getEntityId()); - PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); + if(coughsCoal) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "vomit"); + nbt.setString("mode", "smoke"); + nbt.setInteger("count", coughsALotOfCoal ? 50 : 10); + nbt.setInteger("entity", entity.getEntityId()); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); + } + } else { + if(bronchospasms) { + entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2)); + entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 140, 2)); + } } } } diff --git a/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java b/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java index 10251c881..f201b5714 100644 --- a/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java @@ -460,16 +460,22 @@ public class AnvilRecipes { constructionRecipes.add(new AnvilConstructionRecipe( new ComparableStack(ModItems.pile_rod_uranium), - new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.billet_uranium, 3)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 2))}).setTier(3)); + new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.billet_uranium, 3)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 2))}).setTier(2)); + if (GeneralConfig.enable528) { constructionRecipes.add(new AnvilConstructionRecipe( new ComparableStack(ModItems.pile_rod_plutonium), - new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.billet_plutonium, 3)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 2))}).setTier(3)); + new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.billet_pu_mix, 2)),new AnvilOutput(new ItemStack(ModItems.nuclear_waste_tiny, 6)),new AnvilOutput(new ItemStack(ModItems.plate_iron, 1))}).setTier(2)); + } else { + constructionRecipes.add(new AnvilConstructionRecipe( + new ComparableStack(ModItems.pile_rod_plutonium), + new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.billet_pu_mix, 3)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 2))}).setTier(2)); + } constructionRecipes.add(new AnvilConstructionRecipe( new ComparableStack(ModItems.pile_rod_source), - new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.billet_ra226be, 3)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 2))}).setTier(3)); + new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.billet_ra226be, 3)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 2))}).setTier(2)); constructionRecipes.add(new AnvilConstructionRecipe( new ComparableStack(ModItems.pile_rod_boron), - new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_boron, 2)), new AnvilOutput(new ItemStack(Items.stick, 2))}).setTier(3)); + new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_boron, 2)), new AnvilOutput(new ItemStack(Items.stick, 2))}).setTier(2)); constructionRecipes.add(new AnvilConstructionRecipe( new ComparableStack(ModBlocks.machine_industrial_generator), new AnvilOutput[] { diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 98d038fad..e6f798a9a 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -824,6 +824,7 @@ public class ModItems { public static Item siox; public static Item xanax; public static Item fmn; + public static Item pirfenidone; public static Item five_htp; public static Item med_bag; public static Item pill_iodine; @@ -3183,6 +3184,7 @@ public class ModItems { siox = new ItemPill(0).setUnlocalizedName("siox").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":siox"); xanax = new ItemPill(0).setUnlocalizedName("xanax").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":xanax_2"); fmn = new ItemPill(0).setUnlocalizedName("fmn").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":tablet"); + pirfenidone = new ItemPill(0).setUnlocalizedName("pirfenidone").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pirfenidone"); five_htp = new ItemPill(0).setUnlocalizedName("five_htp").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":5htp"); pill_iodine = new ItemPill(0).setUnlocalizedName("pill_iodine").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pill_iodine"); plan_c = new ItemPill(0).setUnlocalizedName("plan_c").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":plan_c"); @@ -7275,6 +7277,7 @@ public class ModItems { GameRegistry.registerItem(pill_iodine, pill_iodine.getUnlocalizedName()); GameRegistry.registerItem(xanax, xanax.getUnlocalizedName()); GameRegistry.registerItem(fmn, fmn.getUnlocalizedName()); + GameRegistry.registerItem(pirfenidone, pirfenidone.getUnlocalizedName()); GameRegistry.registerItem(five_htp, five_htp.getUnlocalizedName()); GameRegistry.registerItem(plan_c, plan_c.getUnlocalizedName()); GameRegistry.registerItem(stealth_boy, stealth_boy.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/food/ItemPill.java b/src/main/java/com/hbm/items/food/ItemPill.java index e0668ebdf..c6a9622fa 100644 --- a/src/main/java/com/hbm/items/food/ItemPill.java +++ b/src/main/java/com/hbm/items/food/ItemPill.java @@ -67,6 +67,11 @@ public class ItemPill extends ItemFood { HbmLivingProps.setDigamma(player, Math.min(digamma, 2F)); player.addPotionEffect(new PotionEffect(Potion.blindness.id, 60, 0)); } + + if(this == ModItems.pirfenidone) { + float fibrosis = HbmLivingProps.getFibrosis(player); + HbmLivingProps.setFibrosis(player, (int) Math.min(fibrosis, 37800)); + } if(this == ModItems.five_htp) { HbmLivingProps.setDigamma(player, 0); @@ -95,6 +100,9 @@ public class ItemPill extends ItemFood { if(this == ModItems.fmn) { list.add("Removes all DRX above 2,000mDRX"); } + if(this == ModItems.pirfenidone) { + list.add("Removes all Pulmonary Fibrosis over 35%"); + } if(this == ModItems.five_htp) { list.add("Removes all DRX, Stability for 10 minutes"); } diff --git a/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileBase.java b/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileBase.java index 938910d79..63d693b33 100644 --- a/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileBase.java +++ b/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileBase.java @@ -53,7 +53,7 @@ public abstract class TileEntityPileBase extends TileEntity { if(te instanceof IPileNeutronReceiver) { //this part throttles neutron efficiency for reactions that are way too close, efficiency reaches 100% after 2.5 meters - float mult = Math.min((float)range / 2.5F, 1F); + float mult = Math.min((float)range / 1.5F, 1F); int n = (int)(flux * mult); IPileNeutronReceiver rec = (IPileNeutronReceiver) te; diff --git a/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileFuel.java b/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileFuel.java index b5b09a9e9..027ad9699 100644 --- a/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileFuel.java +++ b/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileFuel.java @@ -1,6 +1,7 @@ package com.hbm.tileentity.machine.pile; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import api.hbm.block.IPileNeutronReceiver; import net.minecraft.init.Blocks; @@ -13,7 +14,7 @@ public class TileEntityPileFuel extends TileEntityPileBase implements IPileNeutr public int neutrons; public int lastNeutrons; public int progress; - public static final int maxProgress = 100000; + public static final int maxProgress = GeneralConfig.enable528 ? 75000 : 50000; @Override public void updateEntity() { diff --git a/src/main/resources/assets/hbm/lang/en_NT.lang b/src/main/resources/assets/hbm/lang/en_NT.lang index 16299e21a..2b775c582 100644 --- a/src/main/resources/assets/hbm/lang/en_NT.lang +++ b/src/main/resources/assets/hbm/lang/en_NT.lang @@ -1469,6 +1469,7 @@ item.radaway.name=RadAway item.radaway_strong.name=Strong RadAway item.radaway_flush.name=Elite RadAway item.radx.name=Rad-X +item.pirfenidone.name=Pirfenidone item.pill_iodine.name=Iodine Pill item.plan_c.name=Plan C item.med_ipecac.name=Ipecac Syrup diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 76c7e0093..beabe45a0 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -2028,6 +2028,7 @@ item.pill_iodine.name=Iodine Pill item.pin.name=Bobby Pin item.pipes_steel.name=Steel Pipes item.pipes_steel.desc=Uncrafting was omitted due to tax evasion. +item.pirfenidone.name=Pirfenidone item.piston_selenium.name=Radial Engine Piston item.plan_c.name=Plan C item.plate_advanced_alloy.name=Advanced Alloy Plate diff --git a/src/main/resources/assets/hbm/textures/items/pirfenidone.png b/src/main/resources/assets/hbm/textures/items/pirfenidone.png new file mode 100644 index 000000000..90a7965be Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/pirfenidone.png differ