00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00022
00023 #include "crogue.h"
00024 #include "dll.h"
00025
00026 #define NUM_HELP_PAGES 5
00027 static const char *help_titles[] = {
00028 gettext("How to play"),
00029 gettext("Game Options"),
00030 gettext("Classes"),
00031 gettext("Hints"),
00032 gettext("About")
00033 };
00034
00035
00036 static void helptitlebynum(int N, char *buf)
00037 {
00038 strcpy(buf, help_titles[N]);
00039 }
00040
00041
00042
00043 const char *help_how_to_play =
00044 gettext("How to Play\n"
00045 "\n"
00046 "At any time, you can press [%s] to get a list of commands and the"
00047 " corresponding keys. This section does not list nearly every possibility. If"
00048 " it occurs to you to do something, check the menu - it's probably there!\n"
00049 "\n"
00050 "Your character moves in each of the cardinal directions, plus diagonals."
00051 " Because of the importance of diagonal movement, the arrow keys are not used;"
00052 " instead, use the number pad. You start the game in a simple dungeon, so start"
00053 " exploring."
00054 "\n"
00055 "Odds are pretty soon, you'll run into a monster, which is represented on the"
00056 " map by a letter which tells you what it is. To attack, simply move onto the"
00057 " monster's square. Your hit points are shown on the status line, at the bottom"
00058 " of the screen. If they get low, run away!\n"
00059 "\n"
00060 "You will see plenty of items lying around, and you start with some useful"
00061 " things as well. Press [%s] to see your current inventory. If you see an item"
00062 " on the map, move onto its square and you"
00063 " will be asked if you want to pick it up. (If you have turned this off, press"
00064 " [%s] to pick up items.) Press [%s] to equip armor and weapons you find, and"
00065 " [%s] to use potions, scrolls, and other items. Be warned that while some "
00066 " items are beneficial, others are enchanted with harmful magic.\n"
00067 "\n"
00068 "If you are playing a magic user, the first thing you should do is use your"
00069 " spellbook. Later, you can cast spells you have studied with [%s].\n"
00070 "\n"
00071 "Your quest is to find and bring back the Amulet of Yendor. Good luck!");
00072
00073
00074 const char *help_classes =
00075 gettext("Classes\n"
00076 "\n"
00077 "Fighter: A simple warrior, skilled with any weapon but not at magic. Fighers"
00078 " are the strongest class.\n"
00079 "\n"
00080 "Wizard: A sorceror, weak with weapons but casting powerful spells. A wizard"
00081 " can't fight well toe-to-toe, but he doesn't need to.\n"
00082 "\n"
00083 "Archer: A marksman, weak in melee but strong at range. An archer moves quickly"
00084 " and shoots accurately.\n"
00085 "\n"
00086 "Priest: A holy warrior, not as well trained in arms as a fighter but with"
00087 " divine powers at his side.\n"
00088 "\n"
00089 "Necromancer: A dark wizard. A necromancer does not often fight, but instead"
00090 " he commands his undead minions to fight for him."
00091 "");
00092
00093
00094 const char *help_options =
00095 gettext("Options\n"
00096 "\n"
00097 "Auto-pickup: Controls whether, when moving onto an item, you will"
00098 " automatically pick it up. (default: prompt).\n"
00099 "\n"
00100 "Auto-follow-stairs: If set to yes, when moving onto stairs you will"
00101 " automatically follow them. If set to prompt, you will be asked whether"
00102 " to follow them; if off, you must follow stairs manually (press [%s]"
00103 " (default: prompt).\n"
00104 "\n"
00105 "Tile size (calculator only): Toggles between small (5x5) and large"
00106 " (7x7) tilesets. (default: small).\n"
00107 "\n"
00108 "Font size (calculator only): Toggles between small (4x6) and large"
00109 " (6x8) font. (default: small).\n"
00110 "\n"
00111 "Archive saves (calculator only): If set, saved games and levels will"
00112 " be moved into archive memory. Turn this off if archive memory is full."
00113 " (default: yes).\n"
00114 "\n"
00115 "Archive scores (calculator only): If set, high scores will be moved"
00116 " into archive memory. If this is off, you may lose your high scores"
00117 " when your calculator is reset. (default: yes).\n"
00118 "\n"
00119 "Use grayscale (calculator only): Enables grayscale graphics, which"
00120 " look better but will drain your batteries faster. (default: yes).");
00121
00122
00123 const char *help_hints =
00124 gettext("Hints\n"
00125 "\n"
00126 "Some items are useful, some items are harmful, some items are useful if used"
00127 " at the right moment but harmful otherwise. Don't use an item until you have"
00128 " some idea what it is. Try dropping it in a shop, and see how much the"
00129 " shopkeeper offers; that's a big clue to whether the item is good or bad.\n"
00130 "\n"
00131 "When you get into trouble, stop, take a look at your inventory, and think"
00132 " your situation. Most deaths are avoidable, but a scroll of teleportation"
00133 " won't do you any good if you forget you have it!\n"
00134 "\n"
00135 "Never fight a big group all at once. Instead, face them one at a time in a"
00136 " corridor.\n"
00137 "\n"
00138 "Some monsters shouldn't be fought up close, but from a distance with spells or"
00139 " with arrows. In particular, watch out for mimics.\n"
00140 "\n"
00141 "Some monsters can open doors, but some can't. Use this to your advantage.");
00142
00143
00144 const char *help_about =
00145 gettext("CalcRogue (" CROGUE_VERSION ")\n"
00146 "by Jim Babcock\n"
00147 "jimmy_b@earthlink.net\n"
00148 "\n"
00149 "This game is postcardware. If you enjoy it, please send the author a"
00150 " postcard at the address below from wherever you live. Feel free to"
00151 " include feature requests and your e-mail address.\n"
00152 "\n"
00153 " Jim Babcock\n"
00154 " 16 Sweeney Ridge Rd\n"
00155 " Bedford, Massachusetts\n"
00156 " 01730\n"
00157 "\n"
00158 "This program is released under the GNU General Public License (GPL)."
00159 " Source is available at <http://calcrogue.jimrandomh.org>.\n"
00160 "\n")
00161 #ifdef __TIGCC__
00162 gettext("This build was compiled with ")
00163 __TIGCC_VERSION_STRING__ gettext(" and ") __TIGCCLIB_VERSION_STRING__ ".\n"
00164 #endif
00165 ;
00166
00167
00168 #define num_help_menu_tab_stops 2
00169 static void show_help_page(int page);
00170
00171 void help(void)
00172 {
00173 sint page;
00174
00175 while(1) {
00176 page = UI_Menu_Pick(help_menu_rect, NUM_HELP_PAGES, &helptitlebynum, 0);
00177 if(page==-1) break;
00178 setTabStops(help_menu_tabs);
00179 show_help_page(page);
00180 }
00181 }
00182
00183
00184 static void show_help_page(int page)
00185 {
00186 #ifdef CONSERVE_STACK
00187 char *buf = debug_malloc(4096);
00188 #else
00189 char buf[4096];
00190 #endif
00191 const char *str = buf;
00192
00193 switch(page)
00194 {
00195 case 0:
00196 sprintf(buf, help_how_to_play,
00197 get_keyname(KEY_ACT_MENU),
00198 get_keyname(KEY_INVENTORY),
00199 get_keyname(KEY_PICKUP),
00200 get_keyname(KEY_WEAR),
00201 get_keyname(KEY_USE),
00202 get_keyname(KEY_CAST) );
00203 break;
00204 case 1:
00205 str = help_classes;
00206 break;
00207 case 2:
00208 sprintf(buf, help_options,
00209 get_keyname(KEY_STAIR));
00210 break;
00211 case 3:
00212 str = help_hints;
00213 break;
00214 case 4:
00215 str = help_about;
00216 break;
00217 }
00218 UI_Dialog_Display(default_dialog_rect, str);
00219 #ifdef CONSERVE_STACK
00220 free(buf);
00221 #endif
00222 }
00223