home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch2g < prev    next >
Encoding:
Internet Message Format  |  1989-08-19  |  56.5 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: v08i012:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch2g
  5. Message-ID: <4464@tekred.CNA.TEK.COM>
  6. Date: 18 Aug 89 15:51:40 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 2159
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 8, Issue 12
  13. Archive-name: NetHack3/Patch2g
  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 7 (of 7)."
  25. # Contents:  patch02g
  26. # Wrapped by billr@saab on Fri Aug 18 08:44:43 1989
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patch02g' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'patch02g'\"
  30. else
  31. echo shar: Extracting \"'patch02g'\" \(53958 characters\)
  32. sed "s/^X//" >'patch02g' <<'END_OF_FILE'
  33. X*** src/Old/priest.c    Wed Aug 16 12:38:50 1989
  34. X--- src/priest.c    Mon Aug  7 23:38:33 1989
  35. X***************
  36. X*** 173,179 ****
  37. X      return(move_special(priest,temple,TRUE,FALSE,avoid,omx,omy,gx,gy));
  38. X  }
  39. X  
  40. X! /* exclusevely for mktemple() */
  41. X  void
  42. X  priestini(lvl, sx, sy, align)
  43. X  register int lvl, sx, sy, align;
  44. X--- 173,179 ----
  45. X      return(move_special(priest,temple,TRUE,FALSE,avoid,omx,omy,gx,gy));
  46. X  }
  47. X  
  48. X! /* exclusively for mktemple() */
  49. X  void
  50. X  priestini(lvl, sx, sy, align)
  51. X  register int lvl, sx, sy, align;
  52. X***************
  53. X*** 183,190 ****
  54. X  #ifdef SPELLS
  55. X      register int cnt;
  56. X  #endif
  57. X  
  58. X!     if (priest = makemon(&mons[!rn2(2) ? PM_TEMPLE_PRIEST : 
  59. X              PM_TEMPLE_PRIESTESS], sx+1, sy)) {
  60. X          EPRI(priest)->shroom = inroom(sx, sy);
  61. X          EPRI(priest)->shralign = align;
  62. X--- 183,191 ----
  63. X  #ifdef SPELLS
  64. X      register int cnt;
  65. X  #endif
  66. X+     if(levl[sx+1][sy].mmask) rloc(m_at(sx+1, sy)); /* insurance */
  67. X  
  68. X!     if(priest = makemon(&mons[!rn2(2) ? PM_TEMPLE_PRIEST : 
  69. X              PM_TEMPLE_PRIESTESS], sx+1, sy)) {
  70. X          EPRI(priest)->shroom = inroom(sx, sy);
  71. X          EPRI(priest)->shralign = align;
  72. X*** src/Old/prisym.c    Wed Aug 16 12:39:12 1989
  73. X--- src/prisym.c    Tue Aug 15 22:58:34 1989
  74. X***************
  75. X*** 106,112 ****
  76. X  uchar let;
  77. X  xchar cnt;
  78. X  coord tc[COLNO];    /* but watch reflecting beams! */
  79. X! # ifdef MSDOSCOLOR
  80. X  uchar col;
  81. X  # endif
  82. X  #else
  83. X--- 106,112 ----
  84. X  uchar let;
  85. X  xchar cnt;
  86. X  coord tc[COLNO];    /* but watch reflecting beams! */
  87. X! # ifdef TEXTCOLOR
  88. X  uchar col;
  89. X  # endif
  90. X  #else
  91. X***************
  92. X*** 113,119 ****
  93. X  static uchar let;
  94. X  static xchar cnt;
  95. X  static coord tc[COLNO];    /* but watch reflecting beams! */
  96. X! # ifdef MSDOSCOLOR
  97. X  static uchar col;
  98. X  # endif
  99. X  #endif
  100. X--- 113,119 ----
  101. X  static uchar let;
  102. X  static xchar cnt;
  103. X  static coord tc[COLNO];    /* but watch reflecting beams! */
  104. X! # ifdef TEXTCOLOR
  105. X  static uchar col;
  106. X  # endif
  107. X  #endif
  108. X***************
  109. X*** 123,129 ****
  110. X          if(y > 0) {    /* open call */
  111. X              let = y;
  112. X              cnt = 0;
  113. X! #ifdef MSDOSCOLOR
  114. X              col = AT_ZAP;
  115. X  #endif
  116. X              return;
  117. X--- 123,129 ----
  118. X          if(y > 0) {    /* open call */
  119. X              let = y;
  120. X              cnt = 0;
  121. X! #ifdef TEXTCOLOR
  122. X              col = AT_ZAP;
  123. X  #endif
  124. X              return;
  125. X***************
  126. X*** 140,146 ****
  127. X          case -2:        /* change let call */
  128. X          let = y;
  129. X          return;
  130. X! #ifdef MSDOSCOLOR
  131. X          case -3:        /* set color call */
  132. X          col = y;
  133. X          return;
  134. X--- 140,146 ----
  135. X          case -2:        /* change let call */
  136. X          let = y;
  137. X          return;
  138. X! #ifdef TEXTCOLOR
  139. X          case -3:        /* set color call */
  140. X          col = y;
  141. X          return;
  142. X***************
  143. X*** 149,155 ****
  144. X      /* normal call */
  145. X      if(cansee(x,y)) {
  146. X          if(cnt) delay_output();
  147. X! #ifdef MSDOSCOLOR
  148. X          at(x,y,let,col);
  149. X  #else
  150. X          at(x,y,let,AT_ZAP);
  151. X--- 149,155 ----
  152. X      /* normal call */
  153. X      if(cansee(x,y)) {
  154. X          if(cnt) delay_output();
  155. X! #ifdef TEXTCOLOR
  156. X          at(x,y,let,col);
  157. X  #else
  158. X          at(x,y,let,AT_ZAP);
  159. X***************
  160. X*** 218,224 ****
  161. X          return;
  162. X      if(room->mmask) mtmp = m_at(x,y);
  163. X      if(mtmp && !mtmp->mhide &&
  164. X!         (!mtmp->minvis || See_invisible)) {
  165. X  #ifdef WORM
  166. X          if(m_atseg)
  167. X              pwseg(m_atseg);
  168. X--- 218,224 ----
  169. X          return;
  170. X      if(room->mmask) mtmp = m_at(x,y);
  171. X      if(mtmp && !mtmp->mhide &&
  172. X!         (!mtmp->minvis || See_invisible || Telepat)) {
  173. X  #ifdef WORM
  174. X          if(m_atseg)
  175. X              pwseg(m_atseg);
  176. X***************
  177. X*** 235,241 ****
  178. X      else if((!mtmp || mtmp->data == &mons[PM_GIANT_SPIDER]) &&
  179. X            (ttmp = t_at(x,y)) && ttmp->ttyp == WEB)
  180. X          atl(x,y,(char)WEB_SYM);
  181. X!     else if(mtmp && (!mtmp->minvis || See_invisible)) {
  182. X          /* must be a hiding monster, but not hiding right now */
  183. X          /* assume for the moment that long worms do not hide */
  184. X          pmon(mtmp);
  185. X--- 235,241 ----
  186. X      else if((!mtmp || mtmp->data == &mons[PM_GIANT_SPIDER]) &&
  187. X            (ttmp = t_at(x,y)) && ttmp->ttyp == WEB)
  188. X          atl(x,y,(char)WEB_SYM);
  189. X!     else if(mtmp && (!mtmp->minvis || See_invisible || Telepat)) {
  190. X          /* must be a hiding monster, but not hiding right now */
  191. X          /* assume for the moment that long worms do not hide */
  192. X          pmon(mtmp);
  193. X*** src/Old/read.c    Wed Aug 16 12:39:33 1989
  194. X--- src/read.c    Wed Aug 16 10:15:57 1989
  195. X***************
  196. X*** 192,198 ****
  197. X                sobj->cursed ? black : silver,
  198. X                (s*s>1) ? "while" : "moment");
  199. X          otmp->cursed = sobj->cursed;
  200. X!         otmp->blessed = sobj->blessed;
  201. X          otmp->spe += s;
  202. X          adj_abon(otmp, s);
  203. X          break;
  204. X--- 192,199 ----
  205. X                sobj->cursed ? black : silver,
  206. X                (s*s>1) ? "while" : "moment");
  207. X          otmp->cursed = sobj->cursed;
  208. X!         if (!otmp->blessed || sobj->cursed)
  209. X!             otmp->blessed = sobj->blessed;
  210. X          otmp->spe += s;
  211. X          adj_abon(otmp, s);
  212. X          break;
  213. X***************
  214. X*** 329,336 ****
  215. X          if(confused || sobj->cursed) cnt += 12;
  216. X          while(cnt--) {
  217. X  #if defined(WIZARD) || defined(EXPLORE_MODE)
  218. X!             if(wizard || discover)
  219. X!             if (!create_particular())
  220. X  #endif /* WIZARD || EXPLORE_MODE */
  221. X              (void) makemon (confused ? &mons[PM_ACID_BLOB] :
  222. X                      (struct permonst *) 0, u.ux, u.uy);
  223. X--- 330,336 ----
  224. X          if(confused || sobj->cursed) cnt += 12;
  225. X          while(cnt--) {
  226. X  #if defined(WIZARD) || defined(EXPLORE_MODE)
  227. X!             if((!wizard && !discover) || !create_particular())
  228. X  #endif /* WIZARD || EXPLORE_MODE */
  229. X              (void) makemon (confused ? &mons[PM_ACID_BLOB] :
  230. X                      (struct permonst *) 0, u.ux, u.uy);
  231. X***************
  232. X*** 694,709 ****
  233. X      useup(obj);
  234. X  }
  235. X  
  236. X- int
  237. X- identify(otmp)        /* also called by newmail() */
  238. X-     register struct obj *otmp;
  239. X- {
  240. X-     makeknown(otmp->otyp);
  241. X-     otmp->known = otmp->dknown = otmp->bknown = 1;
  242. X-     prinv(otmp);
  243. X-     return(1);
  244. X- }
  245. X- 
  246. X  void
  247. X  litroom(on)
  248. X  register boolean on;
  249. X--- 694,699 ----
  250. X***************
  251. X*** 811,817 ****
  252. X                      You("feel dead inside.");
  253. X                  else
  254. X  #endif
  255. X!                     done("died");
  256. X                  }
  257. X                  /* for simplicity (and fairness) let's avoid
  258. X                   * alignment changes here...
  259. X--- 801,807 ----
  260. X                      You("feel dead inside.");
  261. X                  else
  262. X  #endif
  263. X!                     done(GENOCIDED);
  264. X                  }
  265. X                  /* for simplicity (and fairness) let's avoid
  266. X                   * alignment changes here...
  267. X***************
  268. X*** 917,923 ****
  269. X          if(u.umonnum >= 0)    You("feel dead inside.");
  270. X          else
  271. X  #endif
  272. X!             done("died");
  273. X          return;
  274. X          }
  275. X  #ifdef POLYSELF
  276. X--- 907,913 ----
  277. X          if(u.umonnum >= 0)    You("feel dead inside.");
  278. X          else
  279. X  #endif
  280. X!             done(GENOCIDED);
  281. X          return;
  282. X          }
  283. X  #ifdef POLYSELF
  284. X***************
  285. X*** 983,1029 ****
  286. X          for(zx = (u.ux-9 < 0 ? 0 : u.ux-9); 
  287. X              zx < (u.ux+10 > COLNO ? COLNO : u.ux+10); zx++)
  288. X          show_map_spot(zx, zy);
  289. X- }
  290. X- 
  291. X- int
  292. X- destroy_arm(atmp)
  293. X- register struct obj *atmp;
  294. X- {
  295. X-     register struct obj *otmp;
  296. X- 
  297. X-     if((otmp = uarmc) && (!atmp || atmp == uarmc)) {
  298. X-         Your("cloak crumbles and turns to dust!");
  299. X-         (void) Cloak_off();
  300. X-         useup(otmp);
  301. X-     } else if((otmp = uarm) && (!atmp || atmp == uarm)) {
  302. X-         Your("armor turns to dust and falls to the floor!");
  303. X-         (void) Armor_gone();
  304. X-         useup(otmp);
  305. X- #ifdef SHIRT
  306. X-     } else if((otmp = uarmu) && (!atmp || atmp == uarmu)) {
  307. X-         Your("shirt crumbles into tiny threads and falls apart!");
  308. X-         useup(otmp);
  309. X- #endif
  310. X-     } else if((otmp = uarmh) && (!atmp || atmp == uarmh)) {
  311. X-         Your("helmet turns to dust and is blown away!");
  312. X-         (void) Helmet_off();
  313. X-         useup(otmp);
  314. X-     } else if((otmp = uarmg) && (!atmp || atmp == uarmg)) {
  315. X-         Your("gloves vanish!");
  316. X-         (void) Gloves_off();
  317. X-         useup(otmp);
  318. X-         selftouch("You");
  319. X-     } else if((otmp = uarmf) && (!atmp || atmp == uarmf)) {
  320. X-         Your("boots disintegrate!");
  321. X-         (void) Boots_off();
  322. X-         useup(otmp);
  323. X-     } else if((otmp =uarms) && (!atmp || atmp == uarms)) {
  324. X-         Your("shield crumbles away!");
  325. X-         (void) Shield_off();
  326. X-         useup(otmp);
  327. X-     } else     return(0);        /* could not destroy anything */
  328. X- 
  329. X-     return(1);
  330. X  }
  331. X  
  332. X  int
  333. X--- 973,978 ----
  334. X*** src/Old/restore.c    Fri Jul 28 01:59:18 1989
  335. X--- src/restore.c    Thu Aug 17 00:20:55 1989
  336. X***************
  337. X*** 211,216
  338. X      mread(fd, (genericptr_t) &moves, sizeof moves);
  339. X      mread(fd, (genericptr_t) &wiz_level, sizeof wiz_level);
  340. X      mread(fd, (genericptr_t) &medusa_level, sizeof medusa_level);
  341. X  #ifdef ORACLE
  342. X      mread(fd, (genericptr_t) &oracle_level, sizeof oracle_level);
  343. X  #endif
  344. X
  345. X--- 211,217 -----
  346. X      mread(fd, (genericptr_t) &moves, sizeof moves);
  347. X      mread(fd, (genericptr_t) &wiz_level, sizeof wiz_level);
  348. X      mread(fd, (genericptr_t) &medusa_level, sizeof medusa_level);
  349. X+     mread(fd, (genericptr_t) &bigroom_level, sizeof bigroom_level);
  350. X  #ifdef ORACLE
  351. X      mread(fd, (genericptr_t) &oracle_level, sizeof oracle_level);
  352. X  #endif
  353. X***************
  354. X*** 424,430
  355. X          pline("Strange, this map is not as I remember it.");
  356. X          pline("Somebody is trying some trickery here...");
  357. X          pline("This game is void.");
  358. X!         done("tricked");
  359. X      }
  360. X  
  361. X      mread(fd, (genericptr_t) levl, sizeof(levl));
  362. X
  363. X--- 425,431 -----
  364. X          pline("Strange, this map is not as I remember it.");
  365. X          pline("Somebody is trying some trickery here...");
  366. X          pline("This game is void.");
  367. X!         done(TRICKED);
  368. X      }
  369. X  
  370. X      mread(fd, (genericptr_t) levl, sizeof(levl));
  371. X***************
  372. X*** 598,603
  373. X  
  374. X          mtmp2 = mtmp->nmon;
  375. X          if(mtmp->data->geno & G_GENOD) {
  376. X              mondead(mtmp);
  377. X              continue;
  378. X          }
  379. X
  380. X--- 599,607 -----
  381. X  
  382. X          mtmp2 = mtmp->nmon;
  383. X          if(mtmp->data->geno & G_GENOD) {
  384. X+ #ifdef KOPS
  385. X+             allow_kops = FALSE;
  386. X+ #endif
  387. X              mondead(mtmp);
  388. X  #ifdef KOPS
  389. X              allow_kops = TRUE;
  390. X***************
  391. X*** 599,604
  392. X          mtmp2 = mtmp->nmon;
  393. X          if(mtmp->data->geno & G_GENOD) {
  394. X              mondead(mtmp);
  395. X              continue;
  396. X          }
  397. X  
  398. X
  399. X--- 603,611 -----
  400. X              allow_kops = FALSE;
  401. X  #endif
  402. X              mondead(mtmp);
  403. X+ #ifdef KOPS
  404. X+             allow_kops = TRUE;
  405. X+ #endif
  406. X              continue;
  407. X          }
  408. X  
  409. X*** src/Old/rnd.c    Wed Aug 16 12:40:51 1989
  410. X--- src/rnd.c    Wed Aug 16 10:32:27 1989
  411. X***************
  412. X*** 69,75 ****
  413. X  {
  414. X      register int tmp = 1;
  415. X      while(!rn2(x)) tmp++;
  416. X!     return(tmp);
  417. X  }
  418. X  
  419. X  #ifdef THEOLOGY
  420. X--- 69,75 ----
  421. X  {
  422. X      register int tmp = 1;
  423. X      while(!rn2(x)) tmp++;
  424. X!     return(min(tmp,(u.ulevel < 15) ? 5 : (int)u.ulevel/3));
  425. X  }
  426. X  
  427. X  #ifdef THEOLOGY
  428. X*** src/Old/rumors.c    Wed Aug 16 12:41:04 1989
  429. X--- src/rumors.c    Tue Aug 15 21:57:08 1989
  430. X***************
  431. X*** 34,40 ****
  432. X--- 34,50 ----
  433. X  {
  434. X      register FILE *fp;
  435. X  
  436. X+ #ifdef OS2_CODEVIEW
  437. X+     {
  438. X+     char tmp[PATHLEN];
  439. X+ 
  440. X+     Strcpy(tmp,hackdir);
  441. X+     append_slash(tmp);
  442. X+     Strcat(tmp,RUMORFILE);
  443. X+     if(fp = fopen(tmp, "r")) {
  444. X+ #else
  445. X      if(fp = fopen(RUMORFILE, "r")) {
  446. X+ #endif
  447. X          (void) fread((genericptr_t)&true_rumor_size,sizeof(long),1,fp);
  448. X          (void) fseek(fp, 0L, 2);
  449. X          end_rumor_file = ftell(fp);
  450. X***************
  451. X*** 44,51 ****
  452. X--- 54,74 ----
  453. X          pline("Can't open rumors file!");
  454. X          end_rumor_file = -1;    /* don't try to open it again */
  455. X      }
  456. X+ #ifdef OS2_CODEVIEW
  457. X+     }
  458. X+ #endif
  459. X  #ifdef ORACLE
  460. X+ #ifdef OS2_CODEVIEW
  461. X+     {
  462. X+     char tmp[PATHLEN];
  463. X+ 
  464. X+     Strcpy(tmp,hackdir);
  465. X+     append_slash(tmp);
  466. X+     Strcat(tmp,ORACLEFILE);
  467. X+     if(fp = fopen(tmp, "r")) {
  468. X+ #else
  469. X      if(fp = fopen(ORACLEFILE, "r")) {
  470. X+ #endif
  471. X          (void) fseek(fp, 0L, 2);
  472. X          oracle_size = ftell(fp);
  473. X          (void) fclose(fp);
  474. X***************
  475. X*** 53,58 ****
  476. X--- 76,84 ----
  477. X          pline("Can't open oracles file!");
  478. X          oracle_size = -1;    /* don't try to open it again */
  479. X      }
  480. X+ #ifdef OS2_CODEVIEW
  481. X+     }
  482. X+ #endif
  483. X  #endif
  484. X  }
  485. X  
  486. X***************
  487. X*** 76,82 ****
  488. X--- 102,118 ----
  489. X      }
  490. X      if (end_rumor_file < 0) /* We couldn't open RUMORFILE */
  491. X          return;
  492. X+ #ifdef OS2_CODEVIEW
  493. X+     {
  494. X+     char tmp[PATHLEN];
  495. X+ 
  496. X+     Strcpy(tmp,hackdir);
  497. X+     append_slash(tmp);
  498. X+     Strcat(tmp,RUMORFILE);
  499. X+     if(rumors = fopen(tmp, "r")) {
  500. X+ #else
  501. X      if(rumors = fopen(RUMORFILE, "r")) {
  502. X+ #endif
  503. X          if (!end_rumor_file) {    /* if this is the first outrumor() */
  504. X              init_rumors();
  505. X          }
  506. X***************
  507. X*** 109,114 ****
  508. X--- 145,153 ----
  509. X          pline("Can't open rumors file!");
  510. X          end_rumor_file = -1;    /* don't try to open it again */
  511. X      }
  512. X+ #ifdef OS2_CODEVIEW
  513. X+     }
  514. X+ #endif
  515. X  }
  516. X  
  517. X  #ifdef ORACLE
  518. X***************
  519. X*** 121,127 ****
  520. X--- 160,176 ----
  521. X  
  522. X      if (oracle_size < 0)    /* We couldn't open ORACLEFILE */
  523. X          return;
  524. X+ #ifdef OS2_CODEVIEW
  525. X+     {
  526. X+     char tmp[PATHLEN];
  527. X+ 
  528. X+     Strcpy(tmp,hackdir);
  529. X+     append_slash(tmp);
  530. X+     Strcat(tmp,ORACLEFILE);
  531. X+     if(oracles = fopen(tmp, "r")) {
  532. X+ #else
  533. X      if(oracles = fopen(ORACLEFILE, "r")) {
  534. X+ #endif
  535. X          if (!oracle_size) {    /* if this is the first outrumor() */
  536. X              init_rumors();
  537. X          }
  538. X***************
  539. X*** 148,153 ****
  540. X--- 197,205 ----
  541. X          pline("Can't open oracles file!");
  542. X          oracle_size = -1;    /* don't try to open it again */
  543. X      }
  544. X+ #ifdef OS2_CODEVIEW
  545. X+     }
  546. X+ #endif
  547. X  }
  548. X  
  549. X  int
  550. X*** src/Old/save.c    Wed Aug 16 12:41:20 1989
  551. X--- src/save.c    Tue Aug 15 22:05:11 1989
  552. X***************
  553. X*** 52,58 ****
  554. X--- 52,62 ----
  555. X          if(multi > 0) nomul(0);
  556. X      } else {
  557. X  #ifdef EXPLORE_MODE
  558. X+ # ifdef WIZARD
  559. X+         if(!discover && !wizard) {
  560. X+ # else
  561. X          if(!discover) {
  562. X+ # endif
  563. X      pline("Do you want to create a non-scoring, restartable save file? ");
  564. X              if(yn() == 'y')  discover = TRUE;
  565. X          }
  566. X***************
  567. X*** 162,167 ****
  568. X--- 166,172 ----
  569. X      bwrite(fd, (genericptr_t) &moves, sizeof moves);
  570. X      bwrite(fd, (genericptr_t) &wiz_level, sizeof wiz_level);
  571. X      bwrite(fd, (genericptr_t) &medusa_level, sizeof medusa_level);
  572. X+     bwrite(fd, (genericptr_t) &bigroom_level, sizeof bigroom_level);
  573. X  #ifdef ORACLE
  574. X      bwrite(fd, (genericptr_t) &oracle_level, sizeof oracle_level);
  575. X  #endif
  576. X***************
  577. X*** 232,238 ****
  578. X              if(!hu) pline("Error while saving: cannot read %s.", lock);
  579. X              (void) close(fd);
  580. X              (void) unlink(SAVEF);
  581. X!             if(!hu) done("tricked");
  582. X              return(0);
  583. X          }
  584. X  #ifdef ZEROCOMP
  585. X--- 237,243 ----
  586. X              if(!hu) pline("Error while saving: cannot read %s.", lock);
  587. X              (void) close(fd);
  588. X              (void) unlink(SAVEF);
  589. X!             if(!hu) done(TRICKED);
  590. X              return(0);
  591. X          }
  592. X  #ifdef ZEROCOMP
  593. X*** src/Old/search.c    Wed Aug 16 12:41:46 1989
  594. X--- src/search.c    Tue Aug 15 22:04:11 1989
  595. X***************
  596. X*** 201,208 ****
  597. X  seemimic(mtmp)
  598. X  register struct monst *mtmp;
  599. X  {
  600. X!         mtmp->mimic = 0;
  601. X!         mtmp->mappearance = 0;
  602. X!         unpmon(mtmp);
  603. X!         pmon(mtmp);
  604. X  }
  605. X--- 201,208 ----
  606. X  seemimic(mtmp)
  607. X  register struct monst *mtmp;
  608. X  {
  609. X!     mtmp->mimic = 0;
  610. X!     mtmp->mappearance = 0;
  611. X!     unpmon(mtmp);
  612. X!     pmon(mtmp);
  613. X  }
  614. X*** src/Old/shk.c    Wed Aug 16 12:42:05 1989
  615. X--- src/shk.c    Wed Aug  2 20:48:09 1989
  616. X***************
  617. X*** 1302,1308 ****
  618. X  register char *dmgstr;
  619. X  {
  620. X      register struct monst *mtmp;
  621. X-     register int ox, oy;
  622. X      register int roomno = inroom(x, y);
  623. X      register int damage = (ACURR(A_STR) > 18) ? 400 : 20 * ACURR(A_STR);
  624. X  
  625. X--- 1302,1307 ----
  626. X***************
  627. X*** 1327,1337 ****
  628. X          return;
  629. X      }
  630. X  
  631. X-     ox = shopkeeper->mx;
  632. X-     oy = shopkeeper->my;
  633. X- 
  634. X      /* if he's not in his shop.. */
  635. X!     if(!in_shop(ox, oy)) return;
  636. X  
  637. X      /* if a !shopkeeper shows up at the door, move him */
  638. X      if(levl[x][y].mmask && (mtmp = m_at(x, y)) != shopkeeper) {
  639. X--- 1326,1333 ----
  640. X          return;
  641. X      }
  642. X  
  643. X      /* if he's not in his shop.. */
  644. X!     if(!in_shop(shopkeeper->mx ,shopkeeper->my)) return;
  645. X  
  646. X      /* if a !shopkeeper shows up at the door, move him */
  647. X      if(levl[x][y].mmask && (mtmp = m_at(x, y)) != shopkeeper) {
  648. X***************
  649. X*** 1376,1390 ****
  650. X          pline("Mollified, %s accepts your restitution.",
  651. X              shkname(shopkeeper));
  652. X  
  653. X!         /* clear ox oy of another monster, if one got there somehow */
  654. X!         if(levl[ox][oy].mmask) mnearto(m_at(ox,oy),ox,oy,FALSE);
  655. X! 
  656. X!         /* move shk back to his orig loc */
  657. X!         levl[shopkeeper->mx][shopkeeper->my].mmask = 0;
  658. X!         levl[ox][oy].mmask = 1;
  659. X!         shopkeeper->mx = ox;
  660. X!         shopkeeper->my = oy;
  661. X!         unpmon(shopkeeper);
  662. X          NOTANGRY(shopkeeper) = 1;
  663. X      }
  664. X      else {
  665. X--- 1372,1379 ----
  666. X          pline("Mollified, %s accepts your restitution.",
  667. X              shkname(shopkeeper));
  668. X  
  669. X!         /* move shk back to his home loc */
  670. X!         home_shk(shopkeeper);
  671. X          NOTANGRY(shopkeeper) = 1;
  672. X      }
  673. X      else {
  674. X*** src/Old/shknam.c    Wed Aug 16 12:42:44 1989
  675. X--- src/shknam.c    Fri Aug  4 11:38:47 1989
  676. X***************
  677. X*** 258,263 ****
  678. X--- 258,265 ----
  679. X              return(-1);
  680. X              }
  681. X  
  682. X+     if(levl[sx][sy].mmask) rloc(m_at(sx, sy)); /* insurance */
  683. X+ 
  684. X      /* now initialize the shopkeeper monster structure */
  685. X      if(!(shk = makemon(&mons[PM_SHOPKEEPER], sx, sy))) return(-1);
  686. X      shk->isshk = shk->mpeaceful = 1;
  687. X*** src/Old/sit.c    Wed Aug 16 12:43:02 1989
  688. X--- src/sit.c    Tue Aug 15 20:35:12 1989
  689. X***************
  690. X*** 181,187 ****
  691. X              if (Inhell && !Fire_resistance) {
  692. X                  You("burn to a crisp.");
  693. X                  killer = "gremlin curse";
  694. X!                 done("died");
  695. X              } else You("feel warmer.");
  696. X              break;
  697. X          }
  698. X--- 181,187 ----
  699. X              if (Inhell && !Fire_resistance) {
  700. X                  You("burn to a crisp.");
  701. X                  killer = "gremlin curse";
  702. X!                 done(BURNING);
  703. X              } else You("feel warmer.");
  704. X              break;
  705. X          }
  706. X*** src/Old/sounds.c    Wed Aug 16 12:43:19 1989
  707. X--- src/sounds.c    Mon Aug  7 23:10:57 1989
  708. X***************
  709. X*** 380,386 ****
  710. X          break;
  711. X      case MS_HUMANOID:
  712. X          /* Generic humanoid behaviour. */
  713. X!         if (!mtmp->mpeaceful || !mtmp->mtame) break;
  714. X          if (mtmp->mhp < 10)
  715. X          kludge("%s moans.", Monnam(mtmp));
  716. X          else if (mtmp->mflee)
  717. X--- 380,386 ----
  718. X          break;
  719. X      case MS_HUMANOID:
  720. X          /* Generic humanoid behaviour. */
  721. X!         if (!mtmp->mpeaceful && !mtmp->mtame) break;
  722. X          if (mtmp->mhp < 10)
  723. X          kludge("%s moans.", Monnam(mtmp));
  724. X          else if (mtmp->mflee)
  725. X***************
  726. X*** 420,432 ****
  727. X          break;
  728. X      case MS_SEDUCE:
  729. X  # ifdef SEDUCE
  730. X!         if ((mtmp->data==&mons[PM_SUCCUBUS] ||
  731. X!         mtmp->data==&mons[PM_INCUBUS])) {
  732. X!         doseduce(mtmp);
  733. X!         break;
  734. X          }
  735. X  # endif
  736. X-         switch (poly_gender() == 0 ? rn2(3) : 0) {
  737. X          case 2:
  738. X              verbalize("Hello, sailor.");
  739. X              break;
  740. X--- 420,434 ----
  741. X          break;
  742. X      case MS_SEDUCE:
  743. X  # ifdef SEDUCE
  744. X!         if (mtmp->data->mlet != S_NYMPH &&
  745. X!         could_seduce(mtmp, &youmonst, (struct attack *)0) == 1) {
  746. X!             (void) doseduce(mtmp);
  747. X!             break;
  748. X          }
  749. X+         switch ((poly_gender() != is_female(mtmp)) ? rn2(3) : 0) {
  750. X+ # else
  751. X+         switch ((poly_gender() == 0) ? rn2(3) : 0) {
  752. X  # endif
  753. X          case 2:
  754. X              verbalize("Hello, sailor.");
  755. X              break;
  756. X*** src/Old/sp_lev.c    Wed Aug 16 12:43:41 1989
  757. X--- src/sp_lev.c    Tue Aug 15 21:57:10 1989
  758. X***************
  759. X*** 571,577 ****
  760. X--- 571,590 ----
  761. X      boolean result;
  762. X      schar c;
  763. X  
  764. X+ #ifdef OS2_CODEVIEW
  765. X+     {
  766. X+     char tmp[PATHLEN];
  767. X+ 
  768. X+     Strcpy(tmp,hackdir);
  769. X+     append_slash(tmp);
  770. X+     Strcat(tmp,name);
  771. X+     fd = fopen(tmp, RDMODE);
  772. X+ #else
  773. X      fd = fopen(name, RDMODE);
  774. X+ #endif
  775. X+ #ifdef OS2_CODEVIEW
  776. X+     }
  777. X+ #endif
  778. X      if (!fd) return FALSE;
  779. X  
  780. X      if ((c = fgetc(fd)) == EOF) {
  781. X*** src/Old/spell.c    Wed Aug 16 12:44:00 1989
  782. X--- src/spell.c    Sat Aug  5 11:30:35 1989
  783. X***************
  784. X*** 1,6 ****
  785. X  /*    SCCS Id: @(#)spell.c    3.0    88/09/18
  786. X   *
  787. X!  *    Copyright (c) M. Stepheneon 1988
  788. X   */
  789. X  /* NetHack may be freely redistributed.  See license for details. */
  790. X  
  791. X--- 1,6 ----
  792. X  /*    SCCS Id: @(#)spell.c    3.0    88/09/18
  793. X   *
  794. X!  *    Copyright (c) M. Stephenson 1988
  795. X   */
  796. X  /* NetHack may be freely redistributed.  See license for details. */
  797. X  
  798. X*** src/Old/termcap.c    Wed Aug 16 12:44:34 1989
  799. X--- src/termcap.c    Tue Aug 15 22:05:16 1989
  800. X***************
  801. X*** 8,13 ****
  802. X--- 8,17 ----
  803. X  #define MONATTK_H
  804. X  #include "hack.h"    /* for ROWNO, COLNO, *HI, *HE, *AS, *AE */
  805. X  
  806. X+ #ifndef MSDOS
  807. X+ # define TERMLIB    /* include termcap code */
  808. X+ #endif
  809. X+ 
  810. X  #if !defined(SYSV) || defined(TOS) || defined(UNIXPC)
  811. X  # ifndef LINT
  812. X  extern            /* it is defined in libtermlib (libtermcap) */
  813. X***************
  814. X*** 24,34 ****
  815. X  #endif /* MICROPORT_286_BUG **/
  816. X  
  817. X  static void nocmov();
  818. X! #ifdef MSDOSCOLOR
  819. X  static void init_hilite();
  820. X! #endif /* MSDOSCOLOR */
  821. X  
  822. X- static char tbuf[512];
  823. X  static char *HO, *CL, *CE, *UP, *CM, *ND, *XD, *BC, *SO, *SE, *TI, *TE;
  824. X  static char *VS, *VE, *US, *UE;
  825. X  static char *MR, *ME;
  826. X--- 28,43 ----
  827. X  #endif /* MICROPORT_286_BUG **/
  828. X  
  829. X  static void nocmov();
  830. X! #ifdef TEXTCOLOR
  831. X! # ifdef TERMLIB
  832. X  static void init_hilite();
  833. X! # endif
  834. X! #define NONE        0
  835. X! #define HIGH_INTENSITY    1
  836. X! #define BLACK        0
  837. X! #define HILITE_ATTRIB    HIGH_INTENSITY
  838. X! #endif /* TEXTCOLOR */
  839. X  
  840. X  static char *HO, *CL, *CE, *UP, *CM, *ND, *XD, *BC, *SO, *SE, *TI, *TE;
  841. X  static char *VS, *VE, *US, *UE;
  842. X  static char *MR, *ME;
  843. X***************
  844. X*** 35,86 ****
  845. X  #if 0
  846. X  static char *MB, *MD, *MH;
  847. X  #endif
  848. X  static int SG;
  849. X  static char PC = '\0';
  850. X  
  851. X! #if defined(MSDOS) && !defined(TERMLIB)
  852. X  static char tgotobuf[20];
  853. X! #ifdef TOS
  854. X  #define tgoto(fmt, x, y)    (Sprintf(tgotobuf, fmt, y+' ', x+' '), tgotobuf)
  855. X! #else
  856. X  #define tgoto(fmt, x, y)    (Sprintf(tgotobuf, fmt, y+1, x+1), tgotobuf)
  857. X! #endif
  858. X! #endif /* MSDOS /**/
  859. X  
  860. X  void
  861. X  startup()
  862. X  {
  863. X! #if defined(TOS) && !defined(TERMLIB)
  864. X!     HO = "\033H";
  865. X!     CL = "\033E";        /* the VT52 termcap */
  866. X!     CE = "\033K";
  867. X!     UP = "\033A";
  868. X!     CM = "\033Y%c%c";    /* used with function tgoto() */
  869. X!     ND = "\033C";
  870. X!     XD = "\033B";
  871. X!     BC = "\033D";
  872. X!     SO = "\033p";
  873. X!     SE = "\033q";
  874. X!     HI = "\033p";
  875. X!     HE = "\033q";
  876. X! #else
  877. X      register char *term;
  878. X      register char *tptr;
  879. X      char *tbufptr, *pc;
  880. X      register int i;
  881. X  
  882. X      if(!(term = getenv("TERM")))
  883. X  # ifdef ANSI_DEFAULT
  884. X      {
  885. X          HO = "\033[H";
  886. X          CL = "\033[2J";        /* the ANSI termcap */
  887. X  /*        CD = "\033[J"; */
  888. X          CE = "\033[K";
  889. X          CM = "\033[%i%d;%dH";
  890. X          UP = "\033[A";
  891. X          ND = "\033[C";
  892. X          XD = "\033[B";
  893. X          BC = "\033[D";
  894. X          HI = SO = "\033[1m";
  895. X          US = "\033[4m";
  896. X          MR = "\033[7m";
  897. X--- 44,120 ----
  898. X  #if 0
  899. X  static char *MB, *MD, *MH;
  900. X  #endif
  901. X+ #ifdef TERMLIB
  902. X  static int SG;
  903. X  static char PC = '\0';
  904. X+ static char tbuf[512];
  905. X+ #endif
  906. X  
  907. X! #ifndef TERMLIB
  908. X  static char tgotobuf[20];
  909. X! # ifdef TOS
  910. X  #define tgoto(fmt, x, y)    (Sprintf(tgotobuf, fmt, y+' ', x+' '), tgotobuf)
  911. X! # else
  912. X  #define tgoto(fmt, x, y)    (Sprintf(tgotobuf, fmt, y+1, x+1), tgotobuf)
  913. X! # endif
  914. X! #endif /* TERMLIB */
  915. X  
  916. X  void
  917. X  startup()
  918. X  {
  919. X! #ifdef TERMLIB
  920. X      register char *term;
  921. X      register char *tptr;
  922. X      char *tbufptr, *pc;
  923. X+ #endif
  924. X      register int i;
  925. X  
  926. X+ #ifdef TERMLIB
  927. X      if(!(term = getenv("TERM")))
  928. X+ #endif
  929. X+ #if defined(TOS) && defined(__GNUC__)    /* library has a default */
  930. X+         term = "st52";
  931. X+ #else
  932. X  # ifdef ANSI_DEFAULT
  933. X+ #  ifdef TOS
  934. X+     {
  935. X+         HO = "\033H";
  936. X+         CL = "\033E";        /* the VT52 termcap */
  937. X+         CE = "\033K";
  938. X+         UP = "\033A";
  939. X+         CM = "\033Y%c%c";    /* used with function tgoto() */
  940. X+         ND = "\033C";
  941. X+         XD = "\033B";
  942. X+         BC = "\033D";
  943. X+         SO = "\033p";
  944. X+         SE = "\033q";
  945. X+         HI = "\033p";
  946. X+         HE = "\033q";
  947. X+     }
  948. X+ #  else /* TOS */
  949. X      {
  950. X+ #   ifdef DGK
  951. X+         get_scr_size();
  952. X+         if(CO < COLNO || LI < ROWNO+3)
  953. X+             setclipped();
  954. X+ #   endif
  955. X          HO = "\033[H";
  956. X          CL = "\033[2J";        /* the ANSI termcap */
  957. X  /*        CD = "\033[J"; */
  958. X          CE = "\033[K";
  959. X+ #   ifndef TERMLIB
  960. X+         CM = "\033[%d;%dH";
  961. X+ #   else
  962. X          CM = "\033[%i%d;%dH";
  963. X+ #   endif
  964. X          UP = "\033[A";
  965. X          ND = "\033[C";
  966. X          XD = "\033[B";
  967. X+ #   ifdef MSDOS    /* backspaces are non-destructive */
  968. X+         BC = "\b";
  969. X+ #   else
  970. X          BC = "\033[D";
  971. X+ #   endif
  972. X          HI = SO = "\033[1m";
  973. X          US = "\033[4m";
  974. X          MR = "\033[7m";
  975. X***************
  976. X*** 88,113 ****
  977. X          /* strictly, SE should be 2, and UE should be 24,
  978. X             but we can't trust all ANSI emulators to be
  979. X             that complete.  -3. */
  980. X          AS = "\016";
  981. X          AE = "\017";
  982. X!         VS = VE = "";
  983. X! #  ifdef MSDOSCOLOR
  984. X!         HI_WHITE = HI;
  985. X!         HI_RED = "\033[1;31m";
  986. X!         HI_YELLOW = "\033[1;33m";
  987. X!         HI_GREEN = "\033[1;32m";
  988. X!         HI_BLUE = "\033[1;34m";
  989. X! #  endif
  990. X          return;
  991. X      }
  992. X  # else
  993. X- #  if defined(TOS) && defined(__GNUC__)        /* library has a default */
  994. X-         term = "st52";
  995. X- #  else
  996. X          error("Can't get TERM.");
  997. X! #  endif
  998. X! # endif
  999. X! 
  1000. X      tptr = (char *) alloc(1024);
  1001. X  
  1002. X      tbufptr = tbuf;
  1003. X--- 122,147 ----
  1004. X          /* strictly, SE should be 2, and UE should be 24,
  1005. X             but we can't trust all ANSI emulators to be
  1006. X             that complete.  -3. */
  1007. X+ #   if !defined(MSDOS) || defined(DECRAINBOW)
  1008. X          AS = "\016";
  1009. X          AE = "\017";
  1010. X! #   endif
  1011. X!         TE = VS = VE = "";
  1012. X! #   ifdef TEXTCOLOR
  1013. X!         for (i = 0; i < SIZE(HI_COLOR); i++) {
  1014. X!             HI_COLOR[i] = (char *) alloc(sizeof("E[0;33;44m"));
  1015. X!             Sprintf(HI_COLOR[i], "\033[%d;3%dm",
  1016. X!                 i == BLACK ? NONE : HILITE_ATTRIB, i);
  1017. X!         }
  1018. X! #   endif
  1019. X          return;
  1020. X      }
  1021. X+ #  endif /* TOS */
  1022. X  # else
  1023. X          error("Can't get TERM.");
  1024. X! # endif /* ANSI_DEFAULT */
  1025. X! #endif /* __GNUC__ */
  1026. X! #ifdef TERMLIB
  1027. X      tptr = (char *) alloc(1024);
  1028. X  
  1029. X      tbufptr = tbuf;
  1030. X***************
  1031. X*** 117,142 ****
  1032. X          error("Unknown terminal type: %s.", term);
  1033. X      if(pc = Tgetstr("pc"))
  1034. X          PC = *pc;
  1035. X! #ifdef TERMINFO
  1036. X      if(!(BC = Tgetstr("le"))) {    
  1037. X! #else
  1038. X      if(!(BC = Tgetstr("bc"))) {    
  1039. X! #endif
  1040. X! #if !defined(MINIMAL_TERM) && !defined(HISX)
  1041. X          if(!tgetflag("bs"))
  1042. X              error("Terminal must backspace.");
  1043. X! #endif
  1044. X          BC = tbufptr;
  1045. X          tbufptr += 2;
  1046. X          *BC = '\b';
  1047. X      }
  1048. X! #ifdef MINIMAL_TERM
  1049. X      HO = NULL;
  1050. X! #else
  1051. X      HO = Tgetstr("ho");
  1052. X! #endif
  1053. X      CO = tgetnum("co");
  1054. X      LI = tgetnum("li");
  1055. X      if(CO < COLNO || LI < ROWNO+3)
  1056. X          setclipped();
  1057. X      if(!(CL = Tgetstr("cl")))
  1058. X--- 151,188 ----
  1059. X          error("Unknown terminal type: %s.", term);
  1060. X      if(pc = Tgetstr("pc"))
  1061. X          PC = *pc;
  1062. X! # ifdef TERMINFO
  1063. X      if(!(BC = Tgetstr("le"))) {    
  1064. X! # else
  1065. X      if(!(BC = Tgetstr("bc"))) {    
  1066. X! # endif
  1067. X! # if !defined(MINIMAL_TERM) && !defined(HISX)
  1068. X          if(!tgetflag("bs"))
  1069. X              error("Terminal must backspace.");
  1070. X! # endif
  1071. X          BC = tbufptr;
  1072. X          tbufptr += 2;
  1073. X          *BC = '\b';
  1074. X      }
  1075. X! # ifdef MINIMAL_TERM
  1076. X      HO = NULL;
  1077. X! # else
  1078. X      HO = Tgetstr("ho");
  1079. X! # endif
  1080. X!     /*
  1081. X!      * LI and CO are set in ioctl.c via a TIOCGWINSZ if available.  If
  1082. X!      * the kernel has values for either we should use them rather than
  1083. X!      * the values from TERMCAP ...
  1084. X!      */
  1085. X! # ifndef DGK
  1086. X!     if (!CO) CO = tgetnum("co");
  1087. X!     if (!LI) LI = tgetnum("li");
  1088. X! # else
  1089. X      CO = tgetnum("co");
  1090. X      LI = tgetnum("li");
  1091. X+     if (!LI || !CO)            /* if we don't override it */
  1092. X+         get_scr_size();
  1093. X+ # endif
  1094. X      if(CO < COLNO || LI < ROWNO+3)
  1095. X          setclipped();
  1096. X      if(!(CL = Tgetstr("cl")))
  1097. X***************
  1098. X*** 167,177 ****
  1099. X      TI = Tgetstr("ti");
  1100. X      TE = Tgetstr("te");
  1101. X      VS = VE = "";
  1102. X! #if 0
  1103. X      MB = Tgetstr("mb");    /* blink */
  1104. X      MD = Tgetstr("md");    /* boldface */
  1105. X      MH = Tgetstr("mh");    /* dim */
  1106. X! #endif
  1107. X      MR = Tgetstr("mr");    /* reverse */
  1108. X      ME = Tgetstr("me");
  1109. X  
  1110. X--- 213,223 ----
  1111. X      TI = Tgetstr("ti");
  1112. X      TE = Tgetstr("te");
  1113. X      VS = VE = "";
  1114. X! # if 0
  1115. X      MB = Tgetstr("mb");    /* blink */
  1116. X      MD = Tgetstr("md");    /* boldface */
  1117. X      MH = Tgetstr("mh");    /* dim */
  1118. X! # endif
  1119. X      MR = Tgetstr("mr");    /* reverse */
  1120. X      ME = Tgetstr("me");
  1121. X  
  1122. X***************
  1123. X*** 194,203 ****
  1124. X      set_whole_screen();        /* uses LI and CD */
  1125. X      if(tbufptr-tbuf > sizeof(tbuf)) error("TERMCAP entry too big...\n");
  1126. X      free((genericptr_t)tptr);
  1127. X! # ifdef MSDOSCOLOR
  1128. X      init_hilite();
  1129. X  # endif
  1130. X! #endif /* TOS /* */
  1131. X  }
  1132. X  
  1133. X  void
  1134. X--- 240,249 ----
  1135. X      set_whole_screen();        /* uses LI and CD */
  1136. X      if(tbufptr-tbuf > sizeof(tbuf)) error("TERMCAP entry too big...\n");
  1137. X      free((genericptr_t)tptr);
  1138. X! # ifdef TEXTCOLOR
  1139. X      init_hilite();
  1140. X  # endif
  1141. X! #endif /* TERMLIB */
  1142. X  }
  1143. X  
  1144. X  void
  1145. X***************
  1146. X*** 318,324 ****
  1147. X  xputs(s)
  1148. X  char *s;
  1149. X  {
  1150. X! #if defined(MSDOS) && !defined(TERMLIB)
  1151. X      (void) fputs(s, stdout);
  1152. X  #else
  1153. X  # ifdef __STDC__
  1154. X--- 364,370 ----
  1155. X  xputs(s)
  1156. X  char *s;
  1157. X  {
  1158. X! #ifndef TERMLIB
  1159. X      (void) fputs(s, stdout);
  1160. X  #else
  1161. X  # ifdef __STDC__
  1162. X***************
  1163. X*** 496,523 ****
  1164. X      }
  1165. X  }
  1166. X  
  1167. X! #ifdef MSDOSCOLOR
  1168. X! /* Sets up highlighting, using ANSI escape sequences, for monsters,
  1169. X!  * objects, and gold (highlight code found in pri.c).
  1170. X!  * The termcap entry for HI (from SO) is scanned to find the background 
  1171. X!  * color. If everything is OK, monsters are displayed in the color
  1172. X!  * used to define HILITE_MONSTER, objects are displayed in the color
  1173. X!  * used to define HILITE_OBJECT, and gold is displayed in the color
  1174. X!  * used to define HILITE_GOLD. -3. */
  1175. X  
  1176. X! #define ESC        0x1b
  1177. X! #define NONE        0
  1178. X! #define HIGH_INTENSITY    1
  1179. X! #define BLACK        0
  1180. X! #define RED        1
  1181. X! #define GREEN        2
  1182. X! #define YELLOW        3
  1183. X! #define BLUE        4
  1184. X! #define MAGENTA        5
  1185. X! #define CYAN        6
  1186. X! #define WHITE        7
  1187. X  
  1188. X! #define HILITE_ATTRIB    HIGH_INTENSITY
  1189. X  
  1190. X  static void
  1191. X  init_hilite()
  1192. X--- 542,596 ----
  1193. X      }
  1194. X  }
  1195. X  
  1196. X! #if defined(TEXTCOLOR) && defined(TERMLIB)
  1197. X! # ifdef UNIX
  1198. X! /*
  1199. X!  * Sets up color highlighting, using terminfo(4) escape sequences (highlight
  1200. X!  * code found in pri.c).  It is assumed that the background color is black.
  1201. X!  */
  1202. X! /* terminfo indexes for the basic colors it guarantees */
  1203. X! #define COLOR_BLACK   0
  1204. X! #define COLOR_BLUE    1
  1205. X! #define COLOR_GREEN   2
  1206. X! #define COLOR_CYAN    3
  1207. X! #define COLOR_RED     4
  1208. X! #define COLOR_MAGENTA 5
  1209. X! #define COLOR_YELLOW  6
  1210. X! #define COLOR_WHITE   7
  1211. X! 
  1212. X! /* map ANSI RGB to terminfo BGR */
  1213. X! const int ti_map[8] = {
  1214. X!     COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW,
  1215. X!     COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE };
  1216. X  
  1217. X! static void
  1218. X! init_hilite()
  1219. X! {
  1220. X!     int erret;
  1221. X!     char *setf, *scratch;
  1222. X!     extern int setupterm();
  1223. X!     extern char *tparm(), *tigetstr();
  1224. X  
  1225. X!     for (c = 0; c < SIZE(HI_COLOR); c++)
  1226. X!         HI_COLOR[c] = HI;
  1227. X! 
  1228. X!     if (tgetnum("Co") < 8 || (setf = tgetstr("Sf", 0)) == (char *)NULL)
  1229. X!         return;
  1230. X! 
  1231. X!     for (c = 0; c < SIZE(HI_COLOR); c++) {
  1232. X!         scratch = tparm(setf, ti_map[c]);
  1233. X!         HI_COLOR[c] = (char *)alloc(strlen(scratch) + 1);
  1234. X!         Strcpy(HI_COLOR[c], scratch);
  1235. X!     }
  1236. X! }
  1237. X! 
  1238. X! # else /* UNIX */
  1239. X! 
  1240. X! /*
  1241. X!  * Sets up highlighting sequences, using ANSI escape sequences (highlight code
  1242. X!  * found in pri.c).  The termcap entry for HI (from SO) is scanned to find the
  1243. X!  * background color.
  1244. X!  */
  1245. X  
  1246. X  static void
  1247. X  init_hilite()
  1248. X***************
  1249. X*** 525,531 ****
  1250. X      int backg = BLACK, foreg = WHITE, len;
  1251. X      register int c, color;
  1252. X  
  1253. X!     HI_RED = HI_YELLOW = HI_GREEN = HI_BLUE = HI_WHITE = HI;
  1254. X  
  1255. X      /* find the background color, HI[len] == 'm' */
  1256. X      len = strlen(HI) - 1;
  1257. X--- 598,605 ----
  1258. X      int backg = BLACK, foreg = WHITE, len;
  1259. X      register int c, color;
  1260. X  
  1261. X!     for (c = 0; c < SIZE(HI_COLOR); c++)
  1262. X!         HI_COLOR[c] = HI;
  1263. X  
  1264. X      /* find the background color, HI[len] == 'm' */
  1265. X      len = strlen(HI) - 1;
  1266. X***************
  1267. X*** 546,581 ****
  1268. X          c++;
  1269. X      }
  1270. X  
  1271. X!     /* avoid invisibility */
  1272. X!     if (foreg != RED && backg != RED) {
  1273. X!         HI_RED = (char *) alloc(sizeof("E[0;33;44;54m"));
  1274. X!         Sprintf(HI_RED, "%c[%d;3%d;4%dm", ESC, HILITE_ATTRIB,
  1275. X!             RED, backg);
  1276. X!     }
  1277. X! 
  1278. X!     if (foreg != YELLOW && backg != YELLOW) {
  1279. X!         HI_YELLOW = (char *) alloc(sizeof("E[0;33;44;54m"));
  1280. X!         Sprintf(HI_YELLOW, "%c[%d;3%d;4%dm", ESC, HILITE_ATTRIB,
  1281. X!             YELLOW, backg);
  1282. X!     }
  1283. X! 
  1284. X!     if (foreg != GREEN && backg != GREEN) {
  1285. X!         HI_GREEN = (char *) alloc(sizeof("E[0;33;44;54m"));
  1286. X!         Sprintf(HI_GREEN, "%c[%d;3%d;4%dm", ESC, HILITE_ATTRIB,
  1287. X!             GREEN, backg);
  1288. X!     }
  1289. X! 
  1290. X!     if (foreg != BLUE && backg != BLUE) {
  1291. X!         HI_BLUE = (char *) alloc(sizeof("E[0;33;44;54m"));
  1292. X!         Sprintf(HI_BLUE, "%c[%d;3%d;4%dm", ESC, HILITE_ATTRIB,
  1293. X!             BLUE, backg);
  1294. X!     }
  1295. X! 
  1296. X!     if (foreg != WHITE && backg != WHITE) {
  1297. X!         HI_WHITE = (char *) alloc(sizeof("E[0;33;44;54m"));
  1298. X!         Sprintf(HI_WHITE, "%c[%d;3%d;4%dm", ESC, HILITE_ATTRIB,
  1299. X!             WHITE, backg);
  1300. X!     }
  1301. X  }
  1302. X! 
  1303. X! #endif
  1304. X--- 620,633 ----
  1305. X          c++;
  1306. X      }
  1307. X  
  1308. X!     for (c = 0; c < SIZE(HI_COLOR); c++)
  1309. X!         /* avoid invisibility */
  1310. X!         if (foreg != c && backg != c) {
  1311. X!         HI_COLOR[c] = (char *) alloc(sizeof("E[0;33;44;54m"));
  1312. X!         Sprintf(HI_COLOR[c], "\033[%d;3%d;4%dm",
  1313. X!             c == BLACK ? NONE : HILITE_ATTRIB,
  1314. X!             c, backg);
  1315. X!         }
  1316. X  }
  1317. X! # endif /* UNIX */
  1318. X! #endif /* TEXTCOLOR */
  1319. X*** src/Old/timeout.c    Wed Aug 16 12:44:59 1989
  1320. X--- src/timeout.c    Tue Aug 15 20:35:14 1989
  1321. X***************
  1322. X*** 78,89 ****
  1323. X          else switch(upp - u.uprops){
  1324. X          case STONED:
  1325. X              killer = "cockatrice";
  1326. X!             done("stoned");
  1327. X              break;
  1328. X          case SICK:
  1329. X              You("die from food poisoning.");
  1330. X              killer = u.usick_cause;
  1331. X!             done("died");
  1332. X              break;
  1333. X          case FAST:
  1334. X              You("feel yourself slowing down.");
  1335. X--- 78,89 ----
  1336. X          else switch(upp - u.uprops){
  1337. X          case STONED:
  1338. X              killer = "cockatrice";
  1339. X!             done(STONING);
  1340. X              break;
  1341. X          case SICK:
  1342. X              You("die from food poisoning.");
  1343. X              killer = u.usick_cause;
  1344. X!             done(POISONING);
  1345. X              break;
  1346. X          case FAST:
  1347. X              You("feel yourself slowing down.");
  1348. X***************
  1349. X*** 125,131 ****
  1350. X              break;
  1351. X          case STRANGLED:
  1352. X              killer = "strangulation";
  1353. X!             done("died");
  1354. X              break;
  1355. X          case FUMBLING:
  1356. X              /* call this only when a move took place.  */
  1357. X--- 125,131 ----
  1358. X              break;
  1359. X          case STRANGLED:
  1360. X              killer = "strangulation";
  1361. X!             done(DIED);
  1362. X              break;
  1363. X          case FUMBLING:
  1364. X              /* call this only when a move took place.  */
  1365. X*** src/Old/topl.c    Wed Aug 16 12:45:16 1989
  1366. X--- src/topl.c    Fri Aug 11 17:17:51 1989
  1367. X***************
  1368. X*** 6,11 ****
  1369. X--- 6,12 ----
  1370. X  
  1371. X  char toplines[BUFSIZ];
  1372. X  xchar tlx, tly;            /* set by pline; used by addtopl */
  1373. X+ static boolean no_repeat = FALSE;
  1374. X  
  1375. X  struct topl {
  1376. X      struct topl *next_topl;
  1377. X***************
  1378. X*** 148,154 ****
  1379. X      if(!line || !*line) return;
  1380. X      if(!index(line, '%')) Strcpy(pbuf,line); else
  1381. X      Sprintf(pbuf,line,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
  1382. X! /*    if(flags.toplin == 1 && !strcmp(pbuf, toplines)) return;*/
  1383. X      nscr();        /* %% */
  1384. X  
  1385. X      /* If there is room on the line, print message on same line */
  1386. X--- 149,155 ----
  1387. X      if(!line || !*line) return;
  1388. X      if(!index(line, '%')) Strcpy(pbuf,line); else
  1389. X      Sprintf(pbuf,line,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
  1390. X!     if(no_repeat && flags.toplin == 1 && !strcmp(pbuf, toplines)) return;
  1391. X      nscr();        /* %% */
  1392. X  
  1393. X      /* If there is room on the line, print message on same line */
  1394. X***************
  1395. X*** 201,206 ****
  1396. X--- 202,221 ----
  1397. X          if(n0 && tl[0]) Strcat(tl, "\n");
  1398. X      }
  1399. X      redotoplin();
  1400. X+ }
  1401. X+ 
  1402. X+ /*VARARGS1*/
  1403. X+ void
  1404. X+ Norep(line,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
  1405. X+ #ifndef TOS
  1406. X+ register
  1407. X+ #endif
  1408. X+ const char *line,*arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9;
  1409. X+ {
  1410. X+     no_repeat = TRUE;
  1411. X+     pline(line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
  1412. X+     no_repeat = FALSE;
  1413. X+     return;
  1414. X  }
  1415. X  
  1416. X  /*VARARGS1*/
  1417. X*** src/Old/topten.c    Wed Aug 16 12:45:32 1989
  1418. X--- src/topten.c    Tue Aug 15 22:04:44 1989
  1419. X***************
  1420. X*** 48,55 ****
  1421. X  # ifdef NO_FILE_LINKS
  1422. X      int lockfd ;
  1423. X  # endif
  1424. X  #endif /* UNIX */
  1425. X-     int sleepct = 300;
  1426. X      FILE *rfile;
  1427. X      register int flg = 0;
  1428. X  #ifdef LOGFILE
  1429. X--- 48,55 ----
  1430. X  # ifdef NO_FILE_LINKS
  1431. X      int lockfd ;
  1432. X  # endif
  1433. X+     int sleepct = 100;
  1434. X  #endif /* UNIX */
  1435. X      FILE *rfile;
  1436. X      register int flg = 0;
  1437. X  #ifdef LOGFILE
  1438. X***************
  1439. X*** 67,107 ****
  1440. X  #define    HUP    if(!done_hup)
  1441. X  #endif
  1442. X  
  1443. X- #ifdef UNIX
  1444. X- # ifdef NO_FILE_LINKS
  1445. X-     reclock = (char *)alloc(sizeof(LOCKDIR)+1+strlen(recfile)+7);
  1446. X-     Strcpy(reclock,LOCKDIR) ;
  1447. X-     Strcat(reclock,"/") ;
  1448. X-     Strcat(reclock,recfile) ;
  1449. X-     Strcat(reclock,"_lock") ;
  1450. X-     while ((lockfd = open(reclock,O_RDWR|O_CREAT|O_EXCL,0666)) == -1) {
  1451. X- # else
  1452. X-     while(link(recfile, reclock) == -1) {
  1453. X- # endif /* NO_FILE_LINKS */
  1454. X-         HUP perror(reclock);
  1455. X-         if(!sleepct--) {
  1456. X-             HUP (void) puts("I give up.  Sorry.");
  1457. X-             HUP (void) puts("Perhaps there is an old record_lock around?");
  1458. X-             return;
  1459. X-         }
  1460. X-         HUP Printf("Waiting for access to record file. (%d)\n",
  1461. X-             sleepct);
  1462. X-         HUP (void) fflush(stdout);
  1463. X- # if defined(SYSV) || defined(ULTRIX)
  1464. X-         (void)
  1465. X- # endif
  1466. X-             sleep(1);
  1467. X-     }
  1468. X- #endif /* UNIX */
  1469. X-     if(!(rfile = fopen(recfile,"r"))){
  1470. X-         HUP (void) puts("Cannot open record file!");
  1471. X-         goto unlock;
  1472. X-     }
  1473. X- #ifdef NO_FILE_LINKS
  1474. X-     (void) close(lockfd) ;
  1475. X- #endif
  1476. X-     HUP (void) putchar('\n');
  1477. X- 
  1478. X      /* create a new 'topten' entry */
  1479. X      t0 = newttentry();
  1480. X      t0->level = dlevel;
  1481. X--- 67,72 ----
  1482. X***************
  1483. X*** 118,125 ****
  1484. X      (t0->death)[DTHSZ] = 0;
  1485. X      Strcpy(t0->date, getdate());
  1486. X  
  1487. X-     /* assure minimum number of points */
  1488. X-     if(t0->points < POINTSMIN) t0->points = 0;
  1489. X  #ifdef LOGFILE        /* used for debugging (who dies of what, where) */
  1490. X  # ifdef UNIX
  1491. X  #  ifdef NO_FILE_LINKS
  1492. X--- 83,88 ----
  1493. X***************
  1494. X*** 168,175 ****
  1495. X--- 131,183 ----
  1496. X  # ifdef NO_FILE_LINKS
  1497. X      (void) close(lockfd) ;
  1498. X  # endif
  1499. X+ # if defined(WIZARD) || defined(EXPLORE_MODE)
  1500. X+     if (wizard || discover) {
  1501. X+  Printf("\nSince you were in %s mode, the score list will not be checked.\n",
  1502. X+     wizard ? "wizard" : "discover");
  1503. X+         return;
  1504. X+     }
  1505. X+ # endif
  1506. X  #endif /* LOGFILE */
  1507. X  
  1508. X+ #ifdef UNIX
  1509. X+ # ifdef NO_FILE_LINKS
  1510. X+     reclock = (char *)alloc(sizeof(LOCKDIR)+1+strlen(recfile)+7);
  1511. X+     Strcpy(reclock,LOCKDIR) ;
  1512. X+     Strcat(reclock,"/") ;
  1513. X+     Strcat(reclock,recfile) ;
  1514. X+     Strcat(reclock,"_lock") ;
  1515. X+     while ((lockfd = open(reclock,O_RDWR|O_CREAT|O_EXCL,0666)) == -1) {
  1516. X+ # else
  1517. X+     while(link(recfile, reclock) == -1) {
  1518. X+ # endif /* NO_FILE_LINKS */
  1519. X+         HUP perror(reclock);
  1520. X+         if(!sleepct--) {
  1521. X+             HUP (void) puts("I give up.  Sorry.");
  1522. X+             HUP (void) puts("Perhaps there is an old record_lock around?");
  1523. X+             return;
  1524. X+         }
  1525. X+         HUP Printf("Waiting for access to record file. (%d)\n",
  1526. X+             sleepct);
  1527. X+         HUP (void) fflush(stdout);
  1528. X+ # if defined(SYSV) || defined(ULTRIX)
  1529. X+         (void)
  1530. X+ # endif
  1531. X+             sleep(1);
  1532. X+     }
  1533. X+ #endif /* UNIX */
  1534. X+     if(!(rfile = fopen(recfile,"r"))){
  1535. X+         HUP (void) puts("Cannot open record file!");
  1536. X+         goto unlock;
  1537. X+     }
  1538. X+ #ifdef NO_FILE_LINKS
  1539. X+     (void) close(lockfd) ;
  1540. X+ #endif
  1541. X+     HUP (void) putchar('\n');
  1542. X+ 
  1543. X+     /* assure minimum number of points */
  1544. X+     if(t0->points < POINTSMIN) t0->points = 0;
  1545. X+ 
  1546. X      t1 = tt_head = newttentry();
  1547. X      tprev = 0;
  1548. X      /* rank0: -1 undefined, 0 not_on_list, n n_th on list */
  1549. X***************
  1550. X*** 320,358 ****
  1551. X      char linebuf[BUFSZ];
  1552. X      linebuf[0] = 0;
  1553. X      if(rank) Sprintf(eos(linebuf), " %2d", rank);
  1554. X!         else Sprintf(eos(linebuf), "   ");
  1555. X      Sprintf(eos(linebuf), " %7ld  %.10s", t1->points, t1->name);
  1556. X      Sprintf(eos(linebuf), "-%c ", t1->plchar);
  1557. X      if(!strncmp("escaped", t1->death, 7)) {
  1558. X!       if(!strcmp(" (with amulet)", t1->death+7))
  1559. X!         Sprintf(eos(linebuf), "escaped the dungeon with amulet");
  1560. X        else
  1561. X          Sprintf(eos(linebuf), "escaped the dungeon [max level %d]",
  1562. X            t1->maxlvl);
  1563. X  #ifdef ENDGAME
  1564. X      } else if(!strncmp("ascended", t1->death, 8)) {
  1565. X!        Sprintf(eos(linebuf), "ascended to demigod-hood");
  1566. X  #endif
  1567. X      } else {
  1568. X        if(!strncmp(t1->death,"quit",4)) {
  1569. X          quit = TRUE;
  1570. X!         Sprintf(eos(linebuf), "quit");
  1571. X!       } else if(!strcmp(t1->death,"choked"))
  1572. X          Sprintf(eos(linebuf), "choked on %s food",
  1573. X              (t1->sex == 'F') ? "her" : "his");
  1574. X!       else if(!strncmp(t1->death,"starv",5)) {
  1575. X!         Sprintf(eos(linebuf), "starved to death");
  1576. X          starv = TRUE;
  1577. X        } else if(!strncmp(t1->death, "turned to stone by ",19)) {
  1578. X!         Sprintf(eos(linebuf), "was petrified");
  1579. X          isstoned = TRUE;
  1580. X        } else {
  1581. X!         Sprintf(eos(linebuf), "was killed");
  1582. X          iskilled = TRUE;
  1583. X        }
  1584. X  #ifdef ENDLEVEL
  1585. X        if (t1->level == ENDLEVEL)
  1586. X!         Strcpy(eos(linebuf), " in the endgame");
  1587. X        else
  1588. X  #endif
  1589. X          Sprintf(eos(linebuf), " on%s level %d",
  1590. X--- 328,370 ----
  1591. X      char linebuf[BUFSZ];
  1592. X      linebuf[0] = 0;
  1593. X      if(rank) Sprintf(eos(linebuf), " %2d", rank);
  1594. X!         else Strcat(linebuf, "   ");
  1595. X      Sprintf(eos(linebuf), " %7ld  %.10s", t1->points, t1->name);
  1596. X      Sprintf(eos(linebuf), "-%c ", t1->plchar);
  1597. X      if(!strncmp("escaped", t1->death, 7)) {
  1598. X!       if(!strcmp(" (with the Amulet)", t1->death+7))
  1599. X!         Strcat(linebuf, "escaped the dungeon with the Amulet");
  1600. X        else
  1601. X          Sprintf(eos(linebuf), "escaped the dungeon [max level %d]",
  1602. X            t1->maxlvl);
  1603. X  #ifdef ENDGAME
  1604. X      } else if(!strncmp("ascended", t1->death, 8)) {
  1605. X!        Strcat(linebuf, "ascended to demigod-hood");
  1606. X  #endif
  1607. X      } else {
  1608. X        if(!strncmp(t1->death,"quit",4)) {
  1609. X          quit = TRUE;
  1610. X!         Strcat(linebuf, "quit");
  1611. X!       } else if(!strcmp(t1->death,"choked")) {
  1612. X          Sprintf(eos(linebuf), "choked on %s food",
  1613. X              (t1->sex == 'F') ? "her" : "his");
  1614. X!       } else if(!strncmp(t1->death,"starv",5)) {
  1615. X!         Strcat(linebuf, "starved to death");
  1616. X          starv = TRUE;
  1617. X+       } else if(!strcmp(t1->death,"poisoned")) {
  1618. X+         Strcat(linebuf, "was posioned");
  1619. X+       } else if(!strcmp(t1->death,"crushed")) {
  1620. X+         Strcat(linebuf, "was crushed to death");
  1621. X        } else if(!strncmp(t1->death, "turned to stone by ",19)) {
  1622. X!         Strcat(linebuf, "was petrified");
  1623. X          isstoned = TRUE;
  1624. X        } else {
  1625. X!         Strcat(linebuf, "was killed");
  1626. X          iskilled = TRUE;
  1627. X        }
  1628. X  #ifdef ENDLEVEL
  1629. X        if (t1->level == ENDLEVEL)
  1630. X!         Strcat(linebuf, " in the endgame");
  1631. X        else
  1632. X  #endif
  1633. X          Sprintf(eos(linebuf), " on%s level %d",
  1634. X***************
  1635. X*** 359,382 ****
  1636. X            (iskilled || isstoned || starv) ? "" : " dungeon", t1->level);
  1637. X        if(t1->maxlvl != t1->level)
  1638. X          Sprintf(eos(linebuf), " [max %d]", t1->maxlvl);
  1639. X!       if(quit && t1->death[4]) Sprintf(eos(linebuf), t1->death + 4);
  1640. X      }
  1641. X      if(iskilled) Sprintf(eos(linebuf), " by %s%s",
  1642. X        (!strncmp(t1->death, "trick", 5) || !strncmp(t1->death, "the ", 4)
  1643. X         || !strncmp(t1->death, "Mr. ", 4) || !strncmp(t1->death, "Ms. ", 4)
  1644. X!        || !strncmp(eos(t1->death)-4, "tion", 4)
  1645. X         ) ? "" :
  1646. X        index(vowels,*t1->death) ? "an " : "a ",
  1647. X        t1->death);
  1648. X      if (isstoned) Sprintf(eos(linebuf), " by %s%s", index(vowels,
  1649. X          *(t1->death + 19)) ? "an " : "a ", t1->death + 19);
  1650. X!     Sprintf(eos(linebuf), ".");
  1651. X      if(t1->maxhp) {
  1652. X        register char *bp = eos(linebuf);
  1653. X        char hpbuf[10];
  1654. X        int hppos;
  1655. X        int lngr = strlen(linebuf);
  1656. X!       Sprintf(hpbuf, (t1->hp > 0) ? itoa(t1->hp) : "-");
  1657. X        hppos = COLNO - 7 - strlen(hpbuf);
  1658. X        if (lngr >= hppos) hppos = (2*COLNO) - 7 - strlen(hpbuf);
  1659. X        if(bp <= linebuf + hppos) {
  1660. X--- 371,394 ----
  1661. X            (iskilled || isstoned || starv) ? "" : " dungeon", t1->level);
  1662. X        if(t1->maxlvl != t1->level)
  1663. X          Sprintf(eos(linebuf), " [max %d]", t1->maxlvl);
  1664. X!       if(quit && t1->death[4]) Strcat(linebuf, t1->death + 4);
  1665. X      }
  1666. X      if(iskilled) Sprintf(eos(linebuf), " by %s%s",
  1667. X        (!strncmp(t1->death, "trick", 5) || !strncmp(t1->death, "the ", 4)
  1668. X         || !strncmp(t1->death, "Mr. ", 4) || !strncmp(t1->death, "Ms. ", 4)
  1669. X!        || !strncmp(eos(t1->death)-5, "ation", 5)
  1670. X         ) ? "" :
  1671. X        index(vowels,*t1->death) ? "an " : "a ",
  1672. X        t1->death);
  1673. X      if (isstoned) Sprintf(eos(linebuf), " by %s%s", index(vowels,
  1674. X          *(t1->death + 19)) ? "an " : "a ", t1->death + 19);
  1675. X!     Strcat(linebuf, ".");
  1676. X      if(t1->maxhp) {
  1677. X        register char *bp = eos(linebuf);
  1678. X        char hpbuf[10];
  1679. X        int hppos;
  1680. X        int lngr = strlen(linebuf);
  1681. X!       Strcpy(hpbuf, (t1->hp > 0) ? itoa(t1->hp) : "-");
  1682. X        hppos = COLNO - 7 - strlen(hpbuf);
  1683. X        if (lngr >= hppos) hppos = (2*COLNO) - 7 - strlen(hpbuf);
  1684. X        if(bp <= linebuf + hppos) {
  1685. X*** src/Old/trap.c    Wed Aug 16 12:46:13 1989
  1686. X--- src/trap.c    Wed Aug 16 10:15:44 1989
  1687. X***************
  1688. X*** 259,265 ****
  1689. X              fobj->quan = 1;
  1690. X              fobj->owt = weight(fobj);
  1691. X              stackobj(fobj);
  1692. X!             if(Invisible) newsym(u.ux, u.uy);
  1693. X              } else {
  1694. X              register int newlevel = dlevel + 1;
  1695. X              while(!rn2(4) && newlevel < 29) newlevel++;
  1696. X--- 259,269 ----
  1697. X              fobj->quan = 1;
  1698. X              fobj->owt = weight(fobj);
  1699. X              stackobj(fobj);
  1700. X!             if(Invisible
  1701. X! #ifdef POLYSELF
  1702. X!                 || u.uundetected
  1703. X! #endif
  1704. X!                         ) newsym(u.ux, u.uy);
  1705. X              } else {
  1706. X              register int newlevel = dlevel + 1;
  1707. X              while(!rn2(4) && newlevel < 29) newlevel++;
  1708. X***************
  1709. X*** 422,427 ****
  1710. X--- 426,433 ----
  1711. X              selftouch("Falling, you");
  1712. X              break;
  1713. X          case LEVEL_TELEP:
  1714. X+         {   int oldl = dlevel;
  1715. X+ 
  1716. X              pline("You have %s onto a level teleport trap!",
  1717. X  #ifdef POLYSELF
  1718. X              is_flyer(uasmon) ? "flown" :
  1719. X***************
  1720. X*** 429,436 ****
  1721. X  #else
  1722. X              Levitation ? "moved" : "stepped");
  1723. X  #endif
  1724. X!             if(Antimagic)
  1725. X              shieldeff(u.ux, u.uy);
  1726. X              if(Antimagic
  1727. X  #ifdef ENDGAME
  1728. X                  || dlevel == ENDLEVEL
  1729. X--- 435,444 ----
  1730. X  #else
  1731. X              Levitation ? "moved" : "stepped");
  1732. X  #endif
  1733. X!             if(Antimagic) {
  1734. X!             pru();
  1735. X              shieldeff(u.ux, u.uy);
  1736. X+             }
  1737. X              if(Antimagic
  1738. X  #ifdef ENDGAME
  1739. X                  || dlevel == ENDLEVEL
  1740. X***************
  1741. X*** 446,451 ****
  1742. X--- 454,468 ----
  1743. X              deltrap(trap);
  1744. X              newsym(u.ux,u.uy);
  1745. X              level_tele();
  1746. X+             if(oldl == dlevel && !Invisible
  1747. X+ #ifdef POLYSELF
  1748. X+                         && !u.uundetected
  1749. X+ #endif
  1750. X+                                 ) {
  1751. X+             levl[u.ux][u.uy].seen = 0; /* force atl */
  1752. X+             atl(u.ux,u.uy,(char)u.usym);
  1753. X+             }
  1754. X+         }
  1755. X              break;
  1756. X  #ifdef SPELLS
  1757. X          case ANTI_MAGIC:
  1758. X***************
  1759. X*** 477,483 ****
  1760. X              u.uen = (u.uenmax += 2);
  1761. X  #endif
  1762. X              deltrap(trap);
  1763. X!             if(Invisible) newsym(u.ux,u.uy);
  1764. X              } else domagictrap();
  1765. X              break;
  1766. X          case SQBRD:        /* Stepped on a squeaky board. */
  1767. X--- 494,504 ----
  1768. X              u.uen = (u.uenmax += 2);
  1769. X  #endif
  1770. X              deltrap(trap);
  1771. X!             if(Invisible
  1772. X! #ifdef POLYSELF
  1773. X!                 && !u.uundetected
  1774. X! #endif
  1775. X!                         ) newsym(u.ux,u.uy);
  1776. X              } else domagictrap();
  1777. X              break;
  1778. X          case SQBRD:        /* Stepped on a squeaky board. */
  1779. X***************
  1780. X*** 604,610 ****
  1781. X      /* A bug fix for dumb messages by ab@unido.
  1782. X       */
  1783. X          int in_sight = cansee(mtmp->mx,mtmp->my)
  1784. X!                && (!mtmp->minvis || See_invisible);
  1785. X  
  1786. X          if(mtmp->mtrapseen & (1 << tt)) {
  1787. X          /* he has been in such a trap - perhaps he escapes */
  1788. X--- 625,631 ----
  1789. X      /* A bug fix for dumb messages by ab@unido.
  1790. X       */
  1791. X          int in_sight = cansee(mtmp->mx,mtmp->my)
  1792. X!                && (!mtmp->minvis || See_invisible || Telepat);
  1793. X  
  1794. X          if(mtmp->mtrapseen & (1 << tt)) {
  1795. X          /* he has been in such a trap - perhaps he escapes */
  1796. X***************
  1797. X*** 822,828 ****
  1798. X          pline("%s touch the cockatrice corpse.", arg);
  1799. X          You("turn to stone...");
  1800. X          killer = "cockatrice corpse accident";
  1801. X!         done("stoned");
  1802. X      }
  1803. X  }
  1804. X  
  1805. X--- 843,849 ----
  1806. X          pline("%s touch the cockatrice corpse.", arg);
  1807. X          You("turn to stone...");
  1808. X          killer = "cockatrice corpse accident";
  1809. X!         done(STONING);
  1810. X      }
  1811. X  }
  1812. X  
  1813. X***************
  1814. X*** 910,915 ****
  1815. X--- 931,938 ----
  1816. X          pline("Being unconscious, you cannot control your teleport.");
  1817. X          else {
  1818. X              pline("To what position do you want to be teleported?");
  1819. X+             cc.x = u.ux;
  1820. X+             cc.y = u.uy;
  1821. X              getpos(&cc, 1, "the desired position"); /* 1: force valid */
  1822. X              /* possible extensions: introduce a small error if
  1823. X                 magic power is low; allow transfer to solid rock */
  1824. X***************
  1825. X*** 1116,1122 ****
  1826. X              You("arrive in heaven.");
  1827. X              pline("\"You are here a bit early, but we'll let you in.\"");
  1828. X              killer = "visit to heaven";
  1829. X!             done("died");
  1830. X          } else    if (newlevel == -9) {
  1831. X              You("feel deliriously happy. ");
  1832. X              pline("(In fact, you're on Cloud 9!) ");
  1833. X--- 1139,1145 ----
  1834. X              You("arrive in heaven.");
  1835. X              pline("\"You are here a bit early, but we'll let you in.\"");
  1836. X              killer = "visit to heaven";
  1837. X!             done(DIED);
  1838. X          } else    if (newlevel == -9) {
  1839. X              You("feel deliriously happy. ");
  1840. X              pline("(In fact, you're on Cloud 9!) ");
  1841. X***************
  1842. X*** 1131,1137 ****
  1843. X          if(Levitation) {
  1844. X              You("float gently down to earth.");
  1845. X  #ifndef STRONGHOLD
  1846. X!             done("escaped");
  1847. X  #endif
  1848. X          }
  1849. X  #ifdef POLYSELF
  1850. X--- 1154,1160 ----
  1851. X          if(Levitation) {
  1852. X              You("float gently down to earth.");
  1853. X  #ifndef STRONGHOLD
  1854. X!             done(ESCAPED);
  1855. X  #endif
  1856. X          }
  1857. X  #ifdef POLYSELF
  1858. X***************
  1859. X*** 1138,1144 ****
  1860. X          if(is_flyer(uasmon)) {
  1861. X              You("fly down to earth.");
  1862. X  # ifndef STRONGHOLD
  1863. X!             done("escaped");
  1864. X  # endif
  1865. X          }
  1866. X  #endif
  1867. X--- 1161,1167 ----
  1868. X          if(is_flyer(uasmon)) {
  1869. X              You("fly down to earth.");
  1870. X  # ifndef STRONGHOLD
  1871. X!             done(ESCAPED);
  1872. X  # endif
  1873. X          }
  1874. X  #endif
  1875. X***************
  1876. X*** 1146,1152 ****
  1877. X          You("plummet a few thousand feet to your death.");
  1878. X          dlevel = 0;
  1879. X          killer = "long fall";
  1880. X!         done("died");
  1881. X  #ifdef WALKIES
  1882. X          } else {
  1883. X          You("shudder for a moment...");
  1884. X--- 1169,1175 ----
  1885. X          You("plummet a few thousand feet to your death.");
  1886. X          dlevel = 0;
  1887. X          killer = "long fall";
  1888. X!         done(DIED);
  1889. X  #ifdef WALKIES
  1890. X          } else {
  1891. X          You("shudder for a moment...");
  1892. X***************
  1893. X*** 1154,1160 ****
  1894. X          }
  1895. X  #endif
  1896. X      }
  1897. X!     /* calls done("escaped") if newlevel==0 */
  1898. X  #ifdef WALKIES
  1899. X      if(!pet_by_u)
  1900. X          You("shudder for a moment...");
  1901. X--- 1177,1183 ----
  1902. X          }
  1903. X  #endif
  1904. X      }
  1905. X!     /* calls done(ESCAPED) if newlevel==0 */
  1906. X  #ifdef WALKIES
  1907. X      if(!pet_by_u)
  1908. X          You("shudder for a moment...");
  1909. X***************
  1910. X*** 1313,1319 ****
  1911. X      }
  1912. X      You("drown.");
  1913. X      killer = levl[u.ux][u.uy].typ == POOL ? "pool of water" : "moat";
  1914. X!     done("drowned");
  1915. X  }
  1916. X  
  1917. X  #ifdef SPELLS
  1918. X--- 1336,1342 ----
  1919. X      }
  1920. X      You("drown.");
  1921. X      killer = levl[u.ux][u.uy].typ == POOL ? "pool of water" : "moat";
  1922. X!     done(DROWNING);
  1923. X  }
  1924. X  
  1925. X  #ifdef SPELLS
  1926. X***************
  1927. X*** 1364,1370 ****
  1928. X                  case 'n': continue;
  1929. X                  }
  1930. X  
  1931. X!                 if((otmp->otrapped && !confused && rn2(44-dlevel*2) < 10)
  1932. X                     || confused && !rn2(3)) {
  1933. X                  You("find a trap on the %s!  Disarm it? ",
  1934. X                         xname(otmp));
  1935. X--- 1387,1394 ----
  1936. X                  case 'n': continue;
  1937. X                  }
  1938. X  
  1939. X!                 if((otmp->otrapped && !confused 
  1940. X!                     && rn2(MAXLEVEL+2-dlevel) < 10)
  1941. X                     || confused && !rn2(3)) {
  1942. X                  You("find a trap on the %s!  Disarm it? ",
  1943. X                         xname(otmp));
  1944. X***************
  1945. X*** 1383,1389 ****
  1946. X                      chest_trap(otmp, FINGER);
  1947. X                      } else {
  1948. X                      You("disarm it!");
  1949. X!                     otmp->otrapped = 0;
  1950. X                      }
  1951. X                  } else pline("That %s was not trapped.",
  1952. X                           doname(otmp));
  1953. X--- 1407,1413 ----
  1954. X                      chest_trap(otmp, FINGER);
  1955. X                      } else {
  1956. X                      You("disarm it!");
  1957. X!                         otmp->otrapped = 0;
  1958. X                      }
  1959. X                  } else pline("That %s was not trapped.",
  1960. X                           doname(otmp));
  1961. X***************
  1962. X*** 1422,1428 ****
  1963. X      }
  1964. X  
  1965. X      if ((levl[x][y].doormask & D_TRAPPED && !confused &&
  1966. X!          rn2(44-dlevel*2) < 10)
  1967. X          || confused && !rn2(3)) {
  1968. X          You("find a trap on the door!  Disarm it? ");
  1969. X          if (ynq() != 'y') return(1);
  1970. X--- 1446,1452 ----
  1971. X      }
  1972. X  
  1973. X      if ((levl[x][y].doormask & D_TRAPPED && !confused &&
  1974. X!          rn2(MAXLEVEL+2-dlevel) < 10)
  1975. X          || confused && !rn2(3)) {
  1976. X          You("find a trap on the door!  Disarm it? ");
  1977. X          if (ynq() != 'y') return(1);
  1978. X***************
  1979. X*** 1433,1442 ****
  1980. X              if(confused || Fumbling || rnd(75+dlevel/2) > ch) {
  1981. X                  You("set it off!");
  1982. X                  b_trapped("door");
  1983. X!             } else {
  1984. X                  You("disarm it!");
  1985. X!                 levl[x][y].doormask &= ~D_TRAPPED;
  1986. X!             }
  1987. X          } else pline("This door was not trapped.");
  1988. X          return(1);
  1989. X      } else {
  1990. X--- 1457,1465 ----
  1991. X              if(confused || Fumbling || rnd(75+dlevel/2) > ch) {
  1992. X                  You("set it off!");
  1993. X                  b_trapped("door");
  1994. X!             } else
  1995. X                  You("disarm it!");
  1996. X!             levl[x][y].doormask &= ~D_TRAPPED;
  1997. X          } else pline("This door was not trapped.");
  1998. X          return(1);
  1999. X      } else {
  2000. X***************
  2001. X*** 1581,1591 ****
  2002. X  b_trapped(item)        /* used for doors. can be used */
  2003. X  register char *item;    /* for anything else that opens */
  2004. X  {
  2005. X!     register int dmg = rn2(15) + rnd((int)u.ulevel);
  2006. X  
  2007. X      pline("KABOOM!!  The %s was booby-trapped!", item);
  2008. X      make_stunned(HStun + dmg, TRUE);
  2009. X-     losehp(dmg, "explosion");
  2010. X  }
  2011. X  
  2012. X  /* Monster is hit by trap. */
  2013. X--- 1604,1616 ----
  2014. X  b_trapped(item)        /* used for doors. can be used */
  2015. X  register char *item;    /* for anything else that opens */
  2016. X  {
  2017. X!     register int dmg = rnd(5+(dlevel < 5 ? dlevel : 2+dlevel/2));
  2018. X  
  2019. X      pline("KABOOM!!  The %s was booby-trapped!", item);
  2020. X+     if(u.ulevel < 4 && dlevel < 3 && !rn2(3)) 
  2021. X+         You("are shaken, but luckily unhurt.");        
  2022. X+     else losehp(dmg, "explosion");
  2023. X      make_stunned(HStun + dmg, TRUE);
  2024. X  }
  2025. X  
  2026. X  /* Monster is hit by trap. */
  2027. X*** src/Old/u_init.c    Wed Aug 16 12:47:06 1989
  2028. X--- src/u_init.c    Tue Aug  8 21:44:38 1989
  2029. X***************
  2030. X*** 534,547 ****
  2031. X           * items: wand of wishing, ring of levitation, or the
  2032. X           * polymorph/polymorph control combination.  Specific objects,
  2033. X           * i.e. the discovery wishing, are still OK.
  2034. X           */
  2035. X          if (undefined) {
  2036. X  #ifdef POLYSELF
  2037. X!             static int nocreate = STRANGE_OBJECT;
  2038. X  #  ifdef SPELLS
  2039. X!             static int nocreate2 = STRANGE_OBJECT;
  2040. X  #  endif
  2041. X  #endif
  2042. X  
  2043. X              while(obj->otyp == WAN_WISHING
  2044. X  #ifdef POLYSELF
  2045. X--- 534,552 ----
  2046. X           * items: wand of wishing, ring of levitation, or the
  2047. X           * polymorph/polymorph control combination.  Specific objects,
  2048. X           * i.e. the discovery wishing, are still OK.
  2049. X+          * Also, don't get a couple of really useless items.  (Note:
  2050. X+          * punishment isn't "useless".  Some players who start out with
  2051. X+          * one will immediately read it and use the iron ball as a
  2052. X+          * weapon.)
  2053. X           */
  2054. X          if (undefined) {
  2055. X  #ifdef POLYSELF
  2056. X!             int nocreate = STRANGE_OBJECT;
  2057. X  #  ifdef SPELLS
  2058. X!             int nocreate2 = STRANGE_OBJECT;
  2059. X  #  endif
  2060. X  #endif
  2061. X+             int nocreate3 = STRANGE_OBJECT;
  2062. X  
  2063. X              while(obj->otyp == WAN_WISHING
  2064. X  #ifdef POLYSELF
  2065. X***************
  2066. X*** 550,558 ****
  2067. X--- 555,571 ----
  2068. X                  || obj->otyp == nocreate2
  2069. X  #  endif
  2070. X  #endif
  2071. X+                 || obj->otyp == nocreate3
  2072. X  #ifdef ELBERETH
  2073. X                  || obj->otyp == RIN_LEVITATION
  2074. X  #endif
  2075. X+                 /* 'useless' items */
  2076. X+                 || obj->otyp == POT_HALLUCINATION
  2077. X+                 || obj->otyp == SCR_AMNESIA
  2078. X+                 || obj->otyp == SCR_FIRE
  2079. X+                 || obj->otyp == RIN_AGGRAVATE_MONSTER
  2080. X+                 || obj->otyp == RIN_HUNGER
  2081. X+                 || obj->otyp == WAN_NOTHING
  2082. X                              ) {
  2083. X                  free((genericptr_t) obj);
  2084. X                  obj = mkobj(trop->trolet, FALSE);
  2085. X***************
  2086. X*** 565,578 ****
  2087. X              /* Heavily relies on the fact that 1) we create wands
  2088. X               * before rings, 2) that we create rings before
  2089. X               * spellbooks, and that 3) not more than 1 object of a
  2090. X!              * particular symbol is to be prohibited.
  2091. X               */
  2092. X  #ifdef POLYSELF
  2093. X!             if (obj->otyp == WAN_POLYMORPH)
  2094. X                  nocreate = RIN_POLYMORPH_CONTROL;
  2095. X!             if (obj->otyp == RIN_POLYMORPH)
  2096. X!                 nocreate = RIN_POLYMORPH_CONTROL;
  2097. X!             if (obj->otyp == RIN_POLYMORPH_CONTROL) {
  2098. X                  nocreate = RIN_POLYMORPH;
  2099. X  #  ifdef SPELLS
  2100. X                  nocreate2 = SPE_POLYMORPH;
  2101. X--- 578,593 ----
  2102. X              /* Heavily relies on the fact that 1) we create wands
  2103. X               * before rings, 2) that we create rings before
  2104. X               * spellbooks, and that 3) not more than 1 object of a
  2105. X!              * particular symbol is to be prohibited.  (For more
  2106. X!              * objects, we need more nocreate variables...)
  2107. X               */
  2108. X  #ifdef POLYSELF
  2109. X!             switch (obj->otyp) {
  2110. X!                 case WAN_POLYMORPH:
  2111. X!                 case RIN_POLYMORPH:
  2112. X                  nocreate = RIN_POLYMORPH_CONTROL;
  2113. X!                 break;
  2114. X!                 case RIN_POLYMORPH_CONTROL:
  2115. X                  nocreate = RIN_POLYMORPH;
  2116. X  #  ifdef SPELLS
  2117. X                  nocreate2 = SPE_POLYMORPH;
  2118. X***************
  2119. X*** 579,584 ****
  2120. X--- 594,602 ----
  2121. X  #  endif /* SPELLS */
  2122. X              }
  2123. X  #endif /* POLYSELF */
  2124. X+             /* Don't have 2 of the same ring */
  2125. X+             if (obj->olet == RING_SYM)
  2126. X+                 nocreate3 = obj->otyp;
  2127. X          }
  2128. X  
  2129. X          obj->bknown = trop->trknown;
  2130. X***************
  2131. X*** 606,612 ****
  2132. X                  && obj->otyp != SACK
  2133. X                  && obj->otyp != CHEST
  2134. X                  && obj->otyp != LARGE_BOX
  2135. X!                 && obj->otyp != ICE_BOX)
  2136. X          }
  2137. X          */
  2138. X          if(trop->trspe != UNDEF_SPE)
  2139. X--- 624,630 ----
  2140. X                  && obj->otyp != SACK
  2141. X                  && obj->otyp != CHEST
  2142. X                  && obj->otyp != LARGE_BOX
  2143. X!                 && obj->otyp != ICE_BOX);
  2144. X          }
  2145. X          */
  2146. X          if(trop->trspe != UNDEF_SPE)
  2147. END_OF_FILE
  2148. if test 53958 -ne `wc -c <'patch02g'`; then
  2149.     echo shar: \"'patch02g'\" unpacked with wrong size!
  2150. fi
  2151. # end of 'patch02g'
  2152. fi
  2153. echo shar: End of archive 7 \(of 7\).
  2154. cp /dev/null ark7isdone
  2155. MISSING=""
  2156. for I in 1 2 3 4 5 6 7 ; do
  2157.     if test ! -f ark${I}isdone ; then
  2158.     MISSING="${MISSING} ${I}"
  2159.     fi
  2160. done
  2161. if test "${MISSING}" = "" ; then
  2162.     echo You have unpacked all 7 archives.
  2163.     rm -f ark[1-9]isdone
  2164. else
  2165.     echo You still need to unpack the following archives:
  2166.     echo "        " ${MISSING}
  2167. fi
  2168. ##  End of shell archive.
  2169. exit 0
  2170.