//	*** 12 Hour Day adjustment version Adjustment: Consumables, Organic Slurry, Air, BadAir 

//	=========================== seeing the coding among the stars
//	*** Kerbalism SIMPLEX   ***
//	=========================== by theJesuit
//
//	*** VERSION 3.23.20250710
//	*** Licence Unlicence http://unlicense.org/
//		
//	***	Requires Module Manager for KSP - check out the Forums https://forum.kerbalspaceprogram.com
//	***	Requires Kerbalism to actually work https://spacedock.info/mod/1774/Kerbalism
//
//	***	Contents
//		The AngleCan Simplex profile (Supplies, Rules, Processes)
//		Part Upgrade for upgradeable slots
//		Add configurable Life Support System to all crewed parts
//		Add scrubber process to EVA kerbals
//		Add configurable supplies to inline containers
//		Add configurable supplies to radial containers
//		Add configurable Life Support System to Life Support Unit part
//		Universal Storage 2 containers and surplus part removal
//		Pseudo-resources used by processes
//		ISRU, Drills, Fuel Cells, Greenhouse now in separate files

//	============================================================================
//	The AngleCan Simplex profile with JNSQ
//	============================================================================

// 12 hour adjustments
	@RESOURCE_DEFINITION[Air]			{	@density *= 2	}
	@RESOURCE_DEFINITION[BadAir]		{	@density *= 2	}
	@RESOURCE_DEFINITION[Consumables]	{	@density *= 2	}
	@RESOURCE_DEFINITION[OrganicSlurry]	{	@density *= 2	}

//	Greenhouses
	@PART[kerbalism-greenhouse]:NEEDS[Profilesimplex]:FOR[Kerbalism]
		{	@MODULE[Greenhouse]		{	@crop_rate /= 2						// halved growth per-second for 72 days (12 hour day and 1/5 365) 
										@INPUT_RESOURCE[OrganicSlurry]	{	@rate /= 2 	}
										@INPUT_RESOURCE[BadAir]			{	@rate /= 2	}
										@OUTPUT_RESOURCE[Air]			{	@rate /= 2	}
		}							}

	@PART[Benjee10_MMSEV_baseGreenhouse]:NEEDS[Benjee10_MMSEV,Profilesimplex]:FOR[Kerbalism]
		{	@MODULE[Greenhouse]		{	@crop_rate /= 2						// halved growth per-second for 72 days (12 hour day and 1/5 365) 
										@INPUT_RESOURCE[OrganicSlurry]	{	@rate /= 2 	}
										@INPUT_RESOURCE[BadAir]			{	@rate /= 2	}
										@OUTPUT_RESOURCE[Air]			{	@rate /= 2	}
		}							}

	@PART[KKAOSS_Greenhouse_g]:NEEDS[PlanetaryBaseInc,Profilesimplex]:FOR[Kerbalism]
		{	@MODULE[Greenhouse]		{	@crop_rate /= 2						// halved growth per-second for 72 days (12 hour day and 1/5 365) 
										@INPUT_RESOURCE[OrganicSlurry]	{	@rate /= 2 	}
										@INPUT_RESOURCE[BadAir]			{	@rate /= 2	}
										@OUTPUT_RESOURCE[Air]			{	@rate /= 2	}
		}							}
	@PART[mmgh-agr-1875|mmgh-agr-250|mmgh-agr-375]:NEEDS[MoldaviteMachines,Profilesimplex]:FOR[Kerbalism]
		{	@MODULE[Greenhouse]		{	@crop_rate /= 2						// halved growth per-second for 72 days (12 hour day and 1/5 365) 
										@INPUT_RESOURCE[OrganicSlurry]	{	@rate /= 2 	}
										@INPUT_RESOURCE[BadAir]			{	@rate /= 2	}
										@OUTPUT_RESOURCE[Air]			{	@rate /= 2	}
		}							} 
	@PART[sspx-greenhouse-25-1|sspx-greenhouse-375-1,sspx-greenhouse-25-1,sspx-cupola-greenhouse-125-1,sspx-greenhouse-5-1,sspx-dome-greenhouse-5-1]:NEEDS[StationPartsExpansionRedux,Profilesimplex]:FOR[Kerbalism]
		{	@MODULE[Greenhouse]		{	@crop_rate /= 2						// halved growth per-second for 72 days (12 hour day and 1/5 365) 
										@INPUT_RESOURCE[OrganicSlurry]	{	@rate /= 2 	}
										@INPUT_RESOURCE[BadAir]			{	@rate /= 2	}
										@OUTPUT_RESOURCE[Air]			{	@rate /= 2	}
		}							}
	@PART[sspx-aquaculture-375-1]:NEEDS[StationPartsExpansionRedux,Profilesimplex]:FOR[Kerbalism]
		{	@MODULE[Greenhouse]		{	@crop_rate /= 2						// halved growth per-second for 72 days (12 hour day and 1/5 365) 
										@INPUT_RESOURCE[OrganicSlurry]	{	@rate /= 2 	}
										@INPUT_RESOURCE[BadAir]			{	@rate /= 2	}
										@OUTPUT_RESOURCE[Consumables]	{	@rate /= 2	}
										@OUTPUT_RESOURCE[Air]			{	@rate /= 2	}
		}							}


Profile
	{	name = simplex

//	*** SUPPLIES - note that BadAir and OrganicSlurry are not carried on crewed habitats - additional containers must be supplied.
		Supply
			{	resource = ElectricCharge
				on_pod = 50.0
				on_eva = 33.0
				on_rescue = 10000.0
				low_message = #KERBALISM_low_battery
				empty_message = #KERBALISM_empty_battery
				refill_message = #KERBALISM_refill_battery
			}
		Supply
			{	resource = Air
				on_pod = 5
				on_eva = .33
				on_rescue = 50
				low_message = #KERBALISM_low_oxygen
				empty_message = #KERBALISM_empty_oxygen
				refill_message = #KERBALISM_refill_oxygen
			}
		Supply
			{	resource = Consumables
				on_pod = 5
				on_rescue = 50.0
				low_message = #KERBALISM_low_food
				empty_message = #KERBALISM_empty_food
				refill_message = #KERBALISM_refill_food
			}
			
//	*** RULES
			
		Rule
			{	name = climatization
				input = ElectricCharge
				rate = 0.0001 						// per-kelvin (temp diff), per m^3 (living space), per-second
				degeneration = 0.00000007 			// about 2h at 100k temp diff in 20m^3
				modifier = temperature,volume,per_capita
				warning_message = #KERBALISM_climatization_warning
				danger_message = #KERBALISM_climatization_danger
				fatal_message = #KERBALISM_climatization_fatal
				relax_message = #KERBALISM_climatization_relax
			}
		Rule
			{	name = eating
				input = Consumables
				output = OrganicSlurry
				rate = .5			
				interval = 21600						// JNSQ original 10800				// 2 meals per-day
				degeneration = 0.03333					// 30 meals, 15 days
				warning_message = #KERBALISM_food_warning
				danger_message = #KERBALISM_food_danger
				fatal_message = #KERBALISM_food_fatal
				relax_message = #KERBALISM_food_relax
			}
		Rule
			{	name = breathing
				input = Air								// Air
				output = WasteAtmosphere
				rate = 0.00002314815					//	JNSQ original 0.00004629630			// 1.251 kg per day JNSQ 2.502 kg per day
				ratio = 25								// vanilla takes 3 hours to feel lightheaded in mk1 pod
														// when Air is *1000 Atmosphere, and ratio is 1000 it takes around 15mins to feel lightheaded
														// adjust ratio to make it three hours, ratio is good at 25 for timing in a mk1 pod.
														// adjust the WasteAtmosphere but with bug - .001 kg lost eveyr 40 or seconds.  balanenced with scrubbers though!
				degeneration = 0.0055555				// 3 minutes
				modifier = non_breathable				// change in 2.2.0
				warning_message = #KERBALISM_oxygen_warning
				danger_message = #KERBALISM_oxygen_danger
				fatal_message = #KERBALISM_oxygen_fatal
				relax_message = #KERBALISM_oxygen_relax
			}
		Rule
			{	name = stress
				degeneration = 0.00000000463			// 10000 days
				variance = 0.33							// add per-kerbal variance
				modifier = living_space,comfort,pressure
				breakdown = true 						// trigger breakdown event instead of death
				warning_message = #KERBALISM_stress_warning
				danger_message = #KERBALISM_stress_danger
				relax_message = #KERBALISM_stress_relax
			}
		Rule
			{	name = radiation
				degeneration = 1.0 						// just use the modifier
				variance = 0.1 							// add per-kerbal variance
				modifier = radiation,shielding
				warning_threshold = 25.0
				danger_threshold = 37.5
				fatal_threshold = 50.0
				warning_message = #KERBALISM_radiation_warning
				danger_message = #KERBALISM_radiation_danger
				fatal_message = #KERBALISM_radiation_fatal
				relax_message = #KERBALISM_radiation_relax
			}
		Rule
			{	name = BadAir poisoning
				degeneration = 0.0005555 				// 30 minutes
				modifier = poisoning
				warning_message = #KERBALISM_co2_warning
				danger_message = #KERBALISM_co2_danger
				fatal_message = #KERBALISM_co2_fatal
				relax_message = #KERBALISM_co2_relax
			}	

// ***	PROCESSES

		Process
			{	name = non-regenerative scrubber
				modifier = _NonRegenScrubber
				input = WasteAtmosphere@0.0000462963	// capacity start at 2, reach 1 in 6h, then drop below
				input = _NonRegenScrubber@0.000023148	// consume 0.5 capacity in 6h
			}
		Process
			{	name = scrubber							// works at the same rate as breathing
				modifier = _Scrubber
				input = ElectricCharge@0.025
				input = WasteAtmosphere@0.025																		//	0.0000462963
				output = BadAir@0.0005					//	JNSQ original 0.001 will take out same rate per day as atmoharvesting	//	0.0000462963
				dump = true
			} 
		Process
			{	name = electrolysis						// convinces BadAir to become Air
				modifier = _SOE
				input = ElectricCharge@5
				input = BadAir@0.00002314815	
				output = Air@0.00002314815				
				output = Air@0.00002314815				
			} 
 		Process
			{	name = pressure control					// This seems to be an arbitary amount - but works reasonably fast to return a habitat to normal.
				modifier = _PressureControl,non_breathable
				input = ElectricCharge@0.3
				input = Air@0.000175					//	original 0.00035 JNSQ  will convert half amount to balacnce increase mass Air@0.000175 							//.35
				output = Atmosphere@0.35
				dump = false
			}
		Process
			{	name = atmo leaks						// This rate is based at 1 unit/30 days multipled somehow by volume of habitat.
				modifier = surface,non_breathable
				input = Atmosphere@0.00003086			// old was Atmosphere@0.000001543, but now seems to be 20 times too little
			}
		Process
			{	name = air pump
				modifier = _AirPump,breathable
				input = ElectricCharge@0.00258
				output = Atmosphere@7.35
			}
		Process
			{	name = lfo fuel cell
				modifier = _LFOFuelCell
				input = LiquidFuel@0.0016875
				input = Oxidizer@0.0020625
				output = ElectricCharge@1.5 			// Based on Stock value
			}
		Process
			{	name = monoprop fuel cell
				modifier = _MonopropFuelCell
				input =	Air@0.00002314815				// original 0.0000462963 JNSQ half amount as mass has doubled.   
				input = MonoPropellant@0.003
				output = ElectricCharge@0.1
			}			
		Process
			{	name = radioisotope generator
				modifier = _RTG
				input = _RTG@0.000000001888				// 28.8 kerbin-year half-life
				output = ElectricCharge@1.0
			}
		Process
			{	name = KOTs
				modifier = _kerbalPurpose
				input = ElectricCharge@0.057
				cures = stress@0.00000000926
			}
		Process
			{	name = algae farm									//	Process is at half consumption rate... i.e. it supports .5 kerbals. 
				modifier = _OStoCons								//	Parts will increase capacity i.e. kerbalism algae farm will support 2 kerbals at capacity 4
				input = ElectricCharge@0.25							//	this uses up air though at 1/8 rate of consumable production
				input = Air@0.00000289351875						//	use 1 to 1 with Botany Area, or Electrolysis Process in the Life Support part
				input = OrganicSlurry@0.000011574075
				output = Consumables@0.000011574075
				output = BadAir@0.00000289351875
			}
		Process
			{	name = botany area									//	Process is at quarter consumption rate... i.e. it supports .25 kerbals.  Parts will increase capacity.
				modifier = _BadAirtoAir								// Kerbalism Algae Farm supports 2 kerbals for Consumables, but produces BadAir at 1/8 which is .25 kerbals as a result.  A capacity of 1 for this part will fix that for 1 kerbal.  Alternatively use the Electrolysis part which has higher EC consumption.
				input = ElectricCharge@0.15
				input = BadAir@0.0000057870375
				output = Air@0.0000057870375
			}
		Process
			{	name = electrolysis									// convinces BadAir to become Air
				modifier = _SOE
				input = ElectricCharge@5
				input = BadAir@0.00002314815	
				output = Air@0.00002314815				
				output = Air@0.00002314815				
			} 
// STOCK RESOURCES
		Process
			{	name = Ore to LFO   				// ISRU to based on Stock
				title = #KerbalismSimplex_process_oretolfo
				modifier = _OretoLFO
				input = ElectricCharge@30
				input = Ore@0.025					// prior to 3.22	Ore@0.5
				input = Coolant@1.0
				output = LiquidFuel@0.0225 			// prior to 3.22	LiquidFuel@0.45 
				output =  Oxidizer@0.0.275			// prior to 3.22	Oxidizer@0.55
				dump_valve = LiquidFuel,Oxidizer	// do I need this for balance?
			}
		Process
			{	name = mini Ore to LFO   			// ISRU to based on Stock
				title = #KerbalismSimplex_process_minioretolfo
				modifier = _miniOretoLFO
				input = ElectricCharge@30
				input = Ore@0.1125
				output = LiquidFuel@0.01125
				output = Oxidizer@0.01375
				dump_valve = LiquidFuel,Oxidizer	// do I need this for balance?
			}
		Process
			{	name = Ore to MP   					// ISRU to based on Stock
				title = #KerbalismSimplex_process_oretomp
				modifier = _OretoMP
				input = ElectricCharge@30
				input = Ore@0.026
				output = MonoPropellant@0.05
				output = BadAir@0.001
				dump_valve = MonoPropellant,BadAir	// do I need this for balance?
			}
		Process
			{	name = mini Ore to MP   			// ISRU to based on Stock
				title = #KerbalismSimplex_process_minioretomp
				modifier = _miniOretoMP
				input = ElectricCharge@30
				input = Ore@0.1255
				output = MonoPropellant@0.025
				output = BadAir@0.00005
				dump_valve = MonoPropellant,BadAir	// do I need this for balance?
			}				
		Process
			{	name = Ore to OS  
				title = #KerbalismSimplex_process_oretoorgslur
				modifier = _OretoOS
				input = ElectricCharge@30
				input = Ore@0.025
				output = OrganicSlurry@0.00375
				output = Air@0.0075					//	Adjust
				dump_valve = OrganicSlurry,Air
			}
		Process
			{	name = coolant replenishment
				title = #KerbalismSimplex_coolant_gen
				modifier = _coolant
				input = ElectricCharge@0.01				// For pumping coolant
				output = Coolant@1.0
			}

	}	// Profile ends here


//	========================================================
//	Add configurable Life Support System to all crewed parts

@PART[*]:HAS[#CrewCapacity[>0],!MODULE[KerbalSeat]]
	{	@MODULE[ProcessController],*
			{	@capacity *= 1.67
			}
		MODULE
			{	name = ProcessController
				resource = _Scrubber
				title = Scrubber
				capacity = #$/CrewCapacity$			//	capacity = #$../CrewCapacity$
				running = true
			}
		MODULE
			{	name = ProcessController
				resource = _PressureControl
				title = Pressure control
				capacity = #$/CrewCapacity$
				running = true
			}
		MODULE
			{	name = ProcessController
				resource = _MonopropFuelCell
				title = Monoprop+Air fuel cell
				capacity = #$/CrewCapacity$
				running = false
			}
		MODULE
			{	name = Configure
				title = Pod
				slots = 2
 				SETUP
					{	name = Scrubber
						desc = A dual-bed vacuum-exposing regenerative scrubber that removes <b>BadAir</b> from the internal atmosphere.
						mass = 0.01
						cost = 250
						MODULE
							{	type = ProcessController
								id_field = resource
								id_value = _Scrubber
							}
					}
				SETUP
					{	name = Pressure Control
						desc = Use <b>Air</b> to maintain the internal atmosphere at a comfortable pressure.
//						tech = engineering101					// Taken this out as it doesn't really matter when you get it, the first few pods you are likely to encounter won't have it available anyway!
						mass = 0.01
						cost = 250
						MODULE
							{	type = ProcessController
								id_field = resource
								id_value = _PressureControl
							}
					}
 				SETUP
					{	name = MonopropFuelCell
						desc = An emergency fuel cell that burns <b>MonoPropellant</b> and <b>Air</b>, that produces very smelly gas that is vented immeadiatly.  No questions asked.
						mass = 0.01
						cost = 250
						MODULE
							{	type = ProcessController
								id_field = resource
								id_value = _MonopropFuelCell
							}
					}
				SETUP	
					{	name = None
						desc = Empty slot for mass and cost savings, should you not require any additional LifeSupport modules.
					}
			}
	}

//	Remove pressure controlmodules from all habitats that have a max_pressure set, such as Mk1 Command
	@PART[*]:HAS[@MODULE[Habitat]:HAS[#max_pressure]]:NEEDS[ProfileSimplex]:AFTER[zzzKerbalismSimplex]
		{	!MODULE[ProcessController]:HAS[#resource[_PressureControl]] {}
			@MODULE[Configure]
				{	!SETUP[Pressure?Control] {}
				}
		}
	
// 	Boost Mk3 Shuttle cockpit and Science Lab Air storage
	@PART[mk3Cockpit_Shuttle,Large_Crewed_Lab]:NEEDS[ProfileSimplex]:FOR[KerbalismSimplex]
		{	@MODULE[Configure]:HAS[#title[Pod]]
				{	@SETUP[Pressure?Control]
						{	@RESOURCE[Air]
								{	@amount *= 3
									@maxAmount *= 3
								}
						}
				}
		}

	@PART[SimplexPart_GreenhouseScience]:NEEDS[ProfileSimplex]:AFTER[zzzKerbalismSimplex]
		{	!MODULE[ProcessController]:HAS[#resource[_MonopropFuelCell]] {}
			@MODULE[Configure]:HAS[#title[Pod]]	
				{	@slots = 1 	
					!SETUP[MonopropFuelCell] {}
				}	
			MODULE
				{	name = ProcessController
					resource = _BadAirtoAir
					title = Botany Area
					capacity = 2
					running = true
				}
			RESOURCE
				{	name = BadAir
					amount = 0
					maxAmount = 5
				}
			RESOURCE
				{	name = Air
					amount = 5
					maxAmount = 5
				}
		}



	@PART[MK1CrewCabin|Mark2Cockpit|cupola]:NEEDS[ProfileSimplex]:FOR[KerbalismSimplex] 			{	@MODULE[Configure]:HAS[#title[Pod]]	{	@slots = 1 	}	}
	@PART[mk3Cockpit_Shuttle]:NEEDS[ProfileSimplex]:FOR[KerbalismSimplex] 							{	@MODULE[Configure]:HAS[#title[Pod]] {	@slots = 3 }	}

// Remove ECLSS from non-command pods, hitchhiker crewcabin etc.   Promotes ECLSS part.  Needs command.

	@PART[*]:HAS[@MODULE[SimplexExperimentCREW]]:NEEDS[ProfileSimplex]:AFTER[zzzKerbalismSimplex]
		{	!MODULE[ProcessController],* 		{}
			!MODULE[Configure]:HAS[#title[Pod]]	{}
			!MODULE[Reliability]		 		{}
		}	

//	============================================================================
//	Add scrubber process to EVA kerbals
//	============================================================================

	@PART[kerbalEVA,kerbalEVAfemale]:NEEDS[Profilesimplex]:FOR[Kerbalism]
		{	MODULE
				{	name = ProcessController
					resource = _NonRegenScrubber
					title = Non-Regen Scrubber
					capacity = 1.0
					toggle = true
					running = true
				}
		}


//	============================================================================
//	Add Kerbalism Configurable supplies to inline containers
//	============================================================================

	@PART[SimplexPart_Consumables_Tiny]
		{	@ContainerVolume = 24
		}
	@PART[SimplexPart_Consumables_Small]
		{	@ContainerVolume = 120
		}
	@PART[SimplexPart_Consumables_Medium]
		{	@ContainerVolume = 375
		}
	@PART[SimplexPart_Consumables_Large]
		{	@ContainerVolume = 960
		}
	@PART[SimplexPart_Consumables_Huge]
		{	@ContainerVolume = 3240
		}

	@PART[SimplexPart_Consumables_*]:NEEDS[ProfileSimplex]:FOR[Kerbalism]
		{	MODULE
				{	name = Configure
					title = Supply Container
					slots = 1
					SETUP
						{	name = Consumables
							desc = Store a balanced supply of <b>Consumables</b>.
							RESOURCE
								{	name = Consumables
									amount = 1
									maxAmount = 1
									@amount *= #$../../../ContainerVolume$
									@maxAmount *= #$../../../ContainerVolume$
								}
						}
					SETUP
						{	name = OrganicSlurry
							desc = Stores <b>OrganicSlurry</b>.
							RESOURCE
								{	name = OrganicSlurry
									amount = 0
									maxAmount = 1
									@amount *= #$../../../ContainerVolume$
									@maxAmount *= #$../../../ContainerVolume$
								}
						}
				}
		}

// ============================================================================
// Add configurable supplies to radial containers
// ============================================================================

@PART[kerbalism-container-radial-pressurized-prosemian-small]:NEEDS[Profilesimplex]:FOR[Kerbalism]		// tiny
	{	@ContainerVolume = 24		// at rescale .6	volume should be *.2
	}
@PART[kerbalism-container-radial-pressurized-prosemian-medium]:NEEDS[Profilesimplex]:FOR[Kerbalism]		//small
	{	@ContainerVolume = 120		// at rescale 1		accounting for 4 kerbals to minmus and back ~15 days
	}
@PART[kerbalism-container-radial-pressurized-prosemian-medium-plus]:NEEDS[Profilesimplex]:FOR[Kerbalism]	// medium
	{	@ContainerVolume = 375
	}
@PART[kerbalism-container-radial-pressurized-prosemian-big]:NEEDS[Profilesimplex]:FOR[Kerbalism]		// large
	{	@ContainerVolume = 960		// at rescale 2		volume should be * 2^3
	}
@PART[kerbalism-container-radial-pressurized-prosemian-huge]:NEEDS[Profilesimplex]:FOR[Kerbalism]		// huge
	{	@ContainerVolume = 3240		// at rescale 3		volume should be * 3^3
	}

@PART[kerbalism-container-radial-*]:NEEDS[Profilesimplex]:FOR[Kerbalism]
	{	MODULE
			{	name = Configure
				title = Pressurized Tank
				slots = 1
				SETUP
					{	name = Air
						desc = Store <b>Air</b>
						RESOURCE
							{	name = Air
								amount = 1
								maxAmount = 1
								@amount *= #$../../../ContainerVolume$
								@maxAmount *= #$../../../ContainerVolume$
							}
					}
				SETUP
					{	name = BadAir
						desc = Store <b>BadAir</b>
						RESOURCE
							{	name = BadAir
								amount = 0
								maxAmount = 1
								@amount *= #$../../../ContainerVolume$
								@maxAmount *= #$../../../ContainerVolume$
							}
					}
			}
	}
	
// ============================================================================
// Add configurable Life Support System to Life Support Unit part
// ============================================================================

	@PART[kerbalism-lifesupportmodule]:NEEDS[ProfileSimplex]:FOR[Kerbalism]
		{	MODULE
				{	name = ProcessController
					resource = _Scrubber
					title = Scrubber
					capacity = 3
					running = true
				}
			MODULE
				{	name = ProcessController
					resource = _PressureControl
					title = Pressure control
					capacity = 3
					running = true
				}
			MODULE
				{	name = ProcessController
					resource = _AirPump
					title = Air Pump
					capacity = 3
					running = true
				}
			MODULE
				{	name = ProcessController
					resource = _MonopropFuelCell
					title = Monoprop+Air fuel cell
					capacity = 1
					running = false
				}
			MODULE
				{	name = ProcessController
					resource = _SOE
					title = BadAir to Air Electrolysis
					capacity = 3
					running = false
				}
			@MODULE[ProcessController],*
				{	@capacity *= 1.67
				}
			MODULE
				{	name = Configure
					title = Life Support
					slots = 3
					SETUP
						{	name = Scrubber
							desc = A dual-bed vacuum-exposing regenerative scrubber that sequesters <b>BadAir</b> from the internal atmosphere.
							mass = 0.01
							cost = 250
							MODULE
								{	type = ProcessController
									id_field = resource
									id_value = _Scrubber
								}
						}
					SETUP
						{	name = Pressure Control
							desc = Use <b>Air</b> to maintain the internal atmosphere at a comfortable pressure.
//							tech = engineering101
							mass = 0.01
							cost = 250
 							MODULE
								{	type = ProcessController
									id_field = resource
									id_value = _PressureControl
								}
						}
					SETUP
						{	name = Air Pump
							desc = Use outside <b>Air</b> to regulates habitat pressure and possibly fill inflatables
							mass = 0.01
							cost = 250
							MODULE
								{	type = ProcessController
									id_field = resource
									id_value = _AirPump
								}
						}
					SETUP
						{	name = MonopropFuelCell
							desc = An emergency fuel cell that burns <b>MonoPropellant</b> and <b>Air</b>, that produces very smelly gas that is vented immeadiatly.  No questions asked.
							mass = 0.01
							cost = 250
							MODULE
								{	type = ProcessController
									id_field = resource
									id_value = _MonopropFuelCell
								}
						}
					SETUP
						{	name = BadAir to Air Electrolysis
							desc = A rather industrial process of convincing <b>BadAir</b> to return to <b>Air</b> by using copious amounts of EC.
							mass = 0.06
							cost = 600
							tech = advScienceTech
							MODULE
								{	type = ProcessController
									id_field = resource
									id_value = _SOE
								}
						}
					SETUP	
						{	name = None
							desc = Empty slot for mass and cost savings, should you not require any additional LifeSupport modules.
						}
				}
		}
@PART[*]:HAS[@MODULE[Configure]:HAS[#title[Life?Support]]]:NEEDS[KerbalismSimplex,AngleCanMods/SIMPLEXTechTree]:LAST[KerbalismSimplex]
		{	@MODULE[Configure]:HAS[#title[Life?Support]]	{	@SETUP:HAS[#name[BadAir?to?Air?Electrolysis]]	{	@tech = advScienceTech		}		}		}

@PART[*]:HAS[@MODULE[Configure]:HAS[#title[Life?Support]]]:NEEDS[KerbalismSimplex,AngleCanMods/TETRIXTechTree]:LAST[KerbalismSimplex]
		{	@MODULE[Configure]:HAS[#title[Life?Support]]	{	@SETUP:HAS[#name[BadAir?to?Air?Electrolysis]]	{	@tech = experimentalMotors	}		}		}

@PART[*]:HAS[@MODULE[Configure]:HAS[#title[Life?Support]]]:NEEDS[KerbalismSimplex,AngleCanMods/QUARTIXTechTree]:LAST[KerbalismSimplex]
		{	@MODULE[Configure]:HAS[#title[Life?Support]]	{	@SETUP:HAS[#name[BadAir?to?Air?Electrolysis]]	{	@tech = specializedSupport	}		}		}

// ============================================================================
// Pseudo-resources used by processes
// ============================================================================

// Standard Life Support. EC Generation.

	RESOURCE_DEFINITION
		{	name = _NonRegenScrubber
			density = 0.0
			isVisible = false
		}

	RESOURCE_DEFINITION
		{	name = _Scrubber
			density = 0.0
			isVisible = false
		}

	RESOURCE_DEFINITION
		{	name = _PressureControl
			density = 0.0
			isVisible = false
		}

	RESOURCE_DEFINITION
		{	name = _SOE
			density = 0.0
			isVisible = false
		}
	RESOURCE_DEFINITION
		{	name = _RTG
			density = 0.0
			isVisible = false
		}
	RESOURCE_DEFINITION
		{	name = _coolant
			density = 0.0
			isVisible = false
		}
	RESOURCE_DEFINITION
		{	name = _AirPump
			density = 0.0
			isVisible = false
		}
	RESOURCE_DEFINITION
		{	name = _LFOFuelCell
			density = 0.0
			isVisible = false
		}
	RESOURCE_DEFINITION
		{	name = _MonopropFuelCell
			density = 0.0
			isVisible = false
		}
		
// FOR STOCK RESOURCES
	RESOURCE_DEFINITION
		{	name = _OretoLFO
			density = 0.0
			isVisible = false
		}
	RESOURCE_DEFINITION
		{	name = _OretoMP
			density = 0.0
			isVisible = false
		}
	RESOURCE_DEFINITION
		{	name = _OretoOS
			density = 0.0
			isVisible = false
		}
	RESOURCE_DEFINITION
		{	name = _miniOretoLFO
			density = 0.0
			isVisible = false
		}
	RESOURCE_DEFINITION
		{	name = _miniOretoMP
			density = 0.0
			isVisible = false
		}			
	RESOURCE_DEFINITION
		{	name = _OStoCons
			density = 0.0
			isVisible = false
		}			
	RESOURCE_DEFINITION
		{	name = _kerbalPurpose
			density = 0.0
			isVisible = false
		}			
	RESOURCE_DEFINITION
		{	name = _SickbayTV
			density = 0.0
			isVisible = false
		}
	RESOURCE_DEFINITION
		{	name = _BadAirtoAir
			density = 0.0
			isVisible = false
		}	