<?xml version="1.0"?>
<!--
************************************************************************
Douglas A4 Skyhawk simulation config. This files ties together
all the components used by FGFS to represent the A4. Components include
the flight data model, instrument panel, and external 3D model.

************************************************************************
-->

<PropertyList>
	<sim>

		<description>Douglas A4F Skyhawk (YASim)</description>
		<author>Lewis Magruder, Dean Baunton, Jim Wilson, Andy Ross, Vivian Meazza, Stuart Buchanan</author>
		<status>early-production</status>
		<long-description>The Douglas A-4 Skyhawk was a light naval attack aircraft,
			originally designed to deliver nuclear bombs from aircraft carriers.  In
			comparison with most other aircraft of the era, it was small and light.
			It served the US Navy in Vietnam, and subsequently was used at TOPGUN, and
			by the Blue Angels.  The A4-F was the final attack variant used by the
			US Navy, with an uprated engine, speedbrakes, ECM suite and various other
			improvements.
		</long-description>
		<rating>
			<FDM type="int">2</FDM>
			<systems type="int">1</systems>
			<cockpit type="int">4</cockpit>
			<model type="int">3</model>
		</rating>
		<virtual-cockpit archive="y">true</virtual-cockpit>

		<tags>
			<tag>bomber</tag>
			<tag>carrier</tag>
			<tag>douglas</tag>
			<tag>1960s</tag>
			<tag>1970s</tag>
			<tag>1980s</tag>
			<tag>coldwar</tag>
			<tag>vietnam</tag>
			<tag>retractable-gear</tag>
			<tag>refuel</tag>
			<tag>tail-hook</tag>
			<tag>tricycle</tag>
			<tag>jet</tag>
			<tag>single-engine</tag>
		</tags>

		<previews>
	    <preview>
	      <type>exterior</type>
	      <splash type="bool">true</splash>
	      <path>exterior1.jpg</path>
	    </preview>
	    <preview>
	      <type>exterior</type>
	      <splash type="bool">true</splash>
	      <path>exterior2.jpg</path>
	    </preview>
			<preview>
	      <type>exterior</type>
	      <splash type="bool">true</splash>
	      <path>exterior3.jpg</path>
	    </preview>
	    <preview>
	      <type>panel</type>
	      <splash type="bool">false</splash>
	      <path>cockpit.jpg</path>
	    </preview>
	  </previews>


		<flight-model>yasim</flight-model>
		<aero>a4f</aero>
		<fuel-fraction>0.5</fuel-fraction>

		<systems>
      <autopilot>
        <path>Aircraft/a4/Systems/autopilot.xml</path>
      </autopilot>

			<electrical>
				<path>Aircraft/a4/Systems/electrical.xml</path>
			</electrical>
		</systems>

		<sound>
			<path>Aircraft/a4/a4-sound.xml</path>
		</sound>

		<state include="States/take-off-overlay.xml" />
		<state include="States/carrier-take-off-overlay.xml" />
		<state include="States/cruise-overlay.xml" />
		<state include="States/carrier-landing-overlay.xml" />
		<state include="States/landing-overlay.xml" />

		<panel>
			<visibility>false</visibility>
		</panel>

		<instrumentation>
			<path>Aircraft/a4/Systems/instrumentation.xml</path>
		</instrumentation>

		<model>
			<path>Aircraft/a4/Models/a4f.xml</path>
      <fallback-model-index type="int">524</fallback-model-index>
		</model>

		<startup>
			<splash-texture>Aircraft/a4/splash.png</splash-texture>
		</startup>

		<submodels>
			<serviceable type="bool">true</serviceable>
			<path>Aircraft/a4/Models/Submodels/a4f-submodels.xml</path>
		</submodels>

		<view n="0">
			<internal archive="y">true</internal>
			<config>
				<x-offset-m archive="y">0.00</x-offset-m>
				<y-offset-m archive="y">0.9</y-offset-m>
				<z-offset-m archive="y">-2.52</z-offset-m>
				<pitch-offset-deg>-10</pitch-offset-deg>
				<default-field-of-view-deg>70.0</default-field-of-view-deg>
			</config>
		</view>

		<view n="1">
			<internal archive="y">false</internal>
			<config>
				<z-offset-m archive="y">10.00</z-offset-m>
			</config>
		</view>

		<view n="2">
			<internal archive="y">false</internal>
			<config>
				<z-offset-m archive="y">10.00</z-offset-m>
			</config>
		</view>

		<view n="3">
			<internal archive="y">false</internal>
			<config>
				<z-offset-m archive="y">10.00</z-offset-m>
			</config>
		</view>

		<view n="4">
			<internal archive="y">false</internal>
			<config>
				<z-offset-m archive="y">10.00</z-offset-m>
			</config>
		</view>

		<current-view>
			<field-of-view>70.0</field-of-view>
			<config>
			  <default-field-of-view-deg>70.0</default-field-of-view-deg>
			</config>
		</current-view>

		<aoa-indexer>
			<too-slow-deg>9</too-slow-deg>
			<slow-deg>8</slow-deg>
			<target-deg>7</target-deg>
			<fast-deg>6</fast-deg>
			<too-fast-deg>5</too-fast-deg>
		</aoa-indexer>

		<hud>
			<enable3d>false</enable3d>
		</hud>

		<weight n="0">
			<name>Left Outboard</name>
			<opt>
			  <name>NONE</name>
        <lbs>0</lbs>
      </opt>
			<opt>
			  <name>LAU-68</name>
			  <lbs>430</lbs>
      </opt>
			<selected>NONE</selected>
		</weight>

		<weight n="1">
			<name>Left Inboard</name>
      <tank>3</tank>
			<opt>
			  <name>NONE</name>
        <lbs>0</lbs>
      </opt>
			<opt>
			  <name>LAU-68</name>
			  <lbs>430</lbs>
      </opt>
			<opt>
			  <name>TER-MK82-LD</name>
			  <lbs>1644</lbs>
      </opt>
			<opt>
			  <name>DROP-300</name>
			  <lbs>207</lbs>
			  <gals>300</gals>
      </opt>
			<selected>NONE</selected>
		</weight>

		<weight n="2">
			<name>Center Pylon</name>
      <tank>4</tank>
			<opt>
			  <name>NONE</name>
        <lbs>0</lbs>
      </opt>
			<opt>
			  <name>LAU-68</name>
			  <lbs>430</lbs>
      </opt>
			<opt>
			  <name>TER-MK82-LD</name>
			  <lbs>1644</lbs>
      </opt>
			<opt>
			  <name>DROP-300</name>
			  <lbs>207</lbs>
			  <gals>300</gals>
      </opt>
			<selected>NONE</selected>
		</weight>

		<weight n="3">
		<name>Right Inboard</name>
			<max-lb>2250</max-lb>
      <tank>5</tank>
			<opt>
			  <name>NONE</name>
        <lbs>0</lbs>
      </opt>
			<opt>
			  <name>LAU-68</name>
			  <lbs>430</lbs>
      </opt>
			<opt>
			  <name>TER-MK82-LD</name>
			  <lbs>1644</lbs>
      </opt>
			<opt>
			  <name>DROP-300</name>
			  <lbs>207</lbs>
			  <gals>300</gals>
      </opt>
			<selected>NONE</selected>
		</weight>

		<weight n="4">
			<name>Right Outboard</name>
			<opt>
			  <name>NONE</name>
        <lbs>0</lbs>
      </opt>
			<opt>
			  <name>LAU-68</name>
			  <lbs>430</lbs>
      </opt>
			<selected>NONE</selected>
		</weight>

		<checklists include="Checklists/a4f-checklists.xml"/>

		<help>
			<title>Douglas A4F Skyhawk</title>
			<line>See Help-Checklists for checklists</line>

			<key>
				<name>a</name>
 				<desc>Toggle Approach Power Compensator</desc>
			</key>
			<key>
				<name>b</name>
				<desc>Trigger bomb</desc>
			</key>
			<key>
				<name>C</name>
				<desc>catapult launch command</desc>
			</key>
			<key>
				<name>L</name>
				<desc>carrier launch-bar engage</desc>
			</key>
			<key>
				<name>o/O</name>
				<desc>hook up/down</desc>
			</key>
			<key>
				<name>CTRL B</name>
				<desc>toggle airbrakes</desc>
			</key>
			<key>
				<name>k/j</name>
				<desc>Arm/Disarm auto-deploy spoilers</desc>
			</key>
			<key>
				<name>u/U</name>
				<desc>Seat up/down</desc>
			</key>
			<key>
				<name>Ctrl-u</name>
				<desc>Seat reset</desc>
			</key>
		</help>

    <menubar include="Dialogs/a4f-menu.xml"/>

	</sim>

	<autopilot>
		<config>
			<min-climb-speed-kt type="float">200.0</min-climb-speed-kt>
			<best-climb-speed-kt type="float">300.0</best-climb-speed-kt>
			<target-climb-rate-fpm type="float">3000.0</target-climb-rate-fpm>
			<target-descent-rate-fpm type="float">1500.0</target-descent-rate-fpm>
			<elevator-adj-factor type="float">5500.0</elevator-adj-factor>
			<integral-contribution type="float">0.007</integral-contribution>
			<zero-pitch-throttle type="float">0.60</zero-pitch-throttle>
			<zero-pitch-trim-full-throttle type="float">0.14</zero-pitch-trim-full-throttle>
			<max-roll-deg type="float">45</max-roll-deg>
			<max-aileron type="float">0.05</max-aileron>
		</config>
	</autopilot>

	<consumables>
		<fuel>
			<tank n="0">
				<name>Center</name>
				<level-gal_us>280</level-gal_us>
			</tank>
			<tank n="1">
				<name>Left Wing</name>
				<level-gal_us>260</level-gal_us>
			</tank>
			<tank n="2">
				<name>Right Wing</name>
				<level-gal_us>260</level-gal_us>
			</tank>
			<tank n="3">
				<name>Left Drop Tank</name>
				<level-gal_us>300</level-gal_us>
			</tank>
			<tank n="4">
				<name>Center Drop Tank</name>
				<level-gal_us>300</level-gal_us>
			</tank>
			<tank n="5">
				<name>Right Drop Tank</name>
				<level-gal_us>300</level-gal_us>
			</tank>
		</fuel>
	</consumables>

	<systems>
		<refuel>
			<type>probe</type>
			<offset-x-m>-0.57</offset-x-m>
			<offset-y-m>0.56</offset-y-m>
			<offset-z-m>0.13</offset-z-m>
		</refuel>
	</systems>

	<!-- *************** set properties **********************-->
	<controls>
		<armament>
			<master>false</master>
		</armament>
		<engines>
			<engine>
				<throttle>0</throttle>
				<apc type="bool">false</apc>
			</engine>
		</engines>
		<flight>
			<speedbrake type="bool">false</speedbrake>
			<spoilers-armed type="bool">false</spoilers-armed>
		</flight>
		<instrumentation>
		  <bhdi-mode type="int">0</bhdi-mode>
		  <drift-indicator-mode type="int">0</drift-indicator-mode>
		  <ins>
		    <!-- Inertial Navigation System -->
		    <mode type="int">1</mode>
		    <magvar-deg type="float">-3.0</magvar-deg>
		    <wind-speed-kts type="int">0</wind-speed-kts>
		    <wind-dir-deg type="int">0</wind-dir-deg>
		    <current-destination>
		      <latitude-deg>-34.67</latitude-deg>
		      <longitude-deg>-117.67</longitude-deg>
        </current-destination>
        <d1>
		      <latitude-deg userarchive="y">-34.67</latitude-deg>
		      <longitude-deg userarchive="y">-117.67</longitude-deg>
        </d1>
        <d2>
		      <latitude-deg userarchive="y">-34.67</latitude-deg>
		      <longitude-deg userarchive="y">-117.67</longitude-deg>
        </d2>
      </ins>

      <uhf>
        <preset-channel type="int" userarchive="y">0</preset-channel>
        <freq-select type="int">0</freq-select>
        <mode type="int">0</mode>
        <preset-channels>
          <channel n="0" userarchive="y">120.500</channel>
          <channel n="1" userarchive="y">118.850</channel>
          <channel n="2" userarchive="y">118.300</channel>
          <channel n="3" userarchive="y">133.775</channel>
          <channel n="4" userarchive="y">133.775</channel>
          <channel n="5" userarchive="y">133.775</channel>
          <channel n="6" userarchive="y">133.775</channel>
          <channel n="7" userarchive="y">133.775</channel>
          <channel n="8" userarchive="y">133.775</channel>
          <channel n="9" userarchive="y">133.775</channel>
          <channel n="10" userarchive="y">133.775</channel>
          <channel n="11" userarchive="y">133.775</channel>
          <channel n="12" userarchive="y">133.775</channel>
          <channel n="13" userarchive="y">133.775</channel>
          <channel n="14" userarchive="y">133.775</channel>
          <channel n="15" userarchive="y">133.775</channel>
          <channel n="16" userarchive="y">133.775</channel>
          <channel n="17" userarchive="y">133.775</channel>
          <channel n="18" userarchive="y">133.775</channel>
          <channel n="19" userarchive="y">133.775</channel>
        </preset-channels>
        <manual-channel userarchive="y">120.500</manual-channel>
      </uhf>
      <tacan-mode type="int">0</tacan-mode>
    </instrumentation>
    <radar>
      <mode type="int">0</mode>
      <orientation type="int">1</orientation>
      <range type="int">10</range>
      <reticle-norm>0.5</reticle-norm>
      <brightness-norm>0.4</brightness-norm>
    </radar>
    <steering>
      <steering-power type="bool">0</steering-power>
    </steering>
	</controls>

	<instrumentation>
	  <ins>
      <set-course-deg>0.0</set-course-deg>
      <set-dist-nm type="int">0</set-dist-nm>
	  </ins>
	  <g-meter>
	    <g-min>1.0</g-min>
	    <g-max>1.0</g-max>
    </g-meter>
	</instrumentation>


	<input>
		<keyboard include="Input/Keyboard/carrier-bindings.xml">
			<key n="97">
				<name>a</name>
				<desc>Toggle APC</desc>
				<binding>
					<command>property-toggle</command>
					<property>/controls/engines/engine[0]/apc</property>
				</binding>
			</key>

			<key n="98">
				<name>b</name>
				<desc>Trigger Bomb</desc>
				<binding>
					<command>property-assign</command>
					<property>/controls/armament/bomb</property>
					<value>1</value>
				</binding>
        <mod-up>
          <binding>
            <command>property-assign</command>
            <property>/controls/armament/bomb</property>
            <value>0</value>
          </binding>
        </mod-up>
			</key>

			<!-- map keys for seat vertical adjust -->
			<key n="21">
				<name>CTRL-U</name>
				<desc>Seat Default.</desc>
				<binding>
					<command>property-assign</command>
					<property>/controls/seat/vertical-adjust</property>
					<value type="double">0</value>
				</binding>
				<binding>
					<condition>
						<equals>
							<property>sim/current-view/view-number</property>
							<value>0</value>
						</equals>
					</condition>
					<command>property-assign</command>
					<property>sim/current-view/y-offset-m</property>
					<value type="double">0.9</value>
				</binding>
			</key>

			<key n="85">
				<name>U</name>
				<desc>Seat Down.</desc>
				<binding>
					<command>property-adjust</command>
					<property>/controls/seat/vertical-adjust</property>
					<step type="double">-0.01</step>
					<min type="double">-0.05</min>
					<max type="double">0.05</max>
				</binding>
				<binding>
					<condition>
						<equals>
							<property>sim/current-view/view-number</property>
							<value>0</value>
						</equals>
					</condition>
					<command>property-adjust</command>
					<property>sim/current-view/y-offset-m</property>
					<step type="double">-0.01</step>
					<min type="double">0.85</min>
					<max type="double">0.95</max>
				</binding>
			</key>

			<key n="117">
				<name>u</name>
				<desc>Seat Up.</desc>
				<binding>
					<command>property-adjust</command>
					<property>controls/seat/vertical-adjust</property>
					<step type="double">0.01</step>
					<min type="double">-0.05</min>
					<max type="double">0.05</max>
				</binding>
				<binding>
					<condition>
						<equals>
							<property>sim/current-view/view-number</property>
							<value>0</value>
						</equals>
					</condition>
					<command>property-adjust</command>
					<property>sim/current-view/y-offset-m</property>
					<step type="double">0.01</step>
					<min type="double">0.85</min>
					<max type="double">0.95</max>
				</binding>
			</key>

		</keyboard>
	</input>

	<!-- weights -->
	<yasim>
		<weights>
			<pilot-lb type="double">200</pilot-lb>
			<drag-chute type="double">0</drag-chute>
		</weights>
	</yasim>

	<armament>

	  <templates>
	    <NONE>
	      <weight-lb>0</weight-lb>
	      <rocket-count>0</rocket-count>
	      <rocket-load-mass-lb>0</rocket-load-mass-lb>
        <bomb-count>0</bomb-count>
        <bomb-load-mass-lb>0</bomb-load-mass-lb>
      </NONE>

	    <LAU-68>
        <weight-lb>430</weight-lb>
	      <!-- 19 rockets in pack -->
        <rocket-count>19</rocket-count>
        <rocket-load-mass-lb>18.5</rocket-load-mass-lb>
        <!-- using the bomb trigger drops the pack itself -->
        <bomb-count>1</bomb-count>
        <bomb-load-mass-lb>430</bomb-load-mass-lb>
      </LAU-68>

      <TER-MK82-LD>
        <weight-lb>1698</weight-lb>
        <rocket-count>0</rocket-count>
        <rocket-load-mass-lb>0</rocket-load-mass-lb>
        <bomb-count>3</bomb-count>
        <bomb-load-mass-lb>531</bomb-load-mass-lb>
      </TER-MK82-LD>

      <DROP-300>
        <!-- 6.8lb/gal, 2247lb total store mass: 2247 - (300 * 6.8) = 207lbs -->
        <weight-lb>207</weight-lb>
        <rocket-count>0</rocket-count>
        <rocket-load-mass-lb>0</rocket-load-mass-lb>
        <bomb-count>1</bomb-count>
        <bomb-load-mass-lb>207</bomb-load-mass-lb>
      </DROP-300>

	  </templates>
  </armament>

  <limits>
    <mass-and-balance>
      <maximum-takeoff-mass-lbs>24500</maximum-takeoff-mass-lbs>
      <maximum-landing-mass-lbs>16000</maximum-landing-mass-lbs>
      <maximum-arrested-landing-mass-lbs>14500</maximum-arrested-landing-mass-lbs>
    </mass-and-balance>
  </limits>

	<nasal>
    <radar>
      <file>Aircraft/a4/Nasal/radar.nas</file>
    </radar>
    <a4_instruments>
      <file>Aircraft/a4/Nasal/instruments.nas</file>
    </a4_instruments>
		<a4>
			<file>Aircraft/a4/Models/a4.nas</file>
		</a4>
		<a4-fuel>
			<file>Aircraft/Generic/aar.nas</file>
		</a4-fuel>
		<chronograph>
			<file>Aircraft/Instruments-3d/chronograph/chronograph.nas</file>
		</chronograph>
	</nasal>
</PropertyList>
