diff --git a/src/main/java/emt/entity/EntityShield.java b/src/main/java/emt/entity/EntityShield.java index 537e23e..ac8d6b0 100644 --- a/src/main/java/emt/entity/EntityShield.java +++ b/src/main/java/emt/entity/EntityShield.java @@ -37,6 +37,7 @@ public class EntityShield extends Entity { @Override protected void entityInit() { + this.dataWatcher.addObject(11, ""); } @Override diff --git a/src/main/java/emt/init/EMTRecipes.java b/src/main/java/emt/init/EMTRecipes.java index f312339..e52f53b 100644 --- a/src/main/java/emt/init/EMTRecipes.java +++ b/src/main/java/emt/init/EMTRecipes.java @@ -5,6 +5,8 @@ import cpw.mods.fml.common.registry.GameRegistry; import emt.EMT; import emt.util.EMTConfigHandler; import emt.util.EMTCraftingAspects; +import emt.util.EMTResearchAspects; + import static emt.util.EMTRandomHelper.*; import ic2.api.item.ElectricItem; import ic2.api.item.IC2Items; @@ -227,6 +229,9 @@ public class EMTRecipes { wandChargeFocus = addInfusionCraftingRecipe("Wand Focus: Wand Charging", new ItemStack(EMTItems.wandChargeFocus), 5, EMTCraftingAspects.wandChargeFocus, new ItemStack(EMTBlocks.emtMachines, 1, 0), new ItemStack[] { new ItemStack(EMTItems.chargeFocus), new ItemStack(IC2Items.getItem("energyPack").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate") }); + + energyBallFocus = addInfusionCraftingRecipe("Wand Focus: Energy Ball", new ItemStack(EMTItems.energyBallFocus), 4, EMTResearchAspects.energyBallFocusResearch, new ItemStack(ConfigItems.itemFocusShock), + new ItemStack[] { new ItemStack(Blocks.tnt), new ItemStack(IC2Items.getItem("advBattery").getItem()), new ItemStack(IC2Items.getItem("advBattery").getItem()), new ItemStack(IC2Items.getItem("advBattery").getItem())}); inventoryChargingRing = addInfusionCraftingRecipe("Inventory Charging Ring", new ItemStack(EMTItems.emtBauble, 1, 1), 6, EMTCraftingAspects.inventoryChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1), new ItemStack[] { new ItemStack(EMTItems.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("solarPanel"), ic2.core.Ic2Items.WindKineticGenerator, ic2.core.Ic2Items.WaterKineticGenerator, IC2Items.getItem("nuclearReactor") }); @@ -448,6 +453,7 @@ public class EMTRecipes { public static InfusionRecipe electricHoeGrowth; public static InfusionRecipe chargeFocus; public static InfusionRecipe wandChargeFocus; + public static InfusionRecipe energyBallFocus; public static InfusionRecipe inventoryChargingRing; public static InfusionRecipe armorChargingRing; public static InfusionRecipe nanoWings; diff --git a/src/main/java/emt/init/EMTResearches.java b/src/main/java/emt/init/EMTResearches.java index 2e745fc..a2f5e6e 100644 --- a/src/main/java/emt/init/EMTResearches.java +++ b/src/main/java/emt/init/EMTResearches.java @@ -94,7 +94,7 @@ public class EMTResearches { } if (!EMTConfigHandler.energyBallFocusResearch) { - new EMTResearchItem("Energy Ball Focus", EMTResearchAspects.energyBallFocusResearch, 1, 3, 2, new ItemStack(EMTItems.energyBallFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage("")); + new EMTResearchItem("Energy Ball Focus", EMTResearchAspects.energyBallFocusResearch, 1, 3, 2, new ItemStack(EMTItems.energyBallFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.energyBallFocus)); } if (!EMTConfigHandler.shieldFocusResearch) { diff --git a/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java b/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java index d4e1f30..1b4f17d 100644 --- a/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java +++ b/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java @@ -111,7 +111,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric { @SubscribeEvent public void onEntityLivingFallEvent(LivingFallEvent event) { - if ((IC2.platform.isSimulating()) && ((event.entity instanceof EntityLivingBase))) { + if (IC2.platform.isSimulating() && (event.entity instanceof EntityLivingBase)) { EntityLivingBase entity = (EntityLivingBase) event.entity; ItemStack armor = entity.getEquipmentInSlot(1); @@ -162,7 +162,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric { } ItemStack currentStack = player.inventory.getCurrentItem(); - Item currentItem = currentStack == null ? null : player.inventory.getCurrentItem().getItem(); + Item currentItem = currentStack == null ? null : currentStack.getItem(); if (nbt.hasKey("useother")) { String useother = nbt.getString("useother"); @@ -182,11 +182,11 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric { nbt.removeTag("useother"); } - if (wing == 0) { + if (wing == NONE) { nbt.setByte("wing", NONE); } - if ((IC2.keyboard.isJumpKeyDown(player)) && (IC2.keyboard.isModeSwitchKeyDown(player)) && (toggleTimer == 0)) { + if (IC2.keyboard.isJumpKeyDown(player) && IC2.keyboard.isModeSwitchKeyDown(player) && toggleTimer == 0) { toggleTimer = 30; hoverMode = !hoverMode; if (IC2.platform.isSimulating()) { @@ -204,11 +204,11 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric { if (currentItem == IC2Items.getItem("electricJetpack").getItem()) { IC2.platform.messagePlayer(player, "Jetpack enabled.", new Object[0]); nbt.setByte("wing", JETPACK); - int charge = (int) ElectricItem.manager.getCharge(itemStack); - if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000) { - ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(currentStack), player); - } - nbt.setInteger("jetpackCharge", (int) (ElectricItem.manager.getCharge(currentStack) + charge - (int) ElectricItem.manager.getCharge(itemStack))); + //int charge = (int) ElectricItem.manager.getCharge(itemStack); + //if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000) { + // ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(currentStack), player); + //} + nbt.setInteger("jetpackCharge", (int) (ElectricItem.manager.getCharge(currentStack)/* + charge - (int) ElectricItem.manager.getCharge(itemStack))*/)); player.inventory.setInventorySlotContents(player.inventory.currentItem, null); } @@ -221,22 +221,22 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric { else if (currentItem == EMTItems.nanoWing) { IC2.platform.messagePlayer(player, "Nano wings enabled.", new Object[0]); nbt.setByte("wing", NANO); - int charge = (int) ElectricItem.manager.getCharge(itemStack); - if (ElectricItem.manager.getCharge(currentStack) < ItemNanoWing.maxCharge) { - ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player); - } - nbt.setInteger("NWCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) + charge - (int) ElectricItem.manager.getCharge(itemStack))); + //int charge = (int) ElectricItem.manager.getCharge(itemStack); + //if (ElectricItem.manager.getCharge(currentStack) < ItemNanoWing.maxCharge) { + // ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player); + //} + nbt.setInteger("NWCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem())/* + charge - (int) ElectricItem.manager.getCharge(itemStack)*/)); player.inventory.setInventorySlotContents(player.inventory.currentItem, null); } else if (currentItem == EMTItems.quantumWing) { IC2.platform.messagePlayer(player, "Quantum wings enabled.", new Object[0]); nbt.setByte("wing", QUANTUM); - int charge = (int) ElectricItem.manager.getCharge(itemStack); - if (ElectricItem.manager.getCharge(currentStack) < ItemQuantumWing.maxCharge) { - ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player); - } - nbt.setInteger("QWCharge", (int) (ElectricItem.manager.getCharge(currentStack) + charge - (int) ElectricItem.manager.getCharge(itemStack))); + //int charge = (int) ElectricItem.manager.getCharge(itemStack); + //if (ElectricItem.manager.getCharge(currentStack) < ItemQuantumWing.maxCharge) { + // ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player); + //} + nbt.setInteger("QWCharge", (int) (ElectricItem.manager.getCharge(currentStack)/* + charge - (int) ElectricItem.manager.getCharge(itemStack)*/)); player.inventory.setInventorySlotContents(player.inventory.currentItem, null); } } @@ -298,11 +298,11 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric { if (wing == QUANTUM) useWings(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true); - if ((IC2.platform.isSimulating()) && (toggleTimer > 0)) { + if (IC2.platform.isSimulating() && toggleTimer > 0) { toggleTimer = (byte) (toggleTimer - 1); nbt.setByte("toggleTimer", toggleTimer); } - if ((IC2.platform.isRendering()) && (player == IC2.platform.getPlayerInstance())) { + if (IC2.platform.isRendering() && player == IC2.platform.getPlayerInstance()) { if (lastJetpackUsed != jetpackUsed) { if (jetpackUsed) { if (audioSource == null) { diff --git a/src/main/java/emt/item/focus/ItemEnergyBallFocus.java b/src/main/java/emt/item/focus/ItemEnergyBallFocus.java index 6a2c3fc..cbc5a9e 100644 --- a/src/main/java/emt/item/focus/ItemEnergyBallFocus.java +++ b/src/main/java/emt/item/focus/ItemEnergyBallFocus.java @@ -1,6 +1,9 @@ package emt.item.focus; import emt.entity.EntityEnergyBall; +import ic2.api.item.ElectricItem; +import ic2.core.item.armor.ItemArmorElectric; +import ic2.core.item.armor.ItemArmorIC2; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityLargeFireball; import net.minecraft.entity.projectile.EntitySmallFireball; @@ -30,12 +33,26 @@ public class ItemEnergyBallFocus extends ItemBaseFocus { @Override public ItemStack onFocusRightClick(ItemStack stack, World world, EntityPlayer player, MovingObjectPosition mop) { - if (!world.isRemote) { - float rotX = (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100; - float rotY = (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI)) * 100; - float rotZ = (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100; - world.spawnEntityInWorld(new EntityEnergyBall(world, player, rotX, rotY, rotZ)); + if (world.isRemote) { + return stack; } + + ItemStack armor = player.inventory.armorInventory[2]; + if (armor == null) { + return stack; + } + + double val = ElectricItem.manager.discharge(armor, 5120, 4, true, false, false); + + if (val < 5120) { + return stack; + } + + float rotX = (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100; + float rotY = (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI)) * 100; + float rotZ = (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100; + world.spawnEntityInWorld(new EntityEnergyBall(world, player, rotX, rotY, rotZ)); + return stack; } diff --git a/src/main/java/emt/util/EMTEventHandler.java b/src/main/java/emt/util/EMTEventHandler.java index 75f46b6..178ea86 100644 --- a/src/main/java/emt/util/EMTEventHandler.java +++ b/src/main/java/emt/util/EMTEventHandler.java @@ -10,18 +10,25 @@ import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent; import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; import emt.EMT; import emt.client.EMTKeys; +import emt.init.EMTBlocks; import emt.init.EMTItems; import emt.network.PacketEMTKeys; import emt.proxy.ClientProxy; +import ic2.api.item.ElectricItem; +import net.minecraft.block.Block; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import thaumcraft.common.config.ConfigBlocks; +import thaumcraft.common.config.ConfigItems; import thaumcraft.common.entities.monster.EntityTaintChicken; public class EMTEventHandler { @@ -63,4 +70,30 @@ public class EMTEventHandler { } } + + @SubscribeEvent + public void createCloud(PlayerInteractEvent e) { + if(e.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK || e.world.isRemote) { + return; + } + + Block block = e.world.getBlock(e.x, e.y, e.z); + int meta = e.world.getBlockMetadata(e.x, e.y, e.z); + + if(block != ConfigBlocks.blockAiry || meta != 1) { + return; + } + + ItemStack currentStack = e.entityPlayer.inventory.getCurrentItem(); + if(currentStack == null) { + return; + } + + double val = ElectricItem.manager.discharge(currentStack, 256, 4, false, true, false); + if(val < 256) { + return; + } + + e.world.setBlock(e.x, e.y, e.z, EMTBlocks.electricCloud); + } } diff --git a/src/main/java/emt/util/EMTResearchAspects.java b/src/main/java/emt/util/EMTResearchAspects.java index c107ea1..742fca8 100644 --- a/src/main/java/emt/util/EMTResearchAspects.java +++ b/src/main/java/emt/util/EMTResearchAspects.java @@ -13,7 +13,7 @@ public class EMTResearchAspects { public static AspectList thaumicNanoHelmet = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.SENSES, 8).add(Aspect.ARMOR, 6); public static AspectList laserFocusResearch = new AspectList().add(Aspect.FIRE, 3).add(Aspect.DEATH, 2).add(Aspect.WEAPON, 3); public static AspectList christmasFocusResearch = new AspectList().add(Aspect.COLD, 2).add(Aspect.BEAST, 5).add(Aspect.LIFE, 6).add(Aspect.DEATH, 2); - public static AspectList energyBallFocusResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.BEAST, 5).add(Aspect.LIFE, 6); + public static AspectList energyBallFocusResearch = new AspectList().add(Aspect.ENERGY, 10).add(Aspect.MAGIC, 5).add(Aspect.LIFE, 6); public static AspectList shieldFocusResearch = new AspectList().add(Aspect.ARMOR, 5).add(Aspect.AIR, 2).add(Aspect.CRYSTAL, 3).add(Aspect.TRAP, 2); public static AspectList electricGogglesResearch = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 5).add(Aspect.SENSES, 6); public static AspectList potentiaGeneratorResearch = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.EXCHANGE, 4).add(Aspect.METAL, 3); diff --git a/src/main/resources/assets/emt/lang/en_US.lang b/src/main/resources/assets/emt/lang/en_US.lang index 7873894..0f52914 100644 --- a/src/main/resources/assets/emt/lang/en_US.lang +++ b/src/main/resources/assets/emt/lang/en_US.lang @@ -136,7 +136,7 @@ emt.tag.Energy Ball Focus=notag emt.text.Energy Ball Focus=notext emt.rsname.Electric Cloud=Electric Cloud -emt.tag.Electric Cloud=Still the same Nitor +emt.tag.Electric Cloud=Still the same Nitor (or better?) emt.text.Electric Cloud.1=All thaumaturges (except Crimson ones, I guess) enjoy the shine and heat of the magic flame called Nitor, aren't they? You desided to make it more... energetic. Well, you did it.

You have created a new kind of magic flame — the Electric Cloud. It behaves and looks like normal Nitor, but it has purple colour and creates light-purple lightning charges around itself. emt.text.Electric Cloud.2=emt:textures/researches/electric_cloud.png:0:0:255:255:0.6 diff --git a/src/main/resources/assets/emt/lang/ru_RU.lang b/src/main/resources/assets/emt/lang/ru_RU.lang index 1d6ce32..89a1d2d 100644 --- a/src/main/resources/assets/emt/lang/ru_RU.lang +++ b/src/main/resources/assets/emt/lang/ru_RU.lang @@ -131,9 +131,9 @@ emt.rsname.Electric Magic Tools=Electric Magic Tools emt.tag.Electric Magic Tools=Кто сказал что магия и технология не дружат вместе? emt.text.Electric Magic Tools=Кто сказал, что магия не может дружить с технологией? Наши исследователи сотрудничали с лучшими магами школы тауматургов, чтобы приподнести Вам эффективность магии, в сочетании с удобством электроинструментов. -emt.rsname.Energy Ball Focus=Energy Ball Focus -emt.tag.Energy Ball Focus=notag -emt.text.Energy Ball Focus=notext +emt.rsname.Energy Ball Focus=Набалдашник: энерго-шар +emt.tag.Energy Ball Focus=Не игрушка. +emt.text.Energy Ball Focus=Для использования этого наболдашника необходимо надеть аккумуляторный ранец или нано/квантовую кирасу. Для создания одного шара необоходимо 5120EU. Крайне не рекомендуется использовать в замкнутом пространстве! emt.rsname.Electric Cloud=Наэлектризованное облако emt.tag.Electric Cloud=Всё тот же Нитор @@ -173,7 +173,7 @@ emt.tag.Thaumium Omnitool=Мистический мультиинструмен emt.text.Thaumium Omnitool=После создания алмазного и железного мультиинструментов, следующим логическим шагом стал таум-мультиинструмент. К сожалению, не всё так просто. Вы обнаружили способ объединения таум-бура и таум-электропилы, в результате чего получается инструмент, дающий возможность копать руды и рубить деревья с большой скоростью и практически без потери энергии. Эти инструменты уже один раз были объединены с магией. Вы не можете знать, что произойдёт, если их объединить снова. emt.rsname.Explosion Focus=Набалдашник: Взрыв -emt.tag.Explosion Focus=Используйте только в хорошо вентилируемых помещениях +emt.tag.Explosion Focus=Используйте только в хорошо вентилируемых помещениях! emt.text.Explosion Focus=Вы обнаружили способ улучшения набалдашника: 9 кругов ада. Подвергая летучих мышей взрывным свойствам шахтёрского лазера, Вы сделали набалдашник, который работает, как лазер, но использует Вис вместо EU. Тем не менее, его эффект очень нестабилен, так что будьте аккуратнее. emt.rsname.Kris-tmas Focus=Набалдашник: Рождество diff --git a/src/main/resources/assets/emt/textures/items/focus_energyBall.png b/src/main/resources/assets/emt/textures/items/focus_energyBall.png index d732d63..99a9ea2 100644 Binary files a/src/main/resources/assets/emt/textures/items/focus_energyBall.png and b/src/main/resources/assets/emt/textures/items/focus_energyBall.png differ