// Compatibility Patch for "Airplane Plus" with "kerbalism"
// version of this patch: 1.0.0
// GameData/AirplanePlus/Updates/
// KerbalismConfig/System/habitat.cfg
// Airplane Plus:  https://forum.kerbalspaceprogram.com/index.php?/topic/140262-14x-18x-airplane-plus-r264-fixed-issuesgithub-is-up-to-date-dec-21-2019/
// Kerbalism: https://forum.kerbalspaceprogram.com/index.php?/topic/190382-15-110-kerbalism-311/
// ============================================================================
// limit pressurized cockpits
// ============================================================================
@PART[b29cockpit,bellcockpit,bombardiercockpit,cessnacockpit,cessnacabin,citationcockpit,fightercockpit,fighterinlinecockpit,hipcockpit,hueycockpit,oh6cockpit,oldfightercockpit,zerocockpit,x1cockpit]:NEEDS[FeatureHabitat]:AFTER[KerbalismDefault]
//1p5CrewCabin,size2CrewCabin,mk3galaxy,144cockpit,concordecockpit,airbuscockpit,herculescockpit,falconcockpit
{
	@title ^= :(.)$:$0 (UNPRESSURIZED) :
	@description ^= :(.)$:$0\n\n<color=orange>Unpressurized.</color> Bring your own space suit. :
	@tags ^= :$: unpressurized:
	@MODULE[Habitat]
	{
	%max_pressure = 0.3
	}
}
// end

// ============================================================================
// Ad-hoc volume/surface for stock habitats
// ============================================================================
@PART[mk3galaxy]:NEEDS[FeatureHabitat]:AFTER[KerbalismDefault]
{
	@MODULE[Habitat]
	{
		volume = 10.12 //12.90
		surface = 30.74 //74.10
	}
}
@PART[144cockpit]:NEEDS[FeatureHabitat]:AFTER[KerbalismDefault]
{
	@MODULE[Habitat]
	{
		volume = 9.38 //10.79
		surface = 25.20 //38.58
	}
}
@PART[falconcockpit]:NEEDS[FeatureHabitat]:AFTER[KerbalismDefault]
{
	@MODULE[Habitat]
	{
		volume = 2.46 //2.63
		surface = 14.52 //22.37
	}
}
// @PART[concordecockpit]:NEEDS[FeatureHabitat]:AFTER[KerbalismDefault]
// {
	// @MODULE[Habitat]
	// {
		// volume = 15 //14.80
		// surface = 30 //33.95
	// }
// }
// @PART[airbuscockpit]:NEEDS[FeatureHabitat]:AFTER[KerbalismDefault]
// {
	// @MODULE[Habitat]
	// {
		// volume = 00 //9.38
		// surface = 00 //19.26
	// }
// }
// @PART[herculescockpit]:NEEDS[FeatureHabitat]:AFTER[KerbalismDefault]
// {
	// @MODULE[Habitat]
	// {
		// volume = 00 //8.56
		// surface = 00 //17.20
	// }
// }
// @PART[1p5CrewCabin]:NEEDS[FeatureHabitat]:AFTER[KerbalismDefault]
// {
	// @MODULE[Habitat]
	// {
		// volume = 00 //7.92
		// surface = 00 //19.75
	// }
// }
// @PART[size2CrewCabin]:NEEDS[FeatureHabitat]:AFTER[KerbalismDefault]
// {
	// @MODULE[Habitat]
	// {
		// volume = 00 //18.77
		// surface = 00 //29.65
	// }
// }

// end

// ============================================================================
//Add panorama to cockpit with large view, only for unpressurized, good idea ?
// ============================================================================
@PART[bellcockpit,oh6cockpit,hueycockpit,hipcockpit,b29cockpit]:HAS[!MODULE[Comfort]]:NEEDS[FeatureComfort]:AFTER[KerbalismDefault]
{
  MODULE
  {
    name = Comfort
    bonus = panorama
    desc = offer a relaxing panoramic view.
  }
  @tags ^= :$: comfort:
}
// end

// ============================================================================
// change energy cost to extend/retract LandingGear
// ============================================================================
@PART[x1gear,x1sidegear]:HAS[@MODULE[Deploy]]:AFTER[KerbalismDefault]//stock:SmallGearBay
{
  @MODULE[Deploy]
  {
    @extra_Deploy = 0.06
  }
}
@PART[fightergear,miggear,sidegear,herculesfrontgear]:HAS[@MODULE[Deploy]]:AFTER[KerbalismDefault]//stock:GearSmall
{
  @MODULE[Deploy]
  {
    @extra_Deploy = 0.1
  }
}
@PART[herculesgear,airbusreargear]:HAS[@MODULE[Deploy]]:AFTER[KerbalismDefault]//stock:GearMedium
{
  @MODULE[Deploy]
  {
    @extra_Deploy = 0.16
  }
}
@PART[b29gear]:HAS[@MODULE[Deploy]]:AFTER[KerbalismDefault]//stock:GearLarge
{
  @MODULE[Deploy]
  {
    @extra_Deploy = 0.22
  }
}
// end