Merge pull request #299 from Vaern/master

can't miss the everything is awful update 2.0
This commit is contained in:
HbmMods 2021-10-06 15:59:37 +02:00 committed by GitHub
commit 30765c5d11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 82 additions and 23 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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" }));

View File

@ -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 ///

View File

@ -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));
}
}
}
}

View File

@ -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[] {

View File

@ -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());

View File

@ -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");
}

View File

@ -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;

View File

@ -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() {

View File

@ -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

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B