import mods.thaumcraft.Arcane;
import mods.thaumcraft.Research;
import mods.thaumcraft.Crucible;
import mods.thaumcraft.Infusion;
import mods.botania.ManaInfusion;

val MEController = <appliedenergistics2:tile.BlockController>;
val GlassCable = <appliedenergistics2:item.ItemMultiPart:16>;
val	BlackGem = <aura:gemBlack>;
val WhiteGem = <aura:gemWhite>;
val CrystalFocus = <ChromatiCraft:chromaticraft_item_crafting:2>;
val TransformationCore = <ChromatiCraft:chromaticraft_item_crafting:7>;
val EngineeringProcessor = <appliedenergistics2:item.ItemMultiMaterial:24>;
val RunicMatrix = <Thaumcraft:blockStoneDevice:2>;
val CrystalRepeater = <ChromatiCraft:chromaticraft_item_placer:11>;
val DenseCable = <appliedenergistics2:item.ItemMultiPart:76>;
val ResonatingIngot = <ChromatiCraft:chromaticraft_item_crafting:17>;
val QuantumRing = <appliedenergistics2:tile.BlockQuantumRing>;
val WirelessBoosterCard = <appliedenergistics2:item.ItemMultiMaterial:42>;
val EnderDust = <appliedenergistics2:item.ItemMultiMaterial:46>;
val FluixDust = <appliedenergistics2:item.ItemMultiMaterial:8>;
val ChargedCertusQuartz = <appliedenergistics2:item.ItemMultiMaterial:1>;

//Me glass cable
Research.addResearch("AE_CABLE", "thaumicenergistics", "perditio 10, ordo 10, permutatio 10, signum 5", 2, 1, 100, GlassCable);
Research.addPage("AE_CABLE", "AE_CABLE.research_page.1");
game.setLocalization("en_US", "AE_CABLE.research_page.1", "Using your knowledge of the ley lines, combined with your knowledge of exchange and transmutation, you have discovered a way to change items into energy, and back. This will prove to be quite useful for automation.");
game.setLocalization("en_US", "tc.research_name.AE_CABLE", "Glass Cables");
game.setLocalization("en_US", "tc.research_text.AE_CABLE", "Magical transport and storage");
recipes.remove(GlassCable);
Crucible.addRecipe("AE_CABLE", GlassCable*4, <Thaumcraft:blockTube>, "signum 2, permutatio 4");
Research.addCruciblePage("AE_CABLE", GlassCable);
Research.addPrereq("AE_CABLE","thaumicenergistics.TERESEARCH");

//Me controller
Research.addResearch("AE_CONTROLLER", "thaumicenergistics", "perditio 10, ordo 10, permutatio 10, signum 5, potentia 5", 3, 2, 100, MEController);
Research.addPage("AE_CONTROLLER", "AE_CONTROLLER.research_page.1");
game.setLocalization("en_US", "AE_CONTROLLER.research_page.1", "The glass cables you made work, but they can only have 8 things hooked up to them before they break. This controller should fix that issue.");
game.setLocalization("en_US", "tc.research_name.AE_CONTROLLER", "ME Controller");
game.setLocalization("en_US", "tc.research_text.AE_CONTROLLER", "Control over storage");
recipes.remove(MEController);
Infusion.addRecipe("AE_CONTROLLER", RunicMatrix, [GlassCable,BlackGem,EngineeringProcessor,GlassCable,EngineeringProcessor,WhiteGem,GlassCable,TransformationCore,GlassCable,BlackGem,EngineeringProcessor,GlassCable,EngineeringProcessor,WhiteGem,GlassCable,CrystalFocus], "ordo 16, perditio 16, signum 24, permutatio 32, potentia 16", MEController, 6);
Research.addInfusionPage("AE_CONTROLLER", MEController);
Research.addPrereq("AE_CONTROLLER","AE_CABLE");

//Quantum Ring
Research.addResearch("AE_QUANTUM", "thaumicenergistics", "signum 10, potentia 5, iter 5, alienis 5", 3, 0, 100, QuantumRing);
Research.addPage("AE_QUANTUM", "AE_QUANTUM.research_page.1");
game.setLocalization("en_US", "AE_QUANTUM.research_page.1", "For short distances, the glass cables work fine. For longer distances, or, even worse, across dimensions, not so much. Luckily you have found a solution. By combining the power of resonating ingots with the circuits you were making, you can use your network across extreme distances.");
game.setLocalization("en_US", "tc.research_name.AE_QUANTUM", "Quantum Ring");
game.setLocalization("en_US", "tc.research_text.AE_QUANTUM", "Long distance networking");
recipes.remove(QuantumRing);
Arcane.addShaped("AE_QUANTUM",QuantumRing*8, "ordo 75, perditio 75, aer 75", [[ResonatingIngot,EngineeringProcessor,ResonatingIngot],[EngineeringProcessor,CrystalRepeater,DenseCable],[ResonatingIngot,EngineeringProcessor,ResonatingIngot]]);
Research.addArcanePage("AE_QUANTUM", QuantumRing);
Research.addPrereq("AE_QUANTUM","AE_CABLE");

recipes.remove(WirelessBoosterCard);
recipes.addShaped(WirelessBoosterCard,[[FluixDust,ChargedCertusQuartz,EnderDust],[ResonatingIngot,ResonatingIngot,ResonatingIngot]]);
WirelessBoosterCard.addTooltip("Has been buffed by a lot.");

Crucible.addRecipe("ASPECTS",<appliedenergistics2:item.ItemMultiMaterial:2>,<appliedenergistics2:item.ItemMultiMaterial>,"perditio 2");
Crucible.addRecipe("ASPECTS",<appliedenergistics2:item.ItemMultiMaterial:3>,<minecraft:quartz>,"perditio 2");
Crucible.addRecipe("ASPECTS",<appliedenergistics2:item.ItemMultiMaterial:8>,<appliedenergistics2:item.ItemMultiMaterial:7>,"perditio 2");
ManaInfusion.removeRecipe(<Botania:manaResource:10>);
ManaInfusion.addAlchemy(<Botania:manaResource:10>,<ChromatiCraft:chromaticraft_item_tiered:9>, 10);
ManaInfusion.addAlchemy(<appliedenergistics2:item.ItemMultiMaterial:2>,<appliedenergistics2:item.ItemMultiMaterial>, 20);
ManaInfusion.addAlchemy(<appliedenergistics2:item.ItemMultiMaterial:3>,<minecraft:quartz>, 20);
ManaInfusion.addAlchemy(<appliedenergistics2:item.ItemMultiMaterial:8>,<appliedenergistics2:item.ItemMultiMaterial:7>, 20);
ManaInfusion.removeRecipe(<Botania:quartz:1>);
ManaInfusion.addInfusion(<Botania:quartz:1>,<minecraft:quartz>,20);
Crucible.addRecipe("ASPECTS",<appliedenergistics2:item.ItemMultiMaterial:46>,<minecraft:ender_pearl>,"perditio 2");
