import mods.thaumcraft.Research;
import mods.thaumcraft.Arcane;
import mods.thaumcraft.Crucible;
import mods.thaumcraft.Infusion;
import minetweaker.item.IItemStack;

val DraconicCore = <DraconicEvolution:draconicCore>;
val WyvernCore = <DraconicEvolution:wyvernCore>;
val AwakenedCore = <DraconicEvolution:awakenedCore>;
val SpatialIngot = <ChromatiCraft:chromaticraft_item_crafting:22>;
val AwakenedDracoBlock = <DraconicEvolution:draconicBlock>;
val ChromastoneIngot =  <ChromatiCraft:chromaticraft_item_crafting:21>;
val NetherStar = <minecraft:nether_star>;
val VoidMetalIngot = <Thaumcraft:ItemResource:16>;
val CelestialPearl = <ThaumicTinkerer:skyPearl>;
val CelestialFocus = <ThaumicTinkerer:focusRecall>;
val Draconium = <DraconicEvolution:draconiumIngot>;
val AwakenedDraconium = <DraconicEvolution:draconicIngot>;
val Dislocator = <DraconicEvolution:teleporterMKI>;
val ChaosIchor = <customthings:item:1>;
val NeutroniumNugget = <Avaritia:Resource:3>;
val Ichor = <ThaumicTinkerer:kamiResource>;
val ChaosShard = <DraconicEvolution:chaosShard>;
val AwakenedEnergyCore = <DraconicEvolution:draconiumEnergyCore:1>;
val WyvernEnergyCore = <DraconicEvolution:draconiumEnergyCore>;
val BlockDraconium = <DraconicEvolution:draconium>;
val ChargedDraconium = <DraconicEvolution:draconium:2>;
val WyvernPick = <DraconicEvolution:wyvernPickaxe>;
val WyvernSword = <DraconicEvolution:wyvernSword>;
val WyvernShovel = <DraconicEvolution:wyvernShovel>;
val WyvernBow = <DraconicEvolution:wyvernBow>;
val WyvernHelmet = <DraconicEvolution:wyvernHelm>;
val WyvernChestPlate = <DraconicEvolution:wyvernChest>;
val WyvernLeggings = <DraconicEvolution:wyvernLeggs>;
val WyvernBoots = <DraconicEvolution:wyvernBoots>;
val IchorPick = <ThaumicTinkerer:ichorPickGem>;
val IchorSword = <ThaumicTinkerer:ichorSwordGem>;
val IchorAxe = <ThaumicTinkerer:ichorAxeGem>;
val IchorShovel = <ThaumicTinkerer:ichorShovelGem>;
val IchorHelmet = <ThaumicTinkerer:ichorclothHelmGem>;
val IchorChestPlate = <ThaumicTinkerer:ichorclothChestGem>;
val IchorLeggings = <ThaumicTinkerer:ichorclothLegsGem>;
val IchorBoots = <ThaumicTinkerer:ichorclothBootsGem>;
val EnderBow = <TwilightForest:item.enderBow>;
val DraconicPick = <DraconicEvolution:draconicPickaxe>;
val DraconicSword = <DraconicEvolution:draconicSword>;
val DraconicShovel = <DraconicEvolution:draconicShovel>;
val DraconicBow = <DraconicEvolution:draconicBow>;
val DraconicAxe = <DraconicEvolution:draconicAxe>;
val DraconicHoe = <DraconicEvolution:draconicHoe>;
val DraconicHelmet = <DraconicEvolution:draconicHelm>;
val DraconicChestPlate = <DraconicEvolution:draconicChest>;
val DraconicLeggings = <DraconicEvolution:draconicLeggs>;
val DraconicBoots = <DraconicEvolution:draconicBoots>;
val Sundial = <DraconicEvolution:sunDial>;
val AccelerationCore4 = <ChromatiCraft:chromaticraft_item_adjacency:12>.withTag({tier: 4});
val TemporalGear = <clockworkphase:gearTemporal>;
val ActiveTemporalCore = <clockworkphase:temporalCoreActive>;
val LegendaryGear = <clockworkphase:gearLegendary>;
val SunStoneBlock = <arsmagica2:vinteumOre:8>;

Research.addResearch("DE_BEGINNINGS", "WITCHGADG", "potentia 10, alienis 10, ira 10, lucrum 10, gula 10, desidia 10, luxuria 10, terminus 10, invidia 10", -2, 6, 100, Draconium);
Research.addPage("DE_BEGINNINGS", "DE_BEGINNINGS.research_page.1");
game.setLocalization("en_US", "DE_BEGINNINGS.research_page.1", "Well then. This is it. You can finally begin to unlock the full potential of draconium. It's been a long wait, but it will be worth it. You can already feel the raw power you can harness with this!");
game.setLocalization("en_US", "tc.research_name.DE_BEGINNINGS", "Draconic Beginnings");
game.setLocalization("en_US", "tc.research_text.DE_BEGINNINGS", "The start of something big!");
Research.addPrereq("DE_BEGINNINGS","PRIMORDIALGEARSET");
Research.setConcealed("DE_BEGINNINGS", true);

Research.addResearch("DE_BASIC", "WITCHGADG", "potentia 10, terminus 10, ignis 10, perditio 10", -3, 7, 100, DraconicCore);
Research.addPage("DE_BASIC", "DE_BASIC.research_page.1");
game.setLocalization("en_US", "DE_BASIC.research_page.1", "Your first endeavor with the power of draconium is the creation of a basic core. It should help you to channel the energy contained in draconium.");
game.setLocalization("en_US", "tc.research_name.DE_BASIC", "Draconic Core");
game.setLocalization("en_US", "tc.research_text.DE_BASIC", "There be dragons here.");
Research.addPrereq("DE_BASIC","DE_BEGINNINGS");
Research.setConcealed("DE_BASIC", true);

Research.addResearch("DE_WYVERN", "WITCHGADG", "potentia 15, terminus 15, ignis 15, perditio 15, aer 15", -2, 9, 100, WyvernCore);
Research.addPage("DE_WYVERN", "DE_WYVERN.research_page.1");
game.setLocalization("en_US", "DE_WYVERN.research_page.1", "With these basic cores, you can create something more powerful. Something actually usable. <BR>These so-called wyvern cores can be used to create powerful armor and tools, based on the already really powerful ichor-based gear.");
game.setLocalization("en_US", "tc.research_name.DE_WYVERN", "Wyvern Core");
game.setLocalization("en_US", "tc.research_text.DE_WYVERN", "The power of dragons, finally unlocked.");
Research.addPrereq("DE_WYVERN","DE_BASIC");
Research.setConcealed("DE_WYVERN", true);

Research.addResearch("DE_AWAKENED", "WITCHGADG", "potentia 15, terminus 15, ignis 15, perditio 15, aer 15, alienis 15", -2, 11, 100, AwakenedCore);
Research.addPage("DE_AWAKENED", "DE_AWAKENED.research_page.1");
game.setLocalization("en_US", "DE_AWAKENED.research_page.1", "This draconium you have been using for your latest constructs looks like it could be infused with the power of a dragon heart. However, try as you might, it will not accept this power in its current state. To try and make it more accepting of the power of a dragon heart, you decide to imbue it with a load of potentia essentia.");
game.setLocalization("en_US", "tc.research_name.DE_AWAKENED", "Draconic Awakening");
game.setLocalization("en_US", "tc.research_text.DE_AWAKENED", "The raw power of a dragon heart, for you to harness.");
Research.addPrereq("DE_AWAKENED","DE_WYVERN");
Research.setConcealed("DE_AWAKENED", true);

Research.addResearch("CHAOS_ICHOR", "WITCHGADG", "potentia 50, alienis 50, perditio 20, infernus 20, spiritus 20, lux 20, tenebrae 20, praecantatio 10", 0, 9, 100, ChaosIchor);
Research.addPage("CHAOS_ICHOR", "CHAOS_ICHOR.research_page.1");
game.setLocalization("en_US", "CHAOS_ICHOR.research_page.1", "Noting ichors tendency to blend easily with many materials, you decided to try mixing it with the chaos shards guarded by the chaos dragon. Your first attempt was... less than perfect and almost destroyed your entire base, before you could seperate the two. Perhaps if you were a bit more careful, and used a ludicrous amount of vis to stabilize it, you could create this elusive and dangerous blend...");
game.setLocalization("en_US", "tc.research_name.CHAOS_ICHOR", "Chaos-Blended Ichor");
game.setLocalization("en_US", "tc.research_text.CHAOS_ICHOR", "The blend of the power of chaos and gods.");
Arcane.addShaped("CHAOS_ICHOR",ChaosIchor, "ordo 1000, terra 1000, aer 1000, perditio 1000, ignis 1000, aqua 1000", [[NeutroniumNugget,Ichor,NeutroniumNugget],[Ichor,ChaosShard,Ichor],[NeutroniumNugget,Ichor,NeutroniumNugget]]);
Research.addArcanePage("CHAOS_ICHOR", ChaosIchor);
Research.addPrereq("CHAOS_ICHOR","PRIMORDIALGEARSET");
Research.setConcealed("CHAOS_ICHOR", true);

recipes.remove(WyvernCore);
Arcane.addShaped("DE_WYVERN",WyvernCore,"ignis 50, perditio 50, aer 50",[[SpatialIngot,DraconicCore,SpatialIngot],[DraconicCore,NetherStar,DraconicCore],[SpatialIngot,DraconicCore,SpatialIngot]]);
Research.addArcanePage("DE_WYVERN", WyvernCore);

recipes.remove(Dislocator);
recipes.addShaped(Dislocator,[[AwakenedDraconium,DraconicCore,AwakenedDraconium],[DraconicCore,CelestialFocus,DraconicCore],[AwakenedDraconium,DraconicCore,AwakenedDraconium]]);

recipes.remove(DraconicCore);
Arcane.addShaped("DE_BASIC",DraconicCore,"ignis 15, perditio 15, aer 15",[[VoidMetalIngot,Draconium,VoidMetalIngot],[Draconium,CelestialPearl,Draconium],[VoidMetalIngot,Draconium,VoidMetalIngot]]);
Research.addArcanePage("DE_BASIC", DraconicCore);

Crucible.addRecipe("DE_AWAKENED", ChargedDraconium, BlockDraconium, "potentia 64");
Research.addCruciblePage("DE_AWAKENED", ChargedDraconium);
Research.addPage("DE_AWAKENED", "DE_AWAKENED.research_page.2");
game.setLocalization("en_US", "DE_AWAKENED.research_page.2", "With the power of this awakened version of draconium, you can upgrade your cores once more, this time to an even more powerful version. The awakened core will unlock the most powerful gear you can envision yourself making, for now.");

recipes.remove(AwakenedCore);
Arcane.addShaped("DE_AWAKENED",AwakenedCore,"ignis 150, perditio 150, aer 150",[[ChromastoneIngot,WyvernCore,ChromastoneIngot],[WyvernCore,AwakenedDracoBlock,WyvernCore],[ChromastoneIngot,WyvernCore,ChromastoneIngot]]);
Research.addArcanePage("DE_AWAKENED", AwakenedCore);

recipes.remove(WyvernPick);
Infusion.addRecipe("DE_WYVERN",IchorPick,[Draconium,Draconium,WyvernCore,Draconium,Draconium,WyvernEnergyCore,Draconium,Draconium,WyvernCore,Draconium],"potentia 128, ignis 64, perditio 32, aer 32, perfodio 64",WyvernPick,16);
Research.addInfusionPage("DE_WYVERN",WyvernPick);

recipes.remove(WyvernSword);
Infusion.addRecipe("DE_WYVERN",IchorSword,[Draconium,Draconium,WyvernCore,Draconium,Draconium,WyvernEnergyCore,Draconium,Draconium,WyvernCore,Draconium],"potentia 128, ignis 64, perditio 32, aer 32, telum 64",WyvernSword,16);
Research.addInfusionPage("DE_WYVERN",WyvernSword);

recipes.remove(WyvernShovel);
Infusion.addRecipe("DE_WYVERN",IchorShovel,[Draconium,Draconium,WyvernCore,Draconium,Draconium,WyvernEnergyCore,Draconium,Draconium,WyvernCore,Draconium],"potentia 128, ignis 64, perditio 32, aer 32, perfodio 64",WyvernShovel,16);
Research.addInfusionPage("DE_WYVERN",WyvernShovel);

recipes.remove(WyvernBow);
Infusion.addRecipe("DE_WYVERN",EnderBow,[Draconium,Draconium,WyvernCore,Draconium,Draconium,WyvernEnergyCore,Draconium,Draconium,WyvernCore,Draconium],"potentia 128, ignis 64, perditio 32, aer 32, telum 64",WyvernBow,16);
Research.addInfusionPage("DE_WYVERN",WyvernBow);

recipes.remove(WyvernHelmet);
Infusion.addRecipe("DE_WYVERN",IchorHelmet,[Draconium,Draconium,WyvernCore,Draconium,Draconium,WyvernEnergyCore,Draconium,Draconium,WyvernCore,Draconium],"potentia 128, ignis 64, perditio 32, aer 32, tutamen 64",WyvernHelmet,16);
Research.addInfusionPage("DE_WYVERN",WyvernHelmet);

recipes.remove(WyvernChestPlate);
Infusion.addRecipe("DE_WYVERN",IchorChestPlate,[Draconium,Draconium,WyvernCore,Draconium,Draconium,WyvernEnergyCore,Draconium,Draconium,WyvernCore,Draconium],"potentia 128, ignis 64, perditio 32, aer 32, tutamen 64",WyvernChestPlate,16);
Research.addInfusionPage("DE_WYVERN",WyvernChestPlate);

recipes.remove(WyvernLeggings);
Infusion.addRecipe("DE_WYVERN",IchorLeggings,[Draconium,Draconium,WyvernCore,Draconium,Draconium,WyvernEnergyCore,Draconium,Draconium,WyvernCore,Draconium],"potentia 128, ignis 64, perditio 32, aer 32, tutamen 64",WyvernLeggings,16);
Research.addInfusionPage("DE_WYVERN",WyvernLeggings);

recipes.remove(WyvernBoots);
Infusion.addRecipe("DE_WYVERN",IchorBoots,[Draconium,Draconium,WyvernCore,Draconium,Draconium,WyvernEnergyCore,Draconium,Draconium,WyvernCore,Draconium],"potentia 128, ignis 64, perditio 32, aer 32, tutamen 64",WyvernBoots,16);
Research.addInfusionPage("DE_WYVERN",WyvernBoots);

recipes.remove(DraconicPick);
Infusion.addRecipe("DE_AWAKENED",WyvernPick,[AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium,AwakenedDraconium,AwakenedEnergyCore,AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium],"potentia 256, ignis 128, perditio 64, aer 64, perfodio 128",DraconicPick,24);
Research.addInfusionPage("DE_AWAKENED",DraconicPick);

recipes.remove(DraconicSword);
Infusion.addRecipe("DE_AWAKENED",WyvernSword,[AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium,AwakenedDraconium,AwakenedEnergyCore,AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium],"potentia 256, ignis 128, perditio 64, aer 64, telum 128",DraconicSword,24);
Research.addInfusionPage("DE_AWAKENED",DraconicSword);

recipes.remove(DraconicShovel);
Infusion.addRecipe("DE_AWAKENED",WyvernShovel,[AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium,AwakenedDraconium,AwakenedEnergyCore,AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium],"potentia 256, ignis 128, perditio 64, aer 64, perfodio 128",DraconicShovel,24);
Research.addInfusionPage("DE_AWAKENED",DraconicShovel);

recipes.remove(DraconicBow);
Infusion.addRecipe("DE_AWAKENED",WyvernBow,[AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium,AwakenedDraconium,AwakenedEnergyCore,AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium],"potentia 256, ignis 128, perditio 64, aer 64, telum 128",DraconicBow,24);
Research.addInfusionPage("DE_AWAKENED",DraconicBow);

recipes.remove(DraconicHelmet);
Infusion.addRecipe("DE_AWAKENED",WyvernHelmet,[AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium,AwakenedDraconium,AwakenedEnergyCore,AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium],"potentia 256, ignis 128, perditio 64, aer 64, tutamen 128",DraconicHelmet,24);
Research.addInfusionPage("DE_AWAKENED",DraconicHelmet);

recipes.remove(DraconicChestPlate);
Infusion.addRecipe("DE_AWAKENED",WyvernChestPlate,[AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium,AwakenedDraconium,AwakenedEnergyCore,AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium],"potentia 256, ignis 128, perditio 64, aer 64, tutamen 128",DraconicChestPlate,24);
Research.addInfusionPage("DE_AWAKENED",DraconicChestPlate);

recipes.remove(DraconicLeggings);
Infusion.addRecipe("DE_AWAKENED",WyvernLeggings,[AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium,AwakenedDraconium,AwakenedEnergyCore,AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium],"potentia 256, ignis 128, perditio 64, aer 64, tutamen 128",DraconicLeggings,24);
Research.addInfusionPage("DE_AWAKENED",DraconicLeggings);

recipes.remove(DraconicBoots);
Infusion.addRecipe("DE_AWAKENED",WyvernBoots,[AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium,AwakenedDraconium,AwakenedEnergyCore,AwakenedDraconium,AwakenedDraconium,AwakenedCore,AwakenedDraconium],"potentia 256, ignis 128, perditio 64, aer 64, tutamen 128",DraconicBoots,24);
Research.addInfusionPage("DE_AWAKENED",DraconicBoots);

recipes.remove(Sundial);
recipes.addShaped(Sundial,[[LegendaryGear,ActiveTemporalCore,LegendaryGear],[WyvernCore,AccelerationCore4,WyvernCore],[SunStoneBlock,TemporalGear,SunStoneBlock]]);
