home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sources / games / 200 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  58.4 KB

  1. Path: sparky!uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v14i069:  umoria4 - single player dungeon simulation (ver. 5.5), Part37/39
  5. Message-ID: <3433@master.CNA.TEK.COM>
  6. Date: 22 Aug 92 22:15:59 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 1771
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: grabiner@math.harvard.edu (David Grabiner)
  12. Posting-number: Volume 14, Issue 69
  13. Archive-name: umoria4/Part37
  14. Supersedes: umoria3: Volume 9, Issue 55-97; Volume 10, Issue 15-17
  15. Environment: Curses, Unix, Mac, MS-DOS, Atari-ST, Amiga, VMS
  16.  
  17.  
  18.  
  19. #! /bin/sh
  20. # This is a shell archive.  Remove anything before this line, then unpack
  21. # it by saving it into a file and typing "sh file".  To overwrite existing
  22. # files, type "sh file -c".  You can also feed this as standard input via
  23. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  24. # will see the following message at the end:
  25. #        "End of archive 37 (of 39)."
  26. # Contents:  amiga/makefile atari_st/Makefile
  27. #   atari_st/curscomp/cursinc.h atari_st/porting.txt doc/moria.6
  28. #   doc/moria.man misc/funckeys.c misc/haggle.sug source/rnd.c
  29. #   source/staffs.c source/variable.c util/map.c util/monster.cng
  30. #   util/weapons/mkallwpn.lst util/weapons/weapon.lst
  31. # Wrapped by billr@saab on Thu Aug 20 09:11:36 1992
  32. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  33. if test -f 'amiga/makefile' -a "${1}" != "-c" ; then 
  34.   echo shar: Will not clobber existing file \"'amiga/makefile'\"
  35. else
  36. echo shar: Extracting \"'amiga/makefile'\" \(3420 characters\)
  37. sed "s/^X//" >'amiga/makefile' <<'END_OF_FILE'
  38. X# This makefile is for Aztec C 5.0 for the Amiga.
  39. X# It will not work with either an earlier version of Aztec C or with Lattice.
  40. X
  41. X
  42. X# BINDIR is the directory where the moria binary while be put
  43. X# LIBDIR is where the other files (score, news, hours) will be put
  44. X# LIBDIR must be the same directory defined in config.h
  45. XBINDIR = moria:
  46. XLIBDIR = moria:
  47. X
  48. X# -bd = stack depth checking, -md = large data model, -so = optimized
  49. XCFLAGS = -so -md -mr -DAMIGA
  50. X# CFLAGS = -md -mr -DAMIGA
  51. X
  52. XCC = cc
  53. XSRCS = main.c misc1.c misc2.c misc3.c misc4.c store1.c files.c io.c \
  54. X    create.c desc.c generate.c sets.c dungeon.c creature.c death.c \
  55. X    eat.c help.c magic.c potions.c prayer.c save.c staffs.c wands.c \
  56. X    scrolls.c spells.c wizard.c store2.c signals.c moria1.c moria2.c \
  57. X    moria3.c moria4.c monsters.c treasure.c variable.c rnd.c recall.c \
  58. X    amiga.c player.c tables.c timer.c
  59. X
  60. XOBJS = main.o misc1.o misc2.o misc3.o misc4.o store1.o files.o io.o \
  61. X    create.o desc.o generate.o sets.o dungeon.o creature.o death.o \
  62. X    eat.o help.o magic.o potions.o prayer.o save.o staffs.o wands.o \
  63. X    scrolls.o spells.o wizard.o store2.o signals.o moria1.o moria2.o \
  64. X    moria3.o moria4.o monsters.o treasure.o variable.o rnd.o recall.o \
  65. X    amiga.o player.o tables.o timer.o
  66. X
  67. XLIBFILES = hours news origcmds.hlp owizcmds.hlp roglcmds.hlp rwizcmds.hlp \
  68. X    scores version.hlp welcome.hlp
  69. X
  70. Xmoria : $(OBJS)
  71. X    ln +q +ss -o moria $(OBJS) $(DETACH) -lcurses32 -lml -lcl
  72. X
  73. X# you must define BINDIR and LIBDIR before installing
  74. X# assumes that BINDIR and LIBDIR exist
  75. Xinstall:
  76. X    copy moria $(BINDIR)
  77. X    copy files/* $(LIBDIR)
  78. X
  79. Xclean:
  80. X    delete *.o
  81. X    delete moria
  82. X
  83. Xcreate.o: constant.h types.h externs.h config.h
  84. Xcreature.o: constant.h types.h externs.h config.h
  85. Xdeath.o: constant.h types.h externs.h config.h
  86. Xdesc.o: constant.h types.h externs.h config.h
  87. Xdungeon.o: constant.h types.h externs.h config.h
  88. Xeat.o: constant.h types.h externs.h config.h
  89. Xfiles.o: constant.h types.h externs.h config.h
  90. Xgenerate.o: constant.h types.h externs.h config.h
  91. Xhelp.o: constant.h types.h externs.h config.h
  92. Xio.o: constant.h types.h externs.h config.h
  93. Xmagic.o: constant.h types.h externs.h config.h
  94. Xmain.o: constant.h types.h externs.h config.h
  95. Xmisc1.o: constant.h types.h externs.h config.h
  96. Xmisc2.o: constant.h types.h externs.h config.h
  97. Xmisc3.o: constant.h types.h externs.h config.h
  98. Xmisc4.o: constant.h types.h externs.h config.h
  99. Xmonsters.o: constant.h types.h config.h
  100. Xmoria1.o: constant.h types.h externs.h config.h
  101. Xmoria2.o: constant.h types.h externs.h config.h
  102. Xmoria3.o: constant.h types.h externs.h config.h
  103. Xmoria4.o: constant.h types.h externs.h config.h
  104. Xplayer.o: constant.h types.h config.h
  105. Xpotions.o: constant.h types.h externs.h config.h
  106. Xprayer.o: constant.h types.h externs.h config.h
  107. Xrecall.o: constant.h config.h types.h externs.h
  108. Xrnd.o: constant.h types.h
  109. Xsave.o: constant.h types.h externs.h config.h
  110. Xscrolls.o: constant.h types.h externs.h config.h
  111. Xsets.o: constant.h config.h
  112. Xsignals.o: constant.h types.h externs.h config.h
  113. Xspells.o: constant.h types.h externs.h config.h
  114. Xstaffs.o: constant.h types.h externs.h config.h
  115. Xstore1.o: constant.h types.h externs.h config.h
  116. Xstore2.o: constant.h types.h externs.h config.h
  117. Xtables.o: constant.h types.h config.h
  118. Xtreasure.o: constant.h types.h config.h
  119. Xunix.o: constant.h config.h types.h externs.h
  120. Xvariable.o: constant.h types.h config.h
  121. Xwands.o: constant.h types.h externs.h config.h
  122. Xwizard.o: constant.h types.h externs.h config.h
  123. END_OF_FILE
  124. if test 3420 -ne `wc -c <'amiga/makefile'`; then
  125.     echo shar: \"'amiga/makefile'\" unpacked with wrong size!
  126. fi
  127. # end of 'amiga/makefile'
  128. fi
  129. if test -f 'atari_st/Makefile' -a "${1}" != "-c" ; then 
  130.   echo shar: Will not clobber existing file \"'atari_st/Makefile'\"
  131. else
  132. echo shar: Extracting \"'atari_st/Makefile'\" \(3841 characters\)
  133. sed "s/^X//" >'atari_st/Makefile' <<'END_OF_FILE'
  134. X# The MWC Makefile.
  135. X
  136. X# BINDIR is the directory where the moria binary will be put
  137. X# LIBDIR is where the other files (scoreboard, news, hours) will be put
  138. X# LIBDIR must be the same directory defined in config.h
  139. X# this was clipped from the link command: -lcurses -ltermcap
  140. XBINDIR = /usr/public/
  141. XLIBDIR = /usr/public/moriadir/
  142. X
  143. XCFLAGS = -A -V -VCSD
  144. XCC = cc
  145. X
  146. XSRCS = main.c misc1.c misc2.c misc3.c misc4.c store1.c files.c io.c \
  147. X    create.c desc.c generate.c sets.c dungeon.c creature.c death.c \
  148. X    eat.c help.c magic.c potions.c prayer.c save.c staffs.c wands.c \
  149. X    scrolls.c spells.c wizard.c store2.c signals.c moria1.c moria2.c \
  150. X    moria3.c moria4.c monsters.c treasure.c variable.c rnd.c recall.c \
  151. X    atarist.c player.c tables.c
  152. X
  153. XOBJS = main.o misc1.o misc2.o misc3.o misc4.o store1.o files.o io.o \
  154. X    create.o desc.o generate.o sets.o dungeon.o creature.o death.o \
  155. X    eat.o help.o magic.o potions.o prayer.o save.o staffs.o wands.o \
  156. X    scrolls.o spells.o wizard.o store2.o signals.o moria1.o moria2.o \
  157. X    moria3.o moria4.o monsters.o treasure.o variable.o rnd.o recall.o \
  158. X    atarist.o curses.o player.o tables.o
  159. X
  160. XLIBFILES = moria_hours moria_help moria_orig_help moria_wiz_help \
  161. X    moria_orig_wiz_help moria_man
  162. X
  163. Xmoria : $(OBJS)
  164. X    $(CC) -o moria $(CFLAGS) $(OBJS)
  165. X
  166. Xlibfiles: $(LIBFILES)
  167. X    chmod 444 $(LIBFILES)
  168. X    cp $(LIBFILES) $(LIBDIR)
  169. X
  170. X$(BINDIR):
  171. X    mkdir $(BINDIR)
  172. X    chmod 755 $(BINDIR)
  173. X
  174. X$(LIBDIR):
  175. X    mkdir $(LIBDIR)
  176. X    chmod 711 $(LIBDIR)
  177. X
  178. X$(LIBDIR)/moria_hours: moria_hours
  179. X    chmod 644 moria_hours
  180. X    cp moria_hours $(LIBDIR)
  181. X
  182. Xlintout : $(SRCS)
  183. X    lint $(SRCS) -lcurses -ltermcap > lintout
  184. X
  185. Xlintout2 : $(SRCS)
  186. X    lint -bach $(SRCS) -lcurses -ltermcap > lintout
  187. X
  188. XTAGS : $(SRCS)
  189. X    ctags -x $(SRCS) > TAGS
  190. X
  191. X# you must define BINDIR and LIBDIR before installing
  192. Xinstall:
  193. X    cp moria $(BINDIR)
  194. X    cp Moria_hours $(LIBDIR)
  195. X    cp Moria_news $(LIBDIR)
  196. X    cp Highscores $(LIBDIR)
  197. X    chmod 4511 $(BINDIR)/moria
  198. X    chmod 644 $(LIBDIR)/Highscores
  199. X    chmod 444 $(LIBDIR)/Moria_news
  200. X    chmod 444 $(LIBDIR)/Moria_hours
  201. X    chmod 555 $(LIBDIR)
  202. X
  203. Xclean:
  204. X    rm -r *.o
  205. X    rm -i moria
  206. X
  207. Xcreate.o: constant.h types.h externs.h config.h
  208. Xcreature.o: constant.h types.h externs.h config.h
  209. Xdeath.o: constant.h types.h externs.h config.h
  210. Xdesc.o: constant.h types.h externs.h config.h
  211. Xdungeon.o: constant.h types.h externs.h config.h
  212. Xeat.o: constant.h types.h externs.h config.h
  213. Xfiles.o: constant.h types.h externs.h config.h
  214. Xgenerate.o: constant.h types.h externs.h config.h
  215. Xhelp.o: constant.h types.h externs.h config.h
  216. Xio.o: constant.h types.h externs.h config.h
  217. Xmagic.o: constant.h types.h externs.h config.h
  218. Xmain.o: constant.h types.h externs.h config.h
  219. Xmisc1.o: constant.h types.h externs.h config.h
  220. Xmisc2.o: constant.h types.h externs.h config.h
  221. Xmisc3.o: constant.h types.h externs.h config.h
  222. Xmisc4.o: constant.h types.h externs.h config.h
  223. Xmonsters.o: constant.h types.h config.h
  224. Xmoria1.o: constant.h types.h externs.h config.h
  225. Xmoria2.o: constant.h types.h externs.h config.h
  226. Xmoria3.o: constant.h types.h externs.h config.h
  227. Xmoria4.o: constant.h types.h externs.h config.h
  228. Xplayer.o: constant.h types.h config.h
  229. Xpotions.o: constant.h types.h externs.h config.h
  230. Xprayer.o: constant.h types.h externs.h config.h
  231. Xrecall.o: constant.h config.h types.h externs.h
  232. Xrnd.o: constant.h types.h
  233. Xsave.o: constant.h types.h externs.h config.h
  234. Xscrolls.o: constant.h types.h externs.h config.h
  235. Xsets.o: constant.h config.h
  236. Xsignals.o: constant.h types.h externs.h config.h
  237. Xspells.o: constant.h types.h externs.h config.h
  238. Xstaffs.o: constant.h types.h externs.h config.h
  239. Xstore1.o: constant.h types.h externs.h config.h
  240. Xstore2.o: constant.h types.h externs.h config.h
  241. Xtables.o: constant.h types.h config.h
  242. Xtreasure.o: constant.h types.h config.h
  243. Xatarist.o: constant.h config.h types.h externs.h
  244. Xvariable.o: constant.h types.h config.h
  245. Xwands.o: constant.h types.h externs.h config.h
  246. Xwizard.o: constant.h types.h externs.h config.h
  247. END_OF_FILE
  248. if test 3841 -ne `wc -c <'atari_st/Makefile'`; then
  249.     echo shar: \"'atari_st/Makefile'\" unpacked with wrong size!
  250. fi
  251. # end of 'atari_st/Makefile'
  252. fi
  253. if test -f 'atari_st/curscomp/cursinc.h' -a "${1}" != "-c" ; then 
  254.   echo shar: Will not clobber existing file \"'atari_st/curscomp/cursinc.h'\"
  255. else
  256. echo shar: Extracting \"'atari_st/curscomp/cursinc.h'\" \(4206 characters\)
  257. sed "s/^X//" >'atari_st/curscomp/cursinc.h' <<'END_OF_FILE'
  258. X/****************************************************************************/
  259. X/*                                                                          */
  260. X/*   CURSINC.H                    include file for the CURSES module itself */
  261. X/*                                                                          */
  262. X/****************************************************************************/
  263. X/*                                                                          */
  264. X/* This source and resulting object may be modified, used or distributed by */
  265. X/* anyone who so desires under the following conditions :                   */
  266. X/*                                                                          */
  267. X/*  1) This notice and the copyright notice shall not be removed or         */
  268. X/*     changed.                                                             */
  269. X/*  2) No credit shall be taken for this source and resulting objects       */
  270. X/*  3) This source or resulting objects is not to be traded, sold or        */
  271. X/*     used for personal gain or profit.                                    */
  272. X/*  4) Inclusion of this source or resulting objects in commercially        */
  273. X/*     available packages is forbidden without written consent of the       */
  274. X/*     author of this source.                                               */
  275. X/*                                                                          */
  276. X/****************************************************************************/
  277. X
  278. X/* Original author :  
  279. X    Rene van't Veen
  280. X    Debussystraat 27
  281. X    1817 GL Alkmaar
  282. X    The Netherlands
  283. X
  284. X   Extensive modifications for speed and clarity by :
  285. X    Hildo Biersma
  286. X    Tollensstraat 138
  287. X    2513 GE Den Haag
  288. X    Holland
  289. X
  290. X   The original copyright notices still apply - refer to CURSES.C */
  291. X
  292. Xtypedef unsigned char bool;
  293. Xtypedef short         int16;
  294. Xtypedef long          int32;
  295. X
  296. X#define OK          1
  297. X#define ERR         0
  298. X#define TRUE        1
  299. X#define FALSE       0
  300. X#define _SUBWIN     01
  301. X#define _ENDLINE    02
  302. X#define _FULLWIN    04
  303. X#define _SCROLLWIN  010
  304. X#define _STANDOUT   0200
  305. X#define WINDOW      struct _win_st
  306. X
  307. X#define TOUCHED     0x0200
  308. X#define STANDOUT    0x0100
  309. X
  310. X#define mvwaddch(w,y,x,c)   { wmove(w,y,x); waddch(w,c); }
  311. X#define mvwaddstr(w,y,x,s)  { wmove(w,y,x); waddstr(w,s); }
  312. X#define clearok(w,f)        { w->_clear = (w->_flags & _FULLWIN) \
  313. X                              ? f : w->_clear; }
  314. X#define getyx(w,y,x)        { y = w->_cury; x = w->_curx; }
  315. X
  316. Xstruct _win_st 
  317. X{
  318. X  int16 _cury, _curx;
  319. X  int16 _maxy, _maxx;
  320. X  int16 _begy, _begx;
  321. X  int16 _flags;
  322. X  bool  _clear;
  323. X  bool  _leave;
  324. X  bool  _scroll;
  325. X  int16 **_y;
  326. X  int16 *_firstch;
  327. X  int16 *_lastch;
  328. X  int16 *_yend;
  329. X};
  330. X
  331. X/* prototypes of functions in curses.c */
  332. XWINDOW *initscr ( void );
  333. Xvoid endwin ( void );
  334. XWINDOW *newwin ( int l , int c , int by , int bx );
  335. Xvoid delwin ( WINDOW *w );
  336. Xint mvwin ( WINDOW *w , int y , int x );
  337. Xvoid touchwin ( WINDOW *w );
  338. XWINDOW *subwin ( WINDOW *w , int l , int c , int by , int bx );
  339. Xvoid leaveok ( WINDOW *w , bool f );
  340. Xvoid scrollok ( WINDOW *w , bool f );
  341. Xvoid nl ( void );
  342. Xvoid nonl ( void );
  343. Xvoid longname ( char *termbuf , char *name );
  344. Xint  curaddch( char c );
  345. Xint  waddch ( WINDOW *w , char c );
  346. Xint  waddstr ( WINDOW *w , char *s );
  347. Xvoid box ( WINDOW *w , char v , char h );
  348. Xvoid wclear ( WINDOW *w );
  349. Xvoid wclrtobot ( WINDOW *w );
  350. Xvoid wclrtoeol ( WINDOW *w );
  351. Xint  wdelch ( WINDOW *w );
  352. Xint  wdeleteln ( WINDOW *w );
  353. Xvoid werase ( WINDOW *w );
  354. Xint  winsch ( WINDOW *w , char c );
  355. Xvoid winsertln ( WINDOW *w );
  356. Xint  wmove ( WINDOW *w , int y , int x );
  357. Xvoid overlay ( WINDOW *v , WINDOW *w );
  358. Xvoid overwrite ( WINDOW *v , WINDOW *w );
  359. Xvoid wstandout ( WINDOW *w );
  360. Xvoid wstandend ( WINDOW *w );
  361. Xvoid raw ( void );
  362. Xvoid noraw ( void );
  363. Xvoid crmode ( void );
  364. Xvoid nocrmode ( void );
  365. Xvoid echo ( void );
  366. Xvoid noecho ( void );
  367. Xlong wgetch ( WINDOW *w );
  368. Xint  wgetstr ( WINDOW *w , char *s );
  369. Xvoid cur_refresh( void );
  370. Xvoid wrefresh ( WINDOW *w );
  371. Xvoid mvcur ( int ly , int lx , int ny , int nx );
  372. Xvoid _movcur ( int16 y , int16 x );
  373. Xint  scroll ( WINDOW *w );
  374. X/* end of prototypes for curses.c */
  375. X
  376. X/****************END OF SOURCE CURSINC.H************************************/
  377. END_OF_FILE
  378. if test 4206 -ne `wc -c <'atari_st/curscomp/cursinc.h'`; then
  379.     echo shar: \"'atari_st/curscomp/cursinc.h'\" unpacked with wrong size!
  380. fi
  381. # end of 'atari_st/curscomp/cursinc.h'
  382. fi
  383. if test -f 'atari_st/porting.txt' -a "${1}" != "-c" ; then 
  384.   echo shar: Will not clobber existing file \"'atari_st/porting.txt'\"
  385. else
  386. echo shar: Extracting \"'atari_st/porting.txt'\" \(3050 characters\)
  387. sed "s/^X//" >'atari_st/porting.txt' <<'END_OF_FILE'
  388. X
  389. XItems marked '*' should no longer be necessary.
  390. XItems marked '?' should be unnecessary, but probably aren't.  I don't
  391. X  understand why they were necessary in the first place.  - Jim Wilson
  392. X
  393. X---------------
  394. X
  395. XPorting the new version of Moria to the Atari ST with TC - by Hildo Biersma
  396. X
  397. XI : Preliminary work
  398. X1) Get the new archive through FTP
  399. X2) Split in files to get it on 720K disks
  400. X3) Reassembly, uncompress, untar
  401. X4) Make a copy of the sources to the MORIATRY folder
  402. X
  403. XII : Starting to do the port
  404. X*1) Build a project file from the file MAKEFILE.TC => MORIA.PRJ
  405. X2) Build a TC configuration file with standard macro GEMDOS,
  406. X    standard options -P -G, linker stack size 16K => TC_MORIA.CFG
  407. X3) Filter all files through UNIX-to-DOS, or load/save from Tempus
  408. X?4) In order to make use of compiler warning level 2, build a list of
  409. X    proper ANSI-C prototypes in EXTERNS.H => EXTERNS.H
  410. X5) Edit CONFIG.H to define ATARIST_TC
  411. X*6) Change fseed in DEATH.C to fseek (typing error)
  412. X?7) Edit all files that use static functions to add proper ANSI-C prototypes
  413. X    (the semi-prototypes at #if defined(LINT_ARGS) are a good template for
  414. X    doing this). This is needed in the following files :
  415. X    CREATE.C, CREATURE.C, DEATH.C, DESC.C, DUNGEON.C,
  416. X    GENERATE.C, MAIN.C, MISC1.C, MISC2.C, MORIA1.C, MORIA2.C,
  417. X    RECALL.C, SAVE.C, SPELLS.C, STORE1.C and STORE2.C
  418. X*8) Edit files to add #include <stdlib.h> to make sure functions
  419. X    like abs() are prototyped. This is needed for :
  420. X    CREATURE.C, DEATH.C, DESC.C, DUNGEON.C, FILES.C, IO.C,
  421. X    MORIA1.C, MORIA2.C, STORE2.C, WIZARD.C and ATARIST.TC
  422. X   This can of course best be done with an #ifdef ATARIST_TC
  423. X*9) GENERATE.C needs an #include <string.h> to prototype memset()
  424. X*10) IO.C gives two compile-time errors; this is because mwaddstr and
  425. X      mwaddch are macro's that don't properly return values. The checks
  426. X      that are done, if (mwaddstr(..) == ERR) and if (mwaddch(..) == ERR)
  427. X      are not needed, as both functions never return an error on the ST 
  428. X      anyway. So you can do an #ifdef ATARIST_TC and use just the function 
  429. X      call; the if, error message and exit stuff can all be removed.
  430. X*12) IO.C needs to have <ext.h> included to define sleep()
  431. X*13) In CONFIG.H, the "#define index strchr" is not done for the Atari ST;
  432. X      it should be, so add "|| ATARIST_TC" to the #ifdef just above.
  433. X*14) In SAVE.C, there is a #ifdef MSDOS before the definition of t_ptr
  434. X      in lines 127-128. This should of course be :
  435. X      #if defined(MSDOS) || defined(ATARI_ST)
  436. X    Same thing in line 681. Also, around line 722, where savefile ownership
  437. X      is checked, there is an ATARIST_MWC which should be an ATARI_ST, as
  438. X      chmod is a dummy function on both the ATARI TC and ATARI MWC versions.
  439. X    Finally, time.h must be included to prototype time().
  440. X?15) Add a #define ATARIST_MWC in SIGNALS.C to avoid using signals in
  441. X      the same way as the MWC version.
  442. X15) Now do a make to compile and link Moria. You now have a working copy of
  443. X      Moria. Finishing and polishing make take a while longer. 
  444. END_OF_FILE
  445. if test 3050 -ne `wc -c <'atari_st/porting.txt'`; then
  446.     echo shar: \"'atari_st/porting.txt'\" unpacked with wrong size!
  447. fi
  448. # end of 'atari_st/porting.txt'
  449. fi
  450. if test -f 'doc/moria.6' -a "${1}" != "-c" ; then 
  451.   echo shar: Will not clobber existing file \"'doc/moria.6'\"
  452. else
  453. echo shar: Extracting \"'doc/moria.6'\" \(3509 characters\)
  454. sed "s/^X//" >'doc/moria.6' <<'END_OF_FILE'
  455. X.TH MORIA 6 "" "Local"
  456. X\" By default, this man page assumes moria was compiled with the original
  457. X\" command set.  If you are using the rogue like command set, then delete
  458. X\" the first three characters on the following line.
  459. X\" .ds O ROGUE_LIKE
  460. X.if '\*(Bd'' .ds Bd moria
  461. X.SH NAME
  462. Xmoria \- a dungeon game
  463. X.SH SYNOPSIS
  464. X.B \*(Bd
  465. X[
  466. X.B \-o
  467. X] [
  468. X.B \-r
  469. X] [
  470. X.B \-s
  471. X] [
  472. X.B \-S
  473. X] [
  474. X.B \-n
  475. X] [
  476. X.B \-w
  477. X] [ savefile ]
  478. X.SH DESCRIPTION
  479. X.I Moria\^
  480. Xplays a dungeon game with you.
  481. XIt lets you generate a character,
  482. Xlets you buy equipment,
  483. Xand lets you wander in a fathomless dungeon
  484. Xwhile finding treasure and being attacked by monsters
  485. Xand fellow adventurers.
  486. XTyping
  487. X.B ?
  488. Xgives you a list of commands.
  489. X.PP
  490. XThe ultimate object of
  491. X.I moria
  492. Xis to kill the Balrog,
  493. Xwhich dwells on the 50th level of the
  494. Xdungeon, 2,500 feet underground.
  495. XMost players never even reach the Balrog,
  496. Xand those that do seldom live to tell about it.
  497. X.PP
  498. XFor a more complete description of the game,
  499. Xread the document
  500. X.I The Dungeons of Moria.
  501. X.PP
  502. XBy default,
  503. X.I moria
  504. Xwill save and restore games from a file
  505. Xcalled moria.save in your home directory.  If the environment
  506. Xvariable MORIA_SAV is defined, then
  507. X.I moria
  508. Xwill use that
  509. Xfile name instead of the default.  If MORIA_SAV is not a complete
  510. Xpath name, then the savefile will be created or restored from the
  511. Xcurrent directory.  You can also explicitly specify a savefile
  512. Xon the command line.
  513. X.PP
  514. XIf you use the \fB\-n\fP option,
  515. X.I moria
  516. Xwill create a new game,
  517. Xignoring any savefile which may already exist.
  518. XThis works best when a savefile name is specified on the
  519. Xcommand line, as this will prevent
  520. X.I moria
  521. Xfrom trying to overwrite the default savefile
  522. X(if it exists) when you try to save your game.
  523. X.PP
  524. XYou move in various directions
  525. X.ie '\*O'ROGUE_LIKE' the same way you do in \fIrogue\fP(6).
  526. X.el by pressing the numeric keypad keys, VMS-style.
  527. XIf you specify
  528. X.if '\*O'ROGUE_LIKE' \fB\-o\fP, you move by pressing the numeric keypad
  529. X.ie '\*O'ROGUE_LIKE' keys, VMS-style.
  530. X.el \fB\-r\fP, you move the same way you do in \fIrogue\fP(6).
  531. XYou can also specify
  532. X.ie '\*O'ROGUE_LIKE' \fB\-r\fP to force the \fIrogue\fP(6) like command set.
  533. X.el \fB\-o\fP to force the VMS-style command set.
  534. XThese options will override defaults stored in the savefile.  If these
  535. Xoptions are given multiple times, only the last one will take effect.
  536. X.PP
  537. XIf you specify
  538. X.BR \-s ,
  539. X.I moria
  540. Xprints all of the scores in the score file and exits.
  541. XOn a multiuser system, if you specify
  542. X.BR \-S ,
  543. X.I moria
  544. Xprints prints only those scores belonging to you and then exits.
  545. X.PP
  546. XIf you specify \fB\-w\fP,
  547. X.I moria
  548. Xwill start up in wizard mode.
  549. XYou can resurrect a dead character by using this option when starting
  550. Xthe game.  Resurrected characters are teleported to the town level
  551. Xand given zero hitpoints.
  552. XWizard mode is intended for debugging the game, and for experimenting
  553. Xwith new features.  Any other use is considered cheating.
  554. XGames played with wizard mode are not scored.
  555. X.SH AUTHORS
  556. XThe original version of Moria was written in VMS/Pascal by Robert
  557. XAlan Koeneke, Jimmey Wayne Todd,
  558. XGary McAdoo, and others at the University of Oklahoma.
  559. XThis version was written by Jim Wilson at the University of California,
  560. XBerkeley, and released with minor revisions by David Grabiner at Harvard
  561. XUniversity.
  562. X.SH BUGS
  563. X.PP
  564. XA suspended game that gets a hangup signal will die without creating a
  565. Xsave file.
  566. X
  567. XRerolling with a % at the class prompt not implemented.
  568. X
  569. XFor a more comprehensive list, see the ERRORS file in the source
  570. Xdistribution.
  571. END_OF_FILE
  572. if test 3509 -ne `wc -c <'doc/moria.6'`; then
  573.     echo shar: \"'doc/moria.6'\" unpacked with wrong size!
  574. fi
  575. # end of 'doc/moria.6'
  576. fi
  577. if test -f 'doc/moria.man' -a "${1}" != "-c" ; then 
  578.   echo shar: Will not clobber existing file \"'doc/moria.man'\"
  579. else
  580. echo shar: Extracting \"'doc/moria.man'\" \(3544 characters\)
  581. sed "s/^X//" >'doc/moria.man' <<'END_OF_FILE'
  582. X
  583. X
  584. X
  585. XMORIA(6)                 GAMES AND DEMOS                 MORIA(6)
  586. X
  587. X
  588. X
  589. XNAME
  590. X     moria - a dungeon game
  591. X
  592. XSYNOPSIS
  593. X     moria [ -o ] [ -r ] [ -s ] [ -S ] [ -n ] [ -w ] [ savefile ]
  594. X
  595. XDESCRIPTION
  596. X     Moria plays a dungeon game with you.  It lets you generate a
  597. X     character,  lets you buy equipment, and lets you wander in a
  598. X     fathomless dungeon while finding treasure and being attacked
  599. X     by  monsters  and  fellow adventurers.  Typing ? gives you a
  600. X     list of commands.
  601. X
  602. X     The ultimate object of moria is to kill  the  Balrog,  which
  603. X     dwells  on  the 50th level of the dungeon, 2,500 feet under-
  604. X     ground.  Most players never even reach the Balrog, and those
  605. X     that do seldom live to tell about it.
  606. X
  607. X     For a more complete description of the game, read the  docu-
  608. X     ment The Dungeons of Moria.
  609. X
  610. X     By default, moria will save and restore games  from  a  file
  611. X     called  moria.save  in your home directory.  If the environ-
  612. X     ment variable MORIA_SAV is defined, then moria will use that
  613. X     file  name  instead  of  the default.  If MORIA_SAV is not a
  614. X     complete path name, then the savefile  will  be  created  or
  615. X     restored  from  the  current directory.  You can also expli-
  616. X     citly specify a savefile on the command line.
  617. X
  618. X     If you use the -n option, moria  will  create  a  new  game,
  619. X     ignoring  any  savefile which may already exist.  This works
  620. X     best when a savefile name is specified on the command  line,
  621. X     as  this  will  prevent  moria  from trying to overwrite the
  622. X     default savefile (if it exists) when you try  to  save  your
  623. X     game.
  624. X
  625. X     You move in  various  directions  by  pressing  the  numeric
  626. X     keypad  keys,  VMS-style.   If  you specify -r, you move the
  627. X     same way you do in rogue(6).  You can  also  specify  -o  to
  628. X     force  the  VMS-style command set.  These options will over-
  629. X     ride defaults stored in the savefile.  If these options  are
  630. X     given multiple times, only the last one will take effect.
  631. X
  632. X     If you specify -s, moria prints all of  the  scores  in  the
  633. X     score file and exits.  On a multiuser system, if you specify
  634. X     -S, moria prints prints only those scores belonging  to  you
  635. X     and then exits.
  636. X
  637. X     If you specify -w, moria will start up in wizard mode.   You
  638. X     can  resurrect  a  dead  character by using this option when
  639. X     starting the game.  Resurrected characters are teleported to
  640. X     the  town  level  and  given zero hitpoints.  Wizard mode is
  641. X
  642. X
  643. X
  644. XLocal                     Last change:                          1
  645. X
  646. X
  647. X
  648. X
  649. X
  650. X
  651. XMORIA(6)                 GAMES AND DEMOS                 MORIA(6)
  652. X
  653. X
  654. X
  655. X     intended for debugging the game, and for experimenting  with
  656. X     new  features.  Any other use is considered cheating.  Games
  657. X     played with wizard mode are not scored.
  658. X
  659. XAUTHORS
  660. X     The original version of Moria was written in  VMS/Pascal  by
  661. X     Robert  Alan  Koeneke,  Jimmey  Wayne Todd, Gary McAdoo, and
  662. X     others at the University  of  Oklahoma.   This  version  was
  663. X     written  by  Jim  Wilson  at  the  University of California,
  664. X     Berkeley, and released with minor revisions  by  David  Gra-
  665. X     biner at Harvard University.
  666. X
  667. XBUGS
  668. X     A suspended game that gets a hangup signal will die  without
  669. X     creating a save file.
  670. X
  671. X     Rerolling with a % at the class prompt not implemented.
  672. X
  673. X     For a more comprehensive list, see the ERRORS  file  in  the
  674. X     source distribution.
  675. X
  676. X
  677. X
  678. X
  679. X
  680. X
  681. X
  682. X
  683. X
  684. X
  685. X
  686. X
  687. X
  688. X
  689. X
  690. X
  691. X
  692. X
  693. X
  694. X
  695. X
  696. X
  697. X
  698. X
  699. X
  700. X
  701. X
  702. X
  703. X
  704. X
  705. X
  706. X
  707. X
  708. X
  709. X
  710. XLocal                     Last change:                          2
  711. X
  712. X
  713. X
  714. END_OF_FILE
  715. if test 3544 -ne `wc -c <'doc/moria.man'`; then
  716.     echo shar: \"'doc/moria.man'\" unpacked with wrong size!
  717. fi
  718. # end of 'doc/moria.man'
  719. fi
  720. if test -f 'misc/funckeys.c' -a "${1}" != "-c" ; then 
  721.   echo shar: Will not clobber existing file \"'misc/funckeys.c'\"
  722. else
  723. echo shar: Extracting \"'misc/funckeys.c'\" \(3169 characters\)
  724. sed "s/^X//" >'misc/funckeys.c' <<'END_OF_FILE'
  725. X/* call e_inkey() in dungeon.c instead of inkey() */
  726. X
  727. Xint keypadon;
  728. X
  729. X/* e_inkey
  730. X * This inkey processes function keys also (using map_keypad)
  731. X */
  732. X
  733. X/* Gets single character from keyboard and returns a character.  If the key
  734. X * pressed is a function key, it processes the key without waiting on the
  735. X * escape.  At this time it processes function keys by using map_keypad and
  736. X * needs funckeys.h.  If you don't want ANY escape processing, use inkey().
  737. X * If you are using this function, Escape will need to be pressed twice to get
  738. X * an escape.
  739. X */
  740. X
  741. Xe_inkey(ch)
  742. X     char *ch;
  743. X{
  744. X
  745. X  put_qio();            /* Dump IO buffer         */
  746. X  if (!keypadon) {
  747. X    *ch = getch();
  748. X    return;
  749. X  }
  750. X  if ((*ch = getch()) != ESC)
  751. X    return;
  752. X  /* we now have an escape, if a [ does not follow it, send back a null */
  753. X  if ((*ch = getch()) != FCHAR ) {
  754. X    if (*ch == ESC)
  755. X      return;
  756. X    *ch = INPUT_ERROR;
  757. X    return;
  758. X  }
  759. X  map_keypad(ch);
  760. X}
  761. X
  762. X/* map_keypad is sun specific still.  It should not be hard to change it for
  763. X * any keypad.  It needs funckeys.h to work and is only called from e_inkey().
  764. X * This seems to be too slow, and we are getting some processing errors that
  765. X * look like short teleportation.
  766. X */
  767. X
  768. Xmap_keypad(ch)
  769. X
  770. X     char *ch;
  771. X{
  772. X  int             c;
  773. X  int             key, rawkey, n;
  774. X  char            side;
  775. X
  776. X
  777. X
  778. X#if SUN
  779. X
  780. X  switch (c = getch()) {
  781. X  case 'A':
  782. X    side = 'r';
  783. X    key = 8;
  784. X    break;
  785. X
  786. X  case 'B':
  787. X    side = 'r';
  788. X    key = 14;
  789. X    break;
  790. X
  791. X  case 'C':
  792. X    side = 'r';
  793. X    key = 12;
  794. X    break;
  795. X
  796. X  case 'D':
  797. X    side = 'r';
  798. X    key = 10;
  799. X    break;
  800. X
  801. X  default:
  802. X    rawkey = c - '0';
  803. X
  804. X    for (n = 0; c = getch(), n < 3; n++) {
  805. X      if (c == 'z')
  806. X    break;
  807. X      else if (c < '0' || c > '9') {
  808. X    *ch = INPUT_ERROR;
  809. X    return;
  810. X      } else
  811. X    rawkey = rawkey * 10 + c - '0';
  812. X
  813. X    }
  814. X    if (c != 'z') {
  815. X      *ch = INPUT_ERROR;
  816. X      return;
  817. X    } else if (rawkey >= 208 && rawkey <= 222) {
  818. X      side = 'r';
  819. X      key = rawkey - 207;
  820. X
  821. X    } else if (rawkey >= 192 && rawkey <= 201) {
  822. X      side = 'l';
  823. X      key = rawkey - 191;
  824. X    } else if (rawkey >= 224 && rawkey <= 232) {
  825. X      side = 'f';
  826. X      key = rawkey - 223;
  827. X    } else {
  828. X      *ch = INPUT_ERROR;
  829. X      return;
  830. X    }
  831. X    break;
  832. X  }
  833. X  if (side == 'r')
  834. X    *ch = rkeys[key];
  835. X  else if (side == 'l')
  836. X    *ch = lkeys[key];
  837. X  else if (side == 'f')
  838. X    *ch = fkeys[key];
  839. X  else
  840. X    *ch = INPUT_ERROR;
  841. X#endif
  842. X}
  843. X
  844. X/* Prompts (optional) and returns False if ESC is the input character.  escp
  845. X * is a boolean option that allows you to decide if you want function key
  846. X * processing or not.
  847. X *
  848. X * If the prompt is NULL or empty, nothing is printed and nothing is erase.
  849. X */
  850. Xget_com(prompt, command, escp)
  851. X     char *prompt;
  852. X     char *command;
  853. X     int escp;
  854. X{
  855. X  int             com_val;
  856. X  int             res;
  857. X  int             do_erase;
  858. X
  859. X  if ((prompt != NULL) && (strlen(prompt) > 0)) {
  860. X    oprint(prompt);
  861. X    do_erase = TRUE;
  862. X  } else
  863. X    do_erase = FALSE;
  864. X
  865. X  if (escp)
  866. X    inkey(command);
  867. X  else
  868. X    e_inkey(command);
  869. X  com_val = *command;
  870. X  switch (com_val) {
  871. X  case ESC:
  872. X    res = FALSE;
  873. X    break;
  874. X  default:
  875. X    res = TRUE;
  876. X    break;
  877. X  }
  878. X  if (do_erase == TRUE)
  879. X    erase_line(msg_line, msg_line);
  880. X  return (res);
  881. X}
  882. END_OF_FILE
  883. if test 3169 -ne `wc -c <'misc/funckeys.c'`; then
  884.     echo shar: \"'misc/funckeys.c'\" unpacked with wrong size!
  885. fi
  886. # end of 'misc/funckeys.c'
  887. fi
  888. if test -f 'misc/haggle.sug' -a "${1}" != "-c" ; then 
  889.   echo shar: Will not clobber existing file \"'misc/haggle.sug'\"
  890. else
  891. echo shar: Extracting \"'misc/haggle.sug'\" \(3206 characters\)
  892. sed "s/^X//" >'misc/haggle.sug' <<'END_OF_FILE'
  893. XFrom ghudson@cie.uoregon.edu Tue Mar  6 17:09:23 1990
  894. XReceived: from oregon.uoregon.edu by ernie.Berkeley.EDU (5.61/1.36)
  895. X    id AA19401; Tue, 6 Mar 90 17:09:11 -0800
  896. XReceived: from cie.uoregon.edu by oregon.uoregon.edu; Tue, 6 Mar 90 17:07 PST
  897. XReceived: by cie.uoregon.edu (MC 2.0/SMI-4.0.1.2(JQJ)) id AA09277; Tue, 6 Mar
  898. X 90 17:07:48 PST
  899. XDate: Tue, 6 Mar 90 17:07:48 PST
  900. XFrom: ghudson@cie.uoregon.edu
  901. XSubject: Re: Haggling
  902. XTo: wilson@ernie.Berkeley.EDU
  903. XMessage-Id: <9003070107.AA09277@cie.uoregon.edu>
  904. XX-Envelope-To: wilson@ernie.Berkeley.EDU
  905. XStatus: RO
  906. X
  907. X> Drat.  This will ahve to be fixed somehow, maybe by setting a bit in each
  908. X> individual object when bought/sold, so that it can only contribute to the
  909. X> good/bad bargain counts once.
  910. X     Reasonable.  Shouldn't take too much coding.
  911. X     Since this is getting so complex, you might try to put in some clue as
  912. Xto how good of a bargainer you are, e.g. when you start bargaining, you have
  913. Xa small (10%-20%) chance of getting a message like:
  914. XThe merchant looks at you distatesfully
  915. XThe merchant eyes you with a hint of respect
  916. X     Something like that.
  917. X     Now, on to our (3*bad + 20) formula:
  918. X     Simplified, this could be algorythm'd like so:
  919. Xptr = 20;
  920. Xcase <bad bargain> pointer += 3;
  921. Xcase <good bargain> pointer -= 1;
  922. Xif (ptr == 0) <don't bargain>
  923. X     Okay, that was of course a mishhash of something slightly resembling
  924. XC code, but you get the idea.  But I don't like how if you missed the final
  925. Xoffer by one gold piece, your pointer goes up by three, even if the item
  926. Xwas worth some 900 to start with.  I'd think it'd be better if that was
  927. Xmore like:
  928. Xcase <bad bargain> pointer += (price paid - low price) / low price * 10
  929. X     So you lose one point for each 10% over the final value that you paid.
  930. X     This isn't particularly accurate, unfortunately, but that might be
  931. Xremedied by a (float) ptr.
  932. X     (I just realized that "ptr" is a pretty dumb name for what should be
  933. Xcalled "counter" or something.  Sorry...)
  934. X
  935. X     Back to our spoiler solution, do note that one could still buy a bunch
  936. Xof junk and still up (down, via my algorythm) your counter, even though you
  937. Xdidn't need the item.  I really don't have a solution, other than expanding
  938. Xthe code so that each price range (increments of about a hundred, so the
  939. Xfirst few would be 10-100, 11-200, 201-300 and the last few would be 801-900
  940. Xand 901-1000 or 901-999, however you work it) gets a separate counter.  Natur-
  941. Xally, this would have to be accompanied by a decrease of the original counter
  942. Xvalue to 10 or 5 or so (or a different value for each range, since players
  943. Xwill buy a lot more items in the 10-100 range).
  944. X
  945. X> Thanks for the warning.
  946. X     Just came to my mind.  It isn't quite so bad, since items under 10 gp
  947. Xfinal price don't count, so one couldn't up your counter by buying flasks of
  948. Xoil or something.
  949. X
  950. XGreg Hudson
  951. Xghudson@cie.uoregon.edu
  952. X"Though the Earth, and all inferior Creatures be common to all Men, yet every
  953. XMan has a Property in his own Person.  This no Body has any Right to but
  954. Xhimself." -- John Locke, _Two Treatises of Government_, 2nd Treatise
  955. XI am blatantly close-minded and refuse to admit it.
  956. XThere are missionaries aplenty, but few enlightened.  Believe me.
  957. X
  958. END_OF_FILE
  959. if test 3206 -ne `wc -c <'misc/haggle.sug'`; then
  960.     echo shar: \"'misc/haggle.sug'\" unpacked with wrong size!
  961. fi
  962. # end of 'misc/haggle.sug'
  963. fi
  964. if test -f 'source/rnd.c' -a "${1}" != "-c" ; then 
  965.   echo shar: Will not clobber existing file \"'source/rnd.c'\"
  966. else
  967. echo shar: Extracting \"'source/rnd.c'\" \(3146 characters\)
  968. sed "s/^X//" >'source/rnd.c' <<'END_OF_FILE'
  969. X/* source/rnd.c: random number generator
  970. X
  971. X   Copyright (c) 1989-92 James E. Wilson
  972. X
  973. X   This software may be copied and distributed for educational, research, and
  974. X   not for profit purposes provided that this copyright and statement are
  975. X   included in all such copies. */
  976. X
  977. X#include "config.h"
  978. X#include "constant.h"
  979. X#include "types.h"
  980. X
  981. X/* Define this to compile as a standalone test */
  982. X/* #define TEST_RNG */
  983. X
  984. X/* This alg uses a prime modulus multiplicative congruential generator
  985. X   (PMMLCG), also known as a Lehmer Grammer, which satisfies the following
  986. X   properties
  987. X
  988. X   (i)     modulus: m - a large prime integer
  989. X   (ii)     multiplier: a - an integer in the range 2, 3, ..., m - 1
  990. X   (iii) z[n+1] = f(z[n]), for n = 1, 2, ...
  991. X   (iv)     f(z) = az mod m
  992. X   (v)     u[n] = z[n] / m, for n = 1, 2, ...
  993. X
  994. X   The sequence of z's must be initialized by choosing an initial seed
  995. X   z[1] from the range 1, 2, ..., m - 1.  The sequence of z's is a pseudo-
  996. X   random sequence drawn without replacement from the set 1, 2, ..., m - 1.
  997. X   The u's form a psuedo-random sequence of real numbers between (but not
  998. X   including) 0 and 1.
  999. X
  1000. X   Schrage's method is used to compute the sequence of z's.
  1001. X   Let m = aq + r, where q = m div a, and r = m mod a.
  1002. X   Then f(z) = az mod m = az - m * (az div m) =
  1003. X         = gamma(z) + m * delta(z)
  1004. X   Where gamma(z) = a(z mod q) - r(z div q)
  1005. X   and     delta(z) = (z div q) - (az div m)
  1006. X
  1007. X   If r < q, then for all z in 1, 2, ..., m - 1:
  1008. X   (1) delta(z) is either 0 or 1
  1009. X   (2) both a(z mod q) and r(z div q) are in 0, 1, ..., m - 1
  1010. X   (3) absolute value of gamma(z) <= m - 1
  1011. X   (4) delta(z) = 1 iff gamma(z) < 0
  1012. X
  1013. X   Hence each value of z can be computed exactly without overflow as long
  1014. X   as m can be represented as an integer.
  1015. X */
  1016. X
  1017. X/* a good random number generator, correct on any machine with 32 bit
  1018. X   integers, this algorithm is from:
  1019. X
  1020. XStephen K. Park and Keith W. Miller, "Random Number Generators:
  1021. X    Good ones are hard to find", Communications of the ACM, October 1988,
  1022. X    vol 31, number 10, pp. 1192-1201.
  1023. X
  1024. X   If this algorithm is implemented correctly, then if z[1] = 1, then
  1025. X   z[10001] will equal 1043618065
  1026. X
  1027. X   Has a full period of 2^31 - 1.
  1028. X   Returns integers in the range 1 to 2^31-1.
  1029. X */
  1030. X
  1031. X#define RNG_M 2147483647L  /* m = 2^31 - 1 */
  1032. X#define RNG_A 16807L
  1033. X#define RNG_Q 127773L       /* m div a */
  1034. X#define RNG_R 2836L       /* m mod a */
  1035. X
  1036. X/* 32 bit seed */
  1037. Xstatic int32u rnd_seed;
  1038. X
  1039. Xint32u get_rnd_seed ()
  1040. X{
  1041. X  return rnd_seed;
  1042. X}
  1043. X
  1044. Xvoid set_rnd_seed (seedval)
  1045. Xint32u seedval;
  1046. X{
  1047. X  /* set seed to value between 1 and m-1 */
  1048. X
  1049. X  rnd_seed = (seedval % (RNG_M - 1)) + 1;
  1050. X}
  1051. X
  1052. X/* returns a pseudo-random number from set 1, 2, ..., RNG_M - 1 */
  1053. Xint32 rnd ()
  1054. X{
  1055. X  register long low, high, test;
  1056. X
  1057. X  high = rnd_seed / RNG_Q;
  1058. X  low = rnd_seed % RNG_Q;
  1059. X  test = RNG_A * low - RNG_R * high;
  1060. X  if (test > 0)
  1061. X    rnd_seed = test;
  1062. X  else
  1063. X    rnd_seed = test + RNG_M;
  1064. X  return rnd_seed;
  1065. X}
  1066. X
  1067. X#ifdef TEST_RNG
  1068. X
  1069. Xmain ()
  1070. X{
  1071. X  long i, random;
  1072. X
  1073. X  set_rnd_seed (0L);
  1074. X
  1075. X  for (i = 1; i < 10000; i++)
  1076. X    (void) rnd ();
  1077. X
  1078. X  random = rnd ();
  1079. X  printf ("z[10001] = %ld, should be 1043618065\n", random);
  1080. X  if (random == 1043618065L)
  1081. X    printf ("success!!!\n");
  1082. X}
  1083. X
  1084. X#endif
  1085. END_OF_FILE
  1086. if test 3146 -ne `wc -c <'source/rnd.c'`; then
  1087.     echo shar: \"'source/rnd.c'\" unpacked with wrong size!
  1088. fi
  1089. # end of 'source/rnd.c'
  1090. fi
  1091. if test -f 'source/staffs.c' -a "${1}" != "-c" ; then 
  1092.   echo shar: Will not clobber existing file \"'source/staffs.c'\"
  1093. else
  1094. echo shar: Extracting \"'source/staffs.c'\" \(3989 characters\)
  1095. sed "s/^X//" >'source/staffs.c' <<'END_OF_FILE'
  1096. X/* source/staffs.c: staff code
  1097. X
  1098. X   Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke
  1099. X
  1100. X   This software may be copied and distributed for educational, research, and
  1101. X   not for profit purposes provided that this copyright and statement are
  1102. X   included in all such copies. */
  1103. X
  1104. X#include "config.h"
  1105. X#include "constant.h"
  1106. X#include "types.h"
  1107. X#include "externs.h"
  1108. X
  1109. X#ifdef USG
  1110. X#include <string.h>
  1111. X#else
  1112. X#include <strings.h>
  1113. X#endif
  1114. X
  1115. X
  1116. X/* Use a staff.                    -RAK-    */
  1117. Xvoid use()
  1118. X{
  1119. X  int32u i;
  1120. X  int j, k, item_val, chance, y, x;
  1121. X  register int ident;
  1122. X  register struct misc *m_ptr;
  1123. X  register inven_type *i_ptr;
  1124. X
  1125. X  free_turn_flag = TRUE;
  1126. X  if (inven_ctr == 0)
  1127. X    msg_print("But you are not carrying anything.");
  1128. X  else if (!find_range(TV_STAFF, TV_NEVER, &j, &k))
  1129. X    msg_print("You are not carrying any staffs.");
  1130. X  else if (get_item(&item_val, "Use which staff?", j, k, CNIL, CNIL))
  1131. X    {
  1132. X      i_ptr = &inventory[item_val];
  1133. X      free_turn_flag = FALSE;
  1134. X      m_ptr = &py.misc;
  1135. X      chance = m_ptr->save + stat_adj(A_INT) - (int)i_ptr->level - 5
  1136. X    + (class_level_adj[m_ptr->pclass][CLA_DEVICE] * m_ptr->lev / 3);
  1137. X      if (py.flags.confused > 0)
  1138. X    chance = chance / 2;
  1139. X      if ((chance < USE_DEVICE) && (randint(USE_DEVICE - chance + 1) == 1))
  1140. X    chance = USE_DEVICE; /* Give everyone a slight chance */
  1141. X      if (chance <= 0)    chance = 1;
  1142. X      if (randint(chance) < USE_DEVICE)
  1143. X    msg_print("You failed to use the staff properly.");
  1144. X      else if (i_ptr->p1 > 0)
  1145. X    {
  1146. X      i = i_ptr->flags;
  1147. X      ident = FALSE;
  1148. X      (i_ptr->p1)--;
  1149. X      while (i != 0)
  1150. X        {
  1151. X          j = bit_pos(&i) + 1;
  1152. X          /* Staffs.                */
  1153. X          switch(j)
  1154. X        {
  1155. X        case 1:
  1156. X          ident = light_area(char_row, char_col);
  1157. X          break;
  1158. X        case 2:
  1159. X          ident = detect_sdoor();
  1160. X          break;
  1161. X        case 3:
  1162. X          ident = detect_trap();
  1163. X          break;
  1164. X        case 4:
  1165. X          ident = detect_treasure();
  1166. X          break;
  1167. X        case 5:
  1168. X          ident = detect_object();
  1169. X          break;
  1170. X        case 6:
  1171. X          teleport(100);
  1172. X          ident = TRUE;
  1173. X          break;
  1174. X        case 7:
  1175. X          ident = TRUE;
  1176. X          earthquake();
  1177. X          break;
  1178. X        case 8:
  1179. X          ident = FALSE;
  1180. X          for (k = 0; k < randint(4); k++)
  1181. X            {
  1182. X              y = char_row;
  1183. X              x = char_col;
  1184. X              ident |= summon_monster(&y, &x, FALSE);
  1185. X            }
  1186. X          break;
  1187. X        case 10:
  1188. X          ident = TRUE;
  1189. X          destroy_area(char_row, char_col);
  1190. X          break;
  1191. X        case 11:
  1192. X          ident = TRUE;
  1193. X          starlite(char_row, char_col);
  1194. X          break;
  1195. X        case 12:
  1196. X          ident = speed_monsters(1);
  1197. X          break;
  1198. X        case 13:
  1199. X          ident = speed_monsters(-1);
  1200. X          break;
  1201. X        case 14:
  1202. X          ident = sleep_monsters2();
  1203. X          break;
  1204. X        case 15:
  1205. X          ident = hp_player(randint(8));
  1206. X          break;
  1207. X        case 16:
  1208. X          ident = detect_invisible();
  1209. X          break;
  1210. X        case 17:
  1211. X          if (py.flags.fast == 0)
  1212. X            ident = TRUE;
  1213. X          py.flags.fast += randint(30) + 15;
  1214. X          break;
  1215. X        case 18:
  1216. X          if (py.flags.slow == 0)
  1217. X            ident = TRUE;
  1218. X          py.flags.slow += randint(30) + 15;
  1219. X          break;
  1220. X        case 19:
  1221. X          ident = mass_poly();
  1222. X          break;
  1223. X        case 20:
  1224. X          if (remove_curse())
  1225. X            {
  1226. X              if (py.flags.blind < 1)
  1227. X            msg_print("The staff glows blue for a moment..");
  1228. X              ident = TRUE;
  1229. X            }
  1230. X          break;
  1231. X        case 21:
  1232. X          ident = detect_evil();
  1233. X          break;
  1234. X        case 22:
  1235. X          if ((cure_blindness()) || (cure_poison()) ||
  1236. X              (cure_confusion()))
  1237. X            ident = TRUE;
  1238. X          break;
  1239. X        case 23:
  1240. X          ident = dispel_creature(CD_EVIL, 60);
  1241. X          break;
  1242. X        case 25:
  1243. X          ident = unlight_area(char_row, char_col);
  1244. X          break;
  1245. X        case 32:
  1246. X          /* store bought flag */
  1247. X          break;
  1248. X        default:
  1249. X          msg_print("Internal error in staffs()");
  1250. X          break;
  1251. X        }
  1252. X          /* End of staff actions.        */
  1253. X        }
  1254. X      if (ident)
  1255. X        {
  1256. X          if (!known1_p(i_ptr))
  1257. X        {
  1258. X          m_ptr = &py.misc;
  1259. X          /* round half-way case up */
  1260. X          m_ptr->exp += (i_ptr->level + (m_ptr->lev >> 1)) /
  1261. X            m_ptr->lev;
  1262. X          prt_experience();
  1263. X
  1264. X          identify(&item_val);
  1265. X          i_ptr = &inventory[item_val];
  1266. X        }
  1267. X        }
  1268. X      else if (!known1_p(i_ptr))
  1269. X        sample (i_ptr);
  1270. X      desc_charges(item_val);
  1271. X    }
  1272. X      else
  1273. X    {
  1274. X      msg_print("The staff has no charges left.");
  1275. X      if (!known2_p(i_ptr))
  1276. X        add_inscribe(i_ptr, ID_EMPTY);
  1277. X    }
  1278. X    }
  1279. X}
  1280. END_OF_FILE
  1281. if test 3989 -ne `wc -c <'source/staffs.c'`; then
  1282.     echo shar: \"'source/staffs.c'\" unpacked with wrong size!
  1283. fi
  1284. # end of 'source/staffs.c'
  1285. fi
  1286. if test -f 'source/variable.c' -a "${1}" != "-c" ; then 
  1287.   echo shar: Will not clobber existing file \"'source/variable.c'\"
  1288. else
  1289. echo shar: Extracting \"'source/variable.c'\" \(3525 characters\)
  1290. sed "s/^X//" >'source/variable.c' <<'END_OF_FILE'
  1291. X/* source/variable.c: Global variables */
  1292. X
  1293. Xchar *copyright[5] = {
  1294. X"Copyright (c) 1989-92 James E. Wilson, Robert A. Keoneke",
  1295. X"",
  1296. X"This software may be copied and distributed for educational, research, and",
  1297. X"not for profit purposes provided that this copyright and statement are",
  1298. X"included in all such copies."};
  1299. X
  1300. X#include <stdio.h>
  1301. X
  1302. X#include "config.h"
  1303. X#include "constant.h"
  1304. X#include "types.h"
  1305. X
  1306. X/* Save the store's last increment value.  */
  1307. Xint16 last_store_inc;
  1308. X
  1309. X/* a horrible hack: needed because compact_monster() can be called from
  1310. X   creatures() via summon_monster() and place_monster() */
  1311. Xint hack_monptr = -1;
  1312. X
  1313. Xint weapon_heavy = FALSE;
  1314. Xint pack_heavy = FALSE;
  1315. Xvtype died_from;
  1316. Xint32 birth_date;
  1317. X
  1318. Xvtype savefile;            /* The savefile to use. */
  1319. X
  1320. Xint16 total_winner = FALSE;
  1321. Xint32 max_score = 0;
  1322. Xint character_generated = 0;    /* don't save score until char gen finished */
  1323. Xint character_saved = 0;    /* prevents save on kill after save_char() */
  1324. XFILE *highscore_fp;        /* File pointer to high score file */
  1325. Xint32u randes_seed;        /* for restarting randes_state */
  1326. Xint32u town_seed;        /* for restarting town_seed */
  1327. Xint16 cur_height,cur_width;    /* Cur dungeon size    */
  1328. Xint16 dun_level = 0;        /* Cur dungeon level   */
  1329. Xint16 missile_ctr = 0;        /* Counter for missiles */
  1330. Xint msg_flag;            /* Set with first msg  */
  1331. Xvtype old_msg[MAX_SAVE_MSG];    /* Last message          */
  1332. Xint16 last_msg = 0;        /* Where last is held */
  1333. Xint death = FALSE;        /* True if died          */
  1334. Xint find_flag;            /* Used in MORIA for .(dir) */
  1335. Xint free_turn_flag;        /* Used in MORIA, do not move creatures  */
  1336. Xint command_count;        /* Gives repetition of commands. -CJS- */
  1337. Xint default_dir = FALSE;    /* Use last direction for repeated command */
  1338. Xint32 turn = -1;        /* Cur turn of game    */
  1339. Xint wizard = FALSE;        /* Wizard flag          */
  1340. Xint to_be_wizard = FALSE;    /* used during startup, when -w option used */
  1341. Xint16 panic_save = FALSE;    /* this is true if playing from a panic save */
  1342. Xint16 noscore = FALSE;        /* Don't log the game. -CJS- */
  1343. X
  1344. Xint rogue_like_commands;    /* set in config.h/main.c */
  1345. X
  1346. X/* options set via the '=' command */
  1347. Xint find_cut = TRUE;
  1348. Xint find_examine = TRUE;
  1349. Xint find_bound = FALSE;
  1350. Xint find_prself = FALSE;
  1351. Xint prompt_carry_flag = FALSE;
  1352. Xint show_weight_flag = FALSE;
  1353. Xint highlight_seams = FALSE;
  1354. Xint find_ignore_doors = FALSE;
  1355. Xint sound_beep_flag = TRUE;
  1356. Xint display_counts = TRUE;
  1357. X
  1358. Xchar doing_inven = FALSE;    /* Track inventory commands. -CJS- */
  1359. Xint screen_change = FALSE;    /* Track screen updates for inven_commands. */
  1360. Xchar last_command = ' ';      /* Memory of previous command. */
  1361. X
  1362. X/* these used to be in dungeon.c */
  1363. Xint new_level_flag;        /* Next level when true     */
  1364. Xint teleport_flag;        /* Handle teleport traps  */
  1365. Xint player_light;        /* Player carrying light */
  1366. Xint eof_flag = FALSE;        /* Used to signal EOF/HANGUP condition */
  1367. Xint light_flag = FALSE;        /* Track if temporary light about player.  */
  1368. X
  1369. Xint wait_for_more = FALSE;    /* used when ^C hit during -more- prompt */
  1370. Xint closing_flag = FALSE;    /* Used for closing   */
  1371. X
  1372. X/*  Following are calculated from max dungeon sizes        */
  1373. Xint16 max_panel_rows,max_panel_cols;
  1374. Xint panel_row,panel_col;
  1375. Xint panel_row_min,panel_row_max;
  1376. Xint panel_col_min,panel_col_max;
  1377. Xint panel_col_prt,panel_row_prt;
  1378. X
  1379. X#ifdef MAC
  1380. Xcave_type (*cave)[MAX_WIDTH];
  1381. X#else
  1382. Xcave_type cave[MAX_HEIGHT][MAX_WIDTH];
  1383. X#endif
  1384. X
  1385. X#ifdef MAC
  1386. Xrecall_type *c_recall;
  1387. X#else
  1388. Xrecall_type c_recall[MAX_CREATURES];    /* Monster memories */
  1389. X#endif
  1390. X
  1391. X/* See atarist/st-stuff.c */
  1392. X#if defined(atarist) && defined(__GNUC__)
  1393. Xchar extended_file_name[80];
  1394. X#endif
  1395. END_OF_FILE
  1396. if test 3525 -ne `wc -c <'source/variable.c'`; then
  1397.     echo shar: \"'source/variable.c'\" unpacked with wrong size!
  1398. fi
  1399. # end of 'source/variable.c'
  1400. fi
  1401. if test -f 'util/map.c' -a "${1}" != "-c" ; then 
  1402.   echo shar: Will not clobber existing file \"'util/map.c'\"
  1403. else
  1404. echo shar: Extracting \"'util/map.c'\" \(3021 characters\)
  1405. sed "s/^X//" >'util/map.c' <<'END_OF_FILE'
  1406. X/* this used to be in files.c, this is not a working program */
  1407. X
  1408. X/* Output dungeon section sizes                    */
  1409. X#define OUTPAGE_HEIGHT 44     /* 44 lines of dungeon per section       */
  1410. X#define OUTPAGE_WIDTH  99     /* 100 columns of dungeon per section    */
  1411. X
  1412. X/* deleted in favor of improved Map and Where commands */
  1413. X/* Prints dungeon map to external file            -RAK-     */
  1414. Xprint_map()
  1415. X{
  1416. X  register int i, j, m, n;
  1417. X  register k, l;
  1418. X  register i7, i8;
  1419. X  char dun_line[MAX_WIDTH+1];
  1420. X  char *dun_ptr;
  1421. X  static vtype filename1 = "MORIAMAP.DAT";
  1422. X  vtype filename2;
  1423. X  char tmp_str[80];
  1424. X  FILE *file1;
  1425. X  static int page_width = OUTPAGE_WIDTH;
  1426. X  static int page_height = OUTPAGE_HEIGHT;
  1427. X
  1428. X  /* this allows us to strcat each character in the inner loop,
  1429. X     instead of using the expensive sprintf */
  1430. X  (void) sprintf (tmp_str, "File name [%s]: ", filename1);
  1431. X  prt(tmp_str, 0, 0);
  1432. X  if (get_string(filename2, 0, strlen(tmp_str), 64))
  1433. X    {
  1434. X      if (strlen(filename2) > 0)
  1435. X    (void) strcpy(filename1, filename2);
  1436. X      if ((file1 = fopen(filename1, "w")) == NULL)
  1437. X    {
  1438. X      (void) sprintf(dun_line, "Cannot open file %s", filename1);
  1439. X      prt(dun_line, 0, 0);
  1440. X      return;
  1441. X    }
  1442. X      (void) sprintf(tmp_str, "section width (default = %d char):",
  1443. X             page_width);
  1444. X      prt(tmp_str, 0, 0);
  1445. X      (void) get_string(tmp_str, 0, strlen(tmp_str), 10);
  1446. X      page_width = atoi(tmp_str);
  1447. X      if (page_width < 10)
  1448. X    page_width = 10;
  1449. X
  1450. X      (void) sprintf(tmp_str, "section height (default = %d lines):",
  1451. X             page_height);
  1452. X      prt(tmp_str, 0, 0);
  1453. X      (void) get_string(tmp_str, 0, strlen(tmp_str), 10);
  1454. X      page_height = atoi(tmp_str);
  1455. X      if (page_height < 10)
  1456. X    page_height = 10;
  1457. X
  1458. X      prt("Writing Moria Dungeon Map...", 0, 0);
  1459. X      put_qio();
  1460. X
  1461. X      i = 0;
  1462. X      i7 = 0;
  1463. X      do
  1464. X    {
  1465. X      j = 0;
  1466. X      k = i + page_height - 1;
  1467. X      if (k >= cur_height)
  1468. X        k = cur_height - 1;
  1469. X      i7++;
  1470. X      i8 = 0;
  1471. X      do
  1472. X        {
  1473. X          l = j + page_width - 1;
  1474. X          if (l >= cur_width)
  1475. X        l = cur_width - 1;
  1476. X          i8++;
  1477. X          (void) fprintf(file1, "%c\n", CTRL('L'));
  1478. X          (void) fprintf(file1, "Section[%d,%d];     ", i7, i8);
  1479. X          (void) fprintf(file1, "Depth : %d (feet)\n\n   ",
  1480. X                 (dun_level * 50));
  1481. X          for (m = j; m <= l; m++)
  1482. X        {
  1483. X          n = (m / 100);
  1484. X          (void) fprintf(file1, "%d", n);
  1485. X        }
  1486. X          (void) fputs("\n   ", file1);
  1487. X          for (m = j; m <= l; m++)
  1488. X        {
  1489. X          n = (m / 10) - (m / 100) * 10;
  1490. X          (void) fprintf(file1, "%d", n);
  1491. X        }
  1492. X          (void) fputs("\n   ", file1);
  1493. X          for (m = j; m <= l; m++)
  1494. X        {
  1495. X          n = m - (m / 10) * 10;
  1496. X          (void) fprintf(file1, "%d", n);
  1497. X        }
  1498. X          (void) fprintf(file1, "\n");
  1499. X          for (m = i; m <= k; m++)
  1500. X        {
  1501. X          (void) sprintf(dun_line, "%2d ", m);
  1502. X          dun_ptr = &dun_line[3];
  1503. X          for (n = j; n <= l; n++)
  1504. X            *dun_ptr++ = loc_symbol(m, n);
  1505. X          *dun_ptr++ = '\n';
  1506. X          *dun_ptr++ = '\0';
  1507. X          (void) fputs(dun_line, file1);
  1508. X        }
  1509. X          j += page_width;
  1510. X        }
  1511. X      while (j < cur_width);
  1512. X      i += page_height;
  1513. X    }
  1514. X      while (i < cur_height);
  1515. X      (void) fclose(file1);
  1516. X      prt("Completed.", 0, 0);
  1517. X    }
  1518. X}
  1519. END_OF_FILE
  1520. if test 3021 -ne `wc -c <'util/map.c'`; then
  1521.     echo shar: \"'util/map.c'\" unpacked with wrong size!
  1522. fi
  1523. # end of 'util/map.c'
  1524. fi
  1525. if test -f 'util/monster.cng' -a "${1}" != "-c" ; then 
  1526.   echo shar: Will not clobber existing file \"'util/monster.cng'\"
  1527. else
  1528. echo shar: Extracting \"'util/monster.cng'\" \(3702 characters\)
  1529. sed "s/^X//" >'util/monster.cng' <<'END_OF_FILE'
  1530. XFrom djgrabin@phoenix.Princeton.EDU Mon Nov 27 12:37:32 1989
  1531. XReceived: from Princeton.EDU by ernie.Berkeley.EDU (5.61/1.36)
  1532. X    id AA09548; Mon, 27 Nov 89 12:35:31 -0800
  1533. XReceived: from phoenix.Princeton.EDU by Princeton.EDU (5.58+++/2.25/mailrelay)
  1534. X    id AA03654; Mon, 27 Nov 89 14:42:43 EST
  1535. XReceived: by phoenix.Princeton.EDU (5.61/1.95)
  1536. X    id AA27562; Mon, 27 Nov 89 14:38:54 -0500
  1537. XDate: Mon, 27 Nov 89 14:38:54 -0500
  1538. XFrom: djgrabin@phoenix.Princeton.EDU (David Joseph Grabiner)
  1539. XMessage-Id: <8911271938.AA27562@phoenix.Princeton.EDU>
  1540. XTo: wilson@ernie.Berkeley.EDU
  1541. XSubject: Corrections to the monster dictionary
  1542. XStatus: RO
  1543. X
  1544. X
  1545. XI have now made the changes I mentioned to you before, plus a few more
  1546. Xwhich I discovered in the process.  My current monster dictionary has
  1547. X161 monsters changed from the original 4.87 copy.  I can send you a copy
  1548. Xof either my dictionary or the diffs if you want them.  However, since
  1549. Xyour dictionary is in a different form, and I have a different definition
  1550. Xof "monster," I would suggest that, if you do use my files, you use them
  1551. Xonly for reference.
  1552. X
  1553. XAnyway, here is my current list of changes.
  1554. X
  1555. X!is a definite bug;
  1556. X*has been changed.
  1557. X
  1558. XOK, even though they seem wrong:
  1559. XSinging, happy drunk moving 20+40+75 random
  1560. XAncient red dragon having maximum treasure.
  1561. XGreen ooze not moving.  This is obviously intentional.
  1562. X
  1563. XRandom movement:
  1564. XSome ants are 20%, others aren't.
  1565. XHuge brown bat 75%, four others are 20%.
  1566. X*!Giant fire and giant lightning bat should both be 20% or both be 40%.
  1567. X Long-eared, red, lightning changed to 40, huge brown left alone.
  1568. X*!Giant black centipede should not be 75%, should be 20%.
  1569. X*Fire elemental is 40%, fire spirit and earth spirit not random.
  1570. X All of these made 20.
  1571. X*Moaning spirit is 20%, banshee is 20% and 40%.
  1572. X Moaning spirit made 20+40.
  1573. X*Clear and bloodshot icky-things should be 40%.
  1574. X*Killer beetles vary; should they all be 20%?
  1575. XShould squint-eyed rogue be 20% random?
  1576. X*!Giant black scorpion should be 20%.
  1577. X*!Giant brown tick should be 20%.
  1578. X
  1579. XDoors:
  1580. X*Fire spirit cannot open doors, fire elemental can and shouldn't.
  1581. X*Should golems be able to open doors?
  1582. X*!Oozes shouldn't open doors.
  1583. X*!Spirit troll should open doors.
  1584. X
  1585. XPicking up objects:
  1586. X*!Earth spirit should pick up objects, water elemental shouldn't.
  1587. X*!Warrior shouldn't unless all people do.
  1588. X
  1589. XTreasure:
  1590. X*!Scruffy-looking hobbit should carry gold as well as objects.
  1591. XWhy don't quasits carry gold?
  1592. X*!Mature green dragon should be 60+90+2d2, not 60+90+1d2.
  1593. X*!Orc warrior and ogre mage should be 90, like other o's.
  1594. X*Seedy-looking human 1d2 but nasty little gnome only 90, should be 1d2?
  1595. X*!Berzerker should be 1d2, not 60; ninja should be 1d2, not 60+90.
  1596. X*Black knight should be 1d2; sorceror increased to 60+90+1d2, to be
  1597. X consistent with liches.
  1598. X*Should ordinary troll be 60+90, like other trolls?
  1599. X
  1600. XSpell frequency:
  1601. X*!Ancient white is the weakest ancient dragon, should be 9 like ancient green.
  1602. X*!Moaning spirit should be 15, like other ghosts.
  1603. X*!Orc shaman is 5, ogre mage is 6 and should be 5 or less.
  1604. X*Should necromancer be 3 rather than 2, since sorceror is 3?
  1605. X
  1606. X*!Silver jelly and rot jelly shouldn't be harmed by cold.
  1607. X
  1608. XWhy are nagas harmed by poison?
  1609. X
  1610. XAcid:
  1611. X*Should flesh golem really be harmed by acid?
  1612. X*Should green jelly, green worm mass really be harmed by acid?
  1613. X
  1614. XBlue light:
  1615. X*Why are flesh golem, giant clear ant, black ooze harmed by light?
  1616. X*!Rot jelly should be harmed by blue light.
  1617. X*!Cloud giant should not be.
  1618. XShould giant purple worm be harmed, like other worms?
  1619. X*Should all undead, or all intelligent undead, be harmed?
  1620. X (Changed to harm L,W,V,G, and spirit troll, not M,s,z.)
  1621. X
  1622. X*Should it be possible to charm/sleep quasits?
  1623. X
  1624. X*!White dragon bat should not be seen by infravision.
  1625. X
  1626. END_OF_FILE
  1627. if test 3702 -ne `wc -c <'util/monster.cng'`; then
  1628.     echo shar: \"'util/monster.cng'\" unpacked with wrong size!
  1629. fi
  1630. # end of 'util/monster.cng'
  1631. fi
  1632. if test -f 'util/weapons/mkallwpn.lst' -a "${1}" != "-c" ; then 
  1633.   echo shar: Will not clobber existing file \"'util/weapons/mkallwpn.lst'\"
  1634. else
  1635. echo shar: Extracting \"'util/weapons/mkallwpn.lst'\" \(1408 characters\)
  1636. sed "s/^X//" >'util/weapons/mkallwpn.lst' <<'END_OF_FILE'
  1637. XAwl-Pike                      |
  1638. XBacksword                     |
  1639. XBall and Chain                |
  1640. XBastard Sword                 |
  1641. XBattle Axe (Balestarius)      |
  1642. XBattle Axe (European)         |
  1643. XBeaked Axe                    |
  1644. XBroad Axe                     |
  1645. XBroadsword                    |
  1646. XCat-O-Nine Tails              |
  1647. XCutlass                       |
  1648. XDagger (Bodkin)               |
  1649. XDagger (Main Gauche)          |
  1650. XDagger (Misercorde)           |
  1651. XDagger (Stiletto)             |
  1652. XExecutioner's Sword           |
  1653. XFauchard                      |
  1654. XFlail                         |
  1655. XFoil                          |
  1656. XGlaive                        |
  1657. XHalberd                       |
  1658. XJavelin                       |
  1659. XKatana                        |
  1660. XLance                         |
  1661. XLongsword                     |
  1662. XLucerne Hammer                |
  1663. XMace                          |
  1664. XMace (Lead filled)            |
  1665. XMorningstar                   |
  1666. XPike                          |
  1667. XRapier                        |
  1668. XSabre                         |
  1669. XSmall Sword                   |
  1670. XSpear                         |
  1671. XThrusting Sword (Baselard)    |
  1672. XThrusting Sword (Bilbo)       |
  1673. XTwo Handed Great Flail        |
  1674. XTwo Handed Sword (Claymore)   |
  1675. XTwo Handed Sword (Espadon)    |
  1676. XTwo Handed Sword (Flamberge)  |
  1677. XTwo Handed Sword (No-Dachi)   |
  1678. XTwo Handed Sword (Zweihander) |
  1679. XWar Hammer                    |
  1680. XWooden Club                   |
  1681. END_OF_FILE
  1682. if test 1408 -ne `wc -c <'util/weapons/mkallwpn.lst'`; then
  1683.     echo shar: \"'util/weapons/mkallwpn.lst'\" unpacked with wrong size!
  1684. fi
  1685. # end of 'util/weapons/mkallwpn.lst'
  1686. fi
  1687. if test -f 'util/weapons/weapon.lst' -a "${1}" != "-c" ; then 
  1688.   echo shar: Will not clobber existing file \"'util/weapons/weapon.lst'\"
  1689. else
  1690. echo shar: Extracting \"'util/weapons/weapon.lst'\" \(3411 characters\)
  1691. sed "s/^X//" >'util/weapons/weapon.lst' <<'END_OF_FILE'
  1692. X         Name                Symbol   Price  Weight   Damage  Level
  1693. X           V                   V        V      V    V       V
  1694. XAwl-Pike                      '/'      340    160      1d8    8
  1695. XBacksword                     '|'       60     95      1d9    7
  1696. XBall and Chain                '\'      200    150      2d4     20
  1697. XBastard Sword                 '|'      350    140      3d4     14
  1698. XBattle Axe (Balestarius)      '\'      500    180      2d8     30
  1699. XBattle Axe (European)         '\'      334    170      3d4     13
  1700. XBeaked Axe                    '/'      408    180      2d6     15
  1701. XBroad Axe                     '\'      304    160      2d6     17
  1702. XBroadsword                    '|'      255    150      2d5    9
  1703. XCat-O-Nine Tails              '\'       14     40      1d4    3
  1704. XCutlass                       '|'       85    110      1d7    7
  1705. XDagger (Bodkin)               '|'       10     20      1d4    1
  1706. XDagger (Main Gauche)          '|'       25     30      1d5    2
  1707. XDagger (Misercorde)           '|'       10     15      1d4    0
  1708. XDagger (Stiletto)             '|'       10     12      1d4    0
  1709. XExecutioner's Sword           '|'      850    260      4d5     40
  1710. XFauchard                      '/'      376    170      1d10    17
  1711. XFlail                         '\'      353    150      2d6     12
  1712. XFoil                          '|'       35     30      1d5    2
  1713. XGlaive                        '/'      363    190      2d6     20
  1714. XHalberd                       '/'      430    190      3d4     22
  1715. XJavelin                       '/'       18     30      1d4    4
  1716. XKatana                        '|'      400    120      3d4     18
  1717. XLance                         '/'      230    300      2d8     10
  1718. XLongsword                     '|'      300    130      1d10    12
  1719. XLucerne Hammer                '/'      376    120      2d5     11
  1720. XMace                          '\'      130    120      2d4    6
  1721. XMace (Lead filled)            '\'      502    180      3d4     15
  1722. XMorningstar                   '\'      396    150      2d6     10
  1723. XPike                          '/'      358    160      2d5     15
  1724. XRapier                        '|'       42     40      1d6    4
  1725. XSabre                         '|'       50     50      1d7    5
  1726. XSmall Sword                   '|'       48     75      1d6    5
  1727. XSpear                         '/'       36     50      1d6    5
  1728. XThrusting Sword (Baselard)    '|'       80    100      1d7    5
  1729. XThrusting Sword (Bilbo)       '|'       60     80      1d6    4
  1730. XTwo Handed Great Flail        '\'      590    280      3d6     45
  1731. XTwo Handed Sword (Claymore)   '|'      775    200      3d6     30
  1732. XTwo Handed Sword (Espadon)    '|'      655    180      3d6     35
  1733. XTwo Handed Sword (Flamberge)  '|'     1000    240      4d5     45
  1734. XTwo Handed Sword (No-Dachi)   '|'      675    200      4d4     45
  1735. XTwo Handed Sword (Zweihander) '|'     1000    280      4d6     50
  1736. XWar Hammer                    '\'      225    120      3d3    5
  1737. XWooden Club                   '\'        1    100      1d3    0
  1738. X
  1739. X
  1740. X
  1741. XHoly Avenger:  (HA)
  1742. Xincrease strength (P1), slay evil, slay undead, sustain stat (P1),
  1743. Xsee invisible
  1744. X
  1745. XDefender:  (DF)
  1746. Xstealth, regeneration, resist fire, resist acid, resist cold,
  1747. Xresist lightning, free action, see invisible, feather fall
  1748. X
  1749. XSlay Monster:  (SM)
  1750. Xslay monster, see invisible
  1751. X
  1752. XHelmet of the Magi:  (0x01380008)
  1753. Xincrease intelligence (P1), resist fire, resist acid, resist cold,
  1754. Xsee invisible
  1755. X
  1756. XAmulet of the Magi:  (0x01800040)
  1757. Xfree action, see invisible, searching
  1758. END_OF_FILE
  1759. if test 3411 -ne `wc -c <'util/weapons/weapon.lst'`; then
  1760.     echo shar: \"'util/weapons/weapon.lst'\" unpacked with wrong size!
  1761. fi
  1762. # end of 'util/weapons/weapon.lst'
  1763. fi
  1764. echo shar: End of archive 37 \(of 39\).
  1765. cp /dev/null ark37isdone
  1766. MISSING=""
  1767. 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 34 35 36 37 38 39 ; do
  1768.     if test ! -f ark${I}isdone ; then
  1769.     MISSING="${MISSING} ${I}"
  1770.     fi
  1771. done
  1772. if test "${MISSING}" = "" ; then
  1773.     echo You have unpacked all 39 archives.
  1774.     echo "Now run "bldfiles.sh" to build split files"
  1775.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1776. else
  1777.     echo You still need to unpack the following archives:
  1778.     echo "        " ${MISSING}
  1779. fi
  1780. ##  End of shell archive.
  1781. exit 0
  1782.