From 33d4876767a92f3f241008d9813d46146bc6a67f Mon Sep 17 00:00:00 2001 From: HbmMods Date: Tue, 28 Aug 2018 15:44:43 +0200 Subject: [PATCH] tainted heart effect, tainted syringe --- assets/hbm/lang/de_DE.lang | 3 +- assets/hbm/lang/en_US.lang | 3 +- assets/hbm/textures/items/syringe_taint.png | Bin 0 -> 294 bytes com/hbm/explosion/ExplosionChaos.java | 9 +++- com/hbm/items/ModItems.java | 3 ++ com/hbm/items/special/ItemSyringe.java | 50 ++++++++++++++++++++ com/hbm/lib/Library.java | 10 +++- com/hbm/main/CraftingManager.java | 3 +- com/hbm/main/MainRegistry.java | 4 ++ com/hbm/main/ModEventHandler.java | 36 +++++++++++++- com/hbm/potion/HbmPotion.java | 2 + 11 files changed, 115 insertions(+), 8 deletions(-) create mode 100644 assets/hbm/textures/items/syringe_taint.png 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 0000000000000000000000000000000000000000..51f837e60fc5d17928427d8c5ea96232e302b7df GIT binary patch literal 294 zcmV+>0oneEP)*@h>Y9Ok)jA#ClZ?tU@8~UR0Dx51C){@ zF>P9C)4AaY+}mV{eQ<=i5 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) {