home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / games / sail / globals.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-08  |  20.2 KB  |  508 lines

  1. /*
  2.  * Copyright (c) 1983 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  */
  33.  
  34. #ifndef lint
  35. static char sccsid[] = "@(#)globals.c    5.4 (Berkeley) 6/1/90";
  36. #endif /* not lint */
  37.  
  38. #include "externs.h"
  39.  
  40. struct scenario scene[] = {
  41.     /*
  42.      * int winddir;
  43.      * int windspeed;
  44.      * int windchange;
  45.      * int vessels;
  46.      * char *name;
  47.      * struct ship ship[NSHIP];
  48.      */
  49.     5, 3, 5, 2, "Ranger vs. Drake",
  50.     {
  51.         { "Ranger",        specs+0,  N_A,  7, 20, 4, 0 },
  52.         { "Drake",        specs+1,  N_B,  7, 31, 5, 0 }
  53.     },
  54.     1, 3, 6, 2, "The Battle of Flamborough Head",
  55.     {
  56.         { "Bonhomme Rich",    specs+2,  N_A, 13, 40, 2, 0 },
  57.         { "Serapis",        specs+3,  N_B,  2, 42, 2, 0 }
  58.     },
  59.     5, 5, 5, 10, "Arbuthnot and Des Touches",
  60.     {
  61.         { "America",        specs+4,  N_B,  7, 37, 4, 0 },
  62.         { "Befford",        specs+5,  N_B,  5, 35, 4, 0 },
  63.         { "Adamant",        specs+6,  N_B,  3, 33, 4, 0 },
  64.         { "London",        specs+7,  N_B,  1, 31, 4, 0 },
  65.         { "Royal Oak",        specs+8,  N_B, -1, 29, 4, 0 },
  66.         { "Neptune",        specs+9,  N_F,  6, 44, 4, 0 },
  67.         { "Duc Bougogne",    specs+10, N_F,  8, 46, 4, 0 },
  68.         { "Conquerant",        specs+48, N_F, 10, 48, 4, 0 },
  69.         { "Provence",        specs+11, N_F, 12, 50, 4, 0 },
  70.         { "Romulus",        specs+12, N_F, 20, 58, 4, 0 }
  71.     },
  72.     1, 3, 5, 10, "Suffren and Hughes",
  73.     {
  74.         { "Monmouth",        specs+52, N_B,  9, 45, 2, 0 },
  75.         { "Hero",        specs+5,  N_B, 13, 49, 2, 0 },
  76.         { "Isis",        specs+6,  N_B, 12, 48, 2, 0 },
  77.         { "Superb",        specs+50, N_B, 10, 46, 2, 0 },
  78.         { "Burford",        specs+48, N_B, 11, 47, 2, 0 },
  79.         { "Flamband",        specs+13, N_F,  7, 59, 4, 0 },
  80.         { "Annibal",        specs+9,  N_F,  4, 56, 4, 0 },
  81.         { "Severe",        specs+11, N_F,  2, 54, 4, 0 },
  82.         { "Brilliant",        specs+49, N_F, -1, 51, 4, 0 },
  83.         { "Sphinx",        specs+51, N_F, -5, 47, 4, 0 }
  84.     },
  85.     1, 3, 4, 2, "Nymphe vs. Cleopatre",
  86.     {
  87.         { "Nymphe",        specs+14, N_B, 13, 30, 2, 0 },
  88.         { "Cleopatre",        specs+15, N_F,  3, 41, 2, 0 }
  89.     },
  90.     1, 3, 5, 2, "Mars vs. Hercule",
  91.     {
  92.         { "Mars",        specs+16, N_B, 13, 30, 2, 0 },
  93.         { "Hercule",        specs+17, N_F,  3, 41, 2, 0 }
  94.     },
  95.     5, 3, 5, 2, "Ambuscade vs. Baionnaise",
  96.     {
  97.         { "Ambuscade",        specs+18, N_B, 13, 30, 2, 0 },
  98.         { "Baionnaise",        specs+19, N_F,  3, 41, 2, 0 }
  99.     },
  100.     1, 5, 6, 2, "Constellation vs. Insurgent",
  101.     {
  102.         { "Constellation",    specs+20, N_A,  9, 50, 8, 0 },
  103.         { "Insurgent",        specs+22, N_F,  4, 24, 2, 0 }
  104.     },
  105.     1, 3, 5, 2, "Constellation vs. Vengeance",
  106.     {
  107.         { "Constellation",    specs+20, N_A, 12, 40, 2, 0 },
  108.         { "Vengeance",        specs+21, N_F,  1, 43, 2, 0 }
  109.     },
  110.     1, 3, 6, 10, "The Battle of Lissa",
  111.     {
  112.         { "Amphion",        specs+23, N_B,  8, 50, 4, 0 },
  113.         { "Active",        specs+24, N_B,  6, 48, 4, 0 },
  114.         { "Volage",        specs+25, N_B,  4, 46, 4, 0 },
  115.         { "Cerberus",        specs+26, N_B,  2, 44, 4, 0 },
  116.         { "Favorite",        specs+27, N_F,  9, 34, 2, 0 },
  117.         { "Flore",        specs+21, N_F, 13, 39, 2, 0 },
  118.         { "Danae",        specs+64, N_F, 15, 37, 2, 0 },
  119.         { "Bellona",        specs+28, N_F, 17, 35, 2, 0 },
  120.         { "Corona",        specs+29, N_F, 12, 31, 2, 0 },
  121.         { "Carolina",        specs+30, N_F, 15, 28, 2, 0 }
  122.     },
  123.     2, 5, 6, 2, "Constitution vs. Guerriere",
  124.     {
  125.         { "Constitution",    specs+31, N_A,  7, 35, 1, 0 },
  126.         { "Guerriere",        specs+32, N_B,  7, 47, 4, 0 }
  127.     },
  128.     1, 3, 5, 2, "United States vs. Macedonian",
  129.     {
  130.         { "United States",    specs+33, N_A,  1, 52, 6, 0 },
  131.         { "Macedonian",        specs+34, N_B, 14, 40, 1, 0 }
  132.     },
  133.     1, 3, 6, 2, "Constitution vs. Java",
  134.     {
  135.         { "Constitution",    specs+31, N_A,  1, 40, 2, 0 },
  136.         { "Java",        specs+35, N_B, 11, 40, 2, 0 }
  137.     },
  138.     1, 3, 5, 2, "Chesapeake vs. Shannon",
  139.     {
  140.         { "Chesapeake",        specs+36, N_A, 13, 40, 2, 0 },
  141.         { "Shannon",        specs+37, N_B,  1, 42, 2, 0 }
  142.     },
  143.     1, 1, 6, 5, "The Battle of Lake Erie",
  144.     {
  145.         { "Lawrence",        specs+38, N_A,  4, 55, 8, 0 },
  146.         { "Niagara",        specs+42, N_A,  7, 61, 8, 0 },
  147.         { "Lady Prevost",    specs+39, N_B,  4, 25, 2, 0 },
  148.         { "Detroit",        specs+40, N_B,  7, 22, 2, 0 },
  149.         { "Q. Charlotte",    specs+41, N_B, 10, 19, 2, 0 }
  150.     },
  151.     1, 1, 5, 2, "Wasp vs. Reindeer",
  152.     {
  153.         { "Wasp",        specs+42, N_A,  3, 41, 2, 0 },
  154.         { "Reindeer",        specs+43, N_B, 10, 48, 2, 0 }
  155.     },
  156.     1, 2, 5, 3, "Constitution vs. Cyane and Levant",
  157.     {
  158.         { "Constitution",    specs+31, N_A, 10, 45, 2, 0 },
  159.         { "Cyane",        specs+44, N_B,  3, 37, 2, 0 },
  160.         { "Levant",        specs+45, N_B,  5, 35, 2, 0 }
  161.     },
  162.     5, 5, 5, 3, "Pellew vs. Droits de L'Homme",
  163.     {
  164.         { "Indefatigable",    specs+46, N_B, 12, 45, 6, 0 },
  165.         { "Amazon",        specs+47, N_B,  9, 48, 6, 0 },
  166.         { "Droits L'Hom",    specs+48, N_F,  3, 28, 5, 0 }
  167.     },
  168.     2, 2, 3, 10, "Algeciras",
  169.     {
  170.         { "Caesar",        specs+49, N_B,  7, 70, 6, 0 },
  171.         { "Pompee",        specs+50, N_B,  5, 72, 6, 0 },
  172.         { "Spencer",        specs+5,  N_B,  3, 74, 6, 0 },
  173.         { "Hannibal",        specs+7,  N_B,  1, 76, 6, 0 },
  174.         { "Real-Carlos",    specs+53, N_S,  9, 20, 3, 0 },
  175.         { "San Fernando",    specs+54, N_S, 11, 16, 3, 0 },
  176.         { "Argonauta",        specs+55, N_S, 10, 14, 4, 0 },
  177.         { "San Augustine",    specs+56, N_S,  6, 22, 4, 0 },
  178.         { "Indomptable",    specs+51, N_F,  7, 23, 5, 0 },
  179.         { "Desaix",        specs+52, N_F,  7, 27, 7, 0 }
  180.     },
  181.     5, 3, 6, 7, "Lake Champlain",
  182.     {
  183.         { "Saratoga",        specs+60, N_A,  8, 10, 1, 0 },
  184.         { "Eagle",        specs+61, N_A,  9, 13, 2, 0 },
  185.         { "Ticonderoga",    specs+62, N_A, 12, 17, 3, 0 },
  186.         { "Preble",        specs+63, N_A, 14, 20, 2, 0 },
  187.         { "Confiance",        specs+57, N_B,  4, 70, 6, 0 },
  188.         { "Linnet",        specs+58, N_B,  7, 68, 6, 0 },
  189.         { "Chubb",        specs+59, N_B, 10, 65, 6, 0 }
  190.     },
  191.     5, 3, 6, 4, "Last Voyage of the USS President",
  192.     {
  193.         { "President",        specs+67, N_A, 12, 42, 5, 0 },
  194.         { "Endymion",        specs+64, N_B,  5, 42, 5, 0 },
  195.         { "Pomone",        specs+65, N_B,  7, 82, 6, 0 },
  196.         { "Tenedos",        specs+66, N_B,  7, -1, 4, 0 }
  197.     },
  198.     7, 5, 5, 2, "Hornblower and the Natividad",
  199.     {
  200.         { "Lydia",        specs+68, N_B, 12, 40, 2, 0 },
  201.         { "Natividad",        specs+69, N_S,  2, 40, 4, 0 }
  202.     },
  203.     1, 3, 6, 2, "Curse of the Flying Dutchman",
  204.     {
  205.         { "Piece of Cake",    specs+19, N_S,  7, 40, 2, 0 },
  206.         { "Flying Dutchy",    specs+71, N_F,  7, 41, 1, 0 }
  207.     },
  208.     1, 4, 1, 4, "The South Pacific",
  209.     {
  210.         { "USS Scurvy",        specs+70, N_A,  7, 40, 1, 0 },
  211.         { "HMS Tahiti",        specs+71, N_B, 12, 60, 1, 0 },
  212.         { "Australian",        specs+18, N_S,  5, 20, 8, 0 },
  213.         { "Bikini Atoll",    specs+63, N_F,  2, 60, 4, 0 }
  214.     },
  215.     7, 3, 6, 5, "Hornblower and the battle of Rosas bay",
  216.     {
  217.         { "Sutherland",        specs+5,  N_B, 13, 30, 2, 0 },
  218.         { "Turenne",        specs+10, N_F,  9, 35, 6, 0 },
  219.         { "Nightmare",        specs+9,  N_F,  7, 37, 6, 0 },
  220.         { "Paris",        specs+53, N_F,  3, 45, 4, 0 },
  221.         { "Napolean",        specs+56, N_F,  1, 40, 6, 0 }
  222.     },
  223.     6, 4, 7, 5, "Cape Horn",
  224.     {
  225.         { "Concord",        specs+51, N_A,  3, 20, 4, 0 },
  226.         { "Berkeley",        specs+7,  N_A,  5, 50, 5, 0 },
  227.         { "Thames",        specs+71, N_B, 10, 40, 1, 0 },
  228.         { "Madrid",        specs+53, N_S, 13, 60, 8, 0 },
  229.         { "Musket",        specs+10, N_F, 10, 60, 7, 0 }
  230.     },
  231.     8, 3, 7, 3, "New Orleans",
  232.     {
  233.         { "Alligator",        specs+71, N_A, 13,  5, 1, 0 },
  234.         { "Firefly",        specs+50, N_B, 10, 20, 8, 0 },
  235.         { "Cypress",        specs+46, N_B,  5, 10, 6, 0 }
  236.     },
  237.     5, 3, 7, 3, "Botany Bay",
  238.     {
  239.         { "Shark",        specs+11, N_B,  6, 15, 4, 0 },
  240.         { "Coral Snake",    specs+31, N_F,  3, 30, 6, 0 },
  241.         { "Sea Lion",        specs+33, N_F, 13, 50, 8, 0 }
  242.     },
  243.     4, 3, 6, 4, "Voyage to the Bottom of the Sea",
  244.     {
  245.         { "Seaview",        specs+71, N_A,  6, 3,  3, 0 },
  246.         { "Flying Sub",        specs+64, N_A,  8, 3,  3, 0 },
  247.         { "Mermaid",        specs+70, N_B,  2, 5,  5, 0 },
  248.         { "Giant Squid",    specs+53, N_S, 10, 30, 8, 0 }
  249.     },
  250.     7, 3, 6, 3, "Frigate Action",
  251.     {
  252.         { "Killdeer",        specs+21, N_A,  7, 20, 8, 0 },
  253.         { "Sandpiper",        specs+27, N_B,  5, 40, 8, 0 },
  254.         { "Curlew",        specs+34, N_S, 10, 60, 8, 0 }
  255.     },
  256.     7, 2, 5, 6, "The Battle of Midway",
  257.     {
  258.         { "Enterprise",        specs+49, N_A, 10, 70, 8, 0 },
  259.         { "Yorktown",        specs+51, N_A,  3, 70, 7, 0 },
  260.         { "Hornet",        specs+52, N_A,  6, 70, 7, 0 },
  261.         { "Akagi",        specs+53, N_J,  6, 10, 4, 0 },
  262.         { "Kaga",        specs+54, N_J,  4, 12, 4, 0 },
  263.         { "Soryu",        specs+55, N_J,  2, 14, 4, 0 }
  264.     },
  265.     1, 3, 4, 8, "Star Trek",
  266.     {
  267.         { "Enterprise",        specs+76, N_D,-10, 60, 7, 0 },
  268.         { "Yorktown",        specs+77, N_D,  0, 70, 7, 0 },
  269.         { "Reliant",        specs+78, N_D, 10, 70, 7, 0 },
  270.         { "Galileo",        specs+79, N_D, 20, 60, 7, 0 },
  271.         { "Kobayashi Maru",    specs+80, N_K,  0,120, 7, 0 },
  272.         { "Klingon II",        specs+81, N_K, 10,120, 7, 0 },
  273.         { "Red Orion",        specs+82, N_O,  0,  0, 3, 0 },
  274.         { "Blue Orion",        specs+83, N_O, 10,  0, 3, 0 }
  275.     }
  276. };
  277. int nscene = sizeof scene / sizeof (struct scenario);
  278.  
  279. struct shipspecs specs[] = {
  280. /*      bs fs ta guns   hull  crew1   crew3    gunR  carR   rig2  rig4 pts */
  281. /*                 class   qual   crew2    gunL   carL   rig1  rig3        */
  282. /*00*/    4, 7, 3,  19, 5,  5, 4,  2,  2,  2,  2,  2, 0, 0,  4, 4, 4,  4,  7,
  283. /*01*/    4, 7, 3,  17, 5,  5, 4,  2,  2,  2,  0,  0, 4, 4,  3, 3, 3,  3,  6,
  284. /*02*/    3, 5, 2,  42, 4,  7, 4,  2,  2,  2,  2,  2, 0, 0,  5, 5, 5, -1, 11,
  285. /*03*/    4, 6, 3,  44, 3,  7, 4,  2,  2,  2,  3,  3, 0, 0,  5, 5, 5,  5, 12,
  286. /*04*/    3, 5, 2,  64, 2, 17, 4,  8,  6,  6, 12, 12, 2, 2,  7, 7, 7, -1, 20,
  287. /*05*/    3, 5, 2,  74, 2, 20, 4,  8,  8,  8, 16, 16, 2, 2,  7, 7, 7, -1, 26,
  288. /*06*/    3, 5, 2,  50, 2, 12, 4,  6,  4,  4,  8,  8, 2, 2,  6, 6, 6, -1, 17,
  289. /*07*/    3, 5, 1,  98, 1, 23, 4, 10, 10, 10, 18, 18, 2, 2,  8, 8, 8, -1, 28,
  290. /*08*/    3, 5, 2,  74, 2, 20, 4,  8,  8,  8, 16, 16, 2, 2,  7, 7, 7, -1, 26,
  291. /*09*/    3, 5, 2,  74, 2, 21, 3, 10, 10,  8, 20, 20, 0, 0,  7, 7, 7, -1, 24,
  292. /*10*/    3, 5, 1,  80, 1, 23, 3, 12, 12, 10, 22, 22, 0, 0,  7, 7, 7, -1, 27,
  293. /*11*/    3, 5, 2,  64, 2, 18, 3,  8,  8,  6, 12, 12, 0, 0,  7, 7, 7, -1, 18,
  294. /*12*/    3, 5, 2,  44, 2, 11, 3,  4,  4,  4,  6,  6, 2, 2,  5, 5, 5, -1, 10,
  295. /*13*/    3, 5, 2,  50, 2, 14, 3,  6,  6,  4,  8,  8, 0, 0,  6, 6, 6, -1, 14,
  296. /*14*/    4, 6, 3,  36, 3, 11, 4,  4,  4,  2,  4,  4, 2, 2,  5, 5, 5,  5, 11,
  297. /*15*/    4, 6, 3,  36, 3, 11, 3,  4,  4,  4,  4,  4, 2, 2,  5, 5, 5,  5, 10,
  298. /*16*/    3, 5, 2,  74, 2, 21, 4, 10,  8,  8, 18, 18, 2, 2,  7, 7, 7, -1, 26,
  299. /*17*/    3, 5, 2,  74, 2, 21, 3, 10, 10,  8, 20, 20, 2, 2,  7, 7, 7, -1, 23,
  300. /*18*/    4, 6, 3,  32, 3,  8, 3,  4,  2,  2,  4,  4, 2, 2,  5, 5, 5,  5,  9,
  301. /*19*/    4, 6, 3,  24, 4,  6, 3,  4,  4,  4,  2,  2, 0, 0,  4, 4, 4,  4,  9,
  302. /*20*/    4, 7, 3,  38, 4, 14, 5,  6,  4,  4,  4,  4, 6, 6,  5, 5, 5,  5, 17,
  303. /*21*/    4, 6, 3,  40, 3, 15, 3,  8,  6,  6,  6,  6, 4, 4,  5, 5, 5,  5, 15,
  304. /*22*/    4, 7, 3,  36, 4, 11, 3,  6,  6,  4,  4,  4, 2, 2,  5, 5, 5,  5, 11,
  305. /*23*/    4, 6, 3,  32, 3, 11, 5,  4,  4,  2,  4,  4, 2, 2,  5, 5, 5,  5, 13,
  306. /*24*/    4, 6, 3,  38, 3, 14, 5,  4,  4,  4,  6,  6, 4, 4,  5, 5, 5,  5, 18,
  307. /*25*/    4, 6, 3,  22, 3,  6, 5,  2,  2,  2,  0,  0, 8, 8,  4, 4, 4,  4, 11,
  308. /*26*/    4, 6, 3,  32, 3, 11, 5,  4,  4,  2,  4,  4, 2, 2,  5, 5, 5,  5, 13,
  309. /*27*/    4, 6, 3,  40, 3, 14, 3,  6,  6,  4,  6,  6, 4, 4,  5, 5, 5,  5, 15,
  310. /*28*/    4, 6, 3,  32, 3, 11, 2,  4,  4,  4,  4,  4, 0, 0,  5, 5, 5,  5,  9,
  311. /*29*/    4, 6, 3,  40, 3, 14, 2,  6,  6,  4,  6,  6, 4, 4,  5, 5, 5,  5, 12,
  312. /*30*/    4, 6, 3,  32, 3,  8, 2,  4,  4,  1,  2,  2, 0, 0,  4, 4, 4,  4,  7,
  313. /*31*/    4, 7, 3,  44, 4, 18, 5,  6,  6,  6,  8,  8, 6, 6,  6, 6, 6,  6, 24,
  314. /*32*/    4, 6, 3,  38, 3, 14, 4,  4,  4,  2,  6,  6, 4, 4,  5, 5, 5,  5, 15,
  315. /*33*/    4, 5, 3,  44, 3, 18, 5,  8,  6,  6,  8,  8, 8, 8,  6, 6, 6,  6, 24,
  316. /*34*/    4, 6, 3,  38, 3, 14, 4,  4,  4,  4,  6,  6, 4, 4,  5, 5, 5,  5, 16,
  317. /*35*/    4, 7, 3,  38, 4, 14, 4,  6,  6,  6,  6,  6, 6, 6,  5, 5, 5,  5, 19,
  318. /*36*/    4, 6, 3,  38, 3, 14, 3,  6,  6,  4,  6,  6, 6, 6,  5, 5, 5,  5, 14,
  319. /*37*/    4, 6, 3,  38, 3, 14, 5,  6,  4,  4,  6,  6, 6, 6,  5, 5, 5,  5, 17,
  320. /*38*/    4, 7, 3,  20, 5,  6, 4,  4,  2,  2,  0,  0, 6, 6,  4, 4, 4,  4,  9,
  321. /*39*/    4, 7, 3,  13, 6,  3, 4,  0,  2,  2,  0,  0, 2, 2,  2, 2, 2,  2,  5,
  322. /*40*/    4, 7, 3,  19, 5,  5, 4,  2,  2,  2,  2,  2, 0, 0,  4, 4, 4,  4,  7,
  323. /*41*/    4, 7, 3,  17, 5,  5, 4,  2,  2,  2,  2,  2, 0, 0,  3, 3, 3,  3,  6,
  324. /*42*/    4, 7, 3,  20, 5,  6, 5,  4,  2,  2,  0,  0, 6, 6,  4, 4, 4,  4, 12,
  325. /*43*/    4, 7, 3,  18, 5,  5, 5,  2,  2,  2,  0,  0, 6, 6,  4, 4, 4,  4,  9,
  326. /*44*/    4, 7, 3,  24, 5,  6, 4,  4,  2,  2,  0,  0,10,10,  4, 4, 4,  4, 11,
  327. /*45*/    4, 7, 3,  20, 5,  6, 4,  2,  2,  2,  0,  0, 8, 8,  4, 4, 4,  4, 10,
  328. /*46*/    4, 6, 3,  44, 3, 11, 5,  4,  4,  4,  4,  4, 2, 2,  5, 5, 5,  5, 14,
  329. /*47*/    4, 6, 3,  36, 3, 12, 4,  4,  4,  4,  6,  6, 2, 2,  5, 5, 5,  5, 14,
  330. /*48*/    3, 5, 2,  74, 2, 21, 3, 10,  8,  8, 20, 20, 2, 2,  4, 4, 7, -1, 24,
  331. /*49*/    3, 5, 2,  80, 2, 24, 4, 10,  8,  8, 20, 20, 2, 2,  8, 8, 8, -1, 31,
  332. /*50*/    3, 5, 2,  74, 2, 21, 4,  8,  8,  6, 16, 16, 4, 4,  7, 7, 7, -1, 27,
  333. /*51*/    3, 5, 2,  80, 2, 24, 3, 12, 12, 10, 22, 22, 2, 2,  7, 7, 7, -1, 27,
  334. /*52*/    3, 5, 2,  74, 2, 21, 3, 10, 10,  8, 20, 20, 2, 2,  7, 7, 7, -1, 24,
  335. /*53*/    3, 5, 1, 112, 1, 27, 2, 12, 12, 12, 24, 24, 0, 0,  9, 9, 9, -1, 27,
  336. /*54*/    3, 5, 1,  96, 1, 24, 2, 12, 12, 10, 20, 20, 0, 0,  8, 8, 8, -1, 24,
  337. /*55*/    3, 5, 2,  80, 2, 23, 2, 10, 10,  8, 20, 20, 0, 0,  7, 7, 7, -1, 23,
  338. /*56*/    3, 5, 2,  74, 2, 21, 2, 10,  8,  8, 16, 16, 4, 4,  7, 7, 7, -1, 20,
  339. /*57*/    4, 6, 3,  37, 3, 12, 4,  4,  4,  2,  6,  6, 4, 4,  5, 5, 5,  5, 14,
  340. /*58*/    4, 7, 3,  16, 5,  5, 5,  2,  2,  2,  0,  0, 4, 4,  4, 4, 4,  4, 10,
  341. /*59*/    4, 7, 3,  11, 6,  3, 4,  2,  2,  2,  0,  0, 2, 2,  2, 2, 2,  2,  5,
  342. /*60*/    4, 7, 3,  26, 5,  6, 4,  4,  2,  2,  2,  2, 6, 6,  4, 4, 4,  4, 12,
  343. /*61*/    4, 7, 3,  20, 5,  6, 4,  4,  2,  2,  0,  0, 6, 6,  4, 4, 4,  4, 11,
  344. /*62*/    4, 7, 3,  17, 5,  5, 4,  2,  2,  2,  0,  0, 6, 6,  4, 4, 4,  4,  9,
  345. /*63*/    4, 7, 3,   7, 6,  3, 4,  0,  2,  2,  0,  0, 2, 2,  2, 2, 2,  2,  4,
  346. /*64*/    4, 6, 3,  40, 3, 15, 4,  4,  4,  4,  8,  8, 6, 6,  5, 5, 5,  5, 17,
  347. /*65*/    4, 6, 3,  44, 3, 15, 4,  8,  8,  6, 10, 10, 2, 2,  6, 6, 6,  6, 20,
  348. /*66*/    4, 6, 3,  38, 3, 14, 4,  4,  4,  4,  6,  6, 6, 6,  5, 5, 5,  5, 15,
  349. /*67*/    4, 5, 3,  44, 3, 18, 5,  8,  6,  6,  8,  8, 8, 8,  6, 6, 6,  6, 24,
  350. /*68*/    4, 6, 3,  36, 3,  9, 5,  4,  4,  2,  4,  4, 2, 2,  5, 5, 5,  5, 13,
  351. /*69*/    3, 5, 2,  50, 2, 14, 2,  6,  6,  6,  8,  8, 0, 0,  6, 6, 6, -1, 14,
  352. /*70*/    3, 5, 1, 136, 1, 30, 1,  8, 14, 14, 28, 28, 0, 0,  9, 9, 9, -1, 27,
  353. /*71*/    3, 5, 1, 120, 1, 27, 5, 16, 14, 14, 28, 28, 2, 2,  9, 9, 9, -1, 43,
  354. /*72*/    3, 5, 1, 120, 2, 21, 5, 15, 17, 15, 25, 25, 7, 7,  9, 9, 9, -1, 36,
  355. /*73*/    3, 5, 1,  90, 3, 18, 4, 13, 15, 13, 20, 20, 6, 6,  5, 5, 5,  5, 28,
  356. /*74*/    4, 7, 3,   6, 6,  3, 4,  2,  2,  2, 20, 20, 6, 6,  2, 2, 3,  3,  5,
  357. /*75*/    3, 5, 1, 110, 2, 20, 4, 14, 15, 11, 26, 26, 8, 8,  7, 8, 9, -1, 34,
  358. /*76*/    4, 7, 3, 450, 1, 99, 5, 50, 40, 40, 50, 50,25,25,  9, 9, 9, -1, 75,
  359. /*77*/    4, 7, 3, 450, 1, 99, 5, 50, 40, 40, 50, 50,25,25,  9, 9, 9, -1, 75,
  360. /*78*/    4, 7, 3, 450, 1, 99, 5, 50, 40, 40, 50, 50,25,25,  9, 9, 9, -1, 75,
  361. /*79*/    4, 7, 3, 450, 1, 99, 5, 50, 40, 40, 50, 50,25,25,  9, 9, 9, -1, 75,
  362. /*80*/    4, 7, 3, 450, 1, 99, 5, 50, 40, 40, 50, 50,25,25,  9, 9, 9, -1, 75,
  363. /*81*/    4, 7, 3, 450, 1, 99, 5, 50, 40, 40, 50, 50,25,25,  9, 9, 9, -1, 75,
  364. /*82*/    4, 7, 3, 450, 1, 99, 5, 50, 40, 40, 50, 50,25,25,  9, 9, 9, -1, 75,
  365. /*83*/    4, 7, 3, 450, 1, 99, 5, 50, 40, 40, 50, 50,25,25,  9, 9, 9, -1, 75,
  366. /*      bs fs ta guns   hull  crew1   crew3    gunR  carR   rig2  rig4 pts */
  367. /*                 class   qual   crew2    gunL   carL   rig1  rig3        */
  368. };
  369.  
  370. struct windeffects WET[7][6] = {
  371.     { {9,9,9,9}, {9,9,9,9}, {9,9,9,9}, {9,9,9,9}, {9,9,9,9}, {9,9,9,9} },
  372.     { {3,2,2,0}, {3,2,1,0}, {3,2,1,0}, {3,2,1,0}, {2,1,0,0}, {2,1,0,0} },
  373.     { {1,1,1,0}, {1,1,0,0}, {1,0,0,0}, {1,0,0,0}, {1,0,0,0}, {1,0,0,0} },
  374.     { {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} },
  375.     { {0,0,0,0}, {1,0,0,0}, {1,1,0,0}, {1,1,0,0}, {2,2,1,0}, {2,2,1,0} },
  376.     { {1,0,0,0}, {1,1,0,0}, {1,1,1,0}, {1,1,1,0}, {3,2,2,0}, {3,2,2,0} },
  377.     { {2,1,1,0}, {3,2,1,0}, {3,2,1,0}, {3,2,1,0}, {3,3,2,0}, {3,3,2,0} }
  378. };
  379.  
  380. struct Tables RigTable[11][6] = {
  381.     { {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,1}, {0,0,1,0} },
  382.     { {0,0,0,0}, {0,0,0,0}, {0,0,0,1}, {0,0,1,0}, {1,0,0,1}, {0,1,1,1} },
  383.     { {0,0,0,0}, {0,0,0,1}, {0,0,1,1}, {0,1,0,1}, {0,1,0,1}, {1,0,1,2} },
  384.     { {0,0,0,0}, {0,0,1,1}, {0,1,0,1}, {0,0,0,2}, {0,1,0,2}, {1,0,1,2} },
  385.     { {0,1,0,1}, {1,0,0,1}, {0,1,1,2}, {0,1,0,2}, {0,0,1,3}, {1,0,1,4} },
  386.     { {0,0,1,1}, {0,1,0,2}, {1,0,0,3}, {0,1,1,3}, {1,0,0,4}, {1,1,1,4} },
  387.     { {0,0,1,2}, {0,1,1,2}, {1,1,0,3}, {0,1,0,4}, {1,0,0,4}, {1,0,1,5} },
  388.     { {0,0,1,2}, {0,1,0,3}, {1,1,0,3}, {1,0,2,4}, {0,2,1,5}, {2,1,0,5} },
  389.     { {0,2,1,3}, {1,0,0,3}, {2,1,0,4}, {0,1,1,4}, {0,1,0,5}, {1,0,2,6} },
  390.     { {1,1,0,4}, {1,0,1,4}, {2,0,0,5}, {0,2,1,5}, {0,1,2,6}, {0,2,0,7} },
  391.     { {1,0,1,5}, {0,2,0,6}, {1,2,0,6}, {1,1,1,6}, {2,0,2,6}, {1,1,2,7} }
  392. };
  393. struct Tables HullTable[11][6] = {
  394.     { {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {1,0,0,0}, {0,1,0,0} },
  395.     { {0,0,0,0}, {0,0,0,0}, {0,1,0,0}, {1,1,0,0}, {1,0,1,0}, {1,0,1,1} },
  396.     { {0,1,0,0}, {1,0,0,0}, {1,1,0,0}, {1,0,1,0}, {1,0,1,1}, {2,1,0,0} },
  397.     { {0,1,1,0}, {1,0,0,0}, {1,1,1,0}, {2,0,0,1}, {2,0,1,0}, {2,2,0,0} },
  398.     { {0,1,1,0}, {1,0,0,1}, {2,1,0,1}, {2,2,1,0}, {3,0,1,0}, {3,1,0,0} },
  399.     { {1,1,1,0}, {2,0,2,1}, {2,1,1,0}, {2,2,0,0}, {3,1,0,1}, {3,1,1,0} },
  400.     { {1,2,2,0}, {2,0,2,1}, {2,1,0,1}, {2,2,0,0}, {3,1,1,0}, {4,2,1,0} },
  401.     { {2,1,1,0}, {2,0,1,1}, {3,2,2,0}, {3,2,0,0}, {4,2,1,0}, {4,2,1,1} },
  402.     { {2,1,2,0}, {3,1,1,1}, {3,2,2,0}, {4,2,1,0}, {4,1,0,2}, {4,2,2,0} },
  403.     { {2,3,1,0}, {3,2,2,0}, {3,2,2,1}, {4,2,2,0}, {4,1,0,3}, {5,1,2,0} },
  404.     { {2,2,4,0}, {3,3,1,1}, {4,2,1,1}, {5,1,0,2}, {5,1,2,1}, {6,2,2,0} },
  405. };
  406.  
  407. char AMMO[9][4] = {
  408.     { -1, 1, 0, 1 },
  409.     { -1, 1, 0, 1 },
  410.     { -1, 1, 0, 1 },
  411.     { -2, 1, 0, 2 },
  412.     { -2, 2, 0, 2 },
  413.     { -2, 2, 0, 2 },
  414.     { -3, 2, 0, 2 },
  415.     { -3, 2, 0, 3 },
  416.     { -3, 2, 0, 3 }
  417. };
  418.     
  419. char HDT[9][10] = {
  420.     { 1, 0,-1,-2,-3,-3,-4,-4,-4,-4 },
  421.     { 1, 1, 0,-1,-2,-2,-3,-3,-3,-3 },
  422.     { 2, 1, 0,-1,-2,-2,-3,-3,-3,-3 },
  423.     { 2, 2, 1, 0,-1,-1,-2,-2,-2,-2 },
  424.     { 3, 2, 1, 0,-1,-1,-2,-2,-2,-2 },
  425.     { 3, 3, 2, 1, 0, 0,-1,-1,-1,-1 },
  426.     { 4, 3, 2, 1, 0, 0,-1,-1,-1,-1 },
  427.     { 4, 4, 3, 2, 1, 1, 0, 0, 0, 0 },
  428.     { 5, 4, 3, 2, 1, 1, 0, 0, 0, 0 }
  429. };
  430.  
  431. char HDTrake[9][10] = {
  432.     { 2, 1, 0,-1,-2,-2,-3,-3,-3,-3 },
  433.     { 2, 2, 1, 0,-1,-1,-2,-2,-2,-2 },
  434.     { 3, 2, 1, 0,-1,-1,-2,-2,-2,-2 },
  435.     { 4, 3, 2, 1, 0, 0,-1,-1,-1,-1 },
  436.     { 5, 4, 3, 2, 1, 1, 0, 0, 0, 0 },
  437.     { 6, 5, 4, 3, 2, 2, 1, 1, 1, 1 },
  438.     { 7, 6, 5, 4, 3, 3, 2, 2, 2, 2 },
  439.     { 8, 7, 6, 5, 4, 4, 3, 3, 3, 3 },
  440.     { 9, 8, 7, 6, 5, 5, 4, 4, 4, 4 }
  441. };
  442.  
  443. char QUAL[9][5] = {
  444.     { -1, 0, 0, 1, 1 },
  445.     { -1, 0, 0, 1, 1 },
  446.     { -1, 0, 0, 1, 2 },
  447.     { -1, 0, 0, 1, 2 },
  448.     { -1, 0, 0, 2, 2 },
  449.     { -1,-1, 0, 2, 2 },
  450.     { -2,-1, 0, 2, 2 },
  451.     { -2,-1, 0, 2, 2 },
  452.     { -2,-1, 0, 2, 3 }
  453. };
  454.  
  455. char MT[9][3] = {
  456.     { 1, 0, 0 },
  457.     { 1, 1, 0 },
  458.     { 2, 1, 0 },
  459.     { 2, 1, 1 },
  460.     { 2, 2, 1 },
  461.     { 3, 2, 1 },
  462.     { 3, 2, 2 },
  463.     { 4, 3, 2 },
  464.     { 4, 4, 2 }
  465. };
  466.  
  467. char rangeofshot[] = {
  468.     0,
  469.     1,        /* grape */
  470.     3,        /* chain */
  471.     10,        /* round */
  472.     1        /* double */
  473. };
  474.  
  475. char *countryname[] = {
  476.     "American", "British", "Spanish", "French", "Japanese",
  477.     "Federation", "Klingon", "Orion"
  478. };
  479.  
  480. char *classname[] = {
  481.     "Drift wood",
  482.     "Ship of the Line",
  483.     "Ship of the Line",
  484.     "Frigate",
  485.     "Corvette",
  486.     "Sloop",
  487.     "Brig"
  488. };
  489.  
  490. char *directionname[] = {
  491.     "dead ahead",
  492.     "off the starboard bow",
  493.     "off the starboard beam",
  494.     "off the starboard quarter",
  495.     "dead astern",
  496.     "off the port quarter",
  497.     "off the port beam",
  498.     "off the port bow",
  499.     "dead ahead"
  500. };
  501.  
  502. char *qualname[] = { "dead", "mutinous", "green", "mundane", "crack", "elite" };
  503.  
  504. char loadname[] = { '-', 'G', 'C', 'R', 'D', 'E' };
  505.  
  506. char dr[] = { 0, 1, 1, 0, -1, -1, -1, 0, 1 };
  507. char dc[] = { 0, 0, -1, -1, -1, 0, 1, 1, 1 };
  508.