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

  1. Subject:  v17i048:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Patch1g/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 48
  7. Archive-name: nethack31/Patch1g
  8. Patch-To: nethack31: Volume 16, Issue 1-116
  9. Environment: Amiga, Atari, Mac, MS-DOS, Windows-NT, OS2, Unix, VMS, X11
  10.  
  11.  
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then unpack
  15. # it by saving it into a file and typing "sh file".  To overwrite existing
  16. # files, type "sh file -c".  You can also feed this as standard input via
  17. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  18. # will see the following message at the end:
  19. #        "End of archive 7 (of 31)."
  20. # Contents:  patches01h sys/share/sounds/README
  21. # Wrapped by billr@saab on Fri Mar  5 10:50:42 1993
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'patches01h' -a "${1}" != "-c" ; then 
  24.   echo shar: Renaming existing file \"'patches01h'\" to \"'patches01h.orig'\"
  25.   mv -f 'patches01h' 'patches01h.orig'
  26. fi
  27. echo shar: Extracting \"'patches01h'\" \(54919 characters\)
  28. sed "s/^X//" >'patches01h' <<'END_OF_FILE'
  29. X*** /tmp/da08502    Thu Feb 25 10:24:49 1993
  30. X--- src/priest.c    Thu Feb 18 10:58:35 1993
  31. X***************
  32. X*** 1,4 ****
  33. X! /*    SCCS Id: @(#)priest.c    3.1    92/01/05
  34. X  /* Copyright (c) Izchak Miller, Steve Linhart, 1989.           */
  35. X  /* NetHack may be freely redistributed.  See license for details. */
  36. X  
  37. X--- 1,4 ----
  38. X! /*    SCCS Id: @(#)priest.c    3.1    93/02/09
  39. X  /* Copyright (c) Izchak Miller, Steve Linhart, 1989.           */
  40. X  /* NetHack may be freely redistributed.  See license for details. */
  41. X  
  42. X***************
  43. X*** 265,271 ****
  44. X  priestname(mon)
  45. X  register struct monst *mon;
  46. X  {
  47. X!     static char NEARDATA pname[PL_NSIZ];
  48. X  
  49. X      Strcpy(pname, "the ");
  50. X      if (mon->minvis) Strcat(pname, "invisible ");
  51. X--- 265,271 ----
  52. X  priestname(mon)
  53. X  register struct monst *mon;
  54. X  {
  55. X!     static NEARDATA char pname[PL_NSIZ];
  56. X  
  57. X      Strcpy(pname, "the ");
  58. X      if (mon->minvis) Strcat(pname, "invisible ");
  59. X***************
  60. X*** 414,423 ****
  61. X           !priest->mpeaceful || !priest->mcanmove || priest->msleep) {
  62. X          if(!priest->mcanmove || priest->msleep) {
  63. X          pline("%s breaks out of %s reverie!",
  64. X!             humanoid(priest->data)
  65. X!                 ? (priest->female ? "her" : "his")
  66. X!                 : "its",
  67. X!             Monnam(priest));
  68. X          priest->mfrozen = priest->msleep = 0;
  69. X          priest->mcanmove = 1;
  70. X          }
  71. X--- 414,420 ----
  72. X           !priest->mpeaceful || !priest->mcanmove || priest->msleep) {
  73. X          if(!priest->mcanmove || priest->msleep) {
  74. X          pline("%s breaks out of %s reverie!",
  75. X!               Monnam(priest), his[pronoun_gender(priest)]);
  76. X          priest->mfrozen = priest->msleep = 0;
  77. X          priest->mcanmove = 1;
  78. X          }
  79. X***************
  80. X*** 430,436 ****
  81. X             verbalize("Talk?  Here is what I have to say!");
  82. X             break;
  83. X          default:
  84. X!            verbalize("Pilgrim, I have lost mine desire to talk.");
  85. X             break;
  86. X          }
  87. X          return;
  88. X--- 427,433 ----
  89. X             verbalize("Talk?  Here is what I have to say!");
  90. X             break;
  91. X          default:
  92. X!            verbalize("Pilgrim, I would speak no longer with thee.");
  93. X             break;
  94. X          }
  95. X          return;
  96. X***************
  97. X*** 632,637 ****
  98. X--- 629,662 ----
  99. X  
  100. X      if(priest = findpriest(temple_occupied(u.urooms)))
  101. X          wakeup(priest);
  102. X+ }
  103. X+ 
  104. X+ /*
  105. X+  * When saving bones, find priests that aren't on their shrine level,
  106. X+  * and remove them.   This avoids big problems when restoring bones.
  107. X+  */
  108. X+ void
  109. X+ clearpriests()
  110. X+ {
  111. X+     register struct monst *mtmp, *mtmp2;
  112. X+ 
  113. X+     for(mtmp = fmon; mtmp; mtmp = mtmp2) {
  114. X+     mtmp2 = mtmp->nmon;
  115. X+     if (mtmp->ispriest && !on_level(&(EPRI(mtmp)->shrlevel), &u.uz))
  116. X+         mongone(mtmp);
  117. X+     }
  118. X+ }
  119. X+ 
  120. X+ /* munge priest-specific structure when restoring -dlc */
  121. X+ void
  122. X+ restpriest(mtmp, ghostly)
  123. X+ register struct monst *mtmp;
  124. X+ boolean ghostly;
  125. X+ {
  126. X+     if(u.uz.dlevel) {
  127. X+     if (ghostly)
  128. X+         assign_level(&(EPRI(mtmp)->shrlevel), &u.uz);
  129. X+     }
  130. X  }
  131. X  
  132. X  #endif /* OVLB */
  133. X*** /tmp/da08510    Thu Feb 25 10:24:51 1993
  134. X--- src/quest.c    Thu Feb 11 12:11:06 1993
  135. X***************
  136. X*** 55,105 ****
  137. X  }
  138. X  
  139. X  void
  140. X! quest_init() {
  141. X  /*
  142. X   *    Special setup modifications here:
  143. X   *
  144. X!  *    Unfortunately, this is going to have to be done on each level,
  145. X!  *    on start-up, and on entry, since you lose the permonst mods
  146. X   *    across a save/restore :-)
  147. X   *
  148. X   *    1 - The Rogue Leader is the Tourist Nemesis.
  149. X-  *    1 - Elves can have one of two different leaders, work it out here.
  150. X   *    2 - Priests start with a random alignment - convert the leader and
  151. X   *        guardians here.
  152. X   */
  153. X  #ifdef TOURIST
  154. X!     if(pl_character[0] == 'T' && Is_nemesis(&u.uz)) {
  155. X!     register struct monst *mtmp;
  156. X      mons[PM_MASTER_OF_THIEVES].msound = MS_NEMESIS;
  157. X      mons[PM_MASTER_OF_THIEVES].mflags2 &= ~(M2_PEACEFUL);
  158. X      mons[PM_MASTER_OF_THIEVES].mflags2 |= (M2_NASTY|M2_STALK|M2_HOSTILE);
  159. X      mons[PM_MASTER_OF_THIEVES].mflags3 = M3_WANTSARTI | M3_WAITFORU;
  160. X-     for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) /* find the leader... */
  161. X-         if(mtmp->data->msound == MS_NEMESIS) {
  162. X-         set_malign(mtmp); /* changed M2_PEACEFUL */
  163. X-         break;
  164. X-         }
  165. X      } else
  166. X  #endif
  167. X!     if(pl_character[0] == 'E' && flags.female && Is_qstart(&u.uz)) {
  168. X!     register struct monst *mtmp;
  169. X!     for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) /* find the leader... */
  170. X!         if(mtmp->data->msound == MS_LEADER) {
  171. X!         mtmp->data = &mons[PM_ELWING]; /* sex-change */
  172. X!         break;
  173. X!         }
  174. X!     } else if(pl_character[0] == 'P' && Is_qstart(&u.uz)) {
  175. X! 
  176. X!     register struct monst *mtmp;
  177. X!     for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) /* find leader & guards */
  178. X!        if(mtmp->data->msound == MS_LEADER ||
  179. X!           mtmp->data->msound == MS_GUARDIAN) {
  180. X!            /* use game-start alignment for reference */
  181. X!         mtmp->data->maligntyp = u.ualignbase[1]*3;
  182. X!         mtmp->mpeaceful = TRUE;
  183. X!         set_malign(mtmp); /* mpeaceful may have changed */
  184. X!        }
  185. X      }
  186. X  }
  187. X  
  188. X--- 55,87 ----
  189. X  }
  190. X  
  191. X  void
  192. X! quest_init()
  193. X! {
  194. X  /*
  195. X   *    Special setup modifications here:
  196. X   *
  197. X!  *    Unfortunately, this is going to have to be done
  198. X!  *    on each newgame or restore, because you lose the permonst mods
  199. X   *    across a save/restore :-)
  200. X   *
  201. X   *    1 - The Rogue Leader is the Tourist Nemesis.
  202. X   *    2 - Priests start with a random alignment - convert the leader and
  203. X   *        guardians here.
  204. X+  *    3 - Elves can have one of two different leaders, but can't work it
  205. X+  *        out here because it requires hacking the level file data (see
  206. X+  *        sp_lev.c).
  207. X   */
  208. X  #ifdef TOURIST
  209. X!     if (pl_character[0] == 'T') {
  210. X      mons[PM_MASTER_OF_THIEVES].msound = MS_NEMESIS;
  211. X      mons[PM_MASTER_OF_THIEVES].mflags2 &= ~(M2_PEACEFUL);
  212. X      mons[PM_MASTER_OF_THIEVES].mflags2 |= (M2_NASTY|M2_STALK|M2_HOSTILE);
  213. X      mons[PM_MASTER_OF_THIEVES].mflags3 = M3_WANTSARTI | M3_WAITFORU;
  214. X      } else
  215. X  #endif
  216. X!     if (pl_character[0] == 'P') {
  217. X!     mons[PM_ARCH_PRIEST].maligntyp = u.ualignbase[1]*3;
  218. X!     mons[PM_ACOLYTE].maligntyp = u.ualignbase[1]*3;
  219. X      }
  220. X  }
  221. X  
  222. X*** /tmp/da08518    Thu Feb 25 10:24:53 1993
  223. X--- src/questpgr.c    Wed Feb 17 09:03:15 1993
  224. X***************
  225. X*** 183,191 ****
  226. X        ART_PALANTIR_OF_WESTERNESSE },
  227. X  
  228. X  /* H */ { "the Temple of Coeus",
  229. X!       "the Isle of the Healers",
  230. X!       PM_HIPPOCRATES, PM_CYCLOPS, PM_NURSE,
  231. X!       PM_GIANT_RAT, PM_APE, S_RODENT, S_YETI,
  232. X        ART_STAFF_OF_AESCULAPIUS },
  233. X  
  234. X  /* K */ { "the Isle of Glass",
  235. X--- 183,191 ----
  236. X        ART_PALANTIR_OF_WESTERNESSE },
  237. X  
  238. X  /* H */ { "the Temple of Coeus",
  239. X!       "the Temple of Epidaurus",
  240. X!       PM_HIPPOCRATES, PM_CYCLOPS, PM_ATTENDANT,
  241. X!       PM_GIANT_RAT, PM_SNAKE, S_RODENT, S_YETI,
  242. X        ART_STAFF_OF_AESCULAPIUS },
  243. X  
  244. X  /* K */ { "the Isle of Glass",
  245. X***************
  246. X*** 346,352 ****
  247. X              break;
  248. X          case 'i':    str = intermed();
  249. X              break;
  250. X!         case 'o':    str = artiname(qt_matrix[class_index()].artinum);
  251. X              break;
  252. X          case 'n':    str = neminame();
  253. X              break;
  254. X--- 346,352 ----
  255. X              break;
  256. X          case 'i':    str = intermed();
  257. X              break;
  258. X!         case 'o':    str = the(artiname(qt_matrix[class_index()].artinum));
  259. X              break;
  260. X          case 'n':    str = neminame();
  261. X              break;
  262. X***************
  263. X*** 398,403 ****
  264. X--- 398,416 ----
  265. X              if (*(c+1)) {
  266. X                  convert_arg(*(++c));
  267. X                  switch (*(c+1)) {
  268. X+ 
  269. X+                 case 'A': Strcat(cc, An(cvt_buf));
  270. X+                     cc += strlen(cc);
  271. X+                     c++;
  272. X+                     continue; /* for */
  273. X+                 case 'a': Strcat(cc, an(cvt_buf));
  274. X+                     cc += strlen(cc);
  275. X+                     c++;
  276. X+                     continue; /* for */
  277. X+ 
  278. X+                 case 'C': cvt_buf[0] = highc(cvt_buf[0]);
  279. X+                     c++;
  280. X+                     break;
  281. X  
  282. X                  case 'P': cvt_buf[0] = highc(cvt_buf[0]);
  283. X                  case 'p': Strcpy(cvt_buf, makeplural(cvt_buf));
  284. X*** /tmp/da08526    Thu Feb 25 10:24:55 1993
  285. X--- src/read.c    Thu Feb 18 16:51:40 1993
  286. X***************
  287. X*** 1,4 ****
  288. X! /*    SCCS Id: @(#)read.c    3.1    92/12/10    */
  289. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  290. X  /* NetHack may be freely redistributed.  See license for details. */
  291. X  
  292. X--- 1,4 ----
  293. X! /*    SCCS Id: @(#)read.c    3.1    93/02/04    */
  294. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  295. X  /* NetHack may be freely redistributed.  See license for details. */
  296. X  
  297. X***************
  298. X*** 15,21 ****
  299. X  
  300. X  boolean    known;
  301. X  
  302. X! static const char NEARDATA readable[] =
  303. X             { ALL_CLASSES, SCROLL_CLASS, SPBOOK_CLASS, 0 };
  304. X  static const char all_count[] = { ALLOW_COUNT, ALL_CLASSES, 0 };
  305. X  
  306. X--- 15,21 ----
  307. X  
  308. X  boolean    known;
  309. X  
  310. X! static NEARDATA const char readable[] =
  311. X             { ALL_CLASSES, SCROLL_CLASS, SPBOOK_CLASS, 0 };
  312. X  static const char all_count[] = { ALLOW_COUNT, ALL_CLASSES, 0 };
  313. X  
  314. X***************
  315. X*** 281,286 ****
  316. X--- 281,287 ----
  317. X          break;
  318. X          case HORN_OF_PLENTY:
  319. X          case BAG_OF_TRICKS:
  320. X+         case CAN_OF_GREASE:
  321. X          if (is_cursed) stripspe(obj);
  322. X          else if (is_blessed) {
  323. X              if (obj->spe <= 10)
  324. X***************
  325. X*** 292,297 ****
  326. X--- 293,313 ----
  327. X              p_glow1(obj);
  328. X          }
  329. X          break;
  330. X+         case MAGIC_FLUTE:
  331. X+         case MAGIC_HARP:
  332. X+         case FROST_HORN:
  333. X+         case FIRE_HORN:
  334. X+         case DRUM_OF_EARTHQUAKE:
  335. X+         if (is_cursed) {
  336. X+             stripspe(obj);
  337. X+         } else if (is_blessed) {
  338. X+             obj->spe += d(2,4);
  339. X+             p_glow2(obj,blue);
  340. X+         } else {
  341. X+             obj->spe += rnd(4);
  342. X+             p_glow1(obj);
  343. X+         }
  344. X+         break;
  345. X          default:
  346. X          You("have a feeling of loss.");
  347. X          break;
  348. X***************
  349. X*** 349,355 ****
  350. X      register boolean confused = (Confusion != 0);
  351. X      register struct obj *otmp;
  352. X  
  353. X!     exercise(A_WIS, TRUE);        /* just for trying */
  354. X      switch(sobj->otyp) {
  355. X  #ifdef MAIL
  356. X      case SCR_MAIL:
  357. X--- 365,372 ----
  358. X      register boolean confused = (Confusion != 0);
  359. X      register struct obj *otmp;
  360. X  
  361. X!     if (objects[sobj->otyp].oc_magic)
  362. X!         exercise(A_WIS, TRUE);        /* just for trying */
  363. X      switch(sobj->otyp) {
  364. X  #ifdef MAIL
  365. X      case SCR_MAIL:
  366. X***************
  367. X*** 599,604 ****
  368. X--- 616,623 ----
  369. X              (void) makemon (confused ? &mons[PM_ACID_BLOB] :
  370. X                      (struct permonst *) 0, u.ux, u.uy);
  371. X          }
  372. X+         /* flush monsters before asking for identification */
  373. X+         flush_screen(0);
  374. X          break;
  375. X          }
  376. X  /*        break;    /*NOTREACHED*/
  377. X***************
  378. X*** 836,849 ****
  379. X  struct obj *obj;
  380. X  {
  381. X      /* first produce the text (provided you're not blind) */
  382. X-     if(Blind) goto do_it;
  383. X      if(!on) {
  384. X!         if(u.uswallow) {
  385. X              pline("It seems even darker in here than before.");
  386. X              return;
  387. X          }
  388. X!         You("are surrounded by darkness!");
  389. X      } else {
  390. X          if(u.uswallow){
  391. X              if (is_animal(u.ustuck->data))
  392. X                  pline("%s stomach is lit.",
  393. X--- 855,878 ----
  394. X  struct obj *obj;
  395. X  {
  396. X      /* first produce the text (provided you're not blind) */
  397. X      if(!on) {
  398. X!         register struct obj *otmp;
  399. X! 
  400. X!         if (!Blind) {
  401. X!             if(u.uswallow) {
  402. X              pline("It seems even darker in here than before.");
  403. X              return;
  404. X+             }
  405. X+             You("are surrounded by darkness!");
  406. X          }
  407. X! 
  408. X!         /* the magic douses lamps, et al, too */
  409. X!         for(otmp = invent; otmp; otmp = otmp->nobj)
  410. X!             if (otmp->lamplit)
  411. X!             (void) snuff_lit(otmp);
  412. X!         if (Blind) goto do_it;
  413. X      } else {
  414. X+         if (Blind) goto do_it;
  415. X          if(u.uswallow){
  416. X              if (is_animal(u.ustuck->data))
  417. X                  pline("%s stomach is lit.",
  418. X*** /tmp/da08542    Thu Feb 25 10:25:00 1993
  419. X--- src/restore.c    Tue Feb 23 10:00:06 1993
  420. X***************
  421. X*** 31,39 ****
  422. X  
  423. X  boolean restoring = FALSE;
  424. X  #ifdef TUTTI_FRUTTI
  425. X! static struct fruit NEARDATA *oldfruit;
  426. X  #endif
  427. X! static long NEARDATA omoves;
  428. X  
  429. X  /* Recalculate level.objects[x][y], since this info was not saved. */
  430. X  static void
  431. X--- 31,39 ----
  432. X  
  433. X  boolean restoring = FALSE;
  434. X  #ifdef TUTTI_FRUTTI
  435. X! static NEARDATA struct fruit *oldfruit;
  436. X  #endif
  437. X! static NEARDATA long omoves;
  438. X  
  439. X  /* Recalculate level.objects[x][y], since this info was not saved. */
  440. X  static void
  441. X***************
  442. X*** 251,257 ****
  443. X  #ifdef MUSE
  444. X          if (mtmp->mw) mtmp->mw = mtmp->minvent;    /* wield 1st obj in inventory */
  445. X  #endif
  446. X!         if (mtmp->isshk) restshk(mtmp);
  447. X  
  448. X          mtmp2 = mtmp;
  449. X      }
  450. X--- 251,258 ----
  451. X  #ifdef MUSE
  452. X          if (mtmp->mw) mtmp->mw = mtmp->minvent;    /* wield 1st obj in inventory */
  453. X  #endif
  454. X!         if (mtmp->isshk) restshk(mtmp, ghostly);
  455. X!         if (mtmp->ispriest) restpriest(mtmp, ghostly);
  456. X  
  457. X          mtmp2 = mtmp;
  458. X      }
  459. X***************
  460. X*** 330,336 ****
  461. X      flags.msg_history = oldflags.msg_history;
  462. X      flags.echo = oldflags.echo;
  463. X      flags.cbreak = oldflags.cbreak;
  464. X! 
  465. X      mread(fd, (genericptr_t) &u, sizeof(struct you));
  466. X      if(u.uhp <= 0) {
  467. X          You("were not healthy enough to survive restoration.");
  468. X--- 331,342 ----
  469. X      flags.msg_history = oldflags.msg_history;
  470. X      flags.echo = oldflags.echo;
  471. X      flags.cbreak = oldflags.cbreak;
  472. X! #ifdef NEWS
  473. X!     flags.news = oldflags.news;
  474. X! #endif
  475. X! #ifdef AMII_GRAPHICS
  476. X!     amii_setpens();        /* use colors from save file */
  477. X! #endif
  478. X      mread(fd, (genericptr_t) &u, sizeof(struct you));
  479. X      if(u.uhp <= 0) {
  480. X          You("were not healthy enough to survive restoration.");
  481. X***************
  482. X*** 452,457 ****
  483. X--- 458,466 ----
  484. X          restoring = FALSE;
  485. X          return(0);
  486. X      }
  487. X+ #ifdef MULDGN
  488. X+     quest_init();
  489. X+ #endif
  490. X  #ifdef INSURANCE
  491. X      savestateinlock();
  492. X  #endif
  493. X***************
  494. X*** 485,492 ****
  495. X              break;
  496. X          getlev(fd, 0, ltmp, FALSE);
  497. X  #ifdef MICRO
  498. X!         curs(WIN_MAP, 11 + dotcnt++, 1);
  499. X          putstr(WIN_MAP, 0, ".");
  500. X  #endif
  501. X          rtmp = restlevelfile(fd, ltmp);
  502. X          if (rtmp < 2) return(rtmp);  /* dorecover called recursively */
  503. X--- 494,502 ----
  504. X              break;
  505. X          getlev(fd, 0, ltmp, FALSE);
  506. X  #ifdef MICRO
  507. X!         curs(WIN_MAP, 1+dotcnt++, 2);
  508. X          putstr(WIN_MAP, 0, ".");
  509. X+         mark_synch();
  510. X  #endif
  511. X          rtmp = restlevelfile(fd, ltmp);
  512. X          if (rtmp < 2) return(rtmp);  /* dorecover called recursively */
  513. X***************
  514. X*** 814,819 ****
  515. X--- 824,837 ----
  516. X          }
  517. X          break;
  518. X          }
  519. X+     } else if (ghostly && !Is_branchlev(&u.uz)) {
  520. X+         /* Make sure there are no dangling portals.  If so, remove them */
  521. X+         register struct trap *ttmp;
  522. X+         for(ttmp = ftrap; ttmp; ttmp = ttmp->ntrap)
  523. X+         if (ttmp->ttyp == MAGIC_PORTAL) {
  524. X+             deltrap(ttmp);
  525. X+             break; /* max of 1 portal/level */
  526. X+         }
  527. X      }
  528. X  }
  529. X  
  530. X***************
  531. X*** 823,833 ****
  532. X  #ifndef ZEROCOMP_BUFSIZ
  533. X  #define ZEROCOMP_BUFSIZ BUFSZ
  534. X  #endif
  535. X! static unsigned char NEARDATA inbuf[ZEROCOMP_BUFSIZ];
  536. X! static unsigned short NEARDATA inbufp = 0;
  537. X! static unsigned short NEARDATA inbufsz = 0;
  538. X! static short NEARDATA inrunlength = -1;
  539. X! static int NEARDATA mreadfd;
  540. X  
  541. X  static int
  542. X  mgetc()
  543. X--- 841,851 ----
  544. X  #ifndef ZEROCOMP_BUFSIZ
  545. X  #define ZEROCOMP_BUFSIZ BUFSZ
  546. X  #endif
  547. X! static NEARDATA unsigned char inbuf[ZEROCOMP_BUFSIZ];
  548. X! static NEARDATA unsigned short inbufp = 0;
  549. X! static NEARDATA unsigned short inbufsz = 0;
  550. X! static NEARDATA short inrunlength = -1;
  551. X! static NEARDATA int mreadfd;
  552. X  
  553. X  static int
  554. X  mgetc()
  555. X*** /tmp/da08558    Thu Feb 25 10:25:05 1993
  556. X--- src/rnd.c    Thu Feb 11 12:12:15 1993
  557. X***************
  558. X*** 27,34 ****
  559. X          impossible("rn2(0) attempted");
  560. X          return(0);
  561. X      }
  562. X! #endif
  563. X      return(RND(x));
  564. X  }
  565. X  
  566. X  #endif /* OVL0 */
  567. X--- 27,37 ----
  568. X          impossible("rn2(0) attempted");
  569. X          return(0);
  570. X      }
  571. X!     x = RND(x);
  572. X!     return(x);
  573. X! #else
  574. X      return(RND(x));
  575. X+ #endif
  576. X  }
  577. X  
  578. X  #endif /* OVL0 */
  579. X***************
  580. X*** 69,76 ****
  581. X          impossible("rnd(0) attempted");
  582. X          return(1);
  583. X      }
  584. X! #endif
  585. X      return(RND(x)+1);
  586. X  }
  587. X  
  588. X  #endif /* OVL0 */
  589. X--- 72,82 ----
  590. X          impossible("rnd(0) attempted");
  591. X          return(1);
  592. X      }
  593. X!     x = RND(x)+1;
  594. X!     return(x);
  595. X! #else
  596. X      return(RND(x)+1);
  597. X+ #endif
  598. X  }
  599. X  
  600. X  #endif /* OVL0 */
  601. X***************
  602. X*** 83,89 ****
  603. X      register int tmp = n;
  604. X  
  605. X  #ifdef DEBUG
  606. X!     if (x == 0) {
  607. X          impossible("d(n,0) attempted");
  608. X          return(1);
  609. X      }
  610. X--- 89,95 ----
  611. X      register int tmp = n;
  612. X  
  613. X  #ifdef DEBUG
  614. X!     if (x == 0 && n != 0) {
  615. X          impossible("d(n,0) attempted");
  616. X          return(1);
  617. X      }
  618. X*** /tmp/da08574    Thu Feb 25 10:25:09 1993
  619. X--- src/save.c    Tue Feb 23 10:00:09 1993
  620. X***************
  621. X*** 1,4 ****
  622. X! /*    SCCS Id: @(#)save.c    3.1    93/01/07    */
  623. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  624. X  /* NetHack may be freely redistributed.  See license for details. */
  625. X  
  626. X--- 1,4 ----
  627. X! /*    SCCS Id: @(#)save.c    3.1    93/02/09    */
  628. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  629. X  /* NetHack may be freely redistributed.  See license for details. */
  630. X  
  631. X***************
  632. X*** 61,67 ****
  633. X      } else {
  634. X          clear_nhwindow(WIN_MESSAGE);
  635. X          pline("Saving...");
  636. X-         mark_synch();    /* flush output */
  637. X          hu = FALSE;
  638. X          if(dosave0()) {
  639. X              /* make sure they see the Saving message */
  640. X--- 61,66 ----
  641. X***************
  642. X*** 93,98 ****
  643. X--- 92,98 ----
  644. X  {
  645. X      register int fd, ofd;
  646. X      xchar ltmp;
  647. X+     d_level uz_save;
  648. X  #ifdef MFLOPPY
  649. X      long fds, needed;
  650. X  #endif
  651. X***************
  652. X*** 122,128 ****
  653. X          }
  654. X      }
  655. X  #endif
  656. X!     
  657. X      fd = create_savefile();
  658. X  
  659. X      if(fd < 0) {
  660. X--- 122,129 ----
  661. X          }
  662. X      }
  663. X  #endif
  664. X!     if (!hu) mark_synch();    /* flush any buffered screen output */
  665. X! 
  666. X      fd = create_savefile();
  667. X  
  668. X      if(fd < 0) {
  669. X***************
  670. X*** 170,177 ****
  671. X      savelev(fd, ledger_no(&u.uz), WRITE_SAVE | FREE_SAVE);
  672. X      savegamestate(fd, WRITE_SAVE | FREE_SAVE);
  673. X  
  674. X      for(ltmp = (xchar)1; ltmp <= maxledgerno(); ltmp++) {
  675. X!         if (ltmp == ledger_no(&u.uz)) continue;
  676. X  #ifdef MFLOPPY
  677. X          if (!fileinfo[ltmp].where) continue;
  678. X  #else
  679. X--- 171,186 ----
  680. X      savelev(fd, ledger_no(&u.uz), WRITE_SAVE | FREE_SAVE);
  681. X      savegamestate(fd, WRITE_SAVE | FREE_SAVE);
  682. X  
  683. X+     /* While copying level files around, zero out u.uz to keep
  684. X+      * parts of the restore code from completely initializing all
  685. X+      * in-core data structures, since all we're doing is copying.
  686. X+      * This also avoids at least one nasty core dump.
  687. X+      */
  688. X+     uz_save = u.uz;
  689. X+     u.uz.dnum = u.uz.dlevel = 0;
  690. X+ 
  691. X      for(ltmp = (xchar)1; ltmp <= maxledgerno(); ltmp++) {
  692. X!         if (ltmp == ledger_no(&uz_save)) continue;
  693. X  #ifdef MFLOPPY
  694. X          if (!fileinfo[ltmp].where) continue;
  695. X  #else
  696. X***************
  697. X*** 179,186 ****
  698. X  #endif
  699. X  #ifdef MICRO
  700. X          if(!hu) {
  701. X!             curs(WIN_MAP, 8 + dotcnt++, 1);
  702. X              putstr(WIN_MAP, 0, ".");
  703. X          }
  704. X  #endif
  705. X          ofd = open_levelfile(ltmp);
  706. X--- 188,196 ----
  707. X  #endif
  708. X  #ifdef MICRO
  709. X          if(!hu) {
  710. X!             curs(WIN_MAP, 1 + dotcnt++, 2);
  711. X              putstr(WIN_MAP, 0, ".");
  712. X+             mark_synch();
  713. X          }
  714. X  #endif
  715. X          ofd = open_levelfile(ltmp);
  716. X***************
  717. X*** 200,205 ****
  718. X--- 210,217 ----
  719. X      }
  720. X      bclose(fd);
  721. X  
  722. X+     u.uz = uz_save;
  723. X+ 
  724. X      /* get rid of current level --jgm */
  725. X      delete_levelfile(ledger_no(&u.uz));
  726. X      delete_levelfile(0);
  727. X***************
  728. X*** 455,466 ****
  729. X  #define flushoutrun(ln) (bputc(RLESC), bputc(ln), ln = -1)
  730. X  
  731. X  #ifndef ZEROCOMP_BUFSIZ
  732. X! #define ZEROCOMP_BUFSIZ BUFSZ
  733. X  #endif
  734. X! static unsigned char NEARDATA outbuf[ZEROCOMP_BUFSIZ];
  735. X! static unsigned short NEARDATA outbufp = 0;
  736. X! static short NEARDATA outrunlength = -1;
  737. X! static int NEARDATA bwritefd;
  738. X  
  739. X  /*dbg()
  740. X  {
  741. X--- 467,478 ----
  742. X  #define flushoutrun(ln) (bputc(RLESC), bputc(ln), ln = -1)
  743. X  
  744. X  #ifndef ZEROCOMP_BUFSIZ
  745. X! # define ZEROCOMP_BUFSIZ BUFSZ
  746. X  #endif
  747. X! static NEARDATA unsigned char outbuf[ZEROCOMP_BUFSIZ];
  748. X! static NEARDATA unsigned short outbufp = 0;
  749. X! static NEARDATA short outrunlength = -1;
  750. X! static NEARDATA int bwritefd;
  751. X  
  752. X  /*dbg()
  753. X  {
  754. X***************
  755. X*** 676,683 ****
  756. X  
  757. X          if (Is_container(otmp) || otmp->otyp == STATUE)
  758. X          saveobjchn(fd,otmp->cobj,mode);
  759. X!         if (mode & FREE_SAVE)
  760. X          dealloc_obj(otmp);
  761. X          otmp = otmp2;
  762. X      }
  763. X      bwrite(fd, (genericptr_t) &minusone, sizeof(int));
  764. X--- 688,697 ----
  765. X  
  766. X          if (Is_container(otmp) || otmp->otyp == STATUE)
  767. X          saveobjchn(fd,otmp->cobj,mode);
  768. X!         if (mode & FREE_SAVE) {
  769. X!         if(otmp->oclass == FOOD_CLASS) food_disappears(otmp);
  770. X          dealloc_obj(otmp);
  771. X+         }
  772. X          otmp = otmp2;
  773. X      }
  774. X      bwrite(fd, (genericptr_t) &minusone, sizeof(int));
  775. X*** /tmp/da08582    Thu Feb 25 10:25:11 1993
  776. X--- src/shk.c    Thu Feb 18 11:17:58 1993
  777. X***************
  778. X*** 1,4 ****
  779. X! /*    SCCS Id: @(#)shk.c    3.1    93/01/12    */
  780. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  781. X  /* NetHack may be freely redistributed.  See license for details. */
  782. X  
  783. X--- 1,4 ----
  784. X! /*    SCCS Id: @(#)shk.c    3.1    93/02/09    */
  785. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  786. X  /* NetHack may be freely redistributed.  See license for details. */
  787. X  
  788. X***************
  789. X*** 25,31 ****
  790. X  
  791. X  extern const struct shclass shtypes[];    /* defined in shknam.c */
  792. X  
  793. X! STATIC_VAR long int NEARDATA followmsg;    /* last time of follow message */
  794. X  
  795. X  STATIC_DCL void FDECL(setpaid, (struct monst *));
  796. X  STATIC_DCL long FDECL(addupbill, (struct monst *));
  797. X--- 25,31 ----
  798. X  
  799. X  extern const struct shclass shtypes[];    /* defined in shknam.c */
  800. X  
  801. X! STATIC_VAR NEARDATA long int followmsg;    /* last time of follow message */
  802. X  
  803. X  STATIC_DCL void FDECL(setpaid, (struct monst *));
  804. X  STATIC_DCL long FDECL(addupbill, (struct monst *));
  805. X***************
  806. X*** 43,49 ****
  807. X  static long FDECL(cost_per_charge, (struct obj *));
  808. X  static long FDECL(cheapest_item, (struct monst *));
  809. X  static int FDECL(dopayobj, (struct monst *, struct bill_x *,
  810. X!                 struct obj *, int, BOOLEAN_P));
  811. X  static long FDECL(stolen_container, (struct obj *, struct monst *, long,
  812. X                       BOOLEAN_P));
  813. X  static long FDECL(getprice, (struct obj *));
  814. X--- 43,49 ----
  815. X  static long FDECL(cost_per_charge, (struct obj *));
  816. X  static long FDECL(cheapest_item, (struct monst *));
  817. X  static int FDECL(dopayobj, (struct monst *, struct bill_x *,
  818. X!                 struct obj **, int, BOOLEAN_P));
  819. X  static long FDECL(stolen_container, (struct obj *, struct monst *, long,
  820. X                       BOOLEAN_P));
  821. X  static long FDECL(getprice, (struct obj *));
  822. X***************
  823. X*** 55,61 ****
  824. X  static void FDECL(remove_damage, (struct monst *, BOOLEAN_P));
  825. X  static void FDECL(sub_one_frombill, (struct obj *, struct monst *));
  826. X  static void FDECL(add_one_tobill, (struct obj *, BOOLEAN_P));
  827. X! static void FDECL(dropped_container, (struct obj *));
  828. X  static void FDECL(bill_box_content, (struct obj *, BOOLEAN_P, BOOLEAN_P,
  829. X                       struct monst *));
  830. X  
  831. X--- 55,62 ----
  832. X  static void FDECL(remove_damage, (struct monst *, BOOLEAN_P));
  833. X  static void FDECL(sub_one_frombill, (struct obj *, struct monst *));
  834. X  static void FDECL(add_one_tobill, (struct obj *, BOOLEAN_P));
  835. X! static void FDECL(dropped_container, (struct obj *, struct monst *,
  836. X!                       BOOLEAN_P));
  837. X  static void FDECL(bill_box_content, (struct obj *, BOOLEAN_P, BOOLEAN_P,
  838. X                       struct monst *));
  839. X  
  840. X***************
  841. X*** 134,144 ****
  842. X  
  843. X  /* do shopkeeper specific structure munging -dlc */
  844. X  void
  845. X! restshk(mtmp)
  846. X  register struct monst *mtmp;
  847. X  {
  848. X!     if(ESHK(mtmp)->bill_p != (struct bill_x *) -1000)
  849. X!     ESHK(mtmp)->bill_p = &(ESHK(mtmp)->bill[0]);
  850. X  }
  851. X  
  852. X  /* Clear the unpaid bit on all of the objects in the list. */
  853. X--- 135,152 ----
  854. X  
  855. X  /* do shopkeeper specific structure munging -dlc */
  856. X  void
  857. X! restshk(mtmp, ghostly)
  858. X  register struct monst *mtmp;
  859. X+ boolean ghostly;
  860. X  {
  861. X!     if(u.uz.dlevel) {
  862. X!     if(ESHK(mtmp)->bill_p != (struct bill_x *) -1000)
  863. X!         ESHK(mtmp)->bill_p = &(ESHK(mtmp)->bill[0]);
  864. X!     /* shoplevel can change as dungeons move around */
  865. X!     /* savebones guarantees that non-homed shk's will be gone */
  866. X!     if (ghostly)
  867. X!         assign_level(&(ESHK(mtmp)->shoplevel), &u.uz);
  868. X!     }
  869. X  }
  870. X  
  871. X  /* Clear the unpaid bit on all of the objects in the list. */
  872. X***************
  873. X*** 857,864 ****
  874. X  
  875. X      /* ltmp is still eshkp->robbed here */
  876. X      if (!eshkp->billct && !eshkp->debit) {
  877. X!         const char *pronoun = shkp->female ? "her" : "him";
  878. X!         const char *possessive = shkp->female ? "her" : "his";
  879. X  
  880. X          if(!ltmp && NOTANGRY(shkp)) {
  881. X              You("do not owe %s anything.", mon_nam(shkp));
  882. X--- 865,872 ----
  883. X  
  884. X      /* ltmp is still eshkp->robbed here */
  885. X      if (!eshkp->billct && !eshkp->debit) {
  886. X!         const char *pronoun = him[shkp->female];
  887. X!         const char *possessive = his[shkp->female];
  888. X  
  889. X          if(!ltmp && NOTANGRY(shkp)) {
  890. X              You("do not owe %s anything.", mon_nam(shkp));
  891. X***************
  892. X*** 980,990 ****
  893. X          for (pass = 0; pass <= 1; pass++) {
  894. X          tmp = 0;
  895. X          while (tmp < eshkp->billct) {
  896. X!             register struct obj *otmp;
  897. X              register struct bill_x *bp = &(eshkp->bill_p[tmp]);
  898. X  
  899. X              /* find the object on one of the lists */
  900. X!             if (!(otmp = bp_to_obj(bp))) {
  901. X              impossible("Shopkeeper administration out of order.");
  902. X              setpaid(shkp);    /* be nice to the player */
  903. X              return 1;
  904. X--- 988,1003 ----
  905. X          for (pass = 0; pass <= 1; pass++) {
  906. X          tmp = 0;
  907. X          while (tmp < eshkp->billct) {
  908. X!             struct obj *otmp;
  909. X              register struct bill_x *bp = &(eshkp->bill_p[tmp]);
  910. X  
  911. X              /* find the object on one of the lists */
  912. X!             if ((otmp = bp_to_obj(bp)) != 0) {
  913. X!             /* if completely used up, object quantity is stale;
  914. X!                restoring it to its original value here avoids
  915. X!                making the partly-used-up code more complicated */
  916. X!             if (bp->useup) otmp->quan = bp->bquan;
  917. X!             } else {
  918. X              impossible("Shopkeeper administration out of order.");
  919. X              setpaid(shkp);    /* be nice to the player */
  920. X              return 1;
  921. X***************
  922. X*** 996,1002 ****
  923. X               * are processed on both passes */
  924. X              tmp++;
  925. X              } else {
  926. X!             switch (dopayobj(shkp, bp, otmp, pass, itemize)) {
  927. X                case PAY_CANT:
  928. X                  return 1;    /*break*/
  929. X                case PAY_BROKE:
  930. X--- 1009,1015 ----
  931. X               * are processed on both passes */
  932. X              tmp++;
  933. X              } else {
  934. X!             switch (dopayobj(shkp, bp, &otmp, pass, itemize)) {
  935. X                case PAY_CANT:
  936. X                  return 1;    /*break*/
  937. X                case PAY_BROKE:
  938. X***************
  939. X*** 1033,1045 ****
  940. X  /*     -1 if skip this object     */
  941. X  /*     -2 if no money/credit left */
  942. X  static int
  943. X! dopayobj(shkp, bp, obj, which, itemize)
  944. X  register struct monst *shkp;
  945. X  register struct bill_x *bp;
  946. X! register struct obj *obj;
  947. X  int    which;        /* 0 => used-up item, 1 => other (unpaid or lost) */
  948. X  boolean itemize;
  949. X  {
  950. X      long ltmp, quan, save_quan;
  951. X      int buy;
  952. X      boolean stashed_gold = (hidden_gold() > 0L),
  953. X--- 1046,1059 ----
  954. X  /*     -1 if skip this object     */
  955. X  /*     -2 if no money/credit left */
  956. X  static int
  957. X! dopayobj(shkp, bp, obj_p, which, itemize)
  958. X  register struct monst *shkp;
  959. X  register struct bill_x *bp;
  960. X! struct obj **obj_p;
  961. X  int    which;        /* 0 => used-up item, 1 => other (unpaid or lost) */
  962. X  boolean itemize;
  963. X  {
  964. X+     register struct obj *obj = *obj_p;
  965. X      long ltmp, quan, save_quan;
  966. X      int buy;
  967. X      boolean stashed_gold = (hidden_gold() > 0L),
  968. X***************
  969. X*** 1106,1129 ****
  970. X      obj->quan = save_quan;        /* restore original count */
  971. X      /* quan => amount just bought, save_quan => remaining unpaid count */
  972. X      if (consumed) {
  973. X!         if (quan != save_quan) {
  974. X          /* eliminate used-up portion; remainder is still unpaid */
  975. X          bp->bquan = obj->quan;
  976. X          obj->unpaid = 1;
  977. X          bp->useup = 0;
  978. X          } else {    /* completely used-up, so get rid of it */
  979. X!         register struct obj *otmp = billobjs;
  980. X!         if(obj == billobjs)
  981. X!             billobjs = obj->nobj;
  982. X!         else {
  983. X!             while(otmp && otmp->nobj != obj) otmp = otmp->nobj;
  984. X!             if(otmp) otmp->nobj = obj->nobj;
  985. X!             else impossible("Error in shopkeeper administration.");
  986. X          }
  987. X          dealloc_obj(obj);
  988. X          }
  989. X      }
  990. X!     return quan != save_quan ? PAY_SOME : PAY_BUY;
  991. X  }
  992. X  
  993. X  /* routine called after dying (or quitting) */
  994. X--- 1120,1147 ----
  995. X      obj->quan = save_quan;        /* restore original count */
  996. X      /* quan => amount just bought, save_quan => remaining unpaid count */
  997. X      if (consumed) {
  998. X!         if (quan != bp->bquan) {
  999. X          /* eliminate used-up portion; remainder is still unpaid */
  1000. X          bp->bquan = obj->quan;
  1001. X          obj->unpaid = 1;
  1002. X          bp->useup = 0;
  1003. X+         buy = PAY_SOME;
  1004. X          } else {    /* completely used-up, so get rid of it */
  1005. X!         if (obj == billobjs) {
  1006. X!             billobjs = obj->nobj;
  1007. X!         } else {
  1008. X!             register struct obj *otmp = billobjs;
  1009. X! 
  1010. X!             while (otmp && otmp->nobj != obj) otmp = otmp->nobj;
  1011. X!             if (otmp) otmp->nobj = obj->nobj;
  1012. X!             else impossible("Error in shopkeeper administration.");
  1013. X          }
  1014. X+          /* assert( obj == *obj_p ); */
  1015. X          dealloc_obj(obj);
  1016. X+         *obj_p = 0;    /* destroy pointer to freed object */
  1017. X          }
  1018. X      }
  1019. X!     return buy;
  1020. X  }
  1021. X  
  1022. X  /* routine called after dying (or quitting) */
  1023. X***************
  1024. X*** 1353,1359 ****
  1025. X          register boolean goods = saleable(rooms[ESHK(shkp)->shoproom -
  1026. X                         ROOMOFFSET].rtype-SHOPBASE, otmp);
  1027. X  
  1028. X!         if(otmp->otyp == GOLD_PIECE) continue;
  1029. X  
  1030. X          /* the "top" container is evaluated by caller */
  1031. X          if(usell) {
  1032. X--- 1371,1377 ----
  1033. X          register boolean goods = saleable(rooms[ESHK(shkp)->shoproom -
  1034. X                         ROOMOFFSET].rtype-SHOPBASE, otmp);
  1035. X  
  1036. X!         if(otmp->oclass == GOLD_CLASS) continue;
  1037. X  
  1038. X          /* the "top" container is evaluated by caller */
  1039. X          if(usell) {
  1040. X***************
  1041. X*** 1383,1389 ****
  1042. X  
  1043. X      /* accumulate contained gold */
  1044. X      for (otmp = obj->cobj; otmp; otmp = otmp->nobj)
  1045. X!         if (otmp->otyp == GOLD_PIECE)
  1046. X          value += otmp->quan;
  1047. X          else if (Is_container(otmp))
  1048. X          value += contained_gold(otmp);
  1049. X--- 1401,1407 ----
  1050. X  
  1051. X      /* accumulate contained gold */
  1052. X      for (otmp = obj->cobj; otmp; otmp = otmp->nobj)
  1053. X!         if (otmp->oclass == GOLD_CLASS)
  1054. X          value += otmp->quan;
  1055. X          else if (Is_container(otmp))
  1056. X          value += contained_gold(otmp);
  1057. X***************
  1058. X*** 1392,1412 ****
  1059. X  }
  1060. X  
  1061. X  static void
  1062. X! dropped_container(obj)
  1063. X  register struct obj *obj;
  1064. X  {
  1065. X      register struct obj *otmp;
  1066. X  
  1067. X      /* the "top" container is treated in the calling fn */
  1068. X      for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  1069. X  
  1070. X!         if(otmp->otyp == GOLD_PIECE) continue;
  1071. X  
  1072. X!         if(!otmp->unpaid)
  1073. X          otmp->no_charge = 1;
  1074. X  
  1075. X          if(Is_container(otmp))
  1076. X!         dropped_container(otmp);
  1077. X      }
  1078. X  }
  1079. X  
  1080. X--- 1410,1436 ----
  1081. X  }
  1082. X  
  1083. X  static void
  1084. X! dropped_container(obj, shkp, sale)
  1085. X  register struct obj *obj;
  1086. X+ register struct monst *shkp;
  1087. X+ register boolean sale;
  1088. X  {
  1089. X      register struct obj *otmp;
  1090. X+     register boolean saleitem;
  1091. X  
  1092. X      /* the "top" container is treated in the calling fn */
  1093. X      for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  1094. X  
  1095. X!         if(otmp->oclass == GOLD_CLASS) continue;
  1096. X  
  1097. X!         saleitem = saleable(rooms[ESHK(shkp)->shoproom -
  1098. X!                     ROOMOFFSET].rtype-SHOPBASE, otmp);
  1099. X! 
  1100. X!         if(!otmp->unpaid && !(sale && saleitem))
  1101. X          otmp->no_charge = 1;
  1102. X  
  1103. X          if(Is_container(otmp))
  1104. X!         dropped_container(otmp, shkp, sale);
  1105. X      }
  1106. X  }
  1107. X  
  1108. X***************
  1109. X*** 1419,1425 ****
  1110. X      /* the "top" container is treated in the calling fn */
  1111. X      for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  1112. X  
  1113. X!         if(otmp->otyp == GOLD_PIECE) continue;
  1114. X  
  1115. X          if(otmp->no_charge)
  1116. X          otmp->no_charge = 0;
  1117. X--- 1443,1449 ----
  1118. X      /* the "top" container is treated in the calling fn */
  1119. X      for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  1120. X  
  1121. X!         if(otmp->oclass == GOLD_CLASS) continue;
  1122. X  
  1123. X          if(otmp->no_charge)
  1124. X          otmp->no_charge = 0;
  1125. X***************
  1126. X*** 1535,1541 ****
  1127. X  
  1128. X      for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  1129. X  
  1130. X!         if(obj->otyp == GOLD_PIECE) continue;
  1131. X          /* the "top" box is added in addtobill() */
  1132. X          if(!otmp->no_charge)
  1133. X              add_one_tobill(otmp, dummy);
  1134. X--- 1559,1565 ----
  1135. X  
  1136. X      for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  1137. X  
  1138. X!         if(otmp->oclass == GOLD_CLASS) continue;
  1139. X          /* the "top" box is added in addtobill() */
  1140. X          if(!otmp->no_charge)
  1141. X              add_one_tobill(otmp, dummy);
  1142. X***************
  1143. X*** 1576,1582 ****
  1144. X          return;
  1145. X      }
  1146. X  
  1147. X!     if(!obj->no_charge) ltmp = get_cost(obj, shkp);
  1148. X  
  1149. X      if (obj->no_charge && !container) {
  1150. X          obj->no_charge = 0;
  1151. X--- 1600,1607 ----
  1152. X          return;
  1153. X      }
  1154. X  
  1155. X!     if(!obj->no_charge)
  1156. X!         ltmp = get_cost(obj, shkp);
  1157. X  
  1158. X      if (obj->no_charge && !container) {
  1159. X          obj->no_charge = 0;
  1160. X***************
  1161. X*** 1754,1760 ****
  1162. X  
  1163. X      if(Is_container(obj))
  1164. X          for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  1165. X!         if(otmp->otyp == GOLD_PIECE) continue;
  1166. X  
  1167. X          if(Is_container(otmp))
  1168. X              subfrombill(otmp, shkp);
  1169. X--- 1779,1785 ----
  1170. X  
  1171. X      if(Is_container(obj))
  1172. X          for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  1173. X!         if(otmp->oclass == GOLD_CLASS) continue;
  1174. X  
  1175. X          if(Is_container(otmp))
  1176. X              subfrombill(otmp, shkp);
  1177. X***************
  1178. X*** 1783,1789 ****
  1179. X      /* the price of contained objects, if any */
  1180. X      for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  1181. X  
  1182. X!         if(otmp->otyp == GOLD_PIECE) continue;
  1183. X  
  1184. X          if(!Is_container(otmp)) {
  1185. X          if(ininv) {
  1186. X--- 1808,1814 ----
  1187. X      /* the price of contained objects, if any */
  1188. X      for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  1189. X  
  1190. X!         if(otmp->oclass == GOLD_CLASS) continue;
  1191. X  
  1192. X          if(!Is_container(otmp)) {
  1193. X          if(ininv) {
  1194. X***************
  1195. X*** 1825,1831 ****
  1196. X                     ROOMOFFSET].rtype-SHOPBASE, obj);
  1197. X      goods = (goods && !obj->no_charge);
  1198. X  
  1199. X!     if(obj->otyp == GOLD_PIECE) {
  1200. X          gvalue += obj->quan;
  1201. X      } else if(Is_container(obj)) {
  1202. X          register boolean ininv = !!count_unpaid(obj->cobj);
  1203. X--- 1850,1856 ----
  1204. X                     ROOMOFFSET].rtype-SHOPBASE, obj);
  1205. X      goods = (goods && !obj->no_charge);
  1206. X  
  1207. X!     if(obj->oclass == GOLD_CLASS) {
  1208. X          gvalue += obj->quan;
  1209. X      } else if(Is_container(obj)) {
  1210. X          register boolean ininv = !!count_unpaid(obj->cobj);
  1211. X***************
  1212. X*** 1845,1851 ****
  1213. X          ESHK(shkp)->debit += value;
  1214. X  
  1215. X          if(!silent) {
  1216. X!         if(obj->otyp == GOLD_PIECE)
  1217. X              You("owe %s %ld zorkmids!", mon_nam(shkp), value);
  1218. X          else You("owe %s %ld zorkmids for %s!",
  1219. X              mon_nam(shkp),
  1220. X--- 1870,1876 ----
  1221. X          ESHK(shkp)->debit += value;
  1222. X  
  1223. X          if(!silent) {
  1224. X!         if(obj->oclass == GOLD_CLASS)
  1225. X              You("owe %s %ld zorkmids!", mon_nam(shkp), value);
  1226. X          else You("owe %s %ld zorkmids for %s!",
  1227. X              mon_nam(shkp),
  1228. X***************
  1229. X*** 1928,1933 ****
  1230. X--- 1953,1959 ----
  1231. X  
  1232. X      offer = ltmp + cltmp;
  1233. X  
  1234. X+     /* get one case out of the way: nothing to sell, and no gold */
  1235. X      if(!isgold && (offer + gltmp) == 0L) {
  1236. X          register boolean unpaid = (obj->unpaid ||
  1237. X                    (container && count_unpaid(obj->cobj)));
  1238. X***************
  1239. X*** 1934,1940 ****
  1240. X  
  1241. X          if(container) {
  1242. X              if(obj->cobj != (struct obj *)0) {
  1243. X!             dropped_container(obj);
  1244. X              if(obj->unpaid || count_unpaid(obj->cobj))
  1245. X                  subfrombill(obj, shkp);
  1246. X              } else obj->no_charge = 1;
  1247. X--- 1960,1968 ----
  1248. X  
  1249. X          if(container) {
  1250. X              if(obj->cobj != (struct obj *)0) {
  1251. X!             dropped_container(obj, shkp, FALSE);
  1252. X!             if(!obj->unpaid && !saleitem)
  1253. X!                 obj->no_charge = 1;
  1254. X              if(obj->unpaid || count_unpaid(obj->cobj))
  1255. X                  subfrombill(obj, shkp);
  1256. X              } else obj->no_charge = 1;
  1257. X***************
  1258. X*** 1948,1955 ****
  1259. X      /* you dropped something of your own - probably want to sell it */
  1260. X      if(shkp->msleep || !shkp->mcanmove) {
  1261. X          if(container && obj->cobj != (struct obj *)0) {
  1262. X!             dropped_container(obj);
  1263. X          }
  1264. X          if(!shkp->mcanmove) {
  1265. X              if(ANGRY(shkp) && !rn2(4))
  1266. X              pline("%s utters a curse.", Monnam(shkp));
  1267. X--- 1976,1985 ----
  1268. X      /* you dropped something of your own - probably want to sell it */
  1269. X      if(shkp->msleep || !shkp->mcanmove) {
  1270. X          if(container && obj->cobj != (struct obj *)0) {
  1271. X!             dropped_container(obj, shkp, TRUE);
  1272. X          }
  1273. X+         if(!obj->unpaid && !saleitem && !isgold)
  1274. X+             obj->no_charge = 1;
  1275. X          if(!shkp->mcanmove) {
  1276. X              if(ANGRY(shkp) && !rn2(4))
  1277. X              pline("%s utters a curse.", Monnam(shkp));
  1278. X***************
  1279. X*** 1963,1977 ****
  1280. X  
  1281. X      eshkp = ESHK(shkp);
  1282. X  
  1283. X!     if(isgold || cgold) {
  1284. X!         if(ANGRY(shkp)) {
  1285. X!             if(!offer) {
  1286. X!              pline("%s is not appeased.", Monnam(shkp));
  1287. X!              if(cgold) subfrombill(obj, shkp);
  1288. X!              return;
  1289. X!             } else goto move_on;
  1290. X!         }
  1291. X  
  1292. X          if(!cgold) gltmp = obj->quan;
  1293. X  
  1294. X          if(eshkp->debit >= gltmp) {
  1295. X--- 1993,2016 ----
  1296. X  
  1297. X      eshkp = ESHK(shkp);
  1298. X  
  1299. X!     if (ANGRY(shkp)) { /* they become shop-objects, no pay */
  1300. X!         pline("Thank you, scum!");
  1301. X!         subfrombill(obj, shkp);
  1302. X!         return;
  1303. X!     }
  1304. X  
  1305. X+     if(eshkp->robbed) {  /* shkp is not angry? */
  1306. X+         if(isgold) offer = obj->quan;
  1307. X+         else if(cgold) offer += cgold;
  1308. X+         if((eshkp->robbed -= offer < 0L))
  1309. X+             eshkp->robbed = 0L;
  1310. X+         if(offer) verbalize(
  1311. X+   "Thank you for your contribution to restock this recently plundered shop.");
  1312. X+         subfrombill(obj, shkp);
  1313. X+         return;
  1314. X+     }
  1315. X+ 
  1316. X+     if(isgold || cgold) {
  1317. X          if(!cgold) gltmp = obj->quan;
  1318. X  
  1319. X          if(eshkp->debit >= gltmp) {
  1320. X***************
  1321. X*** 1997,2020 ****
  1322. X          }
  1323. X          if(offer) goto move_on;
  1324. X          else {
  1325. X!             if(container && obj->cobj != (struct obj *)0) {
  1326. X!             dropped_container(obj);
  1327. X              }
  1328. X-             subfrombill(obj, shkp);
  1329. X-             obj->no_charge = 1;
  1330. X              return;
  1331. X          }
  1332. X      }
  1333. X  move_on:
  1334. X-     if (ANGRY(shkp)) { /* they become shop-objects, no pay */
  1335. X-         pline("Thank you, scum!");
  1336. X-         subfrombill(obj, shkp);
  1337. X-         return;
  1338. X-     }
  1339. X- 
  1340. X      if((!saleitem && !(container && cltmp > 0L))
  1341. X         || eshkp->billct == BILLSZ
  1342. X!        || obj->oclass == BALL_CLASS || offer == 0L
  1343. X         || (obj->oclass == FOOD_CLASS && obj->oeaten)
  1344. X         || (Is_candle(obj) &&
  1345. X             obj->age < 20L * (long)objects[obj->otyp].oc_cost)) {
  1346. X--- 2036,2057 ----
  1347. X          }
  1348. X          if(offer) goto move_on;
  1349. X          else {
  1350. X!             if(!isgold) {
  1351. X!                 if(container && obj->cobj != (struct obj *)0) {
  1352. X!                 dropped_container(obj, shkp, FALSE);
  1353. X!                 }
  1354. X!                 if(!obj->unpaid && !saleitem)
  1355. X!                 obj->no_charge = 1;
  1356. X!                 subfrombill(obj, shkp);
  1357. X              }
  1358. X              return;
  1359. X          }
  1360. X      }
  1361. X  move_on:
  1362. X      if((!saleitem && !(container && cltmp > 0L))
  1363. X         || eshkp->billct == BILLSZ
  1364. X!        || obj->oclass == BALL_CLASS
  1365. X!        || obj->oclass == CHAIN_CLASS || offer == 0L
  1366. X         || (obj->oclass == FOOD_CLASS && obj->oeaten)
  1367. X         || (Is_candle(obj) &&
  1368. X             obj->age < 20L * (long)objects[obj->otyp].oc_cost)) {
  1369. X***************
  1370. X*** 2021,2041 ****
  1371. X          pline("%s seems not interested%s.", Monnam(shkp),
  1372. X                         cgold ? " in the rest" : "");
  1373. X          if(container && obj->cobj != (struct obj *)0) {
  1374. X!             dropped_container(obj);
  1375. X          }
  1376. X          obj->no_charge = 1;
  1377. X          return;
  1378. X      }
  1379. X  
  1380. X-     if(eshkp->robbed) {  /* shkp is not angry? */
  1381. X-         if((eshkp->robbed -= offer < 0L))
  1382. X-             eshkp->robbed = 0L;
  1383. X-         verbalize(
  1384. X-   "Thank you for your contribution to restock this recently plundered shop.");
  1385. X-         subfrombill(obj, shkp);
  1386. X-         return;
  1387. X-     }
  1388. X- 
  1389. X      if(!shkp->mgold) {
  1390. X          long tmpcr = (ltmp + cltmp) * 2L;
  1391. X  
  1392. X--- 2058,2069 ----
  1393. X          pline("%s seems not interested%s.", Monnam(shkp),
  1394. X                         cgold ? " in the rest" : "");
  1395. X          if(container && obj->cobj != (struct obj *)0) {
  1396. X!             dropped_container(obj, shkp, FALSE);
  1397. X          }
  1398. X          obj->no_charge = 1;
  1399. X          return;
  1400. X      }
  1401. X  
  1402. X      if(!shkp->mgold) {
  1403. X          long tmpcr = (ltmp + cltmp) * 2L;
  1404. X  
  1405. X***************
  1406. X*** 2050,2059 ****
  1407. X              subfrombill(obj, shkp);
  1408. X          } else {
  1409. X              if(container && obj->cobj != (struct obj *)0) {
  1410. X!                 dropped_container(obj);
  1411. X              }
  1412. X              subfrombill(obj, shkp);
  1413. X-             obj->no_charge = 1;
  1414. X          }
  1415. X      } else {
  1416. X          int qlen;
  1417. X--- 2078,2088 ----
  1418. X              subfrombill(obj, shkp);
  1419. X          } else {
  1420. X              if(container && obj->cobj != (struct obj *)0) {
  1421. X!                 dropped_container(obj, shkp, FALSE);
  1422. X              }
  1423. X+             if(!obj->unpaid)
  1424. X+             obj->no_charge = 1;
  1425. X              subfrombill(obj, shkp);
  1426. X          }
  1427. X      } else {
  1428. X          int qlen;
  1429. X***************
  1430. X*** 2085,2097 ****
  1431. X          switch (sell_response ? sell_response : ynaq(qbuf)) {
  1432. X           case 'q':  sell_response = 'n';
  1433. X           case 'n':  if(container && obj->cobj != (struct obj *)0) {
  1434. X!                 dropped_container(obj);
  1435. X                  }
  1436. X                  subfrombill(obj, shkp);
  1437. X-                 obj->no_charge = 1;
  1438. X                  break;
  1439. X           case 'a':  sell_response = 'y';
  1440. X!          case 'y':  subfrombill(obj, shkp);
  1441. X                  pay(-offer, shkp);
  1442. X                  You("sold %s for %ld gold piece%s.", doname(obj),
  1443. X                  offer, plur(offer));
  1444. X--- 2114,2130 ----
  1445. X          switch (sell_response ? sell_response : ynaq(qbuf)) {
  1446. X           case 'q':  sell_response = 'n';
  1447. X           case 'n':  if(container && obj->cobj != (struct obj *)0) {
  1448. X!                 dropped_container(obj, shkp, FALSE);
  1449. X                  }
  1450. X+                     if(!obj->unpaid) obj->no_charge = 1;
  1451. X                  subfrombill(obj, shkp);
  1452. X                  break;
  1453. X           case 'a':  sell_response = 'y';
  1454. X!          case 'y':  if(container && obj->cobj != (struct obj *)0)
  1455. X!                         dropped_container(obj, shkp, TRUE);
  1456. X!                     if(!obj->unpaid && !saleitem)
  1457. X!                     obj->no_charge = 1;
  1458. X!                     subfrombill(obj, shkp);
  1459. X                  pay(-offer, shkp);
  1460. X                  You("sold %s for %ld gold piece%s.", doname(obj),
  1461. X                  offer, plur(offer));
  1462. X***************
  1463. X*** 2193,2201 ****
  1464. X      case WEAPON_CLASS:
  1465. X          if (obj->spe > 0) tmp += 10L * (long) obj->spe;
  1466. X          break;
  1467. X-     case CHAIN_CLASS:
  1468. X-         pline("Strange... carrying a chain?");
  1469. X-         break;
  1470. X      case TOOL_CLASS:
  1471. X          if (Is_candle(obj) &&
  1472. X              obj->age < 20L * (long)objects[obj->otyp].oc_cost)
  1473. X--- 2226,2231 ----
  1474. X***************
  1475. X*** 2630,2636 ****
  1476. X  makekops(mm)        /* returns the number of (all types of) Kops  made */
  1477. X  coord *mm;
  1478. X  {
  1479. X!     register int cnt = depth(&u.uz) + rnd(5);
  1480. X      register int scnt = (cnt / 3) + 1;    /* at least one sarge */
  1481. X      register int lcnt = (cnt / 6);        /* maybe a lieutenant */
  1482. X      register int kcnt = (cnt / 9);        /* and maybe a kaptain */
  1483. X--- 2660,2666 ----
  1484. X  makekops(mm)        /* returns the number of (all types of) Kops  made */
  1485. X  coord *mm;
  1486. X  {
  1487. X!     register int cnt = abs(depth(&u.uz)) + rnd(5);
  1488. X      register int scnt = (cnt / 3) + 1;    /* at least one sarge */
  1489. X      register int lcnt = (cnt / 6);        /* maybe a lieutenant */
  1490. X      register int kcnt = (cnt / 9);        /* and maybe a kaptain */
  1491. X***************
  1492. X*** 2864,2870 ****
  1493. X      if (otmp->otyp == GOLD_PIECE) {
  1494. X       /* if (otmp == first_obj)  first_obj = otmp->nexthere; */
  1495. X          continue;    /* don't quote a price on this */
  1496. X!     } else if (otmp->no_charge) {
  1497. X          Strcpy(price, "no charge");
  1498. X      } else {
  1499. X          cost = get_cost(otmp, (struct monst *)0);
  1500. X--- 2894,2900 ----
  1501. X      if (otmp->otyp == GOLD_PIECE) {
  1502. X       /* if (otmp == first_obj)  first_obj = otmp->nexthere; */
  1503. X          continue;    /* don't quote a price on this */
  1504. X!     } else if (otmp->no_charge || otmp == uball || otmp == uchain) {
  1505. X          Strcpy(price, "no charge");
  1506. X      } else {
  1507. X          cost = get_cost(otmp, (struct monst *)0);
  1508. X***************
  1509. X*** 2877,2886 ****
  1510. X      if (cnt > 1) {
  1511. X      display_nhwindow(tmpwin, TRUE);
  1512. X      } else if (cnt == 1) {
  1513. X!     cost = get_cost(first_obj, (struct monst *)0);
  1514. X!     pline("%s, price %ld zorkmid%s%s%s", doname(first_obj),
  1515. X          cost, plur(cost), first_obj->quan > 1L ? " each" : "",
  1516. X          shk_embellish(first_obj, cost));
  1517. X      }
  1518. X      destroy_nhwindow(tmpwin);
  1519. X  }
  1520. X--- 2907,2921 ----
  1521. X      if (cnt > 1) {
  1522. X      display_nhwindow(tmpwin, TRUE);
  1523. X      } else if (cnt == 1) {
  1524. X!     if (first_obj->no_charge || first_obj == uball || first_obj == uchain){
  1525. X!         pline("%s!", buf);    /* buf still contains the string */
  1526. X!     } else {
  1527. X!         /* print cost in slightly different format, so can't reuse buf */
  1528. X!         cost = get_cost(first_obj, (struct monst *)0);
  1529. X!         pline("%s, price %ld zorkmid%s%s%s", doname(first_obj),
  1530. X          cost, plur(cost), first_obj->quan > 1L ? " each" : "",
  1531. X          shk_embellish(first_obj, cost));
  1532. X+     }
  1533. X      }
  1534. X      destroy_nhwindow(tmpwin);
  1535. X  }
  1536. X***************
  1537. X*** 2972,2978 ****
  1538. X              if (otmp->spe > 1) tmp /= 4L;
  1539. X      } else if (otmp->oclass == SPBOOK_CLASS) {
  1540. X              tmp -= tmp / 5L;
  1541. X!     }
  1542. X      return(tmp);
  1543. X  }
  1544. X  
  1545. X--- 3007,3014 ----
  1546. X              if (otmp->spe > 1) tmp /= 4L;
  1547. X      } else if (otmp->oclass == SPBOOK_CLASS) {
  1548. X              tmp -= tmp / 5L;
  1549. X!     } else if (otmp->otyp == CAN_OF_GREASE)
  1550. X!                 tmp /= 10L;
  1551. X      return(tmp);
  1552. X  }
  1553. X  
  1554. X*** /tmp/da08590    Thu Feb 25 10:25:16 1993
  1555. X--- src/shknam.c    Thu Feb 18 10:58:37 1993
  1556. X***************
  1557. X*** 1,4 ****
  1558. X! /*    SCCS Id: @(#)shknam.c    3.1    92/11/14    */
  1559. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1560. X  /* NetHack may be freely redistributed.  See license for details. */
  1561. X  
  1562. X--- 1,4 ----
  1563. X! /*    SCCS Id: @(#)shknam.c    3.1    93/02/17    */
  1564. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1565. X  /* NetHack may be freely redistributed.  See license for details. */
  1566. X  
  1567. X***************
  1568. X*** 163,169 ****
  1569. X      {"used armor dealership", ARMOR_CLASS, 14,
  1570. X          D_SHOP, {{90, ARMOR_CLASS}, {10, WEAPON_CLASS}, {0, 0}},
  1571. X           shkarmors},
  1572. X!     {"second hand bookstore", SCROLL_CLASS, 10, D_SHOP,
  1573. X          {{90, SCROLL_CLASS}, {10, SPBOOK_CLASS}, {0, 0}}, shkbooks},
  1574. X      {"liquor emporium", POTION_CLASS, 10, D_SHOP,
  1575. X          {{100, POTION_CLASS}, {0, 0}, {0, 0}}, shkliquors},
  1576. X--- 163,169 ----
  1577. X      {"used armor dealership", ARMOR_CLASS, 14,
  1578. X          D_SHOP, {{90, ARMOR_CLASS}, {10, WEAPON_CLASS}, {0, 0}},
  1579. X           shkarmors},
  1580. X!     {"second-hand bookstore", SCROLL_CLASS, 10, D_SHOP,
  1581. X          {{90, SCROLL_CLASS}, {10, SPBOOK_CLASS}, {0, 0}}, shkbooks},
  1582. X      {"liquor emporium", POTION_CLASS, 10, D_SHOP,
  1583. X          {{100, POTION_CLASS}, {0, 0}, {0, 0}}, shkliquors},
  1584. X*** /tmp/da08598    Thu Feb 25 10:25:18 1993
  1585. X--- src/sit.c    Fri Feb 19 11:00:57 1993
  1586. X***************
  1587. X*** 20,56 ****
  1588. X  int
  1589. X  dosit()
  1590. X  {
  1591. X!     char pbuf[BUFSZ];
  1592. X      register struct trap *trap;
  1593. X      register int typ = levl[u.ux][u.uy].typ;
  1594. X  
  1595. X      if(Levitation)  {
  1596. X!         pline("There's nothing to sit on up here.");
  1597. X          return 0;
  1598. X      } 
  1599. X  
  1600. X-     Strcpy(pbuf, "You sit on the %s.");
  1601. X- 
  1602. X      if(OBJ_AT(u.ux, u.uy)) { 
  1603. X          register struct obj *obj;
  1604. X  
  1605. X          obj = level.objects[u.ux][u.uy];
  1606. X          You("sit on %s.", the(xname(obj)));
  1607. X!         if(!Is_box(obj)) pline("It is not very comfortable...");
  1608. X  
  1609. X      } else if(trap = t_at(u.ux, u.uy)) {
  1610. X  
  1611. X!         if(u.utrap) {
  1612. X!             if(u.utraptype == TT_BEARTRAP) {
  1613. X!             You("can't sit down!");
  1614. X              u.utrap++;
  1615. X              } else if(u.utraptype == TT_PIT) {
  1616. X!             You("sit in the bottom of the pit.");
  1617. X!             if(trap->ttyp == SPIKED_PIT) pline("This hurts!");
  1618. X              u.utrap += rn2(5);
  1619. X          } else if(u.utraptype == TT_WEB) {
  1620. X!             pline(pbuf, "giant spider's web");
  1621. X!             You("are further entangled!");
  1622. X              u.utrap += rn1(10, 5);
  1623. X          } else if(u.utraptype == TT_LAVA) {
  1624. X              /* Must have fire resistance or they'd be dead already */
  1625. X--- 20,58 ----
  1626. X  int
  1627. X  dosit()
  1628. X  {
  1629. X!     static const char *sit_message = "sit on the %s.";
  1630. X      register struct trap *trap;
  1631. X      register int typ = levl[u.ux][u.uy].typ;
  1632. X  
  1633. X      if(Levitation)  {
  1634. X!         pline("You're sitting on air.");
  1635. X          return 0;
  1636. X      } 
  1637. X  
  1638. X      if(OBJ_AT(u.ux, u.uy)) { 
  1639. X          register struct obj *obj;
  1640. X  
  1641. X          obj = level.objects[u.ux][u.uy];
  1642. X          You("sit on %s.", the(xname(obj)));
  1643. X!         if(!Is_box(obj)) pline("It's not very comfortable...");
  1644. X  
  1645. X      } else if(trap = t_at(u.ux, u.uy)) {
  1646. X  
  1647. X!         if (u.utrap) {
  1648. X!         exercise(A_WIS, FALSE);    /* you're getting stuck longer */
  1649. X!         if(u.utraptype == TT_BEARTRAP) {
  1650. X!             You("can't sit down with your %s in the bear trap.", body_part(FOOT));
  1651. X              u.utrap++;
  1652. X              } else if(u.utraptype == TT_PIT) {
  1653. X!             if(trap->ttyp == SPIKED_PIT) {
  1654. X!             You("sit down on a spike.  Ouch!");
  1655. X!             losehp(1, "sitting on an iron spike", KILLED_BY);
  1656. X!             exercise(A_STR, FALSE);
  1657. X!             } else
  1658. X!             You("sit down in the pit.");
  1659. X              u.utrap += rn2(5);
  1660. X          } else if(u.utraptype == TT_WEB) {
  1661. X!             You("sit in the spider web and get entangled further!");
  1662. X              u.utrap += rn1(10, 5);
  1663. X          } else if(u.utraptype == TT_LAVA) {
  1664. X              /* Must have fire resistance or they'd be dead already */
  1665. X***************
  1666. X*** 67,73 ****
  1667. X          }
  1668. X      } else if(Underwater || Is_waterlevel(&u.uz)) {
  1669. X          if (Is_waterlevel(&u.uz))
  1670. X!         pline("There are no seats floating in the neighborhood.");
  1671. X          else
  1672. X          You("sit down in the muddy bottom.");
  1673. X      } else if(is_pool(u.ux, u.uy)) {
  1674. X--- 69,75 ----
  1675. X          }
  1676. X      } else if(Underwater || Is_waterlevel(&u.uz)) {
  1677. X          if (Is_waterlevel(&u.uz))
  1678. X!         pline("There are no cushions floating nearby.");
  1679. X          else
  1680. X          You("sit down in the muddy bottom.");
  1681. X      } else if(is_pool(u.ux, u.uy)) {
  1682. X***************
  1683. X*** 84,125 ****
  1684. X  #ifdef SINKS
  1685. X      } else if(IS_SINK(typ)) {
  1686. X  
  1687. X!         pline(pbuf, defsyms[S_sink].explanation);
  1688. X          Your("%s gets wet.", humanoid(uasmon) ? "rump" : "underside");
  1689. X  #endif
  1690. X      } else if(IS_ALTAR(typ)) {
  1691. X  
  1692. X!         pline(pbuf, defsyms[S_altar].explanation);
  1693. X          altar_wrath(u.ux, u.uy);
  1694. X  
  1695. X      } else if(typ == STAIRS) {
  1696. X  
  1697. X!         pline(pbuf, "stairs");
  1698. X  
  1699. X      } else if(typ == LADDER) {
  1700. X  
  1701. X!         pline(pbuf, "ladder");
  1702. X  
  1703. X      } else if (is_lava(u.ux, u.uy)) {
  1704. X  
  1705. X          /* must be WWalking */
  1706. X!         pline(pbuf, "lava");
  1707. X!         pline("It burns you!");
  1708. X          losehp(d((Fire_resistance ? 2 : 10), 10),
  1709. X             "sitting on lava", KILLED_BY);
  1710. X  
  1711. X      } else if (is_ice(u.ux, u.uy)) {
  1712. X  
  1713. X!         pline(pbuf, defsyms[S_ice].explanation);
  1714. X!         if (!Cold_resistance) pline("It's very cold...");
  1715. X  
  1716. X      } else if (typ == DRAWBRIDGE_DOWN) {
  1717. X  
  1718. X!         pline(pbuf, "drawbridge");
  1719. X  
  1720. X      } else if(IS_THRONE(typ)) {
  1721. X  
  1722. X!         pline(pbuf, defsyms[S_throne].explanation);
  1723. X          if (rnd(6) > 4)  {
  1724. X          switch (rnd(13))  {
  1725. X              case 1:
  1726. X--- 86,127 ----
  1727. X  #ifdef SINKS
  1728. X      } else if(IS_SINK(typ)) {
  1729. X  
  1730. X!         You(sit_message, defsyms[S_sink].explanation);
  1731. X          Your("%s gets wet.", humanoid(uasmon) ? "rump" : "underside");
  1732. X  #endif
  1733. X      } else if(IS_ALTAR(typ)) {
  1734. X  
  1735. X!         You(sit_message, defsyms[S_altar].explanation);
  1736. X          altar_wrath(u.ux, u.uy);
  1737. X  
  1738. X      } else if(typ == STAIRS) {
  1739. X  
  1740. X!         You(sit_message, "stairs");
  1741. X  
  1742. X      } else if(typ == LADDER) {
  1743. X  
  1744. X!         You(sit_message, "ladder");
  1745. X  
  1746. X      } else if (is_lava(u.ux, u.uy)) {
  1747. X  
  1748. X          /* must be WWalking */
  1749. X!         You(sit_message, "lava");
  1750. X!         pline("The lava burns you!");
  1751. X          losehp(d((Fire_resistance ? 2 : 10), 10),
  1752. X             "sitting on lava", KILLED_BY);
  1753. X  
  1754. X      } else if (is_ice(u.ux, u.uy)) {
  1755. X  
  1756. X!         You(sit_message, defsyms[S_ice].explanation);
  1757. X!         if (!Cold_resistance) pline("The ice feels cold.");
  1758. X  
  1759. X      } else if (typ == DRAWBRIDGE_DOWN) {
  1760. X  
  1761. X!         You(sit_message, "drawbridge");
  1762. X  
  1763. X      } else if(IS_THRONE(typ)) {
  1764. X  
  1765. X!         You(sit_message, defsyms[S_throne].explanation);
  1766. X          if (rnd(6) > 4)  {
  1767. X          switch (rnd(13))  {
  1768. X              case 1:
  1769. X***************
  1770. X*** 130,140 ****
  1771. X              (void) adjattrib(rn2(A_MAX), 1, FALSE);
  1772. X              break;
  1773. X              case 3:
  1774. X!         pline("A%s charge of electricity shoots through your body!",
  1775. X                    (Shock_resistance) ? "" : " massive");
  1776. X!             if(Shock_resistance)
  1777. X!                 losehp(rnd(6), "electric chair", KILLED_BY_AN);
  1778. X!             else    losehp(rnd(30), "electric chair", KILLED_BY_AN);
  1779. X              exercise(A_CON, FALSE);
  1780. X              break;
  1781. X              case 4:
  1782. X--- 132,141 ----
  1783. X              (void) adjattrib(rn2(A_MAX), 1, FALSE);
  1784. X              break;
  1785. X              case 3:
  1786. X!             pline("A%s electric shock shoots through your body!",
  1787. X                    (Shock_resistance) ? "" : " massive");
  1788. X!             losehp(Shock_resistance ? rnd(6) : rnd(30),
  1789. X!                    "electric chair", KILLED_BY_AN);
  1790. X              exercise(A_CON, FALSE);
  1791. X              break;
  1792. X              case 4:
  1793. X***************
  1794. X*** 159,165 ****
  1795. X              {
  1796. X              register int cnt = rnd(10);
  1797. X  
  1798. X!             You("hear a voice echo:");
  1799. X              verbalize("Thy audience hath been summoned, %s!",
  1800. X                    flags.female ? "Dame" : "Sire");
  1801. X              while(cnt--)
  1802. X--- 160,166 ----
  1803. X              {
  1804. X              register int cnt = rnd(10);
  1805. X  
  1806. X!             pline("A voice echoes:");
  1807. X              verbalize("Thy audience hath been summoned, %s!",
  1808. X                    flags.female ? "Dame" : "Sire");
  1809. X              while(cnt--)
  1810. X***************
  1811. X*** 167,179 ****
  1812. X              break;
  1813. X              }
  1814. X              case 8:
  1815. X!             You("hear a voice echo:");
  1816. X              verbalize("By thy Imperious order, %s...",
  1817. X                    flags.female ? "Dame" : "Sire");
  1818. X              do_genocide(1);
  1819. X              break;
  1820. X              case 9:
  1821. X!             You("hear a voice echo:");
  1822. X      verbalize("A curse upon thee for sitting upon this most holy throne!");
  1823. X              if (Luck > 0)  {
  1824. X                  make_blinded(Blinded + rn1(100,250),TRUE);
  1825. X--- 168,180 ----
  1826. X              break;
  1827. X              }
  1828. X              case 8:
  1829. X!             pline("A voice echoes:");
  1830. X              verbalize("By thy Imperious order, %s...",
  1831. X                    flags.female ? "Dame" : "Sire");
  1832. X              do_genocide(1);
  1833. X              break;
  1834. X              case 9:
  1835. X!             pline("A voice echoes:");
  1836. X      verbalize("A curse upon thee for sitting upon this most holy throne!");
  1837. X              if (Luck > 0)  {
  1838. X                  make_blinded(Blinded + rn1(100,250),TRUE);
  1839. X***************
  1840. X*** 191,197 ****
  1841. X                      do_mapping();
  1842. X                  }
  1843. X              } else  {
  1844. X!                 Your("vision clarifies.");
  1845. X                  HSee_invisible |= FROMOUTSIDE;
  1846. X                  newsym(u.ux, u.uy);
  1847. X              }
  1848. X--- 192,198 ----
  1849. X                      do_mapping();
  1850. X                  }
  1851. X              } else  {
  1852. X!                 Your("vision becomes clear.");
  1853. X                  HSee_invisible |= FROMOUTSIDE;
  1854. X                  newsym(u.ux, u.uy);
  1855. X              }
  1856. X***************
  1857. X*** 207,213 ****
  1858. X              }
  1859. X              break;
  1860. X              case 12:
  1861. X!             You("are granted a gift of insight!");
  1862. X              if (invent) {
  1863. X                  int ret, cval = rn2(5); /* agrees w/seffects() */
  1864. X                  do {
  1865. X--- 208,214 ----
  1866. X              }
  1867. X              break;
  1868. X              case 12:
  1869. X!             You("are granted an insight!");
  1870. X              if (invent) {
  1871. X                  int ret, cval = rn2(5); /* agrees w/seffects() */
  1872. X                  do {
  1873. X***************
  1874. X*** 241,247 ****
  1875. X          }
  1876. X  
  1877. X          if (u.uhunger < (int)objects[EGG].oc_nutrition) {
  1878. X!             You("are too weak to lay an egg.");
  1879. X              return 0;
  1880. X          }
  1881. X  
  1882. X--- 242,248 ----
  1883. X          }
  1884. X  
  1885. X          if (u.uhunger < (int)objects[EGG].oc_nutrition) {
  1886. X!             You("don't have enough energy to lay an egg.");
  1887. X              return 0;
  1888. X          }
  1889. X  
  1890. X*** /tmp/da08622    Thu Feb 25 10:25:27 1993
  1891. X--- src/spell.c    Fri Feb 12 10:26:53 1993
  1892. X***************
  1893. X*** 4,11 ****
  1894. X  
  1895. X  #include "hack.h"
  1896. X  
  1897. X! static schar NEARDATA delay;        /* moves left for this spell */
  1898. X! static struct obj NEARDATA *book;    /* last/current book being xscribed */
  1899. X  
  1900. X  #define spelluses(spell)    spl_book[spell-1].sp_uses
  1901. X  #define decrnuses(spell)    spl_book[spell-1].sp_uses--
  1902. X--- 4,11 ----
  1903. X  
  1904. X  #include "hack.h"
  1905. X  
  1906. X! static NEARDATA schar delay;        /* moves left for this spell */
  1907. X! static NEARDATA struct obj *book;    /* last/current book being xscribed */
  1908. X  
  1909. X  #define spelluses(spell)    spl_book[spell-1].sp_uses
  1910. X  #define decrnuses(spell)    spl_book[spell-1].sp_uses--
  1911. X***************
  1912. X*** 92,97 ****
  1913. X--- 92,99 ----
  1914. X  deadbook(book2)
  1915. X  struct obj *book2;
  1916. X  {
  1917. X+     You("turn the pages of the Book of the Dead....");
  1918. X+     makeknown(SPE_BOOK_OF_THE_DEAD);
  1919. X      if(invocation_pos(u.ux, u.uy) && !On_stairs(u.ux, u.uy)) {
  1920. X      register struct obj *otmp;
  1921. X      register boolean arti1_primed = FALSE, arti2_primed = FALSE,
  1922. X*** /tmp/da08630    Thu Feb 25 10:25:30 1993
  1923. X--- src/steal.c    Thu Feb 11 11:29:21 1993
  1924. X***************
  1925. X*** 242,248 ****
  1926. X      (void) snuff_candle(otmp);
  1927. X      mpickobj(mtmp,otmp);
  1928. X      if (otmp->otyp == CORPSE && otmp->corpsenm == PM_COCKATRICE
  1929. X!         && !resists_ston(mtmp->data)) {
  1930. X          pline("%s turns to stone.", Monnam(mtmp));
  1931. X          stoned = TRUE;
  1932. X          xkilled(mtmp, 0);
  1933. X--- 242,252 ----
  1934. X      (void) snuff_candle(otmp);
  1935. X      mpickobj(mtmp,otmp);
  1936. X      if (otmp->otyp == CORPSE && otmp->corpsenm == PM_COCKATRICE
  1937. X!         && !resists_ston(mtmp->data)
  1938. X! #ifdef MUSE
  1939. X!         && !(mtmp->misc_worn_check & W_ARMG)
  1940. X! #endif
  1941. X!         ) {
  1942. X          pline("%s turns to stone.", Monnam(mtmp));
  1943. X          stoned = TRUE;
  1944. X          xkilled(mtmp, 0);
  1945. X***************
  1946. X*** 271,281 ****
  1947. X  register struct monst *mtmp;
  1948. X  {
  1949. X      register struct obj *otmp;
  1950. X  
  1951. X      for(otmp = invent; otmp; otmp = otmp->nobj) {
  1952. X!         if(otmp->otyp == AMULET_OF_YENDOR ||
  1953. X!            (otmp->otyp == FAKE_AMULET_OF_YENDOR && !mtmp->iswiz)) {
  1954. X          /* might be an imitation one */
  1955. X          setnotworn(otmp);
  1956. X          freeinv(otmp);
  1957. X          mpickobj(mtmp,otmp);
  1958. X--- 275,307 ----
  1959. X  register struct monst *mtmp;
  1960. X  {
  1961. X      register struct obj *otmp;
  1962. X+     register int    real, fake;
  1963. X  
  1964. X+     /* select the artifact to steal */
  1965. X+         if(u.uhave.amulet) {
  1966. X+         real = AMULET_OF_YENDOR ;
  1967. X+         fake = FAKE_AMULET_OF_YENDOR ;
  1968. X+ #ifdef MULDGN
  1969. X+     } else if(u.uhave.questart) {
  1970. X+         for(otmp = invent; otmp; otmp = otmp->nobj)
  1971. X+             if(is_quest_artifact(otmp)) goto snatch_it;
  1972. X+ #endif
  1973. X+     } else if(u.uhave.bell) {
  1974. X+         real = BELL_OF_OPENING;
  1975. X+         fake = BELL;
  1976. X+     } else if(u.uhave.book) {
  1977. X+         real = SPE_BOOK_OF_THE_DEAD;
  1978. X+         fake = 0;
  1979. X+     } else if(u.uhave.menorah) {
  1980. X+         real = CANDELABRUM_OF_INVOCATION;
  1981. X+         fake = 0;
  1982. X+     } else return;    /* you have nothing of special interest */
  1983. X+ 
  1984. X+ /*    If we get here, real and fake have been set up. */
  1985. X      for(otmp = invent; otmp; otmp = otmp->nobj) {
  1986. X!         if(otmp->otyp == real || (otmp->otyp == fake && !mtmp->iswiz)) {
  1987. X          /* might be an imitation one */
  1988. X+ snatch_it:
  1989. X          setnotworn(otmp);
  1990. X          freeinv(otmp);
  1991. X          mpickobj(mtmp,otmp);
  1992. X
  1993. END_OF_FILE
  1994. if test 54919 -ne `wc -c <'patches01h'`; then
  1995.     echo shar: \"'patches01h'\" unpacked with wrong size!
  1996. fi
  1997. # end of 'patches01h'
  1998. if test -f 'sys/share/sounds/README' -a "${1}" != "-c" ; then 
  1999.   echo shar: Renaming existing file \"'sys/share/sounds/README'\" to \"'sys/share/sounds/README.orig'\"
  2000.   mv -f 'sys/share/sounds/README' 'sys/share/sounds/README.orig'
  2001. fi
  2002. echo shar: Extracting \"'sys/share/sounds/README'\" \(1408 characters\)
  2003. sed "s/^X//" >'sys/share/sounds/README' <<'END_OF_FILE'
  2004. XREADME for the AIFF files:
  2005. X
  2006. XThese files are sound files for the instruments in NetHack.
  2007. XThere are 12 sounds, one for each distinct instrument.
  2008. XThe sounds are in 8-bit 22kHz AIFF format, which should be
  2009. Xreadable by a broad range of platforms. Since the sounds
  2010. Xcame from Rolands S-750 sample library (most of them) there
  2011. Xshould be no copyright on them when we treat them like we
  2012. Xdo here (as instruments) - indeed, the sample library I
  2013. Xgot from Roland didn't even bear a (c) symbol.
  2014. X
  2015. XSome of the sounds are very adequate (Drum of Earthquake,
  2016. XWooden Flute, Magic Harp) while some are less true to the
  2017. Xoriginal name (how does a Frost Horn sound?) Actually, I
  2018. Xdon't know what a Bugle is (Bugle horn?) so I took a trumpet
  2019. Xsound for that. Correct me if I'm wrong.
  2020. X
  2021. XWhat does this have to do with the main code? Well, nothing
  2022. Xso far. There are some places that are #ifdef MAC and calls
  2023. Xmac_speaker; that function takes an object and a tune (in
  2024. Xcapital letters A-G) and plays the tune with the given
  2025. Xinstrument. When playing a specific tune, that tune is of
  2026. Xcourse used. For "improvise," I use middle "C."
  2027. X
  2028. XIdeally, we should do something equal with sound that we
  2029. Xhave with displays, so we can use one common set of calls
  2030. Xin the main code, and have ports do whatever seems appropriate
  2031. Xfor the available hardware.
  2032. X
  2033. XAny comment on the sounds or their use is welcome:
  2034. X
  2035. X                        h+@nada.kth.se
  2036. X                        Jon W{tte
  2037. X                        Mac Team
  2038. END_OF_FILE
  2039. if test 1408 -ne `wc -c <'sys/share/sounds/README'`; then
  2040.     echo shar: \"'sys/share/sounds/README'\" unpacked with wrong size!
  2041. fi
  2042. # end of 'sys/share/sounds/README'
  2043. echo shar: End of archive 7 \(of 31\).
  2044. cp /dev/null ark7isdone
  2045. MISSING=""
  2046. 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
  2047.     if test ! -f ark${I}isdone ; then
  2048.     MISSING="${MISSING} ${I}"
  2049.     fi
  2050. done
  2051. if test "${MISSING}" = "" ; then
  2052.     echo You have unpacked all 31 archives.
  2053.     echo "Now execute 'patchit.sh'"
  2054.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2055. else
  2056.     echo You still need to unpack the following archives:
  2057.     echo "        " ${MISSING}
  2058. fi
  2059. ##  End of shell archive.
  2060. exit 0
  2061.