home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume16
/
nethack31
/
part43
< prev
next >
Wrap
Internet Message Format
|
1993-02-01
|
33KB
Path: uunet!news.tek.com!master!saab!billr
From: billr@saab.CNA.TEK.COM (Bill Randle)
Newsgroups: comp.sources.games
Subject: v16i051: nethack31 - display oriented dungeons & dragons (Ver. 3.1), Part43/108
Message-ID: <4345@master.CNA.TEK.COM>
Date: 30 Jan 93 01:13:24 GMT
Sender: news@master.CNA.TEK.COM
Lines: 940
Approved: billr@saab.CNA.TEK.COM
Xref: uunet comp.sources.games:1600
Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
Posting-number: Volume 16, Issue 51
Archive-name: nethack31/Part43
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 43 (of 108)."
# Contents: src/shknam.c sys/amiga/scroll.uu util/lev_cmp.l
# win/X11/nethack.rc win/X11/nh56icon
# Wrapped by billr@saab on Wed Jan 27 16:09:03 1993
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'src/shknam.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'src/shknam.c'\"
else
echo shar: Extracting \"'src/shknam.c'\" \(14990 characters\)
sed "s/^X//" >'src/shknam.c' <<'END_OF_FILE'
X/* SCCS Id: @(#)shknam.c 3.1 92/11/14 */
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* NetHack may be freely redistributed. See license for details. */
X
X/* shknam.c -- initialize a shop */
X
X#include "hack.h"
X#include "eshk.h"
X
X#ifdef OVLB
X
Xstatic void FDECL(mkshobj_at, (const struct shclass *,int,int));
Xstatic void FDECL(findname, (char *,const char **));
Xstatic int FDECL(shkinit, (const struct shclass *,struct mkroom *));
X
Xstatic const char *shkliquors[] = {
X /* Ukraine */
X "Njezjin", "Tsjernigof", "Gomel", "Ossipewsk", "Gorlowka",
X /* N. Russia */
X "Konosja", "Weliki Oestjoeg", "Syktywkar", "Sablja",
X "Narodnaja", "Kyzyl",
X /* Silezie */
X "Walbrzych", "Swidnica", "Klodzko", "Raciborz", "Gliwice",
X "Brzeg", "Krnov", "Hradec Kralove",
X /* Schweiz */
X "Leuk", "Brig", "Brienz", "Thun", "Sarnen", "Burglen", "Elm",
X "Flims", "Vals", "Schuls", "Zum Loch",
X ""
X};
X
Xstatic const char *shkbooks[] = {
X /* Eire */
X "Skibbereen", "Kanturk", "Rath Luirc", "Ennistymon", "Lahinch",
X "Kinnegad", "Lugnaquillia", "Enniscorthy", "Gweebarra",
X "Kittamagh", "Nenagh", "Sneem", "Ballingeary", "Kilgarvan",
X "Cahersiveen", "Glenbeigh", "Kilmihil", "Kiltamagh",
X "Droichead Atha", "Inniscrone", "Clonegal", "Lisnaskea",
X "Culdaff", "Dunfanaghy", "Inishbofin", "Kesh",
X ""
X};
X
Xstatic const char *shkarmors[] = {
X /* Turquie */
X "Demirci", "Kalecik", "Boyabai", "Yildizeli", "Gaziantep",
X "Siirt", "Akhalataki", "Tirebolu", "Aksaray", "Ermenak",
X "Iskenderun", "Kadirli", "Siverek", "Pervari", "Malasgirt",
X "Bayburt", "Ayancik", "Zonguldak", "Balya", "Tefenni",
X "Artvin", "Kars", "Makharadze", "Malazgirt", "Midyat",
X "Birecik", "Kirikkale", "Alaca", "Polatli", "Nallihan",
X ""
X};
X
Xstatic const char *shkwands[] = {
X /* Wales */
X "Yr Wyddgrug", "Trallwng", "Mallwyd", "Pontarfynach",
X "Rhaeader", "Llandrindod", "Llanfair-ym-muallt",
X "Y-Fenni", "Measteg", "Rhydaman", "Beddgelert",
X "Curig", "Llanrwst", "Llanerchymedd", "Caergybi",
X /* Scotland */
X "Nairn", "Turriff", "Inverurie", "Braemar", "Lochnagar",
X "Kerloch", "Beinn a Ghlo", "Drumnadrochit", "Morven",
X "Uist", "Storr", "Sgurr na Ciche", "Cannich", "Gairloch",
X "Kyleakin", "Dunvegan",
X ""
X};
X
Xstatic const char *shkrings[] = {
X /* Hollandse familienamen */
X "Feyfer", "Flugi", "Gheel", "Havic", "Haynin", "Hoboken",
X "Imbyze", "Juyn", "Kinsky", "Massis", "Matray", "Moy",
X "Olycan", "Sadelin", "Svaving", "Tapper", "Terwen", "Wirix",
X "Ypey",
X /* Skandinaviske navne */
X "Rastegaisa", "Varjag Njarga", "Kautekeino", "Abisko",
X "Enontekis", "Rovaniemi", "Avasaksa", "Haparanda",
X "Lulea", "Gellivare", "Oeloe", "Kajaani", "Fauske",
X ""
X};
X
Xstatic const char *shkfoods[] = {
X /* Indonesia */
X "Djasinga", "Tjibarusa", "Tjiwidej", "Pengalengan",
X "Bandjar", "Parbalingga", "Bojolali", "Sarangan",
X "Ngebel", "Djombang", "Ardjawinangun", "Berbek",
X "Papar", "Baliga", "Tjisolok", "Siboga", "Banjoewangi",
X "Trenggalek", "Karangkobar", "Njalindoeng", "Pasawahan",
X "Pameunpeuk", "Patjitan", "Kediri", "Pemboeang", "Tringanoe",
X "Makin", "Tipor", "Semai", "Berhala", "Tegal", "Samoe",
X ""
X};
X
Xstatic const char *shkweapons[] = {
X /* Perigord */
X "Voulgezac", "Rouffiac", "Lerignac", "Touverac", "Guizengeard",
X "Melac", "Neuvicq", "Vanzac", "Picq", "Urignac", "Corignac",
X "Fleac", "Lonzac", "Vergt", "Queyssac", "Liorac", "Echourgnac",
X "Cazelon", "Eypau", "Carignan", "Monbazillac", "Jonzac",
X "Pons", "Jumilhac", "Fenouilledes", "Laguiolet", "Saujon",
X "Eymoutiers", "Eygurande", "Eauze", "Labouheyre",
X ""
X};
X
Xstatic const char *shktools[] = {
X /* Spmi */
X "Ymla", "Eed-morra", "Cubask", "Nieb", "Bnowr Falr", "Telloc Cyaj",
X "Sperc", "Noskcirdneh", "Yawolloh", "Hyeghu", "Niskal", "Trahnil",
X "Htargcm", "Enrobwem", "Kachzi Rellim", "Regien", "Donmyar",
X "Yelpur", "Nosnehpets", "Stewe", "Renrut", "_Zlaw", "Nosalnef",
X "Rewuorb", "Rellenk", "Yad", "Cire Htims", "Y-crad", "Nenilukah",
X#ifdef OVERLAY
X "Erreip", "Nehpets", "Mron", "Snivek",
X#endif
X#ifdef MAC
X "Nhoj-lee", "Evad\'kh", "Ettaw-noj", "Tsew-mot", "Ydna-s",
X#endif
X#ifdef AMIGA
X "Falo", "Nosid-da\'r", "Ekim-p", "Rebrol-nek", "Noslo", "Yl-rednow",
X "Mured-oog",
X#endif
X#ifdef VMS
X "Lez-tneg", "Ytnu-haled", "Niknar",
X#endif
X ""
X};
X
Xstatic const char *shkgeneral[] = {
X /* Suriname */
X "Hebiwerie", "Possogroenoe", "Asidonhopo", "Manlobbi",
X "Adjama", "Pakka Pakka", "Kabalebo", "Wonotobo",
X "Akalapi", "Sipaliwini",
X /* Greenland */
X "Annootok", "Upernavik", "Angmagssalik",
X /* N. Canada */
X "Aklavik", "Inuvik", "Tuktoyaktuk",
X "Chicoutimi", "Ouiatchouane", "Chibougamau",
X "Matagami", "Kipawa", "Kinojevis",
X "Abitibi", "Maganasipi",
X /* Iceland */
X "Akureyri", "Kopasker", "Budereyri", "Akranes", "Bordeyri",
X "Holmavik",
X ""
X};
X
X/*
X * To add new shop types, all that is necessary is to edit the shtypes[] array.
X * See mkroom.h for the structure definition. Typically, you'll have to lower
X * some or all of the probability fields in old entries to free up some
X * percentage for the new type.
X *
X * The placement type field is not yet used but will be in the near future.
X *
X * The iprobs array in each entry defines the probabilities for various kinds
X * of objects to be present in the given shop type. You can associate with
X * each percentage either a generic object type (represented by one of the
X * *_CLASS macros) or a specific object (represented by an onames.h define).
X * In the latter case, prepend it with a unary minus so the code can know
X * (by testing the sign) whether to use mkobj() or mksobj().
X */
X
Xconst struct shclass shtypes[] = {
X {"general store", RANDOM_CLASS, 44,
X D_SHOP, {{100, RANDOM_CLASS}, {0, 0}, {0, 0}}, shkgeneral},
X {"used armor dealership", ARMOR_CLASS, 14,
X D_SHOP, {{90, ARMOR_CLASS}, {10, WEAPON_CLASS}, {0, 0}},
X shkarmors},
X {"second hand bookstore", SCROLL_CLASS, 10, D_SHOP,
X {{90, SCROLL_CLASS}, {10, SPBOOK_CLASS}, {0, 0}}, shkbooks},
X {"liquor emporium", POTION_CLASS, 10, D_SHOP,
X {{100, POTION_CLASS}, {0, 0}, {0, 0}}, shkliquors},
X {"antique weapons outlet", WEAPON_CLASS, 5, D_SHOP,
X {{90, WEAPON_CLASS}, {10, ARMOR_CLASS}, {0, 0}}, shkweapons},
X {"delicatessen", FOOD_CLASS, 5, D_SHOP,
X {{95, FOOD_CLASS}, {5, POTION_CLASS}, {0, 0}}, shkfoods},
X {"jewelers", RING_CLASS, 3, D_SHOP,
X {{85, RING_CLASS}, {10, GEM_CLASS}, {5, AMULET_CLASS}, {0, 0}},
X shkrings},
X {"quality apparel and accessories", WAND_CLASS, 3, D_SHOP,
X {{90, WAND_CLASS}, {5, -LEATHER_GLOVES}, {5, -ELVEN_CLOAK}, {0, 0}},
X shkwands},
X {"hardware store", TOOL_CLASS, 3, D_SHOP,
X {{100, TOOL_CLASS}, {0, 0}, {0, 0}}, shktools},
X /* Actually shktools is ignored; the code specifically chooses a
X * random implementor name (along with candle shops having
X * random shopkeepers)
X */
X {"rare books", SPBOOK_CLASS, 3, D_SHOP,
X {{90, SPBOOK_CLASS}, {10, SCROLL_CLASS}, {0, 0}}, shkbooks},
X /* Shops below this point are "unique". That is they must all have a
X * probability of zero. They are only created via the special level
X * loader.
X */
X {"lighting store", TOOL_CLASS, 0, D_SHOP,
X {{32, -WAX_CANDLE}, {50, -TALLOW_CANDLE},
X {5, -BRASS_LANTERN}, {10, -OIL_LAMP}, {3, -MAGIC_LAMP}},shktools},
X {NULL, 0, 0, 0, {{0, 0}, {0, 0}, {0, 0}}, 0}
X};
X
X#else /* OVLB */
X
Xextern const struct shclass shtypes[];
X
X#endif /* OVLB */
X
X#ifdef OVLB
X
X#if 0
X/* validate shop probabilities; otherwise incorrect local changes could
X end up provoking infinite loops or wild subscripts fetching garbage */
Xvoid
Xinit_shop_selection()
X{
X register int i, j, item_prob, shop_prob;
X
X for (shop_prob = 0, i = 0; i < SIZE(shtypes); i++) {
X shop_prob += shtypes[i].prob;
X for (item_prob = 0, j = 0; j < SIZE(shtypes[0].iprobs); j++)
X item_prob += shtypes[i].iprobs[j].iprob;
X if (item_prob != 100)
X panic("item probabilities total to %d for %s shops!",
X item_prob, shtypes[i].name);
X }
X if (shop_prob != 100)
X panic("shop probabilities total to %d!", shop_prob);
X}
X#endif /*0*/
X
Xstatic void
Xmkshobj_at(shp, sx, sy)
X/* make an object of the appropriate type for a shop square */
Xconst struct shclass *shp;
Xint sx, sy;
X{
X register struct monst *mtmp;
X int atype;
X struct permonst *ptr;
X
X if (rn2(100) < depth(&u.uz) &&
X !MON_AT(sx, sy) && (ptr = mkclass(S_MIMIC,0)) &&
X (mtmp=makemon(ptr,sx,sy))) {
X /* note: makemon will set the mimic symbol to a shop item */
X if (rn2(10) >= depth(&u.uz)) {
X mtmp->m_ap_type = M_AP_OBJECT;
X mtmp->mappearance = STRANGE_OBJECT;
X }
X } else if ((atype = get_shop_item(shp - shtypes)) < 0)
X (void) mksobj_at(-atype, sx, sy, TRUE);
X else (void) mkobj_at(atype, sx, sy, TRUE);
X}
X
Xstatic void
Xfindname(nampt, nlp)
X/* extract a shopkeeper name for the given shop type */
X char *nampt;
X const char *nlp[];
X{
X register int i;
X
X for(i = 0; i < ledger_no(&u.uz); i++) /* Note: _not_ depth */
X if (!*nlp[i]) {
X /* Not enough names, try random/general name */
X if((i = rn2(i)))
X break;
X else if (nlp != shkgeneral)
X findname(nampt, shkgeneral);
X else
X Strcpy(nampt, "Dirk");
X return;
X }
X (void) strncpy(nampt, nlp[i-1], PL_NSIZ);
X nampt[PL_NSIZ-1] = 0;
X}
X
Xstatic int
Xshkinit(shp, sroom) /* create a new shopkeeper in the given room */
Xconst struct shclass *shp;
Xstruct mkroom *sroom;
X{
X register int sh, sx, sy;
X struct monst *shk;
X
X /* place the shopkeeper in the given room */
X sh = sroom->fdoor;
X sx = doors[sh].x;
X sy = doors[sh].y;
X
X /* check that the shopkeeper placement is sane */
X if(sroom->irregular) {
X int rmno = (sroom - rooms) + ROOMOFFSET;
X if(isok(sx-1,sy) &&
X levl[sx-1][sy].roomno == rmno && !levl[sx-1][sy].edge) sx--;
X else if(isok(sx+1,sy) &&
X levl[sx+1][sy].roomno == rmno && !levl[sx+1][sy].edge) sx++;
X else if(isok(sx,sy-1) &&
X levl[sx][sy-1].roomno == rmno && !levl[sx][sy-1].edge) sy--;
X else if(isok(sx,sy+1) &&
X levl[sx][sy+1].roomno == rmno && !levl[sx][sy+1].edge) sx++;
X else goto shk_failed;
X }
X else if(sx == sroom->lx-1) sx++;
X else if(sx == sroom->hx+1) sx--;
X else if(sy == sroom->ly-1) sy++;
X else if(sy == sroom->hy+1) sy--; else {
X shk_failed:
X#ifdef DEBUG
X# ifdef WIZARD
X /* Said to happen sometimes, but I have never seen it. */
X /* Supposedly fixed by fdoor change in mklev.c */
X if(wizard) {
X register int j = sroom->doorct;
X
X pline("Where is shopdoor?");
X pline("Room at (%d,%d),(%d,%d).",
X sroom->lx, sroom->ly, sroom->hx, sroom->hy);
X pline("doormax=%d doorct=%d fdoor=%d",
X doorindex, sroom->doorct, sh);
X while(j--) {
X pline("door [%d,%d]", doors[sh].x, doors[sh].y);
X sh++;
X }
X display_nhwindow(WIN_MESSAGE, FALSE);
X }
X# endif
X#endif
X return(-1);
X }
X
X if(MON_AT(sx, sy)) rloc(m_at(sx, sy)); /* insurance */
X
X /* now initialize the shopkeeper monster structure */
X if(!(shk = makemon(&mons[PM_SHOPKEEPER], sx, sy))) return(-1);
X shk->isshk = shk->mpeaceful = 1;
X set_malign(shk);
X shk->msleep = 0;
X shk->mtrapseen = ~0; /* we know all the traps already */
X ESHK(shk)->shoproom = (sroom - rooms) + ROOMOFFSET;
X sroom->resident = shk;
X ESHK(shk)->shoptype = sroom->rtype;
X assign_level(&(ESHK(shk)->shoplevel), &u.uz);
X ESHK(shk)->shd = doors[sh];
X ESHK(shk)->shk.x = sx;
X ESHK(shk)->shk.y = sy;
X ESHK(shk)->robbed = 0L;
X ESHK(shk)->credit = 0L;
X ESHK(shk)->debit = 0L;
X ESHK(shk)->loan = 0L;
X ESHK(shk)->visitct = 0;
X ESHK(shk)->following = 0;
X ESHK(shk)->billct = 0;
X shk->mgold = 1000L + 30L*(long)rnd(100); /* initial capital */
X if (shp->shknms == shktools) {
X int who = rn2(SIZE(shktools) - 1);
X const char *shname = shp->shknms[who];
X if (shk->female = (*shname == '_')) shname++;
X (void) strncpy(ESHK(shk)->shknam, shname, PL_NSIZ);
X ESHK(shk)->shknam[PL_NSIZ-1] = 0;
X } else {
X shk->female = ledger_no(&u.uz)%2;
X findname(ESHK(shk)->shknam, shp->shknms);
X }
X
X return(sh);
X}
X
X/* stock a newly-created room with objects */
Xvoid
Xstock_room(shp_indx, sroom)
Xint shp_indx;
Xregister struct mkroom *sroom;
X{
X /*
X * Someday soon we'll dispatch on the shdist field of shclass to do
X * different placements in this routine. Currently it only supports
X * shop-style placement (all squares except a row nearest the first
X * door get objects).
X */
X register int sx, sy, sh;
X char buf[BUFSZ];
X int rmno = (sroom - rooms) + ROOMOFFSET;
X const struct shclass *shp = &shtypes[shp_indx];
X
X /* first, try to place a shopkeeper in the room */
X if ((sh = shkinit(shp, sroom)) < 0)
X return;
X
X /* make sure no doorways without doors, and no */
X /* trapped doors, in shops. */
X sx = doors[sroom->fdoor].x;
X sy = doors[sroom->fdoor].y;
X
X if(levl[sx][sy].doormask == D_NODOOR) {
X levl[sx][sy].doormask = D_ISOPEN;
X newsym(sx,sy);
X }
X if(levl[sx][sy].typ == SDOOR) {
X levl[sx][sy].typ = DOOR;
X newsym(sx,sy);
X }
X if(levl[sx][sy].doormask & D_TRAPPED)
X levl[sx][sy].doormask = D_LOCKED;
X
X if(levl[sx][sy].doormask == D_LOCKED) {
X register int m = sx, n = sy;
X
X if(inside_shop(sx+1,sy)) m--;
X else if(inside_shop(sx-1,sy)) m++;
X if(inside_shop(sx,sy+1)) n--;
X else if(inside_shop(sx,sy-1)) n++;
X Sprintf(buf, "Closed for inventory");
X make_engr_at(m, n, buf, 0L, DUST);
X }
X
X for(sx = sroom->lx; sx <= sroom->hx; sx++)
X for(sy = sroom->ly; sy <= sroom->hy; sy++) {
X if(sroom->irregular) {
X if(levl[sx][sy].edge || levl[sx][sy].roomno != rmno ||
X distmin(sx, sy, doors[sh].x, doors[sh].y) <= 1)
X continue;
X } else if((sx == sroom->lx && doors[sh].x == sx-1) ||
X (sx == sroom->hx && doors[sh].x == sx+1) ||
X (sy == sroom->ly && doors[sh].y == sy-1) ||
X (sy == sroom->hy && doors[sh].y == sy+1)) continue;
X mkshobj_at(shp, sx, sy);
X }
X
X /*
X * Special monster placements (if any) should go here: that way,
X * monsters will sit on top of objects and not the other way around.
X */
X
X level.flags.has_shop = 1;
X}
X
X#endif /* OVLB */
X#ifdef OVL0
X
X/* does "shop" stock this item type? */
Xboolean
Xsaleable(shp_indx, obj)
Xregister int shp_indx;
Xregister struct obj *obj;
X{
X register int i;
X register const struct shclass *shp = &shtypes[shp_indx];
X
X if (shp->symb == RANDOM_CLASS) return TRUE;
X else for (i = 0; i < SIZE(shtypes[0].iprobs) && shp->iprobs[i].iprob; i++)
X if (shp->iprobs[i].itype < 0 ?
X shp->iprobs[i].itype == - obj->otyp :
X shp->iprobs[i].itype == obj->oclass) return TRUE;
X /* not found */
X return FALSE;
X}
X
X/* positive value: class; negative value: specific object type */
Xint
Xget_shop_item(type)
Xint type;
X{
X const struct shclass *shp = shtypes+type;
X register int i,j;
X
X /* select an appropriate object type at random */
X for(j = rnd(100), i = 0; (j -= shp->iprobs[i].iprob) > 0; i++)
X continue;
X
X return shp->iprobs[i].itype;
X}
X
X#endif /* OVL0 */
X
X/*shknam.c*/
END_OF_FILE
if test 14990 -ne `wc -c <'src/shknam.c'`; then
echo shar: \"'src/shknam.c'\" unpacked with wrong size!
fi
# end of 'src/shknam.c'
fi
if test -f 'sys/amiga/scroll.uu' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'sys/amiga/scroll.uu'\"
else
echo shar: Extracting \"'sys/amiga/scroll.uu'\" \(536 characters\)
sed "s/^X//" >'sys/amiga/scroll.uu' <<'END_OF_FILE'
Xbegin 777 scroll.pw
XM4&]W97)7:6YD;W=S('8R+C5C(*DQ.3@W+"`Q.3@X(&)Y($E.3U9!5%)/3DE#
XM4RP@24Y#+B`@("`@("`@("`@("`@("`@("`@("`@```"K`````E``8#_````
XM`0`````!``````=B87)F+F,```````````$``A`+```"6@`%``7_____````
XM``````````````````````````````$`(86````````!```!`,\`$0$``'T`
XM!0`%_____P````$``````/_Q``H`#__M`%```P`#`"&'T```````````````
XM```AB"```P`AB.C_____`P``!0`NKQ0````````````0````$`!K````:P``
XM``````````<`9@`````````````````````!!?__________````"@!0``D`
XM(8E``"*KR``BL:@`(^]0`"/P0``C\L`````!``````$``````0`````!````
X(``$``````0`B
X`
Xend
END_OF_FILE
if test 536 -ne `wc -c <'sys/amiga/scroll.uu'`; then
echo shar: \"'sys/amiga/scroll.uu'\" unpacked with wrong size!
fi
# end of 'sys/amiga/scroll.uu'
fi
if test -f 'util/lev_comp.l' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'util/lev_comp.l'\"
else
echo shar: Extracting \"'util/lev_comp.l'\" \(7556 characters\)
sed "s/^X//" >'util/lev_comp.l' <<'END_OF_FILE'
X%{
X/* SCCS Id: @(#)lev_lex.c 3.1 92/07/12 */
X/* Copyright (c) 1989 by Jean-Christophe Collet */
X/* NetHack may be freely redistributed. See license for details. */
X
X#define LEV_LEX_C
X
X#include "hack.h"
X#include "lev_comp.h"
X#include "sp_lev.h"
X
X/* Most of these don't exist in flex, yywrap is macro and
X * yyunput is properly declared in flex.skel.
X */
X#ifndef FLEX_SCANNER
Xint FDECL (yyback, (int *, int));
Xint NDECL (yylook);
Xint NDECL (yyinput);
Xint NDECL (yywrap);
Xint NDECL (yylex);
X /* Traditional lexes let yyunput() and yyoutput() default to int;
X * newer ones may declare them as void since they don't return
X * values. For even more fun, the lex supplied as part of the
X * newer unbundled compiler for SunOS 4.x adds the void declarations
X * (under __STDC__ or _cplusplus ifdefs -- otherwise they remain
X * int) while the bundled lex and the one with the older unbundled
X * compiler do not. To detect this, we need help from outside --
X * sys/unix/Makefile.utl.
X */
X# if defined(NeXT) || defined(SVR4)
X# define VOIDYYPUT
X# endif
X# if !defined(VOIDYYPUT)
X# if defined(POSIX_TYPES) && !defined(BOS) && !defined(HISX)
X# define VOIDYYPUT
X# endif
X# endif
X# if !defined(VOIDYYPUT) && defined(WEIRD_LEX)
X# if defined(SUNOS4) && defined(__STDC__) && (WEIRD_LEX != 0)
X# define VOIDYYPUT
X# endif
X# endif
X# ifdef VOIDYYPUT
Xvoid FDECL (yyunput, (int));
Xvoid FDECL (yyoutput, (int));
X# else
Xint FDECL (yyunput, (int));
Xint FDECL (yyoutput, (int));
X# endif
X#endif /* FLEX_SCANNER */
X
Xvoid FDECL (init_yyin, (FILE *));
Xvoid FDECL (init_yyout, (FILE *));
X
X#ifdef MICRO
X#undef exit
Xextern void FDECL(exit, (int));
X#endif
X
X/* this doesn't always get put in lev_comp.h
X * (esp. when using older versions of bison)
X */
X
Xextern YYSTYPE yylval;
X
Xint line_number = 1, colon_line_number = 1;
X
X/* This is *** UGLY *** but I can't think a better way to do it
X * I really need a huge buffer to scan maps...
X */
X
X#undef YYLMAX
X#define YYLMAX 2048
X
X/*
X * This is a hack required by Michael Hamel to get things
X * working on the Mac.
X */
X#if defined(applec) && !defined(FLEX_SCANNER)
X#undef input
X#undef unput
X#define unput(c) { yytchar = (c); if (yytchar == 10) yylineno--; *yysptr++ = yytchar; }
X# ifndef YYNEWLINE
X# define YYNEWLINE 10
X# endif
X
Xchar
Xinput() { /* Under MPW \n is chr(13)! Compensate for this. */
X
X if (yysptr > yysbuf) return(*--yysptr);
X else {
X yytchar = getc(yyin);
X if (yytchar == '\n') {
X yylineno++;
X return(YYNEWLINE);
X }
X if (yytchar == EOF) return(0);
X else return(yytchar);
X }
X}
X#endif /* applec && !FLEX_SCANNER */
X
X%}
X%e 1500
X%p 5000
X%n 600
X%s MAPC
X%%
X<MAPC>ENDMAP {
X#ifdef FLEX_SCANNER
X /*
X * There is a bug in Flex 2.3 patch level < 6
X * (absent in previous versions)
X * that results in the following behaviour :
X * Once you enter an yymore(), you never exit from it.
X * This should do the trick!
X */
X extern int yy_more_len;
X
X yy_more_len = 0;
X#endif
X BEGIN(INITIAL);
X yylval.map = (char *) alloc(yyleng-5);
X strncpy(yylval.map, yytext,yyleng-6);
X yylval.map[yyleng-6] = 0;
X return MAP_ID;
X }
X<MAPC>[-|}{+ABCISKPLW\\#. ]*\n { line_number++; yymore(); }
X^#.*\n { line_number++; }
X: { colon_line_number = line_number; return ':'; }
XMESSAGE return MESSAGE_ID;
XMAZE return MAZE_ID;
XNOMAP return NOMAP_ID;
XLEVEL return LEVEL_ID;
XINIT_MAP return LEV_INIT_ID;
XFLAGS return FLAGS_ID;
XGEOMETRY return GEOMETRY_ID;
X^MAP\n { BEGIN(MAPC); line_number++; }
XOBJECT return OBJECT_ID;
XMONSTER return MONSTER_ID;
XTRAP return TRAP_ID;
XDOOR return DOOR_ID;
XDRAWBRIDGE return DRAWBRIDGE_ID;
XMAZEWALK return MAZEWALK_ID;
XWALLIFY return WALLIFY_ID;
XREGION return REGION_ID;
XRANDOM_OBJECTS return RANDOM_OBJECTS_ID;
XRANDOM_MONSTERS return RANDOM_MONSTERS_ID;
XRANDOM_PLACES return RANDOM_PLACES_ID;
XALTAR return ALTAR_ID;
XLADDER return LADDER_ID;
XSTAIR return STAIR_ID;
XPORTAL return PORTAL_ID;
XTELEPORT_REGION return TELEPRT_ID;
XBRANCH return BRANCH_ID;
XFOUNTAIN return FOUNTAIN_ID;
XSINK return SINK_ID;
XPOOL return POOL_ID;
XNON_DIGGABLE return NON_DIGGABLE_ID;
XROOM return ROOM_ID;
XSUBROOM return SUBROOM_ID;
XRANDOM_CORRIDORS return RAND_CORRIDOR_ID;
XCORRIDOR return CORRIDOR_ID;
XGOLD return GOLD_ID;
XENGRAVING return ENGRAVING_ID;
XNAME return NAME_ID;
XCHANCE return CHANCE_ID;
Xlevregion return LEV;
Xopen { yylval.i=D_ISOPEN; return DOOR_STATE; }
Xclosed { yylval.i=D_CLOSED; return DOOR_STATE; }
Xlocked { yylval.i=D_LOCKED; return DOOR_STATE; }
Xnodoor { yylval.i=D_NODOOR; return DOOR_STATE; }
Xbroken { yylval.i=D_BROKEN; return DOOR_STATE; }
Xnorth { yylval.i=W_NORTH; return DIRECTION; }
Xeast { yylval.i=W_EAST; return DIRECTION; }
Xsouth { yylval.i=W_SOUTH; return DIRECTION; }
Xwest { yylval.i=W_WEST; return DIRECTION; }
Xrandom { yylval.i = -1; return RANDOM_TYPE; }
Xnone { yylval.i = -2; return NONE; }
Xobject return O_REGISTER;
Xmonster return M_REGISTER;
Xplace return P_REGISTER;
Xalign return A_REGISTER;
Xleft { yylval.i=1; return LEFT_OR_RIGHT; }
Xhalf-left { yylval.i=2; return LEFT_OR_RIGHT; }
Xcenter { yylval.i=3; return CENTER; }
Xhalf-right { yylval.i=4; return LEFT_OR_RIGHT; }
Xright { yylval.i=5; return LEFT_OR_RIGHT; }
Xtop { yylval.i=1; return TOP_OR_BOT; }
Xbottom { yylval.i=5; return TOP_OR_BOT; }
Xlit { yylval.i=1; return LIGHT_STATE; }
Xunlit { yylval.i=0; return LIGHT_STATE; }
Xfilled { yylval.i=0; return FILLING; }
Xunfilled { yylval.i=1; return FILLING; }
Xnoalign { yylval.i= AM_NONE; return ALIGNMENT; }
Xlaw { yylval.i= AM_LAWFUL; return ALIGNMENT; }
Xneutral { yylval.i= AM_NEUTRAL; return ALIGNMENT; }
Xchaos { yylval.i= AM_CHAOTIC; return ALIGNMENT; }
Xpeaceful { yylval.i=1; return MON_ATTITUDE; }
Xhostile { yylval.i=0; return MON_ATTITUDE; }
Xasleep { yylval.i=1; return MON_ALERTNESS; }
Xawake { yylval.i=0; return MON_ALERTNESS; }
Xm_feature { yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; }
Xm_monster { yylval.i= M_AP_MONSTER; return MON_APPEARANCE; }
Xm_object { yylval.i= M_AP_OBJECT; return MON_APPEARANCE; }
Xsanctum { yylval.i=2; return ALTAR_TYPE; }
Xshrine { yylval.i=1; return ALTAR_TYPE; }
Xaltar { yylval.i=0; return ALTAR_TYPE; }
Xup { yylval.i=1; return UP_OR_DOWN; }
Xdown { yylval.i=0; return UP_OR_DOWN; }
Xfalse { yylval.i=0; return BOOLEAN; }
Xtrue { yylval.i=1; return BOOLEAN; }
Xdust { yylval.i=DUST; return ENGRAVING_TYPE; }
Xengrave { yylval.i=ENGRAVE; return ENGRAVING_TYPE; }
Xburn { yylval.i=BURN; return ENGRAVING_TYPE; }
Xmark { yylval.i=MARK; return ENGRAVING_TYPE; }
Xblessed { yylval.i=1; return CURSE_TYPE; }
Xuncursed { yylval.i=2; return CURSE_TYPE; }
Xcursed { yylval.i=3; return CURSE_TYPE; }
Xnoteleport { yylval.i=NOTELEPORT; return FLAG_TYPE; }
Xhardfloor { yylval.i=HARDFLOOR; return FLAG_TYPE; }
Xnommap { yylval.i=NOMMAP; return FLAG_TYPE; }
Xshortsighted { yylval.i=SHORTSIGHTED; return FLAG_TYPE; }
X[+\-]?[0-9]+ { yylval.i=atoi(yytext); return INTEGER; }
X\"[^"]*\" { yytext[yyleng-1] = 0; /* Discard the trailing \" */
X yylval.map = (char *) alloc(strlen(yytext+1)+1);
X strcpy(yylval.map, yytext+1); /* Discard the first \" */
X return STRING; }
X\n { line_number++; }
X[ \t]+ ;
X'.' { yylval.i = yytext[1]; return CHAR; }
X. { return yytext[0]; }
X%%
X#ifdef AMIGA
Xlong *alloc(n)
X unsigned n;
X{
X return ((long *)malloc (n));
X}
X#endif
X
X/* routine to switch to another input file; needed for flex */
Xvoid init_yyin( input_f )
XFILE *input_f;
X{
X#ifdef FLEX_SCANNER
X if (yyin)
X yyrestart(input_f);
X else
X#endif
X yyin = input_f;
X}
X/* analogous routine (for completeness) */
Xvoid init_yyout( output_f )
XFILE *output_f;
X{
X yyout = output_f;
X}
X
END_OF_FILE
if test 7556 -ne `wc -c <'util/lev_comp.l'`; then
echo shar: \"'util/lev_comp.l'\" unpacked with wrong size!
fi
# end of 'util/lev_comp.l'
fi
if test -f 'win/X11/nethack.rc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'win/X11/nethack.rc'\"
else
echo shar: Extracting \"'win/X11/nethack.rc'\" \(1877 characters\)
sed "s/^X//" >'win/X11/nethack.rc' <<'END_OF_FILE'
X#
X# Nethack configuration file.
X#
X# Naming this file $(HOME)/.nethackrc (for UNIX) or setting the environment
X# variable NETHACKOPTIONS to point to its full path name elsewhere tells
X# NetHack to use X11 windowing and fonts (provided the executable was
X# compiled with that ability).
X#
X#
XOPTIONS=windowtype:x11
XOPTIONS=confirm,male,fixinv,nopickup,safe_pet,sortpack,tombstone,verbose,news
XOPTIONS=fruit:pineapple
XOPTIONS=dogname:Dhairrhuwyth
XOPTIONS=catname:Ghisteslwchlohm
X#
X# There are 17 object symbols and 69 graphics symbols.
X# The descriptions of these symbols can be found in dat/opthelp.
X#
X#
X# Font: nh10 (10x20)
X#
XOBJECTS= 180 183 188 192 181 184 182 189 190 196 \
X 191 194 193 187 185 186 195
X#
XGRAPHICS= 032 025 018 013 012 014 011 015 023 024 \
X 022 021 128 129 130 131 132 133 134 135 \
X 136 137 145 146 138 139 144 143 142 141 \
X 140 149 150 031 031 147 148 031 161 140 \
X 151 152 153 154 155 156 157 158 \
X 159 160 161 162 \
X 163 164 165 166 167 168 169 170 \
X 171 172 173 174 175 176 177 178 179
X#
X#
X# Font: ibm (8x14)
X#
X#OBJECTS= 207 210 215 219 208 211 209 216 217 223 \
X# 218 221 220 214 212 213 222
X#
X#GRAPHICS= 032 128 129 130 131 132 133 134 135 136 \
X# 137 138 139 045 124 142 143 144 145 146 \
X# 147 148 155 156 149 150 227 154 153 152 \
X# 151 159 160 200 200 157 158 250 170 151 \
X# 161 162 163 164 165 166 167 168 \
X# 169 170 171 172 \
X# 173 174 175 176 177 178 179 180 \
X# 181 182 183 184 185 186 187 188 189
X#
X#
X# Font: a "standard" font like 6x13
X#
X#GRAPHICS = 032 025 018 013 012 014 011 015 023 024 \
X# 022 021 031 045 124 043 043 031 035 001 \
X# 060 062 060 062 094 002 019 092 035 123 \
X# 125 031 125 046 046 035 035 046 127 125 \
X# 124 045 092 047 042 033 041 040 \
X# 048 035 064 042 \
X# 047 045 092 124 124 092 045 047 \
X# 047 064 092 064 064 064 092 064 047
END_OF_FILE
if test 1877 -ne `wc -c <'win/X11/nethack.rc'`; then
echo shar: \"'win/X11/nethack.rc'\" unpacked with wrong size!
fi
# end of 'win/X11/nethack.rc'
fi
if test -f 'win/X11/nh56icon' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'win/X11/nh56icon'\"
else
echo shar: Extracting \"'win/X11/nh56icon'\" \(2734 characters\)
sed "s/^X//" >'win/X11/nh56icon' <<'END_OF_FILE'
X/* SCCS Id: @(#)nh56icon 3.1 93/01/21 */
X/* Copyright (c) 1993 by M. Stephenson */
X/* NetHack may be freely redistributed. See license for details. */
X
X/* 56x56 X11 icon for NetHack. */
X
X#define nh56icon_width 56
X#define nh56icon_height 56
Xstatic char nh56icon_bits[] = {
X 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
X 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03,
X 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
X 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x30, 0x38,
X 0x18, 0x00, 0xc0, 0x03, 0x00, 0x78, 0x28, 0x3c, 0x00, 0xc0, 0x03, 0x00,
X 0xf8, 0x6c, 0x3e, 0x00, 0xc0, 0x03, 0x00, 0xf8, 0x55, 0x3f, 0x00, 0xc0,
X 0x23, 0x22, 0xfc, 0xc7, 0x7f, 0x88, 0xc8, 0x43, 0x10, 0xfc, 0xd7, 0x7f,
X 0x10, 0xc4, 0x03, 0x07, 0xfe, 0xc7, 0xff, 0xc0, 0xc1, 0x83, 0x0d, 0xfe,
X 0xd7, 0xff, 0x60, 0xc3, 0xa3, 0x28, 0xfe, 0xc7, 0xff, 0x28, 0xca, 0x83,
X 0x0d, 0xfe, 0xd7, 0xff, 0x60, 0xc3, 0x03, 0x07, 0xfe, 0xc7, 0xff, 0xc0,
X 0xc1, 0x43, 0x10, 0xfc, 0xd7, 0x7f, 0x10, 0xc4, 0x23, 0x22, 0xfc, 0xc7,
X 0x7f, 0x88, 0xc8, 0x03, 0x00, 0xf8, 0x55, 0x3f, 0x00, 0xc0, 0x03, 0x00,
X 0xf8, 0x44, 0x3e, 0x00, 0xc0, 0x03, 0x00, 0x78, 0x54, 0x3c, 0x00, 0xc0,
X 0x03, 0x00, 0x30, 0x6c, 0x18, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x6c, 0x00,
X 0x00, 0xc0, 0x03, 0x00, 0x00, 0x38, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
X 0x38, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x38, 0x00, 0x00, 0xc0, 0x03,
X 0x00, 0x00, 0x38, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x38, 0x00, 0x00,
X 0xc0, 0x03, 0x00, 0x00, 0x38, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x38,
X 0x00, 0x00, 0xc0, 0x43, 0x10, 0x21, 0x38, 0x70, 0x80, 0xc0, 0xc3, 0x10,
X 0x21, 0x38, 0x88, 0xc0, 0xc0, 0xc3, 0x10, 0x21, 0x38, 0x80, 0x80, 0xc0,
X 0x43, 0x11, 0x21, 0x38, 0x80, 0x80, 0xc0, 0x43, 0x12, 0x3f, 0x38, 0x70,
X 0x80, 0xc0, 0x43, 0x12, 0x21, 0x38, 0x80, 0x80, 0xc0, 0x43, 0x14, 0x21,
X 0x38, 0x80, 0x80, 0xc0, 0x43, 0x18, 0x21, 0x38, 0x80, 0x80, 0xc0, 0x43,
X 0x18, 0x21, 0x38, 0x88, 0x8c, 0xc0, 0x43, 0x10, 0x21, 0x38, 0x70, 0xcc,
X 0xc1, 0x03, 0x00, 0x00, 0x38, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x38,
X 0x00, 0x00, 0xc0, 0xfb, 0xff, 0xff, 0x39, 0xff, 0xff, 0xdf, 0x0b, 0x00,
X 0x80, 0x7c, 0x02, 0x00, 0xd0, 0x0b, 0x00, 0x80, 0xee, 0x02, 0x00, 0xd0,
X 0xfb, 0xff, 0xff, 0xd6, 0xfe, 0xff, 0xdf, 0x0b, 0x00, 0x80, 0xaa, 0x02,
X 0x00, 0xd0, 0x0b, 0x00, 0x80, 0x54, 0x02, 0x00, 0xd0, 0xfb, 0xff, 0xff,
X 0x39, 0xff, 0xff, 0xdf, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03,
X 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
END_OF_FILE
if test 2734 -ne `wc -c <'win/X11/nh56icon'`; then
echo shar: \"'win/X11/nh56icon'\" unpacked with wrong size!
fi
# end of 'win/X11/nh56icon'
fi
echo shar: End of archive 43 \(of 108\).
cp /dev/null ark43isdone
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