import globals.Globals

FBR = recipemap('fixed_bed_reactor')
DISTILLERY = recipemap('distillery')
ALLOY_SMELTER = recipemap('alloy_smelter')
REACTION_FURNACE = recipemap('reaction_furnace')
MIXER = recipemap('mixer')
DISTILLATION_TOWER = recipemap('distillation_tower')

// Methanol

ALLOY_SMELTER.recipeBuilder()
    .inputs(ore('dustCupricOxide') * 2)
    .inputs(ore('dustAlumina') * 5)
    .outputs(metaitem('dustImpregnatedCopperOxideCatalyst') * 7)
    .duration(100)
    .EUt(Globals.voltAmps[1])
    .buildAndRegister()

FBR.recipeBuilder()
    .fluidInputs(fluid('syngas') * 350)
    .fluidInputs(fluid('carbon_monoxide') * 25)
    .notConsumable(metaitem('dustImpregnatedCopperOxideCatalyst') * 1)
    .fluidOutputs(fluid('methanol') * 75)
    .duration(8)
    .EUt(480)
    .buildAndRegister()

FBR.recipeBuilder()
    .fluidInputs(fluid('carbon_monoxide') * 50)
    .fluidInputs(fluid('hot_hp_hydrogen') * 200)
    .notConsumable(metaitem('dustImpregnatedCopperOxideCatalyst') * 1)
    .fluidOutputs(fluid('methanol') * 50)
    .duration(8)
    .EUt(480)
    .buildAndRegister()

FBR.recipeBuilder()
    .fluidInputs(fluid('carbon_dioxide') * 50)
    .fluidInputs(fluid('hot_hp_hydrogen') * 300)
    .notConsumable(metaitem('dustImpregnatedCopperOxideCatalyst') * 1)
    .fluidOutputs(fluid('methanol') * 50)
    .fluidOutputs(fluid('dense_steam') * 50)
    .duration(8)
    .EUt(480)
    .buildAndRegister()

FBR.recipeBuilder()
    .fluidInputs(fluid('syngas') * 1050)
    .fluidInputs(fluid('carbon_dioxide') * 50)
    .notConsumable(metaitem('dustImpregnatedCopperOxideCatalyst') * 1)
    .fluidOutputs(fluid('methanol') * 200)
    .fluidOutputs(fluid('dense_steam') * 50)
    .duration(24)
    .EUt(480)
    .buildAndRegister()

// Ethanol

DISTILLATION_TOWER.recipeBuilder()
    .fluidInputs(fluid('impure_ethanol') * 2000)
    .outputs(metaitem('dustWood'))
    .fluidOutputs(fluid('fusel_oil') * 20)
    .fluidOutputs(fluid('water') * 1280)
    .fluidOutputs(fluid('ethanol_water_azeotrope') * 700)
    .duration(50)
    .EUt(30)
    .buildAndRegister()

MIXER.recipeBuilder()
    .fluidInputs(fluid('ethanol_water_azeotrope') * 700)
    .fluidInputs(fluid('toluene') * 10)
    .fluidOutputs(fluid('entrained_ethanol_water_azeotrope') * 710)
    .duration(50)
    .EUt(30)
    .buildAndRegister()

DISTILLATION_TOWER.recipeBuilder()
    .fluidInputs(fluid('entrained_ethanol_water_azeotrope') * 710)
    .fluidOutputs(fluid('toluene') * 10)
    .fluidOutputs(fluid('water') * 70)
    .fluidOutputs(fluid('ethanol') * 630)
    .duration(50)
    .EUt(30)
    .buildAndRegister()

DISTILLATION_TOWER.recipeBuilder()
    .fluidInputs(fluid('fusel_oil') * 1000)
    .fluidOutputs(fluid('isoamyl_alcohol') * 615)
    .fluidOutputs(fluid('n_butanol') * 10)
    .fluidOutputs(fluid('isobutyl_alcohol') * 155)
    .fluidOutputs(fluid('water') * 110)
    .fluidOutputs(fluid('n_propanol') * 10)
    .fluidOutputs(fluid('ethanol_water_azeotrope') * 100)
    .duration(50)
    .EUt(30)
    .buildAndRegister()

// n-Pentanol
REACTION_FURNACE.recipeBuilder()
    .inputs(metaitem('dustDicobaltOctacarbonyl') * 18)
    .fluidInputs(fluid('hot_hp_hydrogen') * 2000)
    .fluidInputs(fluid('carbon_monoxide') * 1000)
    .fluidInputs(fluid('one_butene') * 1000)
    .fluidOutputs(fluid('pentanal_mixture') * 1000)
    .EUt(Globals.voltAmps[3])
    .duration(80)
    .buildAndRegister()

DISTILLERY.recipeBuilder()
    .fluidInputs(fluid('pentanal_mixture') * 1000)
    .outputs(metaitem('dustDicobaltOctacarbonyl') * 18)
    .fluidOutputs(fluid('valeraldehyde') * 800)
    .EUt(Globals.voltAmps[3])
    .duration(80)
    .buildAndRegister()

FBR.recipeBuilder()
    .fluidInputs(fluid('valeraldehyde') * 50)
    .fluidInputs(fluid('hydrogen') * 100)
    .notConsumable(metaitem('susy:hv_catalyst_bed_reduction'))
    .fluidOutputs(fluid('n_pentanol') * 50)
    .EUt(Globals.voltAmps[3])
    .duration(4)
    .buildAndRegister()

FBR.recipeBuilder()
    .fluidInputs(fluid('valeraldehyde') * 50)
    .fluidInputs(fluid('hydrogen') * 100)
    .notConsumable(metaitem('catalystBedPlatinum'))
    .fluidOutputs(fluid('n_pentanol') * 50)
    .EUt(Globals.voltAmps[3])
    .duration(4)
    .buildAndRegister()

// Isodecanol

FBR.recipeBuilder()
    .notConsumable(metaitem('catalystBedZsmFive'))
    .fluidInputs(fluid('propene') * 150)
    .fluidOutputs(fluid('tripropylene') * 50)
    .duration(5)
    .EUt(Globals.voltAmps[1])
    .buildAndRegister()

REACTION_FURNACE.recipeBuilder()
    .inputs(metaitem('dustDicobaltOctacarbonyl') * 18)
    .fluidInputs(fluid('hot_hp_hydrogen') * 2000)
    .fluidInputs(fluid('carbon_monoxide') * 1000)
    .fluidInputs(fluid('tripropylene') * 1000)
    .fluidOutputs(fluid('isodecanal_mixture') * 1000)
    .EUt(Globals.voltAmps[3])
    .duration(80)
    .buildAndRegister()

DISTILLERY.recipeBuilder()
    .fluidInputs(fluid('isodecanal_mixture') * 1000)
    .outputs(metaitem('dustDicobaltOctacarbonyl') * 18)
    .fluidOutputs(fluid('isodecanal') * 500)
    .EUt(Globals.voltAmps[3])
    .duration(80)
    .buildAndRegister()

FBR.recipeBuilder()
    .fluidInputs(fluid('isodecanal') * 50)
    .fluidInputs(fluid('hydrogen') * 100)
    .notConsumable(metaitem('catalystBedPlatinum'))
    .fluidOutputs(fluid('isodecanol') * 50)
    .EUt(Globals.voltAmps[3])
    .duration(4)
    .buildAndRegister()
