diff options
4 files changed, 40 insertions, 7 deletions
diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index a370e8a4a4..15e010780a 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -30,7 +30,7 @@ import static com.github.technus.tectech.magicAddon.EssentiaCompat.essentiaConta import static com.github.technus.tectech.magicAddon.definitions.AspectDefinitionCompat.aspectDefinitionCompat; public final class MainLoader {//TODO add checks for - is mod loaded dreamcraft to enable higher tier machinery. (above UV), or implement a check for GT tier values. - public static DamageSource microwaving; + public static DamageSource microwaving, elementalPollution; public void load() { ProgressManager.ProgressBar progressBarLoad = ProgressManager.push("TecTech Loader", 6); @@ -64,6 +64,10 @@ public final class MainLoader {//TODO add checks for - is mod loaded dreamcraft microwaving=new DamageSource("microwaving"); microwaving.setDamageAllowedInCreativeMode(); microwaving.setDamageBypassesArmor(); + + elementalPollution=new DamageSource("elementalPollution"); + elementalPollution.setDamageAllowedInCreativeMode(); + elementalPollution.setDamageBypassesArmor(); TecTech.Logger.info("Damage types addition Done"); ProgressManager.pop(progressBarLoad); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java index 0dcd80d4b5..a297d5bd78 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java @@ -10,14 +10,25 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.EnumSkyBlock; +import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.CommonValues.disperseAt; +import static com.github.technus.tectech.loader.MainLoader.elementalPollution; import static gregtech.api.enums.Dyes.MACHINE_METAL; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity; @@ -136,6 +147,7 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_ aBaseMetaTileEntity.setLightValue((byte) 0); aBaseMetaTileEntity.getWorld().updateLightByType(EnumSkyBlock.Block, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()); } + vapePollution(aBaseMetaTileEntity); } else { if (overflowMatter > 0) { aBaseMetaTileEntity.setActive(true); @@ -150,6 +162,24 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_ //DOES NOT CHECK FOR TOO MUCH, it is done only while putting stuff in (OPTIMIZATION!!!) } + private void vapePollution(IGregTechTileEntity mte){ + float xPos=mte.getXCoord()+0.5f; + float yPos=mte.getYCoord()+0.5f; + float zPos=mte.getZCoord()+0.5f; + + int xDirShift = ForgeDirection.getOrientation(mte.getFrontFacing()).offsetX; + int yDirShift = ForgeDirection.getOrientation(mte.getFrontFacing()).offsetY; + int zDirShift = ForgeDirection.getOrientation(mte.getFrontFacing()).offsetZ; + + AxisAlignedBB aabb=AxisAlignedBB.getBoundingBox(xPos-.5+xDirShift,yPos-.5+yDirShift,zPos-.5+zDirShift,xPos+.5+xDirShift,yPos+1.5+yDirShift,zPos+.5+zDirShift); + for (Object entity : mte.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, aabb)) { + float damagingFactor = (float)Math.log(overflowDisperse); + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.confusion.id,1,(int)(damagingFactor*20))); + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.id,2,(int)(damagingFactor*15))); + ((EntityLivingBase) entity).attackEntityFrom(elementalPollution, damagingFactor); + } + } + @Override public boolean isGivingInformation() { return true; diff --git a/src/main/java/openmodularturrets/entity/projectiles/projectileEM.java b/src/main/java/openmodularturrets/entity/projectiles/projectileEM.java index 1d118964ca..f2102237d9 100644 --- a/src/main/java/openmodularturrets/entity/projectiles/projectileEM.java +++ b/src/main/java/openmodularturrets/entity/projectiles/projectileEM.java @@ -27,10 +27,6 @@ public class projectileEM extends TurretProjectile { private float massFactor; - public projectileEM(World par1World) { - super(par1World); - } - public projectileEM(World par1World, TurretBase turretBase, cElementalInstanceStackMap avalableEM) { super(par1World); this.turretBase = turretBase; @@ -116,7 +112,7 @@ public class projectileEM extends TurretProjectile { } public void onEntityUpdate() { - if(this.ticksExisted >= 250) { + if(this.ticksExisted >= 75) { this.setDead(); } } diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index 6d76b761f7..f17f2e48c9 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -4,4 +4,7 @@ item.em.debugContainer.name=Debug EM Container item.em.debugBuilder.name=Debug Builder death.attack.microwaving=%1$s was dehydrated by radiation. -death.attack.microwaving.player=%1$s was was dehydrated by radiation while fighting %2$s. +death.attack.microwaving.player=%1$s was dehydrated by radiation while fighting %2$s. + +death.attack.elementalPollution=%1$s was vaping from the wrong hole. +death.attack.elementalPollution.player=%1$s was vaping from the wrong hole while fighting %2$s.
\ No newline at end of file |