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

  1. Path: uunet!gatech!howland.reston.ans.net!ux1.cso.uiuc.edu!uwm.edu!ogicse!news.tek.com!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v17i097:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Patch2v/33
  5. Message-ID: <1v8irj$j5v@ying.cna.tek.com>
  6. Date: 11 Jun 93 00:15:47 GMT
  7. Article-I.D.: ying.1v8irj$j5v
  8. Organization: Tektronix, Inc, Redmond, OR, USA
  9. Lines: 2133
  10. Approved: billr@saab.CNA.TEK.COM
  11. NNTP-Posting-Host: saab.cna.tek.com
  12. Xref: uunet comp.sources.games:1760
  13.  
  14. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  15. Posting-number: Volume 17, Issue 97
  16. Archive-name: nethack31/Patch2v
  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 22 (of 33)."
  29. # Contents:  patches02p.1 src/sounds.c
  30. # Wrapped by billr@saab on Thu Jun 10 16:55:06 1993
  31. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  32. if test -f 'patches02p.1' -a "${1}" != "-c" ; then 
  33.   echo shar: Renaming existing file \"'patches02p.1'\" to \"'patches02p.1.orig'\"
  34.   mv -f 'patches02p.1' 'patches02p.1.orig'
  35. fi
  36. echo shar: Extracting \"'patches02p.1'\" \(39051 characters\)
  37. sed "s/^X//" >'patches02p.1' <<'END_OF_FILE'
  38. X*** /tmp/da14064    Tue Jun  1 20:02:00 1993
  39. X--- sys/mac/macwin.c    Tue Jun  1 19:57:55 1993
  40. X***************
  41. X*** 17,22 ****
  42. X--- 17,24 ----
  43. X  
  44. X  #include "hack.h"
  45. X  #include "func_tab.h"
  46. X+ #include "mactty.h"
  47. X+ #include "wintty.h"
  48. X  
  49. X  #include <osutils.h>
  50. X  #include <dialogs.h>
  51. X***************
  52. X*** 38,48 ****
  53. X  
  54. X  NhWindow * theWindows = (NhWindow *) NULL ;
  55. X  
  56. X  /*
  57. X   * Some useful #defines for the scroll bar width and height
  58. X   */
  59. X  #define        SBARWIDTH    15
  60. X! #define        SBARHEIGHT    14
  61. X  
  62. X  /*
  63. X   * We put a TE on the message window for the "top line" queries.
  64. X--- 40,57 ----
  65. X  
  66. X  NhWindow * theWindows = (NhWindow *) NULL ;
  67. X  
  68. X+ extern pascal short tty_environment_changed ( WindowPtr ) ;
  69. X+ 
  70. X  /*
  71. X+  * Borrowed from the Mac tty port
  72. X+  */
  73. X+ extern WindowPtr _mt_window;
  74. X+ 
  75. X+ /*
  76. X   * Some useful #defines for the scroll bar width and height
  77. X   */
  78. X  #define        SBARWIDTH    15
  79. X! #define        SBARHEIGHT    13
  80. X  
  81. X  /*
  82. X   * We put a TE on the message window for the "top line" queries.
  83. X***************
  84. X*** 75,80 ****
  85. X--- 84,90 ----
  86. X   * queue, shifting in a 0.
  87. X   */
  88. X  #define QUEUE_LEN 24
  89. X+ const int keyQueueLen = QUEUE_LEN ;
  90. X  static int keyQueue [ QUEUE_LEN ] ;
  91. X  
  92. X  Boolean gClickedToMove = 0 ; /* For ObscureCursor */
  93. X***************
  94. X*** 86,91 ****
  95. X--- 96,104 ----
  96. X  
  97. X  static Boolean cursor_locked = false ;
  98. X  
  99. X+ extern void dprintf ( char * , ... ) ;
  100. X+ 
  101. X+ 
  102. X  void
  103. X  lock_mouse_cursor(Boolean new_cursor_locked)
  104. X  {
  105. X***************
  106. X*** 96,105 ****
  107. X  
  108. X  
  109. X  /*
  110. X!  * Add key to input queue, force means replace last if full
  111. X   */
  112. X  void
  113. X! addToKeyQueue ( int ch , Boolean force )
  114. X  {
  115. X      int i ;
  116. X  
  117. X--- 109,118 ----
  118. X  
  119. X  
  120. X  /*
  121. X!  * Add key to input queue, force means flush left and replace if full
  122. X   */
  123. X  void
  124. X! AddToKeyQueue ( int ch , Boolean force )
  125. X  {
  126. X      int i ;
  127. X  
  128. X***************
  129. X*** 112,118 ****
  130. X          }
  131. X      }
  132. X      if ( force ) {
  133. X! 
  134. X          keyQueue [ QUEUE_LEN - 1 ] = ch ;
  135. X      }
  136. X  }
  137. X--- 125,133 ----
  138. X          }
  139. X      }
  140. X      if ( force ) {
  141. X!         for ( i = 0 ; i < QUEUE_LEN - 1 ; i ++ ) {
  142. X!             keyQueue [ i ] = keyQueue [ i + 1 ] ;
  143. X!         }
  144. X          keyQueue [ QUEUE_LEN - 1 ] = ch ;
  145. X      }
  146. X  }
  147. X***************
  148. X*** 141,150 ****
  149. X  static NhWindow * asyDSC = (NhWindow *) NULL ;
  150. X  
  151. X  /*
  152. X!  * The font to be used in the text window, will be set to geneva after
  153. X!  * we create the base window
  154. X   */
  155. X! short text_wind_font = monaco;
  156. X  
  157. X  /*
  158. X   * Whether to adjust the height of a text window according to its contents
  159. X--- 156,164 ----
  160. X  static NhWindow * asyDSC = (NhWindow *) NULL ;
  161. X  
  162. X  /*
  163. X!  * The font to be used in the text window
  164. X   */
  165. X! short text_wind_font = geneva;
  166. X  
  167. X  /*
  168. X   * Whether to adjust the height of a text window according to its contents
  169. X***************
  170. X*** 165,171 ****
  171. X  MenuHandle helpMenu ;
  172. X  
  173. X  #define NHW_BASE 0
  174. X! winid BASE_WINDOW ; // Was: , WIN_MAP , WIN_MESSAGE , WIN_INVEN , WIN_STATUS ;
  175. X  
  176. X  void NDECL(port_help);
  177. X  
  178. X--- 179,185 ----
  179. X  MenuHandle helpMenu ;
  180. X  
  181. X  #define NHW_BASE 0
  182. X! extern winid BASE_WINDOW ; // Was: , WIN_MAP , WIN_MESSAGE , WIN_INVEN , WIN_STATUS ;
  183. X  
  184. X  void NDECL(port_help);
  185. X  
  186. X***************
  187. X*** 178,183 ****
  188. X--- 192,198 ----
  189. X  void FDECL(HandleClick, ( EventRecord * theEvent ));
  190. X  void FDECL(HandleUpdate, ( EventRecord * theEvent ));
  191. X  void FDECL(HandleEvent, ( EventRecord * theEvent ));
  192. X+ void FDECL(WindowGoAway, ( EventRecord *, WindowPtr));
  193. X  void NDECL(DimMenuBar);
  194. X  void NDECL(UndimMenuBar);
  195. X  int FDECL(filter_scroll_key,(const int, NhWindow *));
  196. X***************
  197. X*** 198,226 ****
  198. X  #define NUM_FUNCS 6
  199. X  static void FDECL(macKeyNull, ( EventRecord * , WindowPtr )) ;
  200. X  static void FDECL(macKeyMessage, ( EventRecord * , WindowPtr )) ;
  201. X! static void FDECL(macKeyStatus, ( EventRecord * , WindowPtr )) ;
  202. X! static void FDECL(macKeyMap, ( EventRecord * , WindowPtr )) ;
  203. X  static void FDECL(macKeyMenu, ( EventRecord * , WindowPtr )) ;
  204. X  static void FDECL(macKeyText, ( EventRecord * , WindowPtr )) ;
  205. X  
  206. X  static void FDECL(macClickNull, ( EventRecord * , WindowPtr )) ;
  207. X  static void FDECL(macClickMessage, ( EventRecord * , WindowPtr )) ;
  208. X! static void FDECL(macClickStatus, ( EventRecord * , WindowPtr )) ;
  209. X! static void FDECL(macClickMap, ( EventRecord * , WindowPtr )) ;
  210. X  static void FDECL(macClickMenu, ( EventRecord * , WindowPtr )) ;
  211. X  static void FDECL(macClickText, ( EventRecord * , WindowPtr )) ;
  212. X  
  213. X  static void FDECL(macUpdateNull, ( EventRecord * , WindowPtr )) ;
  214. X  static void FDECL(macUpdateMessage, ( EventRecord * , WindowPtr )) ;
  215. X! static void FDECL(macUpdateStatus, ( EventRecord * , WindowPtr )) ;
  216. X! static void FDECL(macUpdateMap, ( EventRecord * , WindowPtr )) ;
  217. X  static void FDECL(macUpdateMenu, ( EventRecord * , WindowPtr )) ;
  218. X  static void FDECL(macUpdateText, ( EventRecord * , WindowPtr )) ;
  219. X  
  220. X  static void FDECL(macCursorNull, ( EventRecord * , WindowPtr , RgnHandle )) ;
  221. X  static void FDECL(macCursorMessage, ( EventRecord * , WindowPtr , RgnHandle )) ;
  222. X! static void FDECL(macCursorStatus, ( EventRecord * , WindowPtr , RgnHandle )) ;
  223. X! static void FDECL(macCursorMap, ( EventRecord * , WindowPtr , RgnHandle )) ;
  224. X  static void FDECL(macCursorMenu, ( EventRecord * , WindowPtr , RgnHandle )) ;
  225. X  static void FDECL(macCursorText, ( EventRecord * , WindowPtr , RgnHandle )) ;
  226. X  
  227. X--- 213,237 ----
  228. X  #define NUM_FUNCS 6
  229. X  static void FDECL(macKeyNull, ( EventRecord * , WindowPtr )) ;
  230. X  static void FDECL(macKeyMessage, ( EventRecord * , WindowPtr )) ;
  231. X! static void FDECL(macKeyTerm, ( EventRecord * , WindowPtr )) ;
  232. X  static void FDECL(macKeyMenu, ( EventRecord * , WindowPtr )) ;
  233. X  static void FDECL(macKeyText, ( EventRecord * , WindowPtr )) ;
  234. X  
  235. X  static void FDECL(macClickNull, ( EventRecord * , WindowPtr )) ;
  236. X  static void FDECL(macClickMessage, ( EventRecord * , WindowPtr )) ;
  237. X! static void FDECL(macClickTerm, ( EventRecord * , WindowPtr )) ;
  238. X  static void FDECL(macClickMenu, ( EventRecord * , WindowPtr )) ;
  239. X  static void FDECL(macClickText, ( EventRecord * , WindowPtr )) ;
  240. X  
  241. X  static void FDECL(macUpdateNull, ( EventRecord * , WindowPtr )) ;
  242. X  static void FDECL(macUpdateMessage, ( EventRecord * , WindowPtr )) ;
  243. X! static void FDECL(macUpdateTerm, ( EventRecord * , WindowPtr )) ;
  244. X  static void FDECL(macUpdateMenu, ( EventRecord * , WindowPtr )) ;
  245. X  static void FDECL(macUpdateText, ( EventRecord * , WindowPtr )) ;
  246. X  
  247. X  static void FDECL(macCursorNull, ( EventRecord * , WindowPtr , RgnHandle )) ;
  248. X  static void FDECL(macCursorMessage, ( EventRecord * , WindowPtr , RgnHandle )) ;
  249. X! static void FDECL(macCursorTerm, ( EventRecord * , WindowPtr , RgnHandle )) ;
  250. X  static void FDECL(macCursorMenu, ( EventRecord * , WindowPtr , RgnHandle )) ;
  251. X  static void FDECL(macCursorText, ( EventRecord * , WindowPtr , RgnHandle )) ;
  252. X  
  253. X***************
  254. X*** 229,235 ****
  255. X  
  256. X  static void FDECL (DrawScrollbar, ( NhWindow * , WindowPtr ));
  257. X  static void FDECL (InvalScrollBar, ( NhWindow * ));
  258. X- static void FDECL(DrawMapCursor,(NhWindow *));
  259. X  static void FDECL(DoScrollBar,(Point, short, ControlHandle, NhWindow *, WindowPtr));
  260. X  static pascal void FDECL(Up, (ControlHandle, short));
  261. X  static pascal void FDECL(Down,(ControlHandle, short));
  262. X--- 240,245 ----
  263. X***************
  264. X*** 238,261 ****
  265. X  typedef void ( * CbCursFunc ) ( EventRecord * , WindowPtr , RgnHandle ) ;
  266. X  
  267. X  CbFunc winKeyFuncs [ NUM_FUNCS ] = {
  268. X!     macKeyNull , macKeyMessage , macKeyStatus , macKeyMap , macKeyMenu , macKeyText
  269. X  } ;
  270. X  
  271. X  CbFunc winClickFuncs [ NUM_FUNCS ] = {
  272. X!     macClickNull , macClickMessage , macClickStatus , macClickMap , macClickMenu ,
  273. X      macClickText
  274. X  } ;
  275. X  
  276. X  CbFunc winUpdateFuncs [ NUM_FUNCS ] = {
  277. X!     macUpdateNull , macUpdateMessage , macUpdateStatus , macUpdateMap ,
  278. X      macUpdateMenu , macUpdateText
  279. X  } ;
  280. X  
  281. X  CbCursFunc winCursorFuncs [ NUM_FUNCS ] = {
  282. X!     macCursorNull , macCursorMessage , macCursorStatus , macCursorMap ,
  283. X      macCursorMenu , macCursorText
  284. X  } ;
  285. X  
  286. X  #ifdef applec
  287. X    extern void _DataInit();
  288. X    /* This routine is part of the MPW runtime library. This external
  289. X--- 248,282 ----
  290. X  typedef void ( * CbCursFunc ) ( EventRecord * , WindowPtr , RgnHandle ) ;
  291. X  
  292. X  CbFunc winKeyFuncs [ NUM_FUNCS ] = {
  293. X!     macKeyNull , macKeyMessage , macKeyTerm , macKeyTerm , macKeyMenu , macKeyText
  294. X  } ;
  295. X  
  296. X  CbFunc winClickFuncs [ NUM_FUNCS ] = {
  297. X!     macClickNull , macClickMessage , macClickTerm , macClickTerm , macClickMenu ,
  298. X      macClickText
  299. X  } ;
  300. X  
  301. X  CbFunc winUpdateFuncs [ NUM_FUNCS ] = {
  302. X!     macUpdateNull , macUpdateMessage , macUpdateTerm , macUpdateTerm ,
  303. X      macUpdateMenu , macUpdateText
  304. X  } ;
  305. X  
  306. X  CbCursFunc winCursorFuncs [ NUM_FUNCS ] = {
  307. X!     macCursorNull , macCursorMessage , macCursorTerm , macCursorTerm ,
  308. X      macCursorMenu , macCursorText
  309. X  } ;
  310. X  
  311. X+ NhWindow *
  312. X+ GetNhWin(WindowPtr mac_win)
  313. X+ {
  314. X+     int ix;
  315. X+     for (ix = 0; ix < NUM_MACWINDOWS; ++ix)
  316. X+         if (mac_win == theWindows[ix].theWindow)
  317. X+             return theWindows + ix;
  318. X+     return nil;
  319. X+ }
  320. X+ 
  321. X+ 
  322. X  #ifdef applec
  323. X    extern void _DataInit();
  324. X    /* This routine is part of the MPW runtime library. This external
  325. X***************
  326. X*** 274,285 ****
  327. X      UnloadSeg((Ptr) _DataInit);
  328. X  #endif
  329. X  
  330. X!     SetApplLimit ( 
  331. X                      ( void * ) 
  332. X                      ( 
  333. X!                     ( ( long ) GetApplLimit() ) - 40 * 1024L 
  334. X                      ) 
  335. X                   ) ;
  336. X      MaxApplZone ( ) ;
  337. X      for ( i = 0 ; i < 5 ; i ++ )
  338. X          MoreMasters ( ) ;
  339. X--- 295,308 ----
  340. X      UnloadSeg((Ptr) _DataInit);
  341. X  #endif
  342. X  
  343. X!     if ( * ( long * ) DefltStack < 50 * 1024L ) {
  344. X!         SetApplLimit ( 
  345. X                      ( void * ) 
  346. X                      ( 
  347. X!                     ( * ( long * ) CurStackBase ) - 50 * 1024L 
  348. X                      ) 
  349. X                   ) ;
  350. X+     }
  351. X      MaxApplZone ( ) ;
  352. X      for ( i = 0 ; i < 5 ; i ++ )
  353. X          MoreMasters ( ) ;
  354. X***************
  355. X*** 343,348 ****
  356. X--- 366,373 ----
  357. X      }
  358. X  
  359. X      gMouseRgn = NewRgn ( ) ;
  360. X+     InitCursor ( ) ;
  361. X+     ObscureCursor ( ) ;
  362. X  }
  363. X  
  364. X  
  365. X***************
  366. X*** 357,364 ****
  367. X  int
  368. X  SanePositions ( void )
  369. X  {
  370. X!     short mainTop , mainLeft , mainWidth , mainHeight ;
  371. X!     short statTop , statLeft , statWidth , statHeight ;
  372. X      short mesgTop , mesgLeft , mesgWidth , mesgHeight ;
  373. X      short left , top , width , height ;
  374. X      short ix , numText = 0 , numMenu = 0 ;
  375. X--- 382,388 ----
  376. X  int
  377. X  SanePositions ( void )
  378. X  {
  379. X!     short mainTop , mainLeft ;
  380. X      short mesgTop , mesgLeft , mesgWidth , mesgHeight ;
  381. X      short left , top , width , height ;
  382. X      short ix , numText = 0 , numMenu = 0 ;
  383. X***************
  384. X*** 383,420 ****
  385. X  
  386. X      mainTop = top ;
  387. X      mainLeft = left ;
  388. X-     mainHeight = height ;
  389. X-     mainWidth = width ;
  390. X  
  391. X- /* Status Window */
  392. X-     nhWin = theWindows + WIN_STATUS ;
  393. X-     theWindow = nhWin -> theWindow ;
  394. X- 
  395. X-     height = nhWin -> charHeight * NUM_STAT_ROWS ;
  396. X- 
  397. X-     if ( ! RetrievePosition ( kStatusWindow , & top , & left ) ) {
  398. X-         top = mainTop + mainHeight + 2 ;
  399. X-         left = mainLeft ;
  400. X-     }
  401. X- 
  402. X-     if ( top + height > screenArea . bottom ) {
  403. X-         top = screenArea . bottom - height ;
  404. X-         left += 20 ; /* Edge to the right so we can read it */
  405. X-     }
  406. X-     statTop = top ;
  407. X-     statLeft = left ;
  408. X-     statHeight = height ;
  409. X-     statWidth = width ;
  410. X- 
  411. X  /* Message Window */
  412. X      nhWin = theWindows + WIN_MESSAGE ;
  413. X      theWindow = nhWin -> theWindow ;
  414. X  
  415. X      if ( ! RetrievePosition ( kMessageWindow , & top , & left ) ) {
  416. X!         top = statTop + statHeight ;
  417. X          if ( ! small_screen )
  418. X              top += 20 ;
  419. X!         left = statLeft ;
  420. X      }
  421. X  
  422. X      if ( ! RetrieveSize ( kMessageWindow , top , left , & height , & width ) ) {
  423. X--- 407,422 ----
  424. X  
  425. X      mainTop = top ;
  426. X      mainLeft = left ;
  427. X  
  428. X  /* Message Window */
  429. X      nhWin = theWindows + WIN_MESSAGE ;
  430. X      theWindow = nhWin -> theWindow ;
  431. X  
  432. X      if ( ! RetrievePosition ( kMessageWindow , & top , & left ) ) {
  433. X!         top = mainTop + _mt_window->portRect.bottom - _mt_window->portRect.top;
  434. X          if ( ! small_screen )
  435. X              top += 20 ;
  436. X!         left = mainLeft ;
  437. X      }
  438. X  
  439. X      if ( ! RetrieveSize ( kMessageWindow , top , left , & height , & width ) ) {
  440. X***************
  441. X*** 436,449 ****
  442. X  /* Move these windows */
  443. X      MoveWindow ( theWindows [ WIN_MESSAGE ] . theWindow , mesgLeft , mesgTop , 1 ) ;
  444. X      SizeWindow ( theWindows [ WIN_MESSAGE ] . theWindow , mesgWidth , mesgHeight , 1 ) ;
  445. X!     MoveWindow ( theWindows [ WIN_STATUS ] . theWindow , statLeft , statTop , 1 ) ;
  446. X!     SizeWindow ( theWindows [ WIN_STATUS ] . theWindow , statWidth , statHeight , 1 ) ;
  447. X!     MoveWindow ( theWindows [ WIN_MAP ] . theWindow , mainLeft , mainTop , 1 ) ;
  448. X!     SizeWindow ( theWindows [ WIN_MAP ] . theWindow , mainWidth , mainHeight , 1 ) ;
  449. X  
  450. X  /* Handle other windows */
  451. X      for ( ix = 0 ; ix < NUM_MACWINDOWS ; ix ++ ) {
  452. X!         if ( ix != WIN_STATUS && ix != WIN_MESSAGE && ix != WIN_MAP ) {
  453. X              if ( theWindow = theWindows [ ix ] . theWindow ) {
  454. X                  if ( ( ( WindowPeek ) theWindow ) -> visible ) {
  455. X                      if ( theWindows [ ix ] . kind == NHW_MENU ) {
  456. X--- 438,448 ----
  457. X  /* Move these windows */
  458. X      MoveWindow ( theWindows [ WIN_MESSAGE ] . theWindow , mesgLeft , mesgTop , 1 ) ;
  459. X      SizeWindow ( theWindows [ WIN_MESSAGE ] . theWindow , mesgWidth , mesgHeight , 1 ) ;
  460. X!     MoveWindow ( _mt_window , mainLeft , mainTop , 1 ) ;
  461. X  
  462. X  /* Handle other windows */
  463. X      for ( ix = 0 ; ix < NUM_MACWINDOWS ; ix ++ ) {
  464. X!         if ( ix != WIN_STATUS && ix != WIN_MESSAGE && ix != WIN_MAP && ix != BASE_WINDOW ) {
  465. X              if ( theWindow = theWindows [ ix ] . theWindow ) {
  466. X                  if ( ( ( WindowPeek ) theWindow ) -> visible ) {
  467. X                      if ( theWindows [ ix ] . kind == NHW_MENU ) {
  468. X***************
  469. X*** 502,509 ****
  470. X      if ( i >= NUM_MACWINDOWS ) {
  471. X          for ( i = 0 ; i < NUM_MACWINDOWS ; i ++ ) {
  472. X              WindowPeek w = ( WindowPeek ) theWindows [ i ] . theWindow ;
  473. X!             if ( w -> visible || i == WIN_INVEN || ( w -> windowKind
  474. X!                 != NHW_MENU && w -> windowKind != NHW_TEXT ) )
  475. X                  continue ;
  476. X              error ( "The window list is getting full, freeing unnecessary window (%d)..." ,
  477. X                  i ) ;
  478. X--- 501,509 ----
  479. X      if ( i >= NUM_MACWINDOWS ) {
  480. X          for ( i = 0 ; i < NUM_MACWINDOWS ; i ++ ) {
  481. X              WindowPeek w = ( WindowPeek ) theWindows [ i ] . theWindow ;
  482. X!             if ( w -> visible || i == WIN_INVEN ||
  483. X!                  w -> windowKind != WIN_BASE_KIND + NHW_MENU &&
  484. X!                  w -> windowKind != WIN_BASE_KIND + NHW_TEXT )
  485. X                  continue ;
  486. X              error ( "The window list is getting full, freeing unnecessary window (%d)..." ,
  487. X                  i ) ;
  488. X***************
  489. X*** 517,563 ****
  490. X  
  491. X  got1 :
  492. X      aWin = & theWindows [ i ] ;
  493. X!     aWin -> theWindow = GetNewWindow ( WIN_BASE_RES + type ,
  494. X!         ( WindowPtr ) 0L , ( WindowPtr ) -1L ) ;
  495. X!     ( ( WindowPeek ) aWin -> theWindow ) -> windowKind = WIN_BASE_KIND
  496. X!         + type ;
  497. X      aWin -> windowTextLen = 0L ;
  498. X      aWin -> clear = 0 ; /* Yes, we need to inval the area on a clear */
  499. X      aWin -> scrollBar = (ControlHandle) NULL ;
  500. X!     switch ( type ) {
  501. X!     case NHW_MAP :
  502. X!         if ( ! ( aWin -> windowText = NewHandle
  503. X!             ( sizeof ( MapData ) ) ) ) {
  504. X!             error ( "NewHandle failed in create_nhwindow (%ld bytes)" ,
  505. X!                 ( long ) sizeof ( MapData ) ) ;
  506. X!             DisposeWindow ( aWin -> theWindow ) ;
  507. X!             aWin -> theWindow = (WindowPtr) NULL ;
  508. X!             return WIN_ERR ;
  509. X          }
  510. X!         break ;
  511. X!     case NHW_STATUS :
  512. X!         if ( ! ( aWin -> windowText = NewHandle
  513. X!             ( sizeof ( StatusData ) ) ) ) {
  514. X!             error ( "NewHandle failed in create_nhwindow (%ld bytes)" ,
  515. X!                 ( long ) sizeof ( StatusData ) ) ;
  516. X!             DisposeWindow ( aWin -> theWindow ) ;
  517. X!             aWin -> theWindow = (WindowPtr) NULL ;
  518. X!             return WIN_ERR ;
  519. X!         }
  520. X!         break ;
  521. X!     default :
  522. X!         if ( ! ( aWin -> windowText = NewHandle ( TEXT_BLOCK ) ) ) {
  523. X!             error ( "NewHandle failed in create_nhwindow (%ld bytes)" ,
  524. X!                 ( long ) TEXT_BLOCK ) ;
  525. X!             DisposeWindow ( aWin -> theWindow ) ;
  526. X!             aWin -> theWindow = (WindowPtr) NULL ;
  527. X!             return WIN_ERR ;
  528. X!         }
  529. X!         aWin -> windowTextLen = 0L ;
  530. X!         aWin -> lin = 0 ;
  531. X!         break ;
  532. X      }
  533. X  
  534. X      clear_nhwindow ( i ) ;
  535. X  
  536. X  /*HARDCODED*/
  537. X--- 517,570 ----
  538. X  
  539. X  got1 :
  540. X      aWin = & theWindows [ i ] ;
  541. X! 
  542. X      aWin -> windowTextLen = 0L ;
  543. X      aWin -> clear = 0 ; /* Yes, we need to inval the area on a clear */
  544. X      aWin -> scrollBar = (ControlHandle) NULL ;
  545. X! 
  546. X!     dprintf ( "Created window type %d" , type ) ;
  547. X!     aWin -> kind = type ;
  548. X!     aWin -> keyFunc = winKeyFuncs [ type ] ;
  549. X!     aWin -> clickFunc = winClickFuncs [ type ] ;
  550. X!     aWin -> updateFunc = winUpdateFuncs [ type ] ;
  551. X!     aWin -> cursorFunc = winCursorFuncs [ type ] ;
  552. X! 
  553. X!     if (type == NHW_BASE || type == NHW_MAP || type == NHW_STATUS) {
  554. X!         short x_sz, x_sz_p, y_sz_p;
  555. X!         dprintf ( "This is in the TTY window" ) ;
  556. X!         if (type == NHW_BASE) {
  557. X!             aWin -> keyFunc = winKeyFuncs [ NHW_MAP ] ;
  558. X!             aWin -> clickFunc = winClickFuncs [ NHW_MAP ] ;
  559. X!             aWin -> updateFunc = winUpdateFuncs [ NHW_MAP ] ;
  560. X!             aWin -> cursorFunc = winCursorFuncs [ NHW_MAP ] ;
  561. X!         } else {
  562. X!             if (i != tty_create_nhwindow(type)) {
  563. X!                 dprintf ( "Cannot create window type %d" , type ) ;
  564. X!             }
  565. X!             if (type == NHW_MAP) {
  566. X!                 wins[i]->offy = 0;    /* the message box is in a separate window */
  567. X!             }
  568. X          }
  569. X!         aWin->theWindow = _mt_window;
  570. X!         ((WindowPeek)aWin->theWindow)->windowKind = WIN_BASE_KIND + NHW_MAP;
  571. X!         get_tty_metrics(aWin->theWindow, &x_sz, &aWin->lin, &x_sz_p, &y_sz_p,
  572. X!                                          &aWin->fontNum, &aWin->fontSize,
  573. X!                                          &aWin->charWidth, &aWin->charHeight);
  574. X!         return i;
  575. X      }
  576. X  
  577. X+     aWin -> theWindow = GetNewWindow ( WIN_BASE_RES + type ,
  578. X+         ( WindowPtr ) 0L , ( WindowPtr ) -1L ) ;
  579. X+     ( ( WindowPeek ) aWin -> theWindow ) -> windowKind = WIN_BASE_KIND
  580. X+         + type ;
  581. X+     if ( ! ( aWin -> windowText = NewHandle ( TEXT_BLOCK ) ) ) {
  582. X+         error ( "NewHandle failed in create_nhwindow (%ld bytes)" ,
  583. X+             ( long ) TEXT_BLOCK ) ;
  584. X+         DisposeWindow ( aWin -> theWindow ) ;
  585. X+         aWin -> theWindow = (WindowPtr) NULL ;
  586. X+         return WIN_ERR ;
  587. X+     }
  588. X+     aWin -> lin = 0 ;
  589. X      clear_nhwindow ( i ) ;
  590. X  
  591. X  /*HARDCODED*/
  592. X***************
  593. X*** 566,576 ****
  594. X      PenPat ( &qd . black ) ;
  595. X  
  596. X      switch ( type ) {
  597. X-         case NHW_MAP :
  598. X-         case NHW_STATUS :
  599. X-             GetFNum ( "\pHackFont", & aWin -> fontNum ) ;
  600. X-             aWin -> fontSize = flags.large_font ? 12 : 9 ;
  601. X-             break ;
  602. X          case NHW_MESSAGE :
  603. X              GetFNum ( "\pPSHackFont", & aWin -> fontNum ) ;
  604. X              aWin -> fontSize = flags.large_font ? 12 : 9 ;
  605. X--- 573,578 ----
  606. X***************
  607. X*** 600,626 ****
  608. X      }
  609. X      SetPt ( & ( theWindows [ i ] . cursor ) , 0 , 0 ) ;
  610. X  
  611. X!     aWin -> kind = type ;
  612. X!     aWin -> keyFunc = winKeyFuncs [ type ] ;
  613. X!     aWin -> clickFunc = winClickFuncs [ type ] ;
  614. X!     aWin -> updateFunc = winUpdateFuncs [ type ] ;
  615. X!     aWin -> cursorFunc = winCursorFuncs [ type ] ;
  616. X!     SetWRefCon ( aWin -> theWindow , ( long ) aWin ) ;
  617. X! 
  618. X!     SetRect ( & siz , 0 , 0 , aWin -> charWidth * NUM_COLS ,
  619. X!         aWin -> charHeight * NUM_ROWS ) ;
  620. X!     switch ( type ) {
  621. X!     case NHW_MAP :
  622. X!         OffsetRect ( & siz , 50 , 50 ) ;
  623. X!         break ;
  624. X!     case NHW_BASE :
  625. X!         OffsetRect ( & siz , 20 , 10 ) ;
  626. X!         break ;
  627. X!     default :
  628. X!         siz = aWin -> theWindow -> portRect ;
  629. X!         OffsetRect ( & siz , 30 + rn2 ( 20 ) , 250 + rn2 ( 50 ) ) ;
  630. X!         break ;
  631. X!     }
  632. X      SizeWindow ( aWin -> theWindow , siz . right - siz . left ,
  633. X          siz . bottom - siz . top , FALSE ) ;
  634. X      MoveWindow ( aWin -> theWindow , siz . left , siz . top , FALSE ) ;
  635. X--- 602,609 ----
  636. X      }
  637. X      SetPt ( & ( theWindows [ i ] . cursor ) , 0 , 0 ) ;
  638. X  
  639. X!     siz = aWin -> theWindow -> portRect ;
  640. X!     OffsetRect ( & siz , 30 + rn2 ( 20 ) , 250 + rn2 ( 50 ) ) ;
  641. X      SizeWindow ( aWin -> theWindow , siz . right - siz . left ,
  642. X          siz . bottom - siz . top , FALSE ) ;
  643. X      MoveWindow ( aWin -> theWindow , siz . left , siz . top , FALSE ) ;
  644. X***************
  645. X*** 634,644 ****
  646. X          r . top -= 1 ;
  647. X          r . right += 1 ;
  648. X          bool = ( r . bottom > r . top + 50 ) ;
  649. X!         aWin -> scrollBar = NewControl ( aWin -> theWindow , & r , (StringPtr)"" ,
  650. X              bool , 0 , 0 , 0 , 16 , 0L ) ;
  651. X      }
  652. X      aWin -> scrollPos = 0 ;
  653. X-     aWin -> cursorDrawn = 0 ;
  654. X  
  655. X      return i ;
  656. X  }
  657. X--- 617,626 ----
  658. X          r . top -= 1 ;
  659. X          r . right += 1 ;
  660. X          bool = ( r . bottom > r . top + 50 ) ;
  661. X!         aWin -> scrollBar = NewControl ( aWin -> theWindow , & r , "\P" ,
  662. X              bool , 0 , 0 , 0 , 16 , 0L ) ;
  663. X      }
  664. X      aWin -> scrollPos = 0 ;
  665. X  
  666. X      return i ;
  667. X  }
  668. X***************
  669. X*** 655,665 ****
  670. X      return menu;
  671. X  }
  672. X  
  673. X  void
  674. X  InitRes ( void )
  675. X  {
  676. X!     Str255 str ;
  677. X  
  678. X      mBar = GetNewMBar ( 128 ) ;
  679. X      mustwork(ResError());
  680. X      SetMenuBar ( mBar ) ;
  681. X--- 637,725 ----
  682. X      return menu;
  683. X  }
  684. X  
  685. X+ 
  686. X+ #define A_LOT 0x7fffffff
  687. X+ #define HEAP_SPACE 100000
  688. X+ #define RES_FACTOR 1.1
  689. X+ 
  690. X+ static long
  691. X+ SpaceToLoad ( char * name ) {
  692. X+ FCBPBRec fcb ;
  693. X+ long ret ;
  694. X+ 
  695. X+     memset ( & fcb , 0 , sizeof ( fcb ) ) ;
  696. X+ 
  697. X+     fcb . ioRefNum = CurResFile ( ) ;
  698. X+     fcb . ioNamePtr = name ;
  699. X+     if ( PBGetFCBInfoSync ( & fcb ) ) {
  700. X+         return A_LOT ;
  701. X+     }
  702. X+     ret = fcb . ioFCBEOF * RES_FACTOR + HEAP_SPACE ;
  703. X+     dprintf ( "Space needed %ld" , ret ) ;
  704. X+     return ret ;
  705. X+ }
  706. X+ 
  707. X+ 
  708. X  void
  709. X  InitRes ( void )
  710. X  {
  711. X! #if 1    /* see macmenu.c:InitMenuRes */
  712. X! # if 0
  713. X! extern void InitMenuRes(void);
  714. X! int resIDIndex ;
  715. X! int resTypeIndex ;
  716. X! ResType resType , infoType ;
  717. X! Str255 name ;
  718. X! short id ;
  719. X! long spaceFree , totalContig ;
  720. X! Handle theResource ;
  721. X! static Boolean stuffLoaded = 0 ;
  722. X! # endif
  723. X  
  724. X+     InitMenuRes();
  725. X+ 
  726. X+ # if 0
  727. X+ /*
  728. X+  * For better performance (and powerbooks) we may want to load in the
  729. X+  * entire game to avoid spinning the disk up.
  730. X+  * This doesn't seem to be efficient, though. Better to just use whatever
  731. X+  * memory is assigned for default resource caching.
  732. X+  */
  733. X+     if ( ! stuffLoaded ) {
  734. X+         PurgeSpace ( & spaceFree , & totalContig ) ;
  735. X+         if ( spaceFree > SpaceToLoad ( name ) ) {
  736. X+             dprintf ( "Space now: %ld" , spaceFree ) ;
  737. X+             SetResLoad ( 0 ) ;
  738. X+             for ( resTypeIndex = Count1Types ( ) ; resTypeIndex > 0 ; resTypeIndex -- ) {
  739. X+                 Get1IndType ( & resType , resTypeIndex ) ;
  740. X+                 for ( resIDIndex = Count1Resources ( resType ) ; resIDIndex > 0 ; resIDIndex -- ) {
  741. X+                     theResource = Get1IndResource ( resType , resIDIndex ) ;
  742. X+                     if ( ! * theResource ) {
  743. X+                         GetResInfo ( theResource , & id , & infoType , name ) ;
  744. X+ #  ifdef applec
  745. X+                         if ( infoType != 'CODE'  || ! EqualString ( name , "\P%A5Init" , 0 , 0 ) ) {
  746. X+ #  else
  747. X+                         if ( infotype != 'ZREF' && infoType != 'DATA' ) {
  748. X+ #  endif
  749. X+                             LoadResource ( theResource ) ;
  750. X+                             HUnlock ( theResource ) ;
  751. X+                             MoveHHi ( theResource ) ;
  752. X+                             HLock ( theResource ) ;
  753. X+                         }
  754. X+                     }
  755. X+                 }
  756. X+             }
  757. X+             SetResLoad ( 1 ) ;
  758. X+             stuffLoaded = 1 ;
  759. X+         } else {
  760. X+             dprintf ( "Space now: %ld" , spaceFree ) ;
  761. X+         }
  762. X+     }
  763. X+ # endif
  764. X+ 
  765. X+ #else
  766. X+ Str255 str ;
  767. X+ 
  768. X      mBar = GetNewMBar ( 128 ) ;
  769. X      mustwork(ResError());
  770. X      SetMenuBar ( mBar ) ;
  771. X***************
  772. X*** 689,694 ****
  773. X--- 749,755 ----
  774. X      DrawMenuBar ( ) ;
  775. X  
  776. X      return ;
  777. X+ #endif    /* see macmenu.c:InitMenuRes */
  778. X  }
  779. X  
  780. X  
  781. X***************
  782. X*** 714,733 ****
  783. X          keyQueue [ i ] = 0 ;
  784. X      }
  785. X  
  786. X-     BASE_WINDOW = create_nhwindow ( NHW_TEXT ) ;
  787. X-     clear_nhwindow(BASE_WINDOW);
  788. X-     putstr(BASE_WINDOW, 0, "");
  789. X-     putstr(BASE_WINDOW, 0,
  790. X-       "NetHack, Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993");
  791. X-     putstr(BASE_WINDOW, 0,
  792. X-       "         By Stichting Mathematisch Centrum and M. Stephenson.");
  793. X-     putstr(BASE_WINDOW, 0, "         See license for details.");
  794. X-     putstr(BASE_WINDOW, 0, "");
  795. X-     display_nhwindow(BASE_WINDOW, FALSE);
  796. X- 
  797. X-     flags . window_inited = 1 ;
  798. X      DimMenuBar ( ) ;
  799. X!     normal_font ( ) ;
  800. X  }
  801. X  
  802. X  
  803. X--- 775,788 ----
  804. X          keyQueue [ i ] = 0 ;
  805. X      }
  806. X  
  807. X      DimMenuBar ( ) ;
  808. X! 
  809. X!     tty_init_nhwindows();
  810. X!     flags.window_inited = TRUE;
  811. X! 
  812. X!     /* Some ugly hacks to make both interfaces happy */
  813. X!     mac_create_nhwindow(NHW_BASE);
  814. X!     tty_create_nhwindow(NHW_MESSAGE);
  815. X  }
  816. X  
  817. X  
  818. X***************
  819. X*** 752,761 ****
  820. X  static void
  821. X  DrawScrollbar ( NhWindow * aWin , WindowPtr theWindow )
  822. X  {
  823. X!     Rect r2 = theWindow -> portRect ;
  824. X!     Rect r = r2 ;
  825. X!     Boolean vis ;
  826. X!     short val , lin ;
  827. X  
  828. X      if ( ! aWin -> scrollBar ) {
  829. X          return ;
  830. X--- 807,816 ----
  831. X  static void
  832. X  DrawScrollbar ( NhWindow * aWin , WindowPtr theWindow )
  833. X  {
  834. X! Rect r2 = theWindow -> portRect ;
  835. X! Rect r = r2 ;
  836. X! Boolean vis ;
  837. X! short val , lin ;
  838. X  
  839. X      if ( ! aWin -> scrollBar ) {
  840. X          return ;
  841. X***************
  842. X*** 766,777 ****
  843. X      r2 . right += 1 ;
  844. X      r2 . top -= 1 ;
  845. X      if ( ( * aWin -> scrollBar ) -> contrlRect . top  != r2 . top ||
  846. X!          ( * aWin -> scrollBar ) -> contrlRect . left != r2 . left )
  847. X          MoveControl ( aWin -> scrollBar , r2 . left , r2 . top ) ;
  848. X      if ( ( * aWin -> scrollBar ) -> contrlRect . bottom != r2 . bottom ||
  849. X!          ( * aWin -> scrollBar ) -> contrlRect . right  != r2 . right )
  850. X          SizeControl ( aWin -> scrollBar , r2 . right  - r2 . left ,
  851. X                                            r2 . bottom - r2 . top ) ;
  852. X      vis = ( r2 . bottom > r2 . top + 50 ) ;
  853. X      if ( vis && ! ( * aWin -> scrollBar ) -> contrlVis ) {
  854. X          ShowControl ( aWin -> scrollBar ) ;
  855. X--- 821,834 ----
  856. X      r2 . right += 1 ;
  857. X      r2 . top -= 1 ;
  858. X      if ( ( * aWin -> scrollBar ) -> contrlRect . top  != r2 . top ||
  859. X!          ( * aWin -> scrollBar ) -> contrlRect . left != r2 . left ) {
  860. X          MoveControl ( aWin -> scrollBar , r2 . left , r2 . top ) ;
  861. X+     }
  862. X      if ( ( * aWin -> scrollBar ) -> contrlRect . bottom != r2 . bottom ||
  863. X!          ( * aWin -> scrollBar ) -> contrlRect . right  != r2 . right ) {
  864. X          SizeControl ( aWin -> scrollBar , r2 . right  - r2 . left ,
  865. X                                            r2 . bottom - r2 . top ) ;
  866. X+     }
  867. X      vis = ( r2 . bottom > r2 . top + 50 ) ;
  868. X      if ( vis && ! ( * aWin -> scrollBar ) -> contrlVis ) {
  869. X          ShowControl ( aWin -> scrollBar ) ;
  870. X***************
  871. X*** 784,798 ****
  872. X          r . bottom -= SBARHEIGHT + 1 ;
  873. X          min = aWin -> save_lin + ( r . bottom - r . top ) / aWin ->
  874. X              charHeight ;
  875. X!         if ( lin < min )
  876. X              lin = min ;
  877. X      }
  878. X      if ( lin ) {
  879. X          short max = lin - ( r . bottom - r . top ) / aWin -> charHeight ;
  880. X!         if ( max < 0 ) max = 0 ;
  881. X          SetCtlMax ( aWin -> scrollBar , max ) ;
  882. X!         if ( max ) HiliteControl ( aWin -> scrollBar , 0 ) ;
  883. X!         else HiliteControl ( aWin -> scrollBar , 255 ) ;
  884. X      } else {
  885. X          HiliteControl ( aWin -> scrollBar , 255 ) ;
  886. X      }
  887. X--- 841,861 ----
  888. X          r . bottom -= SBARHEIGHT + 1 ;
  889. X          min = aWin -> save_lin + ( r . bottom - r . top ) / aWin ->
  890. X              charHeight ;
  891. X!         if ( lin < min ) {
  892. X              lin = min ;
  893. X+         }
  894. X      }
  895. X      if ( lin ) {
  896. X          short max = lin - ( r . bottom - r . top ) / aWin -> charHeight ;
  897. X!         if ( max < 0 ) {
  898. X!             max = 0 ;
  899. X!         }
  900. X          SetCtlMax ( aWin -> scrollBar , max ) ;
  901. X!         if ( max ) {
  902. X!             HiliteControl ( aWin -> scrollBar , 0 ) ;
  903. X!         } else {
  904. X!             HiliteControl ( aWin -> scrollBar , 255 ) ;
  905. X!         }
  906. X      } else {
  907. X          HiliteControl ( aWin -> scrollBar , 255 ) ;
  908. X      }
  909. X***************
  910. X*** 823,829 ****
  911. X  {
  912. X      long l ;
  913. X      Rect r ;
  914. X-     register char * start , * stop ;
  915. X      WindowPtr theWindow ;
  916. X      NhWindow * aWin = & theWindows [ win ] ;
  917. X  
  918. X--- 886,891 ----
  919. X***************
  920. X*** 831,839 ****
  921. X          error ( "Invalid window %d in clear_nhwindow." , win ) ;
  922. X          return ;
  923. X      }
  924. X      if ( aWin -> clear )
  925. X          return ;
  926. X-     theWindow = aWin -> theWindow ;
  927. X      if ( ! theWindow ) {
  928. X          error ( "Unallocated window %d in clear_nhwindow." , win ) ;
  929. X          return ;
  930. X--- 893,907 ----
  931. X          error ( "Invalid window %d in clear_nhwindow." , win ) ;
  932. X          return ;
  933. X      }
  934. X+ 
  935. X+     theWindow = aWin -> theWindow ;
  936. X+     if (theWindow == _mt_window) {
  937. X+         tty_clear_nhwindow(win);
  938. X+         return;
  939. X+     }
  940. X+ 
  941. X      if ( aWin -> clear )
  942. X          return ;
  943. X      if ( ! theWindow ) {
  944. X          error ( "Unallocated window %d in clear_nhwindow." , win ) ;
  945. X          return ;
  946. X***************
  947. X*** 846,863 ****
  948. X          r . bottom -= SBARHEIGHT + 1 ;
  949. X      InvalRect ( & r ) ;
  950. X      switch ( ( ( WindowPeek ) theWindow ) -> windowKind - WIN_BASE_KIND ) {
  951. X-     case NHW_MAP :
  952. X-         stop = ( char * ) ( ( MapData * ) ( * aWin -> windowText ) )
  953. X-             -> map ;
  954. X-         start = stop + NUM_COLS * NUM_ROWS ;
  955. X-         while ( start > stop ) * -- start = CHAR_BLANK ;
  956. X-         break ;
  957. X-     case NHW_STATUS :
  958. X-         stop = ( char * ) ( ( StatusData * ) ( * aWin -> windowText ) )
  959. X-             -> map ;
  960. X-         start = stop + NUM_COLS * NUM_STAT_ROWS ;
  961. X-         while ( start > stop ) * -- start = CHAR_BLANK ;
  962. X-         break ;
  963. X      case NHW_MESSAGE :
  964. X          l = 0;
  965. X          while (aWin->lin > flags.msg_history) {
  966. X--- 914,919 ----
  967. X***************
  968. X*** 892,898 ****
  969. X      }
  970. X      SetPt ( & ( aWin -> cursor ) , 0 , 0 ) ;
  971. X      aWin -> clear = 1 ;
  972. X-     aWin -> cursorDrawn = 0 ;
  973. X  }
  974. X  
  975. X  
  976. X--- 948,953 ----
  977. X***************
  978. X*** 1222,1235 ****
  979. X          return ;
  980. X      }
  981. X  
  982. X!     if ( f && inSelect == WIN_ERR && ( win == BASE_WINDOW || win == WIN_MESSAGE ) ) {
  983. X!         if ( win == WIN_MESSAGE ) {
  984. X!             topl_set_resp ( NULL , 0 ) ;
  985. X!             if ( aWin -> windowTextLen > 0 &&
  986. X!                  ( * aWin -> windowText ) [ aWin -> windowTextLen - 1 ] == CHAR_CR ) {
  987. X!                 -- aWin -> windowTextLen ;
  988. X!                 -- aWin -> lin ;
  989. X!             }
  990. X          }
  991. X          putstr ( win , flags . standout ? ATR_INVERSE : ATR_NONE , " --More--" ) ;
  992. X      }
  993. X--- 1277,1293 ----
  994. X          return ;
  995. X      }
  996. X  
  997. X!     if (theWindow == _mt_window) {
  998. X!         tty_display_nhwindow(win, f);
  999. X!         return;
  1000. X!     }
  1001. X! 
  1002. X!     if ( f && inSelect == WIN_ERR && win == WIN_MESSAGE ) {
  1003. X!         topl_set_resp ( NULL , 0 ) ;
  1004. X!         if ( aWin -> windowTextLen > 0 &&
  1005. X!              ( * aWin -> windowText ) [ aWin -> windowTextLen - 1 ] == CHAR_CR ) {
  1006. X!             -- aWin -> windowTextLen ;
  1007. X!             -- aWin -> lin ;
  1008. X          }
  1009. X          putstr ( win , flags . standout ? ATR_INVERSE : ATR_NONE , " --More--" ) ;
  1010. X      }
  1011. X***************
  1012. X*** 1236,1243 ****
  1013. X  
  1014. X      if ( ! ( ( WindowPeek ) theWindow ) -> visible || full_screen ) {
  1015. X  
  1016. X!         int kind = ((WindowPeek)theWindow)->windowKind - WIN_BASE_KIND;
  1017. X!         if (kind == NHW_TEXT || kind == NHW_MENU) {
  1018. X              const char cr = CHAR_CR;
  1019. X              short w = 0;
  1020. X              long line_start = 0;
  1021. X--- 1294,1300 ----
  1022. X  
  1023. X      if ( ! ( ( WindowPeek ) theWindow ) -> visible || full_screen ) {
  1024. X  
  1025. X!         if ( win != WIN_MESSAGE ) {
  1026. X              const char cr = CHAR_CR;
  1027. X              short w = 0;
  1028. X              long line_start = 0;
  1029. X***************
  1030. X*** 1280,1286 ****
  1031. X  
  1032. X          if ( win == WIN_MESSAGE )
  1033. X              topl_set_resp ( "" , '\0' ) ;
  1034. X!         else if ( win != WIN_MAP && win != WIN_STATUS )
  1035. X              HideWindow ( theWindow ) ;
  1036. X  
  1037. X      } else {
  1038. X--- 1337,1343 ----
  1039. X  
  1040. X          if ( win == WIN_MESSAGE )
  1041. X              topl_set_resp ( "" , '\0' ) ;
  1042. X!         else
  1043. X              HideWindow ( theWindow ) ;
  1044. X  
  1045. X      } else {
  1046. X***************
  1047. X*** 1308,1313 ****
  1048. X--- 1365,1376 ----
  1049. X              win ) ;
  1050. X          return ;
  1051. X      }
  1052. X+ /*
  1053. X+  *    if (theWindow == _mt_window) {
  1054. X+  *        tty_destroy_nhwindow(win);
  1055. X+  *        return;
  1056. X+  *    }
  1057. X+  */
  1058. X  
  1059. X      /*
  1060. X       * Check special windows.
  1061. X***************
  1062. X*** 1318,1325 ****
  1063. X      if ( win == BASE_WINDOW ) {
  1064. X          return ;
  1065. X      }
  1066. X!     if ( win == WIN_INVEN || win == WIN_STATUS || win == WIN_MAP ||
  1067. X!         win == WIN_MESSAGE ) {
  1068. X          if ( flags . window_inited ) {
  1069. X              if ( flags . tombstone && killer ) {
  1070. X                  /* Prepare for the coming of the tombstone window. */
  1071. X--- 1381,1387 ----
  1072. X      if ( win == BASE_WINDOW ) {
  1073. X          return ;
  1074. X      }
  1075. X!     if ( win == WIN_INVEN || win == WIN_MESSAGE ) {
  1076. X          if ( flags . window_inited ) {
  1077. X              if ( flags . tombstone && killer ) {
  1078. X                  /* Prepare for the coming of the tombstone window. */
  1079. X***************
  1080. X*** 1333,1339 ****
  1081. X      kind = ( ( WindowPeek ) theWindow ) -> windowKind - WIN_BASE_KIND ;
  1082. X      visible = ( ( WindowPeek ) theWindow ) -> visible ;
  1083. X  
  1084. X!     if ( ! visible || ( kind != NHW_MENU && kind != NHW_TEXT ) ) {
  1085. X          DisposeWindow ( theWindow ) ;
  1086. X          if ( aWin -> windowText ) {
  1087. X              DisposHandle ( aWin -> windowText ) ;
  1088. X--- 1395,1402 ----
  1089. X      kind = ( ( WindowPeek ) theWindow ) -> windowKind - WIN_BASE_KIND ;
  1090. X      visible = ( ( WindowPeek ) theWindow ) -> visible ;
  1091. X  
  1092. X!     if ( ( ! visible || ( kind != NHW_MENU && kind != NHW_TEXT ) ) &&
  1093. X!         theWindow != _mt_window ) {
  1094. X          DisposeWindow ( theWindow ) ;
  1095. X          if ( aWin -> windowText ) {
  1096. X              DisposHandle ( aWin -> windowText ) ;
  1097. X***************
  1098. X*** 1378,1385 ****
  1099. X  void
  1100. X  GeneralKey ( EventRecord * theEvent , WindowPtr theWindow )
  1101. X  {
  1102. X      trans_num_keys ( theEvent ) ;
  1103. X!     addToKeyQueue ( topl_resp_key ( theEvent -> message & 0xff ) , 1 ) ;
  1104. X  }
  1105. X  
  1106. X  
  1107. X--- 1441,1451 ----
  1108. X  void
  1109. X  GeneralKey ( EventRecord * theEvent , WindowPtr theWindow )
  1110. X  {
  1111. X+ #if defined(applec)
  1112. X+ # pragma unused(theWindow)
  1113. X+ #endif
  1114. X      trans_num_keys ( theEvent ) ;
  1115. X!     AddToKeyQueue ( topl_resp_key ( theEvent -> message & 0xff ) , 1 ) ;
  1116. X  }
  1117. X  
  1118. X  
  1119. X***************
  1120. X*** 1398,1404 ****
  1121. X  
  1122. X  
  1123. X  static void
  1124. X! macKeyStatus ( EventRecord * theEvent , WindowPtr theWindow )
  1125. X  {
  1126. X      GeneralKey ( theEvent , theWindow ) ;
  1127. X  }
  1128. X--- 1464,1470 ----
  1129. X  
  1130. X  
  1131. X  static void
  1132. X! macKeyTerm ( EventRecord * theEvent , WindowPtr theWindow )
  1133. X  {
  1134. X      GeneralKey ( theEvent , theWindow ) ;
  1135. X  }
  1136. X***************
  1137. X*** 1405,1421 ****
  1138. X  
  1139. X  
  1140. X  static void
  1141. X- macKeyMap ( EventRecord * theEvent , WindowPtr theWindow )
  1142. X- {
  1143. X-     GeneralKey ( theEvent , theWindow ) ;
  1144. X- }
  1145. X- 
  1146. X- 
  1147. X- static void
  1148. X  macKeyMenu ( EventRecord * theEvent , WindowPtr theWindow )
  1149. X  {
  1150. X      if ( filter_scroll_key ( theEvent -> message & 0xff ,
  1151. X!         ( NhWindow * ) GetWRefCon ( theWindow ) ) ) {
  1152. X          GeneralKey ( theEvent , theWindow ) ;
  1153. X      }
  1154. X  }
  1155. X--- 1471,1480 ----
  1156. X  
  1157. X  
  1158. X  static void
  1159. X  macKeyMenu ( EventRecord * theEvent , WindowPtr theWindow )
  1160. X  {
  1161. X      if ( filter_scroll_key ( theEvent -> message & 0xff ,
  1162. X!         GetNhWin ( theWindow ) ) ) {
  1163. X          GeneralKey ( theEvent , theWindow ) ;
  1164. X      }
  1165. X  }
  1166. X***************
  1167. X*** 1425,1435 ****
  1168. X  macKeyText ( EventRecord * theEvent , WindowPtr theWindow )
  1169. X  {
  1170. X      char c = filter_scroll_key ( theEvent -> message & 0xff ,
  1171. X!                                  ( NhWindow * ) GetWRefCon ( theWindow ) ) ;
  1172. X      if ( c )
  1173. X          if ( inSelect == WIN_ERR && ClosingWindowChar ( c ) ) {
  1174. X              HideWindow ( theWindow ) ;
  1175. X!             destroy_nhwindow ( ( NhWindow * ) GetWRefCon ( theWindow ) - theWindows ) ;
  1176. X          } else {
  1177. X              GeneralKey ( theEvent , theWindow ) ;
  1178. X          }
  1179. X--- 1484,1494 ----
  1180. X  macKeyText ( EventRecord * theEvent , WindowPtr theWindow )
  1181. X  {
  1182. X      char c = filter_scroll_key ( theEvent -> message & 0xff ,
  1183. X!                                  GetNhWin ( theWindow ) ) ;
  1184. X      if ( c )
  1185. X          if ( inSelect == WIN_ERR && ClosingWindowChar ( c ) ) {
  1186. X              HideWindow ( theWindow ) ;
  1187. X!             destroy_nhwindow ( GetNhWin ( theWindow ) - theWindows ) ;
  1188. X          } else {
  1189. X              GeneralKey ( theEvent , theWindow ) ;
  1190. X          }
  1191. X***************
  1192. X*** 1469,1475 ****
  1193. X              }
  1194. X              if (in_btn) {
  1195. X                  InvertRect(&frame);
  1196. X!                 addToKeyQueue ( topl_resp [ r_idx ] , 1 ) ;
  1197. X              }
  1198. X              return;
  1199. X  
  1200. X--- 1528,1534 ----
  1201. X              }
  1202. X              if (in_btn) {
  1203. X                  InvertRect(&frame);
  1204. X!                 AddToKeyQueue ( topl_resp [ r_idx ] , 1 ) ;
  1205. X              }
  1206. X              return;
  1207. X  
  1208. X***************
  1209. X*** 1482,1504 ****
  1210. X  
  1211. X  
  1212. X  static void
  1213. X! macClickStatus ( EventRecord * theEvent , WindowPtr theWindow )
  1214. X  {
  1215. X-     if ( ! theEvent || ! theWindow ) {
  1216. X-         Debugger ( ) ;
  1217. X-     }
  1218. X- }
  1219. X- 
  1220. X- 
  1221. X- static void
  1222. X- macClickMap ( EventRecord * theEvent , WindowPtr theWindow )
  1223. X- {
  1224. X      int shift_down = theEvent->modifiers & shiftKey;
  1225. X!     NhWindow *nhw = (NhWindow *)GetWRefCon(theWindow);
  1226. X      Point where = theEvent->where;
  1227. X          GlobalToLocal(&where);
  1228. X!         where.h /= nhw->charWidth;
  1229. X!         where.v /= nhw->charHeight;
  1230. X      clicked_mod = shift_down ? CLICK_2 : CLICK_1;
  1231. X  
  1232. X      if (strchr(topl_resp, click_to_cmd(where.h, where.v, clicked_mod)))
  1233. X--- 1541,1554 ----
  1234. X  
  1235. X  
  1236. X  static void
  1237. X! macClickTerm ( EventRecord * theEvent , WindowPtr theWindow )
  1238. X  {
  1239. X      int shift_down = theEvent->modifiers & shiftKey;
  1240. X!     NhWindow *nhw = GetNhWin(theWindow);
  1241. X      Point where = theEvent->where;
  1242. X          GlobalToLocal(&where);
  1243. X!         where.h = where.h / nhw->charWidth + 1;
  1244. X!         where.v = where.v / nhw->charHeight;
  1245. X      clicked_mod = shift_down ? CLICK_2 : CLICK_1;
  1246. X  
  1247. X      if (strchr(topl_resp, click_to_cmd(where.h, where.v, clicked_mod)))
  1248. X***************
  1249. X*** 1675,1681 ****
  1250. X      Point p ;
  1251. X      short hiRow = -1 , loRow = -1 ;
  1252. X      Rect r ;
  1253. X!     NhWindow * aWin = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  1254. X  
  1255. X      r = theWindow -> portRect ;
  1256. X      if ( aWin -> scrollBar && ( * aWin -> scrollBar ) -> contrlVis ) {
  1257. X--- 1725,1731 ----
  1258. X      Point p ;
  1259. X      short hiRow = -1 , loRow = -1 ;
  1260. X      Rect r ;
  1261. X!     NhWindow * aWin = GetNhWin ( theWindow ) ;
  1262. X  
  1263. X      r = theWindow -> portRect ;
  1264. X      if ( aWin -> scrollBar && ( * aWin -> scrollBar ) -> contrlVis ) {
  1265. X***************
  1266. X*** 1725,1731 ****
  1267. X          } while ( StillDown ( ) ) ;
  1268. X          if ( loRow > -1 && aWin -> itemChars [ loRow + aWin -> scrollPos ] ) {
  1269. X              InvertRect ( & r ) ;
  1270. X!             addToKeyQueue ( aWin -> itemChars [ loRow + aWin -> scrollPos ] , 1 ) ;
  1271. X          }
  1272. X      }
  1273. X  }
  1274. X--- 1775,1781 ----
  1275. X          } while ( StillDown ( ) ) ;
  1276. X          if ( loRow > -1 && aWin -> itemChars [ loRow + aWin -> scrollPos ] ) {
  1277. X              InvertRect ( & r ) ;
  1278. X!             AddToKeyQueue ( aWin -> itemChars [ loRow + aWin -> scrollPos ] , 1 ) ;
  1279. X          }
  1280. X      }
  1281. X  }
  1282. X***************
  1283. X*** 1736,1742 ****
  1284. X  {
  1285. X      short hiRow = -1 , loRow = -1 ;
  1286. X      Rect r ;
  1287. X!     NhWindow * aWin = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  1288. X  
  1289. X      r = theWindow -> portRect ;
  1290. X      if ( aWin -> scrollBar && ( * aWin -> scrollBar ) -> contrlVis ) {
  1291. X--- 1786,1792 ----
  1292. X  {
  1293. X      short hiRow = -1 , loRow = -1 ;
  1294. X      Rect r ;
  1295. X!     NhWindow * aWin = GetNhWin ( theWindow ) ;
  1296. X  
  1297. X      r = theWindow -> portRect ;
  1298. X      if ( aWin -> scrollBar && ( * aWin -> scrollBar ) -> contrlVis ) {
  1299. X***************
  1300. X*** 1787,1793 ****
  1301. X  {
  1302. X      RgnHandle org_clip = NewRgn(), clip = NewRgn();
  1303. X      Rect r = theWindow -> portRect ;
  1304. X!     NhWindow * aWin = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  1305. X      int l ;
  1306. X  
  1307. X      if ( ! theEvent ) {
  1308. X--- 1837,1843 ----
  1309. X  {
  1310. X      RgnHandle org_clip = NewRgn(), clip = NewRgn();
  1311. X      Rect r = theWindow -> portRect ;
  1312. X!     NhWindow * aWin = GetNhWin ( theWindow ) ;
  1313. X      int l ;
  1314. X  
  1315. X      if ( ! theEvent ) {
  1316. X***************
  1317. X*** 1907,1989 ****
  1318. X  
  1319. X  
  1320. X  static void
  1321. X! macUpdateStatus ( EventRecord * theEvent , WindowPtr theWindow )
  1322. X  {
  1323. X!     NhWindow * nhw = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  1324. X!     int height = nhw -> charHeight ;
  1325. X!     int leading = nhw -> leading ;
  1326. X!     int i ;
  1327. X! 
  1328. X!     if ( ! theEvent ) {
  1329. X!         Debugger ( ) ;
  1330. X!     }
  1331. X! 
  1332. X!     TextFont ( nhw -> fontNum ) ;
  1333. X!     TextSize ( nhw -> fontSize ) ;
  1334. X!     HLock ( nhw -> windowText ) ;
  1335. X!     for ( i = 0 ; i < NUM_STAT_ROWS ; i ++ ) {
  1336. X!         MoveTo ( 0 , ( i + 1 ) * height - leading ) ;
  1337. X!         DrawText ( ( ( StatusData * ) ( * nhw -> windowText ) ) -> map [ i ] ,
  1338. X!             0 , NUM_COLS ) ;
  1339. X!     }
  1340. X!     HUnlock ( nhw -> windowText ) ;
  1341. X  }
  1342. X  
  1343. X  
  1344. X  static void
  1345. X- DrawMapCursor ( NhWindow * nhw )
  1346. X- {
  1347. X-     Rect r ;
  1348. X- 
  1349. X-     /*
  1350. X-      * We only want a cursor in the map
  1351. X-      * window...
  1352. X-      */
  1353. X-     if ( ! WIN_MAP || nhw - theWindows != WIN_MAP )
  1354. X-         return ;
  1355. X- 
  1356. X-     r . left = nhw -> cursor . h * nhw -> charWidth ;
  1357. X-     r . right = ( nhw -> cursor . h + 1 ) * nhw -> charWidth ;
  1358. X-     r . top = nhw -> cursor . v * nhw -> charHeight ;
  1359. X-     r . bottom = ( nhw -> cursor . v + 1 ) * nhw -> charHeight ;
  1360. X-     InvertRect ( & r ) ;
  1361. X-     nhw -> cursorDrawn = 1 ;
  1362. X- }
  1363. X- 
  1364. X- 
  1365. X- static void
  1366. X- macUpdateMap ( EventRecord * theEvent , WindowPtr theWindow )
  1367. X- {
  1368. X-     NhWindow * nhw = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  1369. X-     int height = nhw -> charHeight ;
  1370. X-     int leading = nhw -> leading ;
  1371. X-     int i ;
  1372. X- 
  1373. X-     if ( ! theEvent ) {
  1374. X-         Debugger ( ) ;
  1375. X-     }
  1376. X- 
  1377. X-     TextFont ( nhw -> fontNum ) ;
  1378. X-     TextSize ( nhw -> fontSize ) ;
  1379. X-     HLock ( nhw -> windowText ) ;
  1380. X-     for ( i = 0 ; i < NUM_ROWS ; i ++ ) {
  1381. X-         MoveTo ( 0 , ( i + 1 ) * height - leading ) ;
  1382. X-         DrawText ( ( ( MapData * ) ( * nhw -> windowText ) ) -> map [ i ] ,
  1383. X-             0 , NUM_COLS ) ;
  1384. X-     }
  1385. X-     HUnlock ( nhw -> windowText ) ;
  1386. X-     if ( nhw -> cursorDrawn ) {
  1387. X-         DrawMapCursor ( nhw ) ;
  1388. X-     }
  1389. X- }
  1390. X- 
  1391. X- 
  1392. X- static void
  1393. X  macUpdateMenu ( EventRecord * theEvent , WindowPtr theWindow )
  1394. X  {
  1395. X      Rect r = theWindow -> portRect ;
  1396. X      Rect r2 = r ;
  1397. X!     NhWindow * aWin = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  1398. X      RgnHandle h ;
  1399. X      Boolean vis ;
  1400. X  
  1401. X--- 1957,1978 ----
  1402. X  
  1403. X  
  1404. X  static void
  1405. X! macUpdateTerm ( EventRecord * theEvent , WindowPtr theWindow )
  1406. X  {
  1407. X! #if defined(applec)
  1408. X! # pragma unused(theEvent)
  1409. X! #endif
  1410. X!     tty_environment_changed ( theWindow ) ;
  1411. X!     image_tty(theWindow);
  1412. X  }
  1413. X  
  1414. X  
  1415. X  static void
  1416. X  macUpdateMenu ( EventRecord * theEvent , WindowPtr theWindow )
  1417. X  {
  1418. X      Rect r = theWindow -> portRect ;
  1419. X      Rect r2 = r ;
  1420. X!     NhWindow * aWin = GetNhWin ( theWindow ) ;
  1421. X      RgnHandle h ;
  1422. X      Boolean vis ;
  1423. X  
  1424. END_OF_FILE
  1425. if test 39051 -ne `wc -c <'patches02p.1'`; then
  1426.     echo shar: \"'patches02p.1'\" unpacked with wrong size!
  1427. fi
  1428. # end of 'patches02p.1'
  1429. if test -f 'src/sounds.c' -a "${1}" != "-c" ; then 
  1430.   echo shar: Renaming existing file \"'src/sounds.c'\" to \"'src/sounds.c.orig'\"
  1431.   mv -f 'src/sounds.c' 'src/sounds.c.orig'
  1432. fi
  1433. echo shar: Extracting \"'src/sounds.c'\" \(16940 characters\)
  1434. sed "s/^X//" >'src/sounds.c' <<'END_OF_FILE'
  1435. X/*    SCCS Id: @(#)sounds.c    3.1    93/03/14    */
  1436. X/*    Copyright (c) 1989 Janet Walz, Mike Threepoint */
  1437. X/* NetHack may be freely redistributed.  See license for details. */
  1438. X
  1439. X#include "hack.h"
  1440. X#include "edog.h"
  1441. X
  1442. X#ifdef OVLB
  1443. X
  1444. Xstatic int FDECL(domonnoise,(struct monst *));
  1445. Xstatic int NDECL(dochat);
  1446. X
  1447. X#endif /* OVLB */
  1448. X
  1449. X#ifdef SOUNDS
  1450. X
  1451. X#ifdef OVL0
  1452. X
  1453. Xvoid
  1454. Xdosounds()
  1455. X{
  1456. X    register xchar hallu;
  1457. X    register struct mkroom *sroom;
  1458. X    register int vx, vy;
  1459. X#if defined(AMIGA) && defined(AZTEC_C_WORKAROUND)
  1460. X    int xx;
  1461. X#endif
  1462. X
  1463. X    hallu = Hallucination ? 1 : 0;
  1464. X
  1465. X    if(!flags.soundok || u.uswallow || Underwater) return;
  1466. X
  1467. X    if (level.flags.nfountains && !rn2(400)) {
  1468. X    static const char *fountain_msg[4] = {
  1469. X        "hear bubbling water.",
  1470. X        "hear water falling on coins.",
  1471. X        "hear the splashing of a naiad.",
  1472. X        "hear a soda fountain!",
  1473. X    };
  1474. X    You(fountain_msg[rn2(3)+hallu]);
  1475. X    }
  1476. X#ifdef SINK
  1477. X    if (level.flags.nsinks && !rn2(300)) {
  1478. X    static const char *sink_msg[3] = {
  1479. X        "hear a slow drip.",
  1480. X        "hear a gurgling noise.",
  1481. X        "hear dishes being washed!",
  1482. X    };
  1483. X    You(sink_msg[rn2(2)+hallu]);
  1484. X    }
  1485. X#endif
  1486. X    if (level.flags.has_court && !rn2(200)) {
  1487. X    static const char *throne_msg[4] = {
  1488. X        "hear the tones of courtly conversation.",
  1489. X        "hear a sceptre pounded in judgment.",
  1490. X        "Someone shouts \"Off with %s head!\"",
  1491. X        "hear Queen Beruthiel's cats!",
  1492. X    };
  1493. X    int which = rn2(3)+hallu;
  1494. X    if (which != 2) You(throne_msg[which]);
  1495. X    else        pline(throne_msg[2], his[flags.female]);
  1496. X    return;
  1497. X    }
  1498. X    if (level.flags.has_swamp && !rn2(200)) {
  1499. X    static const char *swamp_msg[3] = {
  1500. X        "hear mosquitoes!",
  1501. X        "smell marsh gas!",    /* so it's a smell...*/
  1502. X        "hear Donald Duck!",
  1503. X    };
  1504. X    You(swamp_msg[rn2(2)+hallu]);
  1505. X    return;
  1506. X    }
  1507. X    if (level.flags.has_vault && !rn2(200)) {
  1508. X    if (!(sroom = search_special(VAULT))) {
  1509. X        /* strange ... */
  1510. X        level.flags.has_vault = 0;
  1511. X        return;
  1512. X    }
  1513. X    if(gd_sound())
  1514. X        switch (rn2(2)+hallu) {
  1515. X        case 1: {
  1516. X            boolean gold_in_vault = FALSE;
  1517. X
  1518. X            for (vx = sroom->lx;vx <= sroom->hx; vx++)
  1519. X            for (vy = sroom->ly; vy <= sroom->hy; vy++)
  1520. X                if (g_at(vx, vy))
  1521. X                gold_in_vault = TRUE;
  1522. X#if defined(AMIGA) && defined(AZTEC_C_WORKAROUND)
  1523. X            /* Bug in aztec assembler here. Workaround below */
  1524. X            xx = ROOM_INDEX(sroom) + ROOMOFFSET;
  1525. X            xx = (xx != vault_occupied(u.urooms));
  1526. X            if(xx)
  1527. X#else
  1528. X            if (vault_occupied(u.urooms) != 
  1529. X             (ROOM_INDEX(sroom) + ROOMOFFSET))
  1530. X#endif /* AZTEC_C_WORKAROUND */
  1531. X            {
  1532. X            if (gold_in_vault)
  1533. X                You(!hallu ? "hear someone counting money." :
  1534. X                "hear the quarterback calling the play.");
  1535. X            else
  1536. X                You("hear someone searching.");
  1537. X            break;
  1538. X            }
  1539. X            /* fall into... (yes, even for hallucination) */
  1540. X        }
  1541. X        case 0:
  1542. X            You("hear the footsteps of a guard on patrol.");
  1543. X            break;
  1544. X        case 2:
  1545. X            You("hear Ebenezer Scrooge!");
  1546. X            break;
  1547. X        }
  1548. X    return;
  1549. X    }
  1550. X    if (level.flags.has_beehive && !rn2(200)) {
  1551. X    switch (rn2(2)+hallu) {
  1552. X        case 0:
  1553. X        You("hear a low buzzing.");
  1554. X        break;
  1555. X        case 1:
  1556. X        You("hear an angry drone.");
  1557. X        break;
  1558. X        case 2:
  1559. X        You("hear bees in your %sbonnet!",
  1560. X            uarmh ? "" : "(nonexistent) ");
  1561. X        break;
  1562. X    }
  1563. X    return;
  1564. X    }
  1565. X    if (level.flags.has_morgue && !rn2(200)) {
  1566. X    switch (rn2(2)+hallu) {
  1567. X        case 0:
  1568. X        You("suddenly realize it is unnaturally quiet.");
  1569. X        break;
  1570. X        case 1:
  1571. X        pline("The hair on the back of your %s stands up.",
  1572. X            body_part(NECK));
  1573. X        break;
  1574. X        case 2:
  1575. X        pline("The hair on your %s seems to stand up.",
  1576. X            body_part(HEAD));
  1577. X        break;
  1578. X    }
  1579. X    return;
  1580. X    }
  1581. X#ifdef ARMY
  1582. X    if (level.flags.has_barracks && !rn2(200)) {
  1583. X    static const char *barracks_msg[4] = {
  1584. X        "hear blades being honed.",
  1585. X        "hear loud snoring.",
  1586. X        "hear dice being thrown.",
  1587. X        "hear General MacArthur!",
  1588. X    };
  1589. X    You(barracks_msg[rn2(3)+hallu]);
  1590. X    return;
  1591. X    }
  1592. X#endif /* ARMY */
  1593. X    if (level.flags.has_zoo && !rn2(200)) {
  1594. X    static const char *zoo_msg[3] = {
  1595. X        "hear a sound reminiscent of an elephant stepping on a peanut.",
  1596. X        "hear a sound reminiscent of a seal barking.",
  1597. X        "hear Doctor Doolittle!",
  1598. X    };
  1599. X    You(zoo_msg[rn2(2)+hallu]);
  1600. X    return;
  1601. X    }
  1602. X    if (level.flags.has_shop && !rn2(200)) {
  1603. X    if (!(sroom = search_special(ANY_SHOP))) {
  1604. X        /* strange... */
  1605. X        level.flags.has_shop = 0;
  1606. X        return;
  1607. X    }
  1608. X    if (tended_shop(sroom) &&
  1609. X        !index(u.ushops, ROOM_INDEX(sroom) + ROOMOFFSET)) {
  1610. X        static const char *shop_msg[3] = {
  1611. X            "hear someone cursing shoplifters.",
  1612. X            "hear the chime of a cash register.",
  1613. X            "hear Neiman and Marcus arguing!",
  1614. X        };
  1615. X        You(shop_msg[rn2(2)+hallu]);
  1616. X    }
  1617. X    return;
  1618. X    }
  1619. X}
  1620. X
  1621. X#endif /* OVL0 */
  1622. X#ifdef OVLB
  1623. X
  1624. Xstatic const char *h_sounds[] = {
  1625. X    "beep", "boing", "sing", "belche", "creak", "cough", "rattle",
  1626. X    "ululate", "pop", "jingle", "sniffle", "tinkle", "eep"
  1627. X};
  1628. X
  1629. Xvoid
  1630. Xgrowl(mtmp)
  1631. Xregister struct monst *mtmp;
  1632. X{
  1633. X    register const char *growl_verb = 0;
  1634. X
  1635. X    if (mtmp->msleep || !mtmp->mcanmove || !mtmp->data->msound) return;
  1636. X
  1637. X    /* presumably nearness and soundok checks have already been made */
  1638. X    if (Hallucination)
  1639. X        growl_verb = h_sounds[rn2(SIZE(h_sounds))];
  1640. X    else switch (mtmp->data->msound) {
  1641. X    case MS_MEW:
  1642. X    case MS_HISS:
  1643. X        growl_verb = "hisse";    /* hisseS */
  1644. X        break;
  1645. X    case MS_BARK:
  1646. X    case MS_GROWL:
  1647. X        growl_verb = "growl";
  1648. X        break;
  1649. X    case MS_ROAR:
  1650. X        growl_verb = "roar";
  1651. X        break;
  1652. X    case MS_BUZZ:
  1653. X        growl_verb = "buzze";
  1654. X        break;
  1655. X    case MS_SQEEK:
  1656. X        growl_verb = "squeal";
  1657. X        break;
  1658. X    case MS_SQAWK:
  1659. X        growl_verb = "screeche";
  1660. X        break;
  1661. X    case MS_NEIGH:
  1662. X        growl_verb = "neigh";
  1663. X        break;
  1664. X    case MS_WAIL:
  1665. X        growl_verb = "wail";
  1666. X        break;
  1667. X    }
  1668. X    if (growl_verb) pline("%s %ss!", Monnam(mtmp), growl_verb);
  1669. X}
  1670. X
  1671. X/* the sounds of mistreated pets */
  1672. Xvoid
  1673. Xyelp(mtmp)
  1674. Xregister struct monst *mtmp;
  1675. X{
  1676. X    register const char *yelp_verb = 0;
  1677. X
  1678. X    if (mtmp->msleep || !mtmp->mcanmove || !mtmp->data->msound) return;
  1679. X
  1680. X    /* presumably nearness and soundok checks have already been made */
  1681. X    if (Hallucination)
  1682. X        yelp_verb = h_sounds[rn2(SIZE(h_sounds))];
  1683. X    else switch (mtmp->data->msound) {
  1684. X    case MS_MEW:
  1685. X        yelp_verb = "yowl";
  1686. X        break;
  1687. X    case MS_BARK:
  1688. X    case MS_GROWL:
  1689. X        yelp_verb = "yelp";
  1690. X        break;
  1691. X    case MS_ROAR:
  1692. X        yelp_verb = "snarl";
  1693. X        break;
  1694. X    case MS_SQEEK:
  1695. X        yelp_verb = "squeal";
  1696. X        break;
  1697. X    case MS_SQAWK:
  1698. X        yelp_verb = "screak";
  1699. X        break;
  1700. X    case MS_WAIL:
  1701. X        yelp_verb = "wail";
  1702. X        break;
  1703. X    }
  1704. X    if (yelp_verb) pline("%s %ss!", Monnam(mtmp), yelp_verb);
  1705. X}
  1706. X
  1707. X/* the sounds of distressed pets */
  1708. Xvoid
  1709. Xwhimper(mtmp)
  1710. Xregister struct monst *mtmp;
  1711. X{
  1712. X    register const char *whimper_verb = 0;
  1713. X
  1714. X    if (mtmp->msleep || !mtmp->mcanmove || !mtmp->data->msound) return;
  1715. X
  1716. X    /* presumably nearness and soundok checks have already been made */
  1717. X    if (Hallucination)
  1718. X        whimper_verb = h_sounds[rn2(SIZE(h_sounds))];
  1719. X    else switch (mtmp->data->msound) {
  1720. X    case MS_MEW:
  1721. X    case MS_GROWL:
  1722. X        whimper_verb = "whimper";
  1723. X        break;
  1724. X    case MS_BARK:
  1725. X        whimper_verb = "whine";
  1726. X        break;
  1727. X    case MS_SQEEK:
  1728. X        whimper_verb = "squeal";
  1729. X        break;
  1730. X    }
  1731. X    if (whimper_verb) pline("%s %ss.", Monnam(mtmp), whimper_verb);
  1732. X}
  1733. X
  1734. X/* pet makes "I'm hungry" noises */
  1735. Xvoid
  1736. Xbeg(mtmp)
  1737. Xregister struct monst *mtmp;
  1738. X{
  1739. X    if (mtmp->msleep || !mtmp->mcanmove ||
  1740. X    !(carnivorous(mtmp->data) || herbivorous(mtmp->data))) return;
  1741. X    /* presumably nearness and soundok checks have already been made */
  1742. X    if (mtmp->data->msound != MS_SILENT && mtmp->data->msound <= MS_ANIMAL)
  1743. X    (void) domonnoise(mtmp);
  1744. X    else if (mtmp->data->msound >= MS_HUMANOID)
  1745. X    verbalize("I'm hungry.");
  1746. X}
  1747. X
  1748. X#endif /* OVLB */
  1749. X
  1750. X#endif /* SOUNDS */
  1751. X
  1752. X#ifdef OVLB
  1753. X
  1754. Xstatic int
  1755. Xdomonnoise(mtmp)
  1756. Xregister struct monst *mtmp;
  1757. X{
  1758. X#ifdef SOUNDS
  1759. X    register const char *pline_msg = 0;    /* Monnam(mtmp) will be prepended */
  1760. X#endif
  1761. X
  1762. X    /* presumably nearness and sleep checks have already been made */
  1763. X    if (!flags.soundok) return(0);
  1764. X
  1765. X    switch (mtmp->data->msound) {
  1766. X    case MS_ORACLE:
  1767. X        return doconsult(mtmp);
  1768. X    case MS_PRIEST:
  1769. X        priest_talk(mtmp);
  1770. X        break;
  1771. X#ifdef MULDGN
  1772. X    case MS_LEADER:
  1773. X    case MS_NEMESIS:
  1774. X    case MS_GUARDIAN:
  1775. X        quest_chat(mtmp);
  1776. X        break;
  1777. X#endif
  1778. X#ifdef SOUNDS
  1779. X    case MS_SELL: /* pitch, pay, total */
  1780. X        shk_chat(mtmp);
  1781. X        break;
  1782. X    case MS_SILENT:
  1783. X        break;
  1784. X    case MS_BARK:
  1785. X        if (flags.moonphase == FULL_MOON && night()) {
  1786. X        pline_msg = "howls.";
  1787. X        } else if (mtmp->mpeaceful) {
  1788. X        if (mtmp->mtame &&
  1789. X            (mtmp->mconf || mtmp->mflee || mtmp->mtrapped ||
  1790. X             moves > EDOG(mtmp)->hungrytime || mtmp->mtame < 5))
  1791. X            pline_msg = "whines.";
  1792. X        else if (EDOG(mtmp)->hungrytime > moves + 1000)
  1793. X            pline_msg = "yips.";
  1794. X        else
  1795. X            pline_msg = "barks.";
  1796. X        } else {
  1797. X        pline_msg = "growls.";
  1798. X        }
  1799. X        break;
  1800. X    case MS_MEW:
  1801. X        if (mtmp->mtame) {
  1802. X        if (mtmp->mconf || mtmp->mflee || mtmp->mtrapped ||
  1803. X            mtmp->mtame < 5)
  1804. X            pline_msg = "yowls.";
  1805. X        else if (moves > EDOG(mtmp)->hungrytime)
  1806. X            pline_msg = "miaos.";
  1807. X        else if (EDOG(mtmp)->hungrytime > moves + 1000)
  1808. X            pline_msg = "purrs.";
  1809. X        else
  1810. X            pline_msg = "mews.";
  1811. X        break;
  1812. X        } /* else FALLTHRU */
  1813. X    case MS_GROWL:
  1814. X        pline_msg = mtmp->mpeaceful ? "snarls." : "growls!";
  1815. X        break;
  1816. X    case MS_ROAR:
  1817. X        pline_msg = mtmp->mpeaceful ? "snarls." : "roars!";
  1818. X        break;
  1819. X    case MS_SQEEK:
  1820. X        pline_msg = "squeaks.";
  1821. X        break;
  1822. X    case MS_SQAWK:
  1823. X        pline_msg = "squawks.";
  1824. X        break;
  1825. X    case MS_HISS:
  1826. X        if (!mtmp->mpeaceful)
  1827. X        pline_msg = "hisses!";
  1828. X        else return 0;    /* no sound */
  1829. X        break;
  1830. X    case MS_BUZZ:
  1831. X        pline_msg = mtmp->mpeaceful ? "drones." : "buzzes angrily.";
  1832. X        break;
  1833. X    case MS_GRUNT:
  1834. X        pline_msg = "grunts.";
  1835. X        break;
  1836. X    case MS_NEIGH:
  1837. X        if (mtmp->mtame < 5)
  1838. X        pline_msg = "neighs.";
  1839. X        else if (moves > EDOG(mtmp)->hungrytime)
  1840. X        pline_msg = "whinnies.";
  1841. X        else
  1842. X        pline_msg = "whickers.";
  1843. X        break;
  1844. X    case MS_WAIL:
  1845. X        pline_msg = "wails mournfully.";
  1846. X        break;
  1847. X    case MS_GURGLE:
  1848. X        pline_msg = "gurgles.";
  1849. X        break;
  1850. X    case MS_BURBLE:
  1851. X        pline_msg = "burbles.";
  1852. X        break;
  1853. X    case MS_SHRIEK:
  1854. X        pline_msg = "shrieks.";
  1855. X        aggravate();
  1856. X        break;
  1857. X    case MS_IMITATE:
  1858. X        pline_msg = "imitates you.";
  1859. X        break;
  1860. X    case MS_BONES:
  1861. X        pline("%s rattles noisily.", Monnam(mtmp));
  1862. X        You("freeze for a moment.");
  1863. X        nomul(-2);
  1864. X        break;
  1865. X    case MS_LAUGH:
  1866. X        {
  1867. X        static const char *laugh_msg[4] = {
  1868. X            "giggles.", "chuckles.", "snickers.", "laughs.",
  1869. X        };
  1870. X        pline_msg = laugh_msg[rn2(4)];
  1871. X        }
  1872. X        break;
  1873. X    case MS_MUMBLE:
  1874. X        pline_msg = "mumbles incomprehensibly.";
  1875. X        break;
  1876. X    case MS_DJINNI:
  1877. X        if (mtmp->mtame) verbalize("Thank you for freeing me!");
  1878. X        else if (mtmp->mpeaceful) verbalize("I'm free!");
  1879. X        else verbalize("This will teach you not to disturb me!");
  1880. X        break;
  1881. X    case MS_HUMANOID:
  1882. X        if (!mtmp->mpeaceful) {
  1883. X        if (In_endgame(&u.uz) && is_mplayer(mtmp->data)) {
  1884. X            mplayer_talk(mtmp);
  1885. X            break;
  1886. X        } else {
  1887. X            return 0;    /* no sound */
  1888. X        }
  1889. X        }
  1890. X        /* Generic peaceful humanoid behaviour. */
  1891. X        if (mtmp->mflee)
  1892. X        pline_msg = "wants nothing to do with you.";
  1893. X        else if (mtmp->mhp < mtmp->mhpmax/4)
  1894. X        pline_msg = "moans.";
  1895. X        else if (mtmp->mconf || mtmp->mstun)
  1896. X        verbalize(!rn2(3) ? "Huh?" : rn2(2) ? "What?" : "Eh?");
  1897. X        else if (!mtmp->mcansee)
  1898. X        verbalize("I can't see!");
  1899. X        else if (mtmp->mtrapped)
  1900. X        verbalize("I'm trapped!");
  1901. X        else if (mtmp->mhp < mtmp->mhpmax/2)
  1902. X        pline_msg = "asks for a potion of healing.";
  1903. X        else if (mtmp->mtame && moves > EDOG(mtmp)->hungrytime)
  1904. X        verbalize("I'm hungry.");
  1905. X        /* Specific monster's interests */
  1906. X        else if (is_elf(mtmp->data))
  1907. X        pline_msg = "curses orcs.";
  1908. X        else if (is_dwarf(mtmp->data))
  1909. X        pline_msg = "talks about mining.";
  1910. X        else if (likes_magic(mtmp->data))
  1911. X        pline_msg = "talks about spellcraft.";
  1912. X        else if (carnivorous(mtmp->data))
  1913. X        pline_msg = "discusses hunting.";
  1914. X        else switch (monsndx(mtmp->data)) {
  1915. X        case PM_HOBBIT:
  1916. X            pline_msg = (mtmp->mhpmax - mtmp->mhp >= 10) ?
  1917. X                "complains about unpleasant dungeon conditions."
  1918. X                : "asks you about the One Ring.";
  1919. X            break;
  1920. X        case PM_ARCHEOLOGIST:
  1921. X    pline_msg = "describes a recent article in \"Spelunker Today\" magazine.";
  1922. X            break;
  1923. X# ifdef TOURIST
  1924. X        case PM_TOURIST:
  1925. X            verbalize("Aloha.");
  1926. X            break;
  1927. X# endif
  1928. X        default:
  1929. X            pline_msg = "discusses dungeon exploration.";
  1930. X        }
  1931. X        break;
  1932. X    case MS_SEDUCE:
  1933. X# ifdef SEDUCE
  1934. X        if (mtmp->data->mlet != S_NYMPH &&
  1935. X        could_seduce(mtmp, &youmonst, (struct attack *)0) == 1) {
  1936. X            (void) doseduce(mtmp);
  1937. X            break;
  1938. X        }
  1939. X        switch ((poly_gender() != mtmp->female) ? rn2(3) : 0) {
  1940. X# else
  1941. X        switch ((poly_gender() == 0) ? rn2(3) : 0) {
  1942. X# endif
  1943. X        case 2:
  1944. X            verbalize("Hello, sailor.");
  1945. X            break;
  1946. X        case 1:
  1947. X            pline_msg = "comes on to you.";
  1948. X            break;
  1949. X        default:
  1950. X            pline_msg = "cajoles you.";
  1951. X        }
  1952. X        break;
  1953. X# ifdef KOPS
  1954. X    case MS_ARREST:
  1955. X        if (mtmp->mpeaceful)
  1956. X        verbalize("Just the facts, %s.",
  1957. X              flags.female ? "Ma'am" : "Sir");
  1958. X        else {
  1959. X        static const char *arrest_msg[3] = {
  1960. X            "Anything you say can be used against you.",
  1961. X            "You're under arrest!",
  1962. X            "Stop in the name of the Law!",
  1963. X        };
  1964. X        verbalize(arrest_msg[rn2(3)]);
  1965. X        }
  1966. X        break;
  1967. X# endif
  1968. X    case MS_BRIBE:
  1969. X        if (mtmp->mpeaceful && !mtmp->mtame) {
  1970. X        (void) demon_talk(mtmp);
  1971. X        break;
  1972. X        }
  1973. X        /* fall through */
  1974. X    case MS_CUSS:
  1975. X        if (!mtmp->mpeaceful)
  1976. X        cuss(mtmp);
  1977. X        break;
  1978. X    case MS_NURSE:
  1979. X        if (uwep)
  1980. X        verbalize("Put that weapon away before you hurt someone!");
  1981. X        else if (uarmc || uarm || uarmh || uarms || uarmg || uarmf)
  1982. X        if (pl_character[0] == 'H')
  1983. X            verbalize("Doc, I can't help you unless you cooperate.");
  1984. X        else
  1985. X            verbalize("Please undress so I can examine you.");
  1986. X# ifdef TOURIST
  1987. X        else if (uarmu)
  1988. X        verbalize("Take off your shirt, please.");
  1989. X# endif
  1990. X        else verbalize("Relax, this won't hurt a bit.");
  1991. X        break;
  1992. X    case MS_GUARD:
  1993. X        if (u.ugold)
  1994. X        verbalize("Please drop that gold and follow me.");
  1995. X        else
  1996. X        verbalize("Please follow me.");
  1997. X        break;
  1998. X    case MS_SOLDIER:
  1999. X        {
  2000. X        static const char *soldier_foe_msg[3] = {
  2001. X            "Resistance is useless!",
  2002. X            "You're dog meat!",
  2003. X            "Surrender!",
  2004. X        },          *soldier_pax_msg[3] = {
  2005. X            "What lousy pay we're getting here!",
  2006. X            "The food's not fit for Orcs!",
  2007. X            "My feet hurt, I've been on them all day!",
  2008. X        };
  2009. X        verbalize(mtmp->mpeaceful ? soldier_pax_msg[rn2(3)]
  2010. X                      : soldier_foe_msg[rn2(3)]);
  2011. X        }
  2012. X        break;
  2013. X    case MS_RIDER:
  2014. X        if (mtmp->data == &mons[PM_DEATH] && mtmp->mpeaceful)
  2015. X        pline_msg = "is busy reading a copy of Sandman #9.";
  2016. X        else verbalize("Who do you think you are, War?");
  2017. X        break;
  2018. X#endif /* SOUNDS */
  2019. X    }
  2020. X
  2021. X#ifdef SOUNDS
  2022. X    if (pline_msg) pline("%s %s", Monnam(mtmp), pline_msg);
  2023. X#endif
  2024. X    return(1);
  2025. X}
  2026. X
  2027. X
  2028. Xint
  2029. Xdotalk()
  2030. X{
  2031. X    int result;
  2032. X    boolean save_soundok = flags.soundok;
  2033. X    flags.soundok = 1;    /* always allow sounds while chatting */
  2034. X    result = dochat();
  2035. X    flags.soundok = save_soundok;
  2036. X    return result;
  2037. X}
  2038. X
  2039. Xstatic int
  2040. Xdochat()
  2041. X{
  2042. X    register struct monst *mtmp;
  2043. X    register int tx,ty;
  2044. X    struct obj *otmp;
  2045. X
  2046. X#ifdef POLYSELF
  2047. X    if (uasmon->msound == MS_SILENT) {
  2048. X    pline("As %s, you cannot speak.", an(uasmon->mname));
  2049. X    return(0);
  2050. X    }
  2051. X#endif
  2052. X    if (Strangled) {
  2053. X    You("can't speak.  You're choking!");
  2054. X    return(0);
  2055. X    }
  2056. X    if (u.uswallow) {
  2057. X    pline("They won't hear you out there.");
  2058. X    return(0);
  2059. X    }
  2060. X    if (Underwater) {
  2061. X    pline("Your speech is unintelligible underwater.");
  2062. X    return(0);
  2063. X    }
  2064. X
  2065. X    if (!Blind && (otmp = shop_object(u.ux, u.uy)) != (struct obj *)0) {
  2066. X    /* standing on something in a shop and chatting causes the shopkeeper
  2067. X       to describe the price(s).  This can inhibit other chatting inside
  2068. X       a shop, but that shouldn't matter much.  shop_object() returns an
  2069. X       object iff inside a shop and the shopkeeper is present and willing
  2070. X       (not angry) and able (not asleep) to speak and the position contains
  2071. X       any objects other than just gold.
  2072. X    */
  2073. X    price_quote(otmp);
  2074. X    return(1);
  2075. X    }
  2076. X
  2077. X    (void) getdir("Talk to whom? [in what direction]");
  2078. X
  2079. X    if (u.dz) {
  2080. X    pline("They won't hear you %s there.", u.dz < 0 ? "up" : "down");
  2081. X    return(0);
  2082. X    }
  2083. X
  2084. X    if (u.dx == 0 && u.dy == 0) {
  2085. X/*
  2086. X * Let's not include this.  It raises all sorts of questions: can you wear
  2087. X * 2 helmets, 2 amulets, 3 pairs of gloves or 6 rings as a marilith,
  2088. X * etc...  --KAA
  2089. X#ifdef POLYSELF
  2090. X    if (u.umonnum == PM_ETTIN) {
  2091. X        You("discover that your other head makes boring conversation.");
  2092. X        return(1);
  2093. X    }
  2094. X#endif
  2095. X*/
  2096. X    pline("Talking to yourself is a bad habit for a dungeoneer.");
  2097. X    return(0);
  2098. X    }
  2099. X
  2100. X    tx = u.ux+u.dx; ty = u.uy+u.dy;
  2101. X    mtmp = m_at(tx, ty);
  2102. X    if ((Blind && !Telepat) || !mtmp || mtmp->mundetected ||
  2103. X        mtmp->m_ap_type == M_AP_FURNITURE ||
  2104. X        mtmp->m_ap_type == M_AP_OBJECT) {
  2105. X    pline("I see nobody there.");
  2106. X    return(0);
  2107. X    }
  2108. X    if (!mtmp->mcanmove || mtmp->msleep) {
  2109. X    pline("%s seems not to notice you.", Monnam(mtmp));
  2110. X    return(0);
  2111. X    }
  2112. X
  2113. X    if (mtmp->mtame && mtmp->meating) {
  2114. X    pline("%s is eating noisily.", Monnam(mtmp));
  2115. X    return (0);
  2116. X    }
  2117. X
  2118. X    return domonnoise(mtmp);
  2119. X}
  2120. X
  2121. X#endif /* OVLB */
  2122. X
  2123. X/*sounds.c*/
  2124. END_OF_FILE
  2125. if test 16940 -ne `wc -c <'src/sounds.c'`; then
  2126.     echo shar: \"'src/sounds.c'\" unpacked with wrong size!
  2127. fi
  2128. # end of 'src/sounds.c'
  2129. echo shar: End of archive 22 \(of 33\).
  2130. cp /dev/null ark22isdone
  2131. MISSING=""
  2132. 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
  2133.     if test ! -f ark${I}isdone ; then
  2134.     MISSING="${MISSING} ${I}"
  2135.     fi
  2136. done
  2137. if test "${MISSING}" = "" ; then
  2138.     echo You have unpacked all 33 archives.
  2139.     echo "Now execute ./patchit.sh"
  2140.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2141. else
  2142.     echo You still need to unpack the following archives:
  2143.     echo "        " ${MISSING}
  2144. fi
  2145. ##  End of shell archive.
  2146. exit 0
  2147.