Profile
{
	name = KerbalismSupport
	modname = Moldavite Machines Kerbalism
	moddir = MoldaviteMachinesKerbalism
	
	Process
	{
		name = MMGHAlgae
		title = #LOC_mmgh_algae
		modifier = _MMGHAlgae
		input = Water@0.7208
		input = Minerals@0.1
		input = ElectricCharge@15
		output = Algae@0.1
	}
	Process
	{
		name = MMGHPhotolysis
		title = #LOC_mmgh_watersplit
		modifier = _MMGHPhotolysis
		input = Water@0.7208
		input = Algae@0.00001
		output = LqdHydrogen@1.1404
		output = Oxidizer@0.128
		dump_valve = Oxidizer
	}
	Process
	{
		name = MMGHPhotoculture
		title = #LOC_mmgh_photoculture
		modifier = _MMGHPhotoculture
		input = Water@0.7208
		input = Minerals@0.01
		input = ElectricCharge@15
		output = Photoculture@0.1
	}
	Process
	{
		name = MMGHLiquidFuel
		title = #LOC_mmgh_lf
		modifier = _MMGHLiquidFuel
		input = Photoculture@0.0001
		input = CarbonDioxide@541.3839
		input = Water@0.4685
		output = LiquidFuel@0.0681
		output = Oxidizer@0.2368
		dump_valve = Oxidizer
	}
	Process
	{
		name = MMGHKerosene
		title = #LOC_mmgh_kero
		modifier = _MMGHKerosene
		input = Photoculture@0.0001
		input = CarbonDioxide@541.3839
		input = Water@0.4685
		output = Kerosene@0.41549853
		output = LqdOxygen@1.037643392
		dump_valve = LqdOxygen
	}
	Process
	{
		name = MMGHMethane
		title = #LOC_mmgh_lch4
		modifier = _MMGHMethane
		input = Photoculture@0.0001
		input = CarbonDioxide@451.4533
		input = Water@0.7208
		output = LqdMethane@0.7542
		output = Oxidizer@0.256
		dump_valve = Oxidizer
	}
	Process
	{
		name = MMGHMethaneRF
		title = #LOC_mmgh_lch4
		modifier = _MMGHMethaneRF
		input = Photoculture@0.0001
		input = CarbonDioxide@451.4533
		input = Water@0.7208
		output = LqdMethane@0.7542
		output = LqdOxygen@1.12177664
		dump_valve = LqdOxygen
	}
	Process
	{
		name = MMGHEthanol
		title = #LOC_mmgh_ethanol
		modifier = _MMGHEthanol
		input = Photoculture@0.0001
		input = CarbonDioxide@541.3839
		input = Water@0.6487
		output = Ethanol@0.7007
		output = Oxidizer@0.2304
		dump_valve = Oxidizer
	}
	Process
	{
		name = MMGHEthanolRF
		title = #LOC_mmgh_ethanol
		modifier = _MMGHEthanolRF
		input = Photoculture@0.0001
		input = CarbonDioxide@541.3839
		input = Water@0.6487
		output = Ethanol@0.7007
		output = LqdOxygen@1.009598976
		dump_valve = LqdOxygen
	}
}

RESOURCE_DEFINITION
{
	name = _MMGHAlgae
	density = 0.0
	isVisible = false
}
RESOURCE_DEFINITION
{
	name = _MMGHPhotoculture
	density = 0.0
	isVisible = false
}
RESOURCE_DEFINITION
{
	name = _MMGHPhotolysis
	density = 0.0
	isVisible = false
}
RESOURCE_DEFINITION
{
	name = _MMGHLiquidFuel
	density = 0.0
	isVisible = false
}
RESOURCE_DEFINITION
{
	name = _MMGHKerosene
	density = 0.0
	isVisible = false
}
RESOURCE_DEFINITION
{
	name = _MMGHMethane
	density = 0.0
	isVisible = false
}
RESOURCE_DEFINITION
{
	name = _MMGHMethaneRF
	density = 0.0
	isVisible = false
}
RESOURCE_DEFINITION
{
	name = _MMGHEthanol
	density = 0.0
	isVisible = false
}
RESOURCE_DEFINITION
{
	name = _MMGHEthanolRF
	density = 0.0
	isVisible = false
}

// Algae farms
@PART[mmgh-alg-???]:NEEDS[Kerbalism,ProfileDefault]:FOR[MoldaviteMachinesKerbalism]
{
	MODULE
	{
		name = ProcessController
		resource = _MMGHAlgae
		title = #LOC_mmgh_algae
		capacity = #$/refPower$
	}
	MODULE
	{
		name = ProcessController
		resource = _MMGHPhotolysis
		title = #LOC_mmgh_watersplit
		capacity = #$/refPower$
	}
	
	MODULE
	{
		name = Configure
		title = Chemical Plant
		slots = 2
		SETUP
		{
			name = Algae
			desc = Use <b>Water</b> , <b>Minerals</b> and modest UV light to foster the growth of usable <b>Algae</b>.
			MODULE
			{
				type = ProcessController
				id_field = resource
				id_value = _MMGHAlgae
			}
		}
		SETUP
		{
			name = Water Photolysis
			desc = Use accumulated <b>Algae</b> and some UV light to separate much needed <b>LqdHydrogen</b> from <b>Water</b>.
			MODULE
			{
				type = ProcessController
				id_field = resource
				id_value = _MMGHPhotolysis
			}
		}
	}
	
}

// Photobioreactors
@PART[mmgh-pbr-???]:NEEDS[Kerbalism,ProfileDefault]:FOR[MoldaviteMachinesKerbalism]
{
	@tags ^= :$: _kerbalism
	MODULE
	{
		name = ProcessController
		resource = _MMGHPhotoculture
		title = #LOC_mmgh_photoculture
		capacity = #$/refPower$
	}
	MODULE
	{
		name = ProcessController
		resource = _MMGHLiquidFuel
		@resource:NEEDS[RealFuels] = _MMGHKerosene
		title = #LOC_mmgh_lf
		capacity = #$/refPower$
	}
	MODULE
	{
		name = ProcessController
		resource = _MMGHMethane
		@resource:NEEDS[RealFuels] = _MMGHMethaneRF
		title = #LOC_mmgh_lch4
		capacity = #$/refPower$
	}
	MODULE
	{
		name = ProcessController
		resource = _MMGHEthanol
		@resource:NEEDS[RealFuels] = _MMGHEthanolRF
		title = #LOC_mmgh_ethanol
		capacity = #$/refPower$
	}
	
	MODULE
	{
		name = Configure
		title = Chemical Plant
		slots = 2
		UPGRADES
		{
			UPGRADE
			{
				name__ = Upgrade-Slots
				techRequired__ = electronics
				slots = 3
			}
		}
		SETUP
		{
			name = Photoculture
			desc = Use <b>Water</b>, some modest UV light and abstracted <b>Minerals</b> to foster the growth of Carbon-fixing microbes refered hereto as <b>Photoculture</b>.
			MODULE
			{
				type = ProcessController
				id_field = resource
				id_value = _MMGHPhotoculture
			}
		}
		SETUP:NEEDS[!RealFuels]
		{
			name = LiquidFuel
			desc = Use some <b>Photoculture</b> , <b>CarbonDioxide</b> and <b>Water</b> to produce <b>LiquidFuel</b>.
			MODULE
			{
				type = ProcessController
				id_field = resource
				id_value = _MMGHLiquidFuel
			}
		}
		SETUP:NEEDS[RealFuels]
		{
			name = Kerosene
			desc = Use some <b>Photoculture</b> , <b>CarbonDioxide</b> and <b>Water</b> to produce <b>Kerosene</b>.
			MODULE
			{
				type = ProcessController
				id_field = resource
				id_value = _MMGHKerosene
			}
		}
		SETUP
		{
			name = Methane
			desc = Use some <b>Photoculture</b> , <b>CarbonDioxide</b> and <b>Water</b> to produce <b>LqdMethane</b>.
			MODULE
			{
				type = ProcessController
				id_field = resource
				id_value = _MMGHMethane
				@id_value:NEEDS[RealFuels] = _MMGHMethaneRF
			}
		}
		SETUP
		{
			name = Ethanol
			desc = Use some <b>Photoculture</b> , <b>CarbonDioxide</b> and <b>Water</b> to produce <b>Ethanol</b>.
			MODULE
			{
				type = ProcessController
				id_field = resource
				id_value = _MMGHEthanol
				@id_value:NEEDS[RealFuels] = _MMGHEthanolRF
			}
		}
	}
}