home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume16 / nethck31 / patch2j < prev    next >
Encoding:
Internet Message Format  |  1993-06-15  |  61.6 KB

  1. Path: uunet!news.tek.com!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v17i085:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Patch2j/33
  5. Date: 11 Jun 1993 00:09:38 GMT
  6. Organization: Tektronix, Inc, Redmond, OR, USA
  7. Lines: 2049
  8. Approved: billr@saab.CNA.TEK.COM
  9. Message-ID: <1v8ig2$j0h@ying.cna.tek.com>
  10. NNTP-Posting-Host: saab.cna.tek.com
  11. Xref: uunet comp.sources.games:1773
  12.  
  13. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  14. Posting-number: Volume 17, Issue 85
  15. Archive-name: nethack31/Patch2j
  16. Patch-To: nethack31: Volume 16, Issue 1-116
  17. Environment: Amiga, Atari, Mac, MS-DOS, Windows-NT, OS2, Unix, VMS, X11
  18.  
  19.  
  20.  
  21. #! /bin/sh
  22. # This is a shell archive.  Remove anything before this line, then unpack
  23. # it by saving it into a file and typing "sh file".  To overwrite existing
  24. # files, type "sh file -c".  You can also feed this as standard input via
  25. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  26. # will see the following message at the end:
  27. #        "End of archive 10 (of 33)."
  28. # Contents:  patches02f sys/winnt/winnt.cnf
  29. # Wrapped by billr@saab on Thu Jun 10 16:55:02 1993
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'patches02f' -a "${1}" != "-c" ; then 
  32.   echo shar: Renaming existing file \"'patches02f'\" to \"'patches02f.orig'\"
  33.   mv -f 'patches02f' 'patches02f.orig'
  34. fi
  35. echo shar: Extracting \"'patches02f'\" \(55370 characters\)
  36. sed "s/^X//" >'patches02f' <<'END_OF_FILE'
  37. X*** /tmp/da11202    Tue Jun  1 16:14:54 1993
  38. X--- src/o_init.c    Fri May 28 11:40:29 1993
  39. X***************
  40. X*** 1,4 ****
  41. X! /*    SCCS Id: @(#)o_init.c    3.1    92/12/11    */
  42. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  43. X  /* NetHack may be freely redistributed.  See license for details. */
  44. X  
  45. X--- 1,4 ----
  46. X! /*    SCCS Id: @(#)o_init.c    3.1    93/05/25    */
  47. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  48. X  /* NetHack may be freely redistributed.  See license for details. */
  49. X  
  50. X***************
  51. X*** 23,29 ****
  52. X  static NEARDATA short disco[TOTAL_OBJS] = DUMMY;
  53. X  
  54. X  int
  55. X! letindex(acls) register char acls; {
  56. X  register int i = 0;
  57. X  register char ch;
  58. X      while ((ch = obj_symbols[i++]) != 0)
  59. X--- 23,31 ----
  60. X  static NEARDATA short disco[TOTAL_OBJS] = DUMMY;
  61. X  
  62. X  int
  63. X! letindex(acls)
  64. X! register char acls;
  65. X! {
  66. X  register int i = 0;
  67. X  register char ch;
  68. X      while ((ch = obj_symbols[i++]) != 0)
  69. X***************
  70. X*** 85,91 ****
  71. X  }
  72. X  
  73. X  void
  74. X! init_objects(){
  75. X  register int i, j, first, last, sum, end;
  76. X  register char acls;
  77. X  #ifdef TEXTCOLOR
  78. X--- 87,94 ----
  79. X  }
  80. X  
  81. X  void
  82. X! init_objects()
  83. X! {
  84. X  register int i, j, first, last, sum, end;
  85. X  register char acls;
  86. X  #ifdef TEXTCOLOR
  87. X***************
  88. X*** 104,110 ****
  89. X--- 107,115 ----
  90. X      /* initialize object descriptions */
  91. X      for (i = 0; i < TOTAL_OBJS; i++)
  92. X          objects[i].oc_name_idx = objects[i].oc_descr_idx = i;
  93. X+     /* moved to after u_init()
  94. X      init_artifacts();
  95. X+     */
  96. X      /* init base; if probs given check that they add up to 1000,
  97. X         otherwise compute probs; shuffle descriptions */
  98. X      end = TOTAL_OBJS;
  99. X***************
  100. X*** 199,204 ****
  101. X--- 204,211 ----
  102. X      for (i = SPEED_BOOTS; i <= LEVITATION_BOOTS; i++)
  103. X      if ((s = OBJ_DESCR(objects[i])) != 0 && !strcmp(s, "snow boots"))
  104. X          return i;
  105. X+     /* special case:  description of elven boots is nulled out for elf role */
  106. X+     if (pl_character[0] == 'E') return ELVEN_BOOTS;
  107. X  
  108. X      impossible("snow boots not found?");
  109. X      return -1;    /* not 0, or caller would try again each move */
  110. X***************
  111. X*** 311,317 ****
  112. X  {
  113. X      register int i, dis;
  114. X      int    ct = 0;
  115. X!     char class = -1;
  116. X      winid tmpwin;
  117. X  
  118. X      tmpwin = create_nhwindow(NHW_MENU);
  119. X--- 318,324 ----
  120. X  {
  121. X      register int i, dis;
  122. X      int    ct = 0;
  123. X!     char *s, oclass, prev_class, classes[MAXOCLASSES];
  124. X      winid tmpwin;
  125. X  
  126. X      tmpwin = create_nhwindow(NHW_MENU);
  127. X***************
  128. X*** 318,331 ****
  129. X      putstr(tmpwin, 0, "Discoveries");
  130. X      putstr(tmpwin, 0, "");
  131. X  
  132. X!     for (i = 0; i <= NROFOBJECTS; i++) {
  133. X!     if ((dis = disco[i]) && interesting_to_discover(dis)) {
  134. X!         ct++;
  135. X!         if (objects[dis].oc_class != class) {
  136. X!         class = objects[dis].oc_class;
  137. X!         putstr(tmpwin, ATR_INVERSE, let_to_name(class, FALSE));
  138. X          }
  139. X-         putstr(tmpwin, 0, typename(dis));
  140. X      }
  141. X      }
  142. X      if (ct == 0) {
  143. X--- 325,351 ----
  144. X      putstr(tmpwin, 0, "Discoveries");
  145. X      putstr(tmpwin, 0, "");
  146. X  
  147. X!     /* several classes are omitted from packorder; one is of interest here */
  148. X!     Strcpy(classes, flags.inv_order);
  149. X!     if (!index(classes, VENOM_CLASS)) {
  150. X!     s = eos(classes);
  151. X!     *s++ = VENOM_CLASS;
  152. X!     *s = '\0';
  153. X!     }
  154. X! 
  155. X!     for (s = classes; *s; s++) {
  156. X!     oclass = *s;
  157. X!     prev_class = oclass + 1;    /* forced different from oclass */
  158. X!     for (i = bases[letindex(oclass)];
  159. X!          i <= NROFOBJECTS && objects[i].oc_class == oclass; i++) {
  160. X!         if ((dis = disco[i]) && interesting_to_discover(dis)) {
  161. X!         ct++;
  162. X!         if (oclass != prev_class) {
  163. X!             putstr(tmpwin, ATR_INVERSE, let_to_name(oclass, FALSE));
  164. X!             prev_class = oclass;
  165. X!         }
  166. X!         putstr(tmpwin, 0, typename(dis));
  167. X          }
  168. X      }
  169. X      }
  170. X      if (ct == 0) {
  171. X*** /tmp/da11210    Tue Jun  1 16:14:56 1993
  172. X--- src/objects.c    Wed Mar 17 17:23:13 1993
  173. X***************
  174. X*** 560,567 ****
  175. X      FOOD("lump of royal jelly",  0, 1,  2, 0, VEGGY, 200, YELLOW),
  176. X      FOOD("cream pie",           25, 1, 10, 0, VEGGY, 100, WHITE),
  177. X      FOOD("candy bar",           13, 1,  2, 0, VEGGY, 100, BROWN),
  178. X!     FOOD("fortune cookie",      55, 1,  1, 0, VEGGY,  40, BROWN),
  179. X!     FOOD("pancake",             25, 2,  2, 0, VEGGY, 200, BROWN),
  180. X      FOOD("lembas wafer",        20, 2,  5, 0, VEGGY, 800, WHITE),
  181. X      FOOD("cram ration",         20, 3, 15, 0, VEGGY, 600, HI_ORGANIC),
  182. X      FOOD("food ration",        381, 5, 20, 0, VEGGY, 800, HI_ORGANIC),
  183. X--- 560,567 ----
  184. X      FOOD("lump of royal jelly",  0, 1,  2, 0, VEGGY, 200, YELLOW),
  185. X      FOOD("cream pie",           25, 1, 10, 0, VEGGY, 100, WHITE),
  186. X      FOOD("candy bar",           13, 1,  2, 0, VEGGY, 100, BROWN),
  187. X!     FOOD("fortune cookie",      55, 1,  1, 0, VEGGY,  40, YELLOW),
  188. X!     FOOD("pancake",             25, 2,  2, 0, VEGGY, 200, YELLOW),
  189. X      FOOD("lembas wafer",        20, 2,  5, 0, VEGGY, 800, WHITE),
  190. X      FOOD("cram ration",         20, 3, 15, 0, VEGGY, 600, HI_ORGANIC),
  191. X      FOOD("food ration",        381, 5, 20, 0, VEGGY, 800, HI_ORGANIC),
  192. X***************
  193. X*** 648,654 ****
  194. X  SPELL("finger of death", "stained",      5, 10, 7, 1, RAY,       HI_PAPER),
  195. X  SPELL("light",           "cloth",       45,  1, 1, 1, NODIR,     HI_CLOTH),
  196. X  SPELL("detect monsters", "leather",     45,  1, 1, 1, NODIR,     HI_LEATHER),
  197. X! SPELL("healing",         "white",       40,  2, 1, 1, NODIR,     WHITE),
  198. X  SPELL("knock",           "pink",        36,  1, 1, 1, IMMEDIATE, BRIGHT_MAGENTA),
  199. X  SPELL("force bolt",      "red",         35,  2, 1, 1, IMMEDIATE, RED),
  200. X  SPELL("confuse monster", "orange",      37,  2, 2, 1, IMMEDIATE, ORANGE_COLORED),
  201. X--- 648,654 ----
  202. X  SPELL("finger of death", "stained",      5, 10, 7, 1, RAY,       HI_PAPER),
  203. X  SPELL("light",           "cloth",       45,  1, 1, 1, NODIR,     HI_CLOTH),
  204. X  SPELL("detect monsters", "leather",     45,  1, 1, 1, NODIR,     HI_LEATHER),
  205. X! SPELL("healing",         "white",       40,  2, 1, 1, IMMEDIATE, WHITE),
  206. X  SPELL("knock",           "pink",        36,  1, 1, 1, IMMEDIATE, BRIGHT_MAGENTA),
  207. X  SPELL("force bolt",      "red",         35,  2, 1, 1, IMMEDIATE, RED),
  208. X  SPELL("confuse monster", "orange",      37,  2, 2, 1, IMMEDIATE, ORANGE_COLORED),
  209. X***************
  210. X*** 664,670 ****
  211. X  SPELL("haste self",      "purple",      33,  4, 3, 1, NODIR,     MAGENTA),
  212. X  SPELL("detect unseen",   "violet",      20,  4, 3, 1, NODIR,     MAGENTA),
  213. X  SPELL("levitation",      "tan",         20,  4, 4, 1, NODIR,     BROWN),
  214. X! SPELL("extra healing",   "plaid",       35,  5, 3, 1, NODIR,     GREEN),
  215. X  SPELL("restore ability", "light brown", 25,  5, 4, 1, NODIR,     BROWN),
  216. X  SPELL("invisibility",    "dark brown",  32,  5, 4, 1, NODIR,     BROWN),
  217. X  SPELL("detect treasure", "gray",        25,  5, 4, 1, NODIR,     GRAY),
  218. X--- 664,670 ----
  219. X  SPELL("haste self",      "purple",      33,  4, 3, 1, NODIR,     MAGENTA),
  220. X  SPELL("detect unseen",   "violet",      20,  4, 3, 1, NODIR,     MAGENTA),
  221. X  SPELL("levitation",      "tan",         20,  4, 4, 1, NODIR,     BROWN),
  222. X! SPELL("extra healing",   "plaid",       35,  5, 3, 1, IMMEDIATE, GREEN),
  223. X  SPELL("restore ability", "light brown", 25,  5, 4, 1, NODIR,     BROWN),
  224. X  SPELL("invisibility",    "dark brown",  32,  5, 4, 1, NODIR,     BROWN),
  225. X  SPELL("detect treasure", "gray",        25,  5, 4, 1, NODIR,     GRAY),
  226. X*** /tmp/da11218    Tue Jun  1 16:14:59 1993
  227. X--- src/objnam.c    Tue Jun  1 12:13:20 1993
  228. X***************
  229. X*** 1,8 ****
  230. X! /*    SCCS Id: @(#)objnam.c    3.1    93/02/12    */
  231. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  232. X  /* NetHack may be freely redistributed.  See license for details. */
  233. X  
  234. X! #include    "hack.h"
  235. X  
  236. X  /* "an uncursed partly eaten guardian naga hatchling corpse" */
  237. X  #define    PREFIX    50
  238. X--- 1,8 ----
  239. X! /*    SCCS Id: @(#)objnam.c    3.1    93/05/15    */
  240. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  241. X  /* NetHack may be freely redistributed.  See license for details. */
  242. X  
  243. X! #include "hack.h"
  244. X  
  245. X  /* "an uncursed partly eaten guardian naga hatchling corpse" */
  246. X  #define    PREFIX    50
  247. X***************
  248. X*** 24,31 ****
  249. X--- 24,39 ----
  250. X  STATIC_OVL struct Jitem Japanese_items[] = {
  251. X      { SHORT_SWORD, "wakizashi" },
  252. X      { BROADSWORD, "ninja-to" },
  253. X+     { FLAIL, "nunchaku" },
  254. X      { GLAIVE, "naginata" },
  255. X      { LOCK_PICK, "osaku" },
  256. X+     { WOODEN_HARP, "koto" },
  257. X+     { KNIFE, "shito" },
  258. X+     { PLATE_MAIL, "tanko" },
  259. X+     { HELMET, "kabuto" },
  260. X+     { LEATHER_GLOVES, "yugake" },
  261. X+     { FOOD_RATION, "gunyoki" },
  262. X+     { POT_BOOZE, "sake" },
  263. X      {0, "" }
  264. X  };
  265. X  
  266. X***************
  267. X*** 182,188 ****
  268. X          actualn = Japanese_item_name(typ);
  269. X  
  270. X      buf[0] = '\0';
  271. X!     if (!Blind) obj->dknown=1;
  272. X      if (obj_is_pname(obj))
  273. X          goto nameit;
  274. X      switch (obj->oclass) {
  275. X--- 190,197 ----
  276. X          actualn = Japanese_item_name(typ);
  277. X  
  278. X      buf[0] = '\0';
  279. X!     if (!Blind) obj->dknown = TRUE;
  280. X!     if (pl_character[0] == 'P') obj->bknown = TRUE;
  281. X      if (obj_is_pname(obj))
  282. X          goto nameit;
  283. X      switch (obj->oclass) {
  284. X***************
  285. X*** 300,307 ****
  286. X                  Strcat(buf, " of ");
  287. X                  if (typ == POT_WATER &&
  288. X                  objects[POT_WATER].oc_name_known &&
  289. X!                 (obj->bknown || pl_character[0] == 'P') &&
  290. X!                 (obj->blessed || obj->cursed)) {
  291. X                  Strcat(buf, obj->blessed ? "holy " : "unholy ");
  292. X                  }
  293. X                  Strcat(buf, actualn);
  294. X--- 309,315 ----
  295. X                  Strcat(buf, " of ");
  296. X                  if (typ == POT_WATER &&
  297. X                  objects[POT_WATER].oc_name_known &&
  298. X!                 obj->bknown && (obj->blessed || obj->cursed)) {
  299. X                  Strcat(buf, obj->blessed ? "holy " : "unholy ");
  300. X                  }
  301. X                  Strcat(buf, actualn);
  302. X***************
  303. X*** 412,417 ****
  304. X--- 420,426 ----
  305. X       * end (Strcat is used on the end)
  306. X       */
  307. X      register char *bp = xname(obj);
  308. X+ 
  309. X      /* When using xname, we want "poisoned arrow", and when using
  310. X       * doname, we want "poisoned +0 arrow".  This kludge is about the only
  311. X       * way to do it, at least until someone overhauls xname() and doname(),
  312. X***************
  313. X*** 430,460 ****
  314. X          Strcpy(prefix, "the ");
  315. X      } else
  316. X          Strcpy(prefix, "a ");
  317. X!     if((obj->bknown || pl_character[0] == 'P') &&
  318. X          (obj->otyp != POT_WATER || !objects[POT_WATER].oc_name_known
  319. X          || (!obj->cursed && !obj->blessed))) {
  320. X          /* allow 'blessed clear potion' if we don't know it's holy water;
  321. X           * always allow "uncursed potion of water"
  322. X           */
  323. X!         if(obj->cursed)
  324. X          Strcat(prefix, "cursed ");
  325. X!         else if(obj->blessed)
  326. X          Strcat(prefix, "blessed ");
  327. X!         else if (((obj->oclass != ARMOR_CLASS
  328. X!             && obj->oclass != WAND_CLASS
  329. X!             && obj->oclass != WEAPON_CLASS
  330. X!             && ((obj->oclass != TOOL_CLASS &&
  331. X!                  obj->oclass != RING_CLASS) ||
  332. X!                  !objects[obj->otyp].oc_charged))
  333. X!                 || !obj->known)
  334. X!         /* For items with charges or +/-, knowing the +/- means that
  335. X!          * the item has been totally identified, and therefore there
  336. X!          * is no doubt as to the object being uncursed if it's
  337. X!          * not described as "blessed" or "cursed".
  338. X           *
  339. X!          * If the +/- isn't known, "uncursed" must be printed to
  340. X!          * avoid ambiguity between an item whose curse status is
  341. X!          * unknown, and an item known to be uncursed.
  342. X           */
  343. X  #ifdef MAIL
  344. X              && obj->otyp != SCR_MAIL
  345. X--- 439,467 ----
  346. X          Strcpy(prefix, "the ");
  347. X      } else
  348. X          Strcpy(prefix, "a ");
  349. X! 
  350. X!     if (obj->bknown && 
  351. X          (obj->otyp != POT_WATER || !objects[POT_WATER].oc_name_known
  352. X          || (!obj->cursed && !obj->blessed))) {
  353. X          /* allow 'blessed clear potion' if we don't know it's holy water;
  354. X           * always allow "uncursed potion of water"
  355. X           */
  356. X!         if (obj->cursed)
  357. X          Strcat(prefix, "cursed ");
  358. X!         else if (obj->blessed)
  359. X          Strcat(prefix, "blessed ");
  360. X!         else if ((!obj->known || !objects[obj->otyp].oc_charged ||
  361. X!               (obj->oclass == ARMOR_CLASS ||
  362. X!                obj->oclass == RING_CLASS))
  363. X!         /* For most items with charges or +/-, if you know how many
  364. X!          * charges are left or what the +/- is, then you must have
  365. X!          * totally identified the item, so "uncursed" is unneccesary,
  366. X!          * because an identified object not described as "blessed" or
  367. X!          * "cursed" must be uncursed.
  368. X           *
  369. X!          * If the charges or +/- is not known, "uncursed" must be
  370. X!          * printed to avoid ambiguity between an item whose curse
  371. X!          * status is unknown, and an item known to be uncursed.
  372. X           */
  373. X  #ifdef MAIL
  374. X              && obj->otyp != SCR_MAIL
  375. X***************
  376. X*** 464,470 ****
  377. X              && pl_character[0] != 'P')
  378. X          Strcat(prefix, "uncursed ");
  379. X      }
  380. X!     if(obj->greased) Strcat(prefix, "greased ");
  381. X      switch(obj->oclass) {
  382. X      case AMULET_CLASS:
  383. X          if(obj->otyp == FAKE_AMULET_OF_YENDOR ||
  384. X--- 471,479 ----
  385. X              && pl_character[0] != 'P')
  386. X          Strcat(prefix, "uncursed ");
  387. X      }
  388. X! 
  389. X!     if (obj->greased) Strcat(prefix, "greased ");
  390. X! 
  391. X      switch(obj->oclass) {
  392. X      case AMULET_CLASS:
  393. X          if(obj->otyp == FAKE_AMULET_OF_YENDOR ||
  394. X***************
  395. X*** 489,495 ****
  396. X              Strcat(prefix,
  397. X                     is_rustprone(obj) ? "rusty " :
  398. X                     is_corrodeable(obj) ? "corroded " :
  399. X!                    is_flammable(obj) ? "burnt " : "eroded ");
  400. X          } else if (obj->rknown && obj->oerodeproof)
  401. X              Strcat(prefix,
  402. X                     is_rustprone(obj) ? "rustproof " :
  403. X--- 498,505 ----
  404. X              Strcat(prefix,
  405. X                     is_rustprone(obj) ? "rusty " :
  406. X                     is_corrodeable(obj) ? "corroded " :
  407. X!                 /* is_flammable(obj) ? "burnt " : "eroded " */
  408. X!                    "damaged ");
  409. X          } else if (obj->rknown && obj->oerodeproof)
  410. X              Strcat(prefix,
  411. X                     is_rustprone(obj) ? "rustproof " :
  412. X***************
  413. X*** 523,534 ****
  414. X              goto plus;
  415. X          if (Is_candle(obj) &&
  416. X              obj->age < 20L * (long)objects[obj->otyp].oc_cost)
  417. X!             Sprintf(eos(prefix), "partly used ");
  418. X          if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP ||
  419. X              obj->otyp == BRASS_LANTERN ||
  420. X              Is_candle(obj) || obj->otyp == CANDELABRUM_OF_INVOCATION) {
  421. X              if(obj->lamplit)
  422. X!                 Sprintf(eos(bp), " (lit)");
  423. X              break;
  424. X          }
  425. X          if(!objects[obj->otyp].oc_charged) break;
  426. X--- 533,544 ----
  427. X              goto plus;
  428. X          if (Is_candle(obj) &&
  429. X              obj->age < 20L * (long)objects[obj->otyp].oc_cost)
  430. X!             Strcat(prefix, "partly used ");
  431. X          if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP ||
  432. X              obj->otyp == BRASS_LANTERN ||
  433. X              Is_candle(obj) || obj->otyp == CANDELABRUM_OF_INVOCATION) {
  434. X              if(obj->lamplit)
  435. X!                 Strcat(bp, " (lit)");
  436. X              break;
  437. X          }
  438. X          if(!objects[obj->otyp].oc_charged) break;
  439. X***************
  440. X*** 573,578 ****
  441. X--- 583,596 ----
  442. X          }
  443. X          break;
  444. X      case BALL_CLASS:
  445. X+     case CHAIN_CLASS:
  446. X+         if (obj->oeroded) {
  447. X+             switch(obj->oeroded) {
  448. X+             case 2: Strcat(prefix, "very "); break;
  449. X+             case 3: Strcat(prefix, "thoroughly "); break;
  450. X+             }
  451. X+             Strcat(prefix, "rusty ");
  452. X+         }
  453. X          if(obj->owornmask & W_BALL)
  454. X              Strcat(bp, " (chained to you)");
  455. X              break;
  456. X***************
  457. X*** 753,764 ****
  458. X      "wand", "ring", "potion", "scroll", "gem", "amulet",
  459. X      "spellbook", "spell book",
  460. X      /* for non-specific wishes */
  461. X!     "weapon", "armor", "tool", "food", "comestible",
  462. X  };
  463. X  static const char wrpsym[] = {
  464. X      WAND_CLASS, RING_CLASS, POTION_CLASS, SCROLL_CLASS, GEM_CLASS, 
  465. X          AMULET_CLASS, SPBOOK_CLASS, SPBOOK_CLASS,
  466. X!     WEAPON_CLASS, ARMOR_CLASS, TOOL_CLASS, FOOD_CLASS, FOOD_CLASS
  467. X  };
  468. X  
  469. X  #endif /* OVLB */
  470. X--- 771,783 ----
  471. X      "wand", "ring", "potion", "scroll", "gem", "amulet",
  472. X      "spellbook", "spell book",
  473. X      /* for non-specific wishes */
  474. X!     "weapon", "armor", "armour", "tool", "food", "comestible",
  475. X  };
  476. X  static const char wrpsym[] = {
  477. X      WAND_CLASS, RING_CLASS, POTION_CLASS, SCROLL_CLASS, GEM_CLASS, 
  478. X          AMULET_CLASS, SPBOOK_CLASS, SPBOOK_CLASS,
  479. X!     WEAPON_CLASS, ARMOR_CLASS, ARMOR_CLASS, TOOL_CLASS, FOOD_CLASS,
  480. X!     FOOD_CLASS
  481. X  };
  482. X  
  483. X  #endif /* OVLB */
  484. X***************
  485. X*** 900,906 ****
  486. X  
  487. X      /* mumak/mumakil */
  488. X      if (len >= 5 && !strcmp(spot-4, "mumak")) {
  489. X!         Strcpy(spot, "il");
  490. X          goto bottom;
  491. X      }
  492. X  
  493. X--- 919,925 ----
  494. X  
  495. X      /* mumak/mumakil */
  496. X      if (len >= 5 && !strcmp(spot-4, "mumak")) {
  497. X!         Strcpy(spot+1, "il");
  498. X          goto bottom;
  499. X      }
  500. X  
  501. X***************
  502. X*** 1017,1022 ****
  503. X--- 1036,1042 ----
  504. X  #ifdef WIZARD
  505. X      { "venom",    VENOM_CLASS,  BLINDING_VENOM, ACID_VENOM },
  506. X  #endif
  507. X+     { "grey stone", GEM_CLASS,    LUCKSTONE,      LOADSTONE },
  508. X  };
  509. X  
  510. X  #define BSTRCMP(base,ptr,string) ((ptr) < base || strcmp((ptr),string))
  511. X***************
  512. X*** 1038,1044 ****
  513. X  
  514. X      if (!oldstr || !*oldstr) {
  515. X          impossible("singular of null?");
  516. X!         str[0] = 0; return str;
  517. X      }
  518. X      Strcpy(str, oldstr);
  519. X      bp = str;
  520. X--- 1058,1065 ----
  521. X  
  522. X      if (!oldstr || !*oldstr) {
  523. X          impossible("singular of null?");
  524. X!         str[0] = 0;
  525. X!         return str;
  526. X      }
  527. X      Strcpy(str, oldstr);
  528. X      bp = str;
  529. X***************
  530. X*** 1126,1131 ****
  531. X--- 1147,1158 ----
  532. X      { "warhammer", WAR_HAMMER },
  533. X      { "grey dragon scale mail", GRAY_DRAGON_SCALE_MAIL },
  534. X      { "grey dragon scales", GRAY_DRAGON_SCALES },
  535. X+     { "enchant armour", SCR_ENCHANT_ARMOR },
  536. X+     { "destroy armour", SCR_DESTROY_ARMOR },
  537. X+     { "scroll of enchant armour", SCR_ENCHANT_ARMOR },
  538. X+     { "scroll of destroy armour", SCR_DESTROY_ARMOR },
  539. X+     { "leather armour", LEATHER_ARMOR },
  540. X+     { "studded leather armour", STUDDED_LEATHER_ARMOR },
  541. X      { "iron ball", HEAVY_IRON_BALL },
  542. X      { "stone", ROCK },
  543. X      { (const char *)0, 0 },
  544. X***************
  545. X*** 1236,1241 ****
  546. X--- 1263,1271 ----
  547. X                 !strncmp(bp, "burned ", l=7) ||
  548. X                 !strncmp(bp, "rotted ", l=7)) {
  549. X              eroded = 1 + very; very = 0;
  550. X+         } else if (!strncmpi(bp, "very ", l=5)) {
  551. X+             /* very rusted very heavy iron ball */
  552. X+             very = 1;
  553. X          } else if (!strncmpi(bp, "partly eaten ", l=13)) {
  554. X              halfeaten = 1;
  555. X          } else break;
  556. X***************
  557. X*** 1407,1424 ****
  558. X          goto typfnd;
  559. X      }
  560. X  
  561. X-     if(!strcmpi(bp, "ring mail") ||    /* Note: ring mail is not a ring ! */
  562. X-        !strcmpi(bp, "leather armor") || /* Prevent falling to 'armor'. */
  563. X-        !strcmpi(bp, "studded leather armor")) {
  564. X-         let = ARMOR_CLASS;
  565. X-         actualn = bp;
  566. X-         goto srch;
  567. X-     }
  568. X-     if(!strcmpi(bp, "food ration")){
  569. X-         let = FOOD_CLASS;
  570. X-         actualn = bp;
  571. X-         goto srch;
  572. X-     }
  573. X      p = eos(bp);
  574. X      if(!BSTRCMPI(bp, p-10, "holy water")) {
  575. X          typ = POT_WATER;
  576. X--- 1437,1442 ----
  577. X***************
  578. X*** 1466,1475 ****
  579. X          let = i;
  580. X          goto any;
  581. X      }
  582. X      if(strncmpi(bp, "enchant ", 8) &&
  583. X         strncmpi(bp, "destroy ", 8) &&
  584. X!        strncmpi(bp, "food detection", 14))
  585. X!     /* allow wishes for "enchant weapon" and "food detection" */
  586. X      for(i = 0; i < sizeof(wrpsym); i++) {
  587. X          register int j = strlen(wrp[i]);
  588. X          if(!strncmpi(bp, wrp[i], j)){
  589. X--- 1484,1501 ----
  590. X          let = i;
  591. X          goto any;
  592. X      }
  593. X+ 
  594. X+     /* Search for class names: XXXXX potion, scroll of XXXXX.  Avoid */
  595. X+     /* false hits on, e.g., rings for "ring mail". */
  596. X      if(strncmpi(bp, "enchant ", 8) &&
  597. X         strncmpi(bp, "destroy ", 8) &&
  598. X!        strncmpi(bp, "food detection", 14) &&
  599. X!        strncmpi(bp, "ring mail", 9) &&
  600. X!        strncmpi(bp, "studded leather arm", 19) &&
  601. X!        strncmpi(bp, "leather arm", 11) &&
  602. X!        strncmpi(bp, "tooled horn", 11) &&
  603. X!        strncmpi(bp, "food ration", 11)
  604. X!     )
  605. X      for(i = 0; i < sizeof(wrpsym); i++) {
  606. X          register int j = strlen(wrp[i]);
  607. X          if(!strncmpi(bp, wrp[i], j)){
  608. X***************
  609. X*** 1502,1507 ****
  610. X--- 1528,1534 ----
  611. X          if (!strncmpi(g, "worthless ", 10)) g += 10;
  612. X          if (!strncmpi(g, "piece of ", 9)) g += 9;
  613. X          if (!strncmpi(g, "colored ", 8)) g += 8;
  614. X+         else if (!strncmpi(g, "coloured ", 9)) g += 9;
  615. X          if (!strcmpi(g, "glass")) {    /* choose random color */
  616. X              /* white, blue, red, yellowish brown, green, violet */
  617. X              typ = LAST_GEM + rnd(6);
  618. X***************
  619. X*** 1858,1864 ****
  620. X      if (ispoisoned) {
  621. X          if (let == WEAPON_CLASS && typ <= SHURIKEN)
  622. X          otmp->opoisoned = (Luck >= 0);
  623. X!         else if (Is_box(otmp))
  624. X          otmp->otrapped = 1;
  625. X          else if (let == FOOD_CLASS)
  626. X          /* try to taint by making it as old as possible */
  627. X--- 1885,1891 ----
  628. X      if (ispoisoned) {
  629. X          if (let == WEAPON_CLASS && typ <= SHURIKEN)
  630. X          otmp->opoisoned = (Luck >= 0);
  631. X!         else if (Is_box(otmp) || typ == TIN)
  632. X          otmp->otrapped = 1;
  633. X          else if (let == FOOD_CLASS)
  634. X          /* try to taint by making it as old as possible */
  635. X***************
  636. X*** 1870,1875 ****
  637. X--- 1897,1903 ----
  638. X          if (otmp->oartifact) otmp->quan = 1L;
  639. X      }
  640. X  
  641. X+ #ifdef MULDGN
  642. X      /* more wishing abuse: don't allow wishing for certain artifacts */
  643. X      /* and make them pay; charge them for the wish anyway! */
  644. X      if ((is_quest_artifact(otmp) || 
  645. X***************
  646. X*** 1881,1889 ****
  647. X          artifact_unexist(otmp);
  648. X          obfree(otmp, (struct obj *) 0);
  649. X          otmp = &zeroobj;
  650. X!         pline("For a moment, you feel something in your %s, but it disappears!", makeplural(body_part(HAND)));
  651. X      }
  652. X!     
  653. X      otmp->owt = weight(otmp);
  654. X      if (very && otmp->otyp == HEAVY_IRON_BALL) otmp->owt += 160;
  655. X      if (halfeaten && otmp->oclass == FOOD_CLASS) {
  656. X--- 1909,1920 ----
  657. X          artifact_unexist(otmp);
  658. X          obfree(otmp, (struct obj *) 0);
  659. X          otmp = &zeroobj;
  660. X!         pline(
  661. X!          "For a moment, you feel something in your %s, but it disappears!",
  662. X!           makeplural(body_part(HAND)));
  663. X      }
  664. X! #endif    /* MULDGN */
  665. X! 
  666. X      otmp->owt = weight(otmp);
  667. X      if (very && otmp->otyp == HEAVY_IRON_BALL) otmp->owt += 160;
  668. X      if (halfeaten && otmp->oclass == FOOD_CLASS) {
  669. X*** /tmp/da11226    Tue Jun  1 16:15:03 1993
  670. X--- src/options.c    Tue Jun  1 11:19:05 1993
  671. X***************
  672. X*** 1,10 ****
  673. X! /*    SCCS Id: @(#)options.c    3.1    93/02/19    */
  674. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  675. X  /* NetHack may be freely redistributed.  See license for details. */
  676. X  
  677. X  #include "hack.h"
  678. X  #include "termcap.h"
  679. X  #include <ctype.h>
  680. X  
  681. X  /*
  682. X   *  NOTE:  If you add (or delete) an option, please update the short
  683. X--- 1,18 ----
  684. X! /*    SCCS Id: @(#)options.c    3.1    93/05/29    */
  685. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  686. X  /* NetHack may be freely redistributed.  See license for details. */
  687. X  
  688. X+ #ifdef OPTION_LISTS_ONLY    /* want option lists for external program */
  689. X+ #include "config.h"
  690. X+ #include "objclass.h"
  691. X+ #include "flag.h"
  692. X+ NEARDATA struct flag flags;    /* provide linkage */
  693. X+ #define static
  694. X+ #else
  695. X  #include "hack.h"
  696. X  #include "termcap.h"
  697. X  #include <ctype.h>
  698. X+ #endif
  699. X  
  700. X  /*
  701. X   *  NOTE:  If you add (or delete) an option, please update the short
  702. X***************
  703. X*** 13,46 ****
  704. X   *  and also the Guidebooks.
  705. X   */
  706. X  
  707. X- #if defined(TOS) && defined(TEXTCOLOR)
  708. X- extern boolean colors_changed;    /* in tos.c */
  709. X- #endif
  710. X- 
  711. X- extern const char *roles[];    /* from u_init.c */
  712. X- extern char inv_order[];    /* from invent.c */
  713. X- 
  714. X- static boolean initial, from_file;
  715. X- 
  716. X- static void FDECL(nmcpy, (char *, const char *, int));
  717. X- static void FDECL(escapes, (const char *, char *));
  718. X- static void FDECL(rejectoption, (const char *));
  719. X- static void FDECL(badoption, (const char *));
  720. X- static char *FDECL(string_for_opt, (char *));
  721. X- static char *FDECL(string_for_env_opt, (const char *, char *));
  722. X- static int FDECL(change_inv_order, (char *));
  723. X- static void FDECL(oc_to_str, (char *, char *));
  724. X- 
  725. X  static struct Bool_Opt
  726. X  {
  727. X      const char *name;
  728. X      boolean    *addr, initvalue;
  729. X  } boolopt[] = {
  730. X  #if defined(MICRO) && !defined(AMIGA)
  731. X      {"BIOS", &flags.BIOS, FALSE},
  732. X  #endif
  733. X  #ifdef INSURANCE
  734. X      {"checkpoint", &flags.ins_chkpt, TRUE},
  735. X  #endif
  736. X  #ifdef TEXTCOLOR
  737. X  # ifdef MICRO
  738. X--- 21,46 ----
  739. X   *  and also the Guidebooks.
  740. X   */
  741. X  
  742. X  static struct Bool_Opt
  743. X  {
  744. X      const char *name;
  745. X      boolean    *addr, initvalue;
  746. X  } boolopt[] = {
  747. X+ #ifdef MFLOPPY
  748. X+     {"asksavedisk", &flags.asksavedisk, FALSE},
  749. X+ #else
  750. X+     {"asksavedisk", (boolean *)0, FALSE},
  751. X+ #endif
  752. X+     {"autopickup", &flags.pickup, TRUE},
  753. X  #if defined(MICRO) && !defined(AMIGA)
  754. X      {"BIOS", &flags.BIOS, FALSE},
  755. X+ #else
  756. X+     {"BIOS", (boolean *)0, FALSE},
  757. X  #endif
  758. X  #ifdef INSURANCE
  759. X      {"checkpoint", &flags.ins_chkpt, TRUE},
  760. X+ #else
  761. X+     {"checkpoint", (boolean *)0, FALSE},
  762. X  #endif
  763. X  #ifdef TEXTCOLOR
  764. X  # ifdef MICRO
  765. X***************
  766. X*** 48,102 ****
  767. X  # else    /* systems that support multiple terminals, many monochrome */
  768. X      {"color", &flags.use_color, FALSE},
  769. X  # endif
  770. X  #endif
  771. X      {"confirm",&flags.confirm, TRUE},
  772. X  #ifdef TERMLIB
  773. X      {"DECgraphics", &flags.DECgraphics, FALSE},
  774. X  #endif
  775. X-     {"disclose", &flags.end_disclose, TRUE},
  776. X      {"female", &flags.female, FALSE},
  777. X      {"fixinv", &flags.invlet_constant, TRUE},
  778. X  #ifdef AMIFLUSH
  779. X      {"flush", &flags.amiflush, FALSE},
  780. X  #endif
  781. X      {"help", &flags.help, TRUE},
  782. X  #ifdef TEXTCOLOR
  783. X      {"hilite_pet", &flags.hilite_pet, FALSE},
  784. X  #endif
  785. X  #ifdef ASCIIGRAPH
  786. X      {"IBMgraphics", &flags.IBMgraphics, FALSE},
  787. X  #endif
  788. X      {"ignintr", &flags.ignintr, FALSE},
  789. X  #ifdef MAC_GRAPHICS_ENV
  790. X      {"large_font", &flags.large_font, FALSE},
  791. X  #endif
  792. X      {"legacy",&flags.legacy, TRUE},
  793. X      {"lit_corridor", &flags.lit_corridor, FALSE},
  794. X  #ifdef MAC_GRAPHICS_ENV
  795. X      {"Macgraphics", &flags.MACgraphics, TRUE},
  796. X  #endif
  797. X  #ifdef NEWS
  798. X      {"news", &flags.news, TRUE},
  799. X  #endif
  800. X      {"null", &flags.null, TRUE},
  801. X      {"number_pad", &flags.num_pad, FALSE},
  802. X  #ifdef MAC
  803. X      {"page_wait", &flags.page_wait, TRUE},
  804. X  #endif
  805. X-     {"pickup", &flags.pickup, TRUE},
  806. X  #ifdef MAC
  807. X      {"popup_dialog", &flags.popup_dialog, FALSE},
  808. X  #endif
  809. X  #if defined(MICRO) && !defined(AMIGA)
  810. X      {"rawio", &flags.rawio, FALSE},
  811. X  #endif
  812. X      {"rest_on_space", &flags.rest_on_space, FALSE},
  813. X      {"safe_pet", &flags.safe_dog, TRUE},
  814. X  #ifdef EXP_ON_BOTL
  815. X      {"showexp", &flags.showexp, FALSE},
  816. X  #endif
  817. X  #ifdef SCORE_ON_BOTL
  818. X      {"showscore", &flags.showscore, FALSE},
  819. X  #endif
  820. X      {"silent", &flags.silent, TRUE},
  821. X      {"sortpack", &flags.sortpack, TRUE},
  822. X--- 48,126 ----
  823. X  # else    /* systems that support multiple terminals, many monochrome */
  824. X      {"color", &flags.use_color, FALSE},
  825. X  # endif
  826. X+ #else
  827. X+     {"color", (boolean *)0, FALSE},
  828. X  #endif
  829. X      {"confirm",&flags.confirm, TRUE},
  830. X  #ifdef TERMLIB
  831. X      {"DECgraphics", &flags.DECgraphics, FALSE},
  832. X+ #else
  833. X+     {"DECgraphics", (boolean *)0, FALSE},
  834. X  #endif
  835. X      {"female", &flags.female, FALSE},
  836. X      {"fixinv", &flags.invlet_constant, TRUE},
  837. X  #ifdef AMIFLUSH
  838. X      {"flush", &flags.amiflush, FALSE},
  839. X+ #else
  840. X+     {"flush", (boolean *)0, FALSE},
  841. X  #endif
  842. X      {"help", &flags.help, TRUE},
  843. X  #ifdef TEXTCOLOR
  844. X      {"hilite_pet", &flags.hilite_pet, FALSE},
  845. X+ #else
  846. X+     {"hilite_pet", (boolean *)0, FALSE},
  847. X  #endif
  848. X  #ifdef ASCIIGRAPH
  849. X      {"IBMgraphics", &flags.IBMgraphics, FALSE},
  850. X+ #else
  851. X+     {"IBMgraphics", (boolean *)0, FALSE},
  852. X  #endif
  853. X      {"ignintr", &flags.ignintr, FALSE},
  854. X  #ifdef MAC_GRAPHICS_ENV
  855. X      {"large_font", &flags.large_font, FALSE},
  856. X+ #else
  857. X+     {"large_font", (boolean *)0, FALSE},
  858. X  #endif
  859. X      {"legacy",&flags.legacy, TRUE},
  860. X      {"lit_corridor", &flags.lit_corridor, FALSE},
  861. X  #ifdef MAC_GRAPHICS_ENV
  862. X      {"Macgraphics", &flags.MACgraphics, TRUE},
  863. X+ #else
  864. X+     {"Macgraphics", (boolean *)0, FALSE},
  865. X  #endif
  866. X  #ifdef NEWS
  867. X      {"news", &flags.news, TRUE},
  868. X+ #else
  869. X+     {"news", (boolean *)0, FALSE},
  870. X  #endif
  871. X      {"null", &flags.null, TRUE},
  872. X      {"number_pad", &flags.num_pad, FALSE},
  873. X  #ifdef MAC
  874. X      {"page_wait", &flags.page_wait, TRUE},
  875. X+ #else
  876. X+     {"page_wait", (boolean *)0, FALSE},
  877. X  #endif
  878. X  #ifdef MAC
  879. X      {"popup_dialog", &flags.popup_dialog, FALSE},
  880. X+ #else
  881. X+     {"popup_dialog", (boolean *)0, FALSE},
  882. X  #endif
  883. X  #if defined(MICRO) && !defined(AMIGA)
  884. X      {"rawio", &flags.rawio, FALSE},
  885. X+ #else
  886. X+     {"rawio", (boolean *)0, FALSE},
  887. X  #endif
  888. X      {"rest_on_space", &flags.rest_on_space, FALSE},
  889. X      {"safe_pet", &flags.safe_dog, TRUE},
  890. X  #ifdef EXP_ON_BOTL
  891. X      {"showexp", &flags.showexp, FALSE},
  892. X+ #else
  893. X+     {"showexp", (boolean *)0, FALSE},
  894. X  #endif
  895. X  #ifdef SCORE_ON_BOTL
  896. X      {"showscore", &flags.showscore, FALSE},
  897. X+ #else
  898. X+     {"showscore", (boolean *)0, FALSE},
  899. X  #endif
  900. X      {"silent", &flags.silent, TRUE},
  901. X      {"sortpack", &flags.sortpack, TRUE},
  902. X***************
  903. X*** 108,115 ****
  904. X--- 132,195 ----
  905. X      {NULL, (boolean *)0, FALSE}
  906. X  };
  907. X  
  908. X+ /* compound options, for option_help() and external programs like Amiga
  909. X+  * frontend */
  910. X+ static struct Comp_Opt
  911. X+ {
  912. X+     const char *name, *descr;
  913. X+ } compopt[] = {
  914. X+     { "catname",  "the name of your (first) cat (e.g., catname:Tabby)," },
  915. X+     { "disclose", "the kinds of information to disclose at end of game," },
  916. X+     { "dogname",  "the name of your (first) dog (e.g., dogname:Fang)," },
  917. X+ #ifdef TUTTI_FRUTTI
  918. X+     { "fruit",    "the name of a fruit you enjoy eating," },
  919. X+ #endif
  920. X+     { "graphics", "the symbols to use in drawing the dungeon map," },
  921. X+     { "monsters", "the symbols to use for monsters," },
  922. X+     { "msghistory", "number of top line messages to save," },
  923. X+     { "name",     "your character's name (e.g., name:Merlin-W)," },
  924. X+     { "objects",  "the symbols to use for objects," },
  925. X+     { "packorder", "the inventory order of the items in your pack," },
  926. X+ #ifdef CHANGE_COLOR
  927. X+     { "palette",  "palette (00c/880/-fff is blue/yellow/reverse white)," },
  928. X+ # if defined(MAC)
  929. X+     { "hicolor",  "same as palette, only order is reversed," },
  930. X+ # endif
  931. X+ #endif
  932. X+     { "pettype",  "your preferred initial pet type," },
  933. X+     { "pickup_types", "types of objects to pick up automatically," },
  934. X+     { "scores",   "the parts of the score list you wish to see," },
  935. X+     { "windowtype", "windowing system to use." },
  936. X+     { NULL, NULL }
  937. X+ };
  938. X+ 
  939. X+ #ifndef OPTION_LISTS_ONLY    /* use rest of file */
  940. X+ 
  941. X  static boolean need_redraw; /* for doset() */
  942. X  
  943. X+ #if defined(TOS) && defined(TEXTCOLOR)
  944. X+ extern boolean colors_changed;    /* in tos.c */
  945. X+ #endif
  946. X+ 
  947. X+ extern const char *roles[];    /* from u_init.c */
  948. X+ 
  949. X+ static char def_inv_order[MAXOCLASSES] = {
  950. X+     AMULET_CLASS, WEAPON_CLASS, ARMOR_CLASS, FOOD_CLASS, SCROLL_CLASS,
  951. X+     SPBOOK_CLASS, POTION_CLASS, RING_CLASS, WAND_CLASS, TOOL_CLASS, 
  952. X+     GEM_CLASS, ROCK_CLASS, BALL_CLASS, CHAIN_CLASS, 0,
  953. X+ };
  954. X+ 
  955. X+ static boolean initial, from_file;
  956. X+ 
  957. X+ static void FDECL(nmcpy, (char *, const char *, int));
  958. X+ static void FDECL(escapes, (const char *, char *));
  959. X+ static void FDECL(rejectoption, (const char *));
  960. X+ static void FDECL(badoption, (const char *));
  961. X+ static char *FDECL(string_for_opt, (char *,BOOLEAN_P));
  962. X+ static char *FDECL(string_for_env_opt, (const char *, char *,BOOLEAN_P));
  963. X+ static int FDECL(change_inv_order, (char *));
  964. X+ static void FDECL(oc_to_str, (char *, char *));
  965. X+ 
  966. X  void
  967. X  initoptions()
  968. X  {
  969. X***************
  970. X*** 128,137 ****
  971. X      /* Set the default monster and object class symbols.  Don't use */
  972. X      /* memcpy() --- sizeof char != sizeof uchar on some machines.    */
  973. X      for (i = 0; i < MAXOCLASSES; i++)
  974. X!             oc_syms[i] = (uchar) def_oc_syms[i];
  975. X      for (i = 0; i < MAXMCLASSES; i++)
  976. X!             monsyms[i] = (uchar) def_monsyms[i];
  977. X  
  978. X      switch_graphics(ASCII_GRAPHICS);    /* set default characters */
  979. X  #if defined(UNIX) && defined(TTY_GRAPHICS)
  980. X      /*
  981. X--- 208,222 ----
  982. X      /* Set the default monster and object class symbols.  Don't use */
  983. X      /* memcpy() --- sizeof char != sizeof uchar on some machines.    */
  984. X      for (i = 0; i < MAXOCLASSES; i++)
  985. X!         oc_syms[i] = (uchar) def_oc_syms[i];
  986. X      for (i = 0; i < MAXMCLASSES; i++)
  987. X!         monsyms[i] = (uchar) def_monsyms[i];
  988. X  
  989. X+      /* assert( sizeof flags.inv_order == sizeof def_inv_order ); */
  990. X+     (void)memcpy((genericptr_t)flags.inv_order,
  991. X+              (genericptr_t)def_inv_order, sizeof flags.inv_order);
  992. X+     flags.pickup_types[0] = '\0';
  993. X+ 
  994. X      switch_graphics(ASCII_GRAPHICS);    /* set default characters */
  995. X  #if defined(UNIX) && defined(TTY_GRAPHICS)
  996. X      /*
  997. X***************
  998. X*** 153,159 ****
  999. X  # ifdef TTY_GRAPHICS
  1000. X      /* detect whether a "vt" terminal can handle alternate charsets */
  1001. X      if (!strncmpi(getenv("TERM"), "vt", 2) && (AS && AE) &&
  1002. X!         !strcmp(AS, "\016") && !strcmp(AE, "\017")) {
  1003. X          switch_graphics(DEC_GRAPHICS);
  1004. X      }
  1005. X  # endif
  1006. X--- 238,244 ----
  1007. X  # ifdef TTY_GRAPHICS
  1008. X      /* detect whether a "vt" terminal can handle alternate charsets */
  1009. X      if (!strncmpi(getenv("TERM"), "vt", 2) && (AS && AE) &&
  1010. X!         index(AS, '\016') && index(AE, '\017')) {
  1011. X          switch_graphics(DEC_GRAPHICS);
  1012. X      }
  1013. X  # endif
  1014. X***************
  1015. X*** 170,176 ****
  1016. X  #endif
  1017. X      opts = getenv("NETHACKOPTIONS");
  1018. X      if (!opts) opts = getenv("HACKOPTIONS");
  1019. X!     if (opts)
  1020. X          if (*opts == '/' || *opts == '\\' || *opts == '@') {
  1021. X              if (*opts == '@') opts++;    /* @filename */
  1022. X              /* looks like a filename */
  1023. X--- 255,261 ----
  1024. X  #endif
  1025. X      opts = getenv("NETHACKOPTIONS");
  1026. X      if (!opts) opts = getenv("HACKOPTIONS");
  1027. X!     if (opts) {
  1028. X          if (*opts == '/' || *opts == '\\' || *opts == '@') {
  1029. X              if (*opts == '@') opts++;    /* @filename */
  1030. X              /* looks like a filename */
  1031. X***************
  1032. X*** 179,186 ****
  1033. X              read_config_file(NULL);
  1034. X              parseoptions(opts, TRUE, FALSE);
  1035. X          }
  1036. X!     else
  1037. X          read_config_file(NULL);
  1038. X  #ifdef AMIGA
  1039. X      ami_wbench_init();    /* must be here or can't set fruit */
  1040. X  #endif
  1041. X--- 264,272 ----
  1042. X              read_config_file(NULL);
  1043. X              parseoptions(opts, TRUE, FALSE);
  1044. X          }
  1045. X!     } else {
  1046. X          read_config_file(NULL);
  1047. X+     }
  1048. X  #ifdef AMIGA
  1049. X      ami_wbench_init();    /* must be here or can't set fruit */
  1050. X  #endif
  1051. X***************
  1052. X*** 319,332 ****
  1053. X  }
  1054. X  
  1055. X  static char *
  1056. X! string_for_opt(opts)
  1057. X  char *opts;
  1058. X  {
  1059. X      register char *colon;
  1060. X  
  1061. X      colon = index(opts, ':');
  1062. X      if(!colon) {
  1063. X!         badoption(opts);
  1064. X          return NULL;
  1065. X      }
  1066. X      return ++colon;
  1067. X--- 405,419 ----
  1068. X  }
  1069. X  
  1070. X  static char *
  1071. X! string_for_opt(opts, val_optional)
  1072. X  char *opts;
  1073. X+ boolean val_optional;
  1074. X  {
  1075. X      register char *colon;
  1076. X  
  1077. X      colon = index(opts, ':');
  1078. X      if(!colon) {
  1079. X!         if (!val_optional) badoption(opts);
  1080. X          return NULL;
  1081. X      }
  1082. X      return ++colon;
  1083. X***************
  1084. X*** 333,347 ****
  1085. X  }
  1086. X  
  1087. X  static char *
  1088. X! string_for_env_opt(optname, opts)
  1089. X  const char *optname;
  1090. X  char *opts;
  1091. X  {
  1092. X      if(!initial) {
  1093. X          rejectoption(optname);
  1094. X          return NULL;
  1095. X      }
  1096. X!     return string_for_opt(opts);
  1097. X  }
  1098. X  
  1099. X  /*
  1100. X--- 420,435 ----
  1101. X  }
  1102. X  
  1103. X  static char *
  1104. X! string_for_env_opt(optname, opts, val_optional)
  1105. X  const char *optname;
  1106. X  char *opts;
  1107. X+ boolean val_optional;
  1108. X  {
  1109. X      if(!initial) {
  1110. X          rejectoption(optname);
  1111. X          return NULL;
  1112. X      }
  1113. X!     return string_for_opt(opts, val_optional);
  1114. X  }
  1115. X  
  1116. X  /*
  1117. X***************
  1118. X*** 364,370 ****
  1119. X  
  1120. X      /* Remove bad or duplicate entries. */
  1121. X      if (oc_sym == MAXOCLASSES ||
  1122. X!         (!index(inv_order, oc_sym)) || (index(sp+1, *sp)))
  1123. X  
  1124. X          return 0;
  1125. X  
  1126. X--- 452,458 ----
  1127. X  
  1128. X      /* Remove bad or duplicate entries. */
  1129. X      if (oc_sym == MAXOCLASSES ||
  1130. X!         (!index(flags.inv_order, oc_sym)) || (index(sp+1, *sp)))
  1131. X  
  1132. X          return 0;
  1133. X  
  1134. X***************
  1135. X*** 371,382 ****
  1136. X      *sp = (char) oc_sym;
  1137. X      } 
  1138. X      Strcpy(buf, op);
  1139. X!     for (sp = inv_order, num = strlen(buf); *sp; sp++)
  1140. X!     if (!index(buf, *sp))
  1141. X          buf[num++] = *sp;
  1142. X  
  1143. X      buf[num] = 0;
  1144. X!     Strcpy(inv_order, buf);
  1145. X      return 1;
  1146. X  }
  1147. X  
  1148. X--- 459,472 ----
  1149. X      *sp = (char) oc_sym;
  1150. X      } 
  1151. X      Strcpy(buf, op);
  1152. X!     for (sp = flags.inv_order, num = strlen(buf); *sp; sp++)
  1153. X!     if (!index(buf, *sp)) {
  1154. X          buf[num++] = *sp;
  1155. X+         buf[num] = '\0';    /* explicitly terminate for next index() */
  1156. X+     }
  1157. X  
  1158. X      buf[num] = 0;
  1159. X!     Strcpy(flags.inv_order, buf);
  1160. X      return 1;
  1161. X  }
  1162. X  
  1163. X***************
  1164. X*** 438,444 ****
  1165. X      /* compound options */
  1166. X  
  1167. X      if (!strncmpi(opts, "pettype", 3)) {
  1168. X!         if ((op = string_for_env_opt("pettype", opts)) != 0)
  1169. X              switch (*op) {
  1170. X              case 'd':    /* dog */
  1171. X              case 'D':
  1172. X--- 528,534 ----
  1173. X      /* compound options */
  1174. X  
  1175. X      if (!strncmpi(opts, "pettype", 3)) {
  1176. X!         if ((op = string_for_env_opt("pettype", opts, FALSE)) != 0)
  1177. X              switch (*op) {
  1178. X              case 'd':    /* dog */
  1179. X              case 'D':
  1180. X***************
  1181. X*** 458,483 ****
  1182. X      }
  1183. X  
  1184. X      if (!strncmpi(opts, "catname", 3)) {
  1185. X!         if ((op = string_for_env_opt("catname", opts)) != 0)
  1186. X              nmcpy(catname, op, 62);
  1187. X          return;
  1188. X      }
  1189. X  
  1190. X      if (!strncmpi(opts, "dogname", 3)) {
  1191. X!         if ((op = string_for_env_opt("dogname", opts)) != 0)
  1192. X              nmcpy(dogname, op, 62);
  1193. X          return;
  1194. X      }
  1195. X  
  1196. X      if (!strncmpi(opts, "msghistory", 3)) {
  1197. X!         if ((op = string_for_env_opt("msghistory", opts)) != 0) {
  1198. X              flags.msg_history = atoi(op);
  1199. X          }
  1200. X          return;
  1201. X      }
  1202. X  #ifdef TUTTI_FRUTTI
  1203. X      if (!strncmpi(opts, "fruit", 2)) {
  1204. X!         if (!(op = string_for_opt(opts))) return;
  1205. X          if (!initial) {
  1206. X              struct fruit *f;
  1207. X  
  1208. X--- 548,640 ----
  1209. X      }
  1210. X  
  1211. X      if (!strncmpi(opts, "catname", 3)) {
  1212. X!         if ((op = string_for_env_opt("catname", opts, FALSE)) != 0)
  1213. X              nmcpy(catname, op, 62);
  1214. X          return;
  1215. X      }
  1216. X  
  1217. X      if (!strncmpi(opts, "dogname", 3)) {
  1218. X!         if ((op = string_for_env_opt("dogname", opts, FALSE)) != 0)
  1219. X              nmcpy(dogname, op, 62);
  1220. X          return;
  1221. X      }
  1222. X  
  1223. X      if (!strncmpi(opts, "msghistory", 3)) {
  1224. X!         if ((op = string_for_env_opt("msghistory", opts, FALSE)) != 0) {
  1225. X              flags.msg_history = atoi(op);
  1226. X          }
  1227. X          return;
  1228. X      }
  1229. X+ 
  1230. X+ #ifdef CHANGE_COLOR
  1231. X+     if (!strncmpi(opts, "palette", 3)
  1232. X+ # ifdef MAC
  1233. X+                     || !strncmpi(opts, "hicolor", 3)
  1234. X+ # endif
  1235. X+                                     ) {
  1236. X+         int color_number, color_incr;
  1237. X+ # ifdef MAC
  1238. X+         if (!strncmpi(opts, "hicolor", 3)) {
  1239. X+         color_number = MAXCOLORS + 4;    /* HARDCODED inverse number */
  1240. X+         color_incr = -1;
  1241. X+         } else {
  1242. X+ # endif
  1243. X+         color_number = 0;
  1244. X+         color_incr = 1;
  1245. X+ # ifdef MAC
  1246. X+         }
  1247. X+ # endif
  1248. X+         if ((op = string_for_opt(opts, FALSE)) != NULL) {
  1249. X+         char *pt = op;
  1250. X+         int cnt, tmp, reverse;
  1251. X+         long rgb;
  1252. X+ 
  1253. X+         while (*pt && color_number >= 0) {
  1254. X+             cnt = 3;
  1255. X+             rgb = 0L;
  1256. X+             if (*pt == '-') {
  1257. X+             reverse = 1;
  1258. X+             pt++;
  1259. X+             } else {
  1260. X+             reverse = 0;
  1261. X+             }
  1262. X+             while (cnt-- > 0) {
  1263. X+             if (*pt && *pt != '/') {
  1264. X+ # ifdef AMIGA
  1265. X+                 rgb <<= 4;
  1266. X+ # else
  1267. X+                 rgb <<= 8;
  1268. X+ # endif
  1269. X+                 tmp = *(pt++);
  1270. X+                 if (isalpha(tmp)) {
  1271. X+                 tmp = (tmp + 9) & 0xf;    /* Assumes ASCII... */
  1272. X+                 } else {
  1273. X+                 tmp &= 0xf;    /* Digits in ASCII too... */
  1274. X+                 }
  1275. X+ # ifndef AMIGA
  1276. X+                 /* Add an extra so we fill f -> ff and 0 -> 00 */
  1277. X+                 rgb += tmp << 4;
  1278. X+ # endif
  1279. X+                 rgb += tmp;
  1280. X+             }
  1281. X+             }
  1282. X+             if (*pt == '/') {
  1283. X+             pt++;
  1284. X+             }
  1285. X+             change_color(color_number, rgb, reverse);
  1286. X+             color_number += color_incr;
  1287. X+         }
  1288. X+         }
  1289. X+         if (!initial) {
  1290. X+         need_redraw = TRUE;
  1291. X+         }
  1292. X+         return;
  1293. X+     }
  1294. X+ #endif
  1295. X+ 
  1296. X  #ifdef TUTTI_FRUTTI
  1297. X      if (!strncmpi(opts, "fruit", 2)) {
  1298. X!         if (!(op = string_for_opt(opts, FALSE))) return;
  1299. X          if (!initial) {
  1300. X              struct fruit *f;
  1301. X  
  1302. X***************
  1303. X*** 510,516 ****
  1304. X          uchar translate[MAXPCHARS+1];
  1305. X          int length;
  1306. X  
  1307. X!         if (!(opts = string_for_env_opt("graphics", opts)))
  1308. X              return;
  1309. X          escapes(opts, opts);
  1310. X  
  1311. X--- 667,673 ----
  1312. X          uchar translate[MAXPCHARS+1];
  1313. X          int length;
  1314. X  
  1315. X!         if (!(opts = string_for_env_opt("graphics", opts, FALSE)))
  1316. X              return;
  1317. X          escapes(opts, opts);
  1318. X  
  1319. X***************
  1320. X*** 527,533 ****
  1321. X      if (!strncmpi(opts, "objects", 7)) {
  1322. X          int length;
  1323. X  
  1324. X!         if (!(opts = string_for_env_opt("objects", opts)))
  1325. X              return;
  1326. X          escapes(opts, opts);
  1327. X  
  1328. X--- 684,690 ----
  1329. X      if (!strncmpi(opts, "objects", 7)) {
  1330. X          int length;
  1331. X  
  1332. X!         if (!(opts = string_for_env_opt("objects", opts, FALSE)))
  1333. X              return;
  1334. X          escapes(opts, opts);
  1335. X  
  1336. X***************
  1337. X*** 553,559 ****
  1338. X      if (!strncmpi(opts, "monsters", 8)) {
  1339. X          int length;
  1340. X  
  1341. X!         if (!(opts = string_for_env_opt("monsters", opts)))
  1342. X              return;
  1343. X          escapes(opts, opts);
  1344. X  
  1345. X--- 710,716 ----
  1346. X      if (!strncmpi(opts, "monsters", 8)) {
  1347. X          int length;
  1348. X  
  1349. X!         if (!(opts = string_for_env_opt("monsters", opts, FALSE)))
  1350. X              return;
  1351. X          escapes(opts, opts);
  1352. X  
  1353. X***************
  1354. X*** 569,575 ****
  1355. X  
  1356. X      /* name:string */
  1357. X      if (!strncmpi(opts, "name", 4)) {
  1358. X!         if ((op = string_for_env_opt("name", opts)) != 0)
  1359. X              nmcpy(plname, op, (int)sizeof(plname)-1);
  1360. X          return;
  1361. X      }
  1362. X--- 726,732 ----
  1363. X  
  1364. X      /* name:string */
  1365. X      if (!strncmpi(opts, "name", 4)) {
  1366. X!         if ((op = string_for_env_opt("name", opts, FALSE)) != 0)
  1367. X              nmcpy(plname, op, (int)sizeof(plname)-1);
  1368. X          return;
  1369. X      }
  1370. X***************
  1371. X*** 576,591 ****
  1372. X  
  1373. X      /* the order to list the pack */
  1374. X      if (!strncmpi(opts, "packorder", 4)) {
  1375. X!         if (!(op = string_for_opt(opts))) return;
  1376. X  
  1377. X          if (!change_inv_order(op))
  1378. X!                 badoption(opts);
  1379. X          return;
  1380. X      }
  1381. X  
  1382. X      /* scores:5t[op] 5a[round] o[wn] */
  1383. X      if (!strncmpi(opts, "scores", 6)) {
  1384. X!         if (!(op = string_for_opt(opts))) return;
  1385. X  
  1386. X          while (*op) {
  1387. X              num = 1;
  1388. X--- 733,808 ----
  1389. X  
  1390. X      /* the order to list the pack */
  1391. X      if (!strncmpi(opts, "packorder", 4)) {
  1392. X!         if (!(op = string_for_opt(opts, FALSE))) return;
  1393. X  
  1394. X          if (!change_inv_order(op))
  1395. X!             badoption(opts);
  1396. X          return;
  1397. X      }
  1398. X  
  1399. X+     /* types of objects to pick up automatically */
  1400. X+     if (!strncmpi(opts, "pickup_types", 4)) {
  1401. X+         int oc_sym;
  1402. X+         boolean badopt = FALSE, compat = (strlen(opts) <= 6);
  1403. X+ 
  1404. X+         flags.pickup_types[0] = '\0';    /* all */
  1405. X+         if (!(op = string_for_opt(opts, compat))) {
  1406. X+             /* for backwards compatibility, "pickup" without a value
  1407. X+                is a synonym for boolean autopickup, and pickup_types
  1408. X+                gets reset to "all"                    */
  1409. X+             flags.pickup = !negated;
  1410. X+             return;
  1411. X+         }
  1412. X+ 
  1413. X+         while (*op == ' ') op++;
  1414. X+         if (*op != 'a' && *op != 'A') {
  1415. X+             num = 0;
  1416. X+             while (*op) {
  1417. X+             oc_sym = def_char_to_objclass(*op);
  1418. X+             /* make sure all are valid obj symbols occuring once */
  1419. X+             if (oc_sym != MAXOCLASSES &&
  1420. X+                 !index(flags.pickup_types, oc_sym)) {
  1421. X+                 flags.pickup_types[num] = (char)oc_sym;
  1422. X+                 flags.pickup_types[++num] = '\0';
  1423. X+             } else
  1424. X+                 badopt = TRUE;
  1425. X+             op++;
  1426. X+             }
  1427. X+             if (badopt) badoption(opts);
  1428. X+         }
  1429. X+         return;
  1430. X+     }
  1431. X+ 
  1432. X+     /* things to disclose at end of game */
  1433. X+     if (!strncmpi(opts, "disclose", 4)) {
  1434. X+         flags.end_disclose[0] = '\0';    /* all */
  1435. X+         if (!(op = string_for_opt(opts, TRUE))) {
  1436. X+             /* for backwards compatibility, "disclose" without a
  1437. X+              * value means all (was inventory and attributes,
  1438. X+              * the only things available then), but negated
  1439. X+              * it means "none"
  1440. X+              * (note "none" contains none of "iavkg")
  1441. X+              */
  1442. X+             if (negated) Strcpy(flags.end_disclose, "none");
  1443. X+             return;
  1444. X+         }
  1445. X+         num = 0;
  1446. X+         while (*op && num < sizeof flags.end_disclose - 1) {
  1447. X+             register char c;
  1448. X+             c = lowc(*op);
  1449. X+             if (c == 'k') c = 'v';    /* killed -> vanquished */
  1450. X+             if (!index(flags.end_disclose, c)) {
  1451. X+                 flags.end_disclose[num++] = c;
  1452. X+                 flags.end_disclose[num] = '\0';    /* for index */
  1453. X+             }
  1454. X+             op++;
  1455. X+         }
  1456. X+         return;
  1457. X+     }
  1458. X+ 
  1459. X      /* scores:5t[op] 5a[round] o[wn] */
  1460. X      if (!strncmpi(opts, "scores", 6)) {
  1461. X!         if (!(op = string_for_opt(opts, FALSE))) return;
  1462. X  
  1463. X          while (*op) {
  1464. X              num = 1;
  1465. X***************
  1466. X*** 622,628 ****
  1467. X      }
  1468. X  
  1469. X      if (!strncmpi(opts, "windowtype", 3)) {
  1470. X!         if ((op = string_for_env_opt("windowtype", opts)) != 0) {
  1471. X          char buf[16];
  1472. X          nmcpy(buf, op, 15);
  1473. X          choose_windows(buf);
  1474. X--- 839,845 ----
  1475. X      }
  1476. X  
  1477. X      if (!strncmpi(opts, "windowtype", 3)) {
  1478. X!         if ((op = string_for_env_opt("windowtype", opts, FALSE)) != 0) {
  1479. X          char buf[16];
  1480. X          nmcpy(buf, op, 15);
  1481. X          choose_windows(buf);
  1482. X***************
  1483. X*** 634,642 ****
  1484. X       * options list
  1485. X       */
  1486. X      for (i = 0; boolopt[i].name; i++) {
  1487. X!         if (boolopt[i].addr && strlen(opts) >= 3 &&
  1488. X              !strncmpi(boolopt[i].name, opts, strlen(opts))) {
  1489. X!                 /* options that must come from config file */
  1490. X              if (!initial &&
  1491. X                  ((boolopt[i].addr) == &flags.legacy
  1492. X  #if defined(MICRO) && !defined(AMIGA)
  1493. X--- 851,866 ----
  1494. X       * options list
  1495. X       */
  1496. X      for (i = 0; boolopt[i].name; i++) {
  1497. X!         if (strlen(opts) >= 3 &&
  1498. X              !strncmpi(boolopt[i].name, opts, strlen(opts))) {
  1499. X!             /* options that don't exist */
  1500. X!             if (!boolopt[i].addr) {
  1501. X!                 if (!initial && !negated)
  1502. X!                 pline("The \"%s\" option is not available.",
  1503. X!                     boolopt[i].name);
  1504. X!                 return;
  1505. X!             }
  1506. X!             /* options that must come from config file */
  1507. X              if (!initial &&
  1508. X                  ((boolopt[i].addr) == &flags.legacy
  1509. X  #if defined(MICRO) && !defined(AMIGA)
  1510. X***************
  1511. X*** 763,769 ****
  1512. X      *dest = '\0';
  1513. X  }
  1514. X  
  1515. X! #ifdef MICRO
  1516. X  # define OPTIONS_HEADING "OPTIONS"
  1517. X  #else
  1518. X  # define OPTIONS_HEADING "NETHACKOPTIONS"
  1519. X--- 987,993 ----
  1520. X      *dest = '\0';
  1521. X  }
  1522. X  
  1523. X! #if defined(MICRO) || defined(MAC)
  1524. X  # define OPTIONS_HEADING "OPTIONS"
  1525. X  #else
  1526. X  # define OPTIONS_HEADING "NETHACKOPTIONS"
  1527. X***************
  1528. X*** 772,778 ****
  1529. X  int
  1530. X  doset()
  1531. X  {
  1532. X!     char buf[BUFSZ], pack_order[MAXOCLASSES+1], on_off;
  1533. X      const char *opt_name;
  1534. X      int i;
  1535. X      winid tmpwin;
  1536. X--- 996,1002 ----
  1537. X  int
  1538. X  doset()
  1539. X  {
  1540. X!     char buf[BUFSZ], ocl[MAXOCLASSES+1], on_off;
  1541. X      const char *opt_name;
  1542. X      int i;
  1543. X      winid tmpwin;
  1544. X***************
  1545. X*** 806,811 ****
  1546. X--- 1030,1038 ----
  1547. X          Sprintf(buf, " catname: %s",
  1548. X              (catname[0] != 0) ? catname : "(null)");
  1549. X          putstr(tmpwin, 0, buf);
  1550. X+         Sprintf(buf, " disclose: %s",
  1551. X+             (flags.end_disclose[0]) ? flags.end_disclose : "all");
  1552. X+         putstr(tmpwin, 0, buf);
  1553. X          Sprintf(buf, " dogname: %s",
  1554. X              (dogname[0] != 0) ? dogname : "(null)");
  1555. X          putstr(tmpwin, 0, buf);
  1556. X***************
  1557. X*** 817,828 ****
  1558. X          putstr(tmpwin, 0, buf);
  1559. X          Sprintf(buf, " name: %s", plname);
  1560. X          putstr(tmpwin, 0, buf);
  1561. X!         oc_to_str(inv_order, pack_order);
  1562. X!         Sprintf(buf, " packorder: %s", pack_order);
  1563. X          putstr(tmpwin, 0, buf);
  1564. X          Sprintf(buf, " pettype: %s", preferred_pet == 'c' ? "cat" :
  1565. X                      preferred_pet == 'd' ? "dog" : "random");
  1566. X          putstr(tmpwin, 0, buf);
  1567. X          Sprintf(buf, " scores: %utop/%uaround%s",
  1568. X                  flags.end_top, flags.end_around,
  1569. X                  (flags.end_own ? "/own" : ""));
  1570. X--- 1044,1062 ----
  1571. X          putstr(tmpwin, 0, buf);
  1572. X          Sprintf(buf, " name: %s", plname);
  1573. X          putstr(tmpwin, 0, buf);
  1574. X!         oc_to_str(flags.inv_order, ocl);
  1575. X!         Sprintf(buf, " packorder: %s", ocl);
  1576. X          putstr(tmpwin, 0, buf);
  1577. X+ #ifdef CHANGE_COLOR
  1578. X+         Sprintf(buf, " palette: %s", get_color_string());
  1579. X+         putstr(tmpwin, 0, buf);
  1580. X+ #endif
  1581. X          Sprintf(buf, " pettype: %s", preferred_pet == 'c' ? "cat" :
  1582. X                      preferred_pet == 'd' ? "dog" : "random");
  1583. X          putstr(tmpwin, 0, buf);
  1584. X+         oc_to_str(flags.pickup_types, ocl);
  1585. X+         Sprintf(buf, " pickup_types: %s", (ocl[0]) ? ocl : "all");
  1586. X+         putstr(tmpwin, 0, buf);
  1587. X          Sprintf(buf, " scores: %utop/%uaround%s",
  1588. X                  flags.end_top, flags.end_around,
  1589. X                  (flags.end_own ? "/own" : ""));
  1590. X***************
  1591. X*** 847,855 ****
  1592. X  }
  1593. X  
  1594. X  int
  1595. X! dotogglepickup() {
  1596. X      flags.pickup = !flags.pickup;
  1597. X!     pline("Pickup: %s.", flags.pickup ? "ON" : "OFF");
  1598. X      return 0;
  1599. X  }
  1600. X  
  1601. X--- 1081,1098 ----
  1602. X  }
  1603. X  
  1604. X  int
  1605. X! dotogglepickup()
  1606. X! {
  1607. X!     char buf[BUFSZ], ocl[MAXOCLASSES+1];
  1608. X! 
  1609. X      flags.pickup = !flags.pickup;
  1610. X!     if (flags.pickup) {
  1611. X!         oc_to_str(flags.pickup_types, ocl);
  1612. X!         Sprintf(buf, "ON, for %s objects", ocl[0] ? ocl : "all");
  1613. X!     } else {
  1614. X!         Strcpy(buf, "OFF");
  1615. X!     }
  1616. X!     pline("Autopickup: %s.", buf);
  1617. X      return 0;
  1618. X  }
  1619. X  
  1620. X***************
  1621. X*** 860,898 ****
  1622. X      "",
  1623. X  #define CONFIG_SLOT 3    /* fill in next value at run-time */
  1624. X      NULL,
  1625. X! #ifndef MICRO
  1626. X      "or use `NETHACKOPTIONS=\"<options>\"' in your environment;",
  1627. X  # ifdef VMS
  1628. X!     "-- for example, $ DEFINE NETHACKOPTIONS \"nopickup,fruit:kumquat\"",
  1629. X  # endif
  1630. X  #endif
  1631. X      "or press \"O\" while playing, and type your <options> at the prompt.",
  1632. X!     "In either case, <options> is a list of options separated by commas.",
  1633. X      "",
  1634. X   "Boolean options (which can be negated by prefixing them with '!' or \"no\"):",
  1635. X      NULL
  1636. X  };
  1637. X! static const char *opt_compound[] = {
  1638. X!     "Compound options:",
  1639. X!     "`catname'   - the name of your (first) cat (e.g., catname:Tabby),",
  1640. X!     "`dogname'   - the name of your (first) dog (e.g., dogname:Fang),",
  1641. X! #ifdef TUTTI_FRUTTI
  1642. X!     "`fruit'     - the name of a fruit you enjoy eating,",
  1643. X! # define FRUIT_OFFSET 1
  1644. X! #else
  1645. X! # define FRUIT_OFFSET 0
  1646. X! #endif
  1647. X!     "`graphics'  - defines the symbols to use in drawing the dungeon map,",
  1648. X!     "`monsters'  - defines the symbols to use for monsters,",
  1649. X!     "`msghistory'- number of top line messages to save,",
  1650. X!     "`name'      - your character's name (e.g., name:Merlin-W),",
  1651. X!     "`objects'   - defines the symbols to use for objects,",
  1652. X!     "`packorder' - the inventory order of the items in your pack",
  1653. X! #define PCKORD_SLOT 9+FRUIT_OFFSET
  1654. X!     NULL,
  1655. X!     "`pettype'   - your preferred initial pet type,",
  1656. X!     "`scores'    - the parts of the score list you wish to see,",
  1657. X!     "`windowtype'- windowing system to use.",
  1658. X      "",
  1659. X   "Some of the options can be set only before the game is started.  You will",
  1660. X      "be so informed, if you attempt to set them while in the game.",
  1661. X--- 1103,1122 ----
  1662. X      "",
  1663. X  #define CONFIG_SLOT 3    /* fill in next value at run-time */
  1664. X      NULL,
  1665. X! #if !defined(MICRO) && !defined(MAC)
  1666. X      "or use `NETHACKOPTIONS=\"<options>\"' in your environment;",
  1667. X  # ifdef VMS
  1668. X!     "-- for example, $ DEFINE NETHACKOPTIONS \"noautopickup,fruit:kumquat\"",
  1669. X  # endif
  1670. X  #endif
  1671. X      "or press \"O\" while playing, and type your <options> at the prompt.",
  1672. X!     "In all cases, <options> is a list of options separated by commas.",
  1673. X      "",
  1674. X   "Boolean options (which can be negated by prefixing them with '!' or \"no\"):",
  1675. X      NULL
  1676. X  };
  1677. X! 
  1678. X! static const char *opt_epilog[] = {
  1679. X      "",
  1680. X   "Some of the options can be set only before the game is started.  You will",
  1681. X      "be so informed, if you attempt to set them while in the game.",
  1682. X***************
  1683. X*** 902,909 ****
  1684. X  void
  1685. X  option_help()
  1686. X  {
  1687. X!     char    buf[BUFSZ], pack_order[MAXOCLASSES+1];
  1688. X!     register int    i;
  1689. X      winid datawin;
  1690. X  
  1691. X      datawin = create_nhwindow(NHW_TEXT);
  1692. X--- 1126,1133 ----
  1693. X  void
  1694. X  option_help()
  1695. X  {
  1696. X!     char buf[BUFSZ], buf2[BUFSZ];
  1697. X!     register int i;
  1698. X      winid datawin;
  1699. X  
  1700. X      datawin = create_nhwindow(NHW_TEXT);
  1701. X***************
  1702. X*** 925,939 ****
  1703. X      next_opt(datawin, "");
  1704. X  
  1705. X      /* Compound options */
  1706. X!     oc_to_str(inv_order, pack_order);
  1707. X!     Sprintf(buf, "              (currently, packorder:%s ),", pack_order);
  1708. X! #if 0
  1709. X!     assert( opt_compound[PCKORD_SLOT] == NULL );
  1710. X! #endif
  1711. X!     opt_compound[PCKORD_SLOT] = (const char *) buf;
  1712. X!     for (i = 0; opt_compound[i]; i++)
  1713. X!     putstr(datawin, 0, opt_compound[i]);
  1714. X  
  1715. X      display_nhwindow(datawin, FALSE);
  1716. X      destroy_nhwindow(datawin);
  1717. X      return;
  1718. X--- 1149,1164 ----
  1719. X      next_opt(datawin, "");
  1720. X  
  1721. X      /* Compound options */
  1722. X!     putstr(datawin, 0, "Compound options:");
  1723. X!     for (i = 0; compopt[i].name; i++) {
  1724. X!     Sprintf(buf2, "`%s'", compopt[i].name);
  1725. X!     Sprintf(buf, "%-14s - %s", buf2, compopt[i].descr);
  1726. X!     putstr(datawin, 0, buf);
  1727. X!     }
  1728. X  
  1729. X+     for (i = 0; opt_epilog[i]; i++)
  1730. X+     putstr(datawin, 0, opt_epilog[i]);
  1731. X+ 
  1732. X      display_nhwindow(datawin, FALSE);
  1733. X      destroy_nhwindow(datawin);
  1734. X      return;
  1735. X***************
  1736. X*** 1047,1051 ****
  1737. X--- 1272,1278 ----
  1738. X      return f->fid;
  1739. X  }
  1740. X  #endif
  1741. X+ 
  1742. X+ #endif    /* OPTION_LISTS_ONLY */
  1743. X  
  1744. X  /*options.c*/
  1745. X*** /tmp/da11234    Tue Jun  1 16:15:06 1993
  1746. X--- src/pager.c    Fri May 28 11:32:07 1993
  1747. X***************
  1748. X*** 1,4 ****
  1749. X! /*    SCCS Id: @(#)pager.c    3.1    93/02/04    */
  1750. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1751. X  /* NetHack may be freely redistributed.  See license for details. */
  1752. X  
  1753. X--- 1,4 ----
  1754. X! /*    SCCS Id: @(#)pager.c    3.1    93/05/26    */
  1755. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1756. X  /* NetHack may be freely redistributed.  See license for details. */
  1757. X  
  1758. X***************
  1759. X*** 5,17 ****
  1760. X  /* This file contains the command routines dowhatis() and dohelp() and */
  1761. X  /* a few other help related facilities */
  1762. X  
  1763. X! #include    "hack.h"
  1764. X  
  1765. X  #ifndef SEEK_SET
  1766. X  #define SEEK_SET 0
  1767. X  #endif
  1768. X  
  1769. X! static boolean FDECL(is_swallow_sym, (UCHAR_P));
  1770. X  static int FDECL(append_str, (char *, const char *));
  1771. X  static void FDECL(lookat, (int, int, char *));
  1772. X  static void FDECL(checkfile, (char *, BOOLEAN_P));
  1773. X--- 5,17 ----
  1774. X  /* This file contains the command routines dowhatis() and dohelp() and */
  1775. X  /* a few other help related facilities */
  1776. X  
  1777. X! #include "hack.h"
  1778. X  
  1779. X  #ifndef SEEK_SET
  1780. X  #define SEEK_SET 0
  1781. X  #endif
  1782. X  
  1783. X! static boolean FDECL(is_swallow_sym, (int));
  1784. X  static int FDECL(append_str, (char *, const char *));
  1785. X  static void FDECL(lookat, (int, int, char *));
  1786. X  static void FDECL(checkfile, (char *, BOOLEAN_P));
  1787. X***************
  1788. X*** 24,34 ****
  1789. X  /* Returns "true" for characters that could represent a monster's stomach. */
  1790. X  static boolean
  1791. X  is_swallow_sym(c)
  1792. X!     uchar c;
  1793. X  {
  1794. X      int i;
  1795. X      for (i = S_sw_tl; i <= S_sw_br; i++)
  1796. X!     if (showsyms[i] == c) return TRUE;
  1797. X      return FALSE;
  1798. X  }
  1799. X  
  1800. X--- 24,34 ----
  1801. X  /* Returns "true" for characters that could represent a monster's stomach. */
  1802. X  static boolean
  1803. X  is_swallow_sym(c)
  1804. X! int c;
  1805. X  {
  1806. X      int i;
  1807. X      for (i = S_sw_tl; i <= S_sw_br; i++)
  1808. X!     if ((int)showsyms[i] == c) return TRUE;
  1809. X      return FALSE;
  1810. X  }
  1811. X  
  1812. X***************
  1813. X*** 68,74 ****
  1814. X      buf[0] = 0;
  1815. X      glyph = glyph_at(x,y);
  1816. X      if (u.ux == x && u.uy == y && canseeself()) {
  1817. X!     Sprintf(buf, "%s called %s",
  1818. X  #ifdef POLYSELF
  1819. X          u.mtimedone ? mons[u.umonnum].mname :
  1820. X  #endif
  1821. X--- 68,75 ----
  1822. X      buf[0] = 0;
  1823. X      glyph = glyph_at(x,y);
  1824. X      if (u.ux == x && u.uy == y && canseeself()) {
  1825. X!     Sprintf(buf, "%s%s called %s",
  1826. X!         Invis ? "invisible " : "",
  1827. X  #ifdef POLYSELF
  1828. X          u.mtimedone ? mons[u.umonnum].mname :
  1829. X  #endif
  1830. X***************
  1831. X*** 115,123 ****
  1832. X          }
  1833. X      } else
  1834. X          Strcpy(buf, distant_name(otmp, xname));
  1835. X      }
  1836. X      else if (glyph_is_trap(glyph)) {
  1837. X!     if (trap = t_at(x, y)) {
  1838. X          if (trap->ttyp == WEB)
  1839. X          Strcpy(buf, "web");
  1840. X          else {
  1841. X--- 116,135 ----
  1842. X          }
  1843. X      } else
  1844. X          Strcpy(buf, distant_name(otmp, xname));
  1845. X+ 
  1846. X+     if (levl[x][y].typ == STONE || levl[x][y].typ == SCORR)
  1847. X+         Strcat(buf, " embedded in stone");
  1848. X+     else if (IS_WALL(levl[x][y].typ) || levl[x][y].typ == SDOOR)
  1849. X+         Strcat(buf, " embedded in a wall");
  1850. X+     else if (closed_door(x,y))
  1851. X+         Strcat(buf, " embedded in a door");
  1852. X+     else if (is_pool(x,y))
  1853. X+         Strcat(buf, " in water");
  1854. X+     else if (is_lava(x,y))
  1855. X+         Strcat(buf, " in molten lava");    /* [can this ever happen?] */
  1856. X      }
  1857. X      else if (glyph_is_trap(glyph)) {
  1858. X!     if ((trap = t_at(x, y)) != 0) {
  1859. X          if (trap->ttyp == WEB)
  1860. X          Strcpy(buf, "web");
  1861. X          else {
  1862. X***************
  1863. X*** 126,132 ****
  1864. X          /* strip leading garbage */
  1865. X          for (s = buf; *s && *s != ' '; s++) ;
  1866. X          if (*s) ++s;
  1867. X!         for (t = buf; *t++ = *s++; ) ;
  1868. X          }
  1869. X      }
  1870. X      }
  1871. X--- 138,144 ----
  1872. X          /* strip leading garbage */
  1873. X          for (s = buf; *s && *s != ' '; s++) ;
  1874. X          if (*s) ++s;
  1875. X!         for (t = buf; (*t++ = *s++) != 0; ) ;
  1876. X          }
  1877. X      }
  1878. X      }
  1879. X***************
  1880. X*** 296,305 ****
  1881. X      boolean need_to_look;    /* need to get explan. from glyph */
  1882. X      static const char *mon_interior = "the interior of a monster";
  1883. X  
  1884. X- #ifdef GCC_WARN
  1885. X-     sym = 0;
  1886. X- #endif
  1887. X- 
  1888. X      if (quick) {
  1889. X      from_screen = TRUE;    /* yes, we want to use the cursor */
  1890. X      } else {
  1891. X--- 308,313 ----
  1892. X***************
  1893. X*** 311,316 ****
  1894. X--- 319,325 ----
  1895. X      if (from_screen) {
  1896. X      cc.x = u.ux;
  1897. X      cc.y = u.uy;
  1898. X+     sym = 0;        /* gcc -Wall lint */
  1899. X      } else {
  1900. X      getlin("Specify what? (type the word)", out_str);
  1901. X      if (out_str[0] == '\0' || out_str[0] == '\033')
  1902. X***************
  1903. X*** 357,365 ****
  1904. X          } else if (glyph_is_trap(glyph)) {
  1905. X          sym = showsyms[(glyph_to_trap(glyph) == WEB) ? S_web : S_trap];
  1906. X          } else if (glyph_is_object(glyph)) {
  1907. X!         sym = oc_syms[objects[glyph_to_obj(glyph)].oc_class];
  1908. X          } else if (glyph_is_monster(glyph)) {
  1909. X!         sym = monsyms[mons[glyph_to_mon(glyph)].mlet];
  1910. X          } else if (glyph_is_swallow(glyph)) {
  1911. X          sym = showsyms[glyph_to_swallow(glyph)+S_sw_tl];
  1912. X          } else {
  1913. X--- 366,374 ----
  1914. X          } else if (glyph_is_trap(glyph)) {
  1915. X          sym = showsyms[(glyph_to_trap(glyph) == WEB) ? S_web : S_trap];
  1916. X          } else if (glyph_is_object(glyph)) {
  1917. X!         sym = oc_syms[(int)objects[glyph_to_obj(glyph)].oc_class];
  1918. X          } else if (glyph_is_monster(glyph)) {
  1919. X!         sym = monsyms[(int)mons[glyph_to_mon(glyph)].mlet];
  1920. X          } else if (glyph_is_swallow(glyph)) {
  1921. X          sym = showsyms[glyph_to_swallow(glyph)+S_sw_tl];
  1922. X          } else {
  1923. X***************
  1924. X*** 393,399 ****
  1925. X       * and looking at something other than our own symbol, then just say
  1926. X       * "the interior of a monster".
  1927. X       */
  1928. X!     if (u.uswallow && from_screen && is_swallow_sym((uchar) sym)) {
  1929. X          if (!found) {
  1930. X          Sprintf(out_str, "%c       %s", sym, mon_interior);
  1931. X          firstmatch = mon_interior;
  1932. X--- 402,408 ----
  1933. X       * and looking at something other than our own symbol, then just say
  1934. X       * "the interior of a monster".
  1935. X       */
  1936. X!     if (u.uswallow && from_screen && is_swallow_sym(sym)) {
  1937. X          if (!found) {
  1938. X          Sprintf(out_str, "%c       %s", sym, mon_interior);
  1939. X          firstmatch = mon_interior;
  1940. END_OF_FILE
  1941. if test 55370 -ne `wc -c <'patches02f'`; then
  1942.     echo shar: \"'patches02f'\" unpacked with wrong size!
  1943. fi
  1944. # end of 'patches02f'
  1945. if test -f 'sys/winnt/winnt.cnf' -a "${1}" != "-c" ; then 
  1946.   echo shar: Renaming existing file \"'sys/winnt/winnt.cnf'\" to \"'sys/winnt/winnt.cnf.orig'\"
  1947.   mv -f 'sys/winnt/winnt.cnf' 'sys/winnt/winnt.cnf.orig'
  1948. fi
  1949. echo shar: Extracting \"'sys/winnt/winnt.cnf'\" \(3017 characters\)
  1950. sed "s/^X//" >'sys/winnt/winnt.cnf' <<'END_OF_FILE'
  1951. X# NetHack.cnf file for Windows NT
  1952. X# A '#' at the beginning of a line means the rest of the line is a comment.
  1953. X#
  1954. X# To change the configuration, comment out the unwanted lines, and
  1955. X# uncomment the configuration you want.
  1956. X
  1957. X
  1958. X# *** OPTIONS ***
  1959. X#
  1960. X# Some options to set personal preferences.  Uncomment and change these to
  1961. X# suit your personal preference.  If several people are to use the same
  1962. X# configuration, options like these should not be set.
  1963. X#
  1964. X#OPTIONS=name:Janet-V,female,dogname:Fido,catname:Morris,fruit:apricot
  1965. X#OPTIONS=packorder:")[%?+/=!(*0_`,scores:10 top/2 around/own
  1966. X#
  1967. X#
  1968. X# Other general options.  You might also set "silent" so as not to attract
  1969. X# the boss's attention.
  1970. X#
  1971. XOPTIONS=time,rest_on_space,noautopickup,number_pad
  1972. X
  1973. X
  1974. X# *** HARD DISK CONFIGURATION ***
  1975. X#
  1976. XHACKDIR=c:\games\nethack
  1977. X#
  1978. X#   LEVELS and SAVE default to HACKDIR
  1979. X#
  1980. X#LEVELS=c:\games\nethack\bones
  1981. X#SAVE=c:\games\nethack\bones;n
  1982. X#
  1983. X#   appending a ";n" to SAVE means don't prompt to insert a disk.
  1984. XSAVE=;n
  1985. X#
  1986. X# *** CHARACTER GRAPHICS ***
  1987. X#
  1988. X# The 69 GRAPHICS characters (0-68) are:
  1989. X#
  1990. X# stone,
  1991. X# walls: vertical, horizontal,
  1992. X#     4 corners: top left, top right, bottom left, bottom right,
  1993. X#     cross wall,
  1994. X#     4 T walls: upward, downward, left, right,
  1995. X# doors: no door,
  1996. X#     open doors: vertical, horizontal,
  1997. X#     closed doors: vertical, horizontal,
  1998. X# floor,
  1999. X# corridors: unlit, lit,
  2000. X# stairs up, stairs down, ladder up, ladder down,
  2001. X# trap, web, altar, throne, sink, fountain, pool/moat, ice, lava,
  2002. X# lowered drawbridge: vertical, horizontal,
  2003. X# raised drawbridge: vertical, horizontal,
  2004. X# air, cloud, water,
  2005. X# 4 beams: vertical, horizontal, left slant, right slant,
  2006. X# digging beam, camera flash beam, left boomerang, right boomerang,
  2007. X# 4 magic shield display symbols,
  2008. X# 8 swallowed: top left/middle/right, mid left/right, bottom left/mid/right,
  2009. X# 9 explosion: [3 rows (top, middle, bottom) of 3 characters]
  2010. X#
  2011. X# If you specify fewer that 69 ASCII values, the remaining characters will be
  2012. X# set to their respective defaults:
  2013. X#       ' '  |   -   -   -   -   -   -   -   -
  2014. X#           |   |   .   -   |   +   +   .   #   #
  2015. X#        <   >   <   >   ^   "   _   \   #   {
  2016. X#        }   .   }   .   .   #   #  ' '  #   }
  2017. X#        |   -   \   /   *   !   )   (   0   #
  2018. X#        @   *   /   -   \   |   |   \   -   /
  2019. X#        /   -   \   |  ' '  |   \   -   /
  2020. X#
  2021. X#
  2022. X# An example using the IBM graphics character set:
  2023. XGRAPHICS= 032 186 205 201 187 200 188 206 202 203 \
  2024. X       185 204 249 239 239 254 254 249 177 177 \
  2025. X       060 062 060 062 094 034 095 092 035 244 \
  2026. X       247 249 247 042 042 179 196 046 035 247 \
  2027. X       179 196 092 047 042 033 041 040 048 035 \
  2028. X       064 042 047 045 092 058 058 092 045 047 \
  2029. X       047 045 092 058 032 058 092 045 047
  2030. X
  2031. X# An alternative:
  2032. X#GRAPHICS= 032 179 196 218 191 192 217 197 193 194 \
  2033. X#       180 195 249 239 239 254 254 249 177 177 \
  2034. X#       060 062 060 062 094 157 220 190 035 244 \
  2035. X#       247 249 247 042 042 186 205 046 035 247 \
  2036. X#       179 196 092 047 042 033 041 040 048 035 \
  2037. X#       064 042 047 045 092 058 058 092 045 047 \
  2038. X#       047 045 092 058 032 058 092 045 047
  2039. END_OF_FILE
  2040. if test 3017 -ne `wc -c <'sys/winnt/winnt.cnf'`; then
  2041.     echo shar: \"'sys/winnt/winnt.cnf'\" unpacked with wrong size!
  2042. fi
  2043. # end of 'sys/winnt/winnt.cnf'
  2044. echo shar: End of archive 10 \(of 33\).
  2045. cp /dev/null ark10isdone
  2046. MISSING=""
  2047. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
  2048.     if test ! -f ark${I}isdone ; then
  2049.     MISSING="${MISSING} ${I}"
  2050.     fi
  2051. done
  2052. if test "${MISSING}" = "" ; then
  2053.     echo You have unpacked all 33 archives.
  2054.     echo "Now execute ./patchit.sh"
  2055.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2056. else
  2057.     echo You still need to unpack the following archives:
  2058.     echo "        " ${MISSING}
  2059. fi
  2060. ##  End of shell archive.
  2061. exit 0
  2062.