PART
{
//Basic
	name = O_vtol_engine
	module = Part
	author = ClimberFX
	//mesh = O_vtol_engine.mu
	MODEL
	{
		model = Omicron/Parts/O_vtol_engine
	}
	rescaleFactor = 1.25
	tags = climberfx omicron air aircraft speed vtol engine rocket jet sabre

//Node
	// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
	attachRules = 0,1,0,1,0
	node_attach = 0, 0, 0, 1, 0, 0, 0
	
//Cost & RD
	TechRequired = experimentalMotors
	entryCost = 0
	cost = 2500

//Description
	category = Engine
	subcategory = 0
	title = Omicron Vtol Sabre
	manufacturer = ClimberFX
	description = Vtol engine for Omicron back. This engine is a fine engineering of an supercompact hibrid rocket/sabre jet. Is capable of doing supersonics speeds and then put your baleanced ship into space. Use it wisely and don't put your nose near exaustor.

//Drag
	dragModelType = default
	maximum_drag = 0.2
	minimum_drag = 0.1
	angularDrag = 2

//Physical
	mass = 0.75
	crashTolerance = 25
	breakingForce = 150
	breakingTorque = 150
	maxTemp = 3500
	bulkheadProfiles = srf

	skinInternalConductionMult = 4.0
	emissiveConstant = 0.8
	heatConductivity = 0.45

//Effects
	EFFECTS
    {
        power
        {
            AUDIO
            {
                channel = Ship
                clip = sound_jet_deep
                volume = 0.0 0.0
                volume = 0.05 0.0
                volume = 1.0 1.0
                pitch = 0.0 0.2
                pitch = 1.0 2.5
                loop = true
            }
        }

//ROCKET
        running
        {
            AUDIO
            {
                channel = Ship
                clip = sound_rocket_spurts //sound_jet_low
                volume = 0.0 0.0
                volume = 1.0 1.0
                pitch = 0.0 0.2
                pitch = 1.0 3.0
                loop = true
            }

            MODEL_MULTI_PARTICLE
            {
                modelName = Omicron/FX/O_vtol_particle
                transformName = vtol_thruster1
                localPosition = 0, 0, 0.1
                decluster = true
                emitOnUpdate = true

				emission = 0 0.01	//Quantity. Fade Particle
				emission = 1 1

				energy = 0 0.55		
				energy = 1 1.5		//Double life of particle

				speed = 1		//Move particle back. Zero make a statick ball
            }
        }

        engage
        {
            AUDIO
            {
                channel = Ship
                clip = sound_vent_medium
                volume = 1.0
                pitch = 2.0
                loop = false
            }
        }

        disengage
        {
            AUDIO
            {
                channel = Ship
                clip = sound_vent_soft
                volume = 1.0
                pitch = 2.0
                loop = false
            }
        }

        flameout
        {
            PREFAB_PARTICLE
            {
                prefabName = fx_exhaustSparks_flameout_2
                transformName = vtol_thruster1
                oneShot = true
                localOffset = 0, 0, 0.15
            }
            AUDIO
            {
                channel = Ship
                clip = sound_explosion_low
                volume = 1.0
                pitch = 2.0
                loop = false
            }
        }

        power_closed
        {
            AUDIO
            {
                channel = Ship
                clip = sound_jet_deep
                volume = 0.0 0.0
                volume = 0.05 0.0
                volume = 1.0 1.0
                pitch = 0.0 0.2
                pitch = 1.0 2.5
                loop = true
            }
        }

//JET
        running_closed
        {
            AUDIO
            {
                channel = Ship
                clip = sound_jet_low
                volume = 0.0 0.0
                volume = 1.0 1.0
                pitch = 0.0 0.2
                pitch = 1.0 3.0
                loop = true
            }

            MODEL_MULTI_PARTICLE
            {
                modelName = Omicron/FX/smokejet
                transformName = vtol_thruster1
                localPosition = 0, 0, 0.2
                decluster = true
                emitOnUpdate = true

                emission = 0.0 0.01
                emission = 0.075 1.0
                emission = 1.0 2.5

                speed = 0.0 0.15
                speed = 1.0 1.0
                
            }

            MODEL_MULTI_PARTICLE
            {
                modelName = Omicron/FX/O_vtol_particle_jet
                transformName = vtol_thruster1
                localPosition = 0, 0, 0.1
                decluster = true
                emitOnUpdate = true

				emission = 0 0.01	//Quantity. Fade Particle
				emission = 0.33 0.1
				emission = 0.66 0.5
				emission = 1 1

				energy = 0 0.55	
				energy = 1 1.25		//Double life of particle

				speed = 1			//Move particle back. Zero make a statick ball
            }
        }

        flameout_closed
        {
            PREFAB_PARTICLE
            {
                prefabName = fx_exhaustSparks_flameout_2
                transformName = vtol_thruster1
                oneShot = true
                localOffset = 0, 0, 0.15
            }
            AUDIO
            {
                channel = Ship
                clip = sound_explosion_low
                volume = 1.0
                pitch = 2.0
                loop = false
            }
        }
    }

    MODULE
    {
        name = MultiModeEngine
        primaryEngineID = AirBreathing
        secondaryEngineID = Rocket
    }

//Air-Breathing Mode
    MODULE
    {
        name = ModuleEnginesFX
        engineID = AirBreathing
        powerEffectName = power_closed
        runningEffectName = running_closed
        flameoutEffectName = flameout_closed
        thrustVectorTransformName = vtol_thruster1
        exhaustDamage = True
        ignitionThreshold = 0.025
        minThrust = 0
        maxThrust = 105
        heatProduction = 125 // Modified in global config
        useEngineResponseTime = True
        engineAccelerationSpeed = 2.5
        engineDecelerationSpeed = 2.5
        useVelocityCurve = False
        PROPELLANT
        {
            name = LiquidFuel
            ratio = 1
            DrawGauge = True
        }
        PROPELLANT
        {
            name = IntakeAir
            ignoreForIsp = True
            ratio = 45
        }
        atmosphereCurve
        {
            key = 0 7200 0 0  //6800
        }
        atmChangeFlow = True
        useVelCurve = True
        useAtmCurve = True
        flowMultCap = 5.0
        velCurve
        {
			key = 0 1 0 0
			key = 0.2 0.98 0 0
			key = 0.4 1.5 1.5 1.5
			key = 1 3 3.5 3.5
			key = 2 7 2.821036 2.821036
			key = 4.5 9 0 0
			key = 6 0 -17.76577 0
        }
        atmCurve
        {
            // higher thrust at altitude than even TRJ
			key = 0 0 0 6.163951
			key = 0.015 0.1 6.383988 6.383988
			key = 0.08 0.3 1.175865 1.175865
			key = 0.35 0.45 0.2340841 0.2340841
			key = 1 1 1.454293 0.25

        }
    }


//Rocket Mode
    MODULE
    {
        name = ModuleEnginesFX
        engineID = Rocket
		runningEffectName = running
        thrustVectorTransformName = vtol_thruster1
        exhaustDamage = True
        ignitionThreshold = 0.1
        minThrust = 0
        maxThrust = 95 //115
        heatProduction = 125
        fxOffset = 0, 0, 0.55
        useEngineResponseTime = True
        engineAccelerationSpeed = 5
        engineDecelerationSpeed = 5
        EngineType = LiquidFuel
        PROPELLANT
        {
            name = LiquidFuel
            ratio = 0.9
            DrawGauge = True
        }
        PROPELLANT
        {
            name = Oxidizer
            ratio = 1.1
        }
        atmosphereCurve
        {
            key = 0 380
            key = 1 280
        }
    }

    MODULE
    {
        name = FXModuleAnimateThrottle
        animationName = heat_vtol_anim
        responseSpeed = 0.01
        dependOnEngineState = True
        dependOnThrottle = True
        preferMultiMode = True // bind to the parent multimode module, not the actual engines.
    }

//Modules
    MODULE
    {
        name = ModuleAlternator
        RESOURCE
        {
            name = ElectricCharge
            rate = 15.0
        }
    }

    MODULE
    {
        name = ModuleGimbal
        gimbalTransformName = vtol_thruster1
        gimbalRange = 5
        useGimbalResponseSpeed = true
        gimbalResponseSpeed = 25
    }

	MODULE	
	{
		name = FXModuleLookAtConstraint
		CONSTRAINLOOKFX
		{
			targetName = aim_1
			rotatorsName = vtol_cone_1
		}
		CONSTRAINLOOKFX
		{
			targetName = aim_2
			rotatorsName = vtol_cone_2
		}
		CONSTRAINLOOKFX
		{
			targetName = aim_3
			rotatorsName = vtol_cone_3
		}
		CONSTRAINLOOKFX
		{
			targetName = aim_4
			rotatorsName = vtol_cone_4
		}
		CONSTRAINLOOKFX
		{
			targetName = aim_5
			rotatorsName = vtol_cone_5
		}
    }

    MODULE
    {
        name = ModuleOmicronVtol
    }

	MODULE
	{
		name = ModuleSurfaceFX
		thrustProviderModuleIndex = 1
		fxMax = 0.5
		maxDistance = 20
		falloff = 2
		thrustTransformName = vtol_thruster1
	}
}