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

  1. Path: uunet!news.tek.com!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v17i086:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Patch2k/33
  5. Date: 11 Jun 1993 00:10:11 GMT
  6. Organization: Tektronix, Inc, Redmond, OR, USA
  7. Lines: 2079
  8. Approved: billr@saab.CNA.TEK.COM
  9. Message-ID: <1v8ih3$j0s@ying.cna.tek.com>
  10. NNTP-Posting-Host: saab.cna.tek.com
  11. Xref: uunet comp.sources.games:1774
  12.  
  13. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  14. Posting-number: Volume 17, Issue 86
  15. Archive-name: nethack31/Patch2k
  16. Patch-To: nethack31: Volume 16, Issue 1-116
  17. Environment: Amiga, Atari, Mac, MS-DOS, Windows-NT, OS2, Unix, VMS, X11
  18.  
  19.  
  20.  
  21. #! /bin/sh
  22. # This is a shell archive.  Remove anything before this line, then unpack
  23. # it by saving it into a file and typing "sh file".  To overwrite existing
  24. # files, type "sh file -c".  You can also feed this as standard input via
  25. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  26. # will see the following message at the end:
  27. #        "End of archive 11 (of 33)."
  28. # Contents:  patches02h
  29. # Wrapped by billr@saab on Thu Jun 10 16:55:02 1993
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'patches02h' -a "${1}" != "-c" ; then 
  32.   echo shar: Renaming existing file \"'patches02h'\" to \"'patches02h.orig'\"
  33.   mv -f 'patches02h' 'patches02h.orig'
  34. fi
  35. echo shar: Extracting \"'patches02h'\" \(55125 characters\)
  36. sed "s/^X//" >'patches02h' <<'END_OF_FILE'
  37. X*** /tmp/da11330    Tue Jun  1 16:15:37 1993
  38. X--- src/rip.c    Tue Apr 27 17:00:24 1993
  39. X***************
  40. X*** 1,4 ****
  41. X! /*    SCCS Id: @(#)rip.c    3.1    91/08/05
  42. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  43. X  /* NetHack may be freely redistributed.  See license for details. */
  44. X  
  45. X--- 1,4 ----
  46. X! /*    SCCS Id: @(#)rip.c    3.1    93/04/26    */
  47. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  48. X  /* NetHack may be freely redistributed.  See license for details. */
  49. X  
  50. X***************
  51. X*** 8,13 ****
  52. X--- 8,15 ----
  53. X  
  54. X  extern const char *killed_by_prefix[];
  55. X  
  56. X+ #if defined(TTY_GRAPHICS) || defined(X11_GRAPHICS) || defined(mac)
  57. X+ 
  58. X  static const char *rip_txt[] = {
  59. X  "                       ----------",
  60. X  "                      /          \\",
  61. X***************
  62. X*** 49,58 ****
  63. X      while(*ip) *op++ = *ip++;
  64. X  }
  65. X  
  66. X  void
  67. X! outrip(how, tmpwin)
  68. X! int how;
  69. X  winid tmpwin;
  70. X  {
  71. X      register char **dp;
  72. X      register char *dpx;
  73. X--- 51,61 ----
  74. X      while(*ip) *op++ = *ip++;
  75. X  }
  76. X  
  77. X+ 
  78. X  void
  79. X! genl_outrip(tmpwin, how)
  80. X  winid tmpwin;
  81. X+ int how;
  82. X  {
  83. X      register char **dp;
  84. X      register char *dpx;
  85. X***************
  86. X*** 126,130 ****
  87. X--- 129,135 ----
  88. X      putstr(tmpwin, 0, "");
  89. X      putstr(tmpwin, 0, "");
  90. X  }
  91. X+ 
  92. X+ #endif
  93. X  
  94. X  /*rip.c*/
  95. X*** /tmp/da11354    Tue Jun  1 16:15:42 1993
  96. X--- src/save.c    Fri May 28 11:32:09 1993
  97. X***************
  98. X*** 1,4 ****
  99. X! /*    SCCS Id: @(#)save.c    3.1    93/02/09    */
  100. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  101. X  /* NetHack may be freely redistributed.  See license for details. */
  102. X  
  103. X--- 1,4 ----
  104. X! /*    SCCS Id: @(#)save.c    3.1    93/05/26    */
  105. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  106. X  /* NetHack may be freely redistributed.  See license for details. */
  107. X  
  108. X***************
  109. X*** 31,37 ****
  110. X  #endif
  111. X  
  112. X  #ifdef ZEROCOMP
  113. X! static void FDECL(bputc, (UCHAR_P));
  114. X  #endif
  115. X  static void FDECL(savelevchn, (int, int));
  116. X  static void FDECL(savedamage, (int,struct damage *, int));
  117. X--- 31,37 ----
  118. X  #endif
  119. X  
  120. X  #ifdef ZEROCOMP
  121. X! static void FDECL(bputc, (int));
  122. X  #endif
  123. X  static void FDECL(savelevchn, (int, int));
  124. X  static void FDECL(savedamage, (int,struct damage *, int));
  125. X***************
  126. X*** 138,149 ****
  127. X      if(flags.window_inited)
  128. X          clear_nhwindow(WIN_MESSAGE);
  129. X  
  130. X! #ifdef MFLOPPY
  131. X      if(!hu) {
  132. X          dotcnt = 0;
  133. X          curs(WIN_MAP, 1, 1);
  134. X          putstr(WIN_MAP, 0, "Saving:");
  135. X      }
  136. X      /* make sure there is enough disk space */
  137. X      savelev(fd, ledger_no(&u.uz), COUNT_SAVE);
  138. X      savegamestate(fd, COUNT_SAVE);
  139. X--- 138,151 ----
  140. X      if(flags.window_inited)
  141. X          clear_nhwindow(WIN_MESSAGE);
  142. X  
  143. X! #ifdef MICRO
  144. X      if(!hu) {
  145. X          dotcnt = 0;
  146. X          curs(WIN_MAP, 1, 1);
  147. X          putstr(WIN_MAP, 0, "Saving:");
  148. X      }
  149. X+ #endif
  150. X+ #ifdef MFLOPPY
  151. X      /* make sure there is enough disk space */
  152. X      savelev(fd, ledger_no(&u.uz), COUNT_SAVE);
  153. X      savegamestate(fd, COUNT_SAVE);
  154. X***************
  155. X*** 383,389 ****
  156. X          struct rm *prm, *rgrm;
  157. X          int x, y;
  158. X          uchar match;
  159. X!         
  160. X          rgrm = &levl[0][0];        /* start matching at first rm */
  161. X          match = 0;
  162. X  
  163. X--- 385,391 ----
  164. X          struct rm *prm, *rgrm;
  165. X          int x, y;
  166. X          uchar match;
  167. X! 
  168. X          rgrm = &levl[0][0];        /* start matching at first rm */
  169. X          match = 0;
  170. X  
  171. X***************
  172. X*** 412,418 ****
  173. X              bwrite(fd, (genericptr_t)rgrm, sizeof(struct rm));
  174. X              /* start encoding again. we have at least 1 rm
  175. X               * in the next run, viz. this one. */
  176. X!             match = 1;    
  177. X              rgrm = prm;
  178. X              }
  179. X          }
  180. X--- 414,420 ----
  181. X              bwrite(fd, (genericptr_t)rgrm, sizeof(struct rm));
  182. X              /* start encoding again. we have at least 1 rm
  183. X               * in the next run, viz. this one. */
  184. X!             match = 1;
  185. X              rgrm = prm;
  186. X              }
  187. X          }
  188. X***************
  189. X*** 439,444 ****
  190. X--- 441,447 ----
  191. X      save_worm(fd, mode);    /* save worm information */
  192. X      savetrapchn(fd, ftrap, mode);
  193. X      saveobjchn(fd, fobj, mode);
  194. X+     saveobjchn(fd, level.buriedobjlist, mode);
  195. X      saveobjchn(fd, billobjs, mode);
  196. X  
  197. X      save_engravings(fd, mode);
  198. X***************
  199. X*** 481,487 ****
  200. X  
  201. X  static void
  202. X  bputc(c)
  203. X! unsigned char c;
  204. X  {
  205. X  #ifdef MFLOPPY
  206. X      bytes_counted++;
  207. X--- 484,490 ----
  208. X  
  209. X  static void
  210. X  bputc(c)
  211. X! int c;
  212. X  {
  213. X  #ifdef MFLOPPY
  214. X      bytes_counted++;
  215. X***************
  216. X*** 492,498 ****
  217. X      (void) write(bwritefd, outbuf, sizeof outbuf);
  218. X      outbufp = 0;
  219. X      }
  220. X!     outbuf[outbufp++] = c;
  221. X  }
  222. X  
  223. X  /*ARGSUSED*/
  224. X--- 495,501 ----
  225. X      (void) write(bwritefd, outbuf, sizeof outbuf);
  226. X      outbufp = 0;
  227. X      }
  228. X!     outbuf[outbufp++] = (unsigned char)c;
  229. X  }
  230. X  
  231. X  /*ARGSUSED*/
  232. X***************
  233. X*** 499,504 ****
  234. X--- 502,510 ----
  235. X  void
  236. X  bufon(fd)
  237. X      int fd;
  238. X+ #if defined(applec)
  239. X+ # pragma unused(fd)
  240. X+ #endif
  241. X  {
  242. X      return;
  243. X  }
  244. X***************
  245. X*** 523,545 ****
  246. X  
  247. X  void
  248. X  bwrite(fd, loc, num)
  249. X! register int fd;
  250. X  genericptr_t loc;
  251. X  register unsigned num;
  252. X  {
  253. X!       bwritefd = fd;
  254. X!       for (; num; num--, (*(char **)&loc)++) {
  255. X!           if (*((char *)loc) == RLESC) { /* One more char in run */
  256. X!           if (++outrunlength == 0xFF) {
  257. X!               flushoutrun(outrunlength);
  258. X!           }
  259. X!           } else { /* end of run */
  260. X!           if (outrunlength >= 0) {    /* flush run */
  261. X!               flushoutrun(outrunlength);
  262. X!           }
  263. X!           bputc(*((char *)loc));
  264. X!           }
  265. X!       }
  266. X  }
  267. X  
  268. X  void
  269. X--- 529,553 ----
  270. X  
  271. X  void
  272. X  bwrite(fd, loc, num)
  273. X! int fd;
  274. X  genericptr_t loc;
  275. X  register unsigned num;
  276. X  {
  277. X!     register unsigned char *bp = (unsigned char *)loc;
  278. X! 
  279. X!     bwritefd = fd;
  280. X!     for (; num; num--, bp++) {
  281. X!         if (*bp == RLESC) {    /* One more char in run */
  282. X!         if (++outrunlength == 0xFF) {
  283. X!             flushoutrun(outrunlength);
  284. X!         }
  285. X!         } else {        /* end of run */
  286. X!         if (outrunlength >= 0) {    /* flush run */
  287. X!             flushoutrun(outrunlength);
  288. X!         }
  289. X!         bputc(*bp);
  290. X!         }
  291. X!     }
  292. X  }
  293. X  
  294. X  void
  295. X***************
  296. X*** 686,692 ****
  297. X          bwrite(fd, (genericptr_t) &xl, sizeof(int));
  298. X          bwrite(fd, (genericptr_t) otmp, xl + sizeof(struct obj));
  299. X  
  300. X!         if (Is_container(otmp) || otmp->otyp == STATUE)
  301. X          saveobjchn(fd,otmp->cobj,mode);
  302. X          if (mode & FREE_SAVE) {
  303. X          if(otmp->oclass == FOOD_CLASS) food_disappears(otmp);
  304. X--- 694,700 ----
  305. X          bwrite(fd, (genericptr_t) &xl, sizeof(int));
  306. X          bwrite(fd, (genericptr_t) otmp, xl + sizeof(struct obj));
  307. X  
  308. X!         if (Has_contents(otmp))
  309. X          saveobjchn(fd,otmp->cobj,mode);
  310. X          if (mode & FREE_SAVE) {
  311. X          if(otmp->oclass == FOOD_CLASS) food_disappears(otmp);
  312. X***************
  313. X*** 711,719 ****
  314. X  
  315. X      while(mtmp) {
  316. X          mtmp2 = mtmp->nmon;
  317. X- #ifdef MUSE
  318. X-         if (mtmp->mw && mtmp->mw != mtmp->minvent) sort_mwep(mtmp);
  319. X- #endif
  320. X          xl = mtmp->mxlth + mtmp->mnamelth;
  321. X          bwrite(fd, (genericptr_t) &xl, sizeof(int));
  322. X          bwrite(fd, (genericptr_t) mtmp, xl + sizeof(struct monst));
  323. X--- 719,724 ----
  324. X*** /tmp/da11362    Tue Jun  1 16:15:45 1993
  325. X--- src/shk.c    Tue Jun  1 10:42:27 1993
  326. X***************
  327. X*** 1,4 ****
  328. X! /*    SCCS Id: @(#)shk.c    3.1    93/02/09    */
  329. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  330. X  /* NetHack may be freely redistributed.  See license for details. */
  331. X  
  332. X--- 1,4 ----
  333. X! /*    SCCS Id: @(#)shk.c    3.1    93/05/19    */
  334. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  335. X  /* NetHack may be freely redistributed.  See license for details. */
  336. X  
  337. X***************
  338. X*** 59,64 ****
  339. X--- 59,65 ----
  340. X                        BOOLEAN_P));
  341. X  static void FDECL(bill_box_content, (struct obj *, BOOLEAN_P, BOOLEAN_P,
  342. X                       struct monst *));
  343. X+ static void FDECL(shk_names_obj, (struct obj *));
  344. X  
  345. X  /*
  346. X      invariants: obj->unpaid iff onbill(obj) [unless bp->useup]
  347. X***************
  348. X*** 128,134 ****
  349. X  replshk(mtmp,mtmp2)
  350. X  register struct monst *mtmp, *mtmp2;
  351. X  {
  352. X!     if(inhishop(mtmp) && *u.ushops == ESHK(mtmp)->shoproom) {
  353. X          ESHK(mtmp2)->bill_p = &(ESHK(mtmp2)->bill[0]);
  354. X      }
  355. X  }
  356. X--- 129,136 ----
  357. X  replshk(mtmp,mtmp2)
  358. X  register struct monst *mtmp, *mtmp2;
  359. X  {
  360. X!     rooms[ESHK(mtmp2)->shoproom - ROOMOFFSET].resident = mtmp2;
  361. X!     if (inhishop(mtmp) && *u.ushops == ESHK(mtmp)->shoproom) {
  362. X          ESHK(mtmp2)->bill_p = &(ESHK(mtmp2)->bill[0]);
  363. X      }
  364. X  }
  365. X***************
  366. X*** 155,161 ****
  367. X  register struct obj *list;
  368. X  {
  369. X      while (list) {
  370. X!     if (Is_container(list)) clear_unpaid(list->cobj);
  371. X      list->unpaid = 0;
  372. X      list = list->nobj;
  373. X      }
  374. X--- 157,163 ----
  375. X  register struct obj *list;
  376. X  {
  377. X      while (list) {
  378. X!     if (Has_contents(list)) clear_unpaid(list->cobj);
  379. X      list->unpaid = 0;
  380. X      list = list->nobj;
  381. X      }
  382. X***************
  383. X*** 170,175 ****
  384. X--- 172,178 ----
  385. X  
  386. X      clear_unpaid(invent);
  387. X      clear_unpaid(fobj);
  388. X+     clear_unpaid(level.buriedobjlist);
  389. X      for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  390. X          clear_unpaid(mtmp->minvent);
  391. X      for(mtmp = migrating_mons; mtmp; mtmp = mtmp->nmon)
  392. X***************
  393. X*** 303,314 ****
  394. X      if(!eshkp->billct && !eshkp->debit)    /* bill is settled */
  395. X          return;
  396. X  
  397. X!     if(!*leavestring) {
  398. X          /*
  399. X           * Player just stepped onto shop-boundary (known from above logic).
  400. X           * Try to intimidate him into paying his bill
  401. X           */
  402. X- 
  403. X          verbalize(NOTANGRY(shkp) ?
  404. X                "%s!  Please pay before leaving." :
  405. X                "%s!  Don't you leave without paying!",
  406. X--- 306,316 ----
  407. X      if(!eshkp->billct && !eshkp->debit)    /* bill is settled */
  408. X          return;
  409. X  
  410. X!     if (!*leavestring && shkp->mcanmove && !shkp->msleep) {
  411. X          /*
  412. X           * Player just stepped onto shop-boundary (known from above logic).
  413. X           * Try to intimidate him into paying his bill
  414. X           */
  415. X          verbalize(NOTANGRY(shkp) ?
  416. X                "%s!  Please pay before leaving." :
  417. X                "%s!  Don't you leave without paying!",
  418. X***************
  419. X*** 315,327 ****
  420. X                plname);
  421. X          return;
  422. X      }
  423. X-         /* by this point, we know an actual robbery has taken place */
  424. X-     You("escaped the shop without paying!");
  425. X      total = (addupbill(shkp) + eshkp->debit);
  426. X!     eshkp->robbed += total;
  427. X!     eshkp->credit = 0L;
  428. X!     eshkp->debit = 0L;
  429. X      setpaid(shkp);
  430. X      You("stole %ld zorkmid%s worth of merchandise.",
  431. X          total, plur(total));
  432. X      if (pl_character[0] != 'R') /* stealing is unlawful */
  433. X--- 317,336 ----
  434. X                plname);
  435. X          return;
  436. X      }
  437. X      total = (addupbill(shkp) + eshkp->debit);
  438. X!     if (eshkp->credit >= total) {
  439. X!         Your("credit of %ld zorkmid%s is used to cover your shopping bill.",
  440. X!          eshkp->credit, plur(eshkp->credit));
  441. X!         total = 0L;        /* credit gets cleared by setpaid() */
  442. X!     } else {
  443. X!         You("escaped the shop without paying!");
  444. X!         total -= eshkp->credit;
  445. X!     }
  446. X      setpaid(shkp);
  447. X+     if (!total) return;
  448. X+ 
  449. X+     /* by this point, we know an actual robbery has taken place */
  450. X+     eshkp->robbed += total;
  451. X      You("stole %ld zorkmid%s worth of merchandise.",
  452. X          total, plur(total));
  453. X      if (pl_character[0] != 'R') /* stealing is unlawful */
  454. X***************
  455. X*** 381,387 ****
  456. X          pacify_shk(shkp);
  457. X      }
  458. X  
  459. X!     if (eshkp->following)
  460. X          return;
  461. X  
  462. X      if (Invis) {
  463. X--- 390,396 ----
  464. X          pacify_shk(shkp);
  465. X      }
  466. X  
  467. X!     if (shkp->msleep || !shkp->mcanmove || eshkp->following) /* no dialog */
  468. X          return;
  469. X  
  470. X      if (Invis) {
  471. X***************
  472. X*** 398,405 ****
  473. X                s_suffix(shkname(shkp)),
  474. X                shtypes[rt - SHOPBASE].name);
  475. X      } else if (eshkp->robbed) {
  476. X!         verbalize("Beware, %s!  I am upset about missing stock!",
  477. X!               plname);
  478. X      } else {
  479. X          verbalize("Hello, %s!  Welcome%s to %s %s!",
  480. X                plname,
  481. X--- 407,413 ----
  482. X                s_suffix(shkname(shkp)),
  483. X                shtypes[rt - SHOPBASE].name);
  484. X      } else if (eshkp->robbed) {
  485. X!         pline("%s mutters imprecations against shoplifters.", shkname(shkp));
  486. X      } else {
  487. X          verbalize("Hello, %s!  Welcome%s to %s %s!",
  488. X                plname,
  489. X***************
  490. X*** 418,423 ****
  491. X--- 426,461 ----
  492. X      return;
  493. X  }
  494. X  
  495. X+ /*
  496. X+    Decide whether two unpaid items are mergable; caller is responsible for
  497. X+    making sure they're unpaid and the same type of object; we check the price
  498. X+    quoted by the shopkeeper and also that they both belong to the same shk.
  499. X+  */
  500. X+ boolean same_price(obj1, obj2)
  501. X+ struct obj *obj1, *obj2;
  502. X+ {
  503. X+     register struct monst *shkp1, *shkp2;
  504. X+     register struct bill_x *bp1 = 0, *bp2 = 0;
  505. X+     register boolean are_mergable = FALSE;
  506. X+ 
  507. X+     /* look up the first object by finding shk whose bill it's on */
  508. X+     for (shkp1 = next_shkp(fmon, TRUE); shkp1;
  509. X+         shkp1 = next_shkp(shkp1, TRUE))
  510. X+         if ((bp1 = onbill(obj1, shkp1, TRUE)) != 0) break;
  511. X+     /* second object is probably owned by same shk; if not, look harder */
  512. X+     if (shkp1 && (bp2 = onbill(obj2, shkp1, TRUE)) != 0) {
  513. X+         shkp2 = shkp1;
  514. X+     } else {
  515. X+         for (shkp2 = next_shkp(fmon, TRUE); shkp2;
  516. X+             shkp2 = next_shkp(shkp2, TRUE))
  517. X+         if ((bp2 = onbill(obj2, shkp2, TRUE)) != 0) break;
  518. X+     }
  519. X+ 
  520. X+     if (!bp1 || !bp2) impossible("same_price: object wasn't on any bill!");
  521. X+     else are_mergable = (shkp1 == shkp2 && bp1->price == bp2->price);
  522. X+     return are_mergable;
  523. X+ }
  524. X+ 
  525. X  #endif /* OVL1 */
  526. X  #ifdef OVLB
  527. X  
  528. X***************
  529. X*** 830,835 ****
  530. X--- 868,879 ----
  531. X          return(0);
  532. X      }
  533. X  proceed:
  534. X+ 
  535. X+     if (shkp->msleep || !shkp->mcanmove) {
  536. X+         pline("%s %s.", Monnam(shkp),
  537. X+               rn2(2) ? "seems to be napping" : "doesn't respond");
  538. X+         return 0;
  539. X+     }
  540. X      eshkp = ESHK(shkp);
  541. X  
  542. X      ltmp = eshkp->robbed;
  543. X***************
  544. X*** 1115,1120 ****
  545. X--- 1159,1165 ----
  546. X      }
  547. X  
  548. X      pay(ltmp, shkp);
  549. X+     shk_names_obj(obj);    /* identify some non-magic objects */
  550. X      You("bought %s for %ld gold piece%s.",
  551. X          doname(obj), ltmp, plur(ltmp));
  552. X      obj->quan = save_quan;        /* restore original count */
  553. X***************
  554. X*** 1194,1200 ****
  555. X      if(numsk > 1) {
  556. X          if(cansee(shkp->mx, shkp->my) && croaked)
  557. X          pline("%s %slooks at your corpse%s%s", Monnam(shkp),
  558. X!              (shkp->msleep || shkp->mfrozen) ?
  559. X                     "wakes up, " : "",
  560. X               !rn2(2) ? (shkp->female ? ", shakes her head," :
  561. X                   ", shakes his head,") : "",
  562. X--- 1239,1245 ----
  563. X      if(numsk > 1) {
  564. X          if(cansee(shkp->mx, shkp->my) && croaked)
  565. X          pline("%s %slooks at your corpse%s%s", Monnam(shkp),
  566. X!              (shkp->msleep || !shkp->mcanmove) ?
  567. X                     "wakes up, " : "",
  568. X               !rn2(2) ? (shkp->female ? ", shakes her head," :
  569. X                   ", shakes his head,") : "",
  570. X***************
  571. X*** 1231,1237 ****
  572. X          if((loss > u.ugold) || !loss) {
  573. X              pline("%s %s%stakes all your possessions.",
  574. X                  shkname(shkp),
  575. X!                 (shkp->msleep || shkp->mfrozen) ?
  576. X                     "wakes up and " : "",
  577. X                  (distu(shkp->mx, shkp->my) > 2) ?
  578. X                      "comes and " : "");
  579. X--- 1276,1282 ----
  580. X          if((loss > u.ugold) || !loss) {
  581. X              pline("%s %s%stakes all your possessions.",
  582. X                  shkname(shkp),
  583. X!                 (shkp->msleep || !shkp->mcanmove) ?
  584. X                     "wakes up and " : "",
  585. X                  (distu(shkp->mx, shkp->my) > 2) ?
  586. X                      "comes and " : "");
  587. X***************
  588. X*** 1272,1278 ****
  589. X              shkp->mgold += loss;
  590. X              pline("%s %sand takes %ld zorkmid%s %sowed %s.",
  591. X                    Monnam(shkp),
  592. X!                   (shkp->msleep || shkp->mfrozen) ?
  593. X                      "wakes up " : "comes ",
  594. X                    loss, plur(loss),
  595. X                    strncmp(eshkp->customer,
  596. X--- 1317,1323 ----
  597. X              shkp->mgold += loss;
  598. X              pline("%s %sand takes %ld zorkmid%s %sowed %s.",
  599. X                    Monnam(shkp),
  600. X!                   (shkp->msleep || !shkp->mcanmove) ?
  601. X                      "wakes up " : "comes ",
  602. X                    loss, plur(loss),
  603. X                    strncmp(eshkp->customer,
  604. X***************
  605. X*** 1302,1307 ****
  606. X--- 1347,1353 ----
  607. X          obj = o_on(id, billobjs);
  608. X      else if(!(obj = o_on(id, invent)) &&
  609. X          !(obj = o_on(id, fobj)) &&
  610. X+         !(obj = o_on(id, level.buriedobjlist)) &&
  611. X          !(obj = o_on(id, migrating_objs))) {
  612. X              for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  613. X              if ((obj = o_on(id, mtmp->minvent)) != 0)
  614. X***************
  615. X*** 1385,1391 ****
  616. X              price += get_cost(otmp, shkp);
  617. X          }
  618. X  
  619. X!         if(Is_container(otmp))
  620. X              price += contained_cost(otmp, shkp, price, usell);
  621. X      }
  622. X  
  623. X--- 1431,1437 ----
  624. X              price += get_cost(otmp, shkp);
  625. X          }
  626. X  
  627. X!         if (Has_contents(otmp))
  628. X              price += contained_cost(otmp, shkp, price, usell);
  629. X      }
  630. X  
  631. X***************
  632. X*** 1403,1409 ****
  633. X      for (otmp = obj->cobj; otmp; otmp = otmp->nobj)
  634. X          if (otmp->oclass == GOLD_CLASS)
  635. X          value += otmp->quan;
  636. X!         else if (Is_container(otmp))
  637. X          value += contained_gold(otmp);
  638. X  
  639. X      return(value);
  640. X--- 1449,1455 ----
  641. X      for (otmp = obj->cobj; otmp; otmp = otmp->nobj)
  642. X          if (otmp->oclass == GOLD_CLASS)
  643. X          value += otmp->quan;
  644. X!         else if (Has_contents(otmp))
  645. X          value += contained_gold(otmp);
  646. X  
  647. X      return(value);
  648. X***************
  649. X*** 1429,1435 ****
  650. X          if(!otmp->unpaid && !(sale && saleitem))
  651. X          otmp->no_charge = 1;
  652. X  
  653. X!         if(Is_container(otmp))
  654. X          dropped_container(otmp, shkp, sale);
  655. X      }
  656. X  }
  657. X--- 1475,1481 ----
  658. X          if(!otmp->unpaid && !(sale && saleitem))
  659. X          otmp->no_charge = 1;
  660. X  
  661. X!         if (Has_contents(otmp))
  662. X          dropped_container(otmp, shkp, sale);
  663. X      }
  664. X  }
  665. X***************
  666. X*** 1448,1454 ****
  667. X          if(otmp->no_charge)
  668. X          otmp->no_charge = 0;
  669. X  
  670. X!         if(Is_container(otmp))
  671. X          picked_container(otmp);
  672. X      }
  673. X  }
  674. X--- 1494,1500 ----
  675. X          if(otmp->no_charge)
  676. X          otmp->no_charge = 0;
  677. X  
  678. X!         if (Has_contents(otmp))
  679. X          picked_container(otmp);
  680. X      }
  681. X  }
  682. X***************
  683. X*** 1563,1574 ****
  684. X          /* the "top" box is added in addtobill() */
  685. X          if(!otmp->no_charge)
  686. X              add_one_tobill(otmp, dummy);
  687. X!         if(Is_container(otmp))
  688. X              bill_box_content(otmp, ininv, dummy, shkp);
  689. X      }
  690. X  
  691. X  }
  692. X  
  693. X  void
  694. X  addtobill(obj, ininv, dummy, silent)
  695. X  register struct obj *obj;
  696. X--- 1609,1635 ----
  697. X          /* the "top" box is added in addtobill() */
  698. X          if(!otmp->no_charge)
  699. X              add_one_tobill(otmp, dummy);
  700. X!         if (Has_contents(otmp))
  701. X              bill_box_content(otmp, ininv, dummy, shkp);
  702. X      }
  703. X  
  704. X  }
  705. X  
  706. X+ static void
  707. X+ shk_names_obj(obj)
  708. X+ register struct obj *obj;
  709. X+ /* shopkeeper tells you what an object is */
  710. X+ {
  711. X+     obj->dknown = TRUE;
  712. X+     /* use real name for ordinary weapons/armor, and spell-less
  713. X+      * scrolls/books (that is, blank and mail).
  714. X+      */
  715. X+     if (!objects[obj->otyp].oc_magic &&
  716. X+         (obj->oclass == WEAPON_CLASS || obj->oclass == ARMOR_CLASS ||
  717. X+          obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS))
  718. X+         makeknown(obj->otyp);
  719. X+ }
  720. X+ 
  721. X  void
  722. X  addtobill(obj, ininv, dummy, silent)
  723. X  register struct obj *obj;
  724. X***************
  725. X*** 1577,1583 ****
  726. X      register struct monst *shkp;
  727. X      register char roomno = *u.ushops;
  728. X      long ltmp = 0L, cltmp = 0L, gltmp = 0L;
  729. X!     register boolean container = Is_container(obj);
  730. X  
  731. X      if(!*u.ushops) return;
  732. X  
  733. X--- 1638,1644 ----
  734. X      register struct monst *shkp;
  735. X      register char roomno = *u.ushops;
  736. X      long ltmp = 0L, cltmp = 0L, gltmp = 0L;
  737. X!     register boolean container = Has_contents(obj);
  738. X  
  739. X      if(!*u.ushops) return;
  740. X  
  741. X***************
  742. X*** 1639,1645 ****
  743. X      } else /* i.e., !container */
  744. X          add_one_tobill(obj, dummy);
  745. X  speak:
  746. X!     if(!shkp->msleep && !shkp->mfrozen && !silent) {
  747. X          char buf[BUFSZ];
  748. X  
  749. X          if(!ltmp) {
  750. X--- 1700,1706 ----
  751. X      } else /* i.e., !container */
  752. X          add_one_tobill(obj, dummy);
  753. X  speak:
  754. X!     if (shkp->mcanmove && !shkp->msleep && !silent) {
  755. X          char buf[BUFSZ];
  756. X  
  757. X          if(!ltmp) {
  758. X***************
  759. X*** 1650,1667 ****
  760. X          Strcpy(buf, "\"For you, ");
  761. X          if (ANGRY(shkp)) Strcat(buf, "scum ");
  762. X          else {
  763. X!         switch(rnd(4) + u.uevent.udemigod) {
  764. X!           case 1: Strcat(buf, "good");
  765. X!               break;
  766. X!           case 2: Strcat(buf, "honored");
  767. X!               break;
  768. X!           case 3: Strcat(buf, "most gracious");
  769. X!               break;
  770. X!           case 4: Strcat(buf, "esteemed");
  771. X!               break;
  772. X!           case 5: Strcat(buf, "most renowned and sacred");
  773. X!               break;
  774. X!         }
  775. X  #ifdef POLYSELF
  776. X          if(!is_human(uasmon)) Strcat(buf, " creature");
  777. X          else
  778. X--- 1711,1721 ----
  779. X          Strcpy(buf, "\"For you, ");
  780. X          if (ANGRY(shkp)) Strcat(buf, "scum ");
  781. X          else {
  782. X!         static const char *honored[5] = {
  783. X!           "good", "honored", "most gracious", "esteemed",
  784. X!           "most renowned and sacred"
  785. X!         };
  786. X!         Strcat(buf, honored[rn2(4) + u.uevent.udemigod]);
  787. X  #ifdef POLYSELF
  788. X          if(!is_human(uasmon)) Strcat(buf, " creature");
  789. X          else
  790. X***************
  791. X*** 1668,1676 ****
  792. X  #endif
  793. X              Strcat(buf, (flags.female) ? " lady" : " sir");
  794. X          }
  795. X-         /* after all, the shk is telling you what it is */
  796. X-         obj->dknown = 1;
  797. X-         exercise(A_WIS, TRUE);
  798. X          if(ininv) {
  799. X          long quan = obj->quan;
  800. X          obj->quan = 1L; /* fool xname() into giving singular */
  801. X--- 1722,1727 ----
  802. X***************
  803. X*** 1777,1787 ****
  804. X  
  805. X      sub_one_frombill(obj, shkp);
  806. X  
  807. X!     if(Is_container(obj))
  808. X          for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  809. X          if(otmp->oclass == GOLD_CLASS) continue;
  810. X  
  811. X!         if(Is_container(otmp))
  812. X              subfrombill(otmp, shkp);
  813. X          else
  814. X              sub_one_frombill(otmp, shkp);
  815. X--- 1828,1838 ----
  816. X  
  817. X      sub_one_frombill(obj, shkp);
  818. X  
  819. X!     if (Has_contents(obj))
  820. X          for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
  821. X          if(otmp->oclass == GOLD_CLASS) continue;
  822. X  
  823. X!         if (Has_contents(otmp))
  824. X              subfrombill(otmp, shkp);
  825. X          else
  826. X              sub_one_frombill(otmp, shkp);
  827. X***************
  828. X*** 1810,1816 ****
  829. X  
  830. X          if(otmp->oclass == GOLD_CLASS) continue;
  831. X  
  832. X!         if(!Is_container(otmp)) {
  833. X          if(ininv) {
  834. X              if(otmp->unpaid)
  835. X              price += get_cost(otmp, shkp);
  836. X--- 1861,1867 ----
  837. X  
  838. X          if(otmp->oclass == GOLD_CLASS) continue;
  839. X  
  840. X!         if (!Has_contents(otmp)) {
  841. X          if(ininv) {
  842. X              if(otmp->unpaid)
  843. X              price += get_cost(otmp, shkp);
  844. X***************
  845. X*** 1852,1858 ****
  846. X  
  847. X      if(obj->oclass == GOLD_CLASS) {
  848. X          gvalue += obj->quan;
  849. X!     } else if(Is_container(obj)) {
  850. X          register boolean ininv = !!count_unpaid(obj->cobj);
  851. X  
  852. X          value += stolen_container(obj, shkp, value, ininv);
  853. X--- 1903,1909 ----
  854. X  
  855. X      if(obj->oclass == GOLD_CLASS) {
  856. X          gvalue += obj->quan;
  857. X!     } else if (Has_contents(obj)) {
  858. X          register boolean ininv = !!count_unpaid(obj->cobj);
  859. X  
  860. X          value += stolen_container(obj, shkp, value, ininv);
  861. X***************
  862. X*** 1918,1924 ****
  863. X      register struct monst *shkp;
  864. X      register struct eshk *eshkp;
  865. X      register long ltmp = 0L, cltmp = 0L, gltmp = 0L, offer;
  866. X!     boolean saleitem, cgold = FALSE, container = Is_container(obj);
  867. X      boolean isgold = (obj->oclass == GOLD_CLASS);
  868. X  
  869. X      if(!(shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) ||
  870. X--- 1969,1975 ----
  871. X      register struct monst *shkp;
  872. X      register struct eshk *eshkp;
  873. X      register long ltmp = 0L, cltmp = 0L, gltmp = 0L, offer;
  874. X!     boolean saleitem, cgold = FALSE, container = Has_contents(obj);
  875. X      boolean isgold = (obj->oclass == GOLD_CLASS);
  876. X  
  877. X      if(!(shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) ||
  878. X***************
  879. X*** 1934,1951 ****
  880. X          return;
  881. X      }
  882. X      if(container) {
  883. X-         if(obj->cobj == (struct obj *)0) {
  884. X-         if(obj->unpaid) {
  885. X-             sub_one_frombill(obj, shkp);
  886. X-             return;
  887. X-         }
  888. X-         } else {
  889. X          /* find the price of content before subfrombill */
  890. X          cltmp += contained_cost(obj, shkp, cltmp, TRUE);
  891. X          /* find the value of contained gold */
  892. X          gltmp += contained_gold(obj);
  893. X          cgold = (gltmp > 0L);
  894. X-         }
  895. X      }
  896. X  
  897. X      if(!isgold && !obj->unpaid && saleitem)
  898. X--- 1985,1995 ----
  899. X***************
  900. X*** 1959,1971 ****
  901. X                    (container && count_unpaid(obj->cobj)));
  902. X  
  903. X          if(container) {
  904. X-             if(obj->cobj != (struct obj *)0) {
  905. X              dropped_container(obj, shkp, FALSE);
  906. X              if(!obj->unpaid && !saleitem)
  907. X                  obj->no_charge = 1;
  908. X              if(obj->unpaid || count_unpaid(obj->cobj))
  909. X                  subfrombill(obj, shkp);
  910. X-             } else obj->no_charge = 1;
  911. X          } else obj->no_charge = 1;
  912. X  
  913. X          if(!unpaid)
  914. X--- 2003,2013 ----
  915. X***************
  916. X*** 1974,1986 ****
  917. X      }
  918. X  
  919. X      /* you dropped something of your own - probably want to sell it */
  920. X!     if(shkp->msleep || !shkp->mcanmove) {
  921. X!         if(container && obj->cobj != (struct obj *)0) {
  922. X              dropped_container(obj, shkp, TRUE);
  923. X!         }
  924. X!         if(!obj->unpaid && !saleitem && !isgold)
  925. X              obj->no_charge = 1;
  926. X!         if(!shkp->mcanmove) {
  927. X              if(ANGRY(shkp) && !rn2(4))
  928. X              pline("%s utters a curse.", Monnam(shkp));
  929. X              else pline("%s is indisposed.", Monnam(shkp));
  930. X--- 2016,2027 ----
  931. X      }
  932. X  
  933. X      /* you dropped something of your own - probably want to sell it */
  934. X!     if (shkp->msleep || !shkp->mcanmove) {
  935. X!         if (container)
  936. X              dropped_container(obj, shkp, TRUE);
  937. X!         if (!obj->unpaid)
  938. X              obj->no_charge = 1;
  939. X!         if (!shkp->mcanmove) {
  940. X              if(ANGRY(shkp) && !rn2(4))
  941. X              pline("%s utters a curse.", Monnam(shkp));
  942. X              else pline("%s is indisposed.", Monnam(shkp));
  943. X***************
  944. X*** 2037,2048 ****
  945. X          if(offer) goto move_on;
  946. X          else {
  947. X              if(!isgold) {
  948. X!                 if(container && obj->cobj != (struct obj *)0) {
  949. X                  dropped_container(obj, shkp, FALSE);
  950. X!                 }
  951. X!                 if(!obj->unpaid && !saleitem)
  952. X!                 obj->no_charge = 1;
  953. X!                 subfrombill(obj, shkp);
  954. X              }
  955. X              return;
  956. X          }
  957. X--- 2078,2087 ----
  958. X          if(offer) goto move_on;
  959. X          else {
  960. X              if(!isgold) {
  961. X!             if (container)
  962. X                  dropped_container(obj, shkp, FALSE);
  963. X!             if (!obj->unpaid && !saleitem) obj->no_charge = 1;
  964. X!             subfrombill(obj, shkp);
  965. X              }
  966. X              return;
  967. X          }
  968. X***************
  969. X*** 2056,2087 ****
  970. X         || (Is_candle(obj) &&
  971. X             obj->age < 20L * (long)objects[obj->otyp].oc_cost)) {
  972. X          pline("%s seems not interested%s.", Monnam(shkp),
  973. X!                        cgold ? " in the rest" : "");
  974. X!         if(container && obj->cobj != (struct obj *)0) {
  975. X              dropped_container(obj, shkp, FALSE);
  976. X-         }
  977. X          obj->no_charge = 1;
  978. X          return;
  979. X      }
  980. X  
  981. X      if(!shkp->mgold) {
  982. X          long tmpcr = (ltmp + cltmp) * 2L;
  983. X  
  984. X!         pline("%s cannot pay you at present.", Monnam(shkp));
  985. X!         pline("Will you accept %ld zorkmids in credit for %s? ",
  986. X!                      tmpcr, doname(obj));
  987. X!         /* cannot use a yn function here */
  988. X!         if (readchar() == 'y') {
  989. X              You("have %ld zorkmids in %scredit.", tmpcr,
  990. X!                 ESHK(shkp)->credit > 0L ? "additional " : "");
  991. X              ESHK(shkp)->credit += tmpcr;
  992. X              subfrombill(obj, shkp);
  993. X          } else {
  994. X!             if(container && obj->cobj != (struct obj *)0) {
  995. X!                 dropped_container(obj, shkp, FALSE);
  996. X!             }
  997. X!             if(!obj->unpaid)
  998. X!             obj->no_charge = 1;
  999. X              subfrombill(obj, shkp);
  1000. X          }
  1001. X      } else {
  1002. X--- 2095,2131 ----
  1003. X         || (Is_candle(obj) &&
  1004. X             obj->age < 20L * (long)objects[obj->otyp].oc_cost)) {
  1005. X          pline("%s seems not interested%s.", Monnam(shkp),
  1006. X!             cgold ? " in the rest" : "");
  1007. X!         if (container)
  1008. X              dropped_container(obj, shkp, FALSE);
  1009. X          obj->no_charge = 1;
  1010. X          return;
  1011. X      }
  1012. X  
  1013. X      if(!shkp->mgold) {
  1014. X+         char c, qbuf[BUFSZ];
  1015. X          long tmpcr = (ltmp + cltmp) * 2L;
  1016. X  
  1017. X!         if (sell_response != 'n') {
  1018. X!             pline("%s cannot pay you at present.", Monnam(shkp));
  1019. X!             Sprintf(qbuf,
  1020. X!                 "Will you accept %ld zorkmids in credit for %s? ",
  1021. X!                 tmpcr, doname(obj));
  1022. X!             /* won't accept 'a' response here */
  1023. X!             c = ynq(qbuf);
  1024. X!         } else        /* previously specified "quit" */
  1025. X!             c = 'n';
  1026. X! 
  1027. X!         if (c == 'y') {
  1028. X              You("have %ld zorkmids in %scredit.", tmpcr,
  1029. X!             ESHK(shkp)->credit > 0L ? "additional " : "");
  1030. X              ESHK(shkp)->credit += tmpcr;
  1031. X              subfrombill(obj, shkp);
  1032. X          } else {
  1033. X!             if (c == 'q') sell_response = 'n';
  1034. X!             if (container)
  1035. X!             dropped_container(obj, shkp, FALSE);
  1036. X!             if (!obj->unpaid) obj->no_charge = 1;
  1037. X              subfrombill(obj, shkp);
  1038. X          }
  1039. X      } else {
  1040. X***************
  1041. X*** 2113,2130 ****
  1042. X  
  1043. X          switch (sell_response ? sell_response : ynaq(qbuf)) {
  1044. X           case 'q':  sell_response = 'n';
  1045. X!          case 'n':  if(container && obj->cobj != (struct obj *)0) {
  1046. X                  dropped_container(obj, shkp, FALSE);
  1047. X!                 }
  1048. X!                     if(!obj->unpaid) obj->no_charge = 1;
  1049. X                  subfrombill(obj, shkp);
  1050. X                  break;
  1051. X           case 'a':  sell_response = 'y';
  1052. X!          case 'y':  if(container && obj->cobj != (struct obj *)0)
  1053. X!                         dropped_container(obj, shkp, TRUE);
  1054. X!                     if(!obj->unpaid && !saleitem)
  1055. X!                     obj->no_charge = 1;
  1056. X!                     subfrombill(obj, shkp);
  1057. X                  pay(-offer, shkp);
  1058. X                  You("sold %s for %ld gold piece%s.", doname(obj),
  1059. X                  offer, plur(offer));
  1060. X--- 2157,2172 ----
  1061. X  
  1062. X          switch (sell_response ? sell_response : ynaq(qbuf)) {
  1063. X           case 'q':  sell_response = 'n';
  1064. X!          case 'n':  if (container)
  1065. X                  dropped_container(obj, shkp, FALSE);
  1066. X!                 if (!obj->unpaid) obj->no_charge = 1;
  1067. X                  subfrombill(obj, shkp);
  1068. X                  break;
  1069. X           case 'a':  sell_response = 'y';
  1070. X!          case 'y':  if (container)
  1071. X!                 dropped_container(obj, shkp, TRUE);
  1072. X!                 if (!obj->unpaid && !saleitem) obj->no_charge = 1;
  1073. X!                 subfrombill(obj, shkp);
  1074. X                  pay(-offer, shkp);
  1075. X                  You("sold %s for %ld gold piece%s.", doname(obj),
  1076. X                  offer, plur(offer));
  1077. X***************
  1078. X*** 2179,2194 ****
  1079. X          goto quit;
  1080. X          }
  1081. X          if(bp->useup || bp->bquan > obj->quan) {
  1082. X!         register long oquan, uquan;
  1083. X!         long thisused;
  1084. X  
  1085. X          oquan = obj->quan;
  1086. X          uquan = (bp->useup ? bp->bquan : bp->bquan - oquan);
  1087. X          thisused = bp->price * uquan;
  1088. X          totused += thisused;
  1089. X          obj->quan = uquan;        /* cheat doname */
  1090. X          buf_p = xprname(obj, ' ', FALSE, thisused);
  1091. X          obj->quan = oquan;        /* restore value */
  1092. X          putstr(datawin, 0, buf_p);
  1093. X          }
  1094. X      }
  1095. X--- 2221,2244 ----
  1096. X          goto quit;
  1097. X          }
  1098. X          if(bp->useup || bp->bquan > obj->quan) {
  1099. X!         register long oquan, uquan, thisused;
  1100. X!         unsigned save_unpaid;
  1101. X  
  1102. X+         save_unpaid = obj->unpaid;
  1103. X          oquan = obj->quan;
  1104. X          uquan = (bp->useup ? bp->bquan : bp->bquan - oquan);
  1105. X          thisused = bp->price * uquan;
  1106. X          totused += thisused;
  1107. X          obj->quan = uquan;        /* cheat doname */
  1108. X+         obj->unpaid = 0;        /* ditto */
  1109. X          buf_p = xprname(obj, ' ', FALSE, thisused);
  1110. X          obj->quan = oquan;        /* restore value */
  1111. X+ #ifdef __SASC
  1112. X+                 /* SAS/C 6.2 can't cope for some reason */
  1113. X+         sasc_bug(obj,save_unpaid);
  1114. X+ #else
  1115. X+         obj->unpaid = save_unpaid;
  1116. X+ #endif
  1117. X          putstr(datawin, 0, buf_p);
  1118. X          }
  1119. X      }
  1120. X***************
  1121. X*** 2236,2241 ****
  1122. X--- 2286,2292 ----
  1123. X      return tmp;
  1124. X  }
  1125. X  
  1126. X+ /* shk catches thrown pick-axe */
  1127. X  int
  1128. X  shkcatch(obj, x, y)
  1129. X  register struct obj *obj;
  1130. X***************
  1131. X*** 2403,2409 ****
  1132. X  
  1133. X      if ((monstermoves - tmp_dam->when) < REPAIR_DELAY)
  1134. X          return(0);
  1135. X!     if (ESHK(shkp)->following)
  1136. X          return(0);
  1137. X      x = tmp_dam->place.x;
  1138. X      y = tmp_dam->place.y;
  1139. X--- 2454,2460 ----
  1140. X  
  1141. X      if ((monstermoves - tmp_dam->when) < REPAIR_DELAY)
  1142. X          return(0);
  1143. X!     if (shkp->msleep || !shkp->mcanmove || ESHK(shkp)->following)
  1144. X          return(0);
  1145. X      x = tmp_dam->place.x;
  1146. X      y = tmp_dam->place.y;
  1147. X***************
  1148. X*** 2448,2455 ****
  1149. X                  y+vert(i)) == ESHK(shkp)->shoproom)
  1150. X              litter[i] |= INSHOP;
  1151. X          }
  1152. X!         if (Punished && ((uchain->ox == x && uchain->oy == y) ||
  1153. X!                     (uball->ox == x && uball->oy == y))) {
  1154. X          /*
  1155. X           * Either the ball or chain is in the repair location.
  1156. X           *
  1157. X--- 2499,2507 ----
  1158. X                  y+vert(i)) == ESHK(shkp)->shoproom)
  1159. X              litter[i] |= INSHOP;
  1160. X          }
  1161. X!         if (Punished && !u.uswallow &&
  1162. X!                 ((uchain->ox == x && uchain->oy == y) ||
  1163. X!                  (uball->ox == x && uball->oy == y))) {
  1164. X          /*
  1165. X           * Either the ball or chain is in the repair location.
  1166. X           *
  1167. X***************
  1168. X*** 2872,2878 ****
  1169. X          break;
  1170. X      /* note: otmp might have ->no_charge set, but that's ok */
  1171. X      return (otmp && costly_spot(x, y) && NOTANGRY(shkp)
  1172. X!         && !shkp->msleep && !shkp->mfrozen)
  1173. X          ? otmp : (struct obj *)0;
  1174. X  }
  1175. X  
  1176. X--- 2924,2930 ----
  1177. X          break;
  1178. X      /* note: otmp might have ->no_charge set, but that's ok */
  1179. X      return (otmp && costly_spot(x, y) && NOTANGRY(shkp)
  1180. X!         && shkp->mcanmove && !shkp->msleep)
  1181. X          ? otmp : (struct obj *)0;
  1182. X  }
  1183. X  
  1184. X***************
  1185. X*** 2950,2955 ****
  1186. X--- 3002,3048 ----
  1187. X      return ".";
  1188. X  }
  1189. X  
  1190. X+ #ifdef SOUNDS
  1191. X+ void
  1192. X+ shk_chat(shkp)
  1193. X+ register struct monst *shkp;
  1194. X+ {
  1195. X+     register struct eshk *eshk = ESHK(shkp);
  1196. X+ 
  1197. X+     if (ANGRY(shkp))
  1198. X+         pline("%s mentions how much %s dislikes %s customers.",
  1199. X+             shkname(shkp), he[shkp->female],
  1200. X+             eshk->robbed ? "non-paying" : "rude");
  1201. X+     else if (eshk->following)
  1202. X+         if (strncmp(eshk->customer, plname, PL_NSIZ)) {
  1203. X+             verbalize("Hello %s!  I was looking for %s.",
  1204. X+                 plname, eshk->customer);
  1205. X+             eshk->following = 0;
  1206. X+         } else {
  1207. X+             verbalize("Hello %s!  Didn't you forget to pay?", plname);
  1208. X+         }
  1209. X+     else if (eshk->billct) {
  1210. X+         register long total = addupbill(shkp) + eshk->debit;
  1211. X+         pline("%s says that your bill comes to %ld zorkmid%s.",
  1212. X+               shkname(shkp), total, plur(total));
  1213. X+     } else if (eshk->debit)
  1214. X+         pline("%s reminds you that you owe %s %ld zorkmid%s.",
  1215. X+               shkname(shkp), him[shkp->female],
  1216. X+               eshk->debit, plur(eshk->debit));
  1217. X+     else if (eshk->credit)
  1218. X+         pline("%s encourages you to use your %ld zorkmid%s of credit.",
  1219. X+               shkname(shkp), eshk->credit, plur(eshk->credit));
  1220. X+     else if (eshk->robbed)
  1221. X+         pline("%s complains about a recent robbery.", shkname(shkp));
  1222. X+     else if (shkp->mgold < 50)
  1223. X+         pline("%s complains that business is bad.", shkname(shkp));
  1224. X+     else if (shkp->mgold > 4000)
  1225. X+         pline("%s says that business is good.", shkname(shkp));
  1226. X+     else
  1227. X+         pline("%s talks about the problem of shoplifters.", shkname(shkp));
  1228. X+ }
  1229. X+ #endif  /* SOUNDS */
  1230. X+ 
  1231. X  #ifdef KOPS
  1232. X  static void
  1233. X  kops_gone(silent)
  1234. X***************
  1235. X*** 3008,3014 ****
  1236. X      } else if (otmp->oclass == SPBOOK_CLASS) {
  1237. X              tmp -= tmp / 5L;
  1238. X      } else if (otmp->otyp == CAN_OF_GREASE)
  1239. X!                 tmp /= 10L;
  1240. X      return(tmp);
  1241. X  }
  1242. X  
  1243. X--- 3101,3107 ----
  1244. X      } else if (otmp->oclass == SPBOOK_CLASS) {
  1245. X              tmp -= tmp / 5L;
  1246. X      } else if (otmp->otyp == CAN_OF_GREASE)
  1247. X!             tmp /= 10L;
  1248. X      return(tmp);
  1249. X  }
  1250. X  
  1251. X***************
  1252. X*** 3140,3144 ****
  1253. X--- 3233,3243 ----
  1254. X  }
  1255. X  
  1256. X  #endif /* OVLB */
  1257. X+ 
  1258. X+ #ifdef __SASC
  1259. X+ sasc_bug(struct obj *op, unsigned x){
  1260. X+     op->unpaid=x;
  1261. X+ }
  1262. X+ #endif
  1263. X  
  1264. X  /*shk.c*/
  1265. X*** /tmp/da11370    Tue Jun  1 16:15:50 1993
  1266. X--- src/shknam.c    Mon May 17 14:05:04 1993
  1267. X***************
  1268. X*** 1,4 ****
  1269. X! /*    SCCS Id: @(#)shknam.c    3.1    93/02/17    */
  1270. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1271. X  /* NetHack may be freely redistributed.  See license for details. */
  1272. X  
  1273. X--- 1,4 ----
  1274. X! /*    SCCS Id: @(#)shknam.c    3.1    93/05/15    */
  1275. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1276. X  /* NetHack may be freely redistributed.  See license for details. */
  1277. X  
  1278. X***************
  1279. X*** 10,16 ****
  1280. X  #ifdef OVLB
  1281. X  
  1282. X  static void FDECL(mkshobj_at, (const struct shclass *,int,int));
  1283. X! static void FDECL(findname, (char *,const char **));
  1284. X  static int  FDECL(shkinit, (const struct shclass *,struct mkroom *));
  1285. X  
  1286. X  static const char *shkliquors[] = {
  1287. X--- 10,16 ----
  1288. X  #ifdef OVLB
  1289. X  
  1290. X  static void FDECL(mkshobj_at, (const struct shclass *,int,int));
  1291. X! static void FDECL(nameshk, (struct monst *,const char **));
  1292. X  static int  FDECL(shkinit, (const struct shclass *,struct mkroom *));
  1293. X  
  1294. X  static const char *shkliquors[] = {
  1295. X***************
  1296. X*** 123,128 ****
  1297. X--- 123,140 ----
  1298. X      ""
  1299. X  };
  1300. X  
  1301. X+ static const char *shklight[] = {
  1302. X+     /* Romania */
  1303. X+     "Zarnesti", "Slanic", "Nehoiasu", "Ludus", "Sighisoara", "Nisipitu",
  1304. X+     "Razboieni", "Bicaz", "Dorohoi", "Vaslui", "Fetesti", "Tirgu Neamt",
  1305. X+     "Babadag", "Zimnicea", "Zlatna", "Jiu", "Eforie", "Mamaia",
  1306. X+     /* Bulgaria */
  1307. X+     "Silistra", "Tulovo", "Panagyuritshte", "Smolyan", "Kirklareli",
  1308. X+     "Pernik", "Lom", "Haskovo", "Dobrinishte", "Varvara", "Oryahovo",
  1309. X+     "Troyan", "Lovech", "Sliven",
  1310. X+     ""
  1311. X+ };
  1312. X+ 
  1313. X  static const char *shkgeneral[] = {
  1314. X      /* Suriname */
  1315. X      "Hebiwerie", "Possogroenoe", "Asidonhopo", "Manlobbi",
  1316. X***************
  1317. X*** 191,197 ****
  1318. X       */
  1319. X      {"lighting store", TOOL_CLASS, 0, D_SHOP,
  1320. X          {{32, -WAX_CANDLE}, {50, -TALLOW_CANDLE},
  1321. X!          {5, -BRASS_LANTERN}, {10, -OIL_LAMP}, {3, -MAGIC_LAMP}},shktools},
  1322. X      {NULL, 0, 0, 0, {{0, 0}, {0, 0}, {0, 0}}, 0}
  1323. X  };
  1324. X  
  1325. X--- 203,209 ----
  1326. X       */
  1327. X      {"lighting store", TOOL_CLASS, 0, D_SHOP,
  1328. X          {{32, -WAX_CANDLE}, {50, -TALLOW_CANDLE},
  1329. X!          {5, -BRASS_LANTERN}, {10, -OIL_LAMP}, {3, -MAGIC_LAMP}}, shklight},
  1330. X      {NULL, 0, 0, 0, {{0, 0}, {0, 0}, {0, 0}}, 0}
  1331. X  };
  1332. X  
  1333. X***************
  1334. X*** 247,273 ****
  1335. X      else (void) mkobj_at(atype, sx, sy, TRUE);
  1336. X  }
  1337. X  
  1338. X- static void
  1339. X- findname(nampt, nlp)
  1340. X  /* extract a shopkeeper name for the given shop type */
  1341. X!     char *nampt;
  1342. X!     const char *nlp[];
  1343. X  {
  1344. X!     register int i;
  1345. X  
  1346. X!     for(i = 0; i < ledger_no(&u.uz); i++) /* Note: _not_ depth */
  1347. X!     if (!*nlp[i]) {
  1348. X!         /* Not enough names, try random/general name */
  1349. X!         if((i = rn2(i)))
  1350. X!         break;
  1351. X!         else if (nlp != shkgeneral)
  1352. X!         findname(nampt, shkgeneral);
  1353. X!         else
  1354. X!         Strcpy(nampt, "Dirk");
  1355. X!         return;
  1356. X      }
  1357. X!     (void) strncpy(nampt, nlp[i-1], PL_NSIZ);
  1358. X!     nampt[PL_NSIZ-1] = 0;
  1359. X  }
  1360. X  
  1361. X  static int
  1362. X--- 259,313 ----
  1363. X      else (void) mkobj_at(atype, sx, sy, TRUE);
  1364. X  }
  1365. X  
  1366. X  /* extract a shopkeeper name for the given shop type */
  1367. X! static void
  1368. X! nameshk(shk, nlp)
  1369. X! struct monst *shk;
  1370. X! const char *nlp[];
  1371. X  {
  1372. X!     int i, try, names_avail;
  1373. X!     const char *shname = 0;
  1374. X!     struct monst *mtmp;
  1375. X!     int name_wanted = ledger_no(&u.uz);    /* Note: _not_ depth */
  1376. X  
  1377. X!     for (names_avail = 0; *nlp[names_avail]; names_avail++)
  1378. X!         ;
  1379. X! 
  1380. X!     for (try = 0; try < 50; try++) {
  1381. X!         if (nlp == shktools) {
  1382. X!             shname = shktools[rn2(names_avail)];
  1383. X!             shk->female = (*shname == '_');
  1384. X!             if (shk->female) shname++;
  1385. X!         } else {
  1386. X!             shk->female = name_wanted % 2;
  1387. X! 
  1388. X!             if (name_wanted < names_avail) {
  1389. X!             shname = nlp[name_wanted];
  1390. X!             } else {
  1391. X!             if ((i = rn2(names_avail)) != 0)
  1392. X!                 shname = nlp[i-1];
  1393. X!             else if (nlp != shkgeneral) {
  1394. X!                 nlp = shkgeneral;    /* try general names */
  1395. X!                 for (names_avail = 0; *nlp[names_avail];
  1396. X!                                 names_avail++)
  1397. X!                     ;
  1398. X!                 continue;
  1399. X!             } else
  1400. X!                 shname = "Dirk";
  1401. X!             }
  1402. X!         }
  1403. X! 
  1404. X!         /* is name already is use on this level? */
  1405. X!         for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
  1406. X!             if (mtmp == shk) continue;
  1407. X!             if (!mtmp->isshk) continue;
  1408. X!             if (strcmp(ESHK(mtmp)->shknam, shname)) continue;
  1409. X!             break;
  1410. X!         }
  1411. X!         if (!mtmp) break;    /* new name */
  1412. X      }
  1413. X!     (void) strncpy(ESHK(shk)->shknam, shname, PL_NSIZ);
  1414. X!     ESHK(shk)->shknam[PL_NSIZ-1] = 0;
  1415. X  }
  1416. X  
  1417. X  static int
  1418. X***************
  1419. X*** 328,336 ****
  1420. X  
  1421. X      /* now initialize the shopkeeper monster structure */
  1422. X      if(!(shk = makemon(&mons[PM_SHOPKEEPER], sx, sy))) return(-1);
  1423. X!     shk->isshk = shk->mpeaceful = 1;
  1424. X      set_malign(shk);
  1425. X!     shk->msleep = 0;
  1426. X      shk->mtrapseen = ~0;    /* we know all the traps already */
  1427. X      ESHK(shk)->shoproom = (sroom - rooms) + ROOMOFFSET;
  1428. X      sroom->resident = shk;
  1429. X--- 368,376 ----
  1430. X  
  1431. X      /* now initialize the shopkeeper monster structure */
  1432. X      if(!(shk = makemon(&mons[PM_SHOPKEEPER], sx, sy))) return(-1);
  1433. X!     shk->isshk = shk->mpeaceful = TRUE;
  1434. X      set_malign(shk);
  1435. X!     shk->msleep = FALSE;
  1436. X      shk->mtrapseen = ~0;    /* we know all the traps already */
  1437. X      ESHK(shk)->shoproom = (sroom - rooms) + ROOMOFFSET;
  1438. X      sroom->resident = shk;
  1439. X***************
  1440. X*** 347,362 ****
  1441. X      ESHK(shk)->following = 0;
  1442. X      ESHK(shk)->billct = 0;
  1443. X      shk->mgold = 1000L + 30L*(long)rnd(100);    /* initial capital */
  1444. X!     if (shp->shknms == shktools) {
  1445. X!         int who = rn2(SIZE(shktools) - 1);
  1446. X!         const char *shname = shp->shknms[who];
  1447. X!         if (shk->female = (*shname == '_')) shname++;
  1448. X!         (void) strncpy(ESHK(shk)->shknam, shname, PL_NSIZ);
  1449. X!         ESHK(shk)->shknam[PL_NSIZ-1] = 0;
  1450. X!     } else {
  1451. X!         shk->female = ledger_no(&u.uz)%2;
  1452. X!         findname(ESHK(shk)->shknam, shp->shknms);
  1453. X!     }
  1454. X  
  1455. X      return(sh);
  1456. X  }
  1457. X--- 387,393 ----
  1458. X      ESHK(shk)->following = 0;
  1459. X      ESHK(shk)->billct = 0;
  1460. X      shk->mgold = 1000L + 30L*(long)rnd(100);    /* initial capital */
  1461. X!     nameshk(shk, shp->shknms);
  1462. X  
  1463. X      return(sh);
  1464. X  }
  1465. X***************
  1466. X*** 427,433 ****
  1467. X       * monsters will sit on top of objects and not the other way around.
  1468. X       */
  1469. X  
  1470. X!     level.flags.has_shop = 1;
  1471. X  }
  1472. X  
  1473. X  #endif /* OVLB */
  1474. X--- 458,464 ----
  1475. X       * monsters will sit on top of objects and not the other way around.
  1476. X       */
  1477. X  
  1478. X!     level.flags.has_shop = TRUE;
  1479. X  }
  1480. X  
  1481. X  #endif /* OVLB */
  1482. X*** /tmp/da11378    Tue Jun  1 16:15:53 1993
  1483. X--- src/sit.c    Thu May 20 15:43:51 1993
  1484. X***************
  1485. X*** 1,4 ****
  1486. X! /*    SCCS Id: @(#)sit.c    3.1    92/10/24    */
  1487. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1488. X  /* NetHack may be freely redistributed.  See license for details. */
  1489. X  
  1490. X--- 1,4 ----
  1491. X! /*    SCCS Id: @(#)sit.c    3.1    93/05/19    */
  1492. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1493. X  /* NetHack may be freely redistributed.  See license for details. */
  1494. X  
  1495. X***************
  1496. X*** 36,42 ****
  1497. X          You("sit on %s.", the(xname(obj)));
  1498. X          if(!Is_box(obj)) pline("It's not very comfortable...");
  1499. X  
  1500. X!     } else if(trap = t_at(u.ux, u.uy)) {
  1501. X  
  1502. X          if (u.utrap) {
  1503. X          exercise(A_WIS, FALSE);    /* you're getting stuck longer */
  1504. X--- 36,42 ----
  1505. X          You("sit on %s.", the(xname(obj)));
  1506. X          if(!Is_box(obj)) pline("It's not very comfortable...");
  1507. X  
  1508. X!     } else if ((trap = t_at(u.ux, u.uy)) != 0) {
  1509. X  
  1510. X          if (u.utrap) {
  1511. X          exercise(A_WIS, FALSE);    /* you're getting stuck longer */
  1512. X***************
  1513. X*** 211,219 ****
  1514. X              You("are granted an insight!");
  1515. X              if (invent) {
  1516. X                  int ret, cval = rn2(5); /* agrees w/seffects() */
  1517. X                  do {
  1518. X                  ret = ggetobj("identify", identify, cval);
  1519. X!                 } while (cval && (cval -= ret));
  1520. X              }
  1521. X              break;
  1522. X              case 13:
  1523. X--- 211,221 ----
  1524. X              You("are granted an insight!");
  1525. X              if (invent) {
  1526. X                  int ret, cval = rn2(5); /* agrees w/seffects() */
  1527. X+                 /* use up `cval' "charges"; 0 is special case */
  1528. X                  do {
  1529. X                  ret = ggetobj("identify", identify, cval);
  1530. X!                 if (ret < 0) break;    /* quit */
  1531. X!                 } while (ret == 0 || (cval -= ret) > 0);
  1532. X              }
  1533. X              break;
  1534. X              case 13:
  1535. X***************
  1536. X*** 261,267 ****
  1537. X      } else if (u.uswallow)
  1538. X          pline("There are no seats in here!");
  1539. X      else
  1540. X!         pline("Having fun sitting on the floor?");
  1541. X      return(1);
  1542. X  }
  1543. X  
  1544. X--- 263,269 ----
  1545. X      } else if (u.uswallow)
  1546. X          pline("There are no seats in here!");
  1547. X      else
  1548. X!         pline("Having fun sitting on the %s?", surface(u.ux,u.uy));
  1549. X      return(1);
  1550. X  }
  1551. X  
  1552. X***************
  1553. X*** 271,280 ****
  1554. X      int    nobj = 0;
  1555. X      int    cnt, onum;
  1556. X      struct    obj    *otmp;
  1557. X  
  1558. X      if(Antimagic) {
  1559. X          shieldeff(u.ux, u.uy);
  1560. X!         You("feel a malignant aura surround you.");
  1561. X      }
  1562. X  
  1563. X      for (otmp = invent; otmp; otmp = otmp->nobj)  nobj++;
  1564. X--- 273,288 ----
  1565. X      int    nobj = 0;
  1566. X      int    cnt, onum;
  1567. X      struct    obj    *otmp;
  1568. X+     static const char *mal_aura = "feel a malignant aura surround %s.";
  1569. X  
  1570. X+     if (uwep && (uwep->oartifact == ART_MAGICBANE) && rn2(20)) {
  1571. X+         You(mal_aura, "the magic-absorbing blade");
  1572. X+         return;
  1573. X+     }
  1574. X+ 
  1575. X      if(Antimagic) {
  1576. X          shieldeff(u.ux, u.uy);
  1577. X!         You(mal_aura, "you");
  1578. X      }
  1579. X  
  1580. X      for (otmp = invent; otmp; otmp = otmp->nobj)  nobj++;
  1581. X*** /tmp/da11402    Tue Jun  1 16:16:01 1993
  1582. X--- src/spell.c    Mon May 17 14:05:10 1993
  1583. X***************
  1584. X*** 1,4 ****
  1585. X! /*    SCCS Id: @(#)spell.c    3.1    92/12/10
  1586. X  /*    Copyright (c) M. Stephenson 1988              */
  1587. X  /* NetHack may be freely redistributed.  See license for details. */
  1588. X  
  1589. X--- 1,4 ----
  1590. X! /*    SCCS Id: @(#)spell.c    3.1    93/05/15    */
  1591. X  /*    Copyright (c) M. Stephenson 1988              */
  1592. X  /* NetHack may be freely redistributed.  See license for details. */
  1593. X  
  1594. X***************
  1595. X*** 105,111 ****
  1596. X      }
  1597. X  
  1598. X      if(!u.uhave.bell || !u.uhave.menorah) {
  1599. X!         pline("A chill runs down your spine.");
  1600. X          if(!u.uhave.bell) You("hear a faint chime...");
  1601. X          if(!u.uhave.menorah) pline("Vlad's doppelganger is amused.");
  1602. X          return;
  1603. X--- 105,111 ----
  1604. X      }
  1605. X  
  1606. X      if(!u.uhave.bell || !u.uhave.menorah) {
  1607. X!         pline("A chill runs down your %s.", body_part(SPINE));
  1608. X          if(!u.uhave.bell) You("hear a faint chime...");
  1609. X          if(!u.uhave.menorah) pline("Vlad's doppelganger is amused.");
  1610. X          return;
  1611. X***************
  1612. X*** 149,155 ****
  1613. X      mm.y = u.uy;
  1614. X      mkundead(&mm);
  1615. X      if(!rn2(4))
  1616. X!         if(mtmp = makemon(&mons[PM_MASTER_LICH],u.ux,u.uy)) {
  1617. X          mtmp->mpeaceful = 0;
  1618. X          set_malign(mtmp);
  1619. X          }
  1620. X--- 149,155 ----
  1621. X      mm.y = u.uy;
  1622. X      mkundead(&mm);
  1623. X      if(!rn2(4))
  1624. X!         if ((mtmp = makemon(&mons[PM_MASTER_LICH],u.ux,u.uy)) != 0) {
  1625. X          mtmp->mpeaceful = 0;
  1626. X          set_malign(mtmp);
  1627. X          }
  1628. X***************
  1629. X*** 494,499 ****
  1630. X--- 494,501 ----
  1631. X      case SPE_FINGER_OF_DEATH:
  1632. X      case SPE_LIGHT:
  1633. X      case SPE_DETECT_UNSEEN:
  1634. X+     case SPE_HEALING:
  1635. X+     case SPE_EXTRA_HEALING:
  1636. X          if (!(objects[pseudo->otyp].oc_dir == NODIR)) {
  1637. X              if (atme) u.dx = u.dy = u.dz = 0;
  1638. X              else (void) getdir(NULL);
  1639. X***************
  1640. X*** 524,533 ****
  1641. X      case SPE_INVISIBILITY:
  1642. X          (void) peffects(pseudo);
  1643. X          break;
  1644. X-     case SPE_HEALING:
  1645. X-         You("feel a bit better.");
  1646. X-         healup(rnd(8), 0, FALSE, FALSE);
  1647. X-         break;
  1648. X      case SPE_CURE_BLINDNESS:
  1649. X          healup(0, 0, FALSE, TRUE);
  1650. X          break;
  1651. X--- 526,531 ----
  1652. X***************
  1653. X*** 534,543 ****
  1654. X      case SPE_CURE_SICKNESS:
  1655. X          if (Sick) You("are no longer ill.");
  1656. X          healup(0, 0, TRUE, FALSE);
  1657. X-         break;
  1658. X-     case SPE_EXTRA_HEALING:
  1659. X-         You("feel a fair bit better.");
  1660. X-         healup(d(2,8)+2, 0, FALSE, FALSE);
  1661. X          break;
  1662. X      case SPE_CREATE_FAMILIAR:
  1663. X          make_familiar((struct obj *)0, u.ux, u.uy);
  1664. X--- 532,537 ----
  1665. X*** /tmp/da11410    Tue Jun  1 16:16:03 1993
  1666. X--- src/steal.c    Tue Jun  1 11:58:39 1993
  1667. X***************
  1668. X*** 1,4 ****
  1669. X! /*    SCCS Id: @(#)steal.c    3.1    92/10/14    */
  1670. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1671. X  /* NetHack may be freely redistributed.  See license for details. */
  1672. X  
  1673. X--- 1,4 ----
  1674. X! /*    SCCS Id: @(#)steal.c    3.1    93/05/30    */
  1675. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1676. X  /* NetHack may be freely redistributed.  See license for details. */
  1677. X  
  1678. X***************
  1679. X*** 11,20 ****
  1680. X  
  1681. X  static const char *
  1682. X  equipname(otmp)
  1683. X! 
  1684. X!     register struct obj *otmp;
  1685. X  {
  1686. X- 
  1687. X      return (
  1688. X  #ifdef TOURIST
  1689. X          (otmp == uarmu) ? "shirt" :
  1690. X--- 11,18 ----
  1691. X  
  1692. X  static const char *
  1693. X  equipname(otmp)
  1694. X! register struct obj *otmp;
  1695. X  {
  1696. X      return (
  1697. X  #ifdef TOURIST
  1698. X          (otmp == uarmu) ? "shirt" :
  1699. X***************
  1700. X*** 27,33 ****
  1701. X  }
  1702. X  
  1703. X  long        /* actually returns something that fits in an int */
  1704. X! somegold(){
  1705. X  #ifdef LINT    /* long conv. ok */
  1706. X      return(0L);
  1707. X  #else
  1708. X--- 25,32 ----
  1709. X  }
  1710. X  
  1711. X  long        /* actually returns something that fits in an int */
  1712. X! somegold()
  1713. X! {
  1714. X  #ifdef LINT    /* long conv. ok */
  1715. X      return(0L);
  1716. X  #else
  1717. X***************
  1718. X*** 50,56 ****
  1719. X          pline("%s quickly snatches some gold from between your %s!",
  1720. X              Monnam(mtmp), makeplural(body_part(FOOT)));
  1721. X          if(!u.ugold || !rn2(5)) {
  1722. X!         rloc(mtmp);
  1723. X          mtmp->mflee = 1;
  1724. X          }
  1725. X      } else if(u.ugold) {
  1726. X--- 49,55 ----
  1727. X          pline("%s quickly snatches some gold from between your %s!",
  1728. X              Monnam(mtmp), makeplural(body_part(FOOT)));
  1729. X          if(!u.ugold || !rn2(5)) {
  1730. X!         if (!tele_restrict(mtmp)) rloc(mtmp);
  1731. X          mtmp->mflee = 1;
  1732. X          }
  1733. X      } else if(u.ugold) {
  1734. X***************
  1735. X*** 57,63 ****
  1736. X          u.ugold -= (tmp = somegold());
  1737. X          Your("purse feels lighter.");
  1738. X          mtmp->mgold += tmp;
  1739. X!         rloc(mtmp);
  1740. X          mtmp->mflee = 1;
  1741. X          flags.botl = 1;
  1742. X      }
  1743. X--- 56,62 ----
  1744. X          u.ugold -= (tmp = somegold());
  1745. X          Your("purse feels lighter.");
  1746. X          mtmp->mgold += tmp;
  1747. X!         if (!tele_restrict(mtmp)) rloc(mtmp);
  1748. X          mtmp->mflee = 1;
  1749. X          flags.botl = 1;
  1750. X      }
  1751. X***************
  1752. X*** 68,74 ****
  1753. X  unsigned int stealmid;        /* monster doing the stealing */
  1754. X  
  1755. X  STATIC_OVL int
  1756. X! stealarm(){
  1757. X      register struct monst *mtmp;
  1758. X      register struct obj *otmp;
  1759. X  
  1760. X--- 67,74 ----
  1761. X  unsigned int stealmid;        /* monster doing the stealing */
  1762. X  
  1763. X  STATIC_OVL int
  1764. X! stealarm()
  1765. X! {
  1766. X      register struct monst *mtmp;
  1767. X      register struct obj *otmp;
  1768. X  
  1769. X***************
  1770. X*** 82,88 ****
  1771. X            pline("%s steals %s!", Monnam(mtmp), doname(otmp));
  1772. X            mpickobj(mtmp,otmp);
  1773. X            mtmp->mflee = 1;
  1774. X!           rloc(mtmp);
  1775. X          break;
  1776. X            }
  1777. X          break;
  1778. X--- 82,88 ----
  1779. X            pline("%s steals %s!", Monnam(mtmp), doname(otmp));
  1780. X            mpickobj(mtmp,otmp);
  1781. X            mtmp->mflee = 1;
  1782. X!           if (!tele_restrict(mtmp)) rloc(mtmp);
  1783. X          break;
  1784. X            }
  1785. X          break;
  1786. X***************
  1787. X*** 263,270 ****
  1788. X--- 263,275 ----
  1789. X  register struct monst *mtmp;
  1790. X  register struct obj *otmp;
  1791. X  {
  1792. X+     if (otmp->otyp == GOLD_PIECE) {    /* from floor etc. -- not inventory */
  1793. X+     mtmp->mgold += otmp->quan;
  1794. X+     obfree(otmp, (struct obj *)0);
  1795. X+     } else {
  1796. X      otmp->nobj = mtmp->minvent;
  1797. X      mtmp->minvent = otmp;
  1798. X+     }
  1799. X  }
  1800. X  
  1801. X  #endif /* OVL1 */
  1802. X***************
  1803. X*** 278,288 ****
  1804. X      register int    real, fake;
  1805. X  
  1806. X      /* select the artifact to steal */
  1807. X!         if(u.uhave.amulet) {
  1808. X          real = AMULET_OF_YENDOR ;
  1809. X          fake = FAKE_AMULET_OF_YENDOR ;
  1810. X  #ifdef MULDGN
  1811. X      } else if(u.uhave.questart) {
  1812. X          for(otmp = invent; otmp; otmp = otmp->nobj)
  1813. X              if(is_quest_artifact(otmp)) goto snatch_it;
  1814. X  #endif
  1815. X--- 283,294 ----
  1816. X      register int    real, fake;
  1817. X  
  1818. X      /* select the artifact to steal */
  1819. X!     if(u.uhave.amulet) {
  1820. X          real = AMULET_OF_YENDOR ;
  1821. X          fake = FAKE_AMULET_OF_YENDOR ;
  1822. X  #ifdef MULDGN
  1823. X      } else if(u.uhave.questart) {
  1824. X+         real = fake = 0;        /* gcc -Wall lint */
  1825. X          for(otmp = invent; otmp; otmp = otmp->nobj)
  1826. X              if(is_quest_artifact(otmp)) goto snatch_it;
  1827. X  #endif
  1828. X***************
  1829. X*** 302,312 ****
  1830. X          if(otmp->otyp == real || (otmp->otyp == fake && !mtmp->iswiz)) {
  1831. X          /* might be an imitation one */
  1832. X  snatch_it:
  1833. X          setnotworn(otmp);
  1834. X          freeinv(otmp);
  1835. X          mpickobj(mtmp,otmp);
  1836. X          pline("%s stole %s!", Monnam(mtmp), doname(otmp));
  1837. X!         if (can_teleport(mtmp->data)) rloc(mtmp);
  1838. X          return;
  1839. X          }
  1840. X      }
  1841. X--- 308,322 ----
  1842. X          if(otmp->otyp == real || (otmp->otyp == fake && !mtmp->iswiz)) {
  1843. X          /* might be an imitation one */
  1844. X  snatch_it:
  1845. X+ #ifdef MULDGN
  1846. X+         if (otmp->oclass == ARMOR_CLASS) adj_abon(otmp, -(otmp->spe));
  1847. X+ #endif
  1848. X          setnotworn(otmp);
  1849. X          freeinv(otmp);
  1850. X          mpickobj(mtmp,otmp);
  1851. X          pline("%s stole %s!", Monnam(mtmp), doname(otmp));
  1852. X!         if (can_teleport(mtmp->data) && !tele_restrict(mtmp))
  1853. X!             rloc(mtmp);
  1854. X          return;
  1855. X          }
  1856. X      }
  1857. X***************
  1858. X*** 315,353 ****
  1859. X  #endif /* OVLB */
  1860. X  #ifdef OVL0
  1861. X  
  1862. X! /* release the objects the killed animal was carrying */
  1863. X  void
  1864. X  relobj(mtmp,show,is_pet)
  1865. X  register struct monst *mtmp;
  1866. X  register int show;
  1867. X! boolean is_pet;        /* If true, pet should keep wielded weapon */
  1868. X  {
  1869. X      register struct obj *otmp, *otmp2;
  1870. X      register int omx = mtmp->mx, omy = mtmp->my;
  1871. X- 
  1872. X  #ifdef MUSE
  1873. X!     otmp2 = otmp = 0;
  1874. X!     if (is_pet) {
  1875. X!         sort_mwep(mtmp);
  1876. X!         if ((otmp2 = MON_WEP(mtmp))) {
  1877. X!             otmp = otmp2->nobj;
  1878. X!             otmp2->nobj = 0;
  1879. X!         }
  1880. X!     }
  1881. X!     if (!otmp2)
  1882. X  #endif
  1883. X-     {    otmp = mtmp->minvent;
  1884. X-         mtmp->minvent = 0;
  1885. X-     }
  1886. X  
  1887. X      for (; otmp; otmp = otmp2) {
  1888. X  #ifdef MUSE
  1889. X!         if (otmp->owornmask) {
  1890. X              mtmp->misc_worn_check &= ~(otmp->owornmask);
  1891. X              otmp->owornmask = 0L;
  1892. X          }
  1893. X  #endif
  1894. X-         otmp2 = otmp->nobj;
  1895. X          if (is_pet && cansee(omx, omy) && flags.verbose)
  1896. X              pline("%s drops %s.", Monnam(mtmp),
  1897. X                      distant_name(otmp, doname));
  1898. X--- 325,364 ----
  1899. X  #endif /* OVLB */
  1900. X  #ifdef OVL0
  1901. X  
  1902. X! /* release the objects the creature is carrying */
  1903. X  void
  1904. X  relobj(mtmp,show,is_pet)
  1905. X  register struct monst *mtmp;
  1906. X  register int show;
  1907. X! boolean is_pet;        /* If true, pet should keep wielded/worn items */
  1908. X  {
  1909. X      register struct obj *otmp, *otmp2;
  1910. X      register int omx = mtmp->mx, omy = mtmp->my;
  1911. X  #ifdef MUSE
  1912. X!     struct obj *backobj = 0;
  1913. X!     struct obj *wep = MON_WEP(mtmp);
  1914. X  #endif
  1915. X  
  1916. X+     otmp = mtmp->minvent;
  1917. X+     mtmp->minvent = 0;
  1918. X      for (; otmp; otmp = otmp2) {
  1919. X+         otmp2 = otmp->nobj;
  1920. X  #ifdef MUSE
  1921. X!         if (otmp->owornmask || otmp == wep) {
  1922. X!             if (is_pet) { /* skip worn/wielded item */
  1923. X!                 if (!backobj) {
  1924. X!                     mtmp->minvent = backobj = otmp;
  1925. X!                 } else {
  1926. X!                     backobj->nobj = otmp;
  1927. X!                     backobj = backobj->nobj;
  1928. X!                 }
  1929. X!                 continue;
  1930. X!             }
  1931. X              mtmp->misc_worn_check &= ~(otmp->owornmask);
  1932. X              otmp->owornmask = 0L;
  1933. X          }
  1934. X+         if (backobj) backobj->nobj = otmp->nobj;
  1935. X  #endif
  1936. X          if (is_pet && cansee(omx, omy) && flags.verbose)
  1937. X              pline("%s drops %s.", Monnam(mtmp),
  1938. X                      distant_name(otmp, doname));
  1939. X*** /tmp/da11418    Tue Jun  1 16:16:06 1993
  1940. X--- src/timeout.c    Wed Mar 31 14:20:11 1993
  1941. X***************
  1942. X*** 1,4 ****
  1943. X! /*    SCCS Id: @(#)timeout.c    3.1    92/11/01    */
  1944. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1945. X  /* NetHack may be freely redistributed.  See license for details. */
  1946. X  
  1947. X--- 1,4 ----
  1948. X! /*    SCCS Id: @(#)timeout.c    3.1    93/03/30    */
  1949. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1950. X  /* NetHack may be freely redistributed.  See license for details. */
  1951. X  
  1952. X***************
  1953. X*** 164,172 ****
  1954. X              break;
  1955. X          case INVIS:
  1956. X              newsym(u.ux,u.uy);
  1957. X!             if (!Invis && !See_invisible && !Blind)
  1958. X                  You("are no longer invisible.");
  1959. X!             stop_occupation();
  1960. X              break;
  1961. X          case SEE_INVIS:
  1962. X              set_mimic_blocking(); /* do special mimic handling */
  1963. X--- 164,173 ----
  1964. X              break;
  1965. X          case INVIS:
  1966. X              newsym(u.ux,u.uy);
  1967. X!             if (!Invis && !See_invisible && !Blind) {
  1968. X                  You("are no longer invisible.");
  1969. X!                 stop_occupation();
  1970. X!             }
  1971. X              break;
  1972. X          case SEE_INVIS:
  1973. X              set_mimic_blocking(); /* do special mimic handling */
  1974. X***************
  1975. X*** 213,219 ****
  1976. X                  switch (rn2(4)) {
  1977. X                      case 1:
  1978. X                      if (ACCESSIBLE(levl[u.ux][u.uy].typ)) { /* not POOL or STONE */
  1979. X!                         if (Hallucination) pline("A rock bites your foot.");
  1980. X                          else You("trip over a rock.");
  1981. X                          break;
  1982. X                      }
  1983. X--- 214,220 ----
  1984. X                  switch (rn2(4)) {
  1985. X                      case 1:
  1986. X                      if (ACCESSIBLE(levl[u.ux][u.uy].typ)) { /* not POOL or STONE */
  1987. X!                         if (Hallucination) pline("A rock bites your %s.", body_part(FOOT));
  1988. X                          else You("trip over a rock.");
  1989. X                          break;
  1990. X                      }
  1991. X***************
  1992. X*** 271,277 ****
  1993. X              locomotion(mtmp->data, "drop"));
  1994. X          else
  1995. X              You("see %s %s out of your pack!",
  1996. X!             an(mtmp->data->mname),
  1997. X              locomotion(mtmp->data, "drop"));
  1998. X  
  1999. X  #ifdef POLYSELF
  2000. X--- 272,278 ----
  2001. X              locomotion(mtmp->data, "drop"));
  2002. X          else
  2003. X              You("see %s %s out of your pack!",
  2004. X!             a_monnam(mtmp),
  2005. X              locomotion(mtmp->data, "drop"));
  2006. X  
  2007. X  #ifdef POLYSELF
  2008. X***************
  2009. X*** 280,289 ****
  2010. X  
  2011. X              pline("Its cries sound like \"%s.\"",
  2012. X              flags.female ? "mommy" : "daddy");
  2013. X!             if (mtmp2 = tamedog(mtmp, (struct obj *)0))
  2014. X              mtmp = mtmp2;
  2015. X              mtmp->mtame = 20;
  2016. X!             while(otmp = (mtmp->minvent)) {
  2017. X              mtmp->minvent = otmp->nobj;
  2018. X              dealloc_obj(otmp);
  2019. X              }
  2020. X--- 281,290 ----
  2021. X  
  2022. X              pline("Its cries sound like \"%s.\"",
  2023. X              flags.female ? "mommy" : "daddy");
  2024. X!             if ((mtmp2 = tamedog(mtmp, (struct obj *)0)) != 0)
  2025. X              mtmp = mtmp2;
  2026. X              mtmp->mtame = 20;
  2027. X!             while ((otmp = (mtmp->minvent)) != 0) {
  2028. X              mtmp->minvent = otmp->nobj;
  2029. X              dealloc_obj(otmp);
  2030. X              }
  2031. X***************
  2032. X*** 294,302 ****
  2033. X              struct monst *mtmp2;
  2034. X  
  2035. X              verbalize("Gleep!");        /* Mything eggs :-) */
  2036. X!             if (mtmp2 = tamedog(mtmp, (struct obj *)0))
  2037. X              mtmp = mtmp2;
  2038. X!             while(otmp = (mtmp->minvent)) {
  2039. X              mtmp->minvent = otmp->nobj;
  2040. X              dealloc_obj(otmp);
  2041. X              }
  2042. X--- 295,303 ----
  2043. X              struct monst *mtmp2;
  2044. X  
  2045. X              verbalize("Gleep!");        /* Mything eggs :-) */
  2046. X!             if ((mtmp2 = tamedog(mtmp, (struct obj *)0)) != 0)
  2047. X              mtmp = mtmp2;
  2048. X!             while ((otmp = (mtmp->minvent)) != 0) {
  2049. X              mtmp->minvent = otmp->nobj;
  2050. X              dealloc_obj(otmp);
  2051. X              }
  2052. X***************
  2053. X*** 316,322 ****
  2054. X      for(otmp = invent; otmp; otmp = otmp2) {
  2055. X          otmp2 = otmp->nobj;        /* otmp may hatch */
  2056. X          if(otmp->otyp == EGG && otmp->corpsenm >= 0) hatch_it(otmp);
  2057. X!         /* else if (Is_container(otmp) && otmp->cobj) ...        */
  2058. X          /*                                */
  2059. X          /* Check for container here and hatch with the container.    */
  2060. X          /* One of these days...                    */
  2061. X--- 317,323 ----
  2062. X      for(otmp = invent; otmp; otmp = otmp2) {
  2063. X          otmp2 = otmp->nobj;        /* otmp may hatch */
  2064. X          if(otmp->otyp == EGG && otmp->corpsenm >= 0) hatch_it(otmp);
  2065. X!         /* else if (Has_contents(otmp)) ...                */
  2066. X          /*                                */
  2067. X          /* Check for container here and hatch with the container.    */
  2068. X          /* One of these days...                    */
  2069. END_OF_FILE
  2070. if test 55125 -ne `wc -c <'patches02h'`; then
  2071.     echo shar: \"'patches02h'\" unpacked with wrong size!
  2072. fi
  2073. # end of 'patches02h'
  2074. echo shar: End of archive 11 \(of 33\).
  2075. cp /dev/null ark11isdone
  2076. MISSING=""
  2077. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
  2078.     if test ! -f ark${I}isdone ; then
  2079.     MISSING="${MISSING} ${I}"
  2080.     fi
  2081. done
  2082. if test "${MISSING}" = "" ; then
  2083.     echo You have unpacked all 33 archives.
  2084.     echo "Now execute ./patchit.sh"
  2085.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2086. else
  2087.     echo You still need to unpack the following archives:
  2088.     echo "        " ${MISSING}
  2089. fi
  2090. ##  End of shell archive.
  2091. exit 0
  2092.