slight tweaks, DNT armor, digamma protection, mesothelioma

This commit is contained in:
Bob 2021-03-01 23:14:29 +01:00
parent ebdc0e9ca2
commit e2585760de
15 changed files with 192 additions and 37 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

View File

@ -2,9 +2,12 @@ package com.hbm.blocks.generic;
import java.util.Random; import java.util.Random;
import com.hbm.util.ContaminationUtil;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
@ -19,6 +22,14 @@ public class BlockGasAsbestos extends BlockGasBase {
world.spawnParticle("townaura", x + rand.nextFloat(), y + rand.nextFloat(), z + rand.nextFloat(), 0.0D, 0.0D, 0.0D); world.spawnParticle("townaura", x + rand.nextFloat(), y + rand.nextFloat(), z + rand.nextFloat(), 0.0D, 0.0D, 0.0D);
} }
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
if(entity instanceof EntityLivingBase) {
ContaminationUtil.applyAsbestos(entity, 1);
}
}
@Override @Override
public ForgeDirection getFirstDirection(World world, int x, int y, int z) { public ForgeDirection getFirstDirection(World world, int x, int y, int z) {

View File

@ -76,6 +76,8 @@ public abstract class BlockGasBase extends Block {
if(!world.isRemote) { if(!world.isRemote) {
world.scheduledUpdatesAreImmediate = false; //prevent recursive loop when some dumbass forgets to clean up immediate updating
if(!tryMove(world, x, y, z, getFirstDirection(world, x, y, z))) if(!tryMove(world, x, y, z, getFirstDirection(world, x, y, z)))
if(!tryMove(world, x, y, z, getSecondDirection(world, x, y, z))) if(!tryMove(world, x, y, z, getSecondDirection(world, x, y, z)))
world.scheduleBlockUpdate(x, y, z, this, getDelay(world)); world.scheduleBlockUpdate(x, y, z, this, getDelay(world));

View File

@ -50,6 +50,10 @@ public class ArmorRecipes {
GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_plate, 1), new Object[] { "E E", "EEE", "EEE", 'E', ModItems.ingot_cobalt }); GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_plate, 1), new Object[] { "E E", "EEE", "EEE", 'E', ModItems.ingot_cobalt });
GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_legs, 1), new Object[] { "EEE", "E E", "E E", 'E', ModItems.ingot_cobalt }); GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_legs, 1), new Object[] { "EEE", "E E", "E E", 'E', ModItems.ingot_cobalt });
GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_boots, 1), new Object[] { "E E", "E E", 'E', ModItems.ingot_cobalt }); GameRegistry.addRecipe(new ItemStack(ModItems.cobalt_boots, 1), new Object[] { "E E", "E E", 'E', ModItems.ingot_cobalt });
GameRegistry.addRecipe(new ItemStack(ModItems.dnt_helmet, 1), new Object[] { "EEE", "EE ", 'E', ModItems.ingot_dineutronium });
GameRegistry.addRecipe(new ItemStack(ModItems.dnt_plate, 1), new Object[] { "EE ", "EEE", "EEE", 'E', ModItems.ingot_dineutronium });
GameRegistry.addRecipe(new ItemStack(ModItems.dnt_legs, 1), new Object[] { "EE ", "EEE", "E E", 'E', ModItems.ingot_dineutronium });
GameRegistry.addRecipe(new ItemStack(ModItems.dnt_boots, 1), new Object[] { " E", "E ", "E E", 'E', ModItems.ingot_dineutronium });
//Power armor //Power armor
GameRegistry.addRecipe(new ItemStack(ModItems.t45_helmet, 1), new Object[] { "PPC", "PBP", "IXI", 'P', ModItems.plate_armor_titanium, 'C', ModItems.circuit_targeting_tier3, 'I', ModItems.plate_polymer, 'X', ModItems.gas_mask_m65, 'B', ModItems.titanium_helmet }); GameRegistry.addRecipe(new ItemStack(ModItems.t45_helmet, 1), new Object[] { "PPC", "PBP", "IXI", 'P', ModItems.plate_armor_titanium, 'C', ModItems.circuit_targeting_tier3, 'I', ModItems.plate_polymer, 'X', ModItems.gas_mask_m65, 'B', ModItems.titanium_helmet });

View File

@ -4,7 +4,6 @@ import java.util.UUID;
import com.hbm.lib.ModDamageSource; import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.potion.HbmPotion;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -25,6 +24,7 @@ public class HbmLivingProps implements IExtendedEntityProperties {
/// VALS /// /// VALS ///
private float radiation; private float radiation;
private float digamma; private float digamma;
private int asbestos;
public HbmLivingProps(EntityLivingBase entity) { public HbmLivingProps(EntityLivingBase entity) {
this.entity = entity; this.entity = entity;
@ -69,12 +69,8 @@ public class HbmLivingProps implements IExtendedEntityProperties {
return getData(entity).digamma; return getData(entity).digamma;
} }
//TODO: move all the checking into the contamination util
public static void setDigamma(EntityLivingBase entity, float digamma) { public static void setDigamma(EntityLivingBase entity, float digamma) {
if(entity.isPotionActive(HbmPotion.stability.id))
return;
getData(entity).digamma = digamma; getData(entity).digamma = digamma;
float healthMod = (float)Math.pow(0.5, digamma) - 1F; float healthMod = (float)Math.pow(0.5, digamma) - 1F;
@ -123,6 +119,25 @@ public class HbmLivingProps implements IExtendedEntityProperties {
data.setDigamma(entity, dRad); data.setDigamma(entity, dRad);
} }
/// ASBESTOS ///
public static int getAsbestos(EntityLivingBase entity) {
return getData(entity).asbestos;
}
public static void setAsbestos(EntityLivingBase entity, int asbestos) {
getData(entity).asbestos = asbestos;
if(asbestos <= 1000000) {
getData(entity).asbestos = 0;
entity.attackEntityFrom(ModDamageSource.asbestos, 1000);
}
}
public static void incrementAsbestos(EntityLivingBase entity, int asbestos) {
setAsbestos(entity, getAsbestos(entity) + asbestos);
}
@Override @Override
public void init(Entity entity, World world) { } public void init(Entity entity, World world) { }
@ -133,6 +148,7 @@ public class HbmLivingProps implements IExtendedEntityProperties {
props.setFloat("hfr_radiation", radiation); props.setFloat("hfr_radiation", radiation);
props.setFloat("hfr_digamma", digamma); props.setFloat("hfr_digamma", digamma);
props.setInteger("hfr_asbestos", asbestos);
nbt.setTag("HbmLivingProps", props); nbt.setTag("HbmLivingProps", props);
} }
@ -145,6 +161,25 @@ public class HbmLivingProps implements IExtendedEntityProperties {
if(props != null) { if(props != null) {
radiation = props.getFloat("hfr_radiation"); radiation = props.getFloat("hfr_radiation");
digamma = props.getFloat("hfr_digamma"); digamma = props.getFloat("hfr_digamma");
asbestos = props.getInteger("hfr_asbestos");
}
}
public static class ContaminationEffect {
public float maxRad;
public int maxTime;
public int time;
public boolean ignoreArmor;
public ContaminationEffect(float rad, int time, boolean ignoreArmor) {
this.maxRad = rad;
this.maxTime = this.time = time;
this.ignoreArmor = ignoreArmor;
}
public float getRad() {
return maxRad * ((float)time / (float)maxTime);
} }
} }
} }

View File

@ -1687,6 +1687,10 @@ public class ModItems {
public static Item starmetal_plate; public static Item starmetal_plate;
public static Item starmetal_legs; public static Item starmetal_legs;
public static Item starmetal_boots; public static Item starmetal_boots;
public static Item dnt_helmet;
public static Item dnt_plate;
public static Item dnt_legs;
public static Item dnt_boots;
public static Item ajr_helmet; public static Item ajr_helmet;
public static Item ajr_plate; public static Item ajr_plate;
public static Item ajr_legs; public static Item ajr_legs;
@ -1848,6 +1852,7 @@ public class ModItems {
public static Item insert_polonium; public static Item insert_polonium;
public static Item insert_era; public static Item insert_era;
public static Item insert_yharonite; public static Item insert_yharonite;
public static Item insert_doxium;
public static Item armor_polish; public static Item armor_polish;
public static Item bandaid; public static Item bandaid;
public static Item serum; public static Item serum;
@ -2807,6 +2812,7 @@ public class ModItems {
insert_polonium = new ItemModInsert(500, 0.9F, 1F, 0.95F, 0.9F).setUnlocalizedName("insert_polonium").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":insert_polonium"); insert_polonium = new ItemModInsert(500, 0.9F, 1F, 0.95F, 0.9F).setUnlocalizedName("insert_polonium").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":insert_polonium");
insert_era = new ItemModInsert(25, 0.5F, 1F, 0.25F, 1F).setUnlocalizedName("insert_era").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":insert_era"); insert_era = new ItemModInsert(25, 0.5F, 1F, 0.25F, 1F).setUnlocalizedName("insert_era").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":insert_era");
insert_yharonite = new ItemModInsert(9999, 0.01F, 1F, 1F, 1F).setUnlocalizedName("insert_yharonite").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":insert_yharonite"); insert_yharonite = new ItemModInsert(9999, 0.01F, 1F, 1F, 1F).setUnlocalizedName("insert_yharonite").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":insert_yharonite");
insert_doxium = new ItemModInsert(9999, 5.0F, 1F, 1F, 1F).setUnlocalizedName("insert_doxium").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":insert_doxium");
armor_polish = new ItemModPolish().setUnlocalizedName("armor_polish").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":armor_polish"); armor_polish = new ItemModPolish().setUnlocalizedName("armor_polish").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":armor_polish");
bandaid = new ItemModBandaid().setUnlocalizedName("bandaid").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bandaid"); bandaid = new ItemModBandaid().setUnlocalizedName("bandaid").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bandaid");
serum = new ItemModSerum().setUnlocalizedName("serum").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":serum"); serum = new ItemModSerum().setUnlocalizedName("serum").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":serum");
@ -3926,6 +3932,14 @@ public class ModItems {
starmetal_legs = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_legs").setTextureName(RefStrings.MODID + ":starmetal_legs"); starmetal_legs = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_legs").setTextureName(RefStrings.MODID + ":starmetal_legs");
starmetal_boots = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_boots").setTextureName(RefStrings.MODID + ":starmetal_boots"); starmetal_boots = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_boots").setTextureName(RefStrings.MODID + ":starmetal_boots");
ArmorMaterial aMatDNT = EnumHelper.addArmorMaterial("HBM_DNT_LOLOLOL", 3, new int[] { 1, 1, 1, 1 }, 0);
aMatDNT.customCraftingMaterial = ModItems.ingot_dineutronium;
dnt_helmet = new ArmorFSB(aMatDNT, 7, 0, RefStrings.MODID + ":textures/armor/dnt_1.png")
.setMod(1.1F).setUnlocalizedName("dnt_helmet").setTextureName(RefStrings.MODID + ":dnt_helmet");
dnt_plate = new ArmorFSB(aMatDNT, 7, 1, RefStrings.MODID + ":textures/armor/dnt_1.png").cloneStats((ArmorFSB) dnt_helmet).setUnlocalizedName("dnt_plate").setTextureName(RefStrings.MODID + ":dnt_plate");
dnt_legs = new ArmorFSB(aMatDNT, 7, 2, RefStrings.MODID + ":textures/armor/dnt_2.png").cloneStats((ArmorFSB) dnt_helmet).setUnlocalizedName("dnt_legs").setTextureName(RefStrings.MODID + ":dnt_legs");
dnt_boots = new ArmorFSB(aMatDNT, 7, 3, RefStrings.MODID + ":textures/armor/dnt_1.png").cloneStats((ArmorFSB) dnt_helmet).setUnlocalizedName("dnt_boots").setTextureName(RefStrings.MODID + ":dnt_boots");
ArmorMaterial aMatT45 = EnumHelper.addArmorMaterial("HBM_T45", 150, new int[] { 3, 8, 6, 3 }, 0); ArmorMaterial aMatT45 = EnumHelper.addArmorMaterial("HBM_T45", 150, new int[] { 3, 8, 6, 3 }, 0);
aMatT45.customCraftingMaterial = ModItems.plate_armor_titanium; aMatT45.customCraftingMaterial = ModItems.plate_armor_titanium;
t45_helmet = new ArmorT45(aMatT45, 2, 0, 1000000, 10000, 1000, 5).setCap(10F).setMod(0.5F) t45_helmet = new ArmorT45(aMatT45, 2, 0, 1000000, 10000, 1000, 5).setCap(10F).setMod(0.5F)
@ -3935,6 +3949,7 @@ public class ModItems {
.setHasHardLanding(true) .setHasHardLanding(true)
.addEffect(new PotionEffect(Potion.damageBoost.id, 20, 0)) .addEffect(new PotionEffect(Potion.damageBoost.id, 20, 0))
.setBlastProtection(0.5F) .setBlastProtection(0.5F)
.addResistance("monoxide", 0F)
.addResistance("fall", 0) .addResistance("fall", 0)
.setUnlocalizedName("t45_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_helmet"); .setUnlocalizedName("t45_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_helmet");
t45_plate = new ArmorT45(aMatT45, 2, 1, 1000000, 10000, 1000, 5).cloneStats((ArmorFSB) t45_helmet).setUnlocalizedName("t45_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_plate"); t45_plate = new ArmorT45(aMatT45, 2, 1, 1000000, 10000, 1000, 5).cloneStats((ArmorFSB) t45_helmet).setUnlocalizedName("t45_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_plate");
@ -3954,6 +3969,7 @@ public class ModItems {
.setStep("hbm:step.metal") .setStep("hbm:step.metal")
.setJump("hbm:step.iron_jump") .setJump("hbm:step.iron_jump")
.setFall("hbm:step.iron_land") .setFall("hbm:step.iron_land")
.addResistance("monoxide", 0F)
.addResistance("fall", 0).setUnlocalizedName("ajr_helmet").setTextureName(RefStrings.MODID + ":ajr_helmet"); .addResistance("fall", 0).setUnlocalizedName("ajr_helmet").setTextureName(RefStrings.MODID + ":ajr_helmet");
ajr_plate = new ArmorAJR(aMatAJR, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajr_helmet).setUnlocalizedName("ajr_plate").setTextureName(RefStrings.MODID + ":ajr_plate"); ajr_plate = new ArmorAJR(aMatAJR, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajr_helmet).setUnlocalizedName("ajr_plate").setTextureName(RefStrings.MODID + ":ajr_plate");
ajr_legs = new ArmorAJR(aMatAJR, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajr_helmet).setUnlocalizedName("ajr_legs").setTextureName(RefStrings.MODID + ":ajr_legs"); ajr_legs = new ArmorAJR(aMatAJR, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajr_helmet).setUnlocalizedName("ajr_legs").setTextureName(RefStrings.MODID + ":ajr_legs");
@ -3970,6 +3986,7 @@ public class ModItems {
.setStep("hbm:step.metal") .setStep("hbm:step.metal")
.setJump("hbm:step.iron_jump") .setJump("hbm:step.iron_jump")
.setFall("hbm:step.iron_land") .setFall("hbm:step.iron_land")
.addResistance("monoxide", 0F)
.addResistance("fall", 0).setUnlocalizedName("ajro_helmet").setTextureName(RefStrings.MODID + ":ajro_helmet"); .addResistance("fall", 0).setUnlocalizedName("ajro_helmet").setTextureName(RefStrings.MODID + ":ajro_helmet");
ajro_plate = new ArmorAJRO(aMatAJR, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajro_helmet).setUnlocalizedName("ajro_plate").setTextureName(RefStrings.MODID + ":ajro_plate"); ajro_plate = new ArmorAJRO(aMatAJR, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajro_helmet).setUnlocalizedName("ajro_plate").setTextureName(RefStrings.MODID + ":ajro_plate");
ajro_legs = new ArmorAJRO(aMatAJR, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajro_helmet).setUnlocalizedName("ajro_legs").setTextureName(RefStrings.MODID + ":ajro_legs"); ajro_legs = new ArmorAJRO(aMatAJR, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajro_helmet).setUnlocalizedName("ajro_legs").setTextureName(RefStrings.MODID + ":ajro_legs");
@ -4008,6 +4025,7 @@ public class ModItems {
.setHasGeigerSound(true) .setHasGeigerSound(true)
.setHasCustomGeiger(true) .setHasCustomGeiger(true)
.addResistance("fall", 0.5F) .addResistance("fall", 0.5F)
.addResistance("monoxide", 0F)
.addResistance("onFire", 0F).setUnlocalizedName("hev_helmet").setTextureName(RefStrings.MODID + ":hev_helmet"); .addResistance("onFire", 0F).setUnlocalizedName("hev_helmet").setTextureName(RefStrings.MODID + ":hev_helmet");
hev_plate = new ArmorHEV(aMatHEV, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000, 10000, 2500, 0).cloneStats((ArmorFSB) hev_helmet).setUnlocalizedName("hev_plate").setTextureName(RefStrings.MODID + ":hev_plate"); hev_plate = new ArmorHEV(aMatHEV, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000, 10000, 2500, 0).cloneStats((ArmorFSB) hev_helmet).setUnlocalizedName("hev_plate").setTextureName(RefStrings.MODID + ":hev_plate");
hev_legs = new ArmorHEV(aMatHEV, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 1000000, 10000, 2500, 0).cloneStats((ArmorFSB) hev_helmet).setUnlocalizedName("hev_legs").setTextureName(RefStrings.MODID + ":hev_legs"); hev_legs = new ArmorHEV(aMatHEV, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 1000000, 10000, 2500, 0).cloneStats((ArmorFSB) hev_helmet).setUnlocalizedName("hev_legs").setTextureName(RefStrings.MODID + ":hev_legs");
@ -4028,7 +4046,8 @@ public class ModItems {
.setStep("hbm:step.metal") .setStep("hbm:step.metal")
.setJump("hbm:step.iron_jump") .setJump("hbm:step.iron_jump")
.setFall("hbm:step.iron_land") .setFall("hbm:step.iron_land")
.addResistance("fall", 0.05F) .addResistance("fall", 0F)
.addResistance("monoxide", 0F)
.setFireproof(true).setUnlocalizedName("fau_helmet").setTextureName(RefStrings.MODID + ":fau_helmet"); .setFireproof(true).setUnlocalizedName("fau_helmet").setTextureName(RefStrings.MODID + ":fau_helmet");
fau_plate = new ArmorDigamma(aMatFau, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setUnlocalizedName("fau_plate").setTextureName(RefStrings.MODID + ":fau_plate"); fau_plate = new ArmorDigamma(aMatFau, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setUnlocalizedName("fau_plate").setTextureName(RefStrings.MODID + ":fau_plate");
fau_legs = new ArmorDigamma(aMatFau, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setUnlocalizedName("fau_legs").setTextureName(RefStrings.MODID + ":fau_legs"); fau_legs = new ArmorDigamma(aMatFau, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setUnlocalizedName("fau_legs").setTextureName(RefStrings.MODID + ":fau_legs");
@ -6303,6 +6322,7 @@ public class ModItems {
GameRegistry.registerItem(insert_polonium, insert_polonium.getUnlocalizedName()); GameRegistry.registerItem(insert_polonium, insert_polonium.getUnlocalizedName());
GameRegistry.registerItem(insert_era, insert_era.getUnlocalizedName()); GameRegistry.registerItem(insert_era, insert_era.getUnlocalizedName());
GameRegistry.registerItem(insert_yharonite, insert_yharonite.getUnlocalizedName()); GameRegistry.registerItem(insert_yharonite, insert_yharonite.getUnlocalizedName());
GameRegistry.registerItem(insert_doxium, insert_doxium.getUnlocalizedName());
GameRegistry.registerItem(armor_polish, armor_polish.getUnlocalizedName()); GameRegistry.registerItem(armor_polish, armor_polish.getUnlocalizedName());
GameRegistry.registerItem(bandaid, bandaid.getUnlocalizedName()); GameRegistry.registerItem(bandaid, bandaid.getUnlocalizedName());
GameRegistry.registerItem(serum, serum.getUnlocalizedName()); GameRegistry.registerItem(serum, serum.getUnlocalizedName());
@ -6476,6 +6496,10 @@ public class ModItems {
GameRegistry.registerItem(starmetal_plate, starmetal_plate.getUnlocalizedName()); GameRegistry.registerItem(starmetal_plate, starmetal_plate.getUnlocalizedName());
GameRegistry.registerItem(starmetal_legs, starmetal_legs.getUnlocalizedName()); GameRegistry.registerItem(starmetal_legs, starmetal_legs.getUnlocalizedName());
GameRegistry.registerItem(starmetal_boots, starmetal_boots.getUnlocalizedName()); GameRegistry.registerItem(starmetal_boots, starmetal_boots.getUnlocalizedName());
GameRegistry.registerItem(dnt_helmet, dnt_helmet.getUnlocalizedName());
GameRegistry.registerItem(dnt_plate, dnt_plate.getUnlocalizedName());
GameRegistry.registerItem(dnt_legs, dnt_legs.getUnlocalizedName());
GameRegistry.registerItem(dnt_boots, dnt_boots.getUnlocalizedName());
GameRegistry.registerItem(schrabidium_helmet, schrabidium_helmet.getUnlocalizedName()); GameRegistry.registerItem(schrabidium_helmet, schrabidium_helmet.getUnlocalizedName());
GameRegistry.registerItem(schrabidium_plate, schrabidium_plate.getUnlocalizedName()); GameRegistry.registerItem(schrabidium_plate, schrabidium_plate.getUnlocalizedName());
GameRegistry.registerItem(schrabidium_legs, schrabidium_legs.getUnlocalizedName()); GameRegistry.registerItem(schrabidium_legs, schrabidium_legs.getUnlocalizedName());

View File

@ -38,7 +38,7 @@ public class ItemModInsert extends ItemArmorMod {
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
if(damageMod != 1F) if(damageMod != 1F)
list.add(EnumChatFormatting.RED + "-" + Math.round((1F - damageMod) * 100) + "% damage"); list.add(EnumChatFormatting.RED + (damageMod < 1 ? "-" : "+") + Math.abs(Math.round((1F - damageMod) * 100)) + "% damage");
if(projectileMod != 1F) if(projectileMod != 1F)
list.add(EnumChatFormatting.YELLOW + "-" + Math.round((1F - projectileMod) * 100) + "% projectile damage"); list.add(EnumChatFormatting.YELLOW + "-" + Math.round((1F - projectileMod) * 100) + "% projectile damage");
if(explosionMod != 1F) if(explosionMod != 1F)
@ -61,7 +61,7 @@ public class ItemModInsert extends ItemArmorMod {
List<String> desc = new ArrayList(); List<String> desc = new ArrayList();
if(damageMod != 1F) if(damageMod != 1F)
desc.add("-" + Math.round((1F - damageMod) * 100) + "% dmg"); desc.add((damageMod < 1 ? "-" : "+") + Math.abs(Math.round((1F - damageMod) * 100)) + "% dmg");
if(projectileMod != 1F) if(projectileMod != 1F)
desc.add("-" + Math.round((1F - projectileMod) * 100) + "% proj"); desc.add("-" + Math.round((1F - projectileMod) * 100) + "% proj");
if(explosionMod != 1F) if(explosionMod != 1F)

View File

@ -5,6 +5,7 @@ import java.util.List;
import com.hbm.config.WeaponConfig; import com.hbm.config.WeaponConfig;
import com.hbm.entity.effect.EntityRagingVortex; import com.hbm.entity.effect.EntityRagingVortex;
import com.hbm.extprop.HbmLivingProps; import com.hbm.extprop.HbmLivingProps;
import com.hbm.util.ContaminationUtil;
import com.hbm.util.I18nUtil; import com.hbm.util.I18nUtil;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -23,16 +24,16 @@ public class ItemDigamma extends ItemRadioactive {
this.digamma = digamma; this.digamma = digamma;
} }
@Override @Override
public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean b) { public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean b) {
super.onUpdate(stack, world, entity, i, b); super.onUpdate(stack, world, entity, i, b);
if(entity instanceof EntityPlayer) { if(entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity; EntityPlayer player = (EntityPlayer) entity;
HbmLivingProps.incrementDigamma(player, 1F / ((float) digamma)); ContaminationUtil.applyDigammaData(player, 1F / ((float) digamma));
} }
} }
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
@ -43,7 +44,7 @@ public class ItemDigamma extends ItemRadioactive {
list.add(""); list.add("");
super.addInformation(stack, player, list, bool); super.addInformation(stack, player, list, bool);
float d = ((int)((1000F / digamma) * 10F)) / 10F; float d = ((int) ((1000F / digamma) * 10F)) / 10F;
list.add(EnumChatFormatting.RED + "[" + I18nUtil.resolveKey("trait.digamma") + "]"); list.add(EnumChatFormatting.RED + "[" + I18nUtil.resolveKey("trait.digamma") + "]");
list.add(EnumChatFormatting.DARK_RED + "" + d + "mDRX/s"); list.add(EnumChatFormatting.DARK_RED + "" + d + "mDRX/s");
@ -53,16 +54,16 @@ public class ItemDigamma extends ItemRadioactive {
@Override @Override
public boolean onEntityItemUpdate(EntityItem entityItem) { public boolean onEntityItemUpdate(EntityItem entityItem) {
if (entityItem != null) { if(entityItem != null) {
if (entityItem.onGround) { if(entityItem.onGround) {
if(WeaponConfig.dropSing) { if(WeaponConfig.dropSing) {
EntityRagingVortex bl = new EntityRagingVortex(entityItem.worldObj, 10F); EntityRagingVortex bl = new EntityRagingVortex(entityItem.worldObj, 10F);
bl.posX = entityItem.posX ; bl.posX = entityItem.posX;
bl.posY = entityItem.posY ; bl.posY = entityItem.posY;
bl.posZ = entityItem.posZ ; bl.posZ = entityItem.posZ;
entityItem.worldObj.spawnEntityInWorld(bl); entityItem.worldObj.spawnEntityInWorld(bl);
} }
entityItem.setDead(); entityItem.setDead();

View File

@ -50,6 +50,7 @@ public class ModDamageSource extends DamageSource {
public static DamageSource spikes = (new DamageSource("spikes")).setDamageBypassesArmor(); public static DamageSource spikes = (new DamageSource("spikes")).setDamageBypassesArmor();
public static DamageSource lunar = (new DamageSource("lunar")).setDamageIsAbsolute().setDamageBypassesArmor(); public static DamageSource lunar = (new DamageSource("lunar")).setDamageIsAbsolute().setDamageBypassesArmor();
public static DamageSource monoxide = (new DamageSource("monoxide")).setDamageIsAbsolute().setDamageBypassesArmor(); public static DamageSource monoxide = (new DamageSource("monoxide")).setDamageIsAbsolute().setDamageBypassesArmor();
public static DamageSource asbestos = (new DamageSource("asbestos")).setDamageIsAbsolute().setDamageBypassesArmor();
public ModDamageSource(String p_i1566_1_) { public ModDamageSource(String p_i1566_1_) {
super(p_i1566_1_); super(p_i1566_1_);

View File

@ -103,6 +103,16 @@ public class ArmorUtil {
return false; return false;
} }
public static boolean checkForDigamma(EntityPlayer player) {
if(checkArmor(player, ModItems.fau_helmet, ModItems.fau_plate, ModItems.fau_legs, ModItems.fau_boots))
{
return true;
}
return false;
}
public static boolean checkForFaraday(EntityPlayer player) { public static boolean checkForFaraday(EntityPlayer player) {
ItemStack[] armor = player.inventory.armorInventory; ItemStack[] armor = player.inventory.armorInventory;

View File

@ -38,6 +38,7 @@ public class ContaminationUtil {
return 1; return 1;
} }
/// RADIATION ///
public static void applyRadData(Entity e, float f) { public static void applyRadData(Entity e, float f) {
if(!(e instanceof EntityLivingBase)) if(!(e instanceof EntityLivingBase))
@ -91,6 +92,72 @@ public class ContaminationUtil {
return HbmLivingProps.getRadiation(entity); return HbmLivingProps.getRadiation(entity);
} }
/// ASBESTOS ///
public static void applyAsbestos(Entity e, int i) {
if(!(e instanceof EntityLivingBase))
return;
if(e instanceof IRadiationImmune)
return;
if(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)
return;
if(e instanceof EntityPlayer && e.ticksExisted < 200)
return;
EntityLivingBase entity = (EntityLivingBase)e;
if(!(entity instanceof EntityPlayer && ArmorUtil.checkForGasMask((EntityPlayer) entity)))
HbmLivingProps.incrementAsbestos(entity, i);
}
/// DIGAMMA ///
public static void applyDigammaData(Entity e, float f) {
if(!(e instanceof EntityLivingBase))
return;
if(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)
return;
if(e instanceof EntityPlayer && e.ticksExisted < 200)
return;
EntityLivingBase entity = (EntityLivingBase)e;
if(entity.isPotionActive(HbmPotion.stability.id))
return;
if(!(entity instanceof EntityPlayer && ArmorUtil.checkForDigamma((EntityPlayer) entity)))
HbmLivingProps.incrementDigamma(entity, f);
}
public static void applyDigammaDirect(Entity e, float f) {
if(!(e instanceof EntityLivingBase))
return;
if(e instanceof IRadiationImmune)
return;
if(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)
return;
EntityLivingBase entity = (EntityLivingBase)e;
HbmLivingProps.incrementDigamma(entity, f);
}
public static float getDigamma(Entity e) {
if(!(e instanceof EntityLivingBase))
return 0.0F;
EntityLivingBase entity = (EntityLivingBase)e;
return HbmLivingProps.getDigamma(entity);
}
public static void printGeigerData(EntityPlayer player) { public static void printGeigerData(EntityPlayer player) {
World world = player.worldObj; World world = player.worldObj;