billr@saab.CNA.TEK.COM (Bill Randle) (07/12/90)
Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu> Posting-number: Volume 10, Issue 51 Archive-name: nethack3p9/Part06 Supersedes: NetHack3: Volume 7, Issue 56-93 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 6 (of 56)." # Contents: auxil/Guidebook.mn vms/vmsmain.c # Wrapped by billr@saab on Wed Jul 11 17:10:57 1990 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'auxil/Guidebook.mn' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'auxil/Guidebook.mn'\" else echo shar: Extracting \"'auxil/Guidebook.mn'\" \(46943 characters\) sed "s/^X//" >'auxil/Guidebook.mn' <<'END_OF_FILE' X.ds h0 "NetHack Guidebook X.ds h1 X.ds h2 % X.ds vr "NetHack 3.0 X.ds f0 "\*(vr X.ds f1 X.ds f2 "May 28, 1990 X.mt XA Guide to the Mazes of Menace X.au XEric S. Raymond X(Extensively edited and expanded for 3.0 by Mike Threepoint) X.ai XThyrsus Enterprises XMalvern, PA 19355 X.hn 1 XIntroduction X.pg XYou have just finished your years as a student at the local adventurer's Xguild. After much practice and sweat you have finally completed your Xtraining and are ready to embark upon a perilous adventure. To prove Xyour worthiness, the local guildmasters have sent you into the Mazes of XMenace. Your quest is to return with the Amulet of Yendor. According Xto legend, the gods will grant immortality to the one who recovers this Xartifact; true or not, its recovery will bring honor and full guild Xmembership (not to mention the attentions of certain wealthy wizards). X.pg XYour abilities and strengths for dealing with the hazards of adventure Xwill vary with your background and training. X.pg X\fIArcheologists\fP understand dungeons pretty well; this enables them Xto move quickly and sneak up on dungeon nasties. They start equipped Xwith proper tools for a scientific expedition. X.pg X\fIBarbarians\fP are warriors out of the hinterland, hardened to battle. XThey begin their quests with naught but uncommon strength, a trusty hauberk, Xand a great two-handed sword. X.pg X\fICavemen\fP and \fICavewomen\fP start with exceptional strength and Xneolithic weapons. X.pg X\fIElves\fP are agile, quick, and sensitive; very little of what goes Xon will escape an Elf. The quality of Elven craftsmanship often gives Xthem an advantage in arms and armor. X.pg X\fIHealers\fP are wise in medicine and the apothecary. They know the Xherbs and simples that can restore vitality, ease pain, anesthetize, Xand neutralize Xpoisons; and with their instruments, they can divine a being's state Xof health or sickness. Their medical practice earns them quite reasonable Xamounts of money, which they enter the dungeon with. X.pg X\fIKnights\fP are distinguished from the common skirmisher by their Xdevotion to the ideals of chivalry and by the surpassing excellence of Xtheir armor. X.pg X\fIPriests\fP and \fIPriestesses\fP are clerics militant, crusaders Xadvancing the cause of righteousness with arms, armor, and arts Xthaumaturgic. Their ability to commune with deities via prayer Xoccasionally extricates them from peril\(embut can also put them in it. X.pg X\fIRogues\fP are agile and stealthy thieves, who carry daggers, lock Xpicks, and poisons to put on darts. X.pg X\fISamurai\fP are the elite warriors of feudal Nippon. They are lightly Xarmored and quick, and wear the \fIdai-sho\fP, two swords of the deadliest Xkeenness. X.pg X\fITourists\fP start out with lots of gold (suitable for shopping with), Xa credit card, lots of food, some maps, and an expensive camera. Most Xmonsters don't like being photographed. X.pg X\fIValkyries\fP are hardy warrior women. Their upbringing in the harsh XNorthlands makes them strong and inures them to extremes of cold, and instills Xin them stealth and cunning. X.pg X\fIWizards\fP start out with a fair selection of magical goodies and Xa particular affinity for dweomercraft. X.pg XYou set out for the dungeon and after several days of uneventful Xtravel, you see the ancient ruins that mark the entrance to the Mazes Xof Menace. It is late at night, so you make camp at the entrance and Xspend the night sleeping under the open skies. In the morning, you Xgather your gear, eat what may be your last meal outside, and enter Xthe dungeon. X X.hn 1 XWhat is going on here? X.pg XYou have just begun a game of NetHack. Your goal is to grab as much Xtreasure as you can, retrieve the Amulet of Yendor, and escape the XMazes of Menace alive. On the screen is kept a map of where you have Xbeen and what you have seen on the current dungeon level; as you Xexplore more of the level, it appears on the screen in front of you. X.pg XWhen NetHack's ancestor \fIrogue\fP first appeared, its screen Xorientation was almost unique among computer fantasy games. Since Xthen, screen orientation has become the norm rather than the Xexception; NetHack continues this fine tradition. Unlike text Xadventure games that input commands in pseudo-English sentences and Xexplain the results in words, NetHack commands are all one or two Xkeystrokes and the results are displayed graphically on the screen. A Xminimum screen size of 24 lines by 80 columns is recommended; if the Xscreen is larger, only a 21x80 section will be used for the map. X.pg XNetHack generates a new dungeon every time you play it; even the Xauthors still find it an entertaining and exciting game despite Xhaving won several times. X X.hn 1 XWhat do all those things on the screen mean? X.pg XIn order to understand what is going on in NetHack, first you must Xunderstand what NetHack is doing with the screen. The NetHack screen Xreplaces the ``You see...'' descriptions of text adventure games. XFigure 1 is a sample of what a NetHack screen might look like. X X.TS S Xcenter tab(~); Xa. X_ XThe bat bites! X X ------ X |....| ---------- X |.<..|####...@...$.| X |....-# |...B....+ X |....| |.d......| X ------ -------|-- X X X XPlayer the Rambler St:12 Dx:7 Co:18 In:11 Wi:9 Ch:15 Neutral XDlvl:1 G:0 HP:9(12) Pw:3(3) AC:10 Xp:1/19 T:257 Weak X_ X.TE X.ce 1 XFigure 1 X X.hn 2 XThe status lines (bottom) X.pg XThe bottom two lines of the screen contain several cryptic pieces of Xinformation describing your current status. If either status line Xbecomes longer than the width of the screen, you might not see all of Xit. Here are explanations of what the various status items mean X(though your configuration may not have all the status items listed Xbelow): X.lp Rank\ \ XYour character's name and professional ranking (based on the Xexperience level, see below). X.lp Strength XA measure of your character's strength, one of your six basic Xattributes. Your attributes can range from 3 to 18 inclusive X(occasionally you may get super-strengths of the form 18/xx). The Xhigher your strength, the stronger you are. Strength affects how Xsuccessfully you perform physical tasks and how much damage you do in Xcombat. X.lp Dexterity XDexterity affects your chances to hit in combat, to avoid traps, and Xdo other tasks requiring agility or manipulation of objects. X.lp Constitution XConstitution affects your ability to withstand injury and other Xstrains on your stamina. X.lp Intelligence XIntelligence affects your ability to cast spells. X.lp Wisdom XWisdom comes from your religious affairs. It affects your magical energy. X.lp Charisma XCharisma affects how certain creatures react toward you. In Xparticular, it can affect the prices shopkeepers offer you. X.lp Alignment X\fBLawful\fP, \fBNeutral\fP, or \fBChaotic\fP. Basically, Lawful is Xgood and Chaotic is evil. Your alignment influences how other Xmonsters react toward you. X.lp Dungeon Level\ XHow deep you have gone into the dungeon. It starts at one and Xincreases as you go deeper into the dungeon. The Amulet of Yendor is Xreputed to be somewhere beneath the twentieth level. X.lp Gold\ \ XThe number of gold pieces you have. X.lp "Hit Points XYour current and maximum hit points. Hit points indicate how much Xdamage you can take before you die. The more you get hit in a fight, Xthe lower they get. You can regain hit points by resting. The number Xin parentheses is the maximum number your hit points can reach. X.lp Power XSpell points. This tells you how much mystic energy (\fImana\fP) Xyou have available for spell casting. When you type `+' to Xlist your spells, each will have a spell point cost beside Xit in parentheses. You will not see this if your dungeon Xhas been set up without spells. X.lp "Armor Class XA measure of how effectively your armor stops blows from unfriendly Xcreatures. The lower this number is, the more effective the armor; it Xis quite possible to have negative armor class. X.lp Experience XYour current experience level and experience points. As you Xadventure, you gain experience points. At certain experience point Xtotals, you gain an experience level. The more experienced you are, Xthe better you fight and withstand magical attacks. Many dungeons Xshow only your experience level here. X.lp Time\ \ XThe number of turns elapsed so far, displayed if you have the X.op time Xoption set. X.lp "Hunger status XYour current hunger status, ranging from \fBSatiated\fP down to X\fBFainting\fP. If your hunger status is normal, it is not displayed. X.pg XAdditional status flags may appear after the hunger status: \fBConf\fP Xwhen you're confused, \fBSick\fP when sick, \fBBlind\fP when you can't Xsee, \fBStun\fP when stunned, and \fBHallu\fP when hallucinating. X.hn 2 XThe message line (top) X.pg XThe top line of the screen is reserved for messages that describe Xthings that are impossible to represent visually. If you see a X``\fB--More--\fP'' on the top line, this means that NetHack has Xanother message to display on the screen, but it wants to make certain Xthat you've read the one that is there first. To read the next message, Xjust press the space bar. X.hn 2 XThe map (rest of the screen) X.pg XThe rest of the screen is the map of the level as you have explored it Xso far. Each symbol on the screen represents something. You can set Xthe X.op graphics Xoption to change some of the symbols the game uses; otherwise, the Xgame will use default symbols. Here is a list of what the default Xsymbols mean: X.lp "- and | XThe walls of a room, or an open door. X.lp . XThe floor of a room, or a doorless doorway. X.lp # XA corridor, or possibly a kitchen sink or drawbridge (if your dungeon Xhas sinks or drawbridges). X.lp < XA way to the previous level. X.lp > XA way to the next level. X.lp + XA closed door, or a spell book containing a spell you can learn (if your Xdungeon has spell books). X.lp @ XA human (you, usually). X.lp $ XA pile of gold. X.lp ^ XA trap (once you detect it). X.lp ) XA weapon. X.lp [ XA suit or piece of armor. X.lp % XA piece of food (not necessarily healthy). X.lp ? XA scroll. X.lp / XA wand. X.lp = XA ring. X.lp ! XA potion. X.lp ( XA useful item (pick-axe, key, lamp...). X.lp """ XAn amulet, or a spider web. X.lp * XA gem or rock (possibly valuable, possibly worthless). X.lp ` XA boulder or statue. X.lp 0 XAn iron ball. X.lp _ XAn altar (if your dungeon has altars), or an iron chain. X.lp } XA pool of water or moat. X.lp { XA fountain (your dungeon may not have fountains). X.lp "\\\\ XAn opulent throne (your dungeon may not have thrones either). X.lp "a-zA-Z and other symbols XLetters and certain other symbols represent the various inhabitants Xof the Mazes of Menace. Watch out, they can be nasty and vicious. XSometimes, however, they can be helpful. X.pg XYou need not memorize all these symbols; you can ask the game what any Xsymbol represents with the `/' command (see the Commands section for Xmore info). X X.hn 1 XCommands X.pg XCommands are given to NetHack by typing one or two characters; NetHack Xthen asks questions to find out what it needs to know to do your Xbidding. X.pg XFor example, a common question, in the form ``What do you want to Xuse?\ [a-zA-Z\ ?*]'', asks you to choose an object you are carrying. XHere, ``a-zA-Z'' are the inventory letters of your possible choices. XTyping `?' gives you an inventory list of these items, so you can see Xwhat each letter refers to. In this example, there is also a `*' Xindicating that you may choose an object not on the list, if you Xwanted to use something unexpected. Typing a `*' lists your entire Xinventory, so you can see the inventory letters of every object you're Xcarrying. Finally, if you change your mind and decide you don't want Xto do this command after all, you can press the ESC key to abort the Xcommand. X.pg XYou can put a number before most commands to repeat them that many Xtimes; for example, ``10s'' will search ten times. If you have the X.op number_pad Xoption set, you must type `n' to prefix a count, so the example above Xwould be typed ``n10s'' instead. Commands for which counts make no Xsense ignore them. In addition, movement commands can be prefixed for Xgreater control (see below). To cancel a count or a prefix, press the XESC key. X.pg XThe list of commands is rather long, but it can be read at any time Xduring the game through the `?' command, which accesses a menu of Xhelpful texts. Here are the commands for your reference: X.lp ? XHelp menu: display one of several help texts available. X.lp / XTell what a symbol represents. You may choose to specify a location Xor type a symbol (or even a whole word) to define. If the X.op help Xoption is on, and NetHack has some special information about an object or Xmonster that you looked at, you'll be asked if you want ``More info?''. XIf \fBhelp\fP is off, then you'll only get the special information if you Xexplicitly ask for it by typing in the name of the monster or object. X.lp & XTell what a command does. X.lp < XGo up a staircase to the previous level (if you are on the stairs). X.lp > XGo down a staircase to the next level (if you are on the stairs). X.lp [yuhjklbn] XGo one step in the direction indicated (see Figure 2). If there is Xa monster there, you will fight the monster instead. Only these Xone-step movement commands cause you to fight monsters; the others X(below) are ``safe.'' X.sd X.TS S Xcenter; Xc c. Xy k u 7 8 9 X \\\\\\\\ | / \\\\\\\\ | / Xh- . -l 4- . -6 X / | \\\\\\\\ / | \\\\\\\\ Xb j n 1 2 3 X (if \fBnumber_pad\fP is set) X.TE X.ed X.ce 1 XFigure 2 X X.lp [YUHJKLBN] XGo in that direction until you hit a wall or run into something. X.lp m[yuhjklbn] XPrefix: move without picking up any objects. X.lp M[yuhjklbn] XPrefix: move far, no pickup. X.lp "g[yuhjklbn] XPrefix: move until something interesting is found. X.lp G[yuhjklbn] or <CONTROL->[yuhjklbn] XPrefix: same as `g', but forking of corridors is not considered interesting. X.lp . XRest, do nothing for one turn. X.lp a XApply (use) a tool (pick-axe, key, lamp...). X.lp A XRemove all armor. Use `T' (take off) to take off only one piece of armor. X.lp ^A XRedo the previous command. X.lp c XClose a door. X.lp C XCall (name) an individual monster. X.lp ^C XPanic button. Quit the game. X.lp d XDrop something. Ex. ``d7a'' means drop seven items of object \fIa\fP. X.lp D XDrop several things. In answer to the question X``What kinds of things do you want to drop? [!%= au]'' Xyou should type zero or more object symbols possibly followed by X`a' and/or `u'. X.sd X.si XDa - drop all objects, without asking for confirmation. XDu - drop only unpaid objects (when in a shop). XD%u - drop only unpaid food. X.ei X.ed X.lp ^D XKick something (usually a door). X.lp e XEat food. X.lp E XEngrave a message on the floor. XEngraving the word ``Elbereth'' will cause most monsters to not attack Xyou hand-to-hand (but if you attack, you will rub it out); this is Xoften useful to give yourself a breather. (This feature may be compiled out Xof the game, so your version might not necessarily have it.) X.sd X.si XE- - write in the dust with your fingers. X.ei X.ed X.lp i XList your inventory (everything you're carrying). X.lp I XList selected parts of your inventory. X.sd X.si XI* - list all gems in inventory; XIu - list all unpaid items; XIx - list all used up items that are on your shopping bill; XI$ - count your money. X.ei X.ed X.lp o XOpen a door. X.lp O XSet options. You will be asked to enter an option line. If you enter Xa blank line, the current options are reported. Entering `?' will Xget you explanations of the various options. Otherwise, you should Xenter a list of options separated by commas. The available options Xare listed later in this Guidebook. Options are usually set before Xthe game, not with the `O' command; see the section on options below. X.lp p XPay your shopping bill. X.lp P XPut on a ring. X.lp ^P XRepeat previous message (subsequent ^P's repeat earlier messages). X.lp q XQuaff (drink) a potion. X.lp Q XQuit the game. X.lp r XRead a scroll or spell book. X.lp R XRemove a ring. X.lp ^R XRedraw the screen. X.lp s XSearch for secret doors and traps around you. It usually takes several Xtries to find something. X.lp S XSave the game. The game will be restored automatically the next time Xyou play. X.lp t XThrow an object or shoot a projectile. X.lp T XTake off armor. X.lp ^T XTeleport, if you have the ability. X.lp v XDisplay version number. X.lp V XDisplay the game history. X.lp w XWield weapon. w- means wield nothing, use your bare hands. X.lp W XWear armor. X.lp x XList the spells you know (same as `+'). X.lp X XEnter explore (discovery) mode. X.lp z XZap a wand. X.lp Z XZap (cast) a spell. X.lp ^Z XSuspend the game X.ux " versions with job control only)." ( X.lp : XLook at what is here. X.lp , XPick up some things. X.lp @ XToggle the X.op pickup Xoption on and off. X.lp ^ XAsk for the type of a trap you found earlier. X.lp ) XTell what weapon you are wielding. X.lp [ XTell what armor you are wearing. X.lp = XTell what rings you are wearing. X.lp """ XTell what amulet you are wearing. X.lp ( XTell what tools you are using. X.lp $ XCount your gold pieces. X.lp + XList the spells you know (same as `x'). X.lp "\\\\ XShow what types of objects have been discovered. X.lp ! XEscape to a shell. X.lp # XPerform an extended command. As you can see, the authors of NetHack Xused up all the letters, so this is a way to introduce the less useful Xcommands, or commands used under limited circumstances. You may obtain a Xlist of them by entering `?'. What extended commands are available Xdepend on what features the game was compiled with. X.pg XIf your keyboard has a meta key (which, when pressed in combination Xwith another key, modifies it by setting the `meta' [8th, or `high'] Xbit), you can invoke the extended commands by meta-ing the first Xletter of the command. In PC and ST NetHack, the `Alt' key Xcan be used in this fashion. X.lp M-a XAdjust inventory letters (the X.op fixinvlet Xoption must be ``on'' to do this). X.lp M-c XTalk to someone. X.lp M-d XDip an object into something. X.lp M-f XForce a lock. X.lp M-j XJump to another location. X.lp M-l XLoot a box on the floor. X.lp M-m XUse a monster's special ability. X.lp M-N XName an item or type of object. X.lp M-o XOffer a sacrifice to the gods. X.lp M-p XPray to the gods for help. X.lp M-r XRub a lamp. X.lp M-s XSit down. X.lp M-t XTurn undead. X.lp M-u XUntrap something (usually a trapped object). X.lp M-v XPrint compile time options for this version of NetHack. X.lp M-w XWipe off your face. X.pg XIf the X.op number_pad Xoption is on, some additional letter commands are available: X.lp j XJump to another location. Same as ``#jump'' or ``M-j''. X.lp k XKick something (usually a door). Same as `^D'. X.lp l XLoot a box on the floor. Same as ``#loot'' or ``M-l''. X.lp N XName an item or type of object. Same as ``#name'' or ``M-N''. X.lp u XUntrap a trapped object or door. Same as ``#untrap'' or ``M-u''. X X.hn 1 XRooms and corridors X.pg XRooms in the dungeon are either lit or dark. If you walk into a lit Xroom, the entire room will be drawn on the screen. If you walk into a Xdark room, only the areas you can see will be displayed. In darkness, Xyou can only see one space in all directions. Corridors are always Xdark, but remain on the map as you explore them. X.pg XSecret corridors are hidden. You can find them with the `s' (search) Xcommand. X.hn 2 XDoorways X.pg XDoorways connect rooms and corridors. Some doorways have no doors; Xyou can walk right through. Others have doors in them, which may be Xopen, closed, or locked. To open a closed door, use the `o' (open) Xcommand; to close it again, use the `c' (close) command. X.pg XYou can get through a locked door by using a tool to pick the lock Xwith the `a' (apply) command, or by kicking it open with the `^D' X(kick) command. X.pg XOpen doors cannot be entered diagonally; you must approach them Xstraight on, horizontally or vertically. Doorways without doors are Xnot restricted. X.pg XDoors can be useful for shutting out monsters. Most monsters cannot Xopen doors, although a few don't need to (ex. ghosts can walk through Xdoors). X.pg XSecret doors are hidden. You can find them with the `s' (search) Xcommand. X.hn 2 XTraps (`^') X.pg XThere are traps throughout the dungeon to snare the unwary delver. XFor example, you may suddenly fall into a pit and be stuck for a few Xturns. Traps don't appear on your map until you trigger one by moving Xonto it, or you discover it with the `s' (search) command. Monsters Xcan fall prey to traps, too. X X.hn 1 XMonsters X.pg XMonsters you cannot see are not displayed on the screen. Beware! XYou may suddenly come upon one in a dark place. Some magic items can Xhelp you locate them before they locate you, which some monsters do Xvery well. X.hn 2 XFighting X.pg XIf you see a monster and you wish to fight it, just attempt to walk Xinto it. Many monsters you find will mind their own business unless Xyou attack them. Some of them are very dangerous when angered. XRemember: Discretion is the better part of valor. X.hn 2 XYour pet X.pg XYou start the game with a little dog (`d') or cat (`f'), which follows Xyou about the dungeon and fights monsters with you. Like you, your Xpet needs food to survive. It usually feeds itself on fresh carrion Xand other meats. If you're worried about it or want to train it, you Xcan feed it, too, by throwing it food. X.pg XYour pet also gains experience from killing monsters, and can grow Xover time, gaining hit points and doing more damage. Initially, your Xpet may even be better at killing things than you, which makes pets Xuseful for low-level characters. X.pg XYour pet will follow you up and down staircases, if it is next to you Xwhen you move. Otherwise, your pet will be stranded, and may become Xwild. X.hn 2 XGhost levels X.pg XYou may encounter the shades and corpses of other adventurers (or even Xformer incarnations of yourself!) and their personal effects. Ghosts Xare hard to kill, but easy to avoid, since they're slow and do little Xdamage. You can plunder the deceased adventurer's possessions; Xhowever, they are likely to be cursed. Beware of whatever killed the Xformer player. X X.hn 1 XObjects X.pg XWhen you find something in the dungeon, it is common to want to pick Xit up. In NetHack, this is accomplished automatically by walking over Xthe object (unless you turn off the X.op pickup Xoption (see below), or move with the `m' prefix (see above)), or Xmanually by using the `,' command. If you're carrying too many Xthings, NetHack will tell you so and won't pick up anything more. XOtherwise, it will add the object(s) to your pack and tell you what you Xjust picked up. X.pg XWhen you pick up an object, it is assigned an inventory letter. Many Xcommands that operate on objects must ask you to find out which object Xyou want to use. When NetHack asks you to choose a particular object Xyou are carrying, you are usually presented with a list of inventory Xletters to choose from (see Commands, above). X.pg XSome objects, such as weapons, are easily differentiated. Others, like Xscrolls and potions, are given descriptions which vary according to Xtype. During a game, any two objects with the same description are Xthe same type. However, the descriptions will vary from game to game. X.pg XWhen you use one of these objects, if its effect is obvious, NetHack Xwill remember what it is for you. If its effect isn't extremely Xobvious, you will be asked what you want to call this type of object Xso you will recognize it later. You can also use the ``#name'' Xcommand for the same purpose at any time, to name all objects of a Xparticular type or just an individual object. X.hn 2 XCurses and blessings X.pg XAny object that you find may be cursed, even if the object is Xotherwise helpful. The most common effect of a curse is being stuck Xwith (and to) the item. Cursed weapons weld themselves to your hand Xwhen wielded, so you cannot unwield them. Any cursed item you wear Xis not removable by ordinary means. In addition, cursed arms and armor Xusually, but not always, bear negative enchantments that make them Xless effective in combat. Other cursed objects may act poorly or Xdetrimentally in other ways. X.pg XObjects can also become blessed. Blessed items usually work better or Xmore beneficially than normal uncursed items. For example, a blessed Xweapon will do more damage against demons. X.pg XThere are magical means of bestowing or removing curses upon objects, Xso even if you are stuck with one, you can still have the curse Xlifted and the item removed. Priests and Priestesses have an innate Xsensitivity to curses and blessings, so they can more easily avoid Xcursed objects than other character classes. X.pg XAn item with unknown curse status, and an item which you know to be uncursed, Xwill be distinguished in your inventory by the presence of the word ``uncursed'' Xin the description of the latter. The exception is if this description Xisn't needed; you can look at the inventory description and know Xthat you have discovered whether it's cursed. This applies to items which Xhave ``plusses,'' and items with charges. X.hn 2 XWeapons (`)') X.pg XGiven a chance, almost all monsters in the Mazes of Menace will Xgratuitously kill you. You need weapons for self-defense (killing Xthem first). Without a weapon, you do only 1-2 hit points of damage X(plus bonuses, if any). X.pg XThere are wielded weapons, like maces and swords, and thrown weapons, Xlike arrows. To hit monsters with a weapon, you must wield it and Xattack them, or throw it at them. To shoot an arrow out of a bow, you Xmust first wield the bow, then throw the arrow. Crossbows shoot Xcrossbow bolts. Slings hurl rocks and (other) gems. You can wield Xonly one weapon at a time, but you can change weapons unless you're Xwielding a cursed one. X.pg XEnchanted weapons have a ``plus'' (which can also be a minus) Xthat adds to your chance Xto hit and the damage you do to a monster. The only way to find out Xif a weapon is enchanted is to have it magically identified somehow. X.pg XThose of you in the audience who are AD&D players, be aware that each Xweapon which exists in AD&D does the same damage to monsters in XNetHack. Some of the more obscure weapons (such as the \fIaklys\fP, X\fIlucern hammer\fP, and \fIbec-de-corbin\fP) are defined in an Xappendix to \fIUnearthed Arcana\fP, an AD&D supplement. X.pg XThe commands to use weapons are `w' (wield) and `t' (throw). X.hn 2 XArmor (`[') X.pg XLots of unfriendly things lurk about; you need armor to protect Xyourself from their blows. Some types of armor offer better Xprotection than others. Your armor class is a measure of this Xprotection. Armor class (AC) is measured as in AD&D, with 10 being Xthe equivalent of no armor, and lower numbers meaning better armor. XEach suit of armor which exists in AD&D gives the same protection in XNetHack. Here is an (incomplete) list of the armor classes provided by Xvarious suits of armor: X X.TS S Xcenter; Xa n. Xdragon scale mail 1 Xplate mail 3 Xbronze plate mail 4 Xsplint mail 4 Xbanded mail 4 Xelven mithril-coat 5 Xchain mail 5 Xscale mail 6 Xring mail 7 Xstudded leather armor 7 Xleather armor 8 Xno armor 10 X.TE X.pg XYou can also wear other pieces of armor (ex. helmets, boots, shields, cloaks) Xto lower your armor class even further, but you can only wear one item Xof each category (one suit of armor, one cloak, one helmet, one Xshield, and so on). X.pg XIf a piece of armor is enchanted, its armor protection will be better X(or worse) than normal, and its ``plus'' (or minus) will subtract from Xyour armor class. For example, a +1 chain mail would give you Xbetter protection than normal chain mail, lowering your armor class one Xunit further to 4. When you put on a piece of armor, you immediately Xfind out the armor class and any ``plusses'' it provides. Cursed Xpieces of armor usually have negative enchantments (minuses) in Xaddition to being unremovable. X.pg XThe commands to use armor are `W' (wear) and `T' (take off). X.hn 2 XFood (`%') X.pg XFood is necessary to survive. If you go too long without eating you Xwill faint, and eventually die of starvation. Unprotected food does Xnot stay fresh indefinitely; after a while it will spoil, and be Xunhealthy to eat. Food stored in ice boxes or tins (``cans'' to you XAmericans) will usually stay fresh, but ice boxes are heavy, and tins Xtake a while to open. X.pg XWhen you kill monsters, they usually leave corpses which are also X``food.'' Many, but not all, of these are edible; some also give you Xspecial powers when you eat them. A good rule of thumb is ``you are Xwhat you eat.'' X.pg XYou can name one food item after something you like to eat with the X.op fruit Xoption, if your dungeon has it. X.pg XThe command to eat food is `e'. X.hn 2 XScrolls (`?') X.pg XScrolls are labeled with various titles, probably chosen by ancient wizards Xfor their amusement value (ex. ``READ ME,'' or ``HOLY BIBLE'' backwards). XScrolls disappear after you read them (except for blank ones, without Xmagic spells on them). X.pg XOne of the most useful of these is the \fIscroll of identify\fP, which Xcan be used to determine what another object is, whether it is cursed or Xblessed, and how many uses it has left. Some objects of subtle Xenchantment are difficult to identify without these. X.pg XIf you receive mail while you are playing (on Xversions compiled with this feature), a mail daemon may run up and Xdeliver it to you as a \fIscroll of mail\fP. To use this feature, Xyou must let NetHack know where to look for new mail by setting the X``MAIL'' environment variable to the file name of your mailbox. You Xmay also want to set the ``MAILREADER'' environment variable to the Xfile name of your favorite reader, so NetHack can shell to it when you Xread the scroll. X.pg XThe command to read a scroll is `r'. X.hn 2 XPotions (`!') X.pg XPotions are distinguished by the color of the liquid inside the flask. XThey disappear after you quaff them. X.pg XClear potions are potions of water. Sometimes these are Xblessed or cursed, resulting in holy or unholy water. Holy water is Xthe bane of the undead, so potions of holy water are good thing to Xthrow (`t') at them. It also is very useful when you dip (``#dip'') other Xobjects in it. X.pg XThe command to drink a potion is `q' (quaff). X.hn 2 XWands (`/') X.pg XMagic wands have multiple magical charges. Some wands are Xdirectional\(emyou must give a direction to zap them in. You can also Xzap them at yourself (just give a `.' or `s' for the direction), but Xit is often unwise. Other wands are nondirectional\(emthey don't ask Xfor directions. The number of charges in a wand is random, and Xdecreases by one whenever you use it. X.pg XThe command to use a wand is `z' (zap). X.hn 2 XRings (`=') X.pg XRings are very useful items, since they are relatively permanent Xmagic, unlike the usually fleeting effects of potions, scrolls, and Xwands. X.pg XPutting on a ring activates its magic. You can wear only two Xrings, one on each ring finger. X.pg XMost rings also cause you to grow hungry more rapidly, the rate Xvarying with the type of ring. X.pg XThe commands to use rings are `P' (put on) and `R' (remove). X.hn 2 XSpell books (`+') X.pg XSpell books are tomes of mighty magic. When studied with the `r' (read) Xcommand, they bestow the knowledge of a spell\(emunless the attempt Xbackfires. XReading a cursed spell book, or one with mystic runes beyond Xyour ken can be harmful to your health! X.pg XA spell can also backfire when you cast it. If you attempt to cast a Xspell well above your experience level, or cast it at a time when your Xluck is particularly bad, you can end up wasting both the energy and Xthe time required in casting. X.pg XCasting a spell calls forth magical energies and focuses them with Xyour naked mind. Releasing the magical energy releases some of your Xmemory of the spell with it. Each time you cast a spell, your Xfamiliarity with it will dwindle, until you eventually forget the Xdetails completely and must relearn it. X.pg XThe command to read a spell book is the same as for scrolls, `r' X(read). The `+' command lists your current spells and the number of Xspell points they require. The `Z' (cast) command casts a spell. X.hn 2 XTools (`(') X.pg XTools are miscellaneous objects with various purposes. Some tools, Xlike wands, have a limited number of uses. For example, lamps burn Xout after a while. Other tools are containers, which objects can Xbe placed into or taken out of. X.pg XThe command to use tools is `a' (apply). X.hn 3 XChests and boxes X.pg XYou may encounter chests or boxes in your travels. These can be Xopened with the ``#loot'' extended command when they are on the floor, Xor with the `a' (apply) command when you are carrying one. However, Xchests are often locked, and require you to either use a key to unlock Xit, a tool to pick the lock, or to break it open with brute force. XChests are unwieldy objects, and must be set down to be unlocked (by Xkicking them, using a key or lock picking tool with the `a' (apply) Xcommand, or by using a weapon to force the lock with the ``#force'' Xextended command). X.pg XSome chests are trapped, causing nasty things to happen when you Xunlock or open them. You can check for and try to deactivate traps Xwith the ``#untrap'' extended command. X.hn 2 XAmulets (`"') X.pg XAmulets are very similar to rings, and often more powerful. Like Xrings, amulets have various magical properties, some beneficial, Xsome harmful, which are activated by putting them on. X.pg XThe commands to use amulets are the same as for rings, `P' (put on) Xand `R' (remove). X.hn 2 XGems (`*') X.pg XSome gems are valuable, and can be sold for a lot of gold pieces. XValuable gems increase your score if you bring them with you when you Xexit. Other small rocks are also categorized as gems, but they are Xmuch less valuable. X.hn 2 XLarge rocks (`\`') X.pg XStatues and boulders are not particularly useful, and are generally Xheavy. It is rumored that some statues are not what they seem. X.hn 2 XGold (`$') X.pg XGold adds to your score, and you can buy things in shops with it. XYour version of NetHack may display how much gold you have on the Xstatus line. If not, the `$' command will count it. X X.hn 1 XOptions X.pg XDue to variations in personal tastes and conceptions of how NetHack Xshould do things, there are options you can set to change how NetHack Xbehaves. X.hn 2 XSetting the options X.pg XThere are two ways to set the options. The first is with the `O' Xcommand in NetHack; the second is with the ``NETHACKOPTIONS'' Xenvironment variable. X.hn 2 XUsing the NETHACKOPTIONS environment variable X.pg XThe NETHACKOPTIONS variable is a comma-separated list of initial Xvalues for the various options. Some can only be turned on or off. XYou turn one of these on by adding the name of the option to the list, Xand turn it off by typing a `!' or ``no'' before the name. Others take a Xcharacter string as a value. You can set string options by typing Xthe option name, a colon, and then the value of the string. The value Xis terminated by the next comma or the end of string. X.pg XFor example, to set up an environment variable so that ``female'' is on, X``pickup'' is off, the name is set to ``Blue Meanie'', and the fruit Xis set to ``papaya'', you would enter the command X.sd X% \fBsetenv NETHACKOPTIONS "female,!pickup,name:Blue Meanie,fruit:papaya"\fP X.ed Xin \fIcsh\fP, or X.sd X$ \fBNETHACKOPTIONS="female,!pickup,name:Blue Meanie,fruit:papaya"\fP X$ \fBexport NETHACKOPTIONS\fP X.ed Xin \fIsh\fP or \fIksh\fP. X.hn 2 XCustomization options X.pg XHere are explanations of the various options do. Character strings Xlonger than fifty characters are truncated. Some of the options Xlisted may be inactive in your dungeon. X.lp catname XName your starting cat (ex. ``catname:Morris''). XCannot be set with the `O' command. X.lp color\ \ \ XUse color for different monsters, objects, and dungeon features (default on). X.lp confirm\ XHave user confirm attacks on pets, shopkeepers, and other Xpeaceable creatures (default on). X.lp DECgraphics XUse a predefined selection of characters from the DEC VT-xxx/DEC Rainbow/ XANSI line-drawing character set to display the dungeon instead of having Xto define a full graphics set yourself (default off). XCannot be set with the `O' command. X.lp dogname XName your starting dog (ex. ``dogname:Fang''). XCannot be set with the `O' command. X.lp endgame XControl what parts of the score list you are shown at the end (ex. X``endgame:5 top scores/4 around my score/own scores''). Only the first Xletter of each category (`t', `a', or `o') is necessary. X.lp female XSet your sex (default off). XCannot be set with the `O' command. X.lp fixinvlet XAn object's inventory letter sticks to it when it's dropped (default on). XIf this is off, dropping an object shifts all the remaining inventory letters. X.lp fruit\ \ \ XName a fruit after something you enjoy eating (ex. ``fruit:mango'') X(default ``slime mold''. Basically a nostalgic whimsy that NetHack uses Xfrom time to time. You should set this to something you find more Xappetizing than slime mold. Apples, oranges, pears, bananas, and melons Xalready exist in NetHack, so don't use those. X.lp graphics XSet the graphics symbols for screen displays X(default `` |--------|||-\\\\/.-|+.#<>^"}{#\\\\_<>##''). The X.op graphics Xoption (if used) should come last, followed by a string of up to 35 Xcharacters to be used instead of the default map-drawing characters. XThe dungeon map will use the characters you specify instead of the Xdefault symbols. X XThe X.op DECgraphics Xand X.op IBMgraphics Xoptions use predefined selections of graphics symbols, so you need not Xgo to the trouble of setting up a full graphics string for these common Xcases. These two options also set up proper handling of graphics Xcharacters for such terminals, so you should specify them as appropriate Xeven if you override the selections with your own graphics string. X XNote that this option string is now escape-processed in conventional C Xfashion. This means that `\\' is a prefix to take the following Xcharacter literally, and not as a special prefix. Your graphics Xstrings for NetHack 2.2 and older versions may contain a `\\'; it must Xbe doubled for the same effect now. The special escape form `\\m' Xswitches on the meta bit in the following character, and the `^' Xprefix causes the following character to be treated as a control Xcharacter (so any `^' in your old graphics strings should be changed Xto `\\^' now). X XThe order of the symbols is: solid rock, vertical wall, horizontal Xwall, upper left corner, upper right corner, lower left corner, lower Xright corner, cross wall, upward T wall, downward T wall, leftward T Xwall, rightward T wall, vertical beam, horizontal beam, left slant, Xright slant, no door, vertical open door, horizontal open door, closed Xdoor, floor of a room, corridor, stairs up, stairs down, trap, web, Xpool or moat, fountain, kitchen sink, throne, altar, ladder up, ladder Xdown, vertical drawbridge, horizontal drawbridge. XYou might want to use `+' for the corners and T walls for a more Xesthetic, boxier display. Note that in the next release, new symbols Xmay be added, or the present ones rearranged. X XCannot be set with the `O' command. X.lp help XIf more information is available for an object looked at Xwith the `/' command, ask if you want to see it (default on). Turning help Xoff makes just looking at things faster, since you aren't interrupted with the X``More info?'' prompt, but it also means that you might miss some Xinteresting and/or important information. X.lp IBM_BIOS\ \ \ \ XUse BIOS calls to update the screen Xdisplay quickly and to read the keyboard (allowing the use of arrow Xkeys to move) on machines with an IBM PC compatible BIOS ROM (default off, XPC and ST NetHack only). X.lp IBMgraphics XUse a predefined selection of IBM extended ASCII characters to display the Xdungeon instead of having to define a full graphics set yourself (default off). XCannot be set with the `O' command. X.lp ignintr XIgnore interrupt signals, including breaks (default off). X.lp male\ \ \ \ XSet your sex (default on, most hackers are male). XCannot be set with the `O' command. X.lp name\ \ \ \ XSet your character's name (defaults to your user name). You can also Xset your character class by appending a dash and the first letter of Xthe character class (that is, by suffixing one of X.op "-A -B -C -E -H -K -P -R -S -T -V -W" ). XCannot be set with the `O' command. X.lp news\ \ \ \ XRead the NetHack news file, if present (default on). XSince the news is shown at the beginning of the game, there's no point Xin setting this with the `O' command. X.lp number_pad XUse the number keys to move instead of [yuhjklbn] (default off). X.lp null\ \ \ \ XSend padding nulls to the terminal (default off). X.lp packorder XSpecify the order to list object types in (default ``\\")[%?+/=!(*'0_''). XThe value of this option should be a string containing the Xsymbols for the various object types. X.lp pickup\ \ XPick up things you move onto by default (default on). X.lp rawio\ \ \ XForce raw (non-cbreak) mode for faster output and more Xbulletproof input (MS-DOS sometimes treats `^P' as a printer toggle Xwithout it) (default off). Note: DEC Rainbows hang if this is turned on. XCannot be set with the `O' command. X.lp rest_on_space XMake the space bar a synonym for the `.' (rest) command (default off). X.lp safe_pet XPrevent you from (knowingly) attacking your pets (default on). X.lp silent\ \ XSuppress terminal beeps (default on). X.lp sortpack XSort the pack contents by type when displaying inventory (default on). X.lp standout XBoldface monsters and ``\fB--More--\fP'' (default off). X.lp time\ \ \ \ XShow the elapsed game time in turns on bottom line (default off). X.lp tombstone XDraw a tombstone graphic upon your death (default on). X.lp verbose XProvide more commentary during the game (default on). X.pg XIn some versions, options may be set in a configuration file Xon disk as well as from NETHACKOPTIONS. X X.hn 1 XScoring X.pg XNetHack maintains a list of the top scores or scorers on your machine, Xdepending on how it is set up. In the latter case, each account on Xthe machine can post only one non-winning score on this list. If Xyou score higher than someone else on this list, or better your Xprevious score, you will be inserted in the proper place under your Xcurrent name. How many scores are kept can also be set up when XNetHack is compiled. X.pg XYour score is chiefly based upon how much experience you gained, how Xmuch loot you accumulated, how deep you explored, and how the game Xended. If you quit the game, you escape with all of your gold intact. XIf, however, you get killed in the Mazes of Menace, the guild will Xonly hear about 90% of your gold when your corpse is discovered X(adventurers have been known to collect finder's fees). So, consider Xwhether you want to take one last hit at that monster and possibly Xlive, or quit and stop with whatever you have. If you quit, you keep Xall your gold, but if you swing and live, you might find more. X.pg XIf you just want to see what the current top players/games list is, you Xcan type \fBnethack -s all\fP. X X.hn 1 XExplore mode X.pg XNetHack is an intricate and difficult game. Novices might falter Xin fear, aware of their ignorance of the means to survive. Well, fear Xnot. Your dungeon may come equipped with an ``explore'' or ``discovery'' Xmode that enables you to keep old save files and cheat death, at the Xpaltry cost of not getting on the high score list. X.pg XThere are two ways of enabling explore mode. One is to start the game Xwith the X.op -X Xswitch. The other is to issue the `X' command while already playing Xthe game. The other benefits of explore mode are left for the trepid Xreader to discover. X X.hn XCredits X.pg XThe original \fIhack\fP game was modeled on the Berkeley X.ux X\fIrogue\fP game. Large portions of this paper were shamelessly Xcribbed from \fIA Guide to the Dungeons of Doom\fP, by Michael C. Toy Xand Kenneth C. R. C. Arnold. Small portions were adapted from X\fIFurther Exploration of the Dungeons of Doom\fP, by Ken Arromdee. X.pg XNetHack is the product of literally dozens of people's work. XMain events in the course of the game development are described below: X X.pg X\fBJay Fenlason\fP wrote the original Hack, with help from X\fBKenny Woodland\fP, \fBMike Thome\fP and \fBJon Payne\fP. X.pg X\fBAndries Brouwer\fP did a major re-write, transforming Hack into a Xvery different game, and published (at least) three versions (1.0.1, X1.0.2, and 1.0.3) for X.ux Xmachines to the Usenet. X.pg X\fBDon G. Kneller\fP ported Hack 1.0.3 to Microsoft C and MS-DOS, producing PC XHACK 1.01e, added support for DEC Rainbow graphics in version 1.03g, and went Xon to produce at least four more versions (3.0, 3.2, 3.51, and 3.6). X.pg X\fBR. Black\fP ported PC HACK 3.51 to Lattice C and the Atari 520/1040ST, Xproducing ST Hack 1.03. X.pg X\fBMike Stephenson\fP merged these various versions back together, Xincorporating many of the added features, and produced NetHack 1.4. XHe then coordinated a cast of thousands in enhancing and debugging XNetHack 1.4 and released NetHack versions 2.2 and 2.3. X2.3. X.pg XLater, Mike coordinated a major rewrite of the game, heading a Xteam which included \fBKen Arromdee\fP, \fBJean-Christophe Collet\fP, \fBSteve XCreps\fP, \fBEric Hendrickson\fP, \fBIzchak Miller\fP, \fBJohn Rupley\fP, X\fBMike Threepoint\fP, and \fBJanet Walz\fP, to produce NetHack 3.0c. X.pg XNetHack 3.0 was ported to the Atari by \fBEric R. Smith\fP, to OS/2 by X\fBTimo Hakulinen\fP, and to VMS by \fBDavid Gentzel\fP. The three of them Xand \fBKevin Darcy\fP later joined the main development team to produce Xsubsequent revisions of 3.0. X.pg X\fBOlaf Seibert\fP ported NetHack 2.3 and 3.0 to the Amiga. X\fBNorm Meluch\fP, \fBStephen Spackman\fP and \fBPierre Martineau\fP designed Xoverlay code for PC NetHack 3.0. \fBJohnny Lee\fP ported XNetHack 3.0 to the Macintosh. Along with various other Dungeoneers, they Xcontinued to enhance the PC, Macintosh, and Amiga ports through the later Xrevisions of 3.0. X X.pg XFrom time to time, some depraved individual out there in netland sends a Xparticularly intriguing modification to help out with the game. The Gods of Xthe Dungeon sometimes make note of the names of the worst of these miscreants Xin this, the list of Dungeoneers: X X.sd X.TS S Xcenter; Xc c c. XRichard Addison Bruce Holloway Pat Rankin XTom Almy Richard P. Hughey Eric S. Raymond XKen Arromdee Ari Huttunen John Rupley XEric Backus Del Lamb Olaf Seibert XJohn S. Bien Greg Laskin Kevin Sitze XRalf Brown Johnny Lee Eric R. Smith XJean-Christophe Collet Steve Linhart Kevin Smolkowski XSteve Creps Ken Lorber Michael Sokolov XKevin Darcy Benson I. Margulies Stephen Spackman XMatthew Day Pierre Martineau Andy Swanson XJoshua Delahunty Roland McGrath Kevin Sweet XJochen Erwied Norm Meluch Scott R. Turner XDavid Gentzel Bruce Mewborne Janet Walz XMark Gooderum Izchak Miller Jon Watte XDavid Hairston Gil Neiger Tom West XTimo Hakulinen Greg Olson Gregg Wonderly XEric Hendrickson Mike Passaretti X.TE X.ed X X.\"Microsoft and MS-DOS are registered trademarks of Microsoft Corporation. X.\"Lattice is a trademark of Lattice, Inc. X.\"Atari and 1040ST are trademarks of Atari, Inc. X.\"AMIGA is a trademark of Commodore-Amiga, Inc. X.sm "Brand and product names are trademarks or registered trademarks \ Xof their respective holders." END_OF_FILE if test 46943 -ne `wc -c <'auxil/Guidebook.mn'`; then echo shar: \"'auxil/Guidebook.mn'\" unpacked with wrong size! fi # end of 'auxil/Guidebook.mn' fi if test -f 'vms/vmsmain.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'vms/vmsmain.c'\" else echo shar: Extracting \"'vms/vmsmain.c'\" \(10064 characters\) sed "s/^X//" >'vms/vmsmain.c' <<'END_OF_FILE' X/* SCCS Id: @(#)vmsmain.c 3.0 89/01/13 X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ X/* NetHack may be freely redistributed. See license for details. */ X/* main.c - VMS NetHack */ X X#include "hack.h" X X#include <signal.h> X Xchar SAVEF[PL_NSIZ + 20]; /* [.save]<uic>player;1 */ X Xconst char *hname = 0; /* name of the game (argv[0] of call) */ Xchar obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */ Xint hackpid = 0; /* current pid */ Xint locknum = 0; /* max num of players */ X Xstatic void NDECL(whoami); Xstatic void NDECL(byebye); X#ifndef SAVE_ON_FATAL_ERROR Xstatic long FDECL(vms_handler,(long [],long [])); X#include <ssdef.h> /* system service status codes */ X#endif X Xint Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X extern int x_maze_max, y_maze_max; X register int fd; X#ifdef CHDIR X register char *dir; X#endif X X atexit(byebye); X hname = argv[0]; X hackpid = getpid(); X (void) umask(0); X X /* X * Remember tty modes, to be restored on exit. X * X * gettty() must be called before startup() X * due to ordering of LI/CO settings X * startup() must be called before initoptions() X * due to ordering of graphics settings X */ X gettty(); X setbuf(stdout,obuf); X startup(); X initoptions(); X whoami(); X X#ifdef CHDIR /* otherwise no chdir() */ X /* X * See if we must change directory to the playground. X * (Perhaps hack is installed with privs and playground is X * inaccessible for the player.) X * The logical name HACKDIR is overridden by a X * -d command line option (must be the first option given) X */ X dir = getenv("HACKDIR"); X#endif X if(argc > 1) { X#ifdef CHDIR X if (!strncmp(argv[1], "-d", 2) && argv[1][2] != 'e') { X /* avoid matching "-dec" for DECgraphics; since the man page X * says -d directory, hope nobody's using -desomething_else X */ X argc--; X argv++; X dir = argv[0]+2; X if(*dir == '=' || *dir == ':') dir++; X if(!*dir && argc > 1) { X argc--; X argv++; X dir = argv[0]; X } X if(!*dir) X error("Flag -d must be followed by a directory name."); X } else X#endif /* CHDIR /**/ X X /* X * Now we know the directory containing 'record' and X * may do a prscore(). X */ X if (!strncmp(argv[1], "-s", 2)) { X#ifdef CHDIR X chdirx(dir,0); X#endif X prscore(argc, argv); X if(isatty(1) > 0) getret(); X settty(NULL); X exit(0); X } X } X X /* X * It seems you really want to play. X */ X setrandom(); X cls(); X u.uhp = 1; /* prevent RIP on early quits */ X u.ux = FAR; /* prevent nscr() */ X#ifndef SAVE_ON_FATAL_ERROR X /* used to clear hangup stuff while still giving standard traceback */ X VAXC$ESTABLISH(vms_handler); X#endif X (void) signal(SIGHUP, (SIG_RET_TYPE) hangup); X X /* X * Find the creation date of this game, X * so as to avoid restoring outdated savefiles. X */ X gethdate(hname); X X /* X * We cannot do chdir earlier, otherwise gethdate will fail. X */ X#ifdef CHDIR X chdirx(dir,1); X#endif X X /* X * Process options. X */ X while(argc > 1 && argv[1][0] == '-'){ X argv++; X argc--; X switch(argv[0][1]){ X#if defined(WIZARD) || defined(EXPLORE_MODE) X# ifndef EXPLORE_MODE X case 'X': X case 'x': X# endif X case 'D': X# ifdef WIZARD X if(!strcmp(getenv("USER"), WIZARD_NAME)) { X wizard = TRUE; X break; X } X /* otherwise fall thru to discover */ X# endif X# ifdef EXPLORE_MODE X case 'X': X case 'x': X discover = TRUE; X# endif X break; X#endif X#ifdef NEWS X case 'n': X flags.nonews = TRUE; X break; X#endif X case 'u': X if(argv[0][2]) X (void) strncpy(plname, argv[0]+2, sizeof(plname)-1); X else if(argc > 1) { X argc--; X argv++; X (void) strncpy(plname, argv[0], sizeof(plname)-1); X } else X Printf("Player name expected after -u\n"); X break; X case 'i': X if(!strcmp(argv[0]+1, "ibm")) assign_ibm_graphics(); X break; X case 'd': X if(!strcmp(argv[0]+1, "dec")) assign_dec_graphics(); X break; X default: X /* allow -T for Tourist, etc. */ X (void) strncpy(pl_character, argv[0]+1, X sizeof(pl_character)-1); X X /* Printf("Unknown option: %s\n", *argv); */ X } X } X X if(argc > 1) X locknum = atoi(argv[1]); X#ifdef MAX_NR_OF_PLAYERS X if(!locknum || locknum > MAX_NR_OF_PLAYERS) X locknum = MAX_NR_OF_PLAYERS; X#endif X#ifdef WIZARD X if (wizard) X Strcpy(plname, "wizard"); X else X#endif X if(!*plname || !strncmp(plname, "games", 4)) X askname(); X plnamesuffix(); /* strip suffix from name; calls askname() */ X /* again if suffix was whole name */ X /* accepts any suffix */ X#ifdef WIZARD X if(!wizard) { X#endif X /* X * check for multiple games under the same name X * (if !locknum) or check max nr of players (otherwise) X */ X (void) signal(SIGQUIT,SIG_IGN); X (void) signal(SIGINT,SIG_IGN); X if(!locknum) X Sprintf(lock, "%d%s", getuid(), plname); X getlock(); /* sets lock if locknum != 0 */ X#ifdef WIZARD X } else X Sprintf(lock, "%d%s", getuid(), plname); X#endif /* WIZARD /**/ X setftty(); X X /* X * Initialisation of the boundaries of the mazes X * Both boundaries have to be even. X */ X X x_maze_max = COLNO-1; X if (x_maze_max % 2) X x_maze_max--; X y_maze_max = ROWNO-1; X if (y_maze_max % 2) X y_maze_max--; X X /* initialize static monster strength array */ X init_monstr(); X X Sprintf(SAVEF, "[.save]%d%s", getuid(), plname); X regularize(SAVEF+7); /* avoid bogus chars in name */ X if((fd = open(SAVEF,O_RDONLY)) >= 0 && X /* if not up-to-date, quietly unlink file via false condition */ X (uptodate(fd) || unlink(SAVEF) >= 0)) { X#ifdef WIZARD X /* Since wizard is actually flags.debug, restoring might X * overwrite it. X */ X boolean remember_wiz_mode = wizard; X#endif X (void) chmod(SAVEF,0); /* disallow parallel restores */ X (void) signal(SIGINT, (SIG_RET_TYPE) done1); X pline("Restoring save file..."); X (void) fflush(stdout); X if(!dorecover(fd)) X goto not_recovered; X#ifdef WIZARD X if(!wizard && remember_wiz_mode) wizard = TRUE; X#endif X pline("Hello %s, welcome to NetHack!", plname); X /* get shopkeeper set properly if restore is in shop */ X (void) inshop(); X#ifdef EXPLORE_MODE X if (discover) X You("are in non-scoring discovery mode."); X#endif X#if defined(EXPLORE_MODE) || defined(WIZARD) X if (discover || wizard) { X pline("Do you want to keep the save file? "); X if(yn() == 'n') X (void) unlink(SAVEF); X else X (void) chmod(SAVEF,FCMASK); /* back to readable */ X } X#endif X flags.move = 0; X } else { Xnot_recovered: X newgame(); X /* give welcome message before pickup messages */ X pline("Hello %s, welcome to NetHack!", plname); X#ifdef EXPLORE_MODE X if (discover) X You("are in non-scoring discovery mode."); X#endif X flags.move = 0; X set_wear(); X pickup(1); X read_engr_at(u.ux,u.uy); X } X X flags.moonphase = phase_of_the_moon(); X if(flags.moonphase == FULL_MOON) { X You("are lucky! Full moon tonight."); X if(!u.uluck) change_luck(1); X } else if(flags.moonphase == NEW_MOON) { X pline("Be careful! New moon tonight."); X } X X initrack(); X X moveloop(); X return(0); X} X Xvoid Xglo(foo) Xregister int foo; X{ X /* construct the string xlock.n */ X register char *tf; X X tf = lock; X while(*tf && *tf != '.') tf++; X Sprintf(tf, ".%d;1", foo); X} X X/* X * plname is filled either by an option (-u Player or -uPlayer) or X * explicitly (by being the wizard) or by askname. X * It may still contain a suffix denoting pl_character. X */ Xvoid Xaskname() { X register int c, ct; X X Printf("\nWho are you? "); X (void) fflush(stdout); X ct = 0; X while((c = getchar()) != '\n') { X if(c == EOF) error("End of input\n"); X if(c != '-') X if(c < 'A' || (c > 'Z' && c < 'a') || c > 'z') c = '_'; X if(ct < sizeof(plname)-1) X plname[ct++] = c; X } X plname[ct] = 0; X if(ct == 0) askname(); X} X X#ifdef CHDIR Xvoid Xchdirx(dir, wr) Xchar *dir; Xboolean wr; X{ X# ifndef HACKDIR X static char *defdir = "."; X# else X static char *defdir = HACKDIR; X X if(dir == NULL) X dir = defdir; X else if (wr) X /* If we're playing anywhere other than HACKDIR, turn off any X privs we may have been installed with. */ X privoff(); X# endif X X if(dir && chdir(dir) < 0) { X perror(dir); X error("Cannot chdir to %s.", dir); X } X X /* warn the player if we can't write the record file */ X /* perhaps we should also test whether . is writable */ X /* unfortunately the access systemcall is worthless */ X if(wr) { X register int fd; X X if(dir == NULL) X dir = ""; X if((fd = open(RECORD, O_RDWR)) < 0) { X if((fd = open(RECORD, O_CREAT|O_RDWR, FCMASK)) < 0) { X Printf("Warning: cannot write %s/%s", dir, RECORD); X getret(); X } else X (void) close(fd); X } else X (void) close(fd); X } X defdir = dir; X} X#endif /* CHDIR /**/ X Xstatic void Xwhoami() { X /* X * Who am i? Algorithm: 1. Use name as specified in NETHACKOPTIONS X * 2. Use $USER (if 1. fails) X * The resulting name is overridden by command line options. X * If everything fails, or if the resulting name is some generic X * account like "games" then eventually we'll ask him. X * Note that we trust the user here; it is possible to play under X * somebody else's name. X */ X register char *s; X X if(!*plname && (s = getenv("USER"))) X (void) strncpy(plname, s, sizeof(plname)-1); X} X Xstatic void Xbyebye() X{ X int (*hup)(); X#ifdef SHELL X extern unsigned int dosh_pid; X X if (dosh_pid) X SYS$DELPRC(&dosh_pid, 0); X#endif SHELL X X /* SIGHUP doesn't seem to do anything on VMS, so we fudge it here... */ X hup = signal(SIGHUP, SIG_IGN); X if (hup != SIG_DFL && hup != SIG_IGN) X (*hup)(); X X#ifdef CHDIR X (void) chdir(getenv("PATH")); X#endif X} X X#ifndef SAVE_ON_FATAL_ERROR X/* Condition handler to prevent byebye's hangup simulation X from saving the game after a fatal error has occurred. */ Xstatic long Xvms_handler(sigargs, mechargs) Xlong sigargs[], mechargs[]; /* [0] is argc, [1..argc] are the real args */ X{ X extern boolean hu; /* src/save.c */ X long condition = sigargs[1]; X X if (condition == SS$_ACCVIO /* access violation */ X || condition >= SS$_ASTFLT && condition <= SS$_TBIT X || condition >= SS$_ARTRES && condition <= SS$_INHCHME) { X if (wizard) X abort(); /* enter the debugger */ X else X hu = TRUE; /* pretend that hangup has already been attempted */ X } X return SS$_RESIGNAL; X} X#endif END_OF_FILE if test 10064 -ne `wc -c <'vms/vmsmain.c'`; then echo shar: \"'vms/vmsmain.c'\" unpacked with wrong size! fi # end of 'vms/vmsmain.c' fi echo shar: End of archive 6 \(of 56\). cp /dev/null ark6isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 56 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0