//This MM patch configures Pathfinder's life support systems to use Snacks.
@PATH_HABITATION[Ponderosa]:NEEDS[SnacksUtils]
{
	//1 snack per meal and 1 meal per day.
	//In game, the player can adjust the efficiency of the recycler from 10% to 100%.
	//Given the dynamic nature, the input/output ratio is ALWAYS set to 0.000034723,
	//which gives a daily input/output of 1.00008 per day. The recycler will then adjust
	//the input/output ratio based upon RecyclerCapacity and recycler efficiency.
	MODULE
	{
		name = SoilRecycler
		ConverterName = Soil Recycler
		StartActionName = Start Soil Recycler
		StopActionName = Stop Soil Recycler
		AutoShutdown = false
		GeneratesHeat = false
		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		UseSpecializationBonus = true
		SpecialistEfficiencyFactor = 0.1
		ExperienceEffect = ScienceSkill
		EfficiencyBonus = 1.0
		RecyclerCapacity = 6
	 
		INPUT_RESOURCE
		{
			ResourceName = Soil
			Ratio = 0.000034723
			FlowMode = ALL_VESSEL
  		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 18
		}

		OUTPUT_RESOURCE
		{
			ResourceName = Snacks
			Ratio = 0.000034723
			DumpExcess = false
			FlowMode = ALL_VESSEL
		}
	}
}

@PATH_HABITATION[Pigpen]:NEEDS[SnacksUtils]
{
	MODULE
	{
		name = ModuleResourceConverter
		ConverterName = Haber Process (Makes Fertilizer)
		StartActionName = Start Haber Process
		StopActionName = Stop Haber Process
		AutoShutdown = false
		GeneratesHeat = false
		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		SpecialistBonusBase = 0.05
		ExperienceEffect = ScienceSkill
		EfficiencyBonus = 1
		 
		INPUT_RESOURCE
		{
			ResourceName = Ore
			Ratio = .002
		}

		INPUT_RESOURCE
		{
			ResourceName = Minerals
			Ratio = .002
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 3.5
		}

		OUTPUT_RESOURCE
		{
			ResourceName = Fertilizer
			Ratio = .002
			DumpExcess = false
		}
	}

	//This is calibrated for 4 kerbals at 100% efficiency when then consume
	//1 snack per meal and 1 meal per day.
	//In game, the player can adjust the efficiency of the recycler from 10% to 100%.
	//Given the dynamic nature, the input/output ratio is ALWAYS set to 0.00004630,
	//which gives a daily input/output of 1.00008 per day. The recycler will then adjust
	//the input/output ratio based upon RecyclerCapacity and recycler efficiency.
	MODULE
	{
		name = SoilRecycler
		ConverterName = Soil Recycler
		StartActionName = Start Soil Recycler
		StopActionName = Stop Soil Recycler
		AutoShutdown = false
		GeneratesHeat = false
		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		UseSpecializationBonus = true
		SpecialistEfficiencyFactor = 0.1
		ExperienceEffect = ScienceSkill
		EfficiencyBonus = 1.0
		RecyclerCapacity = 6
	 
		INPUT_RESOURCE
		{
			ResourceName = Soil
			Ratio = 0.000034723
			FlowMode = ALL_VESSEL
  		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 18
		}

		OUTPUT_RESOURCE
		{
			ResourceName = Snacks
			Ratio = 0.000034723
			DumpExcess = false
			FlowMode = ALL_VESSEL
		}
	}

	RESOURCE
	{
		name = Ore
		amount = 0
		maxAmount = 500
		isTweakable = false
	}

	RESOURCE
	{
		name = Minerals
		amount = 0
		maxAmount = 500
		isTweakable = false
	}

	RESOURCE
	{
		name = Fertilizer
		amount = 0
		maxAmount = 500
		isTweakable = false
	}

	RESOURCE
	{
		name = Soil
		amount = 0
		maxAmount = 500
		isTweakable = false
	}
}

@GREENHOUSE[Prairie]:NEEDS[SnacksUtils]
{
	needs = SnacksUtils

	MODULE
	{
		name = WBIGreenhouse
		ConverterName = Greenhouse
		StartActionName = Start Grenhouse
		StopActionName = Stop Greenhouse
		AutoShutdown = false
		GeneratesHeat = false
		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		ExperienceEffect = ScienceSkill
		EfficiencyBonus = 1
		hoursPerCycle = 540 //Number of hours to grow crops
		minimumSuccess = 45
		criticalSuccess = 90
		criticalFail = 20
		cropResource = Snacks

		//Calibrated for standard 1 snack per meal, 3 meals per day
		//Supports 3 kerbals
		cropYield = 810

		criticalSuccessBonus = 0.25
		failureLoss = 0.5
		repairSkill = ScienceSkill
		repairResource = Equipment
		repairAmount = 50

		INPUT_RESOURCE
		{
			ResourceName = Water
			Ratio = 0.000328125
		}

		INPUT_RESOURCE
		{
			ResourceName = Fertilizer
			Ratio = 0.000109375
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 6
		}
	}

	RESOURCE
	{
		name = Fertilizer
		amount = 0
		maxAmount = 1000
		isTweakable = true
	}

	RESOURCE
	{
		name = Water
		amount = 0
		maxAmount = 1000
		isTweakable = true
	}
}

@PATH_INDUSTRY[CropWorks]:NEEDS[SnacksUtils]
{
	needs = SnacksUtils

	MODULE
	{
		name = WBIGreenhouse
		ConverterName = Greenhouse
		StartActionName = Start Grenhouse
		StopActionName = Stop Greenhouse
		AutoShutdown = false
		GeneratesHeat = false
		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		ExperienceEffect = ScienceSkill
		EfficiencyBonus = 1
		hoursPerCycle = 540 //Number of hours to grow crops
		minimumSuccess = 45
		criticalSuccess = 90
		criticalFail = 20
		cropResource = Snacks

		//Calibrated for standard 1 snack per meal, 3 meals per day
		//Supports 10 kerbals
		cropYield = 2700

		criticalSuccessBonus = 0.25
		failureLoss = 0.5
		repairSkill = ScienceSkill
		repairResource = Equipment
		repairAmount = 150

		INPUT_RESOURCE
		{
			ResourceName = Water
			Ratio = 0.001093750
		}

		INPUT_RESOURCE
		{
			ResourceName = Fertilizer
			Ratio = 0.000364583
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 12
		}
	}

	RESOURCE
	{
		name = Fertilizer
		amount = 0
		maxAmount = 4000
		isTweakable = true
	}

	RESOURCE
	{
		name = Water
		amount = 0
		maxAmount = 4000
		isTweakable = true
	}
}

@PART[WBI_Outback]:NEEDS[SnacksUtils]
{
	@MODULE[WBIOutback]
	{
		@resourcesToKeep = EVA Propellant;Snacks
	}
}

@PART[WBI_Chuckwagon]:NEEDS[SnacksUtils]
{
	@MODULE[WBIMultipurposeStorage]
	{
		resourcesToKeep = Snacks;Soil
	}

	RESOURCE
	{
		name= Snacks
		amount = 0
		maxAmount = 200
	}
}

@PART[WBI_DocSciLab]:NEEDS[SnacksUtils]
{
	@MODULE[WBIMultipurposeLab]
	{
		resourcesToKeep = Snacks;Soil
	}

	RESOURCE
	{
		name= Snacks
		amount = 0
		maxAmount = 400
	}
}

@PART[WBI_Hacienda]:NEEDS[SnacksUtils]
{
	@MODULE[WBIMultipurposeHab]
	{
		resourcesToKeep = Snacks;Soil
	}

	RESOURCE
	{
		name= Snacks
		amount = 0
		maxAmount = 800
	}
}

@PART[WBI_Ponderosa]:NEEDS[SnacksUtils]
{
	@MODULE[WBIMultipurposeHab]
	{
		resourcesToKeep = Snacks;Soil
	}

	RESOURCE
	{
		name= Snacks
		amount = 0
		maxAmount = 800
	}
}

@PART[WBI_Ponderosa2]:NEEDS[SnacksUtils]
{
	@MODULE[WBIMultipurposeHab]
	{
		resourcesToKeep = Snacks;Soil
	}

	RESOURCE
	{
		name= Snacks
		amount = 0
		maxAmount = 800
	}
}

@PART[WBI_Homestead]:NEEDS[SnacksUtils]
{
	@MODULE[WBIMultipurposeHab]
	{
		resourcesToKeep = Snacks;Soil
	}

	RESOURCE
	{
		name= Snacks
		amount = 0
		maxAmount = 800
	}
}

@PART[wbiRanchHouse]:NEEDS[SnacksUtils]
{
	MODULE
	{
		name = WBIGreenhouse
		ConverterName = Greenhouse
		StartActionName = Start Grenhouse
		StopActionName = Stop Greenhouse
		AutoShutdown = false
		GeneratesHeat = false
		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		ExperienceEffect = ScienceSkill
		EfficiencyBonus = 1
		hoursPerCycle = 540 //Number of hours to grow crops
		minimumSuccess = 45
		criticalSuccess = 90
		criticalFail = 20
		cropResource = Snacks

		//Calibrated for standard 1 snack per meal, 3 meals per day
		//Supports 10 kerbals
		cropYield = 2700

		criticalSuccessBonus = 0.25
		failureLoss = 0.5
		repairSkill = ScienceSkill
		repairResource = Equipment
		repairAmount = 150

		INPUT_RESOURCE
		{
			ResourceName = Water
			Ratio = 0.001093750
		}

		INPUT_RESOURCE
		{
			ResourceName = Fertilizer
			Ratio = 0.000364583
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 12
		}
	}

	RESOURCE
	{
		name = Fertilizer
		amount = 0
		maxAmount = 4000
		isTweakable = true
	}

	RESOURCE
	{
		name = Water
		amount = 0
		maxAmount = 4000
		isTweakable = true
	}

	RESOURCE
	{
		name= Snacks
		amount = 0
		maxAmount = 6400
	}
}