home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff216.lzh / Wanderer / src / help.c < prev    next >
C/C++ Source or Header  |  1989-06-02  |  7KB  |  189 lines

  1. /* From jason@uucp.aeras */
  2.  
  3. #include "wand_head.h"
  4.  
  5. /* this help text structure allows graphic icons to be displayed along
  6.  * with the help text.  if your machine doesn't do graphics, it still
  7.  * works ok with the text representation.
  8.  */
  9. struct {
  10.     char *text;    /* text for this line */
  11.     short col;    /* column position for graphic icon, -1 for none */
  12.     short offrow;    /* row offset, fakes multiple icons per row */
  13.     char icon;    /* icon character to display */
  14. } help[]={
  15. "      **  W A N D E R E R  **      ", -1,0,0,    /* 0 */
  16. "    ===========================    ", -1,0,0,    /* 1 */
  17. "        by Steven Shipway          ", -1,0,0,    /* 2 */
  18. "How to play:                       ", -1,0,0,    /* 3 */
  19. " Collect all the treasure:         ", 30,0,'*',/* 4 */
  20. "                                   ", -1,0,0,    /* 5 */
  21. " Then go through the exit:         ", 30,0,'X',/* 6 */
  22. "                                   ", -1,0,0,    /* 7 */
  23. #ifdef AMIGA
  24. "  Use mouse, cursor keys or        ", -1,0,0,    /* 8 */
  25. "  h,j,k,l keys move around.        ", -1,0,0,    /* 9 */
  26. "                  ESC Quit game    ", -1,0,0,    /* 10 */
  27. "                  F10 Look at map  ", -1,0,0,    /* 11 */
  28. "    F6 Save game   F7 Restore Game ", -1,0,0,    /* 12 */
  29. "  HELP Help mode   F3 Center screen", -1,0,0,    /* 13 */
  30. "    F1 Jump level  F2 Switch mode  ", -1,0,0,    /* 14 */
  31. #else
  32. "  h  Left       j  Down            ", -1,0,0,    /* 8 */
  33. "  k  Up         l  Right           ", -1,0,0,    /* 9 */
  34. "  1  Loud       q  Quit game       ", -1,0,0,    /* 10 */
  35. "  0  Quiet      !  Look at map     ", -1,0,0,    /* 11 */
  36. "  S  Save game  R  Restore Game    ", -1,0,0,    /* 12 */
  37. "  ?  Help mode  @  Center screen   ", -1,0,0,    /* 13 */
  38. "  ~  Jump level #  Switch mode     ", -1,0,0,    /* 14 */
  39. #endif
  40. " nb: No level bonus for jumping.   ", -1,0,0,    /* 15 */
  41.  
  42. #ifdef AMIGA
  43. "This is you:                       ", -1,0,0,    /* 0 */
  44. "                                   ", 5,0,'@',    /* 1 */
  45. "                                   ", -1,0,0,    /* 2 */
  46. #else
  47. "This is you:  You are a spider.    ", -1,0,0,    /* 0 */
  48. "              (At least, that's    ", 5,0,'@',    /* 1 */
  49. "              what you look like)  ", -1,0,0,    /* 2 */
  50. #endif
  51. "                                   ", -1,0,0,    /* 3 */
  52. "The other items you will find are: ", -1,0,0,    /* 4 */
  53. "                                   ", -1,0,0,    /* 5 */
  54. "                                   ", 1,0,'#',    /* 6 */
  55. "      and        Solid rock        ", 10,-1,'=',/* 7 */
  56. "                                   ", -1,0,0,    /* 8 */
  57. "        Time capsule (5 points,    ", 2,0,'C',    /* 9 */
  58. "        +250 extra moves)          ", -1,0,0,    /* 10 */
  59. "                                   ", -1,0,0,    /* 11 */
  60. "        Passable earth (one point) ", 2,0,':',    /* 12 */
  61. "                                   ", -1,0,0,    /* 13 */
  62. "       Teleport  (50 points for    ", 1,0,'T',    /* 14 */
  63. "                  using it)        ", -1,0,0,    /* 15 */
  64.  
  65. "        Boulder (falls down, other ", 2,0,'O',    /* 0 */
  66. "        boulders and arrows fall   ", -1,0,0,    /* 1 */
  67. "        off of it)                 ", -1,0,0,    /* 2 */
  68. "                                   ", -1,0,0,    /* 3 */
  69. "               Arrows              ", 1,0,'<',    /* 4 */
  70. "      and      (run left and right)", 10,-1,'>',/* 5 */
  71. "                                   ", -1,0,0,    /* 6 */
  72. "        Cage - holds baby monsters ", 2,0,'=',    /* 7 */
  73. "        and changes into diamonds  ", -1,0,0,    /* 8 */
  74. "                                   ", -1,0,0,    /* 9 */
  75. "         (10 points)               ", 2,0,'*',    /* 10 */
  76. "         Money  (collect it)       ", -1,0,0,    /* 11 */
  77. "                                   ", -1,0,0,    /* 12 */
  78. "       Baby monster (kills you)    ", 2,0,'S',    /* 13 */
  79. "                                   ", -1,0,0,    /* 14 */
  80. "                                   ", -1,0,0,    /* 15 */
  81.  
  82. "When a baby monster hits a cage it ", -1,0,0,    /* 0 */
  83. "is captured and you get 50 points. ", -1,0,0,    /* 1 */
  84. "The cage also becomes a diamond.   ", -1,0,0,    /* 2 */
  85. "                                   ", -1,0,0,    /* 3 */
  86. "      Instant annihilation         ", 1,0,'!',    /* 4 */
  87. "                                   ", -1,0,0,    /* 5 */
  88. "                                   ", -1,0,0,    /* 6 */
  89. "               Slopes (boulders    ", 1,0,'\\',/* 7 */
  90. "     and       and etc slide off)  ", 9,-1,'/',/* 8 */
  91. "                                   ", -1,0,0,    /* 9 */
  92. "      Monster  (eats you up whole. ", 1,0,'M',    /* 10 */
  93. "      Yum Yum yum..) (100 points)  ", -1,0,0,    /* 11 */
  94. "      (kill with a rock or arrow)  ", -1,0,0,    /* 12 */
  95. "                                   ", -1,0,0,    /* 13 */
  96. "      Exit -- Must Collect all the ", 1,0,'X',    /* 14 */
  97. "      treasure first. (250 bonus)  ", -1,0,0,    /* 15 */
  98.  
  99. "      A new addition for version   ", 1,0,'^',    /* 0 */
  100. "      2.2M . The balloon rises,    ", -1,0,0,    /* 1 */
  101. "      and is popped by arrows. It  ", -1,0,0,    /* 2 */
  102. "      does *not* kill you.         ", -1,0,0,    /* 3 */
  103. "                                   ", -1,0,0,    /* 4 */
  104. "      Unrecognised symbol in map.  ", 1,0,'-',    /* 5 */
  105. "      This is probably a **bug** ! ", -1,0,0,    /* 6 */
  106. "                                   ", -1,0,0,    /* 7 */
  107. " ENVIRONMENT VARIABLES:            ", -1,0,0,    /* 8 */
  108. "                                   ", -1,0,0,    /* 9 */
  109. "   NEWNAME,NAME : Checked in that  ", -1,0,0,    /* 10 */
  110. "       order for the hiscore table ", -1,0,0,    /* 11 */
  111. "   NEWKEYS : Redefine movement keys", -1,0,0,    /* 12 */
  112. "       eg- 'hlkj' for default      ", -1,0,0,    /* 13 */
  113. "   SAVENAME : File used for saved  ", -1,0,0,    /* 14 */
  114. "       games.                      ", -1,0,0    /* 15 */
  115. };
  116.  
  117.  
  118.  
  119. void
  120. helpme()    /* routine to show help menu. */
  121. {
  122.     int i = 0, i1 = 0, i2 = 0;  /* loop counters */
  123.     char ch;
  124.  
  125.     draw_box(0,0,43,19);
  126.     for(i1 = 0; i1 < 5; i1++)  /* times to show loop. */
  127.     {
  128.         setcolor(WHITE, DK_GREEN);
  129.         for(i = 0; i < 16; i++)    /* show one menu. */
  130.         {
  131.             move(i+1,1);  /* move to start of line. */
  132.             addstr(help[i2+i].text);
  133.         }
  134.         /* now go back and draw any icon images */
  135.         for(i = 0; i < 16; i++)    /* show one menu. */
  136.         {
  137.             if (help[i2+i].col >= 0)
  138.             {
  139.                 /* draw the beastie */
  140.                 draw_symbol(help[i2+i].col+1,i+help[i2+i].offrow,help[i2+i].icon);
  141.             }
  142.         }
  143.  
  144.         i2 += 16;
  145.  
  146.         move(i+1,1);  /* move to start of line. */
  147.         setcolor(YELLOW, DK_GREEN);
  148.         addstr("<return> to continue, <space> to exit");
  149.         refresh();    /* show on screen. */
  150.         ch = (char) getchar();    /* just for now, get anything. */
  151.         if(ch == ' ') /* if return or what ever.. */
  152.             break;  /* exit routine now. */
  153.     }
  154.     setcolor(TEXT_COLOR, BACK_COLOR);
  155.     for (i=0; i<19; i++)
  156.     {
  157.         move(i,0);  /* move to start of line. */
  158.         addstr("                                              ");
  159.     }
  160. }
  161.  
  162. credits()
  163. {
  164.     char buffer[512];
  165.     FILE *fp;
  166.     int i;
  167.     clear();
  168.     sprintf(buffer,"%s/credits",SCREENPATH);
  169.     if((fp = fopen(buffer,"r")) == NULL) {
  170.             addstr(" Sorry - credits unavailable!\n");
  171.         }
  172.     else {
  173.         i = 0;
  174.         while(fgets(buffer,512,fp) != NULL) {
  175.             addstr(buffer);
  176.         if (++i == LINES-2) {
  177.             addstr("Press any key.");
  178.             refresh();
  179.             getch();
  180.             i = 0;
  181.             clear();
  182.         }
  183.         }
  184.     }
  185.     addstr("Press any key.");
  186.     refresh();
  187.     getch();
  188. }
  189.