PART
{
	// Kerbal Space Program - Part Config
	//
	//

	// --- general parameters ---
	name = bahaAim120
	module = Part
	author = BahamutoD

	// --- asset parameters ---
	mesh = model.mu
	rescaleFactor = 1


	// --- node definitions ---
	node_attach = 0.0, 0.09, -0.984, 0, 1, 0, 0
	node_stack_top = 0.0, 0.09, -0.175, 0, 1, 0, 0


	// --- editor parameters ---
	TechRequired = precisionEngineering
	entryCost = 5000
	cost = 2500
	category = none
	bdacategory = Missiles
	subcategory = 0
	bulkheadProfiles = srf
	title = #loc_BDArmory_part_bahaAim120_title //AIM-120 AMRAAM Missile
	manufacturer = #loc_BDArmory_agent_title  //Bahamuto Dynamics
	description = #loc_BDArmory_part_bahaAim120_description  //Medium range radar guided homing missile.
	// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
	attachRules = 1,1,0,0,1
	tags = #loc_BDArmory_part_bahaAim120_tags
	// --- standard part parameters ---
	mass = 0.152
	dragModelType = default
	maximum_drag = 0.01
	minimum_drag = 0.01
	angularDrag = 2
	crashTolerance = 5
	maxTemp = 3600


	MODULE
	{
		name = MissileLauncher

		shortName = AIM-120

		thrust = 55 //KN thrust during boost phase
		cruiseThrust = 25 //thrust during cruise phase
		dropTime = 0.55 //how many seconds after release until engine ignites
		boostTime = 2.2 //seconds of boost phase
		cruiseTime = 120 //seconds of cruise phase
		guidanceActive = true //missile has guidanceActive
		maxTurnRateDPS = 35 //thrust+maxTurnRateDPS is the value used by the AI to prioritize missiles over each other. maxTurnRateDPS, in degrees per second, ONLY affects flight of RCS missiles like the HEKV1

		decoupleSpeed = 5

		engineFailureRate = 0    // Probability the missile engine will fail to start (0-1), evaluated once on missile launch
		guidanceFailureRate = 0  // Probability the missile guidance will fail per second (0-1), evaluated every frame after launch

		audioClipPath = BDArmory/Sounds/rocketLoop
		exhaustPrefabPath = BDArmory/Models/exhaust/smallExhaust
		boostExhaustPrefabPath = BDArmory/Models/exhaust/mediumExhaust

		boostTransformName = boostTransform
		boostExhaustTransformName = boostTransform

		optimumAirspeed = 1272 //deals with how missile leads the target and calculation of turn radius for dynamic launch zone calculation, should match the max speed of your missile

		aero = true //Missile has aerodynamics
		liftArea = 0.0020 //increases lift which helps with manuevering and turning, but also increases drag
		// dragArea = 0.0020 // Option to set reference area for drag independently from the lift area, otherwise defaults to liftArea
		steerMult = 8 //big number = steer harder...
		maxTorque = 60 //ammount of torque that will be applied to the missile for turning
		maxAoA = 30 //max AoA missile can turn at, will limit missile's turn radius below what is possible with maxTorque if set too low

		missileType = missile
		homingType = aam //air to air missile different types are AAM, AGM, Cruise, Ballistic, ProNav, and AugProNav

		terminalHoming = true
		terminalHomingType = ProNav //switches to ProNav at final engagement for a more accurate homing solution at expense of energy expenditure
		pronavGain = 3 // ProNav gain constant, only used with ProNav and AugProNav homing types (default is 3)
		terminalHomingRange = 8000

		targetingType = inertial
		gpsUpdates = 1 // How often GPS or inertial guidance should update the target's position (in seconds)

		terminalManeuvering = true
		terminalGuidanceShouldActivate = true // Should the missile try to active it's terminalGuidanceType?
		terminalGuidanceType = radar // Guidance type to use when the missile approaches the target
		terminalGuidanceDistance = 8000 // Range at which the missile should switch to terminalGuidanceType
		activeRadarRange = 9000 // Active radar range (this should be greater than terminalGuidanceDistance to ensure the target is spotted)

		maxOffBoresight = 120 //maximum angle, from the boresight, that the missile can track the target. This also controls how the missile can launch off boresight. When launched from the air at another air target with uncagedLock = false, launch off boresight is at 0.35*maxOffBoresight, otherwise it is at 0.75*,maxOffBoresight (uncagedLock = true OR either launching craft or target is landed/splashed).
		// allAspect = false // DEPRECATED - use uncagedLock instead
		uncagedLock = false // Only affects when missile can launch for radar-guided missiles, see comment on maxOffBoresight for how. For heat-seeking missiles this also allows lock-on after launch.
		lockedSensorFOV = 7 //the field of view the missile can see to maintain a lock after launch, will affect accuracy
		chaffEffectivity = 1 //modifies how the missile targeting is affected by chaff, 1 is fully affected (normal behavior), lower values mean less affected (i.e. 0 ignores chaff), higher values means more affected

		minStaticLaunchRange = 500 // minimum launch range in meters assuming craft don't move, final min launch distance is dynamically calculated based on target/launching craft speeds
		maxStaticLaunchRange = 25000 // maximum launch range in meters assuming craft don't move, final max launch distance is dynamically calculated based on target/launching craft speeds

		radarLOAL = true //radar lock on after launch
		seekerTimeout = 5 //timelimit without a detected target before Active Radar guidance fails and LOAL could not lock a target (default is 5).
		engageAir = true
		engageMissile = false
		engageGround = false
		engageSLW = false
	}

	MODULE
	{
		name = BDExplosivePart
		tntMass = 25
		warheadType = ContinuousRod
		fuseFailureRate = 0	// How often the explosive fuse will fail to detonate (0-1), evaluated once on detonation trigger
	}
}
