home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume16
/
nethack31
/
part23
< prev
next >
Wrap
Internet Message Format
|
1993-02-01
|
58KB
Path: uunet!news.tek.com!master!saab!billr
From: billr@saab.CNA.TEK.COM (Bill Randle)
Newsgroups: comp.sources.games
Subject: v16i023: nethack31 - display oriented dungeons & dragons (Ver. 3.1), Part23/108
Message-ID: <4311@master.CNA.TEK.COM>
Date: 29 Jan 93 20:44:19 GMT
Sender: news@master.CNA.TEK.COM
Lines: 1338
Approved: billr@saab.CNA.TEK.COM
Xref: uunet comp.sources.games:1580
Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
Posting-number: Volume 16, Issue 23
Archive-name: nethack31/Part23
Supersedes: nethack3p9: Volume 10, Issue 46-102
Environment: Amiga, Atari, Mac, MS-DOS, OS2, Unix, VMS, X11
#! /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 23 (of 108)."
# Contents: src/objects.c src/timeout.c
# Wrapped by billr@saab on Wed Jan 27 16:08:55 1993
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
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'\" \(41735 characters\)
sed "s/^X//" >'src/objects.c' <<'END_OF_FILE'
X/* SCCS Id: @(#)objects.c 3.1 92/12/13 */
X/* Copyright (c) Mike Threepoint, 1989 (890110) */
X/* NetHack may be freely redistributed. See license for details. */
X
X#ifndef OBJECTS_PASS_2_
X/* first pass */
X# include "config.h"
X# include "obj.h"
X# include "objclass.h"
X# include "prop.h"
X
X#else /* !OBJECTS_PASS_2_ */
X/* second pass */
X# ifdef TEXTCOLOR
X#include "color.h"
X# endif
X#endif /* !OBJECTS_PASS_2_ */
X
X/* objects have symbols: ) [ = " ( % ! ? + / $ * ` 0 _ . */
X
X#ifndef OBJECTS_PASS_2_
X/* first pass -- object descriptive text */
X# define OBJ(name,desc) name,desc
X# define OBJECT(obj,bits,prp,sym,prob,dly,wt,cost,sdam,ldam,oc1,oc2,nut,color) \
X {obj}
X/* note: OBJ and BITS macros used to get around compiler argument limits */
X/* the ctnr field of BITS currently does not map into struct objclass,
X * and is ignored in the expansion */
X
Xstruct objdescr NEARDATA obj_descr[] = {
X#else
X/* second pass -- object definitions */
X
X# define BITS(nmkn,mrg,uskn,ctnr,mgc,chrg,uniq,big,dir,mtrl) nmkn,mrg,uskn,mgc,chrg,uniq,big,dir,mtrl /* SCO ODT 1.1 cpp fodder */
X/* SCO's version of MSC 5.x barfs on the line above without a trailing space */
X
X#ifdef TEXTCOLOR
X# define OBJECT(obj,bits,prp,sym,prob,dly,wt,cost,sdam,ldam,oc1,oc2,nut,color) \
X {0, 0, NULL, bits, prp, sym, dly, color,\
X prob, wt, cost, sdam, ldam, oc1, oc2, nut}
X#else
X# define OBJECT(obj,bits,prp,sym,prob,dly,wt,cost,sdam,ldam,oc1,oc2,nut,color) \
X {0, 0, NULL, bits, prp, sym, dly,\
X prob, wt, cost, sdam, ldam, oc1, oc2, nut}
X#endif
X
Xstruct objclass NEARDATA objects[] = {
X#endif
X/* dummy object[0] -- description [2nd arg] *must* be NULL */
X OBJECT(OBJ("strange object",NULL), BITS(1,0,0,0,0,0,0,0,0,0), 0,
X ILLOBJ_CLASS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
X
X/* weapons ... */
X#define WEAPON(name,app,kn,mg,bi,prob,wt,cost,sdam,ldam,hitbon,metal,color) OBJECT( \
X OBJ(name,app), BITS(kn,mg,1,0,0,1,0,bi,0,metal), 0, \
X WEAPON_CLASS, prob, 0, \
X wt, cost, sdam, ldam, hitbon, 0, wt, color )
X#define PROJECTILE(name,app,kn,prob,wt,cost,sdam,ldam,hitbon,metal,prop,color) OBJECT( \
X OBJ(name,app), BITS(kn,1,1,0,0,1,0,0,0,metal), 0, \
X WEAPON_CLASS, prob, 0, \
X wt, cost, sdam, ldam, hitbon, prop, wt, color )
X#define BOW(name,app,kn,prob,wt,cost,sdam,ldam,hitbon,metal,prop,color) OBJECT( \
X OBJ(name,app), BITS(kn,0,1,0,0,1,0,0,0,metal), 0, \
X WEAPON_CLASS, prob, 0, \
X wt, cost, sdam, ldam, hitbon, -(prop), wt, color )
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 */
XPROJECTILE("arrow", NULL, 1, 42, 1, 2, 6, 6, 0,
X IRON, WP_BOW, HI_METAL),
XPROJECTILE("elven arrow", "runed arrow", 0, 10, 1, 2, 7, 6, 0,
X IRON, WP_BOW, HI_METAL),
XPROJECTILE("orcish arrow", "crude arrow", 0, 11, 1, 2, 5, 6, 0,
X IRON, WP_BOW, BLACK),
XPROJECTILE("silver arrow", NULL, 1, 8, 1, 2, 6, 6, 0,
X SILVER, WP_BOW, HI_SILVER),
XPROJECTILE("ya", "bamboo arrow", 0, 5, 1, 4, 7, 7, 1,
X METAL, WP_BOW, HI_METAL),
XPROJECTILE("crossbow bolt", NULL, 1, 50, 1, 2, 4, 6, 0,
X IRON, WP_CROSSBOW, HI_METAL),
X
XWEAPON("dart", NULL, 1, 1, 0, 60, 1, 2, 3, 2, 0, IRON, HI_METAL),
XWEAPON("shuriken", "throwing star",0, 1, 0, 35, 1, 5, 8, 6, 2, IRON, HI_METAL),
XWEAPON("boomerang", NULL, 1, 1, 0, 15, 5, 20, 9, 9, 0, WOOD, HI_WOOD),
X
X/* spears */
XWEAPON("spear", NULL, 1, 1, 0, 50, 30, 3, 6, 8, 0, IRON, HI_METAL),
XWEAPON("elven spear", "runed spear", 0, 1, 0, 10, 30, 3, 7, 8, 0, IRON, HI_METAL),
XWEAPON("orcish spear", "crude spear", 0, 1, 0, 13, 30, 3, 5, 8, 0, IRON, BLACK),
XWEAPON("dwarvish spear", "stout spear", 0, 1, 0, 12, 35, 3, 8, 8, 0, IRON, HI_METAL),
XWEAPON("javelin", "throwing spear",0,1, 0, 10, 20, 3, 6, 6, 0, IRON, HI_METAL),
XWEAPON("trident", NULL, 1, 0, 0, 8, 25, 5, 6, 4, 0, IRON, HI_METAL),
X /* +1 small, +2d4 large */
XWEAPON("lance", NULL, 1, 0, 0, 8,180, 10, 6, 8, 0, IRON, HI_METAL),
X
X/* blades */
XWEAPON("dagger", NULL, 1, 1, 0, 25, 10, 4, 4, 3, 2, IRON, HI_METAL),
XWEAPON("elven dagger", "runed dagger", 0, 1, 0, 8, 10, 4, 5, 3, 2, IRON, HI_METAL),
XWEAPON("orcish dagger", "crude dagger", 0, 1, 0, 10, 10, 4, 3, 3, 2, IRON, BLACK),
XWEAPON("athame", NULL, 1, 1, 0, 0, 10, 4, 4, 3, 2, IRON, HI_METAL),
XWEAPON("scalpel", NULL, 1, 1, 0, 0, 5, 4, 3, 3, 2, IRON, HI_METAL),
XWEAPON("knife", NULL, 1, 1, 0, 20, 5, 4, 3, 2, 0, IRON, HI_METAL),
XWEAPON("stiletto", NULL, 1, 1, 0, 5, 5, 4, 3, 2, 0, IRON, HI_METAL),
XWEAPON("worm tooth", NULL, 1, 0, 0, 0, 20, 2, 2, 2, 0, 0, WHITE),
XWEAPON("crysknife", NULL, 1, 0, 0, 0, 20,100, 10, 10, 3, MINERAL, WHITE),
XWEAPON("dwarvish mattock", "heavy pick",
X 0, 0, 1, 13,120, 50,12, 8,-1, IRON, HI_METAL),
XWEAPON("axe", NULL, 1, 0, 0, 40, 60, 8, 6, 4, 0, IRON, HI_METAL),
XWEAPON("battle-axe","double-headed axe",0, 0, 1, 10,120, 40, 8, 6, 0, IRON, HI_METAL),
X /* "double-bitted" ? */
X
X/* swords */
XWEAPON("short sword", NULL, 1, 0, 0, 8, 30, 10, 6, 8, 0, IRON, HI_METAL),
XWEAPON("elven short sword", "runed short sword",
X 0, 0, 0, 2, 30, 10, 8, 8, 0, IRON, HI_METAL),
XWEAPON("orcish short sword", "crude short sword",
X 0, 0, 0, 3, 30, 10, 5, 8, 0, IRON, BLACK),
XWEAPON("dwarvish short sword", "broad short sword",
X 0, 0, 0, 2, 30, 10, 7, 8, 0, IRON, HI_METAL),
XWEAPON("scimitar", "curved sword", 0, 0, 0, 15, 40, 15, 8, 8, 0, IRON, HI_METAL),
XWEAPON("silver saber", NULL, 1, 0, 0, 6, 40, 75, 8, 8, 0, SILVER, HI_SILVER),
XWEAPON("broadsword", NULL, 1, 0, 0, 8, 70, 10, 4, 6, 0, IRON, HI_METAL),
X /* +d4 small, +1 large */
XWEAPON("elven broadsword", "runed broadsword",
X 0, 0, 0, 4, 70, 10, 6, 6, 0, IRON, HI_METAL),
X /* +d4 small, +1 large */
XWEAPON("long sword", NULL, 1, 0, 0, 50, 40, 15, 8, 12, 0, IRON, HI_METAL),
XWEAPON("two-handed sword", NULL, 1, 0, 1, 22,150, 50, 12, 6, 0, IRON, HI_METAL),
X /* +2d6 large */
XWEAPON("katana", "samurai sword", 0, 0, 0, 4, 40, 80, 10, 12, 1, IRON, HI_METAL),
X/* two set-up-for-artifacts swords */
X /* +2d6 large */
XWEAPON("tsurugi", "long samurai sword", 0, 0, 1, 0, 60,500, 16, 8, 2, METAL, HI_METAL),
X /* +5 */
XWEAPON("runesword", "runed broadsword", 0, 0, 0, 0, 40,300, 4, 6, 0, IRON, BLACK),
X /* +d4 small, +1 large */
X /* +5d2 +d8 from level drain */
X
X/* polearms */
X/* spear-type */
XWEAPON("partisan", "vulgar polearm", 0, 0, 1, 10, 80, 10, 6, 6, 0, IRON, HI_METAL),
X /* +1 large */
XWEAPON("ranseur", "hilted polearm", 0, 0, 1, 10, 50, 6, 4, 4, 0, IRON, HI_METAL),
X /* +d4 both */
XWEAPON("spetum", "forked polearm", 0, 0, 1, 10, 50, 5, 6, 6, 0, IRON, HI_METAL),
X /* +1 small, +d6 large */
XWEAPON("glaive", "single-edged polearm",0, 0, 1, 15, 75, 6, 6,10, 0, IRON, HI_METAL),
X/* axe-type */
XWEAPON("halberd", "angled poleaxe", 0, 0, 1, 16,150, 10, 10, 6, 0, IRON, HI_METAL),
X /* +1d6 large */
XWEAPON("bardiche", "long poleaxe", 0, 0, 1, 8,120, 7, 4, 4, 0, IRON, HI_METAL),
X /* +1d4 small, +2d4 large */
XWEAPON("voulge", "pole cleaver", 0, 0, 1, 8,125, 5, 4, 4, 0, IRON, HI_METAL),
X /* +d4 both */
X/* curved/hooked */
XWEAPON("fauchard", "pole sickle", 0, 0, 1, 11, 60, 5, 6, 8, 0, IRON, HI_METAL),
XWEAPON("guisarme", "pruning hook", 0, 0, 1, 11, 80, 5, 4, 8, 0, IRON, HI_METAL),
X /* +1d4 small */
XWEAPON("bill-guisarme", "hooked polearm",0,0, 1, 8,120, 7, 4,10, 0, IRON, HI_METAL),
X /* +1d4 small */
X/* other */
XWEAPON("lucern hammer", "pronged polearm",0,0,1, 10,150, 7, 4, 6, 0, IRON, HI_METAL),
X /* +1d4 small */
XWEAPON("bec de corbin", "beaked polearm",0,0, 1, 8,100, 8, 8, 6, 0, IRON, HI_METAL),
X
X/* blunt */
XWEAPON("mace", NULL, 1, 0, 0, 40, 30, 5, 6, 6, 0, IRON, HI_METAL),
X /* +1 small */
XWEAPON("morning star", NULL, 1, 0, 0, 12,120, 10, 4, 6, 0, IRON, HI_METAL),
X /* +d4 small, +1 large */
XWEAPON("war hammer", NULL, 1, 0, 0, 15, 50, 5, 4, 4, 0, IRON, HI_METAL),
X /* +1 small */
XWEAPON("club", NULL, 1, 0, 0, 12, 30, 3, 6, 3, 0, WOOD, HI_WOOD),
X#ifdef KOPS
XWEAPON("rubber hose", NULL, 1, 0, 0, 0, 20, 3, 4, 3, 0, 0, BROWN),
X#endif
XWEAPON("quarterstaff", "staff", 0, 0, 1, 11, 40, 5, 6, 6, 0, WOOD, HI_WOOD),
X/* two-piece */
XWEAPON("aklys", "thonged club", 0, 0, 0, 8, 15, 4, 6, 3, 0, IRON, HI_METAL),
XWEAPON("flail", NULL, 1, 0, 0, 40, 15, 4, 6, 4, 0, IRON, HI_METAL),
X /* +1 small, +1d4 large */
X/* whip */
XWEAPON("bullwhip", NULL, 1, 0, 0, 2, 20, 4, 2, 1, 0, LEATHER, BROWN),
X
X/* bows */
XBOW("bow", NULL, 1, 24, 30, 60, 30, 6, 0, WOOD, WP_BOW, HI_WOOD),
XBOW("elven bow", "runed bow", 0, 12, 30, 60, 35, 6, 0, WOOD, WP_BOW, HI_WOOD),
XBOW("orcish bow", "crude bow", 0, 12, 30, 60, 25, 6, 0, WOOD, WP_BOW, BLACK),
XBOW("yumi", "long bow", 0, 0, 30, 60, 35, 6, 0, WOOD, WP_BOW, HI_WOOD),
XBOW("sling", NULL, 1, 40, 3, 20, 4, 6, 0, WOOD, WP_SLING, HI_WOOD),
XBOW("crossbow", NULL, 1, 45, 50, 40, 35, 6, 0, WOOD, WP_CROSSBOW, HI_WOOD),
X#undef WEAPON
X#undef PROJECTILE
X#undef BOW
X
X/* armor ... */
X/* IRON denotes ferrous metals, including steel.
X * Only IRON weapons and armor can rust.
X * Only COPPER (including brass) corrodes.
X * Some creatures are vulnerable to SILVER.
X */
X#define ARMOR(name,desc,kn,mgc,blk,power,prob,delay,wt,cost,ac,can,metal,c) OBJECT( \
X OBJ(name,desc), BITS(kn,0,1,0,mgc,1,0,blk,0,metal), power, \
X ARMOR_CLASS, prob, delay, wt, cost, \
X 0, 0, 10 - ac, can, wt, c )
X
X/* helmets */
XARMOR("elven leather helm", "leather hat",
X 0, 0, 0, 0, 6, 1, 3, 8, 9, 0, LEATHER, HI_LEATHER),
XARMOR("orcish helm", "iron skull cap",
X 0, 0, 0, 0, 6, 1, 30, 10, 9, 0, IRON, BLACK),
XARMOR("dwarvish iron helm", "hard hat",
X 0, 0, 0, 0, 6, 1, 40, 20, 8, 0, IRON, HI_METAL),
XARMOR("fedora", NULL,
X 1, 0, 0, 0, 0, 0, 3, 1,10, 0, CLOTH, BROWN),
XARMOR("dented pot", NULL,
X 1, 0, 0, 0, 2, 0, 10, 8, 9, 0, IRON, BLACK),
XARMOR("helmet", "plumed helmet",
X 0, 0, 0, 0, 10, 1, 30, 10, 9, 0, IRON, HI_METAL),
XARMOR("helm of brilliance", "etched helmet",
X 0, 1, 0, 0, 6, 1, 50, 50, 9, 0, IRON, GREEN),
XARMOR("helm of opposite alignment", "crested helmet",
X 0, 1, 0, 0, 6, 1, 50, 50, 9, 0, IRON, HI_METAL),
XARMOR("helm of telepathy", "visored helmet",
X 0, 1, 0, TELEPAT, 2, 1, 50, 50, 9, 0, IRON, HI_METAL),
X
X/* suits of armor */
X/*
X * There is code in polyself.c that assumes (1) and (2).
X * There is code in objnam.c, mon.c, read.c that assumes (2).
X *
X * (1) The dragon scale mails and the dragon scales are together.
X * (2) That the order of the dragon scale mail and dragon scales is the
X * the same defined in monst.c.
X */
X#define DRGN_ARMR(name,power,cost,ac,color) \
X ARMOR(name,NULL,1,0,1,power,0,5,40,cost,ac,0,DRAGON_HIDE,color)
XDRGN_ARMR("gray dragon scale mail", ANTIMAGIC, 1200, 1, GRAY),
XDRGN_ARMR("red dragon scale mail", FIRE_RES, 900, 1, RED),
XDRGN_ARMR("white dragon scale mail", COLD_RES, 900, 1, WHITE),
XDRGN_ARMR("orange dragon scale mail", SLEEP_RES, 900, 1, ORANGE_COLORED),
XDRGN_ARMR("black dragon scale mail", DISINT_RES, 1200, 1, BLACK),
XDRGN_ARMR("blue dragon scale mail", SHOCK_RES, 900, 1, BLUE),
XDRGN_ARMR("green dragon scale mail", POISON_RES, 900, 1, GREEN),
XDRGN_ARMR("yellow dragon scale mail", 0, 900, 1, YELLOW),
X
X/* For now, only dragons leave these. */
XDRGN_ARMR("gray dragon scales", ANTIMAGIC, 700, 7, GRAY),
XDRGN_ARMR("red dragon scales", FIRE_RES, 500, 7, RED),
XDRGN_ARMR("white dragon scales", COLD_RES, 500, 7, WHITE),
XDRGN_ARMR("orange dragon scales", SLEEP_RES, 500, 7, ORANGE_COLORED),
XDRGN_ARMR("black dragon scales", DISINT_RES, 700, 7, BLACK),
XDRGN_ARMR("blue dragon scales", SHOCK_RES, 500, 7, BLUE),
XDRGN_ARMR("green dragon scales", POISON_RES, 500, 7, GREEN),
XDRGN_ARMR("yellow dragon scales", 0, 500, 7, YELLOW),
X#undef DRGN_ARMR
X
XARMOR("plate mail", NULL,
X 1, 0, 1, 0, 44, 5, 450, 600, 3, 2, IRON, HI_METAL),
XARMOR("crystal plate mail", NULL,
X 1, 0, 1, 0, 10, 5, 450, 820, 3, 2, GLASS, WHITE),
X#ifdef TOURIST
XARMOR("bronze plate mail", NULL,
X 1, 0, 1, 0, 25, 5, 450, 400, 4, 0, COPPER, HI_COPPER),
X#else
XARMOR("bronze plate mail", NULL,
X 1, 0, 1, 0, 35, 5, 450, 400, 4, 0, COPPER, HI_COPPER),
X#endif
XARMOR("splint mail", NULL,
X 1, 0, 1, 0, 66, 5, 400, 80, 4, 1, IRON, HI_METAL),
XARMOR("banded mail", NULL,
X 1, 0, 1, 0, 76, 5, 350, 90, 4, 0, IRON, HI_METAL),
XARMOR("dwarvish mithril-coat", NULL,
X 1, 0, 0, 0, 10, 1, 150, 240, 4, 3, MITHRIL, HI_METAL),
XARMOR("elven mithril-coat", NULL,
X 1, 0, 0, 0, 15, 1, 150, 240, 5, 3, MITHRIL, HI_METAL),
XARMOR("chain mail", NULL,
X 1, 0, 0, 0, 76, 5, 300, 75, 5, 1, IRON, HI_METAL),
XARMOR("orcish chain mail", "crude chain mail",
X 0, 0, 0, 0, 20, 5, 300, 75, 5, 1, IRON, BLACK),
XARMOR("scale mail", NULL,
X 1, 0, 0, 0, 76, 5, 250, 45, 6, 0, IRON, HI_METAL),
XARMOR("studded leather armor", NULL,
X 1, 0, 0, 0, 76, 3, 200, 15, 7, 1, LEATHER, HI_LEATHER),
XARMOR("ring mail", NULL,
X 1, 0, 0, 0, 76, 5, 250, 100, 7, 0, IRON, HI_METAL),
XARMOR("orcish ring mail", "crude ring mail",
X 0, 0, 0, 0, 20, 5, 250, 80, 8, 1, IRON, BLACK),
XARMOR("leather armor", NULL,
X 1, 0, 0, 0, 85, 3, 150, 5, 8, 0, LEATHER, HI_LEATHER),
XARMOR("leather jacket", NULL,
X 1, 0, 0, 0, 12, 0, 30, 10, 9, 0, LEATHER, BLACK),
X
X/* cloaks */
X/* 'cope' is not a spelling mistake... leave it be */
XARMOR("mummy wrapping", NULL,
X 1, 0, 0, 0, 0, 0, 3, 2, 10, 1, CLOTH, GRAY),
XARMOR("elven cloak", "faded pall",
X 0, 1, 0, STEALTH, 10, 0, 10, 60, 9, 3, CLOTH, BLACK),
XARMOR("orcish cloak", "coarse mantelet",
X 0, 0, 0, 0, 10, 0, 10, 40, 10, 2, CLOTH, BLACK),
XARMOR("dwarvish cloak", "hooded cloak",
X 0, 0, 0, 0, 10, 0, 10, 50, 10, 2, CLOTH, HI_CLOTH),
XARMOR("oilskin cloak", "slippery cloak",
X 0, 0, 0, 0, 10, 0, 10, 50, 9, 3, CLOTH, HI_CLOTH),
XARMOR("cloak of protection", "tattered cape",
X 0, 1, 0, PROTECTION, 10, 0, 10, 50, 7, 3, CLOTH, HI_CLOTH),
XARMOR("cloak of invisibility", "opera cloak",
X 0, 1, 0, INVIS, 11, 0, 10, 60, 9, 2, CLOTH, BRIGHT_MAGENTA),
XARMOR("cloak of magic resistance", "ornamental cope",
X 0, 1, 0, ANTIMAGIC, 2, 0, 10, 60, 9, 3, CLOTH, WHITE),
XARMOR("cloak of displacement", "piece of cloth",
X 0, 1, 0, DISPLACED, 11, 0, 10, 50, 9, 2, CLOTH, HI_CLOTH),
X
X/* shields */
XARMOR("small shield", NULL,
X 1, 0, 0, 0, 6, 0, 30, 3, 9, 0, WOOD, HI_WOOD),
X/* TODO: these shield descriptions should be changed,
X * because you can't see colors when blind.
X */
XARMOR("elven shield", "blue and green shield",
X 0, 0, 0, 0, 2, 0, 50, 7, 8, 0, IRON, GREEN),
XARMOR("Uruk-hai shield", "white-handed shield",
X 0, 0, 0, 0, 2, 0, 50, 7, 9, 0, IRON, HI_METAL),
XARMOR("orcish shield", "red-eyed shield",
X 0, 0, 0, 0, 2, 0, 50, 7, 9, 0, IRON, RED),
XARMOR("large shield", NULL,
X 1, 0, 1, 0, 7, 0,100, 10, 8, 0, IRON, HI_METAL),
XARMOR("dwarvish roundshield", "large round shield",
X 0, 0, 0, 0, 4, 0,100, 10, 8, 0, IRON, HI_METAL),
XARMOR("shield of reflection", "polished silver shield",
X 0, 1, 0, REFLECTING, 3, 0, 50, 50, 8, 0, SILVER, HI_SILVER),
X
X#ifdef TOURIST
X/* shirt */
XARMOR("Hawaiian shirt", NULL,
X 1, 0, 0, 0, 10, 0, 5, 3, 10, 0, CLOTH, MAGENTA),
X#endif
X
X/* gloves */
XARMOR("leather gloves", "old gloves",
X 0, 0, 0, 0, 16, 1, 10, 8, 9, 0, LEATHER, HI_LEATHER),
XARMOR("gauntlets of fumbling", "padded gloves",
X 0, 1, 0, FUMBLING, 8, 1, 10, 50, 9, 0, LEATHER, HI_LEATHER),
XARMOR("gauntlets of power", "riding gloves",
X 0, 1, 0, 0, 8, 1, 30, 50, 9, 0, IRON, BROWN),
XARMOR("gauntlets of dexterity", "fencing gloves",
X 0, 1, 0, 0, 8, 1, 10, 50, 9, 0, LEATHER, HI_LEATHER),
X
X/* boots */
XARMOR("low boots", "walking shoes",
X 0, 0, 0, 0, 25, 2, 10, 8, 9, 0, LEATHER, HI_LEATHER),
XARMOR("iron shoes", "hard shoes",
X 0, 0, 0, 0, 7, 2, 50, 16, 8, 0, IRON, HI_METAL),
XARMOR("high boots", "jackboots",
X 0, 0, 0, 0, 15, 2, 20, 12, 8, 0, LEATHER, HI_LEATHER),
XARMOR("speed boots", "combat boots",
X 0, 1, 0, FAST, 12, 2, 20, 50, 9, 0, LEATHER, HI_LEATHER),
XARMOR("water walking boots", "jungle boots",
X 0, 1, 0, WWALKING, 12, 2, 20, 50, 9, 0, LEATHER, HI_LEATHER),
XARMOR("jumping boots", "hiking boots",
X 0, 1, 0, JUMPING, 12, 2, 20, 50, 9, 0, LEATHER, HI_LEATHER),
XARMOR("elven boots", "mud boots",
X 0, 1, 0, STEALTH, 12, 2, 15, 8, 9, 0, LEATHER, HI_LEATHER),
XARMOR("fumble boots", "riding boots",
X 0, 1, 0, FUMBLING, 12, 2, 20, 30, 9, 0, LEATHER, HI_LEATHER),
XARMOR("levitation boots", "snow boots",
X 0, 1, 0, LEVITATION, 12, 2, 15, 30, 9, 0, LEATHER, HI_LEATHER),
X#undef ARMOR
X
X/* rings ... */
X#define RING(name,stone,power,cost,mgc,spec,metal,color) OBJECT( \
X OBJ(name,stone), BITS(0,0,spec,0,mgc,spec,0,0,0,metal), \
X power, RING_CLASS, 0, 0, 3, cost, 0, 0, 0, 0, 15, color )
XRING("adornment", "wooden", ADORNED, 100, 0, 1, WOOD, HI_WOOD),
XRING("gain strength", "granite", 0, 150, 1, 1, MINERAL, HI_MINERAL),
XRING("increase damage", "coral", 0, 150, 1, 1, MINERAL, ORANGE_COLORED),
XRING("protection", "black onyx", PROTECTION, 100, 1, 1, MINERAL, BLACK),
XRING("regeneration", "moonstone", REGENERATION, 200, 1, 0, MINERAL, HI_MINERAL),
XRING("searching", "tiger eye", SEARCHING, 200, 1, 0, GEMSTONE, BROWN),
XRING("stealth", "jade", STEALTH, 100, 1, 0, GEMSTONE, GREEN),
XRING("levitation", "agate", LEVITATION, 200, 1, 0, GEMSTONE, RED),
XRING("hunger", "topaz", HUNGER, 100, 1, 0, GEMSTONE, CYAN),
XRING("aggravate monster", "sapphire", AGGRAVATE_MONSTER,
X 150, 1, 0, GEMSTONE, BLUE),
XRING("conflict", "ruby", CONFLICT, 300, 1, 0, GEMSTONE, RED),
XRING("warning", "diamond", WARNING, 100, 1, 0, GEMSTONE, WHITE),
XRING("poison resistance", "pearl", POISON_RES, 150, 1, 0, IRON, WHITE),
XRING("fire resistance", "iron", FIRE_RES, 200, 1, 0, IRON, HI_METAL),
XRING("cold resistance", "brass", COLD_RES, 150, 1, 0, COPPER, HI_COPPER),
XRING("shock resistance", "copper", SHOCK_RES, 150, 1, 0, COPPER, HI_COPPER),
XRING("teleportation", "silver", TELEPORT, 200, 1, 0, SILVER, HI_SILVER),
XRING("teleport control", "gold", TELEPORT_CONTROL,
X 300, 1, 0, GOLD, HI_GOLD),
X#ifdef POLYSELF
XRING("polymorph", "ivory", POLYMORPH, 300, 1, 0, 0, WHITE),
XRING("polymorph control", "emerald", POLYMORPH_CONTROL,
X 300, 1, 0, GEMSTONE, BRIGHT_GREEN),
X#endif
XRING("invisibility", "wire", INVIS, 150, 1, 0, IRON, HI_METAL),
XRING("see invisible", "engagement", SEE_INVIS, 150, 1, 0, IRON, HI_METAL),
XRING("protection from shape changers", "shiny", PROT_FROM_SHAPE_CHANGERS,
X 100, 1, 0, IRON, BRIGHT_CYAN),
X#undef RING
X
X/* amulets ... - THE Amulet comes last because it is special */
X#define AMULET(name,desc,power,prob) OBJECT( \
X OBJ(name,desc), BITS(0,0,0,0,1,0,0,0,0,IRON), power, \
X AMULET_CLASS, prob, 0, 20, 150, 0, 0, 0, 0, 20, HI_METAL )
X
XAMULET("amulet of ESP", "circular", TELEPAT, 180),
XAMULET("amulet of life saving", "spherical", LIFESAVED, 80),
XAMULET("amulet of strangulation", "oval", STRANGLED, 140),
XAMULET("amulet of restful sleep", "triangular", SLEEPING, 140),
XAMULET("amulet versus poison", "pyramidal", POISON_RES, 170),
XAMULET("amulet of change", "square", 0, 140),
X /* POLYMORPH */
XAMULET("amulet of reflection", "hexagonal", REFLECTING, 80),
XAMULET("amulet of magical breathing", "octagonal", MAGICAL_BREATHING, 70),
XOBJECT(OBJ("cheap plastic imitation of the Amulet of Yendor",
X "Amulet of Yendor"), BITS(0,0,1,0,0,0,0,0,0,PLASTIC), 0,
X AMULET_CLASS, 0, 0, 20, 0, 0, 0, 0, 0, 1, HI_METAL),
XOBJECT(OBJ("Amulet of Yendor",NULL), BITS(1,0,1,0,1,0,1,0,0,MITHRIL), 0,
X AMULET_CLASS, 0, 0, 20, 3500, 0, 0, 0, 0, 20, HI_METAL),
X#undef AMULET
X
X/* tools ... */
X/* tools with weapon characteristics come last */
X#define TOOL(name,desc,kn,mrg,mgc,chg,prob,wt,cost,material,color) OBJECT( \
X OBJ(name,desc), BITS(kn,mrg,chg,0,mgc,chg,0,0,0,material), 0, \
X TOOL_CLASS, prob, 0, \
X wt, cost, 0, 0, 0, 0, wt, color )
X#define CONTAINER(name,desc,kn,mgc,chg,prob,wt,cost,material,color) OBJECT( \
X OBJ(name,desc), BITS(kn,0,chg,1,mgc,chg,0,0,0,material), 0, \
X TOOL_CLASS, prob, 0, \
X wt, cost, 0, 0, 0, 0, wt, color )
X#define WEPTOOL(name,desc,kn,mgc,bi,prob,wt,cost,sdam,ldam,hitbon,material,color) OBJECT( \
X OBJ(name,desc), BITS(kn,0,1,0,mgc,1,0,bi,0,material), 0, \
X TOOL_CLASS, prob, 0, \
X wt, cost, sdam, ldam, hitbon, 0, wt, color )
X/* containers */
XCONTAINER("large box", NULL, 1, 0, 0, 40,350, 8, WOOD, HI_WOOD),
XCONTAINER("chest", NULL, 1, 0, 0, 35,600, 16, WOOD, HI_WOOD),
XCONTAINER("ice box", NULL, 1, 0, 0, 5,900, 42, PLASTIC, WHITE),
XCONTAINER("sack", "bag", 0, 0, 0, 35, 15, 2, CLOTH, HI_CLOTH),
XCONTAINER("oilskin sack", "bag", 0, 0, 0, 5, 15, 100, CLOTH, HI_CLOTH),
XCONTAINER("bag of holding", "bag", 0, 1, 0, 20, 15, 100, CLOTH, HI_CLOTH),
XCONTAINER("bag of tricks", "bag", 0, 1, 1, 20, 15, 100, CLOTH, HI_CLOTH),
X#undef CONTAINER
X/* lock opening tools */
XTOOL("skeleton key", "key", 0, 0, 0, 0, 80, 3, 10, IRON, HI_METAL),
X#ifdef TOURIST
XTOOL("lock pick", NULL, 1, 0, 0, 0, 60, 4, 20, IRON, HI_METAL),
XTOOL("credit card", NULL, 1, 0, 0, 0, 15, 1, 10, PLASTIC, WHITE),
X#else
XTOOL("lock pick", NULL, 1, 0, 0, 0, 75, 4, 20, IRON, HI_METAL),
X#endif
X/* light sources */
XTOOL("tallow candle", "candle", 0, 1, 0, 0, 20, 2, 10, WAX, WHITE),
XTOOL("wax candle", "candle", 0, 1, 0, 0, 5, 2, 20, WAX, WHITE),
X#ifdef WALKIES
XTOOL("brass lantern", NULL, 1, 0, 0, 0, 30,100, 10, COPPER, YELLOW),
XTOOL("oil lamp", "lamp", 0, 0, 0, 0, 45, 80, 10, COPPER, YELLOW),
X#else
XTOOL("brass lantern", NULL, 1, 0, 0, 0, 45,100, 10, COPPER, YELLOW),
XTOOL("oil lamp", "lamp", 0, 0, 0, 0, 75, 80, 10, COPPER, YELLOW),
X#endif
XTOOL("magic lamp", "lamp", 0, 0, 1, 0, 15, 80, 50, COPPER, YELLOW),
X/* other tools */
X#ifdef TOURIST
XTOOL("expensive camera", NULL, 1, 0, 0, 0, 15, 30, 200, PLASTIC, BLACK),
XTOOL("mirror", "looking glass", 0, 0, 0, 0, 45, 13, 10, GLASS, SILVER),
X#else
XTOOL("mirror", "looking glass", 0, 0, 0, 0, 60, 13, 10, GLASS, SILVER),
X#endif
XTOOL("crystal ball", "glass orb",
X 0, 0, 1, 1, 15,150, 60, GLASS, HI_GLASS),
XTOOL("blindfold", NULL, 1, 0, 0, 0, 55, 2, 20, CLOTH, BLACK),
X#ifdef WALKIES
XTOOL("towel", NULL, 1, 0, 0, 0, 50, 2, 50, CLOTH, MAGENTA),
XTOOL("leash", NULL, 1, 0, 0, 0, 70, 12, 20, LEATHER, HI_LEATHER),
X#else
XTOOL("towel", NULL, 1, 0, 0, 0, 75, 3, 50, CLOTH, MAGENTA),
X#endif
XTOOL("stethoscope", NULL, 1, 0, 0, 0, 25, 4, 75, IRON, HI_METAL),
XTOOL("tinning kit", NULL, 1, 0, 0, 0, 15,100, 30, IRON, HI_METAL),
XTOOL("tin opener", NULL, 1, 0, 0, 0, 35, 4, 30, IRON, HI_METAL),
XTOOL("can of grease", NULL, 1, 0, 0, 1, 15, 15, 20, IRON, HI_METAL),
XTOOL("figurine", NULL, 1, 0, 1, 0, 25, 50, 80, MINERAL, HI_MINERAL),
XTOOL("magic marker", NULL, 1, 0, 1, 1, 15, 2, 50, PLASTIC, RED),
X/* instruments */
XTOOL("tin whistle", "whistle",
X 0, 0, 0, 0, 105, 3, 10, METAL, HI_METAL),
XTOOL("magic whistle", "whistle",
X 0, 0, 1, 0, 30, 3, 10, METAL, HI_METAL),
X/* "If tin whistles are made out of tin, what do they make foghorns out of?" */
XTOOL("wooden flute", "flute", 0, 0, 0, 0, 4, 5, 12, WOOD, HI_WOOD),
XTOOL("magic flute", "flute", 0, 0, 1, 1, 2, 5, 36, WOOD, HI_WOOD),
XTOOL("tooled horn", "horn", 0, 0, 0, 0, 5, 18, 15, BONE, WHITE),
XTOOL("frost horn", "horn", 0, 0, 1, 1, 2, 18, 50, BONE, WHITE),
XTOOL("fire horn", "horn", 0, 0, 1, 1, 2, 18, 50, BONE, WHITE),
XTOOL("horn of plenty", "horn", 0, 0, 1, 1, 2, 18, 50, BONE, WHITE),
XTOOL("wooden harp", "harp", 0, 0, 1, 0, 4, 30, 50, WOOD, HI_WOOD),
XTOOL("magic harp", "harp", 0, 0, 1, 1, 2, 30, 50, WOOD, HI_WOOD),
XTOOL("bell", NULL, 1, 0, 0, 0, 2, 30, 50, COPPER, HI_COPPER),
XTOOL("bugle", NULL, 1, 0, 0, 0, 4, 10, 15, COPPER, HI_COPPER),
XTOOL("leather drum", "drum", 0, 0, 0, 0, 4, 25, 25, LEATHER, HI_LEATHER),
XTOOL("drum of earthquake", "drum",
X 0, 0, 1, 1, 2, 25, 25, LEATHER, HI_LEATHER),
X/* tools useful as weapons */
XWEPTOOL("pick-axe", NULL, 1, 0, 1, 20, 100, 50,
X 6, 3, 0, IRON, HI_METAL),
XWEPTOOL("unicorn horn", NULL, 1, 1, 1, 0, 20, 100,
X 12, 12, 0, BONE, WHITE),
X/* two special, one of each kind, "tools" */
XOBJECT(OBJ("Candelabrum of Invocation", "candelabrum"),
X BITS(0,0,1,0,1,0,1,0,0,GOLD), 0,
X TOOL_CLASS, 0, 0,10, 3000, 0, 0, 0, 0, 200, HI_GOLD),
XOBJECT(OBJ("Bell of Opening", "silver bell"),
X BITS(0,0,1,0,1,0,1,0,0,SILVER), 0,
X TOOL_CLASS, 0, 0,10, 1000, 0, 0, 0, 0, 50, HI_SILVER),
X#undef TOOL
X#undef WEPTOOL
X
X/* comestibles ... */
X#define FOOD(name,prob,delay,wt,uk,tin,nutrition,color) OBJECT( \
X OBJ(name,NULL), BITS(1,1,uk,0,0,0,0,0,0,tin), 0, \
X FOOD_CLASS, prob, delay, \
X wt, nutrition/20 + 5, 0, 0, 0, 0, nutrition, color )
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 FOOD("tripe ration", 142, 2, 10, 0, FLESH, 200, BROWN),
X FOOD("corpse", 0, 1, 0, 0, FLESH, 0, BROWN),
X FOOD("egg", 85, 1, 1, 1, FLESH, 80, WHITE),
X /* fruits & veggies */
X FOOD("apple", 15, 1, 2, 0, VEGGY, 50, RED),
X FOOD("orange", 10, 1, 2, 0, VEGGY, 80, ORANGE_COLORED),
X FOOD("pear", 10, 1, 2, 0, VEGGY, 50, BRIGHT_GREEN),
X FOOD("melon", 10, 1, 5, 0, VEGGY, 100, BRIGHT_GREEN),
X FOOD("banana", 10, 1, 2, 0, VEGGY, 80, YELLOW),
X FOOD("carrot", 15, 1, 2, 0, VEGGY, 50, ORANGE_COLORED),
X FOOD("sprig of wolfsbane", 7, 1, 1, 0, VEGGY, 40, GREEN),
X FOOD("clove of garlic", 7, 1, 1, 0, VEGGY, 40, WHITE),
X#ifdef TUTTI_FRUTTI
X FOOD("slime mold", 75, 1, 5, 0, VEGGY, 250, HI_ORGANIC),
X#else
X FOOD("slice of pizza", 75, 1, 3, 0, VEGGY, 250, RED),
X#endif
X /* human food */
X FOOD("lump of royal jelly", 0, 1, 2, 0, VEGGY, 200, YELLOW),
X FOOD("cream pie", 25, 1, 10, 0, VEGGY, 100, WHITE),
X FOOD("candy bar", 13, 1, 2, 0, VEGGY, 100, BROWN),
X FOOD("fortune cookie", 55, 1, 1, 0, VEGGY, 40, BROWN),
X FOOD("pancake", 25, 2, 2, 0, VEGGY, 200, BROWN),
X FOOD("lembas wafer", 20, 2, 5, 0, VEGGY, 800, WHITE),
X FOOD("cram ration", 20, 3, 15, 0, VEGGY, 600, HI_ORGANIC),
X FOOD("food ration", 381, 5, 20, 0, VEGGY, 800, HI_ORGANIC),
X#ifdef ARMY
X FOOD("K-ration", 0, 1, 10, 0, VEGGY, 400, HI_ORGANIC),
X FOOD("C-ration", 0, 1, 10, 0, VEGGY, 300, HI_ORGANIC),
X#endif
X FOOD("tin", 75, 0, 10, 1, METAL, 0, HI_METAL),
X#undef FOOD
X
X/* potions ... */
X#define POTION(name,desc,mgc,power,prob,cost,color) OBJECT( \
X OBJ(name,desc), BITS(0,1,0,0,mgc,0,0,0,0,GLASS), power, \
X POTION_CLASS, prob, 0, 20, cost, 0, 0, 0, 0, 10, color )
XPOTION("gain ability", "ruby", 1, 0, 45, 300, RED),
XPOTION("restore ability", "pink", 1, 0, 45, 100, BRIGHT_MAGENTA),
XPOTION("confusion", "orange", 1, CONFUSION, 45, 100, ORANGE_COLORED),
XPOTION("blindness", "yellow", 1, BLINDED, 45, 150, YELLOW),
XPOTION("paralysis", "emerald", 1, 0, 45, 300, BRIGHT_GREEN),
XPOTION("speed", "dark green", 1, FAST, 45, 200, GREEN),
XPOTION("levitation", "cyan", 1, LEVITATION, 45, 200, CYAN),
XPOTION("hallucination", "sky blue", 1, HALLUC, 45, 100, CYAN),
XPOTION("invisibility", "brilliant blue", 1, INVIS, 45, 150, BRIGHT_BLUE),
XPOTION("see invisible", "magenta", 1, SEE_INVIS, 45, 50, MAGENTA),
XPOTION("healing", "purple-red", 1, 0, 65, 100, MAGENTA),
XPOTION("extra healing", "puce", 1, 0, 50, 100, RED),
XPOTION("gain level", "milky", 1, 0, 20, 300, WHITE),
XPOTION("enlightenment", "swirly", 1, 0, 20, 200, BROWN),
XPOTION("monster detection", "bubbly", 1, 0, 45, 150, WHITE),
XPOTION("object detection", "smoky", 1, 0, 45, 150, GRAY),
XPOTION("gain energy", "cloudy", 1, 0, 45, 150, WHITE),
XPOTION("booze", "brown", 0, 0, 45, 50, BROWN),
XPOTION("sickness", "fizzy", 0, 0, 45, 50, CYAN),
XPOTION("fruit juice", "dark", 0, 0, 45, 50, BLACK),
XPOTION("water", "clear", 0, 0, 125, 100, CYAN),
X#undef POTION
X
X/* scrolls ... */
X#define SCROLL(name,text,mgc,prob,cost) OBJECT( \
X OBJ(name,text), BITS(0,1,0,0,mgc,0,0,0,0,PAPER), 0, \
X SCROLL_CLASS, prob, 0, 5, cost, 0, 0, 0, 0, 6, HI_PAPER )
X SCROLL("enchant armor", "ZELGO MER", 1, 63, 80),
X SCROLL("destroy armor", "JUYED AWK YACC", 1, 45, 100),
X SCROLL("confuse monster", "NR 9", 1, 53, 100),
X SCROLL("scare monster", "XIXAXA XOXAXA XUXAXA", 1, 35, 100),
X SCROLL("remove curse", "PRATYAVAYAH", 1, 65, 80),
X SCROLL("enchant weapon", "DAIYEN FOOELS", 1, 85, 60),
X SCROLL("create monster", "LEP GEX VEN ZEA", 1, 45, 200),
X SCROLL("taming", "PRIRUTSENIE", 1, 15, 200),
X SCROLL("genocide", "ELBIB YLOH", 1, 15, 300),
X SCROLL("light", "VERR YED HORRE", 1, 95, 50),
X SCROLL("teleportation", "VENZAR BORGAVVE", 1, 55, 100),
X SCROLL("gold detection", "THARR", 1, 33, 100),
X SCROLL("food detection", "YUM YUM", 1, 25, 100),
X SCROLL("identify", "KERNOD WEL", 1, 185, 20),
X SCROLL("magic mapping", "ELAM EBOW", 1, 45, 100),
X SCROLL("amnesia", "DUAM XNAHT", 1, 35, 200),
X SCROLL("fire", "ANDOVA BEGARIN", 1, 48, 100),
X SCROLL("punishment", "VE FORBRYDERNE", 1, 15, 300),
X SCROLL("charging", "HACKEM MUCHE", 1, 15, 300),
X SCROLL(NULL, "VELOX NEB", 1, 0, 100),
X SCROLL(NULL, "FOOBIE BLETCH", 1, 0, 100),
X SCROLL(NULL, "TEMOV", 1, 0, 100),
X SCROLL(NULL, "GARVEN DEH", 1, 0, 100),
X SCROLL(NULL, "READ ME", 1, 0, 100),
X SCROLL(NULL, "KIRJE", 1, 0, 100),
X /* these must come last because they have special descriptions */
X#ifdef MAIL
X SCROLL("mail", "stamped", 0, 0, 0),
X#endif
X SCROLL("blank paper", "unlabeled", 0, 28, 60),
X#undef SCROLL
X
X/* spellbooks ... */
X#define SPELL(name,desc,prob,delay,level,mgc,dir,color) OBJECT( \
X OBJ(name,desc), BITS(0,1,0,0,mgc,0,0,0,dir,PAPER), 0, \
X SPBOOK_CLASS, prob, delay, \
X 50, level*100, 0, 0, 0, level, 20, color )
XSPELL("dig", "parchment", 22, 6, 5, 1, RAY, HI_PAPER),
XSPELL("magic missile", "vellum", 45, 3, 2, 1, RAY, HI_PAPER),
XSPELL("fireball", "ragged", 20, 6, 4, 1, RAY, HI_PAPER),
XSPELL("cone of cold", "dog eared", 10, 8, 5, 1, RAY, HI_PAPER),
XSPELL("sleep", "mottled", 50, 1, 1, 1, RAY, HI_PAPER),
XSPELL("finger of death", "stained", 5, 10, 7, 1, RAY, HI_PAPER),
XSPELL("light", "cloth", 45, 1, 1, 1, NODIR, HI_CLOTH),
XSPELL("detect monsters", "leather", 45, 1, 1, 1, NODIR, HI_LEATHER),
XSPELL("healing", "white", 40, 2, 1, 1, NODIR, WHITE),
XSPELL("knock", "pink", 36, 1, 1, 1, IMMEDIATE, BRIGHT_MAGENTA),
XSPELL("force bolt", "red", 35, 2, 1, 1, IMMEDIATE, RED),
XSPELL("confuse monster", "orange", 37, 2, 2, 1, IMMEDIATE, ORANGE_COLORED),
XSPELL("cure blindness", "yellow", 27, 2, 2, 1, IMMEDIATE, YELLOW),
XSPELL("slow monster", "light green", 37, 2, 2, 1, IMMEDIATE, BRIGHT_GREEN),
XSPELL("wizard lock", "dark green", 35, 3, 2, 1, IMMEDIATE, GREEN),
XSPELL("create monster", "turquoise", 37, 3, 2, 1, NODIR, BRIGHT_CYAN),
XSPELL("detect food", "cyan", 37, 3, 2, 1, NODIR, CYAN),
XSPELL("cause fear", "light blue", 25, 3, 3, 1, NODIR, BRIGHT_BLUE),
XSPELL("clairvoyance", "dark blue", 15, 3, 3, 1, NODIR, BLUE),
XSPELL("cure sickness", "indigo", 32, 3, 3, 1, NODIR, BLUE),
XSPELL("charm monster", "magenta", 20, 3, 3, 1, IMMEDIATE, MAGENTA),
XSPELL("haste self", "purple", 33, 4, 3, 1, NODIR, MAGENTA),
XSPELL("detect unseen", "violet", 20, 4, 3, 1, NODIR, MAGENTA),
XSPELL("levitation", "tan", 20, 4, 4, 1, NODIR, BROWN),
XSPELL("extra healing", "plaid", 35, 5, 3, 1, NODIR, GREEN),
XSPELL("restore ability", "light brown", 25, 5, 4, 1, NODIR, BROWN),
XSPELL("invisibility", "dark brown", 32, 5, 4, 1, NODIR, BROWN),
XSPELL("detect treasure", "gray", 25, 5, 4, 1, NODIR, GRAY),
XSPELL("remove curse", "white", 25, 5, 5, 1, NODIR, WHITE),
XSPELL("magic mapping", "dusty", 18, 7, 5, 1, NODIR, HI_PAPER),
XSPELL("identify", "bronze", 25, 8, 5, 1, NODIR, HI_COPPER),
XSPELL("turn undead", "copper", 17, 8, 6, 1, IMMEDIATE, HI_COPPER),
XSPELL("polymorph", "silver", 10, 8, 6, 1, IMMEDIATE, HI_SILVER),
XSPELL("teleport away", "gold", 15, 6, 6, 1, IMMEDIATE, HI_GOLD),
XSPELL("create familiar", "glittering", 10, 7, 6, 1, NODIR, WHITE),
XSPELL("cancellation", "shining", 15, 8, 7, 1, IMMEDIATE, WHITE),
XSPELL(NULL, "dull", 0, 0, 0, 1, 0, HI_PAPER),
XSPELL(NULL, "thin", 0, 0, 0, 1, 0, HI_PAPER),
XSPELL(NULL, "thick", 0, 0, 0, 1, 0, HI_PAPER),
X/* blank spellbook must come last because it retains its description */
XSPELL("blank paper", "plain", 20, 0, 0, 0, 0, HI_PAPER),
X/* a special, one of a kind, spellbook */
XOBJECT(OBJ("Book of the Dead", "papyrus"), BITS(0,0,1,0,1,0,1,0,0,PAPER), 0,
X SPBOOK_CLASS, 0, 0,20, 3500, 0, 0, 0, 7, 20, HI_PAPER),
X#undef SPELL
X
X/* wands ... */
X#define WAND(name,typ,prob,cost,mgc,dir,metal,color) OBJECT( \
X OBJ(name,typ), BITS(0,0,1,0,mgc,1,0,0,dir,metal), 0, WAND_CLASS, \
X prob, 0, 7, cost, 0, 0, 0, 0, 30, color )
XWAND("light", "glass", 95, 100, 1, NODIR, GLASS, HI_GLASS),
XWAND("secret door detection", "balsa", 50, 150, 1, NODIR, WOOD, HI_WOOD),
XWAND("create monster", "maple", 45, 200, 1, NODIR, WOOD, HI_WOOD),
XWAND("wishing", "pine", 5, 500, 1, NODIR, WOOD, HI_WOOD),
XWAND("nothing", "oak", 25, 100, 0, IMMEDIATE, WOOD, HI_WOOD),
XWAND("striking", "ebony", 75, 150, 1, IMMEDIATE, WOOD, HI_WOOD),
XWAND("make invisible", "marble", 45, 150, 1, IMMEDIATE, MINERAL, HI_MINERAL),
XWAND("slow monster", "tin", 55, 150, 1, IMMEDIATE, METAL, HI_METAL),
XWAND("speed monster", "brass", 55, 150, 1, IMMEDIATE, COPPER, HI_COPPER),
XWAND("undead turning", "copper", 55, 150, 1, IMMEDIATE, COPPER, HI_COPPER),
XWAND("polymorph", "silver", 45, 200, 1, IMMEDIATE, SILVER, HI_SILVER),
XWAND("cancellation", "platinum", 45, 200, 1, IMMEDIATE, PLATINUM, WHITE),
XWAND("teleportation", "iridium", 45, 200, 1, IMMEDIATE, METAL, BRIGHT_CYAN),
XWAND("opening", "zinc", 25, 150, 1, IMMEDIATE, METAL, HI_METAL),
XWAND("locking", "aluminum", 25, 150, 1, IMMEDIATE, METAL, HI_METAL),
XWAND("probing", "uranium", 30, 150, 1, IMMEDIATE, METAL, HI_METAL),
XWAND("digging", "iron", 55, 150, 1, RAY, IRON, HI_METAL),
XWAND("magic missile", "steel", 50, 150, 1, RAY, IRON, HI_METAL),
XWAND("fire", "hexagonal", 40, 175, 1, RAY, IRON, HI_METAL),
XWAND("cold", "short", 40, 175, 1, RAY, IRON, HI_METAL),
XWAND("sleep", "runed", 50, 175, 1, RAY, IRON, HI_METAL),
XWAND("death", "long", 5, 500, 1, RAY, IRON, HI_METAL),
XWAND("lightning", "curved", 40, 175, 1, RAY, IRON, HI_METAL),
XWAND(NULL, "forked", 0, 150, 1, 0, WOOD, HI_WOOD),
XWAND(NULL, "spiked", 0, 150, 1, 0, IRON, HI_METAL),
XWAND(NULL, "jeweled", 0, 150, 1, 0, IRON, HI_MINERAL),
X#undef WAND
X
X/* coins ... - so far, gold is all there is */
X#define COIN(name,prob,metal) OBJECT( \
X OBJ(name,NULL), BITS(0,1,0,0,0,0,0,0,0,metal), 0, \
X GOLD_CLASS, prob, 0, 1, 0, 0, 0, 0, 0, 0, HI_GOLD )
X COIN("gold piece", 1000, GOLD),
X#undef COIN
X
X/* gems ... - includes stones but not boulders */
X#define GEM(name,desc,prob,wt,gval,nutr,glass,color) OBJECT( \
X OBJ(name,desc), BITS(0,1,0,0,0,0,0,0,0,glass), 0, \
X GEM_CLASS, prob, 0, 1, gval, 3, 3, 0, WP_SLING, nutr, color )
X#define ROCK(name,desc,kn,prob,wt,gval,mgc,nutr,glass,color) OBJECT( \
X OBJ(name,desc), BITS(kn,1,0,0,mgc,0,0,0,0,glass), 0, \
X GEM_CLASS, prob, 0, wt, gval, 3, 3, 0, WP_SLING, nutr, color )
XGEM("dilithium crystal", "white", 3, 1, 4500, 15, GEMSTONE, WHITE),
XGEM("diamond", "white", 4, 1, 4000, 15, GEMSTONE, WHITE),
XGEM("ruby", "red", 5, 1, 3500, 15, GEMSTONE, RED),
XGEM("sapphire", "blue", 6, 1, 3000, 15, GEMSTONE, BLUE),
XGEM("emerald", "green", 7, 1, 2500, 15, GEMSTONE, GREEN),
XGEM("turquoise", "green", 8, 1, 2000, 15, GEMSTONE, GREEN),
XGEM("aquamarine", "green", 10, 1, 1500, 15, GEMSTONE, GREEN),
XGEM("amber", "yellowish brown", 11, 1, 1000, 15, GEMSTONE, BROWN),
XGEM("topaz", "yellowish brown", 13, 1, 900, 15, GEMSTONE, BROWN),
XGEM("opal", "white", 15, 1, 800, 15, GEMSTONE, WHITE),
XGEM("garnet", "red", 17, 1, 700, 15, GEMSTONE, RED),
XGEM("amethyst", "violet", 19, 1, 600, 15, GEMSTONE, MAGENTA),
XGEM("jasper", "red", 21, 1, 500, 15, GEMSTONE, RED),
XGEM("fluorite", "violet", 22, 1, 400, 15, GEMSTONE, MAGENTA),
XGEM("jade", "green", 23, 1, 300, 15, GEMSTONE, GREEN),
XGEM("worthless piece of white glass", "white", 116, 1, 0, 6, GLASS, WHITE),
XGEM("worthless piece of blue glass", "blue", 116, 1, 0, 6, GLASS, BLUE),
XGEM("worthless piece of red glass", "red", 116, 1, 0, 6, GLASS, RED),
XGEM("worthless piece of yellowish brown glass", "yellowish brown",
X 116, 1, 0, 6, GLASS, BROWN),
XGEM("worthless piece of green glass", "green", 116, 1, 0, 6, GLASS, GREEN),
XGEM("worthless piece of violet glass", "violet",116, 1, 0, 6, GLASS, MAGENTA),
XROCK("luckstone", "gray", 0, 10, 10, 60, 1, 10, MINERAL, GRAY),
XROCK("loadstone", "gray", 0, 10,500, 1, 1, 10, MINERAL, GRAY),
XROCK("rock", NULL, 1,100, 10, 0, 0, 10, MINERAL, GRAY),
X#undef GEM
X#undef ROCK
X
X/* miscellaneous ... */
X/* Note: boulders and rocks are not normally created at random; the
X * probabilities only come into effect when you try to polymorph them.
X * Boulders and statues weigh more than MAX_CARR_CAP.
X */
XOBJECT(OBJ("boulder",NULL), BITS(1,0,0,0,0,0,0,1,0,MINERAL), 0,
X ROCK_CLASS, 100, 0, 6000, 0, 20, 20, 0, 0, 2000, HI_MINERAL),
XOBJECT(OBJ("statue", NULL), BITS(1,0,0,1,0,0,0,0,0,MINERAL), 0,
X ROCK_CLASS, 900, 0, 2500, 0, 20, 20, 0, 0, 2500, HI_MINERAL),
XOBJECT(OBJ("heavy iron ball", NULL), BITS(1,0,0,0,0,0,0,0,0,IRON), 0,
X BALL_CLASS, 1000, 0, 480, 10, 0, 0, 0, 0, 200, HI_METAL),
XOBJECT(OBJ("iron chain", NULL), BITS(1,0,0,0,0,0,0,0,0,IRON), 0,
X CHAIN_CLASS, 1000, 0, 120, 0, 0, 0, 0, 0, 200, HI_METAL),
XOBJECT(OBJ("blinding venom", "splash of venom"),
X BITS(0,1,0,0,0,0,0,0,0,LIQUID), 0,
X VENOM_CLASS, 500, 0, 1, 0, 0, 0, 0, 0, 0, HI_ORGANIC),
XOBJECT(OBJ("acid venom", "splash of venom"),
X BITS(0,1,0,0,0,0,0,0,0,LIQUID), 0,
X VENOM_CLASS, 500, 0, 1, 0, 6, 6, 0, 0, 0, HI_ORGANIC),
X /* +d6 small or large */
X
X/* fencepost -- name [1st arg] *must* be NULL */
X OBJECT(OBJ(NULL,NULL), BITS(0,0,0,0,0,0,0,0,0,0), 0,
X ILLOBJ_CLASS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
X}; /* objects[] */
X
X#ifndef OBJECTS_PASS_2_
X
X/* perform recursive compilation for second structure */
X# undef OBJ
X# undef OBJECT
X# define OBJECTS_PASS_2_
X#include "objects.c"
X
Xvoid NDECL(objects_init);
X
X/* dummy routine used to force linkage */
Xvoid
Xobjects_init()
X{
X return;
X}
X
X#endif /* !OBJECTS_PASS_2_ */
X
X/*objects.c*/
END_OF_FILE
if test 41735 -ne `wc -c <'src/objects.c'`; then
echo shar: \"'src/objects.c'\" unpacked with wrong size!
fi
# end of 'src/objects.c'
fi
if test -f 'src/timeout.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'src/timeout.c'\"
else
echo shar: Extracting \"'src/timeout.c'\" \(11863 characters\)
sed "s/^X//" >'src/timeout.c' <<'END_OF_FILE'
X/* SCCS Id: @(#)timeout.c 3.1 92/11/01 */
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* NetHack may be freely redistributed. See license for details. */
X
X#include "hack.h"
X
XSTATIC_DCL void NDECL(stoned_dialogue);
XSTATIC_DCL void NDECL(vomiting_dialogue);
XSTATIC_DCL void NDECL(choke_dialogue);
XSTATIC_DCL void FDECL(hatch_it, (struct obj *));
X
Xstatic void FDECL(age_candle, (struct obj *));
X
X#ifdef OVLB
X
X/* He is being petrified - dialogue by inmet!tower */
Xstatic const char NEARDATA *stoned_texts[] = {
X "You are slowing down.", /* 5 */
X "Your limbs are stiffening.", /* 4 */
X "Your limbs have turned to stone.", /* 3 */
X "You have turned to stone.", /* 2 */
X "You are a statue." /* 1 */
X};
X
XSTATIC_OVL void
Xstoned_dialogue() {
X register long i = (Stoned & TIMEOUT);
X
X if(i > 0 && i <= SIZE(stoned_texts))
X pline(stoned_texts[SIZE(stoned_texts) - i]);
X if(i == 5)
X Fast &= ~(TIMEOUT|INTRINSIC);
X if(i == 3)
X nomul(-3);
X exercise(A_DEX, FALSE);
X}
X
X/* He is getting sicker and sicker prior to vomiting */
Xstatic const char NEARDATA *vomiting_texts[] = {
X "You are feeling mildly nauseous.", /* 14 */
X "You feel slightly confused.", /* 11 */
X "You can't seem to think straight.", /* 8 */
X "You feel incredibly sick.", /* 5 */
X "You suddenly vomit!" /* 2 */
X};
X
XSTATIC_OVL void
Xvomiting_dialogue() {
X register long i = (Vomiting & TIMEOUT) / 3L;
X
X if ((((Vomiting & TIMEOUT) % 3L) == 2) && (i >= 0)
X && (i < SIZE(vomiting_texts)))
X pline(vomiting_texts[SIZE(vomiting_texts) - i - 1]);
X
X switch ((int) i) {
X case 0:
X vomit();
X morehungry(20);
X break;
X case 2:
X make_stunned(HStun + d(2,4), FALSE);
X /* fall through */
X case 3:
X make_confused(HConfusion + d(2,4), FALSE);
X break;
X }
X exercise(A_CON, FALSE);
X}
X
Xstatic const char NEARDATA *choke_texts[] = {
X "You find it hard to breathe.",
X "You're gasping for air.",
X "You can no longer breathe.",
X "You're turning %s.",
X "You suffocate."
X};
X
XSTATIC_OVL void
Xchoke_dialogue()
X{
X register long i = (Strangled & TIMEOUT);
X
X if(i > 0 && i <= SIZE(choke_texts))
X pline(choke_texts[SIZE(choke_texts) - i], Hallucination ?
X hcolor() : blue);
X exercise(A_STR, FALSE);
X}
X
X#endif /* OVLB */
X#ifdef OVL0
X
Xvoid
Xnh_timeout()
X{
X register struct prop *upp;
X int sleeptime;
X
X if(u.uluck && moves % (u.uhave.amulet || u.ugangr ? 300 : 600) == 0) {
X /* Cursed luckstones stop bad luck from timing out; blessed luckstones
X * stop good luck from timing out; normal luckstones stop both;
X * neither is stopped if you don't have a luckstone.
X * Luck is based at 0 usually, +1 if a full moon and -1 on Friday 13th
X */
X register int time_luck = stone_luck(FALSE);
X boolean nostone = !carrying(LUCKSTONE) && !stone_luck(TRUE);
X int baseluck = (flags.moonphase == FULL_MOON) ? 1 : 0;
X
X baseluck -= (flags.friday13 ? 1 : 0);
X
X if(u.uluck > baseluck && (nostone || time_luck < 0))
X u.uluck--;
X else if(u.uluck < baseluck && (nostone || time_luck > 0))
X u.uluck++;
X }
X if(u.uinvulnerable) return; /* things past this point could kill you */
X if(Stoned) stoned_dialogue();
X if(Vomiting) vomiting_dialogue();
X if(Strangled) choke_dialogue();
X#ifdef POLYSELF
X if(u.mtimedone) if(!--u.mtimedone) rehumanize();
X#endif
X if(u.ucreamed) u.ucreamed--;
X
X for(upp = u.uprops; upp < u.uprops+SIZE(u.uprops); upp++)
X if((upp->p_flgs & TIMEOUT) && !(--upp->p_flgs & TIMEOUT)) {
X if(upp->p_tofn) (*upp->p_tofn)();
X else switch(upp - u.uprops){
X case STONED:
X if (!killer) {
X killer_format = KILLED_BY_AN;
X killer = "cockatrice";
X } done(STONING);
X break;
X case VOMITING:
X make_vomiting(0L, TRUE);
X break;
X case SICK:
X You("die from your illness.");
X killer_format = KILLED_BY_AN;
X killer = u.usick_cause;
X done(POISONING);
X break;
X case FAST:
X if (Fast & ~INTRINSIC) /* boot speed */
X ;
X else
X You("feel yourself slowing down%s.",
X Fast ? " a bit" : "");
X break;
X case CONFUSION:
X HConfusion = 1; /* So make_confused works properly */
X make_confused(0L, TRUE);
X stop_occupation();
X break;
X case STUNNED:
X HStun = 1;
X make_stunned(0L, TRUE);
X stop_occupation();
X break;
X case BLINDED:
X Blinded = 1;
X make_blinded(0L, TRUE);
X stop_occupation();
X break;
X case INVIS:
X newsym(u.ux,u.uy);
X if (!Invis && !See_invisible && !Blind)
X You("are no longer invisible.");
X stop_occupation();
X break;
X case SEE_INVIS:
X set_mimic_blocking(); /* do special mimic handling */
X see_monsters(); /* make invis mons appear */
X newsym(u.ux,u.uy); /* make self appear */
X stop_occupation();
X break;
X case WOUNDED_LEGS:
X heal_legs();
X stop_occupation();
X break;
X case HALLUC:
X HHallucination = 1;
X make_hallucinated(0L, TRUE, 0L);
X stop_occupation();
X break;
X case SLEEPING:
X if (unconscious() || Sleep_resistance)
X Sleeping += rnd(100);
X else {
X You("fall asleep.");
X sleeptime = rnd(20);
X nomul(-sleeptime);
X u.usleep = 1;
X nomovemsg = "You wake up.";
X Sleeping = sleeptime + rnd(100);
X }
X break;
X case STRANGLED:
X killer_format = KILLED_BY;
X killer = "strangulation";
X done(DIED);
X break;
X case FUMBLING:
X /* call this only when a move took place. */
X /* otherwise handle fumbling msgs locally. */
X if (!Levitation && u.umoved) {
X if (OBJ_AT(u.ux, u.uy))
X You("trip over something.");
X else if (rn2(3) && is_ice(u.ux, u.uy))
X You("%s on the ice.",
X rn2(2) ? "slip" : "slide");
X else
X switch (rn2(4)) {
X case 1:
X if (ACCESSIBLE(levl[u.ux][u.uy].typ)) { /* not POOL or STONE */
X if (Hallucination) pline("A rock bites your foot.");
X else You("trip over a rock.");
X break;
X }
X case 2:
X if (ACCESSIBLE(levl[u.ux][u.uy].typ)) { /* not POOL or STONE */
X if (Hallucination) You("slip on a banana peel.");
X else You("slip and nearly fall.");
X break;
X }
X case 3:
X You("flounder.");
X break;
X default:
X You("stumble.");
X }
X nomul(-2);
X nomovemsg = "";
X /* Fumbling can be noisy */
X if ((inv_weight() > -500)) {
X You("make a lot of noise!");
X wake_nearby();
X }
X }
X Fumbling += rnd(20);
X break;
X }
X }
X}
X
X#endif /* OVL0 */
X#ifdef OVLB
X
XSTATIC_OVL void
Xhatch_it(otmp) /* hatch the egg "otmp" if possible */
Xregister struct obj *otmp;
X{
X register struct monst *mtmp;
X#ifdef POLYSELF
X int yours = otmp->spe;
X#endif
X
X if(monstermoves-otmp->age > 200) /* very old egg - it's dead */
X otmp->corpsenm = -1;
X#ifdef LINT /* long conv. ok */
X else if(rnd(150) > 150) {
X#else
X else if(rnd((int)(monstermoves-otmp->age)) > 150) {
X#endif
X mtmp = makemon(&mons[big_to_little(otmp->corpsenm)], u.ux, u.uy);
X useup(otmp);
X if(mtmp) {
X
X if(Blind)
X You("feel something %s from your pack!",
X locomotion(mtmp->data, "drop"));
X else
X You("see %s %s out of your pack!",
X an(mtmp->data->mname),
X locomotion(mtmp->data, "drop"));
X
X#ifdef POLYSELF
X if (yours) {
X struct monst *mtmp2;
X
X pline("Its cries sound like \"%s.\"",
X flags.female ? "mommy" : "daddy");
X if (mtmp2 = tamedog(mtmp, (struct obj *)0))
X mtmp = mtmp2;
X mtmp->mtame = 20;
X while(otmp = (mtmp->minvent)) {
X mtmp->minvent = otmp->nobj;
X dealloc_obj(otmp);
X }
X return;
X }
X#endif
X if(mtmp->data->mlet == S_DRAGON) {
X struct monst *mtmp2;
X
X verbalize("Gleep!"); /* Mything eggs :-) */
X if (mtmp2 = tamedog(mtmp, (struct obj *)0))
X mtmp = mtmp2;
X while(otmp = (mtmp->minvent)) {
X mtmp->minvent = otmp->nobj;
X dealloc_obj(otmp);
X }
X }
X }
X }
X}
X
X#endif /* OVLB */
X#ifdef OVL1
X
Xvoid
Xhatch_eggs() /* hatch any eggs that have been too long in pack */
X{
X register struct obj *otmp, *otmp2;
X
X for(otmp = invent; otmp; otmp = otmp2) {
X otmp2 = otmp->nobj; /* otmp may hatch */
X if(otmp->otyp == EGG && otmp->corpsenm >= 0) hatch_it(otmp);
X /* else if (Is_container(otmp) && otmp->cobj) ... */
X /* */
X /* Check for container here and hatch with the container. */
X /* One of these days... */
X /* Maybe call hatch_eggs() with invent as a parameter so */
X /* that we can call it recursively. */
X }
X}
X
X/* Burn up lit lamps. Only applies to non-magic lamps; magic lamps stay
X * lit as long as there's a genie inside. We use obj->age to see how long
X * there is left for the lamp to burn, but this differs from the use of
X * age for corpses and eggs: for the latter items it's when the object was
X * created, but for lamps it's the number of moves remaining.
X */
Xvoid
Xburn_lamps()
X{
X register struct obj *obj;
X
X /* Note: magic lamps never go out as long as the genie's inside */
X for(obj=invent; obj; obj=obj->nobj) {
X if ((obj->otyp == OIL_LAMP || obj->otyp == BRASS_LANTERN)
X && obj->lamplit) {
X obj->age--;
X switch((int)obj->age) {
X case 150:
X case 100:
X if (obj->otyp == BRASS_LANTERN) goto advmsg;
X if (!Blind)
X Your("%s flickers.", xname(obj));
X break;
X case 50:
X if (obj->otyp == BRASS_LANTERN) goto advmsg;
X if (!Blind)
X Your("%s flickers considerably.", xname(obj));
X break;
X case 25:
X advmsg: if (!Blind) {
X if (obj->otyp == BRASS_LANTERN) {
X Your("lamp is getting dim.");
X if (Hallucination)
X pline("Batteries have not been invented yet.");
X } else
X Your("%s seems about to go out.", xname(obj));
X }
X break;
X case 0: /* even if blind you'll know */
X if (obj->otyp == BRASS_LANTERN)
X Your("lamp has run out of power.");
X else Your("%s goes out.", xname(obj));
X obj->lamplit = 0;
X obj->spe = 0;
X check_lamps();
X break;
X default: break;
X }
X }
X if ((obj->otyp == CANDELABRUM_OF_INVOCATION || Is_candle(obj)) &&
X obj->lamplit)
X age_candle(obj);
X }
X}
X
Xstatic void
Xage_candle(otmp)
Xregister struct obj *otmp;
X{
X register boolean many,
X menorah = otmp->otyp == CANDELABRUM_OF_INVOCATION;
X
X otmp->age--;
X
X if (otmp->age == 0L) {
X otmp->lamplit = 0;
X many = menorah ? otmp->spe > 1 : otmp->quan > 1L;
X if (menorah) {
X pline("%s's flame%s.",
X The(xname(otmp)), (many ? "s die" : " dies"));
X otmp->spe = 0;
X } else {
X Your("%s %s consumed! %s",
X xname(otmp), (many ? "are" : "is"),
X (Hallucination ?
X (many ? "They shriek!" : "It shrieks!") :
X Blind ? "" :
X (many ? "Their flames die." : "Its flame dies.")));
X freeinv(otmp);
X obfree(otmp, (struct obj *)0);
X }
X check_lamps();
X } else if (Blind) {
X return;
X } else if (otmp->age == 15L) {
X many = menorah ? otmp->spe > 1 : otmp->quan > 1L;
X Norep("The %scandle%s flame%s flicker%s low!",
X (menorah ? "candelabrum's " : ""),
X (many ? "s'" : "'s"),
X (many ? "s" : ""),
X (many ? "" : "s"));
X } else if (otmp->age == 75L) {
X many = menorah ? otmp->spe > 1 : otmp->quan > 1L;
X Norep("The %scandle%s getting short.",
X menorah ? "candelabrum's " : "",
X (many ? "s are" : " is"));
X }
X}
Xvoid
Xdo_storms()
X{
X int nstrike;
X register int x, y;
X int dirx, diry;
X int count;
X
X /* no lightning if not the air level or too often, even then */
X if(!Is_airlevel(&u.uz) || rn2(8))
X return;
X
X /* the number of strikes is 8-log2(nstrike) */
X for(nstrike = rnd(64); nstrike <= 64; nstrike *= 2) {
X count = 0;
X do {
X x = rnd(COLNO-1);
X y = rn2(ROWNO);
X } while (++count < 100 && levl[x][y].typ != CLOUD);
X
X if(count < 100) {
X dirx = rn2(3) - 1;
X diry = rn2(3) - 1;
X if(dirx != 0 || diry != 0)
X buzz(-15, /* "monster" LIGHTNING spell */
X 8, x, y, dirx, diry);
X }
X }
X
X if(levl[u.ux][u.uy].typ == CLOUD) {
X /* inside a cloud during a thunder storm is deafening */
X pline("Kaboom!!! Boom!! Boom!!");
X if(!u.uinvulnerable) {
X stop_occupation();
X nomul(-3);
X }
X } else
X You("hear a rumbling noise.");
X}
X#endif /* OVL1 */
X
X/*timeout.c*/
END_OF_FILE
if test 11863 -ne `wc -c <'src/timeout.c'`; then
echo shar: \"'src/timeout.c'\" unpacked with wrong size!
fi
# end of 'src/timeout.c'
fi
echo shar: End of archive 23 \(of 108\).
cp /dev/null ark23isdone
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 57 58 59 60 \
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 \
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 \
101 102 103 104 105 106 107 108 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 108 archives.
echo "Now execute 'rebuild.sh'"
rm -f ark10[0-8]isdone 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