diff --git a/src/main/java/com/hbm/items/armor/ArmorFSB.java b/src/main/java/com/hbm/items/armor/ArmorFSB.java index d6eb33079..912a11dcc 100644 --- a/src/main/java/com/hbm/items/armor/ArmorFSB.java +++ b/src/main/java/com/hbm/items/armor/ArmorFSB.java @@ -12,6 +12,7 @@ import org.lwjgl.opengl.GL11; import com.hbm.extprop.HbmLivingProps; import com.hbm.handler.radiation.ChunkRadiationManager; +import com.hbm.util.ContaminationUtil; import com.hbm.util.I18nUtil; import cpw.mods.fml.common.gameevent.TickEvent; @@ -48,8 +49,8 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel { private String texture = ""; private ResourceLocation overlay = null; - public List effects = new ArrayList(); - public HashMap resistance = new HashMap(); + public List effects = new ArrayList(); + public HashMap resistance = new HashMap(); public float blastProtection = -1; public float projectileProtection = -1; public float damageCap = -1; @@ -572,34 +573,31 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel { if(this.armorType != 1) return; - if(!this.hasFSBArmor(entity) || !this.geigerSound) + if(!hasFSBArmor(entity) || !this.geigerSound) return; if(world.getTotalWorldTime() % 5 == 0) { - - float x = HbmLivingProps.getRadBuf((EntityLivingBase)entity); + + // Armor piece dosimeters indicate radiation dosage inside the armor, so reduce the counts by the effective protection + float mod = ContaminationUtil.calculateRadiationMod(entity); + float x = HbmLivingProps.getRadBuf(entity) * mod; if(x > 1E-5) { - - if(x > 0) { - List list = new ArrayList(); - - if(x < 1) list.add(0); - if(x < 5) list.add(0); - if(x < 10) list.add(1); - if(x > 5 && x < 15) list.add(2); - if(x > 10 && x < 20) list.add(3); - if(x > 15 && x < 25) list.add(4); - if(x > 20 && x < 30) list.add(5); - if(x > 25) list.add(6); - - int r = list.get(world.rand.nextInt(list.size())); - - if(r > 0) - world.playSoundAtEntity(entity, "hbm:item.geiger" + r, 1.0F, 1.0F); - } else if(world.rand.nextInt(50) == 0) { - world.playSoundAtEntity(entity, "hbm:item.geiger" + (1 + world.rand.nextInt(1)), 1.0F, 1.0F); - } + List list = new ArrayList(); + + if(x < 1) list.add(0); + if(x < 5) list.add(0); + if(x < 10) list.add(1); + if(x > 5 && x < 15) list.add(2); + if(x > 10 && x < 20) list.add(3); + if(x > 15 && x < 25) list.add(4); + if(x > 20 && x < 30) list.add(5); + if(x > 25) list.add(6); + + int r = list.get(world.rand.nextInt(list.size())); + + if(r > 0) + world.playSoundAtEntity(entity, "hbm:item.geiger" + r, 1.0F, 1.0F); } } } @@ -645,7 +643,7 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } - private HashSet hidden = new HashSet(); + private HashSet hidden = new HashSet(); private boolean needsFullSet = false; public ArmorFSB hides(EnumPlayerPart... parts) {