[comp.sources.games] v10i066: nethack3p9 - display oriented dungeons & dragons

billr@saab.CNA.TEK.COM (Bill Randle) (07/12/90)

Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
Posting-number: Volume 10, Issue 66
Archive-name: nethack3p9/Part21
Supersedes: NetHack3: Volume 7, Issue 56-93



#! /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 21 (of 56)."
# Contents:  src/cmd.c src/objects.c
# Wrapped by billr@saab on Wed Jul 11 17:11:21 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'src/cmd.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/cmd.c'\"
else
echo shar: Extracting \"'src/cmd.c'\" \(21843 characters\)
sed "s/^X//" >'src/cmd.c' <<'END_OF_FILE'
X/*	SCCS Id: @(#)cmd.c	3.0	89/11/15
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* NetHack may be freely redistributed.  See license for details. */
X
X#include	"hack.h"
X#include	"func_tab.h"
X
X#ifdef DUMB	/* stuff commented out in extern.h, but needed here */
Xextern int NDECL(doapply); /**/
Xextern int NDECL(dorub); /**/
Xextern int NDECL(dojump); /**/
Xextern int NDECL(doextlist); /**/
Xextern int NDECL(dodrop); /**/
Xextern int NDECL(doddrop); /**/
Xextern int NDECL(dodown); /**/
Xextern int NDECL(doup); /**/
Xextern int NDECL(donull); /**/
Xextern int NDECL(dowipe); /**/
Xextern int NDECL(do_mname); /**/
Xextern int NDECL(ddocall); /**/
Xextern int NDECL(dotakeoff); /**/
Xextern int NDECL(doremring); /**/
Xextern int NDECL(dowear); /**/
Xextern int NDECL(doputon); /**/
Xextern int NDECL(doddoremarm); /**/
Xextern int NDECL(dokick); /**/
Xextern int NDECL(dothrow); /**/
Xextern int NDECL(doeat); /**/
Xextern int NDECL(done2); /**/
Xextern int NDECL(doengrave); /**/
Xextern int NDECL(dopickup); /**/
Xextern int NDECL(ddoinv); /**/
Xextern int NDECL(dotypeinv); /**/
Xextern int NDECL(dolook); /**/
Xextern int NDECL(doprgold); /**/
Xextern int NDECL(doprwep); /**/
Xextern int NDECL(doprarm); /**/
Xextern int NDECL(doprring); /**/
Xextern int NDECL(dopramulet); /**/
Xextern int NDECL(doprtool); /**/
Xextern int NDECL(dosuspend); /**/
Xextern int NDECL(doforce); /**/
Xextern int NDECL(doopen); /**/
Xextern int NDECL(doclose); /**/
Xextern int NDECL(dosh); /**/
Xextern int NDECL(dodiscovered); /**/
Xextern int NDECL(doset); /**/
Xextern int NDECL(dotogglepickup); /**/
Xextern int NDECL(dowhatis); /**/
Xextern int NDECL(dowhatdoes); /**/
Xextern int NDECL(dohelp); /**/
Xextern int NDECL(dohistory); /**/
Xextern int NDECL(doloot); /**/
Xextern int NDECL(dodrink); /**/
Xextern int NDECL(dodip); /**/
Xextern int NDECL(dosacrifice); /**/
Xextern int NDECL(dopray); /**/
Xextern int NDECL(doturn); /**/
Xextern int NDECL(doredraw); /**/
Xextern int NDECL(doread); /**/
Xextern int NDECL(dosave); /**/
Xextern int NDECL(dosave0); /**/
Xextern int NDECL(dosearch); /**/
Xextern int FDECL(dosearch0, (int)); /**/
Xextern int NDECL(doidtrap); /**/
Xextern int NDECL(dopay); /**/
Xextern int NDECL(dosit); /**/
Xextern int NDECL(dotalk); /**/
Xextern int NDECL(docast); /**/
Xextern int NDECL(dovspell); /**/
Xextern int NDECL(doredotopl); /**/
Xextern int NDECL(dotele); /**/
Xextern int NDECL(dountrap); /**/
Xextern int NDECL(doversion); /**/
Xextern int NDECL(doextversion); /**/
Xextern int NDECL(dowield); /**/
Xextern int NDECL(dozap); /**/
X#endif /* DUMB */
X
X#ifdef OVL1
X
Xstatic int NDECL((*timed_occ_fn));
X
X#endif /* OVL1 */
X
XSTATIC_PTR int NDECL(timed_occupation);
XSTATIC_PTR int NDECL(doextcmd);
X# ifdef POLYSELF
XSTATIC_PTR int NDECL(domonability);
X# endif
X# ifdef WIZARD
XSTATIC_PTR int NDECL(wiz_wish);
XSTATIC_PTR int NDECL(wiz_identify);
XSTATIC_PTR int NDECL(wiz_map);
XSTATIC_PTR int NDECL(wiz_genesis);
XSTATIC_PTR int NDECL(wiz_where);
XSTATIC_PTR int NDECL(wiz_detect);
XSTATIC_PTR int NDECL(wiz_level_tele);
X# endif
X# ifdef EXPLORE_MODE
XSTATIC_PTR int NDECL(enter_explore_mode);
X# endif
X# if defined(WIZARD) || defined(EXPLORE_MODE)
XSTATIC_PTR int NDECL(wiz_attributes);
X# endif
X
X#ifdef STUPID_CPP
Xstatic char FDECL(unctrl, (CHAR_P));
Xstatic char FDECL(unmeta, (CHAR_P));
X#endif
X
X#ifdef OVL1
X
X/* Count down by decrementing multi */
XSTATIC_PTR int
Xtimed_occupation() {
X	(*timed_occ_fn)();
X	if (multi > 0)
X		multi--;
X	return multi > 0;
X}
X
X/* If you have moved since initially setting some occupations, they
X * now shouldn't be able to restart.
X *
X * The basic rule is that if you are carrying it, you can continue
X * since it is with you.  If you are acting on something at a distance,
X * your orientation to it must have changed when you moved.
X *
X * The exception to this is taking off items, since they can be taken
X * off in a number of ways in the intervening time, screwing up ordering.
X *
X *	Currently:	Take off all armor.
X *			Picking Locks / Forcing Chests.
X */
Xvoid
Xreset_occupations() {
X
X	reset_remarm();
X	reset_pick();
X}
X
X/* If a time is given, use it to timeout this function, otherwise the
X * function times out by its own means.
X */
Xvoid
Xset_occupation(fn, txt, xtime)
Xint NDECL((*fn));
Xconst char *txt;
Xint xtime;
X{
X	if (xtime) {
X		occupation = timed_occupation;
X		timed_occ_fn = fn;
X	} else
X		occupation = fn;
X	occtxt = txt;
X	occtime = 0;
X	return;
X}
X
X#ifdef REDO
X
Xstatic char NDECL(popch);
X
X/* Provide a means to redo the last command.  The flag `in_doagain' is set
X * to true while redoing the command.  This flag is tested in commands that
X * require additional input (like `throw' which requires a thing and a
X * direction), and the input prompt is not shown.  Also, while in_doagain is
X * TRUE, no keystrokes can be saved into the saveq.
X */
X#define BSIZE 20
Xstatic char pushq[BSIZE], saveq[BSIZE];
Xstatic int NEARDATA phead, NEARDATA ptail, NEARDATA shead, NEARDATA stail;
X
Xstatic char
Xpopch() {
X	/* If occupied, return 0, letting tgetch know a character should
X	 * be read from the keyboard.  If the character read is not the
X	 * ABORT character (as checked in pcmain.c), that character will be
X	 * pushed back on the pushq.
X	 */
X	if (occupation) return 0;
X	if (in_doagain) return (shead != stail) ? saveq[stail++] : 0;
X	else		return (phead != ptail) ? pushq[ptail++] : 0;
X}
X
Xchar
Xpgetchar() {		/* curtesy of aeb@cwi.nl */
X	register int ch;
X
X	if(!(ch = popch()))
X		ch = tgetch();
X	return(ch);
X}
X
X/* A ch == 0 resets the pushq */
Xvoid
Xpushch(ch)
Xchar ch;
X{
X	if (!ch)
X		phead = ptail = 0;
X	if (phead < BSIZE)
X		pushq[phead++] = ch;
X	return;
X}
X
X/* A ch == 0 resets the saveq.	Only save keystrokes when not
X * replaying a previous command.
X */
Xvoid
Xsavech(ch)
Xchar ch;
X{
X	if (!in_doagain) {
X		if (!ch)
X			phead = ptail = shead = stail = 0;
X		else if (shead < BSIZE)
X			saveq[shead++] = ch;
X	}
X	return;
X}
X#endif /* REDO */
X
X#endif /* OVL1 */
X#ifdef OVLB
X
XSTATIC_PTR int
Xdoextcmd()	/* here after # - now read a full-word command */
X{
X	char buf[BUFSZ];
X	register const struct ext_func_tab *efp = extcmdlist;
Xagain:
X	pline("# ");
X#ifdef COM_COMPL
X	get_ext_cmd(buf);
X#else
X	getlin(buf);
X#endif
X	clrlin();
X	if(buf[0] == '\0' || buf[0] == '\033')
X		return 0;
X	if(buf[0] == '?') {
X		(void) doextlist();
X		goto again;
X	}
X	while(efp->ef_txt) {
X		if(!strcmp(efp->ef_txt, buf))
X			return (*(efp->ef_funct))();
X		efp++;
X	}
X	pline("%s: unknown extended command.", buf);
X	return 0;
X}
X
Xint
Xdoextlist()	/* here after #? - now list all full-word commands */
X{
X	register const struct ext_func_tab *efp = extcmdlist;
X	char	 buf[BUFSZ];
X
X	set_pager(0);
X	if(page_line("") ||
X	   page_line("            Extended Commands List") ||
X	   page_line("") ||
X	   page_line("    Press '#', then type (first letter only):") ||
X	   page_line(""))                                        goto quit;
X
X	while(efp->ef_txt) {
X
X		Sprintf(buf, "    %-8s  - %s.", efp->ef_txt, efp->ef_desc);
X		if(page_line(buf)) goto quit;
X		efp++;
X	}
X	set_pager(1);
X	return 0;
Xquit:
X	set_pager(2);
X	return 0;
X}
X
X#ifdef POLYSELF
XSTATIC_PTR int
Xdomonability()
X{
X	if (can_breathe(uasmon)) return dobreathe();
X	else if (attacktype(uasmon, AT_SPIT)) return dospit();
X	else if (u.usym == S_NYMPH) return doremove();
X	else if (u.usym == S_UMBER) return doconfuse();
X	else if (is_were(uasmon)) return dosummon();
X	else if (webmaker(uasmon)) return dospinweb();
X	else if (is_hider(uasmon)) return dohide();
X	else if (u.usym == S_UNICORN) return use_unicorn_horn((struct obj *)0);
X	else if (u.umonnum >= 0)
X		pline("Any special ability you may have is purely reflexive.");
X	else You("don't have a special ability!");
X	return 0;
X}
X#endif
X
X#ifdef EXPLORE_MODE
XSTATIC_PTR int
Xenter_explore_mode()
X{
X	if(!discover && !wizard) {
X		pline("Beware!  From discovery mode there will be no return to normal game.");
X		more();
X#ifndef MACOS
X		pline("Do you want to enter discovery mode? ");
X	 	if(yn() == 'y') {
X#else
X		if(!flags.silent) SysBeep(1);
X		if(UseMacAlertText(128, "Enter discovery mode ?") == 1) {
X#endif
X			clrlin();
X			pline("You are now in non-scoring discovery mode.");
X			discover = TRUE;
X		}
X		else {
X			clrlin();
X			pline("Resuming normal game.");
X		}
X	}
X	return 0;
X}
X#endif
X
X#ifdef WIZARD
XSTATIC_PTR int
Xwiz_wish()	/* Unlimited wishes for wizard mode by Paul Polderman */
X{
X	if (wizard)	makewish();
X	else		pline("Unavailable command '^W'.");
X	return 0;
X}
X
XSTATIC_PTR int
Xwiz_identify()
X{
X	struct obj *obj;
X
X	if (!wizard)
X		pline("Unavailable command '^I'.");
X	else {
X		for (obj = invent; obj; obj = obj->nobj)
X			if (!objects[obj->otyp].oc_name_known || !obj->known
X						|| !obj->dknown || !obj->bknown)
X				(void) identify(obj);
X	}
X	return 0;
X}
X
XSTATIC_PTR int
Xwiz_map()
X{
X	if (wizard)	do_mapping();
X	else		pline("Unavailable command '^F'.");
X	return 0;
X}
X
XSTATIC_PTR int
Xwiz_genesis()
X{
X	if (wizard)	(void) create_particular();
X	else		pline("Unavailable command '^G'.");
X	return 0;
X}
X
XSTATIC_PTR int
Xwiz_where()
X{
X	if (wizard) {
X		pline("Medusa:%d  Wiz:%d  Big:%d", medusa_level, wiz_level, bigroom_level);
X#ifdef STRONGHOLD
X#  ifdef MUSIC
X		pline("Castle:%d (tune %s)  Tower:%d-%d",
X		      stronghold_level, tune, tower_level, tower_level+2);
X#  else
X		pline("Castle:%d  Tower:%d-%d",
X		      stronghold_level, tower_level, tower_level+2);
X#  endif
X#endif
X#ifdef REINCARNATION
X		pline("Rogue:%d", rogue_level);
X#endif
X#ifdef ORACLE
X		pline("Oracle:%d", oracle_level);
X#endif
X	}
X	else	pline("Unavailable command '^O'.");
X	return 0;
X}
X
XSTATIC_PTR int
Xwiz_detect()
X{
X	if(wizard)  (void) findit();
X	else	    pline("Unavailable command '^E'.");
X	return 0;
X}
X
XSTATIC_PTR int
Xwiz_level_tele()
X{
X	if (wizard)	level_tele();
X	else		pline("Unavailable command '^V'.");
X	return 0;
X}
X
X#endif /* WIZARD */
X
Xvoid
Xenlightenment() {
X	char buf[BUFSZ];
X
X	cornline(0, "Current Attributes:");
X
X	if (u.ualign == 0) cornline(1, "You are nominally aligned.");
X	else if (u.ualign > 3) cornline(1, "You are stridently aligned.");
X	else if (u.ualign > 0) cornline(1, "You are haltingly aligned.");
X	else cornline(1, "You have strayed.");
X#ifdef WIZARD
X	if (wizard) {
X		Sprintf(buf, "Your alignment is %d.", u.ualign);
X		cornline(1, buf);
X	}
X#endif
X
X	if (Adornment) cornline(1, "You are adorned.");
X	if (Teleportation) cornline(1, "You can teleport.");
X	if (Regeneration) cornline(1, "You regenerate.");
X	if (Searching) cornline(1, "You have automatic searching.");
X	if (See_invisible) cornline(1, "You see invisible.");
X	if (Stealth) cornline(1, "You are stealthy.");
X	if (Levitation) cornline(1, "You are levitating.");
X	if (Hunger) cornline(1, "You have hunger.");
X	if (Aggravate_monster) cornline(1, "You aggravate monsters.");
X	if (Poison_resistance) cornline(1, "You are poison resistant.");
X	if (Fire_resistance) cornline(1, "You are fire resistant.");
X	if (Cold_resistance) cornline(1, "You are cold resistant.");
X	if (Shock_resistance) cornline(1, "You are shock resistant.");
X	if (Sleep_resistance) cornline(1, "You are sleep resistant.");
X	if (Disint_resistance) cornline(1, "You are disintegration-resistant.");
X	if (Protection_from_shape_changers)
X		cornline(1, "You are protected from shape changers.");
X	if (Conflict) cornline(1, "You cause conflict.");
X	if (Protection) cornline(1, "You are protected.");
X	if (Warning) cornline(1, "You are warned.");
X	if (Teleport_control) cornline(1, "You have teleport control.");
X#ifdef POLYSELF
X	if (Polymorph) cornline(1, "You are polymorphing.");
X	if (Polymorph_control) cornline(1, "You have polymorph control.");
X#endif
X	if (Telepat) cornline(1, "You are telepathic.");
X	if (Fast) cornline(1, "You are fast.");
X	/* if (Stunned) cornline(1, "You are stunned."); */
X	/* if (Confusion) cornline(1, "You are confused."); */
X	/* if (Sick) cornline(1, "You are sick."); */
X	/* if (Blinded) cornline(1, "You are blinded."); */
X	if (Invisible) cornline(1, "You are invisible.");
X	else if (Invis) cornline(1, "You are invisible to others.");
X	if (Wounded_legs) {
X		Sprintf(buf, "You have wounded %s.",
X						makeplural(body_part(LEG)));
X		cornline(1, buf);
X	}
X	if (Stoned) cornline(1, "You are turning to stone.");
X	/* if (Hallucination) cornline(1, "You are hallucinating."); */
X	if (Glib) {
X		Sprintf(buf, "You have slippery %s.",
X						makeplural(body_part(FINGER)));
X		cornline(1, buf);
X	}
X	if (Reflecting) cornline(1, "You have reflection.");
X	if (Strangled) cornline(1, "You are being strangled.");
X	if (Lifesaved) cornline(1, "Your life will be saved.");
X	if (Fumbling) cornline(1, "You fumble.");
X	if (Jumping) cornline(1, "You can jump.");
X	if (Wwalking) cornline(1, "You can walk on water.");
X	if (Antimagic) cornline(1, "You are magic-protected.");
X	if (Displaced) cornline(1, "You are displaced.");
X	if (Clairvoyant) cornline(1, "You are clairvoyant.");
X	if (stone_luck(TRUE) > 0) cornline(1, "You have extra luck.");
X	if (stone_luck(TRUE) < 0) cornline(1, "You have reduced luck.");
X	if (carrying(LUCKSTONE)) {
X		if (stone_luck(FALSE) <= 0)
X			cornline(1, "Bad luck does not time out for you.");
X		if (stone_luck(FALSE) >= 0)
X			cornline(1, "Good luck does not time out for you.");
X	}
X#ifdef WIZARD
X	if (wizard) {
X		Sprintf(buf, "Your luck is %d.", Luck);
X		cornline(1, buf);
X	}
X#endif
X
X	cornline(2, "");
X	return;
X}
X
X#if defined(WIZARD) || defined(EXPLORE_MODE)
XSTATIC_PTR int
Xwiz_attributes()
X{
X	if (wizard || discover)
X		enlightenment();
X	else
X		pline("Unavailable command '^X'.");
X	return 0;
X}
X#endif /* WIZARD || EXPLORE_MODE */
X
X#endif /* OVLB */
X#ifdef OVL1
X
X#ifndef M
X#define M(c)		(0x80 | (c))
X#endif
X#ifndef C
X#define C(c)		(0x1f & (c))
X#endif
Xconst struct func_tab cmdlist[]={
X	{C('d'), dokick},	/* "D" is for door!...? */
X#ifdef WIZARD
X	{C('e'), wiz_detect},
X	{C('f'), wiz_map},
X	{C('g'), wiz_genesis},
X	{C('i'), wiz_identify},
X	{C('o'), wiz_where},
X#endif
X	{C('p'), doredotopl},
X	{C('r'), doredraw},
X	{C('t'), dotele},
X#ifdef WIZARD
X	{C('v'), wiz_level_tele},
X	{C('w'), wiz_wish},
X#endif
X#if defined(WIZARD) || defined(EXPLORE_MODE)
X	{C('x'), wiz_attributes},
X#endif
X#ifdef SUSPEND
X	{C('z'), dosuspend},
X#endif
X	{'a', doapply},
X	{'A', doddoremarm},
X/*	'b', 'B' : go sw */
X	{'c', doclose},
X	{'C', do_mname},
X	{M('c'), dotalk},
X	{'d', dodrop},
X	{'D', doddrop},
X	{M('d'), dodip},
X	{'e', doeat},
X	{'E', doengrave},
X/* Soon to be
X	{'f', dofight, "fighting"},
X	{'F', doFight, "fighting"},
X */
X	{M('f'), doforce},
X/*	'g', 'G' : multiple go */
X/*	'h', 'H' : go west */
X	{'h', dohelp}, /* if number_pad is set */
X	{'i', ddoinv},
X	{'I', dotypeinv},		/* Robert Viduya */
X/*	'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N' : move commands */
X	{'j', dojump}, /* if number_pad is on */
X	{M('j'), dojump},
X	{'k', dokick}, /* if number_pad is on */
X	{'l', doloot}, /* if number_pad is on */
X	{M('l'), doloot},
X/*	'n' prefixes a count if number_pad is on */
X#ifdef POLYSELF
X	{M('m'), domonability},
X#endif /* POLYSELF */
X	{'N', ddocall}, /* if number_pad is on */
X	{M('N'), ddocall},
X	{'o', doopen},
X	{'O', doset},
X#ifdef THEOLOGY
X	{M('o'), dosacrifice},
X#endif /* THEOLOGY */
X	{'p', dopay},
X	{'P', doputon},
X#ifdef THEOLOGY
X	{M('p'), dopray},
X#endif /* THEOLOGY */
X	{'q', dodrink},
X	{'Q', done2},
X	{'r', doread},
X	{'R', doremring},
X	{M('r'), dorub},
X	{'s', dosearch, "searching"},
X	{'S', dosave},
X	{M('s'), dosit},
X	{'t', dothrow},
X	{'T', dotakeoff},
X	{M('t'), doturn},
X/*	'u', 'U' : go ne */
X	{'u', dountrap}, /* if number_pad is on */
X	{M('u'), dountrap},
X	{'v', doversion},
X	{'V', dohistory},
X	{M('v'), doextversion},
X	{'w', dowield},
X	{'W', dowear},
X	{M('w'), dowipe},
X#ifdef SPELLS
X	{'x', dovspell},			/* Mike Stephenson */
X#endif
X#ifdef EXPLORE_MODE
X	{'X', enter_explore_mode},
X#endif
X/*	'y', 'Y' : go nw */
X	{'z', dozap},
X#ifdef SPELLS
X	{'Z', docast},
X#endif
X	{'<', doup},
X	{'>', dodown},
X	{'/', dowhatis},
X	{'&', dowhatdoes},
X	{'?', dohelp},
X#ifdef SHELL
X	{'!', dosh},
X#endif
X	{'.', donull, "waiting"},
X	{' ', donull, "waiting"},
X	{',', dopickup},
X	{':', dolook},
X	{'^', doidtrap},
X	{'\\', dodiscovered},		/* Robert Viduya */
X	{'@', dotogglepickup},
X	{WEAPON_SYM,  doprwep},
X	{ARMOR_SYM,  doprarm},
X	{RING_SYM,  doprring},
X	{AMULET_SYM, dopramulet},
X	{TOOL_SYM, doprtool},
X	{GOLD_SYM, doprgold},
X#ifdef SPELLS
X	{SPBOOK_SYM, dovspell},			/* Mike Stephenson */
X#endif
X	{'#', doextcmd},
X	{0,0,0}
X};
X#undef M
X
Xconst struct ext_func_tab extcmdlist[] = {
X	"chat", "talk to someone", dotalk,	/* converse? */
X	"dip", "dip an object into something", dodip,
X	"force", "force a lock", doforce,
X	"jump", "jump to a location", dojump,
X	"loot", "loot a box on the floor", doloot,
X#ifdef POLYSELF
X	"monster", "use a monster's special ability", domonability,
X#endif
X	"name", "name an item or type of object", ddocall,
X#ifdef THEOLOGY
X	"offer", "offer a sacrifice to the gods", dosacrifice,
X	"pray", "pray to the gods for help", dopray,
X#endif
X	"rub", "rub a lamp", dorub,
X	"sit", "sit down", dosit,
X	"turn", "turn undead", doturn,
X	"untrap", "untrap something", dountrap,
X	"version", "print compile time options for this version of NetHack",
X		doextversion,
X	"wipe", "wipe off your face", dowipe,
X	"?", "get this list of extended commands", doextlist,
X	NULL, NULL, donull
X};
X
X#ifdef STUPID_CPP
Xstatic char
Xunctrl(sym)
Xchar sym;
X{
X	return (sym >= C('a') && sym <= C('z')) ? sym + 0140 : sym;
X}
X
Xstatic char
Xunmeta(sym)
Xchar sym;
X{
X	return (sym & 0x7f);
X}
X#else
X#define unctrl(c)	((c) <= C('z') ? (0x60 | (c)) : (c))
X#define unmeta(c)	(0x7f & (c))
X#endif
X
X
Xvoid
Xrhack(cmd)
Xregister char *cmd;
X{
X	register const struct func_tab *tlist = cmdlist;
X	boolean firsttime = FALSE;
X	register int res;
X
X	if(!cmd) {
X		firsttime = TRUE;
X		flags.nopick = 0;
X		cmd = parse();
X	}
X	if(*cmd == (char)033) {
X		flags.move = 0;
X		return;
X	}
X#ifdef REDO
X	if (*cmd == DOAGAIN && !in_doagain && saveq[0]) {
X		in_doagain = TRUE;
X		stail = 0;
X		rhack(NULL);	/* read and execute command */
X		in_doagain = FALSE;
X		return;
X	}
X	/* Special case of *cmd == ' ' handled better below */
X	if(!*cmd || *cmd == (char)0377) {
X#else
X	if(!*cmd || *cmd == (char)0377 || (flags.no_rest_on_space && *cmd == ' ')){
X#endif
X		bell();
X		flags.move = 0;
X		return;		/* probably we just had an interrupt */
X	}
X	if(movecmd(*cmd)) {
X	walk:
X		if(multi) flags.mv = 1;
X		domove();
X		return;
X	}
X	if(movecmd(flags.num_pad ? unmeta(*cmd) : lowc(*cmd))) {
X		flags.run = 1;
X	rush:
X		if(firsttime){
X			if(!multi) multi = COLNO;
X			u.last_str_turn = 0;
X		}
X		flags.mv = 1;
X		domove();
X		return;
X	}
X	if(*cmd == 'g' && movecmd(cmd[1])) {
X		flags.run = 2;
X		goto rush;
X	}
X	if(((*cmd == 'G' || (flags.num_pad && *cmd == '5')) && 
X	    movecmd(lowc(cmd[1]))) || movecmd(unctrl(*cmd))) {
X		flags.run = 3;
X		goto rush;
X	}
X	if((*cmd == 'm' || (flags.num_pad & *cmd == '-')) &&
X	    movecmd(cmd[1])) {
X		flags.run = 0;
X		flags.nopick = 1;
X		goto walk;
X	}
X	if(*cmd == 'M' && movecmd(lowc(cmd[1]))) {
X		flags.run = 1;
X		flags.nopick = 1;
X		goto rush;
X	}
X	if(flags.num_pad && *cmd == '0') {
X	        (void)ddoinv();	/* A convenience borrowed from the PC */
X		flags.move = 0;
X		multi = 0;
X		return;
X	}
X	while(tlist->f_char) {
X		if((*cmd & 0xff) == (tlist->f_char & 0xff)){
X			/* Special case of *cmd == ' ' handled here */
X			if (*cmd == ' ' && flags.no_rest_on_space)
X				break;
X
X			/* Now control-A can stop lengthy commands */
X			/* in the PC version only -- use ^C-N otherwise */
X			if (tlist->f_text && !occupation && multi)
X#ifdef __GNULINT__
X				set_occupation(tlist->f_funct,
X						tlist->f_text, multi);
X#else
X				set_occupation(((struct func_tab *)tlist)->f_funct,
X					tlist->f_text, multi);
X#endif
X			res = (*(tlist->f_funct))();
X			if(!res) {
X				flags.move = 0;
X				multi = 0;
X			}
X			return;
X		}
X		tlist++;
X	}
X	{ char expcmd[10];
X	  register char *cp = expcmd;
X	  while(*cmd && cp-expcmd < sizeof(expcmd)-2) {
X		if(*cmd >= 040 && *cmd < 0177)
X			*cp++ = *cmd++;
X		else if (*cmd & 0200) {
X			*cp++ = 'M';
X			*cp++ = '-';
X			*cp++ = *cmd++ &=~ 0200;
X		}
X		else {
X			*cp++ = '^';
X			*cp++ = *cmd++ ^ 0100;
X		}
X	  }
X	  *cp++ = 0;
X	  pline("Unknown command '%s'.", expcmd);
X	}
X	multi = flags.move = 0;
X	return;
X}
X
Xchar
Xlowc(sym)
Xchar sym;
X{
X    return (sym >= 'A' && sym <= 'Z') ? sym+'a'-'A' : sym;
X}
X
X/* 'rogue'-like direction commands */
Xconst char NEARDATA sdir[] = "hykulnjb><";
Xconst char NEARDATA ndir[] = "47896321><";
Xconst schar NEARDATA xdir[10] = { -1,-1, 0, 1, 1, 1, 0,-1, 0, 0 };
Xconst schar NEARDATA ydir[10] = {  0,-1,-1,-1, 0, 1, 1, 1, 0, 0 };
Xconst schar zdir[10] = {  0, 0, 0, 0, 0, 0, 0, 0, 1,-1 };
X
X#ifdef WALKIES
Xint
Xxytod(x, y)	/* convert an x,y pair into a direction code */
Xschar x, y;
X{
X	register int dd;
X
X	for(dd = 0; dd < 8; dd++)
X	    if(x == xdir[dd] && y == ydir[dd]) return dd;
X
X	return -1;
X}
X
Xvoid
Xdtoxy(cc,dd)	/* convert a direction code into an x,y pair */
Xcoord *cc;
Xregister int dd;
X{
X	cc->x = xdir[dd];
X	cc->y = ydir[dd];
X	return;
X}
X#endif /* WALKIES */
X
Xint
Xmovecmd(sym)	/* also sets u.dz, but returns false for <> */
Xchar sym;
X{
X	register const char *dp;
X	register const char *sdp = flags.num_pad ? ndir : sdir;
X
X	u.dz = 0;
X	if(!(dp = index(sdp, sym))) return 0;
X	u.dx = xdir[dp-sdp];
X	u.dy = ydir[dp-sdp];
X	u.dz = zdir[dp-sdp];
X#ifdef POLYSELF
X	if (u.dx && u.dy && u.umonnum == PM_GRID_BUG) {
X		u.dx = u.dy = 0;
X		return 0;
X	}
X#endif
X	return !u.dz;
X}
X
Xint
Xgetdir(s)
Xboolean s;
X{
X	char dirsym;
X
X#ifdef REDO
X	if (!in_doagain)
X#endif
X	    if(s) pline("In what direction? ");
X	dirsym = readchar();
X#ifdef REDO
X	savech(dirsym);
X#endif
X	if(dirsym == '.' || dirsym == 's')
X		u.dx = u.dy = u.dz = 0;
X	else if(!movecmd(dirsym) && !u.dz) {
X		if(!index(quitchars, dirsym))
X			pline("What a strange direction!");
X		return 0;
X	}
X	if(!u.dz && (Stunned || (Confusion && !rn2(5)))) confdir();
X	return 1;
X}
X
X#endif /* OVL1 */
X#ifdef OVLB
X
Xvoid
Xconfdir()
X{
X	register int x = 
X#ifdef POLYSELF
X		(u.umonnum == PM_GRID_BUG) ? 2*rn2(4) :
X#endif
X							rn2(8);
X	u.dx = xdir[x];
X	u.dy = ydir[x];
X	return;
X}
X
X#endif /* OVLB */
X#ifdef OVL0
X
Xint
Xisok(x,y)
Xregister int x, y;
X{
X	/* x corresponds to curx, so x==1 is the first column. Ach. %% */
X	return x >= 1 && x <= COLNO-1 && y >= 0 && y <= ROWNO-1;
X}
X
X#endif /* OVL0 */
END_OF_FILE
if test 21843 -ne `wc -c <'src/cmd.c'`; then
    echo shar: \"'src/cmd.c'\" unpacked with wrong size!
fi
# end of 'src/cmd.c'
fi
if test -f 'src/objects.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/objects.c'\"
else
echo shar: Extracting \"'src/objects.c'\" \(33564 characters\)
sed "s/^X//" >'src/objects.c' <<'END_OF_FILE'
X/*	SCCS Id: @(#)objects.c	3.0	89/04/14
X/* NetHack may be freely redistributed.  See license for details. */
X/* Copyright (c) Mike Threepoint, 1989 (890110) */
X
X#include "config.h"
X#include "obj.h"
X#include "objclass.h"
X#include "prop.h"
X
X/* objects have letter " % ) ( 0 _ ` [ ! ? / = * + . */
X
X#ifdef C
X#undef C
X#endif
X#ifdef TEXTCOLOR
X#include "color.h"
X#define C(n)	n
X#else
X#define C(n)
X#endif
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
Xstruct objclass *objects;
Xstruct small_objclass sm_obj[] = {
X#else
Xstruct objclass NEARDATA objects[] = {
X#endif
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X	{ "strange object", NULL},
X#else
X	{ "strange object", NULL, NULL, 1,0,0,0,0, 0,
X		ILLOBJ_SYM, 0, 0, 0, 0, 0, 0, 0, C(0) },
X#endif
X/* amulets ... - THE Amulet comes last because it is special */
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define AMULET(name,desc,power,prob,weight) { \
X	name, desc}
X#else
X#define AMULET(name,desc,power,prob,weight) { \
X	name, desc, NULL, 0,0,0,0,METAL, power, AMULET_SYM, prob, 0, weight, \
X	150, 0, 0, 0, C(HI_METAL) }
X#endif
X
X	AMULET("amulet of esp", 	  "circular",	TELEPAT,    190, 2),
X	AMULET("amulet of life saving",   "spherical",	LIFESAVED,   90, 2),
X	AMULET("amulet of strangulation", "oval",	STRANGLED,  150, 2),
X	AMULET("amulet of restful sleep", "triangular",	SLEEPING,   150, 2),
X	AMULET("amulet versus poison",	  "pyramidal",	POISON_RES, 180, 2),
X	AMULET("amulet of change",	  "square",	0,	    150, 2),
X								/* POLYMORPH */
X	AMULET("amulet of reflection",	  "hexagonal",	REFLECTING,  90, 2),
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X	{ "Amulet of Yendor", NULL},
X#else
X	{ "Amulet of Yendor", NULL, NULL, 1,0,1,0,METAL, 0,
X		AMULET_SYM, 0, 0, 2, 3500, 0, 0, 0, C(HI_METAL) },
X#endif
X#undef AMULET
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define FOOD(name,prob,delay,wt,uk,tin,nutrition,color) { \
X	name, NULL}
X#else
X#define FOOD(name,prob,delay,wt,uk,tin,nutrition,color) { \
X	name, NULL, NULL, 1,1,uk,0,tin, 0, FOOD_SYM, prob, delay, wt, \
X	nutrition/20 + 5, 0, 0, nutrition, C(color) }
X#endif
X
X/* all types of food (except tins & corpses) must have a delay of at least 1. */
X/* delay on corpses is computed and is weight dependant */
X/* dog eats foods 0-4 but prefers tripe rations above all others */
X/* fortune cookies can be read */
X/* carrots improve your vision */
X/* +0 tins contain monster meat */
X/* +1 tins (of spinach) make you stronger (like Popeye) */
X/* food CORPSE is a cadaver of some type */
X
X	/* meat */
X#ifdef TOLKIEN
X	FOOD("tripe ration",	   145, 2, 2, 0, 0, 200, BROWN),
X#else
X	FOOD("tripe ration",	   150, 2, 2, 0, 0, 200, BROWN),
X#endif
X	FOOD("corpse",		     0, 1, 0, 0, 0,   0, BROWN),
X	FOOD("egg",		    85, 1, 1, 1, 0,  80, WHITE),
X	/* fruits & veggies */
X	FOOD("apple",		    15, 1, 1, 0, 0,  50, RED),
X	FOOD("orange",		    10, 1, 1, 0, 0,  80, ORANGE_COLORED),
X	FOOD("pear",		    10, 1, 1, 0, 0,  50, GREEN|BRIGHT),
X	FOOD("melon",		    10, 1, 1, 0, 0, 100, GREEN|BRIGHT),
X	FOOD("banana",		    10, 1, 1, 0, 0,  80, YELLOW),
X	FOOD("carrot",		    15, 1, 1, 0, 0,  50, ORANGE_COLORED),
X	FOOD("clove of garlic",      7, 1, 1, 0, 0,  40, WHITE),
X#ifdef TUTTI_FRUTTI
X	FOOD("slime mold",	    75, 1, 1, 0, 0, 250, BROWN),
X#else
X	FOOD("slice of pizza",	    75, 1, 1, 0, 0, 250, RED),
X#endif
X	/* human food */
X	FOOD("lump of royal jelly",  0, 1, 1, 0, 0, 200, YELLOW),
X	FOOD("cream pie",	    25, 1, 1, 0, 0, 100, WHITE),
X	FOOD("candy bar",	    13, 1, 1, 0, 0, 100, BROWN),
X	FOOD("fortune cookie",	    55, 1, 1, 0, 0,  40, BROWN),
X#ifdef TOLKIEN
X	FOOD("pancake", 	    25, 2, 1, 0, 0, 200, BROWN),
X	FOOD("lembas wafer",	    20, 2, 1, 0, 0, 800, WHITE|BRIGHT),
X	FOOD("cram ration",	    20, 3, 3, 0, 0, 600, HI_ORGANIC),
X	FOOD("food ration",	   385, 5, 4, 0, 0, 800, HI_ORGANIC),
X#else
X	FOOD("pancake", 	    40, 1, 1, 0, 0, 200, BROWN),
X	FOOD("food ration",	   405, 5, 4, 0, 0, 800, HI_ORGANIC),
X#endif
X#ifdef ARMY
X	FOOD("K-ration",	     0, 1, 1, 0, 0, 400, HI_ORGANIC),
X	FOOD("C-ration",	     0, 1, 1, 0, 0, 300, HI_ORGANIC),
X#endif
X	FOOD("tin",		    75, 0, 1, 1, METAL, 0, HI_METAL),
X#undef FOOD
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define WEAPON(name,app,kn,mg,bi,prob,wt,cost,sdam,ldam,metal,color) { \
X	name, app}
X#else
X#define WEAPON(name,app,kn,mg,bi,prob,wt,cost,sdam,ldam,metal,color) { \
X	name, app, NULL, kn,mg,1,bi,metal, 0, WEAPON_SYM, prob, 0, wt, \
X	cost, sdam, ldam, 0, C(color) }
X#endif
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define PROJECTILE(name,app,kn,bi,prob,wt,cost,sdam,ldam,metal,prop,color) { \
X	name, app}
X#else
X#define PROJECTILE(name,app,kn,bi,prob,wt,cost,sdam,ldam,metal,prop,color) { \
X	name, app, NULL, kn,1,1,bi,metal, 0, WEAPON_SYM, prob, 0, wt, \
X	cost, sdam, ldam, prop, C(color) }
X#endif
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define BOW(name,app,kn,bi,prob,wt,cost,sdam,ldam,metal,prop,color) { \
X	name, app}
X#else
X#define BOW(name,app,kn,bi,prob,wt,cost,sdam,ldam,metal,prop,color) { \
X	name, app, NULL, kn,0,1,bi,metal, 0, WEAPON_SYM, prob, 0, wt, \
X	cost, sdam, ldam, -(prop), C(color) }
X#endif
X
X/* Note: for weapons that don't do an even die of damage (ex. 2-7 or 3-18)
X * the extra damage is added on in weapon.c, not here! */
X
X/* missiles */
X#ifdef TOLKIEN
XPROJECTILE("arrow",		NULL,		1, 0, 37, 0,  2, 6, 6,
X		   METAL, WP_BOW, HI_METAL),
XPROJECTILE("elven arrow",	"runed arrow",	0, 0, 10, 0,  2, 7, 6,
X		   METAL, WP_BOW, HI_METAL),
XPROJECTILE("orcish arrow",	"black arrow",	0, 0, 11, 0,  2, 5, 6,
X		   METAL, WP_BOW, BLACK),
X#else
XPROJECTILE("arrow",		NULL,		1, 0, 58, 0,  2, 6, 6,
X		   METAL, WP_BOW, HI_METAL),
X#endif
XPROJECTILE("silver arrow",	NULL,		1, 0,  8, 0,  2, 6, 6,
X		   SILVER, WP_BOW, HI_SILVER),
XPROJECTILE("crossbow bolt",	NULL,		1, 0, 60, 0,  2, 4, 6,
X		   METAL, WP_CROSSBOW, HI_METAL),
X
XWEAPON("dart",		NULL,		1, 1, 0, 60, 0,  2, 3, 2, METAL, HI_METAL),
XWEAPON("shuriken",	"throwing star",0, 1, 0, 30, 0,  5, 8, 6, METAL, HI_METAL),
XWEAPON("boomerang",	NULL,		1, 1, 0, 15, 3, 20, 9, 9, WOOD, HI_WOOD),
X
X/* spears */
X#ifdef TOLKIEN
XWEAPON("spear", 	NULL,		1, 1, 0, 55, 3,  5, 6, 8, METAL, HI_METAL),
XWEAPON("elven spear",	"runed spear",	0, 1, 0, 10, 3,  5, 7, 8, METAL, HI_METAL),
XWEAPON("orcish spear",	"black spear",	0, 1, 0, 13, 3,  5, 5, 8, METAL, BLACK),
XWEAPON("dwarvish spear","shiny spear",	0, 1, 0, 12, 3,  5, 8, 8, METAL, HI_METAL),
X#else
XWEAPON("spear", 	NULL,		1, 1, 0, 90, 3,  5, 6, 8, METAL, HI_METAL),
X#endif
XWEAPON("javelin",	"throwing spear",0,1, 0, 10, 3,  5, 6, 6, METAL, HI_METAL),
XWEAPON("trident",	NULL,		1, 0, 0,  8, 4, 15, 6, 4, METAL, HI_METAL),
X						/* +1 small, +2d4 large */
XWEAPON("lance", 	NULL,		1, 0, 0,  8, 4, 10, 6, 8, METAL, HI_METAL),
X
X/* blades */
X#ifdef TOLKIEN
XWEAPON("dagger",	NULL,		1, 1, 0, 25, 2,  4, 4, 3, METAL, HI_METAL),
XWEAPON("elven dagger",	"large runed knife", 0, 1, 0,  8, 2, 4, 5, 3, METAL, HI_METAL),
XWEAPON("orcish dagger", "large black knife", 0, 1, 0, 10, 2, 4, 3, 3, METAL, BLACK),
X#else
XWEAPON("dagger",	NULL,		1, 1, 0, 43, 2,  4, 4, 3, METAL, HI_METAL),
X#endif
XWEAPON("athame",	NULL,		1, 1, 0,  0, 2,  4, 4, 3, METAL, HI_METAL),
XWEAPON("scalpel",	NULL,		1, 1, 0,  0, 1,  4, 4, 3, METAL, HI_METAL),
XWEAPON("knife", 	NULL,		1, 1, 0, 25, 2,  4, 3, 3, METAL, HI_METAL),
XWEAPON("axe",		NULL,		1, 0, 0, 50, 3,  8, 6, 4, METAL, HI_METAL),
X#ifdef WORM
XWEAPON("worm tooth",	NULL,		1, 0, 0,  0, 3,  2, 2, 2, 0, WHITE),
XWEAPON("crysknife",	NULL,		1, 0, 0,  0, 3,100,10,10, METAL, HI_METAL),
X#endif
X
X/* swords */
X#ifdef TOLKIEN
XWEAPON("short sword",		NULL,	1, 0, 0,  6, 3, 10, 6, 8, METAL, HI_METAL),
XWEAPON("elven short sword",	"short runed sword",
X					0, 0, 0,  2, 3, 10, 8, 8, METAL, HI_METAL),
XWEAPON("orcish short sword",	"short black sword",
X					0, 0, 0,  3, 3, 10, 5, 8, METAL, BLACK),
XWEAPON("dwarvish short sword",	"short shiny sword",
X					0, 0, 0,  2, 3, 10, 7, 8, METAL, HI_METAL),
X#else
XWEAPON("short sword",		NULL,	1, 0, 0, 13, 3, 10, 6, 8, METAL, HI_METAL),
X#endif
XWEAPON("scimitar", "curved sword",	0, 0, 0,  6, 4, 15, 8, 8, METAL, HI_METAL),
X#ifdef TOLKIEN
XWEAPON("broadsword", "wide sword",	0, 0, 0,  8, 4, 10, 4, 6, METAL, HI_METAL),
X						/* +d4 small, +1 large */
XWEAPON("elven broadsword",	"wide runed sword",
X					0, 0, 0,  4, 4, 10, 6, 6, METAL, HI_METAL),
X						/* +d4 small, +1 large */
X#else
XWEAPON("broadsword", "wide sword",	0, 0, 0, 12, 4, 10, 4, 6, METAL, HI_METAL),
X						/* +d4 small, +1 large */
X#endif
XWEAPON("long sword",		NULL,	1, 0, 0, 60, 4, 15, 8, 12, METAL, HI_METAL),
X#ifdef TOLKIEN
XWEAPON("two-handed sword",	NULL,	1, 0, 1, 25, 5, 50,12,	6, METAL, HI_METAL),
X						/* +2d6 large */
XWEAPON("dwarvish mattock",	"huge shiny sword",
X					0, 0, 1, 15, 6, 50,12,	8, METAL, HI_METAL),
X						/* +2d6 large */
X#else
XWEAPON("two-handed sword",	NULL,	1, 0, 1, 40, 5, 50,12,	6, METAL, HI_METAL),
X						/* +2d6 large */
X#endif
XWEAPON("katana", "samurai sword",	0, 0, 0,  6, 4,100,10, 12, METAL, HI_METAL),
X
X/* blunt */
XWEAPON("mace",		NULL,		1, 0, 0, 40, 4,  8, 6, 6, METAL, HI_METAL),
X						/* +1 small */
XWEAPON("morning star",	NULL,		1, 0, 0, 12, 4, 10, 4, 6, METAL, HI_METAL),
X						/* +d4 small, +1 large */
XWEAPON("war hammer",	NULL,		1, 0, 0, 15, 3,  5, 4, 4, METAL, HI_METAL),
X						/* +1 small */
XWEAPON("club",		NULL,		1, 0, 0, 10, 3,  4, 6, 3, WOOD, HI_WOOD),
X#ifdef KOPS
XWEAPON("rubber hose",	NULL,		1, 0, 0,  0, 2,  4, 6, 3, 0, BROWN),
X#endif
XWEAPON("quarterstaff",	"staff",	0, 0, 1, 10, 3,  8, 6, 6, WOOD, HI_WOOD),
X/* two-piece */
XWEAPON("aklys", 	"thonged club", 0, 0, 0,  8, 3,  4, 6, 3, METAL, HI_METAL),
XWEAPON("flail", 	NULL,		1, 0, 0, 40, 3,  4, 6, 4, METAL, HI_METAL),
X						/* +1 small, +1d4 large */
X/* whip */
XWEAPON("bullwhip",	NULL,		1, 0, 0,  5, 2,  4, 2, 1, 0, BROWN),
X
X/* polearms */
X/* spear-type */
XWEAPON("partisan", "vulgar polearm",	0, 0, 1, 10, 3, 10, 6, 6, METAL, HI_METAL),
X						/* +1 large */
XWEAPON("ranseur", "hilted polearm",	0, 0, 1, 10, 3,  6, 4, 4, METAL, HI_METAL),
X						/* +d4 both */
XWEAPON("spetum", "forked polearm",	0, 0, 1, 10, 3,  5, 6, 6, METAL, HI_METAL),
X						/* +1 small, +d6 large */
XWEAPON("glaive", "single-edged polearm", 0, 0, 1, 15, 3, 6, 6,10, METAL, HI_METAL),
X/* axe-type */
XWEAPON("halberd", "angled poleaxe",	0, 0, 1, 16, 3, 10,10, 6, METAL, HI_METAL),
X						/* +1d6 large */
XWEAPON("bardiche", "long poleaxe",	0, 0, 1,  8, 3,  7, 4, 4, METAL, HI_METAL),
X						/* +1d4 small, +2d4 large */
XWEAPON("voulge", "pole cleaver",	0, 0, 1,  8, 3,  5, 4, 4, METAL, HI_METAL),
X						/* +d4 both */
X/* curved/hooked */
XWEAPON("fauchard",	"pole sickle",	0, 0, 1, 11, 3,  5, 6, 8, METAL, HI_METAL),
XWEAPON("guisarme",	"pruning hook", 0, 0, 1, 11, 3,  5, 4, 8, METAL, HI_METAL),
X						/* +1d4 small */
XWEAPON("bill-guisarme","hooked polearm",0, 0, 1,  8, 3,  7, 4,10, METAL, HI_METAL),
X						/* +1d4 small */
X/* other */
XWEAPON("lucern hammer", "pronged polearm", 0, 0, 1, 10, 3,  7, 4, 6, METAL, HI_METAL),
X						/* +1d4 small */
XWEAPON("bec de corbin","beaked polearm",0, 0, 1,  8, 3,  8, 8, 6, METAL, HI_METAL),
X
X/* bows */
X#ifdef TOLKIEN
XBOW("bow",	  NULL, 	1, 0, 24, 3, 120, 30, 6, 0, WP_BOW, HI_WOOD),
XBOW("elven bow",  "runed bow",	0, 0, 12, 3, 120, 35, 6, 0, WP_BOW, HI_WOOD),
XBOW("orcish bow", "black bow",	0, 0, 12, 3, 120, 25, 6, 0, WP_BOW, BLACK),
X#else
XBOW("bow",	  NULL, 	1, 0, 48, 3, 120, 30, 6, 0, WP_BOW, HI_WOOD),
X#endif
XBOW("sling", 	  NULL,	    	1, 0, 40, 2,  20,  4, 6, 0, WP_SLING, HI_WOOD),
XBOW("crossbow",	  NULL,		1, 0, 45, 3,  40, 35, 6, 0, WP_CROSSBOW, HI_WOOD),
X#undef WEAPON
X#undef PROJECTILE
X#undef BOW
X
X/* tools ... - PICK AXE comes last because it has special characteristics */
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define TOOL(name,desc,kn,chg,prob,weight,cost,material,color) {\
X	name, desc}
X#else
X#define TOOL(name,desc,kn,chg,prob,weight,cost,material,color) {\
X	name, desc, NULL, kn,0,chg,chg,material, 0, TOOL_SYM, prob, 0, \
X	weight, cost, 0, 0, 0, C(color)}
X#endif
X
X#ifdef WALKIES
X	TOOL("leash",		NULL,	1, 0,  70,  3,	20, 0, HI_LEATHER),
X#endif
X#ifdef MEDUSA
X	TOOL("blindfold",	NULL,	1, 0,  55,  2,	20, 0, BLACK),
X	TOOL("mirror",		NULL,	1, 0,  50,  3,	40, GLASS, BLUE),
X#else
X	TOOL("blindfold",	NULL,	1, 0, 105,  2,	20, 0, BLACK),
X#endif
X	TOOL("tinning kit",	NULL,	1, 0,  15, 10,	30, METAL, HI_METAL),
X	TOOL("lock pick",	NULL,	1, 0,  55,  2,	20, METAL, HI_METAL),
X	TOOL("credit card",	NULL,	1, 0,	5,  1,	10, 0, WHITE),
X#ifdef WALKIES
X	TOOL("key",		NULL,	1, 0, 100,  1,	10, METAL, HI_METAL),
X#else
X	TOOL("key",		NULL,	1, 0, 155,  1,	10, METAL, HI_METAL),
X#endif
X	TOOL("skeleton key",	"key",	0, 0,  60,  1,	10, METAL, HI_METAL),
X	TOOL("expensive camera", NULL,	1, 0,	5,  3, 200, 0, BLACK),
X	TOOL("magic marker",	NULL,	1, 1,  15,  1,	50, 0, RED),
X	TOOL("stethoscope",	NULL,	1, 0,  15,  2,	75, 0, HI_METAL),
X	TOOL("tin opener",	NULL,	1, 0,  25,  1,	30, METAL, HI_METAL),
X#ifdef WALKIES
X	TOOL("lamp",		NULL,	1, 1,  90, 10,	50, 0, YELLOW),
X#else
X	TOOL("lamp",		NULL,	1, 1, 105, 10,	50, 0, YELLOW),
X#endif
X	TOOL("magic lamp",	"lamp", 0, 1,  20, 10,	50, 0, YELLOW),
X	TOOL("crystal ball",	NULL,	1, 1,  35, 15,	60, GLASS, HI_GLASS),
X	TOOL("figurine",	NULL,	1, 0,  35,  5,	80, MINERAL, HI_MINERAL),
X	TOOL("ice box", 	NULL,	1, 0,	5, 40,  30, 0, WHITE),
X	TOOL("large box",	NULL,	1, 0,  40, 40,  20, WOOD, HI_WOOD),
X	TOOL("chest",		NULL,	1, 0,  35, 40,  20, WOOD, HI_WOOD),
X	TOOL("sack",		"bag",	0, 0,  40,  3,  20, 0, HI_CLOTH),
X	TOOL("bag of holding",	"bag",	0, 0,  20,  3, 100, 0, HI_CLOTH),
X	TOOL("bag of tricks",	"bag",	0, 1,  20,  3, 100, 0, HI_CLOTH),
X#ifndef MUSIC
X	TOOL("whistle", 	NULL,	1, 0, 120,  2,	10, METAL, HI_METAL),
X	TOOL("magic whistle","whistle",	0, 0,  50,  2,	10, METAL, HI_METAL),
X#else
X	TOOL("whistle", 	NULL,	1, 0, 105,  2,	10, METAL, HI_METAL),
X	TOOL("magic whistle","whistle",	0, 0,  30,  2,	10, METAL, HI_METAL),
X	TOOL("flute",		NULL,	1, 0,	6,  3,	12, WOOD, HI_WOOD),
X	TOOL("magic flute",   "flute",	0, 1,	2,  3,	12, WOOD, HI_WOOD),
X	TOOL("horn",		NULL,	1, 0,	5,  4,	15, METAL, HI_METAL),
X	TOOL("frost horn",	"horn", 0, 1,	2,  4,	15, METAL, HI_METAL),
X	TOOL("fire horn",	"horn", 0, 1,	2,  4,	15, METAL, HI_METAL),
X	TOOL("harp",		NULL,	1, 0,	4, 10,	50, METAL, HI_METAL),
X	TOOL("magic harp",	"harp", 0, 1,	2, 10,	50, METAL, HI_METAL),
X	TOOL("bugle",		NULL,	1, 0,	6,  3,	15, METAL, HI_METAL),
X	TOOL("drum",		NULL,	1, 0,	4,  4,	25, 0, BROWN),
X	TOOL("drum of earthquake", "drum", 0, 1, 2,  4,	25, 0, BROWN),
X#endif
X#undef TOOL
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X	{ "pick-axe", NULL},
X	{ "unicorn horn", NULL},
X	{ "blinding venom", "splash of venom"},
X	{ "acid venom", "splash of venom"},
X	    /* +d6 small or large */
X	{ "heavy iron ball", NULL},
X	{ "iron chain", NULL},
X#else
X	{ "pick-axe", NULL, NULL, 1,0,1,1,METAL, 0, TOOL_SYM, 20,
X						0, 10, 50, 6, 3, 0, C(HI_METAL)},
X	{ "unicorn horn", NULL, NULL, 1,0,1,1,0, 0, TOOL_SYM, 0,
X						0, 4, 100, 12, 12, 0, C(WHITE)},
X	{ "blinding venom", "splash of venom", NULL,
X		0,1,0,0,0, 0, VENOM_SYM, 500, 0, 0, 0, 0, 0, 0, C(HI_ORGANIC)},
X	{ "acid venom", "splash of venom", NULL,
X	        0,1,0,0,0, 0, VENOM_SYM, 500, 0, 0, 0, 6, 6, 0, C(HI_ORGANIC)},
X	    /* +d6 small or large */
X	{ "heavy iron ball", NULL, NULL, 1,0,0,0,METAL, 0,
X		BALL_SYM, 1000, 0, 20, 10, 0, 0, 0, C(HI_METAL)},
X	{ "iron chain", NULL, NULL, 1,0,0,0,METAL, 0,
X		CHAIN_SYM, 1000, 0, 20, 0, 0, 0, 0, C(HI_METAL)},
X#endif
X
X	/* Note: boulders and rocks normally do not appear at random; the
X	 * probabilities only come into effect when you try to polymorph them.
X	 */
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X	{ "boulder", NULL},
X	{ "statue", NULL},
X#else
X	{ "boulder", NULL, NULL, 1,0,0,0,MINERAL, 0, ROCK_SYM, 100, 0,
X		200 /* > MAX_CARR_CAP */, 0, 20, 20, 0, C(HI_MINERAL)},
X	{ "statue", NULL, NULL, 1,0,0,0,MINERAL, 0, ROCK_SYM, 900, 0,
X	        250, 0, 20, 20, 0, C(HI_MINERAL)},
X#endif
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define ARMOR(name,desc,kn,blk,power,prob,delay,weight,cost,ac,can,metal,c) \
X	{name, desc}
X#else
X#define ARMOR(name,desc,kn,blk,power,prob,delay,weight,cost,ac,can,metal,c) \
X	{name, desc, NULL, kn,0,1,blk,metal, power, ARMOR_SYM, prob,\
X	delay, weight, cost, ac, can, 0, C(c)}
X#endif
X#ifdef TOLKIEN
XARMOR("elven leather helm", "leather hat",
X			0, 0, 0,  6, 1, 2,   8, 9, 0, 0, HI_LEATHER),
XARMOR("orcish helm", "black cap",
X			0, 0, 0,  6, 1, 3,  10, 9, 0, METAL, BLACK),
XARMOR("dwarvish iron helm", "hard hat",
X			0, 0, 0,  6, 1, 3,  20, 8, 0, METAL, HI_METAL),
X#else
XARMOR("orcish helm", "black cap",
X			0, 0, 0, 18, 1, 3,  10, 9, 0, METAL, BLACK),
X#endif
XARMOR("fedora", NULL,	1, 0, 0,  0, 1, 1,   8, 9, 0, 0, BROWN),
XARMOR("helmet", "rusty pot",
X			0, 0, 0, 12, 1, 2,  10, 9, 0, METAL, HI_METAL),
XARMOR("helm of brilliance", "plumed hat",
X			0, 0, 0,  6, 1, 2,  50, 9, 0, METAL, GREEN),
XARMOR("helm of opposite alignment", "crested helmet",
X			0, 0, 0,  6, 1, 2,  50, 9, 0, METAL, HI_METAL),
XARMOR("helm of telepathy", "visored helmet",
X			0, 0, TELEPAT, 2, 1, 2, 50, 9, 0, METAL, HI_METAL),
X
X/* non-metal and (METAL | 1) armors do not rust */
XARMOR("dragon scale mail", NULL,
X			1, 1, 0,  0, 5, 5,1000, 1, 0, 0, HI_LEATHER),
XARMOR("plate mail", NULL,
X			1, 1, 0, 44, 5, 9, 600, 3, 2, METAL, HI_METAL),
XARMOR("crystal plate mail", NULL,
X			1, 1, 0, 10, 5, 9, 820, 3, 2, GLASS, WHITE|BRIGHT),
X#ifdef SHIRT
XARMOR("bronze plate mail", NULL,
X			1, 1, 0, 25, 5, 9, 400, 4, 0, COPPER, HI_COPPER),
X#else
XARMOR("bronze plate mail", NULL,
X			1, 1, 0, 35, 5, 9, 400, 4, 0, COPPER, HI_COPPER),
X#endif
XARMOR("splint mail", NULL,	1, 1, 0, 66, 5, 8,  80, 4, 1, METAL, HI_METAL),
XARMOR("banded mail", NULL,	1, 1, 0, 76, 5, 8,  90, 4, 0, METAL, HI_METAL),
X#ifdef TOLKIEN
XARMOR("dwarvish mithril-coat", NULL,
X			1, 0, 0, 10, 1, 2, 240, 4, 3, MITHRIL, HI_METAL),
XARMOR("elven mithril-coat", NULL, 1, 0, 0, 15, 1, 2, 240, 5, 3, MITHRIL, HI_METAL),
XARMOR("chain mail", NULL,	1, 0, 0, 76, 5, 6,  75, 5, 1, METAL, HI_METAL),
XARMOR("orcish chain mail", "black chain mail",
X				0, 0, 0, 20, 5, 6,  75, 5, 1, METAL, BLACK),
X#else
XARMOR("dwarvish mithril-coat", NULL,
X			1, 0, 0, 25, 1, 2, 240, 4, 3, MITHRIL, HI_METAL),
XARMOR("chain mail", NULL,	1, 0, 0, 96, 5, 6,  75, 5, 1, METAL, HI_METAL),
X#endif
XARMOR("scale mail", NULL,	1, 0, 0, 76, 5, 5,  45, 6, 0, METAL, HI_METAL),
XARMOR("studded leather armor", NULL,
X				1, 0, 0, 76, 3, 3,  15, 7, 1, 0, HI_LEATHER),
X#ifdef TOLKIEN
XARMOR("ring mail", NULL,	1, 0, 0, 76, 5, 4, 100, 7, 0, METAL, HI_METAL),
XARMOR("orcish ring mail", "black ring mail",
X				0, 0, 0, 20, 5, 5,  80, 8, 1, METAL, BLACK),
X#else
XARMOR("ring mail", NULL,	1, 0, 0, 96, 5, 4, 100, 7, 0, METAL, HI_METAL),
X#endif
XARMOR("leather armor", NULL,	1, 0, 0, 97, 3, 2,   5, 8, 0, 0, HI_LEATHER),
X
X/*  'cope' is not a spelling mistake... leave it be */
XARMOR("mummy wrapping", NULL,
X			1, 0, 0,	     0, 0, 2,  2, 10, 2, 0, HI_CLOTH),
X#ifdef TOLKIEN
XARMOR("elven cloak", "ornamental cope",
X			0, 0, STEALTH,	    12, 0, 2, 60,  9, 3, 0, HI_CLOTH),
XARMOR("orcish cloak", "black mantelet",
X			0, 0, 0,	    12, 0, 2, 40, 10, 3, 0, BLACK),
XARMOR("dwarvish cloak", "colorful hooded cloak",
X			0, 0, 0,	    12, 0, 2, 50, 10, 3, 0, HI_CLOTH),
X#else
XARMOR("elven cloak", "ornamental cope",
X			0, 0, STEALTH,	    36, 0, 2, 60,  9, 3, 0, HI_CLOTH),
X#endif
XARMOR("cloak of protection", "tattered cape",
X			0, 0, PROTECTION,   12, 0, 2, 50,  7, 3, 0, HI_CLOTH),
XARMOR("cloak of invisibility", "opera hood",
X			0, 0, INVIS,	    12, 0, 2, 60,  9, 3, 0, HI_CLOTH),
XARMOR("cloak of magic resistance", "faded pall",
X			0, 0, ANTIMAGIC,     2, 0, 2, 60,  9, 3, 0, HI_CLOTH),
XARMOR("cloak of displacement", "piece of cloth",
X			0, 0, DISPLACED,    12, 0, 2, 50,  9, 3, 0, HI_CLOTH),
X
X#ifdef TOLKIEN
XARMOR("small shield", NULL,
X			1, 0, 0,	6, 0, 2,  3,  9, 0, METAL, HI_METAL),
XARMOR("elven shield", "blue and green shield",
X			0, 0, 0,	2, 0, 2,  3,  8, 0, METAL, GREEN),
XARMOR("Uruk-hai shield", "white-handed shield",
X			0, 0, 0,	2, 0, 4,  3,  9, 0, METAL, HI_METAL),
XARMOR("orcish shield", "red-eyed shield",
X			0, 0, 0,	2, 0, 3,  3,  9, 0, METAL, RED),
XARMOR("large shield", NULL,
X			1, 1, 0,	7, 0, 4,  7,  8, 0, METAL, HI_METAL),
XARMOR("dwarvish roundshield", "large round shield",
X			0, 0, 0,	4, 0, 4,  7,  8, 0, METAL, HI_METAL),
X#else
XARMOR("small shield", NULL,
X			1, 0, 0,       12, 0, 2,  3,  9, 0, METAL, HI_METAL),
XARMOR("large shield", NULL,
X			1, 1, 0,       11, 0, 4,  7,  8, 0, METAL, HI_METAL),
X#endif
XARMOR("shield of reflection", "polished silver shield",
X			0, 0, REFLECTING,  3, 0, 3, 50, 8, 0, SILVER, HI_SILVER),
X
X#ifdef SHIRT
XARMOR("Hawaiian shirt", NULL,	1, 0, 0, 10, 0, 2, 5, 10, 0, 0, MAGENTA),
X#endif
X
XARMOR("leather gloves", "old gloves",
X			0, 0, 0,	   16, 1, 2,  8, 9, 0, 0, BROWN),
XARMOR("gauntlets of fumbling", "padded gloves",
X			0, 0, FUMBLING,     8, 1, 2, 50, 9, 0, 0, BROWN),
XARMOR("gauntlets of power", "riding gloves",
X			0, 0, 0,	    8, 1, 2, 50, 9, 0, METAL, BROWN),
XARMOR("gauntlets of dexterity", "fencing gloves",
X			0, 0, 0,	    8, 1, 2, 50, 9, 0, 0, BROWN),
X
XARMOR("low boots", "walking shoes",
X			0, 0, 0,	   25, 2, 3,  8, 9, 0, 0, BROWN),
XARMOR("iron shoes", "hard shoes",
X			0, 0, 0,	    7, 2, 5, 16, 8, 0, METAL, HI_METAL),
XARMOR("high boots", "jackboots",
X			0, 0, 0,	   15, 2, 4, 12, 8, 0, 0, BROWN),
XARMOR("speed boots", "combat boots",
X			0, 0, FAST,	   12, 2, 4, 50, 9, 0, 0, BROWN),
XARMOR("water walking boots", "jungle boots",
X			0, 0, WWALKING,    12, 2, 4, 50, 9, 0, 0, BROWN),
XARMOR("jumping boots", "hiking boots",
X			0, 0, JUMPING,	   12, 2, 4, 50, 9, 0, 0, BROWN),
XARMOR("elven boots", "mud boots",
X			0, 0, STEALTH,	   12, 2, 3,  8, 9, 0, 0, BROWN),
XARMOR("fumble boots", "riding boots",
X			0, 0, FUMBLING,    12, 2, 4, 30, 9, 0, 0, BROWN),
XARMOR("levitation boots", "snow boots",
X			0, 0, LEVITATION,  12, 2, 4, 30, 9, 0, 0, BROWN),
X#undef ARMOR
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define GEM(name,desc,prob,wt,gval,glass, color) \
X	{ name, desc}
X#else
X#define GEM(name,desc,prob,wt,gval,glass, color) \
X		{ name, desc, NULL, 0,1,0,0,glass, 0,\
X		GEM_SYM, prob, 0, wt, gval, 3, 3, WP_SLING, C(color)}
X#endif
XGEM("dilithium crystal", "white",	 3, 1, 4500, MINERAL, WHITE),
XGEM("diamond", "white", 		 4, 1, 4000, MINERAL, WHITE),
XGEM("ruby", "red",			 5, 1, 3500, MINERAL, RED),
XGEM("sapphire", "blue", 		 6, 1, 3000, MINERAL, BLUE),
XGEM("emerald", "green", 		 7, 1, 2500, MINERAL, GREEN),
XGEM("turquoise", "green",		 8, 1, 2000, MINERAL, GREEN),
XGEM("aquamarine", "green",		10, 1, 1500, MINERAL, GREEN),
XGEM("amber", "yellowish brown", 	11, 1, 1000, MINERAL, BROWN),
XGEM("topaz", "yellowish brown", 	13, 1,	900, MINERAL, BROWN),
XGEM("opal", "white",			15, 1,	800, MINERAL, WHITE),
XGEM("garnet", "red",			17, 1,	700, MINERAL, RED),
XGEM("amethyst", "violet",		19, 1,  600, MINERAL, MAGENTA),
XGEM("jasper", "red",			21, 1,	500, MINERAL, RED),
XGEM("fluorite", "violet",		22, 1,	400, MINERAL, MAGENTA),
XGEM("jade", "green",			23, 1,	300, MINERAL, GREEN),
XGEM("worthless piece of white glass", "white",	131, 1, 0, GLASS, WHITE),
XGEM("worthless piece of blue glass", "blue",	131, 1, 0, GLASS, BLUE),
XGEM("worthless piece of red glass", "red",	131, 1, 0, GLASS, RED),
XGEM("worthless piece of yellowish brown glass", "yellowish brown",
X						131, 1, 0, GLASS, BROWN),
XGEM("worthless piece of green glass", "green",	131, 1, 0, GLASS, GREEN),
XGEM("worthless piece of violet glass", "violet",131, 1, 0, GLASS, MAGENTA),
XGEM("luckstone", "gray",		 10, 1,  60, MINERAL, GRAY),
XGEM("loadstone", "gray",		 10, 50,  1, MINERAL, GRAY),
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X{ "rock", NULL},
X#else
X{ "rock", NULL, NULL, 1,1,0,0,MINERAL, 0,
X		GEM_SYM, 10, 0, 1, 0, 3, 3, WP_SLING, C(HI_MINERAL)},
X#endif
X#undef GEM
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define POTION(name,desc,power,prob,cost,color) \
X	{ name, desc}
X#else
X#define POTION(name,desc,power,prob,cost,color) \
X		{ name, desc, NULL, 0,1,0,0,0, power,\
X		POTION_SYM, prob, 0, 2, cost, 0, 0, 0, C(color)}
X#endif
X
X#ifdef SPELLS
XPOTION("fruit juice",		"smoky",	0,	45, 50,	WHITE),
XPOTION("booze", 		"bubbly",	0,	45, 50,	WHITE),
XPOTION("gain energy",		"ebony", 	0,	45,150,	BLACK),
X#else
XPOTION("fruit juice",		"smoky",	0,	70, 50,	WHITE),
XPOTION("booze", 		"bubbly",	0,	65, 50,	WHITE),
X#endif
XPOTION("gain ability",		"swirly",	0,	45,300,	WHITE),
XPOTION("restore ability",	"pink",		0,	45,100,	MAGENTA|BRIGHT),
XPOTION("sickness",		"ruby",		0,	45, 50,	RED),
XPOTION("confusion",		"orange",	CONFUSION, 45, 100, ORANGE_COLORED),
XPOTION("blindness",		"yellow",	BLINDED, 45,150, YELLOW),
XPOTION("paralysis",		"emerald", 	0,	45,300,	GREEN|BRIGHT),
XPOTION("speed", 		"dark green", 	FAST,	45,200,	GREEN),
XPOTION("levitation",		"cyan",		LEVITATION, 45,200, CYAN),
XPOTION("hallucination", 	"brilliant blue", HALLUC, 45,100, BLUE|BRIGHT),
XPOTION("invisibility",		"sky blue",	INVIS,	45,150,	CYAN),
XPOTION("see invisible", 	"magenta",	SEE_INVIS, 45,50, MAGENTA),
XPOTION("healing",		"purple", 	0,	65,100,	MAGENTA),
XPOTION("extra healing", 	"purple-red",	0,	50,100,	MAGENTA),
XPOTION("gain level",		"puce",		0,	20,300,	MAGENTA|BRIGHT),
XPOTION("enlightenment",		"brown",	0,	20,200,	BROWN),
XPOTION("monster detection",	"white",	0,	45,150,	WHITE),
XPOTION("object detection",	"glowing",	0,	45,150,	WHITE|BRIGHT),
XPOTION("water", 		"clear",	0,	125,100,CYAN),
X#undef POTION
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define SCROLL(name,text,prob,cost) \
X	{ name, text}
X#else
X#define SCROLL(name,text,prob,cost) \
X	{ name, text, NULL, 0,1,0,0,0, 0,\
X		SCROLL_SYM, prob, 0, 3, cost, 0, 0, 0, C(HI_PAPER)}
X#endif
X#ifdef MAIL
X	SCROLL("mail",			"KIRJE",	     0,   0),
X#endif
X	SCROLL("enchant armor", 	"ZELGO MER",	    63,  80),
X	SCROLL("destroy armor", 	"JUYED AWK YACC",   45, 100),
X	SCROLL("confuse monster",	"NR 9", 	    53, 100),
X	SCROLL("scare monster", 	"XIXAXA XOXAXA XUXAXA", 35, 100),
X	SCROLL("blank paper",		"READ ME",	    28,  60),
X	SCROLL("remove curse",		"PRATYAVAYAH",	    65,  80),
X	SCROLL("enchant weapon",	"DAIYEN FOOELS",    85,  60),
X	SCROLL("create monster",	"LEP GEX VEN ZEA",  45, 200),
X	SCROLL("taming",		"PRIRUTSENIE",	    15, 200),
X	SCROLL("genocide",		"ELBIB YLOH",	    15, 300),
X	SCROLL("light", 		"VERR YED HORRE",   95,  50),
X	SCROLL("teleportation", 	"VENZAR BORGAVVE",  55, 100),
X	SCROLL("gold detection",	"THARR",	    33, 100),
X	SCROLL("food detection",	"YUM YUM",	    25, 100),
X	SCROLL("identify",		"KERNOD WEL",	    185, 20),
X	SCROLL("magic mapping", 	"ELAM EBOW",	    45, 100),
X	SCROLL("amnesia",		"DUAM XNAHT",	    35, 200),
X	SCROLL("fire",			"ANDOVA BEGARIN",   48, 100),
X	SCROLL("punishment",		"VE FORBRYDERNE",   15, 300),
X	SCROLL("charging",		"HACKEM MUCHE",     15, 300),
X	SCROLL(NULL,			"VELOX NEB",	     0, 100),
X	SCROLL(NULL,			"FOOBIE BLETCH",     0, 100),
X	SCROLL(NULL,			"TEMOV",	     0, 100),
X	SCROLL(NULL,			"GARVEN DEH",	     0, 100),
X#undef SCROLL
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define WAND(name,typ,prob,cost,flags,metal,c)	{ \
X	name, typ}
X#else
X#define WAND(name,typ,prob,cost,flags,metal,c)	{ \
X	name, typ, NULL, 0,0,1,0,metal, 0, WAND_SYM, \
X	prob, 0, 3, cost, flags, 0, 0, C(c) }
X#endif
X
XWAND("light",		"glass",	95, 100, NODIR,    GLASS,HI_GLASS),
XWAND("secret door detection", "balsa",	50, 150, NODIR,    WOOD,HI_WOOD),
XWAND("create monster",	"maple",	45, 200, NODIR,    WOOD,HI_WOOD),
XWAND("wishing", 	"pine",		 5, 500, NODIR,    WOOD,HI_WOOD),
XWAND("striking",	"oak",	 	75, 150, IMMEDIATE,WOOD,HI_WOOD),
XWAND("nothing", 	"ebony",	25, 100, IMMEDIATE,WOOD,HI_WOOD),
XWAND("make invisible",	"marble",	45, 150, IMMEDIATE,MINERAL,HI_MINERAL),
XWAND("slow monster",	"tin",		55, 150, IMMEDIATE,METAL,HI_METAL),
XWAND("speed monster",	"brass",	55, 150, IMMEDIATE,COPPER,HI_COPPER),
XWAND("undead turning",	"copper",	55, 150, IMMEDIATE,COPPER,HI_COPPER),
XWAND("polymorph",	"silver",	45, 200, IMMEDIATE,SILVER,HI_SILVER),
XWAND("cancellation",	"platinum",	45, 200, IMMEDIATE,PLATINUM,HI_SILVER|BRIGHT),
XWAND("teleportation",	"iridium", 	45, 200, IMMEDIATE,METAL,CYAN|BRIGHT),
X#ifdef PROBING
XWAND("opening", 	"zinc",		25, 150, IMMEDIATE,METAL,HI_METAL),
XWAND("locking", 	"aluminum",	25, 150, IMMEDIATE,METAL,HI_METAL),
XWAND("probing", 	"uranium",	30, 150, IMMEDIATE,METAL,HI_METAL),
X#else
XWAND("opening", 	"zinc",		40, 150, IMMEDIATE,METAL,HI_METAL),
XWAND("locking", 	"aluminum",	40, 150, IMMEDIATE,METAL,HI_METAL),
X#endif
XWAND("digging", 	"iron", 	55, 150, RAY,	   METAL,HI_METAL),
XWAND("magic missile",	"steel",	50, 150, RAY,	   METAL,HI_METAL),
XWAND("fire",		"hexagonal",	40, 175, RAY,	   METAL,HI_METAL),
XWAND("sleep",		"runed",	50, 175, RAY,	   METAL,HI_METAL),
XWAND("cold",		"short",	40, 175, RAY,	   METAL,HI_METAL),
XWAND("death",		"long", 	 5, 500, RAY,	   METAL,HI_METAL),
XWAND("lightning",	"curved",	40, 175, RAY,	   METAL,HI_METAL),
XWAND(NULL,		"forked",	 0, 150, 0,	   WOOD,HI_WOOD),
XWAND(NULL,		"spiked",	 0, 150, 0,	   METAL,HI_METAL),
XWAND(NULL,		"jeweled",	 0, 150, 0,	   METAL,HI_MINERAL),
X#undef WAND
X
X#ifdef SPELLS
X/* books */
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define SPELL(name,desc,prob,delay,level,flags,color) \
X	{ name, desc}
X#else
X#define SPELL(name,desc,prob,delay,level,flags,color) \
X	{ name, desc, NULL, 0,1,0,0,0, 0, SPBOOK_SYM, prob, delay, \
X	5, level*100, flags, 0, level, C(color)}
X#endif
X
XSPELL("magic missile",	 "parchment",	45,  3, 2, RAY,		HI_PAPER),
XSPELL("fireball",	 "vellum",	20,  6, 4, RAY,		HI_PAPER),
XSPELL("sleep",		 "dog eared",	50,  1, 1, RAY,		HI_PAPER),
XSPELL("cone of cold",	 "ragged",	10,  8, 5, RAY,		HI_PAPER),
XSPELL("finger of death", "stained",	 5, 10, 7, RAY,		HI_PAPER),
XSPELL("light",		 "cloth",	45,  1, 1, NODIR,	HI_CLOTH),
XSPELL("detect monsters", "leather", 	45,  1, 1, NODIR,	HI_LEATHER),
XSPELL("healing",	 "white",	40,  2, 1, NODIR,	WHITE),
XSPELL("knock",		 "pink",	40,  1, 1, IMMEDIATE,	MAGENTA|BRIGHT),
XSPELL("force bolt",	 "red",		40,  2, 1, IMMEDIATE,	RED),
XSPELL("confuse monster", "orange",	37,  2, 2, IMMEDIATE,	ORANGE_COLORED),
XSPELL("cure blindness",  "yellow", 	27,  2, 2, IMMEDIATE,	YELLOW),
XSPELL("slow monster",	 "light green",	37,  2, 2, IMMEDIATE,	GREEN|BRIGHT),
XSPELL("wizard lock",	 "dark green",	35,  3, 2, IMMEDIATE,	GREEN),
XSPELL("create monster",  "turquoise",	37,  3, 2, NODIR,	CYAN|BRIGHT),
XSPELL("detect food",	 "cyan",	37,  3, 2, NODIR,	CYAN),
XSPELL("cause fear",	 "light blue",	25,  3, 3, NODIR,	BLUE|BRIGHT),
XSPELL("clairvoyance",	 "dark blue",	15,  3, 3, NODIR,	BLUE),
XSPELL("cure sickness",	 "indigo",	32,  3, 3, NODIR,	BLUE),
XSPELL("charm monster",	 "magenta",	20,  3, 3, IMMEDIATE,	MAGENTA),
XSPELL("haste self",	 "purple",	33,  4, 3, NODIR,	MAGENTA),
XSPELL("detect unseen",	 "violet",	25,  4, 3, NODIR,	MAGENTA),
XSPELL("levitation",	 "tan",		25,  4, 4, NODIR,	BROWN),
XSPELL("extra healing",	 "plaid",	32,  5, 3, NODIR,	GREEN),
XSPELL("restore ability", "light brown",	25,  5, 4, NODIR,	BROWN),
XSPELL("invisibility",	 "dark brown",	32,  5, 4, NODIR,	BROWN),
XSPELL("detect treasure", "gray",	25,  5, 4, NODIR,	GRAY),
XSPELL("remove curse",	 "white",	25,  5, 5, NODIR,	WHITE),
XSPELL("dig",		 "mottled",	22,  6, 5, RAY,		HI_PAPER),
XSPELL("magic mapping",	 "rusty",	18,  7, 5, NODIR,	RED),
XSPELL("identify",	 "bronze",	25,  8, 5, NODIR,	HI_COPPER),
XSPELL("turn undead",	 "copper",	17,  8, 6, IMMEDIATE,	HI_COPPER),
XSPELL("polymorph",	 "silver",	12,  8, 6, IMMEDIATE,	HI_SILVER),
XSPELL("teleport away",	 "gold",	15,  6, 6, IMMEDIATE,	HI_GOLD),
XSPELL("create familiar", "glittering", 	10,  7, 6, NODIR,	WHITE|BRIGHT),
XSPELL("cancellation",	 "shining",	12,  8, 7, IMMEDIATE,	WHITE|BRIGHT),
XSPELL("genocide",	 "glowing",	 5, 10, 7, NODIR,	WHITE|BRIGHT),
XSPELL(NULL,		 "dull",	 0,  0, 0, 0,		HI_PAPER),
XSPELL(NULL,		 "thin",	 0,  0, 0, 0,		HI_PAPER),
XSPELL(NULL,		 "thick",	 0,  0, 0, 0,		HI_PAPER),
X#undef SPELL
X#endif /* SPELLS /**/
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X#define RING(name,stone,power,cost,spec,metal,color) \
X	{ name, stone}
X#else
X#define RING(name,stone,power,cost,spec,metal,color) \
X		{ name, stone, NULL, 0,0,spec,spec,metal, \
X		power, RING_SYM, 0, 0, 1, cost, 0, 0, 0, C(color)}
X#endif
X
XRING("adornment",	"wooden",	ADORNED,	100, 1, WOOD, HI_WOOD),
XRING("gain strength",	"granite",	0,		150, 1, MINERAL, HI_MINERAL),
XRING("increase damage", "coral",	0,		150, 1, MINERAL, RED|BRIGHT),
XRING("protection",	"black onyx",	PROTECTION,	100, 1, MINERAL, BLACK),
XRING("regeneration",	"moonstone",	REGENERATION,	200, 0, MINERAL, HI_MINERAL),
XRING("searching",	"tiger eye",	SEARCHING,	200, 0, MINERAL, BROWN),
XRING("stealth", 	"jade",		STEALTH,	100, 0, MINERAL, GREEN),
XRING("levitation",	"agate",	LEVITATION,	200, 0, MINERAL, RED),
XRING("hunger",		"topaz",	HUNGER, 	100, 0, MINERAL, CYAN),
XRING("aggravate monster", "sapphire",	AGGRAVATE_MONSTER, 150, 0, METAL, BLUE),
XRING("conflict",	"ruby", 	CONFLICT,	300, 0, METAL, RED),
XRING("warning", 	"diamond", 	WARNING,	100, 0, METAL, WHITE|BRIGHT),
XRING("poison resistance", "pearl",	POISON_RES,	150, 0, METAL, WHITE),
XRING("fire resistance", "iron",		FIRE_RES,	200, 0, METAL, HI_METAL),
XRING("cold resistance", "brass",	COLD_RES,	150, 0, COPPER, HI_COPPER),
XRING("shock resistance", "copper",	SHOCK_RES,	150, 0, COPPER, HI_COPPER),
XRING("teleportation",	"silver",	TELEPORT,	200, 0, SILVER, HI_SILVER),
XRING("teleport control", "gold",	TELEPORT_CONTROL,
X							300, 0, GOLD, HI_GOLD),
X#ifdef POLYSELF
XRING("polymorph",	"ivory",	POLYMORPH,	300, 0, 0, WHITE),
XRING("polymorph control","emerald",	POLYMORPH_CONTROL,
X							300, 0, METAL, GREEN|BRIGHT),
X#endif
XRING("invisibility",	"wire",		INVIS,		150, 0, METAL, HI_METAL),
XRING("see invisible",	"engagement",	SEE_INVIS,	150, 0, METAL, HI_METAL),
XRING("protection from shape changers", "shining", PROT_FROM_SHAPE_CHANGERS,
X							100, 0, METAL, HI_METAL|BRIGHT),
X#undef RING
X
X#if defined(MACOS) && !defined(MAKEDEFS_C)
X	{ NULL, NULL}
X#else
X	{ NULL, NULL, NULL, 0,0,0,0,0, 0, ILLOBJ_SYM, 0, 0, 0, 0, 0, 0, 0, C(0) }
X#endif
X};
X
X#undef C
END_OF_FILE
if test 33564 -ne `wc -c <'src/objects.c'`; then
    echo shar: \"'src/objects.c'\" unpacked with wrong size!
fi
# end of 'src/objects.c'
fi
echo shar: End of archive 21 \(of 56\).
cp /dev/null ark21isdone
MISSING=""
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 56 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