<?xml version="1.0" encoding="ISO-8859-1"?>

<PropertyList>

  <nasal>
    <load>
      <![CDATA[

      var nodeName = cmdarg().getPath();

      print("Loading MB 339 ", nodeName);

      if ( bombable.check_overall_initialized (nodeName) ) {
        return;
      }

      var object_init = func() {
        thisNodeName = cmdarg().getPath();

        var bombableObject = {

          objectNodeName : thisNodeName,
          objectNode     : props.globals.getNode(thisNodeName),
          updateTime_s   : 1/3,
          altitudes : {
            wheelsOnGroundAGL_m : 1,
            minimumAGL_m        : 100,
            maximumAGL_m        : 13715,
            crashedAGL_m        : 0.6,
          },
          velocities : {
            maxSpeedReduce_percent                       : 0.5,
            minSpeed_kt                                  : 115,
            cruiseSpeed_kt                               : 400,
            attackSpeed_kt                               : 450,
            maxSpeed_kt                                  : 485,
            damagedAltitudeChangeMaxRate_meterspersecond : 30,

            diveTerminalVelocities: {
              point1: { airspeed_kt : 377, vertical_speed_fps : -41.8},
              point2: { airspeed_kt : 416, vertical_speed_fps : -87.2},
              point3: { airspeed_kt : 430, vertical_speed_fps : -188.8},
              point4: { airspeed_kt : 547, vertical_speed_fps : -302},
            },
            climbTerminalVelocities: {
              point1: { airspeed_kt : 344, vertical_speed_fps : 27.6},
              point2: { airspeed_kt : 314, vertical_speed_fps : 52.6},
              point3: { airspeed_kt : 297, vertical_speed_fps : 88},
              point4: { airspeed_kt : 252, vertical_speed_fps : 88},
            },
          },
          evasions : {
            dodgeDelayMax_sec             : 15,
            dodgeDelayMin_sec             : 5,
            dodgeMax_deg                  : 79,
            dodgeMin_deg                  : 58,
            rollRateMax_degpersec         : 65,
            dodgeROverLPreference_percent : 50,
            dodgeAltMax_m                 : 5000,
            dodgeAltMin_m                 : -5000,
            dodgeVertSpeedClimb_mps       : 80,
            dodgeVertSpeedDive_mps        : 160,
          },
          attacks : {
            maxDistance_m              : 20000,
            minDistance_m              : 1600,
            continueAttackAngle_deg    : 80,
            altitudeHigherCutoff_m     : 15000,
            altitudeLowerCutoff_m      : 10000,
            rollMin_deg                : 58,
            rollMax_deg                : 79,
            rollRateMax_degpersec      : 65,
            climbPower                 : 4500,
            divePower                  : 9000,
            attackCheckTime_sec        : 6,
            attackCheckTimeEngaged_sec : 0.6,
          },
          weapons : {
            cannon_left : {
              name                : "30 mm Machine Gun",
              maxDamage_percent   : 25,
              maxDamageDistance_m : 1500,
              weaponAngle_deg     : { heading: 0, elevation: 0 },
              weaponOffset_m      : { x:-2.091, y:-2.777, z:-1.087 },
              weaponSize_m        : { start:0.1, end:0.1 },
            },
            cannon_right : {
              name                : "30 mm Machine Gun",
              maxDamage_percent   : 25,
              maxDamageDistance_m : 1500,
              weaponAngle_deg     : { heading: 0, elevation: 0 },
              weaponOffset_m      : { x:-2.091, y:2.777, z:-1.087 },
              weaponSize_m        : { start:0.1, end:0.1 },
            },
          },
          dimensions : {
            width_m             : 10.86,
            length_m            : 10.97,
            height_m            : 3.60,
            damageRadius_m      : 2.25,
            vitalDamageRadius_m : 1,
          },
          vulnerabilities : {
            damageVulnerability               : 45,
            engineDamageVulnerability_percent : 4,
            fireVulnerability_percent         : 5,
            fireDamageRate_percentpersecond   : 0.2,
            fireExtinguishMaxTime_seconds     : 50,
            fireExtinguishSuccess_percentage  : 50,
            explosiveMass_kg                  : 40772 ,
          },
          damageLiveries : {
            damageLivery : [  ]
          },
        };
        bombable.initialize ( bombableObject );
        # bombable.location_init ( thisNodeName );
        bombable.ground_init ( thisNodeName );
        bombable.bombable_init ( thisNodeName );
        bombable.attack_init ( thisNodeName );
        bombable.weapons_init ( thisNodeName );
        bombable.startSmoke("jetcontrail", thisNodeName );
      }
      object_init();
      ]]>
    </load>
    <unload>
      <![CDATA[
        print("Unload MB 339.");
        var nodeName= cmdarg().getPath();
        bombable.de_overall_initialize( nodeName );
        bombable.initialize_del( nodeName );
        bombable.ground_del( nodeName );
        bombable.location_del (nodeName);
        bombable.bombable_del( nodeName );
        bombable.attack_del( nodeName );
        bombable.weapons_del (nodeName);
      ]]>
    </unload>
  </nasal>

</PropertyList>
