import mods.thaumcraft.Infusion;
import mods.thaumcraft.Research;
import mods.thaumcraft.Arcane;

val PhilosophersStone = <ProjectE:item.pe_philosophers_stone>;
val Ichor = <ThaumicTinkerer:kamiResource>;
val TransmutatingComb = <MagicBees:comb:4>;
val CrystalCluster = <AWWayofTime:blockCrystal>;
val EssenceScornful = <MagicBees:miscResources:11>;
val TransmutationCoreEnergized = <ChromatiCraft:chromaticraft_item_crafting:24>;
val Obsidian = <ore:blockObsidian>;
val RedMatter = <ProjectE:item.pe_matter:1>;
val AlchemicalChest = <ProjectE:alchemical_chest>;
val VoidMetal = <Thaumcraft:ItemResource:16>;
val DragonStone = <Botania:manaResource:9>;
val ObsidianChest = <IronChest:BlockIronChest:6>;
val EnergyCondenser = <ProjectE:condenser_mk1>;
val DarkMatter = <ProjectE:item.pe_matter>;
val TransmutationTable = <ProjectE:transmutation_table>;
val ChaosIchor = <customthings:item:1>;
val YkriCore = <ChromatiCraft:chromaticraft_item_placer:43>.withTag({color: 8});
val BlockExchanger7 = <ChromatiCraft:chromaticraft_item_adjacency:8>.withTag({tier: 7});

Research.addResearch("PHILOSOPHER_STONE", "TE_CATEGORY", "perditio 10, ordo 10, permutatio 10, potentia 10, praecantatio 10", 3, 2, 100, PhilosophersStone);
Research.addPage("PHILOSOPHER_STONE", "PHILOSOPHER_STONE.research_page.1");
game.setLocalization("en_US", "PHILOSOPHER_STONE.research_page.1", "Transmutation using your cauldron is fun and all, but it's really nothing to special. This new discovery however is. With this, you can transmute anything at will, although there still seem to be limits. It might be worth investigating further...");
game.setLocalization("en_US", "tc.research_name.PHILOSOPHER_STONE", "Philosopher's Stone");
game.setLocalization("en_US", "tc.research_text.PHILOSOPHER_STONE", "Very advanced transmutation");
recipes.remove(PhilosophersStone);
Infusion.addRecipe("PHILOSOPHER_STONE", TransmutationCoreEnergized, [Ichor,TransmutatingComb,CrystalCluster,EssenceScornful,Ichor,TransmutatingComb,CrystalCluster,EssenceScornful,Ichor,TransmutatingComb,CrystalCluster,EssenceScornful,Ichor,TransmutatingComb,CrystalCluster,EssenceScornful], "cognitio 64, potentia 64, permutatio 64, lucrum 32",PhilosophersStone, 8);
Research.addInfusionPage("PHILOSOPHER_STONE", PhilosophersStone);
Research.addPrereq("PHILOSOPHER_STONE","ICHOR");
Research.addPrereq("PHILOSOPHER_STONE","BASICEMC");

recipes.remove(EnergyCondenser);
recipes.addShaped(EnergyCondenser,[[Obsidian,RedMatter,Obsidian],[RedMatter,AlchemicalChest,RedMatter],[Obsidian,RedMatter,Obsidian]]);

recipes.remove(AlchemicalChest);
recipes.addShaped(AlchemicalChest,[[<ProjectE:item.pe_covalence_dust>,<ProjectE:item.pe_covalence_dust:1>,<ProjectE:item.pe_covalence_dust:2>],[Obsidian,DragonStone,Obsidian],[VoidMetal,ObsidianChest,VoidMetal]]);

Research.addResearch("TRANSMUTATION_TABLE", "TE_CATEGORY", "perditio 10, ordo 10, permutatio 10, potentia 10, praecantatio 10, superbia 10", 5, 2, 100, TransmutationTable);
Research.addPage("TRANSMUTATION_TABLE", "TRANSMUTATION_TABLE.research_page.1");
game.setLocalization("en_US", "TRANSMUTATION_TABLE.research_page.1", "After further investigation, you found something. Something powerful. With this, you shall rule the world, and exchange anything to anything else. Well, except for that random ME stuff. That doesn't like being transmuted...");
game.setLocalization("en_US", "tc.research_name.TRANSMUTATION_TABLE", "Transmutation Table");
game.setLocalization("en_US", "tc.research_text.TRANSMUTATION_TABLE", "Ultimate Exchange");
recipes.remove(TransmutationTable);
Arcane.addShaped("TRANSMUTATION_TABLE",TransmutationTable,"ordo 10000, perditio 10000, aqua 10000, terra 10000, ignis 10000, aer 10000",[[DarkMatter,BlockExchanger7,DarkMatter],[YkriCore,PhilosophersStone,YkriCore],[RedMatter,ChaosIchor,RedMatter]]);
Research.addArcanePage("TRANSMUTATION_TABLE", TransmutationTable);
Research.addPrereq("TRANSMUTATION_TABLE","PHILOSOPHER_STONE");

recipes.remove(<ProjectE:collector_mk1>);
recipes.addShaped(<ProjectE:collector_mk1>,[[<ore:glowstone>,<ExtraUtilities:decorativeBlock2:7>,<ore:glowstone>],[<ore:glowstone>,<ProjectE:fuel_block:2>,<ore:glowstone>],[<ore:glowstone>,<minecraft:furnace>,<ore:glowstone>]]);
