// MM Config to set fancy nuclear engines if NFE is around
@PART[restock-engine-cherenkov]:NEEDS[NearFutureElectrical]:AFTER[zKerbalAtomics]
{
	@mass -= 1.5358

	// $865 per U
	@cost += 121100
	!MODULE[ModuleActiveRadiator] {}
	!MODULE[ModuleGenerator] {}
	!MODULE[ModuleAlternator] {}

	MODULE
	{
		name = ModuleUpdateOverride
	}
	MODULE
	{
		name = FissionReactor
		StartActionName = #LOC_NFElectrical_ModuleFissionReactor_Action_StartActionName
		StopActionName = #LOC_NFElectrical_ModuleFissionReactor_Action_StopActionName
		ToggleActionName = #LOC_NFElectrical_ModuleFissionReactor_Action_ToggleActionName

		FollowThrottle = true

		// Heat animation, plays when above nominal temp
		// OverheatAnimation = Reactor_1MW_Heat

		// Heat to generate (kW *50)
		HeatGeneration = 800000

		// Above this temp more power output but risky
		NominalTemperature = 3300
		// Above this temp, reactor takes damage
		CriticalTemperature = 3700

		MaximumTemperature = 3900

		// Amount of damage taken by core when over critical temp
		// %/s/K, so with value 0.001, at 200 K over CriticalTemp, reactor takes 0.2% damage/s
		CoreDamageRate = 0.01

		// Base lifetime calculations off this resource
		FuelName = EnrichedUranium

		INPUT_RESOURCE
		{
			ResourceName = EnrichedUranium
			Ratio = 0.0003
			FlowMode = NO_FLOW
		}
		OUTPUT_RESOURCE
		{
			ResourceName = DepletedFuel
			Ratio = 0.0003
			DumpExcess = false
			FlowMode = NO_FLOW
		}
		// Disables stock converter functions DO NOT CHANGE
		UseSpecializationBonus = false
		AutoShutdown = false
		DefaultShutoffTemp = 0.90
		GeneratesHeat = false
		TemperatureModifier
		{
			key = 0 0
		}
	}
	MODULE
	{
		name = ModuleCoreHeatNoCatchup
		CoreTempGoal = 3300					//Internal temp goal - we don't transfer till we hit this point
		CoreToPartRatio = 0.1				//Scale back cooling if the part is this % of core temp
		CoreTempGoalAdjustment = 0			//Dynamic goal adjustment
		CoreEnergyMultiplier = 0.001			//What percentage of our core energy do we transfer to the part
		HeatRadiantMultiplier = 0.05		//If the core is hotter, how much heat radiates?
		CoolingRadiantMultiplier = 0		//If the core is colder, how much radiates?
		HeatTransferMultiplier = 0			//If the part is hotter, how much heat transfers in?
		CoolantTransferMultiplier = 0.01	//If the part is colder, how much of our energy can we transfer?
		radiatorCoolingFactor = 1			//How much energy we pull from core with an active radiator?  >= 1
		radiatorHeatingFactor = 0.01		//How much energy we push to the active radiator
		MaxCalculationWarp = 1000			//Based on how dramatic the changes are, this is the max rate of change
		CoreShutdownTemp = 3900				//At what core temperature do we shut down all generators on this part?
		MaxCoolant = 16000					//Maximum amount of radiator capacity we can consume - 50 = 1 small
	}
	MODULE
	{
		name = FissionFlowRadiator
		passiveCooling = 800
		exhaustCooling = 16000
		CoolingDecayRate = 1500
	}
	MODULE
	{
		name = FissionEngine
		Priority = 2
		HeatUsed = 16000
		TempIspScale
		{
			key = 300 0
			key = 1000 0.2
			key = 3300 1.0
			key = 4000 1.3
		}
	}
	//MODULE
	//{
		//name = FissionGenerator
		//Priority = 1
		//PowerGeneration = 100
		//HeatUsed = 800
	//}
	RESOURCE
	{
		name = EnrichedUranium
		amount = 140
		maxAmount = 140
	}
	RESOURCE
	{
		name = DepletedFuel
		amount = 0
		maxAmount = 140
	}
	MODULE
	{
		name = RadioactiveStorageContainer
		DangerousFuel = DepletedFuel
		SafeFuel = EnrichedUranium
		// What enginer level is needed to transfer the safe fuel
		EngineerLevelForSafe = 1
		// What enginer level is needed to transfer the dangerous fuel
		EngineerLevelForDangerous = 3
		// Max temp for transferring fuel into or out of the part
		MaxTempForTransfer = 400
		// kW of heat per unit of waste
		HeatFluxPerWasteUnit = 5
	}
	@MODULE[ModuleEnginesFX]:HAS[!PROPELLANT[Oxidizer]]   {
		@heatProduction *= 0.01
	}
	@MODULE[ModuleEnginesFX]:HAS[@PROPELLANT[Oxidizer]]   {
		@heatProduction *= 0.01
	}
}
