home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume16 / nethck31 / patch1a < prev    next >
Encoding:
Text File  |  1993-03-04  |  58.2 KB  |  2,045 lines

  1. Subject:  v17i042:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Patch1a/31
  2. Newsgroups: comp.sources.games
  3. Approved: billr@saab.CNA.TEK.COM
  4.  
  5. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  6. Posting-number: Volume 17, Issue 42
  7. Archive-name: nethack31/Patch1a
  8. Patch-To: nethack31: Volume 16, Issue 1-116
  9. Environment: Amiga, Atari, Mac, MS-DOS, Windows-NT, OS2, Unix, VMS, X11
  10.  
  11.     [Here's the first set of patches to NetHack 3.1. Binaries and tar
  12.      files will be updated in a few days.  -br]
  13.  
  14. [From the development team:]
  15. [[We wish to thank the many people who sent us bug reports, fixes, and
  16. suggestions for improvements.  Please keep doing this.
  17.  
  18. More polish was applied to the Amiga, Mac, and X11 windowing systems.
  19. X11 WM_DELETE_WINDOW handling was added by David Wexelblat.  As we said
  20. in the initial release, the Mac and the Amiga ports are still in
  21. development.  You will find them to be much improved, but there is more
  22. work to be done.  Make constructive comments.
  23.  
  24. The instrument sound files were broken out from their Mac-specific format
  25. and are now being used by the Amiga port.
  26.  
  27. A Windows NT console port was provided by Michael Allison.
  28.  
  29. Various portability fixes for more UNIX makes and HPUX versions.
  30.  
  31. Many small bugs were fixed.  Some of the most popular include misconfiguring
  32. windowing systems, the wrong phase of the moon for some micro ports,
  33. polymorphing into bees, "ghosts" left by reeling monsters, throwing Mjollnir
  34. at walls, various problems with shop payment, mysterious rust damage on damp
  35. levels, Bells of Opening for Tourists, and bones on endgame levels.
  36.  
  37. Many, many small changes having to do with message phrasing (thanks to
  38. Felix Lee) and Amiga declaration syntax for their new compiler version
  39. (transparent to other ports).
  40.  
  41. Please NOTE:  Old save/bones files should be deleted.  They will NOT
  42. work with NetHack 3.1.1.]]
  43.  
  44.  
  45. #! /bin/sh
  46. # This is a shell archive.  Remove anything before this line, then unpack
  47. # it by saving it into a file and typing "sh file".  To overwrite existing
  48. # files, type "sh file -c".  You can also feed this as standard input via
  49. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  50. # will see the following message at the end:
  51. #        "End of archive 1 (of 31)."
  52. # Contents:  MANIFEST_P1 patches01d sys sys/amiga sys/mac sys/share
  53. #   sys/share/sounds sys/winnt
  54. # Wrapped by billr@saab on Fri Mar  5 10:50:41 1993
  55. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  56. if test -f 'MANIFEST_P1' -a "${1}" != "-c" ; then 
  57.   echo shar: Renaming existing file \"'MANIFEST_P1'\" to \"'MANIFEST_P1.orig'\"
  58.   mv -f 'MANIFEST_P1' 'MANIFEST_P1.orig'
  59. fi
  60. echo shar: Extracting \"'MANIFEST_P1'\" \(2123 characters\)
  61. sed "s/^X//" >'MANIFEST_P1' <<'END_OF_FILE'
  62. X   File Name        Archive #    Description
  63. X-----------------------------------------------------------
  64. X MANIFEST_P1                1    This shipping list
  65. X UPDATE1                   10    
  66. X patches01a                 2    
  67. X patches01b                16    
  68. X patches01c                 9    
  69. X patches01d                 1    
  70. X patches01e                 6    
  71. X patches01f                 4    
  72. X patches01g                14    
  73. X patches01h                 7    
  74. X patches01i                 8    
  75. X patches01j                 5    
  76. X patches01k                 3    
  77. X patches01l                17    
  78. X patches01m                30    
  79. X patches01n                19    
  80. X patches01o                13    
  81. X patches01p                12    
  82. X patches01q                18    
  83. X patches01r                15    
  84. X patches01s                10    
  85. X patches01t.uu1            25    
  86. X patches01t.uu2            22    
  87. X patchit.sh                 3    
  88. X sys                        1    
  89. X sys/amiga                  1    
  90. X sys/amiga/amisnd.c        30    
  91. X sys/amiga/colors.uu       12    
  92. X sys/amiga/cvtsnd.c        11    
  93. X sys/amiga/hackwb.hlp       8    
  94. X sys/amiga/wbwin.uu        26    
  95. X sys/mac                    1    
  96. X sys/mac/NHmake.hqx        23    
  97. X sys/mac/NHrez.hqx         28    
  98. X sys/mac/NHrsrc.hqx        27    
  99. X sys/share                  1    
  100. X sys/share/dgn_lex.c       21    
  101. X sys/share/lev_lex.c1      24    
  102. X sys/share/lev_lex.c2      23    
  103. X sys/share/lev_yacc.c1     20    
  104. X sys/share/lev_yacc.c2     27    
  105. X sys/share/sounds           1    
  106. X sys/share/sounds/README    7    
  107. X sys/share/sounds/bell.uu  28    
  108. X sys/share/sounds/bugle.uu 29    
  109. X sys/share/sounds/erthdrum.uu 11    
  110. X sys/share/sounds/firehorn.uu 21    
  111. X sys/share/sounds/frsthorn.uu 29    
  112. X sys/share/sounds/lethdrum.uu 26    
  113. X sys/share/sounds/mgcflute.uu 28    
  114. X sys/share/sounds/mgcharp.uu 25    
  115. X sys/share/sounds/toolhorn.uu 24    
  116. X sys/share/sounds/wdnflute.uu 22    
  117. X sys/share/sounds/wdnharp.uu 29    
  118. X sys/winnt                  1    
  119. X sys/winnt/Install.nt      30    
  120. X sys/winnt/Makefile.dat    19    
  121. X sys/winnt/Makefile.src    30    
  122. X sys/winnt/Makefile.utl    20    
  123. X sys/winnt/nhico.uu        14    
  124. X sys/winnt/nhincl.mak      31    
  125. X sys/winnt/nttty.c         30    
  126. X sys/winnt/setup.bat       13    
  127. X sys/winnt/winnt.c          9    
  128. END_OF_FILE
  129. if test 2123 -ne `wc -c <'MANIFEST_P1'`; then
  130.     echo shar: \"'MANIFEST_P1'\" unpacked with wrong size!
  131. fi
  132. # end of 'MANIFEST_P1'
  133. if test -f 'patches01d' -a "${1}" != "-c" ; then 
  134.   echo shar: Renaming existing file \"'patches01d'\" to \"'patches01d.orig'\"
  135.   mv -f 'patches01d' 'patches01d.orig'
  136. fi
  137. echo shar: Extracting \"'patches01d'\" \(51083 characters\)
  138. sed "s/^X//" >'patches01d' <<'END_OF_FILE'
  139. X*** /tmp/da08221    Thu Feb 25 10:23:13 1993
  140. X--- src/files.c    Sun Feb 21 16:41:38 1993
  141. X***************
  142. X*** 1,4 ****
  143. X! /*    SCCS Id: @(#)files.c    3.1    92/12/07    */
  144. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  145. X  /* NetHack may be freely redistributed.  See license for details. */
  146. X  
  147. X--- 1,4 ----
  148. X! /*    SCCS Id: @(#)files.c    3.1    93/02/20    */
  149. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  150. X  /* NetHack may be freely redistributed.  See license for details. */
  151. X  
  152. X***************
  153. X*** 17,23 ****
  154. X  #include <signal.h>
  155. X  #endif
  156. X  
  157. X! #if defined(MSDOS) || defined(OS2) || defined(TOS)
  158. X  # ifndef GNUDOS
  159. X  #include <sys\stat.h>
  160. X  # else
  161. X--- 17,23 ----
  162. X  #include <signal.h>
  163. X  #endif
  164. X  
  165. X! #if defined(MSDOS) || defined(OS2) || defined(TOS) || defined(WIN32)
  166. X  # ifndef GNUDOS
  167. X  #include <sys\stat.h>
  168. X  # else
  169. X***************
  170. X*** 63,68 ****
  171. X--- 63,70 ----
  172. X  extern char PATH[];    /* see sys/amiga/amidos.c */
  173. X  #endif
  174. X  
  175. X+ extern int n_dgns;        /* from dungeon.c */
  176. X+ 
  177. X  static char * FDECL(set_bonesfile_name, (char *,d_level*));
  178. X  
  179. X  /* fopen a file, with OS-dependent bells and whistles */
  180. X***************
  181. X*** 146,156 ****
  182. X       */
  183. X      fd = open(lock, O_WRONLY |O_CREAT | O_TRUNC | O_BINARY, FCMASK);
  184. X  #else
  185. X! #ifdef MAC
  186. X!     fd = maccreat ( lock , LEVL_TYPE ) ;
  187. X! #else /* MAC */
  188. X      fd = creat(lock, FCMASK);
  189. X! #endif /* MAC */
  190. X  #endif /* MICRO */
  191. X  
  192. X      return fd;
  193. X--- 148,158 ----
  194. X       */
  195. X      fd = open(lock, O_WRONLY |O_CREAT | O_TRUNC | O_BINARY, FCMASK);
  196. X  #else
  197. X! # ifdef MAC
  198. X!     fd = maccreat(lock, LEVL_TYPE);
  199. X! # else
  200. X      fd = creat(lock, FCMASK);
  201. X! # endif
  202. X  #endif /* MICRO */
  203. X  
  204. X      return fd;
  205. X***************
  206. X*** 169,179 ****
  207. X      if (fileinfo[lev].where != ACTIVE)
  208. X          swapin_file(lev);
  209. X  #endif
  210. X! # ifdef MAC
  211. X!     fd = macopen ( lock , O_RDONLY | O_BINARY , LEVL_TYPE ) ;
  212. X! # else /* MAC */
  213. X      fd = open(lock, O_RDONLY | O_BINARY, 0);
  214. X! # endif /* MAC */
  215. X      return fd;
  216. X  }
  217. X  
  218. X--- 171,181 ----
  219. X      if (fileinfo[lev].where != ACTIVE)
  220. X          swapin_file(lev);
  221. X  #endif
  222. X! #ifdef MAC
  223. X!     fd = macopen(lock, O_RDONLY | O_BINARY, LEVL_TYPE);
  224. X! #else
  225. X      fd = open(lock, O_RDONLY | O_BINARY, 0);
  226. X! #endif
  227. X      return fd;
  228. X  }
  229. X  
  230. X***************
  231. X*** 202,208 ****
  232. X  # if defined(UNIX) || defined(VMS)
  233. X      (void) signal(SIGHUP, SIG_IGN);
  234. X  # endif
  235. X!     for (x = maxledgerno(); x >= 0; x--)
  236. X          delete_levelfile(x);    /* not all levels need be present */
  237. X  #endif
  238. X  }
  239. X--- 204,211 ----
  240. X  # if defined(UNIX) || defined(VMS)
  241. X      (void) signal(SIGHUP, SIG_IGN);
  242. X  # endif
  243. X!     /* can't access maxledgerno() before dungeons are created -dlc */
  244. X!     for (x = (n_dgns ? maxledgerno() : 0); x >= 0; x--)
  245. X          delete_levelfile(x);    /* not all levels need be present */
  246. X  #endif
  247. X  }
  248. X***************
  249. X*** 253,263 ****
  250. X      fd = open(bones, O_WRONLY |O_CREAT | O_TRUNC | O_BINARY, FCMASK);
  251. X  #else
  252. X  # ifdef MAC
  253. X!     fd = maccreat ( bones , BONE_TYPE ) ;
  254. X! # else /* MAC */
  255. X      fd = creat(bones, FCMASK);
  256. X! # endif /* MAC */
  257. X! #  if defined(VMS) && !defined(SECURE)
  258. X      /*
  259. X         Re-protect bones file with world:read+write+execute+delete access.
  260. X         umask() doesn't seem very reliable; also, vaxcrtl won't let us set
  261. X--- 256,266 ----
  262. X      fd = open(bones, O_WRONLY |O_CREAT | O_TRUNC | O_BINARY, FCMASK);
  263. X  #else
  264. X  # ifdef MAC
  265. X!     fd = maccreat(bones, BONE_TYPE);
  266. X! # else
  267. X      fd = creat(bones, FCMASK);
  268. X! # endif
  269. X! # if defined(VMS) && !defined(SECURE)
  270. X      /*
  271. X         Re-protect bones file with world:read+write+execute+delete access.
  272. X         umask() doesn't seem very reliable; also, vaxcrtl won't let us set
  273. X***************
  274. X*** 267,273 ****
  275. X         denies some or all access to world.
  276. X       */
  277. X      (void) chmod(bones, FCMASK | 007);  /* allow other users full access */
  278. X! #  endif /* VMS && !SECURE */
  279. X  #endif /* MICRO */
  280. X  
  281. X      return fd;
  282. X--- 270,276 ----
  283. X         denies some or all access to world.
  284. X       */
  285. X      (void) chmod(bones, FCMASK | 007);  /* allow other users full access */
  286. X! # endif /* VMS && !SECURE */
  287. X  #endif /* MICRO */
  288. X  
  289. X      return fd;
  290. X***************
  291. X*** 284,290 ****
  292. X      *bonesid = set_bonesfile_name(bones, lev);
  293. X      uncompress(bones);    /* no effect if nonexistent */
  294. X  #ifdef MAC
  295. X!     fd = macopen ( bones , O_RDONLY | O_BINARY , BONE_TYPE ) ;
  296. X  #else
  297. X      fd = open(bones, O_RDONLY | O_BINARY, 0);
  298. X  #endif
  299. X--- 287,293 ----
  300. X      *bonesid = set_bonesfile_name(bones, lev);
  301. X      uncompress(bones);    /* no effect if nonexistent */
  302. X  #ifdef MAC
  303. X!     fd = macopen(bones, O_RDONLY | O_BINARY, BONE_TYPE);
  304. X  #else
  305. X      fd = open(bones, O_RDONLY | O_BINARY, 0);
  306. X  #endif
  307. X***************
  308. X*** 340,347 ****
  309. X  # else
  310. X      Sprintf(SAVEF, "save/%d%s", (int)getuid(), plname);
  311. X      regularize(SAVEF+5);    /* avoid . or / in name */
  312. X! # endif
  313. X! #endif
  314. X  }
  315. X  
  316. X  #ifdef INSURANCE
  317. X--- 343,350 ----
  318. X  # else
  319. X      Sprintf(SAVEF, "save/%d%s", (int)getuid(), plname);
  320. X      regularize(SAVEF+5);    /* avoid . or / in name */
  321. X! # endif    /* MICRO */
  322. X! #endif    /* VMS */
  323. X  }
  324. X  
  325. X  #ifdef INSURANCE
  326. X***************
  327. X*** 366,376 ****
  328. X        }
  329. X      Strcat(SAVEF, ".e;1");
  330. X  # else
  331. X! #ifdef MAC
  332. X      Strcat(SAVEF, "-e");
  333. X! #else
  334. X      Strcat(SAVEF, ".e");
  335. X! #endif
  336. X  # endif
  337. X  }
  338. X  #endif
  339. X--- 369,379 ----
  340. X        }
  341. X      Strcat(SAVEF, ".e;1");
  342. X  # else
  343. X! #  ifdef MAC
  344. X      Strcat(SAVEF, "-e");
  345. X! #  else
  346. X      Strcat(SAVEF, ".e");
  347. X! #  endif
  348. X  # endif
  349. X  }
  350. X  #endif
  351. X***************
  352. X*** 381,410 ****
  353. X  create_savefile()
  354. X  {
  355. X      int fd;
  356. X! # ifdef AMIGA
  357. X      fd = ami_wbench_getsave(O_WRONLY | O_CREAT | O_TRUNC);
  358. X! # else
  359. X! #  ifdef MICRO
  360. X      fd = open(SAVEF, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK);
  361. X  #  else
  362. X- #   ifdef MAC
  363. X-     fd = creat(SAVEF, SAVE_TYPE);
  364. X- #   else /* MAC */
  365. X      fd = creat(SAVEF, FCMASK);
  366. X! #   endif /* MAC */
  367. X! #   if defined(VMS) && !defined(SECURE)
  368. X      /*
  369. X         Make sure the save file is owned by the current process.  That's
  370. X         the default for non-privileged users, but for priv'd users the
  371. X         file will be owned by the directory's owner instead of the user.
  372. X       */
  373. X! #    ifdef getuid    /*(see vmsunix.c)*/
  374. X! #     undef getuid
  375. X! #    endif
  376. X      (void) chown(SAVEF, getuid(), getgid());
  377. X! #   endif /* VMS && !SECURE */
  378. X! #  endif
  379. X! # endif
  380. X  
  381. X      return fd;
  382. X  }
  383. X--- 384,413 ----
  384. X  create_savefile()
  385. X  {
  386. X      int fd;
  387. X! #ifdef AMIGA
  388. X      fd = ami_wbench_getsave(O_WRONLY | O_CREAT | O_TRUNC);
  389. X! #else
  390. X! # ifdef MICRO
  391. X      fd = open(SAVEF, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK);
  392. X+ # else
  393. X+ #  ifdef MAC
  394. X+     fd = maccreat(SAVEF, SAVE_TYPE);
  395. X  #  else
  396. X      fd = creat(SAVEF, FCMASK);
  397. X! #  endif
  398. X! #  if defined(VMS) && !defined(SECURE)
  399. X      /*
  400. X         Make sure the save file is owned by the current process.  That's
  401. X         the default for non-privileged users, but for priv'd users the
  402. X         file will be owned by the directory's owner instead of the user.
  403. X       */
  404. X! #   ifdef getuid    /*(see vmsunix.c)*/
  405. X! #    undef getuid
  406. X! #   endif
  407. X      (void) chown(SAVEF, getuid(), getgid());
  408. X! #  endif /* VMS && !SECURE */
  409. X! # endif    /* MICRO */
  410. X! #endif    /* AMIGA */
  411. X  
  412. X      return fd;
  413. X  }
  414. X***************
  415. X*** 420,429 ****
  416. X      fd = ami_wbench_getsave(O_RDONLY);
  417. X  #else
  418. X  # ifdef MAC
  419. X!     fd = macopen ( SAVEF , O_RDONLY , SAVE_TYPE ) ;
  420. X! # else /* MAC */
  421. X!     fd = open(SAVEF, O_RDONLY, 0);
  422. X! # endif /* MAC */
  423. X  #endif /* AMIGA */
  424. X      return fd;
  425. X  }
  426. X--- 423,432 ----
  427. X      fd = ami_wbench_getsave(O_RDONLY);
  428. X  #else
  429. X  # ifdef MAC
  430. X!     fd = macopen(SAVEF, O_RDONLY | O_BINARY, SAVE_TYPE);
  431. X! # else
  432. X!     fd = open(SAVEF, O_RDONLY | O_BINARY, 0);
  433. X! # endif
  434. X  #endif /* AMIGA */
  435. X      return fd;
  436. X  }
  437. X***************
  438. X*** 476,482 ****
  439. X      int fd;
  440. X  
  441. X      Strcpy(cfn,filename);
  442. X!     Strcat(cfn,".Z");
  443. X      if((fd = open(cfn,O_RDONLY)) >= 0) {
  444. X          (void) close(fd);
  445. X          Strcpy(cmd, COMPRESS);
  446. X--- 479,487 ----
  447. X      int fd;
  448. X  
  449. X      Strcpy(cfn,filename);
  450. X! # ifdef COMPRESS_EXTENSION
  451. X!     Strcat(cfn,COMPRESS_EXTENSION);
  452. X! # endif
  453. X      if((fd = open(cfn,O_RDONLY)) >= 0) {
  454. X          (void) close(fd);
  455. X          Strcpy(cmd, COMPRESS);
  456. X***************
  457. X*** 556,561 ****
  458. X--- 561,574 ----
  459. X              HUP raw_printf("No write permission to lock %s!",
  460. X                         filename);
  461. X              return FALSE;
  462. X+ # ifdef VMS            /* c__translate(vmsfiles.c) */
  463. X+             case EPERM:
  464. X+             /* could be misleading, but usually right */
  465. X+             HUP raw_printf(
  466. X+                   "Can't lock %s due to directory protection.",
  467. X+                        filename);
  468. X+             return FALSE;
  469. X+ # endif
  470. X              case EEXIST:
  471. X              break;    /* retry checks below */
  472. X              default:
  473. X***************
  474. X*** 620,631 ****
  475. X  #ifdef UNIX
  476. X              ".nethackrc";
  477. X  #else
  478. X! #ifdef MAC
  479. X              "NetHack defaults";
  480. X! #else
  481. X              "NetHack.cnf";
  482. X  #endif
  483. X- #endif
  484. X  
  485. X  static FILE *FDECL(fopen_config_file, (const char *));
  486. X  static int FDECL(get_uchars, (FILE *, char *, char *, uchar *, int, const char *));
  487. X--- 633,644 ----
  488. X  #ifdef UNIX
  489. X              ".nethackrc";
  490. X  #else
  491. X! # ifdef MAC
  492. X              "NetHack defaults";
  493. X! # else
  494. X              "NetHack.cnf";
  495. X+ # endif
  496. X  #endif
  497. X  
  498. X  static FILE *FDECL(fopen_config_file, (const char *));
  499. X  static int FDECL(get_uchars, (FILE *, char *, char *, uchar *, int, const char *));
  500. X***************
  501. X*** 825,838 ****
  502. X  #ifdef AMIGA
  503. X      } else if (!strncmpi(buf, "PATH", 4)) {
  504. X          (void) strncpy(PATH, bufp, PATHLEN);
  505. X      } else if (!strncmpi(buf, "PENS", 3)) {
  506. X          int i;
  507. X          char *t;
  508. X-         extern unsigned short amii_curmap[];
  509. X          for (i = 0, t = strtok(bufp, ",");
  510. X                  t && i < 8;
  511. X                  t = strtok(NULL, ","), ++i) {
  512. X!             sscanf(t, "%hx", &amii_curmap[i]);
  513. X          }
  514. X          amii_setpens();
  515. X  #endif
  516. X--- 838,852 ----
  517. X  #ifdef AMIGA
  518. X      } else if (!strncmpi(buf, "PATH", 4)) {
  519. X          (void) strncpy(PATH, bufp, PATHLEN);
  520. X+ #endif
  521. X+ #ifdef AMII_GRAPHICS
  522. X      } else if (!strncmpi(buf, "PENS", 3)) {
  523. X          int i;
  524. X          char *t;
  525. X          for (i = 0, t = strtok(bufp, ",");
  526. X                  t && i < 8;
  527. X                  t = strtok(NULL, ","), ++i) {
  528. X!             sscanf(t, "%hx", &flags.amii_curmap[i]);
  529. X          }
  530. X          amii_setpens();
  531. X  #endif
  532. X***************
  533. X*** 861,888 ****
  534. X      char    buf[BUFSZ];
  535. X      FILE    *fp;
  536. X  
  537. X! #if defined(MAC)
  538. X!     {
  539. X!         long nul = 0L ;
  540. X!         Str255 volName ;
  541. X!         /*
  542. X!          * We should try and get this data from a rsrc, in the profile file
  543. X!          * the user double-clicked... This data should be saved with the
  544. X!          * save file in the resource fork, AND be saveable in "stationery"
  545. X!          */
  546. X!         GetVol ( volName , & theDirs . dataRefNum ) ;
  547. X!         GetWDInfo ( theDirs . dataRefNum , & theDirs . dataRefNum , & theDirs .
  548. X!             dataDirID , & nul ) ;
  549. X!         if ( volName [ 0 ] > 31 ) volName [ 0 ] = 31 ;
  550. X!         for ( nul = 1 ; nul <= volName [ 0 ] ; nul ++ ) {
  551. X!             if ( volName [ nul ] == ':' ) {
  552. X!                 volName [ nul ] = 0 ;
  553. X!                 volName [ 0 ] = nul - 1 ;
  554. X!                 break ;
  555. X!             }
  556. X          }
  557. X-         BlockMove ( volName , theDirs . dataName , 32L ) ;
  558. X      }
  559. X  #endif /* MAC */
  560. X  
  561. X      if (!(fp = fopen_config_file(filename))) return;
  562. X--- 875,900 ----
  563. X      char    buf[BUFSZ];
  564. X      FILE    *fp;
  565. X  
  566. X! #ifdef MAC
  567. X!     long nul = 0L ;
  568. X!     Str255 volName ;
  569. X!     /*
  570. X!      * We should try to get this data from a rsrc, in the profile file
  571. X!      * the user double-clicked...  This data should be saved with the
  572. X!      * save file in the resource fork, AND be saveable in "stationery"
  573. X!      */
  574. X!     GetVol ( volName , & theDirs . dataRefNum ) ;
  575. X!     GetWDInfo ( theDirs . dataRefNum , & theDirs . dataRefNum , & theDirs .
  576. X!         dataDirID , & nul ) ;
  577. X!     if ( volName [ 0 ] > 31 ) volName [ 0 ] = 31 ;
  578. X!     for ( nul = 1 ; nul <= volName [ 0 ] ; nul ++ ) {
  579. X!         if ( volName [ nul ] == ':' ) {
  580. X!             volName [ nul ] = 0 ;
  581. X!             volName [ 0 ] = nul - 1 ;
  582. X!             break ;
  583. X          }
  584. X      }
  585. X+     BlockMove ( volName , theDirs . dataName , 32L ) ;
  586. X  #endif /* MAC */
  587. X  
  588. X      if (!(fp = fopen_config_file(filename))) return;
  589. X*** /tmp/da08229    Thu Feb 25 10:23:16 1993
  590. X--- src/fountain.c    Tue Feb 16 16:10:19 1993
  591. X***************
  592. X*** 1,4 ****
  593. X! /*    SCCS Id: @(#)fountain.c    3.1    92/12/19    */
  594. X  /*    Copyright Scott R. Turner, srt@ucla, 10/27/86 */
  595. X  /* NetHack may be freely redistributed.  See license for details. */
  596. X  
  597. X--- 1,4 ----
  598. X! /*    SCCS Id: @(#)fountain.c    3.1    93/02/13    */
  599. X  /*    Copyright Scott R. Turner, srt@ucla, 10/27/86 */
  600. X  /* NetHack may be freely redistributed.  See license for details. */
  601. X  
  602. X***************
  603. X*** 41,54 ****
  604. X      if(mons[PM_WATER_DEMON].geno & (G_GENOD | G_EXTINCT)) return;
  605. X      if((mtmp = makemon(&mons[PM_WATER_DEMON],u.ux,u.uy))) {
  606. X          if (!Blind)
  607. X!         You("have unleashed %s!", a_monnam(mtmp));
  608. X          else
  609. X          You("feel the presence of evil.");
  610. X  
  611. X      /* Give those on low levels a (slightly) better chance of survival */
  612. X!         if ( rnd(100) > (80 + level_difficulty())) {
  613. X          pline("Grateful for %s release, %s grants you a wish!",
  614. X!             Blind ? "its" : "his", Blind ? "it" : "he" );
  615. X          makewish();
  616. X          mongone(mtmp);
  617. X          } else if (t_at(mtmp->mx, mtmp->my))
  618. X--- 41,54 ----
  619. X      if(mons[PM_WATER_DEMON].geno & (G_GENOD | G_EXTINCT)) return;
  620. X      if((mtmp = makemon(&mons[PM_WATER_DEMON],u.ux,u.uy))) {
  621. X          if (!Blind)
  622. X!         You("unleash %s!", a_monnam(mtmp));
  623. X          else
  624. X          You("feel the presence of evil.");
  625. X  
  626. X      /* Give those on low levels a (slightly) better chance of survival */
  627. X!         if (rnd(100) > (80 + level_difficulty())) {
  628. X          pline("Grateful for %s release, %s grants you a wish!",
  629. X!               his[pronoun_gender(mtmp)], he[pronoun_gender(mtmp)]);
  630. X          makewish();
  631. X          mongone(mtmp);
  632. X          } else if (t_at(mtmp->mx, mtmp->my))
  633. X***************
  634. X*** 64,70 ****
  635. X      if(mons[PM_WATER_NYMPH].geno & (G_GENOD | G_EXTINCT)) return;
  636. X      if((mtmp = makemon(&mons[PM_WATER_NYMPH],u.ux,u.uy))) {
  637. X          if (!Blind)
  638. X!            You("have attracted %s!", a_monnam(mtmp));
  639. X          else
  640. X             You("hear a seductive voice.");
  641. X          mtmp->msleep = 0;
  642. X--- 64,70 ----
  643. X      if(mons[PM_WATER_NYMPH].geno & (G_GENOD | G_EXTINCT)) return;
  644. X      if((mtmp = makemon(&mons[PM_WATER_NYMPH],u.ux,u.uy))) {
  645. X          if (!Blind)
  646. X!            You("attract %s!", a_monnam(mtmp));
  647. X          else
  648. X             You("hear a seductive voice.");
  649. X          mtmp->msleep = 0;
  650. X***************
  651. X*** 111,116 ****
  652. X--- 111,118 ----
  653. X  
  654. X      levl[x][y].typ = POOL;
  655. X  
  656. X+     water_damage(level.objects[x][y], FALSE, TRUE);
  657. X+ 
  658. X      if ((mtmp = m_at(x, y)) != 0)
  659. X          (void) minwater(mtmp);
  660. X      else
  661. X***************
  662. X*** 153,159 ****
  663. X                  }
  664. X              }
  665. X              /* You can see or hear this effect */
  666. X!             if(!mtmp) pline("The waterflow reduces to a trickle.");
  667. X              return;
  668. X          }
  669. X  #ifdef WIZARD
  670. X--- 155,161 ----
  671. X                  }
  672. X              }
  673. X              /* You can see or hear this effect */
  674. X!             if(!mtmp) pline("The flow reduces to a trickle.");
  675. X              return;
  676. X          }
  677. X  #ifdef WIZARD
  678. X***************
  679. X*** 450,456 ****
  680. X          return;
  681. X      }
  682. X      switch(rn2(20)) {
  683. X!         static struct obj NEARDATA *otmp;
  684. X          case 0: You("take a sip of very cold water.");
  685. X              break;
  686. X          case 1: You("take a sip of very warm water.");
  687. X--- 452,458 ----
  688. X          return;
  689. X      }
  690. X      switch(rn2(20)) {
  691. X!         static NEARDATA struct obj *otmp;
  692. X          case 0: You("take a sip of very cold water.");
  693. X              break;
  694. X          case 1: You("take a sip of very warm water.");
  695. X***************
  696. X*** 463,469 ****
  697. X          case 3: if (mons[PM_SEWER_RAT].geno & (G_GENOD | G_EXTINCT))
  698. X                  pline("The sink seems quite dirty.");
  699. X              else {
  700. X!                 static struct monst NEARDATA *mtmp;
  701. X  
  702. X                  mtmp = makemon(&mons[PM_SEWER_RAT], u.ux, u.uy);
  703. X                  pline("Eek!  There's %s in the sink!",
  704. X--- 465,471 ----
  705. X          case 3: if (mons[PM_SEWER_RAT].geno & (G_GENOD | G_EXTINCT))
  706. X                  pline("The sink seems quite dirty.");
  707. X              else {
  708. X!                 static NEARDATA struct monst *mtmp;
  709. X  
  710. X                  mtmp = makemon(&mons[PM_SEWER_RAT], u.ux, u.uy);
  711. X                  pline("Eek!  There's %s in the sink!",
  712. X***************
  713. X*** 479,490 ****
  714. X                  }
  715. X              } while(!otmp);
  716. X              otmp->cursed = otmp->blessed = 0;
  717. X!             if (Blind)
  718. X!                 pline("The sink emits some odd liquid.");
  719. X!             else
  720. X!                 pline("The sink emits a stream of %s water.",
  721. X!                     Hallucination ? hcolor() :
  722. X!                     OBJ_DESCR(objects[otmp->otyp]));
  723. X              otmp->dknown = !(Blind || Hallucination);
  724. X              otmp->quan++; /* Avoid panic upon useup() */
  725. X              otmp->corpsenm = 1; /* kludge for docall() */
  726. X--- 481,490 ----
  727. X                  }
  728. X              } while(!otmp);
  729. X              otmp->cursed = otmp->blessed = 0;
  730. X!             pline("Some %s liquid flows from the faucet.",
  731. X!                   Blind ? "odd" :
  732. X!                   Hallucination ? hcolor() :
  733. X!                   OBJ_DESCR(objects[otmp->otyp]));
  734. X              otmp->dknown = !(Blind || Hallucination);
  735. X              otmp->quan++; /* Avoid panic upon useup() */
  736. X              otmp->corpsenm = 1; /* kludge for docall() */
  737. X*** /tmp/da08237    Thu Feb 25 10:23:18 1993
  738. X--- src/hack.c    Wed Feb 24 16:22:24 1993
  739. X***************
  740. X*** 1,4 ****
  741. X! /*    SCCS Id: @(#)hack.c    3.1    92/12/04    */
  742. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  743. X  /* NetHack may be freely redistributed.  See license for details. */
  744. X  
  745. X--- 1,4 ----
  746. X! /*    SCCS Id: @(#)hack.c    3.1    93/02/18    */
  747. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  748. X  /* NetHack may be freely redistributed.  See license for details. */
  749. X  
  750. X***************
  751. X*** 162,168 ****
  752. X          long lastmovetime;
  753. X          lastmovetime = 0;
  754. X  #else
  755. X!         static long NEARDATA lastmovetime;
  756. X  #endif
  757. X          /* note: this var contains garbage initially and
  758. X             after a restore */
  759. X--- 162,168 ----
  760. X          long lastmovetime;
  761. X          lastmovetime = 0;
  762. X  #else
  763. X!         static NEARDATA long lastmovetime;
  764. X  #endif
  765. X          /* note: this var contains garbage initially and
  766. X             after a restore */
  767. X***************
  768. X*** 224,235 ****
  769. X  {
  770. X      struct rm *lev      = &(levl[x][y]);
  771. X      struct obj *boulder = sobj_at(BOULDER,x,y);
  772. X  
  773. X      if (dig_pos.x != x || dig_pos.y != y ||
  774. X                  !on_level(&dig_level, &u.uz) || dig_down) {
  775. X!     if (!boulder && (lev->diggable & W_NONDIGGABLE))
  776. X          You("hurt your teeth on the hard stone.");
  777. X!     else {
  778. X          dig_down = FALSE;
  779. X          dig_pos.x = x;
  780. X          dig_pos.y = y;
  781. X--- 224,238 ----
  782. X  {
  783. X      struct rm *lev      = &(levl[x][y]);
  784. X      struct obj *boulder = sobj_at(BOULDER,x,y);
  785. X+     register boolean shopedge = *in_rooms(x, y, SHOPBASE);
  786. X+     register const char *digtxt = (const char*) 0, *dmgtxt = (const char*) 0;
  787. X  
  788. X      if (dig_pos.x != x || dig_pos.y != y ||
  789. X                  !on_level(&dig_level, &u.uz) || dig_down) {
  790. X!     if (!boulder && (lev->diggable & W_NONDIGGABLE)) {
  791. X          You("hurt your teeth on the hard stone.");
  792. X!         nomul(0);
  793. X!     } else {
  794. X          dig_down = FALSE;
  795. X          dig_pos.x = x;
  796. X          dig_pos.y = y;
  797. X***************
  798. X*** 250,257 ****
  799. X      }
  800. X  
  801. X      if (boulder) {
  802. X-     You("eat the boulder.");    /* yum */
  803. X      delobj(boulder);        /* boulder goes bye-bye */
  804. X  
  805. X      /*
  806. X       *  The location could still block because of
  807. X--- 253,260 ----
  808. X      }
  809. X  
  810. X      if (boulder) {
  811. X      delobj(boulder);        /* boulder goes bye-bye */
  812. X+     You("eat the boulder.");    /* yum */
  813. X  
  814. X      /*
  815. X       *  The location could still block because of
  816. X***************
  817. X*** 267,273 ****
  818. X      }
  819. X      
  820. X      } else if (IS_WALL(lev->typ)) {
  821. X!     You("chew a hole in the wall.");
  822. X      if (level.flags.is_maze_lev) {
  823. X          lev->typ = ROOM;
  824. X      } else if (level.flags.is_cavernous_lev) {
  825. X--- 270,280 ----
  826. X      }
  827. X      
  828. X      } else if (IS_WALL(lev->typ)) {
  829. X!     if(shopedge) {
  830. X!         add_damage(x, y, 10L * ACURRSTR);
  831. X!         dmgtxt = "damage";
  832. X!     }
  833. X!     digtxt = "chew a hole in the wall.";
  834. X      if (level.flags.is_maze_lev) {
  835. X          lev->typ = ROOM;
  836. X      } else if (level.flags.is_cavernous_lev) {
  837. X***************
  838. X*** 278,307 ****
  839. X      }
  840. X      } else if (lev->typ == SDOOR) {
  841. X      if (lev->doormask & D_TRAPPED) {
  842. X-         b_trapped("secret door");
  843. X          lev->doormask = D_NODOOR;
  844. X      } else {
  845. X!         You("chew through the secret door.");
  846. X          lev->doormask = D_BROKEN;
  847. X      }
  848. X      lev->typ = DOOR;
  849. X  
  850. X      } else if (IS_DOOR(lev->typ)) {
  851. X      if (lev->doormask & D_TRAPPED) {
  852. X-         b_trapped("door");
  853. X          lev->doormask = D_NODOOR;
  854. X      } else {
  855. X!         You("chew through the door.");
  856. X          lev->doormask = D_BROKEN;
  857. X      }
  858. X  
  859. X      } else { /* STONE or SCORR */
  860. X!     You("chew a passage through the rock.");
  861. X      lev->typ = CORR;
  862. X      }
  863. X  
  864. X      unblock_point(x, y);    /* vision */
  865. X      newsym(x, y);
  866. X      dig_level.dnum = 0;
  867. X      dig_level.dlevel = -1;
  868. X      return 0;
  869. X--- 285,321 ----
  870. X      }
  871. X      } else if (lev->typ == SDOOR) {
  872. X      if (lev->doormask & D_TRAPPED) {
  873. X          lev->doormask = D_NODOOR;
  874. X+         b_trapped("secret door");
  875. X      } else {
  876. X!         digtxt = "chew through the secret door.";
  877. X          lev->doormask = D_BROKEN;
  878. X      }
  879. X      lev->typ = DOOR;
  880. X  
  881. X      } else if (IS_DOOR(lev->typ)) {
  882. X+     if(shopedge) {
  883. X+         add_damage(x, y, 400L);
  884. X+         dmgtxt = "break";
  885. X+     }
  886. X      if (lev->doormask & D_TRAPPED) {
  887. X          lev->doormask = D_NODOOR;
  888. X+         b_trapped("door");
  889. X      } else {
  890. X!         digtxt = "chew through the door.";
  891. X          lev->doormask = D_BROKEN;
  892. X      }
  893. X  
  894. X      } else { /* STONE or SCORR */
  895. X!     digtxt = "chew a passage through the rock.";
  896. X      lev->typ = CORR;
  897. X      }
  898. X  
  899. X      unblock_point(x, y);    /* vision */
  900. X      newsym(x, y);
  901. X+     if (digtxt) You(digtxt);    /* after newsym */
  902. X+     if (dmgtxt)
  903. X+     pay_for_damage(dmgtxt);
  904. X      dig_level.dnum = 0;
  905. X      dig_level.dlevel = -1;
  906. X      return 0;
  907. X***************
  908. X*** 379,384 ****
  909. X--- 393,405 ----
  910. X  return (!(IS_STWALL(levl[x][y].typ) && (levl[x][y].diggable & W_NONDIGGABLE)));
  911. X  }
  912. X  
  913. X+ boolean
  914. X+ may_passwall(x,y)
  915. X+ register xchar x,y;
  916. X+ {
  917. X+ return (!(IS_STWALL(levl[x][y].typ) && (levl[x][y].diggable & W_NONPASSWALL)));
  918. X+ }
  919. X+ 
  920. X  #endif /* OVLB */
  921. X  #ifdef OVL1
  922. X  
  923. X***************
  924. X*** 388,394 ****
  925. X  {
  926. X      return(IS_ROCK(levl[x][y].typ)
  927. X  #ifdef POLYSELF
  928. X!             && !passes_walls(uasmon)
  929. X              && (!tunnels(uasmon) || needspick(uasmon) || !may_dig(x,y))
  930. X  #endif
  931. X      );
  932. X--- 409,415 ----
  933. X  {
  934. X      return(IS_ROCK(levl[x][y].typ)
  935. X  #ifdef POLYSELF
  936. X!             && !(passes_walls(uasmon) && may_passwall(x,y))
  937. X              && (!tunnels(uasmon) || needspick(uasmon) || !may_dig(x,y))
  938. X  #endif
  939. X      );
  940. X***************
  941. X*** 643,649 ****
  942. X      if (IS_ROCK(tmpr->typ)) {
  943. X          if (Blind) feel_location(x,y);
  944. X  #ifdef POLYSELF
  945. X!         if (passes_walls(uasmon)) {
  946. X          ;    /* do nothing */
  947. X          } else if (tunnels(uasmon) && !needspick(uasmon)) {
  948. X          /* Eat the rock. */
  949. X--- 664,670 ----
  950. X      if (IS_ROCK(tmpr->typ)) {
  951. X          if (Blind) feel_location(x,y);
  952. X  #ifdef POLYSELF
  953. X!         if (passes_walls(uasmon) && may_passwall(x,y)) {
  954. X          ;    /* do nothing */
  955. X          } else if (tunnels(uasmon) && !needspick(uasmon)) {
  956. X          /* Eat the rock. */
  957. X***************
  958. X*** 781,792 ****
  959. X          int swap_result;
  960. X  
  961. X          /* if trapped, there's a chance the pet goes wild */
  962. X!         if (mtmp->mtrapped && !rn2(4)) {
  963. X!             pline ("%s suddenly goes wild!",
  964. X!                mtmp->mnamelth ? NAME(mtmp) : Monnam(mtmp));
  965. X!             mtmp->mtame = mtmp->mpeaceful = mtmp->msleep = 0;
  966. X!         }
  967. X  
  968. X          mtmp->mtrapped = 0;
  969. X          mtmp->mundetected = 0;
  970. X          remove_monster(x, y);
  971. X--- 802,823 ----
  972. X          int swap_result;
  973. X  
  974. X          /* if trapped, there's a chance the pet goes wild */
  975. X!         if (mtmp->mtrapped) {
  976. X!             if (!rn2(mtmp->mtame)) {
  977. X!             mtmp->mtame = mtmp->mpeaceful = mtmp->msleep = 0;
  978. X! #ifndef SOUNDS
  979. X!             pline ("%s suddenly goes wild!",
  980. X!                    mtmp->mnamelth ? NAME(mtmp) : Monnam(mtmp));
  981. X! #else
  982. X!                 growl(mtmp);
  983. X!             } else {
  984. X!                 yelp(mtmp);
  985. X! #endif
  986. X!             }
  987. X!             }
  988. X  
  989. X+         if(!mtmp->mtame) newsym(mtmp->mx, mtmp->my);
  990. X+ 
  991. X          mtmp->mtrapped = 0;
  992. X          mtmp->mundetected = 0;
  993. X          remove_monster(x, y);
  994. X***************
  995. X*** 807,817 ****
  996. X          case 1:    /* trapped */
  997. X          case 3: /* changed levels */
  998. X              /* there's already been a trap message, reinforce it */
  999. X              pline("Trapping your pet was a selfish move.");
  1000. X!             if (!rn2(4)) {
  1001. X!             pline("You'll pay!");
  1002. X!             adjalign(-5);
  1003. X!             }
  1004. X              break;
  1005. X          case 2:
  1006. X              /* it may have drowned or died.  that's no way to
  1007. X--- 838,848 ----
  1008. X          case 1:    /* trapped */
  1009. X          case 3: /* changed levels */
  1010. X              /* there's already been a trap message, reinforce it */
  1011. X+             abuse_dog(mtmp);
  1012. X+ #ifndef SOUNDS    /* else complaint from abuse_dog() */
  1013. X              pline("Trapping your pet was a selfish move.");
  1014. X! #endif
  1015. X!             adjalign(-3);
  1016. X              break;
  1017. X          case 2:
  1018. X              /* it may have drowned or died.  that's no way to
  1019. X***************
  1020. X*** 820,826 ****
  1021. X              if (rn2(4)) {
  1022. X              pline ("%s complains in a booming voice:", u_gname());
  1023. X              verbalize("Losing your pet like this was a mistake!");
  1024. X!             u.ugangr++ ;
  1025. X              adjalign(-15);
  1026. X              }
  1027. X              break;
  1028. X--- 851,857 ----
  1029. X              if (rn2(4)) {
  1030. X              pline ("%s complains in a booming voice:", u_gname());
  1031. X              verbalize("Losing your pet like this was a mistake!");
  1032. X!             u.ugangr++;
  1033. X              adjalign(-15);
  1034. X              }
  1035. X              break;
  1036. X***************
  1037. X*** 915,924 ****
  1038. X          }
  1039. X          else if (Is_waterlevel(&u.uz))
  1040. X              goto stillinwater;
  1041. X!         else if (Levitation || is_floater(uasmon))
  1042. X              You("pop out of the water like a cork!");
  1043. X          else if (is_flyer(uasmon))
  1044. X              You("fly out of the water.");
  1045. X          else if (Wwalking)
  1046. X              You("slowly rise above the surface.");
  1047. X          else
  1048. X--- 946,957 ----
  1049. X          }
  1050. X          else if (Is_waterlevel(&u.uz))
  1051. X              goto stillinwater;
  1052. X!         else if (Levitation)
  1053. X              You("pop out of the water like a cork!");
  1054. X+ #ifdef POLYSELF
  1055. X          else if (is_flyer(uasmon))
  1056. X              You("fly out of the water.");
  1057. X+ #endif
  1058. X          else if (Wwalking)
  1059. X              You("slowly rise above the surface.");
  1060. X          else
  1061. X***************
  1062. X*** 1133,1139 ****
  1063. X          return;        /* no entrance messages necessary */
  1064. X  
  1065. X      /* Did we just enter a shop? */
  1066. X!     if (*u.ushops_entered)
  1067. X              u_entered_shop(u.ushops_entered);
  1068. X  
  1069. X      for (ptr = &u.uentered[0]; *ptr; ptr++) {
  1070. X--- 1166,1172 ----
  1071. X          return;        /* no entrance messages necessary */
  1072. X  
  1073. X      /* Did we just enter a shop? */
  1074. X!     if (*u.ushops_entered && !newlev)
  1075. X              u_entered_shop(u.ushops_entered);
  1076. X  
  1077. X      for (ptr = &u.uentered[0]; *ptr; ptr++) {
  1078. X***************
  1079. X*** 1250,1263 ****
  1080. X                Blind ? "feel" : "see");
  1081. X          return(1);
  1082. X      }
  1083. X-     if(!OBJ_AT(u.ux, u.uy)) {
  1084. X-         pline("There is nothing here to pick up.");
  1085. X-         return(0);
  1086. X-     }
  1087. X-     if(Levitation && !Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz)) {
  1088. X-         You("cannot reach the floor.");
  1089. X-         return(1);
  1090. X-     }
  1091. X      if(is_pool(u.ux, u.uy)) {
  1092. X          if(Wwalking
  1093. X  #ifdef POLYSELF
  1094. X--- 1283,1288 ----
  1095. X***************
  1096. X*** 1272,1277 ****
  1097. X--- 1297,1310 ----
  1098. X              return(1);
  1099. X          }
  1100. X      }
  1101. X+     if(!OBJ_AT(u.ux, u.uy)) {
  1102. X+         pline("There is nothing here to pick up.");
  1103. X+         return(0);
  1104. X+     }
  1105. X+     if(Levitation && !Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz)) {
  1106. X+         You("cannot reach the floor.");
  1107. X+         return(1);
  1108. X+     }
  1109. X      pickup(-count);
  1110. X      return(1);
  1111. X  }
  1112. X***************
  1113. X*** 1521,1528 ****
  1114. X          carrcap = MAX_CARR_CAP;
  1115. X      else {
  1116. X          if(carrcap > MAX_CARR_CAP) carrcap = MAX_CARR_CAP;
  1117. X!         if(Wounded_legs & LEFT_SIDE) carrcap -= 100;
  1118. X!         if(Wounded_legs & RIGHT_SIDE) carrcap -= 100;
  1119. X      }
  1120. X      return((int) carrcap);
  1121. X  }
  1122. X--- 1554,1567 ----
  1123. X          carrcap = MAX_CARR_CAP;
  1124. X      else {
  1125. X          if(carrcap > MAX_CARR_CAP) carrcap = MAX_CARR_CAP;
  1126. X! #ifdef POLYSELF
  1127. X!         if (!is_flyer(uasmon))
  1128. X! #endif
  1129. X!                     {
  1130. X!             if(Wounded_legs & LEFT_SIDE) carrcap -= 100;
  1131. X!             if(Wounded_legs & RIGHT_SIDE) carrcap -= 100;
  1132. X!         }
  1133. X!         if (carrcap < 0) carrcap = 0;
  1134. X      }
  1135. X      return((int) carrcap);
  1136. X  }
  1137. X***************
  1138. X*** 1555,1564 ****
  1139. X  int
  1140. X  near_capacity()
  1141. X  {
  1142. X!     int cap, wt = inv_weight();
  1143. X  
  1144. X!     if (wt < 0) return UNENCUMBERED;
  1145. X!     cap = (wt / (weight_cap()/2)) + 1;
  1146. X      return min(cap, OVERLOADED);
  1147. X  }
  1148. X  
  1149. X--- 1594,1604 ----
  1150. X  int
  1151. X  near_capacity()
  1152. X  {
  1153. X!     int cap, wt = inv_weight(), wc = weight_cap();
  1154. X  
  1155. X!     if (wt <= 0) return UNENCUMBERED;
  1156. X!     if (wc <= 1) return OVERLOADED;
  1157. X!     cap = (wt*2 / wc) + 1;
  1158. X      return min(cap, OVERLOADED);
  1159. X  }
  1160. X  
  1161. X*** /tmp/da08245    Thu Feb 25 10:23:21 1993
  1162. X--- src/hacklib.c    Thu Feb  4 13:47:08 1993
  1163. X***************
  1164. X*** 110,116 ****
  1165. X      Strcat(buf, "s");
  1166. X      else if(*(eos(buf)-1) == 's')
  1167. X      Strcat(buf, "'");
  1168. X!     else 
  1169. X      Strcat(buf, "'s");
  1170. X      return buf;
  1171. X  }
  1172. X--- 110,116 ----
  1173. X      Strcat(buf, "s");
  1174. X      else if(*(eos(buf)-1) == 's')
  1175. X      Strcat(buf, "'");
  1176. X!     else
  1177. X      Strcat(buf, "'s");
  1178. X      return buf;
  1179. X  }
  1180. X***************
  1181. X*** 465,485 ****
  1182. X      return(datestr);
  1183. X  }
  1184. X  
  1185. X  int
  1186. X! phase_of_the_moon()            /* 0-7, with 0: new, 4: full */
  1187. X! /* moon period: 2551442 seconds == 29.53058 days */
  1188. X! /* 722578680: date when there was a new moon (Tue Nov 24 04:18 1992) */
  1189. X! /* *8/2551442: divide into 8 phases */
  1190. X! /* *8 +2551442/2 /2551442: let the division round to nearest instead of down */
  1191. X  {
  1192. X! #ifdef BSD
  1193. X!     long now = time((long *)0);
  1194. X! #else
  1195. X!     long now = time((time_t *)0);
  1196. X! #endif
  1197. X  
  1198. X!     return (int) (((((now - 722578680L) % 2551442L) * 8L) + 2551442L/2L)
  1199. X!         / 2551442L);
  1200. X  }
  1201. X  
  1202. X  boolean
  1203. X--- 465,496 ----
  1204. X      return(datestr);
  1205. X  }
  1206. X  
  1207. X+ /*
  1208. X+  * moon period = 29.53058 days ~= 30, year = 365.2422 days
  1209. X+  * days moon phase advances on first day of year compared to preceding year
  1210. X+  *    = 365.2422 - 12*29.53058 ~= 11
  1211. X+  * years in Metonic cycle (time until same phases fall on the same days of
  1212. X+  *    the month) = 18.6 ~= 19
  1213. X+  * moon phase on first day of year (epact) ~= (11*(year%19) + 29) % 30
  1214. X+  *    (29 as initial condition)
  1215. X+  * current phase in days = first day phase + days elapsed in year
  1216. X+  * 6 moons ~= 177 days
  1217. X+  * 177 ~= 8 reported phases * 22
  1218. X+  * + 11/22 for rounding
  1219. X+  */
  1220. X  int
  1221. X! phase_of_the_moon()        /* 0-7, with 0: new, 4: full */
  1222. X  {
  1223. X!     register struct tm *lt = getlt();
  1224. X!     register int epact, diy, goldn;
  1225. X  
  1226. X!     diy = lt->tm_yday;
  1227. X!     goldn = (lt->tm_year % 19) + 1;
  1228. X!     epact = (11 * goldn + 18) % 30;
  1229. X!     if ((epact == 25 && goldn > 11) || epact == 24)
  1230. X!         epact++;
  1231. X! 
  1232. X!     return( (((((diy + epact) * 6) + 11) % 177) / 22) & 7 );
  1233. X  }
  1234. X  
  1235. X  boolean
  1236. X*** /tmp/da08253    Thu Feb 25 10:23:25 1993
  1237. X--- src/invent.c    Tue Feb 23 17:47:21 1993
  1238. X***************
  1239. X*** 636,646 ****
  1240. X                  word, buf);
  1241. X          }
  1242. X  #ifdef REDO
  1243. X!         if(!in_doagain)
  1244. X!             ilet = yn_function(qbuf, NULL, '\0');
  1245. X          else
  1246. X  #endif
  1247. X!             ilet = readchar();
  1248. X          if(ilet == '0') prezero = TRUE;
  1249. X          while(digit(ilet) && allowcnt) {
  1250. X  #ifdef REDO
  1251. X--- 636,646 ----
  1252. X                  word, buf);
  1253. X          }
  1254. X  #ifdef REDO
  1255. X!         if (in_doagain)
  1256. X!             ilet = readchar();
  1257. X          else
  1258. X  #endif
  1259. X!             ilet = yn_function(qbuf, NULL, '\0');
  1260. X          if(ilet == '0') prezero = TRUE;
  1261. X          while(digit(ilet) && allowcnt) {
  1262. X  #ifdef REDO
  1263. X***************
  1264. X*** 721,730 ****
  1265. X--- 721,736 ----
  1266. X          }
  1267. X          if(!otmp) {
  1268. X              You("don't have that object.");
  1269. X+ #ifdef REDO
  1270. X+             if (in_doagain) return((struct obj *) 0);
  1271. X+ #endif
  1272. X              continue;
  1273. X          } else if (cnt < 0 || otmp->quan < cnt) {
  1274. X              You("don't have that many!  You have only %ld.",
  1275. X                  otmp->quan);
  1276. X+ #ifdef REDO
  1277. X+             if (in_doagain) return((struct obj *) 0);
  1278. X+ #endif
  1279. X              continue;
  1280. X          }
  1281. X          break;
  1282. X***************
  1283. X*** 776,782 ****
  1284. X      return(!!(otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL | W_WEP)));
  1285. X  }
  1286. X  
  1287. X! static const char NEARDATA removeables[] =
  1288. X      { ARMOR_CLASS, WEAPON_CLASS, RING_CLASS, AMULET_CLASS, TOOL_CLASS, 0 };
  1289. X  
  1290. X  /* interactive version of getobj - used for Drop, Identify and */
  1291. X--- 782,788 ----
  1292. X      return(!!(otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL | W_WEP)));
  1293. X  }
  1294. X  
  1295. X! static NEARDATA const char removeables[] =
  1296. X      { ARMOR_CLASS, WEAPON_CLASS, RING_CLASS, AMULET_CLASS, TOOL_CLASS, 0 };
  1297. X  
  1298. X  /* interactive version of getobj - used for Drop, Identify and */
  1299. X***************
  1300. X*** 826,841 ****
  1301. X          ilets[iletct++] = ' ';
  1302. X          if (unpaid) ilets[iletct++] = 'u';
  1303. X          if (invent) ilets[iletct++] = 'a';
  1304. X      }
  1305. X!     ilets[iletct] = '\0';    /* outside the if to catch iletct==0 case */
  1306. X  
  1307. X!     Sprintf(qbuf,"What kinds of thing do you want to %s? [%s]",
  1308. X!         word, ilets);
  1309. X!     getlin(qbuf, buf);
  1310. X!     if(buf[0] == '\033') {
  1311. X!         clear_nhwindow(WIN_MESSAGE);
  1312. X!         return(0);
  1313. X!     }
  1314. X      ip = buf;
  1315. X      olets[0] = 0;
  1316. X      while ((sym = *ip++) != 0) {
  1317. X--- 832,854 ----
  1318. X          ilets[iletct++] = ' ';
  1319. X          if (unpaid) ilets[iletct++] = 'u';
  1320. X          if (invent) ilets[iletct++] = 'a';
  1321. X+     } else if (takeoff && invent) {
  1322. X+         ilets[iletct++] = ' ';
  1323. X      }
  1324. X!     ilets[iletct++] = 'i';
  1325. X!     ilets[iletct] = '\0';
  1326. X  
  1327. X!     do {
  1328. X!         Sprintf(qbuf,"What kinds of thing do you want to %s? [%s]",
  1329. X!             word, ilets);
  1330. X!         getlin(qbuf, buf);
  1331. X!         if (buf[0] == '\033') return(0);
  1332. X!         if (index(buf, 'i')) {
  1333. X!         (void) display_inventory(NULL, FALSE);
  1334. X!         } else
  1335. X!         break;
  1336. X!     } while (1);
  1337. X! 
  1338. X      ip = buf;
  1339. X      olets[0] = 0;
  1340. X      while ((sym = *ip++) != 0) {
  1341. X***************
  1342. X*** 920,926 ****
  1343. X       */
  1344. X  nextclass:
  1345. X      ilet = 'a'-1;
  1346. X!     if ((*objchn)->otyp == GOLD_PIECE) ilet--;    /* extra iteration */
  1347. X      for (otmp = *objchn; otmp; otmp = otmp2) {
  1348. X          if(ilet == 'z') ilet = 'A'; else ilet++;
  1349. X          otmp2 = otmp->nobj;
  1350. X--- 933,939 ----
  1351. X       */
  1352. X  nextclass:
  1353. X      ilet = 'a'-1;
  1354. X!     if (*objchn && (*objchn)->otyp == GOLD_PIECE) ilet--;    /* extra iteration */
  1355. X      for (otmp = *objchn; otmp; otmp = otmp2) {
  1356. X          if(ilet == 'z') ilet = 'A'; else ilet++;
  1357. X          otmp2 = otmp->nobj;
  1358. X***************
  1359. X*** 1500,1529 ****
  1360. X  mergable(otmp, obj)    /* returns TRUE if obj  & otmp can be merged */
  1361. X      register struct obj *otmp, *obj;
  1362. X  {
  1363. X!     if(obj->otyp != otmp->otyp || obj->unpaid != otmp->unpaid ||
  1364. X!        obj->spe != otmp->spe || obj->dknown != otmp->dknown ||
  1365. X!        (obj->bknown != otmp->bknown && pl_character[0] != 'P') ||
  1366. X!        obj->cursed != otmp->cursed || obj->blessed != otmp->blessed ||
  1367. X!        obj->no_charge != otmp->no_charge ||
  1368. X!        obj->obroken != otmp->obroken ||
  1369. X!        obj->otrapped != otmp->otrapped ||
  1370. X!        obj->oeroded != otmp->oeroded)
  1371. X          return(FALSE);
  1372. X  
  1373. X!     if((obj->oclass==WEAPON_CLASS || obj->oclass==ARMOR_CLASS) &&
  1374. X!        (obj->oerodeproof!=otmp->oerodeproof || obj->rknown!=otmp->rknown))
  1375. X!         return FALSE;
  1376. X  
  1377. X!     if(obj->oclass == FOOD_CLASS && (obj->oeaten != otmp->oeaten ||
  1378. X!         obj->orotten != otmp->orotten))
  1379. X!         return(FALSE);
  1380. X  
  1381. X!     if(obj->otyp == CORPSE || obj->otyp == EGG || obj->otyp == TIN) {
  1382. X          if((obj->corpsenm != otmp->corpsenm) ||
  1383. X              (ONAME(obj) && strcmp(ONAME(obj), ONAME(otmp))))
  1384. X                  return FALSE;
  1385. X      }
  1386. X  
  1387. X  /* if they have names, make sure they're the same */
  1388. X      if ( (obj->onamelth != otmp->onamelth &&
  1389. X          ((obj->onamelth && otmp->onamelth) || obj->otyp == CORPSE)
  1390. X--- 1513,1548 ----
  1391. X  mergable(otmp, obj)    /* returns TRUE if obj  & otmp can be merged */
  1392. X      register struct obj *otmp, *obj;
  1393. X  {
  1394. X!     if (obj->otyp != otmp->otyp || obj->unpaid != otmp->unpaid ||
  1395. X!         obj->spe != otmp->spe || obj->dknown != otmp->dknown ||
  1396. X!         (obj->bknown != otmp->bknown && pl_character[0] != 'P') ||
  1397. X!         obj->cursed != otmp->cursed || obj->blessed != otmp->blessed ||
  1398. X!         obj->no_charge != otmp->no_charge ||
  1399. X!         obj->obroken != otmp->obroken ||
  1400. X!         obj->otrapped != otmp->otrapped ||
  1401. X!         obj->lamplit != otmp->lamplit ||
  1402. X!         obj->oeroded != otmp->oeroded)
  1403. X          return(FALSE);
  1404. X  
  1405. X!     if ((obj->oclass==WEAPON_CLASS || obj->oclass==ARMOR_CLASS) &&
  1406. X!         (obj->oerodeproof!=otmp->oerodeproof || obj->rknown!=otmp->rknown))
  1407. X!         return FALSE;
  1408. X  
  1409. X!     if (obj->oclass == FOOD_CLASS && (obj->oeaten != otmp->oeaten ||
  1410. X!                       obj->orotten != otmp->orotten))
  1411. X!         return(FALSE);
  1412. X  
  1413. X!     if (obj->otyp == CORPSE || obj->otyp == EGG || obj->otyp == TIN) {
  1414. X          if((obj->corpsenm != otmp->corpsenm) ||
  1415. X              (ONAME(obj) && strcmp(ONAME(obj), ONAME(otmp))))
  1416. X                  return FALSE;
  1417. X      }
  1418. X  
  1419. X+     /* allow candle merging only if their ages are close */
  1420. X+     /* see burn_lamps() for a reference for the magic "25" */
  1421. X+     if (Is_candle(obj) && obj->age/25 != otmp->age/25)
  1422. X+         return(FALSE);
  1423. X+ 
  1424. X  /* if they have names, make sure they're the same */
  1425. X      if ( (obj->onamelth != otmp->onamelth &&
  1426. X          ((obj->onamelth && otmp->onamelth) || obj->otyp == CORPSE)
  1427. X***************
  1428. X*** 1661,1673 ****
  1429. X   * Conversion from a symbol to a string for printing object classes.
  1430. X   * This must match the array obj_symbols[].
  1431. X   */
  1432. X! static const char NEARDATA *names[] = {
  1433. X      "Illegal objects", "Amulets", "Coins", "Comestibles", "Weapons",
  1434. X      "Tools", "Iron balls", "Chains", "Boulders/Statues", "Armor",
  1435. X      "Potions", "Scrolls", "Wands", "Spellbooks", "Rings", "Gems"
  1436. X  };
  1437. X  
  1438. X! static const char NEARDATA oth_symbols[] = {
  1439. X  #ifdef WIZARD
  1440. X      VENOM_CLASS,
  1441. X  #endif
  1442. X--- 1680,1692 ----
  1443. X   * Conversion from a symbol to a string for printing object classes.
  1444. X   * This must match the array obj_symbols[].
  1445. X   */
  1446. X! static NEARDATA const char *names[] = {
  1447. X      "Illegal objects", "Amulets", "Coins", "Comestibles", "Weapons",
  1448. X      "Tools", "Iron balls", "Chains", "Boulders/Statues", "Armor",
  1449. X      "Potions", "Scrolls", "Wands", "Spellbooks", "Rings", "Gems"
  1450. X  };
  1451. X  
  1452. X! static NEARDATA const char oth_symbols[] = {
  1453. X  #ifdef WIZARD
  1454. X      VENOM_CLASS,
  1455. X  #endif
  1456. X***************
  1457. X*** 1675,1681 ****
  1458. X      '\0'
  1459. X  };
  1460. X  
  1461. X! static const char NEARDATA *oth_names[] = {
  1462. X  #ifdef WIZARD
  1463. X      "Venoms",
  1464. X  #endif
  1465. X--- 1694,1700 ----
  1466. X      '\0'
  1467. X  };
  1468. X  
  1469. X! static NEARDATA const char *oth_names[] = {
  1470. X  #ifdef WIZARD
  1471. X      "Venoms",
  1472. X  #endif
  1473. X***************
  1474. X*** 1690,1697 ****
  1475. X      const char *class_name;
  1476. X      const char *pos = index(obj_symbols, let);
  1477. X      int len;
  1478. X!     static char NEARDATA *buf = NULL;
  1479. X!     static unsigned NEARDATA bufsiz = 0;
  1480. X  
  1481. X      if (pos)
  1482. X          class_name = names[pos - obj_symbols];
  1483. X--- 1709,1716 ----
  1484. X      const char *class_name;
  1485. X      const char *pos = index(obj_symbols, let);
  1486. X      int len;
  1487. X!     static NEARDATA char *buf = NULL;
  1488. X!     static NEARDATA unsigned bufsiz = 0;
  1489. X  
  1490. X      if (pos)
  1491. X          class_name = names[pos - obj_symbols];
  1492. X*** /tmp/da08261    Thu Feb 25 10:23:28 1993
  1493. X--- src/lock.c    Fri Feb 12 10:26:30 1993
  1494. X***************
  1495. X*** 9,25 ****
  1496. X  STATIC_PTR int NDECL(picklock);
  1497. X  STATIC_PTR int NDECL(forcelock);
  1498. X  
  1499. X! STATIC_VAR struct xlock_s {
  1500. X      int    door_or_box, picktyp;
  1501. X      struct rm  *door;
  1502. X      struct obj *box;
  1503. X      int chance, usedtime;
  1504. X! } NEARDATA xlock;
  1505. X  
  1506. X  #ifdef OVLB
  1507. X  
  1508. X  static boolean FDECL(obstructed,(int,int));
  1509. X  static void FDECL(chest_shatter_msg, (struct obj *));
  1510. X  
  1511. X  boolean
  1512. X  picking_at(x, y)
  1513. X--- 9,37 ----
  1514. X  STATIC_PTR int NDECL(picklock);
  1515. X  STATIC_PTR int NDECL(forcelock);
  1516. X  
  1517. X! STATIC_VAR NEARDATA struct xlock_s {
  1518. X      int    door_or_box, picktyp;
  1519. X      struct rm  *door;
  1520. X      struct obj *box;
  1521. X      int chance, usedtime;
  1522. X! } xlock;
  1523. X  
  1524. X  #ifdef OVLB
  1525. X  
  1526. X  static boolean FDECL(obstructed,(int,int));
  1527. X  static void FDECL(chest_shatter_msg, (struct obj *));
  1528. X+ 
  1529. X+ boolean
  1530. X+ picking_lock(x, y)
  1531. X+     int *x, *y;
  1532. X+ {
  1533. X+     if(occupation != picklock) return 0;
  1534. X+     else {
  1535. X+         *x = u.ux + u.dx;
  1536. X+         *y = u.uy + u.dy;
  1537. X+         return 1;
  1538. X+     }
  1539. X+ }
  1540. X  
  1541. X  boolean
  1542. X  picking_at(x, y)
  1543. X*** /tmp/da08269    Thu Feb 25 10:23:30 1993
  1544. X--- src/mail.c    Fri Feb 12 10:26:22 1993
  1545. X***************
  1546. X*** 50,56 ****
  1547. X  /* DON'T trust all Unices to declare getpwuid() in <pwd.h> */
  1548. X  #  if !defined(_BULL_SOURCE) && !defined(sgi)
  1549. X  /* DO trust all SVR4 to typedef uid_t in <sys/types.h> (probably to a long) */
  1550. X! #   if defined(POSIX_TYPES) || defined(SVR4)
  1551. X  extern struct passwd *FDECL(getpwuid,(uid_t));
  1552. X  #   else 
  1553. X  extern struct passwd *FDECL(getpwuid,(int));
  1554. X--- 50,56 ----
  1555. X  /* DON'T trust all Unices to declare getpwuid() in <pwd.h> */
  1556. X  #  if !defined(_BULL_SOURCE) && !defined(sgi)
  1557. X  /* DO trust all SVR4 to typedef uid_t in <sys/types.h> (probably to a long) */
  1558. X! #   if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX)
  1559. X  extern struct passwd *FDECL(getpwuid,(uid_t));
  1560. X  #   else 
  1561. X  extern struct passwd *FDECL(getpwuid,(int));
  1562. X***************
  1563. X*** 242,248 ****
  1564. X  }
  1565. X  
  1566. X  /* Let the mail daemon have a larger vocabulary. */
  1567. X! static const char NEARDATA *mail_text[] = {
  1568. X      "Gangway!",
  1569. X      "Look out!",
  1570. X      "Pardon me!"
  1571. X--- 242,248 ----
  1572. X  }
  1573. X  
  1574. X  /* Let the mail daemon have a larger vocabulary. */
  1575. X! static NEARDATA const char *mail_text[] = {
  1576. X      "Gangway!",
  1577. X      "Look out!",
  1578. X      "Pardon me!"
  1579. X***************
  1580. X*** 561,567 ****
  1581. X  
  1582. X      Sprintf(qbuf, "System command (%s)", cmd);
  1583. X      getlin(qbuf, buf);
  1584. X-     clear_nhwindow(WIN_MESSAGE);
  1585. X      if (*buf != '\033') {
  1586. X      for (p = eos(buf); p > buf; *p = '\0')
  1587. X          if (*--p != ' ') break;    /* strip trailing spaces */
  1588. X--- 561,566 ----
  1589. X*** /tmp/da08277    Thu Feb 25 10:23:32 1993
  1590. X--- src/makemon.c    Sun Feb 21 16:29:30 1993
  1591. X***************
  1592. X*** 1,4 ****
  1593. X! /*    SCCS Id: @(#)makemon.c    3.1    92/11/01    */
  1594. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1595. X  /* NetHack may be freely redistributed.  See license for details. */
  1596. X  
  1597. X--- 1,4 ----
  1598. X! /*    SCCS Id: @(#)makemon.c    3.1    93/02/20    */
  1599. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1600. X  /* NetHack may be freely redistributed.  See license for details. */
  1601. X  
  1602. X***************
  1603. X*** 9,15 ****
  1604. X  # include <ctype.h>
  1605. X  #endif
  1606. X  
  1607. X! STATIC_VAR struct monst NEARDATA zeromonst;
  1608. X  
  1609. X  #define uncommon(ptr) \
  1610. X      (((ptr)->geno & (G_GENOD | G_EXTINCT | G_NOGEN | G_UNIQ)) || \
  1611. X--- 9,15 ----
  1612. X  # include <ctype.h>
  1613. X  #endif
  1614. X  
  1615. X! STATIC_VAR NEARDATA struct monst zeromonst;
  1616. X  
  1617. X  #define uncommon(ptr) \
  1618. X      (((ptr)->geno & (G_GENOD | G_EXTINCT | G_NOGEN | G_UNIQ)) || \
  1619. X***************
  1620. X*** 859,865 ****
  1621. X              return 1;
  1622. X          else return
  1623. X              (is_flyer(mdat) || (mdat == &mons[PM_FIRE_ELEMENTAL]));
  1624. X!         if (passes_walls(mdat)) return 1;
  1625. X      }
  1626. X      if (!ACCESSIBLE(levl[x][y].typ)) return 0;
  1627. X      if (closed_door(x, y) && (!mdat || !amorphous(mdat)))
  1628. X--- 859,865 ----
  1629. X              return 1;
  1630. X          else return
  1631. X              (is_flyer(mdat) || (mdat == &mons[PM_FIRE_ELEMENTAL]));
  1632. X!         if (passes_walls(mdat) && may_passwall(x,y)) return 1;
  1633. X      }
  1634. X      if (!ACCESSIBLE(levl[x][y].typ)) return 0;
  1635. X      if (closed_door(x, y) && (!mdat || !amorphous(mdat)))
  1636. X***************
  1637. X*** 1020,1027 ****
  1638. X  align_shift(ptr)
  1639. X  register struct permonst *ptr;
  1640. X  {
  1641. X!     static long NEARDATA oldmoves = 0L;    /* != 1, starting value of moves */
  1642. X!     static s_level NEARDATA *lev;
  1643. X      register int alshift;
  1644. X  
  1645. X      if(oldmoves != moves) {
  1646. X--- 1020,1027 ----
  1647. X  align_shift(ptr)
  1648. X  register struct permonst *ptr;
  1649. X  {
  1650. X!     static NEARDATA long oldmoves = 0L;    /* != 1, starting value of moves */
  1651. X!     static NEARDATA s_level *lev;
  1652. X      register int alshift;
  1653. X  
  1654. X      if(oldmoves != moves) {
  1655. X***************
  1656. X*** 1048,1059 ****
  1657. X      register struct permonst *ptr;
  1658. X      register int i, ct;
  1659. X      register int zlevel;
  1660. X!     static int NEARDATA minmlev, NEARDATA maxmlev, NEARDATA accept;
  1661. X!     static long NEARDATA oldmoves = 0L;    /* != 1, starting value of moves */
  1662. X  #ifdef REINCARNATION
  1663. X!     static boolean NEARDATA upper;
  1664. X  #endif
  1665. X!     static boolean NEARDATA elemlevel;
  1666. X  
  1667. X  #ifdef MULDGN
  1668. X      if(u.uz.dnum == quest_dnum && (ptr = qt_montype())) return(ptr);
  1669. X--- 1048,1059 ----
  1670. X      register struct permonst *ptr;
  1671. X      register int i, ct;
  1672. X      register int zlevel;
  1673. X!     static NEARDATA int minmlev, maxmlev, accept;
  1674. X!     static NEARDATA long oldmoves = 0L;    /* != 1, starting value of moves */
  1675. X  #ifdef REINCARNATION
  1676. X!     static NEARDATA boolean upper;
  1677. X  #endif
  1678. X!     static NEARDATA boolean elemlevel;
  1679. X  
  1680. X  #ifdef MULDGN
  1681. X      if(u.uz.dnum == quest_dnum && (ptr = qt_montype())) return(ptr);
  1682. X***************
  1683. X*** 1084,1090 ****
  1684. X          if(tooweak(ct, minmlev) || toostrong(ct, maxmlev))
  1685. X              continue;
  1686. X  #ifdef REINCARNATION
  1687. X!         if(upper && !isupper(def_monsyms[ptr->mlet])) continue;
  1688. X  #endif
  1689. X          if(elemlevel && wrong_elem_type(ptr)) continue;
  1690. X          if(uncommon(ptr)) continue;
  1691. X--- 1084,1090 ----
  1692. X          if(tooweak(ct, minmlev) || toostrong(ct, maxmlev))
  1693. X              continue;
  1694. X  #ifdef REINCARNATION
  1695. X!         if(upper && !isupper(def_monsyms[(int)ptr->mlet])) continue;
  1696. X  #endif
  1697. X          if(elemlevel && wrong_elem_type(ptr)) continue;
  1698. X          if(uncommon(ptr)) continue;
  1699. X***************
  1700. X*** 1107,1113 ****
  1701. X          if(tooweak(i, minmlev) || toostrong(i, maxmlev))
  1702. X              continue;
  1703. X  #ifdef REINCARNATION
  1704. X!         if(upper & !isupper(def_monsyms[ptr->mlet])) continue;
  1705. X  #endif
  1706. X          if(elemlevel && wrong_elem_type(ptr)) continue;
  1707. X          if(uncommon(ptr)) continue;
  1708. X--- 1107,1113 ----
  1709. X          if(tooweak(i, minmlev) || toostrong(i, maxmlev))
  1710. X              continue;
  1711. X  #ifdef REINCARNATION
  1712. X!         if(upper & !isupper(def_monsyms[(int)ptr->mlet])) continue;
  1713. X  #endif
  1714. X          if(elemlevel && wrong_elem_type(ptr)) continue;
  1715. X          if(uncommon(ptr)) continue;
  1716. X***************
  1717. X*** 1156,1162 ****
  1718. X      for(last = first; last < NUMMONS && mons[last].mlet == class; last++)
  1719. X          if(!(mons[last].geno & mask)) {
  1720. X          /* consider it */
  1721. X!         if(num && toostrong(last, maxmlev) && rn2(2)) break;
  1722. X          num += mons[last].geno & G_FREQ;
  1723. X          }
  1724. X  
  1725. X--- 1156,1163 ----
  1726. X      for(last = first; last < NUMMONS && mons[last].mlet == class; last++)
  1727. X          if(!(mons[last].geno & mask)) {
  1728. X          /* consider it */
  1729. X!         if(num && toostrong(last, maxmlev) &&
  1730. X!            monstr[last] != monstr[last-1] && rn2(2)) break;
  1731. X          num += mons[last].geno & G_FREQ;
  1732. X          }
  1733. X  
  1734. X***************
  1735. X*** 1168,1175 ****
  1736. X      for(num = rnd(num); num > 0; first++)
  1737. X          if(!(mons[first].geno & mask)) {
  1738. X          /* skew towards lower value monsters at lower exp. levels */
  1739. X-         if(adj_lev(&mons[first]) > (u.ulevel*2)) num--;
  1740. X          num -= mons[first].geno & G_FREQ;
  1741. X          }
  1742. X      first--; /* correct an off-by-one error */
  1743. X  
  1744. X--- 1169,1180 ----
  1745. X      for(num = rnd(num); num > 0; first++)
  1746. X          if(!(mons[first].geno & mask)) {
  1747. X          /* skew towards lower value monsters at lower exp. levels */
  1748. X          num -= mons[first].geno & G_FREQ;
  1749. X+         if (num && adj_lev(&mons[first]) > (u.ulevel*2)) {
  1750. X+             /* but not when multiple monsters are same level */
  1751. X+             if (mons[first].mlevel != mons[first+1].mlevel)
  1752. X+             num--;
  1753. X+         }
  1754. X          }
  1755. X      first--; /* correct an off-by-one error */
  1756. X  
  1757. X***************
  1758. X*** 1410,1416 ****
  1759. X  #endif /* OVL1 */
  1760. X  #ifdef OVLB
  1761. X  
  1762. X! static char NEARDATA syms[] = {
  1763. X      MAXOCLASSES, MAXOCLASSES+1, RING_CLASS, WAND_CLASS, WEAPON_CLASS,
  1764. X      FOOD_CLASS, GOLD_CLASS, SCROLL_CLASS, POTION_CLASS, ARMOR_CLASS,
  1765. X      AMULET_CLASS, TOOL_CLASS, ROCK_CLASS, GEM_CLASS, SPBOOK_CLASS,
  1766. X--- 1415,1421 ----
  1767. X  #endif /* OVL1 */
  1768. X  #ifdef OVLB
  1769. X  
  1770. X! static NEARDATA char syms[] = {
  1771. X      MAXOCLASSES, MAXOCLASSES+1, RING_CLASS, WAND_CLASS, WEAPON_CLASS,
  1772. X      FOOD_CLASS, GOLD_CLASS, SCROLL_CLASS, POTION_CLASS, ARMOR_CLASS,
  1773. X      AMULET_CLASS, TOOL_CLASS, ROCK_CLASS, GEM_CLASS, SPBOOK_CLASS,
  1774. X*** /tmp/da08293    Thu Feb 25 10:23:37 1993
  1775. X--- src/mhitm.c    Sun Feb 21 16:29:04 1993
  1776. X***************
  1777. X*** 1,4 ****
  1778. X! /*    SCCS Id: @(#)mhitm.c    3.1    92/12/10    */
  1779. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1780. X  /* NetHack may be freely redistributed.  See license for details. */
  1781. X  
  1782. X--- 1,4 ----
  1783. X! /*    SCCS Id: @(#)mhitm.c    3.1    93/02/09    */
  1784. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1785. X  /* NetHack may be freely redistributed.  See license for details. */
  1786. X  
  1787. X***************
  1788. X*** 8,16 ****
  1789. X  
  1790. X  #ifdef OVLB
  1791. X  
  1792. X! static boolean NEARDATA vis, NEARDATA far_noise;
  1793. X! static long NEARDATA noisetime;
  1794. X! static struct obj NEARDATA *otmp;
  1795. X  
  1796. X  static void FDECL(mrustm, (struct monst *, struct monst *, struct obj *));
  1797. X  static int FDECL(hitmm, (struct monst *,struct monst *,struct attack *));
  1798. X--- 8,16 ----
  1799. X  
  1800. X  #ifdef OVLB
  1801. X  
  1802. X! static NEARDATA boolean vis, far_noise;
  1803. X! static NEARDATA long noisetime;
  1804. X! static NEARDATA struct obj *otmp;
  1805. X  
  1806. X  static void FDECL(mrustm, (struct monst *, struct monst *, struct obj *));
  1807. X  static int FDECL(hitmm, (struct monst *,struct monst *,struct attack *));
  1808. X***************
  1809. X*** 213,218 ****
  1810. X--- 213,220 ----
  1811. X              magr->weapon_check = NEED_HTH_WEAPON;
  1812. X              if (mon_wield_item(magr) != 0) return 0;
  1813. X          }
  1814. X+         remove_cadavers(&magr->minvent);
  1815. X+         possibly_unwield(magr);
  1816. X          otmp = MON_WEP(magr);
  1817. X  #else
  1818. X          otmp = select_hwep(magr);
  1819. X***************
  1820. X*** 456,462 ****
  1821. X      /* Kill off agressor if it didn't die. */
  1822. X      if (!(result & MM_AGR_DIED)) {
  1823. X          mondead(magr);
  1824. X!         result |= MM_AGR_DIED;
  1825. X      }
  1826. X  
  1827. X      return result;
  1828. X--- 458,467 ----
  1829. X      /* Kill off agressor if it didn't die. */
  1830. X      if (!(result & MM_AGR_DIED)) {
  1831. X          mondead(magr);
  1832. X! #ifdef MUSE
  1833. X!         if (magr->mhp <= 0)
  1834. X! #endif
  1835. X!         result |= MM_AGR_DIED;
  1836. X      }
  1837. X  
  1838. X      return result;
  1839. X***************
  1840. X*** 481,487 ****
  1841. X         (mattk->aatyp != AT_WEAP || !otmp) &&
  1842. X         (mattk->aatyp != AT_GAZE && mattk->aatyp != AT_EXPL) &&
  1843. X  #ifdef MUSE
  1844. X!        (!which_armor(magr, W_ARMG))) {
  1845. X  #else
  1846. X         (!is_mercenary(pa) || !m_carrying(magr, LEATHER_GLOVES))) {
  1847. X         /* Note: other monsters may carry gloves, only soldiers have them */
  1848. X--- 486,492 ----
  1849. X         (mattk->aatyp != AT_WEAP || !otmp) &&
  1850. X         (mattk->aatyp != AT_GAZE && mattk->aatyp != AT_EXPL) &&
  1851. X  #ifdef MUSE
  1852. X!        (!(magr->misc_worn_check & W_ARMG))) {
  1853. X  #else
  1854. X         (!is_mercenary(pa) || !m_carrying(magr, LEATHER_GLOVES))) {
  1855. X         /* Note: other monsters may carry gloves, only soldiers have them */
  1856. X***************
  1857. X*** 515,520 ****
  1858. X--- 520,530 ----
  1859. X              tmp = 0;
  1860. X          else if(mattk->aatyp == AT_WEAP) {
  1861. X              if(otmp) {
  1862. X+ #ifdef MUSE
  1863. X+             if (otmp->otyp == CORPSE &&
  1864. X+                 otmp->corpsenm == PM_COCKATRICE)
  1865. X+                 goto do_stone_goto_label;
  1866. X+ #endif
  1867. X              tmp += dmgval(otmp, pd);
  1868. X              if (otmp->oartifact) {
  1869. X                  (void)artifact_hit(magr,mdef, otmp, &tmp, dieroll);
  1870. X***************
  1871. X*** 599,604 ****
  1872. X--- 609,617 ----
  1873. X              else if(mdef->mtame)
  1874. X                   pline("May %s rust in peace.", mon_nam(mdef));
  1875. X              mondied(mdef);
  1876. X+ #ifdef MUSE
  1877. X+             if (mdef->mhp > 0) return 0;
  1878. X+ #endif
  1879. X              return (MM_DEF_DIED | (grow_up(magr,mdef) ?
  1880. X                              0 : MM_AGR_DIED));
  1881. X          }
  1882. X***************
  1883. X*** 611,616 ****
  1884. X--- 624,632 ----
  1885. X              else if(mdef->mtame)
  1886. X                   pline("May %s rot in peace.", mon_nam(mdef));
  1887. X              mondied(mdef);
  1888. X+ #ifdef MUSE
  1889. X+             if (mdef->mhp > 0) return 0;
  1890. X+ #endif
  1891. X              return (MM_DEF_DIED | (grow_up(magr,mdef) ?
  1892. X                              0 : MM_AGR_DIED));
  1893. X          }
  1894. X***************
  1895. X*** 617,622 ****
  1896. X--- 633,641 ----
  1897. X          tmp = 0;
  1898. X          break;
  1899. X          case AD_STON:
  1900. X+ #ifdef MUSE
  1901. X+ do_stone_goto_label:
  1902. X+ #endif
  1903. X          if(poly_when_stoned(pd)) {
  1904. X              mon_to_stone(mdef);
  1905. X              tmp = 0;
  1906. X***************
  1907. X*** 626,635 ****
  1908. X              if(vis) pline("%s turns to stone!", Monnam(mdef));
  1909. X              else if(mdef->mtame) You(psf);
  1910. X              monstone(mdef);
  1911. X              return (MM_DEF_DIED | (grow_up(magr,mdef) ?
  1912. X                              0 : MM_AGR_DIED));
  1913. X          }
  1914. X!         tmp = 0;    /* no damage if this fails */
  1915. X          break;
  1916. X          case AD_TLPT:
  1917. X          if(!magr->mcan && tmp < mdef->mhp) {
  1918. X--- 645,657 ----
  1919. X              if(vis) pline("%s turns to stone!", Monnam(mdef));
  1920. X              else if(mdef->mtame) You(psf);
  1921. X              monstone(mdef);
  1922. X+ #ifdef MUSE
  1923. X+             if (mdef->mhp > 0) return 0;
  1924. X+ #endif
  1925. X              return (MM_DEF_DIED | (grow_up(magr,mdef) ?
  1926. X                              0 : MM_AGR_DIED));
  1927. X          }
  1928. X!         tmp = (mattk->adtyp == AD_STON ? 0 : 1);
  1929. X          break;
  1930. X          case AD_TLPT:
  1931. X          if(!magr->mcan && tmp < mdef->mhp) {
  1932. X***************
  1933. X*** 703,708 ****
  1934. X--- 725,733 ----
  1935. X                  else if (mdef->mtame)
  1936. X      You("have a strangely sad feeling for a moment, then it passes.");
  1937. X                  mondied(mdef);
  1938. X+ #ifdef MUSE
  1939. X+                 if (mdef->mhp > 0) return 0;
  1940. X+ #endif
  1941. X                  return (MM_DEF_DIED | (grow_up(magr,mdef) ?
  1942. X                              0 : MM_AGR_DIED));
  1943. X                }
  1944. X***************
  1945. X*** 760,765 ****
  1946. X--- 785,794 ----
  1947. X                  mdef->misc_worn_check &= ~otmp->owornmask;
  1948. X                  otmp->owornmask = 0;
  1949. X              }
  1950. X+             mselftouch(mdef, (const char *)0, FALSE);
  1951. X+             if (mdef->mhp <= 0)
  1952. X+                 return (MM_DEF_DIED | (grow_up(magr,mdef) ?
  1953. X+                             0 : MM_AGR_DIED));
  1954. X  #endif
  1955. X          }
  1956. X          tmp = 0;
  1957. X***************
  1958. X*** 828,833 ****
  1959. X--- 857,863 ----
  1960. X          place_monster(mdef, mdef->mx, mdef->my);
  1961. X          }
  1962. X          monkilled(mdef, "", mattk->adtyp);
  1963. X+         if (mdef->mhp > 0) return 0; /* mdef lifesaved */
  1964. X          return (MM_DEF_DIED | (grow_up(magr,mdef) ? 0 : MM_AGR_DIED));
  1965. X      }
  1966. X      return(MM_HIT);
  1967. X***************
  1968. X*** 884,898 ****
  1969. X  {
  1970. X      char buf[BUFSZ];
  1971. X      Strcpy(buf, mon_nam(mdef));
  1972. X!     if (!flags.verbose || Blind || otemp->oclass != WEAPON_CLASS) return;
  1973. X      pline("%s %s %s %s at %s.", Monnam(magr),
  1974. X!           ((otemp->otyp >= SPEAR &&
  1975. X!             otemp->otyp <= LANCE) ||
  1976. X!            (otemp->otyp >= PARTISAN &&
  1977. X!             otemp->otyp <= SPETUM) ||
  1978. X             otemp->otyp == TRIDENT) ? "thrusts" : "swings",
  1979. X!           humanoid(magr->data) ? (magr->female ? "her" : "his") : "its",
  1980. X!           xname(otemp), buf);
  1981. X  }
  1982. X  
  1983. X  /*
  1984. X--- 914,925 ----
  1985. X  {
  1986. X      char buf[BUFSZ];
  1987. X      Strcpy(buf, mon_nam(mdef));
  1988. X!     if (!flags.verbose || Blind) return;
  1989. X      pline("%s %s %s %s at %s.", Monnam(magr),
  1990. X!           ((otemp->otyp >= SPEAR && otemp->otyp <= LANCE) ||
  1991. X!            (otemp->otyp >= PARTISAN && otemp->otyp <= SPETUM) ||
  1992. X             otemp->otyp == TRIDENT) ? "thrusts" : "swings",
  1993. X!           his[pronoun_gender(magr)], xname(otemp), buf);
  1994. X  }
  1995. X  
  1996. X  /*
  1997. X
  1998. END_OF_FILE
  1999. if test 51083 -ne `wc -c <'patches01d'`; then
  2000.     echo shar: \"'patches01d'\" unpacked with wrong size!
  2001. fi
  2002. # end of 'patches01d'
  2003. if test ! -d 'sys' ; then
  2004.     echo shar: Creating directory \"'sys'\"
  2005.     mkdir 'sys'
  2006. fi
  2007. if test ! -d 'sys/amiga' ; then
  2008.     echo shar: Creating directory \"'sys/amiga'\"
  2009.     mkdir 'sys/amiga'
  2010. fi
  2011. if test ! -d 'sys/mac' ; then
  2012.     echo shar: Creating directory \"'sys/mac'\"
  2013.     mkdir 'sys/mac'
  2014. fi
  2015. if test ! -d 'sys/share' ; then
  2016.     echo shar: Creating directory \"'sys/share'\"
  2017.     mkdir 'sys/share'
  2018. fi
  2019. if test ! -d 'sys/share/sounds' ; then
  2020.     echo shar: Creating directory \"'sys/share/sounds'\"
  2021.     mkdir 'sys/share/sounds'
  2022. fi
  2023. if test ! -d 'sys/winnt' ; then
  2024.     echo shar: Creating directory \"'sys/winnt'\"
  2025.     mkdir 'sys/winnt'
  2026. fi
  2027. echo shar: End of archive 1 \(of 31\).
  2028. cp /dev/null ark1isdone
  2029. MISSING=""
  2030. 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 ; do
  2031.     if test ! -f ark${I}isdone ; then
  2032.     MISSING="${MISSING} ${I}"
  2033.     fi
  2034. done
  2035. if test "${MISSING}" = "" ; then
  2036.     echo You have unpacked all 31 archives.
  2037.     echo "Now execute 'patchit.sh'"
  2038.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2039. else
  2040.     echo You still need to unpack the following archives:
  2041.     echo "        " ${MISSING}
  2042. fi
  2043. ##  End of shell archive.
  2044. exit 0
  2045.