home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch8h < prev    next >
Encoding:
Internet Message Format  |  1990-06-08  |  56.4 KB

  1. Path: uunet!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v10i026:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch8h
  5. Message-ID: <5734@tekred.CNA.TEK.COM>
  6. Date: 5 Jun 90 17:54:37 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 2209
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 10, Issue 26
  13. Archive-name: NetHack3/Patch8h
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 8 (of 24)."
  25. # Contents:  patch8.04
  26. # Wrapped by billr@saab on Tue Jun  5 09:07:10 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patch8.04' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'patch8.04'\"
  30. else
  31. echo shar: Extracting \"'patch8.04'\" \(53751 characters\)
  32. sed "s/^X//" >'patch8.04' <<'END_OF_FILE'
  33. X*** src/Old/makemon.c    Sun Jun  3 13:29:39 1990
  34. X--- src/makemon.c    Thu May 31 22:11:01 1990
  35. X***************
  36. X*** 7,21 ****
  37. X  # include <ctype.h>
  38. X  #endif
  39. X  
  40. X! VSTATIC struct monst zeromonst;
  41. X  
  42. X  static int FDECL(uncommon, (struct permonst *));
  43. X! OSTATIC void FDECL(m_initgrp,(struct monst *,int,int,int));
  44. X! static void FDECL(m_initthrow,(struct monst *,int,int));
  45. X! OSTATIC void FDECL(m_initweap,(struct monst *));
  46. X  static void FDECL(m_initinv,(struct monst *));
  47. X- static void FDECL(rloc_to,(struct monst *,int,int));
  48. X  static int FDECL(mstrength,(struct permonst *));
  49. X  
  50. X  extern int monstr[];
  51. X  
  52. X--- 7,26 ----
  53. X  # include <ctype.h>
  54. X  #endif
  55. X  
  56. X! STATIC_VAR struct monst NEARDATA zeromonst;
  57. X  
  58. X+ #ifdef OVL0
  59. X+ static int NDECL(cmnum);
  60. X  static int FDECL(uncommon, (struct permonst *));
  61. X! #endif /* OVL0 */
  62. X! STATIC_DCL void FDECL(m_initgrp,(struct monst *,int,int,int));
  63. X! STATIC_DCL void FDECL(m_initthrow,(struct monst *,int,int));
  64. X! STATIC_DCL void FDECL(m_initweap,(struct monst *));
  65. X! STATIC_DCL void FDECL(rloc_to,(struct monst *,int,int));
  66. X! #ifdef OVL1
  67. X  static void FDECL(m_initinv,(struct monst *));
  68. X  static int FDECL(mstrength,(struct permonst *));
  69. X+ #endif /* OVL1 */
  70. X  
  71. X  extern int monstr[];
  72. X  
  73. X***************
  74. X*** 32,38 ****
  75. X  
  76. X  #ifdef OVLB
  77. X  
  78. X! XSTATIC void
  79. X  m_initgrp(mtmp, x, y, n)    /* make a group just like mtmp */
  80. X  register struct monst *mtmp;
  81. X  register int x, y, n;
  82. X--- 37,43 ----
  83. X  
  84. X  #ifdef OVLB
  85. X  
  86. X! STATIC_OVL void
  87. X  m_initgrp(mtmp, x, y, n)    /* make a group just like mtmp */
  88. X  register struct monst *mtmp;
  89. X  register int x, y, n;
  90. X***************
  91. X*** 57,75 ****
  92. X           * are peaceful and some are not, the result will just be a
  93. X           * smaller group.
  94. X           */
  95. X!         enexto(&mm, mm.x, mm.y, mtmp->data);
  96. X!         mon = makemon(mtmp->data, mm.x, mm.y);
  97. X!         mon->mpeaceful = 0;
  98. X!         set_malign(mon);
  99. X!         /* Undo the second peace_minded() check in makemon(); if the
  100. X!          * monster turned out to be peaceful the first time we didn't
  101. X!          * create it at all; we don't want a second check.
  102. X!          */
  103. X      }
  104. X  }
  105. X  
  106. X! 
  107. X! static void
  108. X  m_initthrow(mtmp,otyp,oquan)
  109. X  struct monst *mtmp;
  110. X  int otyp,oquan;
  111. X--- 62,81 ----
  112. X           * are peaceful and some are not, the result will just be a
  113. X           * smaller group.
  114. X           */
  115. X!         if (enexto(&mm, mm.x, mm.y, mtmp->data)) {
  116. X!             mon = makemon(mtmp->data, mm.x, mm.y);
  117. X!             mon->mpeaceful = 0;
  118. X!             set_malign(mon);
  119. X!             /* Undo the second peace_minded() check in makemon(); if the
  120. X!              * monster turned out to be peaceful the first time we
  121. X!              * didn't create it at all; we don't want a second check.
  122. X!              */
  123. X!         }
  124. X      }
  125. X  }
  126. X  
  127. X! STATIC_OVL
  128. X! void
  129. X  m_initthrow(mtmp,otyp,oquan)
  130. X  struct monst *mtmp;
  131. X  int otyp,oquan;
  132. X***************
  133. X*** 85,91 ****
  134. X      mpickobj(mtmp, otmp);
  135. X  }
  136. X  
  137. X! XSTATIC void
  138. X  m_initweap(mtmp)
  139. X  register struct monst *mtmp;
  140. X  {
  141. X--- 91,100 ----
  142. X      mpickobj(mtmp, otmp);
  143. X  }
  144. X  
  145. X! #endif /* OVLB */
  146. X! #ifdef OVL2
  147. X! 
  148. X! STATIC_OVL void
  149. X  m_initweap(mtmp)
  150. X  register struct monst *mtmp;
  151. X  {
  152. X***************
  153. X*** 360,366 ****
  154. X      }
  155. X  }
  156. X  
  157. X! #endif /* OVLB */
  158. X  #ifdef OVL1
  159. X  
  160. X  static void
  161. X--- 369,375 ----
  162. X      }
  163. X  }
  164. X  
  165. X! #endif /* OVL2 */
  166. X  #ifdef OVL1
  167. X  
  168. X  static void
  169. X***************
  170. X*** 460,466 ****
  171. X  /*
  172. X   * called with [x,y] = coordinates;
  173. X   *    [0,0] means anyplace
  174. X!  *    [u.ux,u.uy] means: call mnexto (if !in_mklev)
  175. X   *
  176. X   *    In case we make a monster group, only return the one at [x,y].
  177. X   */
  178. X--- 469,475 ----
  179. X  /*
  180. X   * called with [x,y] = coordinates;
  181. X   *    [0,0] means anyplace
  182. X!  *    [u.ux,u.uy] means: near player (if !in_mklev)
  183. X   *
  184. X   *    In case we make a monster group, only return the one at [x,y].
  185. X   */
  186. X***************
  187. X*** 472,477 ****
  188. X--- 481,487 ----
  189. X      register struct monst *mtmp;
  190. X      register int    ct;
  191. X      boolean anything = (!ptr);
  192. X+     boolean byyou = (x == u.ux && y == u.uy);
  193. X  
  194. X      /* if caller wants random location, do it here */
  195. X      if(x == 0 && y == 0) {
  196. X***************
  197. X*** 487,492 ****
  198. X--- 497,510 ----
  199. X              y = rn2(ROWNO);
  200. X          } while(!goodpos(x, y, ptr) ||
  201. X              (!in_mklev && tryct++ < 50 && inroom(x, y) == uroom));
  202. X+     } else if (byyou && !in_mklev) {
  203. X+         coord bypos;
  204. X+ 
  205. X+         if(enexto(&bypos, u.ux, u.uy, ptr)) {
  206. X+             x = bypos.x;
  207. X+             y = bypos.y;
  208. X+         } else
  209. X+             return((struct monst *)0);
  210. X      }
  211. X  
  212. X      /* if a monster already exists at the position, return */
  213. X***************
  214. X*** 508,514 ****
  215. X          }
  216. X      }
  217. X      /* if it's unique, don't ever make it again */
  218. X!     if (ptr->geno & G_UNIQ) ptr->geno &= G_GENOD;
  219. X  /* gotmon:    /* label not referenced */
  220. X      mtmp = newmonst(ptr->pxlth);
  221. X      *mtmp = zeromonst;        /* clear all entries in structure */
  222. X--- 526,532 ----
  223. X          }
  224. X      }
  225. X      /* if it's unique, don't ever make it again */
  226. X!     if (ptr->geno & G_UNIQ) ptr->geno |= G_GENOD;
  227. X  /* gotmon:    /* label not referenced */
  228. X      mtmp = newmonst(ptr->pxlth);
  229. X      *mtmp = zeromonst;        /* clear all entries in structure */
  230. X***************
  231. X*** 550,556 ****
  232. X              mtmp->mhide = 1;
  233. X              if(in_mklev)
  234. X                  if(x && y)
  235. X!                 (void) mkobj_at(0, x, y);
  236. X              if(OBJ_AT(x, y) || levl[x][y].gmask)
  237. X                  mtmp->mundetected = 1;
  238. X              break;
  239. X--- 568,574 ----
  240. X              mtmp->mhide = 1;
  241. X              if(in_mklev)
  242. X                  if(x && y)
  243. X!                 (void) mkobj_at(0, x, y, TRUE);
  244. X              if(OBJ_AT(x, y) || levl[x][y].gmask)
  245. X                  mtmp->mundetected = 1;
  246. X              break;
  247. X***************
  248. X*** 600,612 ****
  249. X              (ptr == &mons[PM_GIANT_EEL])) && rn2(5))
  250. X              mtmp->msleep = 1;
  251. X      } else {
  252. X!         if(x == u.ux && y == u.uy) {
  253. X!             mnexto(mtmp);
  254. X!             if (ptr->mlet == S_MIMIC) {
  255. X!                 set_mimic_sym(mtmp);
  256. X!                 unpmon(mtmp);
  257. X!                 pmon(mtmp);
  258. X!             }
  259. X          }
  260. X      }
  261. X  #ifdef INFERNO
  262. X--- 618,626 ----
  263. X              (ptr == &mons[PM_GIANT_EEL])) && rn2(5))
  264. X              mtmp->msleep = 1;
  265. X      } else {
  266. X!         if(byyou) {
  267. X!             pmon(mtmp);
  268. X!             set_apparxy(mtmp);
  269. X          }
  270. X      }
  271. X  #ifdef INFERNO
  272. X***************
  273. X*** 639,645 ****
  274. X      return(mtmp);
  275. X  }
  276. X  
  277. X! void
  278. X  enexto(cc, xx, yy, mdat)
  279. X  coord *cc;
  280. X  register xchar xx, yy;
  281. X--- 653,659 ----
  282. X      return(mtmp);
  283. X  }
  284. X  
  285. X! boolean
  286. X  enexto(cc, xx, yy, mdat)
  287. X  coord *cc;
  288. X  register xchar xx, yy;
  289. X***************
  290. X*** 648,688 ****
  291. X      register xchar x,y;
  292. X      coord foo[15], *tfoo;
  293. X      int range, i;
  294. X  
  295. X      tfoo = foo;
  296. X      range = 1;
  297. X      do {    /* full kludge action. */
  298. X!         for(x = xx-range; x <= xx+range; x++)
  299. X!             if(goodpos(x, yy-range, mdat)) {
  300. X                  tfoo->x = x;
  301. X!                 (tfoo++)->y = yy-range;
  302. X                  if(tfoo == &foo[15]) goto foofull;
  303. X              }
  304. X!         for(x = xx-range; x <= xx+range; x++)
  305. X!             if(goodpos(x, yy+range, mdat)) {
  306. X                  tfoo->x = x;
  307. X!                 (tfoo++)->y = yy+range;
  308. X                  if(tfoo == &foo[15]) goto foofull;
  309. X              }
  310. X!         for(y = yy+1-range; y < yy+range; y++)
  311. X!             if(goodpos(xx-range, y, mdat)) {
  312. X!                 tfoo->x = xx-range;
  313. X                  (tfoo++)->y = y;
  314. X                  if(tfoo == &foo[15]) goto foofull;
  315. X              }
  316. X!         for(y = yy+1-range; y < yy+range; y++)
  317. X!             if(goodpos(xx+range, y, mdat)) {
  318. X!                 tfoo->x = xx+range;
  319. X                  (tfoo++)->y = y;
  320. X                  if(tfoo == &foo[15]) goto foofull;
  321. X              }
  322. X          range++;
  323. X      } while(tfoo == foo);
  324. X  foofull:
  325. X      i = rn2((int)(tfoo - foo));
  326. X      cc->x = foo[i].x;
  327. X      cc->y = foo[i].y;
  328. X!     return;
  329. X  }
  330. X  
  331. X  int
  332. X--- 662,709 ----
  333. X      register xchar x,y;
  334. X      coord foo[15], *tfoo;
  335. X      int range, i;
  336. X+     int xmin, xmax, ymin, ymax;
  337. X  
  338. X      tfoo = foo;
  339. X      range = 1;
  340. X      do {    /* full kludge action. */
  341. X!         xmin = max(0, xx-range);
  342. X!         xmax = min(COLNO, xx+range);
  343. X!         ymin = max(0, yy-range);
  344. X!         ymax = min(ROWNO, yy+range);
  345. X! 
  346. X!         for(x = xmin; x <= xmax; x++)
  347. X!             if(goodpos(x, ymin, mdat)) {
  348. X                  tfoo->x = x;
  349. X!                 (tfoo++)->y = ymin;
  350. X                  if(tfoo == &foo[15]) goto foofull;
  351. X              }
  352. X!         for(x = xmin; x <= xmax; x++)
  353. X!             if(goodpos(x, ymax, mdat)) {
  354. X                  tfoo->x = x;
  355. X!                 (tfoo++)->y = ymax;
  356. X                  if(tfoo == &foo[15]) goto foofull;
  357. X              }
  358. X!         for(y = ymin+1; y < ymax; y++)
  359. X!             if(goodpos(xmin, y, mdat)) {
  360. X!                 tfoo->x = xmin;
  361. X                  (tfoo++)->y = y;
  362. X                  if(tfoo == &foo[15]) goto foofull;
  363. X              }
  364. X!         for(y = ymin+1; y < ymax; y++)
  365. X!             if(goodpos(xmax, y, mdat)) {
  366. X!                 tfoo->x = xmax;
  367. X                  (tfoo++)->y = y;
  368. X                  if(tfoo == &foo[15]) goto foofull;
  369. X              }
  370. X          range++;
  371. X+         if(range > ROWNO && range > COLNO) return FALSE;
  372. X      } while(tfoo == foo);
  373. X  foofull:
  374. X      i = rn2((int)(tfoo - foo));
  375. X      cc->x = foo[i].x;
  376. X      cc->y = foo[i].y;
  377. X!     return TRUE;
  378. X  }
  379. X  
  380. X  int
  381. X***************
  382. X*** 710,716 ****
  383. X  #endif /* OVL1 */
  384. X  #ifdef OVLB
  385. X  
  386. X! static void
  387. X  rloc_to(mtmp, x, y)
  388. X  struct monst *mtmp;
  389. X  register int x,y;
  390. X--- 731,738 ----
  391. X  #endif /* OVL1 */
  392. X  #ifdef OVLB
  393. X  
  394. X! STATIC_OVL
  395. X! void
  396. X  rloc_to(mtmp, x, y)
  397. X  struct monst *mtmp;
  398. X  register int x,y;
  399. X***************
  400. X*** 732,737 ****
  401. X--- 754,762 ----
  402. X      set_apparxy(mtmp);
  403. X  }
  404. X  
  405. X+ #endif /* OVLB */
  406. X+ #ifdef OVL2
  407. X+ 
  408. X  void
  409. X  rloc(mtmp)
  410. X  struct monst *mtmp;
  411. X***************
  412. X*** 748,753 ****
  413. X--- 773,781 ----
  414. X      rloc_to(mtmp, x, y);
  415. X  }
  416. X  
  417. X+ #endif /* OVL2 */
  418. X+ #ifdef OVLB
  419. X+ 
  420. X  void
  421. X  vloc(mtmp)
  422. X  struct monst *mtmp;
  423. X***************
  424. X*** 870,879 ****
  425. X      register struct permonst *ptr;
  426. X      register int i, ct;
  427. X      register int zlevel;
  428. X!     static int minmlev, maxmlev, accept;
  429. X!     static long oldmoves = 0L;    /* != 1, starting value of moves */
  430. X  #ifdef REINCARNATION
  431. X!     static boolean upper;
  432. X  
  433. X      upper = (dlevel == rogue_level);
  434. X  #endif
  435. X--- 898,907 ----
  436. X      register struct permonst *ptr;
  437. X      register int i, ct;
  438. X      register int zlevel;
  439. X!     static int NEARDATA minmlev, NEARDATA maxmlev, NEARDATA accept;
  440. X!     static long NEARDATA oldmoves = 0L;    /* != 1, starting value of moves */
  441. X  #ifdef REINCARNATION
  442. X!     static boolean NEARDATA upper;
  443. X  
  444. X      upper = (dlevel == rogue_level);
  445. X  #endif
  446. X***************
  447. X*** 1019,1025 ****
  448. X      if (ptr->mlevel >= 50 || mtmp->mhpmax <= 8*mtmp->m_lev)
  449. X          return ptr;
  450. X      newtype = little_to_big(monsndx(ptr));
  451. X!     if (++mtmp->m_lev >= mons[newtype].mlevel) {
  452. X          if (mons[newtype].geno & G_GENOD) {
  453. X              pline("As %s grows up into %s, %s dies!",
  454. X                  mon_nam(mtmp),
  455. X--- 1047,1054 ----
  456. X      if (ptr->mlevel >= 50 || mtmp->mhpmax <= 8*mtmp->m_lev)
  457. X          return ptr;
  458. X      newtype = little_to_big(monsndx(ptr));
  459. X!     if (++mtmp->m_lev >= mons[newtype].mlevel
  460. X!                     && newtype != monsndx(ptr)) {
  461. X          if (mons[newtype].geno & G_GENOD) {
  462. X              pline("As %s grows up into %s, %s dies!",
  463. X                  mon_nam(mtmp),
  464. X***************
  465. X*** 1033,1038 ****
  466. X--- 1062,1069 ----
  467. X      }
  468. X      if (mtmp->m_lev > 3*mtmp->data->mlevel / 2)
  469. X          mtmp->m_lev = 3*mtmp->data->mlevel / 2;
  470. X+     if (mtmp->mhp > mtmp->m_lev * 8)
  471. X+         mtmp->mhp = mtmp->m_lev * 8;
  472. X      return(mtmp->data);
  473. X  }
  474. X  
  475. X***************
  476. X*** 1145,1151 ****
  477. X  #endif /* OVL1 */
  478. X  #ifdef OVLB
  479. X  
  480. X! static char syms[] = { 0, 1, RING_SYM, WAND_SYM, WEAPON_SYM, FOOD_SYM, GOLD_SYM,
  481. X      SCROLL_SYM, POTION_SYM, ARMOR_SYM, AMULET_SYM, TOOL_SYM, ROCK_SYM,
  482. X      GEM_SYM,
  483. X  #ifdef SPELLS
  484. X--- 1176,1182 ----
  485. X  #endif /* OVL1 */
  486. X  #ifdef OVLB
  487. X  
  488. X! static char NEARDATA syms[] = { 0, 1, RING_SYM, WAND_SYM, WEAPON_SYM, FOOD_SYM, GOLD_SYM,
  489. X      SCROLL_SYM, POTION_SYM, ARMOR_SYM, AMULET_SYM, TOOL_SYM, ROCK_SYM,
  490. X      GEM_SYM,
  491. X  #ifdef SPELLS
  492. X*** src/Old/mhitm.c    Sun Jun  3 13:30:42 1990
  493. X--- src/mhitm.c    Thu May 31 22:11:05 1990
  494. X***************
  495. X*** 9,20 ****
  496. X  
  497. X  #ifdef OVLB
  498. X  
  499. X! static boolean vis, far_noise;
  500. X! static long noisetime;
  501. X! static struct obj *otmp;
  502. X  
  503. X- #endif /* OVLB */
  504. X- 
  505. X  static void FDECL(mrustm, (struct monst *, struct monst *, struct obj *));
  506. X  static int FDECL(hitmm, (struct monst *,struct monst *,struct attack *));
  507. X  static int FDECL(gazemm, (struct monst *,struct monst *,struct attack *));
  508. X--- 9,18 ----
  509. X  
  510. X  #ifdef OVLB
  511. X  
  512. X! static boolean NEARDATA vis, NEARDATA far_noise;
  513. X! static long NEARDATA noisetime;
  514. X! static struct obj NEARDATA *otmp;
  515. X  
  516. X  static void FDECL(mrustm, (struct monst *, struct monst *, struct obj *));
  517. X  static int FDECL(hitmm, (struct monst *,struct monst *,struct attack *));
  518. X  static int FDECL(gazemm, (struct monst *,struct monst *,struct attack *));
  519. X***************
  520. X*** 25,32 ****
  521. X  static void FDECL(noises,(struct monst *,struct attack *));
  522. X  static void FDECL(missmm,(struct monst *,struct monst *,struct attack *));
  523. X  
  524. X- #ifdef OVLB
  525. X- 
  526. X  static void
  527. X  noises(magr, mattk)
  528. X      register struct monst *magr;
  529. X--- 23,28 ----
  530. X***************
  531. X*** 391,411 ****
  532. X              tmp = 0;
  533. X              break;
  534. X          }
  535. X- #ifdef GOLEMS
  536. X-         golemeffects(mdef, AD_FIRE, tmp);
  537. X- #endif /* GOLEMS */
  538. X          if(vis) pline("%s is on fire!", Monnam(mdef));
  539. X          if(resists_fire(pd)) {
  540. X              pline("The fire doesn't seem to burn %s!", mon_nam(mdef));
  541. X              shieldeff(mdef->mx, mdef->my);
  542. X              tmp = 0;
  543. X-         } else {
  544. X-             tmp += destroy_mitem(mdef, SCROLL_SYM, AD_FIRE);
  545. X-             tmp += destroy_mitem(mdef, POTION_SYM, AD_FIRE);
  546. X- #ifdef SPELLS
  547. X-             tmp += destroy_mitem(mdef, SPBOOK_SYM, AD_FIRE);
  548. X- #endif
  549. X          }
  550. X          break;
  551. X          case AD_COLD:
  552. X          if (magr->mcan) {
  553. X--- 387,407 ----
  554. X              tmp = 0;
  555. X              break;
  556. X          }
  557. X          if(vis) pline("%s is on fire!", Monnam(mdef));
  558. X+         tmp += destroy_mitem(mdef, SCROLL_SYM, AD_FIRE);
  559. X+ #ifdef SPELLS
  560. X+         tmp += destroy_mitem(mdef, SPBOOK_SYM, AD_FIRE);
  561. X+ #endif
  562. X          if(resists_fire(pd)) {
  563. X              pline("The fire doesn't seem to burn %s!", mon_nam(mdef));
  564. X              shieldeff(mdef->mx, mdef->my);
  565. X+ #ifdef GOLEMS
  566. X+             golemeffects(mdef, AD_FIRE, tmp);
  567. X+ #endif /* GOLEMS */
  568. X              tmp = 0;
  569. X          }
  570. X+         /* only potions damage resistant players in destroy_item */
  571. X+         tmp += destroy_mitem(mdef, POTION_SYM, AD_FIRE);
  572. X          break;
  573. X          case AD_COLD:
  574. X          if (magr->mcan) {
  575. X***************
  576. X*** 412,427 ****
  577. X              tmp = 0;
  578. X              break;
  579. X          }
  580. X- #ifdef GOLEMS
  581. X-         golemeffects(mdef, AD_COLD, tmp);
  582. X- #endif /* GOLEMS */
  583. X          if(vis) pline("%s is covered in frost!", Monnam(mdef));
  584. X          if(resists_cold(pd)) {
  585. X              pline("The frost doesn't seem to chill %s!",
  586. X              mon_nam(mdef));
  587. X              shieldeff(mdef->mx, mdef->my);
  588. X              tmp = 0;
  589. X!         } else tmp += destroy_mitem(mdef, POTION_SYM, AD_COLD);
  590. X          break;
  591. X          case AD_ELEC:
  592. X          if (magr->mcan) {
  593. X--- 408,424 ----
  594. X              tmp = 0;
  595. X              break;
  596. X          }
  597. X          if(vis) pline("%s is covered in frost!", Monnam(mdef));
  598. X          if(resists_cold(pd)) {
  599. X              pline("The frost doesn't seem to chill %s!",
  600. X              mon_nam(mdef));
  601. X              shieldeff(mdef->mx, mdef->my);
  602. X+ #ifdef GOLEMS
  603. X+             golemeffects(mdef, AD_COLD, tmp);
  604. X+ #endif /* GOLEMS */
  605. X              tmp = 0;
  606. X!         }
  607. X!         tmp += destroy_mitem(mdef, POTION_SYM, AD_COLD);
  608. X          break;
  609. X          case AD_ELEC:
  610. X          if (magr->mcan) {
  611. X***************
  612. X*** 428,442 ****
  613. X              tmp = 0;
  614. X              break;
  615. X          }
  616. X- #ifdef GOLEMS
  617. X-         golemeffects(mdef, AD_ELEC, tmp);
  618. X- #endif /* GOLEMS */
  619. X          if(vis) pline("%s gets zapped!", Monnam(mdef));
  620. X          if(resists_elec(pd)) {
  621. X              pline("The zap doesn't shock %s!", mon_nam(mdef));
  622. X              shieldeff(mdef->mx, mdef->my);
  623. X              tmp = 0;
  624. X          }
  625. X          break;
  626. X          case AD_ACID:
  627. X          if (magr->mcan) {
  628. X--- 425,442 ----
  629. X              tmp = 0;
  630. X              break;
  631. X          }
  632. X          if(vis) pline("%s gets zapped!", Monnam(mdef));
  633. X+         tmp += destroy_mitem(mdef, WAND_SYM, AD_ELEC);
  634. X          if(resists_elec(pd)) {
  635. X              pline("The zap doesn't shock %s!", mon_nam(mdef));
  636. X              shieldeff(mdef->mx, mdef->my);
  637. X+ #ifdef GOLEMS
  638. X+             golemeffects(mdef, AD_ELEC, tmp);
  639. X+ #endif /* GOLEMS */
  640. X              tmp = 0;
  641. X          }
  642. X+         /* only rings damage resistant players in destroy_item */
  643. X+         tmp += destroy_mitem(mdef, RING_SYM, AD_ELEC);
  644. X          break;
  645. X          case AD_ACID:
  646. X          if (magr->mcan) {
  647. X***************
  648. X*** 459,465 ****
  649. X              else if(mdef->mtame)
  650. X                   pline("May %s rust in peace.", mon_nam(mdef));
  651. X              mondied(mdef);
  652. X!             magr->mhpmax += 1 + rn2((int)mdef->m_lev+1);
  653. X              ptr = grow_up(magr);
  654. X              if(!ptr) return(-1);
  655. X              return(2);
  656. X--- 459,466 ----
  657. X              else if(mdef->mtame)
  658. X                   pline("May %s rust in peace.", mon_nam(mdef));
  659. X              mondied(mdef);
  660. X!             magr->mhpmax = magr->mhpmax +
  661. X!                                             (1 + rn2((int)mdef->m_lev+1));
  662. X              ptr = grow_up(magr);
  663. X              if(!ptr) return(-1);
  664. X              return(2);
  665. X***************
  666. X*** 475,481 ****
  667. X              else if(mdef->mtame)
  668. X                   pline("May %s rot in peace.", mon_nam(mdef));
  669. X              mondied(mdef);
  670. X!             magr->mhpmax += 1 + rn2((int)mdef->m_lev+1);
  671. X              ptr = grow_up(magr);
  672. X              if(!ptr) return(-1);
  673. X              return(2);
  674. X--- 476,483 ----
  675. X              else if(mdef->mtame)
  676. X                   pline("May %s rot in peace.", mon_nam(mdef));
  677. X              mondied(mdef);
  678. X!             magr->mhpmax = magr->mhpmax +
  679. X!                                    (1 + rn2((int)mdef->m_lev+1));
  680. X              ptr = grow_up(magr);
  681. X              if(!ptr) return(-1);
  682. X              return(2);
  683. X***************
  684. X*** 485,491 ****
  685. X          break;
  686. X          case AD_STON:
  687. X          if(!resists_ston(pd)) {
  688. X!             magr->mhpmax += 1 + rn2((int)mdef->m_lev+1);
  689. X              if(vis) pline("%s turns to stone!", Monnam(mdef));
  690. X              else if(mdef->mtame) You(psf);
  691. X              monstone(mdef);
  692. X--- 487,494 ----
  693. X          break;
  694. X          case AD_STON:
  695. X          if(!resists_ston(pd)) {
  696. X!             magr->mhpmax = magr->mhpmax +
  697. X!                                               (1 + rn2((int)mdef->m_lev+1));
  698. X              if(vis) pline("%s turns to stone!", Monnam(mdef));
  699. X              else if(mdef->mtame) You(psf);
  700. X              monstone(mdef);
  701. X***************
  702. X*** 571,577 ****
  703. X                  else if (mdef->mtame)
  704. X      You("have a strangely sad feeling for a moment, then it passes.");
  705. X                  mondied(mdef);
  706. X!                 magr->mhpmax += 1 + rn2((int)mdef->m_lev+1);
  707. X                  ptr = grow_up(magr);
  708. X                  if(!ptr) return(-1);
  709. X                  return(2);
  710. X--- 574,581 ----
  711. X                  else if (mdef->mtame)
  712. X      You("have a strangely sad feeling for a moment, then it passes.");
  713. X                  mondied(mdef);
  714. X!                 magr->mhpmax = magr->mhpmax +
  715. X!                               (1 + rn2((int)mdef->m_lev+1));
  716. X                  ptr = grow_up(magr);
  717. X                  if(!ptr) return(-1);
  718. X                  return(2);
  719. X***************
  720. X*** 657,663 ****
  721. X      if(!tmp) return(1);
  722. X  
  723. X      if((mdef->mhp -= tmp) < 1) {
  724. X!         magr->mhpmax += 1 + rn2((int)mdef->m_lev+1);
  725. X          if(vis)
  726. X          pline("%s is %s!", Monnam(mdef),
  727. X              (is_demon(mdef->data) || is_undead(mdef->data)) ?
  728. X--- 661,667 ----
  729. X      if(!tmp) return(1);
  730. X  
  731. X      if((mdef->mhp -= tmp) < 1) {
  732. X!         magr->mhpmax = magr->mhpmax + (1 + rn2((int)mdef->m_lev+1));
  733. X          if(vis)
  734. X          pline("%s is %s!", Monnam(mdef),
  735. X              (is_demon(mdef->data) || is_undead(mdef->data)) ?
  736. X***************
  737. X*** 669,677 ****
  738. X          if(!ptr) return(-1);
  739. X          return(2);
  740. X      }
  741. X-     /* fixes a bug where max monster hp could overflow. */
  742. X-     if(magr->mhpmax <= 0 || magr->mhpmax > MHPMAX) magr->mhpmax = MHPMAX;
  743. X- 
  744. X      return(1);
  745. X  }
  746. X  
  747. X--- 673,678 ----
  748. X*** src/Old/mhitu.c    Sun Jun  3 13:31:19 1990
  749. X--- src/mhitu.c    Thu May 31 22:11:59 1990
  750. X***************
  751. X*** 7,34 ****
  752. X  #  include "artifact.h"
  753. X  #endif
  754. X  
  755. X! VSTATIC struct obj *otmp;
  756. X  
  757. X  #ifdef POLYSELF
  758. X! OSTATIC void FDECL(urustm, (struct monst *, struct obj *));
  759. X  static int FDECL(passiveum, (struct permonst *,struct monst *,struct attack *));
  760. X! #endif
  761. X! #ifdef SEDUCE
  762. X  static void FDECL(mayberem, (struct obj *, const char *));
  763. X! #endif
  764. X! OSTATIC int FDECL(hitmu, (struct monst *,struct attack *));
  765. X! OSTATIC int FDECL(gulpmu, (struct monst *,struct attack *));
  766. X! OSTATIC int FDECL(explmu, (struct monst *,struct attack *));
  767. X! OSTATIC int FDECL(gazemu, (struct monst *,struct attack *));
  768. X! static void FDECL(hitmsg,(struct monst *,struct attack *));
  769. X! OSTATIC void FDECL(missmu,(struct monst *,BOOLEAN_P,struct attack *));
  770. X! OSTATIC void FDECL(mswings,(struct monst *,struct obj *));
  771. X! OSTATIC void FDECL(wildmiss,(struct monst *));
  772. X  
  773. X! OSTATIC void FDECL(hurtarmor,(struct permonst *,int));
  774. X  
  775. X  #ifdef OVL1
  776. X  
  777. X  static void
  778. X  hitmsg(mtmp, mattk)
  779. X  register struct monst *mtmp;
  780. X--- 7,41 ----
  781. X  #  include "artifact.h"
  782. X  #endif
  783. X  
  784. X! STATIC_VAR struct obj NEARDATA *otmp;
  785. X  
  786. X  #ifdef POLYSELF
  787. X! STATIC_DCL void FDECL(urustm, (struct monst *, struct obj *));
  788. X! # ifdef OVL1
  789. X  static int FDECL(passiveum, (struct permonst *,struct monst *,struct attack *));
  790. X! # endif /* OVL1 */
  791. X! #endif /* POLYSELF */
  792. X! 
  793. X! #ifdef OVLB
  794. X! # ifdef SEDUCE
  795. X  static void FDECL(mayberem, (struct obj *, const char *));
  796. X! # endif
  797. X! #endif /* OVLB */
  798. X  
  799. X! STATIC_DCL int FDECL(hitmu, (struct monst *,struct attack *));
  800. X! STATIC_DCL int FDECL(gulpmu, (struct monst *,struct attack *));
  801. X! STATIC_DCL int FDECL(explmu, (struct monst *,struct attack *));
  802. X! STATIC_DCL int FDECL(gazemu, (struct monst *,struct attack *));
  803. X! STATIC_DCL void FDECL(missmu,(struct monst *,BOOLEAN_P,struct attack *));
  804. X! STATIC_DCL void FDECL(mswings,(struct monst *,struct obj *));
  805. X! STATIC_DCL void FDECL(wildmiss,(struct monst *));
  806. X  
  807. X+ STATIC_DCL void FDECL(hurtarmor,(struct permonst *,int));
  808. X+ 
  809. X  #ifdef OVL1
  810. X  
  811. X+ static void FDECL(hitmsg,(struct monst *,struct attack *));
  812. X+ 
  813. X  static void
  814. X  hitmsg(mtmp, mattk)
  815. X  register struct monst *mtmp;
  816. X***************
  817. X*** 69,78 ****
  818. X          }
  819. X  }
  820. X  
  821. X! #endif /* OVL1 */
  822. X! #ifdef OVLB
  823. X! 
  824. X! XSTATIC void
  825. X  missmu(mtmp, nearmiss, mattk)        /* monster missed you */
  826. X  register struct monst *mtmp;
  827. X  register boolean nearmiss;
  828. X--- 76,82 ----
  829. X          }
  830. X  }
  831. X  
  832. X! STATIC_OVL void
  833. X  missmu(mtmp, nearmiss, mattk)        /* monster missed you */
  834. X  register struct monst *mtmp;
  835. X  register boolean nearmiss;
  836. X***************
  837. X*** 88,94 ****
  838. X      }
  839. X  }
  840. X  
  841. X! XSTATIC void
  842. X  mswings(mtmp, otemp)        /* monster swings obj */
  843. X  register struct monst *mtmp;
  844. X  register struct obj *otemp;
  845. X--- 92,98 ----
  846. X      }
  847. X  }
  848. X  
  849. X! STATIC_OVL void
  850. X  mswings(mtmp, otemp)        /* monster swings obj */
  851. X  register struct monst *mtmp;
  852. X  register struct obj *otemp;
  853. X***************
  854. X*** 105,111 ****
  855. X            xname(otemp));
  856. X  }
  857. X  
  858. X! XSTATIC void
  859. X  wildmiss(mtmp)        /* monster attacked your displaced image */
  860. X      register struct monst *mtmp;
  861. X  {
  862. X--- 109,118 ----
  863. X            xname(otemp));
  864. X  }
  865. X  
  866. X! #endif /* OVL1 */
  867. X! #ifdef OVLB
  868. X! 
  869. X! STATIC_OVL void
  870. X  wildmiss(mtmp)        /* monster attacked your displaced image */
  871. X      register struct monst *mtmp;
  872. X  {
  873. X***************
  874. X*** 271,277 ****
  875. X              remove_monster(mtmp->mx, mtmp->my);
  876. X              place_monster(mtmp, u.ux, u.uy);
  877. X              pmon(mtmp);
  878. X!             enexto(&cc, u.ux, u.uy, &playermon);
  879. X              teleds(cc.x, cc.y);
  880. X              You("fall from the ceiling!");
  881. X              if (is_mercenary(mtmp->data) && m_carrying(mtmp,HELMET)) {
  882. X--- 278,284 ----
  883. X              remove_monster(mtmp->mx, mtmp->my);
  884. X              place_monster(mtmp, u.ux, u.uy);
  885. X              pmon(mtmp);
  886. X!             (void) enexto(&cc, u.ux, u.uy, &playermon);
  887. X              teleds(cc.x, cc.y);
  888. X              You("fall from the ceiling!");
  889. X              if (is_mercenary(mtmp->data) && m_carrying(mtmp,HELMET)) {
  890. X***************
  891. X*** 507,513 ****
  892. X   * helper function for some compilers that have trouble with hitmu
  893. X   */
  894. X  
  895. X! XSTATIC
  896. X  void
  897. X  hurtarmor(mdat, attk)
  898. X  struct permonst *mdat;
  899. X--- 514,520 ----
  900. X   * helper function for some compilers that have trouble with hitmu
  901. X   */
  902. X  
  903. X! STATIC_OVL
  904. X  void
  905. X  hurtarmor(mdat, attk)
  906. X  struct permonst *mdat;
  907. X***************
  908. X*** 580,586 ****
  909. X   *      3 if the monster lives but teleported/paralyzed, so it can't keep
  910. X   *           attacking you
  911. X   */
  912. X! XSTATIC
  913. X  int
  914. X  hitmu(mtmp, mattk)
  915. X      register struct monst *mtmp;
  916. X--- 587,593 ----
  917. X   *      3 if the monster lives but teleported/paralyzed, so it can't keep
  918. X   *           attacking you
  919. X   */
  920. X! STATIC_OVL
  921. X  int
  922. X  hitmu(mtmp, mattk)
  923. X      register struct monst *mtmp;
  924. X***************
  925. X*** 588,593 ****
  926. X--- 595,601 ----
  927. X  {
  928. X      register struct permonst *mdat = mtmp->data;
  929. X      register int dmg, ctmp, ptmp;
  930. X+     int armpro;
  931. X      char     buf[BUFSZ];
  932. X  #ifdef POLYSELF
  933. X      struct permonst *olduasmon = uasmon;
  934. X***************
  935. X*** 621,629 ****
  936. X  /*    Use ctmp when the cancellation factor takes into account certain
  937. X   *    armor's special magic protection.  Otherwise just use !mtmp->mcan.
  938. X   */
  939. X!     ctmp = !mtmp->mcan &&
  940. X!         (!uarm || (rn2(3) >= objects[uarm->otyp].a_can) || !rn2(50))
  941. X!          && (!uarmc || (rn2(3) >= objects[uarmc->otyp].a_can) || !rn2(50));
  942. X  
  943. X  /*    Now, adjust damages via resistances or specific attacks */
  944. X      switch(mattk->adtyp) {
  945. X--- 629,640 ----
  946. X  /*    Use ctmp when the cancellation factor takes into account certain
  947. X   *    armor's special magic protection.  Otherwise just use !mtmp->mcan.
  948. X   */
  949. X!     armpro = 0;
  950. X!     if (uarm && armpro < objects[uarm->otyp].a_can)
  951. X!         armpro = objects[uarm->otyp].a_can;
  952. X!     if (uarmc && armpro < objects[uarmc->otyp].a_can)
  953. X!         armpro = objects[uarmc->otyp].a_can;
  954. X!     ctmp = !mtmp->mcan && ((rn2(3) >= armpro) || !rn2(50));
  955. X  
  956. X  /*    Now, adjust damages via resistances or specific attacks */
  957. X      switch(mattk->adtyp) {
  958. X***************
  959. X*** 1057,1063 ****
  960. X          case AD_CONF:
  961. X          hitmsg(mtmp, mattk);
  962. X          if(!mtmp->mcan && !rn2(4) && !mtmp->mspec_used) {
  963. X!             mtmp->mspec_used += (dmg + rn2(6));
  964. X              if(Confusion)
  965. X               You("are getting even more confused.");
  966. X              else You("are getting confused.");
  967. X--- 1068,1074 ----
  968. X          case AD_CONF:
  969. X          hitmsg(mtmp, mattk);
  970. X          if(!mtmp->mcan && !rn2(4) && !mtmp->mspec_used) {
  971. X!             mtmp->mspec_used = mtmp->mspec_used + (dmg + rn2(6));
  972. X              if(Confusion)
  973. X               You("are getting even more confused.");
  974. X              else You("are getting confused.");
  975. X***************
  976. X*** 1093,1099 ****
  977. X  #endif /* OVL1 */
  978. X  #ifdef OVLB
  979. X  
  980. X! XSTATIC
  981. X  int
  982. X  gulpmu(mtmp, mattk)    /* monster swallows you, or damage if u.uswallow */
  983. X      register struct monst *mtmp;
  984. X--- 1104,1110 ----
  985. X  #endif /* OVL1 */
  986. X  #ifdef OVLB
  987. X  
  988. X! STATIC_OVL
  989. X  int
  990. X  gulpmu(mtmp, mattk)    /* monster swallows you, or damage if u.uswallow */
  991. X      register struct monst *mtmp;
  992. X***************
  993. X*** 1254,1260 ****
  994. X      return(1);
  995. X  }
  996. X  
  997. X! XSTATIC
  998. X  int
  999. X  explmu(mtmp, mattk)    /* monster explodes in your face */
  1000. X      register struct monst *mtmp;
  1001. X--- 1265,1271 ----
  1002. X      return(1);
  1003. X  }
  1004. X  
  1005. X! STATIC_OVL
  1006. X  int
  1007. X  explmu(mtmp, mattk)    /* monster explodes in your face */
  1008. X      register struct monst *mtmp;
  1009. X***************
  1010. X*** 1302,1308 ****
  1011. X      return(2);    /* it dies */
  1012. X  }
  1013. X  
  1014. X! XSTATIC
  1015. X  int
  1016. X  gazemu(mtmp, mattk)    /* monster gazes at you */
  1017. X      register struct monst *mtmp;
  1018. X--- 1313,1319 ----
  1019. X      return(2);    /* it dies */
  1020. X  }
  1021. X  
  1022. X! STATIC_OVL
  1023. X  int
  1024. X  gazemu(mtmp, mattk)    /* monster gazes at you */
  1025. X      register struct monst *mtmp;
  1026. X***************
  1027. X*** 1335,1341 ****
  1028. X                      !mtmp->mspec_used && rn2(5)) {
  1029. X              int conf = d(3,4);
  1030. X  
  1031. X!             mtmp->mspec_used += (conf + rn2(6));
  1032. X              if(!Confusion)
  1033. X              pline("%s's gaze confuses you!", Monnam(mtmp));
  1034. X              else
  1035. X--- 1346,1352 ----
  1036. X                      !mtmp->mspec_used && rn2(5)) {
  1037. X              int conf = d(3,4);
  1038. X  
  1039. X!             mtmp->mspec_used = mtmp->mspec_used + (conf + rn2(6));
  1040. X              if(!Confusion)
  1041. X              pline("%s's gaze confuses you!", Monnam(mtmp));
  1042. X              else
  1043. X***************
  1044. X*** 1350,1356 ****
  1045. X              int stun = d(2,6);
  1046. X  
  1047. X              pline("%s stares piercingly at you!", Monnam(mtmp));
  1048. X!             mtmp->mspec_used += (stun + rn2(6));
  1049. X              make_stunned(HStun + stun, TRUE);
  1050. X          }
  1051. X          break;
  1052. X--- 1361,1367 ----
  1053. X              int stun = d(2,6);
  1054. X  
  1055. X              pline("%s stares piercingly at you!", Monnam(mtmp));
  1056. X!             mtmp->mspec_used = mtmp->mspec_used + (stun + rn2(6));
  1057. X              make_stunned(HStun + stun, TRUE);
  1058. X          }
  1059. X          break;
  1060. X***************
  1061. X*** 1387,1393 ****
  1062. X  #ifdef OVLB
  1063. X  
  1064. X  #ifdef POLYSELF
  1065. X! XSTATIC void
  1066. X  urustm(mon, obj)
  1067. X  register struct monst *mon;
  1068. X  register struct obj *obj;
  1069. X--- 1398,1404 ----
  1070. X  #ifdef OVLB
  1071. X  
  1072. X  #ifdef POLYSELF
  1073. X! STATIC_OVL void
  1074. X  urustm(mon, obj)
  1075. X  register struct monst *mon;
  1076. X  register struct obj *obj;
  1077. X***************
  1078. X*** 1561,1568 ****
  1079. X          }
  1080. X      }
  1081. X  
  1082. X!     pline("%s murmurs in your ear, while helping you undress.",
  1083. X!         Blind ? (fem ? "She" : "He") : Monnam(mon));
  1084. X      mayberem(uarmc, "cloak");
  1085. X      if(!uarmc)
  1086. X          mayberem(uarm, "suit");
  1087. X--- 1572,1587 ----
  1088. X          }
  1089. X      }
  1090. X  
  1091. X!     if (!uarmc && !uarmf && !uarmg && !uarms && !uarmh
  1092. X! #ifdef SHIRT
  1093. X!                                 && !uarmu
  1094. X! #endif
  1095. X!                                     )
  1096. X!         pline("%s murmurs sweet nothings into your ear.",
  1097. X!             Blind ? (fem ? "She" : "He") : Monnam(mon));
  1098. X!     else
  1099. X!         pline("%s murmurs in your ear, while helping you undress.",
  1100. X!             Blind ? (fem ? "She" : "He") : Monnam(mon));
  1101. X      mayberem(uarmc, "cloak");
  1102. X      if(!uarmc)
  1103. X          mayberem(uarm, "suit");
  1104. X***************
  1105. X*** 1674,1680 ****
  1106. X  #endif
  1107. X      else {
  1108. X          long cost = (long)rnd(
  1109. X!             (int)(u.ugold > 32767L ? 32767 : u.ugold) +10) + 500;
  1110. X  
  1111. X          if (mon->mpeaceful) {
  1112. X              cost /= 5;
  1113. X--- 1693,1699 ----
  1114. X  #endif
  1115. X      else {
  1116. X          long cost = (long)rnd(
  1117. X!             (int)(u.ugold > 32757L ? 32757 : u.ugold) +10) + 500;
  1118. X  
  1119. X          if (mon->mpeaceful) {
  1120. X              cost /= 5;
  1121. X*** src/Old/mklev.c    Sun Jun  3 13:32:29 1990
  1122. X--- src/mklev.c    Thu May 31 22:13:01 1990
  1123. X***************
  1124. X*** 25,31 ****
  1125. X  static void NDECL(makebigroom);
  1126. X  static void FDECL(addrsx,(int,int,int,int,BOOLEAN_P));
  1127. X  static void FDECL(addrs,(int,int,int,int));
  1128. X! static int FDECL(comp,(genericptr_t,genericptr_t));
  1129. X  static void FDECL(dosdoor,(int,int,struct mkroom *,int));
  1130. X  static void NDECL(makecorridors);
  1131. X  static void FDECL(join,(int,int));
  1132. X--- 25,31 ----
  1133. X  static void NDECL(makebigroom);
  1134. X  static void FDECL(addrsx,(int,int,int,int,BOOLEAN_P));
  1135. X  static void FDECL(addrs,(int,int,int,int));
  1136. X! STATIC_PTR int FDECL(comp,(genericptr_t,genericptr_t));
  1137. X  static void FDECL(dosdoor,(int,int,struct mkroom *,int));
  1138. X  static void NDECL(makecorridors);
  1139. X  static void FDECL(join,(int,int));
  1140. X***************
  1141. X*** 134,142 ****
  1142. X  
  1143. X  /* Args must be genericptr_t so that qsort will always be happy. */
  1144. X  
  1145. X! static int
  1146. X  comp(vx,vy)
  1147. X! genericptr_t vx, vy;
  1148. X  {
  1149. X  #ifdef LINT
  1150. X  /* lint complains about possible pointer alignment problems, but we know
  1151. X--- 134,143 ----
  1152. X  
  1153. X  /* Args must be genericptr_t so that qsort will always be happy. */
  1154. X  
  1155. X! STATIC_PTR int
  1156. X  comp(vx,vy)
  1157. X! genericptr_t vx;
  1158. X! genericptr_t vy;
  1159. X  {
  1160. X  #ifdef LINT
  1161. X  /* lint complains about possible pointer alignment problems, but we know
  1162. X***************
  1163. X*** 203,223 ****
  1164. X      /* check area around room (and make room smaller if necessary) */
  1165. X      for(x = lowx - xlim; x <= hix + xlim; x++) {
  1166. X          for(y = lowy - ylim; y <= hiy + ylim; y++) {
  1167. X!             if(levl[x][y].typ) {
  1168. X  #ifdef WIZARD
  1169. X                  if(wizard && !secret)
  1170. X                  pline("Strange area [%d,%d] in maker().",x,y);
  1171. X  #endif
  1172. X!                 if(!rn2(3)) return(0);
  1173. X!                 if(x < lowx)
  1174. X!                     lowx = x+xlim+1;
  1175. X!                 else
  1176. X!                     hix = x-xlim-1;
  1177. X!                 if(y < lowy)
  1178. X!                     lowy = y+ylim+1;
  1179. X!                 else
  1180. X!                     hiy = y-ylim-1;
  1181. X!                 goto chk;
  1182. X              }
  1183. X          }
  1184. X      }
  1185. X--- 204,224 ----
  1186. X      /* check area around room (and make room smaller if necessary) */
  1187. X      for(x = lowx - xlim; x <= hix + xlim; x++) {
  1188. X          for(y = lowy - ylim; y <= hiy + ylim; y++) {
  1189. X!             if(isok(x,y) && levl[x][y].typ) {
  1190. X  #ifdef WIZARD
  1191. X                  if(wizard && !secret)
  1192. X                  pline("Strange area [%d,%d] in maker().",x,y);
  1193. X  #endif
  1194. X!                 if(!rn2(3)) return(0);
  1195. X!                 if(x < lowx)
  1196. X!                     lowx = x+xlim+1;
  1197. X!                 else
  1198. X!                     hix = x-xlim-1;
  1199. X!                 if(y < lowy)
  1200. X!                     lowy = y+ylim+1;
  1201. X!                 else
  1202. X!                     hiy = y-ylim-1;
  1203. X!                 goto chk;
  1204. X              }
  1205. X          }
  1206. X      }
  1207. X***************
  1208. X*** 540,546 ****
  1209. X--- 541,554 ----
  1210. X          if (levl[x][y].doormask != D_ISOPEN && !shdoor && !rn2(25))
  1211. X              levl[x][y].doormask |= D_TRAPPED;
  1212. X          } else
  1213. X+ #ifdef STUPID
  1214. X+         if (shdoor)
  1215. X+             levl[x][y].doormask = D_ISOPEN;
  1216. X+         else
  1217. X+             levl[x][y].doormask = D_NODOOR;
  1218. X+ #else
  1219. X          levl[x][y].doormask = (shdoor ? D_ISOPEN : D_NODOOR);
  1220. X+ #endif
  1221. X          levl[x][y].scrsym = news0(x,y);
  1222. X      } else { /* SDOOR */
  1223. X          if(shdoor || !rn2(5))    levl[x][y].doormask = D_LOCKED;
  1224. X***************
  1225. X*** 643,649 ****
  1226. X              dosdoor(xx, yy, aroom, rn2(5) ? SDOOR : DOOR);
  1227. X          else {
  1228. X              (void) mksobj_at(SCR_TELEPORTATION, xx, yy+dy);
  1229. X!             if(!rn2(3)) (void) mkobj_at(0, xx, yy+dy);
  1230. X          }
  1231. X          }
  1232. X          return;
  1233. X--- 651,657 ----
  1234. X              dosdoor(xx, yy, aroom, rn2(5) ? SDOOR : DOOR);
  1235. X          else {
  1236. X              (void) mksobj_at(SCR_TELEPORTATION, xx, yy+dy);
  1237. X!             if(!rn2(3)) (void) mkobj_at(0, xx, yy+dy, TRUE);
  1238. X          }
  1239. X          }
  1240. X          return;
  1241. X***************
  1242. X*** 696,702 ****
  1243. X      }
  1244. X      n = 6 + rn2(10);
  1245. X      while (n--)
  1246. X!         (void) mkobj_at(0,somex(croom),somey(croom));
  1247. X  }
  1248. X  
  1249. X  static void
  1250. X--- 704,710 ----
  1251. X      }
  1252. X      n = 6 + rn2(10);
  1253. X      while (n--)
  1254. X!         (void) mkobj_at(0,somex(croom),somey(croom),TRUE);
  1255. X  }
  1256. X  
  1257. X  static void
  1258. X***************
  1259. X*** 989,995 ****
  1260. X      skip_nonrogue:
  1261. X  #endif
  1262. X          if(!rn2(3)) {
  1263. X!             (void) mkobj_at(0, somex(croom), somey(croom));
  1264. X              tryct = 0;
  1265. X              while(!rn2(5)) {
  1266. X                  if(++tryct > 100){
  1267. X--- 997,1003 ----
  1268. X      skip_nonrogue:
  1269. X  #endif
  1270. X          if(!rn2(3)) {
  1271. X!             (void) mkobj_at(0, somex(croom), somey(croom), TRUE);
  1272. X              tryct = 0;
  1273. X              while(!rn2(5)) {
  1274. X                  if(++tryct > 100){
  1275. X***************
  1276. X*** 996,1002 ****
  1277. X                      Printf("tryct overflow4\n");
  1278. X                      break;
  1279. X                  }
  1280. X!                 (void) mkobj_at(0, somex(croom), somey(croom));
  1281. X              }
  1282. X          }
  1283. X      }
  1284. X--- 1004,1011 ----
  1285. X                      Printf("tryct overflow4\n");
  1286. X                      break;
  1287. X                  }
  1288. X!                 (void) mkobj_at(0, somex(croom), somey(croom),
  1289. X!                                     TRUE);
  1290. X              }
  1291. X          }
  1292. X      }
  1293. X*** src/Old/mkmaze.c    Sun Jun  3 13:33:13 1990
  1294. X--- src/mkmaze.c    Sat May 12 16:06:58 1990
  1295. X***************
  1296. X*** 121,127 ****
  1297. X  #  undef tower
  1298. X  #endif
  1299. X  
  1300. X! static const uchar tower[] = {
  1301. X      MOAT,      MOAT,     MOAT,     MOAT,    MOAT,      MOAT,     MOAT,
  1302. X      MOAT,      MOAT,     TLCORNER, HWALL,    TRCORNER, MOAT,     MOAT,
  1303. X      MOAT,      TLCORNER, BRCORNER, ROOM,    BLCORNER, TRCORNER, MOAT,
  1304. X--- 121,127 ----
  1305. X  #  undef tower
  1306. X  #endif
  1307. X  
  1308. X! static const uchar NEARDATA tower[] = {
  1309. X      MOAT,      MOAT,     MOAT,     MOAT,    MOAT,      MOAT,     MOAT,
  1310. X      MOAT,      MOAT,     TLCORNER, HWALL,    TRCORNER, MOAT,     MOAT,
  1311. X      MOAT,      TLCORNER, BRCORNER, ROOM,    BLCORNER, TRCORNER, MOAT,
  1312. X***************
  1313. X*** 279,285 ****
  1314. X  #endif
  1315. X      for(x = rn1(8,11); x; x--) {
  1316. X          mazexy(&mm);
  1317. X!         (void) mkobj_at(rn2(2) ? GEM_SYM : 0, mm.x, mm.y);
  1318. X      }
  1319. X      for(x = rn1(10,2); x; x--) {
  1320. X          mazexy(&mm);
  1321. X--- 279,285 ----
  1322. X  #endif
  1323. X      for(x = rn1(8,11); x; x--) {
  1324. X          mazexy(&mm);
  1325. X!         (void) mkobj_at(rn2(2) ? GEM_SYM : 0, mm.x, mm.y, TRUE);
  1326. X      }
  1327. X      for(x = rn1(10,2); x; x--) {
  1328. X          mazexy(&mm);
  1329. X*** src/Old/mkobj.c    Sun Jun  3 13:33:34 1990
  1330. X--- src/mkobj.c    Sat Jun  2 19:44:49 1990
  1331. X***************
  1332. X*** 4,10 ****
  1333. X  
  1334. X  #include "hack.h"
  1335. X  
  1336. X! static void FDECL(mkbox_cnts,(struct obj *));
  1337. X  
  1338. X  struct icp {
  1339. X      int  iprob; /* probability of an item type */
  1340. X--- 4,10 ----
  1341. X  
  1342. X  #include "hack.h"
  1343. X  
  1344. X! STATIC_DCL void FDECL(mkbox_cnts,(struct obj *));
  1345. X  
  1346. X  struct icp {
  1347. X      int  iprob; /* probability of an item type */
  1348. X***************
  1349. X*** 11,17 ****
  1350. X      char ilet;    /* item class */
  1351. X  };
  1352. X  
  1353. X! #ifdef OVLB
  1354. X  
  1355. X  const struct icp mkobjprobs[] = {
  1356. X  {10, WEAPON_SYM},
  1357. X--- 11,17 ----
  1358. X      char ilet;    /* item class */
  1359. X  };
  1360. X  
  1361. X! #ifdef OVL1
  1362. X  
  1363. X  const struct icp mkobjprobs[] = {
  1364. X  {10, WEAPON_SYM},
  1365. X***************
  1366. X*** 70,81 ****
  1367. X  { 8, RING_SYM},
  1368. X  { 4, AMULET_SYM}};
  1369. X  
  1370. X! static int mksx=0, mksy=0;
  1371. X  
  1372. X  struct obj *
  1373. X! mkobj_at(let,x,y)
  1374. X  char let;
  1375. X  int x,y;
  1376. X  {
  1377. X      register struct obj *otmp;
  1378. X  
  1379. X--- 70,82 ----
  1380. X  { 8, RING_SYM},
  1381. X  { 4, AMULET_SYM}};
  1382. X  
  1383. X! static int NEARDATA mksx=0, NEARDATA mksy=0;
  1384. X  
  1385. X  struct obj *
  1386. X! mkobj_at(let,x,y, artif)
  1387. X  char let;
  1388. X  int x,y;
  1389. X+ boolean artif;
  1390. X  {
  1391. X      register struct obj *otmp;
  1392. X  
  1393. X***************
  1394. X*** 84,90 ****
  1395. X       * to insure shop boxes are empty.
  1396. X       * Yes, this is a horrible kludge...
  1397. X       */
  1398. X!     otmp = mkobj(let,TRUE);
  1399. X      otmp->nobj = fobj;
  1400. X      fobj = otmp;
  1401. X      place_object(otmp, x, y);
  1402. X--- 85,91 ----
  1403. X       * to insure shop boxes are empty.
  1404. X       * Yes, this is a horrible kludge...
  1405. X       */
  1406. X!     otmp = mkobj(let,artif);
  1407. X      otmp->nobj = fobj;
  1408. X      fobj = otmp;
  1409. X      place_object(otmp, x, y);
  1410. X***************
  1411. X*** 137,143 ****
  1412. X      return(mksobj(i, artif));
  1413. X  }
  1414. X  
  1415. X! static void
  1416. X  mkbox_cnts(box)
  1417. X  /* Note: does not check to see if it overloaded the box capacity; usually
  1418. X   * possible only with corpses in ice boxes.
  1419. X--- 138,145 ----
  1420. X      return(mksobj(i, artif));
  1421. X  }
  1422. X  
  1423. X! STATIC_OVL
  1424. X! void
  1425. X  mkbox_cnts(box)
  1426. X  /* Note: does not check to see if it overloaded the box capacity; usually
  1427. X   * possible only with corpses in ice boxes.
  1428. X***************
  1429. X*** 202,207 ****
  1430. X--- 204,211 ----
  1431. X      return(i);
  1432. X  }
  1433. X  
  1434. X+ #endif /* OVL1 */
  1435. X+ #ifdef OVLB
  1436. X  const char dknowns[] = { WAND_SYM, RING_SYM, POTION_SYM, SCROLL_SYM, GEM_SYM,
  1437. X  #ifdef SPELLS
  1438. X  SPBOOK_SYM,
  1439. X***************
  1440. X*** 437,442 ****
  1441. X--- 441,448 ----
  1442. X      return;
  1443. X  }
  1444. X  
  1445. X+ #endif /* OVLB */
  1446. X+ #ifdef OVL1
  1447. X  void
  1448. X  blessorcurse(otmp, chance)
  1449. X  register struct obj *otmp;
  1450. X***************
  1451. X*** 453,458 ****
  1452. X--- 459,466 ----
  1453. X      return;
  1454. X  }
  1455. X  
  1456. X+ #endif /* OVL1 */
  1457. X+ #ifdef OVLB
  1458. X  int
  1459. X  bcsign(otmp)
  1460. X  register struct obj *otmp;
  1461. X***************
  1462. X*** 519,524 ****
  1463. X--- 527,534 ----
  1464. X      return;
  1465. X  }
  1466. X  
  1467. X+ #endif /* OVLB */
  1468. X+ #ifdef OVL1
  1469. X  struct obj *
  1470. X  mkcorpstat(objtype, ptr, x, y)
  1471. X  int objtype;    /* CORPSE or STATUE */
  1472. X***************
  1473. X*** 538,543 ****
  1474. X--- 548,555 ----
  1475. X      return(otmp);
  1476. X  }
  1477. X  
  1478. X+ #endif /* OVL1 */
  1479. X+ #ifdef OVLB
  1480. X  struct obj *
  1481. X  mk_tt_object(objtype, x, y)
  1482. X  int objtype; /* CORPSE or STATUE */
  1483. X***************
  1484. X*** 609,614 ****
  1485. X--- 621,628 ----
  1486. X  }
  1487. X  #endif
  1488. X  
  1489. X+ #endif /* OVLB */
  1490. X+ #ifdef OVL1
  1491. X  
  1492. X  /*
  1493. X   * These routines maintain the single-linked lists headed in level.objects[][]
  1494. X***************
  1495. X*** 629,634 ****
  1496. X--- 643,650 ----
  1497. X      otmp->oy = y;
  1498. X  }
  1499. X  
  1500. X+ #endif /* OVL1 */
  1501. X+ #ifdef OVLB
  1502. X  void
  1503. X  remove_object(otmp)
  1504. X  register struct obj *otmp;
  1505. X*** src/Old/mkroom.c    Tue Jun  5 10:20:22 1990
  1506. X--- src/mkroom.c    Tue Jun  5 10:17:54 1990
  1507. X***************
  1508. X*** 16,21
  1509. X  /* block some unused #defines to avoid overloading some cpp's */
  1510. X  #include "hack.h"
  1511. X  
  1512. X  static void NDECL(mkshop), FDECL(mkzoo,(int)), NDECL(mkswamp);
  1513. X  #ifdef ORACLE
  1514. X  static void NDECL(mkdelphi);
  1515. X
  1516. X--- 16,24 -----
  1517. X  /* block some unused #defines to avoid overloading some cpp's */
  1518. X  #include "hack.h"
  1519. X  
  1520. X+ #ifdef OVLB
  1521. X+ static boolean FDECL(isbig, (struct mkroom *));
  1522. X+ static struct mkroom * FDECL(pick_room,(BOOLEAN_P));
  1523. X  static void NDECL(mkshop), FDECL(mkzoo,(int)), NDECL(mkswamp);
  1524. X  #ifdef ORACLE
  1525. X  static void NDECL(mkdelphi);
  1526. X***************
  1527. X*** 28,33
  1528. X  #ifdef ARMY
  1529. X  static struct permonst * NDECL(squadmon);
  1530. X  #endif
  1531. X  
  1532. X  #define sq(x) ((x)*(x))
  1533. X  
  1534. X
  1535. X--- 31,37 -----
  1536. X  #ifdef ARMY
  1537. X  static struct permonst * NDECL(squadmon);
  1538. X  #endif
  1539. X+ #endif /* OVLB */
  1540. X  
  1541. X  #define sq(x) ((x)*(x))
  1542. X  
  1543. X***************
  1544. X*** 167,173
  1545. X  }
  1546. X  
  1547. X  static struct mkroom *
  1548. X! pick_room()
  1549. X  /* pick an unused room, preferably with only one door */
  1550. X  {
  1551. X      register struct mkroom *sroom;
  1552. X
  1553. X--- 171,178 -----
  1554. X  }
  1555. X  
  1556. X  static struct mkroom *
  1557. X! pick_room(strict)
  1558. X! register boolean strict;
  1559. X  /* pick an unused room, preferably with only one door */
  1560. X  {
  1561. X      register struct mkroom *sroom;
  1562. X***************
  1563. X*** 179,185
  1564. X          if(sroom->hx < 0)
  1565. X              return (struct mkroom *)0;
  1566. X          if(sroom->rtype != OROOM)    continue;
  1567. X!         if(has_upstairs(sroom) || (has_dnstairs(sroom) && rn2(3)))
  1568. X              continue;
  1569. X          if(sroom->doorct == 1 || !rn2(5))
  1570. X              return sroom;
  1571. X
  1572. X--- 184,191 -----
  1573. X          if(sroom->hx < 0)
  1574. X              return (struct mkroom *)0;
  1575. X          if(sroom->rtype != OROOM)    continue;
  1576. X!         if(!strict) {
  1577. X!             if(has_upstairs(sroom) || (has_dnstairs(sroom) && rn2(3)))
  1578. X              continue;
  1579. X          } else if(has_upstairs(sroom) || has_dnstairs(sroom))
  1580. X              continue;
  1581. X***************
  1582. X*** 181,186
  1583. X          if(sroom->rtype != OROOM)    continue;
  1584. X          if(has_upstairs(sroom) || (has_dnstairs(sroom) && rn2(3)))
  1585. X              continue;
  1586. X          if(sroom->doorct == 1 || !rn2(5))
  1587. X              return sroom;
  1588. X      }
  1589. X
  1590. X--- 187,194 -----
  1591. X          if(!strict) {
  1592. X              if(has_upstairs(sroom) || (has_dnstairs(sroom) && rn2(3)))
  1593. X              continue;
  1594. X+         } else if(has_upstairs(sroom) || has_dnstairs(sroom))
  1595. X+             continue;
  1596. X          if(sroom->doorct == 1 || !rn2(5))
  1597. X              return sroom;
  1598. X      }
  1599. X***************
  1600. X*** 196,202
  1601. X      register int sx,sy,i;
  1602. X      int sh, tx, ty, goldlim = 500 * dlevel;
  1603. X  
  1604. X!     if(!(sroom = pick_room())) return;
  1605. X  
  1606. X      sroom->rtype = type;
  1607. X      sh = sroom->fdoor;
  1608. X
  1609. X--- 204,210 -----
  1610. X      register int sx,sy,i;
  1611. X      int sh, tx, ty, goldlim = 500 * dlevel;
  1612. X  
  1613. X!     if(!(sroom = pick_room(FALSE))) return;
  1614. X  
  1615. X      sroom->rtype = type;
  1616. X      sh = sroom->fdoor;
  1617. X***************
  1618. X*** 332,338
  1619. X      int dy,xx,yy;
  1620. X  
  1621. X      if(doorindex >= DOORMAX) return;
  1622. X!     if(!(sroom = pick_room())) return;
  1623. X  
  1624. X      if(!place_oracle(sroom,&dy,&xx,&yy)) return;
  1625. X  
  1626. X
  1627. X--- 340,346 -----
  1628. X      int dy,xx,yy;
  1629. X  
  1630. X      if(doorindex >= DOORMAX) return;
  1631. X!     if(!(sroom = pick_room(FALSE))) return;
  1632. X  
  1633. X      if(!place_oracle(sroom,&dy,&xx,&yy)) return;
  1634. X  
  1635. X***************
  1636. X*** 373,379
  1637. X      register struct mkroom *sroom;
  1638. X      int sx,sy;
  1639. X  
  1640. X!     if(!(sroom = pick_room())) return;
  1641. X  
  1642. X      /* set up Priest and shrine */
  1643. X      sroom->rtype = TEMPLE;
  1644. X
  1645. X--- 381,387 -----
  1646. X      register struct mkroom *sroom;
  1647. X      int sx,sy;
  1648. X  
  1649. X!     if(!(sroom = pick_room(TRUE))) return;
  1650. X  
  1651. X      /* set up Priest and shrine */
  1652. X      sroom->rtype = TEMPLE;
  1653. X***************
  1654. X*** 396,402
  1655. X  {
  1656. X      register int dx, dy;
  1657. X      register struct rm *lev;
  1658. X!     for(dx = -1; dx <= 1; dx++) for(dy = -1; dy <= 1; dy++)
  1659. X          if(IS_DOOR((lev = &levl[sx+dx][sy+dy])->typ) ||
  1660. X              lev->typ == SDOOR)
  1661. X              return(TRUE);
  1662. X
  1663. X--- 404,411 -----
  1664. X  {
  1665. X      register int dx, dy;
  1666. X      register struct rm *lev;
  1667. X!     for(dx = -1; dx <= 1; dx++) for(dy = -1; dy <= 1; dy++) {
  1668. X!         if(!isok(sx+dx, sy+dy)) continue;
  1669. X          if(IS_DOOR((lev = &levl[sx+dx][sy+dy])->typ) ||
  1670. X              lev->typ == SDOOR)
  1671. X              return(TRUE);
  1672. X***************
  1673. X*** 400,405
  1674. X          if(IS_DOOR((lev = &levl[sx+dx][sy+dy])->typ) ||
  1675. X              lev->typ == SDOOR)
  1676. X              return(TRUE);
  1677. X      return(FALSE);
  1678. X  }
  1679. X  
  1680. X
  1681. X--- 409,415 -----
  1682. X          if(IS_DOOR((lev = &levl[sx+dx][sy+dy])->typ) ||
  1683. X              lev->typ == SDOOR)
  1684. X              return(TRUE);
  1685. X+     }
  1686. X      return(FALSE);
  1687. X  }
  1688. X  
  1689. X*** src/Old/mon.c    Sun Jun  3 13:34:26 1990
  1690. X--- src/mon.c    Thu May 31 22:11:18 1990
  1691. X***************
  1692. X*** 2,13 ****
  1693. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1694. X  /* NetHack may be freely redistributed.  See license for details. */
  1695. X  
  1696. X! /* Aztec C on amiga doesn't recognize defined() at this point! */
  1697. X  #ifndef AZTEC_C
  1698. X  #if defined(MICROPORT_BUG) || (!defined(LINT) && !defined(__STDC__))
  1699. X  #define MKROOM_H
  1700. X  #endif /* Avoid the microport bug */
  1701. X  #endif
  1702. X  
  1703. X  #include "hack.h"
  1704. X  #include "mfndpos.h"
  1705. X--- 2,17 ----
  1706. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1707. X  /* NetHack may be freely redistributed.  See license for details. */
  1708. X  
  1709. X! /* Aztec C on amiga doesn't recognize defined() at this point!
  1710. X!    Neither does the Mac Lightspeed C v.3  compiler. If you're using
  1711. X!    precompiled headers, you don't want this either */
  1712. X  #ifndef AZTEC_C
  1713. X+ #ifndef THINK_C
  1714. X  #if defined(MICROPORT_BUG) || (!defined(LINT) && !defined(__STDC__))
  1715. X  #define MKROOM_H
  1716. X  #endif /* Avoid the microport bug */
  1717. X  #endif
  1718. X+ #endif
  1719. X  
  1720. X  #include "hack.h"
  1721. X  #include "mfndpos.h"
  1722. X***************
  1723. X*** 17,34 ****
  1724. X  #endif
  1725. X  
  1726. X  #ifdef HARD
  1727. X! OSTATIC boolean FDECL(restrap,(struct monst *));
  1728. X  #endif
  1729. X  #ifdef INFERNO
  1730. X  #  include <ctype.h>
  1731. X  #endif
  1732. X  
  1733. X! static struct obj *FDECL(make_corpse,(struct monst *));
  1734. X! OSTATIC void NDECL(dmonsfree);
  1735. X! static void FDECL(m_detach,(struct monst *));
  1736. X  
  1737. X  #ifdef OVL1
  1738. X- 
  1739. X  long lastwarntime;
  1740. X  int lastwarnlev;
  1741. X  const char *warnings[] = {
  1742. X--- 21,35 ----
  1743. X  #endif
  1744. X  
  1745. X  #ifdef HARD
  1746. X! STATIC_DCL boolean FDECL(restrap,(struct monst *));
  1747. X  #endif
  1748. X  #ifdef INFERNO
  1749. X  #  include <ctype.h>
  1750. X  #endif
  1751. X  
  1752. X! STATIC_DCL void NDECL(dmonsfree);
  1753. X  
  1754. X  #ifdef OVL1
  1755. X  long lastwarntime;
  1756. X  int lastwarnlev;
  1757. X  const char *warnings[] = {
  1758. X***************
  1759. X*** 35,41 ****
  1760. X--- 36,45 ----
  1761. X      "white", "pink", "red", "ruby", "purple", "black" };
  1762. X  
  1763. X  #endif /* OVL1 */
  1764. X+ 
  1765. X  #ifdef OVLB
  1766. X+ static struct obj *FDECL(make_corpse,(struct monst *));
  1767. X+ static void FDECL(m_detach,(struct monst *));
  1768. X  
  1769. X  struct monst *fdmon;  /* chain of dead monsters, need not be saved */
  1770. X                /* otherwise used only in priest.c */
  1771. X***************
  1772. X*** 167,173 ****
  1773. X  #endif /* OVLB */
  1774. X  #ifdef OVL2
  1775. X  
  1776. X! XSTATIC void
  1777. X  dmonsfree(){
  1778. X  register struct monst *mtmp;
  1779. X      while(mtmp = fdmon){
  1780. X--- 171,177 ----
  1781. X  #endif /* OVLB */
  1782. X  #ifdef OVL2
  1783. X  
  1784. X! STATIC_OVL void
  1785. X  dmonsfree(){
  1786. X  register struct monst *mtmp;
  1787. X      while(mtmp = fdmon){
  1788. X***************
  1789. X*** 817,822 ****
  1790. X--- 821,829 ----
  1791. X      }
  1792. X  #endif
  1793. X      if(mtmp->isshk) shkdead(mtmp);
  1794. X+     if(mtmp->isgd) {
  1795. X+         if(!grddead(mtmp)) return;
  1796. X+     }
  1797. X  #ifdef WORM
  1798. X      if(mtmp->wormno) wormdead(mtmp);
  1799. X  #endif
  1800. X***************
  1801. X*** 1025,1031 ****
  1802. X                              ) {
  1803. X              int typ;
  1804. X  
  1805. X!             otmp = mkobj_at(RANDOM_SYM, x, y);
  1806. X              /* Don't create large objects from small monsters */
  1807. X              typ = otmp->otyp;
  1808. X              if (mdat->msize < MZ_HUMAN && typ != FOOD_RATION
  1809. X--- 1032,1038 ----
  1810. X                              ) {
  1811. X              int typ;
  1812. X  
  1813. X!             otmp = mkobj_at(RANDOM_SYM, x, y, TRUE);
  1814. X              /* Don't create large objects from small monsters */
  1815. X              typ = otmp->otyp;
  1816. X              if (mdat->msize < MZ_HUMAN && typ != FOOD_RATION
  1817. X***************
  1818. X*** 1071,1076 ****
  1819. X--- 1078,1089 ----
  1820. X          }
  1821. X          if(is_were(mtmp->data) && mtmp->data->mlet != S_HUMAN)
  1822. X              (void) new_were(mtmp);
  1823. X+         if(mtmp->mimic && cansee(mtmp->mx, mtmp->my)) {
  1824. X+             seemimic(mtmp);
  1825. X+             /* we pretend that the mimic doesn't */
  1826. X+             /* know that it has been unmasked.   */
  1827. X+             mtmp->msleep = 1;
  1828. X+         }
  1829. X      }
  1830. X  }
  1831. X  
  1832. X***************
  1833. X*** 1080,1088 ****
  1834. X  
  1835. X      register struct monst *mtmp;
  1836. X  
  1837. X!     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  1838. X          if (mtmp->data == &mons[PM_CHAMELEON])
  1839. X              mtmp->cham = 1;
  1840. X  }
  1841. X  
  1842. X  int
  1843. X--- 1093,1108 ----
  1844. X  
  1845. X      register struct monst *mtmp;
  1846. X  
  1847. X!     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
  1848. X          if (mtmp->data == &mons[PM_CHAMELEON])
  1849. X              mtmp->cham = 1;
  1850. X+         if(mtmp->data->mlet == S_MIMIC && mtmp->msleep &&
  1851. X+                 cansee(mtmp->mx, mtmp->my)) {
  1852. X+             set_mimic_sym(mtmp);
  1853. X+             unpmon(mtmp);
  1854. X+             pmon(mtmp);
  1855. X+         }
  1856. X+     }
  1857. X  }
  1858. X  
  1859. X  int
  1860. X***************
  1861. X*** 1099,1105 ****
  1862. X      tryct = 0;
  1863. X      if(mdat == 0) {
  1864. X          while (++tryct < 100) {
  1865. X!             static int num;
  1866. X              mdat = &mons[num=rn2(NUMMONS)];
  1867. X              if ((!is_human(mdat) || num == PM_NURSE)
  1868. X                  && !type_is_pname(mdat)
  1869. X--- 1119,1125 ----
  1870. X      tryct = 0;
  1871. X      if(mdat == 0) {
  1872. X          while (++tryct < 100) {
  1873. X!             static int NEARDATA num;
  1874. X              mdat = &mons[num=rn2(NUMMONS)];
  1875. X              if ((!is_human(mdat) || num == PM_NURSE)
  1876. X                  && !type_is_pname(mdat)
  1877. X***************
  1878. X*** 1187,1193 ****
  1879. X      struct monst *mtmp;
  1880. X  {
  1881. X      coord mm;
  1882. X!     enexto(&mm, u.ux, u.uy, mtmp->data);
  1883. X      remove_monster(mtmp->mx, mtmp->my);
  1884. X      place_monster(mtmp, mm.x, mm.y);
  1885. X      pmon(mtmp);
  1886. X--- 1207,1213 ----
  1887. X      struct monst *mtmp;
  1888. X  {
  1889. X      coord mm;
  1890. X!     if(!enexto(&mm, u.ux, u.uy, mtmp->data)) return;
  1891. X      remove_monster(mtmp->mx, mtmp->my);
  1892. X      place_monster(mtmp, mm.x, mm.y);
  1893. X      pmon(mtmp);
  1894. X***************
  1895. X*** 1202,1208 ****
  1896. X  {
  1897. X      coord mm;
  1898. X      if(!gz || !goodpos(x,y,mtmp->data)) {
  1899. X!         enexto(&mm, x, y, mtmp->data);
  1900. X          x = mm.x; y = mm.y;
  1901. X      }
  1902. X      if(x == mtmp->mx && y == mtmp->my) /* that was easy */
  1903. X--- 1222,1228 ----
  1904. X  {
  1905. X      coord mm;
  1906. X      if(!gz || !goodpos(x,y,mtmp->data)) {
  1907. X!         if(!enexto(&mm, x, y, mtmp->data)) return;
  1908. X          x = mm.x; y = mm.y;
  1909. X      }
  1910. X      if(x == mtmp->mx && y == mtmp->my) /* that was easy */
  1911. X***************
  1912. X*** 1262,1268 ****
  1913. X  }
  1914. X  
  1915. X  #ifdef HARD
  1916. X! XSTATIC boolean
  1917. X  restrap(mtmp)
  1918. X  /* unwatched hiders may hide again,
  1919. X   * if so, a 1 is returned.
  1920. X--- 1282,1288 ----
  1921. X  }
  1922. X  
  1923. X  #ifdef HARD
  1924. X! STATIC_OVL boolean
  1925. X  restrap(mtmp)
  1926. X  /* unwatched hiders may hide again,
  1927. X   * if so, a 1 is returned.
  1928. X*** src/Old/mondata.c    Sun Jun  3 13:35:20 1990
  1929. X--- src/mondata.c    Wed Apr 11 20:13:05 1990
  1930. X***************
  1931. X*** 348,358 ****
  1932. X--- 348,374 ----
  1933. X  int little_to_big(montype)
  1934. X  int montype;
  1935. X  {
  1936. X+ #ifndef AIXPS2_BUG
  1937. X      register int i;
  1938. X      
  1939. X      for(i=0; grownups[i][0] >= 0; i++)
  1940. X          if(montype == grownups[i][0]) return grownups[i][1];
  1941. X      return montype;
  1942. X+ #else
  1943. X+ /* AIX PS/2 C-compiler 1.1.1 optimizer does not like the above for loop,
  1944. X+  * and causes segmentation faults at runtime.  (The problem does not
  1945. X+  * occur if -O is not used.)
  1946. X+  * lehtonen@cs.Helsinki.FI (Tapio Lehtonen) 28031990
  1947. X+  */
  1948. X+     int i;
  1949. X+     int monvalue;
  1950. X+ 
  1951. X+     monvalue = montype;
  1952. X+     for(i=0; grownups[i][0] >= 0; i++)
  1953. X+         if(montype == grownups[i][0]) monvalue = grownups[i][1];
  1954. X+     
  1955. X+     return monvalue;
  1956. X+ #endif
  1957. X  }
  1958. X  
  1959. X  int big_to_little(montype)
  1960. X*** src/Old/monmove.c    Sun Jun  3 13:35:45 1990
  1961. X--- src/monmove.c    Thu May 31 22:11:21 1990
  1962. X***************
  1963. X*** 2,13 ****
  1964. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1965. X  /* NetHack may be freely redistributed.  See license for details. */
  1966. X  
  1967. X! #ifndef LINT
  1968. X! # ifndef __STDC__
  1969. X  #define TRAP_H    /* comment line for pre-compiled headers */
  1970. X  /* block some unused #defines to avoid overloading some cpp's */
  1971. X! # endif
  1972. X! #endif
  1973. X  
  1974. X  #include "hack.h"
  1975. X  #include "mfndpos.h"
  1976. X--- 2,13 ----
  1977. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1978. X  /* NetHack may be freely redistributed.  See license for details. */
  1979. X  
  1980. X! #ifndef LINT    /* comment line for pre-compiled headers */
  1981. X! # ifndef __STDC__    /* comment line for pre-compiled headers */
  1982. X  #define TRAP_H    /* comment line for pre-compiled headers */
  1983. X  /* block some unused #defines to avoid overloading some cpp's */
  1984. X! # endif    /* comment line for pre-compiled headers */
  1985. X! #endif    /* comment line for pre-compiled headers */
  1986. X  
  1987. X  #include "hack.h"
  1988. X  #include "mfndpos.h"
  1989. X***************
  1990. X*** 15,24 ****
  1991. X  #  include "artifact.h"
  1992. X  #endif
  1993. X  
  1994. X  static void FDECL(distfleeck,(struct monst *,int *,int *,int *));
  1995. X! #ifdef POLYSELF
  1996. X  static boolean FDECL(itsstuck,(struct monst *));
  1997. X! #endif
  1998. X  
  1999. X  #ifdef OVLB
  2000. X  
  2001. X--- 15,29 ----
  2002. X  #  include "artifact.h"
  2003. X  #endif
  2004. X  
  2005. X+ #ifdef OVL1
  2006. X  static void FDECL(distfleeck,(struct monst *,int *,int *,int *));
  2007. X! #endif /* OVL1 */
  2008. X! 
  2009. X! #ifdef OVL0
  2010. X! # ifdef POLYSELF
  2011. X  static boolean FDECL(itsstuck,(struct monst *));
  2012. X! # endif
  2013. X! #endif /* OVL0 */
  2014. X  
  2015. X  #ifdef OVLB
  2016. X  
  2017. X***************
  2018. X*** 96,102 ****
  2019. X          newsym(mtmp->mx,mtmp->my);
  2020. X      else
  2021. X          mnewsym(mtmp->mx,mtmp->my);
  2022. X!     here->seen = FALSE;
  2023. X      return(TRUE);
  2024. X  }
  2025. X  
  2026. X--- 101,108 ----
  2027. X          newsym(mtmp->mx,mtmp->my);
  2028. X      else
  2029. X          mnewsym(mtmp->mx,mtmp->my);
  2030. X!     if (!canseeit)
  2031. X!         here->seen = FALSE;
  2032. X      return(TRUE);
  2033. X  }
  2034. X  
  2035. X***************
  2036. X*** 340,353 ****
  2037. X      return(tmp == 2);
  2038. X  }
  2039. X  
  2040. X! static const char practical[] = { WEAPON_SYM, GEM_SYM, FOOD_SYM, 0 };
  2041. X! static const char magical[] = {
  2042. X      AMULET_SYM, POTION_SYM, SCROLL_SYM, WAND_SYM, RING_SYM,
  2043. X  #ifdef SPELLS
  2044. X      SPBOOK_SYM,
  2045. X  #endif
  2046. X      0 };
  2047. X! static const char indigestion[] = { BALL_SYM, ROCK_SYM, 0 };
  2048. X  
  2049. X  #ifdef POLYSELF
  2050. X  static boolean
  2051. X--- 346,362 ----
  2052. X      return(tmp == 2);
  2053. X  }
  2054. X  
  2055. X! static const char NEARDATA practical[] = { WEAPON_SYM, GEM_SYM, FOOD_SYM, 0 };
  2056. X! static const char NEARDATA magical[] = {
  2057. X      AMULET_SYM, POTION_SYM, SCROLL_SYM, WAND_SYM, RING_SYM,
  2058. X  #ifdef SPELLS
  2059. X      SPBOOK_SYM,
  2060. X  #endif
  2061. X      0 };
  2062. X! static const char NEARDATA indigestion[] = { BALL_SYM, ROCK_SYM, 0 };
  2063. X! 
  2064. X! #endif /* OVL1 */
  2065. X! #ifdef OVL0
  2066. X  
  2067. X  #ifdef POLYSELF
  2068. X  static boolean
  2069. X***************
  2070. X*** 362,370 ****
  2071. X  }
  2072. X  #endif
  2073. X  
  2074. X- #endif /* OVL1 */
  2075. X- #ifdef OVL0
  2076. X- 
  2077. X  int
  2078. X  m_move(mtmp, after)
  2079. X  register struct monst *mtmp;
  2080. X--- 371,376 ----
  2081. X***************
  2082. X*** 517,523 ****
  2083. X          conceals = hides_under(ptr);
  2084. X      }
  2085. X  
  2086. X! #define    SRCHRADIUS    25
  2087. X  
  2088. X        { xchar mind = SRCHRADIUS;        /* not too far away */
  2089. X      register int dd;
  2090. X--- 523,530 ----
  2091. X          conceals = hides_under(ptr);
  2092. X      }
  2093. X  
  2094. X! #define SQSRCHRADIUS    5
  2095. X! #define    SRCHRADIUS    (SQSRCHRADIUS*SQSRCHRADIUS)
  2096. X  
  2097. X        { xchar mind = SRCHRADIUS;        /* not too far away */
  2098. X      register int dd;
  2099. X***************
  2100. X*** 539,564 ****
  2101. X      if((likegems || likeobjs || likemagic || likerock || conceals)
  2102. X            && (!in_shop(omx, omy) || (!rn2(25) && !mtmp->isshk))) {
  2103. X          register struct obj *otmp;
  2104. X  
  2105. X!         for(otmp = fobj; otmp; otmp = otmp->nobj)
  2106. X!         if((likeobjs && index(practical, otmp->olet)) ||
  2107. X!            (likemagic && index(magical, otmp->olet)) ||
  2108. X!            (likerock && otmp->otyp == BOULDER) ||
  2109. X!            (likegems && otmp->olet == GEM_SYM &&
  2110. X!             otmp->otyp < LAST_GEM + 6) ||
  2111. X!            (conceals && !cansee(otmp->ox,otmp->oy)) ||
  2112. X!            (ptr == &mons[PM_GELATINOUS_CUBE] &&
  2113. X!                     !index(indigestion, otmp->olet))
  2114. X!           ) {
  2115. X!             if(can_carry(mtmp,otmp))
  2116. X!             if(ptr->mlet != S_UNICORN ||
  2117. X!                     objects[otmp->otyp].g_val != 0)
  2118. X!                 if((dd = dist2(omx,omy,otmp->ox,otmp->oy)) < mind){
  2119. X                  mind = dd;
  2120. X                  gx = otmp->ox;
  2121. X                  gy = otmp->oy;
  2122. X                  }
  2123. X          }
  2124. X      }
  2125. X      if(mind < SRCHRADIUS && appr == -1) {
  2126. X          if(dist2(omx,omy,mtmp->mux,mtmp->muy) < 10) {
  2127. X--- 546,578 ----
  2128. X      if((likegems || likeobjs || likemagic || likerock || conceals)
  2129. X            && (!in_shop(omx, omy) || (!rn2(25) && !mtmp->isshk))) {
  2130. X          register struct obj *otmp;
  2131. X+         register int xx, yy;
  2132. X  
  2133. X!         for(xx = omx-SQSRCHRADIUS; xx <= omx+SQSRCHRADIUS; xx++) {
  2134. X!         for(yy = omy-SQSRCHRADIUS; yy <= omy+SQSRCHRADIUS; yy++) {
  2135. X!             if(!isok(xx, yy)) continue;
  2136. X!             if((dd = dist2(omx,omy,xx, yy)) >= mind) continue;
  2137. X!             for(otmp = level.objects[xx][yy]; otmp; otmp = otmp->nexthere)
  2138. X!               if((likeobjs && index(practical, otmp->olet)) ||
  2139. X!              (likemagic && index(magical, otmp->olet)) ||
  2140. X!              (likerock && otmp->otyp == BOULDER) ||
  2141. X!              (likegems && otmp->olet == GEM_SYM &&
  2142. X!               otmp->otyp < LAST_GEM + 6) ||
  2143. X!              (conceals && !cansee(otmp->ox,otmp->oy)) ||
  2144. X!              (ptr == &mons[PM_GELATINOUS_CUBE] &&
  2145. X!               !index(indigestion, otmp->olet))
  2146. X!              ) {
  2147. X!               if(can_carry(mtmp,otmp))
  2148. X!                 if(ptr->mlet != S_UNICORN ||
  2149. X!                    objects[otmp->otyp].g_val != 0){
  2150. X                  mind = dd;
  2151. X                  gx = otmp->ox;
  2152. X                  gy = otmp->oy;
  2153. X+                 break;
  2154. X                  }
  2155. X+               }
  2156. X          }
  2157. X+         }
  2158. X      }
  2159. X      if(mind < SRCHRADIUS && appr == -1) {
  2160. X          if(dist2(omx,omy,mtmp->mux,mtmp->muy) < 10) {
  2161. X***************
  2162. X*** 576,582 ****
  2163. X      if (ptr->mlet == S_UNICORN) flag |= NOTONL;
  2164. X      if (passes_walls(ptr)) flag |= (ALLOW_WALL | ALLOW_ROCK);
  2165. X      if (can_tunnel) flag |= ALLOW_DIG;
  2166. X!     if (is_human(ptr)) flag |= ALLOW_SSM;
  2167. X      if (is_undead(ptr)) flag |= NOGARLIC;
  2168. X      if (throws_rocks(ptr)) flag |= ALLOW_ROCK;
  2169. X      if (can_open) flag |= OPENDOOR;
  2170. X--- 590,596 ----
  2171. X      if (ptr->mlet == S_UNICORN) flag |= NOTONL;
  2172. X      if (passes_walls(ptr)) flag |= (ALLOW_WALL | ALLOW_ROCK);
  2173. X      if (can_tunnel) flag |= ALLOW_DIG;
  2174. X!     if (is_human(ptr) || ptr == &mons[PM_MINOTAUR]) flag |= ALLOW_SSM;
  2175. X      if (is_undead(ptr)) flag |= NOGARLIC;
  2176. X      if (throws_rocks(ptr)) flag |= ALLOW_ROCK;
  2177. X      if (can_open) flag |= OPENDOOR;
  2178. X***************
  2179. X*** 624,631 ****
  2180. X          if((info[chi] & ALLOW_M) ||
  2181. X             (nix == mtmp->mux && niy == mtmp->muy)) {
  2182. X          int stat;
  2183. X!         mtmp2 = 
  2184. X!             (MON_AT(nix, niy) ? m_at(nix,niy) : (struct monst *)0);
  2185. X          if((stat = mattackm(mtmp, mtmp2)) == 1 && rn2(4) &&
  2186. X              mtmp2->mlstmv != moves && mattackm(mtmp2, mtmp) == 2)
  2187. X              return(2);
  2188. X--- 638,644 ----
  2189. X          if((info[chi] & ALLOW_M) ||
  2190. X             (nix == mtmp->mux && niy == mtmp->muy)) {
  2191. X          int stat;
  2192. X!         mtmp2 = m_at(nix,niy);
  2193. X          if((stat = mattackm(mtmp, mtmp2)) == 1 && rn2(4) &&
  2194. X              mtmp2->mlstmv != moves && mattackm(mtmp2, mtmp) == 2)
  2195. X              return(2);
  2196. X
  2197. END_OF_FILE
  2198. if test 53751 -ne `wc -c <'patch8.04'`; then
  2199.     echo shar: \"'patch8.04'\" unpacked with wrong size!
  2200. fi
  2201. # end of 'patch8.04'
  2202. fi
  2203. echo shar: End of archive 8 \(of 24\).
  2204. cp /dev/null ark8isdone
  2205. MISSING=""
  2206. 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 ; do
  2207.     if test ! -f ark${I}isdone ; then
  2208.     MISSING="${MISSING} ${I}"
  2209.     fi
  2210. done
  2211. if test "${MISSING}" = "" ; then
  2212.     echo You have unpacked all 24 archives.
  2213.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2214. else
  2215.     echo You still need to unpack the following archives:
  2216.     echo "        " ${MISSING}
  2217. fi
  2218. ##  End of shell archive.
  2219. exit 0
  2220.