home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / games / volume16 / nethack31 / patch2d / patches02d
Text File  |  1993-06-16  |  57KB  |  2,043 lines

  1. *** /tmp/da10978    Tue Jun  1 16:13:38 1993
  2. --- src/exper.c    Wed Mar  3 14:21:59 1993
  3. ***************
  4. *** 24,29 ****
  5. --- 24,32 ----
  6.   experience(mtmp, nk)    /* return # of exp points for mtmp after nk killed */
  7.       register struct    monst *mtmp;
  8.       register int    nk;
  9. + #if defined(applec)
  10. + # pragma unused(nk)
  11. + #endif
  12.   {
  13.       register struct permonst *ptr = mtmp->data;
  14.       int    i, tmp, tmp2;
  15. *** /tmp/da10986    Tue Jun  1 16:13:40 1993
  16. --- src/explode.c    Mon May 17 14:04:31 1993
  17. ***************
  18. *** 1,4 ****
  19. ! /*    SCCS Id: @(#)explode.c 3.1    93/02/17
  20.   /*    Copyright (C) 1990 by Ken Arromdee */
  21.   /* NetHack may be freely redistributed.  See license for details. */
  22.   
  23. --- 1,4 ----
  24. ! /*    SCCS Id: @(#)explode.c 3.1    93/05/15    */
  25.   /*    Copyright (C) 1990 by Ken Arromdee */
  26.   /* NetHack may be freely redistributed.  See license for details. */
  27.   
  28. ***************
  29. *** 5,14 ****
  30.   #include "hack.h"
  31.   
  32.   /* Note: Arrays are column first, while the screen is row first */
  33. ! static int expl[3][3] = 
  34. ! { S_explode1, S_explode4, S_explode7,
  35. !   S_explode2, S_explode5, S_explode8,
  36. !   S_explode3, S_explode6, S_explode9 };
  37.   
  38.   /* Note: I had to choose one of three possible kinds of "type" when writing
  39.    * this function: a wand type (like in zap.c), an adtyp, or an object type.
  40. --- 5,15 ----
  41.   #include "hack.h"
  42.   
  43.   /* Note: Arrays are column first, while the screen is row first */
  44. ! static int expl[3][3] = {
  45. !     { S_explode1, S_explode4, S_explode7 },
  46. !     { S_explode2, S_explode5, S_explode8 },
  47. !     { S_explode3, S_explode6, S_explode9 }
  48. ! };
  49.   
  50.   /* Note: I had to choose one of three possible kinds of "type" when writing
  51.    * this function: a wand type (like in zap.c), an adtyp, or an object type.
  52. ***************
  53. *** 68,74 ****
  54.               }
  55.           }
  56.           /* can be both you and mtmp if you're swallowed */
  57. !         if (mtmp = m_at(i+x-1, j+y-1)) {
  58.               switch(adtyp) {
  59.               case AD_FIRE:
  60.                   explmask[i][j] = resists_fire(mtmp->data)
  61. --- 69,75 ----
  62.               }
  63.           }
  64.           /* can be both you and mtmp if you're swallowed */
  65. !         if ((mtmp = m_at(i+x-1, j+y-1)) != 0) {
  66.               switch(adtyp) {
  67.               case AD_FIRE:
  68.                   explmask[i][j] = resists_fire(mtmp->data)
  69. ***************
  70. *** 83,89 ****
  71.                   explmask[i][j] = 0;
  72.                   break;
  73.               }
  74. !         } else if (i+x-1 != u.ux || j+j-1 != u.uy)
  75.               explmask[i][j] = 0;
  76.   
  77.           if (cansee(i+x-1, j+y-1)) visible = TRUE;
  78. --- 84,90 ----
  79.                   explmask[i][j] = 0;
  80.                   break;
  81.               }
  82. !         } else if (i+x-1 != u.ux || j+y-1 != u.uy)
  83.               explmask[i][j] = 0;
  84.   
  85.           if (cansee(i+x-1, j+y-1)) visible = TRUE;
  86. *** /tmp/da11002    Tue Jun  1 16:13:44 1993
  87. --- src/files.c    Mon May 24 12:32:37 1993
  88. ***************
  89. *** 449,470 ****
  90.   
  91.   /* ----------  BEGIN FILE COMPRESSION HANDLING ----------- */
  92.   
  93.   /* compress file */
  94.   void
  95.   compress(filename)
  96.   const char *filename;
  97.   {
  98.   #ifdef COMPRESS
  99. !     char cmd[80];
  100. !     Strcpy(cmd, COMPRESS);
  101. !     Strcat(cmd, " ");
  102. ! # ifdef COMPRESS_OPTIONS
  103. !     Strcat(cmd, COMPRESS_OPTIONS);
  104. !     Strcat(cmd, " ");
  105. ! # endif
  106. !     Strcat(cmd,filename);
  107. !     (void) system(cmd);
  108.   #endif
  109.   }
  110.   
  111. --- 449,534 ----
  112.   
  113.   /* ----------  BEGIN FILE COMPRESSION HANDLING ----------- */
  114.   
  115. + #ifdef COMPRESS
  116. + /* 
  117. +  * using system() is simpler, but opens up security holes and causes
  118. +  * problems on at least Interactive UNIX 3.0.1 (SVR3.2), where any
  119. +  * setuid is renounced by /bin/sh, so the files cannot be accessed.
  120. +  *
  121. +  * cf. child() in unixunix.c.
  122. +  */
  123. + void
  124. + docompress_file(filename, uncomp)
  125. + char *filename;
  126. + boolean uncomp;
  127. + {
  128. +     char *args[10];
  129. + # ifdef COMPRESS_OPTIONS
  130. +     char opts[80];
  131. + # endif
  132. +     int i = 0;
  133. +     int f;
  134. +     args[0] = COMPRESS;
  135. +     if (uncomp) args[++i] = "-d";    /* uncompress */
  136. + # ifdef COMPRESS_OPTIONS
  137. +     {
  138. +         /* we can't guarantee there's only one additional option, sigh */
  139. +         char *opt;
  140. +         boolean inword = FALSE;
  141. +         Strcpy(opts, COMPRESS_OPTIONS);
  142. +         opt = opts;
  143. +         while (*opt) {
  144. +         if ((*opt == ' ') || (*opt == '\t')) {
  145. +             if (inword) {
  146. +             *opt = '\0';
  147. +             inword = FALSE;
  148. +             }
  149. +         } else if (!inword) {
  150. +             args[++i] = opt;
  151. +             inword = TRUE;
  152. +         }
  153. +         opt++;
  154. +         }
  155. +     }
  156. + # endif
  157. +     args[++i] = filename;
  158. +     args[++i] = NULL;
  159. +     f = fork();
  160. +     if (f == 0) {    /* child */
  161. +         (void) execv(args[0], args);
  162. +         perror(NULL);
  163. +         pline("Exec to %scompress %s failed.",
  164. +             uncomp ? "un" : "", filename);
  165. +         exit(1);
  166. +     } else if (f == -1) {
  167. +         perror(NULL);
  168. +         pline("Fork to %scompress %s failed.",
  169. +             uncomp ? "un" : "", filename);
  170. +         return;
  171. +     }
  172. +     (void) signal(SIGINT, SIG_IGN);
  173. +     (void) signal(SIGQUIT, SIG_IGN);
  174. +     (void) wait((int *)0);
  175. +     (void) signal(SIGINT, (SIG_RET_TYPE) done1);
  176. + # ifdef WIZARD
  177. +     if (wizard) (void) signal(SIGQUIT, SIG_DFL);
  178. + # endif
  179. + }
  180. + #endif
  181.   /* compress file */
  182.   void
  183.   compress(filename)
  184.   const char *filename;
  185. + #ifdef applec
  186. + # pragma unused(filename)
  187. + #endif
  188.   {
  189.   #ifdef COMPRESS
  190. !     docompress_file(filename, FALSE);
  191.   #endif
  192.   }
  193.   
  194. ***************
  195. *** 473,497 ****
  196.   void
  197.   uncompress(filename)
  198.   const char *filename;
  199.   {
  200.   #ifdef COMPRESS
  201. !     char cmd[80], cfn[80];
  202.       int fd;
  203.   
  204. !     Strcpy(cfn,filename);
  205.   # ifdef COMPRESS_EXTENSION
  206. !     Strcat(cfn,COMPRESS_EXTENSION);
  207.   # endif
  208. !     if((fd = open(cfn,O_RDONLY)) >= 0) {
  209. !         (void) close(fd);
  210. !         Strcpy(cmd, COMPRESS);
  211. !         Strcat(cmd, " -d ");        /* uncompress */
  212. ! # ifdef COMPRESS_OPTIONS
  213. !         Strcat(cmd, COMPRESS_OPTIONS);
  214. !         Strcat(cmd, " ");
  215. ! # endif
  216. !         Strcat(cmd,cfn);
  217. !         (void) system(cmd);
  218.       }
  219.   #endif
  220.   }
  221. --- 537,557 ----
  222.   void
  223.   uncompress(filename)
  224.   const char *filename;
  225. + #ifdef applec
  226. + # pragma unused(filename)
  227. + #endif
  228.   {
  229.   #ifdef COMPRESS
  230. !     char cfn[80];
  231.       int fd;
  232.   
  233. !     Strcpy(cfn, filename);
  234.   # ifdef COMPRESS_EXTENSION
  235. !     Strcat(cfn, COMPRESS_EXTENSION);
  236.   # endif
  237. !     if ((fd = open(cfn, O_RDONLY)) >= 0) {
  238. !         (void) close(fd);
  239. !         docompress_file(cfn, TRUE);
  240.       }
  241.   #endif
  242.   }
  243. ***************
  244. *** 540,545 ****
  245. --- 600,608 ----
  246.   lock_file(filename, retryct)
  247.   const char *filename;
  248.   int retryct;
  249. + #ifdef applec
  250. + # pragma unused(filename, retryct)
  251. + #endif
  252.   {
  253.   #if defined(UNIX) || defined(VMS)
  254.       char *lockname;
  255. ***************
  256. *** 609,614 ****
  257. --- 672,680 ----
  258.   void
  259.   unlock_file(filename)
  260.   const char *filename;
  261. + #if defined(applec)
  262. + # pragma unused(filename)
  263. + #endif
  264.   {
  265.   #if defined(UNIX) || defined(VMS)
  266.       char *lockname;
  267. ***************
  268. *** 658,666 ****
  269.   #endif
  270.   
  271.       /* "filename" is an environment variable, so it should hang around */
  272. !     if (filename && ((fp = fopenp(filename, "r")) != (FILE *)0)) {
  273. !         configfile = filename;
  274. !         return(fp);
  275.       }
  276.   
  277.   #if defined(MICRO) || defined(MAC)
  278. --- 724,748 ----
  279.   #endif
  280.   
  281.       /* "filename" is an environment variable, so it should hang around */
  282. !     if (filename) {
  283. ! #ifdef UNIX
  284. !         if (access(filename, 4) == -1) {
  285. !             /* 4 is R_OK on newer systems */
  286. !             /* nasty sneaky attempt to read file through
  287. !              * NetHack's setuid permissions -- this is the only
  288. !              * place a file name may be wholly under the player's
  289. !              * control
  290. !              */
  291. !             raw_printf("Access to %s denied (%d).",
  292. !                     filename, errno);
  293. !             wait_synch();
  294. !             /* fall through to standard names */
  295. !         } else
  296. ! #endif
  297. !         if ((fp = fopenp(filename, "r")) != (FILE *)0) {
  298. !             configfile = filename;
  299. !             return(fp);
  300. !         }
  301.       }
  302.   
  303.   #if defined(MICRO) || defined(MAC)
  304. ***************
  305. *** 752,757 ****
  306. --- 834,842 ----
  307.   char        *buf;
  308.   char        *tmp_ramdisk;
  309.   char        *tmp_levels;
  310. + #if defined(applec)
  311. + # pragma unused(tmp_ramdisk,tmp_levels)
  312. + #endif
  313.   {
  314.       char        *bufp, *altp;
  315.   
  316. ***************
  317. *** 798,813 ****
  318.           (void) strncpy(tmp_levels, bufp, PATHLEN);
  319.   
  320.       } else if (!strncmpi(buf, "SAVE", 4)) {
  321.           char *ptr;
  322.           if (ptr = index(bufp, ';')) {
  323.               *ptr = '\0';
  324.   # ifdef MFLOPPY
  325.               if (*(ptr+1) == 'n' || *(ptr+1) == 'N') {
  326. -                 extern    int saveprompt;
  327.                   saveprompt = FALSE;
  328.               }
  329.   # endif
  330. !     }
  331.           (void) strncpy(SAVEP, bufp, PATHLEN);
  332.           append_slash(SAVEP);
  333.   #endif /* MICRO */
  334. --- 883,905 ----
  335.           (void) strncpy(tmp_levels, bufp, PATHLEN);
  336.   
  337.       } else if (!strncmpi(buf, "SAVE", 4)) {
  338. + # ifdef MFLOPPY
  339. +         extern    int saveprompt;
  340. + #endif
  341.           char *ptr;
  342.           if (ptr = index(bufp, ';')) {
  343.               *ptr = '\0';
  344.   # ifdef MFLOPPY
  345.               if (*(ptr+1) == 'n' || *(ptr+1) == 'N') {
  346.                   saveprompt = FALSE;
  347.               }
  348.   # endif
  349. !         }
  350. ! #ifdef    MFLOPPY
  351. !         else
  352. !             saveprompt = flags.asksavedisk;
  353. ! #endif
  354.           (void) strncpy(SAVEP, bufp, PATHLEN);
  355.           append_slash(SAVEP);
  356.   #endif /* MICRO */
  357. ***************
  358. *** 836,854 ****
  359.           (void) get_uchars(fp, buf, bufp, &(monsyms[1]),
  360.                       MAXMCLASSES-1, "MONSTERS");
  361.   #ifdef AMIGA
  362.       } else if (!strncmpi(buf, "PATH", 4)) {
  363.           (void) strncpy(PATH, bufp, PATHLEN);
  364. - #endif
  365. - #ifdef AMII_GRAPHICS
  366.       } else if (!strncmpi(buf, "PENS", 3)) {
  367.           int i;
  368.           char *t;
  369. !         for (i = 0, t = strtok(bufp, ",");
  370. !                 t && i < 8;
  371. !                 t = strtok(NULL, ","), ++i) {
  372.               sscanf(t, "%hx", &flags.amii_curmap[i]);
  373.           }
  374.           amii_setpens();
  375.   #endif
  376.       } else
  377.           return 0;
  378. --- 928,959 ----
  379.           (void) get_uchars(fp, buf, bufp, &(monsyms[1]),
  380.                       MAXMCLASSES-1, "MONSTERS");
  381.   #ifdef AMIGA
  382. +     } else if (!strncmpi(buf, "FONT", 4)) {
  383. +         char *t;
  384. +         int size;
  385. +         extern void amii_set_text_font( char *, int );
  386. +         if( t = strchr( buf+5, ':' ) )
  387. +         {
  388. +             *t = 0;
  389. +             amii_set_text_font( buf+5, atoi( t + 1 ) );
  390. +             *t = ':';
  391. +         }
  392.       } else if (!strncmpi(buf, "PATH", 4)) {
  393.           (void) strncpy(PATH, bufp, PATHLEN);
  394.       } else if (!strncmpi(buf, "PENS", 3)) {
  395. + # ifdef AMII_GRAPHICS
  396.           int i;
  397.           char *t;
  398. !         extern void amii_setpens( void );
  399. !         for (i = 0, t = strtok(bufp, ",/"); t != NULL;
  400. !                     t = strtok(NULL, ",/"), ++i)
  401. !         {
  402.               sscanf(t, "%hx", &flags.amii_curmap[i]);
  403.           }
  404.           amii_setpens();
  405. + # endif
  406.   #endif
  407.       } else
  408.           return 0;
  409. ***************
  410. *** 942,947 ****
  411. --- 1047,1055 ----
  412.   void
  413.   check_recordfile(dir)
  414.   const char *dir;
  415. + #if defined(applec)
  416. + # pragma unused(dir)
  417. + #endif
  418.   {
  419.   #if defined(UNIX) || defined(VMS)
  420.       int fd = open(RECORD, O_RDWR, 0);
  421. *** /tmp/da11010    Tue Jun  1 16:13:47 1993
  422. --- src/fountain.c    Wed May 19 10:08:25 1993
  423. ***************
  424. *** 1,4 ****
  425. ! /*    SCCS Id: @(#)fountain.c    3.1    93/02/13    */
  426.   /*    Copyright Scott R. Turner, srt@ucla, 10/27/86 */
  427.   /* NetHack may be freely redistributed.  See license for details. */
  428.   
  429. --- 1,4 ----
  430. ! /*    SCCS Id: @(#)fountain.c    3.1    93/05/18    */
  431.   /*    Copyright Scott R. Turner, srt@ucla, 10/27/86 */
  432.   /* NetHack may be freely redistributed.  See license for details. */
  433.   
  434. ***************
  435. *** 108,116 ****
  436.           pline("Water gushes forth from the overflowing fountain!");
  437.   
  438.       /* Put a pool at x, y */
  439.       levl[x][y].typ = POOL;
  440.       water_damage(level.objects[x][y], FALSE, TRUE);
  441.   
  442.       if ((mtmp = m_at(x, y)) != 0)
  443. --- 108,115 ----
  444.           pline("Water gushes forth from the overflowing fountain!");
  445.   
  446.       /* Put a pool at x, y */
  447.       levl[x][y].typ = POOL;
  448. !     del_engr_at(x, y);
  449.       water_damage(level.objects[x][y], FALSE, TRUE);
  450.   
  451.       if ((mtmp = m_at(x, y)) != 0)
  452. ***************
  453. *** 513,524 ****
  454.               morehungry(rn1(30-ACURR(A_CON), 11));
  455.               vomit();
  456.               break;
  457. - #ifdef POLYSELF
  458.           case 10: pline("This water contains toxic wastes!");
  459.               You("undergo a freakish metamorphosis!");
  460.               polyself();
  461. !             break;
  462.   #endif
  463.           /* more odd messages --JJB */
  464.           case 11: You("hear clanking from the pipes....");
  465.               break;
  466. --- 512,525 ----
  467.               morehungry(rn1(30-ACURR(A_CON), 11));
  468.               vomit();
  469.               break;
  470.           case 10: pline("This water contains toxic wastes!");
  471.               You("undergo a freakish metamorphosis!");
  472. + #ifdef POLYSELF
  473.               polyself();
  474. ! #else
  475. !             newman();
  476.   #endif
  477. +             break;
  478.           /* more odd messages --JJB */
  479.           case 11: You("hear clanking from the pipes....");
  480.               break;
  481. *** /tmp/da11018    Tue Jun  1 16:13:50 1993
  482. --- src/hack.c    Tue Jun  1 10:42:03 1993
  483. ***************
  484. *** 1,4 ****
  485. ! /*    SCCS Id: @(#)hack.c    3.1    93/02/18    */
  486.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  487.   /* NetHack may be freely redistributed.  See license for details. */
  488.   
  489. --- 1,4 ----
  490. ! /*    SCCS Id: @(#)hack.c    3.1    93/05/18    */
  491.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  492.   /* NetHack may be freely redistributed.  See license for details. */
  493.   
  494. ***************
  495. *** 115,120 ****
  496. --- 115,124 ----
  497.           case SPIKED_PIT:
  498.           case PIT:
  499.               freeobj(otmp);
  500. +             /* vision kludge to get messages right;
  501. +                the pit will temporarily be seen even
  502. +                if this is one among multiple boulders */
  503. +             if (!Blind) viz_array[ry][rx] |= IN_SIGHT;
  504.               if (!flooreffects(otmp, rx, ry, "fall")) {
  505.               place_object(otmp, rx, ry);
  506.               otmp->nobj = fobj;
  507. ***************
  508. *** 126,132 ****
  509.                 The(xname(otmp)));
  510.               deltrap(ttmp);
  511.               delobj(otmp);
  512. !             delallobj(rx, ry);
  513.               if (cansee(rx,ry)) newsym(rx,ry);
  514.               continue;
  515.           case LEVEL_TELEP:
  516. --- 130,136 ----
  517.                 The(xname(otmp)));
  518.               deltrap(ttmp);
  519.               delobj(otmp);
  520. !             bury_objs(rx, ry);
  521.               if (cansee(rx,ry)) newsym(rx,ry);
  522.               continue;
  523.           case LEVEL_TELEP:
  524. ***************
  525. *** 286,292 ****
  526.       } else if (lev->typ == SDOOR) {
  527.       if (lev->doormask & D_TRAPPED) {
  528.           lev->doormask = D_NODOOR;
  529. !         b_trapped("secret door");
  530.       } else {
  531.           digtxt = "chew through the secret door.";
  532.           lev->doormask = D_BROKEN;
  533. --- 290,296 ----
  534.       } else if (lev->typ == SDOOR) {
  535.       if (lev->doormask & D_TRAPPED) {
  536.           lev->doormask = D_NODOOR;
  537. !         b_trapped("secret door", 0);
  538.       } else {
  539.           digtxt = "chew through the secret door.";
  540.           lev->doormask = D_BROKEN;
  541. ***************
  542. *** 300,306 ****
  543.       }
  544.       if (lev->doormask & D_TRAPPED) {
  545.           lev->doormask = D_NODOOR;
  546. !         b_trapped("door");
  547.       } else {
  548.           digtxt = "chew through the door.";
  549.           lev->doormask = D_BROKEN;
  550. --- 304,310 ----
  551.       }
  552.       if (lev->doormask & D_TRAPPED) {
  553.           lev->doormask = D_NODOOR;
  554. !         b_trapped("door", 0);
  555.       } else {
  556.           digtxt = "chew through the door.";
  557.           lev->doormask = D_BROKEN;
  558. ***************
  559. *** 513,518 ****
  560. --- 517,532 ----
  561.                   y = u.uy + u.dy;
  562.               } while(!isok(x, y) || bad_rock(x, y));
  563.           }
  564. +         /* turbulence might alter your actual destination */
  565. +         if (u.uinwater) {
  566. +             water_friction();
  567. +             if (!u.dx && !u.dy) {
  568. +                 nomul(0);
  569. +                 return;
  570. +             }
  571. +             x = u.ux + u.dx;
  572. +             y = u.uy + u.dy;
  573. +         }
  574.           if(!isok(x, y)) {
  575.               nomul(0);
  576.               return;
  577. ***************
  578. *** 783,789 ****
  579.   
  580.       /* now move the hero */
  581.       mtmp = m_at(x, y);
  582. -     if (u.uinwater) water_friction();
  583.       u.ux += u.dx;
  584.       u.uy += u.dy;
  585.       /* if safepet at destination then move the pet to the hero's
  586. --- 797,802 ----
  587. ***************
  588. *** 980,990 ****
  589.       if(IS_SINK(levl[u.ux][u.uy].typ) && Levitation)
  590.           dosinkfall();
  591.   #endif
  592. !     if(!flags.nopick && OBJ_AT(u.ux, u.uy) &&
  593. !        (!is_pool(u.ux,u.uy) || Underwater))
  594. !         pickup(1);
  595. !     else read_engr_at(u.ux,u.uy);
  596. !     if(trap = t_at(u.ux,u.uy))
  597.           dotrap(trap);    /* fall into pit, arrow trap, etc. */
  598.       if((mtmp = m_at(u.ux, u.uy)) && !u.uswallow) {
  599.           mtmp->mundetected = 0;
  600. --- 993,1000 ----
  601.       if(IS_SINK(levl[u.ux][u.uy].typ) && Levitation)
  602.           dosinkfall();
  603.   #endif
  604. !     pickup(1);
  605. !     if ((trap = t_at(u.ux,u.uy)) != 0)
  606.           dotrap(trap);    /* fall into pit, arrow trap, etc. */
  607.       if((mtmp = m_at(u.ux, u.uy)) && !u.uswallow) {
  608.           mtmp->mundetected = 0;
  609. ***************
  610. *** 1162,1172 ****
  611.       if (*u.ushops0)
  612.           u_left_shop(u.ushops_left, newlev);
  613.   
  614. !     if (!*u.uentered && !*u.ushops_entered) 
  615.           return;        /* no entrance messages necessary */
  616.   
  617.       /* Did we just enter a shop? */
  618. !     if (*u.ushops_entered && !newlev)
  619.               u_entered_shop(u.ushops_entered);
  620.   
  621.       for (ptr = &u.uentered[0]; *ptr; ptr++) {
  622. --- 1172,1182 ----
  623.       if (*u.ushops0)
  624.           u_left_shop(u.ushops_left, newlev);
  625.   
  626. !     if (!*u.uentered && !*u.ushops_entered)     /* implied by newlev */
  627.           return;        /* no entrance messages necessary */
  628.   
  629.       /* Did we just enter a shop? */
  630. !     if (*u.ushops_entered)
  631.               u_entered_shop(u.ushops_entered);
  632.   
  633.       for (ptr = &u.uentered[0]; *ptr; ptr++) {
  634. ***************
  635. *** 1176,1228 ****
  636.           /* vault.c insists that a vault remain a VAULT,
  637.            * and temples should remain TEMPLEs,
  638.            * but everything else gives a message only the first time */
  639. !         if(!newlev) 
  640. !            switch (rt) {
  641. !             case ZOO:
  642. !                pline("Welcome to David's treasure zoo!");
  643. !                 break;
  644. !             case SWAMP:
  645. !                 pline("It %s rather %s down here.",
  646. !                       Blind ? "feels" : "looks",
  647. !                       Blind ? "humid" : "muddy");
  648. !                 break;
  649. !             case COURT:
  650. !             You("enter an opulent throne room!");
  651. !                 break;
  652. !             case MORGUE:
  653. !                 if(midnight())
  654. !                 pline("Run away!  Run away!");
  655. !                 else
  656. !                 You("have an uncanny feeling...");
  657. !                 break;
  658. !             case BEEHIVE:
  659. !                 You("enter a giant beehive!");
  660. !                 break;
  661.   #ifdef ARMY
  662. !             case BARRACKS:
  663. !                 if(monstinroom(&mons[PM_SOLDIER], roomno) ||
  664. !                 monstinroom(&mons[PM_SERGEANT], roomno) ||
  665. !                 monstinroom(&mons[PM_LIEUTENANT], roomno) ||
  666. !                 monstinroom(&mons[PM_CAPTAIN], roomno))
  667. !                     You("enter a military barracks!");
  668. !                 else 
  669. !                 You("enter an abandoned barracks.");
  670. !                 break;
  671.   #endif
  672. !             case DELPHI:
  673. !                 if(monstinroom(&mons[PM_ORACLE], roomno))
  674. !                 verbalize("Hello, %s, welcome to Delphi!", plname);
  675. !                 break;
  676. !             case TEMPLE:
  677. !             intemple(roomno + ROOMOFFSET);
  678. !                 /* fall through */
  679. !             default:
  680. !                 rt = 0;
  681. !             } 
  682. !         else 
  683. !         rt = 0;
  684.   
  685. !         if(rt != 0) {
  686.           rooms[roomno].rtype = OROOM;
  687.           if (!search_special(rt)) {
  688.               /* No more room of that type */
  689. --- 1186,1240 ----
  690.           /* vault.c insists that a vault remain a VAULT,
  691.            * and temples should remain TEMPLEs,
  692.            * but everything else gives a message only the first time */
  693. !         switch (rt) {
  694. !         case ZOO:
  695. !             pline("Welcome to David's treasure zoo!");
  696. !             break;
  697. !         case SWAMP:
  698. !             pline("It %s rather %s down here.",
  699. !               Blind ? "feels" : "looks",
  700. !               Blind ? "humid" : "muddy");
  701. !             break;
  702. !         case COURT:
  703. !             You("enter an opulent throne room!");
  704. !             break;
  705. !         case MORGUE:
  706. !             if(midnight()) {
  707. ! #ifdef POLYSELF
  708. !             const char *run = locomotion(uasmon, "Run");
  709. !             pline("%s away!  %s away!", run, run);
  710. ! #else
  711. !             pline("Run away!  Run away!");
  712. ! #endif
  713. !             } else
  714. !             You("have an uncanny feeling...");
  715. !             break;
  716. !         case BEEHIVE:
  717. !             You("enter a giant beehive!");
  718. !             break;
  719.   #ifdef ARMY
  720. !         case BARRACKS:
  721. !             if(monstinroom(&mons[PM_SOLDIER], roomno) ||
  722. !             monstinroom(&mons[PM_SERGEANT], roomno) ||
  723. !             monstinroom(&mons[PM_LIEUTENANT], roomno) ||
  724. !             monstinroom(&mons[PM_CAPTAIN], roomno))
  725. !             You("enter a military barracks!");
  726. !             else 
  727. !             You("enter an abandoned barracks.");
  728. !             break;
  729.   #endif
  730. !         case DELPHI:
  731. !             if(monstinroom(&mons[PM_ORACLE], roomno))
  732. !             verbalize("Hello, %s, welcome to Delphi!", plname);
  733. !             break;
  734. !         case TEMPLE:
  735. !             intemple(roomno + ROOMOFFSET);
  736. !             /* fall through */
  737. !         default:
  738. !             rt = 0;
  739. !         } 
  740.   
  741. !         if (rt != 0) {
  742.           rooms[roomno].rtype = OROOM;
  743.           if (!search_special(rt)) {
  744.               /* No more room of that type */
  745. ***************
  746. *** 1302,1308 ****
  747.           return(0);
  748.       }
  749.       if(Levitation && !Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz)) {
  750. !         You("cannot reach the floor.");
  751.           return(1);
  752.       }
  753.       pickup(-count);
  754. --- 1314,1320 ----
  755.           return(0);
  756.       }
  757.       if(Levitation && !Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz)) {
  758. !         You("cannot reach the %s.", surface(u.ux,u.uy));
  759.           return(1);
  760.       }
  761.       pickup(-count);
  762. *** /tmp/da11034    Tue Jun  1 16:13:55 1993
  763. --- src/invent.c    Wed May 19 10:30:00 1993
  764. ***************
  765. *** 1,4 ****
  766. ! /*    SCCS Id: @(#)invent.c    3.1    92/12/11    */
  767.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  768.   /* NetHack may be freely redistributed.  See license for details. */
  769.   
  770. --- 1,4 ----
  771. ! /*    SCCS Id: @(#)invent.c    3.1    93/05/17    */
  772.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  773.   /* NetHack may be freely redistributed.  See license for details. */
  774.   
  775. ***************
  776. *** 21,26 ****
  777. --- 21,27 ----
  778.   static struct obj *FDECL(find_unpaid,(struct obj *,struct obj **));
  779.   static boolean NDECL(wearing_armor);
  780.   static boolean FDECL(is_worn,(struct obj *));
  781. + static boolean FDECL(is_fully_identified,(struct obj *));
  782.   #endif /* OVLB */
  783.   STATIC_DCL char FDECL(obj_to_let,(struct obj *));
  784.   
  785. ***************
  786. *** 28,38 ****
  787.   
  788.   static int lastinvnr = 51;    /* 0 ... 51 (never saved&restored) */
  789.   
  790. - char inv_order[] = {    /* manipulated in options.c, used below */
  791. -     AMULET_CLASS, WEAPON_CLASS, ARMOR_CLASS, FOOD_CLASS, SCROLL_CLASS,
  792. -     SPBOOK_CLASS, POTION_CLASS, RING_CLASS, WAND_CLASS, TOOL_CLASS, 
  793. -     GEM_CLASS, ROCK_CLASS, BALL_CLASS, CHAIN_CLASS, 0 };
  794.   #ifdef WIZARD
  795.   /* wizards can wish for venom, which will become an invisible inventory
  796.    * item without this.  putting it in inv_order would mean venom would
  797. --- 29,34 ----
  798. ***************
  799. *** 325,333 ****
  800.       struct obj *otmp, *otmp2;
  801.   
  802.       for (otmp = level.objects[x][y]; otmp; otmp = otmp2) {
  803. -         otmp2 = otmp->nexthere;
  804.           if (otmp == uball)
  805.               unpunish();
  806.           if (otmp == uchain)
  807.               continue;
  808.           delobj(otmp);
  809. --- 321,330 ----
  810.       struct obj *otmp, *otmp2;
  811.   
  812.       for (otmp = level.objects[x][y]; otmp; otmp = otmp2) {
  813.           if (otmp == uball)
  814.               unpunish();
  815. +         /* after unpunish(), or might get deallocated chain */
  816. +         otmp2 = otmp->nexthere;
  817.           if (otmp == uchain)
  818.               continue;
  819.           delobj(otmp);
  820. ***************
  821. *** 334,339 ****
  822. --- 331,426 ----
  823.       }
  824.   }
  825.   
  826. + /* move objects from fobj/nexthere lists to buriedobjlist, keeping position
  827. +  * information */
  828. + void
  829. + bury_objs(x, y)
  830. + int x, y;
  831. + {
  832. +     struct obj *otmp, *otmp2;
  833. +     for (otmp = level.objects[x][y]; otmp; otmp = otmp2) {
  834. +         if (otmp == uball)
  835. +             unpunish();
  836. +         /* after unpunish(), or might get deallocated chain */
  837. +         otmp2 = otmp->nexthere;
  838. +         if (otmp == uchain)
  839. +             continue;
  840. + #ifdef WALKIES
  841. +         if (otmp->otyp == LEASH && otmp->leashmon != 0)
  842. +             o_unleash(otmp);
  843. + #endif
  844. +         if (otmp->lamplit) {
  845. +             otmp->lamplit = 0;
  846. +             check_lamps();
  847. +         }
  848. +         freeobj(otmp);
  849. +         if (otmp->otyp == ROCK) {
  850. +             /* melts into burying material */
  851. +             obfree(otmp, (struct obj *)0);
  852. +             continue;
  853. +         }
  854. +         otmp->nexthere = (struct obj *)0;
  855. +         otmp->nobj = level.buriedobjlist;
  856. +         level.buriedobjlist = otmp;
  857. +     }
  858. +     /* don't expect any engravings here, but just in case */
  859. +     del_engr_at(x, y);
  860. +     newsym(x, y);
  861. + }
  862. + /* delete buried object */
  863. + void
  864. + delburiedobj(obj)
  865. + struct obj *obj;
  866. + {
  867. +     struct obj *otmp;
  868. +     if (obj == level.buriedobjlist)
  869. +         level.buriedobjlist = obj->nobj;
  870. +     else {
  871. +         for (otmp = level.buriedobjlist; otmp; otmp = otmp->nobj)
  872. +             if (otmp->nobj == obj) {
  873. +                 otmp->nobj = obj->nobj;
  874. +                 break;
  875. +             }
  876. +         if (!otmp) panic("error in delburiedobj");
  877. +     }
  878. +     obfree(obj, (struct obj *) 0);    /* frees contents also */
  879. + }
  880. + /* move objects from buriedobjlist to fobj/nexthere lists */
  881. + void
  882. + unearth_objs(x, y)
  883. + int x, y;
  884. + {
  885. +     struct obj *otmp, *otmp2, *prevobj;
  886. +     remove_cadavers(&level.buriedobjlist);
  887. +     prevobj = (struct obj *) 0;
  888. +     for (otmp = level.buriedobjlist; otmp; otmp = otmp2) {
  889. +         otmp2 = otmp->nobj;
  890. +         if (otmp->ox == x && otmp->oy == y) {
  891. +             if (prevobj)
  892. +                 prevobj->nobj = otmp2;
  893. +             else
  894. +                 level.buriedobjlist = otmp2;
  895. +             if (is_organic(otmp) && rn2(2)) {
  896. +                 /* rotted away */
  897. +                 obfree(otmp, (struct obj *) 0);
  898. +             } else {
  899. +                 otmp->nobj = fobj;
  900. +                 fobj = otmp;
  901. +                 place_object(otmp, x, y);
  902. +                 stackobj(otmp);
  903. +             }
  904. +         } else
  905. +             prevobj = otmp;
  906. +     }
  907. +     del_engr_at(x, y);
  908. +     newsym(x, y);
  909. + }
  910.   #endif /* OVL3 */
  911.   #ifdef OVL2
  912.   
  913. ***************
  914. *** 345,350 ****
  915. --- 432,448 ----
  916.   #ifdef WALKIES
  917.       if(obj->otyp == LEASH && obj->leashmon != 0) o_unleash(obj);
  918.   #endif
  919. +     if (obj->otyp == AMULET_OF_YENDOR ||
  920. +             obj->otyp == CANDELABRUM_OF_INVOCATION ||
  921. +             obj->otyp == BELL_OF_OPENING ||
  922. +             obj->otyp == SPE_BOOK_OF_THE_DEAD) {
  923. +         /* player might be doing something stupid, but we
  924. +          * can't guarantee that.  assume special artifacts
  925. +          * are indestructible via drawbridges, and exploding
  926. +          * chests, and golem creation, and ...
  927. +          */
  928. +         return;
  929. +     }
  930.       freeobj(obj);
  931.       newsym(obj->ox,obj->oy);
  932.       obfree(obj, (struct obj *) 0);    /* frees contents also */
  933. ***************
  934. *** 431,437 ****
  935.   
  936.       while(objchn) {
  937.           if(objchn->o_id == id) return(objchn);
  938. !         if (Is_container(objchn) && (temp = o_on(id,objchn->cobj)))
  939.               return temp;
  940.           objchn = objchn->nobj;
  941.       }
  942. --- 529,535 ----
  943.   
  944.       while(objchn) {
  945.           if(objchn->o_id == id) return(objchn);
  946. !         if (Has_contents(objchn) && (temp = o_on(id,objchn->cobj)))
  947.               return temp;
  948.           objchn = objchn->nobj;
  949.       }
  950. ***************
  951. *** 589,609 ****
  952.           else if ((!strcmp(word, "wear") &&
  953.               (otmp->oclass == TOOL_CLASS &&
  954.                otmp->otyp != BLINDFOLD && otmp->otyp != TOWEL))
  955.   #ifdef POLYSELF
  956.           || (!strcmp(word, "eat") && !is_edible(otmp))
  957.   #endif
  958. !         || (!strcmp(word, "can") &&
  959. !             (otmp->otyp != CORPSE))
  960.           || (!strcmp(word, "write with") &&
  961.               (otmp->oclass == TOOL_CLASS &&
  962.                otmp->otyp != MAGIC_MARKER && otmp->otyp != TOWEL))
  963.           || (!strcmp(word, "rub") &&
  964.               (otmp->oclass == TOOL_CLASS &&
  965.                otmp->otyp != OIL_LAMP && otmp->otyp != MAGIC_LAMP &&
  966.                otmp->otyp != BRASS_LANTERN))
  967. -         || (!strcmp(word, "wield") &&
  968. -             (otmp->oclass == TOOL_CLASS &&
  969. -              otmp->otyp != PICK_AXE && otmp->otyp != UNICORN_HORN))
  970.               )
  971.               foo--;
  972.           } else {
  973. --- 687,711 ----
  974.           else if ((!strcmp(word, "wear") &&
  975.               (otmp->oclass == TOOL_CLASS &&
  976.                otmp->otyp != BLINDFOLD && otmp->otyp != TOWEL))
  977. +         || (!strcmp(word, "wield") &&
  978. +             (otmp->oclass == TOOL_CLASS &&
  979. +              otmp->otyp != PICK_AXE && otmp->otyp != UNICORN_HORN))
  980.   #ifdef POLYSELF
  981.           || (!strcmp(word, "eat") && !is_edible(otmp))
  982.   #endif
  983. !         || (!strcmp(word, "sacrifice") &&
  984. !             (otmp->otyp != CORPSE &&
  985. !              otmp->otyp != AMULET_OF_YENDOR &&
  986. !              otmp->otyp != FAKE_AMULET_OF_YENDOR))
  987.           || (!strcmp(word, "write with") &&
  988.               (otmp->oclass == TOOL_CLASS &&
  989.                otmp->otyp != MAGIC_MARKER && otmp->otyp != TOWEL))
  990. +         || (!strcmp(word, "tin") &&
  991. +             (otmp->otyp != CORPSE))
  992.           || (!strcmp(word, "rub") &&
  993.               (otmp->oclass == TOOL_CLASS &&
  994.                otmp->otyp != OIL_LAMP && otmp->otyp != MAGIC_LAMP &&
  995.                otmp->otyp != BRASS_LANTERN))
  996.               )
  997.               foo--;
  998.           } else {
  999. ***************
  1000. *** 782,787 ****
  1001. --- 884,897 ----
  1002.       return(!!(otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL | W_WEP)));
  1003.   }
  1004.   
  1005. + static boolean
  1006. + is_fully_identified(otmp)
  1007. + register struct obj *otmp;
  1008. + {
  1009. +     return(otmp->known && otmp->dknown && otmp->bknown && otmp->rknown
  1010. +        && objects[otmp->otyp].oc_name_known);
  1011. + }
  1012.   static NEARDATA const char removeables[] =
  1013.       { ARMOR_CLASS, WEAPON_CLASS, RING_CLASS, AMULET_CLASS, TOOL_CLASS, 0 };
  1014.   
  1015. ***************
  1016. *** 801,806 ****
  1017. --- 911,917 ----
  1018.       int FDECL((*ckfn),(OBJ_P)) = (int (*)()) 0;
  1019.       xchar allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0; /* BAH */
  1020.       register boolean takeoff = !strcmp(word, "take off");
  1021. +     register boolean ident = !strcmp(word, "identify");
  1022.       struct obj *obj;
  1023.       int unpaid, oc_of_sym;
  1024.   
  1025. ***************
  1026. *** 819,825 ****
  1027.       unpaid = 0;
  1028.       for (obj = invent; obj; obj = obj->nobj) {
  1029.           sym = (char) def_oc_syms[(int) obj->oclass];
  1030. !         if (!index(ilets, sym) && (!takeoff || is_worn(obj))) {
  1031.               ilets[iletct++] = sym;
  1032.               /* necessary because of index() being used above */
  1033.               ilets[iletct] = '\0';
  1034. --- 930,937 ----
  1035.       unpaid = 0;
  1036.       for (obj = invent; obj; obj = obj->nobj) {
  1037.           sym = (char) def_oc_syms[(int) obj->oclass];
  1038. !         if (!index(ilets, sym) && (!takeoff || is_worn(obj))
  1039. !             && (!ident || !is_fully_identified(obj))) {
  1040.               ilets[iletct++] = sym;
  1041.               /* necessary because of index() being used above */
  1042.               ilets[iletct] = '\0';
  1043. ***************
  1044. *** 828,834 ****
  1045.           if (obj->unpaid) unpaid = 1;
  1046.       }
  1047.   
  1048. !     if (!takeoff && (unpaid || invent)) {
  1049.           ilets[iletct++] = ' ';
  1050.           if (unpaid) ilets[iletct++] = 'u';
  1051.           if (invent) ilets[iletct++] = 'a';
  1052. --- 940,949 ----
  1053.           if (obj->unpaid) unpaid = 1;
  1054.       }
  1055.   
  1056. !     if (ident && !iletct) {
  1057. !         You("have already identified all your possessions.");
  1058. !         return -1;        /* special case for seffects(read.c) */
  1059. !     } else if (!takeoff && (unpaid || invent)) {
  1060.           ilets[iletct++] = ' ';
  1061.           if (unpaid) ilets[iletct++] = 'u';
  1062.           if (invent) ilets[iletct++] = 'a';
  1063. ***************
  1064. *** 938,946 ****
  1065.           if(ilet == 'z') ilet = 'A'; else ilet++;
  1066.           otmp2 = otmp->nobj;
  1067.           if (olets && *olets && otmp->oclass != *olets) continue;
  1068. !         if(takeoff && !is_worn(otmp)) continue;
  1069. !         if(ckfn && !(*ckfn)(otmp)) continue;
  1070. !         if(!allflag) {
  1071.               Strcpy(qbuf, ininv ?
  1072.                   xprname(otmp, ilet, !nodot, 0L) : doname(otmp));
  1073.               Strcat(qbuf, "?");
  1074. --- 1053,1062 ----
  1075.           if(ilet == 'z') ilet = 'A'; else ilet++;
  1076.           otmp2 = otmp->nobj;
  1077.           if (olets && *olets && otmp->oclass != *olets) continue;
  1078. !         if (takeoff && !is_worn(otmp)) continue;
  1079. !         if (ident && is_fully_identified(otmp)) continue;
  1080. !         if (ckfn && !(*ckfn)(otmp)) continue;
  1081. !         if (!allflag) {
  1082.               Strcpy(qbuf, ininv ?
  1083.                   xprname(otmp, ilet, !nodot, 0L) : doname(otmp));
  1084.               Strcat(qbuf, "?");
  1085. ***************
  1086. *** 981,986 ****
  1087. --- 1097,1104 ----
  1088.           default:
  1089.               break;
  1090.           case 'q':
  1091. +             /* special case for seffects() */
  1092. +             if (ident) cnt = -1;
  1093.               goto ret;
  1094.           }
  1095.       }
  1096. ***************
  1097. *** 1111,1117 ****
  1098.           } else
  1099.           return (*last_found = list);
  1100.       }
  1101. !     if (Is_container(list) && list->cobj) {
  1102.           if ((obj = find_unpaid(list->cobj, last_found)) != 0)
  1103.           return obj;
  1104.       }
  1105. --- 1229,1235 ----
  1106.           } else
  1107.           return (*last_found = list);
  1108.       }
  1109. !     if (Has_contents(list)) {
  1110.           if ((obj = find_unpaid(list->cobj, last_found)) != 0)
  1111.           return obj;
  1112.       }
  1113. ***************
  1114. *** 1136,1142 ****
  1115.       register struct obj *otmp;
  1116.       struct obj *z_obj;
  1117.       register char ilet;
  1118. !     char *invlet = inv_order;
  1119.       int classcount;
  1120.   #if defined(LINT) || defined(GCC_WARN)
  1121.       int save_unpaid = 0;
  1122. --- 1254,1260 ----
  1123.       register struct obj *otmp;
  1124.       struct obj *z_obj;
  1125.       register char ilet;
  1126. !     char *invlet = flags.inv_order;
  1127.       int classcount;
  1128.   #if defined(LINT) || defined(GCC_WARN)
  1129.       int save_unpaid = 0;
  1130. ***************
  1131. *** 1161,1167 ****
  1132.           if (do_containers) {    /* single non-inventory object */
  1133.               z_obj = (struct obj *) 0;
  1134.               if ((otmp = find_unpaid(invent, &z_obj)) != 0)
  1135. !             pline(xprname(otmp, CONTAINED_SYM, TRUE,
  1136.                        (show_cost ? unpaid_cost(otmp) : 0L)));
  1137.               else
  1138.               impossible(
  1139. --- 1279,1286 ----
  1140.           if (do_containers) {    /* single non-inventory object */
  1141.               z_obj = (struct obj *) 0;
  1142.               if ((otmp = find_unpaid(invent, &z_obj)) != 0)
  1143. !             pline("%s",
  1144. !                   xprname(otmp, CONTAINED_SYM, TRUE,
  1145.                        (show_cost ? unpaid_cost(otmp) : 0L)));
  1146.               else
  1147.               impossible(
  1148. ***************
  1149. *** 1169,1175 ****
  1150.           } else {
  1151.               for(otmp = invent; otmp; otmp = otmp->nobj) {
  1152.               if (otmp->invlet == lets[0]) {
  1153. !                 pline(xprname(otmp, lets[0], TRUE,
  1154.                        (show_cost ? unpaid_cost(otmp) : 0L)));
  1155.                   break;
  1156.               }
  1157. --- 1288,1295 ----
  1158.           } else {
  1159.               for(otmp = invent; otmp; otmp = otmp->nobj) {
  1160.               if (otmp->invlet == lets[0]) {
  1161. !                 pline("%s",
  1162. !                   xprname(otmp, lets[0], TRUE,
  1163.                        (show_cost ? unpaid_cost(otmp) : 0L)));
  1164.                   break;
  1165.               }
  1166. ***************
  1167. *** 1227,1233 ****
  1168.            *  have unpaid items that have been already listed.
  1169.            */
  1170.           for (otmp = invent; otmp; otmp = otmp->nobj) {
  1171. !         if (Is_container(otmp) && otmp->cobj) {
  1172.               z_obj = (struct obj *) 0;    /* haven't found any */
  1173.               while (find_unpaid(otmp->cobj, (struct obj **)&z_obj)) {
  1174.               totcost += cost = unpaid_cost(z_obj);
  1175. --- 1347,1353 ----
  1176.            *  have unpaid items that have been already listed.
  1177.            */
  1178.           for (otmp = invent; otmp; otmp = otmp->nobj) {
  1179. !         if (Has_contents(otmp)) {
  1180.               z_obj = (struct obj *) 0;    /* haven't found any */
  1181.               while (find_unpaid(otmp->cobj, (struct obj **)&z_obj)) {
  1182.               totcost += cost = unpaid_cost(z_obj);
  1183. ***************
  1184. *** 1263,1269 ****
  1185.   
  1186.       while (list) {
  1187.       if (list->unpaid) count++;
  1188. !     if (Is_container(list) && list->cobj)
  1189.           count += count_unpaid(list->cobj);
  1190.       list = list->nobj;
  1191.       }
  1192. --- 1383,1389 ----
  1193.   
  1194.       while (list) {
  1195.       if (list->unpaid) count++;
  1196. !     if (Has_contents(list))
  1197.           count += count_unpaid(list->cobj);
  1198.       list = list->nobj;
  1199.       }
  1200. ***************
  1201. *** 1361,1367 ****
  1202.       const char *verb = Blind ? "feel" : "see";
  1203.       const char *dfeature = (char*) 0;
  1204.       char fbuf[BUFSZ], fbuf2[BUFSZ];
  1205. -     int ct;
  1206.       boolean no_article = FALSE;
  1207.       winid tmpwin;
  1208.   
  1209. --- 1481,1486 ----
  1210. ***************
  1211. *** 1449,1463 ****
  1212.       }
  1213.       /* we know there is something here */
  1214.   
  1215. !     /* find out if there is more than one object there */
  1216. !     for (ct = 0, otmp = otmp0; otmp; otmp = otmp->nexthere)
  1217. !         if (++ct > 1) break;
  1218. !     if (ct == 1) {
  1219.           if (dfeature) pline(fbuf);
  1220.           You("%s here %s.", verb, doname(otmp0));
  1221.       } else {
  1222. !         display_nhwindow(NHW_MESSAGE, FALSE);
  1223.           tmpwin = create_nhwindow(NHW_MENU);
  1224.           if(dfeature) {
  1225.           putstr(tmpwin, 0, fbuf);
  1226. --- 1568,1579 ----
  1227.       }
  1228.       /* we know there is something here */
  1229.   
  1230. !     if (!otmp0->nexthere) {
  1231. !         /* only one object */
  1232.           if (dfeature) pline(fbuf);
  1233.           You("%s here %s.", verb, doname(otmp0));
  1234.       } else {
  1235. !         display_nhwindow(WIN_MESSAGE, FALSE);
  1236.           tmpwin = create_nhwindow(NHW_MENU);
  1237.           if(dfeature) {
  1238.           putstr(tmpwin, 0, fbuf);
  1239. ***************
  1240. *** 1542,1547 ****
  1241. --- 1658,1667 ----
  1242.       /* see burn_lamps() for a reference for the magic "25" */
  1243.       if (Is_candle(obj) && obj->age/25 != otmp->age/25)
  1244.           return(FALSE);
  1245. +     /* don't merge surcharged item with base-cost item */
  1246. +     if (obj->unpaid && !same_price(obj, otmp))
  1247. +         return FALSE;
  1248.   
  1249.   /* if they have names, make sure they're the same */
  1250.       if ( (obj->onamelth != otmp->onamelth &&
  1251. *** /tmp/da11042    Tue Jun  1 16:13:58 1993
  1252. --- src/lock.c    Tue Jun  1 12:07:19 1993
  1253. ***************
  1254. *** 1,8 ****
  1255. ! /*    SCCS Id: @(#)lock.c    3.1    92/09/02
  1256.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1257.   /* NetHack may be freely redistributed.  See license for details. */
  1258.   
  1259. ! #include    "hack.h"
  1260.   
  1261.   #define CONTAINER_BITS 0    /* box options not [yet?] implemented */
  1262.   
  1263. --- 1,8 ----
  1264. ! /*    SCCS Id: @(#)lock.c    3.1    93/05/28    */
  1265.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1266.   /* NetHack may be freely redistributed.  See license for details. */
  1267.   
  1268. ! #include "hack.h"
  1269.   
  1270.   #define CONTAINER_BITS 0    /* box options not [yet?] implemented */
  1271.   
  1272. ***************
  1273. *** 18,23 ****
  1274. --- 18,24 ----
  1275.   
  1276.   #ifdef OVLB
  1277.   
  1278. + static const char *NDECL(lock_action);
  1279.   static boolean FDECL(obstructed,(int,int));
  1280.   static void FDECL(chest_shatter_msg, (struct obj *));
  1281.   
  1282. ***************
  1283. *** 41,46 ****
  1284. --- 42,77 ----
  1285.              xlock.door_or_box && (xlock.door == &levl[x][y])); 
  1286.   }
  1287.   
  1288. + /* produce an occupation string appropriate for the current activity */
  1289. + static const char *
  1290. + lock_action()
  1291. + {
  1292. +     /* "unlocking"+2 == "locking" */
  1293. +     static const char *actions[] = {
  1294. +         /* [0] */    "unlocking the door",
  1295. +         /* [1] */    "unlocking the chest",
  1296. +         /* [2] */    "unlocking the box",
  1297. +         /* [3] */    "picking the lock"
  1298. +     };
  1299. +     /* if the target is currently unlocked, we're trying to lock it now */
  1300. +     if (xlock.door_or_box && !(xlock.door->doormask & D_LOCKED))
  1301. +         return actions[0]+2;    /* "locking the door" */
  1302. +     else if (!xlock.door_or_box && !xlock.box->olocked)
  1303. +         return xlock.box->otyp == CHEST ? actions[1]+2 : actions[2]+2;
  1304. +     /* otherwise we're trying to unlock it */
  1305. +     else if (xlock.picktyp == LOCK_PICK)
  1306. +         return actions[3];    /* "picking the lock" */
  1307. + #ifdef TOURIST
  1308. +     else if (xlock.picktyp == CREDIT_CARD)
  1309. +         return actions[3];    /* same as lock_pick */
  1310. + #endif
  1311. +     else if (xlock.door_or_box)
  1312. +         return actions[0];    /* "unlocking the door" */
  1313. +     else
  1314. +         return xlock.box->otyp == CHEST ? actions[1] : actions[2];
  1315. + }
  1316.   STATIC_PTR
  1317.   int
  1318.   picklock()    /* try to open/close a lock */
  1319. ***************
  1320. *** 73,83 ****
  1321.          || nohands(uasmon)
  1322.   #endif
  1323.          ) {
  1324. !         You("give up your attempt to %s the lock.",
  1325. !           (xlock.door_or_box ? !(xlock.door->doormask & D_LOCKED) :
  1326. !            !xlock.box->olocked) ? "lock" :
  1327. !           ((xlock.picktyp == LOCK_PICK) ? "pick" : "open" ));
  1328.           exercise(A_DEX, TRUE);    /* even if you don't succeed */
  1329.           return((xlock.usedtime = 0));
  1330.       }
  1331. --- 104,110 ----
  1332.          || nohands(uasmon)
  1333.   #endif
  1334.          ) {
  1335. !         You("give up your attempt at %s.", lock_action());
  1336.           exercise(A_DEX, TRUE);    /* even if you don't succeed */
  1337.           return((xlock.usedtime = 0));
  1338.       }
  1339. ***************
  1340. *** 84,95 ****
  1341.   
  1342.       if(rn2(100) > xlock.chance) return(1);        /* still busy */
  1343.   
  1344.       if(xlock.door_or_box) {
  1345. -         You("succeed in %sing the lock.",
  1346. -           !(xlock.door->doormask & D_LOCKED) ? "lock" :
  1347. -           ((xlock.picktyp == LOCK_PICK) ? "pick" : "open" ));
  1348.           if(xlock.door->doormask & D_TRAPPED) {
  1349. !             b_trapped("door");
  1350.               xlock.door->doormask = D_NODOOR;
  1351.               unblock_point(u.ux+u.dx, u.uy+u.dy);
  1352.               newsym(u.ux+u.dx, u.uy+u.dy);
  1353. --- 111,120 ----
  1354.   
  1355.       if(rn2(100) > xlock.chance) return(1);        /* still busy */
  1356.   
  1357. +     You("succeed in %s.", lock_action());
  1358.       if(xlock.door_or_box) {
  1359.           if(xlock.door->doormask & D_TRAPPED) {
  1360. !             b_trapped("door", FINGER);
  1361.               xlock.door->doormask = D_NODOOR;
  1362.               unblock_point(u.ux+u.dx, u.uy+u.dy);
  1363.               newsym(u.ux+u.dx, u.uy+u.dy);
  1364. ***************
  1365. *** 97,105 ****
  1366.           xlock.door->doormask = D_CLOSED;
  1367.           else xlock.door->doormask = D_LOCKED;
  1368.       } else {
  1369. -         You("succeed in %sing the lock.",
  1370. -           (!xlock.box->olocked) ? "lock" :
  1371. -           (xlock.picktyp == LOCK_PICK) ? "pick" : "open" );
  1372.           xlock.box->olocked = !xlock.box->olocked;
  1373.           if(xlock.box->otrapped)    
  1374.           (void) chest_trap(xlock.box, FINGER, FALSE);
  1375. --- 122,127 ----
  1376. ***************
  1377. *** 152,166 ****
  1378.       xlock.box->olocked = 0;
  1379.       xlock.box->obroken = 1;
  1380.       if(!xlock.picktyp && !rn2(3)) {
  1381. !         register struct monst *shkp;
  1382.           long loss = 0L;
  1383.   
  1384. ! #ifdef GCC_WARN
  1385. !         shkp = (struct monst *) 0;
  1386. ! #endif
  1387.   
  1388. -         if(*u.ushops) shkp = shop_keeper(*u.ushops);
  1389.           pline("In fact, you've totally destroyed %s.",
  1390.             the(xname(xlock.box)));
  1391.   
  1392. --- 174,186 ----
  1393.       xlock.box->olocked = 0;
  1394.       xlock.box->obroken = 1;
  1395.       if(!xlock.picktyp && !rn2(3)) {
  1396. !         struct monst *shkp;
  1397. !         boolean costly;
  1398.           long loss = 0L;
  1399.   
  1400. !         costly = (*u.ushops && costly_spot(u.ux, u.uy));
  1401. !         shkp = costly ? shop_keeper(*u.ushops) : 0;
  1402.   
  1403.           pline("In fact, you've totally destroyed %s.",
  1404.             the(xname(xlock.box)));
  1405.   
  1406. ***************
  1407. *** 169,175 ****
  1408.           otmp2 = otmp->nobj;
  1409.           if(!rn2(3) || otmp->oclass == POTION_CLASS) {
  1410.               chest_shatter_msg(otmp);
  1411. !             if(*u.ushops && costly_spot(u.ux, u.uy))
  1412.                   loss += stolen_value(otmp, u.ux, u.uy,
  1413.                            (boolean)shkp->mpeaceful, TRUE);
  1414.               if (otmp->quan == 1L) {
  1415. --- 189,195 ----
  1416.           otmp2 = otmp->nobj;
  1417.           if(!rn2(3) || otmp->oclass == POTION_CLASS) {
  1418.               chest_shatter_msg(otmp);
  1419. !             if (costly)
  1420.                   loss += stolen_value(otmp, u.ux, u.uy,
  1421.                            (boolean)shkp->mpeaceful, TRUE);
  1422.               if (otmp->quan == 1L) {
  1423. ***************
  1424. *** 184,191 ****
  1425.           stackobj(otmp);
  1426.           }
  1427.           xlock.box->cobj = (struct obj *) 0;    /* no contents */
  1428. !         if(*u.ushops && costly_spot(u.ux, u.uy))
  1429. !         loss += stolen_value(otmp, u.ux, u.uy,
  1430.                            (boolean)shkp->mpeaceful, TRUE);
  1431.           if(loss) You("owe %ld zorkmids for objects destroyed.", loss);
  1432.           delobj(xlock.box);
  1433. --- 204,211 ----
  1434.           stackobj(otmp);
  1435.           }
  1436.           xlock.box->cobj = (struct obj *) 0;    /* no contents */
  1437. !         if (costly)
  1438. !         loss += stolen_value(xlock.box, u.ux, u.uy,
  1439.                            (boolean)shkp->mpeaceful, TRUE);
  1440.           if(loss) You("owe %ld zorkmids for objects destroyed.", loss);
  1441.           delobj(xlock.box);
  1442. ***************
  1443. *** 216,232 ****
  1444.       ch = 0;        /* GCC myopia */
  1445.   #endif
  1446.       picktyp = pick->otyp;
  1447. !     if(xlock.usedtime && picktyp == xlock.picktyp) {
  1448.   
  1449. !         You("resume your attempt to %s the lock.",
  1450. !           (xlock.door_or_box ? !(xlock.door->doormask & D_LOCKED) :
  1451. !            !xlock.box->olocked) ? "lock" :
  1452. !           ((xlock.picktyp == LOCK_PICK) ? "pick" : "open" ));
  1453. !         set_occupation(picklock,
  1454. !                (picktyp == LOCK_PICK) ? "picking the lock" :
  1455. !                             "opening the lock",  0);
  1456. !         return(1);
  1457.       }
  1458.   
  1459.   #ifdef POLYSELF
  1460. --- 236,247 ----
  1461.       ch = 0;        /* GCC myopia */
  1462.   #endif
  1463.       picktyp = pick->otyp;
  1464. !     if (xlock.usedtime && picktyp == xlock.picktyp) {
  1465. !         const char *action = lock_action();
  1466.   
  1467. !         You("resume your attempt at %s.", action);
  1468. !         set_occupation(picklock, action, 0);
  1469. !         return(1);
  1470.       }
  1471.   
  1472.   #ifdef POLYSELF
  1473. ***************
  1474. *** 381,389 ****
  1475.       xlock.chance = ch;
  1476.       xlock.picktyp = picktyp;
  1477.       xlock.usedtime = 0;
  1478. !     set_occupation(picklock,
  1479. !                (picktyp == LOCK_PICK) ? "picking the lock" :
  1480. !                         "opening the lock",  0);
  1481.       return(1);
  1482.   }
  1483.   
  1484. --- 396,402 ----
  1485.       xlock.chance = ch;
  1486.       xlock.picktyp = picktyp;
  1487.       xlock.usedtime = 0;
  1488. !     set_occupation(picklock, lock_action(), 0);
  1489.       return(1);
  1490.   }
  1491.   
  1492. ***************
  1493. *** 522,528 ****
  1494.       if (rnl(20) < (ACURRSTR+ACURR(A_DEX)+ACURR(A_CON))/3) {
  1495.           pline("The door opens.");
  1496.           if(door->doormask & D_TRAPPED) {
  1497. !         b_trapped("door");
  1498.           door->doormask = D_NODOOR;
  1499.           } else
  1500.           door->doormask = D_ISOPEN;
  1501. --- 535,541 ----
  1502.       if (rnl(20) < (ACURRSTR+ACURR(A_DEX)+ACURR(A_CON))/3) {
  1503.           pline("The door opens.");
  1504.           if(door->doormask & D_TRAPPED) {
  1505. !         b_trapped("door", FINGER);
  1506.           door->doormask = D_NODOOR;
  1507.           } else
  1508.           door->doormask = D_ISOPEN;
  1509. ***************
  1510. *** 706,711 ****
  1511. --- 719,733 ----
  1512.       case WAN_LOCKING:
  1513.       case SPE_WIZARD_LOCK:
  1514.           if (obstructed(x,y)) return 0;
  1515. +         /* Don't allow doors to close over traps.  This is for pits */
  1516. +         /* & trap doors, but is it ever OK for anything else? */
  1517. +         if (t_at(x,y)) {
  1518. +         /* maketrap() clears doormask, so it should be NODOOR */
  1519. +         pline(
  1520. +     "A cloud of dust springs up in the doorway, but quickly dissipates.");
  1521. +         return 0;
  1522. +         }
  1523.           switch (door->doormask & ~D_TRAPPED) {
  1524.           case D_CLOSED:
  1525.           msg = "The door locks!";
  1526. *** /tmp/da11050    Tue Jun  1 16:14:01 1993
  1527. --- src/mail.c    Mon May 17 14:04:38 1993
  1528. ***************
  1529. *** 1,4 ****
  1530. ! /*    SCCS Id: @(#)mail.c    3.1    92/11/14    */
  1531.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1532.   /* NetHack may be freely redistributed.  See license for details. */
  1533.   
  1534. --- 1,4 ----
  1535. ! /*    SCCS Id: @(#)mail.c    3.1    93/05/15    */
  1536.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1537.   /* NetHack may be freely redistributed.  See license for details. */
  1538.   
  1539. ***************
  1540. *** 48,54 ****
  1541.   #  include <sys/stat.h>
  1542.   #  include <pwd.h>
  1543.   /* DON'T trust all Unices to declare getpwuid() in <pwd.h> */
  1544. ! #  if !defined(_BULL_SOURCE) && !defined(sgi)
  1545.   /* DO trust all SVR4 to typedef uid_t in <sys/types.h> (probably to a long) */
  1546.   #   if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX)
  1547.   extern struct passwd *FDECL(getpwuid,(uid_t));
  1548. --- 48,54 ----
  1549.   #  include <sys/stat.h>
  1550.   #  include <pwd.h>
  1551.   /* DON'T trust all Unices to declare getpwuid() in <pwd.h> */
  1552. ! #  if !defined(_BULL_SOURCE) && !defined(sgi) && !defined(_M_UNIX)
  1553.   /* DO trust all SVR4 to typedef uid_t in <sys/types.h> (probably to a long) */
  1554.   #   if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX)
  1555.   extern struct passwd *FDECL(getpwuid,(uid_t));
  1556. ***************
  1557. *** 368,377 ****
  1558.   
  1559.       message_seen = TRUE;
  1560.   # ifdef NO_MAILREADER
  1561. !     verbalize("Hello, %s!  You have some mail in the outside world.", plname);
  1562. ! # else
  1563.       verbalize("Hello, %s!  %s.", plname, info->display_txt);
  1564.   
  1565.       if (info->message_typ) {
  1566.       struct obj *obj = mksobj(SCR_MAIL, FALSE, FALSE);
  1567.       if (distu(md->mx,md->my) > 2)
  1568. --- 368,382 ----
  1569.   
  1570.       message_seen = TRUE;
  1571.   # ifdef NO_MAILREADER
  1572. !     if (info->message_typ) {
  1573. !     verbalize("Hello, %s!  You have some mail in the outside world.", plname);
  1574. !     goto go_back;
  1575. !     }    
  1576. ! # endif /* NO_MAILREADER */
  1577.       verbalize("Hello, %s!  %s.", plname, info->display_txt);
  1578.   
  1579. + # ifndef NO_MAILREADER
  1580.       if (info->message_typ) {
  1581.       struct obj *obj = mksobj(SCR_MAIL, FALSE, FALSE);
  1582.       if (distu(md->mx,md->my) > 2)
  1583. ***************
  1584. *** 435,453 ****
  1585.   readmail(otmp)
  1586.   struct obj *otmp;
  1587.   {
  1588. - #ifdef AMIGA
  1589.       char *junk[]={
  1590. !     "It reads:  \"Please disregard previous letter.\"",
  1591. !     "It reads:  \"Welcome to NetHack 3.1!\"",
  1592. !     "It reads:  \"Only Amiga makes it possible.\"",
  1593. !     "It reads:  \"CATS have all the answers.\"",
  1594. !     "It reads:  \"Report bugs to nethack-bugs@linc.cis.upenn.edu\""
  1595.       };
  1596.   
  1597. !     pline(junk[rn2(SIZE(junk))]);
  1598. ! #else
  1599. !     pline("It reads:  \"Please disregard previous letter.\"");
  1600. ! #endif
  1601.   }
  1602.   
  1603.   #endif /* OVLB */
  1604. --- 440,456 ----
  1605.   readmail(otmp)
  1606.   struct obj *otmp;
  1607.   {
  1608.       char *junk[]={
  1609. !     "Please disregard previous letter.",
  1610. !     "Welcome to NetHack 3.1!",
  1611. ! #ifdef AMIGA
  1612. !     "Only Amiga makes it possible.",
  1613. !     "CATS have all the answers.",
  1614. ! #endif
  1615. !     "Report bugs to nethack-bugs@linc.cis.upenn.edu"
  1616.       };
  1617.   
  1618. !     pline("It reads:  \"%s\"", junk[rn2(SIZE(junk))]);
  1619.   }
  1620.   
  1621.   #endif /* OVLB */
  1622. ***************
  1623. *** 552,562 ****
  1624.   struct obj *otmp;
  1625.   {
  1626.   #  ifdef SHELL    /* can't access mail reader without spawning subprocess */
  1627. !     char *p, *cmd, buf[BUFSZ], qbuf[BUFSZ];
  1628.   
  1629.       /* there should be a command hidden beyond the object name */
  1630. !     p = otmp->onamelth ? ONAME(otmp) : "";
  1631. !     cmd = (strlen(p) + 1 < otmp->onamelth) ? eos(p) + 1 : (char *) 0;
  1632.       if (!cmd || !*cmd) cmd = "SPAWN";
  1633.   
  1634.       Sprintf(qbuf, "System command (%s)", cmd);
  1635. --- 555,568 ----
  1636.   struct obj *otmp;
  1637.   {
  1638.   #  ifdef SHELL    /* can't access mail reader without spawning subprocess */
  1639. !     const char *txt, *cmd;
  1640. !     char *p, buf[BUFSZ], qbuf[BUFSZ];
  1641. !     int len;
  1642.   
  1643.       /* there should be a command hidden beyond the object name */
  1644. !     txt = otmp->onamelth ? ONAME(otmp) : "";
  1645. !     len = strlen(txt);
  1646. !     cmd = (len + 1 < otmp->onamelth) ? txt + len + 1 : (char *) 0;
  1647.       if (!cmd || !*cmd) cmd = "SPAWN";
  1648.   
  1649.       Sprintf(qbuf, "System command (%s)", cmd);
  1650. *** /tmp/da11058    Tue Jun  1 16:14:03 1993
  1651. --- src/makemon.c    Mon May 24 16:40:28 1993
  1652. ***************
  1653. *** 1,4 ****
  1654. ! /*    SCCS Id: @(#)makemon.c    3.1    93/02/20    */
  1655.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1656.   /* NetHack may be freely redistributed.  See license for details. */
  1657.   
  1658. --- 1,4 ----
  1659. ! /*    SCCS Id: @(#)makemon.c    3.1    93/05/10    */
  1660.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1661.   /* NetHack may be freely redistributed.  See license for details. */
  1662.   
  1663. ***************
  1664. *** 333,338 ****
  1665. --- 333,343 ----
  1666.           (void)mongets(mtmp, KNIFE);
  1667.           (void)mongets(mtmp, LONG_SWORD);
  1668.           break;
  1669. +         case S_ZOMBIE:
  1670. +         if (!rn2(4)) (void)mongets(mtmp, LEATHER_ARMOR);
  1671. +         if (!rn2(4))
  1672. +             (void)mongets(mtmp, (rn2(3) ? KNIFE : SHORT_SWORD));
  1673. +         break;
  1674.           case S_DEMON:
  1675.           switch (mm) {
  1676.               case PM_BALROG:
  1677. ***************
  1678. *** 364,380 ****
  1679.           if (!is_demon(ptr)) break;
  1680.           /* fall thru */
  1681.   /*
  1682. !  *    Now the general case, ~40% chance of getting some type
  1683. !  *    of weapon. TODO: Add more weapons types (use bigmonst());
  1684.    */
  1685.           default:
  1686. !         switch(rnd(12)) {
  1687.               case 1:
  1688. !             m_initthrow(mtmp, DART, 12);
  1689.               break;
  1690.               case 2:
  1691. !             (void) mongets(mtmp, CROSSBOW);
  1692. !             m_initthrow(mtmp, CROSSBOW_BOLT, 12);
  1693.               break;
  1694.               case 3:
  1695.               (void) mongets(mtmp, BOW);
  1696. --- 369,395 ----
  1697.           if (!is_demon(ptr)) break;
  1698.           /* fall thru */
  1699.   /*
  1700. !  *    Now the general case, Some chance of getting some type
  1701. !  *    of weapon for "normal" monsters.  Certain special types
  1702. !  *    of monsters will get a bonus chance or different selections.
  1703.    */
  1704.           default:
  1705. !           {
  1706. !         int bias;
  1707. !         
  1708. !         bias = is_lord(ptr) + is_prince(ptr) * 2 + extra_nasty(ptr);
  1709. !         switch(rnd(14 - (2 * bias))) {
  1710.               case 1:
  1711. !             if(strongmonst(ptr)) (void) mongets(mtmp, BATTLE_AXE);
  1712. !             else m_initthrow(mtmp, DART, 12);
  1713.               break;
  1714.               case 2:
  1715. !             if(strongmonst(ptr))
  1716. !                 (void) mongets(mtmp, TWO_HANDED_SWORD);
  1717. !             else {
  1718. !                 (void) mongets(mtmp, CROSSBOW);
  1719. !                 m_initthrow(mtmp, CROSSBOW_BOLT, 12);
  1720. !             }
  1721.               break;
  1722.               case 3:
  1723.               (void) mongets(mtmp, BOW);
  1724. ***************
  1725. *** 381,398 ****
  1726.               m_initthrow(mtmp, ARROW, 12);
  1727.               break;
  1728.               case 4:
  1729. !             m_initthrow(mtmp, DAGGER, 3);
  1730.               break;
  1731.               case 5:
  1732. !             (void) mongets(mtmp, AKLYS);
  1733.               break;
  1734.               default:
  1735.               break;
  1736.           }
  1737. !         break;
  1738.       }
  1739.   #ifdef MUSE
  1740. !     if ((int) mtmp->m_lev > rn2(70))
  1741.           (void) mongets(mtmp, rnd_offensive_item(mtmp));
  1742.   #endif
  1743.   }
  1744. --- 396,417 ----
  1745.               m_initthrow(mtmp, ARROW, 12);
  1746.               break;
  1747.               case 4:
  1748. !             if(strongmonst(ptr)) (void) mongets(mtmp, LONG_SWORD);
  1749. !             else m_initthrow(mtmp, DAGGER, 3);
  1750.               break;
  1751.               case 5:
  1752. !             if(strongmonst(ptr))
  1753. !                 (void) mongets(mtmp, LUCERN_HAMMER);
  1754. !             else (void) mongets(mtmp, AKLYS);
  1755.               break;
  1756.               default:
  1757.               break;
  1758.           }
  1759. !           }
  1760. !           break;
  1761.       }
  1762.   #ifdef MUSE
  1763. !     if ((int) mtmp->m_lev > rn2(75))
  1764.           (void) mongets(mtmp, rnd_offensive_item(mtmp));
  1765.   #endif
  1766.   }
  1767. ***************
  1768. *** 546,552 ****
  1769.       if (ptr == &mons[PM_SOLDIER] && rn2(13)) return;
  1770.   #endif
  1771.   #ifdef MUSE
  1772. !     if ((int) mtmp->m_lev > rn2(30))
  1773.           (void) mongets(mtmp, rnd_defensive_item(mtmp));
  1774.       if ((int) mtmp->m_lev > rn2(100))
  1775.           (void) mongets(mtmp, rnd_misc_item(mtmp));
  1776. --- 565,571 ----
  1777.       if (ptr == &mons[PM_SOLDIER] && rn2(13)) return;
  1778.   #endif
  1779.   #ifdef MUSE
  1780. !     if ((int) mtmp->m_lev > rn2(50))
  1781.           (void) mongets(mtmp, rnd_defensive_item(mtmp));
  1782.       if ((int) mtmp->m_lev > rn2(100))
  1783.           (void) mongets(mtmp, rnd_misc_item(mtmp));
  1784. ***************
  1785. *** 851,857 ****
  1786.       if (mdat) {
  1787.           if (IS_POOL(levl[x][y].typ))
  1788.           if (mdat == &playermon &&
  1789. !             (HLevitation || Wwalking || Magical_breathing))
  1790.               return 1;
  1791.           else    return (is_flyer(mdat) || is_swimmer(mdat));
  1792.           if (levl[x][y].typ == LAVAPOOL)
  1793. --- 870,876 ----
  1794.       if (mdat) {
  1795.           if (IS_POOL(levl[x][y].typ))
  1796.           if (mdat == &playermon &&
  1797. !             (HLevitation || Wwalking || Amphibious))
  1798.               return 1;
  1799.           else    return (is_flyer(mdat) || is_swimmer(mdat));
  1800.           if (levl[x][y].typ == LAVAPOOL)
  1801. ***************
  1802. *** 1210,1222 ****
  1803.       register int newtype;
  1804.       register struct permonst *ptr = mtmp->data;
  1805.   
  1806. -     if (ptr->mlevel >= 50 || is_golem(ptr) || is_home_elemental(ptr)
  1807. -         || is_mplayer(ptr))
  1808. -         /* doesn't grow up, has strange hp calculation so might be
  1809. -          * weakened by tests below */
  1810. -         return ptr;
  1811.       if (victim) {
  1812.           mtmp->mhpmax = mtmp->mhpmax + (1 + rn2((int)victim->m_lev+1));
  1813.           if (mtmp->mhpmax <= (8 * (int)mtmp->m_lev)
  1814.               || (mtmp->m_lev == 0 && mtmp->mhpmax <= 4))
  1815. --- 1229,1241 ----
  1816.       register int newtype;
  1817.       register struct permonst *ptr = mtmp->data;
  1818.   
  1819.       if (victim) {
  1820. +         if (ptr->mlevel >= 50 || is_golem(ptr) || is_home_elemental(ptr)
  1821. +             || is_mplayer(ptr))
  1822. +         /* doesn't grow up, has strange hp calculation so might be
  1823. +          * weakened by tests below */
  1824. +         return ptr;
  1825.           mtmp->mhpmax = mtmp->mhpmax + (1 + rn2((int)victim->m_lev+1));
  1826.           if (mtmp->mhpmax <= (8 * (int)mtmp->m_lev)
  1827.               || (mtmp->m_lev == 0 && mtmp->mhpmax <= 4))
  1828. ***************
  1829. *** 1245,1250 ****
  1830. --- 1264,1270 ----
  1831.               return (struct permonst *)0;
  1832.           }
  1833.           mtmp->data = &mons[newtype];
  1834. +         newsym(mtmp->mx, mtmp->my);    /* color may change */
  1835.           mtmp->m_lev = mons[newtype].mlevel;
  1836.       }
  1837.       if (newtype == monsndx(ptr) && victim &&
  1838. *** /tmp/da11066    Tue Jun  1 16:14:06 1993
  1839. --- src/mcastu.c    Thu May  6 11:25:36 1993
  1840. ***************
  1841. *** 1,25 ****
  1842. ! /*    SCCS Id: @(#)mcastu.c    3.1    90/09/21
  1843.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1844.   /* NetHack may be freely redistributed.  See license for details. */
  1845.   
  1846. ! #include    "hack.h"
  1847.   
  1848.   #ifdef OVL0
  1849.   static void FDECL(cursetxt,(struct monst *));
  1850. - const char *spelltyp[] = {
  1851. -     "shower of missiles",
  1852. -     "fireball",
  1853. -     "sleep ray",
  1854. -     "cone of cold",
  1855. -     "finger of death",
  1856. -     "bolt of lightning",
  1857. -     "",
  1858. -     "",
  1859. -     "",
  1860. -     ""
  1861. - };
  1862.   
  1863.   static
  1864.   void
  1865.   cursetxt(mtmp)
  1866. --- 1,14 ----
  1867. ! /*    SCCS Id: @(#)mcastu.c    3.1    93/05/04    */
  1868.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1869.   /* NetHack may be freely redistributed.  See license for details. */
  1870.   
  1871. ! #include "hack.h"
  1872.   
  1873.   #ifdef OVL0
  1874.   static void FDECL(cursetxt,(struct monst *));
  1875.   
  1876. + extern const char *flash_types[];    /* from zap.c */
  1877.   static
  1878.   void
  1879.   cursetxt(mtmp)
  1880. ***************
  1881. *** 337,342 ****
  1882. --- 326,334 ----
  1883.   #endif /* OVLB */
  1884.   #ifdef OVL0
  1885.   
  1886. + /* convert 1..10 to 0..9; add 10 for second group (spell casting) */
  1887. + #define ad_to_typ(k) (10 + (int)k - 1)
  1888.   int
  1889.   buzzmu(mtmp, mattk)        /* monster uses spell (ranged) */
  1890.       register struct monst *mtmp;
  1891. ***************
  1892. *** 351,358 ****
  1893.           if(mattk->adtyp && (mattk->adtyp < 11)) { /* no cf unsigned >0 */
  1894.           if(canseemon(mtmp))
  1895.               pline("%s zaps you with a %s!", Monnam(mtmp),
  1896. !               spelltyp[mattk->adtyp-1]);
  1897. !         buzz((int) (-10 - (mattk->adtyp-1)), (int)mattk->damn,
  1898.                mtmp->mx, mtmp->my, sgn(tbx), sgn(tby));
  1899.           } else impossible("Monster spell %d cast", mattk->adtyp-1);
  1900.       }
  1901. --- 343,350 ----
  1902.           if(mattk->adtyp && (mattk->adtyp < 11)) { /* no cf unsigned >0 */
  1903.           if(canseemon(mtmp))
  1904.               pline("%s zaps you with a %s!", Monnam(mtmp),
  1905. !               flash_types[ad_to_typ(mattk->adtyp)]);
  1906. !         buzz(-ad_to_typ(mattk->adtyp), (int)mattk->damn,
  1907.                mtmp->mx, mtmp->my, sgn(tbx), sgn(tby));
  1908.           } else impossible("Monster spell %d cast", mattk->adtyp-1);
  1909.       }
  1910. *** /tmp/da11074    Tue Jun  1 16:14:08 1993
  1911. --- src/mhitm.c    Fri May 28 11:31:59 1993
  1912. ***************
  1913. *** 1,4 ****
  1914. ! /*    SCCS Id: @(#)mhitm.c    3.1    93/02/09    */
  1915.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1916.   /* NetHack may be freely redistributed.  See license for details. */
  1917.   
  1918. --- 1,4 ----
  1919. ! /*    SCCS Id: @(#)mhitm.c    3.1    93/05/26    */
  1920.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1921.   /* NetHack may be freely redistributed.  See license for details. */
  1922.   
  1923. ***************
  1924. *** 360,366 ****
  1925.   
  1926.       if(vis) {
  1927.           Sprintf(buf,"%s gazes at", Monnam(magr));
  1928. !         pline("%s %s.", buf, mon_nam(mdef));
  1929.       }
  1930.   
  1931.       if (!mdef->mcansee || mdef->msleep) {
  1932. --- 360,366 ----
  1933.   
  1934.       if(vis) {
  1935.           Sprintf(buf,"%s gazes at", Monnam(magr));
  1936. !         pline("%s %s...", buf, mon_nam(mdef));
  1937.       }
  1938.   
  1939.       if (!mdef->mcansee || mdef->msleep) {
  1940. ***************
  1941. *** 655,661 ****
  1942.           break;
  1943.           case AD_TLPT:
  1944.           if(!magr->mcan && tmp < mdef->mhp) {
  1945. !             rloc(mdef);
  1946.               if(vis && !cansee(mdef->mx, mdef->my))
  1947.               pline("%s suddenly disappears!", Monnam(mdef));
  1948.           }
  1949. --- 655,661 ----
  1950.           break;
  1951.           case AD_TLPT:
  1952.           if(!magr->mcan && tmp < mdef->mhp) {
  1953. !             if (!tele_restrict(mdef)) rloc(mdef);
  1954.               if(vis && !cansee(mdef->mx, mdef->my))
  1955.               pline("%s suddenly disappears!", Monnam(mdef));
  1956.           }
  1957. ***************
  1958. *** 856,862 ****
  1959.           remove_monster(mdef->mx, mdef->my);
  1960.           place_monster(mdef, mdef->mx, mdef->my);
  1961.           }
  1962. !         monkilled(mdef, "", mattk->adtyp);
  1963.           if (mdef->mhp > 0) return 0; /* mdef lifesaved */
  1964.           return (MM_DEF_DIED | (grow_up(magr,mdef) ? 0 : MM_AGR_DIED));
  1965.       }
  1966. --- 856,862 ----
  1967.           remove_monster(mdef->mx, mdef->my);
  1968.           place_monster(mdef, mdef->mx, mdef->my);
  1969.           }
  1970. !         monkilled(mdef, "", (int)mattk->adtyp);
  1971.           if (mdef->mhp > 0) return 0; /* mdef lifesaved */
  1972.           return (MM_DEF_DIED | (grow_up(magr,mdef) ? 0 : MM_AGR_DIED));
  1973.       }
  1974. ***************
  1975. *** 972,980 ****
  1976. --- 972,988 ----
  1977.       /* These affect the enemy only if defender is still alive */
  1978.       if (rn2(3)) switch(mddat->mattk[i].adtyp) {
  1979.           case AD_PLYS: /* Floating eye */
  1980. +         if (tmp > 127) tmp = 127;
  1981.           if (mddat == &mons[PM_FLOATING_EYE]) {
  1982. +             if (!rn2(4)) tmp = 127;
  1983.               if (magr->mcansee && haseyes(madat) && mdef->mcansee &&
  1984.               (perceives(madat) || !mdef->minvis)) {
  1985. + #ifdef MUSE
  1986. +             Sprintf(buf, "%s gaze is reflected by %%s %%s.",
  1987. +                 s_suffix(mon_nam(mdef)));
  1988. +             if (mon_reflects(magr, buf))
  1989. +                 return(mdead|mhit);
  1990. + #endif
  1991.               Strcpy(buf, Monnam(magr));
  1992.               if(canseemon(magr))
  1993.                   pline("%s is frozen by %s gaze!",
  1994. ***************
  1995. *** 1057,1063 ****
  1996.   
  1997.       assess_dmg:
  1998.       if((magr->mhp -= tmp) <= 0) {
  1999. !         monkilled(magr,"",mddat->mattk[i].adtyp);
  2000.           return (mdead | mhit | MM_AGR_DIED);
  2001.       }
  2002.       return (mdead | mhit);
  2003. --- 1065,1071 ----
  2004.   
  2005.       assess_dmg:
  2006.       if((magr->mhp -= tmp) <= 0) {
  2007. !         monkilled(magr, "", (int)mddat->mattk[i].adtyp);
  2008.           return (mdead | mhit | MM_AGR_DIED);
  2009.       }
  2010.       return (mdead | mhit);
  2011.