[comp.sources.games] v07i086: NetHack3 - display oriented dungeons & dragons

billr@saab.CNA.TEK.COM (Bill Randle) (07/25/89)

Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
Posting-number: Volume 7, Issue 86
Archive-name: NetHack3/Part31



#! /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 31 (of 38)."
# Contents:  auxil/rumors.fal auxil/rumors.tru others/Makefile.pc
#   src/dogmove.c src/mcastu.c src/steal.c
# Wrapped by billr@saab on Sun Jul 23 21:33:16 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'auxil/rumors.fal' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'auxil/rumors.fal'\"
else
echo shar: Extracting \"'auxil/rumors.fal'\" \(9643 characters\)
sed "s/^X//" >'auxil/rumors.fal' <<'END_OF_FILE'
X"So when I die, the first thing I will see in Heaven is a score list?"
XA Dragon is just a Snake that ate a scroll of fire.
XA Nymph will be very pleased if you call her by her real name:  Lorelei.
XA chameleon imitating a mail daemon often delivers scrolls of fire.
XA cockatrice's corpse is guaranteed to be untainted!
XA dead cockatrice is just a dead lizard.
XA dead lizard is a good thing to turn undead.
XA fading corridor enlightens your insight.
XA glowing potion is too hot to drink.
XA good amulet may protect you against guards.
XA long worm can be defined recursively.  So how should you attack it?
XA monstrous mind is a toy forever.
XA ring of dungeon master control is a great find.
XA ring of extra ring finger is useless if not enchanted.
XA rope may form a trail in a maze.
XA staff may recharge if you drop it for awhile.
XA visit to the Zoo is very educational; you meet interesting animals.
XA wand of deaf is a more dangerous weapon than a wand of sheep.
XA wand of vibration might bring the whole cave crashing about your ears.
XA wish?  Okay, make me a fortune cookie!
XA winner never quits.  A quitter never wins.
XAfraid of mimics?  Try to wear a ring of true seeing.
XAll monsters are created evil, but some are more evil than others.
XAlways attack a floating eye from behind!
XAn elven cloak is always the height of fashion.
XAny small object that is accidentally dropped will hide under a larger object.
XAttack long worms from the rear -- that is so much safer!
XBalrogs do not appear above level 20.
XBanana peels work especially well against Keystone Kops.
XBe careful when eating bananas.  Monsters might slip on the peels.
XBetter leave the dungeon; otherwise you might get hurt badly.
XBeware of the potion of nitroglycerin -- it's not for the weak of heart.
XBeware:  there's always a chance that your wand explodes as you try to zap it!
XBeyond the 23rd level lies a happy retirement in a room of your own.
XChanging your suit without dropping your sword?  You must be kidding!
XCockatrices might turn themselves to stone faced with a mirror.
XConsumption of home-made food is strictly forbidden in this dungeon.
XDeath is just life's way of telling you you've been fired.
XDark room?  Your chance to develop your photographs!
XDark rooms are not *completely* dark:  just wait and let your eyes adjust...
XDavid London sez, "Hey guys, *WIELD* a dead lizard against a cockatrice!"
XDemi-gods don't need any help from the gods.
XDemons *HATE* Priests and Priestesses.
XDidn't you forget to pay?
XDidn't your mother tell you not to eat food off the floor?
XDirect a direct hit on your direct opponent, directing in the right direction.
XDon't eat too much:  you might start hiccoughing!
XDon't play hack at your work; your boss might hit you!
XDon't tell a soul you found a secret door, otherwise it isn't a secret anymore.
XDrinking potions of booze may land you in jail if you are under 21.
XDrop your vanity and get rid of your jewels!  Pickpockets about!
XEat 10 cloves of garlic and keep all humans at a two-square distance.
XEels hide under mud.  Use a unicorn to clear the water and make them visible.
XEngrave your wishes with a wand of wishing.
XEventually you will come to admire the swift elegance of a retreating nymph.
XEver heard hissing outside?  I *knew* you hadn't!
XEver lifted a dead dragon?
XEver seen your weapon glow plaid?
XEver seen a leocrotta dancing the tengu?
XEver tamed a shopkeeper?
XEver tried digging through a Vault Guard?
XEver tried enchanting a rope?
XExtra staircases lead to extra levels.
XFloating eyes can't stand Hawaiian shirts.
XFor any remedy there is a misery.
XGiant bats turn into giant vampires.
XGood day for overcoming obstacles.  Try a steeplechase.
XHelp!  I'm being held prisoner in a fortune cookie factory!
XHungry?  There is an abundance of food on the next level.
XI guess you've never hit a mail daemon with the Amulet of Yendor...
XIf you are the shopkeeper, you can take things for free.
XIf you can't learn to do it well, learn to enjoy doing it badly.
XIf you thought the Wizard was bad, just wait till you meet the Warlord!
XIf you turn blind, don't expect your dog to be turned into a seeing-eye dog.
XIf you want to feel great, you must eat something real big.
XIf you want to float, you'd better eat a floating eye.
XIf your ghost kills a player, it increases your score.
XIncrease mindpower:  Tame your own ghost!
XIt furthers one to see the great man.
XIt is said that Killer Bunnies can be tamed with carrots only.
XIt's easy to overlook a monster in a wood.
XJust below any trapdoor there may be another one.  Just keep falling!
XKatanas are very sharp; watch you don't cut yourself.
XKeep a clear mind:  quaff clear potions.
XKicking the terminal doesn't hurt the monsters.
XKiller bees keep appearing till you kill their queen.
XLatest news?  Put 'rec.games.hack' in your .newsrc!
XLearn how to spell.  Play NetHack!
XLeprechauns hide their gold in a secret room.
XLet your fingers do the walking on the yulkjhnb keys.
XLet's face it:  this time you're not going to win.
XLet's have a party, drink a lot of booze.
XLiquor sellers do not drink; they hate to see you twice.
XLunar eclipse tonight.  May as well quit now!
XMeeting your own ghost decreases your luck considerably!
XMoney to invest?  Take it to the local branch of the Magic Memory Vault!
XMonsters come from nowhere to hit you everywhere.
XMonsters sleep because you are boring, not because they ever get tired.
XMost monsters prefer minced meat.  That's why they are hitting you!
XMost of the bugs in NetHack are on the floor.
XMuch ado Nothing Happens.
XMulti-player NetHack is a myth.
XNetHack is addictive.  Too late, you're already hooked.
XNever ask a shopkeeper for a price list.
XNever burn a tree, unless you like getting whacked with a +5 shovel.
XNever eat with glowing hands!
XNever mind the monsters hitting you:  they just replace the charwomen.
XNever play leapfrog with a unicorn.
XNever step on a cursed engraving.
XNever swim with a camera:  there's nothing to take pictures of.
XNever trust a random generator in magic fields.
XNever use a wand of death.
XNo level contains two shops.  The maze is no level.  So...
XNo part of this fortune may be reproduced, stored in a retrieval system, ...
XNot all rumors are as misleading as this one.
XNymphs and nurses like beautiful rings.
XNymphs are blondes.  Are you a gentleman?
XOffering a unicorn a worthless piece of glass might prove to be fatal!
XOld hackers never die:  young ones do.
XOne has to leave shops before closing time.
XOne homunculus a day keeps the doctor away.
XOne level further down somebody is getting killed, right now.
XOnly a wizard can use a magic whistle.
XOnly adventurers of evil alignment think of killing their dog.
XOnly chaotic evils kill sleeping monsters.
XOnly real trappers escape traps.
XOnly real wizards can write scrolls.
XOperation OVERKILL has started now.
XPolymorph into an ettin; meet your opponents face to face to face.
XPLEASE ignore previous rumor.
XPraying will frighten demons.
XRow (3x) that boat gently down the stream, Charon (4x), death is but a dream.
XRunning is good for your legs.
XScrew up your courage!  You've screwed up everything else.
XSegmentation fault (core dumped).
XShopkeepers sometimes die from old age.
XSome mazes (especially small ones) have no solutions, says man 6 maze.
XSome questions Sphinxes ask just *don't* have any answers.
XSometimes "mu" is the answer.
XSorry, no fortune this time.  Better luck next cookie!
XSpare your scrolls of make-edible until it's really necessary!
XSuddenly, the dungeon will collapse...
XTaming a mail daemon may cause a system security violation.
XThe leprechauns hide their treasure in a small hidden room.
XThe longer the wand the better.
XThe use of dynamite is dangerous.
XThey say that a spear will hit a neo-otyugh.  (Do YOU know what that is?)
XThey say that only David can find the zoo!
XThey say that you cannot trust scrolls of rumor.
XThey say that you need a key in order to open locked doors.
XThey say the Gods get angry if you kill your dog.
XThis fortune cookie is the property of Fortune Cookies, Inc.
XTo reach heaven, escape the dungeon while wearing a ring of levitation.
XTourists wear shirts loud enough to wake the dead.
XTridents are for use underwater.
XTry calling your katana Moulinette.
XUlch!  That meat was painted!
XUsing a morning star in the evening has no effect.
XWant a hint?  Zap a wand of make invisible on your weapon!
XWe have new ways of detecting treachery...
XWhat a pity, you cannot read it!
XWhen a piercer drops in on you, you will be tempted to hit the ceiling!
XWhen in a maze follow the right wall and you will never get lost.
XWhen you have a key, you don't have to wait for the guard.
XWhy are you wasting time reading fortunes?
XWhy bother casting fireballs in hell?
XWish for a master key and open the Magic Memory Vault!
XWizard expects every monster to do its duty.
XYou are destined to be misled by a fortune.
XYou can get a genuine Amulet of Yendor by doing the following:  --More--
XYou can protect yourself from black dragons by doing the following:  --More--
XYou feel like someone is pulling your leg.
XYou hear the fortune cookie's hissing!
XYou have to outwit a sphinx or pay her.
XYou may get rich selling letters, but beware of being blackmailed!
XYou offend Shai-Hulud by sheathing your crysknife without having drawn blood.
XYou swallowed the fortune!
XYou want to regain strength?  Two levels ahead is a guesthouse!
XYou will encounter a tall, dark, and gruesome creature...
XFirst Law of Hacking:  leaving is much more difficult than entering.
XSecond Law of Hacking:  first in, first out.
XThird Law of Hacking:  the last blow counts most.
XFourth Law of Hacking:  you will find the exit at the entrance.
END_OF_FILE
if test 9643 -ne `wc -c <'auxil/rumors.fal'`; then
    echo shar: \"'auxil/rumors.fal'\" unpacked with wrong size!
fi
# end of 'auxil/rumors.fal'
fi
if test -f 'auxil/rumors.tru' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'auxil/rumors.tru'\"
else
echo shar: Extracting \"'auxil/rumors.tru'\" \(9417 characters\)
sed "s/^X//" >'auxil/rumors.tru' <<'END_OF_FILE'
XA blindfold can be very useful if you're telepathic.
XA crystal plate mail will not rust.
XA katana might slice a worm in two.
XA magic vomit pump could be useful for gourmands.
XA nymph knows how to unlock chains.
XA potion of blindness lets you see invisible things.
XA priest can get the gods to listen easily.
XA priest can go to hell just like the rest of us.
XA priestess and a virgin you might be, but that unicorn won't care.
XA ring of conflict is a bad thing if there is a nurse in the room.
XA short sword is not as good as a long sword.
XA succubus will go farther than a nymph.
XAcid blobs should be attacked bare-handed.
XAffairs with nymphs are often very expensive.
XAfraid of nymphs?  Wear a ring of adornment.
XAfraid of your valuables being stolen?  Carry more junk!
XAlways be aware of the phase of the moon!
XAlways sweep the floor before engraving important messages.
XAmulets are hard to make.  Even for a wand of wishing.
XAn elven cloak protects against magic.
XAn umber hulk can be a confusing sight.
XAre you blind?  Catch a floating eye!
XAsking about monsters may be very useful.
XAttacking an eel when there is none usually is a fatal mistake!
XBashing monsters with a bow is not such a good idea.
XBe careful!  The Wizard may plan an ambush!
XBe nice to a nurse:  Put away your weapon and take off your clothes.
XBeing digested is a painfully slow process.
XBlank scrolls make more interesting reading.
XBooksellers never read scrolls; they might get carried away.
XConcise conquest:  Control, confuse, conjure, condemn.
XDead lizards protect against a cockatrice.
XDemons are one thing; demon-lords, on the other hand,...
XDilithium crystals are rare indeed.
XDogs are attracted by the smell of tripe.
XDogs are superstitious; they never step on cursed items.
XDogs of ghosts aren't angry, just hungry.
XDon't bother about money:  only leprechauns and shopkeepers are interested.
XDon't forget!  Large dogs are MUCH harder to kill than little dogs.
XDon't mess with shopkeepers, or you'll get the Guild after you.
XDragons never whip their children; they wouldn't feel it!
XEat your carrots.  They're good for your eyes.
XEating a freezing sphere is like eating a yeti.
XEating a killer bee is like eating a scorpion.
XEating a tengu is like eating a nymph.
XEating a wraith is a rewarding experience!
XEating unpaid leprechauns may be advantageous.
XElbereth has quite a reputation around these parts.
XElf has extra speed.
XElven cloaks cannot rust.
XEver fought with an enchanted tooth?
XEver tried reading while confused?
XEver tried to put a troll into a large box?
XEver wondered why one would want to dip something in a potion?
XExpensive cameras have penetrating flash lights.
XFiery letters might deter monsters.
XGems are too precious to be thrown away carelessly.
XGetting hungry?  Stop wearing rings!
XGods expect the best from their priesthood.
XGods look down their noses at demigods.
XHalf Moon tonight.  (At least it's better than no Moon at all.)
XHandle your flasks carefully -- there might be a ghost inside!
XHoly water has many uses.
XHunger is a confusing experience for a dog!
XI once knew a hacker who ate too fast and choked to death.
XI smell a maze of twisty little passages.
XI wish I never wished a wand of wishing.  (Wishful thinking.)
XI wouldn't advise playing catch with a giant.
XI'm watching you.  -- The Wizard of Yendor
XIce boxes keep your food fresh.
XIf you are being punished, it's done with a deadly weapon.
XIf you kill the Wizard, you get promoted to demi-god.
XIf you need a wand of digging, kindly ask the minotaur.
XIf you want a sex change, you must get it before the game.
XIf you want to hit, use a dagger.
XIf you want to rob a shop, train your dog.
XIf you're lost, try buying a map next time you're in a shop.
XInside a shop you better take a look at the price tags before buying anything.
XIt is bad manners to use a wand in a shop.
XIt is dangerous to visit a graveyard at midnight.
XIt is not always a good idea to whistle for your dog.
XIt is rumored that the Wizard has hired some help.
XIt might be a good idea to offer the unicorn a ruby.
XIt would be peculiarly sad were your dog turned to stone.
XKeep your armors away from rust.
XKeep your weaponry away from acids.
XKill a unicorn and you kill your luck.
XLeather is waterproof.  Ever see a cow with an umbrella?
XLeprechauns are the most skilled cutpurses in this dungeon.
XMost monsters can't swim.
XMusic hath charms to affect the stubborn drawbridge.
XMusic hath charms to soothe the savage beast.
XNever attack a guard.
XNever ride a long worm.
XNever use your best weapon to engrave a curse.
XNo easy fighting with a heavy load!
XNurses are accustomed to touch naked persons:  they don't harm them.
XNymphs can unlink more than your chain mail.
XOnce your little dog will be a big dog, and you will be proud of it.
XOpening a tin is difficult, especially when you attempt it bare handed!
XOrcs and killer bees share their lifestyle.
XOrcs do not procreate in dark rooms.
XPlain nymphs are harmless.
XPlaying AD&D may be helpful.
XPlaying Gauntlet might be enlightening in some situations.
XPlaying billiards pays when you are in a shop.
XPolymorphing a shopkeeper might make you safer.
XPolymorphing your dog probably makes you safer.
XPotions don't usually mix, but sometimes...
XPsst!  It's done with mirrors!
XPut on a ring of teleportation:  it will take you away from onslaught.
XRays aren't boomerangs, of course, but still...
XRead the manual before entering the cave -- you might get killed otherwise.
XReading Herbert might be enlightening in one case.
XReading Tolkien might help you.
XRust monsters love water.  There are potions they hate, however.
XShopkeepers accept credit cards, as long as you pay cash.
XShopkeepers can spot a tourist a mile away with those Hawaiian shirts.
XShopkeepers can't read, so what use is engraving in a shop?
XShopkeepers can't swim.
XShopkeepers can't tell identical twins apart.
XShopkeepers have incredible patience.
XShopkeepers might raise their prices for tourists.
XShopkeepers value money more than revenge.
XSome monsters can be tamed.  I once saw a hacker with a tame dragon!
XSomeone's been spiking the pits!
XSometimes monsters are more likely to fight each other than attack you.
XSpinach, carrot, and a melon -- a meal fit for a nurse!
XTainted meat is even more sickening than poison!
XTelepathy is just a trick:  once you know how to do it, it's easy.
XThe Leprechaun Gold Tru$t is no division of the Magic Memory Vault.
XThe Wizard finds death to be quite an experience.
XThe best equipment for your work is, of course, the most expensive.
XThe gods don't appreciate pesky priesthood.
XThe moon is not the only heavenly body to influence this game.
XThe orc swings his two handed sword named Elfrist at you.  You die...
XThe secret of wands of Nothing Happens:  try again!
XThere has always been something mystical about mirrors.
XThere is a Mastermind deep in the dungeon.
XThere is a big treasure hidden in the zoo!
XThere is a trap on this level!
XThere is more magic in this cave than meets the eye.
XThere is no harm in praising a large dog.
XThere is nothing like eating a mimic.
XThey say a gelatinous cube can paralyze you...
XThey say that a cat avoids traps.
XThey say that a dog can be trained to fetch objects.
XThey say that a unicorn might bring you luck.
XThey say that killing a shopkeeper brings bad luck.
XThey say that monsters never step on a scare monster scroll.
XThey say that shopkeepers often have a large amount of money in their purses.
XThey say that the Leprechaun King is rich as Croesus.
XThey say that the walls in shops are made of extra hard material.
XThey say that you can't take your pick-axe into a shop.
XThey say the Wizard's castle is booby-trapped!
XThey say the gods get angry if you pray too much.
XThey say the shopkeepers are insured by Croesus himself!
XThey say there is a powerful magic item hidden in a castle deep down!
XThose who wield a cockatrice corpse have a rocky road ahead of them.
XThrowing food at a wild dog might tame him.
XTrolls are described as rubbery:  they keep bouncing back.
XTry the fall-back end-run play against ghosts.
XTry using your magic marker on wet scrolls.
XValkyries come from the north, and have commensurate abilities.
XVampires hate garlic.
XVault guards never disturb their Lords.
XVisitors are requested not to apply genocide to shopkeepers.
XWanted: shopkeepers.  Send a scroll of mail to: Mage of Yendor/Level 35/Dungeon.
XWarning:  people who eat red dragons can go to hell!
XWatch out, the Wizard might come back.
XWater traps have no effect on dragons.
XWhat is a cockatrice going to eat when it gets hungry?
XWhere do you think all those demons come from?  From hell, of course.
XWhere do you think hell is located?  It must be deep, deep down.
XWho would ever have thought one could live by eating fog clouds?
XWhy do you suppose they call them MAGIC markers?
XWhy would anybody in his sane mind engrave "Elbereth"?
XWishing too much may bring you too little.
XYou can't leave a shop through the back door:  there ain't one!
XYou may discover a fine spirit inside a potion bottle.
XYou may want to dip into a potion of bottled blessings.
XYou might be able to bribe a demon-lord.
XYou might trick a shopkeeper if you're invisible.
XYou should certainly learn about quantum mechanics.
XYou're going into the morgue at midnight???
XYour dog knows what to eat; maybe you should take lessons.
XZap yourself and see what happens...
XZapping a wand of undead turning might bring your dog back to life.
END_OF_FILE
if test 9417 -ne `wc -c <'auxil/rumors.tru'`; then
    echo shar: \"'auxil/rumors.tru'\" unpacked with wrong size!
fi
# end of 'auxil/rumors.tru'
fi
if test -f 'others/Makefile.pc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'others/Makefile.pc'\"
else
echo shar: Extracting \"'others/Makefile.pc'\" \(7940 characters\)
sed "s/^X//" >'others/Makefile.pc' <<'END_OF_FILE'
X#	SCCS Id: @(#)Makefile.pc	3.0	89/07/07
X#	PC NetHack 3.0 Makefile for Microsoft(tm) "C" 4.0 or better.
X#
X# Large memory model, register bug, remove stack probes:
XCC	= msc
XLINK	= link
XMODEL	= L
X
X# Directories (makedefs hardcodes these, don't change them)
XINCL	= ..\include
XAUX	= ..\auxil
XSRC	= ..\src
X
XCFLAGS	= -A$(MODEL) -DLINT_ARGS -Ot -Oa -Gs -Gt28 -I$(INCL)
XLFLAGS	= -exe -noig -stack:0x0aff -seg:512
XTARG	= pc
X
X.c.o:
X	$(CC) $(CFLAGS) $*.c, o\$*.o;
X
X# Optional high-quality BSD random number generation routines (see pcconf.h).
X# Set to nothing if not used.
XRANDOM = o\random.obj
X
X# For NDMAKE, to handle the .o suffix.
X.SUFFIXES: .exe .o .c .y .l
X
X# The game name
XGAME= nethack
X
X# The game directory
XGAMEDIR = \games\$(GAME)
X
X# The game filename
XGAMEFILE = $(GAMEDIR)\$(GAME).exe
X
X# object files for makedefs
XMAKEOBJS = o\makedefs.o o\alloc.o o\monst.o o\objects.o o\panic.o
X
X# object files for special levels compiler
XSPLEVOBJS = o\lev_comp.o o\lev_lex.o o\lev_main.o o\alloc.o o\monst.o o\objects.o o\panic.o
X
X# nothing below this line should have to be changed
X#
X# other things that have to be reconfigured are in config.h,
X# {unixconf.h, pcconf.h, tosconf.h}, and possibly system.h
X
XVOBJ =	o\alloc.o o\apply.o o\artifact.o o\attrib.o o\bones.o o\cmd.o \
X	o\dbridge.o o\decl.o o\demon.o o\do.o o\do_name.o o\do_wear.o \
X	o\dog.o o\dogmove.o o\dothrow.o o\eat.o o\end.o o\engrave.o \
X	o\exper.o o\extralev.o o\fountain.o o\getline.o o\hack.o o\invent.o \
X	o\lock.o o\mail.o o\main.o o\makemon.o o\mcastu.o o\mhitm.o o\mhitu.o \
X	o\mklev.o o\mkmaze.o o\mkobj.o o\mkshop.o o\mon.o o\mondata.o \
X	o\msdos.o o\monmove.o o\monst.o o\mthrowu.o o\music.o o\o_init.o \
X	o\objects.o o\objnam.o o\options.o o\pager.o o\pickup.o o\polyself.o \
X	o\potion.o o\pray.o o\pri.o o\priest.o o\prisym.o $(RANDOM) o\read.o \
X	o\restore.o o\rip.o o\rnd.o o\rumors.o o\save.o o\search.o o\shk.o \
X	o\shknam.o o\sit.o o\sounds.o o\sp_lev.o o\spell.o o\steal.o \
X	o\termcap.o o\timeout.o o\topl.o o\topten.o o\track.o o\trap.o \
X	o\tty.o o\u_init.o o\uhitm.o o\unix.o o\vault.o o\weapon.o o\were.o \
X	o\wield.o o\wizard.o o\worm.o o\worn.o o\write.o o\zap.o
XHOBJ =	$(VOBJ) o\version.o
X
XPCCONF_H   = $(INCL)\$(TARG)conf.h $(INCL)\msdos.h $(INCL)\system.h \
X	     $(INCL)\extern.h 
XGLOBAL_H   = $(INCL)\global.h $(INCL)\coord.h $(PCCONF_H)
XCONFIG_H   = $(INCL)\config.h $(INCL)\tradstdc.h $(GLOBAL_H)
XTRAP_H	   = $(INCL)\trap.h
XPERMONST_H = $(INCL)\permonst.h $(INCL)\monflag.h
XYOU_H	   = $(INCL)\you.h $(INCL)\attrib.h $(PERMONST_H) $(INCL)\mondata.h \
X	     $(INCL)\monst.h $(INCL)\youprop.h
XDECL_H	   = $(INCL)\decl.h $(INCL)\spell.h $(INCL)\obj.h $(YOU_H) \
X	     $(INCL)\onames.h $(INCL)\pm.h
XHACK_H	   = $(CONFIG_H) $(DECL_H) $(INCL)\monsym.h $(INCL)\mkroom.h \
X	     $(INCL)\objclass.h $(INCL)\gold.h $(INCL)\trap.h $(INCL)\flag.h \
X	     $(INCL)\rm.h
X
X# The main target
X$(GAMEDIR)\$(GAME).exe: o $(HOBJ)
X	.\linkit
X#	$(LINK) $(HOBJ),nethack,nethack,ltermcap llibux $(LFLAGS) ;
X
X# NDMAKE automatically generates LINK response files, so you can
X# uncomment the second line if you are using NDMAKE.
X
X$(GAME): $(GAMEDIR)\$(GAME).exe
X$(GAME).exe: $(GAMEDIR)\$(GAME).exe
X
X.c.o:
X	$(CC) $(CFLAGS) $*.c, o\$*.o ;
X
Xall:	o $(GAME) auxil
X	@echo Done.
X
Xo:
X	mkdir o
X
Xmakedefs.exe:	$(MAKEOBJS)
X	$(LINK) $(LFLAGS) $(MAKEOBJS);
X
Xo\makedefs.o:  $(INCL)\config.h $(INCL)\permonst.h $(INCL)\objclass.h
X
Xlev_comp.exe:  $(SPLEVOBJS)
X	$(LINK) $(LFLAGS) -o lev_comp $(SPLEVOBJS)
X
Xo\lev_comp.o:  $(HACK_H) $(INCL)\sp_lev.h
Xo\lev_lex.o:  $(INCL)\lev_comp.h $(HACK_H) $(INCL)\sp_lev.h
Xo\lev_main.o:  $(HACK_H) $(INCL)\sp_lev.h
X
X# If you have yacc or lex programs, and make any changes,
X# add some .y.c and .l.c rules to your Make.ini.
X
Xlev_comp.c:  lev_comp.y
Xlev_lex.c:  lev_comp.l
X
X#
X#	The following include files depend on makedefs to be created.
X#
X#	date.h should be remade any time any of the source or include code
X#	is modified.
X#
X$(INCL)\date.h:	 $(VOBJ) makedefs.exe
X	.\makedefs -v
X
X$(INCL)\trap.h:	 makedefs.exe
X	.\makedefs -t
X
X$(INCL)\onames.h:  makedefs.exe
X	.\makedefs -o
X
X$(INCL)\pm.h:  makedefs.exe
X	.\makedefs -p
X
Xdata:	$(AUX)\data.base makedefs.exe
X	.\makedefs -d
X
Xrumors: $(AUX)\rumors.tru $(AUX)\rumors.fal makedefs.exe
X	.\makedefs -r
X
X#
X#	The following programs vary depending on what OS you are using.
X#
Xo\main.o:   $(HACK_H) $(TARG)main.c
X	$(CC) $(CFLAGS) $(TARG)main.c, o\main.o ;
X
Xo\tty.o:   $(HACK_H) $(INCL)\func_tab.h $(TARG)tty.c
X	$(CC) $(CFLAGS) $(TARG)tty.c, o\tty.o ;
X
Xo\unix.o:   $(HACK_H) $(TARG)unix.c
X	$(CC) $(CFLAGS) $(TARG)unix.c, o\unix.o ;
X
X#
X# Secondary targets
X#
X
Xauxil:	spec_levs
X	cd $(AUX)
X	xcopy *. $(GAMEDIR)
X
Xspec_levs: $(AUX)\castle.des $(AUX)\endgame.des $(AUX)\tower.des
X	lev_comp $(AUX)\castle.des
X	lev_comp $(AUX)\endgame.des
X	lev_comp $(AUX)\tower.des
X	cd $(AUX)
X	xcopy castle $(GAMEDIR)
X	del castle
X	xcopy endgame $(GAMEDIR)
X	del endgame
X	xcopy tower? $(GAMEDIR)
X	del tower?
X
Xclean:
X	del o\*.obj
X	rmdir o
X
Xspotless: clean
X	cd $(INCL)
X	del date.h
X	del onames.h
X	del pm.h
X	touch date.h onames.h pm.h
X	cd $(SRC)
X	del makedefs.exe
X	if exist lev_comp.exe del lev_comp.exe
X
X#
X# Other dependencies
X#
X
X# GO AHEAD, DELETE THIS LINE
X
Xo\alloc.o:  $(CONFIG_H)
Xo\apply.o:  $(HACK_H) $(INCL)\edog.h
Xo\artifact.o:  $(HACK_H) $(INCL)\artifact.h
Xo\attrib.o:  $(HACK_H)
Xo\bones.o:  $(HACK_H)
Xo\cmd.o:  $(HACK_H) $(INCL)\func_tab.h
Xo\dbridge.o: $(HACK_H)
Xo\decl.o:  $(HACK_H)
Xo\demon.o:  $(HACK_H)
Xo\do.o:  $(HACK_H)
Xo\do_name.o:  $(HACK_H)
Xo\do_wear.o:  $(HACK_H)
Xo\dog.o:  $(HACK_H) $(INCL)\edog.h
Xo\dogmove.o:  $(HACK_H) $(INCL)\mfndpos.h $(INCL)\edog.h
Xo\dokick.o:  $(HACK_H)
Xo\dothrow.o:  $(HACK_H)
Xo\eat.o:  $(HACK_H)
Xo\end.o:  $(HACK_H) $(INCL)\eshk.h
Xo\engrave.o:  $(HACK_H)
Xo\exper.o:  $(HACK_H)
Xo\extralev.o:  $(HACK_H)
Xo\fountain.o:  $(HACK_H)
Xo\getline.o:  $(HACK_H) $(INCL)\func_tab.h
Xo\hack.o:  $(HACK_H)
Xo\invent.o:  $(HACK_H) $(INCL)\lev.h $(INCL)\wseg.h
Xo\ioctl.o:  $(HACK_H)
Xo\lev_comp.o:  $(HACK_H) $(INCL)\sp_lev.h
Xo\lock.o:  $(HACK_H)
Xo\makemon.o:  $(HACK_H)
Xo\mail.o:  $(HACK_H)
Xo\mcastu.o:  $(HACK_H)
Xo\mhitm.o:  $(HACK_H) $(INCL)\artifact.h
Xo\mhitu.o:  $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
Xo\mklev.o:  $(HACK_H)
Xo\mkmaze.o:  $(HACK_H)
Xo\mkobj.o:  $(HACK_H)
Xo\mkroom.o:  $(HACK_H)
Xo\mon.o:  $(HACK_H) $(INCL)\mfndpos.h $(INCL)\artifact.h
Xo\mondata.o:  $(HACK_H) $(INCL)\eshk.h $(INCL)\epri.h
Xo\monmove.o:  $(HACK_H) $(INCL)\mfndpos.h $(INCL)\artifact.h
Xo\monst.o:  $(CONFIG_H) $(PERMONST_H) $(INCL)\eshk.h $(INCL)\vault.h $(INCL)\epri.h
Xo\msdos.o:  $(HACK_H)
Xo\mthrowu.o:  $(HACK_H)
Xo\music.o:  $(HACK_H)
Xo\o_init.o:  $(HACK_H) $(INCL)\onames.h
Xo\objects.o:  $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h $(INCL)\prop.h
Xo\objnam.o:  $(HACK_H)
Xo\options.o:  $(HACK_H)
Xo\pager.o:  $(HACK_H)
Xo\panic.o:  $(CONFIG_H)
Xo\pickup.o:  $(HACK_H)
Xo\polyself.o:  $(HACK_H)
Xo\potion.o:  $(HACK_H)
Xo\pray.o:  $(HACK_H)
Xo\pri.o:  $(HACK_H)
Xo\priest.o:  $(HACK_H) $(INCL)\mfndpos.h $(INCL)\eshk.h $(INCL)\epri.h
Xo\prisym.o:  $(HACK_H) $(INCL)\lev.h $(INCL)\wseg.h
Xo\random.o:
Xo\read.o:  $(HACK_H)
Xo\restore.o:  $(HACK_H) $(INCL)\lev.h $(INCL)\wseg.h
Xo\rip.o:  $(HACK_H)
Xo\rnd.o:  $(HACK_H)
Xo\rumors.o:  $(HACK_H)
Xo\save.o:  $(HACK_H) $(INCL)\lev.h $(INCL)\wseg.h
Xo\search.o:  $(HACK_H) $(INCL)\artifact.h
Xo\shk.o:  $(HACK_H) $(INCL)\eshk.h
Xo\shknam.o:  $(HACK_H) $(INCL)\eshk.h
Xo\sit.o:  $(HACK_H)
Xo\sounds.o:  $(HACK_H) $(INCL)\edog.h $(INCL)\eshk.h
Xo\sp_lev.o:  $(HACK_H) $(INCL)\sp_lev.h
Xo\spell.o:  $(HACK_H)
Xo\steal.o:  $(HACK_H)
Xo\termcap.o:  $(HACK_H)
Xo\timeout.o:  $(HACK_H)
Xo\topl.o:  $(HACK_H)
Xo\topten.o:  $(HACK_H)
Xo\track.o:  $(HACK_H)
Xo\trap.o:  $(HACK_H) $(INCL)\edog.h $(INCL)\trapname.h
Xo\u_init.o:  $(HACK_H)
Xo\uhitm.o:  $(HACK_H) $(INCL)\artifact.h
Xo\vault.o:  $(HACK_H) $(INCL)\vault.h
Xo\version.o:  $(HACK_H) $(INCL)\date.h
Xo\weapon.o:  $(HACK_H)
Xo\were.o:  $(HACK_H)
Xo\wield.o:  $(HACK_H)
Xo\wizard.o:  $(HACK_H)
Xo\worm.o:  $(HACK_H) $(INCL)\wseg.h
Xo\worn.o:  $(HACK_H)
Xo\write.o:  $(HACK_H)
Xo\zap.o:  $(HACK_H)
END_OF_FILE
if test 7940 -ne `wc -c <'others/Makefile.pc'`; then
    echo shar: \"'others/Makefile.pc'\" unpacked with wrong size!
fi
# end of 'others/Makefile.pc'
fi
if test -f 'src/dogmove.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/dogmove.c'\"
else
echo shar: Extracting \"'src/dogmove.c'\" \(9541 characters\)
sed "s/^X//" >'src/dogmove.c' <<'END_OF_FILE'
X/*	SCCS Id: @(#)dogmove.c	3.0	88/04/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
X#include "mfndpos.h"
X#include "edog.h"
X
Xstatic const char nofetch[] = { BALL_SYM, CHAIN_SYM, ROCK_SYM, 0 };
X
X/* return 0 (no move), 1 (move) or 2 (dead) */
Xint
Xdog_move(mtmp, after)
Xregister struct monst *mtmp;
Xregister int after;
X{
Xregister int nx,ny,omx,omy,appr,nearer,j;
Xint udist,chi,i,whappr;
X/* XLINT register struct permonst *mdat = mtmp->data; */
Xregister struct edog *edog = EDOG(mtmp);
Xstruct obj *obj;
Xstruct trap *trap;
Xxchar cnt,chcnt,nix,niy;
Xschar dogroom,uroom;
Xxchar gx,gy,gtyp,otyp;	/* current goal */
Xcoord poss[9];
Xlong info[9];
Xlong allowflags;
X#define GDIST(x,y) (dist2(x,y,gx,gy))
X#define DDIST(x,y) (dist2(x,y,omx,omy))
X
X	omx = mtmp->mx;
X	omy = mtmp->my;
X	whappr = (moves - EDOG(mtmp)->whistletime < 5);
X	if(moves > EDOG(mtmp)->hungrytime + 500) {
X		if(!carnivorous(mtmp->data) && !herbivorous(mtmp->data)) {
X			EDOG(mtmp)->hungrytime = moves + 500;
X			/* but not too high; it might polymorph */
X		} else if (!mtmp->mconf) {
X			mtmp->mconf = 1;
X			mtmp->mhpmax /= 3;
X			if(mtmp->mhp > mtmp->mhpmax)
X				mtmp->mhp = mtmp->mhpmax;
X			if(cansee(omx,omy))
X			    pline("%s is confused from hunger.", Monnam(mtmp));
X			else You("feel worried about %s.", mon_nam(mtmp));
X		} else if(moves > EDOG(mtmp)->hungrytime + 750 ||
X							mtmp->mhp < 1) {
X#ifdef WALKIES
X			if(mtmp->mleashed)
X				Your("leash goes slack.");
X#endif
X			if(cansee(omx,omy))
X				pline("%s dies%s.", Monnam(mtmp),
X				      (mtmp->mhp >= 1) ? "" : " from hunger");
X			else
X		You("have a sad feeling for a moment, then it passes.");
X			mondied(mtmp);
X			return(2);
X		}
X	}
X	dogroom = inroom(omx,omy);
X	uroom = inroom(u.ux,u.uy);
X	udist = dist(omx,omy);
X
X	/* maybe we tamed him while being swallowed --jgm */
X	if(!udist) return(0);
X
X	/* if we are carrying sth then we drop it (perhaps near @) */
X	/* Note: if apport == 1 then our behaviour is independent of udist */
X	if(mtmp->minvent){
X		if(!rn2(udist) || !rn2((int) edog->apport))
X		if(rn2(10) < edog->apport){
X			if (cansee(omx,omy) && flags.verbose)
X			    pline("%s drops %s.", Monnam(mtmp),
X					distant_name(mtmp->minvent, doname));
X			relobj(mtmp, (int) mtmp->minvis);
X			if(edog->apport > 1) edog->apport--;
X			edog->dropdist = udist;		/* hpscdi!jon */
X			edog->droptime = moves;
X		}
X	} else {
X		if(obj = o_at(omx,omy)) if(!index(nofetch, obj->olet)){
X		    if((otyp = dogfood(mtmp, obj)) <= CADAVER){
X			nix = omx;
X			niy = omy;
X			goto eatobj;
X		    }
X		    if(can_carry(mtmp, obj))
X		    if(rn2(20) < edog->apport+3)
X		    if(rn2(udist) || !rn2((int) edog->apport)){
X			if (cansee(omx, omy) && flags.verbose)
X			    pline("%s picks up %s.", Monnam(mtmp),
X				distant_name(obj, doname));
X			freeobj(obj);
X			unpobj(obj);
X			/* if(levl[omx][omy].scrsym == obj->olet)
X				newsym(omx,omy); */
X			mpickobj(mtmp,obj);
X		    }
X		}
X	}
X
X	gtyp = UNDEF;	/* no goal as yet */
X	gx = gy = 0;	/* suppress 'used before set' message */
X#ifdef WALKIES
X	/* If he's on a leash, he's not going anywhere. */
X	if(mtmp->mleashed) {
X
X		gtyp = APPORT;
X		gx = u.ux;
X		gy = u.uy;
X	} else
X#endif
X	/* first we look for food, then objects */
X	    for(obj = fobj; obj; obj = obj->nobj) {
X		otyp = dogfood(mtmp, obj);
X		if(otyp > gtyp || otyp == UNDEF) continue;
X		if(inroom(obj->ox,obj->oy) != dogroom) continue;
X		if(otyp < MANFOOD &&
X		 (dogroom >= 0 || DDIST(obj->ox,obj->oy) < 10)) {
X			if(otyp < gtyp || (otyp == gtyp &&
X				DDIST(obj->ox,obj->oy) < DDIST(gx,gy))){
X				gx = obj->ox;
X				gy = obj->oy;
X				gtyp = otyp;
X			}
X		} else if(gtyp == UNDEF && dogroom >= 0 &&
X		   uroom == dogroom &&
X		   !mtmp->minvent && edog->apport > rn2(8) &&
X		   can_carry(mtmp,obj)){
X			gx = obj->ox;
X			gy = obj->oy;
X			gtyp = APPORT;
X		}
X	    }
X
X	if(gtyp == UNDEF ||
X	  (gtyp != DOGFOOD && gtyp != APPORT && moves < EDOG(mtmp)->hungrytime)){
X		if(dogroom < 0 || dogroom == uroom){
X			gx = u.ux;
X			gy = u.uy;
X		} else {
X			int tmp = rooms[dogroom].fdoor;
X			    cnt = rooms[dogroom].doorct;
X
X			gx = gy = FAR;	/* random, far away */
X			while(cnt--){
X			    if(dist(gx,gy) >
X				dist(doors[tmp].x, doors[tmp].y)){
X					gx = doors[tmp].x;
X					gy = doors[tmp].y;
X				}
X				tmp++;
X			}
X			/* here gx == FAR e.g. when dog is in a vault */
X			if(gx == FAR || (gx == omx && gy == omy)){
X				gx = u.ux;
X				gy = u.uy;
X			}
X		}
X		appr = (udist >= 9) ? 1 : (mtmp->mflee) ? -1 : 0;
X		if(after && udist <= 4 && gx == u.ux && gy == u.uy)
X			return(0);
X		if(udist > 1){
X			if(!IS_ROOM(levl[u.ux][u.uy].typ) || !rn2(4) ||
X			   whappr ||
X			   (mtmp->minvent && rn2((int) edog->apport)))
X				appr = 1;
X		}
X		/* if you have dog food it'll follow you more closely */
X		if(appr == 0){
X			obj = invent;
X			while(obj){
X				if(obj->otyp == TRIPE_RATION){
X					appr = 1;
X					break;
X				}
X				obj = obj->nobj;
X			}
X		}
X	} else	appr = 1;	/* gtyp != UNDEF */
X	if(mtmp->mconf) appr = 0;
X
X	if(gx == u.ux && gy == u.uy && (dogroom != uroom || dogroom < 0)) {
X	register coord *cp;
X		cp = gettrack(omx,omy);
X		if(cp){
X			gx = cp->x;
X			gy = cp->y;
X		}
X	}
X
X	nix = omx;
X	niy = omy;
X	
X	allowflags = ALLOW_M | ALLOW_TRAPS | ALLOW_SSM | ALLOW_SANCT;
X	if (passes_walls(mtmp->data)) allowflags |= (ALLOW_ROCK|ALLOW_WALL);
X	if (tunnels(mtmp->data) && !needspick(mtmp->data))
X		allowflags |= ALLOW_DIG;
X	cnt = mfndpos(mtmp, poss, info, allowflags);
X	if (allowflags & ALLOW_DIG) if(!mdig_tunnel(mtmp)) return(2);
X	chcnt = 0;
X	chi = -1;
X	for(i=0; i<cnt; i++){
X		nx = poss[i].x;
X		ny = poss[i].y;
X#ifdef WALKIES
X		/* if leashed, we drag him along. */
X		if(dist(nx, ny) > 4 && mtmp->mleashed) continue;
X#endif
X		if(info[i] & ALLOW_M) {
X			if(levl[nx][ny].mmask) {
X			    register struct monst *mtmp2 = m_at(nx,ny);
X
X			    if(mtmp2->m_lev >= mtmp->m_lev+2 ||
X			       (mtmp2->data->mlet == S_COCKATRICE &&
X				!(mtmp->data->mflags1 & M1_STON_RES)))
X				continue;
X			    if(after) return(0); /* hit only once each move */
X
X			    if(mattackm(mtmp, mtmp2) == 1 && rn2(4) &&
X			      mtmp2->mlstmv != moves &&
X			      mattackm(mtmp2, mtmp) == 2) return(2);
X			    return(0);
X			}
X		}
X
X		/* dog avoids traps */
X		/* but perhaps we have to pass a trap in order to follow @ */
X		if((info[i] & ALLOW_TRAPS) && (trap = t_at(nx,ny))){
X#ifdef WALKIES
X			if(!mtmp->mleashed) {
X#endif
X			    if(!trap->tseen && rn2(40)) continue;
X			    if(rn2(10)) continue;
X#ifdef WALKIES
X			}
X# ifdef SOUNDS
X			else if(flags.soundok)
X				whimper(mtmp);
X# endif
X#endif
X		}
X
X		/* dog eschews cursed objects */
X		/* but likes dog food */
X		obj = fobj;
X		if(levl[nx][ny].omask) 
X		  while(obj){
X		    if(obj->ox != nx || obj->oy != ny)
X			goto nextobj;
X		    if(obj->cursed && !mtmp->mleashed) goto nxti;
X		    if(obj->olet == FOOD_SYM &&
X			(otyp = dogfood(mtmp, obj)) < MANFOOD &&
X			(otyp < ACCFOOD || EDOG(mtmp)->hungrytime <= moves)){
X			/* Note: our dog likes the food so much that he
X			might eat it even when it conceals a cursed object */
X			nix = nx;
X			niy = ny;
X			chi = i;
X		     eatobj:
X			mtmp->meating =
X			    obj->quan * objects[obj->otyp].oc_delay;
X			if(EDOG(mtmp)->hungrytime < moves)
X			    EDOG(mtmp)->hungrytime = moves;
X			EDOG(mtmp)->hungrytime +=
X			    5*obj->quan * objects[obj->otyp].nutrition;
X			mtmp->mconf = 0;
X			if (mtmp->mtame < 20) mtmp->mtame++;
X			if(cansee(nix,niy))
X			    pline("%s eats %s.", Monnam(mtmp), doname(obj));
X			/* perhaps this was a reward */
X			if(otyp != CADAVER)
X#ifdef LINT	/* edog->apport += (unsigned) (200L/((long) edog->dropdist...*/
X			edog->apport = 0;
X#else
X			edog->apport += (unsigned)(200L/
X				((long)edog->dropdist+moves-edog->droptime));
X#endif
X			delobj(obj);
X			goto newdogpos;
X		    }
X		nextobj:
X		    obj = obj->nobj;
X		}
X
X		for(j=0; j<MTSZ && j<cnt-1; j++)
X			if(nx == mtmp->mtrack[j].x && ny == mtmp->mtrack[j].y)
X				if(rn2(4*(cnt-j))) goto nxti;
X
X		nearer = (GDIST(nx,ny) - GDIST(nix,niy)) * appr;
X		if((nearer == 0 && !rn2(++chcnt)) || nearer<0 ||
X			(nearer > 0 && !whappr &&
X				((omx == nix && omy == niy && !rn2(3))
X				|| !rn2(12))
X			)){
X			nix = nx;
X			niy = ny;
X			if(nearer < 0) chcnt = 0;
X			chi = i;
X		}
X	nxti:	;
X	}
Xnewdogpos:
X	if(nix != omx || niy != omy) {
X		if(info[chi] & ALLOW_U) {
X#ifdef WALKIES
X			if(mtmp->mleashed) { /* play it safe */
X				pline("%s breaks loose of %s leash!", 
X					is_female(mtmp) ? "her" :
X					is_human(mtmp->data) ? "his" : "its",
X					Monnam(mtmp));
X				m_unleash(mtmp);
X			}
X#endif
X			(void) mattacku(mtmp);
X			return(0);
X		}
X		levl[omx][omy].mmask = 0;
X		levl[nix][niy].mmask = 1;
X		mtmp->mx = nix;
X		mtmp->my = niy;
X		for(j=MTSZ-1; j>0; j--) mtmp->mtrack[j] = mtmp->mtrack[j-1];
X		mtmp->mtrack[0].x = omx;
X		mtmp->mtrack[0].y = omy;
X	}
X#ifdef WALKIES
X	  /* an incredible kluge, but the only way to keep pooch near
X	   * after he spends time eating or in a trap, etc...
X	   */
X	  else  if(mtmp->mleashed && dist(omx, omy) > 4) {
X		coord cc;	
X
X		nx = sgn(omx - u.ux);
X		ny = sgn(omy - u.uy);
X		if(goodpos((cc.x = u.ux+nx), (cc.y = u.uy+ny))) goto dognext;
X
X	 	i  = xytod(nx, ny);
X		for(j = (i + 7)%8; j < (i + 1)%8; j++) {
X
X		   dtoxy(&cc, j);
X		   if(goodpos(cc.x, cc.y)) goto dognext;
X		}
X		for(j = (i + 6)%8; j < (i + 2)%8; j++) {
X
X		   dtoxy(&cc, j);
X		   if(goodpos(cc.x, cc.y)) goto dognext;
X		}
X		cc.x = mtmp->mx;
X		cc.y = mtmp->my;
Xdognext:
X		levl[mtmp->mx][mtmp->my].mmask = 0;
X		levl[cc.x][cc.y].mmask = 1;
X		mtmp->mx = cc.x;
X		mtmp->my = cc.y;
X		pmon(mtmp);
X		set_apparxy(mtmp);
X	}
X#endif
X
X	if(mintrap(mtmp) == 2)		/* he died */
X		return(2);
X	pmon(mtmp);
X	return(1);
X}
END_OF_FILE
if test 9541 -ne `wc -c <'src/dogmove.c'`; then
    echo shar: \"'src/dogmove.c'\" unpacked with wrong size!
fi
# end of 'src/dogmove.c'
fi
if test -f 'src/mcastu.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/mcastu.c'\"
else
echo shar: Extracting \"'src/mcastu.c'\" \(7711 characters\)
sed "s/^X//" >'src/mcastu.c' <<'END_OF_FILE'
X/*	SCCS Id: @(#)mcastu.c	3.0	88/04/13
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* NetHack may be freely redistributed.  See license for details. */
X
X#include	"hack.h"
X
Xconst char *spelltyp[] = {
X	"shower of missiles",
X	"fireball",
X	"sleep ray",
X	"cone of cold",
X	"finger of death",
X	"bolt of lightning",
X	"",
X	"",
X	"",
X	""
X};
X
Xstatic
Xvoid
Xcursetxt(mtmp)
X	register struct monst *mtmp;
X{
X	if(canseemon(mtmp))
X		pline("%s points at you, then curses.", Monnam(mtmp));
X	else if((!(moves%4) || !rn2(4)) && flags.soundok) 
X		You("hear a mumbled curse.");
X}
X
Xint
Xcastmu(mtmp, mattk)	/* monster casts spell at you */
X	register struct monst *mtmp;
X	register struct attack *mattk;
X{
X	int	dmg = 0, ml = mtmp->m_lev;
X
X	if(mtmp->mcan || mtmp->mspec_used) {  /* could not attack */
X	    cursetxt(mtmp);
X	    return(0);
X	} else {
X	    nomul(0);
X	    if(rn2(ml*10) < (mtmp->mconf ? 100 : 20)) {	/* fumbled attack */
X		if(canseemon(mtmp))
X		    pline("The air crackles around %s.", mon_nam(mtmp));
X		return(0);
X	    }
X	}
X/*
X *	As these are spells, the damage is related to the level
X *	of the monster casting the spell.
X */
X	if (mattk->damd)
X		dmg = d((int)((ml/3) + mattk->damn), (int)mattk->damd);
X	else dmg = d((int)((ml/3) + 1), 6);
X
X	switch(mattk->adtyp)   {
X
X	    case AD_FIRE:
X		pline("You're enveloped in flames.");
X		if(Fire_resistance) {
X			shieldeff(u.ux, u.uy);
X			pline("But you resist the effects.");
X			dmg = 0;
X		}
X		break;
X	    case AD_COLD:
X		pline("You're covered in frost.");
X		if(Cold_resistance) {
X			shieldeff(u.ux, u.uy);
X			pline("But you resist the effects.");
X			dmg = 0;
X		}
X		break;
X#ifdef HARD
X	    case AD_MAGM:
X		You("are hit by a shower of missiles!");
X		if(Antimagic) {
X			shieldeff(u.ux, u.uy);
X			pline("The missiles bounce off!");
X			dmg = 0;
X		} else dmg = d((int)mtmp->m_lev/2 + 1,6);
X		break;
X#endif
X	    case AD_SPEL:	/* random spell */
X
X		mtmp->mspec_used = 10 - mtmp->m_lev;
X		if (mtmp->mspec_used < 2) mtmp->mspec_used = 2;
X		switch(rn2((int)mtmp->m_lev)) {
X		    case 22:
X		    case 21:
X		    case 20:
X			pline("Oh no, %s's using the touch of death!",
X			      is_female(mtmp) ? "she" :
X			      is_human(mtmp->data) ? "he" : "it"
X			     );
X#ifdef POLYSELF
X			if (is_undead(uasmon))
X			    You("seem no deader than before.");
X			else
X#endif
X			if(!Antimagic && rn2(ml) > 12)  {
X
X			    if(Hallucination)
X				You("have an out of body experience.");
X			    else  {
X				killer = "touch of death";
X				done("died");
X			    }
X			} else {
X				if(Antimagic) shieldeff(u.ux, u.uy);
X				pline("Lucky for you, it didn't work!");
X			}
X			dmg = 0;
X			break;
X		    case 19:
X		    case 18:
X			if(mtmp->iswiz && flags.no_of_wizards == 1) {
X				pline("Double Trouble...");
X				clonewiz();
X				dmg = 0;
X				break;
X			} /* else fall into the next case */
X		    case 17:
X		    case 16:
X		    case 15:
X			if(mtmp->iswiz && flags.soundok)
X			    pline("\"Destroy the thief, my pets!\"");
X#ifdef HARD
X			nasty();	/* summon something nasty */
X#endif
X			/* fall into the next case */
X		    case 14:		/* aggravate all monsters */
X		    case 13:
X			aggravate();
X			dmg = 0;
X			break;
X		    case 12:		/* curse random items */
X		    case 11:
X		    case 10:
X			rndcurse();
X			dmg = 0;
X			break;
X		    case 9:
X		    case 8:		/* destroy armor */
X			if(Antimagic) {
X				shieldeff(u.ux, u.uy);
X				pline("A field of force surrounds you!");
X			} else if(!destroy_arm(some_armor()))
X				Your("skin itches.");
X			dmg = 0;
X			break;
X		    case 7:
X		    case 6:		/* drain strength */
X			if(Antimagic) {
X			    shieldeff(u.ux, u.uy);
X			    You("feel momentarily weakened.");
X			} else {
X			    You("suddenly feel weaker!");
X			    losestr(rnd(ml - 6));
X			    if(u.uhp < 1)
X				done_in_by(mtmp);
X			}
X			dmg = 0;
X			break;
X		    case 5:		/* make invisible if not */
X		    case 4:
X			if(!mtmp->minvis) {
X			    if(canseemon(mtmp) && !See_invisible)
X				pline("%s suddenly disappears!",
X				      Monnam(mtmp));
X			    mtmp->minvis = 1;
X			    unpmon(mtmp);
X			    dmg = 0;
X			    break;
X			} /* else fall into the next case */
X		    case 3:		/* stun */
X			if(Antimagic) {
X			    shieldeff(u.ux, u.uy);
X			    if(!Stunned)
X				You("feel momentarily disoriented.");
X			    make_stunned(1L, FALSE);
X			} else {
X			    if (Stunned)	You("struggle to keep your balance.");
X			    else		You("reel...");
X			    make_stunned(HStun + d(ACURR(A_DEX) < 12 ? 6 : 4, 4), FALSE);
X			}
X			dmg = 0;
X			break;
X		    case 2:		/* haste self */
X			if(mtmp->mspeed == MSLOW)	mtmp->mspeed = 0;
X			else				mtmp->mspeed = MFAST;
X			dmg = 0;
X			break;
X		    case 1:		/* cure self */
X			if(mtmp->mhp < mtmp->mhpmax) {
X			    if((mtmp->mhp += rnd(8)) > mtmp->mhpmax)
X				mtmp->mhp = mtmp->mhpmax;
X			    dmg = 0;
X			    break;
X			} /* else fall through to default case */
X		    default:		/* psi bolt */
X			if(Antimagic) {
X			    shieldeff(u.ux, u.uy);
X			    You("get a slight %sache.",body_part(HEAD));
X			    dmg = 1;
X			} else {
X			    if (dmg <= 10)
X				Your("brain is on fire!");
X			    else Your("%s suddenly aches!", body_part(HEAD));
X			}
X			break;
X		}
X		break;
X		
X	    case AD_CLRC:	/* clerical spell */
X
X		mtmp->mspec_used = 10 - mtmp->m_lev;
X		if (mtmp->mspec_used < 2) mtmp->mspec_used = 2;
X		switch(rn2((int)mtmp->m_lev)) {
X		    /* Other ideas: lightning bolts, towers of flame,
X				    gush of water  -3. */
X
X		    default:		/* confuse */
X			if(Antimagic) {
X			    shieldeff(u.ux, u.uy);
X			    You("feel momentarily dizzy.");
X			} else {
X			    make_confused(HConfusion + (long)mtmp->m_lev, TRUE);
X			}
X			dmg = 0;
X			break;
X		    case 12:		/* curse random items */
X		    case 11:
X		    case 10:
X			rndcurse();
X			dmg = 0;
X			break;
X		    case 9:
X		    case 8:		/* insects */
X			/* Try for insects, and if there are none
X			   left, go for (sticks to) snakes.  -3. */
X			{
X			int i;
X			struct permonst *pm = mkclass(S_ANT);
X			struct monst *mtmp2;
X			char let = (pm ? S_ANT : S_SNAKE);
X  
X			for (i = 0; i <= mtmp->m_lev; i++)
X			   if ((pm = mkclass(let)) &&
X					(mtmp2 = makemon(pm, u.ux, u.uy)))
X				mtmp2->msleep = mtmp2->mpeaceful =
X					mtmp2->mtame = 0;
X			}			
X			dmg = 0;
X			break;
X		    case 6:
X		    case 7:		/* blindness */
X			if (!Blinded) {
X			    pline("Scales cover your eyes!");
X			    make_blinded(200L, FALSE);
X			    dmg = 0;
X			    break;
X			}
X		    case 4:
X		    case 5:		/* wound */
X			if(Antimagic) {
X			    shieldeff(u.ux, u.uy);
X			    Your("skin itches badly for a moment.");
X			    dmg = 0;
X			} else {
X			    pline("Wounds appear on your body!");
X			    dmg = d(2,8) + 1;
X			}
X			break;
X		    case 3:		/* hold */
X			if(Antimagic) {
X			    shieldeff(u.ux, u.uy);
X			    if(multi >= 0)
X				You("stiffen briefly.");
X			    nomul(-1);
X		 	} else {
X			    if (multi >= 0)	
X			        You("are frozen in place!");
X			    nomul(-4 - (int)mtmp->m_lev);
X			}
X			dmg = 0;
X			break;
X		    case 2:
X		    case 1:		/* cure self */
X			if(mtmp->mhp < mtmp->mhpmax) {
X			    if((mtmp->mhp += rnd(8)) > mtmp->mhpmax)
X				mtmp->mhp = mtmp->mhpmax;
X			    dmg = 0;
X			    break;
X			} /* else fall through to default case */
X		}
X	}
X	if(dmg) mdamageu(mtmp, dmg);
X	return(1);
X}
X
Xint
Xbuzzmu(mtmp, mattk)		/* monster uses spell (ranged) */
X	register struct monst *mtmp;
X	register struct attack  *mattk;
X{
X	if(mtmp->mcan || mattk->adtyp > AD_SPC2) {
X	    cursetxt(mtmp);
X	    return(0);
X	}
X	if(lined_up(mtmp) && rn2(3)) {
X	    nomul(0);
X	    if(mattk->adtyp && (mattk->adtyp < 11)) { /* no cf unsigned >0 */
X		if(canseemon(mtmp))
X		    pline("%s zaps you with a %s!", Monnam(mtmp),
X			  spelltyp[mattk->adtyp-1]);
X		buzz((int) (-10 - (mattk->adtyp-1)), (int)mattk->damn,
X		     mtmp->mx, mtmp->my, sgn(tbx), sgn(tby));
X	    } else impossible("Monster spell %d cast", mattk->adtyp-1);
X	}
X	return(1);
X}
X
END_OF_FILE
if test 7711 -ne `wc -c <'src/mcastu.c'`; then
    echo shar: \"'src/mcastu.c'\" unpacked with wrong size!
fi
# end of 'src/mcastu.c'
fi
if test -f 'src/steal.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/steal.c'\"
else
echo shar: Extracting \"'src/steal.c'\" \(6558 characters\)
sed "s/^X//" >'src/steal.c' <<'END_OF_FILE'
X/*	SCCS Id: @(#)steal.c	3.0	88/07/06
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 char *
Xequipname(otmp)
X
X	register struct obj *otmp;
X{
X
X	return (
X#ifdef SHIRT
X		(otmp == uarmu) ? "shirt" :
X#endif
X		(otmp == uarmf) ? "boots" :
X		(otmp == uarms) ? "shield" :
X		(otmp == uarmg) ? "gloves" :
X		(otmp == uarmc) ? "cloak" :
X		(otmp == uarmh) ? "helmet" : "armor");
X}
X
Xlong		/* actually returns something that fits in an int */
Xsomegold(){
X#ifdef LINT	/* long conv. ok */
X	return(0L);
X#else
X	return (long)( (u.ugold < 100) ? u.ugold :
X		(u.ugold > 10000) ? rnd(10000) : rnd((int) u.ugold) );
X#endif
X}
X
Xvoid
Xstealgold(mtmp)
Xregister struct monst *mtmp;
X{
X	register struct gold *gold = g_at(u.ux, u.uy);
X	register long tmp;
X	if(gold && ( !u.ugold || gold->amount > u.ugold || !rn2(5))) {
X		mtmp->mgold += gold->amount;
X		freegold(gold);
X		if(Invisible) newsym(u.ux, u.uy);
X		pline("%s quickly snatches some gold from between your %s!",
X			Monnam(mtmp), makeplural(body_part(FOOT)));
X		if(!u.ugold || !rn2(5)) {
X			rloc(mtmp);
X			mtmp->mflee = 1;
X		}
X	} else if(u.ugold) {
X		u.ugold -= (tmp = somegold());
X		Your("purse feels lighter.");
X		mtmp->mgold += tmp;
X		rloc(mtmp);
X		mtmp->mflee = 1;
X		flags.botl = 1;
X	}
X}
X
X/* steal armor after he finishes taking it off */
Xunsigned int stealoid;		/* object to be stolen */
Xunsigned int stealmid;		/* monster doing the stealing */
X
Xstatic int
Xstealarm(){
X	register struct monst *mtmp;
X	register struct obj *otmp;
X
X	for(otmp = invent; otmp; otmp = otmp->nobj)
X	  if(otmp->o_id == stealoid) {
X	    for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
X	      if(mtmp->m_id == stealmid) {
X		  freeinv(otmp);
X		  pline("%s steals %s!", Monnam(mtmp), doname(otmp));
X		  mpickobj(mtmp,otmp);
X		  mtmp->mflee = 1;
X		  rloc(mtmp);
X		break;
X	      }
X	    break;
X	  }
X	return stealoid = 0;
X}
X
X/* Returns 1 when something was stolen (or at least, when N should flee now)
X * Avoid stealing the object stealoid
X */
Xint
Xsteal(mtmp)
Xstruct monst *mtmp;
X{
X	register struct obj *otmp;
X	register int tmp;
X	register int named = 0;
X
X	/* the following is true if successful on first of two attacks. */
X	if(dist(mtmp->mx, mtmp->my) > 3) return(0);
X
X	if(!invent){
X	    /* Not even a thousand men in armor can strip a naked man. */
X	    if(Blind)
X	      pline("Somebody tries to rob you, but finds nothing to steal.");
X	    else
X	      pline("%s tries to rob you, but she finds nothing to steal!",
X		Monnam(mtmp));
X	    return(1);	/* let her flee */
X	}
X
X	if(Adornment & LEFT_RING) {
X	    otmp = uleft;
X	    goto gotobj;
X	} else if(Adornment & RIGHT_RING) {
X	    otmp = uright;
X	    goto gotobj;
X	}
X
X	tmp = 0;
X	for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp != uarmc)
X	    tmp += ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1);
X	tmp = rn2(tmp);
X	for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp != uarmc)
X  	    if((tmp -= ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1))
X			< 0) break;
X	if(!otmp) {
X		impossible("Steal fails!");
X		return(0);
X	}
X	/* can't steal armor while wearing cloak - so steal the cloak. */
X	if(otmp == uarm && uarmc) otmp = uarmc;
X#ifdef SHIRT
X	else if(otmp == uarmu && uarmc) otmp = uarmc;
X	else if(otmp == uarmu && uarm) otmp = uarm;
X#endif
Xgotobj:
X	if(otmp->o_id == stealoid) return(0);
X
X#ifdef WALKIES
X	if(otmp->otyp == LEASH && otmp->leashmon) o_unleash(otmp);
X#endif
X
X	if((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL))){
X		switch(otmp->olet) {
X		case TOOL_SYM:
X			Blindf_off(otmp);
X			break;
X		case AMULET_SYM:
X			Amulet_off();
X			break;
X		case RING_SYM:
X			Ring_gone(otmp);
X			break;
X		case ARMOR_SYM:
X			if(multi < 0 || otmp == uarms){
X			  setworn((struct obj *) 0, otmp->owornmask & W_ARMOR);
X			  break;
X			}
X		{ int curssv = otmp->cursed;
X			otmp->cursed = 0;
X			stop_occupation();
X			if(flags.female)
X			    pline("%s charms you.  You gladly %s your %s.",
X				  Monnam(mtmp),
X				  curssv ? "let her take" : "hand over",
X				  equipname(otmp));
X			else
X			    pline("%s seduces you and %s off your %s.",
X				  Amonnam(mtmp, Blind ? "gentle" : "beautiful"),
X				  curssv ? "helps you to take" : "you start taking",
X				  equipname(otmp));
X			named++;
X			/* the following is to set multi for later on */
X			(void) nomul(-objects[otmp->otyp].oc_delay);
X
X			if (otmp == uarm)  (void) Armor_off();
X			else if (otmp == uarmc) (void) Cloak_off();
X			else if (otmp == uarmf) (void) Boots_off();
X			else if (otmp == uarmg) (void) Gloves_off();
X			else if (otmp == uarmh) (void) Helmet_off();
X			else if (otmp == uarms) (void) Shield_off();
X			else setworn((struct obj *)0, otmp->owornmask & W_ARMOR);
X			otmp->cursed = curssv;
X			if(multi < 0){
X				/*
X				multi = 0;
X				nomovemsg = 0;
X				afternmv = 0;
X				*/
X				stealoid = otmp->o_id;
X				stealmid = mtmp->m_id;
X				afternmv = stealarm;
X				return(0);
X			}
X			break;
X		}
X		default:
X			impossible("Tried to steal a strange worn thing.");
X		}
X	}
X	else if(otmp == uwep) uwepgone();
X
X	if(otmp == uball) unpunish();
X
X	freeinv(otmp);
X	pline("%s stole %s.", named ? "She" : Monnam(mtmp), doname(otmp));
X	mpickobj(mtmp,otmp);
X	return((multi < 0) ? 0 : 1);
X}
X
Xvoid
Xmpickobj(mtmp,otmp)
Xregister struct monst *mtmp;
Xregister struct obj *otmp;
X{
X	otmp->nobj = mtmp->minvent;
X	mtmp->minvent = otmp;
X}
X
Xvoid
Xstealamulet(mtmp)
Xregister struct monst *mtmp;
X{
X	register struct obj *otmp;
X
X	for(otmp = invent; otmp; otmp = otmp->nobj) {
X	    if(otmp->otyp == AMULET_OF_YENDOR) {
X		/* might be an imitation one */
X		setnotworn(otmp);
X		freeinv(otmp);
X		mpickobj(mtmp,otmp);
X		pline("%s stole %s!", Monnam(mtmp), doname(otmp));
X		rloc(mtmp);
X	    }
X	}
X}
X
X/* release the objects the killed animal has stolen */
Xvoid
Xrelobj(mtmp,show)
Xregister struct monst *mtmp;
Xregister int show;
X{
X	register struct obj *otmp, *otmp2;
X
X	for(otmp = mtmp->minvent; otmp; otmp = otmp2){
X		otmp->ox = mtmp->mx;
X		otmp->oy = mtmp->my;
X		otmp2 = otmp->nobj;
X		otmp->nobj = fobj;
X		if (flooreffects(otmp,mtmp->mx,mtmp->my)) continue;
X		fobj = otmp;
X		levl[otmp->ox][otmp->oy].omask = 1;
X		stackobj(fobj);
X		if(show & cansee(mtmp->mx,mtmp->my))
X			atl(otmp->ox,otmp->oy,Hallucination?rndobjsym() : otmp->olet);
X	}
X	mtmp->minvent = (struct obj *) 0;
X	if(mtmp->mgold || mtmp->data->mlet == S_LEPRECHAUN) {
X		register long tmp;
X
X		tmp = (mtmp->mgold > 10000) ? 10000 : mtmp->mgold;
X		mkgold((long)(tmp + d(dlevel,30)), mtmp->mx, mtmp->my);
X		if(show & cansee(mtmp->mx,mtmp->my))
X			atl(mtmp->mx,mtmp->my, Hallucination ? rndobjsym() : GOLD_SYM);
X	}
X}
END_OF_FILE
if test 6558 -ne `wc -c <'src/steal.c'`; then
    echo shar: \"'src/steal.c'\" unpacked with wrong size!
fi
# end of 'src/steal.c'
fi
echo shar: End of archive 31 \(of 38\).
cp /dev/null ark31isdone
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 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 38 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