home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch4h < prev    next >
Encoding:
Internet Message Format  |  1989-10-02  |  59.2 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i044:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch4h
  5. Message-ID: <4634@tekred.CNA.TEK.COM>
  6. Date: 29 Sep 89 21:13:14 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 2067
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 8, Issue 44
  13. Archive-name: NetHack3/Patch4h
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 8 (of 11)."
  23. # Contents:  patches04h
  24. # Wrapped by billr@saab on Fri Sep 29 13:25:08 1989
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'patches04h' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'patches04h'\"
  28. else
  29. echo shar: Extracting \"'patches04h'\" \(56752 characters\)
  30. sed "s/^X//" >'patches04h' <<'END_OF_FILE'
  31. X*** auxil/Old/help    Wed Sep 27 10:17:39 1989
  32. X--- auxil/help    Thu Sep 14 13:20:36 1989
  33. X***************
  34. X*** 139,149 ****
  35. X          the commands you can use with "#" type "#?".  The extended
  36. X          commands you can use depends upon what options the game was
  37. X          compiled with, along with your class and what type of monster
  38. X!         you most closely resemble at a given moment. If your keyboard
  39. X!         has a meta key (that is, one which when pressed in combination
  40. X!         with another key modified it by turning on the 'meta' or 0x80
  41. X!         bit) these extended commands can be invoked by meta-ing the
  42. X!         first letter of the command.
  43. X  
  44. X      If the "number_pad" option is on, some additional letter commands
  45. X      are available:
  46. X--- 139,149 ----
  47. X          the commands you can use with "#" type "#?".  The extended
  48. X          commands you can use depends upon what options the game was
  49. X          compiled with, along with your class and what type of monster
  50. X!         you most closely resemble at a given moment.  If your keyboard
  51. X!         has a meta key (which, when pressed in combination with another
  52. X!         key, modifies it by setting the 'meta' (8th, or 'high') bit),
  53. X!         these extended commands can be invoked by meta-ing the first
  54. X!         letter of the command.
  55. X  
  56. X      If the "number_pad" option is on, some additional letter commands
  57. X      are available:
  58. X*** auxil/Old/hh    Wed Sep 27 10:17:53 1989
  59. X--- auxil/hh    Thu Sep 14 13:20:41 1989
  60. X***************
  61. X*** 7,59 ****
  62. X              G<dir>,   same, except a branching corridor isn't
  63. X              ^<dir>:     considered interesting
  64. X              m<dir>:   move without picking up objects
  65. X!         If the numberpad option is set, the number keys move instead.
  66. X  
  67. X! Meta commands:
  68. X! ?    help    print one of several informative texts
  69. X  Q    quit    end the game
  70. X  S    save    save the game (to be continued later)
  71. X  !    sh    escape to some SHELL (if allowed)
  72. X  ^Z    suspend suspend the game (independent of your current suspend char)
  73. X  O    options set options
  74. X! /    whatis    give name (and sometimes more info) of specified monster
  75. X! \    known    print list of what's been discovered
  76. X! v    version    print version number
  77. X! V    history    print game history
  78. X! ^A    again    redo the previous command
  79. X! ^R    redraw    redraw the screen (^R denotes the symbol CTRL/R)
  80. X! ^P    print    repeat last message  (subsequent ^P's repeat earlier messages)
  81. X! #        introduces a long command (# ? for list of long commands)
  82. X  
  83. X  Game commands:
  84. X- ^T    'port    teleport (if you can)
  85. X  ^D    kick    kick (a door, or something else)
  86. X  a    apply    apply or use a tool (pick-axe, key, camera, etc.)
  87. X! A    remove    take off all armor
  88. X  c    close    close a door
  89. X! C    name    name an individual monster (e.g., baptize your dog)
  90. X  d    drop    drop an object.  d7a:  drop seven items of object 'a'
  91. X! D    drop    drop several things
  92. X  e    eat    eat something
  93. X  E    engrave write a message in the dust on the floor  (E-  use fingers)
  94. X! i    invent    list the inventory (all objects you are carrying)
  95. X! I    invent    list selected parts of the inventory
  96. X          Iu: list unpaid objects
  97. X          Ix: list unpaid but used up items
  98. X          I$: count your money
  99. X  o    open    open a door
  100. X! p    pay    pay your bill
  101. X! P    wear    put on a ring
  102. X  q    quaff    drink a potion
  103. X  r    read    read a scroll or spell book
  104. X  R    remove    remove a ring
  105. X  s    search    search for secret doors, hidden traps and monsters
  106. X  t    throw    throw or shoot a weapon
  107. X! T    remove    take off some armor
  108. X  w    wield    wield a weapon    (w-  wield nothing)
  109. X  W    wear    put on some armor
  110. X  z    zap    zap a wand
  111. X! Z    cast    cast a spell
  112. X  <    up    go up the stairs
  113. X  >    down    go down the stairs
  114. X  ^    trap_id identify a previously found trap
  115. X--- 7,59 ----
  116. X              G<dir>,   same, except a branching corridor isn't
  117. X              ^<dir>:     considered interesting
  118. X              m<dir>:   move without picking up objects
  119. X!         If the number_pad option is set, the number keys move instead.
  120. X  
  121. X! General commands:
  122. X! ?    help    display one of several informative texts
  123. X  Q    quit    end the game
  124. X  S    save    save the game (to be continued later)
  125. X  !    sh    escape to some SHELL (if allowed)
  126. X  ^Z    suspend suspend the game (independent of your current suspend char)
  127. X  O    options set options
  128. X! /    whatis    tell what a map symbol represents
  129. X! \    known    display list of what's been discovered
  130. X! v    version    display version number
  131. X! V    history    display game history
  132. X! ^A    again    redo the previous command (^A denotes the keystroke CTRL-A)
  133. X! ^R    redraw    redraw the screen
  134. X! ^P    prevmsg    repeat previous message (subsequent ^P's repeat earlier ones)
  135. X! #        introduces an extended command (#? for a list of them)
  136. X  
  137. X  Game commands:
  138. X  ^D    kick    kick (a door, or something else)
  139. X+ ^T    'port    teleport (if you can)
  140. X  a    apply    apply or use a tool (pick-axe, key, camera, etc.)
  141. X! A    armor    take off all armor
  142. X  c    close    close a door
  143. X! C    call    name an individual monster (ex. baptize your dog)
  144. X  d    drop    drop an object.  d7a:  drop seven items of object 'a'
  145. X! D    Drop    drop selected types of objects
  146. X  e    eat    eat something
  147. X  E    engrave write a message in the dust on the floor  (E-  use fingers)
  148. X! i    invent    list your inventory (all objects you are carrying)
  149. X! I    Invent    list selected parts of your inventory
  150. X          Iu: list unpaid objects
  151. X          Ix: list unpaid but used up items
  152. X          I$: count your money
  153. X  o    open    open a door
  154. X! p    pay    pay your bill (in a shop)
  155. X! P    puton    put on a ring
  156. X  q    quaff    drink a potion
  157. X  r    read    read a scroll or spell book
  158. X  R    remove    remove a ring
  159. X  s    search    search for secret doors, hidden traps and monsters
  160. X  t    throw    throw or shoot a weapon
  161. X! T    takeoff    take off some armor
  162. X  w    wield    wield a weapon    (w-  wield nothing)
  163. X  W    wear    put on some armor
  164. X  z    zap    zap a wand
  165. X! Z    Zap    cast a spell
  166. X  <    up    go up the stairs
  167. X  >    down    go down the stairs
  168. X  ^    trap_id identify a previously found trap
  169. X***************
  170. X*** 62,78 ****
  171. X  +    spells    list the spells you know
  172. X  .    rest    wait a moment
  173. X  ,    pickup    pick up all you can carry
  174. X! @        turn "autopickup" on and off
  175. X  :    look    look at what is here
  176. X  
  177. X! And if the "number_pad" option is on, these additional commands:
  178. X  
  179. X  n        followed by number of times to repeat the next command
  180. X! j    jump    jump to a location
  181. X! k    kick    kick a door
  182. X  l    loot    loot a box on the floor
  183. X! N    name    name an object or type of object
  184. X! u    untrap    untrap a trapped object
  185. X! 
  186. X! If your keyboard has a meta key, 'jump' 'loot', 'name' and 'untrap' are
  187. X! available as M-j, M-l, M-N or M-u respectively.
  188. X--- 62,92 ----
  189. X  +    spells    list the spells you know
  190. X  .    rest    wait a moment
  191. X  ,    pickup    pick up all you can carry
  192. X! @        toggle "pickup" (auto pickup) option on and off
  193. X  :    look    look at what is here
  194. X  
  195. X! Keyboards that have a meta key can also use these extended commands:
  196. X! 
  197. X! M-c    chat    talk to someone
  198. X! M-d    dip    dip an object into something
  199. X! M-f    force    force a lock
  200. X! M-j    jump    jump to another location
  201. X! M-l    loot    loot a box on the floor
  202. X! M-m    monster    use a monster's special ability (only if defined)
  203. X! M-N    name    name an item or type of object
  204. X! M-o    offer    offer a sacrifice to the gods (only if defined)
  205. X! M-p    pray    pray to the gods for help (only if defined)
  206. X! M-r    rub    rub a lamp
  207. X! M-s    sit    sit down
  208. X! M-t    turn    turn undead
  209. X! M-u    untrap    untrap something (usually a trapped object)
  210. X! M-w    wipe    wipe off your face
  211. X  
  212. X+ If the "number_pad" option is on, these additional commands are available:
  213. X+ 
  214. X  n        followed by number of times to repeat the next command
  215. X! j    jump    jump to another location
  216. X! k    kick    kick something (usually a door)
  217. X  l    loot    loot a box on the floor
  218. X! N    name    name an item or type of object
  219. X! u    untrap    untrap something (usually a trapped object)
  220. X*** auxil/Old/history    Wed Sep 27 10:18:08 1989
  221. X--- auxil/history    Sat Sep 16 17:54:33 1989
  222. X***************
  223. X*** 29,34 ****
  224. X--- 29,35 ----
  225. X  
  226. X  Timo Hakulinen ported NetHack 3.0 to OS/2.
  227. X  
  228. X+ David Gentzel ported NetHack 3.0 to VMS.
  229. X   
  230. X  From time to time, some depraved individual out there in netland sends a
  231. X  particularly intriguing modification to help out with the game.  The Gods of
  232. X*** auxil/Old/nethack.6    Wed Sep 27 10:18:41 1989
  233. X--- auxil/nethack.6    Sun Sep 17 12:29:03 1989
  234. X***************
  235. X*** 99,106 ****
  236. X  .B \-D
  237. X  or
  238. X  .B \-X
  239. X! option will start the game in a special non-scoring discovery mode
  240. X! (or in debugging (wizard) mode if the player is the game administrator).
  241. X  .PP
  242. X  The
  243. X  .B \-d
  244. X--- 99,108 ----
  245. X  .B \-D
  246. X  or
  247. X  .B \-X
  248. X! option will start the game in a special non-scoring discovery mode.
  249. X! .B \-D
  250. X! will, if the player is the game administrator, start in debugging (wizard)
  251. X! mode instead.
  252. X  .PP
  253. X  The
  254. X  .B \-d
  255. X*** auxil/Old/opthelp    Wed Sep 27 10:19:01 1989
  256. X--- auxil/opthelp    Thu Sep 14 14:46:43 1989
  257. X***************
  258. X*** 34,43 ****
  259. X  null        allow nulls to be sent to your terminal  [TRUE]
  260. X  standout    use standout mode for --More-- on messages  [FALSE]
  261. X  
  262. X! Any Boolean option can be negated by prefixing it with a '!' or 'no'.
  263. X! 
  264. X  
  265. X! 
  266. X  
  267. X  
  268. X  
  269. X--- 34,43 ----
  270. X  null        allow nulls to be sent to your terminal  [TRUE]
  271. X  standout    use standout mode for --More-- on messages  [FALSE]
  272. X  
  273. X! Boolean option if TEXTCOLOR was set at compile time:
  274. X! color        use different colors for objects on screen  [TRUE]
  275. X  
  276. X! Any Boolean option can be negated by prefixing it with a '!' or 'no'.
  277. X  
  278. X  
  279. X  
  280. X*** include/Old/amiconf.h    Wed Sep 27 13:08:56 1989
  281. X--- include/amiconf.h    Thu Sep 14 23:31:24 1989
  282. X***************
  283. X*** 1,4 ****
  284. X! /*      SCCS Id: @(#)amiconf.h  3.0     89/04/28
  285. X  /* NetHack may be freely redistributed.  See license for details. */
  286. X  
  287. X  #ifndef AMICONF_H
  288. X--- 1,4 ----
  289. X! /*    SCCS Id: @(#)amiconf.h  3.0     89/09/04
  290. X  /* NetHack may be freely redistributed.  See license for details. */
  291. X  
  292. X  #ifndef AMICONF_H
  293. X***************
  294. X*** 22,27 ****
  295. X--- 22,30 ----
  296. X  
  297. X  #undef  index
  298. X  #undef  rindex
  299. X+ extern char  *index P((const char *,int));
  300. X+ extern char  *rindex P((const char *,int));
  301. X+ #define memcpy(dest, source, size)  movmem(source, dest, size)
  302. X  
  303. X  /*
  304. X   *  Configurable Amiga options:
  305. X*** include/Old/artifact.h    Wed Sep 27 13:09:09 1989
  306. X--- include/artifact.h    Mon Sep 25 20:58:06 1989
  307. X***************
  308. X*** 6,32 ****
  309. X  #ifndef ARTIFACT_H
  310. X  #define ARTIFACT_H
  311. X  
  312. X! #define SPFX_NONE   0x00    /* no special effects, just a bonus */
  313. X! #define SPFX_NOGEN  0x01    /* item is special, bequeathed by gods */
  314. X! #define SPFX_RESTR  0x02    /* item is restricted - can't be named */
  315. X! #define    SPFX_INTEL  0x04    /* item is self-willed - intelligent */
  316. X! #define SPFX_SPEEK  0x08    /* item can speak */
  317. X! #define SPFX_SEEK   0x10    /* item helps you search for things */
  318. X! #define SPFX_WARN   0x20    /* item warns you of danger */
  319. X! #define SPFX_ATTK   0x40    /* item has a special attack (attk) */
  320. X! #define SPFX_DEFN   0x80    /* item has a special defence (defn) */
  321. X! #define SPFX_DMONS  0x100    /* attack bonus on one type of monster */
  322. X! #define    SPFX_DCLAS  0x200    /* attack bonus on one class of monster */
  323. X! #define SPFX_DRLI   0x400    /* drains a level from monsters */
  324. X! #define SPFX_SEARCH 0x800    /* helps searching */
  325. X  
  326. X  struct artifact {
  327. X      unsigned    otyp;
  328. X      char        *name;
  329. X      unsigned    spfx;
  330. X!     unsigned    mtype;
  331. X      struct attack attk, defn;
  332. X!     unsigned    align;
  333. X  };
  334. X  
  335. X  #endif /* ARTIFACT_H /* */
  336. X--- 6,37 ----
  337. X  #ifndef ARTIFACT_H
  338. X  #define ARTIFACT_H
  339. X  
  340. X! #define SPFX_NONE   0x0000    /* no special effects, just a bonus */
  341. X! #define SPFX_NOGEN  0x0001    /* item is special, bequeathed by gods */
  342. X! #define SPFX_RESTR  0x0002    /* item is restricted - can't be named */
  343. X! #define    SPFX_INTEL  0x0004    /* item is self-willed - intelligent */
  344. X! #define SPFX_SPEEK  0x0008    /* item can speak */
  345. X! #define SPFX_SEEK   0x0010    /* item helps you search for things */
  346. X! #define SPFX_WARN   0x0020    /* item warns you of danger */
  347. X! #define SPFX_ATTK   0x0040    /* item has a special attack (attk) */
  348. X! #define SPFX_DEFN   0x0080    /* item has a special defence (defn) */
  349. X! #define SPFX_DRLI   0x0100    /* drains a level from monsters */
  350. X! #define SPFX_SEARCH 0x0200    /* helps searching */
  351. X! #define SPFX_DMONS  0x1000    /* attack bonus on one monster type */
  352. X! #define    SPFX_DCLAS  0x2000    /* attack bonus on monsters w/ symbol mtype */
  353. X! #define    SPFX_DFLAG1 0x4000    /* attack bonus on monsters w/ mflags1 flag */
  354. X! #define    SPFX_DFLAG2 0x8000    /* attack bonus on monsters w/ mflags2 flag */
  355. X  
  356. X+ #define SPFX_DBONUS 0xF000    /* attack bonus mask */
  357. X+ 
  358. X  struct artifact {
  359. X      unsigned    otyp;
  360. X      char        *name;
  361. X      unsigned    spfx;
  362. X!     unsigned long mtype;    /* monster type, symbol, or flag */
  363. X      struct attack attk, defn;
  364. X!     uchar        align;    /* alignment of bequeathing gods */
  365. X!     char        class;    /* character class associated with */
  366. X  };
  367. X  
  368. X  #endif /* ARTIFACT_H /* */
  369. X*** include/Old/config.h    Wed Sep 27 13:09:29 1989
  370. X--- include/config.h    Mon Sep 25 20:55:44 1989
  371. X***************
  372. X*** 9,15 ****
  373. X  /*
  374. X   * Section 1:    OS selection.
  375. X   *        Select the version of the OS you are using.
  376. X!  *        For "UNIX" select either SYSV or BSD in unixconf.h
  377. X   */
  378. X  
  379. X  #define    UNIX        /* delete if no fork(), exec() available */
  380. X--- 9,17 ----
  381. X  /*
  382. X   * Section 1:    OS selection.
  383. X   *        Select the version of the OS you are using.
  384. X!  *        For "UNIX" select either SYSV or BSD in unixconf.h.
  385. X!  *        A "VMS" option is not needed since the VMS C-compiler
  386. X!  *        provides it (comment out the default OS option here).
  387. X   */
  388. X  
  389. X  #define    UNIX        /* delete if no fork(), exec() available */
  390. X*** include/Old/decl.h    Wed Sep 27 13:09:52 1989
  391. X--- include/decl.h    Tue Sep 26 12:59:11 1989
  392. X***************
  393. X*** 13,24 ****
  394. X  E int nroom;
  395. X  E int multi;
  396. X  E int hackpid;
  397. X! #ifdef UNIX
  398. X  E int locknum;
  399. X  #ifdef DEF_PAGER
  400. X  E char *catmore;
  401. X  #endif    /* DEF_PAGER */
  402. X- #endif    /* UNIX */
  403. X  E char SAVEF[];
  404. X  E char *hname;
  405. X  E const char *hu_stat[];    /* defined in eat.c */
  406. X--- 13,24 ----
  407. X  E int nroom;
  408. X  E int multi;
  409. X  E int hackpid;
  410. X! #if defined(UNIX) || defined(VMS)
  411. X  E int locknum;
  412. X+ #endif
  413. X  #ifdef DEF_PAGER
  414. X  E char *catmore;
  415. X  #endif    /* DEF_PAGER */
  416. X  E char SAVEF[];
  417. X  E char *hname;
  418. X  E const char *hu_stat[];    /* defined in eat.c */
  419. X***************
  420. X*** 97,103 ****
  421. X  E coord dig_pos;
  422. X  E boolean dig_down;
  423. X  
  424. X! E long moves;
  425. X  E long wailmsg;
  426. X  
  427. X  E boolean in_mklev;
  428. X--- 97,103 ----
  429. X  E coord dig_pos;
  430. X  E boolean dig_down;
  431. X  
  432. X! E long moves, monstermoves;
  433. X  E long wailmsg;
  434. X  
  435. X  E boolean in_mklev;
  436. X***************
  437. X*** 121,134 ****
  438. X  #endif
  439. X  
  440. X  #ifdef TEXTCOLOR
  441. X  #define RED        1
  442. X  #define GREEN        2
  443. X! #define YELLOW        3
  444. X  #define BLUE        4
  445. X  #define MAGENTA     5
  446. X  #define CYAN        6
  447. X  #define WHITE        7
  448. X! E char *HI_COLOR[8];    /* termcap.c */
  449. X  #endif
  450. X  
  451. X  #ifndef OBJ_H
  452. X--- 121,158 ----
  453. X  #endif
  454. X  
  455. X  #ifdef TEXTCOLOR
  456. X+ 
  457. X+ #define BLACK        0
  458. X  #define RED        1
  459. X  #define GREEN        2
  460. X! #define BROWN        3    /* on IBM, lo-intensity yellow is brown */
  461. X  #define BLUE        4
  462. X  #define MAGENTA     5
  463. X  #define CYAN        6
  464. X  #define WHITE        7
  465. X! #define GRAY        7    /* lo-intensity white */
  466. X! #define BRIGHT        8
  467. X! #define ORANGE_COLORED    9
  468. X! #define YELLOW        11
  469. X! #define MAXCOLORS    16    /* 8 basic + 8 bright */
  470. X! 
  471. X! /* these can be configured */
  472. X! #  define HI_MON    RED + BRIGHT        /* red slaps! */
  473. X! #  define HI_OBJ    MAGENTA
  474. X! #  define HI_METAL    CYAN
  475. X! #  define HI_COPPER    YELLOW
  476. X! #  define HI_SILVER    GRAY
  477. X! #  define HI_GOLD    YELLOW
  478. X! #  define HI_LEATHER    BROWN
  479. X! #  define HI_CLOTH    BROWN
  480. X! #  define HI_ORGANIC    GREEN
  481. X! #  define HI_WOOD    BROWN
  482. X! #  define HI_PAPER    BROWN
  483. X! #  define HI_GLASS    CYAN + BRIGHT
  484. X! #  define HI_MINERAL    GRAY
  485. X! #  define HI_ZAP    BLUE + BRIGHT        /* blue zaps! */
  486. X! 
  487. X! E char *hilites[MAXCOLORS];
  488. X  #endif
  489. X  
  490. X  #ifndef OBJ_H
  491. X*** include/Old/extern.h    Wed Sep 27 13:10:43 1989
  492. X--- include/extern.h    Tue Sep 26 19:11:23 1989
  493. X***************
  494. X*** 5,11 ****
  495. X  #ifndef EXTERN_H
  496. X  #define EXTERN_H
  497. X  
  498. X! #if defined(MSDOS) && !defined(__TURBOC__)
  499. X  /* MSC include files do not contain "extern" keyword */
  500. X  #define E
  501. X  #else
  502. X--- 5,11 ----
  503. X  #ifndef EXTERN_H
  504. X  #define EXTERN_H
  505. X  
  506. X! #if defined(MSDOS) && defined(MSC)
  507. X  /* MSC include files do not contain "extern" keyword */
  508. X  #define E
  509. X  #else
  510. X***************
  511. X*** 12,17 ****
  512. X--- 12,25 ----
  513. X  #define E extern
  514. X  #endif
  515. X  
  516. X+ /* ### allmain.c ### */
  517. X+ 
  518. X+ E int (*occupation)();
  519. X+ E int (*afternmv)();
  520. X+ E void moveloop();
  521. X+ E void stop_occupation();
  522. X+ E void newgame();
  523. X+ 
  524. X  /* ### alloc.c ### */
  525. X  
  526. X  #ifndef __TURBOC__
  527. X***************
  528. X*** 341,348 ****
  529. X  E void delobj P((struct obj *));
  530. X  E void freeobj P((struct obj *));
  531. X  E void freegold P((struct gold *));
  532. X- E struct monst *m_at P((int,int));
  533. X- E struct obj *o_at P((int,int));
  534. X  E struct obj *sobj_at P((int,int,int));
  535. X  E int carried P((struct obj *));
  536. X  E struct obj *carrying P((int));
  537. X--- 349,354 ----
  538. X***************
  539. X*** 404,410 ****
  540. X  E void enexto P((coord *,XCHAR_P,XCHAR_P,struct permonst *));
  541. X  E int goodpos P((int,int, struct permonst *));
  542. X  E void rloc P((struct monst *));
  543. X- E struct monst *mkmon_at P((char *,int,int));
  544. X  E void init_monstr();
  545. X  E struct permonst *rndmonst();
  546. X  E struct permonst *mkclass P((CHAR_P));
  547. X--- 410,415 ----
  548. X***************
  549. X*** 490,496 ****
  550. X  E boolean is_rustprone P((struct obj *));
  551. X  E boolean is_corrodeable P((struct obj *));
  552. X  #endif
  553. X- E boolean OBJ_AT P((int,int));
  554. X  E void place_object P((struct obj *,int,int));
  555. X  E void move_object P((struct obj *,int,int));
  556. X  E void remove_object P((struct obj *));
  557. X--- 495,500 ----
  558. X***************
  559. X*** 528,534 ****
  560. X  E void unstuck P((struct monst *));
  561. X  E void killed P((struct monst *));
  562. X  E void xkilled P((struct monst *,int));
  563. X- E void kludge V((char *,char *,...));
  564. X  E void rescham();
  565. X  E void restartcham();
  566. X  E int newcham P((struct monst *,struct permonst *));
  567. X--- 532,537 ----
  568. X***************
  569. X*** 578,583 ****
  570. X--- 581,592 ----
  571. X  E int m_move P((struct monst *,int));
  572. X  E void set_apparxy P((struct monst *));
  573. X  E boolean mdig_tunnel P((struct monst *));
  574. X+ #ifdef STUPID_CPP
  575. X+ E void place_monster P((struct monst *, int, int));
  576. X+ E void place_worm_seg P((struct monst *, int, int));
  577. X+ E void remove_monster P((int, int));
  578. X+ E struct monst *m_at P((int, int));
  579. X+ #endif
  580. X  
  581. X  /* ### monst.c ### */
  582. X  
  583. X***************
  584. X*** 617,627 ****
  585. X  #ifdef TOS
  586. X  E int _copyfile P((char *, char *));
  587. X  E int kbhit();
  588. X  #endif /* TOS */
  589. X  
  590. X  /* ### mthrowu.c ### */
  591. X  
  592. X! E int thitu P((int,int,char *));
  593. X  E int thrwmu P((struct monst *));
  594. X  E int spitmu P((struct monst *));
  595. X  E int breamu P((struct monst *,struct attack *));
  596. X--- 626,638 ----
  597. X  #ifdef TOS
  598. X  E int _copyfile P((char *, char *));
  599. X  E int kbhit();
  600. X+ E void restore_colors();
  601. X+ E void set_colors();
  602. X  #endif /* TOS */
  603. X  
  604. X  /* ### mthrowu.c ### */
  605. X  
  606. X! E int thitu P((int,int,struct obj *,char *));
  607. X  E int thrwmu P((struct monst *));
  608. X  E int spitmu P((struct monst *));
  609. X  E int breamu P((struct monst *,struct attack *));
  610. X***************
  611. X*** 657,663 ****
  612. X  E void lcase P((char *));
  613. X  E char *makeplural P((char *));
  614. X  E struct obj *readobjnam P((char *));
  615. X- E boolean uses_known P((struct obj *));
  616. X  
  617. X  /* ### options.c ### */
  618. X  
  619. X--- 668,673 ----
  620. X***************
  621. X*** 689,708 ****
  622. X  #ifdef SHELL
  623. X  E int dosh();
  624. X  #endif /* SHELL */
  625. X  E int child P((int));
  626. X  #endif /* UNIX */
  627. X  
  628. X  /* ### pcmain.c ### */
  629. X  
  630. X  #ifdef MSDOS
  631. X- E int (*occupation)();
  632. X- E int (*afternmv)();
  633. X  E void askname();
  634. X- E void impossible V((char *,...));
  635. X  #ifdef CHDIR
  636. X  E void chdirx P((char *,BOOLEAN_P));
  637. X  #endif /* CHDIR */
  638. X- E void stop_occupation();
  639. X  #endif /* MSDOS */
  640. X  
  641. X  /* ### pctty.c ### */
  642. X--- 699,716 ----
  643. X  #ifdef SHELL
  644. X  E int dosh();
  645. X  #endif /* SHELL */
  646. X+ #if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER)
  647. X  E int child P((int));
  648. X+ #endif
  649. X  #endif /* UNIX */
  650. X  
  651. X  /* ### pcmain.c ### */
  652. X  
  653. X  #ifdef MSDOS
  654. X  E void askname();
  655. X  #ifdef CHDIR
  656. X  E void chdirx P((char *,BOOLEAN_P));
  657. X  #endif /* CHDIR */
  658. X  #endif /* MSDOS */
  659. X  
  660. X  /* ### pctty.c ### */
  661. X***************
  662. X*** 957,963 ****
  663. X  E void pay_for_door P((int,int,char *));
  664. X  E void addtobill P((struct obj *,BOOLEAN_P));
  665. X  E void splitbill P((struct obj *,struct obj *));
  666. X! E void subfrombill P((struct obj *));
  667. X  E int doinvbill P((int));
  668. X  E int shkcatch P((struct obj *));
  669. X  E int shk_move P((struct monst *));
  670. X--- 965,971 ----
  671. X  E void pay_for_door P((int,int,char *));
  672. X  E void addtobill P((struct obj *,BOOLEAN_P));
  673. X  E void splitbill P((struct obj *,struct obj *));
  674. X! E void sellobj P((struct obj *));
  675. X  E int doinvbill P((int));
  676. X  E int shkcatch P((struct obj *));
  677. X  E int shk_move P((struct monst *));
  678. X***************
  679. X*** 1060,1072 ****
  680. X--- 1068,1087 ----
  681. X  E void more();
  682. X  E void cmore P((char *));
  683. X  E void clrlin();
  684. X+ #ifdef NEED_VARARGS
  685. X+ #if defined(USE_STDARG) || defined(USE_VARARGS)
  686. X+ E void vpline P((const char *, va_list));
  687. X+ #endif
  688. X+ #endif
  689. X  E void pline V((const char *,...));
  690. X  E void Norep V((const char *,...));
  691. X  E void You V((const char *,...));
  692. X  E void Your V((const char *,...));
  693. X+ E void kludge V((char *,char *,...));
  694. X  E void putsym P((CHAR_P));
  695. X  E void putstr P((char *));
  696. X  E char yn_function P((char *,CHAR_P));
  697. X+ E void impossible V((char *,...));
  698. X  
  699. X  /* ### topten.c ### */
  700. X  
  701. X***************
  702. X*** 1129,1140 ****
  703. X  /* ### unixmain.c ### */
  704. X  
  705. X  #ifdef UNIX
  706. X- E int (*occupation)();
  707. X- E int (*afternmv)();
  708. X  E void glo P((int));
  709. X  E void askname();
  710. X- E void impossible V((char *,...));
  711. X- E void stop_occupation();
  712. X  #endif /* UNIX */
  713. X  
  714. X  /* ### unixtty.c ### */
  715. X--- 1144,1151 ----
  716. X***************
  717. X*** 1175,1180 ****
  718. X--- 1186,1241 ----
  719. X  /* ### version.c ### */
  720. X  
  721. X  E int doversion();
  722. X+ 
  723. X+ /* ### vmsmain.c ### */
  724. X+ 
  725. X+ #ifdef VMS
  726. X+ #ifdef CHDIR
  727. X+ E void chdirx P((char *,char));
  728. X+ #endif /* CHDIR */
  729. X+ E void glo P((int));
  730. X+ E void askname();
  731. X+ #endif /* VMS */
  732. X+ 
  733. X+ /* ### vmsmisc.c ### */
  734. X+ 
  735. X+ #ifdef VMS
  736. X+ E void vms_abort();
  737. X+ E void vms_exit();
  738. X+ #endif /* VMS */
  739. X+ 
  740. X+ /* ### vmstty.c ### */
  741. X+ 
  742. X+ #ifdef VMS
  743. X+ E void gettty();
  744. X+ E void settty P((char *));
  745. X+ E void setftty();
  746. X+ E void intron();
  747. X+ E void introff();
  748. X+ E void error V((char *,...));
  749. X+ #endif /* VMS */
  750. X+ 
  751. X+ /* ### vmsunix.c ### */
  752. X+ 
  753. X+ #ifdef VMS
  754. X+ E void setrandom();
  755. X+ E int getyear();
  756. X+ E char *getdate();
  757. X+ E int phase_of_the_moon();
  758. X+ E int night();
  759. X+ E int midnight();
  760. X+ E void gethdate P((char *));
  761. X+ E int uptodate P((int));
  762. X+ E void getlock();
  763. X+ E void regularize P((char *));
  764. X+ E int vms_creat P((char *,unsigned int));
  765. X+ E int vms_getuid();
  766. X+ E void privoff();
  767. X+ E void privon();
  768. X+ # ifdef SHELL
  769. X+ E int dosh();
  770. X+ # endif
  771. X+ #endif /* VMS */
  772. X  
  773. X  /* ### weapon.c ### */
  774. X  
  775. X*** include/Old/flag.h    Wed Sep 27 13:11:28 1989
  776. X--- include/flag.h    Thu Sep 14 14:46:21 1989
  777. X***************
  778. X*** 51,56 ****
  779. X--- 51,59 ----
  780. X      boolean  silent;    /* whether the bell rings or not */
  781. X      boolean  pickup;    /* whether you pickup or move and look */
  782. X      boolean  num_pad;    /* use numbers for movement commands */
  783. X+ #ifdef TEXTCOLOR
  784. X+     boolean  use_color;    /* use color grapics */
  785. X+ #endif
  786. X  #ifdef DGK
  787. X      boolean  IBMBIOS;    /* whether we can use a BIOS call for
  788. X                   * redrawing the screen and character input */
  789. X*** include/Old/global.h    Wed Sep 27 13:11:49 1989
  790. X--- include/global.h    Mon Sep 25 20:55:26 1989
  791. X***************
  792. X*** 9,15 ****
  793. X  
  794. X  
  795. X  /* #define BETA        /* if a beta-test copy  [MRS] */
  796. X! #define VERSION    "3.0f"    /* version number. */
  797. X  
  798. X  /*
  799. X   * Files expected to exist in the playground directory.
  800. X--- 9,15 ----
  801. X  
  802. X  
  803. X  /* #define BETA        /* if a beta-test copy  [MRS] */
  804. X! #define VERSION    "3.0g"    /* version number. */
  805. X  
  806. X  /*
  807. X   * Files expected to exist in the playground directory.
  808. X***************
  809. X*** 117,122 ****
  810. X--- 117,127 ----
  811. X  #ifndef COORD_H
  812. X  #include "coord.h"
  813. X  #endif
  814. X+ 
  815. X+ #if defined(VMS) && !defined(VMSCONF_H)
  816. X+ # include "vmsconf.h"
  817. X+ #endif
  818. X+ 
  819. X  #if defined(UNIX) && !defined(UNIXCONF_H)
  820. X  # include "unixconf.h"
  821. X  #endif
  822. X*** include/Old/monst.h    Wed Sep 27 13:13:23 1989
  823. X--- include/monst.h    Thu Sep 14 14:24:49 1989
  824. X***************
  825. X*** 68,74 ****
  826. X  
  827. X  #define newmonst(xl)    (struct monst *) alloc((unsigned)(xl) + sizeof(struct monst))
  828. X  
  829. X- extern struct monst *fmon;
  830. X  extern struct monst *mydogs, *fallen_down;
  831. X  
  832. X  /* these are in mspeed */
  833. X--- 68,73 ----
  834. X*** include/Old/obj.h    Wed Sep 27 13:13:52 1989
  835. X--- include/obj.h    Sat Sep 23 01:27:18 1989
  836. X***************
  837. X*** 7,12 ****
  838. X--- 7,13 ----
  839. X  
  840. X  struct obj {
  841. X      struct obj *nobj;
  842. X+     struct obj *nexthere;        /* for location lists */
  843. X      struct obj *cobj;        /* id of container object is in */
  844. X  /*    unsigned o_cwt;            /* container weight capacity */
  845. X      unsigned o_id;
  846. X***************
  847. X*** 45,54 ****
  848. X      Bitfield(onamelth,6);
  849. X      long age;        /* creation date */
  850. X      long owornmask;
  851. X  
  852. X  /* note that TIMEOUT in you.h is defined as 07777L; no bits for items that
  853. X!  * confer properties may overlap that mask, or timeout.c will happily rearrange
  854. X!  * the bits behind the back of the property code
  855. X   * shirts, balls, and chains are currently safe
  856. X   */
  857. X  #define    W_BALL    02000L
  858. X--- 46,56 ----
  859. X      Bitfield(onamelth,6);
  860. X      long age;        /* creation date */
  861. X      long owornmask;
  862. X+ #define oeaten        rustfree
  863. X  
  864. X  /* note that TIMEOUT in you.h is defined as 07777L; no bits for items that
  865. X!  * confer properties may overlap that mask, or timeout.c will happily 
  866. X!  * rearrange the bits behind the back of the property code
  867. X   * shirts, balls, and chains are currently safe
  868. X   */
  869. X  #define    W_BALL    02000L
  870. X***************
  871. X*** 75,88 ****
  872. X                     is flexible; amount for tmp gold objects */
  873. X  };
  874. X  
  875. X- extern struct obj *fobj;
  876. X- 
  877. X  #define newobj(xl)    (struct obj *) alloc((unsigned)(xl) + sizeof(struct obj))
  878. X  #define    ONAME(otmp)    ((char *) otmp->oextra)
  879. X  #define    OGOLD(otmp)    (otmp->oextra[0])
  880. X  
  881. X  # ifndef STUPID_CPP    /* otherwise these macros are functions */
  882. X- /* #define OBJ_AT(x,y)    (levl[x][y].omask) */
  883. X  
  884. X  #define Is_container(otmp)    (otmp->otyp >= ICE_BOX && otmp->otyp <= BAG_OF_TRICKS)
  885. X  #define Is_box(otmp)    (otmp->otyp == LARGE_BOX || otmp->otyp == CHEST)
  886. X--- 77,88 ----
  887. X                     is flexible; amount for tmp gold objects */
  888. X  };
  889. X  
  890. X  #define newobj(xl)    (struct obj *) alloc((unsigned)(xl) + sizeof(struct obj))
  891. X  #define    ONAME(otmp)    ((char *) otmp->oextra)
  892. X  #define    OGOLD(otmp)    (otmp->oextra[0])
  893. X+ #define    OEATEN(otmp)    (otmp->oeaten)
  894. X  
  895. X  # ifndef STUPID_CPP    /* otherwise these macros are functions */
  896. X  
  897. X  #define Is_container(otmp)    (otmp->otyp >= ICE_BOX && otmp->otyp <= BAG_OF_TRICKS)
  898. X  #define Is_box(otmp)    (otmp->otyp == LARGE_BOX || otmp->otyp == CHEST)
  899. X*** include/Old/objclass.h    Wed Sep 27 13:14:06 1989
  900. X--- include/objclass.h    Thu Sep 14 14:53:21 1989
  901. X***************
  902. X*** 13,18 ****
  903. X--- 13,22 ----
  904. X      char *oc_uname;        /* called by user */
  905. X      Bitfield(oc_name_known,1);
  906. X      Bitfield(oc_merge,1);    /* merge otherwise equal objects */
  907. X+     Bitfield(oc_uses_known,1); /* obj->known affects full decription */
  908. X+                 /* otherwise, obj->dknown and obj->bknown */
  909. X+                 /* tell all, and obj->known should always */
  910. X+                 /* be set for proper merging behavior */
  911. X      Bitfield(oc_bool,1);
  912. X  #define oc_bimanual    oc_bool    /* for weapons */
  913. X  #define oc_bulky    oc_bool    /* for armor */
  914. X***************
  915. X*** 35,40 ****
  916. X--- 39,47 ----
  917. X      int oc_cost;        /* base cost in shops */
  918. X      schar oc_oc1, oc_oc2;
  919. X      int oc_oi;
  920. X+ #ifdef TEXTCOLOR
  921. X+     uchar oc_color;        /* color of the object */
  922. X+ #endif /* TEXTCOLOR */
  923. X  #define    nutrition    oc_oi    /* for foods */
  924. X  #define w_propellor    oc_oi    /* for weapons */
  925. X  #define WP_BOW        1
  926. X*** include/Old/patchlevel.h    Wed Sep 27 13:14:18 1989
  927. X--- include/patchlevel.h    Wed Sep 27 13:08:27 1989
  928. X***************
  929. X*** 17,27 ****
  930. X--- 17,29 ----
  931. X   *  add better screen-size sensing
  932. X   *  expand color use for PCs and introduce it for SVR3 UNIX machines
  933. X   *  extend '/' to multiple identifications
  934. X+  *  allow meta key to be used to invoke extended commands
  935. X   *  fix various minor bugs, and do further code cleaning
  936. X   */
  937. X  
  938. X  /*
  939. X   *  Patch 3, September 6, 1989
  940. X+  *  add war hammers and revise object prices
  941. X   *  extend prototypes to ANSI compilers in addition to the previous MSDOS ones
  942. X   *  move object-on-floor references into functions in preparation for planned
  943. X   *    data structures to allow faster access and better colors
  944. X***************
  945. X*** 29,32 ****
  946. X   *    patches
  947. X   */
  948. X  
  949. X! #define PATCHLEVEL    3
  950. X--- 31,46 ----
  951. X   *    patches
  952. X   */
  953. X  
  954. X! /*
  955. X!  *  Patch 4, September 27, 1989
  956. X!  *  add support for VMS (courtesy David Gentzel)
  957. X!  *  move monster-on-floor references into functions and implement the new
  958. X!  *    lookup structure for both objects and monsters
  959. X!  *  extend the definitions of objects and monsters to provide "living color"
  960. X!  *    in the dungeon, instead of a single monster color
  961. X!  *  ifdef varargs usage to satisfy ANSI compilers
  962. X!  *  standardize on the color 'gray'
  963. X!  *  assorted bug fixes
  964. X!  */
  965. X! 
  966. X! #define PATCHLEVEL    4
  967. X*** include/Old/pcconf.h    Wed Sep  6 23:46:25 1989
  968. X--- include/pcconf.h    Tue Sep 19 01:14:13 1989
  969. X***************
  970. X*** 93,107
  971. X  #  define TEXTCOLOR /* */
  972. X  #endif
  973. X  
  974. X! #ifdef TEXTCOLOR
  975. X! /* configurable colors */
  976. X! #  define HI_MON    RED    /* red slaps! */
  977. X! #  define HI_OBJ    MAGENTA
  978. X! #  define HI_METAL    CYAN
  979. X! #  define HI_ORGANIC    GREEN
  980. X! #  define HI_GOLD    YELLOW
  981. X! #  define HI_ZAP    BLUE    /* blue zaps! */
  982. X! #endif
  983. X! 
  984. X! #endif
  985. X  #endif /* MSDOS /* */
  986. X
  987. X--- 93,97 -----
  988. X  #  define TEXTCOLOR /* */
  989. X  #endif
  990. X  
  991. X! #endif /* PCCONF_H /* */
  992. X  #endif /* MSDOS /* */
  993. X*** include/Old/permonst.h    Wed Sep 27 13:14:41 1989
  994. X--- include/permonst.h    Thu Sep 14 14:49:22 1989
  995. X***************
  996. X*** 46,51 ****
  997. X--- 46,54 ----
  998. X      uchar        msound;            /* noise it makes */
  999. X      long        mflags1,        /* boolean bitflags */
  1000. X              mflags2;        /* more boolean bitflags */
  1001. X+ # ifdef TEXTCOLOR
  1002. X+     uchar        mcolor;            /* color to use */
  1003. X+ # endif
  1004. X  };
  1005. X  
  1006. X  extern struct permonst mons[];        /* the master list of monster types */
  1007. X*** include/Old/rm.h    Wed Sep 27 13:15:00 1989
  1008. X--- include/rm.h    Fri Sep 15 11:45:15 1989
  1009. X***************
  1010. X*** 206,213 ****
  1011. X      Bitfield(seen,1);
  1012. X      Bitfield(lit,1);
  1013. X      Bitfield(doormask,5);
  1014. X-     Bitfield(mmask,1);
  1015. X-     Bitfield(omask,1);
  1016. X      Bitfield(gmask,1);
  1017. X  };
  1018. X  
  1019. X--- 206,211 ----
  1020. X***************
  1021. X*** 216,222 ****
  1022. X  #define ladder        doormask
  1023. X  #define drawbridgemask    doormask
  1024. X  
  1025. X! extern struct rm levl[COLNO][ROWNO];
  1026. X  
  1027. X  #if defined(DGK) && !defined(OLD_TOS)
  1028. X  #define ACTIVE    1
  1029. X--- 214,249 ----
  1030. X  #define ladder        doormask
  1031. X  #define drawbridgemask    doormask
  1032. X  
  1033. X! typedef struct
  1034. X! {
  1035. X!     struct rm        locations[COLNO][ROWNO];
  1036. X!     struct obj        *objects[COLNO][ROWNO];
  1037. X!     struct monst    *monsters[COLNO][ROWNO];
  1038. X!     struct obj        *objlist;
  1039. X!     struct monst    *monlist;
  1040. X! }
  1041. X! level_t;
  1042. X! 
  1043. X! extern level_t    level;    /* structure describing the current level */
  1044. X! 
  1045. X! /*
  1046. X!  * Macros for compatibility with old code. Someday these will go away.
  1047. X!  */
  1048. X! #define OBJ_AT(x, y)    (level.objects[x][y] != (struct obj *)0)
  1049. X! #define MON_AT(x, y)    (level.monsters[x][y] != (struct monst *)0)
  1050. X! #define levl        level.locations
  1051. X! #define fobj        level.objlist
  1052. X! #define fmon        level.monlist
  1053. X! 
  1054. X! #ifndef STUPID_CPP    /* otherwise these macros are functions in monmove.c */
  1055. X! /*
  1056. X!  * Macros for encapsulation of level.monsters references.
  1057. X!  */
  1058. X! #define place_monster(m, x, y)    level.monsters[m->mx=x][m->my=y] = m
  1059. X! #define place_worm_seg(m, x, y) level.monsters[x][y] = m
  1060. X! #define remove_monster(x, y)    level.monsters[x][y] = (struct monst *)0
  1061. X! #define m_at(x, y)        level.monsters[x][y]
  1062. X! #endif    /* STUPID_CPP */
  1063. X  
  1064. X  #if defined(DGK) && !defined(OLD_TOS)
  1065. X  #define ACTIVE    1
  1066. X*** include/Old/system.h    Wed Sep 27 13:15:31 1989
  1067. X--- include/system.h    Sun Sep 17 14:26:28 1989
  1068. X***************
  1069. X*** 37,42 ****
  1070. X--- 37,46 ----
  1071. X  # endif
  1072. X  #endif
  1073. X  
  1074. X+ #ifdef VMS
  1075. X+ # define off_t long
  1076. X+ #endif
  1077. X+ 
  1078. X  /* You may want to change this to fit your system, as this is almost
  1079. X   * impossible to get right automatically.
  1080. X   * This is the type of signal handling functions.
  1081. X***************
  1082. X*** 170,179 ****
  1083. X--- 174,199 ----
  1084. X  #endif
  1085. X  #endif
  1086. X  
  1087. X+ #ifdef NEED_VARARGS
  1088. X+ #if defined(USE_STDARG) || defined(USE_VARARGS)
  1089. X+ E int vsprintf P((char *, const char *, va_list));
  1090. X+ E int vprintf P((const char *, va_list));
  1091. X+ #else
  1092. X+ #   define vprintf        printf
  1093. X+ #   define vsprintf        sprintf
  1094. X+ #   define vpline        pline
  1095. X+ #endif
  1096. X+ #endif /* NEED_VARARGS */
  1097. X+ 
  1098. X  #define Sprintf    (void) sprintf
  1099. X  #define Strcat    (void) strcat
  1100. X  #define Strcpy    (void) strcpy
  1101. X  #define Printf  (void) printf
  1102. X+ 
  1103. X+ #ifdef NEED_VARARGS
  1104. X+ #define Vprintf (void) vprintf
  1105. X+ #define Vsprintf (void) vsprintf
  1106. X+ #endif
  1107. X  
  1108. X  E int tgetent P((char *,char *));
  1109. X  E int tgetnum P((char *));
  1110. X*** include/Old/tosconf.h    Wed Sep 27 13:15:45 1989
  1111. X--- include/tosconf.h    Thu Sep 14 14:46:25 1989
  1112. X***************
  1113. X*** 33,41 ****
  1114. X--- 33,43 ----
  1115. X  #define Srand() srand()
  1116. X  #endif
  1117. X  
  1118. X+ /* configurable options */
  1119. X  #define DGK
  1120. X  #define RANDOM
  1121. X  #define SHELL
  1122. X+ #define TEXTCOLOR
  1123. X  
  1124. X  #ifndef MSDOS_H
  1125. X  #include "msdos.h"
  1126. X*** include/Old/tradstdc.h    Wed Sep 27 13:15:56 1989
  1127. X--- include/tradstdc.h    Sun Sep 17 14:26:33 1989
  1128. X***************
  1129. X*** 15,20 ****
  1130. X--- 15,76 ----
  1131. X   * Makes substitutes for compatibility with the old C standard.
  1132. X   */
  1133. X  
  1134. X+ /* Decide how to handle variable parameter lists:
  1135. X+  * USE_STDARG means use the ANSI <stdarg.h> facilities (only ANSI compilers
  1136. X+  * should do this, and only if the library supports it).
  1137. X+  * USE_VARARGS means use the <varargs.h> facilities. Again, this should only
  1138. X+  * be done if the library supports it. ANSI is *not* required for this.
  1139. X+  * Otherwise, the kludgy old methods are used.
  1140. X+  * The defaults are USE_STDARG for ANSI compilers, and USE_OLDARGS for
  1141. X+  * others.
  1142. X+  */
  1143. X+ 
  1144. X+ /* #define USE_VARARGS        /* use <varargs.h> instead of <stdarg.h> */
  1145. X+ /* #define USE_OLDARGS        /* don't use any variable argument facilites */
  1146. X+ 
  1147. X+ #ifdef __STDC__
  1148. X+ # if !(defined(AMIGA) || defined(USE_VARARGS) || defined(USE_OLDARGS))
  1149. X+ #   define USE_STDARG
  1150. X+ # endif
  1151. X+ #endif
  1152. X+ 
  1153. X+ #ifdef NEED_VARARGS        /* only define these if necessary */
  1154. X+ #ifdef USE_STDARG
  1155. X+ # include <stdarg.h>
  1156. X+ # define VA_DECL(typ1,var1)    (typ1 var1, ...) { va_list the_args;
  1157. X+ # define VA_DECL2(typ1,var1,typ2,var2)    \
  1158. X+     (typ1 var1, typ2 var2, ...) { va_list the_args;
  1159. X+ # define VA_INIT(var1,typ1)
  1160. X+ # define VA_NEXT(var1,typ1)    var1 = va_arg(the_args, typ1)
  1161. X+ # define VA_ARGS        the_args
  1162. X+ # define VA_START(x)        va_start(the_args, x)
  1163. X+ # define VA_END()        va_end(the_args)
  1164. X+ #else
  1165. X+ # ifdef USE_VARARGS
  1166. X+ #  include <varargs.h>
  1167. X+ #  define VA_DECL(typ1,var1)    (va_alist) va_dcl {\
  1168. X+         va_list the_args; typ1 var1;
  1169. X+ #  define VA_DECL2(typ1,var1,typ2,var2)    (va_alist) va_dcl {\
  1170. X+         va_list the_args; typ1 var1; typ2 var2;
  1171. X+ #  define VA_ARGS        the_args
  1172. X+ #  define VA_START(x)        va_start(the_args)
  1173. X+ #  define VA_INIT(var1,typ1)     va_arg(var1, typ1)
  1174. X+ #  define VA_NEXT(var1,typ1)    var1 = va_arg(the_args,typ1)
  1175. X+ #  define VA_END()        va_end(the_args)
  1176. X+ # else
  1177. X+ #   define VA_ARGS    arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9
  1178. X+ #   define VA_DECL(typ1,var1)  (var1,VA_ARGS) typ1 var1; \
  1179. X+     char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; {
  1180. X+ #   define VA_DECL2(typ1,var1,typ2,var2)  (var1,var2,VA_ARGS) \
  1181. X+     typ1 var1; typ2 var2;\
  1182. X+     char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; {
  1183. X+ #   define VA_START(x)
  1184. X+ #   define VA_INIT(var1,typ1)
  1185. X+ #   define VA_END()
  1186. X+ # endif
  1187. X+ #endif
  1188. X+ #endif /* NEED_VARARGS */
  1189. X+ 
  1190. X  #if (defined(__STDC__) || defined(MSDOS)) && !defined(AMIGA)
  1191. X  
  1192. X  /* Used for robust ANSI parameter forward declarations:
  1193. X***************
  1194. X*** 27,33 ****
  1195. X   */
  1196. X  
  1197. X  # define P(s)        s
  1198. X! # ifdef MSDOS
  1199. X  #  define V(s)        s
  1200. X  # else
  1201. X  #  define V(s)        ()
  1202. X--- 83,89 ----
  1203. X   */
  1204. X  
  1205. X  # define P(s)        s
  1206. X! # if defined(MSDOS) || defined(USE_STDARG)
  1207. X  #  define V(s)        s
  1208. X  # else
  1209. X  #  define V(s)        ()
  1210. X*** include/Old/unixconf.h    Wed Sep  6 23:47:19 1989
  1211. X--- include/unixconf.h    Sat Sep 16 23:12:56 1989
  1212. X***************
  1213. X*** 73,80
  1214. X   * A stat system call is done on the mailbox every MAILCKFREQ moves.
  1215. X   */
  1216. X  
  1217. X! #define    MAIL
  1218. X! #if defined(BSD) || defined(ULTRIX)
  1219. X  #define    DEF_MAILREADER    "/usr/ucb/Mail"
  1220. X  #else
  1221. X  # ifdef SYSV
  1222. X
  1223. X--- 73,82 -----
  1224. X   * A stat system call is done on the mailbox every MAILCKFREQ moves.
  1225. X   */
  1226. X  
  1227. X! #define    MAIL        /* Deliver mail during the game */
  1228. X! #ifdef MAIL
  1229. X! 
  1230. X! # if defined(BSD) || defined(ULTRIX)
  1231. X  #define    DEF_MAILREADER    "/usr/ucb/Mail"
  1232. X  # else
  1233. X  #  if defined(SYSV) || defined(DGUX)
  1234. X***************
  1235. X*** 76,84
  1236. X  #define    MAIL
  1237. X  #if defined(BSD) || defined(ULTRIX)
  1238. X  #define    DEF_MAILREADER    "/usr/ucb/Mail"
  1239. X- #else
  1240. X- # ifdef SYSV
  1241. X- #define    DEF_MAILREADER    "/usr/bin/mailx"
  1242. X  # else
  1243. X  #define    DEF_MAILREADER    "/bin/mail"
  1244. X  # endif
  1245. X
  1246. X--- 78,83 -----
  1247. X  
  1248. X  # if defined(BSD) || defined(ULTRIX)
  1249. X  #define    DEF_MAILREADER    "/usr/ucb/Mail"
  1250. X  # else
  1251. X  #  if defined(SYSV) || defined(DGUX)
  1252. X  #   ifdef M_XENIX
  1253. X***************
  1254. X*** 80,85
  1255. X  # ifdef SYSV
  1256. X  #define    DEF_MAILREADER    "/usr/bin/mailx"
  1257. X  # else
  1258. X  #define    DEF_MAILREADER    "/bin/mail"
  1259. X  # endif
  1260. X  #endif
  1261. X
  1262. X--- 79,91 -----
  1263. X  # if defined(BSD) || defined(ULTRIX)
  1264. X  #define    DEF_MAILREADER    "/usr/ucb/Mail"
  1265. X  # else
  1266. X+ #  if defined(SYSV) || defined(DGUX)
  1267. X+ #   ifdef M_XENIX
  1268. X+ #define    DEF_MAILREADER    "/usr/bin/mail"
  1269. X+ #   else
  1270. X+ #define    DEF_MAILREADER    "/usr/bin/mailx"
  1271. X+ #   endif
  1272. X+ #  else
  1273. X  #define    DEF_MAILREADER    "/bin/mail"
  1274. X  #  endif
  1275. X  # endif
  1276. X***************
  1277. X*** 81,86
  1278. X  #define    DEF_MAILREADER    "/usr/bin/mailx"
  1279. X  # else
  1280. X  #define    DEF_MAILREADER    "/bin/mail"
  1281. X  # endif
  1282. X  #endif
  1283. X  #define    MAILCKFREQ    50
  1284. X
  1285. X--- 87,93 -----
  1286. X  #   endif
  1287. X  #  else
  1288. X  #define    DEF_MAILREADER    "/bin/mail"
  1289. X+ #  endif
  1290. X  # endif
  1291. X  
  1292. X  #define    MAILCKFREQ    50
  1293. X***************
  1294. X*** 82,88
  1295. X  # else
  1296. X  #define    DEF_MAILREADER    "/bin/mail"
  1297. X  # endif
  1298. X! #endif
  1299. X  #define    MAILCKFREQ    50
  1300. X  
  1301. X  #ifdef COMPRESS
  1302. X
  1303. X--- 89,95 -----
  1304. X  #define    DEF_MAILREADER    "/bin/mail"
  1305. X  #  endif
  1306. X  # endif
  1307. X! 
  1308. X  #define    MAILCKFREQ    50
  1309. X  #endif    /* MAIL */
  1310. X  
  1311. X***************
  1312. X*** 84,89
  1313. X  # endif
  1314. X  #endif
  1315. X  #define    MAILCKFREQ    50
  1316. X  
  1317. X  #ifdef COMPRESS
  1318. X  /* Some implementations of compress need a 'quiet' option.
  1319. X
  1320. X--- 91,97 -----
  1321. X  # endif
  1322. X  
  1323. X  #define    MAILCKFREQ    50
  1324. X+ #endif    /* MAIL */
  1325. X  
  1326. X  #ifdef COMPRESS
  1327. X  /* Some implementations of compress need a 'quiet' option.
  1328. X***************
  1329. X*** 146,160
  1330. X  # undef hc
  1331. X  #endif
  1332. X  
  1333. X! #ifdef TEXTCOLOR
  1334. X! /* configurable colors */
  1335. X! #  define HI_MON    RED    /* red slaps! */
  1336. X! #  define HI_OBJ    MAGENTA
  1337. X! #  define HI_METAL    CYAN
  1338. X! #  define HI_ORGANIC    GREEN
  1339. X! #  define HI_GOLD    YELLOW
  1340. X! #  define HI_ZAP    BLUE    /* blue zaps! */
  1341. X! #endif
  1342. X! 
  1343. X! #endif
  1344. X  #endif /* UNIX /* */
  1345. X
  1346. X--- 154,158 -----
  1347. X  # undef hc
  1348. X  #endif
  1349. X  
  1350. X! #endif /* UNIXCONF_H /* */
  1351. X  #endif /* UNIX /* */
  1352. X*** ./Old/Install.unix    Wed Sep 27 10:11:25 1989
  1353. X--- ./Install.unix    Sat Sep 23 00:47:12 1989
  1354. X***************
  1355. X*** 49,64 ****
  1356. X  
  1357. X  Notes:
  1358. X  
  1359. X! 1.  No, your old save files and bones files will not work with NetHack 3.0.
  1360. X      Don't bother trying to keep them.  The old score list will work fine; the
  1361. X      only problem is that you may have trouble beating your old scores in this
  1362. X      version.
  1363. X  
  1364. X! 2.  If you insisted on doing the final installation by hand, you probably
  1365. X      forgot to make a save directory.  If you don't go back and do this, you
  1366. X      won't be able to save games.
  1367. X  
  1368. X! 3.  To install an update of this version of NetHack after changing something,
  1369. X      type 'make update' from the main directory.  If you created the new
  1370. X      version yourself, it should be safe to use 'make update' as long as you
  1371. X      did not add, delete, or reorder monsters or objects and you did not change
  1372. X--- 49,70 ----
  1373. X  
  1374. X  Notes:
  1375. X  
  1376. X! 1.  A number of systems, such as Xenix, support both the termcap and terminfo
  1377. X!     terminal capability libraries.  Make sure that the TERMINFO definition in
  1378. X!     unixconf.h and TERMLIB in the source Makefile correspond.
  1379. X!     If spurious characters appear on the screen while kicking, zapping, etc.
  1380. X!     it is likely that you have linked the source to the wrong library.
  1381. X! 
  1382. X! 2.  No, your old save files and bones files will not work with NetHack 3.0.
  1383. X      Don't bother trying to keep them.  The old score list will work fine; the
  1384. X      only problem is that you may have trouble beating your old scores in this
  1385. X      version.
  1386. X  
  1387. X! 3.  If you insisted on doing the final installation by hand, you probably
  1388. X      forgot to make a save directory.  If you don't go back and do this, you
  1389. X      won't be able to save games.
  1390. X  
  1391. X! 4.  To install an update of this version of NetHack after changing something,
  1392. X      type 'make update' from the main directory.  If you created the new
  1393. X      version yourself, it should be safe to use 'make update' as long as you
  1394. X      did not add, delete, or reorder monsters or objects and you did not change
  1395. X***************
  1396. X*** 65,67 ****
  1397. X--- 71,81 ----
  1398. X      the format of saved level files.  If you did any of these things, you
  1399. X      should also remove any saved games and bones levels.  (Trying to use such
  1400. X      files often produces amusing but useless confusions on the game's part.)
  1401. X+ 
  1402. X+ 5.  Xenix/286's lex generates a faulty lexical analyser from lev_comp.l.
  1403. X+     The beta-release of flex 2.1 (avaliable from uunet, osu-cis,
  1404. X+     prep.ai.mit.edu, etc.) can be used to generate the lexer.
  1405. X+     The only change to flex is to change "#define yyleng (yy_cp - yy_bp)"
  1406. X+     to "#define yyleng (int)(yy_cp - yy_bp)" in flex.skel.
  1407. X+     Flex is not needed with Xenix/386, as its lex generates a proper lexical
  1408. X+     analyser.  [Xenix instructions by J.T. Conklin]
  1409. X*** ./Old/Makefile.top    Wed Sep 27 10:11:38 1989
  1410. X--- ./Makefile.top    Tue Sep 19 18:52:15 1989
  1411. X***************
  1412. X*** 1,6 ****
  1413. X--- 1,18 ----
  1414. X  #    Hack Makefile.
  1415. X  #    SCCS Id: @(#)Makefile.top    3.0    89/03/23
  1416. X  
  1417. X+ # newer makes predefine $(MAKE) to 'make' and do smarter processing of
  1418. X+ # recursive make calls if $(MAKE) is used
  1419. X+ # these makes allow $(MAKE) to be overridden by the environment if someone
  1420. X+ # wants to (or has to) use something other than the standard make, so we do
  1421. X+ # not want to unconditionally set $(MAKE) here
  1422. X+ #
  1423. X+ # unfortunately, some older makes do not predefine $(MAKE); if you have one of
  1424. X+ # these, uncomment the following line
  1425. X+ # (you will know that you have one if you get complaints about unable to
  1426. X+ # execute things like 'data' and 'rumors')
  1427. X+ # MAKE = make
  1428. X+ 
  1429. X  # make NetHack
  1430. X  GAME     = nethack
  1431. X  GAMEUID  = games
  1432. X***************
  1433. X*** 55,60 ****
  1434. X--- 67,73 ----
  1435. X  #    (don't yank the old version out from under people who're playing it)
  1436. X      mv $(GAMEDIR)/$(GAME) $(GAMEDIR)/$(GAME).old
  1437. X      cp src/$(GAME) $(GAMEDIR)
  1438. X+     -rm -f $(SHELLDIR)/$(GAME)
  1439. X      sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
  1440. X          -e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
  1441. X          < auxil/nethack.sh \
  1442. X***************
  1443. X*** 82,87 ****
  1444. X--- 95,101 ----
  1445. X  # copy over the game files
  1446. X      ( cd auxil ; cp $(AUX) $(GAMEDIR) )
  1447. X      cp src/$(GAME) $(GAMEDIR)
  1448. X+     -rm -f $(SHELLDIR)/$(GAME)
  1449. X      sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
  1450. X          -e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
  1451. X          < auxil/nethack.sh \
  1452. X*** ./Old/Files    Wed Sep 27 10:11:03 1989
  1453. X--- ./Files    Tue Sep 26 23:04:12 1989
  1454. X***************
  1455. X*** 1,7 ****
  1456. X! This is a listing of all files in a full NetHack 3.0 distribution, organized in
  1457. X! their standard manner on a UNIX system.  It indicates which files are necessary
  1458. X! for which versions, so that you can tell which files may be deleted from or not
  1459. X! transferred to your system if you wish.
  1460. X  
  1461. X  
  1462. X  (files in top directory)
  1463. X--- 1,7 ----
  1464. X! This is a listing of all files in a full NetHack 3.0 distribution, organized
  1465. X! in their standard manner on a UNIX system.  It indicates which files are 
  1466. X! necessary for which versions, so that you can tell which files may be deleted
  1467. X! from or not transferred to your system if you wish.
  1468. X  
  1469. X  
  1470. X  (files in top directory)
  1471. X***************
  1472. X*** 27,34 ****
  1473. X  
  1474. X  others:
  1475. X  (files for MSDOS version)
  1476. X! Make.ini        Makefile.msc    Makefile.os2    Makefile.tcc    Maketcc.ini
  1477. X! NetHack.cnf     termcap         termcap.uu
  1478. X  (files for MSDOS, Amiga, and Atari versions)
  1479. X  pcmain.c        pctty.c         pcunix.c
  1480. X  (file for MSDOS and new Atari versions)
  1481. X--- 27,34 ----
  1482. X  
  1483. X  others:
  1484. X  (files for MSDOS version)
  1485. X! Make.ini        Makefile.msc    Makefile.pc     Makefile.os2    Makefile.tcc
  1486. X! Maketcc.ini     NetHack.cnf     termcap         termcap.uu
  1487. X  (files for MSDOS, Amiga, and Atari versions)
  1488. X  pcmain.c        pctty.c         pcunix.c
  1489. X  (file for MSDOS and new Atari versions)
  1490. X***************
  1491. X*** 37,43 ****
  1492. X  Makefile.st
  1493. X  (file for old Atari version)
  1494. X  oldtos.c
  1495. X! (file with random number routines, which may be included in any version)
  1496. X  random.c
  1497. X  
  1498. X  
  1499. X--- 37,43 ----
  1500. X  Makefile.st
  1501. X  (file for old Atari version)
  1502. X  oldtos.c
  1503. X! (Berkeley random number file, which may be included in any version)
  1504. X  random.c
  1505. X  
  1506. X  
  1507. X***************
  1508. X*** 51,57 ****
  1509. X  obj.h           objclass.h      patchlevel.h    pcconf.h        permonst.h
  1510. X  prop.h          rm.h            sp_lev.h        spell.h         system.h
  1511. X  tosconf.h       tradstdc.h      trap.h          trapname.h      unixconf.h
  1512. X! vault.h         wseg.h          you.h           youprop.h
  1513. X  (file for special level compiler (STRONGHOLD option))
  1514. X  lev_comp.h
  1515. X  
  1516. X--- 51,57 ----
  1517. X  obj.h           objclass.h      patchlevel.h    pcconf.h        permonst.h
  1518. X  prop.h          rm.h            sp_lev.h        spell.h         system.h
  1519. X  tosconf.h       tradstdc.h      trap.h          trapname.h      unixconf.h
  1520. X! vault.h         vmsconf.h       wseg.h          you.h           youprop.h
  1521. X  (file for special level compiler (STRONGHOLD option))
  1522. X  lev_comp.h
  1523. X  
  1524. X***************
  1525. X*** 79,81 ****
  1526. X--- 79,88 ----
  1527. X  lev_comp.c      lev_comp.l      lev_comp.y      lev_lex.c       lev_main.c
  1528. X  (files for UNIX versions)
  1529. X  Makefile.src    unixmain.c      unixtty.c       unixunix.c
  1530. X+ 
  1531. X+ vms:
  1532. X+ (files for VMS version)
  1533. X+ Install.vms     spec_lev.com    vmsbuild.com    vmsmain.c       vmsmisc.c
  1534. X+ vmstty.c        vmsunix.c
  1535. X+ (GNU termcap files that support VMS version)
  1536. X+ vmstermcap.c    vmstparam.c
  1537. X*** ./Old/README    Wed Sep 27 10:11:59 1989
  1538. X--- ./README    Sun Sep 17 13:12:06 1989
  1539. X***************
  1540. X*** 37,43 ****
  1541. X      directory as the 'Top' directory.  It makes no difference what you
  1542. X      call it.
  1543. X  
  1544. X! 2.  If there is no flaw in the packaging, FIVE sub-directories will be
  1545. X      automatically created, and files will be deposited in them: 
  1546. X  
  1547. X      a.  A 'src' directory, which will contain general *.c files.
  1548. X--- 37,43 ----
  1549. X      directory as the 'Top' directory.  It makes no difference what you
  1550. X      call it.
  1551. X  
  1552. X! 2.  If there is no flaw in the packaging, SIX sub-directories will be
  1553. X      automatically created, and files will be deposited in them: 
  1554. X  
  1555. X      a.  A 'src' directory, which will contain general *.c files.
  1556. X***************
  1557. X*** 45,50 ****
  1558. X--- 45,51 ----
  1559. X      c.  An 'auxil' directory, which will contain a variety of data files.
  1560. X      d.  An 'amiga' directory, which will contain the Amiga-specific files.
  1561. X      e.  An 'others' directory, which will contain MSDOS and TOS files.
  1562. X+     f.  A 'vms' directory, which will contain VMS files.
  1563. X  
  1564. X      The names of these directories should not be changed, unless you are
  1565. X      ready to go through the makefiles and the makedefs program and change
  1566. X***************
  1567. X*** 86,91 ****
  1568. X--- 87,94 ----
  1569. X      Commodore Amiga (probably -- there have been some changes since
  1570. X          the Amiga port was done, but we believe it should still work)
  1571. X      Atari 1040ST under TOS
  1572. X+     DEC vaxen running VMS (probably still requires tweaking) 
  1573. X+     Data General AViiON systems under DG/UX
  1574. X  
  1575. X              - - - - - - - - - - -
  1576. X  
  1577. X*** /dev/null    Thu Sep 28 00:44:19 1989
  1578. X--- include/vmsconf.h    Thu Sep 28 00:44:04 1989
  1579. X***************
  1580. X*** 0
  1581. X
  1582. X--- 1,69 -----
  1583. X+ /*    SCCS Id: @(#)vmsconf.h    3.0    88/07/21
  1584. X+ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1585. X+ /* NetHack may be freely redistributed.  See license for details. */
  1586. X+ 
  1587. X+ #ifdef VMS
  1588. X+ #ifndef VMSCONF_H
  1589. X+ #define VMSCONF_H
  1590. X+ 
  1591. X+ #undef UNIX
  1592. X+ #undef HACKDIR
  1593. X+ #define HACKDIR    "USR$ROOT0:[GENTZEL.NHDIR]"
  1594. X+ #undef RECORD
  1595. X+ #define RECORD "record;1"
  1596. X+ 
  1597. X+ #undef COMPRESS
  1598. X+ #undef ZEROCOMP
  1599. X+ 
  1600. X+ /*
  1601. X+  * If you define MAIL, then the player will be notified of new broadcasts
  1602. X+  * when they arrive.
  1603. X+  */
  1604. X+ #define    MAIL
  1605. X+ 
  1606. X+ #define RANDOM        /* if neither random/srandom nor lrand48/srand48
  1607. X+                is available from your system */
  1608. X+ 
  1609. X+ #define    FCMASK    0660    /* file creation mask */
  1610. X+ 
  1611. X+ 
  1612. X+ /*
  1613. X+  * The remainder of the file should not need to be changed.
  1614. X+  */
  1615. X+ 
  1616. X+ #include <time.h>
  1617. X+ #include <file.h>
  1618. X+ 
  1619. X+ #define    HLOCK    "perm;1"    /* an empty file used for locking purposes */
  1620. X+ #define LLOCK    "safelock;1"    /* link to previous */
  1621. X+ 
  1622. X+ #ifndef REDO
  1623. X+ # define Getchar vms_getchar
  1624. X+ #else
  1625. X+ # define tgetch vms_getchar
  1626. X+ #endif
  1627. X+ 
  1628. X+ #define SHELL        /* do not delete the '!' command */
  1629. X+ 
  1630. X+ #include "system.h"
  1631. X+ 
  1632. X+ #define index    strchr
  1633. X+ #define rindex    strrchr
  1634. X+ 
  1635. X+ /* Use the high quality random number routines. */
  1636. X+ #if defined(RANDOM)
  1637. X+ #define Rand()    random()
  1638. X+ #define Srand(seed) srandom(seed)
  1639. X+ #else
  1640. X+ #define Rand()    rand()
  1641. X+ #define Srand(seed) srand(seed)
  1642. X+ #endif
  1643. X+ 
  1644. X+ #define unlink(x) delete(x)
  1645. X+ #define exit(x) vms_exit(x)
  1646. X+ #define getuid() vms_getuid()
  1647. X+ #define abort() vms_abort()
  1648. X+ #define creat(f,m) vms_creat(f,m)
  1649. X+ 
  1650. X+ #endif
  1651. X+ #endif /* VMS /* */
  1652. X*** /dev/null    Wed Sep 27 12:48:12 1989
  1653. X--- vms/vmsunix.c    Tue Sep 26 18:51:29 1989
  1654. X***************
  1655. X*** 0 ****
  1656. X--- 1,397 ----
  1657. X+ /*    SCCS Id: @(#)vmsunix.c    3.0    88/04/13
  1658. X+ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1659. X+ /* NetHack may be freely redistributed.  See license for details. */
  1660. X+ 
  1661. X+ /* This file collects some Unix dependencies; pager.c contains some more */
  1662. X+ 
  1663. X+ /*
  1664. X+  * The time is used for:
  1665. X+  *    - seed for rand()
  1666. X+  *    - year on tombstone and yymmdd in record file
  1667. X+  *    - phase of the moon (various monsters react to NEW_MOON or FULL_MOON)
  1668. X+  *    - night and midnight (the undead are dangerous at midnight)
  1669. X+  *    - determination of what files are "very old"
  1670. X+  */
  1671. X+ 
  1672. X+ #include "hack.h"
  1673. X+ 
  1674. X+ #include <rms.h>
  1675. X+ #include <jpidef.h>
  1676. X+ #include <ssdef.h>
  1677. X+ #include <errno.h>
  1678. X+ #include <signal.h>
  1679. X+ #undef off_t
  1680. X+ #include <sys/stat.h>
  1681. X+ 
  1682. X+ void
  1683. X+ setrandom()
  1684. X+ {
  1685. X+     (void) Srand((long) time ((time_t *) 0));
  1686. X+ }
  1687. X+ 
  1688. X+ static struct tm *
  1689. X+ getlt()
  1690. X+ {
  1691. X+     time_t date;
  1692. X+ 
  1693. X+     (void) time(&date);
  1694. X+     return(localtime(&date));
  1695. X+ }
  1696. X+ 
  1697. X+ int
  1698. X+ getyear()
  1699. X+ {
  1700. X+     return(1900 + getlt()->tm_year);
  1701. X+ }
  1702. X+ 
  1703. X+ char *
  1704. X+ getdate()
  1705. X+ {
  1706. X+     static char datestr[7];
  1707. X+     register struct tm *lt = getlt();
  1708. X+ 
  1709. X+     Sprintf(datestr, "%2d%2d%2d",
  1710. X+         lt->tm_year, lt->tm_mon + 1, lt->tm_mday);
  1711. X+     if(datestr[2] == ' ') datestr[2] = '0';
  1712. X+     if(datestr[4] == ' ') datestr[4] = '0';
  1713. X+     return(datestr);
  1714. X+ }
  1715. X+ 
  1716. X+ int
  1717. X+ phase_of_the_moon()            /* 0-7, with 0: new, 4: full */
  1718. X+ {                    /* moon period: 29.5306 days */
  1719. X+                     /* year: 365.2422 days */
  1720. X+     register struct tm *lt = getlt();
  1721. X+     register int epact, diy, goldn;
  1722. X+ 
  1723. X+     diy = lt->tm_yday;
  1724. X+     goldn = (lt->tm_year % 19) + 1;
  1725. X+     epact = (11 * goldn + 18) % 30;
  1726. X+     if ((epact == 25 && goldn > 11) || epact == 24)
  1727. X+         epact++;
  1728. X+ 
  1729. X+     return( (((((diy + epact) * 6) + 11) % 177) / 22) & 7 );
  1730. X+ }
  1731. X+ 
  1732. X+ int
  1733. X+ night()
  1734. X+ {
  1735. X+     register int hour = getlt()->tm_hour;
  1736. X+ 
  1737. X+     return(hour < 6 || hour > 21);
  1738. X+ }
  1739. X+ 
  1740. X+ int
  1741. X+ midnight()
  1742. X+ {
  1743. X+     return(getlt()->tm_hour == 0);
  1744. X+ }
  1745. X+ 
  1746. X+ static struct stat buf, hbuf;
  1747. X+ 
  1748. X+ void
  1749. X+ gethdate(name) char *name; {
  1750. X+     register char *np;
  1751. X+ 
  1752. X+     if(stat(name, &hbuf))
  1753. X+         error("Cannot get status of %s.",
  1754. X+             (np = rindex(name, ']')) ? np+1 : name);
  1755. X+ }
  1756. X+ 
  1757. X+ int
  1758. X+ uptodate(fd)
  1759. X+ int fd;
  1760. X+ {
  1761. X+     if(fstat(fd, &buf)) {
  1762. X+         pline("Cannot get status of saved level? ");
  1763. X+         return(0);
  1764. X+     }
  1765. X+     if(buf.st_mtime < hbuf.st_mtime) {
  1766. X+         pline("Saved level is out of date. ");
  1767. X+         return(0);
  1768. X+     }
  1769. X+     return(1);
  1770. X+ }
  1771. X+ 
  1772. X+ static int
  1773. X+ veryold(fd)
  1774. X+ int fd;
  1775. X+ {
  1776. X+     register int i;
  1777. X+     time_t date;
  1778. X+ 
  1779. X+     if(fstat(fd, &buf)) return(0);            /* cannot get status */
  1780. X+     if(buf.st_size != sizeof(int)) return(0);    /* not an xlock file */
  1781. X+     (void) time(&date);
  1782. X+     if(date - buf.st_mtime < 3L*24L*60L*60L) {    /* recent */
  1783. X+         int lockedpid;    /* should be the same size as hackpid */
  1784. X+         int status, dummy, code = JPI$_PID;
  1785. X+ 
  1786. X+         if(read(fd, (char *)&lockedpid, sizeof(lockedpid)) !=
  1787. X+             sizeof(lockedpid))
  1788. X+             /* strange ... */
  1789. X+             return(0);
  1790. X+           if(!(!((status = LIB$GETJPI(&code, &lockedpid, 0, &dummy)) & 1)
  1791. X+              && status == SS$_NONEXPR))
  1792. X+             return(0);
  1793. X+     }
  1794. X+     (void) close(fd);
  1795. X+     for(i = 1; i <= MAXLEVEL+1; i++) {        /* try to remove all */
  1796. X+         glo(i);
  1797. X+         (void) delete(lock);
  1798. X+     }
  1799. X+     glo(0);
  1800. X+     if(delete(lock)) return(0);            /* cannot remove it */
  1801. X+     return(1);                    /* success! */
  1802. X+ }
  1803. X+ 
  1804. X+ void
  1805. X+ getlock()
  1806. X+ {
  1807. X+     register int i = 0, fd;
  1808. X+ 
  1809. X+ #ifdef HARD
  1810. X+     /* idea from rpick%ucqais@uccba.uc.edu
  1811. X+      * prevent automated rerolling of characters
  1812. X+      * test input (fd0) so that tee'ing output to get a screen dump still
  1813. X+      * works
  1814. X+      * also incidentally prevents development of any hack-o-matic programs
  1815. X+      */
  1816. X+     if (!isatty(0))
  1817. X+         error("You must play from a terminal.");
  1818. X+ #endif
  1819. X+ 
  1820. X+     (void) fflush(stdout);
  1821. X+ 
  1822. X+     /* we ignore QUIT and INT at this point */
  1823. X+     if (link(HLOCK, LLOCK) == -1) {
  1824. X+         register int errnosv = errno;
  1825. X+ 
  1826. X+         perror(HLOCK);
  1827. X+         Printf("Cannot link %s to %s\n", LLOCK, HLOCK);
  1828. X+         switch(errnosv) {
  1829. X+         case ENOENT:
  1830. X+             Printf("Perhaps there is no (empty) file %s ?\n", HLOCK);
  1831. X+             break;
  1832. X+         case EACCES:
  1833. X+             Printf("It seems you don't have write permission here.\n");
  1834. X+             break;
  1835. X+         case EEXIST:
  1836. X+             Printf("(Try again or rm %s.)\n", LLOCK);
  1837. X+             break;
  1838. X+         default:
  1839. X+             Printf("I don't know what is wrong.");
  1840. X+         }
  1841. X+         getret();
  1842. X+         error("");
  1843. X+         /*NOTREACHED*/
  1844. X+     }
  1845. X+ 
  1846. X+     regularize(lock);
  1847. X+     glo(0);
  1848. X+     if(locknum > 25) locknum = 25;
  1849. X+ 
  1850. X+     do {
  1851. X+         if(locknum) lock[0] = 'a' + i++;
  1852. X+ 
  1853. X+         if((fd = open(lock, 0)) == -1) {
  1854. X+             if(errno == ENOENT) goto gotlock;    /* no such file */
  1855. X+             perror(lock);
  1856. X+             (void) delete(LLOCK);
  1857. X+             error("Cannot open %s", lock);
  1858. X+         }
  1859. X+ 
  1860. X+         if(veryold(fd))    /* if true, this closes fd and unlinks lock */
  1861. X+             goto gotlock;
  1862. X+         (void) close(fd);
  1863. X+     } while(i < locknum);
  1864. X+ 
  1865. X+     (void) delete(LLOCK);
  1866. X+     error(locknum ? "Too many hacks running now."
  1867. X+               : "There is a game in progress under your name.");
  1868. X+ gotlock:
  1869. X+     fd = creat(lock, FCMASK);
  1870. X+     if(delete(LLOCK) == -1)
  1871. X+         error("Cannot delete %s.", LLOCK);
  1872. X+     if(fd == -1) {
  1873. X+         error("cannot creat lock file.");
  1874. X+     } else {
  1875. X+         if(write(fd, (char *) &hackpid, sizeof(hackpid))
  1876. X+             != sizeof(hackpid)){
  1877. X+             error("cannot write lock");
  1878. X+         }
  1879. X+         if(close(fd) == -1) {
  1880. X+             error("cannot close lock");
  1881. X+         }
  1882. X+     }
  1883. X+ }    
  1884. X+ 
  1885. X+ void
  1886. X+ regularize(s)    /* normalize file name */
  1887. X+ register char *s;
  1888. X+ {
  1889. X+     register char *lp;
  1890. X+ 
  1891. X+     for (lp = s; *lp; lp++)
  1892. X+         if (!((*lp >= 'A' && *lp <= 'Z')
  1893. X+               || (*lp >= 'a' && *lp <= 'z')
  1894. X+               || (*lp >= '0' && *lp <= '9')
  1895. X+               || *lp == '$' || *lp == '_'
  1896. X+               || (lp > s && *lp == '-')))
  1897. X+             *lp = '_';
  1898. X+ }
  1899. X+ 
  1900. X+ int link(file, new)
  1901. X+ char *file, *new;
  1902. X+ {
  1903. X+     int status;
  1904. X+     struct FAB fab;
  1905. X+     struct NAM nam;
  1906. X+     unsigned short fid[3];
  1907. X+     char esa[NAM$C_MAXRSS];
  1908. X+ 
  1909. X+     fab = cc$rms_fab;
  1910. X+     fab.fab$l_fop = FAB$M_OFP;
  1911. X+     fab.fab$l_fna = file;
  1912. X+     fab.fab$b_fns = strlen(file);
  1913. X+     fab.fab$l_nam = &nam;
  1914. X+ 
  1915. X+     nam = cc$rms_nam;
  1916. X+     nam.nam$l_esa = esa;
  1917. X+     nam.nam$b_ess = NAM$C_MAXRSS;
  1918. X+ 
  1919. X+     if (!((status = SYS$PARSE(&fab)) & 1)
  1920. X+     || !((status = SYS$SEARCH(&fab)) & 1))
  1921. X+     {
  1922. X+     C$$TRANSLATE(status);
  1923. X+     return -1;
  1924. X+     }
  1925. X+ 
  1926. X+     fid[0] = nam.nam$w_fid[0];
  1927. X+     fid[1] = nam.nam$w_fid[1];
  1928. X+     fid[2] = nam.nam$w_fid[2];
  1929. X+ 
  1930. X+     fab.fab$l_fna = new;
  1931. X+     fab.fab$b_fns = strlen(new);
  1932. X+ 
  1933. X+     if (!((status = SYS$PARSE(&fab)) & 1))
  1934. X+     {
  1935. X+     C$$TRANSLATE(status);
  1936. X+     return -1;
  1937. X+     }
  1938. X+ 
  1939. X+     nam.nam$w_fid[0] = fid[0];
  1940. X+     nam.nam$w_fid[1] = fid[1];
  1941. X+     nam.nam$w_fid[2] = fid[2];
  1942. X+ 
  1943. X+     nam.nam$l_esa = nam.nam$l_name;
  1944. X+     nam.nam$b_esl = nam.nam$b_name + nam.nam$b_type + nam.nam$b_ver;
  1945. X+ 
  1946. X+     if (!((status = SYS$ENTER(&fab)) & 1))
  1947. X+     {
  1948. X+     C$$TRANSLATE(status);
  1949. X+     return -1;
  1950. X+     }
  1951. X+ 
  1952. X+     return 0;
  1953. X+ }
  1954. X+ 
  1955. X+ #undef unlink
  1956. X+ int unlink(file)
  1957. X+ char *file;
  1958. X+ {
  1959. X+     int status;
  1960. X+     struct FAB fab = cc$rms_fab;
  1961. X+     struct NAM nam = cc$rms_nam;
  1962. X+     char esa[NAM$C_MAXRSS];
  1963. X+ 
  1964. X+     fab.fab$l_fop = FAB$M_DLT;
  1965. X+     fab.fab$l_fna = file;
  1966. X+     fab.fab$b_fns = strlen(file);
  1967. X+     fab.fab$l_nam = &nam;
  1968. X+     nam.nam$l_esa = esa;
  1969. X+     nam.nam$b_ess = NAM$C_MAXRSS;
  1970. X+ 
  1971. X+     if (!((status = SYS$PARSE(&fab)) & 1)
  1972. X+     || !((status = SYS$REMOVE(&fab)) & 1))
  1973. X+     {
  1974. X+     C$$TRANSLATE(status);
  1975. X+     return -1;
  1976. X+     }
  1977. X+ 
  1978. X+     return 0;
  1979. X+ }
  1980. X+ 
  1981. X+ #undef creat
  1982. X+ int vms_creat(file, mode)
  1983. X+ char *file;
  1984. X+ unsigned int mode;
  1985. X+ {
  1986. X+     if (index(file, ';'))
  1987. X+     (void) delete(file);
  1988. X+     return creat(file, mode);
  1989. X+ }
  1990. X+ 
  1991. X+ #undef getuid
  1992. X+ int
  1993. X+ vms_getuid()
  1994. X+ {
  1995. X+     return (getgid() << 16) | getuid();
  1996. X+ }
  1997. X+ 
  1998. X+ #ifdef CHDIR
  1999. X+ unsigned int oprv[2];
  2000. X+ 
  2001. X+ void
  2002. X+ privoff()
  2003. X+ {
  2004. X+     unsigned int prv[2] = { -1, -1 }, code = JPI$_PROCPRIV;
  2005. X+ 
  2006. X+     (void) SYS$SETPRV(0, prv, 0, oprv);
  2007. X+     (void) LIB$GETJPI(&code, 0, 0, prv);
  2008. X+     (void) SYS$SETPRV(1, prv, 0, 0);
  2009. X+ }
  2010. X+ 
  2011. X+ void
  2012. X+ privon()
  2013. X+ {
  2014. X+     (void) SYS$SETPRV(1, oprv, 0, 0);
  2015. X+ }
  2016. X+ #endif
  2017. X+ 
  2018. X+ #ifdef SHELL
  2019. X+ unsigned int dosh_pid = 0;
  2020. X+ 
  2021. X+ int
  2022. X+ dosh()
  2023. X+ {
  2024. X+     int status;
  2025. X+ 
  2026. X+     settty((char *) NULL);    /* also calls end_screen() */
  2027. X+     (void) signal(SIGINT,SIG_IGN);
  2028. X+     (void) signal(SIGQUIT,SIG_IGN);
  2029. X+     if (!dosh_pid || !((status = LIB$ATTACH(&dosh_pid)) & 1))
  2030. X+     {
  2031. X+ #ifdef CHDIR
  2032. X+         (void) chdir(getenv("PATH"));
  2033. X+         privoff();
  2034. X+ #endif
  2035. X+         dosh_pid = 0;
  2036. X+         status = LIB$SPAWN(0, 0, 0, 0, 0, &dosh_pid);
  2037. X+ #ifdef CHDIR
  2038. X+         privon();
  2039. X+         chdirx((char *) 0, 0);
  2040. X+ #endif
  2041. X+     }
  2042. X+     gettty();
  2043. X+     setftty();
  2044. X+     (void) signal(SIGINT, (SIG_RET_TYPE) done1);
  2045. X+ #ifdef WIZARD
  2046. X+     if(wizard) (void) signal(SIGQUIT,SIG_DFL);
  2047. X+ #endif
  2048. X+     docrt();
  2049. X+     if (!(status & 1))
  2050. X+         pline("Spawn failed.  Try again.");
  2051. X+     return 0;
  2052. X+ }
  2053. X+ #endif
  2054. X
  2055. END_OF_FILE
  2056. if test 56752 -ne `wc -c <'patches04h'`; then
  2057.     echo shar: \"'patches04h'\" unpacked with wrong size!
  2058. fi
  2059. # end of 'patches04h'
  2060. fi
  2061. echo shar: End of archive 8 \(of 11\).
  2062. cp /dev/null ark8isdone
  2063. MISSING=""
  2064. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  2065.     if test ! -f ark${I}isdone ; then
  2066.     MISSING="${MISSING} ${I}"
  2067.     fi
  2068. done
  2069. if test "${MISSING}" = "" ; then
  2070.     echo You have unpacked all 11 archives.
  2071.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2072. else
  2073.     echo You still need to unpack the following archives:
  2074.     echo "        " ${MISSING}
  2075. fi
  2076. ##  End of shell archive.
  2077. exit 0
  2078.