[comp.sources.games] v05i051: umoria2 - single player dungeon simulation

games@tekred.TEK.COM (07/29/88)

Submitted by: "James E. Wilson" <wilson@ji.berkeley.edu>
Comp.sources.games: Volume 5, Issue 51
Archive-name: umoria2/Part17



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 17 (of 18)."
# Contents:  Flexnames INSTALL Makefile Moria.man eat.c externs.h
#   prayer.c sets.c staffs.c
# Wrapped by billr@saab on Wed Jul 13 11:16:38 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Flexnames' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Flexnames'\"
else
echo shar: Extracting \"'Flexnames'\" \(3668 characters\)
sed "s/^X//" >'Flexnames' <<'END_OF_FILE'
XFrom ucbvax!agate!helios.ee.lbl.gov!lll-tis!ames!mailrus!umix!metavax!oxtrap!lokkur!m2-net!stealth Tue Jun 14 11:49:28 PDT 1988
XStatus: R
X
XArticle 1553 of rec.games.moria:
XPath: ucbvax!agate!helios.ee.lbl.gov!lll-tis!ames!mailrus!umix!metavax!oxtrap!lokkur!m2-net!stealth
X>From: stealth@m2-net.UUCP (Mike Peltier)
XNewsgroups: rec.games.moria
XSubject: Moria 4.87 flexnames sed file
XKeywords: 8 character limit
XMessage-ID: <1760@m2-net.UUCP>
XDate: 11 Jun 88 21:00:09 GMT
XOrganization: M-net, Ann Arbor, MI
XLines: 129
X
X
X
XThe new and improved sed script for Moria 4.87 is here.  Eight character
Xvariable limits on your compiler got you down?  Just run your source through
Xthis, and it should be perfectly fine.  It's not totally guaranteed, however,
Xsince my compiler is having problems on the Altos Sys III, and I haven't had
Xa chance to check it out.  But bascially, it's a Moria 4.85 sed script
Xwith a shortc variable name processor output added on.  It will definitely
Xprovide a solid foundation, short by perhaps a couple of bricks.
XEnjoy...
X			Mike Peltier
X			stealth@m-net.UUCP    -- Ann Arbor, Michigan
X			{ att, ihnp4, uunet}!umix!m-net!stealth
X----------------------------->8 Cut Here >8-------------------------------
X
Xs/MORIA_/MRA_/g
Xs/SCREEN_/SCN_/g
Xs/OUTPAGE_/OPG_/g
Xs/DUN_TUN_/D_T_/g
Xs/DUN_STR_/D_S_/g
Xs/STORE_/ST_/g
Xs/INVEN_/IVN_/g
Xs/TREAS_/TRS_/g
Xs/OBJ_STD_/O_S_/g
Xs/OBJ_DIV_/O_D_/g
Xs/MAX_/MX_/g
Xs/MIN_/M_/g
Xs/MALLOC_/MC_/g
Xs/WIN_MON_/WM_/g
Xs/PLAYER_FOOD_/PF_/g
Xs/PLAYER_REGEN_/PR_/g
Xs/randes_/rnd_/g
Xs/password/pswd/g
Xs/panel_/pn_/g
Xs/col_/c_/g
Xs/row_/r_/g
Xs/max_/m_/g
Xs/_floor/_flr/g
Xs/floor_/flr_/g
Xs/corr_/cr_/g
Xs/rock_wall/RckWl/g
Xs/_wall/_wl/g
Xs/player_/p_/g
Xs/background_type/b_type/g
Xs/object_/obj_/g
Xs/inventory_/inv_/g
Xs/trap_list/tp_lst/g
Xs/sustain_/sus_/g
Xs/build_/bld_/g
Xs/change_/cng_/g
Xs/stat_/st_/g
Xs/check_/ck_/g
Xs/compact_/cmpt_/g
Xs/cur_char/c_ch/g
Xs/delete_/del_/g
Xs/detect_/det_/g
Xs/disarm_/darm_/g
Xs/display_/dsp_/g
Xs/haggle_/hgl_/g
Xs/insert_/ins_/g
Xs/inven_/in_/g
Xs/original_/org_/g
Xs/place_/pc_/g
Xs/print_strength/PrtStr/g
Xs/print_/pr_/g
Xs/_comment/_c_/g
Xs/_misc/_m/g
Xs/rogue_like_/rg_/g
Xs/set_1_2/set12/g
Xs/set_acid/st_acd/g
Xs/set_light/st_lgt/g
Xs/signal_save_/sigsv_/g
Xs/sleep_monsters/sl_mon/g
Xs/speed_monster/SpdMon/g
Xs/store_/sto_/g
Xs/summon_/smn_/g
Xs/teleport_/tport_/g
Xs/wizard_/wiz_/g
Xs/OBJ_BASE/O_BS/g
Xs/PLAYER_/PL_/g
Xs/generate_/gen_/g
Xs/next_to/nx_2/g
Xs/bld_typ/BldTp/g
Xs/create_/Creat/g
Xs/de_stat/DStat/g
Xs/det_inv/DetIn/g
Xs/in_stat/InSt/g
Xs/next_to/NxtTo/g
Xs/prt_con/PrCon/g
Xs/remove_/Rem/g
Xs/search_/Searc/g
Xs/set_cor/SetC/g
Xs/st_acd_/StAcd/g
Xs/td_destroy/TdDst/g
Xs/creature_/cre_/g
Xs/char_tmp/CharTmp/g
Xs/monster_/mon_/g
Xs/purchase/purch/g
Xs/magic_shop/MagicShop/g
X/get_stat/s//Aget_stat/g
X/get_stats/s//Bget_stats/g
X/new_spells/s//Anew_spells/g
X/out_val2/s//Bout_val2/g
X/out_val1/s//Aout_val1/g
X/O_BS_MAGIC/s//AO_BS_MAGIC/g
X/destroy2/s//Bdestroy2/g
X/old_ptodam/s//Aold_ptodam/g
X/aggravate_monster/s//Aaggravate_monster/g
X/CharTmp_array/s//ACharTmp_array/g
X/weight_limit/s//Aweight_limit/g
X/test_roll/s//Atest_roll/g
X/turn_undead/s//Aturn_undead/g
X/default_signals/s//Adefault_signals/g
X/destroy_area/s//Adestroy_area/g
X/confuse_monster/s//Bconfuse_monster/g
X/spell_choice/s//Aspell_choice/g
X/character_generated/s//Acharacter_generated/g
X/increase_insults/s//Aincrease_insults/g
X/receive_offer/s//Areceive_offer/g
X/item_val/s//Aitem_val/g
X/item_value/s//Bitem_value/g
X/history_block/s//Ahistory_block/g
X/MX_TRAPA/s//AMX_TRAPA/g
X/insult_cur/s//Ainsult_cur/g
X/unlight_area/s//Aunlight_area/g
X/resist_heat/s//Aresist_heat/g
X/prt_strength/s//Aprt_strength/g
X/critical_blow/s//Acritical_blow/g
X/confused/s//Aconfused/g
X
X
END_OF_FILE
if test 3668 -ne `wc -c <'Flexnames'`; then
    echo shar: \"'Flexnames'\" unpacked with wrong size!
fi
# end of 'Flexnames'
fi
if test -f 'INSTALL' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'INSTALL'\"
else
echo shar: Extracting \"'INSTALL'\" \(2611 characters\)
sed "s/^X//" >'INSTALL' <<'END_OF_FILE'
XTo compile the program, edit the config.h file to change the
Xnames of the files the game uses and the wizard info.  Also, uncomment the
Xappropriate line for the system you are compiling on. Type make
Xto compile the game.  You may want to edit the 'Moria_hours' file
Xto indicate during what hours people are allowed to play the game.
X
XThe game needs to be installed setuid for the scoreboard to work.
XUse the command 'chmod 4511 moria' to do this.
XThe file Highscores should be mode 644 with the same owner as moria.
XThe files Moria_hours and Moria_news must be publicly readable with
Xmode 444.
X(Or just type 'make install' after setting BINDIR and LIBDIR in the
XMakefile to appropriate values.)
X
XThere are two choices for the key bindings, the original style and
Xa rogue-like style.  You can choose which one is to be the default
Xby changing the value of KEY_BINDINGS in config.h.
X
XIf the display does not look right, try defining BUGGY_CURSES in config.h.
XDelete io.o, touch *.o, and then recompile.
X
XFor the IBM PC-RT, 3B1, 3B2, 3B20, and perhaps others, you must
Xdefine NO_SIGNED_CHARS in config.h.
X
XMoria may not compile properly on SYS III machines(?)
X
XSome versions of the SUN4 compiler will dump core while compiling moria2.c
Xwith the -O flag.  Just compile without the -O flag if this happens.
X
XIf you use the Gnu C Compiler, you must also use the -fwritable-strings
Xoptions.  
X
XIf your compiler has a seven character identifier limit, the Flexnames
Xsed file should solve the problem for you.
X
XThere is a patch file which attempts to eliminate the 32bit int assumptions
Xof umoria called Int16bit.patch.  This file should enable systems with
X16 bit integers (such as Xenix) to compile umoria.  It has not been 
Xextensively tested though.
X
XThere is an obsolete patch file included for Xenix.  This is a patch for an
Xolder version of moria, 4.85, and may not work correctly on the new version.
X(I haven't tried it.)  I recommend using the In16bit.patch file first, and
Xthen referencing this file if you still have problems.
XUse the -N option of patch to avoid unfixing bugs that have already been
Xfixed. 
X
XI have successfully compiled the game on a VAX running 4.3BSD,
XSUN 3/50 running UNIX 4.2 Release 3.2, a microvax running ULTRIX 2.0,
Xand an NCR Tower running SYS Vr2
XThe program assumes that ints are 32 bits. The program passes lint
Xso further porting should not be too hard.
XBSD/UNIX dependencies are(?) limited to the files io.c, save.c, and
Xsignals.c.
X
XThe documentation file was split into two parts for usenet distribution.
XBuild a single doc file with the command "cat Moria.doc.? >Moria.doc".
END_OF_FILE
if test 2611 -ne `wc -c <'INSTALL'`; then
    echo shar: \"'INSTALL'\" unpacked with wrong size!
fi
# end of 'INSTALL'
fi
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(3000 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# BINDIR is the directory where the moria binary while be put
X# LIBDIR is where the other files (scoreboard, news, hours) will be put
X#  LIBDIR must be the same directory defined in config.h
XBINDIR = /usr/public/
XLIBDIR = /usr/public/moriadir/
X
X# if you use Gnu C, must add -fwritable-strings option to CFLAGS
X
XCFLAGS = -O
XCC = cc
X
XSRCS = main.c misc1.c misc2.c store1.c files.c io.c create.c desc.c\
X	generate.c sets.c dungeon.c creature.c death.c eat.c help.c magic.c\
X	potions.c prayer.c save.c staffs.c wands.c scrolls.c spells.c\
X	wizard.c store2.c signals.c moria1.c moria2.c monsters.c\
X	treasure1.c treasure2.c variables.c
X
XOBJS = main.o misc1.o misc2.o store1.o files.o io.o create.o desc.o\
X	generate.o sets.o dungeon.o creature.o death.o eat.o help.o magic.o\
X	potions.o prayer.o save.o staffs.o wands.o scrolls.o spells.o\
X	wizard.o store2.o signals.o moria1.o moria2.o monsters.o\
X  	treasure1.o treasure2.o variables.o
X
Xmoria : $(OBJS)
X	$(CC) -o moria $(CFLAGS) $(OBJS) -lm -lcurses -ltermcap
X
Xlintout : $(SRCS)
X	lint $(SRCS) -lm -lcurses -ltermcap > lintout
X
Xlintout2 : $(SRCS)
X	lint -bach $(SRCS) -lm -lcurses -ltermcap > lintout
X
XTAGS : $(SRCS)
X	ctags -x $(SRCS) > TAGS
X
X# you must define BINDIR and LIBDIR before installing
Xinstall:
X	cp moria $(BINDIR)
X	cp Moria_hours $(LIBDIR)
X	cp Moria_news $(LIBDIR)
X	cp Highscores $(LIBDIR)
X	chmod 4511 $(BINDIR)/moria
X	chmod 644 $(LIBDIR)/Highscores
X	chmod 444 $(LIBDIR)/Moria_news
X	chmod 444 $(LIBDIR)/Moria_hours
X	chmod 555 $(LIBDIR)
X
Xcreate.o: constants.h types.h externs.h config.h
Xcreature.o: constants.h types.h externs.h config.h
Xdeath.o: constants.h types.h externs.h config.h
Xdesc.o: constants.h types.h externs.h config.h
Xdungeon.o: constants.h types.h externs.h config.h
Xeat.o: constants.h types.h externs.h config.h
Xfiles.o: constants.h types.h externs.h config.h
Xgenerate.o: constants.h types.h externs.h config.h
Xhelp.o: constants.h types.h externs.h config.h
Xio.o: constants.h types.h externs.h config.h
Xmagic.o: constants.h types.h externs.h config.h
Xmain.o: constants.h types.h externs.h config.h
Xmisc1.o: constants.h types.h externs.h config.h
Xmisc2.o: constants.h types.h externs.h config.h
Xmonsters.o: constants.h types.h config.h
Xmoria1.o: constants.h types.h externs.h config.h
Xmoria2.o: constants.h types.h externs.h config.h
Xpotions.o: constants.h types.h externs.h config.h
Xprayer.o: constants.h types.h externs.h config.h
Xsave.o: constants.h types.h externs.h config.h
Xscrolls.o: constants.h types.h externs.h config.h
Xsets.o: constants.h config.h
Xsignals.o: constants.h types.h externs.h config.h
Xspells.o: constants.h types.h externs.h config.h
Xstaffs.o: constants.h types.h externs.h config.h
Xstore1.o: constants.h types.h externs.h config.h
Xstore2.o: constants.h types.h externs.h config.h
Xtreasure1.o: constants.h types.h config.h
Xtreasure2.o: constants.h types.h config.h
Xvariables.o: constants.h types.h config.h
Xwands.o: constants.h types.h externs.h config.h
Xwizard.o: constants.h types.h externs.h config.h
END_OF_FILE
if test 3000 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'Moria.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Moria.man'\"
else
echo shar: Extracting \"'Moria.man'\" \(4729 characters\)
sed "s/^X//" >'Moria.man' <<'END_OF_FILE'
X.TH MORIA 6
X.UC 4
X.SH NAME
Xmoria \- Dungeon Adventure
X.SH SYNOPSIS
X.B /usr/games/moria
X[
X.B \-ros
X]
X[
X.I save_file
X]
X.SH DESCRIPTION
X.PP
XThe game of
X.I moria
Xis a single player dungeon simulation.   A
Xplayer  may  choose  from  a  number  of  races  and classes when
Xcreating their character, and then 'run' that  character  over  a
Xperiod of days, weeks, even months; attempting to win the game by
Xdefeating the Balrog which lurks in the deeper levels.
X.PP
XThe player will begin his adventure on the town level  where
Xhe  may  acquire supplies, weapons, armor, and magical devices by
Xbartering with various shop  owners.   After  preparing  for  his
Xadventure,  the  player  can  descend  into the dungeons of
X.I moria
Xwhere fantastic adventures await his coming!
X.PP
XTo get started you really only need to know two commands.  The command
X.B ?
Xwill give you a list of the available commands (below).
XThe
X.B /
Xcommand will identify the objects you see on the screen.
XBefore beginning your first adventure, you should also read
X.I The Dungeons of MORIA
Xdocument carefully.  The game of
X.I moria
Xis a complicated game, and
Xwill require a dedicated player to win.
X.PP
XThe
X.B \-r
Xswitch will make the game accept rogue like commands.
X.PP
XThe
X.B \-o
Xswitch will make the game accept original commands (this is the default).
X.PP
XThe
X.B \-s
Xswitch will print the scores and then quit.
X.PP
XIf
X.I save_file
Xis specified,
X.I moria
Xwill be restored from the specified saved game file.
X.SH "Original Mode Commands"
X.nf
XB <Dir> Bash (object/creature)|  q        Quaff a potion.
XC       Display character.    |  r        Read a scroll.
XD <Dir> Disarm a trap/chest.  |  s        Search for hidden doors.
XE       Eat some food.        |  t        Take off an item.
XF       Fill lamp with oil.   |  u        Use a staff.
XL       Current location.     |  v        Version and credits.
XP       Print map.            |  w        Wear/Wield an item.
XR       Rest for a period.    |  x        Exchange weapon.
XS       Search Mode.          |  /        Identify a character.
XT <Dir> Tunnel.               |  ?        Display this panel.
Xa       Aim and fire a wand.  |
Xb       Browse a book.        |  ^P       Repeat the last message.
Xc <Dir> Close a door.         |  ^R       Redraw the screen.
Xd       Drop an item.         |  ^K       Quit the game.
Xe       Equipment list.       |  ^X       Save character and quit.
Xf       Fire/Throw an item.   |   $       Shell out of game.
Xi       Inventory list.       |  < Go up an up-staircase.
Xj <Dir> Jam a door with spike.|  > Go down a down-staircase
Xl <Dir> Look given direction. |  . <Dir>  Move in direction.
Xm       Cast a magic spell.   |  Movement: 7  8  9
Xo <Dir> Open a door/chest.    |            4     6    5 == Rest
Xp       Read a prayer.        |            1  2  3
X.fi
X.bp
X.SH "Rogue Like Commands"
X.nf
Xf <Dir> Bash (object/creature)|  q        Quaff a potion.
XC       Display character.    |  r        Read a scroll.
XD <Dir> Disarm a trap/chest.  |  s        Search for hidden doors.
XE       Eat some food.        |  T        Take off an item.
XF       Fill lamp with oil.   |  Z        Use a staff.
XW       Current location.     |  v        Version and credits.
XM       Print map.            |  w        Wear/Wield an item.
XR       Rest for a period.    |  X        Exchange weapon.
X#       Search Mode.          |  /        Identify a character.
XCTRL <dir> Tunnel             |  ?        Display this panel.
Xz       Aim and fire a wand.  |
XP       Browse a book.        |  ^P       Repeat the last message.
Xc <Dir> Close a door.         |  ^R       Redraw the screen.
Xd       Drop an item.         |  Q        Quit the game.
Xe       Equipment list.       |  ^X       Save character and quit.
Xt       Fire/Throw an item.   |   !       Shell out of game.
Xi       Inventory list.       |  < Go up an up-staircase.
XS <Dir> Jam a door with spike.|  > Go down a down-staircase.
Xx <Dir> Look given direction. |  SHIFT <Dir>  Move in direction.
Xm       Cast a magic spell.   |  Movement: y  k  u
Xo <Dir> Open a door/chest.    |            h     l    . == Rest
Xp       Read a prayer.        |            b  j  n
X.fi
X.SH AUTHORS
XRobert Alan Koeneke / University of Oklahoma
X.br
XJimmey Wayne Todd   / University of Oklahoma
X.SH UNIX Port
XJames E. Wilson     / UC Berkeley
X.SH Manual Page
XRoger S. Southwick  / Tektronix, Inc.
X.SH BUGS
X.PP
XThe SYS V version does not lock the scoreboard, if two processes try
Xto modify it at the same time, it may become corrupted.
X
XWearing an amulet or ring that would raise a stat over 18/100 actually only
Xraises the stat to 18/100.  When the amulet is removed, the stat drops to
Xa value below its original value.
X
XProbably infinite (although countably infinite).
END_OF_FILE
if test 4729 -ne `wc -c <'Moria.man'`; then
    echo shar: \"'Moria.man'\" unpacked with wrong size!
fi
# end of 'Moria.man'
fi
if test -f 'eat.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'eat.c'\"
else
echo shar: Extracting \"'eat.c'\" \(5393 characters\)
sed "s/^X//" >'eat.c' <<'END_OF_FILE'
X#include "constants.h"
X#include "config.h"
X#include "types.h"
X#include "externs.h"
X
X
X/* Eat some food...					-RAK-	*/
Xeat()
X{
X  unsigned int i;
X  int j, k, item_val;
X  int redraw, ident;
X  register struct flags *f_ptr;
X  register struct misc *m_ptr;
X  register struct stats *s_ptr;
X  register treasure_type *i_ptr;
X
X  reset_flag = TRUE;
X  if (inven_ctr > 0)
X    {
X      if (find_range(80, -1, &j, &k))
X	{
X	  redraw = FALSE;
X	  if (get_item(&item_val, "Eat what?", &redraw, j, k))
X	    {
X	      i_ptr = &inventory[item_val];
X	      if (redraw)  draw_cave();
X	      reset_flag = FALSE;
X	      i = i_ptr->flags;
X	      ident = FALSE;
X	      while (i != 0)
X		{
X		  j = bit_pos(&i) + 1;
X		  /* Foods					*/
X		  switch(j)
X		    {
X		    case 1:
X		      f_ptr = &py.flags;
X		      f_ptr->poisoned += randint(10) + i_ptr->level;
X		      ident = TRUE;
X		      break;
X		    case 2:
X		      f_ptr = &py.flags;
X		      f_ptr->blind += randint(250) + 10*i_ptr->level + 100;
X		      draw_cave();
X		      msg_print("A veil of darkness surrounds you.");
X		      ident = TRUE;
X		      break;
X		    case 3:
X		      f_ptr = &py.flags;
X		      f_ptr->afraid += randint(10) + i_ptr->level;
X		      msg_print("You feel terrified!");
X		      ident = TRUE;
X		      break;
X		    case 4:
X		      f_ptr = &py.flags;
X		      f_ptr->confused += randint(10) + i_ptr->level;
X		      msg_print("You feel drugged.");
X		      ident = TRUE;
X		      break;
X		    case 5:
X		      f_ptr = &py.flags;
X		      f_ptr->image += randint(200) + 25*i_ptr->level + 200;
X		      ident = TRUE;
X		      break;
X		    case 6:
X		      ident = cure_poison();
X		      break;
X		    case 7:
X		      ident = cure_blindness();
X		      break;
X		    case 8:
X		      f_ptr = &py.flags;
X		      if (f_ptr->afraid > 1)
X			{
X			  f_ptr->afraid = 1;
X			  ident = TRUE;
X			}
X		      break;
X		    case 9:
X		      ident = cure_confusion();
X		      break;
X		    case 10:
X		      ident = lose_str();
X		      break;
X		    case 11:
X		      ident = lose_con();
X		      break;
X		    case 12:
X		      ident = lose_int();
X		      break;
X		    case 13:
X		      ident = lose_wis();
X		      break;
X		    case 14:
X		      ident = lose_dex();
X		      break;
X		    case 15:
X		      ident = lose_chr();
X		      break;
X		    case 16:
X		      s_ptr = &py.stats;
X		      if (s_ptr->str > s_ptr->cstr)
X			{
X			  s_ptr->cstr = s_ptr->str;
X			  msg_print("You feel your strength returning.");
X			  prt_strength();
X			  ident = TRUE;
X			  /* adjust misc stats */
X			  py_bonuses(blank_treasure, 0);
X			}
X		      break;
X		    case 17:
X		      s_ptr = &py.stats;
X		      if (s_ptr->con > s_ptr->ccon)
X			{
X			  s_ptr->ccon = s_ptr->con;
X			  msg_print("You feel your health returning.");
X			  prt_constitution();
X			  ident = TRUE;
X			}
X		      break;
X		    case 18:
X		      s_ptr = &py.stats;
X		      if (py.stats.intel > s_ptr->cint)
X			{
X			  s_ptr->cint = py.stats.intel;
X			  msg_print("Your head spins a moment.");
X			  prt_intelligence();
X			  ident = TRUE;
X			}
X		      break;
X		    case 19:
X		      s_ptr = &py.stats;
X		      if (s_ptr->wis > s_ptr->cwis)
X			{
X			  s_ptr->cwis = s_ptr->wis;
X			  msg_print("You feel your wisdom returning.");
X			  prt_wisdom();
X			  ident = TRUE;
X			}
X		      break;
X		    case 20:
X		      s_ptr = &py.stats;
X		      if (s_ptr->dex > s_ptr->cdex)
X			{
X			  s_ptr->cdex = s_ptr->dex;
X			  msg_print("You feel more dextrous.");
X			  prt_dexterity();
X			  ident = TRUE;
X			  /* adjust misc stats */
X			  py_bonuses(blank_treasure, 0);
X			}
X		      break;
X		    case 21:
X		      s_ptr = &py.stats;
X		      if (s_ptr->chr > s_ptr->cchr)
X			{
X			  s_ptr->cchr = s_ptr->chr;
X			  msg_print("Your skin starts itching.");
X			  prt_charisma();
X			  ident = TRUE;
X			}
X		      break;
X		    case 22:
X		      ident = hp_player(randint(3), "poisonous food.");
X		      break;
X		    case 23:
X		      ident = hp_player(randint(6), "poisonous food.");
X		      break;
X		    case 24:
X		      ident = hp_player(randint(12), "poisonous food.");
X		      break;
X		    case 25:
X		      ident = hp_player(damroll("3d6"), "poisonous food.");
X		      break;
X		    case 26:
X		      ident = hp_player(damroll("3d12"), "poisonous food.");
X		      break;
X		    case 27:
X		      ident = hp_player(-randint(4), "poisonous food.");
X		      break;
X		    case 28:
X		      ident = hp_player(-randint(8), "poisonous food.");
X		      break;
X		    case 29:
X		      ident = hp_player(-damroll("2d8"), "poisonous food.");
X		      break;
X		    case 30:
X		      ident = hp_player(-damroll("3d8"), "poisonous food.");
X		      break;
X		    case 31:
X		      m_ptr = &py.misc;
X		      m_ptr->mhp--;
X		      if (m_ptr->mhp < m_ptr->chp)
X			m_ptr->chp = (double)m_ptr->mhp;
X		      take_hit(1, "poisonous food.");
X		      prt_mhp();
X		      prt_chp();
X		      ident = TRUE;
X		      break;
X		    default:
X		      break;
X		    }
X		  /* End of food actions...				*/
X		}
X	      if (ident)
X		identify(inventory[item_val]);
X	      if (i_ptr->flags != 0)
X		{
X		  m_ptr = &py.misc;
X		  m_ptr->exp += ((i_ptr->level/m_ptr->lev) + .5);
X		  prt_experience();
X		}
X	      add_food(i_ptr->p1);
X	      py.flags.status = (0xFFFFFFFC & py.flags.status);
X	      prt_hunger();
X	      desc_remain(item_val);
X	      inven_destroy(item_val);
X	    }
X	  else
X	    if (redraw)  draw_cave();
X	}
X      else
X	msg_print("You are not carrying any food.");
X    }
X  else
X    msg_print("But you are not carrying anything.");
X}
END_OF_FILE
if test 5393 -ne `wc -c <'eat.c'`; then
    echo shar: \"'eat.c'\" unpacked with wrong size!
fi
# end of 'eat.c'
fi
if test -f 'externs.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'externs.h'\"
else
echo shar: Extracting \"'externs.h'\" \(4985 characters\)
sed "s/^X//" >'externs.h' <<'END_OF_FILE'
Xextern int character_generated;  /* don't save score until char gen finished */
Xextern int character_saved;      /* prevents save on kill after save_char() */
Xextern int highscore_fd;	/* High score file descriptor */
Xextern int player_max_exp;	/* Max exp possible    */
Xextern char norm_state[STATE_SIZE];	/* Contains seed #     */
Xextern char randes_state[STATE_SIZE];
Xextern int randes_seed;	    /* For encoding colors */
Xextern char town_state[STATE_SIZE];
Xextern int town_seed;	    /* Seed for town genera*/
Xextern int cur_height, cur_width;	/* Cur dungeon size    */
Xextern int dun_level;	/* Cur dungeon level   */
Xextern int missile_ctr;	/* Counter for missiles */
Xextern int msg_flag;	/* Set with first msg  */
Xextern int generate;	/* Generate next level */
Xextern int death;	/* True if died	      */
Xextern vtype died_from;	/* What killed him     */
Xextern int find_flag;	/* Used in MORIA	      */
Xextern int reset_flag;	/* Used in MORIA	      */
Xextern int stat_column;	/* Column for stats    */
Xextern unsigned int print_stat;	/* Flag for stats      */
Xextern int turn;	/* Cur trun of game    */
Xextern int wizard1;	/* Wizard flag	      */
Xextern int wizard2;	/* Wizard flag	      */
Xextern int panic_save;  /* this is true if playing from a panic save */
Xextern int used_line[23];
Xextern char password1[12];
Xextern char password2[12];
X
Xextern int wait_for_more;
X
Xextern int key_bindings;
X
Xextern char days[7][80];
Xextern int closing_flag;	/* Used for closing   */
X
X/* Bit testing array						*/
Xextern unsigned int bit_array[32];
X
X/*  Following are calculated from max dungeon sizes		*/
Xextern int max_panel_rows, max_panel_cols;
Xextern int panel_row, panel_col;
Xextern int panel_row_min, panel_row_max;
Xextern int panel_col_min, panel_col_max;
Xextern int panel_col_prt, panel_row_prt;
X
X/*  Following are all floor definitions				*/
Xextern cave_type cave[MAX_HEIGHT][MAX_WIDTH];
Xextern cave_type blank_floor;
Xextern floor_type dopen_floor;
Xextern floor_type lopen_floor;
Xextern floor_type corr_floor1;
Xextern floor_type corr_floor2;
Xextern floor_type corr_floor3;
Xextern floor_type corr_floor4;
Xextern floor_type rock_wall1;
Xextern floor_type rock_wall2;
Xextern floor_type rock_wall3;
Xextern floor_type boundary_wall;
X
X/* Following are player variables				*/
Xextern player_type py;
Xextern btype player_title[MAX_CLASS][MAX_PLAYER_LEVEL];
Xextern int player_exp[MAX_PLAYER_LEVEL];
Xextern double acc_exp;	                  /* Accumulator for fractional exp*/
Xextern dtype bare_hands;
Xextern int char_row;
Xextern int char_col;
Xextern int global_com_val;
Xextern race_type race[MAX_RACES];
Xextern background_type background[MAX_BACKGROUND];
Xextern double rgold_adj[MAX_RACES][MAX_RACES];
X
X/* SUN4 has a variable called class in the include file <math.h>
X   avoid a conflict by not defining my class in the file misc1.c */
X#ifndef DONT_DEFINE_CLASS
Xextern class_type class[MAX_CLASS];
X#endif
X
Xextern spell_type magic_spell[MAX_CLASS][31];
Xextern treasure_type mush;
Xextern byteint player_init[MAX_CLASS][5];
Xextern int total_winner;
X
X/* Following are store definitions				*/
Xextern owner_type owners[MAX_OWNERS];
Xextern store_type store[MAX_STORES];
Xextern treasure_type store_door[MAX_STORES];
Xextern int store_choice[MAX_STORES][STORE_CHOICES];
X
Xint (*store_buy[MAX_STORES])();
X
X/* Following are treasure arrays	and variables			*/
Xextern treasure_type object_list[MAX_OBJECTS];
Xextern int object_ident[MAX_OBJECTS];
Xextern int t_level[MAX_OBJ_LEVEL];
Xextern treasure_type gold_list[MAX_GOLD];
Xextern treasure_type t_list[MAX_TALLOC];
Xextern treasure_type inventory[INVEN_ARRAY_SIZE];
Xextern treasure_type inventory_init[INVEN_INIT_MAX];
Xextern treasure_type blank_treasure;
Xextern int inven_ctr;	        /* Total different obj's	*/
Xextern int inven_weight;	/* Cur carried weight	*/
Xextern int equip_ctr;  	/* Cur equipment ctr	*/
Xextern int tcptr;      	/* Cur treasure heap ptr	*/
X
X/* Following are feature objects defined for dungeon		*/
Xextern treasure_type trap_lista[MAX_TRAPA];
Xextern treasure_type trap_listb[MAX_TRAPB];
Xextern treasure_type scare_monster;	/* Special trap	*/
Xextern treasure_type rubble;
Xextern treasure_type door_list[3];
Xextern treasure_type up_stair;
Xextern treasure_type down_stair;
X
X/* Following are creature arrays and variables			*/
Xextern creature_type c_list[MAX_CREATURES];
Xextern monster_type m_list[MAX_MALLOC];
Xextern int m_level[MAX_MONS_LEVEL];
Xextern monster_type blank_monster;	/* Blank monster values	*/
Xextern int muptr;	/* Cur used monster ptr	*/
Xextern int mfptr;	/* Cur free monster ptr	*/
Xextern int mon_tot_mult;	/* # of repro's of creature	*/
X
X/* Following are arrays for descriptive pieces			*/
Xextern atype colors[MAX_COLORS];
Xextern atype mushrooms[MAX_MUSH];
Xextern atype woods[MAX_WOODS];
Xextern atype metals[MAX_METALS];
Xextern atype rocks[MAX_ROCKS];
Xextern atype amulets[MAX_AMULETS];
Xextern dtype syllables[MAX_SYLLABLES];
X
X/* function return values */
Xchar *pad();
Xbyteint de_statp();
Xbyteint in_statp();
Xchar *likert();
END_OF_FILE
if test 4985 -ne `wc -c <'externs.h'`; then
    echo shar: \"'externs.h'\" unpacked with wrong size!
fi
# end of 'externs.h'
fi
if test -f 'prayer.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'prayer.c'\"
else
echo shar: Extracting \"'prayer.c'\" \(5019 characters\)
sed "s/^X//" >'prayer.c' <<'END_OF_FILE'
X#include "constants.h"
X#include "config.h"
X#include "types.h"
X#include "externs.h"
X
X
X/* Pray like HELL...					-RAK-	*/
Xpray()
X{
X  int i, j, item_val, dir;
X  int choice, chance, result;
X  int dumy, y_dumy, x_dumy;
X  int redraw;
X  register spell_type *s_ptr;
X  register struct misc *m_ptr;
X  register struct flags *f_ptr;
X  register treasure_type *i_ptr;
X
X  reset_flag = TRUE;
X  if (py.flags.blind > 0)
X    msg_print("You can't see to read your prayer!");
X  else if (no_light())
X    msg_print("You have no light to read by.");
X  else if (py.flags.confused > 0)
X    msg_print("You are too confused...");
X  else if (class[py.misc.pclass].pspell)
X    if (inven_ctr > 0)
X      {
X	if (find_range(91, -1, &i, &j))
X	  {
X	    redraw = FALSE;
X	    if (get_item(&item_val, "Use which Holy Book?", &redraw, i, j))
X	      {
X		if ((result = cast_spell("Recite which prayer?", item_val,
X			       &choice, &chance, &redraw)) == TRUE)
X		  {
X		    s_ptr = &magic_spell[py.misc.pclass][choice];
X		    reset_flag = FALSE;
X		    if (randint(100) < chance)
X		      msg_print("You lost your concentration!");
X		    else
X		      {
X			y_dumy = char_row;
X			x_dumy = char_col;
X			/* Prayers...					*/
X			choice++;
X			switch(choice)
X			  {
X			  case 1:
X			    (void) detect_evil();
X			    break;
X			  case 2:
X			    (void) hp_player(damroll("3d3"), "a prayer.");
X			    break;
X			  case 3:
X			    (void) bless(randint(12)+12);
X			    break;
X			  case 4:
X			    (void) remove_fear();
X			    break;
X			  case 5:
X			    (void) light_area(char_row, char_col);
X			    break;
X			  case 6:
X			    (void) detect_trap();
X			    break;
X			  case 7:
X			    (void) detect_sdoor();
X			    break;
X			  case 8:
X			    (void) slow_poison();
X                            break;
X			  case 9:
X			    if (get_dir("Which direction?", &dir,
X					&dumy, &y_dumy, &x_dumy))
X			      (void) confuse_monster(dir, char_row, char_col);
X			    break;
X			  case 10:
X			    teleport((int)(py.misc.lev*3));
X			    break;
X			  case 11:
X			    (void) hp_player(damroll("4d4"), "a prayer.");
X			    break;
X			  case 12:
X			    (void) bless(randint(24)+24);
X			    break;
X			  case 13:
X			    (void) sleep_monsters1(char_row, char_col);
X			    break;
X			  case 14:
X			    (void) create_food();
X			    break;
X			  case 15:
X			    for (i = 0; i < INVEN_MAX; i++)
X			      {
X				i_ptr = &inventory[i];
X				i_ptr->flags &= 0x7FFFFFFF;
X			      }
X			    break;
X			  case 16:
X			    f_ptr = &py.flags;
X			    f_ptr->resist_heat += randint(10) + 10;
X			    f_ptr->resist_cold += randint(10) + 10;
X			    break;
X			  case 17:
X			    (void) cure_poison();
X			    break;
X			  case 18:
X			    if (get_dir("Which direction?", &dir,
X					&dumy, &y_dumy, &x_dumy))
X			      fire_ball(6, dir, char_row, char_col,
X					(int)(damroll("3d6")+py.misc.lev),
X					"Black Sphere");
X			    break;
X			  case 19:
X			    (void) hp_player(damroll("8d4"), "a prayer.");
X			    break;
X			  case 20:
X			    detect_inv2(randint(24)+24);
X			    break;
X			  case 21:
X			    (void) protect_evil();
X			    break;
X			  case 22:
X			    (void) earthquake();
X			    break;
X			  case 23:
X			    (void) map_area();
X			    break;
X			  case 24:
X			    (void) hp_player(damroll("16d4"), "a prayer.");
X			    break;
X			  case 25:
X			    (void) turn_undead();
X			    break;
X			  case 26:
X			    (void) bless(randint(48)+48);
X			    break;
X			  case 27:
X			    (void) dispell_creature(0x0008,
X						    (int)(3*py.misc.lev));
X			    break;
X			  case 28:
X			    (void) hp_player(200, "a prayer.");
X			    break;
X			  case 29:
X			    (void) dispell_creature(0x0004,
X						    (int)(3*py.misc.lev));
X			    break;
X			  case 30:
X			    (void) warding_glyph();
X			    break;
X			  case 31:
X			    (void) dispell_creature(0x0004,
X						    (int)(4*py.misc.lev));
X			    (void) cure_confusion();
X			    (void) remove_fear();
X			    (void) cure_poison();
X			    (void) cure_blindness();
X			    (void) hp_player(1000, "a prayer.");
X			    break;
X			  default:
X			    break;
X			  }
X			/* End of prayers...				*/
X			if (!reset_flag)
X			  {
X			    m_ptr = &py.misc;
X			    m_ptr->exp += s_ptr->sexp;
X			    prt_experience();
X			    s_ptr->sexp = 0;
X			  }
X		      }
X		    m_ptr = &py.misc;
X		    if (!reset_flag)
X		      {
X			if (s_ptr->smana > m_ptr->cmana)
X			  {
X			    msg_print("You faint from fatigue!");
X			    py.flags.paralysis =
X			      randint(5*(int)(s_ptr->smana-(int)m_ptr->cmana));
X			    m_ptr->cmana = 0.0;
X			    if (randint(3) == 1)
X			      {
X				msg_print("You have damaged your health!");
X				py.stats.ccon = de_statp(py.stats.ccon);
X				prt_constitution();
X			      }
X			  }
X			else
X			  m_ptr->cmana -= (double)s_ptr->smana;
X			prt_cmana();
X		      }
X		  }
X		else if (result == -1)
X		  msg_print("You don't know any prayers in that book.");
X	      }
X	    else
X	      if (redraw)  draw_cave();
X	  }
X	else
X	  msg_print("But you are not carrying any Holy Books!");
X      }
X    else
X      msg_print("But you are not carrying any Holy Books!");
X  else
X    msg_print("Pray hard enough and your prayers may be answered.");
X}
END_OF_FILE
if test 5019 -ne `wc -c <'prayer.c'`; then
    echo shar: \"'prayer.c'\" unpacked with wrong size!
fi
# end of 'prayer.c'
fi
if test -f 'sets.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sets.c'\"
else
echo shar: Extracting \"'sets.c'\" \(3908 characters\)
sed "s/^X//" >'sets.c' <<'END_OF_FILE'
X#include "constants.h"
X#include "config.h"
X
Xint set_1_2(element)
Xregister int element;
X{
X  if ((element == 1) || (element == 2))
X    return(TRUE);
X  return(FALSE);
X}
X
Xint set_1_2_4(element)
Xregister int element;
X{
X  if ((element == 1) || (element == 2) || (element == 4))
X    return(TRUE);
X  return(FALSE);
X}
X
Xint set_4(element)
Xint element;
X{
X  if (element == 4)
X    return(TRUE);
X  return(FALSE);
X}
X
Xint set_corrodes(element)
Xint element;
X{
X  switch(element)
X    {
X    case 23: case 33: case 34: case 35: case 65:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint set_flammable(element)
Xint element;
X{
X  switch(element)
X    {
X    case 12: case 20: case 21: case 22: case 30: case 31: case 32:
X    case 36: case 55: case 70: case 71:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint set_frost_destroy(element)
Xregister int element;
X{
X  if ((element == 75) || (element == 76))
X    return(TRUE);
X  return(FALSE);
X}
X
X
Xint set_acid_affect(element)
Xint element;
X{
X  switch(element)
X    {
X    case 1: case 2: case 11: case 12: case 20: case 21: case 22:
X    case 30: case 31: case 32: case 36:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint set_floor(element)
X{
X  switch(element)
X    {
X    case 1: case 2: case 4: case 5: case 6: case 7:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint set_lightning_destroy(element)
Xint element;
X{
X  switch(element)
X    {
X    case 45: case 60: case 65:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
X/*ARGSUSED*/    /* to shut up lint about unused argument */
Xint set_null(element)
Xint element;
X{
X  return(FALSE);
X}
X
X
Xint set_acid_destroy(element)
Xint element;
X{
X  switch(element)
X    {
X    case 12: case 20: case 21: case 22: case 30: case 31: case 32: case 33:
X    case 34: case 35: case 36: case 55: case 70: case 71: case 80: case 104:
X    case 105:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint set_fire_destroy(element)
Xint element;
X{
X  switch(element)
X    {
X    case 12: case 20: case 21: case 22: case 30: case 31: case 32: case 36:
X    case 55: case 70: case 71: case 75: case 76: case 80: case 104:
X    case 105:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint general_store(element)
Xint element;
X{
X  switch(element)
X    {
X    case 25: case 30: case 32: case 80: case 77: case 15: case 13:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint armory(element)
Xint element;
X{
X  switch(element)
X    {
X    case 30: case 31: case 33: case 34: case 35: case 36:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint weaponsmith(element)
Xint element;
X{
X  switch(element)
X    {
X    case 10: case 11: case 12: case 20: case 21: case 22: case 23:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint temple(element)
Xint element;
X{
X  switch(element)
X    {
X    case 21: case 70: case 71: case 75: case 76: case 91:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint alchemist(element)
Xint element;
X{
X  switch(element)
X    {
X    case 70: case 71: case 75: case 76:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint magic_shop(element)
Xint element;
X{
X  switch(element)
X    {
X    case 40: case 45: case 55: case 65: case 70: case 71:
X    case 75: case 76: case 90:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint set_wall(element)
Xint element;
X{
X  switch(element)
X    {
X    case 10: case 11: case 12:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint set_pwall(element)
Xint element;
X{
X  switch(element)
X    {
X    case 10: case 11: case 12: case 15:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint set_corr(element)
Xregister int element;
X{
X  if ((element == 4) || (element == 5))
X    return(TRUE);
X  return(FALSE);
X}
X
X
Xint set_trap(element)
Xint element;
X{
X  switch(element)
X    {
X    case 101: case 102: case 109: case 110:
X      return(TRUE);
X    }
X  return(FALSE);
X}
X
X
Xint set_light(element)
Xint element;
X{
X  switch(element)
X    {
X    case 102: case 103: case 104: case 105:
X    case 107: case 108: case 109: case 110:
X      return(TRUE);
X    }
X  return(FALSE);
X}
END_OF_FILE
if test 3908 -ne `wc -c <'sets.c'`; then
    echo shar: \"'sets.c'\" unpacked with wrong size!
fi
# end of 'sets.c'
fi
if test -f 'staffs.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'staffs.c'\"
else
echo shar: Extracting \"'staffs.c'\" \(3384 characters\)
sed "s/^X//" >'staffs.c' <<'END_OF_FILE'
X#include "constants.h"
X#include "config.h"
X#include "types.h"
X#include "externs.h"
X
X
X/* Use a staff...					-RAK-	*/
Xuse()
X{
X  unsigned int i;
X  int j, k, item_val, chance;
X  int y, x;
X  int redraw, ident;
X  register struct misc *m_ptr;
X  register treasure_type *i_ptr;
X
X  reset_flag = TRUE;
X  if (inven_ctr > 0)
X    {
X      if (find_range(55, -1, &j, &k))
X	{
X	  redraw = FALSE;
X	  if (get_item(&item_val, "Use which staff?", &redraw, j, k))
X	    {
X	      i_ptr = &inventory[item_val];
X	      if (redraw)  draw_cave();
X	      reset_flag = FALSE;
X	      m_ptr = &py.misc;
X	      chance = m_ptr->save + m_ptr->lev + int_adj() - i_ptr->level - 5;
X	      if (py.flags.confused > 0)
X		chance = chance / 2.0;
X	      if (chance <= 0)  chance = 1;
X	      if (randint(chance) < USE_DEVICE)
X		msg_print("You failed to use the staff properly.");
X	      else if (i_ptr->p1 > 0)
X		{
X		  i = i_ptr->flags;
X		  ident = FALSE;
X		  (i_ptr->p1)--;
X		  while (i != 0)
X		    {
X		      j = bit_pos(&i) + 1;
X		      /* Staffs...				*/
X		      switch(j)
X			{
X			case 1:
X			  ident = light_area(char_row, char_col);
X			  break;
X			case 2:
X			  ident = detect_sdoor();
X			  break;
X			case 3:
X			  ident = detect_trap();
X			  break;
X			case 4:
X			  ident = detect_treasure();
X			  break;
X			case 5:
X			  ident = detect_object();
X			  break;
X			case 6:
X			  teleport(100);
X			  ident = TRUE;
X			  break;
X			case 7:
X			  ident = earthquake();
X			  break;
X			case 8:
X			  ident = FALSE;
X			  for (k = 0; k < randint(4); k++)
X			    {
X			      y = char_row;
X			      x = char_col;
X			      ident |= summon_monster(&y, &x, FALSE);
X			    }
X			  break;
X			case 9:
X			  ident = genocide();
X			  break;
X			case 10:
X			  ident = destroy_area(char_row, char_col);
X			  break;
X			case 11:
X			  ident = starlite(char_row, char_col);
X			  break;
X			case 12:
X			  ident = speed_monsters(1);
X			  break;
X			case 13:
X			  ident = speed_monsters(-1);
X			  break;
X			case 14:
X			  ident = sleep_monsters2();
X			  break;
X			case 15:
X			  ident = hp_player(randint(8), "a staff.");
X			  break;
X			case 16:
X			  ident = detect_invisible();
X			  break;
X			case 17:
X			  py.flags.fast += randint(30) + 15;
X			  ident = TRUE;
X			  break;
X			case 18:
X			  py.flags.slow += randint(30) + 15;
X			  ident = TRUE;
X			  break;
X			case 19:
X			  ident = mass_poly();
X			  break;
X			case 20:
X			  if (remove_curse())
X			    {
X			      msg_print("The staff glows blue for a moment..");
X			      ident = TRUE;
X			    }
X			  break;
X			case 21:
X			  ident = detect_evil();
X			  break;
X			case 22:
X			  if ((cure_blindness()) || (cure_poison()) ||
X			      (cure_confusion()))
X			    ident = TRUE;
X			  break;
X			case 23:
X			  ident = dispell_creature(0x0004, 60);
X			  break;
X			case 24:
X			  ident = mass_genocide();
X			  break;
X			case 25:
X			  ident = unlight_area(char_row, char_col);
X			  break;
X			default:
X			  break;
X			}
X		      /* End of staff actions...		*/
X		    }
X		  if (ident)
X		    identify(inventory[item_val]);
X		  if (i_ptr->flags != 0)
X		    {
X		      m_ptr = &py.misc;
X		      m_ptr->exp += ((i_ptr->level/m_ptr->lev) + 0.5);
X		      prt_experience();
X		    }
X		  desc_charges(item_val);
X		}
X	      else
X		msg_print("The staff has no charges left.");
X	    }
X	  else
X	    if (redraw)  draw_cave();
X	}
X      else
X	msg_print("You are not carrying any staffs.");
X    }
X  else
X    msg_print("But you are not carrying anything.");
X}
END_OF_FILE
if test 3384 -ne `wc -c <'staffs.c'`; then
    echo shar: \"'staffs.c'\" unpacked with wrong size!
fi
# end of 'staffs.c'
fi
echo shar: End of archive 17 \(of 18\).
cp /dev/null ark17isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 18 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0