home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch4b < prev    next >
Encoding:
Internet Message Format  |  1989-10-02  |  56.0 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i038:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch4b
  5. Message-ID: <4628@tekred.CNA.TEK.COM>
  6. Date: 29 Sep 89 21:08:19 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 2131
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 8, Issue 38
  13. Archive-name: NetHack3/Patch4b
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 2 (of 11)."
  23. # Contents:  patches04b
  24. # Wrapped by billr@saab on Fri Sep 29 13:13:32 1989
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'patches04b' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'patches04b'\"
  28. else
  29. echo shar: Extracting \"'patches04b'\" \(53375 characters\)
  30. sed "s/^X//" >'patches04b' <<'END_OF_FILE'
  31. X*** src/Old/end.c    Wed Sep 27 11:25:17 1989
  32. X--- src/end.c    Tue Sep 26 17:47:43 1989
  33. X***************
  34. X*** 4,9 ****
  35. X--- 4,11 ----
  36. X  
  37. X  /* block some unused #defines to avoid overloading some cpp's */
  38. X  #define MONATTK_H
  39. X+ #define NEED_VARARGS
  40. X+ 
  41. X  #include "hack.h"
  42. X  #ifndef NO_SIGNAL
  43. X  #include <signal.h>
  44. X***************
  45. X*** 56,66 ****
  46. X          curs_on_u();
  47. X          (void) fflush(stdout);
  48. X          if(multi > 0) nomul(0);
  49. X          return 0;
  50. X      }
  51. X! #if defined(WIZARD) && defined(UNIX)
  52. X      if(wizard) {
  53. X          pline("Dump core? ");
  54. X          if(yn() == 'y') {
  55. X          (void) signal(SIGINT, (SIG_RET_TYPE) done1);
  56. X          settty(NULL);
  57. X--- 58,73 ----
  58. X          curs_on_u();
  59. X          (void) fflush(stdout);
  60. X          if(multi > 0) nomul(0);
  61. X+         multi = 0;
  62. X          return 0;
  63. X      }
  64. X! #if defined(WIZARD) && (defined(UNIX) || defined(VMS))
  65. X      if(wizard) {
  66. X+ #ifdef VMS
  67. X+         pline("Enter debugger? ");
  68. X+ #else
  69. X          pline("Dump core? ");
  70. X+ #endif
  71. X          if(yn() == 'y') {
  72. X          (void) signal(SIGINT, (SIG_RET_TYPE) done1);
  73. X          settty(NULL);
  74. X***************
  75. X*** 83,89 ****
  76. X      done_stopprint++;
  77. X  #ifndef NO_SIGNAL
  78. X      (void) signal(SIGINT, SIG_IGN);
  79. X! #ifdef UNIX
  80. X      (void) signal(SIGQUIT, SIG_IGN);
  81. X  #endif
  82. X  #endif /* TOS /* */
  83. X--- 90,96 ----
  84. X      done_stopprint++;
  85. X  #ifndef NO_SIGNAL
  86. X      (void) signal(SIGINT, SIG_IGN);
  87. X! #if defined(UNIX) || defined(VMS)
  88. X      (void) signal(SIGQUIT, SIG_IGN);
  89. X  #endif
  90. X  #endif /* TOS /* */
  91. X***************
  92. X*** 90,96 ****
  93. X      return 0;
  94. X  }
  95. X  
  96. X! #ifdef UNIX
  97. X  static
  98. X  int
  99. X  done_hangup(){
  100. X--- 97,103 ----
  101. X      return 0;
  102. X  }
  103. X  
  104. X! #if defined(UNIX) || defined(VMS)
  105. X  static
  106. X  int
  107. X  done_hangup(){
  108. X***************
  109. X*** 148,156 ****
  110. X  extern boolean hu;    /* from save.c */
  111. X  
  112. X  void
  113. X! panic(str,a1,a2,a3,a4,a5,a6)
  114. X! char *str;
  115. X! {
  116. X      if(panicking++)
  117. X  #ifdef SYSV
  118. X          (void)
  119. X--- 155,163 ----
  120. X  extern boolean hu;    /* from save.c */
  121. X  
  122. X  void
  123. X! panic VA_DECL(char *, str)
  124. X!     VA_START(str);
  125. X!     VA_INIT(str, char *);
  126. X      if(panicking++)
  127. X  #ifdef SYSV
  128. X          (void)
  129. X***************
  130. X*** 159,187 ****
  131. X                      /* was exit(1) */
  132. X      home(); cls();
  133. X      (void) puts(" Suddenly, the dungeon collapses.");
  134. X! #ifdef WIZARD
  135. X! # ifndef MSDOS
  136. X      if(!wizard) {
  137. X          pline("Report error to %s and it may be possible to rebuild.",WIZARD);
  138. X          more();
  139. X      }
  140. X!     Sprintf (SAVEF, "%s.e", SAVEF);
  141. X      hu = FALSE;
  142. X      (void) dosave0();
  143. X- # endif
  144. X  #endif
  145. X      (void) fputs(" ERROR:  ", stdout);
  146. X!     Printf(str,a1,a2,a3,a4,a5,a6);
  147. X      more();                /* contains a fflush() */
  148. X! #ifdef WIZARD
  149. X! # ifdef UNIX
  150. X      if (wizard)    
  151. X! #  ifdef SYSV
  152. X          (void)
  153. X- #  endif
  154. X-             abort();    /* generate core dump */
  155. X  # endif
  156. X  #endif
  157. X      done(PANICKED);
  158. X  }
  159. X  
  160. X--- 166,201 ----
  161. X                      /* was exit(1) */
  162. X      home(); cls();
  163. X      (void) puts(" Suddenly, the dungeon collapses.");
  164. X! #if defined(WIZARD) && !defined(MSDOS)
  165. X      if(!wizard) {
  166. X          pline("Report error to %s and it may be possible to rebuild.",WIZARD);
  167. X          more();
  168. X      }
  169. X! #ifdef VMS
  170. X!     {
  171. X!         char *sem = rindex(SAVEF, ';');
  172. X! 
  173. X!         if (sem)
  174. X!             *sem = '\0';
  175. X!     }
  176. X!     Strcat(SAVEF, ".e;1");
  177. X! #else
  178. X!     Strcat(SAVEF, ".e");
  179. X! #endif
  180. X      hu = FALSE;
  181. X      (void) dosave0();
  182. X  #endif
  183. X      (void) fputs(" ERROR:  ", stdout);
  184. X!     Vprintf(str,VA_ARGS);
  185. X      more();                /* contains a fflush() */
  186. X! #if defined(WIZARD) && (defined(UNIX) || defined(VMS))
  187. X      if (wizard)    
  188. X! # ifdef SYSV
  189. X          (void)
  190. X  # endif
  191. X+             abort();    /* generate core dump */
  192. X  #endif
  193. X+     VA_END();
  194. X      done(PANICKED);
  195. X  }
  196. X  
  197. X***************
  198. X*** 257,263 ****
  199. X  die:
  200. X  #ifndef NO_SIGNAL
  201. X      (void) signal(SIGINT, (SIG_RET_TYPE) done_intr);
  202. X! #ifdef UNIX
  203. X      (void) signal(SIGQUIT, (SIG_RET_TYPE) done_intr);
  204. X      (void) signal(SIGHUP, (SIG_RET_TYPE) done_hangup);
  205. X  #endif
  206. X--- 271,277 ----
  207. X  die:
  208. X  #ifndef NO_SIGNAL
  209. X      (void) signal(SIGINT, (SIG_RET_TYPE) done_intr);
  210. X! #if defined(UNIX) || defined(VMS)
  211. X      (void) signal(SIGQUIT, (SIG_RET_TYPE) done_intr);
  212. X      (void) signal(SIGHUP, (SIG_RET_TYPE) done_hangup);
  213. X  #endif
  214. X***************
  215. X*** 406,412 ****
  216. X                      continue;
  217. X                  }
  218. X                  u.urexp += i;
  219. X!                 Printf("        %s (worth %ld Zorkmids),\n",
  220. X                      doname(otmp), i);
  221. X              } else if(otmp->olet == AMULET_SYM) {
  222. X                  otmp->known = 1;
  223. X--- 420,426 ----
  224. X                      continue;
  225. X                  }
  226. X                  u.urexp += i;
  227. X!                 Printf("        %s (worth %ld zorkmids),\n",
  228. X                      doname(otmp), i);
  229. X              } else if(otmp->olet == AMULET_SYM) {
  230. X                  otmp->known = 1;
  231. X***************
  232. X*** 414,420 ****
  233. X                      otmp->otyp == AMULET_OF_YENDOR ?
  234. X                              5000 : 500;
  235. X                  u.urexp += i;
  236. X!                 Printf("        %s (worth %ld Zorkmids),\n",
  237. X                      doname(otmp), i);
  238. X              }
  239. X          }
  240. X--- 428,434 ----
  241. X                      otmp->otyp == AMULET_OF_YENDOR ?
  242. X                              5000 : 500;
  243. X                  u.urexp += i;
  244. X!                 Printf("        %s (worth %ld zorkmids),\n",
  245. X                      doname(otmp), i);
  246. X              }
  247. X          }
  248. X***************
  249. X*** 467,475 ****
  250. X      if (ramdisk)
  251. X          eraseall(permbones, alllevels);
  252. X  #else
  253. X! #if defined(UNIX) || (defined(MSDOS) && !defined(OLD_TOS))
  254. X      register int x;
  255. X! #ifdef UNIX
  256. X      (void) signal(SIGHUP,SIG_IGN);
  257. X  #endif
  258. X      for(x = maxdlevel; x >= 0; x--) {
  259. X--- 481,489 ----
  260. X      if (ramdisk)
  261. X          eraseall(permbones, alllevels);
  262. X  #else
  263. X! #if defined(UNIX) || (defined(MSDOS) && !defined(OLD_TOS)) || defined(VMS)
  264. X      register int x;
  265. X! #if defined(UNIX) || defined(VMS)
  266. X      (void) signal(SIGHUP,SIG_IGN);
  267. X  #endif
  268. X      for(x = maxdlevel; x >= 0; x--) {
  269. X***************
  270. X*** 486,492 ****
  271. X--- 500,508 ----
  272. X  {
  273. X      (void) signal(SIGINT, SIG_IGN);
  274. X      clearlocks();
  275. X+ # ifndef VMS
  276. X      exit(1);
  277. X+ # endif
  278. X  }
  279. X  #endif
  280. X  
  281. X***************
  282. X*** 494,499 ****
  283. X--- 510,516 ----
  284. X  end_box_display()
  285. X  {
  286. X      register struct obj *box, *obj;
  287. X+     int boxcnt = 0;
  288. X      char buf[BUFSZ];
  289. X  
  290. X      for(box=invent; box; box=box->nobj) {
  291. X***************
  292. X*** 504,510 ****
  293. X              if (obj->cobj == box) {
  294. X              if (!cnt) {
  295. X                  Sprintf(buf, "Contents of the %s:",xname(box));
  296. X!                 cornline(0, buf);
  297. X              }
  298. X              makeknown(obj->otyp);
  299. X              obj->known = obj->bknown = obj->dknown = 1;
  300. X--- 521,530 ----
  301. X              if (obj->cobj == box) {
  302. X              if (!cnt) {
  303. X                  Sprintf(buf, "Contents of the %s:",xname(box));
  304. X!                 if (!boxcnt)
  305. X!                 cornline(0, buf);
  306. X!                 else
  307. X!                 cornline(1, buf);
  308. X              }
  309. X              makeknown(obj->otyp);
  310. X              obj->known = obj->bknown = obj->dknown = 1;
  311. X***************
  312. X*** 512,519 ****
  313. X              cnt++;
  314. X              }
  315. X          }
  316. X!         if (!cnt) pline("The %s is empty.", xname(box));
  317. X!         else cornline(2,"");
  318. X          }
  319. X      }
  320. X  }
  321. X--- 532,547 ----
  322. X              cnt++;
  323. X              }
  324. X          }
  325. X!         if (!cnt) {
  326. X!             Sprintf(buf, "The %s is empty.", xname(box));
  327. X!             if (!boxcnt)
  328. X!             cornline(0, buf);
  329. X!             else
  330. X!             cornline(1, buf);
  331. X!         } else
  332. X!             cornline(1," ");
  333. X!         boxcnt++;
  334. X          }
  335. X      }
  336. X+     if (boxcnt) cornline(2,"");
  337. X  }
  338. X*** src/Old/engrave.c    Wed Sep 27 11:25:51 1989
  339. X--- src/engrave.c    Sun Sep 24 19:41:27 1989
  340. X***************
  341. X*** 320,325 ****
  342. X--- 320,334 ----
  343. X                  type = DUST;
  344. X              }
  345. X          }
  346. X+         if (otmp->spe < 0 && type != POLY) {
  347. X+ dust:
  348. X+             /* If POLY, polymorph the writing and _then_ become dust. */
  349. X+             pline("The %s %sturns to dust.",
  350. X+                xname(otmp), Blind ? "" : "glows violently, then ");
  351. X+     You("are not going to get anywhere writing in the dust with your dust...");
  352. X+             useup(otmp);
  353. X+             return(1);
  354. X+         }
  355. X          if(type == DUST)
  356. X              You("write in the dust with %s.",
  357. X                 doname(otmp));
  358. X***************
  359. X*** 362,368 ****
  360. X            del_engr(oep);
  361. X            oep = 0;
  362. X      }
  363. X!     if(type == DUST && oep) {
  364. X          You("cannot wipe out the message that is %s in the rock.",
  365. X            (oep->engr_type == BURN) ? "burned" :
  366. X            (oep->engr_type == ENGRAVE) ? "engraved" : "scribbled");
  367. X--- 371,377 ----
  368. X            del_engr(oep);
  369. X            oep = 0;
  370. X      }
  371. X!     if(oep) {
  372. X          You("cannot wipe out the message that is %s in the rock.",
  373. X            (oep->engr_type == BURN) ? "burned" :
  374. X            (oep->engr_type == ENGRAVE) ? "engraved" : "scribbled");
  375. X***************
  376. X*** 518,524 ****
  377. X      case WAN_STRIKING:
  378. X          pline("The %s unsuccessfully fights your attempt to write!",xname(otmp));
  379. X      }
  380. X! 
  381. X      return(1);
  382. X  }
  383. X  
  384. X--- 527,533 ----
  385. X      case WAN_STRIKING:
  386. X          pline("The %s unsuccessfully fights your attempt to write!",xname(otmp));
  387. X      }
  388. X!     if (otmp->otyp == WAN_POLYMORPH && otmp->spe < 0) goto dust;
  389. X      return(1);
  390. X  }
  391. X  
  392. X*** src/Old/fountain.c    Wed Sep 27 11:27:12 1989
  393. X--- src/fountain.c    Mon Sep 25 21:34:53 1989
  394. X***************
  395. X*** 11,19 ****
  396. X  void
  397. X  dowatersnakes() /* Fountain of snakes! */ {
  398. X      register int num = rnd(6);
  399. X!     if (!(mons[PM_WATER_MOCCASIN].geno & G_GENOD)) {    /* && chgd to &*/
  400. X! 
  401. X!         pline("Good Lord!  An endless stream of snakes pours forth!");
  402. X          while(num-- > 0) (void) makemon(&mons[PM_WATER_MOCCASIN],u.ux,u.uy);
  403. X      } else
  404. X          pline("The fountain bubbles furiously for a moment, then calms.");
  405. X--- 11,18 ----
  406. X  void
  407. X  dowatersnakes() /* Fountain of snakes! */ {
  408. X      register int num = rnd(6);
  409. X!     if (!(mons[PM_WATER_MOCCASIN].geno & G_GENOD)) {
  410. X!         pline("An endless stream of snakes pours forth!");
  411. X          while(num-- > 0) (void) makemon(&mons[PM_WATER_MOCCASIN],u.ux,u.uy);
  412. X      } else
  413. X          pline("The fountain bubbles furiously for a moment, then calms.");
  414. X***************
  415. X*** 105,111 ****
  416. X  
  417. X  void
  418. X  dryup(){
  419. X!     if (!rn2(3) && (levl[u.ux][u.uy].typ == FOUNTAIN)) {
  420. X          pline("The fountain dries up!");
  421. X          levl[u.ux][u.uy].typ = ROOM;
  422. X          levl[u.ux][u.uy].doormask = 0;
  423. X--- 104,110 ----
  424. X  
  425. X  void
  426. X  dryup(){
  427. X!     if (!rn2(3) && IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
  428. X          pline("The fountain dries up!");
  429. X          levl[u.ux][u.uy].typ = ROOM;
  430. X          levl[u.ux][u.uy].doormask = 0;
  431. X*** src/Old/getline.c    Wed Sep 27 11:27:39 1989
  432. X--- src/getline.c    Sat Sep 23 00:47:46 1989
  433. X***************
  434. X*** 9,15 ****
  435. X   * Some systems may have getchar() return EOF for various reasons, and
  436. X   * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs.
  437. X   */
  438. X! #ifdef SYSV
  439. X  #define    NR_OF_EOFS    20
  440. X  #endif
  441. X  
  442. X--- 9,15 ----
  443. X   * Some systems may have getchar() return EOF for various reasons, and
  444. X   * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs.
  445. X   */
  446. X! #if defined(SYSV) || defined(DGUX)
  447. X  #define    NR_OF_EOFS    20
  448. X  #endif
  449. X  
  450. X***************
  451. X*** 123,129 ****
  452. X  #else
  453. X      static char in_line[COLNO];
  454. X  #endif
  455. X!     register int foo;
  456. X  
  457. X      multi = 0;
  458. X      flags.move = 1;
  459. X--- 123,130 ----
  460. X  #else
  461. X      static char in_line[COLNO];
  462. X  #endif
  463. X!     register int foo, cnt = 0;
  464. X!     boolean prezero = FALSE;
  465. X  
  466. X      multi = 0;
  467. X      flags.move = 1;
  468. X***************
  469. X*** 141,147 ****
  470. X--- 142,156 ----
  471. X              Printf("Count: %d", multi);
  472. X          }
  473. X          last_multi = multi;
  474. X+         if(!cnt && foo == '0') prezero = TRUE;
  475. X+         cnt++;
  476. X          }
  477. X+         if (foo == '\033') {   /* esc cancels count (TH) */
  478. X+         remember_topl();
  479. X+         home();
  480. X+         cl_end();
  481. X+         multi = last_multi = 0;
  482. X+         }
  483. X  # ifdef REDO
  484. X      if (foo == DOAGAIN || in_doagain)
  485. X          multi = last_multi;
  486. X***************
  487. X*** 171,176 ****
  488. X--- 180,186 ----
  489. X          in_line[2] = 0;
  490. X      }
  491. X      clrlin();
  492. X+     if(prezero) in_line[0] = '\033';
  493. X      return(in_line);
  494. X  }
  495. X  
  496. X*** src/Old/hack.c    Wed Sep 27 11:28:02 1989
  497. X--- src/hack.c    Mon Sep 25 21:29:34 1989
  498. X***************
  499. X*** 63,69 ****
  500. X              for(y = u.uy-1; y < u.uy+2; y++) {
  501. X              if(!isok(x, y)) continue;
  502. X              lev = &levl[x][y];
  503. X!             if(lev->mmask) unpmon(m_at(x,y));
  504. X              if(!lev->lit && lev->scrsym == ROOM_SYM) {
  505. X                  lev->seen = 0;
  506. X                  atl(x, y, (char)STONE_SYM);
  507. X--- 63,70 ----
  508. X              for(y = u.uy-1; y < u.uy+2; y++) {
  509. X              if(!isok(x, y)) continue;
  510. X              lev = &levl[x][y];
  511. X!             if(MON_AT(x, y))
  512. X!                 unpmon(m_at(x,y));
  513. X              if(!lev->lit && lev->scrsym == ROOM_SYM) {
  514. X                  lev->seen = 0;
  515. X                  atl(x, y, (char)STONE_SYM);
  516. X***************
  517. X*** 95,101 ****
  518. X          if(isok(rx,ry) && !IS_ROCK(levl[rx][ry].typ) &&
  519. X              (!IS_DOOR(levl[rx][ry].typ) || !(u.dx && u.dy)) &&
  520. X              !sobj_at(BOULDER, rx, ry)) {
  521. X!             if(levl[rx][ry].mmask) {
  522. X                  mtmp = m_at(rx,ry);
  523. X                  if(canseemon(mtmp))
  524. X                  pline("There's %s on the other side.",
  525. X--- 96,102 ----
  526. X          if(isok(rx,ry) && !IS_ROCK(levl[rx][ry].typ) &&
  527. X              (!IS_DOOR(levl[rx][ry].typ) || !(u.dx && u.dy)) &&
  528. X              !sobj_at(BOULDER, rx, ry)) {
  529. X!             if(MON_AT(rx, ry)) {
  530. X                  mtmp = m_at(rx,ry);
  531. X                  if(canseemon(mtmp))
  532. X                  pline("There's %s on the other side.",
  533. X***************
  534. X*** 119,124 ****
  535. X--- 120,130 ----
  536. X                      pline("It completely fills the pit!");
  537. X                  continue;
  538. X                  case TRAPDOOR:
  539. X+                 if(is_maze_lev
  540. X+ #ifdef STRONGHOLD
  541. X+                     && (dlevel > stronghold_level)
  542. X+ #endif
  543. X+                     ) break;
  544. X                  pline("The boulder falls into and plugs a hole in the ground!");
  545. X                  deltrap(ttmp);
  546. X                  delobj(otmp);
  547. X***************
  548. X*** 361,367 ****
  549. X  #endif
  550. X              }
  551. X          }
  552. X!         if (levl[x][y].mmask) {
  553. X              mtmp = m_at(x,y);
  554. X              /* Don't attack if you're running */
  555. X              if (flags.run && !mtmp->mimic &&
  556. X--- 367,373 ----
  557. X  #endif
  558. X              }
  559. X          }
  560. X!         if (MON_AT(x, y)) {
  561. X              mtmp = m_at(x,y);
  562. X              /* Don't attack if you're running */
  563. X              if (flags.run && !mtmp->mimic &&
  564. X***************
  565. X*** 490,496 ****
  566. X  
  567. X          movobj(uball, uchain->ox, uchain->oy);
  568. X          unpobj(uball);        /* BAH %% */
  569. X!         place_object(uchain, u.ux, u.uy);
  570. X          nomul(-2);
  571. X          nomovemsg = "";
  572. X      nodrag:    ;
  573. X--- 496,502 ----
  574. X  
  575. X          movobj(uball, uchain->ox, uchain->oy);
  576. X          unpobj(uball);        /* BAH %% */
  577. X!         move_object(uchain, u.ux, u.uy);
  578. X          nomul(-2);
  579. X          nomovemsg = "";
  580. X      nodrag:    ;
  581. X***************
  582. X*** 568,574 ****
  583. X  #ifdef POLYSELF
  584. X      if (hides_under(uasmon))
  585. X          u.uundetected = (OBJ_AT(u.ux, u.uy) || levl[u.ux][u.uy].gmask);
  586. X!     else if (u.dx || u.dy) { /* i.e. piercer */
  587. X          if (u.usym == S_MIMIC_DEF)
  588. X          u.usym = S_MIMIC;
  589. X          u.uundetected = 0;
  590. X--- 574,580 ----
  591. X  #ifdef POLYSELF
  592. X      if (hides_under(uasmon))
  593. X          u.uundetected = (OBJ_AT(u.ux, u.uy) || levl[u.ux][u.uy].gmask);
  594. X!     else if (u.dx || u.dy) { /* piercer */
  595. X          if (u.usym == S_MIMIC_DEF)
  596. X          u.usym = S_MIMIC;
  597. X          u.uundetected = 0;
  598. X***************
  599. X*** 691,697 ****
  600. X      if(Blind || flags.run == 0) return;
  601. X      for(x = u.ux-1; x <= u.ux+1; x++) for(y = u.uy-1; y <= u.uy+1; y++) {
  602. X          if(x == u.ux && y == u.uy) continue;
  603. X!         if(levl[x][y].mmask && (mtmp = m_at(x,y)) && !mtmp->mimic &&
  604. X              (!mtmp->minvis || See_invisible) && !mtmp->mundetected) {
  605. X              if((flags.run != 1 && !mtmp->mtame) || (x == u.ux+u.dx && y == u.uy+u.dy))
  606. X                  goto stop;
  607. X--- 697,703 ----
  608. X      if(Blind || flags.run == 0) return;
  609. X      for(x = u.ux-1; x <= u.ux+1; x++) for(y = u.uy-1; y <= u.uy+1; y++) {
  610. X          if(x == u.ux && y == u.uy) continue;
  611. X!         if(MON_AT(x, y) && (mtmp = m_at(x,y)) && !mtmp->mimic &&
  612. X              (!mtmp->minvis || See_invisible) && !mtmp->mundetected) {
  613. X              if((flags.run != 1 && !mtmp->mtame) || (x == u.ux+u.dx && y == u.uy+u.dy))
  614. X                  goto stop;
  615. X***************
  616. X*** 792,798 ****
  617. X      for(x = u.ux-1; x <= u.ux+1; x++)
  618. X          for(y = u.uy-1; y <= u.uy+1; y++) {
  619. X          if(x == u.ux && y == u.uy) continue;
  620. X!         if(levl[x][y].mmask && (mtmp = m_at(x,y)) && !mtmp->mimic &&
  621. X             !mtmp->mtame && !mtmp->mpeaceful &&
  622. X             !noattacks(mtmp->data) &&
  623. X             !mtmp->mfroz && !mtmp->msleep &&  /* aplvax!jcn */
  624. X--- 798,804 ----
  625. X      for(x = u.ux-1; x <= u.ux+1; x++)
  626. X          for(y = u.uy-1; y <= u.uy+1; y++) {
  627. X          if(x == u.ux && y == u.uy) continue;
  628. X!         if(MON_AT(x, y) && (mtmp = m_at(x,y)) && !mtmp->mimic &&
  629. X             !mtmp->mtame && !mtmp->mpeaceful &&
  630. X             !noattacks(mtmp->data) &&
  631. X             !mtmp->mfroz && !mtmp->msleep &&  /* aplvax!jcn */
  632. X***************
  633. X*** 809,815 ****
  634. X  {
  635. X      if(Blind || (u.uswallow && (x != u.ux || y != u.uy))) return(0);
  636. X      if(IS_ROCK(levl[x][y].typ) && levl[u.ux][u.uy].typ == CORR &&
  637. X!                 !levl[x][y].mmask && !levl[u.ux][u.uy].lit)
  638. X          return(0);
  639. X      if(dist(x,y) < 3) return(1);
  640. X      if(levl[x][y].lit &&
  641. X--- 815,821 ----
  642. X  {
  643. X      if(Blind || (u.uswallow && (x != u.ux || y != u.uy))) return(0);
  644. X      if(IS_ROCK(levl[x][y].typ) && levl[u.ux][u.uy].typ == CORR &&
  645. X!                 !MON_AT(x, y) && !levl[u.ux][u.uy].lit)
  646. X          return(0);
  647. X      if(dist(x,y) < 3) return(1);
  648. X      if(levl[x][y].lit &&
  649. X*** src/Old/invent.c    Wed Sep 27 11:28:57 1989
  650. X--- src/invent.c    Sat Sep 23 01:23:44 1989
  651. X***************
  652. X*** 245,288 ****
  653. X  #endif
  654. X  }
  655. X  
  656. X- struct monst *
  657. X- m_at(x,y)
  658. X- register int x, y;
  659. X- {
  660. X-     register struct monst *mtmp;
  661. X- #ifdef WORM
  662. X-     register struct wseg *wtmp;
  663. X-     m_atseg = 0;
  664. X- #endif
  665. X- 
  666. X-     for(mtmp = fmon; mtmp; mtmp = mtmp->nmon){
  667. X-         if(mtmp->mx == x && mtmp->my == y)
  668. X-             return(mtmp);
  669. X- #ifdef WORM
  670. X-         if(mtmp->wormno){
  671. X-             for(wtmp = wsegs[mtmp->wormno]; wtmp; wtmp = wtmp->nseg)
  672. X-             if(wtmp->wx == x && wtmp->wy == y){
  673. X-             m_atseg = wtmp;
  674. X-             return(mtmp);
  675. X-             }
  676. X-         }
  677. X- #endif
  678. X-     }
  679. X-     return((struct monst *)0);
  680. X- }
  681. X- 
  682. X  struct obj *
  683. X- o_at(x,y)
  684. X- register int x, y;
  685. X- {
  686. X-     register struct obj *otmp;
  687. X- 
  688. X-     for(otmp = fobj; otmp; otmp = otmp->nobj)
  689. X-         if(otmp->ox == x && otmp->oy == y) return(otmp);
  690. X-     return((struct obj *)0);
  691. X- }
  692. X- 
  693. X- struct obj *
  694. X  sobj_at(n,x,y)
  695. X  register int n, x, y;
  696. X  {
  697. X--- 245,251 ----
  698. X***************
  699. X*** 289,296 ****
  700. X      register struct obj *otmp;
  701. X  
  702. X      if(OBJ_AT(x, y))
  703. X!         for(otmp = fobj; otmp; otmp = otmp->nobj)
  704. X!         if(otmp->ox == x && otmp->oy == y && otmp->otyp == n)
  705. X              return(otmp);
  706. X      return((struct obj *)0);
  707. X  }
  708. X--- 252,259 ----
  709. X      register struct obj *otmp;
  710. X  
  711. X      if(OBJ_AT(x, y))
  712. X!         for(otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
  713. X!         if(otmp->otyp == n)
  714. X              return(otmp);
  715. X      return((struct obj *)0);
  716. X  }
  717. X***************
  718. X*** 385,390 ****
  719. X--- 348,354 ----
  720. X      boolean allownone = FALSE;
  721. X      xchar foox = 0;
  722. X      long cnt;
  723. X+     boolean prezero = FALSE;
  724. X  
  725. X      if(*let == '0') let++, allowcnt = 1;
  726. X      if(*let == GOLD_SYM) let++,
  727. X***************
  728. X*** 475,480 ****
  729. X--- 439,445 ----
  730. X          }
  731. X          cnt = 0;
  732. X          ilet = readchar();
  733. X+         if(ilet == '0') prezero = TRUE;
  734. X          while(digit(ilet) && allowcnt) {
  735. X  #ifdef REDO
  736. X              if (ilet != '?' && ilet != '*')    savech(ilet);
  737. X***************
  738. X*** 503,508 ****
  739. X--- 468,474 ----
  740. X                  You("are not carrying any gold.");
  741. X                  return(struct obj *)0;
  742. X              }
  743. X+             if(cnt == 0 && prezero) return((struct obj *)0);
  744. X              if(!(allowcnt == 2 && cnt < u.ugold))
  745. X                  cnt = u.ugold;
  746. X              return(mkgoldobj(cnt));
  747. X***************
  748. X*** 512,518 ****
  749. X               * counts for other things since the throw code will
  750. X               * split off a single item anyway */
  751. X              allowcnt = 1;
  752. X!             if(cnt != 1) {
  753. X                  pline("You can only throw one item at a time.");
  754. X                  continue;
  755. X              }
  756. X--- 478,485 ----
  757. X               * counts for other things since the throw code will
  758. X               * split off a single item anyway */
  759. X              allowcnt = 1;
  760. X!             if(cnt == 0 && prezero) return((struct obj *)0);
  761. X!             if(cnt > 1) {
  762. X                  pline("You can only throw one item at a time.");
  763. X                  continue;
  764. X              }
  765. X***************
  766. X*** 973,979 ****
  767. X  
  768. X          read_engr_at(u.ux, u.uy); /* Eric Backus */
  769. X          if(!u.uswallow) {
  770. X!         otmp0 = o_at(u.ux, u.uy);
  771. X          gold = g_at(u.ux, u.uy);
  772. X          }  else  {
  773. X          You("%s no objects here.", verb);
  774. X--- 940,946 ----
  775. X  
  776. X          read_engr_at(u.ux, u.uy); /* Eric Backus */
  777. X          if(!u.uswallow) {
  778. X!         otmp0 = level.objects[u.ux][u.uy];
  779. X          gold = g_at(u.ux, u.uy);
  780. X          }  else  {
  781. X          You("%s no objects here.", verb);
  782. X***************
  783. X*** 1064,1070 ****
  784. X          }
  785. X  
  786. X          cornline(0, "Things that are here:");
  787. X!         for(otmp = otmp0; otmp; otmp = otmp->nobj) {
  788. X          if(otmp->ox == u.ux && otmp->oy == u.uy) {
  789. X                  ct++;
  790. X                  cornline(1, doname(otmp));
  791. X--- 1031,1037 ----
  792. X          }
  793. X  
  794. X          cornline(0, "Things that are here:");
  795. X!         for(otmp = otmp0; otmp; otmp = otmp->nexthere) {
  796. X          if(otmp->ox == u.ux && otmp->oy == u.uy) {
  797. X                  ct++;
  798. X                  cornline(1, doname(otmp));
  799. X***************
  800. X*** 1129,1139 ****
  801. X      else if((obj->olet==WEAPON_SYM || obj->olet==ARMOR_SYM) &&
  802. X          obj->rustfree != otmp->rustfree) return FALSE;
  803. X  
  804. X      else if(obj->otyp == CORPSE || obj->otyp == EGG || obj->otyp == TIN)
  805. X          return( (obj->corpsenm == otmp->corpsenm) &&
  806. X              (!ONAME(obj) || !strcmp(ONAME(obj), ONAME(otmp))) );
  807. X  
  808. X!     else if(obj->known == otmp->known || !uses_known(otmp)) {
  809. X          return(objects[obj->otyp].oc_merge);
  810. X      } else return(FALSE);
  811. X  }
  812. X--- 1096,1110 ----
  813. X      else if((obj->olet==WEAPON_SYM || obj->olet==ARMOR_SYM) &&
  814. X          obj->rustfree != otmp->rustfree) return FALSE;
  815. X  
  816. X+     else if(obj->olet == FOOD_SYM && OEATEN(obj) != OEATEN(otmp))
  817. X+         return(FALSE);
  818. X+ 
  819. X      else if(obj->otyp == CORPSE || obj->otyp == EGG || obj->otyp == TIN)
  820. X          return( (obj->corpsenm == otmp->corpsenm) &&
  821. X              (!ONAME(obj) || !strcmp(ONAME(obj), ONAME(otmp))) );
  822. X  
  823. X!     else if(obj->known == otmp->known || 
  824. X!         !objects[otmp->otyp].oc_uses_known) {
  825. X          return(objects[obj->otyp].oc_merge);
  826. X      } else return(FALSE);
  827. X  }
  828. X*** src/Old/ioctl.c    Wed Sep 27 11:30:06 1989
  829. X--- src/ioctl.c    Fri Sep 15 09:44:18 1989
  830. X***************
  831. X*** 8,13 ****
  832. X--- 8,14 ----
  833. X  
  834. X  /* block some unused #defines to avoid overloading some cpp's */
  835. X  #define MONATTK_H
  836. X+ #define MONFLAG_H
  837. X  #include "hack.h"
  838. X  
  839. X  #if defined(BSD) || defined(ULTRIX)
  840. X*** src/Old/lev_comp.y    Wed Sep 27 11:32:26 1989
  841. X--- src/lev_comp.y    Tue Sep 26 16:18:27 1989
  842. X***************
  843. X*** 12,18 ****
  844. X  #define MONDATA_H
  845. X  #include "hack.h"
  846. X  #include "sp_lev.h"
  847. X! #include <fcntl.h>
  848. X  
  849. X  #ifdef AMIGA
  850. X  char *fgets();
  851. X--- 12,23 ----
  852. X  #define MONDATA_H
  853. X  #include "hack.h"
  854. X  #include "sp_lev.h"
  855. X! #ifndef O_WRONLY
  856. X! # include <fcntl.h>
  857. X! #endif
  858. X! #ifndef O_CREAT    /* some older BSD systems do not define O_CREAT in <fcntl.h> */
  859. X! # include <sys/file.h>
  860. X! #endif
  861. X  
  862. X  #ifdef AMIGA
  863. X  char *fgets();
  864. X*** src/Old/lev_main.c    Wed Sep 27 11:34:00 1989
  865. X--- src/lev_main.c    Sat Sep 16 17:53:54 1989
  866. X***************
  867. X*** 26,32 ****
  868. X--- 26,37 ----
  869. X          yyparse();
  870. X      else             /* Otherwise every argument is a filename */
  871. X          for(i=1; i<argc; i++) {
  872. X+ #ifdef VMS
  873. X+             extern FILE *yyin;
  874. X+             yyin = fin = fopen(argv[i], "r");
  875. X+ #else
  876. X              fin = freopen(argv[i], "r", stdin);
  877. X+ #endif
  878. X              fname = argv[i];
  879. X              if (!fin) 
  880. X              fprintf(stderr,"Can't open %s\n", argv[i]);
  881. X*** src/Old/lock.c    Wed Sep 27 11:34:30 1989
  882. X--- src/lock.c    Thu Sep 14 14:11:20 1989
  883. X***************
  884. X*** 228,234 ****
  885. X          struct monst *mtmp;
  886. X  
  887. X          door = &levl[x][y];
  888. X!         if (door->mmask && canseemon(mtmp = m_at(x,y)) && !mtmp->mimic) {
  889. X          if (picktyp == CREDIT_CARD &&
  890. X  #ifdef ORACLE
  891. X              (mtmp->isshk || mtmp->data == &mons[PM_ORACLE]))
  892. X--- 228,234 ----
  893. X          struct monst *mtmp;
  894. X  
  895. X          door = &levl[x][y];
  896. X!         if (MON_AT(x, y) && canseemon(mtmp = m_at(x,y)) && !mtmp->mimic) {
  897. X          if (picktyp == CREDIT_CARD &&
  898. X  #ifdef ORACLE
  899. X              (mtmp->isshk || mtmp->data == &mons[PM_ORACLE]))
  900. X***************
  901. X*** 373,379 ****
  902. X      y = u.uy + u.dy;
  903. X      if((x == u.ux) && (y == u.uy)) return(0);
  904. X  
  905. X!     if(levl[x][y].mmask && (mtmp = m_at(x,y))->mimic && 
  906. X                  mtmp->mappearance == DOOR_SYM &&
  907. X                  !Protection_from_shape_changers) {
  908. X          stumble_onto_mimic(mtmp);
  909. X--- 373,379 ----
  910. X      y = u.uy + u.dy;
  911. X      if((x == u.ux) && (y == u.uy)) return(0);
  912. X  
  913. X!     if(MON_AT(x, y) && (mtmp = m_at(x,y))->mimic && 
  914. X                  mtmp->mappearance == DOOR_SYM &&
  915. X                  !Protection_from_shape_changers) {
  916. X          stumble_onto_mimic(mtmp);
  917. X***************
  918. X*** 430,436 ****
  919. X  obstructed(x,y)
  920. X  register int x, y;
  921. X  {
  922. X!     if(levl[x][y].mmask) {
  923. X          if (m_at(x,y)->mimic) goto obj;      
  924. X          pline("%s stands in the way!", Blind ?
  925. X              "Some creature" : Monnam(m_at(x,y)));
  926. X--- 430,436 ----
  927. X  obstructed(x,y)
  928. X  register int x, y;
  929. X  {
  930. X!     if(MON_AT(x, y)) {
  931. X          if (m_at(x,y)->mimic) goto obj;      
  932. X          pline("%s stands in the way!", Blind ?
  933. X              "Some creature" : Monnam(m_at(x,y)));
  934. X***************
  935. X*** 459,465 ****
  936. X          return(1);
  937. X      }
  938. X  
  939. X!     if(levl[x][y].mmask && (mtmp = m_at(x,y))->mimic && 
  940. X                  mtmp->mappearance == DOOR_SYM &&
  941. X                  !Protection_from_shape_changers) {
  942. X          stumble_onto_mimic(mtmp);
  943. X--- 459,465 ----
  944. X          return(1);
  945. X      }
  946. X  
  947. X!     if(MON_AT(x, y) && (mtmp = m_at(x,y))->mimic && 
  948. X                  mtmp->mappearance == DOOR_SYM &&
  949. X                  !Protection_from_shape_changers) {
  950. X          stumble_onto_mimic(mtmp);
  951. X***************
  952. X*** 624,630 ****
  953. X  #endif
  954. X          if(door->doormask & (D_LOCKED | D_CLOSED)) {
  955. X              if(door->doormask & D_TRAPPED) {
  956. X!             if (levl[x][y].mmask)
  957. X                  (void) mb_trapped(m_at(x,y));
  958. X              else if (flags.verbose)
  959. X                  if (cansee(x,y))
  960. X--- 624,630 ----
  961. X  #endif
  962. X          if(door->doormask & (D_LOCKED | D_CLOSED)) {
  963. X              if(door->doormask & D_TRAPPED) {
  964. X!             if (MON_AT(x, y))
  965. X                  (void) mb_trapped(m_at(x,y));
  966. X              else if (flags.verbose)
  967. X                  if (cansee(x,y))
  968. X*** src/Old/mail.c    Wed Sep 27 11:49:09 1989
  969. X--- src/mail.c    Tue Sep 26 17:24:55 1989
  970. X***************
  971. X*** 9,16 ****
  972. X  #ifdef MAIL
  973. X  
  974. X  # ifdef UNIX
  975. X! #include <sys/stat.h>
  976. X  # endif
  977. X  
  978. X  /*
  979. X   * Notify user when new mail has arrived. [Idea from Merlyn Leroy, but
  980. X--- 9,21 ----
  981. X  #ifdef MAIL
  982. X  
  983. X  # ifdef UNIX
  984. X! #  include <sys/stat.h>
  985. X! #  include <pwd.h>
  986. X  # endif
  987. X+ # ifdef VMS
  988. X+ #  include <descrip.h>
  989. X+ #  include <ssdef.h>
  990. X+ # endif
  991. X  
  992. X  /*
  993. X   * Notify user when new mail has arrived. [Idea from Merlyn Leroy, but
  994. X***************
  995. X*** 19,27 ****
  996. X   *   hack should do the paging itself. But when I get mail, I want to put it
  997. X   *   in some folder, reply, etc. - it would be unreasonable to put all these
  998. X   *   functions in hack. }
  999. X!  * The motion of the mail daemon is less restrained than usual:
  1000. X!  * diagonal moves from a DOOR are possible. He might also use SDOOR's. Also,
  1001. X!  * the mail daemon is visible in a ROOM, even when you are Blind.
  1002. X   * Its path should be longer when you are Telepat-hic and Blind.
  1003. X   *
  1004. X   * Possible extensions:
  1005. X--- 24,35 ----
  1006. X   *   hack should do the paging itself. But when I get mail, I want to put it
  1007. X   *   in some folder, reply, etc. - it would be unreasonable to put all these
  1008. X   *   functions in hack. }
  1009. X!  *
  1010. X!  * The mail daemon can move with less than usual restraint.  It can:
  1011. X!  *    - move diagonally from a door
  1012. X!  *    - use secret doors
  1013. X!  *    - run thru a monster
  1014. X!  *
  1015. X   * Its path should be longer when you are Telepat-hic and Blind.
  1016. X   *
  1017. X   * Possible extensions:
  1018. X***************
  1019. X*** 42,57 ****
  1020. X   * Here are some minor problems i didn't fix:  -3.
  1021. X   *
  1022. X   *    - The code sometimes pops up the mail daemon next to you on
  1023. X!  *      the corridor side of doorways when there are open spaces in
  1024. X!  *      the room.
  1025. X   *    - It may also do this with adjoining castle rooms.
  1026. X   */
  1027. X  
  1028. X! # ifndef UNIX
  1029. X  int mustgetmail = -1;
  1030. X  # endif
  1031. X  
  1032. X  # ifdef UNIX
  1033. X  static struct stat omstat,nmstat;
  1034. X  static char *mailbox = NULL;
  1035. X  static long laststattime;
  1036. X--- 50,66 ----
  1037. X   * Here are some minor problems i didn't fix:  -3.
  1038. X   *
  1039. X   *    - The code sometimes pops up the mail daemon next to you on
  1040. X!  *      the corridor side of doorways when there are open spaces
  1041. X!  *      within the room.
  1042. X   *    - It may also do this with adjoining castle rooms.
  1043. X   */
  1044. X  
  1045. X! # if !defined(UNIX) && !defined(VMS)
  1046. X  int mustgetmail = -1;
  1047. X  # endif
  1048. X  
  1049. X  # ifdef UNIX
  1050. X+ extern struct passwd *getpwuid();
  1051. X  static struct stat omstat,nmstat;
  1052. X  static char *mailbox = NULL;
  1053. X  static long laststattime;
  1054. X***************
  1055. X*** 69,75 ****
  1056. X  #  ifdef MAILPATH
  1057. X          mailbox = (char *) alloc(sizeof(MAILPATH)+8);
  1058. X          Strcpy(mailbox, MAILPATH);
  1059. X!         Strcat(mailbox, getlogin());
  1060. X  #  else
  1061. X          return;
  1062. X  #  endif
  1063. X--- 78,84 ----
  1064. X  #  ifdef MAILPATH
  1065. X          mailbox = (char *) alloc(sizeof(MAILPATH)+8);
  1066. X          Strcpy(mailbox, MAILPATH);
  1067. X!         Strcat(mailbox, getpwuid(getuid())->pw_name);
  1068. X  #  else
  1069. X          return;
  1070. X  #  endif
  1071. X***************
  1072. X*** 76,82 ****
  1073. X      }
  1074. X      if(stat(mailbox, &omstat)){
  1075. X  #  ifdef PERMANENT_MAILBOX
  1076. X!         pline("Cannot get status of MAIL=%s .", mailbox);
  1077. X          mailbox = 0;
  1078. X  #  else
  1079. X          omstat.st_mtime = 0;
  1080. X--- 85,91 ----
  1081. X      }
  1082. X      if(stat(mailbox, &omstat)){
  1083. X  #  ifdef PERMANENT_MAILBOX
  1084. X!         pline("Cannot get status of MAIL=\"%s\".", mailbox);
  1085. X          mailbox = 0;
  1086. X  #  else
  1087. X          omstat.st_mtime = 0;
  1088. X***************
  1089. X*** 85,159 ****
  1090. X  }
  1091. X  # endif /* UNIX */
  1092. X  
  1093. X! /* make md run through the cave */
  1094. X  static void
  1095. X! mdrush(md,away)
  1096. X! register struct monst *md;
  1097. X! boolean away;
  1098. X  {
  1099. X!     register int uroom = inroom(u.ux, u.uy);
  1100. X!     if(uroom >= 0 && inroom(md->mx,md->my) == uroom) {
  1101. X!         register int tmp = rooms[uroom].fdoor;
  1102. X!         register int cnt = rooms[uroom].doorct;
  1103. X!         register int fx = u.ux, fy = u.uy;
  1104. X!         while(cnt--) {
  1105. X!             if(dist(fx,fy) < dist(doors[tmp].x, doors[tmp].y)){
  1106. X!                 fx = doors[tmp].x;
  1107. X!                 fy = doors[tmp].y;
  1108. X!             }
  1109. X!             tmp++;
  1110. X!         }
  1111. X!         if (has_dnstairs(&rooms[uroom]))
  1112. X!             if(dist(fx,fy) < dist(xdnstair, ydnstair)){
  1113. X!                 fx = xdnstair;
  1114. X!                 fy = ydnstair;
  1115. X!             }
  1116. X!         if (has_upstairs(&rooms[uroom]))
  1117. X!             if(dist(fx,fy) < dist(xupstair, yupstair)){
  1118. X!                 fx = xupstair;
  1119. X!                 fy = yupstair;
  1120. X              }
  1121. X!         tmp_at(-1, md->data->mlet);    /* open call */
  1122. X!         tmp_at(-3, (int)AT_MON);
  1123. X!         if(away) {    /* interchange origin and destination */
  1124. X              unpmon(md);
  1125. X!             levl[md->mx][md->my].mmask = 0;
  1126. X!             levl[fx][fy].mmask = 1;
  1127. X!             tmp = fx; fx = md->mx; md->mx = tmp;
  1128. X!             tmp = fy; fy = md->my; md->my = tmp;
  1129. X!         }
  1130. X!         while(fx != md->mx || fy != md->my) {
  1131. X!             register int dx,dy,nfx = fx,nfy = fy,d1,d2;
  1132. X  
  1133. X!             tmp_at(fx,fy);
  1134. X!             d1 = dist2(fx,fy,md->mx,md->my);
  1135. X!             for(dx = -1; dx <= 1; dx++) for(dy = -1; dy <= 1; dy++)
  1136. X!                 if((dx || dy) && 
  1137. X!                    !IS_STWALL(levl[fx+dx][fy+dy].typ)) {
  1138. X!                 d2 = dist2(fx+dx,fy+dy,md->mx,md->my);
  1139. X!                 if(d2 < d1) {
  1140. X!                     d1 = d2;
  1141. X!                     nfx = fx+dx;
  1142. X!                     nfy = fy+dy;
  1143. X                  }
  1144. X!                 }
  1145. X!             if(nfx != fx || nfy != fy) {
  1146. X!                 fx = nfx;
  1147. X!                 fy = nfy;
  1148. X!             } else {
  1149. X!                 if(!away) {
  1150. X!                 levl[md->mx][md->my].mmask = 0;
  1151. X!                 levl[fx][fy].mmask = 1;
  1152. X!                 md->mx = fx;
  1153. X!                 md->my = fy;
  1154. X!                 }
  1155. X!                 break;
  1156. X!             } 
  1157. X          }
  1158. X!         tmp_at(-1,-1);            /* close call */
  1159. X!     }
  1160. X!     if(!away)
  1161. X!         pmon(md);
  1162. X  }
  1163. X  
  1164. X  static void
  1165. X--- 94,204 ----
  1166. X  }
  1167. X  # endif /* UNIX */
  1168. X  
  1169. X! # ifdef VMS
  1170. X! extern unsigned long pasteboard_id;
  1171. X! int broadcasts = 0;
  1172. X! #  define getmailstatus()
  1173. X! # endif /* VMS */
  1174. X! 
  1175. X! 
  1176. X! /* make mail daemon run through the dungeon */
  1177. X  static void
  1178. X! mdrush(md,fx,fy)
  1179. X! struct monst *md;
  1180. X! register int fx, fy;    /* origin, where the '&' is displayed */
  1181. X  {
  1182. X!     register int tx = md->mx, ty = md->my;
  1183. X!             /* real location, where the '&' is going */
  1184. X! 
  1185. X!     tmp_at(-1, md->data->mlet);    /* open call */
  1186. X! #ifdef TEXTCOLOR
  1187. X!     tmp_at(-3, (int)md->data->mcolor);
  1188. X! #endif
  1189. X! 
  1190. X!     while(fx != tx || fy != ty) {
  1191. X!         register int dx, dy,        /* direction counters */
  1192. X!                  nfx = fx, nfy = fy,/* next location */ 
  1193. X!                  d1, d2;        /* shortest dist, eval */
  1194. X! 
  1195. X!         /* display the '&' at (fx,fy) */
  1196. X!         tmp_at(fx,fy);
  1197. X! 
  1198. X!         /* find location next to (fx,fy) closest to (tx,ty) */
  1199. X!         d1 = dist2(fx,fy,tx,ty);
  1200. X!         for(dx = -1; dx <= 1; dx++) for(dy = -1; dy <= 1; dy++)
  1201. X!             if((dx || dy) && 
  1202. X!                !IS_STWALL(levl[fx+dx][fy+dy].typ)) {
  1203. X!             d2 = dist2(fx+dx,fy+dy,tx,ty);
  1204. X!             if(d2 < d1) {
  1205. X!                 d1 = d2;
  1206. X!                 nfx = fx+dx;
  1207. X!                 nfy = fy+dy;
  1208. X              }
  1209. X!             }
  1210. X! 
  1211. X!         /* set (fx,fy) to next location, unless it stopped */
  1212. X!         if(nfx != fx || nfy != fy) {
  1213. X!             fx = nfx;
  1214. X!             fy = nfy;
  1215. X!         } else break;
  1216. X!     }
  1217. X! 
  1218. X!     tmp_at(-1,-1);            /* close call */
  1219. X! }
  1220. X! 
  1221. X! static void
  1222. X! mdappear(md,away)
  1223. X! struct monst *md;
  1224. X! boolean away;
  1225. X! {
  1226. X!     static int fx, fy;            /* origin */
  1227. X!     int tx = md->mx, ty = md->my;        /* destination */
  1228. X!     register int uroom = inroom(u.ux, u.uy);/* room you're in */
  1229. X! 
  1230. X!     /* if mail daemon is in same room as you */
  1231. X!     if(uroom >= 0 && inroom(md->mx,md->my) == uroom && (!Blind || Telepat))
  1232. X!         if(away) {
  1233. X              unpmon(md);
  1234. X!             remove_monster(tx, ty);
  1235. X  
  1236. X!             /* fake "real" location to origin */
  1237. X!             md->mx = fx; md->my = fy;
  1238. X! 
  1239. X!             /* rush from destination */
  1240. X!             mdrush(md,tx,ty);
  1241. X!             return;
  1242. X!         } else {
  1243. X!             /* choose origin */
  1244. X!             register int cnt = rooms[uroom].doorct;
  1245. X!             register int tmp = rooms[uroom].fdoor;
  1246. X!             register int dd = 0;
  1247. X! 
  1248. X!             /* which door (or staircase) is farthest? */
  1249. X!             while (cnt--) {
  1250. X!                 if(dd < dist(doors[tmp].x, doors[tmp].y)) {
  1251. X!                     fx = doors[tmp].x;
  1252. X!                     fy = doors[tmp].y;
  1253. X!                     dd = dist(tx,ty);
  1254. X!                 }
  1255. X!                 tmp++;
  1256. X!             }
  1257. X!             if (has_dnstairs(&rooms[uroom]))
  1258. X!                 if(dd < dist(xdnstair, ydnstair)) {
  1259. X!                     fx = xdnstair;
  1260. X!                     fy = ydnstair;
  1261. X!                     dd = dist(xdnstair, ydnstair);
  1262. X!                 }
  1263. X!             if (has_upstairs(&rooms[uroom]))
  1264. X!                 if(dd < dist(xupstair, yupstair)) {
  1265. X!                     fx = xupstair;
  1266. X!                     fy = yupstair;
  1267. X                  }
  1268. X! 
  1269. X!             /* rush from origin */
  1270. X!             mdrush(md,fx,fy);
  1271. X          }
  1272. X! 
  1273. X!     pmon(md);
  1274. X  }
  1275. X  
  1276. X  static void
  1277. X***************
  1278. X*** 167,175 ****
  1279. X  
  1280. X      if(!md)    return;
  1281. X  
  1282. X!     mdrush(md,0);
  1283. X  
  1284. X      pline("\"Hello, %s!  I have some mail for you.\"", plname);
  1285. X  
  1286. X      if(dist(md->mx,md->my) > 2)
  1287. X          verbalize("Catch!");
  1288. X--- 212,224 ----
  1289. X  
  1290. X      if(!md)    return;
  1291. X  
  1292. X!     mdappear(md,FALSE);
  1293. X  
  1294. X+ # ifdef VMS
  1295. X+     pline("\"Hello, %s!  I have a message for you.\"", plname);
  1296. X+ # else
  1297. X      pline("\"Hello, %s!  I have some mail for you.\"", plname);
  1298. X+ # endif
  1299. X  
  1300. X      if(dist(md->mx,md->my) > 2)
  1301. X          verbalize("Catch!");
  1302. X***************
  1303. X*** 186,199 ****
  1304. X      }
  1305. X  
  1306. X      /* disappear again */
  1307. X!     mdrush(md,1);
  1308. X      mongone(md);
  1309. X  
  1310. X      /* force the graphics character set off */
  1311. X      nscr();
  1312. X  }
  1313. X  
  1314. X! # ifndef UNIX
  1315. X  void
  1316. X  ckmailstatus() {
  1317. X      if (mustgetmail < 0)
  1318. X--- 235,251 ----
  1319. X      }
  1320. X  
  1321. X      /* disappear again */
  1322. X!     mdappear(md,TRUE);
  1323. X      mongone(md);
  1324. X  
  1325. X      /* force the graphics character set off */
  1326. X      nscr();
  1327. X+ # ifdef VMS
  1328. X+     broadcasts--;
  1329. X+ # endif
  1330. X  }
  1331. X  
  1332. X! # if !defined(UNIX) && !defined(VMS)
  1333. X  void
  1334. X  ckmailstatus() {
  1335. X      if (mustgetmail < 0)
  1336. X***************
  1337. X*** 209,217 ****
  1338. X  {
  1339. X      pline("It says:  \"Please disregard previous letter.\"");
  1340. X  }
  1341. X! 
  1342. X! # else /* UNIX */
  1343. X  
  1344. X  void
  1345. X  ckmailstatus() {
  1346. X      if(!mailbox
  1347. X--- 261,269 ----
  1348. X  {
  1349. X      pline("It says:  \"Please disregard previous letter.\"");
  1350. X  }
  1351. X! # endif /* !UNIX && !VMS */
  1352. X  
  1353. X+ # ifdef UNIX
  1354. X  void
  1355. X  ckmailstatus() {
  1356. X      if(!mailbox
  1357. X***************
  1358. X*** 224,230 ****
  1359. X      laststattime = moves;
  1360. X      if(stat(mailbox, &nmstat)){
  1361. X  #  ifdef PERMANENT_MAILBOX
  1362. X!         pline("Cannot get status of MAIL=%s anymore.", mailbox);
  1363. X          mailbox = 0;
  1364. X  #  else
  1365. X          nmstat.st_mtime = 0;
  1366. X--- 276,282 ----
  1367. X      laststattime = moves;
  1368. X      if(stat(mailbox, &nmstat)){
  1369. X  #  ifdef PERMANENT_MAILBOX
  1370. X!         pline("Cannot get status of MAIL=\"%s\" anymore.", mailbox);
  1371. X          mailbox = 0;
  1372. X  #  else
  1373. X          nmstat.st_mtime = 0;
  1374. X***************
  1375. X*** 255,259 ****
  1376. X--- 307,334 ----
  1377. X      getmailstatus();
  1378. X  }
  1379. X  # endif /* UNIX */
  1380. X+ 
  1381. X+ # ifdef VMS
  1382. X+ void
  1383. X+ ckmailstatus()
  1384. X+ {
  1385. X+     if (broadcasts)
  1386. X+         newmail();
  1387. X+ }
  1388. X+ 
  1389. X+ void
  1390. X+ readmail()
  1391. X+ {
  1392. X+     char buf[16384];    /* $BRKTHRU limits messages to 16350 bytes */
  1393. X+     $DESCRIPTOR(message, buf);
  1394. X+     short length;
  1395. X+ 
  1396. X+     if (SMG$GET_BROADCAST_MESSAGE(&pasteboard_id, &message, &length)
  1397. X+         == SS$_NORMAL && length != 0) {
  1398. X+         buf[length] = '\0';
  1399. X+         pline("%s", buf);
  1400. X+     }
  1401. X+ }
  1402. X+ # endif /* VMS */
  1403. X  
  1404. X  #endif /* MAIL */
  1405. X*** src/Old/makemon.c    Wed Sep 27 11:49:42 1989
  1406. X--- src/makemon.c    Mon Sep 25 21:34:56 1989
  1407. X***************
  1408. X*** 382,388 ****
  1409. X              for(cnt = rn2((int)(mtmp->m_lev / 2)); cnt; cnt--) {
  1410. X                  do
  1411. X                  otmp = mkobj(GEM_SYM,FALSE);
  1412. X!                 while (otmp->otyp >= LAST_GEM+5);
  1413. X                  otmp->quan = 2 + rnd(2);
  1414. X                  otmp->owt = weight(otmp);
  1415. X                  mpickobj(mtmp, otmp);
  1416. X--- 382,388 ----
  1417. X              for(cnt = rn2((int)(mtmp->m_lev / 2)); cnt; cnt--) {
  1418. X                  do
  1419. X                  otmp = mkobj(GEM_SYM,FALSE);
  1420. X!                 while (otmp->otyp >= LAST_GEM+6);
  1421. X                  otmp->quan = 2 + rnd(2);
  1422. X                  otmp->owt = weight(otmp);
  1423. X                  mpickobj(mtmp, otmp);
  1424. X***************
  1425. X*** 421,434 ****
  1426. X  
  1427. X      /* if caller wants random location, do it here */
  1428. X      if(x == 0 && y == 0) {
  1429. X          do {
  1430. X              x = rn1(COLNO-3,2);
  1431. X              y = rn2(ROWNO);
  1432. X!         } while(!goodpos(x, y, ptr));
  1433. X      }
  1434. X  
  1435. X      /* if a monster already exists at the position, return */
  1436. X!     if(levl[x][y].mmask) return((struct monst *) 0);
  1437. X  
  1438. X      if(ptr){
  1439. X          /* if you are to make a specific monster and it has 
  1440. X--- 421,441 ----
  1441. X  
  1442. X      /* if caller wants random location, do it here */
  1443. X      if(x == 0 && y == 0) {
  1444. X+         int uroom;
  1445. X+         int tryct = 0;    /* careful with bigrooms */
  1446. X+ 
  1447. X+         if(!in_mklev) uroom = inroom(u.ux, u.uy);
  1448. X+ 
  1449. X          do {
  1450. X              x = rn1(COLNO-3,2);
  1451. X              y = rn2(ROWNO);
  1452. X!         } while(!goodpos(x, y, ptr) ||
  1453. X!             (!in_mklev && tryct++ < 50 && inroom(x, y) == uroom));
  1454. X      }
  1455. X  
  1456. X      /* if a monster already exists at the position, return */
  1457. X!     if(MON_AT(x, y))
  1458. X!         return((struct monst *) 0);
  1459. X  
  1460. X      if(ptr){
  1461. X          /* if you are to make a specific monster and it has 
  1462. X***************
  1463. X*** 476,488 ****
  1464. X           * above the 1..49 that indicate "normal" monster levels */
  1465. X           mtmp->mhpmax = mtmp->mhp = 2*(ptr->mlevel - 6);
  1466. X           mtmp->m_lev = mtmp->mhp / 4;    /* approximation */
  1467. X!      } else if((ptr->mlet == S_DRAGON) && (ptr >= &mons[PM_GREY_DRAGON]))
  1468. X          mtmp->mhpmax = mtmp->mhp = 80;
  1469. X      else if(!mtmp->m_lev) mtmp->mhpmax = mtmp->mhp = rnd(4);
  1470. X      else mtmp->mhpmax = mtmp->mhp = d((int)mtmp->m_lev, 8);
  1471. X!     mtmp->mx = x;
  1472. X!     mtmp->my = y;
  1473. X!     levl[x][y].mmask = 1;
  1474. X      mtmp->mcansee = 1;
  1475. X      mtmp->mpeaceful = peace_minded(ptr);
  1476. X  
  1477. X--- 483,493 ----
  1478. X           * above the 1..49 that indicate "normal" monster levels */
  1479. X           mtmp->mhpmax = mtmp->mhp = 2*(ptr->mlevel - 6);
  1480. X           mtmp->m_lev = mtmp->mhp / 4;    /* approximation */
  1481. X!      } else if((ptr->mlet == S_DRAGON) && (ptr >= &mons[PM_GRAY_DRAGON]))
  1482. X          mtmp->mhpmax = mtmp->mhp = 80;
  1483. X      else if(!mtmp->m_lev) mtmp->mhpmax = mtmp->mhp = rnd(4);
  1484. X      else mtmp->mhpmax = mtmp->mhp = d((int)mtmp->m_lev, 8);
  1485. X!     place_monster(mtmp, x, y);
  1486. X      mtmp->mcansee = 1;
  1487. X      mtmp->mpeaceful = peace_minded(ptr);
  1488. X  
  1489. X***************
  1490. X*** 492,501 ****
  1491. X              break;
  1492. X          case S_SPIDER:
  1493. X          case S_SNAKE:
  1494. X!             mtmp->mhide = mtmp->mundetected = 1;
  1495. X              if(in_mklev)
  1496. X!                 if(mtmp->mx && mtmp->my)
  1497. X!                 (void) mkobj_at(0, mtmp->mx, mtmp->my);
  1498. X              break;
  1499. X          case S_CHAMELEON:
  1500. X              /* If you're protected with a ring, don't create
  1501. X--- 497,508 ----
  1502. X              break;
  1503. X          case S_SPIDER:
  1504. X          case S_SNAKE:
  1505. X!             mtmp->mhide = 1;
  1506. X              if(in_mklev)
  1507. X!                 if(x && y)
  1508. X!                 (void) mkobj_at(0, x, y);
  1509. X!             if(OBJ_AT(x, y) || levl[x][y].gmask)
  1510. X!                 mtmp->mundetected = 1;
  1511. X              break;
  1512. X          case S_CHAMELEON:
  1513. X              /* If you're protected with a ring, don't create
  1514. X***************
  1515. X*** 521,527 ****
  1516. X          case S_UNICORN:
  1517. X              if ((ptr==&mons[PM_WHITE_UNICORN] && 
  1518. X                  u.ualigntyp == U_LAWFUL) ||
  1519. X!             (ptr==&mons[PM_GREY_UNICORN] && 
  1520. X                  u.ualigntyp == U_NEUTRAL) ||
  1521. X              (ptr==&mons[PM_BLACK_UNICORN] && 
  1522. X                  u.ualigntyp == U_CHAOTIC))
  1523. X--- 528,534 ----
  1524. X          case S_UNICORN:
  1525. X              if ((ptr==&mons[PM_WHITE_UNICORN] && 
  1526. X                  u.ualigntyp == U_LAWFUL) ||
  1527. X!             (ptr==&mons[PM_GRAY_UNICORN] && 
  1528. X                  u.ualigntyp == U_NEUTRAL) ||
  1529. X              (ptr==&mons[PM_BLACK_UNICORN] && 
  1530. X                  u.ualigntyp == U_CHAOTIC))
  1531. X***************
  1532. X*** 632,638 ****
  1533. X  int x,y;
  1534. X  struct permonst *mdat;
  1535. X  {
  1536. X!     if (x < 1 || x > COLNO-2 || y < 1 || y > ROWNO-2 || levl[x][y].mmask)
  1537. X          return 0;
  1538. X      if (x == u.ux && y == u.uy) return 0;
  1539. X      if (mdat) {
  1540. X--- 639,645 ----
  1541. X  int x,y;
  1542. X  struct permonst *mdat;
  1543. X  {
  1544. X!     if (x < 1 || x > COLNO-2 || y < 1 || y > ROWNO-2 || MON_AT(x, y))
  1545. X          return 0;
  1546. X      if (x == u.ux && y == u.uy) return 0;
  1547. X      if (mdat) {
  1548. X***************
  1549. X*** 668,677 ****
  1550. X          ty = rn2(ROWNO);
  1551. X         } while(!goodpos(tx,ty,mtmp->data));
  1552. X      if(mtmp->mx != 0 && mtmp->my != 0)
  1553. X!         levl[mtmp->mx][mtmp->my].mmask = 0;
  1554. X!     mtmp->mx = tx;
  1555. X!     mtmp->my = ty;
  1556. X!     levl[tx][ty].mmask = 1;
  1557. X      if(u.ustuck == mtmp){
  1558. X          if(u.uswallow) {
  1559. X              u.ux = tx;
  1560. X--- 675,682 ----
  1561. X          ty = rn2(ROWNO);
  1562. X         } while(!goodpos(tx,ty,mtmp->data));
  1563. X      if(mtmp->mx != 0 && mtmp->my != 0)
  1564. X!         remove_monster(mtmp->mx, mtmp->my);
  1565. X!     place_monster(mtmp, tx, ty);
  1566. X      if(u.ustuck == mtmp){
  1567. X          if(u.uswallow) {
  1568. X              u.ux = tx;
  1569. X***************
  1570. X*** 683,704 ****
  1571. X      set_apparxy(mtmp);
  1572. X  }
  1573. X  
  1574. X- struct monst *
  1575. X- mkmon_at(name, x, y)
  1576. X- char *name;
  1577. X- register int x,y;
  1578. X- {
  1579. X-     register int ct;
  1580. X-     register struct permonst *ptr;
  1581. X- 
  1582. X-     for(ct = PM_CHAMELEON; ct >= 0; ct--) { /* Chameleon is last monster */
  1583. X-         ptr = &mons[ct];
  1584. X-         if(!strcmp(ptr->mname, name))
  1585. X-             return(makemon(ptr, x, y));
  1586. X-     }
  1587. X-     return((struct monst *)0);
  1588. X- }
  1589. X- 
  1590. X  static int
  1591. X  cmnum()    {    /* return the number of "common" monsters */
  1592. X  
  1593. X--- 688,693 ----
  1594. X***************
  1595. X*** 735,740 ****
  1596. X--- 724,732 ----
  1597. X      n = (!!(ptr->geno & G_SGROUP));
  1598. X      n += (!!(ptr->geno & G_LGROUP)) << 1;
  1599. X  
  1600. X+ /*    For ranged attacks */
  1601. X+     if (ranged_attk(ptr)) n++;
  1602. X+ 
  1603. X  /*    For higher ac values */
  1604. X      n += (ptr->ac < 0);
  1605. X  
  1606. X***************
  1607. X*** 747,752 ****
  1608. X--- 739,745 ----
  1609. X          tmp2 = ptr->mattk[i].aatyp;
  1610. X          n += (tmp2 > 0);
  1611. X          n += (tmp2 == AT_MAGC);
  1612. X+         n += (tmp2 == AT_WEAP && strongmonst(ptr));
  1613. X      }
  1614. X  
  1615. X  /*    For each "special" damage type */
  1616. X***************
  1617. X*** 753,763 ****
  1618. X      for(i = 0; i < NATTK; i++) {
  1619. X  
  1620. X          tmp2 = ptr->mattk[i].adtyp;
  1621. X!         if((tmp2 == AD_DRLI) || (tmp2 == AD_STON)) n += 2;
  1622. X          else n += (tmp2 != AD_PHYS);
  1623. X          n += ((ptr->mattk[i].damd * ptr->mattk[i].damn) > 23);
  1624. X      }
  1625. X  
  1626. X  /*    Finally, adjust the monster level  0 <= n <= 24 (approx.) */
  1627. X      if(n == 0) tmp--;
  1628. X      else if(n >= 6) tmp += ( n / 2 );
  1629. X--- 746,764 ----
  1630. X      for(i = 0; i < NATTK; i++) {
  1631. X  
  1632. X          tmp2 = ptr->mattk[i].adtyp;
  1633. X!         if((tmp2 == AD_DRLI) || (tmp2 == AD_STON)
  1634. X! #ifdef POLYSELF
  1635. X!                     || (tmp2 == AD_WERE)
  1636. X! #endif
  1637. X!                                 ) n += 2;
  1638. X          else n += (tmp2 != AD_PHYS);
  1639. X          n += ((ptr->mattk[i].damd * ptr->mattk[i].damn) > 23);
  1640. X      }
  1641. X  
  1642. X+ /*    Leprechauns are special cases.  They have many hit dice so they
  1643. X+     can hit and are hard to kill, but they don't really do much damage. */
  1644. X+     if (ptr == &mons[PM_LEPRECHAUN]) n -= 2;
  1645. X+ 
  1646. X  /*    Finally, adjust the monster level  0 <= n <= 24 (approx.) */
  1647. X      if(n == 0) tmp--;
  1648. X      else if(n >= 6) tmp += ( n / 2 );
  1649. X***************
  1650. X*** 1080,1086 ****
  1651. X      if (levl[mtmp->mx][mtmp->my].gmask)
  1652. X          sym = GOLD_SYM;
  1653. X      else if (OBJ_AT(mtmp->mx, mtmp->my))
  1654. X!         sym = o_at(mtmp->mx,mtmp->my)->olet;
  1655. X      else if (IS_DOOR(levl[mtmp->mx][mtmp->my].typ) ||
  1656. X           IS_WALL(levl[mtmp->mx][mtmp->my].typ))
  1657. X          sym = DOOR_SYM;
  1658. X--- 1081,1087 ----
  1659. X      if (levl[mtmp->mx][mtmp->my].gmask)
  1660. X          sym = GOLD_SYM;
  1661. X      else if (OBJ_AT(mtmp->mx, mtmp->my))
  1662. X!         sym = level.objects[mtmp->mx][mtmp->my]->olet;
  1663. X      else if (IS_DOOR(levl[mtmp->mx][mtmp->my].typ) ||
  1664. X           IS_WALL(levl[mtmp->mx][mtmp->my].typ))
  1665. X          sym = DOOR_SYM;
  1666. X*** src/Old/mhitm.c    Wed Sep 27 11:50:37 1989
  1667. X--- src/mhitm.c    Fri Sep 15 11:43:01 1989
  1668. X***************
  1669. X*** 263,270 ****
  1670. X      magr->my = mdef->my;
  1671. X      if(cansee(magr->mx, magr->my))    pmon(magr);
  1672. X      if((tmp = mdamagem(magr, mdef, mattk)) == 2) {
  1673. X!         levl[mx][my].mmask = 0;
  1674. X!         levl[magr->mx][magr->my].mmask = 1;
  1675. X          /* if mdamagem left a corpse it erased magr's symbol */
  1676. X          unpmon(magr);
  1677. X          pmon(magr);
  1678. X--- 263,270 ----
  1679. X      magr->my = mdef->my;
  1680. X      if(cansee(magr->mx, magr->my))    pmon(magr);
  1681. X      if((tmp = mdamagem(magr, mdef, mattk)) == 2) {
  1682. X!         remove_monster(mx, my);
  1683. X!         place_monster(magr, magr->mx, magr->my);
  1684. X          /* if mdamagem left a corpse it erased magr's symbol */
  1685. X          unpmon(magr);
  1686. X          pmon(magr);
  1687. X*** src/Old/mhitu.c    Wed Sep 27 11:51:06 1989
  1688. X--- src/mhitu.c    Mon Sep 25 21:29:39 1989
  1689. X***************
  1690. X*** 217,225 ****
  1691. X              coord cc; /* maybe we need a unexto() function? */
  1692. X  
  1693. X              unpmon(mtmp);
  1694. X!             levl[mtmp->mx][mtmp->my].mmask = 0;
  1695. X!             mtmp->mx = u.ux; mtmp->my = u.uy;
  1696. X!             levl[mtmp->mx][mtmp->my].mmask = 1;
  1697. X              pmon(mtmp);
  1698. X              enexto(&cc, u.ux, u.uy, &playermon);
  1699. X              teleds(cc.x, cc.y);
  1700. X--- 217,224 ----
  1701. X              coord cc; /* maybe we need a unexto() function? */
  1702. X  
  1703. X              unpmon(mtmp);
  1704. X!             remove_monster(mtmp->mx, mtmp->my);
  1705. X!             place_monster(mtmp, u.ux, u.uy);
  1706. X              pmon(mtmp);
  1707. X              enexto(&cc, u.ux, u.uy, &playermon);
  1708. X              teleds(cc.x, cc.y);
  1709. X***************
  1710. X*** 243,250 ****
  1711. X               pline("Wait, %s!  There's a %s named %s hiding under %s!",
  1712. X              mtmp->mnamelth ? NAME(mtmp) : mtmp->data->mname,
  1713. X              uasmon->mname, plname,
  1714. X!             OBJ_AT(u.ux, u.uy) ? doname(o_at(u.ux,u.uy)) :
  1715. X!             "some gold");
  1716. X              prme();
  1717. X          }
  1718. X          return(0);
  1719. X--- 242,250 ----
  1720. X               pline("Wait, %s!  There's a %s named %s hiding under %s!",
  1721. X              mtmp->mnamelth ? NAME(mtmp) : mtmp->data->mname,
  1722. X              uasmon->mname, plname,
  1723. X!             OBJ_AT(u.ux,u.uy)
  1724. X!                ? doname(level.objects[u.ux][u.uy]) :
  1725. X!                "some gold");
  1726. X              prme();
  1727. X          }
  1728. X          return(0);
  1729. X***************
  1730. X*** 465,471 ****
  1731. X          register struct obj *obj;
  1732. X  
  1733. X          if(OBJ_AT(mtmp->mx, mtmp->my)) {
  1734. X!             if(obj = o_at(mtmp->mx,mtmp->my))
  1735. X              pline("%s was hidden under %s!",
  1736. X                    Xmonnam(mtmp), doname(obj));
  1737. X          } else if (levl[mtmp->mx][mtmp->my].gmask == 1)
  1738. X--- 465,471 ----
  1739. X          register struct obj *obj;
  1740. X  
  1741. X          if(OBJ_AT(mtmp->mx, mtmp->my)) {
  1742. X!             if(obj = level.objects[mtmp->mx][mtmp->my])
  1743. X              pline("%s was hidden under %s!",
  1744. X                    Xmonnam(mtmp), doname(obj));
  1745. X          } else if (levl[mtmp->mx][mtmp->my].gmask == 1)
  1746. X***************
  1747. X*** 719,724 ****
  1748. X--- 719,725 ----
  1749. X          hitmsg(mtmp, mattk);
  1750. X  #ifdef POLYSELF
  1751. X          if (ctmp && !rn2(4) && u.ulycn == -1
  1752. X+             && !Protection_from_shape_changers
  1753. X  # ifdef NAMED_ITEMS
  1754. X              && !defends(AD_WERE,uwep)
  1755. X  # endif
  1756. X***************
  1757. X*** 1020,1029 ****
  1758. X  #endif
  1759. X  
  1760. X      if(!u.uswallow) {    /* swallow him */
  1761. X!         levl[mtmp->mx][mtmp->my].mmask = 0;
  1762. X!         mtmp->mx = u.ux;
  1763. X!         mtmp->my = u.uy;
  1764. X!         levl[mtmp->mx][mtmp->my].mmask = 1;
  1765. X          u.ustuck = mtmp;
  1766. X          pmon(mtmp);
  1767. X          kludge("%s engulfs you!", Monnam(mtmp));
  1768. X--- 1021,1028 ----
  1769. X  #endif
  1770. X  
  1771. X      if(!u.uswallow) {    /* swallow him */
  1772. X!         remove_monster(mtmp->mx, mtmp->my);
  1773. X!         place_monster(mtmp, u.ux, u.uy);
  1774. X          u.ustuck = mtmp;
  1775. X          pmon(mtmp);
  1776. X          kludge("%s engulfs you!", Monnam(mtmp));
  1777. X***************
  1778. X*** 1461,1466 ****
  1779. X--- 1460,1466 ----
  1780. X      mayberem(uarmf, "boots");
  1781. X      mayberem(uarmg, "gloves");
  1782. X      mayberem(uarms, "shield");
  1783. X+     mayberem(uarmh, "helmet");
  1784. X  #ifdef SHIRT
  1785. X      if(!uarmc && !uarm)
  1786. X          mayberem(uarmu, "shirt");
  1787. X***************
  1788. X*** 1571,1580 ****
  1789. X              if (!cost) cost=1;
  1790. X          }
  1791. X          if (cost > u.ugold) cost = u.ugold;
  1792. X!         if (!cost) pline("%s says: \"It's on the house!\"", Monnam(mon));
  1793. X          else {
  1794. X!             pline("%s takes %ld Zorkmid%s for services rendered!",
  1795. X!                 Monnam(mon), cost, (cost==1) ? "" : "s");
  1796. X              u.ugold -= cost;
  1797. X              mon->mgold += cost;
  1798. X              flags.botl = 1;
  1799. X--- 1571,1580 ----
  1800. X              if (!cost) cost=1;
  1801. X          }
  1802. X          if (cost > u.ugold) cost = u.ugold;
  1803. X!         if (!cost) verbalize("It's on the house!");
  1804. X          else {
  1805. X!             pline("%s takes %ld zorkmid%s for services rendered!",
  1806. X!                 Monnam(mon), cost, plur(cost));
  1807. X              u.ugold -= cost;
  1808. X              mon->mgold += cost;
  1809. X              flags.botl = 1;
  1810. X***************
  1811. X*** 1599,1605 ****
  1812. X          if (yn() == 'n') return;
  1813. X      } else pline("\"Take off your %s; %s.\"", str,
  1814. X              (obj == uarm)  ? "let's get a little closer" :
  1815. X!             (obj == uarmc) ? "it's in the way" :
  1816. X              (obj == uarmf) ? "let me rub your feet" :
  1817. X              (obj == uarmg) ? "they're too clumsy" :
  1818. X  #ifdef SHIRT
  1819. X--- 1599,1605 ----
  1820. X          if (yn() == 'n') return;
  1821. X      } else pline("\"Take off your %s; %s.\"", str,
  1822. X              (obj == uarm)  ? "let's get a little closer" :
  1823. X!             (obj == uarmc || obj == uarms) ? "it's in the way" :
  1824. X              (obj == uarmf) ? "let me rub your feet" :
  1825. X              (obj == uarmg) ? "they're too clumsy" :
  1826. X  #ifdef SHIRT
  1827. X*** src/Old/mklev.c    Wed Sep 27 11:52:05 1989
  1828. X--- src/mklev.c    Thu Sep 14 14:27:57 1989
  1829. X***************
  1830. X*** 739,746 ****
  1831. X      doorindex = 0;
  1832. X      rooms[0].hx = -1;    /* in case we are in a maze */
  1833. X  
  1834. X!     for(x=0; x<COLNO; x++) for(y=0; y<ROWNO; y++)
  1835. X          levl[x][y] = zerorm;
  1836. X  
  1837. X      oinit();    /* assign level dependent obj probabilities */
  1838. X      fountsound = 0;
  1839. X--- 739,749 ----
  1840. X      doorindex = 0;
  1841. X      rooms[0].hx = -1;    /* in case we are in a maze */
  1842. X  
  1843. X!     for(x=0; x<COLNO; x++) for(y=0; y<ROWNO; y++) {
  1844. X          levl[x][y] = zerorm;
  1845. X+         level.objects[x][y] = (struct obj *)0;
  1846. X+         level.monsters[x][y] = (struct monst *)0;
  1847. X+     }
  1848. X  
  1849. X      oinit();    /* assign level dependent obj probabilities */
  1850. X      fountsound = 0;
  1851. X***************
  1852. X*** 1109,1115 ****
  1853. X                  else    my = croom->ly-1;
  1854. X                  mx = somex(croom);
  1855. X              }
  1856. X!         } while(levl[mx][my].mmask);
  1857. X  
  1858. X          if((mtmp = makemon(mkclass(S_MIMIC), mx, my))) {
  1859. X              mtmp->mimic = 1;
  1860. X--- 1112,1119 ----
  1861. X                  else    my = croom->ly-1;
  1862. X                  mx = somex(croom);
  1863. X              }
  1864. X!         } while
  1865. X!             (MON_AT(mx, my));
  1866. X  
  1867. X          if((mtmp = makemon(mkclass(S_MIMIC), mx, my))) {
  1868. X              mtmp->mimic = 1;
  1869. X*** src/Old/mkmaze.c    Wed Sep 27 11:52:45 1989
  1870. X--- src/mkmaze.c    Mon Sep 25 21:29:42 1989
  1871. X***************
  1872. X*** 473,480 ****
  1873. X  }
  1874. X  
  1875. X  void
  1876. X! mazexy(cc)    /* find random point in generated corridors
  1877. X!            i.e., don't create items in moats, bunkers, or walls */
  1878. X      coord    *cc;
  1879. X  {
  1880. X      int cpt=0;
  1881. X--- 473,480 ----
  1882. X  }
  1883. X  
  1884. X  void
  1885. X! mazexy(cc)    /* find random point in generated corridors,
  1886. X!            so we don't create items in moats, bunkers, or walls */
  1887. X      coord    *cc;
  1888. X  {
  1889. X      int cpt=0;
  1890. X*** src/Old/mkobj.c    Wed Sep 27 11:53:09 1989
  1891. X--- src/mkobj.c    Tue Sep 26 12:59:37 1989
  1892. X***************
  1893. X*** 76,83 ****
  1894. X      register struct obj *otmp;
  1895. X  
  1896. X      mksx = x; mksy = y;
  1897. X!     /* We might need to know the X, Y coordinates while creating the
  1898. X!      * object, i.e. to insure shop boxes are empty.
  1899. X       * Yes, this is a horrible kludge...
  1900. X       */
  1901. X      otmp = mkobj(let,TRUE);
  1902. X--- 76,83 ----
  1903. X      register struct obj *otmp;
  1904. X  
  1905. X      mksx = x; mksy = y;
  1906. X!     /* We need to know the X, Y coordinates while creating the object,
  1907. X!      * to insure shop boxes are empty.
  1908. X       * Yes, this is a horrible kludge...
  1909. X       */
  1910. X      otmp = mkobj(let,TRUE);
  1911. X***************
  1912. X*** 215,227 ****
  1913. X  
  1914. X      otmp = newobj(0);
  1915. X      *otmp = zeroobj;
  1916. X!     otmp->age = moves;
  1917. X      otmp->o_id = flags.ident++;
  1918. X      otmp->quan = 1;
  1919. X      otmp->olet = let;
  1920. X      otmp->otyp = otyp;
  1921. X      otmp->dknown = index(dknowns, let) ? 0 : 1;
  1922. X!     if (!uses_known(otmp))
  1923. X          otmp->known = 1;
  1924. X      switch(let) {
  1925. X      case WEAPON_SYM:
  1926. X--- 215,227 ----
  1927. X  
  1928. X      otmp = newobj(0);
  1929. X      *otmp = zeroobj;
  1930. X!     otmp->age = monstermoves;
  1931. X      otmp->o_id = flags.ident++;
  1932. X      otmp->quan = 1;
  1933. X      otmp->olet = let;
  1934. X      otmp->otyp = otyp;
  1935. X      otmp->dknown = index(dknowns, let) ? 0 : 1;
  1936. X!     if (!objects[otmp->otyp].oc_uses_known)
  1937. X          otmp->known = 1;
  1938. X      switch(let) {
  1939. X      case WEAPON_SYM:
  1940. X***************
  1941. X*** 239,244 ****
  1942. X--- 239,245 ----
  1943. X  #endif
  1944. X          break;
  1945. X      case FOOD_SYM:
  1946. X+         OEATEN(otmp) = 0L;
  1947. X          if(otmp->otyp == CORPSE) {
  1948. X              /* overridden by mkcorpstat() */
  1949. X              do otmp->corpsenm = rndmonnum();
  1950. X***************
  1951. X*** 302,312 ****
  1952. X                      break;
  1953. X          case BAG_OF_TRICKS:    otmp->spe = rnd(20);
  1954. X                      break;
  1955. X!         case FIGURINE:    {    int tryct = 0;
  1956. X                      do
  1957. X                          otmp->corpsenm = rndmonnum();
  1958. X                      while(is_human(&mons[otmp->corpsenm])
  1959. X!                         && tryct++ < 30);
  1960. X                      blessorcurse(otmp, 4);
  1961. X                      break;
  1962. X                  }
  1963. X--- 303,313 ----
  1964. X                      break;
  1965. X          case BAG_OF_TRICKS:    otmp->spe = rnd(20);
  1966. X                      break;
  1967. X!         case FIGURINE:    {    int tryct2 = 0;
  1968. X                      do
  1969. X                          otmp->corpsenm = rndmonnum();
  1970. X                      while(is_human(&mons[otmp->corpsenm])
  1971. X!                         && tryct2++ < 30);
  1972. X                      blessorcurse(otmp, 4);
  1973. X                      break;
  1974. X                  }
  1975. X***************
  1976. X*** 356,363 ****
  1977. X              otmp->blessed = rn2(2);
  1978. X          } else    blessorcurse(otmp, 10);
  1979. X          if(otmp->otyp == DRAGON_SCALE_MAIL)
  1980. X!             otmp->corpsenm = PM_GREY_DRAGON +
  1981. X!                 rn2(PM_YELLOW_DRAGON-PM_GREY_DRAGON+1);
  1982. X          break;
  1983. X      case WAND_SYM:
  1984. X  #ifdef HARD
  1985. X--- 357,364 ----
  1986. X              otmp->blessed = rn2(2);
  1987. X          } else    blessorcurse(otmp, 10);
  1988. X          if(otmp->otyp == DRAGON_SCALE_MAIL)
  1989. X!             otmp->corpsenm = PM_GRAY_DRAGON +
  1990. X!                 rn2(PM_YELLOW_DRAGON-PM_GRAY_DRAGON+1);
  1991. X          break;
  1992. X      case WAND_SYM:
  1993. X  #ifdef HARD
  1994. X***************
  1995. X*** 543,551 ****
  1996. X  
  1997. X      otmp = mkcorpstat(objtype,ptr,x,y);
  1998. X      if (lth > 0) {
  1999. X!         /* Note: oname() is safe since otmp is first in chain */
  2000. X          otmp = oname(otmp, nm, FALSE);
  2001. X          fobj = otmp;
  2002. X      }
  2003. X      return(otmp);
  2004. X  }
  2005. X--- 544,553 ----
  2006. X  
  2007. X      otmp = mkcorpstat(objtype,ptr,x,y);
  2008. X      if (lth > 0) {
  2009. X!         /* Note: oname() is safe since otmp is first in both chains */
  2010. X          otmp = oname(otmp, nm, FALSE);
  2011. X          fobj = otmp;
  2012. X+         level.objects[x][y] = otmp;
  2013. X      }
  2014. X      return(otmp);
  2015. X  }
  2016. X***************
  2017. X*** 575,626 ****
  2018. X  }
  2019. X  #endif
  2020. X  
  2021. X  /*
  2022. X!  * These functions encapsulate operations on the omask bit.  Someday soon they
  2023. X!  * will turn into list-manipulation functions.
  2024. X   */
  2025. X- boolean
  2026. X- OBJ_AT(x, y)
  2027. X- int x, y;
  2028. X- {
  2029. X-     return levl[x][y].omask;
  2030. X- }
  2031. X  
  2032. X  void
  2033. X! place_object(obj, x, y)
  2034. X! struct obj *obj;
  2035. X! register int x, y;
  2036. X  {
  2037. X!     obj->ox = x;
  2038. X!     obj->oy = y;
  2039. X!     levl[x][y].omask = 1;
  2040. X  }
  2041. X  
  2042. X! void
  2043. X! move_object(obj, x, y)
  2044. X! struct obj *obj;
  2045. X! register int x, y;
  2046. X  {
  2047. X!     register int oldx = obj->ox, oldy = obj->oy;
  2048. X  
  2049. X-     obj->ox = x;
  2050. X-     obj->oy = y;
  2051. X-     levl[x][y].omask = 1;
  2052. X-     levl[oldx][oldy].omask = (o_at(oldx, oldy) != (struct obj *)0);
  2053. X- }
  2054. X- 
  2055. X- void
  2056. X- remove_object(obj)
  2057. X- struct obj *obj;
  2058. X- {
  2059. X-     register int oldx = obj->ox, oldy = obj->oy;
  2060. X  
  2061. X- /*
  2062. X-  * This cannot be used since it screws up unpobj().  It's only necessary so
  2063. X-  * that o_at() doesn't mistakenly find the object, but this is called only
  2064. X-  * in situations with the object already removed from the chain anyway.
  2065. X-     obj->ox = 0;
  2066. X-     obj->oy = 0;
  2067. X-  */
  2068. X-     levl[oldx][oldy].omask = (o_at(oldx, oldy) != (struct obj *)0);
  2069. X- }
  2070. X--- 577,623 ----
  2071. X  }
  2072. X  #endif
  2073. X  
  2074. X+ 
  2075. X  /*
  2076. X!  * These routines maintain the single-linked lists headed in level.objects[][]
  2077. X!  * and threaded through the nexthere fields in the object-instance structure.
  2078. X   */
  2079. X  
  2080. X  void
  2081. X! place_object(otmp, x, y)
  2082. X! /* put an object on top of the pile at the given location */
  2083. X! register struct obj *otmp;
  2084. X! int x, y;
  2085. X  {
  2086. X!     otmp->nexthere = level.objects[x][y];
  2087. X!     level.objects[x][y] = otmp;
  2088. X! 
  2089. X!     /* set the new object's location */
  2090. X!     otmp->ox = x;
  2091. X!     otmp->oy = y;
  2092. X! }
  2093. X! 
  2094. X! void
  2095. X! remove_object(otmp)
  2096. X! register struct obj *otmp;
  2097. X! {
  2098. X!     register struct obj *odel;
  2099. X! 
  2100. X!     if (otmp == level.objects[otmp->ox][otmp->oy])
  2101. X!     level.objects[otmp->ox][otmp->oy] = otmp->nexthere;
  2102. X!     else
  2103. X!     for (odel = level.objects[otmp->ox][otmp->oy];
  2104. X!                             odel; odel = odel->nexthere)
  2105. X!         if (odel->nexthere == otmp)
  2106. X!         odel->nexthere = otmp->nexthere;
  2107. X  }
  2108. X  
  2109. X! void move_object(otmp, x, y)
  2110. X! register struct obj *otmp;
  2111. X! int x, y;
  2112. X  {
  2113. X!     remove_object(otmp);
  2114. X!     place_object(otmp, x, y);
  2115. X! }
  2116. X  
  2117. X  
  2118. X
  2119. END_OF_FILE
  2120. if test 53375 -ne `wc -c <'patches04b'`; then
  2121.     echo shar: \"'patches04b'\" unpacked with wrong size!
  2122. fi
  2123. # end of 'patches04b'
  2124. fi
  2125. echo shar: End of archive 2 \(of 11\).
  2126. cp /dev/null ark2isdone
  2127. MISSING=""
  2128. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  2129.     if test ! -f ark${I}isdone ; then
  2130.     MISSING="${MISSING} ${I}"
  2131.     fi
  2132. done
  2133. if test "${MISSING}" = "" ; then
  2134.     echo You have unpacked all 11 archives.
  2135.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2136. else
  2137.     echo You still need to unpack the following archives:
  2138.     echo "        " ${MISSING}
  2139. fi
  2140. ##  End of shell archive.
  2141. exit 0
  2142.