add IC2 hazmat capability. closes #501

This commit is contained in:
MachineMuse 2015-08-28 04:04:00 -06:00
parent f5db0cc0e3
commit f20fac3075
3 changed files with 12 additions and 12 deletions

View file

@ -9,7 +9,6 @@ import net.machinemuse.powersuits.powermodule.armor.HazmatModule;
import net.machinemuse.powersuits.powermodule.misc.AirtightSealModule;
import net.machinemuse.powersuits.powermodule.misc.ThaumGogglesModule;
import net.machinemuse.powersuits.powermodule.tool.GrafterModule;
import net.machinemuse.powersuits.powermodule.tool.MFFSFieldTeleporterModule;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.config.Configuration;
@ -152,7 +151,7 @@ public class ModCompatability {
//IPowerModule module = new MultimeterModule(Collections.singletonList((IModularItem) MPSItems.powerTool()));
// Atomic Science
if (isAtomicScienceLoaded()) {
if (isIndustrialCraftLoaded()) {
ModuleManager.addModule(new HazmatModule(Arrays.<IModularItem>asList(MPSItems.powerArmorHead(), MPSItems.powerArmorTorso(), MPSItems.powerArmorLegs(), MPSItems.powerArmorFeet())));
}
@ -166,14 +165,8 @@ public class ModCompatability {
ModuleManager.addModule(new GrafterModule(Collections.singletonList((IModularItem) MPSItems.powerTool())));
ModuleManager.addModule(new ApiaristArmorModule(Arrays.<IModularItem>asList(MPSItems.powerArmorHead(), MPSItems.powerArmorTorso(), MPSItems.powerArmorLegs(), MPSItems.powerArmorFeet())));
}
try {
ModuleManager.addModule(new MFFSFieldTeleporterModule(Collections.singletonList((IModularItem) MPSItems.powerTool())));
} catch (Throwable e) {
MuseLogger.logError("Failed to get MFFS item!");
}
}
//
//
// public static ItemStack getForestryItem(String name, int quantity) {
// try {

View file

@ -4,7 +4,8 @@ import cpw.mods.fml.relauncher.{Side, SideOnly}
import net.machinemuse.api.{IModularItem, ArmorTraits, ModuleManager}
import net.machinemuse.numina.geometry.Colour
import net.machinemuse.powersuits.client.render.item.ArmorModel
import net.machinemuse.powersuits.common.Config
import net.machinemuse.powersuits.common.{ModCompatability, Config}
import net.machinemuse.powersuits.powermodule.armor.HazmatModule
import net.machinemuse.powersuits.powermodule.misc.{InvisibilityModule, TintModule, TransparentArmorModule}
import net.machinemuse.utils._
import net.minecraft.client.model.ModelBiped
@ -33,10 +34,15 @@ abstract class ItemPowerArmor(renderIndex: Int, armorType: Int)
* calculations.
*/
override def getProperties(player: EntityLivingBase, armor: ItemStack, source: DamageSource, damage: Double, slot: Int): ISpecialArmor.ArmorProperties = {
val priority: Int = 1
val priority: Int = 0
if (source.isFireDamage && !(source == MuseHeatUtils.overheatDamage)) {
return new ISpecialArmor.ArmorProperties(priority, 0.25, (25 * damage).toInt)
}
if(ModuleManager.itemHasModule(armor, HazmatModule.MODULE_HAZMAT)) {
if(source.damageType.equals("electricity") || source.damageType.equals("radiation")) {
return new ISpecialArmor.ArmorProperties(priority, 0.25, (25 * damage).toInt)
}
}
val armorDouble = player match {
case player: EntityPlayer => getArmorDouble(player, armor)
case _ => 2.0
@ -47,6 +53,7 @@ abstract class ItemPowerArmor(renderIndex: Int, armorType: Int)
absorbMax = 0
absorbRatio = 0
}
return new ISpecialArmor.ArmorProperties(priority, absorbRatio, absorbMax)
}

View file

@ -34,7 +34,7 @@ public class HazmatModule extends PowerModuleBase {
@Override
public String getDescription() {
return "Protect yourself from that pesky radiation poisoning. *Must be on every piece*";
return "Protect yourself from electricity and radiation poisoning. *Must be on every piece for 100% protection*";
}
@Override