
(*
   Feb18/96 - DN

   Some players have been requesting the special codes that the Overkill
   Ansiterminal reads and interprets.  This file summarizes what those
   special codes are and what they are used for.  Perhaps someone can
   create a different terminal, either ansi or real graphics.

   When the game sends out information over the modem, it sends out data
   one byte at a time.  With the Overkill ansiterm loaded up, the
   terminal looks for a specific character, ''.  If it receives this
   character from the Overkill game, the terminal knows that a set of
   data is about to be read from the game.  The stream of data is sent
   from the Overkill game and is received by the ansiterm.  The ansiterm
   stores this data until it receives a '|' character, which signifies
   the end of the special game data.  The ansiterm then processes the
   sequence of data it received between the '' and the '|' characters.

   An example ansiterminal code is:

   A|

   The ansiterm strips off the beginning and end characters, and then
   determines what the code is.

   A

   ...and if you look below, the code checks to see what the 'A' code
   does.  In this case, it loads up a main menu picture (like the Barracks
   or the Main Hall menu).

*)


 CASE STCode[1] OF
    'A'..'Z' : ReadInPix(STCode[1]);        { reads in big menus/pixs    }
         '0' : ReadInPix(STCode[1]);        { logon screen picture       }
    '1'..'9' : ReadInText(STCode);          { show various misc/text     }
    'a'..'z' : ReadSmallMenu(STCode);       { reads in small menu        }
         '!' : IncomingCheckStatus(STCode); { show views/check status    }
         '#' : IncomingMapScanner(STCode);  { show infrared scan         }
         '$' : IncomingSoundVoc(STCode);    { play .VOiCe file           }
  END;



  (*
     Here is a summary/paraphrase of each function that is called to
     process the special terminal codes.
  *)




  PROCEDURE ReadInPix(PixChar : CHAR)
  BEGIN

    CASE PixChar OF

    { Complex pictures }

    'A' :  { main hall }
    'B' :  { barracks }
    'C' :  { headquarters }
    'D' :  { comm. post }
    'E' :  { wastelands }

    { Base pictures }

    'F' :  { base main hall }
    'G' :  { base barracks }
    'H' :  { base storage }
    'I' :  { base tech }
    'J' :  { base control }
    'K' :  { base radio }

  END;


  -=-=-=-=-


  PROCEDURE ReadInText(CodeStr : STRING);

    CASE CodeStr[1] OF

       '1' : { introduction text to Barl's bar }

    END;


  -=-=-=-=-


  (#) = a number block, like: d_8675_34234_0_1999


  PROCEDURE ReadSmallMenu(CodeStr : STRING);

  CASE CodeStr[1] OF

    'a' : { Supply Room }
    'b' : { Recruit Chambers }
    'c' : { Adjust Specs }
    'd' : { Bank }

	    d_(savings)_(loaned)_(squadron)_(crystals)

    'e' : { Games Room }

	    e_(games left)

    'f' : { Sentry Post }

	  f_(guard alive=1 or dead=0)

    'g' : { E-Mail }

	    g_(squadron number)

    'h' : { Help Info }

    'i' : { Medical Center }

	    i_(radiation)_(hit point 1)_(hit point 2)_(disease)

    'j' : { Records Room }

    'k' : { Supply Room - Armor }

	    k_(armor)_(hits)

    'l' : { Buy Armor Listing }

	    l_(0=normal 1=price multiplied)

    'm' : { Supply Room Equipment }

	    m_(1=show title 0=no title)

    'n' : { Buy Equipment Listing }

	    n_(0=normal 1=price multiplied)

    'o' : { Suits Menu }

	    o_(suit)

    'p' : { Buy Suit Listing }

	    p_(0=normal 1=price multiplied)

    'q' : { Supply Room - Weapons }

	    q_(weapon1)_(ammotype1)_(rounds1)_(weapon2)_(ammotype2)_(rounds2)

    'r' : { Buy Weapons Listing }

	    r_(0=normal 1=price multiplied)

    's' : { Squadron Menu }

	    s_(squadron)

    't' : { Sighting Combat Menu }

	    t_(monster name)_(0=able to run/surrender 1=no options)

    'u' : { Investigate Campers Menu }

	    u_(camper's name)_(0=camper is dead)_(0=same squadron 1=not same)

    'v' : { Use Medpacks }

	    v_(hit point1)_(hit point2)_(applications1)_(total
            apps)_(rads)_(hunger level)_(1=use rations option 0=no option)

  END;


  -=-=-=-=-


  PROCEDURE IncomingCheckStatus(CodeS : STRING)

  CodeS = !1|  (0 or 1 specifies line color of background)


  -=-=-=-=-


  PROCEDURE IncomingMapScanner(CodeS : STRING);

  Strip off the '#' character.  Then, check the next character:

  CASE CodeS[1] OF

    'F' : { Draw Scanner Background }

    'T' : { Draw Terrain Description Region }

    'M' : { Mapper Scancodes }

	    M_(A=AFB or 0=Wastelands)_(T=minitrik or F=no minitrik)_
	    (NW code)_(N code)_(NE code)_(E code)_(SE code)_(S code)_
	    (SW code)_(W code)

    'O' : { Scanner Info }

	    O_(X Loc)_(Y_Loc)_(Map Level)_(Time Left)_(Hp1)_(Hp2)_(Rad)_
	    (Hunger Level)_

	    If Items:

	    ('I' then if '0' write ' ' else write '')

	    If Campers:

	    ('C' then if '0' write ' ' else write '')

	    If Bases:

	    ('B' then if '0' write ' ' else write '' and (line #)_(base #)

    'D' : { Terrain Descriptions }

	    Remove 'D' and get next character:

            CASE NextChar OF

              2 : { plains }
              3 : { desert }
              4 : { swamp }
              5 : { mountains }
              6 : { flat terrain }
              8 : { hole down }
	      9 : { airforce base }
	     10 : { missile silo }
	     11 : { radiation dump }
	     12 : { road }
	     13 : { Hydrite Prison }
	     14 : { hole up }
	     15 : { stream }

    'P' : { Pits }


  -=-=-=-=-


  PROCEDURE IncomingSoundVoc(CodeS : String);

  Strip off '$', then check the next letter.

    CASE NextChar OF
      '1' : { Welcoming }
      '2' : { Explosion }
      '3' : { Missile launch countdown }
            { Explosion }
      '4' : { AFB clone }
      '5' : { Monster encounter 1 or Monster encounter 2}
      '6' : { Radiation treatment }
      '7' : { Nukem Attack }
      '8' : { Watch is beeping }
      '9' : { Increase a level }
      'A' : { Disease inflames }
      'B' : { Attack hit 1, 2 or 3 }
      'C' : { Time is up }
      'D' : { Using medpack }
      'E' : { Monster shoots long range at running player }
      'F' : { Aurora }
      'G' : { Base teleportation }
      'H' : { Influx Treatment }
      'I' : { Use of remote control }
      'J' : { Airforce door opening/closing }
      'K' : { Base Attack alarm }
      'L' : { Teleporter reverses }
      'M' : { Aerial/trikorder scanner }
      'N' : { Base defense gun }
      'O' : { Combat miss 1, 2, or 3 }
      'P' : { Music 1 or 2 }
      'Q' : { Activating Alien Device }
      'R' : { Player dies }
      'S' : { Player achieves something good }
      'T' : { Player kills a monster }
      'U' : { Shot in the back, falling in pit, ZZilen dying }
      'V' : { Successful break from combat }
      'W' : { Monster's long range weapon misses when player runs }
      'X' : { Player misses long range }
      'Y' : { Player's backpack hit on running }
      'Z' : { Monster breaks from combat }

