//This MM patch configures DSEV's life support systems to use Snacks.
@PART[wbiZenGreenhouse,wbiNautilusBridge]:NEEDS[SnacksUtils]
{
	MODULE
	{
		name = WBIModuleGreenhouse
		ConverterName = Greenhouse
		StartActionName = Start Grenhouse
		StopActionName = Stop Greenhouse
		AutoShutdown = false
		GeneratesHeat = false
		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		ExperienceEffect = ScienceSkill
		EfficiencyBonus = 1
		hoursPerCycle = 168 //Number of hours to grow crops
		minimumSuccess = 45
		criticalSuccess = 90
		criticalFail = 20
		cropResource = Snacks

		//Calibrated for 1 snack per meal, 3 meals per day
		//Supports 2 kerbals
		cropYield = 168

		criticalSuccessBonus = 0.25
		failureLoss = 0.5

		INPUT_RESOURCE
		{
			ResourceName = Water
			Ratio = 0.000218750
		}

		INPUT_RESOURCE
		{
			ResourceName = Fertilizer
			Ratio = 0.000072917
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 12
		}
	}

	RESOURCE
	{
		name = Fertilizer
		amount = 250
		maxAmount = 250
		isTweakable = true
	}

	RESOURCE
	{
		name = Water
		amount = 250
		maxAmount = 250
		isTweakable = true
	}
}

@TRANQ[Tranquility]:NEEDS[SnacksUtils]
{
	//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.000034723.
	//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 = 4
	 
		INPUT_RESOURCE
		{
			ResourceName = Soil
			Ratio = 0.000034723
			FlowMode = ALL_VESSEL
  		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 36
		}

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

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

@CENTRIFUGE[Centrifuge]: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
		}
	}

	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 12 kerbals
		cropYield = 3240

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

		INPUT_RESOURCE
		{
			ResourceName = Water
			Ratio = 0.0013125
		}

		INPUT_RESOURCE
		{
			ResourceName = Fertilizer
			Ratio = 0.0004375
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 12
		}
	}

	//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 = 12
	 
		INPUT_RESOURCE
		{
			ResourceName = Soil
			Ratio = 0.000034723
			FlowMode = ALL_VESSEL
  		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 36
		}

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

	RESOURCE
	{
		name = Fertilizer
		amount = 500
		maxAmount = 500
		isTweakable = true
	}

	RESOURCE
	{
		name = Water
		amount = 500
		maxAmount = 500
		isTweakable = true
	}

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

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

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

D2HAB:NEEDS[SnacksUtils]
{
	author = Angel-125
	name = Habitat
	title = D2 Habitat
	mass = 3.5
	requiredResource = Equipment
	requiredAmount = 1400
	reconfigureSkill = ConverterSkill
	logoPanel = WildBlueIndustries/000WildBlueTools/Decals/Ponderosa
	glowPanel = WildBlueIndustries/000WildBlueTools/Decals/PonderosaGlow
	description = The D2 Habitat contains advanced equipment to supply kerbals with snacks, recycle their waste products, and create fertilizer needed for the greenhouse.
	toolTip = You can recycle soil into snacks and create fertilizer
	toolTipTitle = Your First D2 Habitat

	//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 = 12
	 
		INPUT_RESOURCE
		{
			ResourceName = Soil
			Ratio = 0.000034723
			FlowMode = ALL_VESSEL
  		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 36
		}

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

	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
		}
	}

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

	RESOURCE
	{
		name = Ore
		amount = 1000
		maxAmount = 1000
		isTweakable = false
	}

	RESOURCE
	{
		name = Minerals
		amount = 1000
		maxAmount = 1000
		isTweakable = false
	}

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

@PART[WBI_D2Greenhouse]:FOR[DSEV]: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 12 kerbals
		cropYield = 3240

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

		INPUT_RESOURCE
		{
			ResourceName = Water
			Ratio = 0.0013125
		}

		INPUT_RESOURCE
		{
			ResourceName = Fertilizer
			Ratio = 0.0004375
		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 12
		}
	}

	RESOURCE
	{
		name = Fertilizer
		amount = 500
		maxAmount = 500
		isTweakable = true
	}

	RESOURCE
	{
		name = Water
		amount = 500
		maxAmount = 500
		isTweakable = true
	}

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

@HOMESTEAD[Homestead]:NEEDS[SnacksUtils]
{

	//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 = 12
	 
		INPUT_RESOURCE
		{
			ResourceName = Soil
			Ratio = 0.000034723
			FlowMode = ALL_VESSEL
  		}

		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 36
		}

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

	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
		}
	}

	RESOURCE
	{
		name = Ore
		amount = 1000
		maxAmount = 1000
		isTweakable = false
	}

	RESOURCE
	{
		name = Minerals
		amount = 1000
		maxAmount = 1000
		isTweakable = false
	}

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

	RESOURCE
	{
		name = Compost
		amount = 2400
		maxAmount = 2400
		isTweakable = true
	}

}