diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 808270d94..97e506dab 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -31,7 +31,7 @@ achievement.FOEQ=Pegasi und Raketensilos achievement.FOEQ.desc=Sende ein Relais in den Mars-...ich meine Duna-Orbit. potion.hbm_taint=Verdorben -potion.hbm_taint_boost=Verdorbenes Herz +potion.hbm_mutation=Verdorbenes Herz potion.hbm_radiation=Strahlenkrankheit potion.hbm_bang=! ! ! @@ -1236,6 +1236,7 @@ item.syringe_metal_stimpak.name=Stimpak item.syringe_metal_medx.name=Med-X item.syringe_metal_psycho.name=Psycho item.syringe_metal_super.name=Super Stimpak +item.syringe_taint.name=Wässrige Schmutzinjektion item.med_bag.name=Ärztetasche item.radaway.name=Radaway item.pill_iodine.name=Iodpille diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 883cead31..6c741cbcb 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -31,7 +31,7 @@ achievement.FOEQ=Pegasi and Missile Silos achievement.FOEQ.desc=Send a relay into martian...I mean dunaian orbit. potion.hbm_taint=Tainted -potion.hbm_taint_boost=Tainted Heart +potion.hbm_mutation=Tainted Heart potion.hbm_radiation=Radiation Sickness potion.hbm_bang=! ! ! @@ -1236,6 +1236,7 @@ item.syringe_metal_stimpak.name=Stimpak item.syringe_metal_medx.name=Med-X item.syringe_metal_psycho.name=Psycho item.syringe_metal_super.name=Super Stimpak +item.syringe_taint.name=Watery Taint Injection item.med_bag.name=Doctor's Bag item.radaway.name=Radaway item.pill_iodine.name=Iodine Pill diff --git a/assets/hbm/textures/items/syringe_taint.png b/assets/hbm/textures/items/syringe_taint.png new file mode 100644 index 000000000..51f837e60 Binary files /dev/null and b/assets/hbm/textures/items/syringe_taint.png differ diff --git a/com/hbm/explosion/ExplosionChaos.java b/com/hbm/explosion/ExplosionChaos.java index 052f3d61e..1bca8a882 100644 --- a/com/hbm/explosion/ExplosionChaos.java +++ b/com/hbm/explosion/ExplosionChaos.java @@ -27,6 +27,7 @@ import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.ISource; import com.hbm.lib.Library; import com.hbm.lib.ModDamageSource; +import com.hbm.potion.HbmPotion; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -740,7 +741,13 @@ public class ExplosionChaos { } if (entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer) entity)) { } else { - entity.attackEntityFrom(ModDamageSource.cloud, 3); + + if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(HbmPotion.taint.id)) { + ((EntityLivingBase)entity).removePotionEffect(HbmPotion.taint.id); + ((EntityLivingBase)entity).addPotionEffect(new PotionEffect(HbmPotion.mutation.id, 1 * 60 * 60 * 20, 0)); + } else { + entity.attackEntityFrom(ModDamageSource.cloud, 3); + } } } } diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index e89345544..2bc7a4397 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -518,6 +518,7 @@ public class ModItems { public static Item syringe_metal_medx; public static Item syringe_metal_psycho; public static Item syringe_metal_super; + public static Item syringe_taint; public static Item radaway; public static Item med_bag; public static Item pill_iodine; @@ -1765,6 +1766,7 @@ public class ModItems { syringe_metal_medx = new ItemSyringe().setUnlocalizedName("syringe_metal_medx").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_metal_medx"); syringe_metal_psycho = new ItemSyringe().setUnlocalizedName("syringe_metal_psycho").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_metal_psycho"); syringe_metal_super = new ItemSyringe().setUnlocalizedName("syringe_metal_super").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_metal_super"); + syringe_taint = new ItemSyringe().setUnlocalizedName("syringe_taint").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_taint"); med_bag = new ItemSyringe().setUnlocalizedName("med_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":med_bag"); radaway = new ItemSyringe().setUnlocalizedName("radaway").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":radaway"); pill_iodine = new ItemPill(0).setUnlocalizedName("pill_iodine").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pill_iodine"); @@ -3589,6 +3591,7 @@ public class ModItems { GameRegistry.registerItem(syringe_metal_medx, syringe_metal_medx.getUnlocalizedName()); GameRegistry.registerItem(syringe_metal_psycho, syringe_metal_psycho.getUnlocalizedName()); GameRegistry.registerItem(syringe_metal_super, syringe_metal_super.getUnlocalizedName()); + GameRegistry.registerItem(syringe_taint, syringe_taint.getUnlocalizedName()); GameRegistry.registerItem(med_bag, med_bag.getUnlocalizedName()); GameRegistry.registerItem(radaway, radaway.getUnlocalizedName()); GameRegistry.registerItem(pill_iodine, pill_iodine.getUnlocalizedName()); diff --git a/com/hbm/items/special/ItemSyringe.java b/com/hbm/items/special/ItemSyringe.java index 187ad2a0f..c1766990d 100644 --- a/com/hbm/items/special/ItemSyringe.java +++ b/com/hbm/items/special/ItemSyringe.java @@ -209,6 +209,27 @@ public class ItemSyringe extends Item { } } + if(this == ModItems.syringe_taint) + { + if (!world.isRemote) + { + player.addPotionEffect(new PotionEffect(HbmPotion.taint.id, 60 * 20, 0)); + player.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0)); + + stack.stackSize--; + } + + if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) + { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + + if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty))) + { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.bottle2_empty, 1, 0), false); + } + } + return stack; } @@ -388,6 +409,30 @@ public class ItemSyringe extends Item { } } + if(this == ModItems.syringe_taint) + { + if (!world.isRemote) + { + entity.addPotionEffect(new PotionEffect(HbmPotion.taint.id, 60 * 20, 0)); + entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0)); + + stack.stackSize--; + + if(entityPlayer instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer)entityPlayer; + if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty))) + { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false); + } + if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle2_empty))) + { + player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.bottle2_empty, 1, 0), false); + } + } + } + } + if(this == ModItems.euphemium_stopper) { if (!world.isRemote) @@ -434,5 +479,10 @@ public class ItemSyringe extends Item { if(this == ModItems.radaway) { list.add("Removes radiation effect"); } + if(this == ModItems.syringe_taint) { + list.add("Tainted I for 60 seconds"); + list.add("Nausea I for 5 seconds"); + list.add("Cloud damage + taint = tainted heart effect"); + } } } diff --git a/com/hbm/lib/Library.java b/com/hbm/lib/Library.java index 763d6173a..2030db2fc 100644 --- a/com/hbm/lib/Library.java +++ b/com/hbm/lib/Library.java @@ -258,11 +258,14 @@ public class Library { if(checkArmor(player, ModItems.hazmat_helmet, ModItems.hazmat_plate, ModItems.hazmat_legs, ModItems.hazmat_boots) || checkArmor(player, ModItems.t45_helmet, ModItems.t45_plate, ModItems.t45_legs, ModItems.t45_boots) || checkArmor(player, ModItems.schrabidium_helmet, ModItems.schrabidium_plate, ModItems.schrabidium_legs, ModItems.schrabidium_boots) || - checkForHaz2(player)) - { + checkForHaz2(player)) { + return true; } + if(player.isPotionActive(HbmPotion.mutation)) + return true; + return false; } @@ -318,6 +321,9 @@ public class Library { return true; } + if(player.isPotionActive(HbmPotion.mutation)) + return true; + return false; } diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index f55ec24ca..0310e535f 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -1191,8 +1191,6 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_dineutronium, 4), new Object[] { "PIP", "IDI", "PIP", 'P', ModItems.powder_spark_mix, 'I', "ingotDineutronium", 'D', "ingotDesh" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_desh, 4), new Object[] { "PIP", "IDI", "PIP", 'P', ModItems.powder_polymer, 'I', "ingotDesh", 'D', "ingotDuraSteel" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.piston_selenium, 1), new Object[] { "SSS", "STS", " D ", 'S', "plateSteel", 'T', "ingotTungsten", 'D', ModItems.bolt_dura_steel })); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.taint), new Object[] { "nuggetEuphemium", ModItems.nuclear_waste })); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.taint), new Object[] { "nuggetEuphemium", ModItems.trinitite })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.meteor_remote), new Object[] { "nuggetSchrabidium", ModItems.fragment_meteorite, ModItems.crate_caller })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.crate_caller), new Object[] { "nuggetSchrabidium", ModItems.crowbar, ModItems.detonator })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.catalyst_clay), new Object[] { "dustIron", Items.clay_ball })); @@ -1244,6 +1242,7 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.mine_he, 1), new Object[] { " C ", "PTP", 'C', ModItems.circuit_targeting_tier2, 'P', "plateSteel", 'T', Blocks.tnt })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.mine_shrap, 2), new Object[] { "LLL", " C ", "PTP", 'C', ModItems.circuit_targeting_tier2, 'P', "plateSteel", 'T', ModBlocks.det_cord, 'L', ModItems.pellet_buckshot })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.defuser, 1), new Object[] { " PS", "P P", " P ", 'P', "ingotPolymer", 'S', "plateSteel" })); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.syringe_taint), new Object[] { ModItems.bottle2_empty, ModItems.syringe_metal_empty, ModItems.ducttape, ModItems.powder_magic, "nuggetSchrabidium", Items.potionitem })); GameRegistry.addShapelessRecipe(new ItemStack(Items.paper, 1), new Object[] { new ItemStack(ModItems.assembly_template, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addShapelessRecipe(new ItemStack(Items.paper, 1), new Object[] { new ItemStack(ModItems.chemistry_template, 1, OreDictionary.WILDCARD_VALUE) }); diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index 79f1343d9..013577525 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -503,6 +503,7 @@ public class MainRegistry public static int taintID = 62; public static int radiationID = 63; public static int bangID = 64; + public static int mutationID = 65; public static int x; public static int y; @@ -1519,6 +1520,9 @@ public class MainRegistry Property propBangID = config.get(Configuration.CATEGORY_GENERAL, "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); + propMutationID.comment = "What potion ID the taint mutation effect will have"; + mutationID = propMutationID.getInt(); config.save(); } diff --git a/com/hbm/main/ModEventHandler.java b/com/hbm/main/ModEventHandler.java index 551f07034..515b9e81c 100644 --- a/com/hbm/main/ModEventHandler.java +++ b/com/hbm/main/ModEventHandler.java @@ -153,7 +153,7 @@ public class ModEventHandler entity.attackEntityFrom(ModDamageSource.radiation, 100F); } - } else if(entity instanceof EntityCow) { + } else if(entity instanceof EntityCow && !(entity instanceof EntityMooshroom)) { EntityMooshroom creep = new EntityMooshroom(event.world); creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); @@ -205,6 +205,40 @@ public class ModEventHandler } } } + + if(entity.isPotionActive(HbmPotion.mutation) && !entity.isDead && entity.getHealth() > 0) { + + if(event.world.rand.nextInt(300) == 0) + entity.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 10 * 20, 1)); + if(event.world.rand.nextInt(300) == 0) + entity.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 15 * 20, 0)); + if(event.world.rand.nextInt(300) == 0) + entity.addPotionEffect(new PotionEffect(Potion.jump.id, 30 * 20, 1)); + + if(entity.getHealth() <= entity.getMaxHealth() / 10F * 5F) + entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 5 * 20, 2)); + if(entity.getHealth() <= entity.getMaxHealth() / 10F * 4F) + entity.addPotionEffect(new PotionEffect(Potion.regeneration.id, 5 * 20, 1)); + if(entity.getHealth() <= entity.getMaxHealth() / 10F * 3F) + entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 5 * 20, 4)); + if(entity.getHealth() <= entity.getMaxHealth() / 10F * 2F) + entity.addPotionEffect(new PotionEffect(Potion.regeneration.id, 5 * 20, 3)); + if(entity.getHealth() <= entity.getMaxHealth() / 10F * 1F) + entity.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 5 * 20, 0)); + + if(entity.isPotionActive(Potion.poison)) + entity.removePotionEffect(Potion.poison.id); + if(entity.isPotionActive(Potion.wither)) + entity.removePotionEffect(Potion.wither.id); + if(entity.isPotionActive(Potion.hunger)) + entity.removePotionEffect(Potion.hunger.id); + if(entity.isPotionActive(Potion.confusion)) + entity.removePotionEffect(Potion.confusion.id); + if(entity.isPotionActive(Potion.digSlowdown)) + entity.removePotionEffect(Potion.digSlowdown.id); + if(entity.isPotionActive(Potion.moveSlowdown)) + entity.removePotionEffect(Potion.moveSlowdown.id); + } } } } diff --git a/com/hbm/potion/HbmPotion.java b/com/hbm/potion/HbmPotion.java index ce41e4433..0d33de57e 100644 --- a/com/hbm/potion/HbmPotion.java +++ b/com/hbm/potion/HbmPotion.java @@ -20,6 +20,7 @@ public class HbmPotion extends Potion { public static HbmPotion taint; public static HbmPotion radiation; public static HbmPotion bang; + public static HbmPotion mutation; public HbmPotion(int id, boolean isBad, int color) { super(id, isBad, color); @@ -29,6 +30,7 @@ public class HbmPotion extends Potion { taint = registerPotion(MainRegistry.taintID, true, 8388736, "potion.hbm_taint", 0, 0); radiation = registerPotion(MainRegistry.radiationID, true, 8700200, "potion.hbm_radiation", 1, 0); bang = registerPotion(MainRegistry.bangID, true, 1118481, "potion.hbm_bang", 3, 0); + mutation = registerPotion(MainRegistry.mutationID, false, 8388736, "potion.hbm_mutation", 2, 0); } public static HbmPotion registerPotion(int id, boolean isBad, int color, String name, int x, int y) {