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

<PropertyList>

  <nasal>
    <load>
      <![CDATA[

      var nodeName = cmdarg().getPath();

      print("Loading PZL P37 ", 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                                  : 75,
            cruiseSpeed_kt                               : 200,
            attackSpeed_kt                               : 210,
            maxSpeed_kt                                  : 222,
            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_nose : {
              name                : "20 mm SUU 16 Machine Gun",
              maxDamage_percent   : 20,
              maxDamageDistance_m : 1500,
              weaponAngle_deg     : { heading: 0, elevation: 0 },
              weaponOffset_m      : { x:-6.451, y:0.000, z:0.714 },
              weaponSize_m        : { start: 0.1, end: 0.1 },
            },
            cannon_roof : {
              name                : "20 mm SUU 16 Machine Gun",
              maxDamage_percent   : 20,
              maxDamageDistance_m : 1500,
              weaponAngle_deg     : { heading: 180, elevation: 5 },
              weaponOffset_m      : { x:1.039, y:0.000, z:1.594 },
              weaponSize_m        : { start: 0.1, end: 0.1 },
            },
            cannon_tail : {
              name                : "20 mm SUU 16 Machine Gun",
              maxDamage_percent   : 20,
              maxDamageDistance_m : 1500,
              weaponAngle_deg     : { heading: 180, elevation: -20 },
              weaponOffset_m      : { x:2.120, y:0.000, z:0.059 },
              weaponSize_m        : { start: 0.1, end: 0.1 },
            },
          },
          dimensions : {
            width_m             : 17.93,
            length_m            : 12.92,
            height_m            : 5.10,
            damageRadius_m      : 9,
            vitalDamageRadius_m : 2,
            crashRadius_m       : 6,
          },
          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("pistonexhaust", thisNodeName );
      }
      object_init();
      ]]>
    </load>
    <unload>
      <![CDATA[
        print("Unload PZL P37.");
        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>
