home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch4d < prev    next >
Encoding:
Internet Message Format  |  1989-10-02  |  54.7 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: v08i040:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch4d
  5. Message-ID: <4630@tekred.CNA.TEK.COM>
  6. Date: 29 Sep 89 21:10:03 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 2046
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 8, Issue 40
  13. Archive-name: NetHack3/Patch4d
  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 4 (of 11)."
  23. # Contents:  patches04d
  24. # Wrapped by billr@saab on Fri Sep 29 13:14:06 1989
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'patches04d' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'patches04d'\"
  28. else
  29. echo shar: Extracting \"'patches04d'\" \(52224 characters\)
  30. sed "s/^X//" >'patches04d' <<'END_OF_FILE'
  31. X*** src/Old/polyself.c    Wed Sep 27 12:09:55 1989
  32. X--- src/polyself.c    Mon Sep 25 21:35:23 1989
  33. X***************
  34. X*** 102,109 ****
  35. X--- 102,115 ----
  36. X              goto newname;
  37. X          }
  38. X          (void)strncpy(plname, buf, sizeof(plname)-1);
  39. X+ #ifdef VMS
  40. X+         Sprintf(SAVEF, "[.save]%d%s", getuid(), plname);
  41. X+         regularize(SAVEF+7);
  42. X+         Strcat(SAVEF, ";1");
  43. X+ #else
  44. X          Sprintf(SAVEF, "save/%d%s", getuid(), plname);
  45. X          regularize(SAVEF+5);        /* avoid . or / in name */
  46. X+ #endif
  47. X  #ifdef WIZARD
  48. X      }
  49. X  #endif
  50. X***************
  51. X*** 123,129 ****
  52. X      int mntmp = -1;
  53. X      int tries=0;
  54. X      boolean draconian = (uarm && uarm->otyp==DRAGON_SCALE_MAIL &&
  55. X!         uarm->corpsenm >= PM_GREY_DRAGON &&
  56. X          uarm->corpsenm <= PM_YELLOW_DRAGON);
  57. X      boolean iswere = (u.ulycn > -1 || is_were(uasmon));
  58. X      boolean isvamp = (u.usym == S_VAMPIRE || u.umonnum == PM_VAMPIRE_BAT);
  59. X--- 129,135 ----
  60. X      int mntmp = -1;
  61. X      int tries=0;
  62. X      boolean draconian = (uarm && uarm->otyp==DRAGON_SCALE_MAIL &&
  63. X!         uarm->corpsenm >= PM_GRAY_DRAGON &&
  64. X          uarm->corpsenm <= PM_YELLOW_DRAGON);
  65. X      boolean iswere = (u.ulycn > -1 || is_were(uasmon));
  66. X      boolean isvamp = (u.usym == S_VAMPIRE || u.umonnum == PM_VAMPIRE_BAT);
  67. X***************
  68. X*** 222,230 ****
  69. X--- 228,245 ----
  70. X          u.acurr = u.macurr;
  71. X          u.amax = u.mamax;
  72. X      }
  73. X+     tmp = u.umonnum;
  74. X      u.umonnum = mntmp;
  75. X      set_uasmon();
  76. X      u.usym = mons[mntmp].mlet;
  77. X+ 
  78. X+     if (tmp != mntmp)
  79. X+         You("turn into a%s %s!",
  80. X+             index(vowels, *(mons[mntmp].mname)) ? "n" : "",
  81. X+             mons[mntmp].mname);
  82. X+     else
  83. X+         You("feel like a new %s!", mons[mntmp].mname);
  84. X+ 
  85. X      /* New stats for monster, to last only as long as polymorphed.
  86. X       * Currently only strength gets changed.
  87. X       */
  88. X***************
  89. X*** 238,244 ****
  90. X          Sick = 0;
  91. X          You("no longer feel sick.");
  92. X      }
  93. X!     if (u.usym == S_DRAGON && mntmp >= PM_GREY_DRAGON) u.mhmax = 80;
  94. X  #ifdef GOLEMS
  95. X      else if (is_golem(uasmon)) u.mhmax = golemhp(mntmp);
  96. X  #endif /* GOLEMS */
  97. X--- 253,259 ----
  98. X          Sick = 0;
  99. X          You("no longer feel sick.");
  100. X      }
  101. X!     if (u.usym == S_DRAGON && mntmp >= PM_GRAY_DRAGON) u.mhmax = 80;
  102. X  #ifdef GOLEMS
  103. X      else if (is_golem(uasmon)) u.mhmax = golemhp(mntmp);
  104. X  #endif /* GOLEMS */
  105. X***************
  106. X*** 255,263 ****
  107. X          else u.mhmax = d(tmp, 8);
  108. X      }
  109. X      u.mh = u.mhmax;
  110. X-     You("turn into a%s %s!",
  111. X-         index(vowels, *(mons[mntmp].mname)) ? "n" : "",
  112. X-         mons[mntmp].mname);
  113. X      if (uskin && mntmp != uskin->corpsenm)
  114. X          skinback();
  115. X      break_armor();
  116. X--- 270,275 ----
  117. X***************
  118. X*** 433,438 ****
  119. X--- 445,451 ----
  120. X  
  121. X      if (!getdir(1)) return(0);
  122. X      otmp = mksobj(u.umonnum==PM_COBRA ? BLINDING_VENOM : ACID_VENOM, FALSE);
  123. X+     otmp->spe = 1; /* to indicate it's yours */
  124. X      (void) throwit(otmp);
  125. X      return(1);
  126. X  }
  127. X*** src/Old/potion.c    Wed Sep 27 12:10:40 1989
  128. X--- src/potion.c    Mon Sep 25 21:30:15 1989
  129. X***************
  130. X*** 146,164 ****
  131. X      register struct obj *otmp;
  132. X  
  133. X  #ifdef FOUNTAINS
  134. X! 
  135. X!       /* Is there something to drink here, i.e., a fountain? */
  136. X!        if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
  137. X!        pline("Drink from the fountain? ");
  138. X!        if(yn() == 'y') {
  139. X!         (void) drinkfountain();
  140. X!         return(1);
  141. X!       }
  142. X!        }
  143. X! 
  144. X! #endif /* FOUNTAINS /**/
  145. X  #ifdef SINKS
  146. X!     /* Now, check for kitchen sinks... */
  147. X      if (IS_SINK(levl[u.ux][u.uy].typ)) {
  148. X          pline("Drink from the sink? ");
  149. X          if (yn() == 'y') {
  150. X--- 146,162 ----
  151. X      register struct obj *otmp;
  152. X  
  153. X  #ifdef FOUNTAINS
  154. X!     /* Is there a fountain to drink from here? */
  155. X!         if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
  156. X!         pline("Drink from the fountain? ");
  157. X!         if(yn() == 'y') {
  158. X!             (void) drinkfountain();
  159. X!             return 1;
  160. X!         }
  161. X!     }
  162. X! #endif
  163. X  #ifdef SINKS
  164. X!     /* Or a kitchen sink? */
  165. X      if (IS_SINK(levl[u.ux][u.uy].typ)) {
  166. X          pline("Drink from the sink? ");
  167. X          if (yn() == 'y') {
  168. X***************
  169. X*** 168,174 ****
  170. X      }
  171. X  #endif
  172. X  
  173. X-     unkn = 0;
  174. X      otmp = getobj(beverages, "drink");
  175. X      if(!otmp) return(0);
  176. X      if(objects[otmp->otyp].oc_descr && !strcmp(objects[otmp->otyp].oc_descr, "smoky") && !rn2(13)) {
  177. X--- 166,171 ----
  178. X***************
  179. X*** 190,196 ****
  180. X  {
  181. X      int retval;
  182. X  
  183. X!     nothing = 0;
  184. X      if((retval = peffects(otmp)) >= 0) return(retval);
  185. X  
  186. X      if(nothing) {
  187. X--- 187,193 ----
  188. X  {
  189. X      int retval;
  190. X  
  191. X!     nothing = unkn = 0;
  192. X      if((retval = peffects(otmp)) >= 0) return(retval);
  193. X  
  194. X      if(nothing) {
  195. X***************
  196. X*** 807,814 ****
  197. X      if(!(obj = getobj("#", "dip")))
  198. X          return(0);
  199. X  #ifdef FOUNTAINS
  200. X!     /* Is there something to dip into here, i.e., a fountain? */
  201. X!     if (levl[u.ux][u.uy].typ == FOUNTAIN) {
  202. X          pline("Dip it into the fountain? ");
  203. X          if(yn() == 'y') {
  204. X              dipfountain(obj);
  205. X--- 804,811 ----
  206. X      if(!(obj = getobj("#", "dip")))
  207. X          return(0);
  208. X  #ifdef FOUNTAINS
  209. X!     /* Is there a fountain to dip into here? */
  210. X!     if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
  211. X          pline("Dip it into the fountain? ");
  212. X          if(yn() == 'y') {
  213. X              dipfountain(obj);
  214. X***************
  215. X*** 959,965 ****
  216. X          char buf[BUFSZ];
  217. X          Strcpy(buf, xname(potion));
  218. X          pline("The %s form%s a coating on the %s.",
  219. X!             buf, (potion->quan==1) ? "s" : "", xname(obj));
  220. X          obj->opoisoned = 1;
  221. X          goto poof;
  222. X          } else if(obj->opoisoned && 
  223. X--- 956,962 ----
  224. X          char buf[BUFSZ];
  225. X          Strcpy(buf, xname(potion));
  226. X          pline("The %s form%s a coating on the %s.",
  227. X!             buf, potion->quan==1 ? "s" : "", xname(obj));
  228. X          obj->opoisoned = 1;
  229. X          goto poof;
  230. X          } else if(obj->opoisoned && 
  231. X*** src/Old/pray.c    Wed Sep 27 12:11:32 1989
  232. X--- src/pray.c    Tue Sep 26 12:59:40 1989
  233. X***************
  234. X*** 38,62 ****
  235. X  0,0,0,0
  236. X  };
  237. X  
  238. X! #define TROUBLE_STONED 8
  239. X! #define TROUBLE_STRANGLED 7
  240. X! #define TROUBLE_SICK 6
  241. X! #define TROUBLE_STARVING 5
  242. X! #define TROUBLE_HIT 4
  243. X  #define TROUBLE_STUCK_IN_WALL 3
  244. X  #define TROUBLE_CURSED_BLINDFOLD 2
  245. X  #define TROUBLE_CURSED_LEVITATION 1
  246. X  
  247. X! #define TROUBLE_LYCANTHROPE (-1)
  248. X! #define TROUBLE_PUNISHED (-2)
  249. X! #define TROUBLE_CURSED_ITEMS (-3)
  250. X! #define TROUBLE_BLIND (-4)
  251. X! #define TROUBLE_HUNGRY (-5)
  252. X! #define TROUBLE_POISONED (-6)
  253. X! #define TROUBLE_WOUNDED_LEGS (-7)
  254. X! #define TROUBLE_STUNNED (-8)
  255. X! #define TROUBLE_CONFUSED (-9)
  256. X! #define TROUBLE_HALLUCINATION (-10)
  257. X  
  258. X  /* We could force rehumanize of polyselfed people, but we can't tell
  259. X     unintentional shape changes from the other kind. Oh well. */
  260. X--- 38,62 ----
  261. X  0,0,0,0
  262. X  };
  263. X  
  264. X! #define TROUBLE_STONED 9
  265. X! #define TROUBLE_STRANGLED 8
  266. X! #define TROUBLE_SICK 7
  267. X! #define TROUBLE_STARVING 6
  268. X! #define TROUBLE_HIT 5
  269. X! #define TROUBLE_LYCANTHROPE 4
  270. X  #define TROUBLE_STUCK_IN_WALL 3
  271. X  #define TROUBLE_CURSED_BLINDFOLD 2
  272. X  #define TROUBLE_CURSED_LEVITATION 1
  273. X  
  274. X! #define TROUBLE_PUNISHED (-1)
  275. X! #define TROUBLE_CURSED_ITEMS (-2)
  276. X! #define TROUBLE_BLIND (-3)
  277. X! #define TROUBLE_HUNGRY (-4)
  278. X! #define TROUBLE_POISONED (-5)
  279. X! #define TROUBLE_WOUNDED_LEGS (-6)
  280. X! #define TROUBLE_STUNNED (-7)
  281. X! #define TROUBLE_CONFUSED (-8)
  282. X! #define TROUBLE_HALLUCINATION (-9)
  283. X  
  284. X  /* We could force rehumanize of polyselfed people, but we can't tell
  285. X     unintentional shape changes from the other kind. Oh well. */
  286. X***************
  287. X*** 102,107 ****
  288. X--- 102,110 ----
  289. X          if (!isok(u.ux+i, u.uy+j) || IS_ROCK(levl[u.ux+i][u.uy+j].typ))
  290. X              count++;
  291. X      }
  292. X+ #ifdef POLYSELF
  293. X+     if(u.ulycn >= 0) return(TROUBLE_LYCANTHROPE);
  294. X+ #endif
  295. X      if(count==8
  296. X  #ifdef POLYSELF
  297. X          && !passes_walls(uasmon)
  298. X***************
  299. X*** 113,121 ****
  300. X          return(TROUBLE_CURSED_LEVITATION);
  301. X      if(ublindf && ublindf->cursed) return(TROUBLE_CURSED_BLINDFOLD);
  302. X  
  303. X- #ifdef POLYSELF
  304. X-     if(u.ulycn >= 0) return(TROUBLE_LYCANTHROPE);
  305. X- #endif
  306. X      if(Punished) return(TROUBLE_PUNISHED);
  307. X      for(otmp=invent; otmp; otmp=otmp->nobj)
  308. X          if((otmp->otyp==LOADSTONE || otmp->otyp==LUCKSTONE) &&
  309. X--- 116,121 ----
  310. X***************
  311. X*** 411,417 ****
  312. X      int trouble = in_trouble ();    /* what's your worst difficulty? */
  313. X      int pat_on_head = 0;
  314. X  
  315. X-     if (u.ugangr > 0) u.ugangr--;
  316. X      You("feel that %s is pleased.",
  317. X  #ifndef ALTARS
  318. X             u_gname());
  319. X--- 411,416 ----
  320. X***************
  321. X*** 675,680 ****
  322. X--- 674,681 ----
  323. X  {
  324. X      if (Hallucination)
  325. X      pline ("Your sacrifice sprouts wings and a propeller and roars away!");
  326. X+     else if (Blind && u.ualigntyp == U_LAWFUL)
  327. X+         pline("Your sacrifice disappears!");
  328. X      else pline ("Your sacrifice is consumed in a %s!",
  329. X              u.ualigntyp == U_LAWFUL ? "flash of light" : "burst of flame");
  330. X      useup(otmp);
  331. X***************
  332. X*** 718,724 ****
  333. X          register struct permonst *mtmp = &mons[otmp->corpsenm];
  334. X          extern int monstr[];
  335. X  
  336. X!         if (otmp->corpsenm == PM_ACID_BLOB || (moves <= otmp->age + 50))
  337. X          value = monstr[otmp->corpsenm] + 1;
  338. X  
  339. X          if (is_human(mtmp)) { /* Human sacrifice! */
  340. X--- 719,725 ----
  341. X          register struct permonst *mtmp = &mons[otmp->corpsenm];
  342. X          extern int monstr[];
  343. X  
  344. X!         if (otmp->corpsenm == PM_ACID_BLOB || (monstermoves <= otmp->age + 50))
  345. X          value = monstr[otmp->corpsenm] + 1;
  346. X  
  347. X          if (is_human(mtmp)) { /* Human sacrifice! */
  348. X***************
  349. X*** 777,783 ****
  350. X          int unicalign;
  351. X  
  352. X          if (mtmp == &mons[PM_BLACK_UNICORN]) unicalign = -1;
  353. X!         else if (mtmp == &mons[PM_GREY_UNICORN]) unicalign = 0;
  354. X          else if (mtmp == &mons[PM_WHITE_UNICORN]) unicalign = 1;
  355. X          if (unicalign == u.ualigntyp) {
  356. X              pline("Such an action is an insult to %s!", (unicalign== -1)
  357. X--- 778,784 ----
  358. X          int unicalign;
  359. X  
  360. X          if (mtmp == &mons[PM_BLACK_UNICORN]) unicalign = -1;
  361. X!         else if (mtmp == &mons[PM_GRAY_UNICORN]) unicalign = 0;
  362. X          else if (mtmp == &mons[PM_WHITE_UNICORN]) unicalign = 1;
  363. X          if (unicalign == u.ualigntyp) {
  364. X              pline("Such an action is an insult to %s!", (unicalign== -1)
  365. X*** src/Old/pri.c    Wed Sep 27 12:12:22 1989
  366. X--- src/pri.c    Wed Sep 27 11:25:39 1989
  367. X***************
  368. X*** 10,20 ****
  369. X  #include "epri.h"
  370. X  #endif
  371. X  
  372. X! static void hilite P((UCHAR_P, UCHAR_P));
  373. X  static void cornbot P((int));
  374. X  static boolean ismnst P((CHAR_P));
  375. X! #if !defined(DECRAINBOW) && !defined(UNIX)
  376. X  #  define g_putch  (void) putchar
  377. X  #endif
  378. X  
  379. X  #ifndef g_putch
  380. X--- 10,31 ----
  381. X  #include "epri.h"
  382. X  #endif
  383. X  
  384. X! static void hilite P((int,int,UCHAR_P, UCHAR_P));
  385. X  static void cornbot P((int));
  386. X  static boolean ismnst P((CHAR_P));
  387. X! #ifdef TEXTCOLOR
  388. X! static uchar mimic_color P((UCHAR_P));
  389. X! #endif
  390. X! 
  391. X! #if defined(MSDOS) && !defined(TERMLIB) && !defined(DECRAINBOW)
  392. X! #  define g_putch  (void) putchar
  393. X! #endif
  394. X! 
  395. X! /* This is the same logic used for "#define IBMXASCII" in file "termcap.c" */
  396. X! #if !defined(AMIGA) && !defined(TOS)
  397. X! # if defined(TERMLIB) || !(defined(DECRAINBOW) || defined(OS2))
  398. X  #  define g_putch  (void) putchar
  399. X+ # endif
  400. X  #endif
  401. X  
  402. X  #ifndef g_putch
  403. X***************
  404. X*** 49,55 ****
  405. X      curx = u.ux+2;
  406. X      curs(u.ux-1, u.uy+2);
  407. X      (void) putchar('|');
  408. X!     hilite(u.usym, AT_MON);
  409. X      (void) putchar('|');
  410. X      curx = u.ux+2;
  411. X      curs(u.ux-1, u.uy+3);
  412. X--- 60,66 ----
  413. X      curx = u.ux+2;
  414. X      curs(u.ux-1, u.uy+2);
  415. X      (void) putchar('|');
  416. X!     hilite(u.ux, u.uy, u.usym, AT_MON);
  417. X      (void) putchar('|');
  418. X      curx = u.ux+2;
  419. X      curs(u.ux-1, u.uy+3);
  420. X***************
  421. X*** 140,146 ****
  422. X      y += 2;
  423. X      curs(x,y);
  424. X  
  425. X!     hilite(ch,typ);
  426. X      curx++;
  427. X  }
  428. X  
  429. X--- 151,157 ----
  430. X      y += 2;
  431. X      curs(x,y);
  432. X  
  433. X!     hilite(x, y-2, ch, typ);
  434. X      curx++;
  435. X  }
  436. X  
  437. X***************
  438. X*** 385,397 ****
  439. X          if(obj->olet == FOOD_SYM && obj->otyp == CORPSE) {
  440. X  
  441. X          if(mons[obj->corpsenm].mlet == S_TROLL &&
  442. X!             obj->age + 20 < moves) {
  443. X              boolean visible = cansee(obj->ox,obj->oy);
  444. X              struct monst *mtmp = revive(obj, FALSE);
  445. X  
  446. X              if (mtmp && visible)
  447. X                  pline("%s rises from the dead!", Monnam(mtmp));
  448. X!         } else if (obj->age + 250 < moves) delobj(obj);
  449. X          }
  450. X      }
  451. X  
  452. X--- 396,408 ----
  453. X          if(obj->olet == FOOD_SYM && obj->otyp == CORPSE) {
  454. X  
  455. X          if(mons[obj->corpsenm].mlet == S_TROLL &&
  456. X!             obj->age + 20 < monstermoves) {
  457. X              boolean visible = cansee(obj->ox,obj->oy);
  458. X              struct monst *mtmp = revive(obj, FALSE);
  459. X  
  460. X              if (mtmp && visible)
  461. X                  pline("%s rises from the dead!", Monnam(mtmp));
  462. X!         } else if (obj->age + 250 < monstermoves) delobj(obj);
  463. X          }
  464. X      }
  465. X  
  466. X***************
  467. X*** 399,405 ****
  468. X          obj2 = obj->nobj;
  469. X          if(obj->otyp == CORPSE) {
  470. X          if(mons[obj->corpsenm].mlet == S_TROLL
  471. X!                 && obj->age + 20 < moves) {
  472. X              boolean wielded = (obj==uwep);
  473. X              struct monst *mtmp = revive(obj, TRUE);
  474. X  
  475. X--- 410,416 ----
  476. X          obj2 = obj->nobj;
  477. X          if(obj->otyp == CORPSE) {
  478. X          if(mons[obj->corpsenm].mlet == S_TROLL
  479. X!                 && obj->age + 20 < monstermoves) {
  480. X              boolean wielded = (obj==uwep);
  481. X              struct monst *mtmp = revive(obj, TRUE);
  482. X  
  483. X***************
  484. X*** 408,414 ****
  485. X                  mtmp->data->mname, xname(obj));
  486. X              else if (mtmp)
  487. X              You("feel squirming in your backpack!");
  488. X!         } else if (obj->age + 250 < moves) useup(obj);
  489. X          }
  490. X      }
  491. X  }
  492. X--- 419,425 ----
  493. X                  mtmp->data->mname, xname(obj));
  494. X              else if (mtmp)
  495. X              You("feel squirming in your backpack!");
  496. X!         } else if (obj->age + 250 < monstermoves) useup(obj);
  497. X          }
  498. X      }
  499. X  }
  500. X***************
  501. X*** 1070,1095 ****
  502. X      return hcolors[rn2(SIZE(hcolors))];
  503. X  }
  504. X  
  505. X! /*  Bug: if a level character is the same as an object/monster, it may be
  506. X!  *  hilited, because we use a kludge to figure out if a character is an
  507. X!  *  object/monster symbol.  It's smarter than it was in 2.3, but you
  508. X!  *  can still fool it (ex. if an object is in a doorway you have not seen,
  509. X!  *  and you look at a map, the '+' will be taken as a spellbook symbol).
  510. X!  *
  511. X!  *  The problem is that whenever a portion of the map needs to be redrawn
  512. X!  *  (by ^R, after an inventory dropover, after regurgitation...), the
  513. X!  *  levl[][].scrsym field is used to redraw the map.  A great duplication
  514. X!  *  of code would be needed to trace back every scrsym to find out what color
  515. X!  *  it should be.
  516. X!  *
  517. X!  *  What is really needed is a levl[][].color field; the color be figured
  518. X!  *  out at the same time as the screen symbol, and be restored with
  519. X!  *  redraws.  Unfortunately, as this requires much time and testing,
  520. X!  *  it will have to wait for NetHack 3.1.  -3.
  521. X!  */
  522. X! 
  523. X  static void
  524. X! hilite(let,typ)
  525. X  uchar let, typ;
  526. X  {
  527. X  
  528. X--- 1081,1090 ----
  529. X      return hcolors[rn2(SIZE(hcolors))];
  530. X  }
  531. X  
  532. X! /*ARGSUSED*/
  533. X  static void
  534. X! hilite(x, y, let, typ)
  535. X! int x, y;
  536. X  uchar let, typ;
  537. X  {
  538. X  
  539. X***************
  540. X*** 1122,1152 ****
  541. X              case S_MIMIC_DEF:
  542. X              typ = HI_OBJ;
  543. X              break;
  544. X-             case S_YLIGHT:    /* make 'em "glow" */
  545. X-             typ = YELLOW;
  546. X-             break;
  547. X              default:
  548. X!             typ = HI_MON;
  549. X          }
  550. X          break;
  551. X          case AT_OBJ:
  552. X!         switch (let) {
  553. X!             case GOLD_SYM:
  554. X!             typ = HI_GOLD;
  555. X!             break;
  556. X!             case WEAPON_SYM:
  557. X!             case ARMOR_SYM:
  558. X!             case RING_SYM:
  559. X!             case AMULET_SYM:
  560. X!             typ = HI_METAL;
  561. X!             break;
  562. X!             case FOOD_SYM:
  563. X!             case POTION_SYM:
  564. X!             typ = HI_ORGANIC;
  565. X!             break;
  566. X!             default:
  567. X!             typ = HI_OBJ;
  568. X!         }
  569. X          break;
  570. X          case AT_MAP:
  571. X  #ifdef FOUNTAINS
  572. X--- 1117,1137 ----
  573. X              case S_MIMIC_DEF:
  574. X              typ = HI_OBJ;
  575. X              break;
  576. X              default:
  577. X!                         if (u.ux == x && u.uy == y)
  578. X!                             typ = uasmon->mcolor;
  579. X!             else
  580. X!                 typ = level.monsters[x][y]->data->mcolor;
  581. X          }
  582. X          break;
  583. X          case AT_OBJ:
  584. X!         if (let == GOLD_SYM)
  585. X!             typ = HI_GOLD;
  586. X!         else if (level.objects[x][y] && 
  587. X!              let == objects[level.objects[x][y]->otyp].oc_olet)
  588. X!             typ = objects[level.objects[x][y]->otyp].oc_color;
  589. X!         else
  590. X!             typ = mimic_color(let);
  591. X          break;
  592. X          case AT_MAP:
  593. X  #ifdef FOUNTAINS
  594. X***************
  595. X*** 1154,1178 ****
  596. X  #else
  597. X          typ = (let == POOL_SYM
  598. X  #endif
  599. X!             && HI_COLOR[BLUE] != HI ? BLUE : 0);
  600. X          break;
  601. X          case AT_ZAP:
  602. X          typ = HI_ZAP;
  603. X          break;
  604. X      }
  605. X!     if (typ)
  606. X!         xputs(HI_COLOR[typ]);
  607. X! #else
  608. X!     if (typ == AT_MON) revbeg();
  609. X  #endif
  610. X  
  611. X      g_putch(let);
  612. X  
  613. X  #ifdef TEXTCOLOR
  614. X!     if (typ) xputs(HE);
  615. X! #else
  616. X!     if (typ == AT_MON) m_end();
  617. X  #endif
  618. X  }
  619. X  
  620. X  static boolean
  621. X--- 1139,1166 ----
  622. X  #else
  623. X          typ = (let == POOL_SYM
  624. X  #endif
  625. X!             && hilites[BLUE] != HI ? BLUE :
  626. X! #ifdef THRONES
  627. X!                let == THRONE_SYM && hilites[HI_GOLD] != HI ? HI_GOLD :
  628. X! #endif
  629. X!                0);
  630. X          break;
  631. X          case AT_ZAP:
  632. X          typ = HI_ZAP;
  633. X          break;
  634. X      }
  635. X!     if (typ && flags.use_color)
  636. X!         xputs(hilites[typ]);
  637. X!     else
  638. X  #endif
  639. X+     if (typ == AT_MON) revbeg();
  640. X  
  641. X      g_putch(let);
  642. X  
  643. X  #ifdef TEXTCOLOR
  644. X!     if (typ && flags.use_color) xputs(HE); else
  645. X  #endif
  646. X+     if (typ == AT_MON) m_end();
  647. X  }
  648. X  
  649. X  static boolean
  650. X***************
  651. X*** 1194,1196 ****
  652. X--- 1182,1201 ----
  653. X  #endif
  654. X      return 0;
  655. X  }
  656. X+ 
  657. X+ #ifdef TEXTCOLOR
  658. X+ /* pick an appropriate color for a mimic imitating an object */
  659. X+ 
  660. X+ static uchar
  661. X+ mimic_color(let)
  662. X+ uchar let;
  663. X+ {
  664. X+     int i;
  665. X+ 
  666. X+     for(i = 0; i < NROFOBJECTS; i++) {
  667. X+         if (objects[i].oc_olet == let)
  668. X+             return objects[i].oc_color;
  669. X+     }
  670. X+     return HI_OBJ;
  671. X+ }
  672. X+ #endif
  673. X*** src/Old/priest.c    Wed Sep 27 12:13:05 1989
  674. X--- src/priest.c    Thu Sep 14 23:31:18 1989
  675. X***************
  676. X*** 85,94 ****
  677. X  #endif
  678. X  
  679. X      if(nix != omx || niy != omy) {
  680. X!         levl[omx][omy].mmask = 0;
  681. X!         levl[nix][niy].mmask = 1;
  682. X!         mtmp->mx = nix;
  683. X!         mtmp->my = niy;
  684. X          pmon(mtmp);
  685. X          if(ib) {
  686. X              if (cansee(mtmp->mx,mtmp->my))
  687. X--- 85,92 ----
  688. X  #endif
  689. X  
  690. X      if(nix != omx || niy != omy) {
  691. X!         remove_monster(omx, omy);
  692. X!         place_monster(mtmp, nix, niy);
  693. X          pmon(mtmp);
  694. X          if(ib) {
  695. X              if (cansee(mtmp->mx,mtmp->my))
  696. X***************
  697. X*** 110,116 ****
  698. X  {
  699. X      register int roomno = inroom(x, y);
  700. X  
  701. X!     if (roomno < 0 || rooms[roomno].rtype != TEMPLE) return(FALSE);
  702. X      return(&rooms[roomno]);
  703. X  }
  704. X  
  705. X--- 108,115 ----
  706. X  {
  707. X      register int roomno = inroom(x, y);
  708. X  
  709. X!     if (roomno < 0 || rooms[roomno].rtype != TEMPLE)
  710. X!         return((struct mkroom *)0);
  711. X      return(&rooms[roomno]);
  712. X  }
  713. X  
  714. X***************
  715. X*** 183,189 ****
  716. X  #ifdef SPELLS
  717. X      register int cnt;
  718. X  #endif
  719. X!     if(levl[sx+1][sy].mmask) rloc(m_at(sx+1, sy)); /* insurance */
  720. X  
  721. X      if(priest = makemon(&mons[!rn2(2) ? PM_TEMPLE_PRIEST : 
  722. X              PM_TEMPLE_PRIESTESS], sx+1, sy)) {
  723. X--- 182,188 ----
  724. X  #ifdef SPELLS
  725. X      register int cnt;
  726. X  #endif
  727. X!     if(MON_AT(sx+1, sy)) rloc(m_at(sx+1, sy)); /* insurance */
  728. X  
  729. X      if(priest = makemon(&mons[!rn2(2) ? PM_TEMPLE_PRIEST : 
  730. X              PM_TEMPLE_PRIESTESS], sx+1, sy)) {
  731. X*** src/Old/prisym.c    Wed Sep 27 12:13:29 1989
  732. X--- src/prisym.c    Thu Sep 14 14:11:55 1989
  733. X***************
  734. X*** 216,222 ****
  735. X          /* the only lit corridor squares should be the entrances to
  736. X           * outside castle areas */
  737. X          return;
  738. X!     if(room->mmask) mtmp = m_at(x,y);
  739. X      if(mtmp && !mtmp->mhide &&
  740. X          (!mtmp->minvis || See_invisible)) {
  741. X  #ifdef WORM
  742. X--- 216,222 ----
  743. X          /* the only lit corridor squares should be the entrances to
  744. X           * outside castle areas */
  745. X          return;
  746. X!     if(MON_AT(x, y)) mtmp = m_at(x,y);
  747. X      if(mtmp && !mtmp->mhide &&
  748. X          (!mtmp->minvis || See_invisible)) {
  749. X  #ifdef WORM
  750. X***************
  751. X*** 227,233 ****
  752. X          pmon(mtmp);
  753. X      }
  754. X      else if(OBJ_AT(x, y) && !is_pool(x,y)) {
  755. X!         otmp = o_at(x,y);
  756. X          atl(x,y,Hallucination ? rndobjsym() : otmp->olet);
  757. X      }
  758. X      else if(room->gmask && !is_pool(x,y))
  759. X--- 227,233 ----
  760. X          pmon(mtmp);
  761. X      }
  762. X      else if(OBJ_AT(x, y) && !is_pool(x,y)) {
  763. X!         otmp = level.objects[x][y];
  764. X          atl(x,y,Hallucination ? rndobjsym() : otmp->olet);
  765. X      }
  766. X      else if(room->gmask && !is_pool(x,y))
  767. X***************
  768. X*** 263,269 ****
  769. X      if(!room->seen) tmp = STONE_SYM;
  770. X      else if(room->typ == POOL || room->typ == MOAT) tmp = POOL_SYM;
  771. X      else if(OBJ_AT(x, y) && !Blind && room->scrsym) {
  772. X!         otmp = o_at(x,y);
  773. X          tmp = Hallucination ? rndobjsym() : otmp->olet;
  774. X      }
  775. X      else if(room->gmask && !Blind && room->scrsym) 
  776. X--- 263,269 ----
  777. X      if(!room->seen) tmp = STONE_SYM;
  778. X      else if(room->typ == POOL || room->typ == MOAT) tmp = POOL_SYM;
  779. X      else if(OBJ_AT(x, y) && !Blind && room->scrsym) {
  780. X!         otmp = level.objects[x][y];
  781. X          tmp = Hallucination ? rndobjsym() : otmp->olet;
  782. X      }
  783. X      else if(room->gmask && !Blind && room->scrsym) 
  784. X***************
  785. X*** 483,489 ****
  786. X  {
  787. X      if(x == u.ux && y == u.uy && !Invisible) return(1);
  788. X  
  789. X!     if(levl[x][y].mmask)
  790. X          if (Blind && Telepat || canseemon(m_at(x,y)))
  791. X              return(1);
  792. X          else return ((HTelepat & WORN_HELMET) &&
  793. X--- 483,489 ----
  794. X  {
  795. X      if(x == u.ux && y == u.uy && !Invisible) return(1);
  796. X  
  797. X!     if(MON_AT(x, y))
  798. X          if (Blind && Telepat || canseemon(m_at(x,y)))
  799. X              return(1);
  800. X          else return ((HTelepat & WORN_HELMET) &&
  801. X*** src/Old/read.c    Wed Sep 27 12:13:53 1989
  802. X--- src/read.c    Sat Sep 23 00:46:44 1989
  803. X***************
  804. X*** 216,222 ****
  805. X              return(1);
  806. X              }
  807. X          } else {    /* armor and scroll both cursed */
  808. X!             Your("%s vibrates", xname(otmp));
  809. X              otmp->spe--;
  810. X              make_stunned(HStun + rn1(10, 10), TRUE);
  811. X          }
  812. X--- 216,222 ----
  813. X              return(1);
  814. X              }
  815. X          } else {    /* armor and scroll both cursed */
  816. X!             Your("%s vibrates.", xname(otmp));
  817. X              otmp->spe--;
  818. X              make_stunned(HStun + rn1(10, 10), TRUE);
  819. X          }
  820. X***************
  821. X*** 363,369 ****
  822. X          register struct monst *mtmp;
  823. X  
  824. X          for(i = -bd; i <= bd; i++) for(j = -bd; j <= bd; j++)
  825. X!         if(levl[u.ux+i][u.uy+j].mmask && (mtmp = m_at(u.ux+i, u.uy+j))) {
  826. X              if(sobj->cursed) {
  827. X              if(!mtmp->mtame) mtmp->mpeaceful = 0;
  828. X              } else {
  829. X--- 363,369 ----
  830. X          register struct monst *mtmp;
  831. X  
  832. X          for(i = -bd; i <= bd; i++) for(j = -bd; j <= bd; j++)
  833. X!         if(MON_AT(u.ux+i, u.uy+j) && (mtmp = m_at(u.ux+i, u.uy+j))) {
  834. X              if(sobj->cursed) {
  835. X              if(!mtmp->mtame) mtmp->mpeaceful = 0;
  836. X              } else {
  837. X*** src/Old/restore.c    Wed Sep 27 12:14:35 1989
  838. X--- src/restore.c    Tue Sep 26 16:08:35 1989
  839. X***************
  840. X*** 39,44 ****
  841. X--- 39,72 ----
  842. X          }
  843. X  }
  844. X  
  845. X+ /* Recalculate level.objects[x][y], since this info was not saved. */
  846. X+ static void
  847. X+ find_lev_obj()
  848. X+ {
  849. X+     register struct obj *fobjtmp = (struct obj *)0;
  850. X+     register struct obj *otmp;
  851. X+     int x,y;
  852. X+ 
  853. X+     for(x=0; x<COLNO; x++) for(y=0; y<ROWNO; y++)
  854. X+         level.objects[x][y] = (struct obj *)0;
  855. X+ 
  856. X+     /* Reverse the entire fobj chain, which is necessary so that we can
  857. X+      * place the objects in the proper order.
  858. X+      */
  859. X+     while(otmp = fobj) {
  860. X+         fobj = otmp->nobj;
  861. X+         otmp->nobj = fobjtmp;
  862. X+         fobjtmp = otmp;
  863. X+     }
  864. X+     /* Set level.objects (as well as reversing the chain back again) */
  865. X+     while(otmp = fobjtmp) {
  866. X+         place_object(otmp, otmp->ox, otmp->oy);
  867. X+         fobjtmp = otmp->nobj;
  868. X+         otmp->nobj = fobj;
  869. X+         fobj = otmp;
  870. X+     }
  871. X+ }
  872. X+ 
  873. X  static struct obj *
  874. X  restobjchn(fd, ghostly)
  875. X  register int fd;
  876. X***************
  877. X*** 74,80 ****
  878. X       * new player's clock.  Assumption: new player arrived immediately
  879. X       * after old player died.
  880. X       */
  881. X!         if (ghostly) otmp->age = moves-omoves+otmp->age;
  882. X          otmp2 = otmp;
  883. X      }
  884. X      if(first && otmp2->nobj){
  885. X--- 102,108 ----
  886. X       * new player's clock.  Assumption: new player arrived immediately
  887. X       * after old player died.
  888. X       */
  889. X!         if (ghostly) otmp->age = monstermoves-omoves+otmp->age;
  890. X          otmp2 = otmp;
  891. X      }
  892. X      if(first && otmp2->nobj){
  893. X***************
  894. X*** 211,216 ****
  895. X--- 239,245 ----
  896. X      mread(fd, (genericptr_t) &dlevel, sizeof dlevel);
  897. X      mread(fd, (genericptr_t) &maxdlevel, sizeof maxdlevel);
  898. X      mread(fd, (genericptr_t) &moves, sizeof moves);
  899. X+     mread(fd, (genericptr_t) &monstermoves, sizeof monstermoves);
  900. X      mread(fd, (genericptr_t) &wiz_level, sizeof wiz_level);
  901. X      mread(fd, (genericptr_t) &medusa_level, sizeof medusa_level);
  902. X      mread(fd, (genericptr_t) &bigroom_level, sizeof bigroom_level);
  903. X***************
  904. X*** 328,335 ****
  905. X  #endif
  906. X      getlev(fd, 0, (xchar)0, FALSE);
  907. X      (void) close(fd);
  908. X! #ifdef EXPLORE_MODE
  909. X!     if(!discover)
  910. X  #endif
  911. X          (void) unlink(SAVEF);
  912. X  #ifdef REINCARNATION
  913. X--- 357,374 ----
  914. X  #endif
  915. X      getlev(fd, 0, (xchar)0, FALSE);
  916. X      (void) close(fd);
  917. X! #if defined(WIZARD) || defined(EXPLORE_MODE)
  918. X!     if(
  919. X! # ifdef WIZARD
  920. X!        !wizard
  921. X! #  ifdef EXPLORE_MODE
  922. X!            &&
  923. X! #  endif
  924. X! # endif
  925. X! # ifdef EXPLORE_MODE
  926. X!               !discover
  927. X! # endif
  928. X!                 )
  929. X  #endif
  930. X          (void) unlink(SAVEF);
  931. X  #ifdef REINCARNATION
  932. X***************
  933. X*** 372,377 ****
  934. X--- 411,417 ----
  935. X  {
  936. X      register struct gold *gold;
  937. X      register struct trap *trap;
  938. X+     register struct monst *mtmp;
  939. X  #ifdef WORM
  940. X      register struct wseg *wtmp;
  941. X      register int tmp;
  942. X***************
  943. X*** 666,671 ****
  944. X--- 706,712 ----
  945. X      }
  946. X      free((genericptr_t) trap);
  947. X      fobj = restobjchn(fd, ghostly);
  948. X+     find_lev_obj();
  949. X      billobjs = restobjchn(fd, ghostly);
  950. X      rest_engravings(fd);
  951. X      mread(fd, (genericptr_t)rooms, sizeof(rooms));
  952. X***************
  953. X*** 683,688 ****
  954. X--- 724,737 ----
  955. X      }
  956. X      mread(fd, (genericptr_t)wgrowtime, sizeof(wgrowtime));
  957. X  #endif
  958. X+ 
  959. X+     /* reset level.monsters for new level */
  960. X+     for (x = 0; x < COLNO; x++)
  961. X+         for (y = 0; y < ROWNO; y++)
  962. X+         level.monsters[x][y] = (struct monst *) 0;
  963. X+     for (mtmp = level.monlist; mtmp; mtmp = mtmp->nmon)
  964. X+         place_monster(mtmp, mtmp->mx, mtmp->my);
  965. X+ 
  966. X  #ifdef TUTTI_FRUTTI
  967. X      /* Now get rid of all the temp fruits... */
  968. X      if (ghostly) {
  969. X*** src/Old/rnd.c    Wed Sep 27 12:15:19 1989
  970. X--- src/rnd.c    Thu Sep 14 13:21:51 1989
  971. X***************
  972. X*** 28,33 ****
  973. X--- 28,39 ----
  974. X  rn2(x)        /* 0 <= rn2(x) < x */
  975. X  register int x;
  976. X  {
  977. X+ #ifdef DEBUG
  978. X+     if (x == 0) {
  979. X+         impossible("rn2(0) attempted");
  980. X+         return(0);
  981. X+     }
  982. X+ #endif
  983. X      return(RND(x));
  984. X  }
  985. X  
  986. X***************
  987. X*** 50,55 ****
  988. X--- 56,67 ----
  989. X  rnd(x)        /* 1 <= rnd(x) <= x */
  990. X  register int x;
  991. X  {
  992. X+ #ifdef DEBUG
  993. X+     if (x == 0) {
  994. X+         impossible("rnd(0) attempted");
  995. X+         return(1);
  996. X+     }
  997. X+ #endif
  998. X      return(RND(x)+1);
  999. X  }
  1000. X  
  1001. X*** src/Old/rumors.c    Wed Sep 27 12:15:31 1989
  1002. X--- src/rumors.c    Mon Sep 25 21:29:05 1989
  1003. X***************
  1004. X*** 223,229 ****
  1005. X              You("have no money.");
  1006. X              return(0);
  1007. X          }
  1008. X!         pline("\"Wilt thou settle for a minor consultation?\"  (50 Zorkmids) ");
  1009. X          ans = ynq();
  1010. X          if(ans == 'y') {
  1011. X              if(u.ugold < 50) {
  1012. X--- 223,229 ----
  1013. X              You("have no money.");
  1014. X              return(0);
  1015. X          }
  1016. X!         pline("\"Wilt thou settle for a minor consultation?\"  (50 zorkmids) ");
  1017. X          ans = ynq();
  1018. X          if(ans == 'y') {
  1019. X              if(u.ugold < 50) {
  1020. X***************
  1021. X*** 237,243 ****
  1022. X              return(1);
  1023. X          } else if(ans == 'q') return(0);
  1024. X          else {
  1025. X!             pline("\"Then dost thou desire a major one?\"  (1000 Zorkmids) ");
  1026. X              if (yn() != 'y') return(0);
  1027. X          }
  1028. X          if(u.ugold < 1000) {
  1029. X--- 237,243 ----
  1030. X              return(1);
  1031. X          } else if(ans == 'q') return(0);
  1032. X          else {
  1033. X!             pline("\"Then dost thou desire a major one?\"  (1000 zorkmids) ");
  1034. X              if (yn() != 'y') return(0);
  1035. X          }
  1036. X          if(u.ugold < 1000) {
  1037. X*** src/Old/save.c    Wed Sep 27 12:15:46 1989
  1038. X--- src/save.c    Tue Sep 26 16:08:38 1989
  1039. X***************
  1040. X*** 14,20 ****
  1041. X  #ifndef NO_SIGNAL
  1042. X  #include <signal.h>
  1043. X  #endif /* !NO_SIGNAL */
  1044. X! #ifdef EXPLORE_MODE
  1045. X  #include <fcntl.h>
  1046. X  #endif /* EXPLORE_MODE */
  1047. X  
  1048. X--- 14,20 ----
  1049. X  #ifndef NO_SIGNAL
  1050. X  #include <signal.h>
  1051. X  #endif /* !NO_SIGNAL */
  1052. X! #if defined(EXPLORE_MODE) && !defined(O_RDONLY)
  1053. X  #include <fcntl.h>
  1054. X  #endif /* EXPLORE_MODE */
  1055. X  
  1056. X***************
  1057. X*** 75,83 ****
  1058. X  #ifndef NOSAVEONHANGUP
  1059. X  int
  1060. X  hangup(){
  1061. X!     hu = TRUE;
  1062. X!     (void) dosave0();
  1063. X!     exit(1);
  1064. X      return 0;
  1065. X  }
  1066. X  #endif
  1067. X--- 75,88 ----
  1068. X  #ifndef NOSAVEONHANGUP
  1069. X  int
  1070. X  hangup(){
  1071. X!     if (!hu)
  1072. X!     {
  1073. X!         hu = TRUE;
  1074. X!         (void) dosave0();
  1075. X! # ifndef VMS
  1076. X!         exit(1);
  1077. X! # endif
  1078. X!     }
  1079. X      return 0;
  1080. X  }
  1081. X  #endif
  1082. X***************
  1083. X*** 95,101 ****
  1084. X  #ifdef COMPRESS
  1085. X      char    cmd[80];
  1086. X  #endif
  1087. X! #ifdef UNIX
  1088. X      (void) signal(SIGHUP, SIG_IGN);
  1089. X  #endif
  1090. X  #if !defined(__TURBOC__) && !defined(OLD_TOS)
  1091. X--- 100,110 ----
  1092. X  #ifdef COMPRESS
  1093. X      char    cmd[80];
  1094. X  #endif
  1095. X! 
  1096. X!     if (!SAVEF[0])
  1097. X!         return 0;
  1098. X! 
  1099. X! #if defined(UNIX) || defined(VMS)
  1100. X      (void) signal(SIGHUP, SIG_IGN);
  1101. X  #endif
  1102. X  #if !defined(__TURBOC__) && !defined(OLD_TOS)
  1103. X***************
  1104. X*** 164,169 ****
  1105. X--- 173,179 ----
  1106. X      bwrite(fd, (genericptr_t) &dlevel, sizeof dlevel);
  1107. X      bwrite(fd, (genericptr_t) &maxdlevel, sizeof maxdlevel);
  1108. X      bwrite(fd, (genericptr_t) &moves, sizeof moves);
  1109. X+     bwrite(fd, (genericptr_t) &monstermoves, sizeof monstermoves);
  1110. X      bwrite(fd, (genericptr_t) &wiz_level, sizeof wiz_level);
  1111. X      bwrite(fd, (genericptr_t) &medusa_level, sizeof medusa_level);
  1112. X      bwrite(fd, (genericptr_t) &bigroom_level, sizeof bigroom_level);
  1113. X***************
  1114. X*** 355,361 ****
  1115. X      else
  1116. X  #endif
  1117. X          bwrite(fd, (genericptr_t) &showsyms, sizeof(struct symbols));
  1118. X!     bwrite(fd,(genericptr_t) &moves,sizeof(long));
  1119. X      bwrite(fd,(genericptr_t) &xupstair,sizeof(xupstair));
  1120. X      bwrite(fd,(genericptr_t) &yupstair,sizeof(yupstair));
  1121. X      bwrite(fd,(genericptr_t) &xdnstair,sizeof(xdnstair));
  1122. X--- 365,371 ----
  1123. X      else
  1124. X  #endif
  1125. X          bwrite(fd, (genericptr_t) &showsyms, sizeof(struct symbols));
  1126. X!     bwrite(fd,(genericptr_t) &monstermoves,sizeof(long));
  1127. X      bwrite(fd,(genericptr_t) &xupstair,sizeof(xupstair));
  1128. X      bwrite(fd,(genericptr_t) &yupstair,sizeof(yupstair));
  1129. X      bwrite(fd,(genericptr_t) &xdnstair,sizeof(xdnstair));
  1130. X*** src/Old/search.c    Wed Sep 27 12:16:28 1989
  1131. X--- src/search.c    Thu Sep 14 14:12:00 1989
  1132. X***************
  1133. X*** 36,42 ****
  1134. X              atl(zx,zy,(char)((ttmp->ttyp==WEB) ? WEB_SYM : TRAP_SYM));
  1135. X              (*num)++;
  1136. X          }
  1137. X!     } else if(levl[zx][zy].mmask) {
  1138. X          mtmp = m_at(zx,zy);
  1139. X          if(mtmp->mimic) {
  1140. X                  seemimic(mtmp);
  1141. X--- 36,42 ----
  1142. X              atl(zx,zy,(char)((ttmp->ttyp==WEB) ? WEB_SYM : TRAP_SYM));
  1143. X              (*num)++;
  1144. X          }
  1145. X!     } else if(MON_AT(zx, zy)) {
  1146. X          mtmp = m_at(zx,zy);
  1147. X          if(mtmp->mimic) {
  1148. X                  seemimic(mtmp);
  1149. X***************
  1150. X*** 122,128 ****
  1151. X              prl(x,y);
  1152. X              } else {
  1153. X          /* Be careful not to find anything in an SCORR or SDOOR */
  1154. X!             if(levl[x][y].mmask) {
  1155. X                  mtmp = m_at(x,y);
  1156. X                  if(!aflag && mtmp->mimic) {
  1157. X                  seemimic(mtmp);
  1158. X--- 122,128 ----
  1159. X              prl(x,y);
  1160. X              } else {
  1161. X          /* Be careful not to find anything in an SCORR or SDOOR */
  1162. X!             if(MON_AT(x, y)) {
  1163. X                  mtmp = m_at(x,y);
  1164. X                  if(!aflag && mtmp->mimic) {
  1165. X                  seemimic(mtmp);
  1166. X*** src/Old/shk.c    Wed Sep 27 12:17:07 1989
  1167. X--- src/shk.c    Mon Sep 25 23:01:31 1989
  1168. X***************
  1169. X*** 9,15 ****
  1170. X  #include "eshk.h"
  1171. X  
  1172. X  #ifdef KOPS
  1173. X! static int makekops();
  1174. X  static void kops_gone();
  1175. X  #endif /* KOPS */
  1176. X  
  1177. X--- 9,15 ----
  1178. X  #include "eshk.h"
  1179. X  
  1180. X  #ifdef KOPS
  1181. X! static int makekops P((coord *));
  1182. X  static void kops_gone();
  1183. X  #endif /* KOPS */
  1184. X  
  1185. X***************
  1186. X*** 125,132 ****
  1187. X                  You("escaped the shop without paying!");
  1188. X              addupbill();
  1189. X              total += ESHK(shopkeeper)->debit;
  1190. X!             You("stole %ld zorkmids worth of merchandise.",
  1191. X!                 total);
  1192. X              ESHK(shopkeeper)->robbed += total;
  1193. X              ESHK(shopkeeper)->credit = 0L;
  1194. X              ESHK(shopkeeper)->debit = 0L;
  1195. X--- 125,132 ----
  1196. X                  You("escaped the shop without paying!");
  1197. X              addupbill();
  1198. X              total += ESHK(shopkeeper)->debit;
  1199. X!             You("stole %ld zorkmid%s worth of merchandise.",
  1200. X!                 total, plur(total));
  1201. X              ESHK(shopkeeper)->robbed += total;
  1202. X              ESHK(shopkeeper)->credit = 0L;
  1203. X              ESHK(shopkeeper)->debit = 0L;
  1204. X***************
  1205. X*** 404,415 ****
  1206. X  register struct monst *shkp;
  1207. X  {
  1208. X      register xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y;
  1209. X!     if(levl[x][y].mmask)
  1210. X          mnearto(m_at(x,y), x, y, FALSE);
  1211. X!     levl[shkp->mx][shkp->my].mmask = 0;
  1212. X!     shkp->mx = x;
  1213. X!     shkp->my = y;
  1214. X!     levl[shkp->mx][shkp->my].mmask = 1;
  1215. X      unpmon(shkp);
  1216. X  }
  1217. X  
  1218. X--- 404,413 ----
  1219. X  register struct monst *shkp;
  1220. X  {
  1221. X      register xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y;
  1222. X!     if(MON_AT(x, y))
  1223. X          mnearto(m_at(x,y), x, y, FALSE);
  1224. X!     remove_monster(shkp->mx, shkp->my);
  1225. X!     place_monster(shkp, x, y);
  1226. X      unpmon(shkp);
  1227. X  }
  1228. X  
  1229. X***************
  1230. X*** 468,476 ****
  1231. X          else {
  1232. X              long ugold = u.ugold;
  1233. X  
  1234. X!             if(ugold  > ltmp) {
  1235. X!             You("give %s the %ld gold pieces %s asked for.",
  1236. X!                 mon_nam(shkp), ltmp,
  1237. X                  ESHK(shkp)->ismale ? "he" : "she");
  1238. X              pay(ltmp, shkp);
  1239. X              } else {
  1240. X--- 466,474 ----
  1241. X          else {
  1242. X              long ugold = u.ugold;
  1243. X  
  1244. X!             if(ugold > ltmp) {
  1245. X!             You("give %s the %ld gold piece%s %s asked for.",
  1246. X!                 mon_nam(shkp), ltmp, plur(ltmp),
  1247. X                  ESHK(shkp)->ismale ? "he" : "she");
  1248. X              pay(ltmp, shkp);
  1249. X              } else {
  1250. X***************
  1251. X*** 538,545 ****
  1252. X      }
  1253. X      /* pay debt, if any, first */
  1254. X      if(ESHK(shopkeeper)->debit) {
  1255. X!             You("owe %s %ld zorkmids for the use of merchandise.",
  1256. X!             shkname(shopkeeper), ESHK(shopkeeper)->debit);
  1257. X              if(u.ugold + ESHK(shopkeeper)->credit < 
  1258. X                      ESHK(shopkeeper)->debit) {
  1259. X              pline("But you don't have enough gold%s.",
  1260. X--- 536,544 ----
  1261. X      }
  1262. X      /* pay debt, if any, first */
  1263. X      if(ESHK(shopkeeper)->debit) {
  1264. X!             You("owe %s %ld zorkmid%s for the use of merchandise.",
  1265. X!             shkname(shopkeeper), ESHK(shopkeeper)->debit,
  1266. X!                 plur(ESHK(shopkeeper)->debit));
  1267. X              if(u.ugold + ESHK(shopkeeper)->credit < 
  1268. X                      ESHK(shopkeeper)->debit) {
  1269. X              pline("But you don't have enough gold%s.",
  1270. X***************
  1271. X*** 722,732 ****
  1272. X          } else {
  1273. X              u.ugold -= loss;
  1274. X              shopkeeper->mgold += loss;
  1275. X!             pline("%s comes and takes %ld zorkmids %sowed %s.",
  1276. X!                    Monnam(shopkeeper),
  1277. X!                    loss,
  1278. X!                    strncmp(ESHK(shopkeeper)->customer, plname, PL_NSIZ) ? "" : "you ",
  1279. X!                    ESHK(shopkeeper)->ismale ? "him" : "her");
  1280. X          }
  1281. X  
  1282. X          /* in case we create bones */
  1283. X--- 721,732 ----
  1284. X          } else {
  1285. X              u.ugold -= loss;
  1286. X              shopkeeper->mgold += loss;
  1287. X!             pline("%s comes and takes %ld zorkmid%s %sowed %s.",
  1288. X!                   Monnam(shopkeeper),
  1289. X!                   loss,
  1290. X!                   plur(loss),
  1291. X!                   strncmp(ESHK(shopkeeper)->customer, plname, PL_NSIZ) ? "" : "you ",
  1292. X!                   ESHK(shopkeeper)->ismale ? "him" : "her");
  1293. X          }
  1294. X  
  1295. X          /* in case we create bones */
  1296. X***************
  1297. X*** 847,854 ****
  1298. X          pline("%s; only %d %s %s.\"", buf, bp->price,
  1299. X              (bp->bquan > 1) ? "per" : "for this", xname(obj));
  1300. X          obj->quan = bp->bquan;
  1301. X!     } else pline("The %s will cost you %d zorkmids%s.",
  1302. X!             xname(obj), bp->price,
  1303. X              (bp->bquan > 1) ? " each" : "");
  1304. X      ESHK(shopkeeper)->billct++;
  1305. X      obj->unpaid = 1;
  1306. X--- 847,854 ----
  1307. X          pline("%s; only %d %s %s.\"", buf, bp->price,
  1308. X              (bp->bquan > 1) ? "per" : "for this", xname(obj));
  1309. X          obj->quan = bp->bquan;
  1310. X!     } else pline("The %s will cost you %d zorkmid%s%s.",
  1311. X!             xname(obj), bp->price, plur((long)bp->price),
  1312. X              (bp->bquan > 1) ? " each" : "");
  1313. X      ESHK(shopkeeper)->billct++;
  1314. X      obj->unpaid = 1;
  1315. X***************
  1316. X*** 886,900 ****
  1317. X      }
  1318. X  }
  1319. X  
  1320. X! void
  1321. X  subfrombill(obj)
  1322. X  register struct obj *obj;
  1323. X  {
  1324. X-     long ltmp;
  1325. X      register struct bill_x *bp;
  1326. X  
  1327. X-     if(!costly_spot(u.ux,u.uy))
  1328. X-         return;
  1329. X      if((bp = onbill(obj)) != 0) {
  1330. X          register struct obj *otmp;
  1331. X  
  1332. X--- 886,897 ----
  1333. X      }
  1334. X  }
  1335. X  
  1336. X! static void
  1337. X  subfrombill(obj)
  1338. X  register struct obj *obj;
  1339. X  {
  1340. X      register struct bill_x *bp;
  1341. X  
  1342. X      if((bp = onbill(obj)) != 0) {
  1343. X          register struct obj *otmp;
  1344. X  
  1345. X***************
  1346. X*** 914,927 ****
  1347. X          ESHK(shopkeeper)->billct--;
  1348. X          *bp = bill[ESHK(shopkeeper)->billct];
  1349. X          return;
  1350. X!     }
  1351. X!     if(obj->unpaid) {
  1352. X!         if(inhishop(shopkeeper))
  1353. X!             pline("%s didn't notice.", Monnam(shopkeeper));
  1354. X          obj->unpaid = 0;
  1355. X-         return;        /* %% */
  1356. X      }
  1357. X!     /* he dropped something of his own - probably wants to sell it */
  1358. X      if(shopkeeper->msleep || shopkeeper->mfroz || !inhishop(shopkeeper))
  1359. X          return;
  1360. X      ltmp = (long) getprice(obj) * (long) obj->quan;
  1361. X--- 911,932 ----
  1362. X          ESHK(shopkeeper)->billct--;
  1363. X          *bp = bill[ESHK(shopkeeper)->billct];
  1364. X          return;
  1365. X!     } else if (obj->unpaid) {
  1366. X!         impossible("subfrombill: unpaid object not on bill");
  1367. X          obj->unpaid = 0;
  1368. X      }
  1369. X! }
  1370. X! 
  1371. X! void
  1372. X! sellobj(obj)
  1373. X! register struct obj *obj;
  1374. X! {
  1375. X!     long ltmp;
  1376. X! 
  1377. X!     if(!costly_spot(u.ux,u.uy))
  1378. X!         return;
  1379. X!     subfrombill(obj);
  1380. X!     /* you dropped something of your own - probably want to sell it */
  1381. X      if(shopkeeper->msleep || shopkeeper->mfroz || !inhishop(shopkeeper))
  1382. X          return;
  1383. X      ltmp = (long) getprice(obj) * (long) obj->quan;
  1384. X***************
  1385. X*** 1007,1018 ****
  1386. X          for(cnt = 0; buf[cnt]; cnt++);
  1387. X          while(cnt < 50)
  1388. X              buf[cnt++] = ' ';
  1389. X!         Sprintf(&buf[cnt], " %5ld zorkmids", thisused);
  1390. X          if(page_line(buf))
  1391. X              goto quit;
  1392. X          }
  1393. X      }
  1394. X!     Sprintf(buf, "Total:%50ld zorkmids", totused);
  1395. X      if(page_line("") || page_line(buf))
  1396. X          goto quit;
  1397. X      set_pager(1);
  1398. X--- 1012,1023 ----
  1399. X          for(cnt = 0; buf[cnt]; cnt++);
  1400. X          while(cnt < 50)
  1401. X              buf[cnt++] = ' ';
  1402. X!         Sprintf(&buf[cnt], " %5ld zorkmid%s", thisused, plur(thisused));
  1403. X          if(page_line(buf))
  1404. X              goto quit;
  1405. X          }
  1406. X      }
  1407. X!     Sprintf(buf, "Total:%50ld zorkmid%s", totused, plur(totused));
  1408. X      if(page_line("") || page_line(buf))
  1409. X          goto quit;
  1410. X      set_pager(1);
  1411. X***************
  1412. X*** 1039,1044 ****
  1413. X--- 1044,1050 ----
  1414. X      case FOOD_SYM:
  1415. X          /* simpler hunger check, (2-4)*cost */
  1416. X          if (u.uhs >= HUNGRY) tmp *= u.uhs;
  1417. X+         if (OEATEN(obj)) tmp /= 2;        /* partly eaten */
  1418. X          break;
  1419. X      case WAND_SYM:
  1420. X          if (obj->spe == -1) tmp = 0;
  1421. X***************
  1422. X*** 1064,1071 ****
  1423. X  {
  1424. X      register struct monst *shkp = shopkeeper;
  1425. X  
  1426. X      if(u.uinshop && shkp && !shkp->mfroz && !shkp->msleep &&
  1427. X-         u.dx && u.dy &&
  1428. X          inroom(u.ux+u.dx, u.uy+u.dy) + 1 == u.uinshop &&
  1429. X          shkp->mx == ESHK(shkp)->shk.x && shkp->my == ESHK(shkp)->shk.y &&
  1430. X          u.ux == ESHK(shkp)->shd.x && u.uy == ESHK(shkp)->shd.y) {
  1431. X--- 1070,1077 ----
  1432. X  {
  1433. X      register struct monst *shkp = shopkeeper;
  1434. X  
  1435. X+     if(obj->otyp != PICK_AXE) return(0);
  1436. X      if(u.uinshop && shkp && !shkp->mfroz && !shkp->msleep &&
  1437. X          inroom(u.ux+u.dx, u.uy+u.dy) + 1 == u.uinshop &&
  1438. X          shkp->mx == ESHK(shkp)->shk.x && shkp->my == ESHK(shkp)->shk.y &&
  1439. X          u.ux == ESHK(shkp)->shd.x && u.uy == ESHK(shkp)->shd.y) {
  1440. X***************
  1441. X*** 1072,1077 ****
  1442. X--- 1078,1084 ----
  1443. X          pline("%s nimbly catches the %s.", Monnam(shkp), xname(obj));
  1444. X          obj->nobj = shkp->minvent;
  1445. X          shkp->minvent = obj;
  1446. X+         subfrombill(obj);
  1447. X          return(1);
  1448. X      }
  1449. X      return(0);
  1450. X***************
  1451. X*** 1227,1233 ****
  1452. X          pline("\"%s, do not damage the floor here!\"",
  1453. X              flags.female ? "Madam" : "Sir");
  1454. X      if (pl_character[0] == 'K') adjalign(-sgn(u.ualigntyp));
  1455. X!     } else if(um_dist(shopkeeper->mx, shopkeeper->my, 2)) {
  1456. X      register struct obj *obj, *obj2;
  1457. X  
  1458. X      if(dist(shopkeeper->mx, shopkeeper->my) > 2) {
  1459. X--- 1234,1240 ----
  1460. X          pline("\"%s, do not damage the floor here!\"",
  1461. X              flags.female ? "Madam" : "Sir");
  1462. X      if (pl_character[0] == 'K') adjalign(-sgn(u.ualigntyp));
  1463. X!     } else if(!um_dist(shopkeeper->mx, shopkeeper->my, 5)) {
  1464. X      register struct obj *obj, *obj2;
  1465. X  
  1466. X      if(dist(shopkeeper->mx, shopkeeper->my) > 2) {
  1467. X***************
  1468. X*** 1248,1255 ****
  1469. X          freeinv(obj);
  1470. X          obj->nobj = shopkeeper->minvent;
  1471. X          shopkeeper->minvent = obj;
  1472. X!         if(obj->unpaid)
  1473. X!             subfrombill(obj);
  1474. X      }
  1475. X      }
  1476. X  }
  1477. X--- 1255,1261 ----
  1478. X          freeinv(obj);
  1479. X          obj->nobj = shopkeeper->minvent;
  1480. X          shopkeeper->minvent = obj;
  1481. X!         subfrombill(obj);
  1482. X      }
  1483. X      }
  1484. X  }
  1485. X***************
  1486. X*** 1328,1341 ****
  1487. X      if(!in_shop(shopkeeper->mx ,shopkeeper->my)) return;
  1488. X  
  1489. X      /* if a !shopkeeper shows up at the door, move him */
  1490. X!     if(levl[x][y].mmask && (mtmp = m_at(x, y)) != shopkeeper) {
  1491. X          if(flags.soundok) {
  1492. X              You("hear an angry voice: \"Out of my way, scum!\"");
  1493. X              (void) fflush(stdout);
  1494. X! #if defined(SYSV) || defined(ULTRIX)
  1495. X              (void)
  1496. X  #endif
  1497. X! #ifdef UNIX
  1498. X              sleep(1);
  1499. X  #endif
  1500. X          }
  1501. X--- 1334,1347 ----
  1502. X      if(!in_shop(shopkeeper->mx ,shopkeeper->my)) return;
  1503. X  
  1504. X      /* if a !shopkeeper shows up at the door, move him */
  1505. X!     if(MON_AT(x, y) && (mtmp = m_at(x, y)) != shopkeeper) {
  1506. X          if(flags.soundok) {
  1507. X              You("hear an angry voice: \"Out of my way, scum!\"");
  1508. X              (void) fflush(stdout);
  1509. X! #if defined(SYSV) || defined(ULTRIX) || defined(VMS)
  1510. X              (void)
  1511. X  #endif
  1512. X! #if defined(UNIX) || defined(VMS)
  1513. X              sleep(1);
  1514. X  #endif
  1515. X          }
  1516. X***************
  1517. X*** 1343,1352 ****
  1518. X      }
  1519. X  
  1520. X      /* make shk show up at the door */
  1521. X!     levl[shopkeeper->mx][shopkeeper->my].mmask = 0;
  1522. X!     levl[x][y].mmask = 1;
  1523. X!     shopkeeper->mx = x;
  1524. X!     shopkeeper->my = y;
  1525. X      pmon(shopkeeper);
  1526. X  
  1527. X      damage = (ACURR(A_STR) > 18) ? 400 : 20 * ACURR(A_STR);
  1528. X--- 1349,1356 ----
  1529. X      }
  1530. X  
  1531. X      /* make shk show up at the door */
  1532. X!     remove_monster(shopkeeper->mx, shopkeeper->my);
  1533. X!     place_monster(shopkeeper, x, y);
  1534. X      pmon(shopkeeper);
  1535. X  
  1536. X      damage = (ACURR(A_STR) > 18) ? 400 : 20 * ACURR(A_STR);
  1537. X***************
  1538. X*** 1374,1380 ****
  1539. X          NOTANGRY(shopkeeper) = 1;
  1540. X      }
  1541. X      else {
  1542. X!         pline("\"Oh, yes!  You'll pay!\"");
  1543. X          ESHK(shopkeeper)->following = 1;
  1544. X          NOTANGRY(shopkeeper) = 0;
  1545. X          adjalign(-sgn(u.ualigntyp));
  1546. X--- 1378,1384 ----
  1547. X          NOTANGRY(shopkeeper) = 1;
  1548. X      }
  1549. X      else {
  1550. X!         verbalize("Oh, yes!  You'll pay!");
  1551. X          ESHK(shopkeeper)->following = 1;
  1552. X          NOTANGRY(shopkeeper) = 0;
  1553. X          adjalign(-sgn(u.ualigntyp));
  1554. X*** src/Old/shknam.c    Wed Sep 27 12:17:56 1989
  1555. X--- src/shknam.c    Thu Sep 14 14:12:08 1989
  1556. X***************
  1557. X*** 186,192 ****
  1558. X      register struct monst *mtmp;
  1559. X      int atype;
  1560. X  
  1561. X!     if (rn2(100) < dlevel && levl[sx][sy].mmask == 0 &&
  1562. X                  (mtmp=makemon(mkclass(S_MIMIC),sx,sy))) {
  1563. X          mtmp->mimic = 1;
  1564. X          /* note: makemon will set the mimic symbol to a shop item */
  1565. X--- 186,192 ----
  1566. X      register struct monst *mtmp;
  1567. X      int atype;
  1568. X  
  1569. X!     if (rn2(100) < dlevel && !MON_AT(sx, sy) &&
  1570. X                  (mtmp=makemon(mkclass(S_MIMIC),sx,sy))) {
  1571. X          mtmp->mimic = 1;
  1572. X          /* note: makemon will set the mimic symbol to a shop item */
  1573. X***************
  1574. X*** 258,264 ****
  1575. X              return(-1);
  1576. X              }
  1577. X  
  1578. X!     if(levl[sx][sy].mmask) rloc(m_at(sx, sy)); /* insurance */
  1579. X  
  1580. X      /* now initialize the shopkeeper monster structure */
  1581. X      if(!(shk = makemon(&mons[PM_SHOPKEEPER], sx, sy))) return(-1);
  1582. X--- 258,264 ----
  1583. X              return(-1);
  1584. X              }
  1585. X  
  1586. X!     if(MON_AT(sx, sy)) rloc(m_at(sx, sy)); /* insurance */
  1587. X  
  1588. X      /* now initialize the shopkeeper monster structure */
  1589. X      if(!(shk = makemon(&mons[PM_SHOPKEEPER], sx, sy))) return(-1);
  1590. X*** src/Old/sounds.c    Wed Sep 27 12:18:36 1989
  1591. X--- src/sounds.c    Thu Sep 14 14:12:11 1989
  1592. X***************
  1593. X*** 381,390 ****
  1594. X      case MS_HUMANOID:
  1595. X          /* Generic humanoid behaviour. */
  1596. X          if (!mtmp->mpeaceful && !mtmp->mtame) break;
  1597. X!         if (mtmp->mhp < 10)
  1598. X!         kludge("%s moans.", Monnam(mtmp));
  1599. X!         else if (mtmp->mflee)
  1600. X          kludge("%s wants nothing to do with you.", Monnam(mtmp));
  1601. X          else if (mtmp->mconf || mtmp->mstun)
  1602. X          verbalize(!rn2(3) ? "Huh?" : rn2(2) ? "What?" : "Eh?");
  1603. X          else if (mtmp->mblinded)
  1604. X--- 381,390 ----
  1605. X      case MS_HUMANOID:
  1606. X          /* Generic humanoid behaviour. */
  1607. X          if (!mtmp->mpeaceful && !mtmp->mtame) break;
  1608. X!         if (mtmp->mflee)
  1609. X          kludge("%s wants nothing to do with you.", Monnam(mtmp));
  1610. X+         else if (mtmp->mhp < mtmp->mhpmax/4)
  1611. X+         kludge("%s moans.", Monnam(mtmp));
  1612. X          else if (mtmp->mconf || mtmp->mstun)
  1613. X          verbalize(!rn2(3) ? "Huh?" : rn2(2) ? "What?" : "Eh?");
  1614. X          else if (mtmp->mblinded)
  1615. X***************
  1616. X*** 587,593 ****
  1617. X      }
  1618. X  
  1619. X      tx = u.ux+u.dx; ty = u.uy+u.dy;
  1620. X!     if ((Blind && !Telepat) || !levl[tx][ty].mmask ||
  1621. X          (mtmp = m_at(tx, ty))->mimic || mtmp->mundetected) {
  1622. X      pline("I see nobody there.");
  1623. X      return(0);
  1624. X--- 587,593 ----
  1625. X      }
  1626. X  
  1627. X      tx = u.ux+u.dx; ty = u.uy+u.dy;
  1628. X!     if ((Blind && !Telepat) || !MON_AT(tx, ty) ||
  1629. X          (mtmp = m_at(tx, ty))->mimic || mtmp->mundetected) {
  1630. X      pline("I see nobody there.");
  1631. X      return(0);
  1632. X*** src/Old/spell.c    Wed Sep 27 12:19:31 1989
  1633. X--- src/spell.c    Thu Sep 14 14:06:53 1989
  1634. X***************
  1635. X*** 18,27 ****
  1636. X  #define spellid(spell)        spl_book[spell-1].sp_id
  1637. X  
  1638. X  static void
  1639. X! cursed_book(level)
  1640. X!     register int    level;
  1641. X  {
  1642. X!     switch(rn2(level)) {
  1643. X      case 0:
  1644. X          You("feel a wrenching sensation.");
  1645. X          tele();        /* teleport him */
  1646. X--- 18,27 ----
  1647. X  #define spellid(spell)        spl_book[spell-1].sp_id
  1648. X  
  1649. X  static void
  1650. X! cursed_book(lev)
  1651. X!     register int    lev;
  1652. X  {
  1653. X!     switch(rn2(lev)) {
  1654. X      case 0:
  1655. X          You("feel a wrenching sensation.");
  1656. X          tele();        /* teleport him */
  1657. X*** src/Old/termcap.c    Wed Sep 27 12:20:12 1989
  1658. X--- src/termcap.c    Wed Sep 27 11:25:44 1989
  1659. X***************
  1660. X*** 32,50 ****
  1661. X  # ifdef TERMLIB
  1662. X  static void init_hilite();
  1663. X  # endif
  1664. X! #define NONE        0
  1665. X! #define HIGH_INTENSITY    1
  1666. X! #define BLACK        0
  1667. X! #define HILITE_ATTRIB    HIGH_INTENSITY
  1668. X! #endif /* TEXTCOLOR */
  1669. X  
  1670. X  static char *HO, *CL, *CE, *UP, *CM, *ND, *XD, *BC, *SO, *SE, *TI, *TE;
  1671. X  static char *VS, *VE, *US, *UE;
  1672. X  static char *MR, *ME;
  1673. X  #if 0
  1674. X! static char *MB, *MD, *MH;
  1675. X  #endif
  1676. X  #ifdef TERMLIB
  1677. X  static int SG;
  1678. X  static char PC = '\0';
  1679. X  static char tbuf[512];
  1680. X--- 32,50 ----
  1681. X  # ifdef TERMLIB
  1682. X  static void init_hilite();
  1683. X  # endif
  1684. X! #endif
  1685. X  
  1686. X  static char *HO, *CL, *CE, *UP, *CM, *ND, *XD, *BC, *SO, *SE, *TI, *TE;
  1687. X  static char *VS, *VE, *US, *UE;
  1688. X  static char *MR, *ME;
  1689. X  #if 0
  1690. X! static char *MB, *MH;
  1691. X! static char *MD;    /* may already be in use below */
  1692. X  #endif
  1693. X  #ifdef TERMLIB
  1694. X+ # ifdef TEXTCOLOR
  1695. X+ static char *MD;
  1696. X+ # endif
  1697. X  static int SG;
  1698. X  static char PC = '\0';
  1699. X  static char tbuf[512];
  1700. X***************
  1701. X*** 134,140 ****
  1702. X          SO = "\033p";
  1703. X          SE = "\033q";
  1704. X          HI = "\033p";
  1705. X!         HE = "\033q";
  1706. X      }
  1707. X  #  else /* TOS */
  1708. X      {
  1709. X--- 134,144 ----
  1710. X          SO = "\033p";
  1711. X          SE = "\033q";
  1712. X          HI = "\033p";
  1713. X!         HE = "\033q\033b\020";
  1714. X!         for (i = 0; i < SIZE(hilites); i++) {
  1715. X!             hilites[i] = (char *) alloc(sizeof("Eb1"));
  1716. X!             Sprintf(hilites[i], (i%4)?"\033b%c","\033p", i);
  1717. X!         }
  1718. X      }
  1719. X  #  else /* TOS */
  1720. X      {
  1721. X***************
  1722. X*** 173,182 ****
  1723. X  #   endif
  1724. X          TE = VS = VE = "";
  1725. X  #   ifdef TEXTCOLOR
  1726. X!         for (i = 0; i < SIZE(HI_COLOR); i++) {
  1727. X!             HI_COLOR[i] = (char *) alloc(sizeof("E[0;33;44m"));
  1728. X!             Sprintf(HI_COLOR[i], "\033[%d;3%dm",
  1729. X!                 i == BLACK ? NONE : HILITE_ATTRIB, i);
  1730. X          }
  1731. X  #   endif
  1732. X          return;
  1733. X--- 177,187 ----
  1734. X  #   endif
  1735. X          TE = VS = VE = "";
  1736. X  #   ifdef TEXTCOLOR
  1737. X!         for (i = 0; i < MAXCOLORS / 2; i++) {
  1738. X!             hilites[i] = (char *) alloc(sizeof("\033[0;3%dm"));
  1739. X!             hilites[i+BRIGHT] = (char *) alloc(sizeof("\033[1;3%dm"));
  1740. X!             Sprintf(hilites[i], "\033[0;3%dm", i);
  1741. X!             Sprintf(hilites[i+BRIGHT], "\033[1;3%dm", i);
  1742. X          }
  1743. X  #   endif
  1744. X          return;
  1745. X***************
  1746. X*** 282,287 ****
  1747. X--- 287,295 ----
  1748. X      AS = Tgetstr("as");
  1749. X      AE = Tgetstr("ae");
  1750. X      CD = Tgetstr("cd");
  1751. X+ # ifdef TEXTCOLOR
  1752. X+     MD = Tgetstr("md");
  1753. X+ # endif
  1754. X      set_whole_screen();        /* uses LI and CD */
  1755. X      if(tbufptr-tbuf > sizeof(tbuf)) error("TERMCAP entry too big...\n");
  1756. X      free((genericptr_t)tptr);
  1757. X***************
  1758. X*** 514,519 ****
  1759. X--- 522,528 ----
  1760. X      (void) fflush(stdout);
  1761. X  }
  1762. X  
  1763. X+ #if defined(TERMLIB) || defined(DECRAINBOW)
  1764. X  void
  1765. X  graph_on() {
  1766. X      if (AS) xputs(AS);
  1767. X***************
  1768. X*** 523,533 ****
  1769. X--- 532,550 ----
  1770. X  graph_off() {
  1771. X      if (AE) xputs(AE);
  1772. X  }
  1773. X+ #endif
  1774. X  
  1775. X  #ifndef MSDOS
  1776. X+ # ifdef VMS
  1777. X+ static const short tmspc10[] = {        /* from termcap */
  1778. X+     0, 2000, 1333, 909, 743, 666, 333, 166, 83, 55, 50, 41, 27, 20, 13, 10,
  1779. X+     5
  1780. X+ };
  1781. X+ # else
  1782. X  static const short tmspc10[] = {        /* from termcap */
  1783. X      0, 2000, 1333, 909, 743, 666, 500, 333, 166, 83, 55, 41, 20, 10, 5
  1784. X  };
  1785. X+ # endif
  1786. X  #endif
  1787. X  
  1788. X  void
  1789. X***************
  1790. X*** 594,600 ****
  1791. X   * code found in pri.c).  It is assumed that the background color is black.
  1792. X   */
  1793. X  /* terminfo indexes for the basic colors it guarantees */
  1794. X! #define COLOR_BLACK   0
  1795. X  #define COLOR_BLUE    1
  1796. X  #define COLOR_GREEN   2
  1797. X  #define COLOR_CYAN    3
  1798. X--- 611,617 ----
  1799. X   * code found in pri.c).  It is assumed that the background color is black.
  1800. X   */
  1801. X  /* terminfo indexes for the basic colors it guarantees */
  1802. X! #define COLOR_BLACK   1        /* fake out to avoid black on black */
  1803. X  #define COLOR_BLUE    1
  1804. X  #define COLOR_GREEN   2
  1805. X  #define COLOR_CYAN    3
  1806. X***************
  1807. X*** 611,633 ****
  1808. X  static void
  1809. X  init_hilite()
  1810. X  {
  1811. X-     int erret;
  1812. X-     char *setf, *scratch;
  1813. X      register int c;
  1814. X!     extern int setupterm();
  1815. X!     extern char *tparm(), *tigetstr();
  1816. X  
  1817. X!     for (c = 0; c < SIZE(HI_COLOR); c++)
  1818. X!         HI_COLOR[c] = HI;
  1819. X  
  1820. X!     if (tgetnum("Co") < 8 || (setf = tgetstr("Sf", 0)) == (char *)NULL)
  1821. X          return;
  1822. X  
  1823. X!     for (c = 0; c < SIZE(HI_COLOR); c++) {
  1824. X!         scratch = tparm(setf, ti_map[c]);
  1825. X!         HI_COLOR[c] = (char *)alloc(strlen(scratch) + 1);
  1826. X!         Strcpy(HI_COLOR[c], scratch);
  1827. X      }
  1828. X  }
  1829. X  
  1830. X  # else /* UNIX */
  1831. X--- 628,655 ----
  1832. X  static void
  1833. X  init_hilite()
  1834. X  {
  1835. X      register int c;
  1836. X! #  ifdef TERMINFO
  1837. X!     char *setf, *scratch;
  1838. X!     extern char *tparm();
  1839. X! #  endif
  1840. X  
  1841. X!     for (c = 0; c < MAXCOLORS; c++)
  1842. X!         hilites[c] = HI;
  1843. X  
  1844. X! #  ifdef TERMINFO
  1845. X!     if (tgetnum("Co") < 8 || (setf = tgetstr("Sf", 0)) == NULL)
  1846. X          return;
  1847. X  
  1848. X!     for (c = 0; c < MAXCOLORS / 2; c++) {
  1849. X!           scratch = tparm(setf, ti_map[c]);
  1850. X!         hilites[c] = (char *) alloc(strlen(scratch) + 1);
  1851. X!         hilites[c+BRIGHT] = (char*) alloc(strlen(scratch)+strlen(MD)+1);
  1852. X!         Strcpy(hilites[c], scratch);
  1853. X!         Strcpy(hilites[c+BRIGHT], MD);
  1854. X!         Strcat(hilites[c+BRIGHT], scratch);
  1855. X      }
  1856. X+ #  endif
  1857. X  }
  1858. X  
  1859. X  # else /* UNIX */
  1860. X***************
  1861. X*** 644,652 ****
  1862. X      int backg = BLACK, foreg = WHITE, len;
  1863. X      register int c, color;
  1864. X  
  1865. X!     for (c = 0; c < SIZE(HI_COLOR); c++)
  1866. X!         HI_COLOR[c] = HI;
  1867. X  
  1868. X      /* find the background color, HI[len] == 'm' */
  1869. X      len = strlen(HI) - 1;
  1870. X  
  1871. X--- 666,683 ----
  1872. X      int backg = BLACK, foreg = WHITE, len;
  1873. X      register int c, color;
  1874. X  
  1875. X!     for (c = 0; c < SIZE(hilites); c++)
  1876. X!         hilites[c] = HI;
  1877. X  
  1878. X+ #  ifdef TOS
  1879. X+     hilites[RED] = hilites[BRIGHT+RED] = "\033b1";
  1880. X+     hilites[BLUE] = hilites[BRIGHT+BLUE] = "\033b2";
  1881. X+     hilites[CYAN] = hilites[BRIGHT+CYAN] = "\033b3\033c2";
  1882. X+     hilites[ORANGE_COLORED] = hilites[RED];
  1883. X+     hilites[WHITE] = hilites[GRAY] = "\033b3";
  1884. X+     hilites[MAGENTA] = hilites[BRIGHT+MAGENTA] = "\033b1\033c2";
  1885. X+     HE = "\033q\033b3\033c0";    /* to turn off the color stuff too */
  1886. X+ #  else /* TOS */
  1887. X      /* find the background color, HI[len] == 'm' */
  1888. X      len = strlen(HI) - 1;
  1889. X  
  1890. X***************
  1891. X*** 657,662 ****
  1892. X--- 688,697 ----
  1893. X          if ((color = atoi(&HI[c])) == 0) {
  1894. X          /* this also catches errors */
  1895. X          foreg = WHITE; backg = BLACK;
  1896. X+         /*
  1897. X+         } else if (color == 1) {
  1898. X+         foreg |= BRIGHT;
  1899. X+         */
  1900. X          } else if (color >= 30 && color <= 37) {
  1901. X          foreg = color - 30;
  1902. X          } else if (color >= 40 && color <= 47) {
  1903. X***************
  1904. X*** 666,679 ****
  1905. X          c++;
  1906. X      }
  1907. X  
  1908. X!     for (c = 0; c < SIZE(HI_COLOR); c++)
  1909. X          /* avoid invisibility */
  1910. X          if (foreg != c && backg != c) {
  1911. X!         HI_COLOR[c] = (char *) alloc(sizeof("E[0;33;44;54m"));
  1912. X!         Sprintf(HI_COLOR[c], "\033[%d;3%d;4%dm",
  1913. X!             c == BLACK ? NONE : HILITE_ATTRIB,
  1914. X!             c, backg);
  1915. X          }
  1916. X  }
  1917. X  # endif /* UNIX */
  1918. X  #endif /* TEXTCOLOR */
  1919. X--- 701,715 ----
  1920. X          c++;
  1921. X      }
  1922. X  
  1923. X!     for (c = 0; c < MAXCOLORS / 2; c++)
  1924. X          /* avoid invisibility */
  1925. X          if (foreg != c && backg != c) {
  1926. X!         hilites[c] = (char *) alloc(sizeof("\033[0;3%d;4%dm"));
  1927. X!         hilites[c+BRIGHT] = (char *) alloc(sizeof("\033[1;3%d;4%dm"));
  1928. X!         Sprintf(hilites[c], "\033[0;3%d;4%dm", c, backg);
  1929. X!         Sprintf(hilites[c+BRIGHT], "\033[1;3%d;4%dm", c, backg);
  1930. X          }
  1931. X+ #  endif /* TOS */
  1932. X  }
  1933. X  # endif /* UNIX */
  1934. X  #endif /* TEXTCOLOR */
  1935. X*** src/Old/timeout.c    Wed Sep 27 12:20:47 1989
  1936. X--- src/timeout.c    Tue Sep 26 12:59:23 1989
  1937. X***************
  1938. X*** 29,35 ****
  1939. X      "You find it hard to breathe.",
  1940. X      "You're gasping for air.",
  1941. X      "You can no longer breathe.",
  1942. X!     "You're turning blue.",
  1943. X      "You suffocate."
  1944. X  };
  1945. X  
  1946. X--- 29,35 ----
  1947. X      "You find it hard to breathe.",
  1948. X      "You're gasping for air.",
  1949. X      "You can no longer breathe.",
  1950. X!     "You're turning %s.",
  1951. X      "You suffocate."
  1952. X  };
  1953. X  
  1954. X***************
  1955. X*** 39,45 ****
  1956. X      register long i = (Strangled & TIMEOUT);
  1957. X  
  1958. X      if(i > 0 && i <= SIZE(choke_texts))
  1959. X!         pline(choke_texts[SIZE(choke_texts) - i]);
  1960. X  }
  1961. X  
  1962. X  void
  1963. X--- 39,46 ----
  1964. X      register long i = (Strangled & TIMEOUT);
  1965. X  
  1966. X      if(i > 0 && i <= SIZE(choke_texts))
  1967. X!         pline(choke_texts[SIZE(choke_texts) - i], Hallucination ?
  1968. X!             hcolor() : blue);
  1969. X  }
  1970. X  
  1971. X  void
  1972. X***************
  1973. X*** 77,83 ****
  1974. X          if(upp->p_tofn) (*upp->p_tofn)();
  1975. X          else switch(upp - u.uprops){
  1976. X          case STONED:
  1977. X!             killer = "cockatrice";
  1978. X              done(STONING);
  1979. X              break;
  1980. X          case SICK:
  1981. X--- 78,84 ----
  1982. X          if(upp->p_tofn) (*upp->p_tofn)();
  1983. X          else switch(upp - u.uprops){
  1984. X          case STONED:
  1985. X!             if (!killer) killer = "cockatrice";
  1986. X              done(STONING);
  1987. X              break;
  1988. X          case SICK:
  1989. X***************
  1990. X*** 171,182 ****
  1991. X      int yours = otmp->spe;
  1992. X  #endif
  1993. X  
  1994. X!     if(moves-otmp->age > 200)  /* very old egg - it's dead */
  1995. X          otmp->corpsenm = -1;
  1996. X  #ifdef LINT    /* long conv. ok */
  1997. X      else if(rnd(150) > 150) {
  1998. X  #else
  1999. X!     else if(rnd((int)(moves-otmp->age)) > 150) {
  2000. X  #endif
  2001. X          mtmp = makemon(&mons[big_to_little(otmp->corpsenm)], u.ux, u.uy);
  2002. X          useup(otmp);
  2003. X--- 172,183 ----
  2004. X      int yours = otmp->spe;
  2005. X  #endif
  2006. X  
  2007. X!     if(monstermoves-otmp->age > 200)  /* very old egg - it's dead */
  2008. X          otmp->corpsenm = -1;
  2009. X  #ifdef LINT    /* long conv. ok */
  2010. X      else if(rnd(150) > 150) {
  2011. X  #else
  2012. X!     else if(rnd((int)(monstermoves-otmp->age)) > 150) {
  2013. X  #endif
  2014. X          mtmp = makemon(&mons[big_to_little(otmp->corpsenm)], u.ux, u.uy);
  2015. X          useup(otmp);
  2016. X***************
  2017. X*** 202,208 ****
  2018. X          }
  2019. X  #endif
  2020. X          if(mtmp->data->mlet == S_DRAGON) {
  2021. X!             pline("\"Gleep!\"");        /* Mything eggs :-) */
  2022. X              (void) tamedog(mtmp, (struct obj *)0);
  2023. X          }
  2024. X          }
  2025. X--- 203,209 ----
  2026. X          }
  2027. X  #endif
  2028. X          if(mtmp->data->mlet == S_DRAGON) {
  2029. X!             verbalize("Gleep!");        /* Mything eggs :-) */
  2030. X              (void) tamedog(mtmp, (struct obj *)0);
  2031. X          }
  2032. X          }
  2033. X
  2034. END_OF_FILE
  2035. if test 52224 -ne `wc -c <'patches04d'`; then
  2036.     echo shar: \"'patches04d'\" unpacked with wrong size!
  2037. fi
  2038. # end of 'patches04d'
  2039. fi
  2040. echo shar: End of archive 4 \(of 11\).
  2041. cp /dev/null ark4isdone
  2042. MISSING=""
  2043. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  2044.     if test ! -f ark${I}isdone ; then
  2045.     MISSING="${MISSING} ${I}"
  2046.     fi
  2047. done
  2048. if test "${MISSING}" = "" ; then
  2049.     echo You have unpacked all 11 archives.
  2050.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2051. else
  2052.     echo You still need to unpack the following archives:
  2053.     echo "        " ${MISSING}
  2054. fi
  2055. ##  End of shell archive.
  2056. exit 0
  2057.