PART
{
	name = a4rocketengine
	module = Part
	author = TD and zer0Kerbal

	MODEL
	{
		model = WernhersOldStuff/Parts/Aggregat4/Engine
	}
	scale = 1
	rescaleFactor = 0.64
	bulkheadProfiles = size1
	
	//node_stack_side1 = 0.54, 0.0, 0.0, 1.0, 0.0, 0.0, 1 
	//node_stack_side2 = -0.54, 0.0, 0.0, -1.0, 0.0, 0.0, 1 
	//node_stack_side3 = 0.0, 0.0, 0.54, 0.0, 0.0, 1.0, 1 
	//node_stack_side4 = 0.0, 0.0, -0.54, 0.0, 0.0, -1.0, 1 
	//node_stack_top = 0.0, 1.94418, 0.0, 0.0, 1.0, 0.0, 1
	node_stack_bottom = 0.0, -1.66266, 0.0, 0.0, -1.0, 0.0, 1
	NODE
	{
		name = top
		transform = EngineTop
		size = 1
		method = FIXED_JOINT
	}
	NODE
	{
		name = side1
		transform = WingNode1
		size = 1
		method = FIXED_JOINT
	}
	NODE
	{
		name = side2
		transform = WingNode2
		size = 1
		method = FIXED_JOINT
	}
	NODE
	{
		name = side3
		transform = WingNode3
		size = 1
		method = FIXED_JOINT
	}
	NODE
	{
		name = side4
		transform = WingNode4
		size = 1
		method = FIXED_JOINT
	}
	attachRules = 1,0,1,1,0
	stackSymmetry = 3

	TechRequired = start
	entryCost = 0
	cost = 190
	category = Engine
	subcategory = 0

	title = #WOS-A4-engine-titl
	manufacturer = #WOS-Agency-titl
	description = #WOS-A4-engine-desc
	tags = a4 rocket engine

	mass = .4

	maxTemp = 1050 
	heatConductivity = 0.04 // half default
	skinInternalConductionMult = 4.0
	emissiveConstant = 0.4 // engine nozzles are good at radiating but not this one.

	dragModelType = default
	maximum_drag = 0.2
	minimum_drag = 0.2
	angularDrag = 2

	crashTolerance = 7

	MODULE
	{
		name = ModuleEnginesFX
		engineID = running
		engineName = running
		powerEffectName = running
		thrustVectorTransformName = Thrust
		exhaustDamage = False
		ignitionThreshold = 0.1
		minThrust = 10
		maxThrust = 72.1
		heatProduction = 1050
		fxOffset = 0, 0, 0.07
		EngineType = LiquidFuel
		PROPELLANT
		{
			name = LiquidFuel
			ratio = 0.9
			DrawGauge = True
		}
		PROPELLANT
		{
			name = Oxidizer
			ratio = 1.1
		}
		atmosphereCurve
		{
			key = 0 191
			key = 1 155
			key = 2 120
			key = 10 0
		}
	}

	MODULE
	{
		name = ModuleGimbal
		gimbalTransformName = Gimbal1
		gimbalRangeXP = 0
		gimbalRangeXN = 0
		gimbalRangeYP = 40
		gimbalRangeYN = 40
		gimbalRangeZP = 0
		gimbalRangeZN = 0
		//gimbalResponseSpeed = 0.9
		//useGimbalResponseSpeed = true
	}

	MODULE
	{
		name = ModuleGimbal
		gimbalTransformName = Gimbal2
		gimbalRangeXP = 0
		gimbalRangeXN = 0
		gimbalRangeYP = 40
		gimbalRangeYN = 40
		gimbalRangeZP = 0
		gimbalRangeZN = 0

	}

	MODULE
	{
		name = ModuleGimbal
		gimbalTransformName = Gimbal3
		gimbalRangeXP = 0
		gimbalRangeXN = 0
		gimbalRangeYP = 40
		gimbalRangeYN = 40
		gimbalRangeZP = 0
		gimbalRangeZN = 0

	}

	MODULE
	{
		name = ModuleGimbal
		gimbalTransformName = Gimbal4
		gimbalRangeXP = 0
		gimbalRangeXN = 0
		gimbalRangeYP = 40
		gimbalRangeYN = 40
		gimbalRangeZP = 0
		gimbalRangeZN = 0

	}	

	MODULE
	{
		name = ModuleAlternator
		RESOURCE
		{
			name = ElectricCharge
			rate = 1.2
		}
	}

	MODULE
	{
		name = ModuleAnimateHeat
		ThermalAnim = A4Emissive
	}

	EFFECTS
	{
		running
		{
			AUDIO
			{
				channel = Ship
				clip = sound_rocket_mini
				volume = 0.0 0.0
				volume = 0.05 0.6
				volume = 1.0 1.5
				pitch = 0.0 1.2
				pitch = 1.0 2.0
				loop = true
			}

			MODEL_MULTI_PARTICLE
			{
				name = main_plume
				modelName = WernhersOldStuff/FX/a4Central1
				transformName = FX
				emission = 0.0 0.0
				emission = 0.01 0.01
				emission = 0.5 0.6
				emission = 1.0 1.0
				speed = 0.0 0.0
				speed = 0.1 0.1
				speed = 0.5 0.6
				speed = 1.0 1.0
				localPosition = 0, 0, 0
			}
			MODEL_MULTI_PARTICLE
			{
				name = core_plume
				modelName = WernhersOldStuff/FX/a4Central2
				transformName = FX
				emission = 0.0 0.0
				emission = 0.01 0.01
				emission = 0.5 0.4
				emission = 1.0 1.0
				speed = 0.0 0.0
				speed = 0.1 0.1
				speed = 0.5 0.6
				speed = 1.0 1.0
				localPosition = 0, 0, 0
			}
			MODEL_MULTI_PARTICLE
			{
				name = cold_ethanol_shroud
				modelName = WernhersOldStuff/FX/ColdShroud
				transformName = FX
				emission = 0.0 0.0
				emission = 0.01 0.01
				emission = 0.5 0.4
				emission = 1.0 1.0
				speed = 0.0 0.0
				speed = 0.1 0.1
				speed = 0.5 0.6
				speed = 1.0 1.0
				localPosition = 0, 0, 0
			}
//			MODEL_MULTI_PARTICLE
//			{
//				name = ignited_ethanol_shroud
//				modelName = WernhersOldStuff/FX/HotShroud
//				transformName = FX
//				emission = 0.0 0.0
//				emission = 0.01 0.01
//				emission = 0.5 0.4
//				emission = 1.0 1.0
//				speed = 0.0 0.0
//				speed = 0.1 0.1
//				speed = 0.5 0.6
//				speed = 1.0 1.0
//				localPosition = 0, 0, 0
//			}
			MODEL_MULTI_PARTICLE
			{
				name = vectorvaneeddies
				modelName = WernhersOldStuff/FX/a4Eddy
				//modelName = KOOSE/FX/
				transformName = Eddy
				emission = 0.0 0.0
				emission = 1.0 0.5
				speed = 0.0 0.0
				speed = 1.0 0.4
				localPosition = 0, 0, 0
			}
			MODEL_MULTI_PARTICLE
			{
				name = steamturbineoutput
				modelName = WernhersOldStuff/FX/Steam
				//modelName = KOOSE/FX/
				transformName = SteamExhaust
				emission = 0.0 0.0
				emission = 0.01 0.6
				emission = 1.0 1.0
				speed = 0.0 0.0
				speed = 1.0 0.4
				localPosition = 0, 0, 0
			}			
		}
	}

	MODULE
	{
		name = ModuleTestSubject
		useStaging = True
		useEvent = True
		situationMask = 127
		CONSTRAINT
		{
			type = REPEATABILITY
			value = ALWAYS
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = REPEATABILITY
			value = BODYANDSITUATION
			prestige = Significant
		}
		CONSTRAINT
		{
			type = REPEATABILITY
			value = ONCEPERPART
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = GT
			value = 4000
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = LT
			value = 8000
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = GT
			value = 2000
			prestige = Significant
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = LT
			value = 4000
			prestige = Significant
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = GT
			value = 1000
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = LT
			value = 2000
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = ALTITUDE
			test = GT
			value = 0 // this just registers altitude as something to care about
			situationMask = 8
		}
		CONSTRAINT
		{
			type = ALTITUDE
			test = LT
			value = 300000
			situationMask = 16
			body = _NotSun
		}
		CONSTRAINT
		{
			type = ALTITUDE
			test = LT
			value = 600000
			situationMask = 32
			body = _NotSun
		}
		CONSTRAINT
		{
			type = SPEED
			test = GT
			value = 0
			situationMask = 8
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = SPEED
			test = LT
			value = 600
			situationMask = 8
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = SPEED
			test = GT
			value = 300
			situationMask = 8
			prestige = Significant
		}
		CONSTRAINT
		{
			type = SPEED
			test = LT
			value = 1200
			situationMask = 8
			prestige = Significant
		}
		CONSTRAINT
		{
			type = SPEED
			test = GT
			value = 600
			situationMask = 8
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = SPEED
			test = LT
			value = 2500
			situationMask = 8
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = LT
			value = 200
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = GT
			value = 100
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = LT
			value = 100
			prestige = Significant
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = GT
			value = 50
			prestige = Significant
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = LT
			value = 50
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = GT
			value = 20
			prestige = Exceptional
		}
	}
}