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

  1. Path: uunet!gatech!howland.reston.ans.net!europa.eng.gtefsd.com!emory!ogicse!news.tek.com!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v17i094:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Patch2s/33
  5. Message-ID: <1v8iou$j57@ying.cna.tek.com>
  6. Date: 11 Jun 93 00:14:22 GMT
  7. Article-I.D.: ying.1v8iou$j57
  8. Organization: Tektronix, Inc, Redmond, OR, USA
  9. Lines: 2156
  10. Approved: billr@saab.CNA.TEK.COM
  11. NNTP-Posting-Host: saab.cna.tek.com
  12. Xref: uunet comp.sources.games:1759
  13.  
  14. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  15. Posting-number: Volume 17, Issue 94
  16. Archive-name: nethack31/Patch2s
  17. Patch-To: nethack31: Volume 16, Issue 1-116
  18. Environment: Amiga, Atari, Mac, MS-DOS, Windows-NT, OS2, Unix, VMS, X11
  19.  
  20.  
  21.  
  22. #! /bin/sh
  23. # This is a shell archive.  Remove anything before this line, then unpack
  24. # it by saving it into a file and typing "sh file".  To overwrite existing
  25. # files, type "sh file -c".  You can also feed this as standard input via
  26. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  27. # will see the following message at the end:
  28. #        "End of archive 19 (of 33)."
  29. # Contents:  patches02j
  30. # Wrapped by billr@saab on Thu Jun 10 16:55:05 1993
  31. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  32. if test -f 'patches02j' -a "${1}" != "-c" ; then 
  33.   echo shar: Renaming existing file \"'patches02j'\" to \"'patches02j.orig'\"
  34.   mv -f 'patches02j' 'patches02j.orig'
  35. fi
  36. echo shar: Extracting \"'patches02j'\" \(52637 characters\)
  37. sed "s/^X//" >'patches02j' <<'END_OF_FILE'
  38. X*** /tmp/da11098    Tue Jun  1 16:14:17 1993
  39. X--- src/mklev.c    Wed May 26 13:01:25 1993
  40. X***************
  41. X*** 385,391 ****
  42. X          else
  43. X              levl[x][y].doormask = D_CLOSED;
  44. X  
  45. X!         if (levl[x][y].doormask != D_ISOPEN && !shdoor && !rn2(25))
  46. X              levl[x][y].doormask |= D_TRAPPED;
  47. X          } else
  48. X  #ifdef STUPID
  49. X--- 385,392 ----
  50. X          else
  51. X              levl[x][y].doormask = D_CLOSED;
  52. X  
  53. X!         if (levl[x][y].doormask != D_ISOPEN && !shdoor &&
  54. X!             level_difficulty() >= 5 && !rn2(25))
  55. X              levl[x][y].doormask |= D_TRAPPED;
  56. X          } else
  57. X  #ifdef STUPID
  58. X***************
  59. X*** 415,421 ****
  60. X          if(shdoor || !rn2(5))    levl[x][y].doormask = D_LOCKED;
  61. X          else            levl[x][y].doormask = D_CLOSED;
  62. X  
  63. X!         if(!shdoor && !rn2(20)) levl[x][y].doormask |= D_TRAPPED;
  64. X      }
  65. X  
  66. X      add_door(x,y,aroom);
  67. X--- 416,423 ----
  68. X          if(shdoor || !rn2(5))    levl[x][y].doormask = D_LOCKED;
  69. X          else            levl[x][y].doormask = D_CLOSED;
  70. X  
  71. X!         if(!shdoor && level_difficulty() >= 4 && !rn2(20))
  72. X!             levl[x][y].doormask |= D_TRAPPED;
  73. X      }
  74. X  
  75. X      add_door(x,y,aroom);
  76. X***************
  77. X*** 479,488 ****
  78. X              if(trap_type == TRAPDOOR && !Can_fall_thru(&u.uz))
  79. X              trap_type = ROCKTRAP;
  80. X              ttmp = maketrap(xx, yy+dy, trap_type);
  81. X!             ttmp->once = 1;
  82. X!             if (trap_engravings[trap_type])
  83. X!             make_engr_at(xx, yy-dy,
  84. X                       trap_engravings[trap_type], 0L, DUST);
  85. X          }
  86. X          dosdoor(xx, yy, aroom, SDOOR);
  87. X          } else {
  88. X--- 481,492 ----
  89. X              if(trap_type == TRAPDOOR && !Can_fall_thru(&u.uz))
  90. X              trap_type = ROCKTRAP;
  91. X              ttmp = maketrap(xx, yy+dy, trap_type);
  92. X!             if (ttmp) {
  93. X!             ttmp->once = 1;
  94. X!             if (trap_engravings[trap_type])
  95. X!                 make_engr_at(xx, yy-dy,
  96. X                       trap_engravings[trap_type], 0L, DUST);
  97. X+             }
  98. X          }
  99. X          dosdoor(xx, yy, aroom, SDOOR);
  100. X          } else {
  101. X***************
  102. X*** 490,496 ****
  103. X          if(rn2(7))
  104. X              dosdoor(xx, yy, aroom, rn2(5) ? SDOOR : DOOR);
  105. X          else {
  106. X!             (void) mksobj_at(SCR_TELEPORTATION, xx, yy+dy, TRUE);
  107. X              if(!rn2(3)) (void) mkobj_at(0, xx, yy+dy, TRUE);
  108. X          }
  109. X          }
  110. X--- 494,501 ----
  111. X          if(rn2(7))
  112. X              dosdoor(xx, yy, aroom, rn2(5) ? SDOOR : DOOR);
  113. X          else {
  114. X!             if (!level.flags.noteleport)
  115. X!             (void) mksobj_at(SCR_TELEPORTATION, xx, yy+dy, TRUE);
  116. X              if(!rn2(3)) (void) mkobj_at(0, xx, yy+dy, TRUE);
  117. X          }
  118. X          }
  119. X***************
  120. X*** 501,517 ****
  121. X  static void
  122. X  make_niches()
  123. X  {
  124. X!     register int ct = rnd((nroom>>1) + 1);
  125. X!     boolean    ltptr = TRUE,
  126. X!         vamp = TRUE;
  127. X  
  128. X!     while(ct--) {
  129. X  
  130. X!         if(depth(&u.uz) > 15 && !rn2(6) && ltptr) {
  131. X              ltptr = FALSE;
  132. X              makeniche(LEVEL_TELEP);
  133. X!         } else if(depth(&u.uz) > 5 && depth(&u.uz) < 25
  134. X!                             && !rn2(6) && vamp) {
  135. X              vamp = FALSE;
  136. X              makeniche(TRAPDOOR);
  137. X          } else    makeniche(NO_TRAP);
  138. X--- 506,521 ----
  139. X  static void
  140. X  make_niches()
  141. X  {
  142. X!     register int ct = rnd((nroom>>1) + 1), dep = depth(&u.uz);
  143. X  
  144. X!     boolean    ltptr = (!level.flags.noteleport && dep > 15),
  145. X!         vamp = (dep > 5 && dep < 25);
  146. X  
  147. X!     while(ct--) {
  148. X!         if (ltptr && !rn2(6)) {
  149. X              ltptr = FALSE;
  150. X              makeniche(LEVEL_TELEP);
  151. X!         } else if (vamp && !rn2(6)) {
  152. X              vamp = FALSE;
  153. X              makeniche(TRAPDOOR);
  154. X          } else    makeniche(NO_TRAP);
  155. X***************
  156. X*** 551,556 ****
  157. X--- 555,565 ----
  158. X      (void) memset((genericptr_t)level.objects, 0, sizeof(level.objects));
  159. X      (void) memset((genericptr_t)level.monsters, 0, sizeof(level.monsters));
  160. X  #endif
  161. X+     level.objlist = (struct obj *)0;
  162. X+     level.buriedobjlist = (struct obj *)0;
  163. X+     level.monlist = (struct monst *)0;
  164. X+     level.damagelist = (struct damage *)0;
  165. X+ 
  166. X      level.flags.nfountains = 0;
  167. X      level.flags.nsinks = 0;
  168. X      level.flags.has_shop = 0;
  169. X***************
  170. X*** 690,696 ****
  171. X  #ifdef MULDGN
  172. X              mk_knox_portal(vault_x+w, vault_y+h);
  173. X  #endif
  174. X!             if(!rn2(3)) makevtele();
  175. X          } else if(rnd_rect() && create_vault()) {
  176. X              vault_x = rooms[nroom].lx;
  177. X              vault_y = rooms[nroom].ly;
  178. X--- 699,705 ----
  179. X  #ifdef MULDGN
  180. X              mk_knox_portal(vault_x+w, vault_y+h);
  181. X  #endif
  182. X!             if(!level.flags.noteleport && !rn2(3)) makevtele();
  183. X          } else if(rnd_rect() && create_vault()) {
  184. X              vault_x = rooms[nroom].lx;
  185. X              vault_y = rooms[nroom].ly;
  186. X***************
  187. X*** 999,1012 ****
  188. X  bydoor(x, y)
  189. X  register xchar x, y;
  190. X  {
  191. X!     register boolean tmp1, tmp2;
  192. X  
  193. X!     /* break up large expression to help some compilers */
  194. X!     tmp1 = (IS_DOOR(levl[x+1][y].typ) || levl[x+1][y].typ == SDOOR ||
  195. X!         IS_DOOR(levl[x-1][y].typ) || levl[x-1][y].typ == SDOOR);
  196. X!     tmp2 = (IS_DOOR(levl[x][y+1].typ) || levl[x][y+1].typ == SDOOR ||
  197. X!         IS_DOOR(levl[x][y-1].typ) || levl[x][y-1].typ == SDOOR);
  198. X!     return(tmp1 || tmp2);
  199. X  }
  200. X  
  201. X  /* see whether it is allowable to create a door at [x,y] */
  202. X--- 1008,1032 ----
  203. X  bydoor(x, y)
  204. X  register xchar x, y;
  205. X  {
  206. X!     register int typ;
  207. X  
  208. X!     if (isok(x+1, y)) {
  209. X!         typ = levl[x+1][y].typ;
  210. X!         if (IS_DOOR(typ) || typ == SDOOR) return TRUE;
  211. X!     }
  212. X!     if (isok(x-1, y)) {
  213. X!         typ = levl[x-1][y].typ;
  214. X!         if (IS_DOOR(typ) || typ == SDOOR) return TRUE;
  215. X!     }
  216. X!     if (isok(x, y+1)) {
  217. X!         typ = levl[x][y+1].typ;
  218. X!         if (IS_DOOR(typ) || typ == SDOOR) return TRUE;
  219. X!     }
  220. X!     if (isok(x, y-1)) {
  221. X!         typ = levl[x][y-1].typ;
  222. X!         if (IS_DOOR(typ) || typ == SDOOR) return TRUE;
  223. X!     }
  224. X!     return FALSE;
  225. X  }
  226. X  
  227. X  /* see whether it is allowable to create a door at [x,y] */
  228. X***************
  229. X*** 1088,1106 ****
  230. X          kind = rnd(TRAPNUM-1);
  231. X          /* reject "too hard" traps */
  232. X          switch (kind) {
  233. X              case LEVEL_TELEP:
  234. X!             case LANDMINE:
  235. X!             if (lvl < 5) kind = NO_TRAP; break;
  236. X              case SPIKED_PIT:
  237. X! #ifdef POLYSELF
  238. X!             case POLY_TRAP:
  239. X! #endif
  240. X              if (lvl < 6) kind = NO_TRAP; break;
  241. X              case WEB:
  242. X-             case STATUE_TRAP:
  243. X              if (lvl < 7) kind = NO_TRAP; break;
  244. X              case FIRE_TRAP:
  245. X              if (!Inhell) kind = NO_TRAP; break;
  246. X          }
  247. X          } while (kind == NO_TRAP || kind == MAGIC_PORTAL);
  248. X      }
  249. X--- 1108,1133 ----
  250. X          kind = rnd(TRAPNUM-1);
  251. X          /* reject "too hard" traps */
  252. X          switch (kind) {
  253. X+             case SLP_GAS_TRAP:
  254. X+             if (lvl < 2) kind = NO_TRAP; break;
  255. X              case LEVEL_TELEP:
  256. X!             if (lvl < 5 || level.flags.noteleport)
  257. X!                 kind = NO_TRAP; break;
  258. X              case SPIKED_PIT:
  259. X!             if (lvl < 5) kind = NO_TRAP; break;
  260. X!             case LANDMINE:
  261. X              if (lvl < 6) kind = NO_TRAP; break;
  262. X              case WEB:
  263. X              if (lvl < 7) kind = NO_TRAP; break;
  264. X+             case STATUE_TRAP:
  265. X+ #ifdef POLYSELF
  266. X+             case POLY_TRAP:
  267. X+ #endif
  268. X+             if (lvl < 8) kind = NO_TRAP; break;
  269. X              case FIRE_TRAP:
  270. X              if (!Inhell) kind = NO_TRAP; break;
  271. X+             case TELEP_TRAP:
  272. X+             if (level.flags.noteleport) kind = NO_TRAP; break;
  273. X          }
  274. X          } while (kind == NO_TRAP || kind == MAGIC_PORTAL);
  275. X      }
  276. X***************
  277. X*** 1250,1256 ****
  278. X      register xchar i;
  279. X  
  280. X      pline("The floor shakes violently under you!");
  281. X!     pline("The walls around you begin to move and fall down!");
  282. X      display_nhwindow(WIN_MESSAGE, TRUE);
  283. X  
  284. X      for(dist = 1; dist < 7; dist++) {
  285. X--- 1277,1283 ----
  286. X      register xchar i;
  287. X  
  288. X      pline("The floor shakes violently under you!");
  289. X!     pline("The walls around you begin to bend and crumble!");
  290. X      display_nhwindow(WIN_MESSAGE, TRUE);
  291. X  
  292. X      for(dist = 1; dist < 7; dist++) {
  293. X***************
  294. X*** 1310,1316 ****
  295. X      lev->typ = ROOM;
  296. X      if (is_pool(x,y)) break;
  297. X      ttmp = maketrap(x, y, FIRE_TRAP);
  298. X!     ttmp->tseen = TRUE;
  299. X      break;
  300. X      case 2: /* lit room locations */
  301. X      case 3:
  302. X--- 1337,1343 ----
  303. X      lev->typ = ROOM;
  304. X      if (is_pool(x,y)) break;
  305. X      ttmp = maketrap(x, y, FIRE_TRAP);
  306. X!     if (ttmp) ttmp->tseen = TRUE;
  307. X      break;
  308. X      case 2: /* lit room locations */
  309. X      case 3:
  310. X*** /tmp/da11114    Tue Jun  1 16:14:23 1993
  311. X--- src/mkmaze.c    Wed May 26 13:03:15 1993
  312. X***************
  313. X*** 1,4 ****
  314. X! /*    SCCS Id: @(#)mkmaze.c    3.1    93/01/17    */
  315. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  316. X  /* NetHack may be freely redistributed.  See license for details. */
  317. X  
  318. X--- 1,4 ----
  319. X! /*    SCCS Id: @(#)mkmaze.c    3.1    93/05/23    */
  320. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  321. X  /* NetHack may be freely redistributed.  See license for details. */
  322. X  
  323. X***************
  324. X*** 339,344 ****
  325. X--- 339,347 ----
  326. X      } else if(Is_knox(&u.uz)) {
  327. X      /* using an unfilled morgue for rm id */
  328. X      croom = search_special(MORGUE);
  329. X+     /* avoid inappropriate morgue-related messages */
  330. X+     level.flags.graveyard = level.flags.has_morgue = FALSE;
  331. X+     croom->rtype = OROOM;    /* perhaps it should be set to VAULT? */
  332. X      /* stock the main vault */
  333. X      for(x = croom->lx; x <= croom->hx; x++)
  334. X          for(y = croom->ly; y <= croom->hy; y++) {
  335. X***************
  336. X*** 724,729 ****
  337. X--- 727,736 ----
  338. X      /* portal in the destination dungeon/dlevel */
  339. X      register struct trap *ttmp = maketrap(x, y, MAGIC_PORTAL);
  340. X  
  341. X+     if (!ttmp) {
  342. X+         impossible("portal on top of portal??");
  343. X+         return;
  344. X+     }
  345. X  #ifdef DEBUG
  346. X      pline("mkportal: at (%d,%d), to %s, level %d",
  347. X          x, y, dungeons[todnum].dname, todlevel);
  348. X***************
  349. X*** 893,910 ****
  350. X      vision_full_recalc = 1;
  351. X  }
  352. X  
  353. X  void
  354. X  water_friction()
  355. X  {
  356. X      register boolean eff = FALSE;
  357. X  
  358. X!     if (u.dx && !rn2(3)) {
  359. X!         eff = TRUE;
  360. X          u.dx = 0;
  361. X!     }
  362. X!     if (u.dy && !rn2(3)) {
  363. X          eff = TRUE;
  364. X          u.dy = 0;
  365. X      }
  366. X      if (eff) pline("Water turbulence affects your movements.");
  367. X  }
  368. X--- 900,937 ----
  369. X      vision_full_recalc = 1;
  370. X  }
  371. X  
  372. X+ /* when moving in water, possibly (1 in 3) alter the intended destination */
  373. X  void
  374. X  water_friction()
  375. X  {
  376. X+     register int x, y, dx, dy;
  377. X      register boolean eff = FALSE;
  378. X  
  379. X! #ifdef POLYSELF
  380. X!     if (is_swimmer(uasmon) && rn2(4))
  381. X!         return;        /* natural swimmers have advantage */
  382. X! #endif
  383. X! 
  384. X!     if (u.dx && !rn2(!u.dy ? 3 : 6)) {    /* 1/3 chance or half that */
  385. X!         /* cancel delta x and choose an arbitrary delta y value */
  386. X!         x = u.ux;
  387. X!         do {
  388. X!             dy = rn2(3) - 1;        /* -1, 0, 1 */
  389. X!             y = u.uy + dy;
  390. X!         } while (dy && (!isok(x,y) || !is_pool(x,y)));
  391. X          u.dx = 0;
  392. X!         u.dy = dy;
  393. X          eff = TRUE;
  394. X+     } else if (u.dy && !rn2(!u.dx ? 3 : 5)) {    /* 1/3 or 1/5*(5/6) */
  395. X+         /* cancel delta y and choose an arbitrary delta x value */
  396. X+         y = u.uy;
  397. X+         do {
  398. X+             dx = rn2(3) - 1;        /* -1 .. 1 */
  399. X+             x = u.ux + dx;
  400. X+         } while (dx && (!isok(x,y) || !is_pool(x,y)));
  401. X          u.dy = 0;
  402. X+         u.dx = dx;
  403. X+         eff = TRUE;
  404. X      }
  405. X      if (eff) pline("Water turbulence affects your movements.");
  406. X  }
  407. X***************
  408. X*** 1209,1214 ****
  409. X          }
  410. X      }
  411. X  }
  412. X- 
  413. X  
  414. X  /*mkmaze.c*/
  415. X--- 1236,1240 ----
  416. X*** /tmp/da11122    Tue Jun  1 16:14:26 1993
  417. X--- src/mkobj.c    Mon May  3 13:20:27 1993
  418. X***************
  419. X*** 1,4 ****
  420. X! /*    SCCS Id: @(#)mkobj.c    3.1    93/02/10    */
  421. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  422. X  /* NetHack may be freely redistributed.  See license for details. */
  423. X  
  424. X--- 1,4 ----
  425. X! /*    SCCS Id: @(#)mkobj.c    3.1    93/05/01    */
  426. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  427. X  /* NetHack may be freely redistributed.  See license for details. */
  428. X  
  429. X***************
  430. X*** 66,73 ****
  431. X  { 4, AMULET_CLASS}
  432. X  };
  433. X  
  434. X- static NEARDATA int mksx=0, mksy=0;
  435. X- 
  436. X  struct obj *
  437. X  mkobj_at(let,x,y, artif)
  438. X  char let;
  439. X--- 66,71 ----
  440. X***************
  441. X*** 76,91 ****
  442. X  {
  443. X      register struct obj *otmp;
  444. X  
  445. X-     mksx = x; mksy = y;
  446. X-     /* We need to know the X, Y coordinates while creating the object,
  447. X-      * to insure shop boxes are empty.
  448. X-      * Yes, this is a horrible kludge...
  449. X-      */
  450. X      otmp = mkobj(let,artif);
  451. X      otmp->nobj = fobj;
  452. X      fobj = otmp;
  453. X      place_object(otmp, x, y);
  454. X-     mksx = mksy = 0;
  455. X      return(otmp);
  456. X  }
  457. X  
  458. X--- 74,83 ----
  459. X***************
  460. X*** 96,107 ****
  461. X  {
  462. X      register struct obj *otmp;
  463. X  
  464. X-     mksx = x; mksy = y;
  465. X      otmp = mksobj(otyp,init,TRUE);
  466. X      otmp->nobj = fobj;
  467. X      place_object(otmp, x, y);
  468. X!     mksx = mksy = 0;
  469. X!     return((fobj = otmp));
  470. X  }
  471. X  
  472. X  struct obj *
  473. X--- 88,98 ----
  474. X  {
  475. X      register struct obj *otmp;
  476. X  
  477. X      otmp = mksobj(otyp,init,TRUE);
  478. X      otmp->nobj = fobj;
  479. X+     fobj = otmp;
  480. X      place_object(otmp, x, y);
  481. X!     return(otmp);
  482. X  }
  483. X  
  484. X  struct obj *
  485. X***************
  486. X*** 599,604 ****
  487. X--- 590,597 ----
  488. X          return (int)obj->quan * mons[obj->corpsenm].cwt;
  489. X      else if (obj->otyp == GOLD_PIECE)
  490. X          return (int)((obj->quan + 50L) / 100L);
  491. X+     else if (obj->otyp == HEAVY_IRON_BALL && obj->owt != 0)
  492. X+         return obj->owt;    /* kludge for "very" heavy iron ball */
  493. X      return(wt ? wt*(int)obj->quan : ((int)obj->quan + 1)>>1);
  494. X  }
  495. X  
  496. X*** /tmp/da10930    Tue Jun  1 16:13:22 1993
  497. X--- src/dothrow.c    Wed May 19 10:08:19 1993
  498. X***************
  499. X*** 1,4 ****
  500. X! /*    SCCS Id: @(#)dothrow.c    3.1    92/12/10    */
  501. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  502. X  /* NetHack may be freely redistributed.  See license for details. */
  503. X  
  504. X--- 1,4 ----
  505. X! /*    SCCS Id: @(#)dothrow.c    3.1    93/05/15    */
  506. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  507. X  /* NetHack may be freely redistributed.  See license for details. */
  508. X  
  509. X***************
  510. X*** 84,93 ****
  511. X      }
  512. X      if (IS_ALTAR(levl[u.ux][u.uy].typ)) doaltarobj(obj);
  513. X      else
  514. X!         pline("%s hits the floor.", Doname2(obj));
  515. X      if (breaks(obj, TRUE)) return;
  516. X      else if(obj->oclass == POTION_CLASS) {
  517. X!         pline("The flask breaks, and you smell a peculiar odor...");
  518. X          potionbreathe(obj);
  519. X          if(*u.ushops)
  520. X              check_shop_obj(obj, u.ux, u.uy, TRUE);
  521. X--- 84,95 ----
  522. X      }
  523. X      if (IS_ALTAR(levl[u.ux][u.uy].typ)) doaltarobj(obj);
  524. X      else
  525. X!         pline("%s hit%s the %s.", Doname2(obj), 
  526. X!               (obj->quan == 1L) ? "s" : "", surface(u.ux,u.uy));
  527. X      if (breaks(obj, TRUE)) return;
  528. X      else if(obj->oclass == POTION_CLASS) {
  529. X!         pline("The flask%s break%s, and you smell a peculiar odor...",
  530. X!               plur(obj->quan), (obj->quan == 1L) ? "s" : "");
  531. X          potionbreathe(obj);
  532. X          if(*u.ushops)
  533. X              check_shop_obj(obj, u.ux, u.uy, TRUE);
  534. X***************
  535. X*** 129,141 ****
  536. X         (IS_DOOR(levl[nx][ny].typ) && (levl[nx][ny].doormask & D_ISOPEN))) {
  537. X          pline("Ouch!");
  538. X          losehp(rnd(2+range), IS_ROCK(levl[nx][ny].typ) ?
  539. X!            "bumping to a wall" : "bumping into a door", KILLED_BY);
  540. X          break;
  541. X      }
  542. X  
  543. X!     if (obj = sobj_at(BOULDER,nx,ny)) {
  544. X          You("bump into a %s.  Ouch!", xname(obj));
  545. X!         losehp(rnd(2+range), "bumping to a boulder", KILLED_BY);
  546. X          break;
  547. X      }
  548. X  
  549. X--- 131,143 ----
  550. X         (IS_DOOR(levl[nx][ny].typ) && (levl[nx][ny].doormask & D_ISOPEN))) {
  551. X          pline("Ouch!");
  552. X          losehp(rnd(2+range), IS_ROCK(levl[nx][ny].typ) ?
  553. X!            "bumping into a wall" : "bumping into a door", KILLED_BY);
  554. X          break;
  555. X      }
  556. X  
  557. X!     if ((obj = sobj_at(BOULDER,nx,ny)) != 0) {
  558. X          You("bump into a %s.  Ouch!", xname(obj));
  559. X!         losehp(rnd(2+range), "bumping into a boulder", KILLED_BY);
  560. X          break;
  561. X      }
  562. X  
  563. X***************
  564. X*** 142,148 ****
  565. X      u.ux = nx;
  566. X      u.uy = ny;
  567. X      newsym(u.ux - dx, u.uy - dy);
  568. X!     if(mon = m_at(u.ux, u.uy)) {
  569. X          You("bump into %s.", a_monnam(mon));
  570. X          wakeup(mon);
  571. X          if(Is_airlevel(&u.uz))
  572. X--- 144,150 ----
  573. X      u.ux = nx;
  574. X      u.uy = ny;
  575. X      newsym(u.ux - dx, u.uy - dy);
  576. X!     if ((mon = m_at(u.ux, u.uy)) != 0) {
  577. X          You("bump into %s.", a_monnam(mon));
  578. X          wakeup(mon);
  579. X          if(Is_airlevel(&u.uz))
  580. X***************
  581. X*** 245,250 ****
  582. X--- 247,253 ----
  583. X            pline("%s hits the ceiling and returns to your hand!",
  584. X              The(xname(obj)));
  585. X            obj = addinv(obj);
  586. X+           (void) encumber_msg();
  587. X            setuwep(obj);
  588. X            return(1);
  589. X        }
  590. X***************
  591. X*** 297,302 ****
  592. X--- 300,306 ----
  593. X          if(mon == &youmonst) {        /* the thing was caught */
  594. X              exercise(A_DEX, TRUE);
  595. X              (void) addinv(obj);
  596. X+             (void) encumber_msg();
  597. X              return(1);
  598. X          }
  599. X      } else {
  600. X***************
  601. X*** 365,371 ****
  602. X          int obj_glyph = obj_to_glyph(obj);
  603. X          boolean gone = FALSE;
  604. X  
  605. X!         if (obj->oartifact == ART_MJOLLNIR && pl_character[0] == 'V') {
  606. X              /* we must be wearing Gauntlets of Power to get here */
  607. X  
  608. X              /* might already be our location (bounced off a wall) */
  609. X--- 369,376 ----
  610. X          int obj_glyph = obj_to_glyph(obj);
  611. X          boolean gone = FALSE;
  612. X  
  613. X!         if (obj->oartifact == ART_MJOLLNIR &&
  614. X!             pl_character[0] == 'V' && rn2(100)) {
  615. X              /* we must be wearing Gauntlets of Power to get here */
  616. X  
  617. X              /* might already be our location (bounced off a wall) */
  618. X***************
  619. X*** 381,389 ****
  620. X              tmp_at(DISP_END, 0);
  621. X              }
  622. X  
  623. X!             if(!impaired) {
  624. X              pline("%s returns to your hand!", The(xname(obj)));
  625. X              obj = addinv(obj);
  626. X              setuwep(obj);
  627. X              if(cansee(bhitpos.x, bhitpos.y))
  628. X                  newsym(bhitpos.x,bhitpos.y);
  629. X--- 386,395 ----
  630. X              tmp_at(DISP_END, 0);
  631. X              }
  632. X  
  633. X!             if (!impaired && rn2(100)) {
  634. X              pline("%s returns to your hand!", The(xname(obj)));
  635. X              obj = addinv(obj);
  636. X+             (void) encumber_msg();
  637. X              setuwep(obj);
  638. X              if(cansee(bhitpos.x, bhitpos.y))
  639. X                  newsym(bhitpos.x,bhitpos.y);
  640. X***************
  641. X*** 492,497 ****
  642. X--- 498,520 ----
  643. X      /* it's easier to hit a larger target */
  644. X      if(bigmonst(mon->data)) tmp++;
  645. X  
  646. X+     /* gloves are a hinderance to proper use of bows */
  647. X+     if (uarmg && uwep && -objects[uwep->otyp].w_propellor == WP_BOW) {
  648. X+         switch(uarmg->otyp) {
  649. X+             case GAUNTLETS_OF_POWER:    /* metal */
  650. X+                 tmp -= 2;
  651. X+                 break;
  652. X+             case GAUNTLETS_OF_FUMBLING:
  653. X+                 tmp -= 3;
  654. X+                 break;
  655. X+             case LEATHER_GLOVES:
  656. X+             case GAUNTLETS_OF_DEXTERITY:
  657. X+                 break;
  658. X+             default: impossible("Unknown type of gloves (%d)",
  659. X+                 uarmg->otyp);
  660. X+         }
  661. X+     }
  662. X+ 
  663. X      if(mon->msleep) {
  664. X          mon->msleep = 0;
  665. X          tmp += 2;
  666. X***************
  667. X*** 709,723 ****
  668. X                  check_shop_obj(obj, obj->ox, obj->oy, TRUE);
  669. X          obfree(obj, (struct obj *)0);
  670. X      } else {
  671. X!             /* it is assumed that the obj is a floor-object */ 
  672. X!             register struct monst *shkp;
  673. X!             boolean costly, insider;
  674. X          long loss = 0L;
  675. X  
  676. X- #ifdef GCC_WARN
  677. X-         shkp = (struct monst *) 0;
  678. X- #endif
  679. X- 
  680. X          costly = (costly_spot(obj->ox, obj->oy) && 
  681. X                     (shkp = shop_keeper(*in_rooms(obj->ox,
  682. X                    obj->oy, SHOPBASE))) != (struct monst *)0);
  683. X--- 732,742 ----
  684. X                  check_shop_obj(obj, obj->ox, obj->oy, TRUE);
  685. X          obfree(obj, (struct obj *)0);
  686. X      } else {
  687. X!         /* it is assumed that the obj is a floor-object */ 
  688. X!         register struct monst *shkp = 0;
  689. X!         boolean costly, insider;
  690. X          long loss = 0L;
  691. X  
  692. X          costly = (costly_spot(obj->ox, obj->oy) && 
  693. X                     (shkp = shop_keeper(*in_rooms(obj->ox,
  694. X                    obj->oy, SHOPBASE))) != (struct monst *)0);
  695. X***************
  696. X*** 763,773 ****
  697. X              if(uarmh) pline("Fortunately, you are wearing a helmet!");
  698. X          }
  699. X          if(flooreffects(obj,u.ux,u.uy,"fall")) return(1);
  700. X!         if(u.dz > 0) pline("The gold hits the floor.");
  701. X          obj->nobj = fobj;    /* add the gold to the object list */
  702. X          fobj = obj;
  703. X          place_object(obj,u.ux,u.uy);
  704. X!                 if(*u.ushops) sellobj(obj, u.ux, u.uy);
  705. X          stackobj(obj);
  706. X          newsym(u.ux,u.uy);
  707. X          return 1;
  708. X--- 782,792 ----
  709. X              if(uarmh) pline("Fortunately, you are wearing a helmet!");
  710. X          }
  711. X          if(flooreffects(obj,u.ux,u.uy,"fall")) return(1);
  712. X!         if(u.dz > 0) pline("The gold hits the %s.", surface(u.ux,u.uy));
  713. X          obj->nobj = fobj;    /* add the gold to the object list */
  714. X          fobj = obj;
  715. X          place_object(obj,u.ux,u.uy);
  716. X!         if(*u.ushops) sellobj(obj, u.ux, u.uy);
  717. X          stackobj(obj);
  718. X          newsym(u.ux,u.uy);
  719. X          return 1;
  720. X***************
  721. X*** 798,804 ****
  722. X      obj->nobj = fobj;    /* add the gold to the object list */
  723. X      fobj = obj;
  724. X      place_object(obj,bhitpos.x,bhitpos.y);
  725. X!         if(*u.ushops) sellobj(obj, bhitpos.x, bhitpos.y);
  726. X      stackobj(obj);
  727. X      newsym(bhitpos.x,bhitpos.y);
  728. X      return(1);
  729. X--- 817,823 ----
  730. X      obj->nobj = fobj;    /* add the gold to the object list */
  731. X      fobj = obj;
  732. X      place_object(obj,bhitpos.x,bhitpos.y);
  733. X!     if(*u.ushops) sellobj(obj, bhitpos.x, bhitpos.y);
  734. X      stackobj(obj);
  735. X      newsym(bhitpos.x,bhitpos.y);
  736. X      return(1);
  737. X*** /tmp/da13396    Tue Jun  1 17:54:06 1993
  738. X--- win/tty/getline.c    Wed Mar 10 20:39:07 1993
  739. X***************
  740. X*** 3,8 ****
  741. X--- 3,11 ----
  742. X  /* NetHack may be freely redistributed.  See license for details. */
  743. X  
  744. X  #include "hack.h"
  745. X+ 
  746. X+ #ifdef TTY_GRAPHICS
  747. X+ 
  748. X  #include "wintty.h"
  749. X  #include "func_tab.h"
  750. X  
  751. X***************
  752. X*** 219,223 ****
  753. X--- 222,228 ----
  754. X  #endif /* COM_COMPL */
  755. X  
  756. X  #endif /* OVL2 */
  757. X+ 
  758. X+ #endif /* TTY_GRAPHICS */
  759. X  
  760. X  /*getline.c*/
  761. X*** /tmp/da13404    Tue Jun  1 17:54:08 1993
  762. X--- win/tty/termcap.c    Wed May 26 14:12:28 1993
  763. X***************
  764. X*** 3,8 ****
  765. X--- 3,11 ----
  766. X  /* NetHack may be freely redistributed.  See license for details. */
  767. X  
  768. X  #include "hack.h"
  769. X+ 
  770. X+ #if defined (TTY_GRAPHICS) && !defined(NO_TERMS)
  771. X+ 
  772. X  #include "wintty.h"
  773. X  
  774. X  #include "termcap.h"
  775. X***************
  776. X*** 14,30 ****
  777. X  #define Tgetstr(key) (tgetstr(key,&tbufptr))
  778. X  #endif /* MICROPORT_286_BUG **/
  779. X  
  780. X  void FDECL(cmov, (int, int));
  781. X  void FDECL(nocmov, (int, int));
  782. X! #ifdef TEXTCOLOR
  783. X! # ifdef TERMLIB
  784. X! #  ifdef OVLB
  785. X  #   ifndef TOS
  786. X  static void FDECL(analyze_seq, (char *, int *, int *));
  787. X  #   endif
  788. X  static void NDECL(init_hilite);
  789. X! #  endif /* OVLB */
  790. X! # endif
  791. X  #endif
  792. X  
  793. X  #ifdef OVLB
  794. X--- 17,36 ----
  795. X  #define Tgetstr(key) (tgetstr(key,&tbufptr))
  796. X  #endif /* MICROPORT_286_BUG **/
  797. X  
  798. X+ static char * FDECL(s_atr2str, (int));
  799. X+ static char * FDECL(e_atr2str, (int));
  800. X+ 
  801. X  void FDECL(cmov, (int, int));
  802. X  void FDECL(nocmov, (int, int));
  803. X! #if defined(TEXTCOLOR) && defined(TERMLIB)
  804. X! # ifdef OVLB
  805. X! #  if !defined(UNIX) || !defined(TERMINFO)
  806. X  #   ifndef TOS
  807. X  static void FDECL(analyze_seq, (char *, int *, int *));
  808. X  #   endif
  809. X+ #  endif
  810. X  static void NDECL(init_hilite);
  811. X! # endif /* OVLB */
  812. X  #endif
  813. X  
  814. X  #ifdef OVLB
  815. X***************
  816. X*** 78,113 ****
  817. X  
  818. X  void
  819. X  tty_startup(wid, hgt)
  820. X!     int *wid, *hgt;
  821. X  {
  822. X  #ifdef TERMLIB
  823. X      register const char *term;
  824. X      register char *tptr;
  825. X      char *tbufptr, *pc;
  826. X- #endif
  827. X-     register int i;
  828. X  
  829. X- #ifdef TERMLIB
  830. X  # ifdef VMS
  831. X!     if (!(term = verify_termcap()))
  832. X  # endif
  833. X!     term = getenv("TERM");
  834. X! #endif
  835. X  
  836. X! #ifdef TERMLIB
  837. X!     if(!term)
  838. X! #endif
  839. X! #if defined(TOS) && defined(__GNUC__) && defined(TERMLIB)
  840. X          term = "builtin";        /* library has a default */
  841. X  #else
  842. X! #  ifdef ANSI_DEFAULT
  843. X! #   ifdef TOS
  844. X      {
  845. X          CO = 80; LI = 25;
  846. X          TI = VS = VE = TE = nullstr;
  847. X          HO = "\033H";
  848. X!         CL = "\033E";        /* the VT52 termcap */
  849. X!         CE = "\033K";
  850. X          UP = "\033A";
  851. X          CM = "\033Y%c%c";    /* used with function tgoto() */
  852. X          ND = "\033C";
  853. X--- 84,118 ----
  854. X  
  855. X  void
  856. X  tty_startup(wid, hgt)
  857. X! int *wid, *hgt;
  858. X  {
  859. X+     register int i;
  860. X  #ifdef TERMLIB
  861. X      register const char *term;
  862. X      register char *tptr;
  863. X      char *tbufptr, *pc;
  864. X  
  865. X  # ifdef VMS
  866. X!     term = verify_termcap();
  867. X!     if (!term)
  868. X  # endif
  869. X!         term = getenv("TERM");
  870. X  
  871. X! # if defined(TOS) && defined(__GNUC__)
  872. X!     if (!term)
  873. X          term = "builtin";        /* library has a default */
  874. X+ # endif
  875. X+     if (!term)
  876. X+ #endif
  877. X+ #ifndef ANSI_DEFAULT
  878. X+         error("Can't get TERM.");
  879. X  #else
  880. X! # ifdef TOS
  881. X      {
  882. X          CO = 80; LI = 25;
  883. X          TI = VS = VE = TE = nullstr;
  884. X          HO = "\033H";
  885. X!         CE = "\033K";        /* the VT52 termcap */
  886. X          UP = "\033A";
  887. X          CM = "\033Y%c%c";    /* used with function tgoto() */
  888. X          ND = "\033C";
  889. X***************
  890. X*** 118,190 ****
  891. X      /* HI and HE will be updated in init_hilite if we're using color */
  892. X          HI = "\033p";
  893. X          HE = "\033q";
  894. X      }
  895. X! #   else /* TOS */
  896. X      {
  897. X! #    ifdef MICRO
  898. X          get_scr_size();
  899. X! #     ifdef CLIPPING
  900. X          if(CO < COLNO || LI < ROWNO+3)
  901. X              setclipped();
  902. X! #     endif
  903. X! #    endif
  904. X          HO = "\033[H";
  905. X-         CL = "\033[2J";        /* the ANSI termcap */
  906. X  /*        CD = "\033[J"; */
  907. X!         CE = "\033[K";
  908. X! #    ifndef TERMLIB
  909. X          CM = "\033[%d;%dH";
  910. X! #    else
  911. X          CM = "\033[%i%d;%dH";
  912. X! #    endif
  913. X          UP = "\033[A";
  914. X          ND = "\033[C";
  915. X          XD = "\033[B";
  916. X! #    ifdef MICRO    /* backspaces are non-destructive */
  917. X          BC = "\b";
  918. X! #    else
  919. X          BC = "\033[D";
  920. X! #    endif
  921. X          HI = SO = "\033[1m";
  922. X          US = "\033[4m";
  923. X! #    if 0
  924. X          MR = "\033[7m";
  925. X          ME = "\033[0m";
  926. X! #    endif
  927. X          TI = HE = SE = UE = "\033[0m";
  928. X          /* strictly, SE should be 2, and UE should be 24,
  929. X             but we can't trust all ANSI emulators to be
  930. X             that complete.  -3. */
  931. X! #    ifndef MICRO
  932. X          AS = "\016";
  933. X          AE = "\017";
  934. X! #    endif
  935. X          TE = VS = VE = nullstr;
  936. X! #    ifdef TEXTCOLOR
  937. X          for (i = 0; i < MAXCOLORS / 2; i++)
  938. X              if (i != BLACK) {
  939. X              hilites[i|BRIGHT] = (char *) alloc(sizeof("\033[1;3%dm"));
  940. X              Sprintf(hilites[i|BRIGHT], "\033[1;3%dm", i);
  941. X              if (i != GRAY)
  942. X! #     ifdef MICRO
  943. X                  if (i == BLUE) hilites[BLUE] = hilites[BLUE|BRIGHT];
  944. X                  else
  945. X! #     endif
  946. X                  {
  947. X                  hilites[i] = (char *) alloc(sizeof("\033[0;3%dm"));
  948. X                  Sprintf(hilites[i], "\033[0;3%dm", i);
  949. X                  }
  950. X              }
  951. X! #    endif
  952. X          *wid = CO;
  953. X          *hgt = LI;
  954. X          return;
  955. X      }
  956. X! #   endif /* TOS */
  957. X! #  else
  958. X!         error("Can't get TERM.");
  959. X! #  endif /* ANSI_DEFAULT */
  960. X! #endif /* __GNUC__ && TOS && TERMCAP */
  961. X  #ifdef TERMLIB
  962. X      tptr = (char *) alloc(1024);
  963. X  
  964. X--- 123,197 ----
  965. X      /* HI and HE will be updated in init_hilite if we're using color */
  966. X          HI = "\033p";
  967. X          HE = "\033q";
  968. X+         *wid = CO;
  969. X+         *hgt = LI;
  970. X+         CL = "\033E";        /* last thing set */
  971. X+         return;
  972. X      }
  973. X! # else /* TOS */
  974. X      {
  975. X! #  ifdef MICRO
  976. X          get_scr_size();
  977. X! #   ifdef CLIPPING
  978. X          if(CO < COLNO || LI < ROWNO+3)
  979. X              setclipped();
  980. X! #   endif
  981. X! #  endif
  982. X          HO = "\033[H";
  983. X  /*        CD = "\033[J"; */
  984. X!         CE = "\033[K";        /* the ANSI termcap */
  985. X! #  ifndef TERMLIB
  986. X          CM = "\033[%d;%dH";
  987. X! #  else
  988. X          CM = "\033[%i%d;%dH";
  989. X! #  endif
  990. X          UP = "\033[A";
  991. X          ND = "\033[C";
  992. X          XD = "\033[B";
  993. X! #  ifdef MICRO    /* backspaces are non-destructive */
  994. X          BC = "\b";
  995. X! #  else
  996. X          BC = "\033[D";
  997. X! #  endif
  998. X          HI = SO = "\033[1m";
  999. X          US = "\033[4m";
  1000. X! #  if 0
  1001. X          MR = "\033[7m";
  1002. X          ME = "\033[0m";
  1003. X! #  endif
  1004. X          TI = HE = SE = UE = "\033[0m";
  1005. X          /* strictly, SE should be 2, and UE should be 24,
  1006. X             but we can't trust all ANSI emulators to be
  1007. X             that complete.  -3. */
  1008. X! #  ifndef MICRO
  1009. X          AS = "\016";
  1010. X          AE = "\017";
  1011. X! #  endif
  1012. X          TE = VS = VE = nullstr;
  1013. X! #  ifdef TEXTCOLOR
  1014. X          for (i = 0; i < MAXCOLORS / 2; i++)
  1015. X              if (i != BLACK) {
  1016. X              hilites[i|BRIGHT] = (char *) alloc(sizeof("\033[1;3%dm"));
  1017. X              Sprintf(hilites[i|BRIGHT], "\033[1;3%dm", i);
  1018. X              if (i != GRAY)
  1019. X! #   ifdef MICRO
  1020. X                  if (i == BLUE) hilites[BLUE] = hilites[BLUE|BRIGHT];
  1021. X                  else
  1022. X! #   endif
  1023. X                  {
  1024. X                  hilites[i] = (char *) alloc(sizeof("\033[0;3%dm"));
  1025. X                  Sprintf(hilites[i], "\033[0;3%dm", i);
  1026. X                  }
  1027. X              }
  1028. X! #  endif
  1029. X          *wid = CO;
  1030. X          *hgt = LI;
  1031. X+         CL = "\033[2J";        /* last thing set */
  1032. X          return;
  1033. X      }
  1034. X! # endif /* TOS */
  1035. X! #endif /* ANSI_DEFAULT */
  1036. X! 
  1037. X  #ifdef TERMLIB
  1038. X      tptr = (char *) alloc(1024);
  1039. X  
  1040. X***************
  1041. X*** 201,207 ****
  1042. X          error("Terminal must backspace.");
  1043. X  # else
  1044. X          if(!(BC = Tgetstr("bc"))) {    /* termcap also uses bc/bs */
  1045. X! #  if !defined(MINIMAL_TERM)
  1046. X          if(!tgetflag("bs"))
  1047. X              error("Terminal must backspace.");
  1048. X  #  endif
  1049. X--- 208,214 ----
  1050. X          error("Terminal must backspace.");
  1051. X  # else
  1052. X          if(!(BC = Tgetstr("bc"))) {    /* termcap also uses bc/bs */
  1053. X! #  ifndef MINIMAL_TERM
  1054. X          if(!tgetflag("bs"))
  1055. X              error("Terminal must backspace.");
  1056. X  #  endif
  1057. X***************
  1058. X*** 230,239 ****
  1059. X          get_scr_size();
  1060. X      else {
  1061. X  #  endif
  1062. X!     CO = tgetnum("co");
  1063. X!     LI = tgetnum("li");
  1064. X!     if (!LI || !CO)            /* if we don't override it */
  1065. X!         get_scr_size();
  1066. X  #  if defined(TOS) && defined(__GNUC__)
  1067. X      }
  1068. X  #  endif
  1069. X--- 237,246 ----
  1070. X          get_scr_size();
  1071. X      else {
  1072. X  #  endif
  1073. X!         CO = tgetnum("co");
  1074. X!         LI = tgetnum("li");
  1075. X!         if (!LI || !CO)            /* if we don't override it */
  1076. X!             get_scr_size();
  1077. X  #  if defined(TOS) && defined(__GNUC__)
  1078. X      }
  1079. X  #  endif
  1080. X***************
  1081. X*** 242,252 ****
  1082. X      if(CO < COLNO || LI < ROWNO+3)
  1083. X          setclipped();
  1084. X  # endif
  1085. X-     if(!(CL = Tgetstr("cl")))
  1086. X-         error("Hack needs CL.");
  1087. X      ND = Tgetstr("nd");
  1088. X      if(tgetflag("os"))
  1089. X!         error("Hack can't have OS.");
  1090. X      if(tgetflag("ul"))
  1091. X          ul_hack = TRUE;
  1092. X      CE = Tgetstr("ce");
  1093. X--- 249,257 ----
  1094. X      if(CO < COLNO || LI < ROWNO+3)
  1095. X          setclipped();
  1096. X  # endif
  1097. X      ND = Tgetstr("nd");
  1098. X      if(tgetflag("os"))
  1099. X!         error("NetHack can't have OS.");
  1100. X      if(tgetflag("ul"))
  1101. X          ul_hack = TRUE;
  1102. X      CE = Tgetstr("ce");
  1103. X***************
  1104. X*** 258,267 ****
  1105. X      XD = Tgetstr("xd");
  1106. X  /* not:         XD = Tgetstr("do"); */
  1107. X      if(!(CM = Tgetstr("cm"))) {
  1108. X!         if(!UP && !HO)
  1109. X!             error("Hack needs CM or UP or HO.");
  1110. X!         tty_raw_print("Playing hack on terminals without cm is suspect...");
  1111. X!         tty_wait_synch();
  1112. X      }
  1113. X      SO = Tgetstr("so");
  1114. X      SE = Tgetstr("se");
  1115. X--- 263,272 ----
  1116. X      XD = Tgetstr("xd");
  1117. X  /* not:         XD = Tgetstr("do"); */
  1118. X      if(!(CM = Tgetstr("cm"))) {
  1119. X!         if(!UP && !HO)
  1120. X!         error("NetHack needs CM or UP or HO.");
  1121. X!         tty_raw_print("Playing NetHack on terminals without CM is suspect.");
  1122. X!         tty_wait_synch();
  1123. X      }
  1124. X      SO = Tgetstr("so");
  1125. X      SE = Tgetstr("se");
  1126. X***************
  1127. X*** 304,311 ****
  1128. X  # ifdef TEXTCOLOR
  1129. X      MD = Tgetstr("md");
  1130. X  # endif
  1131. X-     if(tbufptr-tbuf > sizeof(tbuf)) error("TERMCAP entry too big...\n");
  1132. X-     free((genericptr_t)tptr);
  1133. X  # ifdef TEXTCOLOR
  1134. X  #  if defined(TOS) && defined(__GNUC__)
  1135. X      if (!strcmp(term, "builtin") || !strcmp(term, "tw52") ||
  1136. X--- 309,314 ----
  1137. X***************
  1138. X*** 316,324 ****
  1139. X      init_hilite();
  1140. X  #  endif
  1141. X  # endif
  1142. X- #endif /* TERMLIB */
  1143. X      *wid = CO;
  1144. X      *hgt = LI;
  1145. X  }
  1146. X  
  1147. X  void
  1148. X--- 319,331 ----
  1149. X      init_hilite();
  1150. X  #  endif
  1151. X  # endif
  1152. X      *wid = CO;
  1153. X      *hgt = LI;
  1154. X+     if (!(CL = Tgetstr("cl")))    /* last thing set */
  1155. X+         error("NetHack needs CL.");
  1156. X+     if(tbufptr-tbuf > sizeof(tbuf)) error("TERMCAP entry too big...\n");
  1157. X+     free((genericptr_t)tptr);
  1158. X+ #endif /* TERMLIB */
  1159. X  }
  1160. X  
  1161. X  void
  1162. X***************
  1163. X*** 367,381 ****
  1164. X--- 374,428 ----
  1165. X       * Do not select NA ASCII as the primary font since people may
  1166. X       * reasonably be using the UK character set.
  1167. X       */
  1168. X+ #ifdef PC9801
  1169. X+     init_hilite();
  1170. X+ #endif
  1171. X      if (flags.DECgraphics) xputs("\033)0");
  1172. X  }
  1173. X  #endif
  1174. X  
  1175. X+ #if defined(ASCIIGRAPH) && defined(PC9801)
  1176. X+ extern void NDECL((*ibmgraphics_mode_callback));    /* defined in drawing.c */
  1177. X+ #endif
  1178. X+ 
  1179. X+ #ifdef PC9801
  1180. X+ extern void NDECL((*ascgraphics_mode_callback));    /* defined in drawing.c */
  1181. X+ static void NDECL(tty_ascgraphics_hilite_fixup);
  1182. X+ 
  1183. X+ static void
  1184. X+ tty_ascgraphics_hilite_fixup()
  1185. X+ {
  1186. X+     register int c;
  1187. X+ 
  1188. X+     for (c = 0; c < MAXCOLORS / 2; c++)
  1189. X+     if (c != BLACK) {
  1190. X+         hilites[c|BRIGHT] = (char *) alloc(sizeof("\033[1;3%dm"));
  1191. X+         Sprintf(hilites[c]BRIGHT], "\033[1;3%dm", c);
  1192. X+         if (c != GRAY) {
  1193. X+             hilites[c] = (char *) alloc(sizeof("\033[0;3%dm"));
  1194. X+             Sprintf(hilites[c], "\033[0;3%dm", c);
  1195. X+         }
  1196. X+     }
  1197. X+ }
  1198. X+ #endif /* PC9801 */
  1199. X+ 
  1200. X  void
  1201. X  tty_start_screen()
  1202. X  {
  1203. X      xputs(TI);
  1204. X      xputs(VS);
  1205. X+ #ifdef PC9801
  1206. X+     if (!flags.IBMgraphics && !flags.DECgraphics)
  1207. X+         tty_ascgraphics_hilite_fixup();
  1208. X+     /* set up callback in case option is not set yet but toggled later */
  1209. X+     ascgraphics_mode_callback = tty_ascgraphics_hilite_fixup;
  1210. X+ # ifdef ASCIIGRAPH
  1211. X+     if (flags.IBMgraphics) init_hilite();
  1212. X+     /* set up callback in case option is not set yet but toggled later */
  1213. X+     ibmgraphics_mode_callback = init_hilite;
  1214. X+ # endif
  1215. X+ #endif /* PC9801 */
  1216. X+ 
  1217. X  #ifdef TERMLIB
  1218. X      if (flags.DECgraphics) tty_decgraphics_termcap_fixup();
  1219. X      /* set up callback in case option is not set yet but toggled later */
  1220. X***************
  1221. X*** 869,875 ****
  1222. X  #   endif
  1223. X          if (c == foreg)
  1224. X              hilites[c] = NULL;
  1225. X!         else if (c != hi_foreg && backg != hi_backg) {
  1226. X              hilites[c] = (char *) alloc(sizeof("\033[%d;3%d;4%dm"));
  1227. X              Sprintf(hilites[c], "\033[%d", !!(c & BRIGHT));
  1228. X              if ((c | BRIGHT) != (foreg | BRIGHT))
  1229. X--- 916,922 ----
  1230. X  #   endif
  1231. X          if (c == foreg)
  1232. X              hilites[c] = NULL;
  1233. X!         else if (c != hi_foreg || backg != hi_backg) {
  1234. X              hilites[c] = (char *) alloc(sizeof("\033[%d;3%d;4%dm"));
  1235. X              Sprintf(hilites[c], "\033[%d", !!(c & BRIGHT));
  1236. X              if ((c | BRIGHT) != (foreg | BRIGHT))
  1237. X***************
  1238. X*** 889,894 ****
  1239. X--- 936,1037 ----
  1240. X  # endif /* UNIX */
  1241. X  #endif /* TEXTCOLOR */
  1242. X  
  1243. X+ 
  1244. X+ static char nulstr[] = "";
  1245. X+ 
  1246. X+ static char *
  1247. X+ s_atr2str(n)
  1248. X+ int n;
  1249. X+ {
  1250. X+     switch (n) {
  1251. X+         case ATR_ULINE:
  1252. X+             if(US) return US;
  1253. X+         case ATR_BOLD:
  1254. X+         case ATR_BLINK:
  1255. X+         case ATR_INVERSE:
  1256. X+             return HI;
  1257. X+     }
  1258. X+     return nulstr;
  1259. X+ }
  1260. X+ 
  1261. X+ static char *
  1262. X+ e_atr2str(n)
  1263. X+ int n;
  1264. X+ {
  1265. X+     switch (n) {
  1266. X+         case ATR_ULINE:
  1267. X+             if(UE) return UE;
  1268. X+         case ATR_BOLD:
  1269. X+         case ATR_BLINK:
  1270. X+         case ATR_INVERSE:
  1271. X+             return HE;
  1272. X+     }
  1273. X+     return nulstr;
  1274. X+ }
  1275. X+ 
  1276. X+ 
  1277. X+ void
  1278. X+ term_start_attr(attr)
  1279. X+ int attr;
  1280. X+ {
  1281. X+     if (attr) {
  1282. X+         xputs(s_atr2str(attr));
  1283. X+     }
  1284. X+ }
  1285. X+ 
  1286. X+         
  1287. X+ void
  1288. X+ term_end_attr(attr)
  1289. X+ int attr;
  1290. X+ {
  1291. X+     if(attr) {
  1292. X+         xputs(e_atr2str(attr));
  1293. X+     }
  1294. X+ }
  1295. X+ 
  1296. X+ 
  1297. X+ void
  1298. X+ term_start_raw_bold()
  1299. X+ {
  1300. X+     xputs(HI);
  1301. X+ }
  1302. X+ 
  1303. X+ 
  1304. X+ void
  1305. X+ term_end_raw_bold()
  1306. X+ {
  1307. X+     xputs(HE);
  1308. X+ }
  1309. X+ 
  1310. X+ 
  1311. X+ #ifdef TEXTCOLOR
  1312. X+ 
  1313. X+ void
  1314. X+ term_end_color()
  1315. X+ {
  1316. X+     xputs(HE);
  1317. X+ }
  1318. X+ 
  1319. X+ 
  1320. X+ void
  1321. X+ term_start_color(color)
  1322. X+ int color;
  1323. X+ {
  1324. X+     xputs(hilites[color]);
  1325. X+ }
  1326. X+ 
  1327. X+ 
  1328. X+ int
  1329. X+ has_color(color)
  1330. X+ int color;
  1331. X+ {
  1332. X+     return hilites[color] != NULL;
  1333. X+ }
  1334. X+ 
  1335. X+ #endif /* TEXTCOLOR */
  1336. X+ 
  1337. X  #endif /* OVLB */
  1338. X+ 
  1339. X+ #endif /* TTY_GRAPHICS */
  1340. X  
  1341. X  /*termcap.c*/
  1342. X*** /tmp/da14917    Wed Jun  2 08:47:20 1993
  1343. X--- win/tty/topl.c    Wed Jun  2 08:47:04 1993
  1344. X***************
  1345. X*** 1,8 ****
  1346. X! /*    SCCS Id: @(#)topl.c    3.1    90/09/21
  1347. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1348. X  /* NetHack may be freely redistributed.  See license for details. */
  1349. X  
  1350. X  #include "hack.h"
  1351. X  #include "termcap.h"
  1352. X  #include "wintty.h"
  1353. X  #include <ctype.h>
  1354. X--- 1,11 ----
  1355. X! /*    SCCS Id: @(#)topl.c    3.1    93/06/01    */
  1356. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1357. X  /* NetHack may be freely redistributed.  See license for details. */
  1358. X  
  1359. X  #include "hack.h"
  1360. X+ 
  1361. X+ #ifdef TTY_GRAPHICS
  1362. X+ 
  1363. X  #include "termcap.h"
  1364. X  #include "wintty.h"
  1365. X  #include <ctype.h>
  1366. X***************
  1367. X*** 42,48 ****
  1368. X      if(*str & 0x80) {
  1369. X          /* kludge for the / command, the only time we ever want a */
  1370. X          /* graphics character on the top line */
  1371. X!         g_putch(*str++);
  1372. X          ttyDisplay->curx++;
  1373. X      }
  1374. X      end_glyphout();    /* in case message printed during graphics output */
  1375. X--- 45,51 ----
  1376. X      if(*str & 0x80) {
  1377. X          /* kludge for the / command, the only time we ever want a */
  1378. X          /* graphics character on the top line */
  1379. X!         g_putch((int)*str++);
  1380. X          ttyDisplay->curx++;
  1381. X      }
  1382. X      end_glyphout();    /* in case message printed during graphics output */
  1383. X***************
  1384. X*** 196,201 ****
  1385. X--- 199,207 ----
  1386. X      }
  1387. X      cw->curx = ttyDisplay->curx;
  1388. X      if(cw->curx == 0) cl_end();
  1389. X+ #if defined(NO_TERMS) && defined(MSDOS)
  1390. X+     if (c != '\n')
  1391. X+ #endif 
  1392. X      (void) putchar(c);
  1393. X  }
  1394. X  
  1395. X***************
  1396. X*** 339,343 ****
  1397. X--- 345,351 ----
  1398. X  }
  1399. X  
  1400. X  #endif /* OVL2 */
  1401. X+ 
  1402. X+ #endif /* TTY_GRAPHICS */
  1403. X  
  1404. X  /*topl.c*/
  1405. X*** /tmp/da13420    Tue Jun  1 17:54:13 1993
  1406. X--- win/tty/wintty.c    Fri May 28 11:32:20 1993
  1407. X***************
  1408. X*** 1,10 ****
  1409. X! /*    SCCS Id: @(#)wintty.c    3.1    93/02/21    */
  1410. X  /* Copyright (c) David Cohrs, 1991                  */
  1411. X  /* NetHack may be freely redistributed.  See license for details. */
  1412. X  
  1413. X  #include "hack.h"
  1414. X! #include "termcap.h"
  1415. X  #include "wintty.h"
  1416. X  #if (defined(BSD) || defined(ULTRIX) || defined(AIX_31) || defined(_BULL_SOURCE)) && defined(CLIPPING)
  1417. X  #include <signal.h>
  1418. X  #endif
  1419. X--- 1,27 ----
  1420. X! /*    SCCS Id: @(#)wintty.c    3.1    93/05/26    */
  1421. X  /* Copyright (c) David Cohrs, 1991                  */
  1422. X  /* NetHack may be freely redistributed.  See license for details. */
  1423. X  
  1424. X+ /*
  1425. X+  * Neither a standard out nor character-based control codes should be
  1426. X+  * part of the "tty look" windowing implementation.
  1427. X+  * h+ 930227
  1428. X+  */
  1429. X+ 
  1430. X  #include "hack.h"
  1431. X! 
  1432. X! #ifdef TTY_GRAPHICS
  1433. X! 
  1434. X! #ifdef MAC
  1435. X! # define MICRO /* The Mac is a MICRO only for this file, not in general! */
  1436. X! #endif
  1437. X! 
  1438. X! #ifndef NO_TERMS
  1439. X! # include "termcap.h"
  1440. X! #endif
  1441. X! 
  1442. X  #include "wintty.h"
  1443. X+ 
  1444. X  #if (defined(BSD) || defined(ULTRIX) || defined(AIX_31) || defined(_BULL_SOURCE)) && defined(CLIPPING)
  1445. X  #include <signal.h>
  1446. X  #endif
  1447. X***************
  1448. X*** 54,62 ****
  1449. X--- 71,85 ----
  1450. X  #endif /* COM_COMPL */
  1451. X      tty_number_pad,
  1452. X      tty_delay_output,
  1453. X+ #ifdef CHANGE_COLOR    /* the Mac uses a palette device */
  1454. X+     tty_change_color,
  1455. X+     tty_get_color_string,
  1456. X+ #endif
  1457. X+ 
  1458. X      /* other defs that really should go away (they're tty specific) */
  1459. X      tty_start_screen,
  1460. X      tty_end_screen,
  1461. X+     genl_outrip,
  1462. X  };
  1463. X  
  1464. X  static int maxwin = 0;            /* number of windows in use */
  1465. X***************
  1466. X*** 78,95 ****
  1467. X  static int clipx = 0, clipy = 0, clipxmax = 0, clipymax = 0;
  1468. X  #endif
  1469. X  
  1470. X! #ifdef ASCIIGRAPH
  1471. X  boolean GFlag = FALSE;
  1472. X  #endif
  1473. X  
  1474. X  #ifdef MICRO
  1475. X! #define getret() getreturn("to continue")
  1476. X  #else
  1477. X  static void NDECL(getret);
  1478. X  #endif
  1479. X  static void FDECL(dmore,(struct WinDesc *));
  1480. X- static char * FDECL(s_atr2str, (int));
  1481. X- static char * FDECL(e_atr2str, (int));
  1482. X  static const char * FDECL(compress_str, (const char *));
  1483. X  static void FDECL(tty_putsym, (winid, int, int, CHAR_P));
  1484. X  
  1485. X--- 101,117 ----
  1486. X  static int clipx = 0, clipy = 0, clipxmax = 0, clipymax = 0;
  1487. X  #endif
  1488. X  
  1489. X! #if defined(ASCIIGRAPH) && !defined(NO_TERMS)
  1490. X  boolean GFlag = FALSE;
  1491. X  #endif
  1492. X  
  1493. X  #ifdef MICRO
  1494. X! static char to_continue[] = "to continue";
  1495. X! #define getret() getreturn(to_continue)
  1496. X  #else
  1497. X  static void NDECL(getret);
  1498. X  #endif
  1499. X  static void FDECL(dmore,(struct WinDesc *));
  1500. X  static const char * FDECL(compress_str, (const char *));
  1501. X  static void FDECL(tty_putsym, (winid, int, int, CHAR_P));
  1502. X  
  1503. X***************
  1504. X*** 329,338 ****
  1505. X                  ct--;
  1506. X  #ifdef MICRO
  1507. X  # if defined(WIN32CON)
  1508. X!                 nttty_rubout();  /* \b is visible on NT */
  1509. X  # else
  1510. X                  msmsg("\b \b");
  1511. X! # endif 
  1512. X  #else
  1513. X                  (void) putchar('\b');
  1514. X                  (void) putchar(' ');
  1515. X--- 351,360 ----
  1516. X                  ct--;
  1517. X  #ifdef MICRO
  1518. X  # if defined(WIN32CON)
  1519. X!                 backsp();       /* \b is visible on NT */
  1520. X  # else
  1521. X                  msmsg("\b \b");
  1522. X! # endif
  1523. X  #else
  1524. X                  (void) putchar('\b');
  1525. X                  (void) putchar(' ');
  1526. X***************
  1527. X*** 689,701 ****
  1528. X          if(cw->type == NHW_MENU) {
  1529. X              (void) putchar(' '); ++ttyDisplay->curx;
  1530. X          }
  1531. X!         if(attr)
  1532. X!             xputs(s_atr2str(attr));
  1533. X          for(cp = &cw->data[i][1];
  1534. X              *cp && (int)++ttyDisplay->curx < (int) ttyDisplay->cols; )
  1535. X              (void) putchar(*cp++);
  1536. X!         if(attr)
  1537. X!             xputs(e_atr2str(attr));
  1538. X          }
  1539. X      }
  1540. X      if(i == cw->maxrow) {
  1541. X--- 711,725 ----
  1542. X          if(cw->type == NHW_MENU) {
  1543. X              (void) putchar(' '); ++ttyDisplay->curx;
  1544. X          }
  1545. X!         term_start_attr(attr);
  1546. X          for(cp = &cw->data[i][1];
  1547. X              *cp && (int)++ttyDisplay->curx < (int) ttyDisplay->cols; )
  1548. X+ #ifdef __SASC
  1549. X+             (void) fputchar(*cp++);
  1550. X+ #else
  1551. X              (void) putchar(*cp++);
  1552. X! #endif
  1553. X!         term_end_attr(attr);
  1554. X          }
  1555. X      }
  1556. X      if(i == cw->maxrow) {
  1557. X***************
  1558. X*** 837,856 ****
  1559. X      if(cw->type == NHW_MAP)
  1560. X      end_glyphout();
  1561. X  
  1562. X      if(!ND && (cx != x || x <= 3)) { /* Extremely primitive */
  1563. X      cmov(x, y); /* bunker!wtm */
  1564. X      return;
  1565. X      }
  1566. X      if((cy -= y) < 0) cy = -cy;
  1567. X      if((cx -= x) < 0) cx = -cx;
  1568. X!     if(cy <= 3 && cx <= 3)
  1569. X      nocmov(x, y);
  1570. X!     else if((x <= 3 && cy <= 3) || (!CM && x < cx)) {
  1571. X      (void) putchar('\r');
  1572. X      ttyDisplay->curx = 0;
  1573. X      nocmov(x, y);
  1574. X!     } else if(!CM) {
  1575. X      nocmov(x, y);
  1576. X      } else
  1577. X      cmov(x, y);
  1578. X  
  1579. X--- 861,885 ----
  1580. X      if(cw->type == NHW_MAP)
  1581. X      end_glyphout();
  1582. X  
  1583. X+ #ifndef NO_TERMS
  1584. X      if(!ND && (cx != x || x <= 3)) { /* Extremely primitive */
  1585. X      cmov(x, y); /* bunker!wtm */
  1586. X      return;
  1587. X      }
  1588. X+ #endif
  1589. X+ 
  1590. X      if((cy -= y) < 0) cy = -cy;
  1591. X      if((cx -= x) < 0) cx = -cx;
  1592. X!     if(cy <= 3 && cx <= 3) {
  1593. X      nocmov(x, y);
  1594. X! #ifndef NO_TERMS
  1595. X!     } else if ((x <= 3 && cy <= 3) || (!CM && x < cx)) {
  1596. X      (void) putchar('\r');
  1597. X      ttyDisplay->curx = 0;
  1598. X      nocmov(x, y);
  1599. X!     } else if (!CM) {
  1600. X      nocmov(x, y);
  1601. X+ #endif
  1602. X      } else
  1603. X      cmov(x, y);
  1604. X  
  1605. X***************
  1606. X*** 886,928 ****
  1607. X      }
  1608. X  }
  1609. X  
  1610. X- static char nulstr[] = "";
  1611. X  
  1612. X- static char *
  1613. X- s_atr2str(n)
  1614. X-     int n;
  1615. X- {
  1616. X-     switch(n) {
  1617. X-     case ATR_ULINE:
  1618. X-     if(US) return US;
  1619. X-     case ATR_BOLD:
  1620. X-     case ATR_BLINK:
  1621. X-     case ATR_INVERSE:
  1622. X-     return HI;
  1623. X-     }
  1624. X-     return nulstr;
  1625. X- }
  1626. X- 
  1627. X- static char *
  1628. X- e_atr2str(n)
  1629. X-     int n;
  1630. X- {
  1631. X-     switch(n) {
  1632. X-     case ATR_ULINE:
  1633. X-     if(UE) return UE;
  1634. X-     case ATR_BOLD:
  1635. X-     case ATR_BLINK:
  1636. X-     case ATR_INVERSE:
  1637. X-     return HE;
  1638. X-     }
  1639. X-     return nulstr;
  1640. X- }
  1641. X- 
  1642. X  static const char*
  1643. X  compress_str(str)
  1644. X  const char *str;
  1645. X  {
  1646. X!         static char cbuf[BUFSZ];
  1647. X      /* compress in case line too long */
  1648. X      if((int)strlen(str) >= CO) {
  1649. X          register const char *bp0 = str;
  1650. X--- 915,926 ----
  1651. X      }
  1652. X  }
  1653. X  
  1654. X  
  1655. X  static const char*
  1656. X  compress_str(str)
  1657. X  const char *str;
  1658. X  {
  1659. X!     static char cbuf[BUFSZ];
  1660. X      /* compress in case line too long */
  1661. X      if((int)strlen(str) >= CO) {
  1662. X          register const char *bp0 = str;
  1663. X***************
  1664. X*** 1005,1020 ****
  1665. X      case NHW_MAP:
  1666. X      case NHW_BASE:
  1667. X      tty_curs(window, cw->curx+1, cw->cury);
  1668. X!     if(attr)
  1669. X!         xputs(s_atr2str(attr));
  1670. X      while(*str && (int) ttyDisplay->curx < (int) ttyDisplay->cols-1) {
  1671. X          (void) putchar(*str++);
  1672. X          ttyDisplay->curx++;
  1673. X      }
  1674. X      cw->curx = 0;
  1675. X      cw->cury++;
  1676. X!     if(attr)
  1677. X!         xputs(e_atr2str(attr));
  1678. X      break;
  1679. X      case NHW_MENU:
  1680. X      case NHW_TEXT:
  1681. X--- 1003,1020 ----
  1682. X      case NHW_MAP:
  1683. X      case NHW_BASE:
  1684. X      tty_curs(window, cw->curx+1, cw->cury);
  1685. X!     term_start_attr(attr);
  1686. X      while(*str && (int) ttyDisplay->curx < (int) ttyDisplay->cols-1) {
  1687. X+ #ifdef __SASC
  1688. X+         (void) fputchar(*str++);
  1689. X+ #else
  1690. X          (void) putchar(*str++);
  1691. X+ #endif
  1692. X          ttyDisplay->curx++;
  1693. X      }
  1694. X      cw->curx = 0;
  1695. X      cw->cury++;
  1696. X!     term_end_attr(attr);
  1697. X      break;
  1698. X      case NHW_MENU:
  1699. X      case NHW_TEXT:
  1700. X***************
  1701. X*** 1058,1064 ****
  1702. X          cw->data[cw->cury-1][++i] = '\0';
  1703. X          tty_putstr(window, attr, &str[i]);
  1704. X          }
  1705. X!         
  1706. X      }
  1707. X      break;
  1708. X      }
  1709. X--- 1058,1064 ----
  1710. X          cw->data[cw->cury-1][++i] = '\0';
  1711. X          tty_putstr(window, attr, &str[i]);
  1712. X          }
  1713. X! 
  1714. X      }
  1715. X      break;
  1716. X      }
  1717. X***************
  1718. X*** 1097,1109 ****
  1719. X--- 1097,1118 ----
  1720. X      }
  1721. X  #else
  1722. X      {
  1723. X+ #ifdef MAC
  1724. X+     int fd;
  1725. X+ #else
  1726. X      FILE *f;
  1727. X+ #endif
  1728. X      char buf[BUFSZ];
  1729. X      char *cr;
  1730. X  
  1731. X      tty_clear_nhwindow(WIN_MESSAGE);
  1732. X+ #ifdef MAC
  1733. X+     fd = open(fname, O_RDONLY, TEXT_TYPE);
  1734. X+     if (fd < 0) {
  1735. X+ #else
  1736. X      f = fopen_datafile(fname, "r");
  1737. X      if (!f) {
  1738. X+ #endif
  1739. X          if(complain) {
  1740. X          home();  tty_mark_synch();  tty_raw_print("");
  1741. X          perror(fname);  tty_wait_synch();
  1742. X***************
  1743. X*** 1111,1123 ****
  1744. X          } else if(u.ux) docrt();
  1745. X      } else {
  1746. X          winid datawin = tty_create_nhwindow(NHW_TEXT);
  1747. X!         if(complain && CD) {
  1748. X          /* attempt to scroll text below map window if there's room */
  1749. X          wins[datawin]->offy = wins[WIN_STATUS]->offy+3;
  1750. X          if((int) wins[datawin]->offy + 12 > (int) ttyDisplay->rows)
  1751. X              wins[datawin]->offy = 0;
  1752. X          }
  1753. X          while (fgets(buf, BUFSZ, f)) {
  1754. X          if ((cr = index(buf, '\n')) != 0) *cr = 0;
  1755. X          if (index(buf, '\t') != 0) (void) tabexpand(buf);
  1756. X          tty_putstr(datawin, 0, buf);
  1757. X--- 1120,1140 ----
  1758. X          } else if(u.ux) docrt();
  1759. X      } else {
  1760. X          winid datawin = tty_create_nhwindow(NHW_TEXT);
  1761. X!         if(complain
  1762. X! #ifndef NO_TERMS
  1763. X!         && CD
  1764. X! #endif
  1765. X!         ) {
  1766. X          /* attempt to scroll text below map window if there's room */
  1767. X          wins[datawin]->offy = wins[WIN_STATUS]->offy+3;
  1768. X          if((int) wins[datawin]->offy + 12 > (int) ttyDisplay->rows)
  1769. X              wins[datawin]->offy = 0;
  1770. X          }
  1771. X+ #ifdef MAC
  1772. X+         while (macgets(fd, buf, BUFSZ)) {
  1773. X+ #else
  1774. X          while (fgets(buf, BUFSZ, f)) {
  1775. X+ #endif
  1776. X          if ((cr = index(buf, '\n')) != 0) *cr = 0;
  1777. X          if (index(buf, '\t') != 0) (void) tabexpand(buf);
  1778. X          tty_putstr(datawin, 0, buf);
  1779. X***************
  1780. X*** 1126,1132 ****
  1781. X--- 1143,1153 ----
  1782. X          }
  1783. X          tty_display_nhwindow(datawin, FALSE);
  1784. X          tty_destroy_nhwindow(datawin);
  1785. X+ #ifdef MAC
  1786. X+         (void) close(fd);
  1787. X+ #else
  1788. X          (void) fclose(f);
  1789. X+ #endif
  1790. X      }
  1791. X      }
  1792. X  #endif /* DEF_PAGER */
  1793. X***************
  1794. X*** 1276,1282 ****
  1795. X      tty_curs(BASE_WINDOW, xmin,y);    /* move cursor */
  1796. X      cl_end();            /* clear to end of line */
  1797. X  #ifdef CLIPPING
  1798. X!     if (y<(int) cw->offy || y+clipy > ROWNO) 
  1799. X          continue; /* only refresh board */
  1800. X      row_refresh(xmin+clipx-(int)cw->offx,COLNO-1,y+clipy-(int)cw->offy);
  1801. X  #else
  1802. X--- 1297,1303 ----
  1803. X      tty_curs(BASE_WINDOW, xmin,y);    /* move cursor */
  1804. X      cl_end();            /* clear to end of line */
  1805. X  #ifdef CLIPPING
  1806. X!     if (y<(int) cw->offy || y+clipy > ROWNO)
  1807. X          continue; /* only refresh board */
  1808. X      row_refresh(xmin+clipx-(int)cw->offx,COLNO-1,y+clipy-(int)cw->offy);
  1809. X  #else
  1810. X***************
  1811. X*** 1286,1292 ****
  1812. X      }
  1813. X  
  1814. X      end_glyphout();
  1815. X!     if (ymax >= (int) wins[WIN_STATUS]->offy) { 
  1816. X                      /* we have wrecked the bottom line */
  1817. X      flags.botlx = 1;
  1818. X      bot();
  1819. X--- 1307,1313 ----
  1820. X      }
  1821. X  
  1822. X      end_glyphout();
  1823. X!     if (ymax >= (int) wins[WIN_STATUS]->offy) {
  1824. X                      /* we have wrecked the bottom line */
  1825. X      flags.botlx = 1;
  1826. X      bot();
  1827. X***************
  1828. X*** 1296,1302 ****
  1829. X  void
  1830. X  end_glyphout()
  1831. X  {
  1832. X! #ifdef ASCIIGRAPH
  1833. X      if (GFlag) {
  1834. X      GFlag = FALSE;
  1835. X      graph_off();
  1836. X--- 1317,1323 ----
  1837. X  void
  1838. X  end_glyphout()
  1839. X  {
  1840. X! #if defined(ASCIIGRAPH) && !defined(NO_TERMS)
  1841. X      if (GFlag) {
  1842. X      GFlag = FALSE;
  1843. X      graph_off();
  1844. X***************
  1845. X*** 1304,1349 ****
  1846. X  #endif
  1847. X  #ifdef TEXTCOLOR
  1848. X      if(ttyDisplay->color != NO_COLOR) {
  1849. X!     xputs(HE);
  1850. X      ttyDisplay->color = NO_COLOR;
  1851. X      }
  1852. X  #endif
  1853. X  }
  1854. X  
  1855. X- #ifdef ASCIIGRAPH
  1856. X  void
  1857. X! g_putch(ch)
  1858. X!     uchar ch;
  1859. X  {
  1860. X      if (flags.IBMgraphics)
  1861. X      /* IBM-compatible displays don't need other stuff */
  1862. X!     (void) putchar((char) ch);
  1863. X      else if (ch & 0x80) {
  1864. X      if (!GFlag) {
  1865. X          graph_on();
  1866. X          GFlag = TRUE;
  1867. X      }
  1868. X!     (void) putchar((char) (ch ^ 0x80)); /* Strip 8th bit */
  1869. X      } else {
  1870. X      if (GFlag) {
  1871. X          graph_off();
  1872. X          GFlag = FALSE;
  1873. X      }
  1874. X!     (void) putchar((char) ch);
  1875. X      }
  1876. X- }
  1877. X  
  1878. X  #else
  1879. X  
  1880. X! void
  1881. X! g_putch(ch)
  1882. X!     uchar ch;
  1883. X! {
  1884. X!     (void) putchar((char)(ch));
  1885. X  };
  1886. X  
  1887. X- #endif    /* ASCIIGRAPH */
  1888. X- 
  1889. X  #ifdef CLIPPING
  1890. X  void
  1891. X  setclipped()
  1892. X--- 1325,1368 ----
  1893. X  #endif
  1894. X  #ifdef TEXTCOLOR
  1895. X      if(ttyDisplay->color != NO_COLOR) {
  1896. X!     term_end_color();
  1897. X      ttyDisplay->color = NO_COLOR;
  1898. X      }
  1899. X  #endif
  1900. X  }
  1901. X  
  1902. X  void
  1903. X! g_putch(in_ch)
  1904. X! int in_ch;
  1905. X  {
  1906. X+     register char ch = (char)in_ch;
  1907. X+ 
  1908. X+ # if defined(ASCIIGRAPH) && !defined(NO_TERMS)
  1909. X      if (flags.IBMgraphics)
  1910. X      /* IBM-compatible displays don't need other stuff */
  1911. X!     (void) putchar(ch);
  1912. X      else if (ch & 0x80) {
  1913. X      if (!GFlag) {
  1914. X          graph_on();
  1915. X          GFlag = TRUE;
  1916. X      }
  1917. X!     (void) putchar((ch ^ 0x80)); /* Strip 8th bit */
  1918. X      } else {
  1919. X      if (GFlag) {
  1920. X          graph_off();
  1921. X          GFlag = FALSE;
  1922. X      }
  1923. X!     (void) putchar(ch);
  1924. X      }
  1925. X  
  1926. X  #else
  1927. X+     (void) putchar(ch);
  1928. X  
  1929. X! #endif    /* ASCIIGRAPH && !NO_TERMS */
  1930. X! 
  1931. X!     return;
  1932. X  };
  1933. X  
  1934. X  #ifdef CLIPPING
  1935. X  void
  1936. X  setclipped()
  1937. X***************
  1938. X*** 1407,1413 ****
  1939. X  #define cmap_color(n) color = flags.use_color ? defsyms[n].color : NO_COLOR
  1940. X  #define trap_color(n) color = flags.use_color ? \
  1941. X                  (((n) == WEB) ? defsyms[S_web ].color  : \
  1942. X!                             defsyms[S_trap].color) : \
  1943. X                          NO_COLOR
  1944. X  #define obj_color(n)  color = flags.use_color ? objects[n].oc_color : NO_COLOR
  1945. X  #define mon_color(n)  color = flags.use_color ? mons[n].mcolor : NO_COLOR
  1946. X--- 1426,1432 ----
  1947. X  #define cmap_color(n) color = flags.use_color ? defsyms[n].color : NO_COLOR
  1948. X  #define trap_color(n) color = flags.use_color ? \
  1949. X                  (((n) == WEB) ? defsyms[S_web ].color  : \
  1950. X!                         defsyms[S_trap].color) : \
  1951. X                          NO_COLOR
  1952. X  #define obj_color(n)  color = flags.use_color ? objects[n].oc_color : NO_COLOR
  1953. X  #define mon_color(n)  color = flags.use_color ? mons[n].mcolor : NO_COLOR
  1954. X***************
  1955. X*** 1414,1421 ****
  1956. X  #define pet_color(n)  color = flags.use_color ? mons[n].mcolor :          \
  1957. X                  /* If no color, try to hilite pets; black  */ \
  1958. X                  /* should be HI                   */ \
  1959. X!                     ((flags.hilite_pet && hilites[BLACK]) ?          \
  1960. X                              BLACK : NO_COLOR)
  1961. X  # else /* no text color */
  1962. X  
  1963. X  #define zap_color(n)
  1964. X--- 1433,1441 ----
  1965. X  #define pet_color(n)  color = flags.use_color ? mons[n].mcolor :          \
  1966. X                  /* If no color, try to hilite pets; black  */ \
  1967. X                  /* should be HI                   */ \
  1968. X!                 ((flags.hilite_pet && has_color(BLACK)) ?     \
  1969. X                              BLACK : NO_COLOR)
  1970. X+ 
  1971. X  # else /* no text color */
  1972. X  
  1973. X  #define zap_color(n)
  1974. X***************
  1975. X*** 1453,1468 ****
  1976. X      ch = (offset == WEB) ? showsyms[S_web] : showsyms[S_trap];
  1977. X      trap_color(offset);
  1978. X      } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) {    /* object */
  1979. X!     ch = oc_syms[objects[offset].oc_class];
  1980. X      obj_color(offset);
  1981. X      } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) {    /* a corpse */
  1982. X!     ch = oc_syms[objects[CORPSE].oc_class];
  1983. X      mon_color(offset);
  1984. X      } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) {    /* a pet */
  1985. X!     ch = monsyms[mons[offset].mlet];
  1986. X      pet_color(offset);
  1987. X      } else {                            /* a monster */
  1988. X!     ch = monsyms[mons[glyph].mlet];
  1989. X      mon_color(glyph);
  1990. X      }
  1991. X  
  1992. X--- 1473,1488 ----
  1993. X      ch = (offset == WEB) ? showsyms[S_web] : showsyms[S_trap];
  1994. X      trap_color(offset);
  1995. X      } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) {    /* object */
  1996. X!     ch = oc_syms[(int)objects[offset].oc_class];
  1997. X      obj_color(offset);
  1998. X      } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) {    /* a corpse */
  1999. X!     ch = oc_syms[(int)objects[CORPSE].oc_class];
  2000. X      mon_color(offset);
  2001. X      } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) {    /* a pet */
  2002. X!     ch = monsyms[(int)mons[offset].mlet];
  2003. X      pet_color(offset);
  2004. X      } else {                            /* a monster */
  2005. X!     ch = monsyms[(int)mons[glyph].mlet];
  2006. X      mon_color(glyph);
  2007. X      }
  2008. X  
  2009. X***************
  2010. X*** 1469,1497 ****
  2011. X      /* Move the cursor. */
  2012. X      tty_curs(window, x,y);
  2013. X  
  2014. X      if (ul_hack && ch == '_') {        /* non-destructive underscore */
  2015. X      (void) putchar((char) ' ');
  2016. X      backsp();
  2017. X      }
  2018. X  
  2019. X  #ifdef TEXTCOLOR
  2020. X      /* Turn off color if no color defined, or rogue level. */
  2021. X  #  ifdef REINCARNATION
  2022. X!     if (hilites[color] == NULL || Is_rogue_level(&u.uz))
  2023. X  #  else
  2024. X!     if (hilites[color] == NULL)
  2025. X  #  endif
  2026. X      color = NO_COLOR;
  2027. X  
  2028. X      if (color != ttyDisplay->color) {
  2029. X      if(ttyDisplay->color != NO_COLOR)
  2030. X!         xputs(HE);
  2031. X      ttyDisplay->color = color;
  2032. X      if(color != NO_COLOR)
  2033. X!         xputs(hilites[color]);
  2034. X      }
  2035. X  #endif
  2036. X!     g_putch(ch);        /* print the character */
  2037. X      wins[window]->curx++;    /* one character over */
  2038. X      ttyDisplay->curx++;        /* the real cursor moved too */
  2039. X  }
  2040. X--- 1489,1519 ----
  2041. X      /* Move the cursor. */
  2042. X      tty_curs(window, x,y);
  2043. X  
  2044. X+ #ifndef NO_TERMS
  2045. X      if (ul_hack && ch == '_') {        /* non-destructive underscore */
  2046. X      (void) putchar((char) ' ');
  2047. X      backsp();
  2048. X      }
  2049. X+ #endif
  2050. X  
  2051. X  #ifdef TEXTCOLOR
  2052. X      /* Turn off color if no color defined, or rogue level. */
  2053. X  #  ifdef REINCARNATION
  2054. X!     if (!has_color(color) || Is_rogue_level(&u.uz))
  2055. X  #  else
  2056. X!     if (!has_color(color))
  2057. X  #  endif
  2058. X      color = NO_COLOR;
  2059. X  
  2060. X      if (color != ttyDisplay->color) {
  2061. X      if(ttyDisplay->color != NO_COLOR)
  2062. X!         term_end_color();
  2063. X      ttyDisplay->color = color;
  2064. X      if(color != NO_COLOR)
  2065. X!         term_start_color(color);
  2066. X      }
  2067. X  #endif
  2068. X!     g_putch((int)ch);        /* print the character */
  2069. X      wins[window]->curx++;    /* one character over */
  2070. X      ttyDisplay->curx++;        /* the real cursor moved too */
  2071. X  }
  2072. X***************
  2073. X*** 1513,1525 ****
  2074. X      const char *str;
  2075. X  {
  2076. X      if(ttyDisplay) ttyDisplay->rawprint++;
  2077. X!     xputs(HI);
  2078. X  #ifdef MICRO
  2079. X      msmsg("%s", str);
  2080. X  #else
  2081. X      (void) fputs(str, stdout);
  2082. X  #endif
  2083. X!     xputs(HE);
  2084. X  #ifdef MICRO
  2085. X      msmsg("\n");
  2086. X  #else
  2087. X--- 1535,1547 ----
  2088. X      const char *str;
  2089. X  {
  2090. X      if(ttyDisplay) ttyDisplay->rawprint++;
  2091. X!     term_start_raw_bold();
  2092. X  #ifdef MICRO
  2093. X      msmsg("%s", str);
  2094. X  #else
  2095. X      (void) fputs(str, stdout);
  2096. X  #endif
  2097. X!     term_end_raw_bold();
  2098. X  #ifdef MICRO
  2099. X      msmsg("\n");
  2100. X  #else
  2101. X***************
  2102. X*** 1586,1589 ****
  2103. X--- 1608,1612 ----
  2104. X      return;
  2105. X  }
  2106. X  
  2107. X+ #endif /* TTY_GRAPHICS */
  2108. X  /*wintty.c*/
  2109. X*** /tmp/da12240    Tue Jun  1 17:23:04 1993
  2110. X--- sys/atari/atari.cnf    Wed Mar 17 16:46:25 1993
  2111. X***************
  2112. X*** 25,31 ****
  2113. X  # Other general options.  You might also set "silent" so as not to attract
  2114. X  # the boss's attention.
  2115. X  #
  2116. X! OPTIONS=BIOS,time,rest_on_space,nopickup
  2117. X  
  2118. X  # Color: if you have a color monitor and *don't* want colors, 
  2119. X  # comment out the following line. (Mono users don't get color no matter what.)
  2120. X--- 25,31 ----
  2121. X  # Other general options.  You might also set "silent" so as not to attract
  2122. X  # the boss's attention.
  2123. X  #
  2124. X! OPTIONS=BIOS,time,rest_on_space,noautopickup
  2125. X  
  2126. X  # Color: if you have a color monitor and *don't* want colors, 
  2127. X  # comment out the following line. (Mono users don't get color no matter what.)
  2128. X*** /tmp/da12692    Tue Jun  1 17:32:22 1993
  2129. X--- sys/share/sounds/README    Tue Jun  1 10:50:48 1993
  2130. X***************
  2131. X*** 1,7 ****
  2132. X  README for the AIFF files:
  2133. X  
  2134. X  These files are sound files for the instruments in NetHack.
  2135. X! There are 12 sounds, one for each distinct instrument.
  2136. X  The sounds are in 8-bit 22kHz AIFF format, which should be
  2137. X  readable by a broad range of platforms. Since the sounds
  2138. X  came from Rolands S-750 sample library (most of them) there
  2139. X--- 1,7 ----
  2140. X  README for the AIFF files:
  2141. X  
  2142. X  These files are sound files for the instruments in NetHack.
  2143. X! There are 11 sounds, one for each distinct instrument.
  2144. X  The sounds are in 8-bit 22kHz AIFF format, which should be
  2145. X  readable by a broad range of platforms. Since the sounds
  2146. X  came from Rolands S-750 sample library (most of them) there
  2147. END_OF_FILE
  2148. if test 52637 -ne `wc -c <'patches02j'`; then
  2149.     echo shar: \"'patches02j'\" unpacked with wrong size!
  2150. fi
  2151. # end of 'patches02j'
  2152. echo shar: End of archive 19 \(of 33\).
  2153. cp /dev/null ark19isdone
  2154. MISSING=""
  2155. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
  2156.     if test ! -f ark${I}isdone ; then
  2157.     MISSING="${MISSING} ${I}"
  2158.     fi
  2159. done
  2160. if test "${MISSING}" = "" ; then
  2161.     echo You have unpacked all 33 archives.
  2162.     echo "Now execute ./patchit.sh"
  2163.     rm -f ark[1-9]isdone ark[1-9][0-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.