home *** CD-ROM | disk | FTP | other *** search
/ CD PowerPlay 6 / TheCompleteAdventureCollection1995 / CDPP6.ISO / utility / agtsrc / final.pa4 < prev    next >
Encoding:
Text File  |  1989-12-20  |  5.9 KB  |  182 lines

  1.  
  2.   {FINAL.PA2}
  3.  
  4.  
  5.   {Read Final Version of Game}
  6.  
  7.   PROCEDURE ReadFinalVersion;
  8.  
  9.   VAR
  10.     i : Integer;
  11.     st : words;
  12.     Read_Text_file : Text;
  13.     RoomFile : FILE OF rooms;
  14.     NounFile : FILE OF nouns;
  15.     CreatureFile : FILE OF creatures;
  16.     CommandFile : FILE OF Command;
  17.   BEGIN                           {ReadFinalVersion}
  18.  
  19.     {first -- some general initialization -- normally in Initialize_Part_1}
  20.     Word_Chars := ['0'..'9', 'A'..'Z', 'a'..'z', '-', '_'];
  21.     player_dead := False;
  22.     Current_Life := 1;
  23.     Num_turns := 0;
  24.     game_won := False;
  25.     game_end := False;
  26.     Num_saves := 0; num_restores := 0;
  27.     verbose := True;              {default is to describe every room}
  28.     FOR i := 0 TO MaxCounter DO counter[i] := 0; {zero counters}
  29.     FOR i := 0 TO MaxVariable DO Variable[i] := 0; {zero variable}
  30.     FOR i := 0 TO MaxFlag DO Flag[i] := False; {make all flags FALSE}
  31.  
  32.     Subject_IT[Thing] := 'it';    {Subject pronouns for Creature = Thing}
  33.     Cap_Subject_IT[Thing] := 'It';
  34.     Object_IT[Thing] := 'it';
  35.     Snarls[Thing] := 'snarls';    {verbs for Creature = Thing}
  36.     Screeches[Thing] := 'screeches';
  37.     Subject_IT[Man] := 'he';      {Subject pronouns for Creature = Man}
  38.     Cap_Subject_IT[Man] := 'He';
  39.     Object_IT[Man] := 'him';
  40.     Snarls[Man] := 'scowls';      {verbs for Creature = Man}
  41.     Screeches[Man] := 'screams';
  42.     Subject_IT[Woman] := 'she';   {Subject pronouns for Creature = Woman}
  43.     Cap_Subject_IT[Woman] := 'She';
  44.     Object_IT[Woman] := 'her';
  45.     Snarls[Woman] := 'scowls';    {verbs for Creature = Woman}
  46.     Screeches[Woman] := 'screams';
  47.     IsOrAre[Singular] := 'is';
  48.     IsOrAre[Plural] := 'are';
  49.     ItOrThem[Singular] := 'it';
  50.     ItOrThem[Plural] := 'them';
  51.  
  52.  
  53.     {first read the text file with general data}
  54.     Assign(Read_Text_file, Adventure_Name+'.DA1');
  55.     Reset(Read_Text_file);
  56.     ReadLn(Read_Text_file, Starting_room);
  57.     Current_room := Starting_room; {start off here}
  58.     ReadLn(Read_Text_file, Treasure_Room);
  59.     ReadLn(Read_Text_file, Resurrection_Room);
  60.     ReadLn(Read_Text_file, Max_Lives);
  61.     ReadLn(Read_Text_file, Maximum_Score);
  62.     ReadLn(Read_Text_file, MaxRoom);
  63.     ReadLn(Read_Text_file, MaxNoun);
  64.     ReadLn(Read_Text_file, MaxCreature);
  65.     ReadLn(Read_Text_file, Last_CMD);
  66.     ReadLn(Read_Text_file, Items_Being_Carried);
  67.     ReadLn(Read_Text_file, Items_Being_Worn);
  68.     ReadLn(Read_Text_file, Intro_Ptr.start);
  69.     ReadLn(Read_Text_file, Intro_Ptr.len);
  70.  
  71.     FOR i := 1 TO MaxQuestion DO
  72.       BEGIN
  73.         ReadLn(Read_Text_file, Question[i]);
  74.         ReadLn(Read_Text_file, Answer[i]);
  75.       END;
  76.  
  77.     ReadLn(Read_Text_file, st);
  78.     Any_Special_Cmds := (st = 'TRUE');
  79.     IF Any_Special_Cmds THEN FOR i := 0 TO Last_Creature DO
  80.       BEGIN
  81.         ReadLn(Read_Text_file, StartingIndex[i]);
  82.         ReadLn(Read_Text_file, EndingIndex[i]);
  83.       END;
  84.  
  85.     FOR i := 0 TO Num_Verbs DO ReadLn(Read_Text_file, SYN[i]); {verb synonyms}
  86.  
  87.     FOR i := First_Message TO Last_Message DO
  88.       BEGIN                       {Read pointers to description file}
  89.         ReadLn(Read_Text_file, Message_Ptr[i].start);
  90.         ReadLn(Read_Text_file, Message_Ptr[i].len);
  91.       END;
  92.  
  93.     FOR i := First_Room TO MaxRoom DO
  94.       BEGIN
  95.         ReadLn(Read_Text_file, Room_Ptr[i].start);
  96.         ReadLn(Read_Text_file, Room_Ptr[i].len);
  97.         ReadLn(Read_Text_file, Help_Ptr[i].start);
  98.         ReadLn(Read_Text_file, Help_Ptr[i].len);
  99.         ReadLn(Read_Text_file, Special_Ptr[i].start);
  100.         ReadLn(Read_Text_file, Special_Ptr[i].len);
  101.       END;
  102.  
  103.     FOR i := First_noun TO MaxNoun DO
  104.       BEGIN
  105.         ReadLn(Read_Text_file, Noun_Ptr[i].start);
  106.         ReadLn(Read_Text_file, Noun_Ptr[i].len);
  107.         ReadLn(Read_Text_file, Push_Ptr[i].start);
  108.         ReadLn(Read_Text_file, Push_Ptr[i].len);
  109.         ReadLn(Read_Text_file, Pull_Ptr[i].start);
  110.         ReadLn(Read_Text_file, Pull_Ptr[i].len);
  111.         ReadLn(Read_Text_file, Text_Ptr[i].start);
  112.         ReadLn(Read_Text_file, Text_Ptr[i].len);
  113.         ReadLn(Read_Text_file, Turn_Ptr[i].start);
  114.         ReadLn(Read_Text_file, Turn_Ptr[i].len);
  115.         ReadLn(Read_Text_file, Play_Ptr[i].start);
  116.         ReadLn(Read_Text_file, Play_Ptr[i].len);
  117.       END;
  118.  
  119.     IF MaxCreature > 0 THEN FOR i := First_creature TO MaxCreature DO
  120.       BEGIN
  121.         ReadLn(Read_Text_file, Creature_Ptr[i].start);
  122.         ReadLn(Read_Text_file, Creature_Ptr[i].len);
  123.       END;
  124.  
  125.     Close(Read_Text_file);
  126.  
  127.     {next read the ROOM file}
  128.     Assign(RoomFile, Adventure_Name+'.DA2');
  129.     Reset(RoomFile);
  130.     FOR i := First_Room TO MaxRoom DO
  131.       BEGIN
  132.         New(Room[i]);
  133.         Read(RoomFile, Room[i]^);
  134.       END;
  135.     Close(RoomFile);
  136.  
  137.     {next read the NOUN file}
  138.     Assign(NounFile, Adventure_Name+'.DA3');
  139.     Reset(NounFile);
  140.     FOR i := First_noun TO MaxNoun DO
  141.       BEGIN
  142.         New(N[i]);
  143.         Read(NounFile, N[i]^);
  144.       END;
  145.     Close(NounFile);
  146.  
  147.     {next read the CREATURE file}
  148.     IF MaxCreature > 0 THEN
  149.       BEGIN
  150.         Assign(CreatureFile, Adventure_Name+'.DA4');
  151.         Reset(CreatureFile);
  152.         FOR i := First_creature TO MaxCreature DO
  153.           BEGIN
  154.             New(M[i]);
  155.             Read(CreatureFile, M[i]^);
  156.           END;
  157.         Close(CreatureFile);
  158.       END;
  159.  
  160.     {next read the Special Command file -- if used}
  161.     IF Any_Special_Cmds THEN
  162.       BEGIN
  163.         Assign(CommandFile, Adventure_Name+'.DA5');
  164.         Reset(CommandFile);
  165.         FOR i := 1 TO Last_CMD DO
  166.           BEGIN
  167.             New(SpecialCMD[i]);
  168.             Read(CommandFile, SpecialCMD[i]^);
  169.           END;
  170.         Close(CommandFile);
  171.       END;
  172.  
  173.     Assign(descr_file, descr_file_name);
  174.     Reset(descr_file);
  175.     IF Intro_Ptr.start >= 1 THEN
  176.       BEGIN
  177.         CLRSCR;
  178.         Describe_It('INTRO', 0);
  179.       END;
  180.   END;                            {ReadFinalVersion}
  181.  
  182.