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

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

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


// --- node definitions ---
node_attach = 0.0, -0.06, 0, 0, -1, 0, 0


// --- editor parameters ---
TechRequired = precisionEngineering
entryCost = 2300
cost = 1500
category = none
bdacategory = Gun turrets
subcategory = 0
bulkheadProfiles = srf
title = #loc_BDArmory_part_bahaM230ChainGun_title //M230 Chain Gun Turret
manufacturer = #loc_BDArmory_agent_title  //Bahamuto Dynamics
description = #loc_BDArmory_part_bahaM230ChainGun_description //The M230 Chain Gun is a single-barrel automatic cannon firing 30x173 Ammo high explosive rounds. It is commonly used on attack helicopters.
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 0,1,0,0,1
tags = #loc_BDArmory_part_bahaM230ChainGun_tags 
// --- standard part parameters ---
mass = 0.1
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 60
maxTemp = 3600

stagingIcon = SOLID_BOOSTER

MODULE
{
	name = ModuleTurret

	yawTransformName = aimRotate
	pitchTransformName = aimPitch

	pitchSpeedDPS = 120
	yawSpeedDPS = 120

	minPitch = -17
	maxPitch = 50
	yawRange = 270

	smoothRotation = true
	smoothMultiplier = 10
}

MODULE
{
	name = ModuleWeapon

	shortName = M230

	fireTransformName = fireTransform

	hasDeployAnim = true
	deployAnimName = deploy
	hasFireAnimation = true
	fireAnimName = fireAnim
	spinDownAnimation = false

	roundsPerMinute = 625
	isChaingun = true
	maxDeviation = 0.35
	maxEffectiveDistance = 2500
	maxTargetingRange = 5000

	ammoName = 30x173Ammo
	bulletType = 30x173HEBullet; 30x173Bullet
	requestResourceAmount = 1
	shellScale = 0.66

	hasRecoil = true
	onlyFireInRange = true
	bulletDrop = true

	weaponType = ballistic

	tracerLength = 0

	oneShotWorldParticles = true

	maxHeat = 3600
	heatPerShot = 210
	heatLoss = 820

	fireSoundPath = BDArmory/Parts/m230ChainGun/sounds/m230loop
	overheatSoundPath = BDArmory/Parts/m230ChainGun/sounds/m230loopEnd
	oneShotSound = false

	//explosion
	explModelPath = BDArmory/Models/explosion/30mmExplosion
	explSoundPath = BDArmory/Sounds/subExplode
}

MODULE
{
	name = FXModuleLookAtConstraint
	CONSTRAINLOOKFX
	{
		targetName = pitchPiston
		rotatorsName = pitchCylinder
	}
	CONSTRAINLOOKFX
	{
		targetName = pitchCylinder
		rotatorsName = pitchPiston
	}
	CONSTRAINLOOKFX
	{
		targetName = springTarget
		rotatorsName = springHolder
	}
	CONSTRAINLOOKFX
	{
		targetName = springHolder
		rotatorsName = springTarget
	}
}

MODULE
{
	name = BDAScaleByDistance
	transformToScaleName = spring
	scaleFactor = 0,0,2.62
	distanceTransformName = springTarget
}


}
