home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zephyr.ens.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v14i056: umoria4 - single player dungeon simulation (ver. 5.5), Part24/39
- Message-ID: <3420@master.CNA.TEK.COM>
- Date: 22 Aug 92 22:13:00 GMT
- Sender: news@master.CNA.TEK.COM
- Lines: 2008
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted-by: grabiner@math.harvard.edu (David Grabiner)
- Posting-number: Volume 14, Issue 56
- Archive-name: umoria4/Part24
- Supersedes: umoria3: Volume 9, Issue 55-97; Volume 10, Issue 15-17
- Environment: Curses, Unix, Mac, MS-DOS, Atari-ST, Amiga, VMS
-
-
-
- #! /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 24 (of 39)."
- # Contents: doc/moria1.ms.1 source/misc3.c.1
- # Wrapped by billr@saab on Thu Aug 20 09:11:32 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'doc/moria1.ms.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/moria1.ms.1'\"
- else
- echo shar: Extracting \"'doc/moria1.ms.1'\" \(25261 characters\)
- sed "s/^X//" >'doc/moria1.ms.1' <<'END_OF_FILE'
- X\"This is a very modified version of the documentation
- X\"for the original VMS game. Changes were made to reflect differences
- X\"found in the UNIX port by James E. Wilson.
- X\"
- X\" "tbl moria1.ms moria2.ms | nroff -ms"
- X\"
- X\" You might wanna change these two values:
- X.RP
- X.nr PO 1i
- X.nr LL 6.5i
- X.ds LH "The Dungeons of Moria
- X.ds CH "
- X.ds RH "Page %
- X.ds LF "
- X.ds CF "
- X.ds RF "
- X.TL
- XThe Dungeons of Moria
- X.AU
- XRobert Alan Koeneke
- XJames E. Wilson
- X.AB no
- XMoria may be copied and modified freely, but may not be sold or
- Xmarketed IN ANY FORM without the permission and written consent
- Xof the authors Robert Alan Koeneke and James E. Wilson.
- XWe retain all copyrights to
- Xthis program, in either the original or modified forms, and no
- Xviolation, deletion, or change of the copyright notice is
- Xallowed. Furthermore, we will have no liability or responsibility
- Xto any user with respect to loss or damage caused directly or
- Xindirectly by this program.
- X.AE
- X
- X.NH 1
- XIntroduction
- X.LP
- XThe game of \fImoria\fP is a single player dungeon simulation.
- XA player may choose from a number of races and classes when
- Xcreating a character, and then `run' that character over a
- Xperiod of days, weeks, even months, attempting to win the game by
- Xdefeating the Balrog which lurks in the deeper levels.
- X.LP
- XThe player will begin his adventure on the town level where
- Xhe may acquire supplies, weapons, armor, and magical devices by
- Xbartering with various shop owners.
- XAfter preparing for his adventure, the player can descend into the
- Xdungeons of \fImoria\fP where fantastic adventures await his coming!
- X.LP
- XBefore beginning your first adventure, you should read this
- Xdocument carefully.
- XThe game of \fImoria\fP is a complicated game, and
- Xwill require a dedicated player to win.
- X
- X.NH 1
- XThe Character
- X.LP
- XAll characters have six main attributes which modify their basic abilities.
- XThese six attributes, called \fIstats\fP, are
- X\fIstrength\fP, \fIintelligence\fP, \fIwisdom\fP, \fIdexterity\fP,
- X\fIconstitution\fP, and \fIcharisma\fP.
- XStats may vary from a minimum of 3 to a maximum of 18. At the highest level,
- Xstats are further qualified by a number from zero to one hundred, so that
- Xthe highest value is actually 18/100. A value of 18/100 can be thought
- Xof as equivalent to 19, and 18/00 (not actually used) is equivalent to 18.
- XBecause adventurers of interest tend to be better than
- Xaverage characters, \fImoria\fP stats will average about 13, and are
- Xfurther adjusted by race and class.
- XSome races are just naturally better at being certain classes, as will be
- Xshown later.
- X.LP
- XIn addition to the more visible stats, each character has certain abilities
- Xwhich are mainly determined by his race, class, and level, but are
- Xalso modified by his stats.
- XThe abilities are \fIfighting\fP, \fIthrowing/bows\fP, \fIsaving throw\fP,
- X\fIstealth\fP, \fIdisarming\fP, \fImagical devices\fP, \fIperception\fP,
- X\fIsearching\fP, and \fIinfravision\fP.
- X.LP
- XCharacters will be assigned an early history, with money and a social class
- Xbased on that history.
- XStarting money is assigned based on history, charisma, and somewhat upon the
- Xaverage of a character's stats.
- XA character with below average stats will receive extra money to help
- Xhim survive the first adventure.
- X.LP
- XEach character will also have physical attributes such as
- Xrace, height, weight, sex, and a physical description.
- XNone of
- Xthese, except weight, play any part in the game other than to
- Xgive the player a \*Qfeeling\*U for his character.
- XWeight is used for computing carrying capacity and also for bashing.
- X.LP
- XFinally, each character is assigned \fIhit points\fP based on their race,
- Xclass, and constitution.
- XSpell casters will also receive \fImana\fP which is expended when casting
- Xspells.
- XMana is based on Wisdom for Priests and Intelligence for Mages.
- X
- X.NH 2
- XCharacter Stats
- X.IP "Strength"
- XStrength is important in fighting with weapons and hand to hand combat.
- XA high strength can improve your chances of hitting, and the amount of
- Xdamage done with each hit.
- XCharacters with low strengths may receive penalties.
- XStrength is also useful in tunneling, body and shield bashing, and in
- Xcarrying heavy items.
- X.IP "Intelligence"
- XIntelligence is the prime stat of a mage, or magician.
- XA high intelligence increases a mage's chances of learning spells, and
- Xit also increases the amount of mana a mage has.
- XNo spell may be learned by mages with intelligences under 8.
- XIntelligence also modifies a character's chance of disarming traps,
- Xpicking locks, and using magic devices.
- X.IP "Wisdom "
- XWisdom is the prime stat of a priest.
- XA high wisdom increases the chance of receiving new spells from a priest's
- Xdeity, and it also increases the amount of mana a priest has.
- XNo spell may be learned by priests with wisdom under 8.
- XWisdom also modifies a character's chance of resisting magical spells
- Xcast upon his person.
- X.IP "Dexterity"
- XDexterity is a combination of agility and quickness.
- XA high dexterity may allow a character to get multiple blows with lighter
- Xweapons, thus greatly increasing his kill power, and may increase his
- Xchances of hitting with any weapon and dodging blows from enemies.
- XDexterity is also useful in picking locks, disarming traps, and
- Xprotecting yourself from pick pockets.
- X.IP "Constitution"
- XConstitution is a character's ability to resist damage to his body, and to
- Xrecover from damage received.
- XTherefore a character with a high constitution will receive more hit points,
- Xand be more resistant to poisons.
- X.IP "Charisma"
- XCharisma represents a character's personality, as well as physical looks.
- XA character with a high charisma will receive better prices from store
- Xowners, whereas a character with a very low charisma will be robbed blind.
- XA high charisma will also mean more starting money for the character.
- X
- X.NH 2
- XCharacter Sex
- X.LP
- XYou may choose to be either a male or a female character.
- XOnly height and weight are affected by a character's sex.
- XFemale characters tend to be somewhat smaller and lighter than their
- Xmale counterparts.
- XNo adjustments to stats or abilities are made because of the sex of
- Xa character. Female characters start out with slightly more money than
- Xmale characters to help offset the weight penalty.
- X
- X.NH 2
- XCharacter Abilities
- X.LP
- XCharacters possess nine different abilities which can help
- Xthem to survive. The starting abilities of a character are based
- Xupon race and class. Abilities may be adjusted by high or low
- Xstats, and may increase with the level of the character.
- X.IP "Fighting"
- XFighting is the ability to hit and do damage with weapons or
- Xfists. Normally a character gets a single blow from any weapon,
- Xbut if his dexterity and strength are high enough, he may receive
- Xmore blows per round with lighter weapons. Strength and
- Xdexterity both modify the ability to hit an opponent.
- XThis skill increases with the level of the character.
- X.IP "Throwing/Bows"
- XUsing ranged missile weapons and throwing objects is
- Xincluded in this skill. Different stats apply to different
- Xweapons, but this ability may modify the distance an object is thrown/fired,
- Xthe amount of damage done, and the ability to hit a creature.
- XThis skill increases with the level of the character.
- X.IP "Saving Throw"
- XA Saving Throw is the ability of a character to resist the
- Xeffects of a spell cast on him by another person/creature.
- XThis does not include spells cast on the player by his own
- Xstupidity, such as quaffing a nasty potion. This ability
- Xincreases with the level of the character, but then most high
- Xlevel creatures are better at casting spells, so it tends to even
- Xout. A high wisdom also increases this ability.
- X.IP "Stealth "
- XThe ability to move silently about is very useful.
- XCharacters with good stealth can usually surprise their
- Xopponents, gaining the first blow. Also, creatures may fail to
- Xnotice a stealthy character entirely, allowing a player to avoid
- Xcertain fights. This skill is based entirely upon race
- Xand class, and will never improve unless magically enhanced.
- X.IP "Disarming"
- XDisarming is the ability to remove traps (safely), and
- Xincludes picking locks on traps and doors.
- XA successful disarming will gain the character some experience.
- XA trap must be found before it can be disarmed.
- XDexterity and intelligence both modify the ability to disarm, and
- Xthis ability increases with the level of the character.
- X.IP "Using Magical Devices"
- XUsing a magical device such as a wand or staff requires
- Xexperience and knowledge. Spell users such as mages and priests
- Xare therefore much better at using a magical device than say a
- Xwarrior. This skill is modified by intelligence, and increases
- Xwith the level of the character.
- X.IP "Perception"
- XPerception is the ability to notice something without
- Xactively seeking it out. This skill is based entirely upon race
- Xand class, and will never improve unless magically enhanced.
- X.IP "Searching"
- XTo search is to actively look for secret doors, floor traps,
- Xand traps on chests. Rogues are the best at searching, but
- Xmages, rangers, and priests are also good at it.
- XThis skill is based entirely upon race
- Xand class, and will never improve unless magically enhanced.
- X.IP "Infravision"
- XInfravision is the ability to see heat sources. Since most
- Xof the dungeon is cool or cold, infravision will not allow the
- Xplayer to see walls and objects. Infravision will allow a
- Xcharacter to see any warm-blooded creatures up to a certain
- Xdistance. This ability works equally well with or with out a
- Xlight source. The majority of \fImoria\fP's creatures are
- Xcold-blooded, and will not be detected unless lit up by a light
- Xsource. All non human races have innate infravision ability.
- XHuman can gain infravision only if it is magically enhanced.
- X
- X.NH 2
- XChoosing A Race
- X.LP
- XThere are eight different races that you can choose from in
- X\fImoria\fP. Some races are restricted as to what profession they may
- Xbe, and each race has its own adjustments to a character's stats
- Xand abilities.
- X.IP "Human "
- XThe human is the base character, all other races are
- Xcompared to him. Humans can choose any class, and are average
- Xat everything. Humans tend to go up levels faster than any other
- Xrace, because of their shorter life spans. No racial adjustments
- Xoccur to characters choosing human.
- X.IP "Half-Elf"
- XHalf-elves tend to be smarter and faster than a human, but
- Xnot as strong. Half-elves are slightly better at searching,
- Xdisarming, perception, stealth, and magic, but they are not as
- Xgood at hand weapons. Half-elves may choose any class.
- X.IP "Elf "
- XElves are better magicians then humans, but not as good at
- Xfighting. They tend to be smarter and faster than either humans
- Xor half-elves, and also have better wisdom. Elves are better at
- Xsearching, disarming, perception, stealth, and magic, but they
- Xare not as good at hand weapons. Elves may choose any class
- Xexcept Paladin.
- X.IP "Halfling"
- XHalflings, or Hobbits, are very good at bows, throwing, and
- Xhave good saving throws. They also are very good at searching,
- Xdisarming, perception, and stealth; so they make excellent
- Xthieves (but prefer to be called burglars...). They will be much
- Xweaker than humans, and no good at bashing. Halflings have fair
- Xinfravision, so they can detect warm creatures at a distance.
- XHalflings can choose between being a warrior, mage, or rogue.
- X.IP "Gnome "
- XGnomes are smaller than dwarfs, but larger than halflings.
- XThey, like the halflings, live in the earth in burrow-like homes.
- XGnomes are practical jokers, so if they can kill something in a
- Xhumorous way, so much the better. Gnomes make excellent mages,
- Xand have very good saving throws. They are good at searching,
- Xdisarming, perception, and stealth. They have lower strength
- Xthan humans so they are not very good at
- Xfighting with hand weapons. Gnomes have fair infravision, so
- Xthey can detect warm creatures at a distance. A gnome may choose
- Xbetween being a warrior, mage, priest, or rogue.
- X.IP "Dwarf "
- XDwarves are the headstrong miners and fighters of legend.
- XSince dungeons are the natural home of a dwarf, they are
- Xexcellent choices for a warrior or priest. Dwarves tend to be
- Xstronger and have higher constitutions, but are slower and less
- Xintelligent than humans. Because they are so headstrong and are
- Xsomewhat wise, they resist spells which are cast on them.
- XDwarves also have good infravision because they live
- Xunderground. They do have one big drawback though. Dwarves are
- Xloudmouthed and proud, singing in loud voices, arguing with
- Xthemselves for no good reason, screaming out challenges at
- Ximagined foes. In other words, dwarves have a miserable stealth.
- X.IP "Half-Orc"
- XHalf-Orcs make excellent warriors, and decent priests, but
- Xare terrible at magic. They are as bad as dwarves at stealth,
- Xand horrible at searching, disarming, and perception. Half-Orcs
- Xare, let's face it, ugly. They tend to pay more for goods in
- Xtown. Half-Orcs do make good priests and rogues, for the simple
- Xreason that Half-Orcs tend to have great constitutions and lots
- Xof hit points.
- X.IP "Half-Troll"
- XHalf-Trolls are incredibly strong, and have the highest hit
- Xpoints of any character race. They are also very stupid and
- Xslow. They will make great warriors and iffy priests. They are
- Xbad at searching, disarming, perception, and stealth. They are
- Xso ugly that a Half-Orc grimaces in their presence. They also
- Xhappen to be fun to run...
- X
- X.NH 3
- XRace Versus Skills and Stats
- X.LP
- XStat, hit dice, and experience points per level modifications due
- Xto race are listed in the following table.
- X.KS
- X.TS
- Xtab(^) center;
- Xl 2 n 2 n 2 n 2 n 2 n 2 n 2 n 2 n.
- X^Str^Int^Wis^Dex^Con^Chr^Hit Dice^Rqd Exp/level
- X.sp
- XHuman^0^0^0^0^0^0^10^+0%
- XHalf-Elf^\-1^+1^0^+1^\-1^+1^9^+10%
- XElf^\-1^+2^+1^+1^\-2^+1^8^+20%
- XHalfling^\-2^+2^+1^+3^+1^+1^6^+10%
- XGnome^\-1^+2^0^+2^+1^\-2^7^+25%
- XDwarf^+2^\-3^+1^\-2^+2^\-3^9^+20%
- XHalf-Orc^+2^\-1^0^0^+1^\-4^10^+10%
- XHalf-Troll^+4^\-4^\-2^\-4^+3^\-6^12^+20%
- X.TE
- X.KE
- XRacial abilities as compared to each other, with
- X1 the lowest, or worst, and 10 the highest, or best,
- Xare listed in the following table.
- X.KS
- X.TS
- Xtab(^) center;
- Xl 1 n 1 n 1 n 1 n 1 n 1 n 1 n 1 l.
- X^Disarm^Search^Stealth^Percep^Fight^Bows^Save^Infra
- X.sp
- XHuman^5^5^5^5^5^5^5^None
- XHalf-Elf^6^7^7^6^4^6^6^20 feet
- XElf^8^9^7^7^3^9^7^30 feet
- XHalfling^10^10^10^10^1^10^10^40 feet
- XGnome^9^7^9^9^2^8^9^30 feet
- XDwarf^6^8^3^5^9^5^8^50 feet
- XHalf-Orc^3^5^3^2^8^3^3^30 feet
- XHalf-Troll^1^1^1^1^10^1^1^30 feet
- X.TE
- X.KE
- X
- X.NH 2
- XChoosing A Class
- X.LP
- XOnce a race has been chosen, you will need to pick a class.
- XSome classes will not be available to certain races, for instance,
- Xa Half-Troll cannot become a Paladin. For the first few
- Xadventures it is suggested that you run a warrior or rogue.
- XSpell casting generally requires a more experienced player that
- Xis familiar with survival techniques.
- X.IP "Warrior"
- XA Warrior is a hack-and-slash character, who solves most of
- Xhis problems by cutting them to pieces, but will occasionally
- Xfall back on the help of a magical device. His prime stats are
- XStrength and Constitution, and a good Dexterity can really help
- Xat times. A Warrior will be good at Fighting and Throwing/Bows,
- Xbut bad at most other skills.
- X.IP "Mage "
- XA Mage must live by his wits. He cannot hope to simply hack
- Xhis way through the dungeon, and so must therefore use his magic
- Xto defeat, deceive, confuse, and escape. A mage is not
- Xreally complete without an assortment of magical devices to use in
- Xaddition to his spells. He can master the higher level magical
- Xdevices far easier than anyone else, and has the best saving
- Xthrow to resist effects of spells cast at him. Intelligence and
- XDexterity are his primary stats. There is no rule that says a
- Xmage cannot become a good fighter, but spells are his true realm.
- X.IP "Priest "
- XA Priest is a character of holy devotion. They explore the
- Xdungeon only to destroy the evil that lurks within, and if
- Xtreasure just happens to fall into their packs, well, so much
- Xmore to the glory of their church! Priests receive their spells
- Xfrom a deity, and therefore do not choose which spells they will
- Xlearn. They are familiar with magical devices, preferring to call
- Xthem instruments of god, but are not as good as a mage in their
- Xuse. Priests have good saving throws, and make decent fighters,
- Xpreferring blunt weapons over edged ones. Wisdom and Charisma
- Xare the priest's primary stats.
- X.IP "Rogue "
- XA Rogue is a character that prefers to live by his cunning,
- Xbut is capable of fighting his way out of a tight spot. He is
- Xthe master of traps and locks, no device being impossible for him
- Xto overcome. A rogue has a high stealth allowing him to sneak
- Xaround many creatures without having to fight, or sneak up and
- Xget the first blow. A rogue's perception is higher than any
- Xother class, and many times he will notice a trap or secret door
- Xbefore having to search. A rogue is better than warriors or
- Xpaladins with magical devices, but still can not rely on their
- Xperformance. Rogues can also learn a few spells, but not the powerful
- Xoffensive spells mages can use. A rogue's primary stats are
- XIntelligence and Dexterity.
- X.IP "Ranger "
- XA Ranger is a warrior/mage. He is a good fighter, and the
- Xbest of the classes with a missile weapon such as a bow. The
- Xranger learns spells much more slowly than a mage, but is capable
- Xof learning all but the most powerful spell. Because a ranger is
- Xreally a dual class character, more experience is required for him
- Xto advance. A ranger has a good stealth, good perception, good
- Xsearching, a good saving throw, and is good with magical devices.
- XHis primary stats are Intelligence and Dexterity.
- X.IP "Paladin "
- XA Paladin is a warrior/priest. He is a very good fighter,
- Xsecond only to the warrior class, but not very good at missile
- Xweapons. He receives prayers at a slower pace then the priest,
- Xand can receive all but the most powerful prayer. Because a
- Xpaladin is really a dual class character, it requires more
- Xexperience to advance him. A paladin lacks much in the way of
- Xabilities. He is poor at stealth, perception, searching, and
- Xmagical devices. He has a decent saving throw due to his divine
- Xalliance. His primary stats are Strength and Charisma.
- X
- X.NH 3
- XRace Versus Class
- X.LP
- X.KS
- X.TS
- Xtab(^) center;
- Xl 2 ce 2 ce 2 ce 2 ce 2 ce 2 ce.
- X^Warrior^Mage^Priest^Rogue^Ranger^Paladin
- X.sp
- XHuman^Yes^Yes^Yes^Yes^Yes^Yes
- XHalf-Elf^Yes^Yes^Yes^Yes^Yes^Yes
- XElf^Yes^Yes^Yes^Yes^Yes^No
- XHalfling^Yes^Yes^No^Yes^No^No
- XGnome^Yes^Yes^Yes^Yes^No^No
- XDwarf^Yes^No^Yes^No^No^No
- XHalf-Orc^Yes^No^Yes^Yes^No^No
- XHalf-Troll^Yes^No^Yes^No^No^No
- X.TE
- X.KE
- X
- X.NH 3
- XClass Versus Skills
- X.LP
- XClass abilities as compared to each other, with
- X1 as the lowest, or worst, and 10 as the highest, or best
- Xare shown in the following table.
- X.KS
- X.TS
- Xtab(^) center;
- Xl 1 c 1 c 1 c 1 c 1 c 1 c 1 c 1 c 1 c
- Xl c c c c c c c c c
- Xl n n n n n n n n r.
- X^^^Save^Stea-^^Magic^^^Extra
- X^Fight^Bows^Throw^lth^Disarm^Device^Percep^Search^Exp/lev
- X.sp
- XWarrior^10^6^3^2^4^3^2^2^+0%
- XMage^2^1^10^5^6^10^8^5^+30%
- XPriest^4^3^6^5^3^8^4^4^+20%
- XRogue^8^9^7^10^10^6^10^10^+0%
- XRanger^6^10^8^7^6^7^6^6^+40%
- XPaladin^9^5^4^2^2^4^2^2^+35%
- X.TE
- X.KE
- X
- X.NH 1
- XAdventuring
- X.LP
- XAfter you have created your character, you will begin your
- X\fImoria\fP adventure. Symbols appearing on your screen will represent
- Xthe dungeon's walls, floor, objects, features, and
- Xcreatures lurking about. In order to direct your character
- Xthrough his adventure, you will enter single character commands.
- X.LP
- X\fIMoria\fP symbols and commands each have a help section devoted
- Xto them. You should review these sections before attempting an
- Xadventure. Finally, a description of the town level and some
- Xgeneral help on adventuring are included.
- X
- X.NH 1
- XSymbols On Your Map
- X.LP
- XSymbols on your map can be broken down into three
- Xcategories: Features of the dungeon such as walls, floor, doors,
- Xand traps; Objects which can be picked up such as treasure,
- Xweapons, magical devices, etc; and creatures which may or may not
- Xmove about the dungeon, but are mostly harmful to your
- Xcharacter's well being.
- X.LP
- XSome symbols can be in more than one category.
- XAlso note that treasure may be embedded in a wall, and the wall
- Xmust be removed before the treasure can be picked up.
- X.LP
- XIt will not be necessary to remember all of the symbols and
- Xtheir meanings. A simple command, the `/', will identify any
- Xcharacter appearing on your map. See the section on commands for
- Xfurther help.
- X.LP
- X.nf
- X.KS
- X.TS
- Xtab(*) center;
- Xc s s s
- Xl l l l.
- XFeatures
- X.sp
- X\&.*A floor space, or hidden trap*1*Entrance to General Store
- X#*A wall*2*Entrance to Armory
- X'*An open door*3*Entrance to Weapon Smith
- X+*A closed door*4*Entrance to Temple
- X^*A trap*5*Entrance to Alchemy Shop
- X<*A staircase up*6*Entrance to Magic Shop
- X>*A staircase down*:*Obstructing rubble
- X;*A loose floor stone*\ *An open pit (Blank)
- X%*A mineral vein*@*The character
- X.TE
- X.KE
- X.sp
- X.KS
- X.TS
- Xtab(^) center;
- Xc s s s
- Xl l l l.
- XObjects
- X.sp
- X!^A flask or potion^?^A scroll
- X"^An amulet^[^Hard armor
- X$^Money (Can be embedded)^\e^A hafted weapon
- X&^A chest^]^Misc. armor
- X(^Soft armor^\&_^A staff
- X)^A shield^{^Missile (arrow, bolt, pebble)
- X*^Gems (Can be embedded)^|^Sword or dagger
- X\-^A wand^}^Missile arm (Bow, X-bow, sling)
- X/^A pole-arm^~^Misc
- X\&=^A ring^,^Food
- Xs^A skeleton^^
- X.TE
- X.KE
- X.sp
- X.KS
- X.TS
- Xtab(^) center;
- Xc s s s
- Xl l l l.
- XCreatures
- X.sp
- Xa^Giant Ant^A^Giant Ant Lion
- Xb^Giant Bat^B^The Balrog
- Xc^Giant Centipede^C^Gelatinous Cube
- Xd^Dragon^D^Ancient Dragon
- Xe^Floating Eye^E^Elemental
- Xf^Giant Frog^F^Fly
- Xg^Golem^G^Ghost
- Xh^Harpy^H^Hobgoblin
- Xi^Icky-Thing^I^
- Xj^Jackal^J^Jelly
- Xk^Kobold^K^Killer Beetle
- Xl^Giant Louse^L^Lich
- Xm^Mold^M^Mummy
- Xn^Naga^N^
- Xo^Orc or Ogre^O^Ooze
- Xp^Human(oid)^P^Giant Human(oid)
- Xq^Quasit^Q^Quylthulg
- Xr^Rodent^R^Reptile
- Xs^Skeleton^S^Scorpion
- Xt^Giant Tick^T^Troll
- Xu^^U^Umber Hulk
- Xv^^V^Vampire
- Xw^Worm or Worm Mass^W^Wight or Wraith.
- Xx^^X^Xorn
- Xy^Yeek^Y^Yeti
- Xz^Zombie^Z^
- X$^Creeping Coins^,^Mushroom Patch
- X.TE
- X.KE
- X
- X.NH 1
- XCommands
- X.LP
- XAll commands are entered by pressing a single key.
- XSome commands are capital or control characters, which require
- Xyou to hold down the shift or control key while pressing another key.
- XAs a special feature, control keys may be entered in a single stroke,
- Xor in two strokes, with a `^' character first.
- X.LP
- XThere are two command sets: the original command set which is
- Xthe default, and the rogue like command set. The rogue like command
- Xis generally more convenient, especially if you don't have a keypad.
- X.LP
- XThe following tables summarize the two command sets.
- XCertain commands may be preceded by an optional count, and certain
- Xcommands must be followed by a direction. These conditions
- Xare indicated in the tables by `@' for an optional count,
- Xand `~' for a direction. If a particular command requires additional
- Xkey strokes, then they will be prompted for.
- X.KS
- X.TS
- Xtab(^) center;
- Xc 1 s 1 s 1 s 1 s 1 s 1 s.
- XOriginal command summary.
- X.T&
- Xl l l l l l s.
- X^a^Aim and fire a wand^@^B ~^Bash (object/creature)
- X^b^Browse a book^^C^Change name
- X^c ~^Close a door^@^D ~^Disarm a trap/chest
- X^d^Drop an item^^E^Eat some food
- X^e^Equipment list^^F^Fill lamp with oil
- X^f^Fire/Throw an item^^G^Gain new magic spells
- X^i^Inventory list^^L^Locate with map
- X@^j ~^Jam a door with spike^^M^Map shown reduced size
- X^l ~^Look given direction^@^R^Rest for a period
- X^m^Magic spell casting^^S^Search Mode
- X@^o ~^Open a door/chest^@^T ~^Tunnel in a direction
- X^p^Pray^^V^View scoreboard
- X^q^Quaff a potion^^\&=^Set options
- X^r^Read a scroll^^?^Command quick reference
- X@^s^Search for trap or door^^{^Inscribe an object
- X^t^Take off an item^@^\- ~^Move without pickup
- X^u^Use a staff^^. ~^Run in direction
- X^v^Version, credits and manual^^/^Identify a character
- X^w^Wear/Wield an item^^CTRL-K^Quit the game
- X^x^Exchange weapon^@^CTRL-P^Repeat the last message
- X^<^Go up an up staircase^^CTRL-X^Save character and quit
- X^>^Go down a down staircase^@^~^for movement
- X.TE
- X.KE
- X.KS
- X.TS
- Xtab(^) center;
- Xc 1 s 1 s 1 s 1 s 1 s 1 s.
- XRogue like command summary.
- X.T&
- Xl l l l l l s.
- X^c ~^Close a door^^C^Character description
- X^d^Drop an item^@^D ~^Disarm a trap/chest
- X^e^Equipment list^^E^Eat some food
- X@^f ~^Force/bash item/monster^^F^Fill lamp with oil
- X^i^Inventory list^^G^Gain new magic spells
- X^m^magic spell casting^^M^Map shown reduced size
- X@^o ~^Open a door/chest^^P^Peruse a book
- X^p^Pray^^Q^Quit the game
- X^q^Quaff a potion^@^R^Rest for a period
- X^r^Read a scroll^@^S ~^Spike a door
- X@^s^Search for trap or door^^T^Take off an item
- X^t^Throw an item^^V^View scores
- X^v^Version, and manual^^W^Where: locate self
- X^w^Wear/Wield an item^^X^Exchange weapon
- X^x ~^Examine surroundings^^Z^Zap a staff
- X^z^Zap a wand^^#^Search Mode
- X^\&=^Set options^^<^Go up an up staircase
- X^/^Identify a character^^>^Go down a down stair
- X@^CTRL-P^Previous message review^^{^Inscribe an object
- X@^\- ~^Move without pickup^^?^Type this page
- X@^CTRL ~^Tunnel in a direction^^CTRL-X^Save game and exit
- X@^SHFT ~^Run in direction^@^~^for movement
- X.TE
- X.KE
- X
- X.NH 2
- XSpecial keys.
- X.LP
- XCertain commands may be entered at any time input is accepted.
- XThe special character control-R, entered as a single key stroke, will
- Xalways refresh the screen. This may be used at any prompt for input,
- Xand is otherwise ignored.
- X.LP
- XIf you are playing on a UNIX or similar system, then there are some
- Xadditional special characters used by \fImoria\fP.
- XThe special character control-C will interrupt \fImoria\fP, and ask if you
- Xreally want to die and quit the game.
- END_OF_FILE
- if test 25261 -ne `wc -c <'doc/moria1.ms.1'`; then
- echo shar: \"'doc/moria1.ms.1'\" unpacked with wrong size!
- fi
- # end of 'doc/moria1.ms.1'
- fi
- if test -f 'source/misc3.c.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/misc3.c.1'\"
- else
- echo shar: Extracting \"'source/misc3.c.1'\" \(29086 characters\)
- sed "s/^X//" >'source/misc3.c.1' <<'END_OF_FILE'
- X/* source/misc3.c: misc code for maintaining the dungeon, printing player info
- X
- X Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke
- X
- X This software may be copied and distributed for educational, research, and
- X not for profit purposes provided that this copyright and statement are
- X included in all such copies. */
- X
- X#ifdef __TURBOC__
- X#include <stdio.h>
- X#endif
- X
- X#include "config.h"
- X#include "constant.h"
- X#include "types.h"
- X#include "externs.h"
- X
- X#include <ctype.h>
- X
- X#ifndef USG
- X#include <sys/types.h>
- X#include <sys/param.h>
- X#endif
- X
- X#ifdef USG
- X#ifndef ATARIST_MWC
- X#include <string.h>
- X#else
- Xchar *index();
- X#endif
- X#else
- X#include <strings.h>
- X#endif
- X
- X#if defined(LINT_ARGS)
- Xstatic void prt_lnum(char *, int32, int, int);
- Xstatic void prt_num(char *, int, int, int);
- Xstatic void prt_long(int32, int, int);
- Xstatic void prt_int(int, int, int);
- Xstatic void gain_level(void);
- X#endif
- X
- Xstatic char *stat_names[] = { "STR : ", "INT : ", "WIS : ",
- X "DEX : ", "CON : ", "CHR : " };
- X#define BLANK_LENGTH 24
- Xstatic char blank_string[] = " ";
- X
- X
- X/* Places a particular trap at location y, x -RAK- */
- Xvoid place_trap(y, x, subval)
- Xint y, x, subval;
- X{
- X register int cur_pos;
- X
- X cur_pos = popt();
- X cave[y][x].tptr = cur_pos;
- X invcopy(&t_list[cur_pos], OBJ_TRAP_LIST + subval);
- X}
- X
- X
- X/* Places rubble at location y, x -RAK- */
- Xvoid place_rubble(y, x)
- Xint y, x;
- X{
- X register int cur_pos;
- X register cave_type *cave_ptr;
- X
- X cur_pos = popt();
- X cave_ptr = &cave[y][x];
- X cave_ptr->tptr = cur_pos;
- X cave_ptr->fval = BLOCKED_FLOOR;
- X invcopy(&t_list[cur_pos], OBJ_RUBBLE);
- X}
- X
- X
- X/* Places a treasure (Gold or Gems) at given row, column -RAK- */
- Xvoid place_gold(y, x)
- Xint y, x;
- X{
- X register int i, cur_pos;
- X#ifdef M_XENIX
- X /* Avoid 'register' bug. */
- X inven_type *t_ptr;
- X#else
- X register inven_type *t_ptr;
- X#endif
- X
- X cur_pos = popt();
- X i = ((randint(dun_level+2)+2) / 2) - 1;
- X if (randint(OBJ_GREAT) == 1)
- X i += randint(dun_level+1);
- X if (i >= MAX_GOLD)
- X i = MAX_GOLD - 1;
- X cave[y][x].tptr = cur_pos;
- X invcopy(&t_list[cur_pos], OBJ_GOLD_LIST+i);
- X t_ptr = &t_list[cur_pos];
- X t_ptr->cost += (8L * (long)randint((int)t_ptr->cost)) + randint(8);
- X if (cave[y][x].cptr == 1)
- X msg_print ("You feel something roll beneath your feet.");
- X}
- X
- X
- X/* Returns the array number of a random object -RAK- */
- Xint get_obj_num(level)
- Xint level;
- X{
- X register int i, j;
- X
- X if (level == 0)
- X i = randint(t_level[0]) - 1;
- X else
- X {
- X if (level >= MAX_OBJ_LEVEL)
- X level = MAX_OBJ_LEVEL;
- X else if (randint(OBJ_GREAT) == 1)
- X {
- X level = level * MAX_OBJ_LEVEL / randint (MAX_OBJ_LEVEL) + 1;
- X if (level > MAX_OBJ_LEVEL)
- X level = MAX_OBJ_LEVEL;
- X }
- X
- X /* This code has been added to make it slightly more likely to get the
- X higher level objects. Originally a uniform distribution over all
- X objects less than or equal to the dungeon level. This distribution
- X makes a level n objects occur approx 2/n% of the time on level n,
- X and 1/2n are 0th level. */
- X
- X if (randint(2) == 1)
- X i = randint(t_level[level]) - 1;
- X else /* Choose three objects, pick the highest level. */
- X {
- X i = randint(t_level[level]) - 1;
- X j = randint(t_level[level]) - 1;
- X if (i < j)
- X i = j;
- X j = randint(t_level[level]) - 1;
- X if (i < j)
- X i = j;
- X j = object_list[sorted_objects[i]].level;
- X if (j == 0)
- X i = randint(t_level[0]) - 1;
- X else
- X i = randint(t_level[j]-t_level[j-1]) - 1 + t_level[j-1];
- X }
- X }
- X return(i);
- X}
- X
- X
- X/* Places an object at given row, column co-ordinate -RAK- */
- Xvoid place_object(y, x)
- Xint y, x;
- X{
- X register int cur_pos, tmp;
- X
- X cur_pos = popt();
- X cave[y][x].tptr = cur_pos;
- X /* split this line up to avoid a reported compiler bug */
- X tmp = get_obj_num(dun_level);
- X invcopy(&t_list[cur_pos], sorted_objects[tmp]);
- X magic_treasure(cur_pos, dun_level);
- X if (cave[y][x].cptr == 1)
- X msg_print ("You feel something roll beneath your feet."); /* -CJS- */
- X}
- X
- X
- X/* Allocates an object for tunnels and rooms -RAK- */
- Xvoid alloc_object(alloc_set, typ, num)
- Xint (*alloc_set)();
- Xint typ, num;
- X{
- X register int i, j, k;
- X
- X for (k = 0; k < num; k++)
- X {
- X do
- X {
- X i = randint(cur_height) - 1;
- X j = randint(cur_width) - 1;
- X }
- X /* don't put an object beneath the player, this could cause problems
- X if player is standing under rubble, or on a trap */
- X while ((!(*alloc_set)(cave[i][j].fval)) ||
- X (cave[i][j].tptr != 0) || (i == char_row && j == char_col));
- X if (typ < 4) { /* typ == 2 not used, used to be visible traps */
- X if (typ == 1) place_trap(i, j, randint(MAX_TRAP)-1); /* typ == 1 */
- X else place_rubble(i, j); /* typ == 3 */
- X } else {
- X if (typ == 4) place_gold(i, j); /* typ == 4 */
- X else place_object(i, j); /* typ == 5 */
- X }
- X }
- X}
- X
- X
- X/* Creates objects nearby the coordinates given -RAK- */
- Xvoid random_object(y, x, num)
- Xint y, x, num;
- X{
- X register int i, j, k;
- X register cave_type *cave_ptr;
- X
- X do
- X {
- X i = 0;
- X do
- X {
- X j = y - 3 + randint(5);
- X k = x - 4 + randint(7);
- X cave_ptr = &cave[j][k];
- X if (in_bounds(j, k) && (cave_ptr->fval <= MAX_CAVE_FLOOR)
- X && (cave_ptr->tptr == 0))
- X {
- X if (randint(100) < 75)
- X place_object(j, k);
- X else
- X place_gold(j, k);
- X i = 9;
- X }
- X i++;
- X }
- X while(i <= 10);
- X num--;
- X }
- X while (num != 0);
- X}
- X
- X
- X/* Converts stat num into string -RAK- */
- Xvoid cnv_stat(stat, out_val)
- Xint8u stat;
- Xchar *out_val;
- X{
- X register int part1, part2;
- X
- X if (stat > 18)
- X {
- X part1 = 18;
- X part2 = stat - 18;
- X if (part2 == 100)
- X (void) strcpy(out_val, "18/100");
- X else
- X (void) sprintf(out_val, " %2d/%02d", part1, part2);
- X }
- X else
- X (void) sprintf(out_val, "%6d", stat);
- X}
- X
- X
- X/* Print character stat in given row, column -RAK- */
- Xvoid prt_stat(stat)
- Xint stat;
- X{
- X stat_type out_val1;
- X
- X cnv_stat(py.stats.use_stat[stat], out_val1);
- X put_buffer(stat_names[stat], 6+stat, STAT_COLUMN);
- X put_buffer (out_val1, 6+stat, STAT_COLUMN+6);
- X}
- X
- X
- X/* Print character info in given row, column -RAK- */
- X/* the longest title is 13 characters, so only pad to 13 */
- Xvoid prt_field(info, row, column)
- Xchar *info;
- Xint row, column;
- X{
- X put_buffer (&blank_string[BLANK_LENGTH-13], row, column);
- X put_buffer (info, row, column);
- X}
- X
- X/* Print long number with header at given row, column */
- Xstatic void prt_lnum(header, num, row, column)
- Xchar *header;
- Xint32 num;
- Xint row, column;
- X{
- X vtype out_val;
- X
- X (void) sprintf(out_val, "%s: %6ld", header, num);
- X put_buffer(out_val, row, column);
- X}
- X
- X/* Print number with header at given row, column -RAK- */
- Xstatic void prt_num(header, num, row, column)
- Xchar *header;
- Xint num, row, column;
- X{
- X vtype out_val;
- X
- X (void) sprintf(out_val, "%s: %6d", header, num);
- X put_buffer(out_val, row, column);
- X}
- X
- X/* Print long number at given row, column */
- Xstatic void prt_long(num, row, column)
- Xint32 num;
- Xint row, column;
- X{
- X vtype out_val;
- X
- X (void) sprintf(out_val, "%6ld", num);
- X put_buffer(out_val, row, column);
- X}
- X
- X/* Print number at given row, column -RAK- */
- Xstatic void prt_int(num, row, column)
- Xint num, row, column;
- X{
- X vtype out_val;
- X
- X (void) sprintf(out_val, "%6d", num);
- X put_buffer(out_val, row, column);
- X}
- X
- X
- X/* Adjustment for wisdom/intelligence -JWT- */
- Xint stat_adj(stat)
- Xint stat;
- X{
- X register int value;
- X
- X value = py.stats.use_stat[stat];
- X if (value > 117)
- X return(7);
- X else if (value > 107)
- X return(6);
- X else if (value > 87)
- X return(5);
- X else if (value > 67)
- X return(4);
- X else if (value > 17)
- X return(3);
- X else if (value > 14)
- X return(2);
- X else if (value > 7)
- X return(1);
- X else
- X return(0);
- X}
- X
- X
- X/* Adjustment for charisma -RAK- */
- X/* Percent decrease or increase in price of goods */
- Xint chr_adj()
- X{
- X register int charisma;
- X
- X charisma = py.stats.use_stat[A_CHR];
- X if (charisma > 117)
- X return(90);
- X else if (charisma > 107)
- X return(92);
- X else if (charisma > 87)
- X return(94);
- X else if (charisma > 67)
- X return(96);
- X else if (charisma > 18)
- X return(98);
- X else
- X switch(charisma)
- X {
- X case 18: return(100);
- X case 17: return(101);
- X case 16: return(102);
- X case 15: return(103);
- X case 14: return(104);
- X case 13: return(106);
- X case 12: return(108);
- X case 11: return(110);
- X case 10: return(112);
- X case 9: return(114);
- X case 8: return(116);
- X case 7: return(118);
- X case 6: return(120);
- X case 5: return(122);
- X case 4: return(125);
- X case 3: return(130);
- X default: return(100);
- X }
- X}
- X
- X
- X/* Returns a character's adjustment to hit points -JWT- */
- Xint con_adj()
- X{
- X register int con;
- X
- X con = py.stats.use_stat[A_CON];
- X if (con < 7)
- X return(con - 7);
- X else if (con < 17)
- X return(0);
- X else if (con == 17)
- X return(1);
- X else if (con < 94)
- X return(2);
- X else if (con < 117)
- X return(3);
- X else
- X return(4);
- X}
- X
- X
- Xchar *title_string()
- X{
- X register char *p;
- X
- X if (py.misc.lev < 1)
- X p = "Babe in arms";
- X else if (py.misc.lev <= MAX_PLAYER_LEVEL)
- X p = player_title[py.misc.pclass][py.misc.lev-1];
- X else if (py.misc.male)
- X p = "**KING**";
- X else
- X p = "**QUEEN**";
- X return p;
- X}
- X
- X
- X/* Prints title of character -RAK- */
- Xvoid prt_title()
- X{
- X prt_field(title_string(), 4, STAT_COLUMN);
- X}
- X
- X
- X/* Prints level -RAK- */
- Xvoid prt_level()
- X{
- X prt_int((int)py.misc.lev, 13, STAT_COLUMN+6);
- X}
- X
- X
- X/* Prints players current mana points. -RAK- */
- Xvoid prt_cmana()
- X{
- X prt_int(py.misc.cmana, 15, STAT_COLUMN+6);
- X}
- X
- X
- X/* Prints Max hit points -RAK- */
- Xvoid prt_mhp()
- X{
- X prt_int(py.misc.mhp, 16, STAT_COLUMN+6);
- X}
- X
- X
- X/* Prints players current hit points -RAK- */
- Xvoid prt_chp()
- X{
- X prt_int(py.misc.chp, 17, STAT_COLUMN+6);
- X}
- X
- X
- X/* prints current AC -RAK- */
- Xvoid prt_pac()
- X{
- X prt_int(py.misc.dis_ac, 19, STAT_COLUMN+6);
- X}
- X
- X
- X/* Prints current gold -RAK- */
- Xvoid prt_gold()
- X{
- X prt_long(py.misc.au, 20, STAT_COLUMN+6);
- X}
- X
- X
- X/* Prints depth in stat area -RAK- */
- Xvoid prt_depth()
- X{
- X vtype depths;
- X register int depth;
- X
- X depth = dun_level*50;
- X if (depth == 0)
- X (void) strcpy(depths, "Town level");
- X else
- X (void) sprintf(depths, "%d feet", depth);
- X prt(depths, 23, 65);
- X}
- X
- X
- X/* Prints status of hunger -RAK- */
- Xvoid prt_hunger()
- X{
- X if (PY_WEAK & py.flags.status)
- X put_buffer("Weak ", 23, 0);
- X else if (PY_HUNGRY & py.flags.status)
- X put_buffer("Hungry", 23, 0);
- X else
- X put_buffer(&blank_string[BLANK_LENGTH-6], 23, 0);
- X}
- X
- X
- X/* Prints Blind status -RAK- */
- Xvoid prt_blind()
- X{
- X if (PY_BLIND & py.flags.status)
- X put_buffer("Blind", 23, 7);
- X else
- X put_buffer(&blank_string[BLANK_LENGTH-5], 23, 7);
- X}
- X
- X
- X/* Prints Confusion status -RAK- */
- Xvoid prt_confused()
- X{
- X if (PY_CONFUSED & py.flags.status)
- X put_buffer("Confused", 23, 13);
- X else
- X put_buffer(&blank_string[BLANK_LENGTH-8], 23, 13);
- X}
- X
- X
- X/* Prints Fear status -RAK- */
- Xvoid prt_afraid()
- X{
- X if (PY_FEAR & py.flags.status)
- X put_buffer("Afraid", 23, 22);
- X else
- X put_buffer(&blank_string[BLANK_LENGTH-6], 23, 22);
- X}
- X
- X
- X/* Prints Poisoned status -RAK- */
- Xvoid prt_poisoned()
- X{
- X if (PY_POISONED & py.flags.status)
- X put_buffer("Poisoned", 23, 29);
- X else
- X put_buffer(&blank_string[BLANK_LENGTH-8], 23, 29);
- X}
- X
- X
- X/* Prints Searching, Resting, Paralysis, or 'count' status -RAK- */
- Xvoid prt_state()
- X{
- X char tmp[16];
- X#ifdef ATARIST_MWC
- X int32u holder;
- X#endif
- X
- X#ifdef ATARIST_MWC
- X py.flags.status &= ~(holder = PY_REPEAT);
- X#else
- X py.flags.status &= ~PY_REPEAT;
- X#endif
- X if (py.flags.paralysis > 1)
- X put_buffer ("Paralysed", 23, 38);
- X else if (PY_REST & py.flags.status)
- X {
- X if (py.flags.rest < 0)
- X (void) strcpy (tmp, "Rest *");
- X else if (display_counts)
- X (void) sprintf (tmp, "Rest %-5d", py.flags.rest);
- X else
- X (void) strcpy (tmp, "Rest");
- X put_buffer (tmp, 23, 38);
- X }
- X else if (command_count > 0)
- X {
- X if (display_counts)
- X (void) sprintf (tmp, "Repeat %-3d", command_count);
- X else
- X (void) strcpy (tmp, "Repeat");
- X#ifdef ATARIST_MWC
- X py.flags.status |= holder;
- X#else
- X py.flags.status |= PY_REPEAT;
- X#endif
- X put_buffer (tmp, 23, 38);
- X if (PY_SEARCH & py.flags.status)
- X put_buffer ("Search", 23, 38);
- X }
- X else if (PY_SEARCH & py.flags.status)
- X put_buffer("Searching", 23, 38);
- X else /* "repeat 999" is 10 characters */
- X put_buffer(&blank_string[BLANK_LENGTH-10], 23, 38);
- X}
- X
- X
- X/* Prints the speed of a character. -CJS- */
- Xvoid prt_speed ()
- X{
- X register int i;
- X
- X i = py.flags.speed;
- X if (PY_SEARCH & py.flags.status) /* Search mode. */
- X i--;
- X if (i > 1)
- X put_buffer ("Very Slow", 23, 49);
- X else if (i == 1)
- X put_buffer ("Slow ", 23, 49);
- X else if (i == 0)
- X put_buffer (&blank_string[BLANK_LENGTH-9], 23, 49);
- X else if (i == -1)
- X put_buffer ("Fast ", 23, 49);
- X else
- X put_buffer ("Very Fast", 23, 49);
- X}
- X
- X
- Xvoid prt_study()
- X{
- X#ifdef ATARIST_MWC
- X int32u holder;
- X#endif
- X
- X#ifdef ATARIST_MWC
- X py.flags.status &= ~(holder = PY_STUDY);
- X#else
- X py.flags.status &= ~PY_STUDY;
- X#endif
- X if (py.flags.new_spells == 0)
- X put_buffer (&blank_string[BLANK_LENGTH-5], 23, 59);
- X else
- X put_buffer ("Study", 23, 59);
- X}
- X
- X
- X/* Prints winner status on display -RAK- */
- Xvoid prt_winner()
- X{
- X if (noscore & 0x2)
- X {
- X if (wizard)
- X put_buffer("Is wizard ", 22, 0);
- X else
- X put_buffer("Was wizard ", 22, 0);
- X }
- X else if (noscore & 0x1)
- X put_buffer("Resurrected", 22, 0);
- X else if (noscore & 0x4)
- X put_buffer ("Duplicate", 22, 0);
- X else if (total_winner)
- X put_buffer("*Winner* ", 22, 0);
- X}
- X
- X
- Xint8u modify_stat (stat, amount)
- Xint stat;
- Xint16 amount;
- X{
- X register int loop, i;
- X register int8u tmp_stat;
- X
- X tmp_stat = py.stats.cur_stat[stat];
- X loop = (amount < 0 ? -amount : amount);
- X for (i = 0; i < loop; i++)
- X {
- X if (amount > 0)
- X {
- X if (tmp_stat < 18)
- X tmp_stat++;
- X else if (tmp_stat < 108)
- X tmp_stat += 10;
- X else
- X tmp_stat = 118;
- X }
- X else
- X {
- X if (tmp_stat > 27)
- X tmp_stat -= 10;
- X else if (tmp_stat > 18)
- X tmp_stat = 18;
- X else if (tmp_stat > 3)
- X tmp_stat--;
- X }
- X }
- X return tmp_stat;
- X}
- X
- X
- X/* Set the value of the stat which is actually used. -CJS- */
- Xvoid set_use_stat(stat)
- Xint stat;
- X{
- X#ifdef ATARIST_MWC
- X int32u holder;
- X#endif
- X
- X py.stats.use_stat[stat] = modify_stat (stat, py.stats.mod_stat[stat]);
- X
- X if (stat == A_STR)
- X {
- X#ifdef ATARIST_MWC
- X py.flags.status |= (holder = PY_STR_WGT);
- X#else
- X py.flags.status |= PY_STR_WGT;
- X#endif
- X calc_bonuses();
- X }
- X else if (stat == A_DEX)
- X calc_bonuses();
- X else if (stat == A_INT && class[py.misc.pclass].spell == MAGE)
- X {
- X calc_spells(A_INT);
- X calc_mana(A_INT);
- X }
- X else if (stat == A_WIS && class[py.misc.pclass].spell == PRIEST)
- X {
- X calc_spells(A_WIS);
- X calc_mana(A_WIS);
- X }
- X else if (stat == A_CON)
- X calc_hitpoints();
- X}
- X
- X
- X/* Increases a stat by one randomized level -RAK- */
- Xint inc_stat(stat)
- Xregister int stat;
- X{
- X register int tmp_stat, gain;
- X
- X tmp_stat = py.stats.cur_stat[stat];
- X if (tmp_stat < 118)
- X {
- X if (tmp_stat < 18)
- X tmp_stat++;
- X else if (tmp_stat < 116)
- X {
- X /* stat increases by 1/6 to 1/3 of difference from max */
- X gain = ((118 - tmp_stat)/3 + 1) >> 1;
- X tmp_stat += randint(gain) + gain;
- X }
- X else
- X tmp_stat++;
- X
- X py.stats.cur_stat[stat] = tmp_stat;
- X if (tmp_stat > py.stats.max_stat[stat])
- X py.stats.max_stat[stat] = tmp_stat;
- X set_use_stat (stat);
- X prt_stat (stat);
- X return TRUE;
- X }
- X else
- X return FALSE;
- X}
- X
- X
- X/* Decreases a stat by one randomized level -RAK- */
- Xint dec_stat(stat)
- Xregister int stat;
- X{
- X register int tmp_stat, loss;
- X
- X tmp_stat = py.stats.cur_stat[stat];
- X if (tmp_stat > 3)
- X {
- X if (tmp_stat < 19)
- X tmp_stat--;
- X else if (tmp_stat < 117)
- X {
- X loss = (((118 - tmp_stat) >> 1) + 1) >> 1;
- X tmp_stat += -randint(loss) - loss;
- X if (tmp_stat < 18)
- X tmp_stat = 18;
- X }
- X else
- X tmp_stat--;
- X
- X py.stats.cur_stat[stat] = tmp_stat;
- X set_use_stat (stat);
- X prt_stat (stat);
- X return TRUE;
- X }
- X else
- X return FALSE;
- X}
- X
- X
- X/* Restore a stat. Return TRUE only if this actually makes a difference. */
- Xint res_stat (stat)
- Xint stat;
- X{
- X register int i;
- X
- X i = py.stats.max_stat[stat] - py.stats.cur_stat[stat];
- X if (i)
- X {
- X py.stats.cur_stat[stat] += i;
- X set_use_stat (stat);
- X prt_stat (stat);
- X return TRUE;
- X }
- X return FALSE;
- X}
- X
- X/* Boost a stat artificially (by wearing something). If the display argument
- X is TRUE, then increase is shown on the screen. */
- Xvoid bst_stat (stat, amount)
- Xint stat, amount;
- X{
- X#ifdef ATARIST_MWC
- X int32u holder;
- X#endif
- X
- X py.stats.mod_stat[stat] += amount;
- X
- X set_use_stat (stat);
- X /* can not call prt_stat() here, may be in store, may be in inven_command */
- X#ifdef ATARIST_MWC
- X py.flags.status |= ((holder = PY_STR) << stat);
- X#else
- X py.flags.status |= (PY_STR << stat);
- X#endif
- X}
- X
- X
- X/* Returns a character's adjustment to hit. -JWT- */
- Xint tohit_adj()
- X{
- X register int total, stat;
- X
- X stat = py.stats.use_stat[A_DEX];
- X if (stat < 4) total = -3;
- X else if (stat < 6) total = -2;
- X else if (stat < 8) total = -1;
- X else if (stat < 16) total = 0;
- X else if (stat < 17) total = 1;
- X else if (stat < 18) total = 2;
- X else if (stat < 69) total = 3;
- X else if (stat < 118) total = 4;
- X else total = 5;
- X stat = py.stats.use_stat[A_STR];
- X if (stat < 4) total -= 3;
- X else if (stat < 5) total -= 2;
- X else if (stat < 7) total -= 1;
- X else if (stat < 18) total -= 0;
- X else if (stat < 94) total += 1;
- X else if (stat < 109) total += 2;
- X else if (stat < 117) total += 3;
- X else total += 4;
- X return(total);
- X}
- X
- X
- X/* Returns a character's adjustment to armor class -JWT- */
- Xint toac_adj()
- X{
- X register int stat;
- X
- X stat = py.stats.use_stat[A_DEX];
- X if (stat < 4) return(-4);
- X else if (stat == 4) return(-3);
- X else if (stat == 5) return(-2);
- X else if (stat == 6) return(-1);
- X else if (stat < 15) return( 0);
- X else if (stat < 18) return( 1);
- X else if (stat < 59) return( 2);
- X else if (stat < 94) return( 3);
- X else if (stat < 117) return( 4);
- X else return( 5);
- X}
- X
- X
- X/* Returns a character's adjustment to disarm -RAK- */
- Xint todis_adj()
- X{
- X register int stat;
- X
- X stat = py.stats.use_stat[A_DEX];
- X if (stat < 3) return(-8);
- X else if (stat == 4) return(-6);
- X else if (stat == 5) return(-4);
- X else if (stat == 6) return(-2);
- X else if (stat == 7) return(-1);
- X else if (stat < 13) return( 0);
- X else if (stat < 16) return( 1);
- X else if (stat < 18) return( 2);
- X else if (stat < 59) return( 4);
- X else if (stat < 94) return( 5);
- X else if (stat < 117) return( 6);
- X else return( 8);
- X}
- X
- X
- X/* Returns a character's adjustment to damage -JWT- */
- Xint todam_adj()
- X{
- X register int stat;
- X
- X stat = py.stats.use_stat[A_STR];
- X if (stat < 4) return(-2);
- X else if (stat < 5) return(-1);
- X else if (stat < 16) return( 0);
- X else if (stat < 17) return( 1);
- X else if (stat < 18) return( 2);
- X else if (stat < 94) return( 3);
- X else if (stat < 109) return( 4);
- X else if (stat < 117) return( 5);
- X else return( 6);
- X}
- X
- X
- X/* Prints character-screen info -RAK- */
- Xvoid prt_stat_block()
- X{
- X register int32u status;
- X register struct misc *m_ptr;
- X register int i;
- X
- X m_ptr = &py.misc;
- X prt_field(race[py.misc.prace].trace, 2, STAT_COLUMN);
- X prt_field(class[py.misc.pclass].title, 3, STAT_COLUMN);
- X prt_field(title_string(), 4, STAT_COLUMN);
- X for (i = 0; i < 6; i++)
- X prt_stat (i);
- X prt_num ("LEV ", (int)m_ptr->lev, 13, STAT_COLUMN);
- X prt_lnum("EXP ", m_ptr->exp, 14, STAT_COLUMN);
- X prt_num ("MANA", m_ptr->cmana, 15, STAT_COLUMN);
- X prt_num ("MHP ", m_ptr->mhp, 16, STAT_COLUMN);
- X prt_num ("CHP ", m_ptr->chp, 17, STAT_COLUMN);
- X prt_num ("AC ", m_ptr->dis_ac, 19, STAT_COLUMN);
- X prt_lnum("GOLD", m_ptr->au, 20, STAT_COLUMN);
- X prt_winner();
- X status = py.flags.status;
- X if ((PY_HUNGRY|PY_WEAK) & status)
- X prt_hunger();
- X if (PY_BLIND & status)
- X prt_blind();
- X if (PY_CONFUSED & status)
- X prt_confused();
- X if (PY_FEAR & status)
- X prt_afraid();
- X if (PY_POISONED & status)
- X prt_poisoned();
- X if ((PY_SEARCH|PY_REST) & status)
- X prt_state ();
- X /* if speed non zero, print it, modify speed if Searching */
- X if (py.flags.speed - ((PY_SEARCH & status) >> 8) != 0)
- X prt_speed ();
- X /* display the study field */
- X prt_study();
- X}
- X
- X
- X/* Draws entire screen -RAK- */
- Xvoid draw_cave()
- X{
- X clear_screen ();
- X prt_stat_block();
- X prt_map();
- X prt_depth();
- X}
- X
- X
- X/* Prints the following information on the screen. -JWT- */
- Xvoid put_character()
- X{
- X register struct misc *m_ptr;
- X
- X m_ptr = &py.misc;
- X clear_screen ();
- X put_buffer ("Name :", 2, 1);
- X put_buffer ("Race :", 3, 1);
- X put_buffer ("Sex :", 4, 1);
- X put_buffer ("Class :", 5, 1);
- X if (character_generated)
- X {
- X put_buffer (m_ptr->name, 2, 15);
- X put_buffer (race[m_ptr->prace].trace, 3, 15);
- X put_buffer ((m_ptr->male ? "Male" : "Female"), 4, 15);
- X put_buffer (class[m_ptr->pclass].title, 5, 15);
- X }
- X}
- X
- X
- X/* Prints the following information on the screen. -JWT- */
- Xvoid put_stats()
- X{
- X register struct misc *m_ptr;
- X register int i;
- X vtype buf;
- X
- X m_ptr = &py.misc;
- X for (i = 0; i < 6; i++)
- X {
- X cnv_stat (py.stats.use_stat[i], buf);
- X put_buffer (stat_names[i], 2+i, 61);
- X put_buffer (buf, 2+i, 66);
- X if (py.stats.max_stat[i] > py.stats.cur_stat[i])
- X {
- X cnv_stat (py.stats.max_stat[i], buf);
- X put_buffer (buf, 2+i, 73);
- X }
- X }
- X prt_num("+ To Hit ", m_ptr->dis_th, 9, 1);
- X prt_num("+ To Damage ", m_ptr->dis_td, 10, 1);
- X prt_num("+ To AC ", m_ptr->dis_tac, 11, 1);
- X prt_num(" Total AC ", m_ptr->dis_ac, 12, 1);
- X}
- X
- X
- X/* Returns a rating of x depending on y -JWT- */
- Xchar *likert(x, y)
- Xint x, y;
- X{
- X switch((x/y))
- X {
- X case -3: case -2: case -1: return("Very Bad");
- X case 0: case 1: return("Bad");
- X case 2: return("Poor");
- X case 3: case 4: return("Fair");
- X case 5: return("Good");
- X case 6: return("Very Good");
- X case 7: case 8: return("Excellent");
- X default: return("Superb");
- X }
- X}
- X
- X
- X/* Prints age, height, weight, and SC -JWT- */
- Xvoid put_misc1()
- X{
- X register struct misc *m_ptr;
- X
- X m_ptr = &py.misc;
- X prt_num("Age ", (int)m_ptr->age, 2, 38);
- X prt_num("Height ", (int)m_ptr->ht, 3, 38);
- X prt_num("Weight ", (int)m_ptr->wt, 4, 38);
- X prt_num("Social Class ", (int)m_ptr->sc, 5, 38);
- X}
- X
- X
- X/* Prints the following information on the screen. -JWT- */
- Xvoid put_misc2()
- X{
- X register struct misc *m_ptr;
- X
- X m_ptr = &py.misc;
- X prt_num("Level ", (int)m_ptr->lev, 9, 29);
- X prt_lnum("Experience ", m_ptr->exp, 10, 29);
- X prt_lnum("Max Exp ", m_ptr->max_exp, 11, 29);
- X if (m_ptr->lev == MAX_PLAYER_LEVEL)
- X prt ("Exp to Adv.: ******", 12, 29);
- X else
- X prt_lnum("Exp to Adv.", (int32)(player_exp[m_ptr->lev-1]
- X * m_ptr->expfact / 100), 12, 29);
- X prt_lnum("Gold ", m_ptr->au, 13, 29);
- X prt_num("Max Hit Points ", m_ptr->mhp, 9, 52);
- X prt_num("Cur Hit Points ", m_ptr->chp, 10, 52);
- X prt_num("Max Mana ", m_ptr->mana, 11, 52);
- X prt_num("Cur Mana ", m_ptr->cmana, 12, 52);
- X}
- X
- X
- X/* Prints ratings on certain abilities -RAK- */
- Xvoid put_misc3()
- X{
- X int xbth, xbthb, xfos, xsrh, xstl, xdis, xsave, xdev;
- X vtype xinfra;
- X register struct misc *p_ptr;
- X
- X clear_from(14);
- X p_ptr = &py.misc;
- X xbth = p_ptr->bth + p_ptr->ptohit*BTH_PLUS_ADJ
- X + (class_level_adj[p_ptr->pclass][CLA_BTH] * p_ptr->lev);
- X xbthb = p_ptr->bthb + p_ptr->ptohit*BTH_PLUS_ADJ
- X + (class_level_adj[p_ptr->pclass][CLA_BTHB] * p_ptr->lev);
- X /* this results in a range from 0 to 29 */
- X xfos = 40 - p_ptr->fos;
- X if (xfos < 0) xfos = 0;
- X xsrh = p_ptr->srh;
- X /* this results in a range from 0 to 9 */
- X xstl = p_ptr->stl + 1;
- X xdis = p_ptr->disarm + 2*todis_adj() + stat_adj(A_INT)
- X + (class_level_adj[p_ptr->pclass][CLA_DISARM] * p_ptr->lev / 3);
- X xsave = p_ptr->save + stat_adj(A_WIS)
- X + (class_level_adj[p_ptr->pclass][CLA_SAVE] * p_ptr->lev / 3);
- X xdev = p_ptr->save + stat_adj(A_INT)
- X + (class_level_adj[p_ptr->pclass][CLA_DEVICE] * p_ptr->lev / 3);
- X
- X (void) sprintf(xinfra, "%d feet", py.flags.see_infra*10);
- X
- X put_buffer ("(Miscellaneous Abilities)", 15, 25);
- X put_buffer ("Fighting :", 16, 1);
- X put_buffer (likert (xbth, 12), 16, 15);
- X put_buffer ("Bows/Throw :", 17, 1);
- X put_buffer (likert (xbthb, 12), 17, 15);
- X put_buffer ("Saving Throw:", 18, 1);
- X put_buffer (likert (xsave, 6), 18, 15);
- X
- X put_buffer ("Stealth :", 16, 28);
- X put_buffer (likert (xstl, 1), 16, 42);
- X put_buffer ("Disarming :", 17, 28);
- X put_buffer (likert (xdis, 8), 17, 42);
- X put_buffer ("Magic Device:", 18, 28);
- X put_buffer (likert (xdev, 6), 18, 42);
- X
- X put_buffer ("Perception :", 16, 55);
- X put_buffer (likert (xfos, 3), 16, 69);
- X put_buffer ("Searching :", 17, 55);
- X put_buffer (likert (xsrh, 6), 17, 69);
- X put_buffer ("Infra-Vision:", 18, 55);
- X put_buffer (xinfra, 18, 69);
- X}
- X
- X
- X/* Used to display the character on the screen. -RAK- */
- Xvoid display_char()
- X{
- X put_character();
- X put_misc1();
- X put_stats();
- X put_misc2();
- X put_misc3();
- X}
- X
- X
- X/* Gets a name for the character -JWT- */
- Xvoid get_name()
- X{
- X prt("Enter your player's name [press <RETURN> when finished]", 21, 2);
- X put_buffer (&blank_string[BLANK_LENGTH-23], 2, 15);
- X#if defined(MAC) || defined(AMIGA)
- X /* Force player to give a name, would be nice to get name from chooser
- X (STR -16096), but that name might be too long */
- X while (!get_string(py.misc.name, 2, 15, 23) || py.misc.name[0] == 0);
- X#else
- X if (!get_string(py.misc.name, 2, 15, 23) || py.misc.name[0] == 0)
- X {
- X user_name (py.misc.name);
- X put_buffer (py.misc.name, 2, 15);
- X }
- X#endif
- X clear_from (20);
- X#ifdef MAC
- X /* Use the new name to set save file default name. */
- X initsavedefaults();
- X#endif
- X}
- X
- X
- X/* Changes the name of the character -JWT- */
- Xvoid change_name()
- X{
- X register char c;
- X register int flag;
- X#ifndef MAC
- X vtype temp;
- X#endif
- X
- X flag = FALSE;
- X display_char();
- X do
- X {
- X prt( "<f>ile character description. <c>hange character name.", 21, 2);
- X c = inkey();
- X switch(c)
- X {
- X case 'c':
- X get_name();
- X flag = TRUE;
- X break;
- X case 'f':
- X#ifdef MAC
- X /* On mac, file_character() gets filename with std file dialog. */
- X if (file_character ())
- X flag = TRUE;
- X#else
- X prt ("File name:", 0, 0);
- X if (get_string (temp, 0, 10, 60) && temp[0])
- X if (file_character (temp))
- X flag = TRUE;
- X#endif
- X break;
- X case ESCAPE: case ' ':
- X case '\n': case '\r':
- X flag = TRUE;
- X break;
- X default:
- X bell ();
- X break;
- X }
- X }
- X while (!flag);
- X}
- X
- X
- X/* Destroy an item in the inventory -RAK- */
- Xvoid inven_destroy(item_val)
- Xint item_val;
- X{
- X register int j;
- X register inven_type *i_ptr;
- X#ifdef ATARIST_MWC
- X int32u holder;
- X#endif
- X
- X i_ptr = &inventory[item_val];
- X if ((i_ptr->number > 1) && (i_ptr->subval <= ITEM_SINGLE_STACK_MAX))
- X {
- X i_ptr->number--;
- X inven_weight -= i_ptr->weight;
- X }
- X else
- X {
- X inven_weight -= i_ptr->weight*i_ptr->number;
- X for (j = item_val; j < inven_ctr-1; j++)
- X inventory[j] = inventory[j+1];
- X invcopy(&inventory[inven_ctr-1], OBJ_NOTHING);
- X inven_ctr--;
- X }
- X#ifdef ATARIST_MWC
- X py.flags.status |= (holder = PY_STR_WGT);
- X#else
- X py.flags.status |= PY_STR_WGT;
- X#endif
- X}
- X
- X
- X/* Copies the object in the second argument over the first argument.
- X However, the second always gets a number of one except for ammo etc. */
- Xvoid take_one_item (s_ptr, i_ptr)
- Xregister inven_type *s_ptr, *i_ptr;
- X{
- X *s_ptr = *i_ptr;
- X if ((s_ptr->number > 1) && (s_ptr->subval >= ITEM_SINGLE_STACK_MIN)
- X && (s_ptr->subval <= ITEM_SINGLE_STACK_MAX))
- X s_ptr->number = 1;
- X}
- X
- X
- X/* Drops an item from inventory to given location -RAK- */
- Xvoid inven_drop(item_val, drop_all)
- Xregister int item_val, drop_all;
- X{
- X int i;
- X register inven_type *i_ptr;
- X vtype prt2;
- X bigvtype prt1;
- X#ifdef ATARIST_MWC
- X int32u holder;
- X#endif
- X
- X if (cave[char_row][char_col].tptr != 0)
- X (void) delete_object(char_row, char_col);
- X i = popt ();
- X i_ptr = &inventory[item_val];
- X t_list[i] = *i_ptr;
- X cave[char_row][char_col].tptr = i;
- X
- X if (item_val >= INVEN_WIELD)
- X takeoff (item_val, -1);
- X else
- X {
- X if (drop_all || i_ptr->number == 1)
- X {
- X inven_weight -= i_ptr->weight*i_ptr->number;
- X inven_ctr--;
- X while (item_val < inven_ctr)
- X {
- X inventory[item_val] = inventory[item_val+1];
- X item_val++;
- X }
- X invcopy(&inventory[inven_ctr], OBJ_NOTHING);
- X }
- X else
- X {
- X t_list[i].number = 1;
- X inven_weight -= i_ptr->weight;
- X i_ptr->number--;
- X }
- X objdes (prt1, &t_list[i], TRUE);
- X (void) sprintf (prt2, "Dropped %s", prt1);
- X msg_print (prt2);
- X }
- X#ifdef ATARIST_MWC
- X py.flags.status |= (holder = PY_STR_WGT);
- X#else
- X py.flags.status |= PY_STR_WGT;
- X#endif
- X}
- X
- X
- X/* Destroys a type of item on a given percent chance -RAK- */
- Xint inven_damage(typ, perc)
- Xint (*typ)();
- Xregister int perc;
- X{
- X register int i, j;
- X
- X j = 0;
- X for (i = 0; i < inven_ctr; i++)
- X if ((*typ)(&inventory[i]) && (randint(100) < perc))
- X {
- X inven_destroy(i);
- X j++;
- X }
- X return(j);
- X}
- X
- X
- X/* Computes current weight limit -RAK- */
- Xint weight_limit()
- X{
- END_OF_FILE
- if test 29086 -ne `wc -c <'source/misc3.c.1'`; then
- echo shar: \"'source/misc3.c.1'\" unpacked with wrong size!
- fi
- # end of 'source/misc3.c.1'
- fi
- echo shar: End of archive 24 \(of 39\).
- cp /dev/null ark24isdone
- 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 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 39 archives.
- echo "Now run "bldfiles.sh" to build split files"
- 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
-