home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / games / volume14 / umoria4 / part24 < prev    next >
Internet Message Format  |  1992-08-31  |  59KB

  1. Path: uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v14i056:  umoria4 - single player dungeon simulation (ver. 5.5), Part24/39
  5. Message-ID: <3420@master.CNA.TEK.COM>
  6. Date: 22 Aug 92 22:13:00 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 2008
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: grabiner@math.harvard.edu (David Grabiner)
  12. Posting-number: Volume 14, Issue 56
  13. Archive-name: umoria4/Part24
  14. Supersedes: umoria3: Volume 9, Issue 55-97; Volume 10, Issue 15-17
  15. Environment: Curses, Unix, Mac, MS-DOS, Atari-ST, Amiga, VMS
  16.  
  17.  
  18.  
  19. #! /bin/sh
  20. # This is a shell archive.  Remove anything before this line, then unpack
  21. # it by saving it into a file and typing "sh file".  To overwrite existing
  22. # files, type "sh file -c".  You can also feed this as standard input via
  23. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  24. # will see the following message at the end:
  25. #        "End of archive 24 (of 39)."
  26. # Contents:  doc/moria1.ms.1 source/misc3.c.1
  27. # Wrapped by billr@saab on Thu Aug 20 09:11:32 1992
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'doc/moria1.ms.1' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'doc/moria1.ms.1'\"
  31. else
  32. echo shar: Extracting \"'doc/moria1.ms.1'\" \(25261 characters\)
  33. sed "s/^X//" >'doc/moria1.ms.1' <<'END_OF_FILE'
  34. X\"This is a very modified version of the documentation
  35. X\"for the original VMS game.  Changes were made to reflect differences
  36. X\"found in the UNIX port by James E. Wilson.
  37. X\"
  38. X\" "tbl moria1.ms moria2.ms | nroff -ms"
  39. X\"
  40. X\" You might wanna change these two values:
  41. X.RP
  42. X.nr PO 1i
  43. X.nr LL 6.5i
  44. X.ds LH "The Dungeons of Moria
  45. X.ds CH "
  46. X.ds RH "Page %
  47. X.ds LF "
  48. X.ds CF "
  49. X.ds RF "
  50. X.TL
  51. XThe Dungeons of Moria
  52. X.AU
  53. XRobert Alan Koeneke
  54. XJames E. Wilson
  55. X.AB no
  56. XMoria may be copied and modified freely, but may not be sold or
  57. Xmarketed IN ANY FORM without the permission and written consent
  58. Xof the authors Robert Alan Koeneke and James E. Wilson.
  59. XWe retain all copyrights to
  60. Xthis program, in either the original or modified forms, and no
  61. Xviolation, deletion, or change of the copyright notice is
  62. Xallowed.  Furthermore, we will have no liability or responsibility
  63. Xto any user with respect to loss or damage caused directly or
  64. Xindirectly by this program.
  65. X.AE
  66. X
  67. X.NH 1
  68. XIntroduction
  69. X.LP
  70. XThe game of \fImoria\fP is a single player dungeon simulation.
  71. XA player may choose from a number of races and classes when
  72. Xcreating a character, and then `run' that character over a
  73. Xperiod of days, weeks, even months, attempting to win the game by
  74. Xdefeating the Balrog which lurks in the deeper levels.
  75. X.LP
  76. XThe player will begin his adventure on the town level where
  77. Xhe may acquire supplies, weapons, armor, and magical devices by
  78. Xbartering with various shop owners.
  79. XAfter preparing for his adventure, the player can descend into the
  80. Xdungeons of \fImoria\fP where fantastic adventures await his coming!
  81. X.LP
  82. XBefore beginning your first adventure, you should read this
  83. Xdocument carefully.
  84. XThe game of \fImoria\fP is a complicated game, and
  85. Xwill require a dedicated player to win.
  86. X
  87. X.NH 1
  88. XThe Character
  89. X.LP
  90. XAll characters have six main attributes which modify their basic abilities.
  91. XThese six attributes, called \fIstats\fP, are
  92. X\fIstrength\fP, \fIintelligence\fP, \fIwisdom\fP, \fIdexterity\fP,
  93. X\fIconstitution\fP, and \fIcharisma\fP.
  94. XStats may vary from a minimum of 3 to a maximum of 18.  At the highest level,
  95. Xstats are further qualified by a number from zero to one hundred, so that
  96. Xthe highest value is actually 18/100.  A value of 18/100 can be thought
  97. Xof as equivalent to 19, and 18/00 (not actually used) is equivalent to 18.
  98. XBecause adventurers of interest tend to be better than
  99. Xaverage characters, \fImoria\fP stats will average about 13, and are
  100. Xfurther adjusted by race and class.
  101. XSome races are just naturally better at being certain classes, as will be
  102. Xshown later.
  103. X.LP
  104. XIn addition to the more visible stats, each character has certain abilities
  105. Xwhich are mainly determined by his race, class, and level, but are
  106. Xalso modified by his stats.
  107. XThe abilities are \fIfighting\fP, \fIthrowing/bows\fP, \fIsaving throw\fP,
  108. X\fIstealth\fP, \fIdisarming\fP, \fImagical devices\fP, \fIperception\fP,
  109. X\fIsearching\fP, and \fIinfravision\fP.
  110. X.LP
  111. XCharacters will be assigned an early history, with money and a social class
  112. Xbased on that history.
  113. XStarting money is assigned based on history, charisma, and somewhat upon the
  114. Xaverage of a character's stats.
  115. XA character with below average stats will receive extra money to help
  116. Xhim survive the first adventure.
  117. X.LP
  118. XEach character will also have physical attributes such as
  119. Xrace, height, weight, sex, and a physical description.
  120. XNone of
  121. Xthese, except weight, play any part in the game other than to
  122. Xgive the player a \*Qfeeling\*U for his character.
  123. XWeight is used for computing carrying capacity and also for bashing.
  124. X.LP
  125. XFinally, each character is assigned \fIhit points\fP based on their race,
  126. Xclass, and constitution.
  127. XSpell casters will also receive \fImana\fP which is expended when casting
  128. Xspells.
  129. XMana is based on Wisdom for Priests and Intelligence for Mages.
  130. X
  131. X.NH 2
  132. XCharacter Stats
  133. X.IP "Strength"
  134. XStrength is important in fighting with weapons and hand to hand combat.
  135. XA high strength can improve your chances of hitting, and the amount of
  136. Xdamage done with each hit.
  137. XCharacters with low strengths may receive penalties.
  138. XStrength is also useful in tunneling, body and shield bashing, and in
  139. Xcarrying heavy items.
  140. X.IP "Intelligence"
  141. XIntelligence is the prime stat of a mage, or magician.
  142. XA high intelligence increases a mage's chances of learning spells, and
  143. Xit also increases the amount of mana a mage has.
  144. XNo spell may be learned by mages with intelligences under 8.
  145. XIntelligence also modifies a character's chance of disarming traps,
  146. Xpicking locks, and using magic devices.
  147. X.IP "Wisdom  "
  148. XWisdom is the prime stat of a priest.
  149. XA high wisdom increases the chance of receiving new spells from a priest's
  150. Xdeity, and it also increases the amount of mana a priest has.
  151. XNo spell may be learned by priests with wisdom under 8.
  152. XWisdom also modifies a character's chance of resisting magical spells
  153. Xcast upon his person.
  154. X.IP "Dexterity"
  155. XDexterity is a combination of agility and quickness.
  156. XA high dexterity may allow a character to get multiple blows with lighter
  157. Xweapons, thus greatly increasing his kill power, and may increase his
  158. Xchances of hitting with any weapon and dodging blows from enemies.
  159. XDexterity is also useful in picking locks, disarming traps, and
  160. Xprotecting yourself from pick pockets.
  161. X.IP "Constitution"
  162. XConstitution is a character's ability to resist damage to his body, and to
  163. Xrecover from damage received.
  164. XTherefore a character with a high constitution will receive more hit points,
  165. Xand be more resistant to poisons.
  166. X.IP "Charisma"
  167. XCharisma represents a character's personality, as well as physical looks.
  168. XA character with a high charisma will receive better prices from store
  169. Xowners, whereas a character with a very low charisma will be robbed blind.
  170. XA high charisma will also mean more starting money for the character.
  171. X
  172. X.NH 2
  173. XCharacter Sex
  174. X.LP
  175. XYou may choose to be either a male or a female character.
  176. XOnly height and weight are affected by a character's sex.
  177. XFemale characters tend to be somewhat smaller and lighter than their
  178. Xmale counterparts.
  179. XNo adjustments to stats or abilities are made because of the sex of
  180. Xa character.  Female characters start out with slightly more money than
  181. Xmale characters to help offset the weight penalty.
  182. X
  183. X.NH 2
  184. XCharacter Abilities
  185. X.LP
  186. XCharacters possess nine different abilities which can help
  187. Xthem to survive.  The starting abilities of a character are based
  188. Xupon race and class.  Abilities may be adjusted by high or low
  189. Xstats, and may increase with the level of the character.
  190. X.IP "Fighting"
  191. XFighting is the ability to hit and do damage with weapons or
  192. Xfists.  Normally a character gets a single blow from any weapon,
  193. Xbut if his dexterity and strength are high enough, he may receive
  194. Xmore blows per round with lighter weapons.  Strength and
  195. Xdexterity both modify the ability to hit an opponent.
  196. XThis skill increases with the level of the character.
  197. X.IP "Throwing/Bows"
  198. XUsing ranged missile weapons and throwing objects is
  199. Xincluded in this skill.  Different stats apply to different
  200. Xweapons, but this ability may modify the distance an object is thrown/fired,
  201. Xthe amount of damage done, and the ability to hit a creature.
  202. XThis skill increases with the level of the character.
  203. X.IP "Saving Throw"
  204. XA Saving Throw is the ability of a character to resist the
  205. Xeffects of a spell cast on him by another person/creature.
  206. XThis does not include spells cast on the player by his own
  207. Xstupidity, such as quaffing a nasty potion.  This ability
  208. Xincreases with the level of the character, but then most high
  209. Xlevel creatures are better at casting spells, so it tends to even
  210. Xout.  A high wisdom also increases this ability.
  211. X.IP "Stealth  "
  212. XThe ability to move silently about is very useful.
  213. XCharacters with good stealth can usually surprise their
  214. Xopponents, gaining the first blow.  Also, creatures may fail to
  215. Xnotice a stealthy character entirely, allowing a player to avoid
  216. Xcertain fights.  This skill is based entirely upon race
  217. Xand class, and will never improve unless magically enhanced.
  218. X.IP "Disarming"
  219. XDisarming is the ability to remove traps (safely), and
  220. Xincludes picking locks on traps and doors.
  221. XA successful disarming will gain the character some experience.
  222. XA trap must be found before it can be disarmed.
  223. XDexterity and intelligence both modify the ability to disarm, and
  224. Xthis ability increases with the level of the character.
  225. X.IP "Using Magical Devices"
  226. XUsing a magical device such as a wand or staff requires
  227. Xexperience and knowledge.  Spell users such as mages and priests
  228. Xare therefore much better at using a magical device than say a
  229. Xwarrior.  This skill is modified by intelligence, and increases
  230. Xwith the level of the character.
  231. X.IP "Perception"
  232. XPerception is the ability to notice something without
  233. Xactively seeking it out.  This skill is based entirely upon race
  234. Xand class, and will never improve unless magically enhanced.
  235. X.IP "Searching"
  236. XTo search is to actively look for secret doors, floor traps,
  237. Xand traps on chests.  Rogues are the best at searching, but
  238. Xmages, rangers, and priests are also good at it.
  239. XThis skill is based entirely upon race
  240. Xand class, and will never improve unless magically enhanced.
  241. X.IP "Infravision"
  242. XInfravision is the ability to see heat sources.  Since most
  243. Xof the dungeon is cool or cold, infravision will not allow the
  244. Xplayer to see walls and objects.  Infravision will allow a
  245. Xcharacter to see any warm-blooded creatures up to a certain
  246. Xdistance.  This ability works equally well with or with out a
  247. Xlight source.  The majority of \fImoria\fP's creatures are
  248. Xcold-blooded, and will not be detected unless lit up by a light
  249. Xsource.  All non human races have innate infravision ability.
  250. XHuman can gain infravision only if it is magically enhanced.
  251. X
  252. X.NH 2
  253. XChoosing A Race
  254. X.LP
  255. XThere are eight different races that you can choose from in
  256. X\fImoria\fP.  Some races are restricted as to what profession they may
  257. Xbe, and each race has its own adjustments to a character's stats
  258. Xand abilities.
  259. X.IP "Human  "
  260. XThe human is the base character, all other races are
  261. Xcompared to him.  Humans can choose any class, and are average
  262. Xat everything.  Humans tend to go up levels faster than any other
  263. Xrace, because of their shorter life spans.  No racial adjustments
  264. Xoccur to characters choosing human.
  265. X.IP "Half-Elf"
  266. XHalf-elves tend to be smarter and faster than a human, but
  267. Xnot as strong.  Half-elves are slightly better at searching,
  268. Xdisarming, perception, stealth, and magic, but they are not as
  269. Xgood at hand weapons.  Half-elves may choose any class.
  270. X.IP "Elf       "
  271. XElves are better magicians then humans, but not as good at
  272. Xfighting.  They tend to be smarter and faster than either humans
  273. Xor half-elves, and also have better wisdom.  Elves are better at
  274. Xsearching, disarming, perception, stealth, and magic, but they
  275. Xare not as good at hand weapons.  Elves may choose any class
  276. Xexcept Paladin.
  277. X.IP "Halfling"
  278. XHalflings, or Hobbits, are very good at bows, throwing, and
  279. Xhave good saving throws.  They also are very good at searching,
  280. Xdisarming, perception, and stealth; so they make excellent
  281. Xthieves (but prefer to be called burglars...).  They will be much
  282. Xweaker than humans, and no good at bashing.  Halflings have fair
  283. Xinfravision, so they can detect warm creatures at a distance.
  284. XHalflings can choose between being a warrior, mage, or rogue.
  285. X.IP "Gnome   "
  286. XGnomes are smaller than dwarfs, but larger than halflings.
  287. XThey, like the halflings, live in the earth in burrow-like homes.
  288. XGnomes are practical jokers, so if they can kill something in a
  289. Xhumorous way, so much the better.  Gnomes make excellent mages,
  290. Xand have very good saving throws.  They are good at searching,
  291. Xdisarming, perception, and stealth.  They have lower strength
  292. Xthan humans so they are not very good at
  293. Xfighting with hand weapons.  Gnomes have fair infravision, so
  294. Xthey can detect warm creatures at a distance.  A gnome may choose
  295. Xbetween being a warrior, mage, priest, or rogue.
  296. X.IP "Dwarf  "
  297. XDwarves are the headstrong miners and fighters of legend.
  298. XSince dungeons are the natural home of a dwarf, they are
  299. Xexcellent choices for a warrior or priest.  Dwarves tend to be
  300. Xstronger and have higher constitutions, but are slower and less
  301. Xintelligent than humans.  Because they are so headstrong and are
  302. Xsomewhat wise, they resist spells which are cast on them.
  303. XDwarves also have good infravision because they live
  304. Xunderground.  They do have one big drawback though.  Dwarves are
  305. Xloudmouthed and proud, singing in loud voices, arguing with
  306. Xthemselves for no good reason, screaming out challenges at
  307. Ximagined foes.  In other words, dwarves have a miserable stealth.
  308. X.IP "Half-Orc"
  309. XHalf-Orcs make excellent warriors, and decent priests, but
  310. Xare terrible at magic.  They are as bad as dwarves at stealth,
  311. Xand horrible at searching, disarming, and perception.  Half-Orcs
  312. Xare, let's face it, ugly.  They tend to pay more for goods in
  313. Xtown.  Half-Orcs do make good priests and rogues, for the simple
  314. Xreason that Half-Orcs tend to have great constitutions and lots
  315. Xof hit points.
  316. X.IP "Half-Troll"
  317. XHalf-Trolls are incredibly strong, and have the highest hit
  318. Xpoints of any character race.  They are also very stupid and
  319. Xslow.  They will make great warriors and iffy priests.  They are
  320. Xbad at searching, disarming, perception, and stealth.  They are
  321. Xso ugly that a Half-Orc grimaces in their presence.  They also
  322. Xhappen to be fun to run...
  323. X
  324. X.NH 3
  325. XRace Versus Skills and Stats
  326. X.LP
  327. XStat, hit dice, and experience points per level modifications due
  328. Xto race are listed in the following table.
  329. X.KS
  330. X.TS
  331. Xtab(^) center;
  332. Xl 2 n 2 n 2 n 2 n 2 n 2 n 2 n 2 n.
  333. X^Str^Int^Wis^Dex^Con^Chr^Hit Dice^Rqd Exp/level
  334. X.sp
  335. XHuman^0^0^0^0^0^0^10^+0%
  336. XHalf-Elf^\-1^+1^0^+1^\-1^+1^9^+10%
  337. XElf^\-1^+2^+1^+1^\-2^+1^8^+20%
  338. XHalfling^\-2^+2^+1^+3^+1^+1^6^+10%
  339. XGnome^\-1^+2^0^+2^+1^\-2^7^+25%
  340. XDwarf^+2^\-3^+1^\-2^+2^\-3^9^+20%
  341. XHalf-Orc^+2^\-1^0^0^+1^\-4^10^+10%
  342. XHalf-Troll^+4^\-4^\-2^\-4^+3^\-6^12^+20%
  343. X.TE
  344. X.KE
  345. XRacial abilities as compared to each other, with
  346. X1 the lowest, or worst, and 10 the highest, or best,
  347. Xare listed in the following table.
  348. X.KS
  349. X.TS
  350. Xtab(^) center;
  351. Xl 1 n 1 n 1 n 1 n 1 n 1 n 1 n 1 l.
  352. X^Disarm^Search^Stealth^Percep^Fight^Bows^Save^Infra
  353. X.sp
  354. XHuman^5^5^5^5^5^5^5^None
  355. XHalf-Elf^6^7^7^6^4^6^6^20 feet
  356. XElf^8^9^7^7^3^9^7^30 feet
  357. XHalfling^10^10^10^10^1^10^10^40 feet
  358. XGnome^9^7^9^9^2^8^9^30 feet
  359. XDwarf^6^8^3^5^9^5^8^50 feet
  360. XHalf-Orc^3^5^3^2^8^3^3^30 feet
  361. XHalf-Troll^1^1^1^1^10^1^1^30 feet
  362. X.TE
  363. X.KE
  364. X
  365. X.NH 2
  366. XChoosing A Class
  367. X.LP
  368. XOnce a race has been chosen, you will need to pick a class.
  369. XSome classes will not be available to certain races, for instance,
  370. Xa Half-Troll cannot become a Paladin.  For the first few
  371. Xadventures it is suggested that you run a warrior or rogue.
  372. XSpell casting generally requires a more experienced player that
  373. Xis familiar with survival techniques.
  374. X.IP "Warrior"
  375. XA Warrior is a hack-and-slash character, who solves most of
  376. Xhis problems by cutting them to pieces, but will occasionally
  377. Xfall back on the help of a magical device.  His prime stats are
  378. XStrength and Constitution, and a good Dexterity can really help
  379. Xat times.  A Warrior will be good at Fighting and Throwing/Bows,
  380. Xbut bad at most other skills.
  381. X.IP "Mage    "
  382. XA Mage must live by his wits.  He cannot hope to simply hack
  383. Xhis way through the dungeon, and so must therefore use his magic
  384. Xto defeat, deceive, confuse, and escape.  A mage is not
  385. Xreally complete without an assortment of magical devices to use in
  386. Xaddition to his spells.  He can master the higher level magical
  387. Xdevices far easier than anyone else, and has the best saving
  388. Xthrow to resist effects of spells cast at him.  Intelligence and
  389. XDexterity are his primary stats.  There is no rule that says a
  390. Xmage cannot become a good fighter, but spells are his true realm.
  391. X.IP "Priest    "
  392. XA Priest is a character of holy devotion.  They explore the
  393. Xdungeon only to destroy the evil that lurks within, and if
  394. Xtreasure just happens to fall into their packs, well, so much
  395. Xmore to the glory of their church!  Priests receive their spells
  396. Xfrom a deity, and therefore do not choose which spells they will
  397. Xlearn.  They are familiar with magical devices, preferring to call
  398. Xthem instruments of god, but are not as good as a mage in their
  399. Xuse.  Priests have good saving throws, and make decent fighters,
  400. Xpreferring blunt weapons over edged ones.  Wisdom and Charisma
  401. Xare the priest's primary stats.
  402. X.IP "Rogue   "
  403. XA Rogue is a character that prefers to live by his cunning,
  404. Xbut is capable of fighting his way out of a tight spot.  He is
  405. Xthe master of traps and locks, no device being impossible for him
  406. Xto overcome.  A rogue has a high stealth allowing him to sneak
  407. Xaround many creatures without having to fight, or sneak up and
  408. Xget the first blow.  A rogue's perception is higher than any
  409. Xother class, and many times he will notice a trap or secret door
  410. Xbefore having to search.  A rogue is better than warriors or
  411. Xpaladins with magical devices, but still can not rely on their
  412. Xperformance.  Rogues can also learn a few spells, but not the powerful
  413. Xoffensive spells mages can use.  A rogue's primary stats are
  414. XIntelligence and Dexterity.
  415. X.IP "Ranger  "
  416. XA Ranger is a warrior/mage.  He is a good fighter, and the
  417. Xbest of the classes with a missile weapon such as a bow.  The
  418. Xranger learns spells much more slowly than a mage, but is capable
  419. Xof learning all but the most powerful spell.  Because a ranger is
  420. Xreally a dual class character, more experience is required for him
  421. Xto advance.  A ranger has a good stealth, good perception, good
  422. Xsearching, a good saving throw, and is good with magical devices.
  423. XHis primary stats are Intelligence and Dexterity.
  424. X.IP "Paladin  "
  425. XA Paladin is a warrior/priest.  He is a very good fighter,
  426. Xsecond only to the warrior class, but not very good at missile
  427. Xweapons.  He receives prayers at a slower pace then the priest,
  428. Xand can receive all but the most powerful prayer.  Because a
  429. Xpaladin is really a dual class character, it requires more
  430. Xexperience to advance him.  A paladin lacks much in the way of
  431. Xabilities.  He is poor at stealth, perception, searching, and
  432. Xmagical devices.  He has a decent saving throw due to his divine
  433. Xalliance.  His primary stats are Strength and Charisma.
  434. X
  435. X.NH 3
  436. XRace Versus Class
  437. X.LP
  438. X.KS
  439. X.TS
  440. Xtab(^) center;
  441. Xl 2 ce 2 ce 2 ce 2 ce 2 ce 2 ce.
  442. X^Warrior^Mage^Priest^Rogue^Ranger^Paladin
  443. X.sp
  444. XHuman^Yes^Yes^Yes^Yes^Yes^Yes
  445. XHalf-Elf^Yes^Yes^Yes^Yes^Yes^Yes
  446. XElf^Yes^Yes^Yes^Yes^Yes^No
  447. XHalfling^Yes^Yes^No^Yes^No^No
  448. XGnome^Yes^Yes^Yes^Yes^No^No
  449. XDwarf^Yes^No^Yes^No^No^No
  450. XHalf-Orc^Yes^No^Yes^Yes^No^No
  451. XHalf-Troll^Yes^No^Yes^No^No^No
  452. X.TE
  453. X.KE
  454. X
  455. X.NH 3
  456. XClass Versus Skills
  457. X.LP
  458. XClass abilities as compared to each other, with
  459. X1 as the lowest, or worst, and 10 as the highest, or best
  460. Xare shown in the following table.
  461. X.KS
  462. X.TS
  463. Xtab(^) center;
  464. Xl 1 c 1 c 1 c 1 c 1 c 1 c 1 c 1 c 1 c
  465. Xl c c c c c c c c c
  466. Xl n n n n n n n n r.
  467. X^^^Save^Stea-^^Magic^^^Extra
  468. X^Fight^Bows^Throw^lth^Disarm^Device^Percep^Search^Exp/lev
  469. X.sp
  470. XWarrior^10^6^3^2^4^3^2^2^+0%
  471. XMage^2^1^10^5^6^10^8^5^+30%
  472. XPriest^4^3^6^5^3^8^4^4^+20%
  473. XRogue^8^9^7^10^10^6^10^10^+0%
  474. XRanger^6^10^8^7^6^7^6^6^+40%
  475. XPaladin^9^5^4^2^2^4^2^2^+35%
  476. X.TE
  477. X.KE
  478. X
  479. X.NH 1
  480. XAdventuring
  481. X.LP
  482. XAfter you have created your character, you will begin your
  483. X\fImoria\fP adventure.  Symbols appearing on your screen will represent
  484. Xthe dungeon's walls, floor, objects, features, and
  485. Xcreatures lurking about.  In order to direct your character
  486. Xthrough his adventure, you will enter single character commands.
  487. X.LP
  488. X\fIMoria\fP symbols and commands each have a help section devoted
  489. Xto them.  You should review these sections before attempting an
  490. Xadventure.  Finally, a description of the town level and some
  491. Xgeneral help on adventuring are included.
  492. X
  493. X.NH 1
  494. XSymbols On Your Map
  495. X.LP
  496. XSymbols on your map can be broken down into three
  497. Xcategories: Features of the dungeon such as walls, floor, doors,
  498. Xand traps; Objects which can be picked up such as treasure,
  499. Xweapons, magical devices, etc; and creatures which may or may not
  500. Xmove about the dungeon, but are mostly harmful to your
  501. Xcharacter's well being.
  502. X.LP
  503. XSome symbols can be in more than one category.
  504. XAlso note that treasure may be embedded in a wall, and the wall
  505. Xmust be removed before the treasure can be picked up.
  506. X.LP
  507. XIt will not be necessary to remember all of the symbols and
  508. Xtheir meanings.  A simple command, the `/', will identify any
  509. Xcharacter appearing on your map.  See the section on commands for
  510. Xfurther help.
  511. X.LP
  512. X.nf
  513. X.KS
  514. X.TS
  515. Xtab(*) center;
  516. Xc s s s
  517. Xl l l l.
  518. XFeatures
  519. X.sp
  520. X\&.*A floor space, or hidden trap*1*Entrance to General Store
  521. X#*A wall*2*Entrance to Armory
  522. X'*An open door*3*Entrance to Weapon Smith
  523. X+*A closed door*4*Entrance to Temple
  524. X^*A trap*5*Entrance to Alchemy Shop
  525. X<*A staircase up*6*Entrance to Magic Shop
  526. X>*A staircase down*:*Obstructing rubble
  527. X;*A loose floor stone*\ *An open pit (Blank)
  528. X%*A mineral vein*@*The character
  529. X.TE
  530. X.KE
  531. X.sp
  532. X.KS
  533. X.TS
  534. Xtab(^) center;
  535. Xc s s s
  536. Xl l l l.
  537. XObjects
  538. X.sp
  539. X!^A flask or potion^?^A scroll
  540. X"^An amulet^[^Hard armor
  541. X$^Money (Can be embedded)^\e^A hafted weapon
  542. X&^A chest^]^Misc. armor
  543. X(^Soft armor^\&_^A staff
  544. X)^A shield^{^Missile (arrow, bolt, pebble)
  545. X*^Gems (Can be embedded)^|^Sword or dagger
  546. X\-^A wand^}^Missile arm (Bow, X-bow, sling)
  547. X/^A pole-arm^~^Misc
  548. X\&=^A ring^,^Food
  549. Xs^A skeleton^^
  550. X.TE
  551. X.KE
  552. X.sp
  553. X.KS
  554. X.TS
  555. Xtab(^) center;
  556. Xc s s s
  557. Xl l l l.
  558. XCreatures
  559. X.sp
  560. Xa^Giant Ant^A^Giant Ant Lion
  561. Xb^Giant Bat^B^The Balrog
  562. Xc^Giant Centipede^C^Gelatinous Cube
  563. Xd^Dragon^D^Ancient Dragon
  564. Xe^Floating Eye^E^Elemental
  565. Xf^Giant Frog^F^Fly
  566. Xg^Golem^G^Ghost
  567. Xh^Harpy^H^Hobgoblin
  568. Xi^Icky-Thing^I^
  569. Xj^Jackal^J^Jelly
  570. Xk^Kobold^K^Killer Beetle
  571. Xl^Giant Louse^L^Lich
  572. Xm^Mold^M^Mummy
  573. Xn^Naga^N^
  574. Xo^Orc or Ogre^O^Ooze
  575. Xp^Human(oid)^P^Giant Human(oid)
  576. Xq^Quasit^Q^Quylthulg
  577. Xr^Rodent^R^Reptile
  578. Xs^Skeleton^S^Scorpion
  579. Xt^Giant Tick^T^Troll
  580. Xu^^U^Umber Hulk
  581. Xv^^V^Vampire
  582. Xw^Worm or Worm Mass^W^Wight or Wraith.
  583. Xx^^X^Xorn
  584. Xy^Yeek^Y^Yeti
  585. Xz^Zombie^Z^
  586. X$^Creeping Coins^,^Mushroom Patch
  587. X.TE
  588. X.KE
  589. X
  590. X.NH 1
  591. XCommands
  592. X.LP
  593. XAll commands are entered by pressing a single key.
  594. XSome commands are capital or control characters, which require
  595. Xyou to hold down the shift or control key while pressing another key.
  596. XAs a special feature, control keys may be entered in a single stroke,
  597. Xor in two strokes, with a `^' character first.
  598. X.LP
  599. XThere are two command sets: the original command set which is
  600. Xthe default, and the rogue like command set.  The rogue like command
  601. Xis generally more convenient, especially if you don't have a keypad.
  602. X.LP
  603. XThe following tables summarize the two command sets.
  604. XCertain commands may be preceded by an optional count, and certain
  605. Xcommands must be followed by a direction.  These conditions
  606. Xare indicated in the tables by `@' for an optional count,
  607. Xand `~' for a direction.  If a particular command requires additional
  608. Xkey strokes, then they will be prompted for.
  609. X.KS
  610. X.TS
  611. Xtab(^) center;
  612. Xc 1 s 1 s 1 s 1 s 1 s 1 s.
  613. XOriginal command summary.
  614. X.T&
  615. Xl l l l l l s.
  616. X^a^Aim and fire a wand^@^B ~^Bash (object/creature)
  617. X^b^Browse a book^^C^Change name
  618. X^c ~^Close a door^@^D ~^Disarm a trap/chest
  619. X^d^Drop an item^^E^Eat some food
  620. X^e^Equipment list^^F^Fill lamp with oil
  621. X^f^Fire/Throw an item^^G^Gain new magic spells
  622. X^i^Inventory list^^L^Locate with map
  623. X@^j ~^Jam a door with spike^^M^Map shown reduced size
  624. X^l ~^Look given direction^@^R^Rest for a period
  625. X^m^Magic spell casting^^S^Search Mode
  626. X@^o ~^Open a door/chest^@^T ~^Tunnel in a direction
  627. X^p^Pray^^V^View scoreboard
  628. X^q^Quaff a potion^^\&=^Set options
  629. X^r^Read a scroll^^?^Command quick reference
  630. X@^s^Search for trap or door^^{^Inscribe an object
  631. X^t^Take off an item^@^\- ~^Move without pickup
  632. X^u^Use a staff^^. ~^Run in direction
  633. X^v^Version, credits and manual^^/^Identify a character
  634. X^w^Wear/Wield an item^^CTRL-K^Quit the game
  635. X^x^Exchange weapon^@^CTRL-P^Repeat the last message
  636. X^<^Go up an up staircase^^CTRL-X^Save character and quit
  637. X^>^Go down a down staircase^@^~^for movement
  638. X.TE
  639. X.KE
  640. X.KS
  641. X.TS
  642. Xtab(^) center;
  643. Xc 1 s 1 s 1 s 1 s 1 s 1 s.
  644. XRogue like command summary.
  645. X.T&
  646. Xl l l l l l s.
  647. X^c ~^Close a door^^C^Character description
  648. X^d^Drop an item^@^D ~^Disarm a trap/chest
  649. X^e^Equipment list^^E^Eat some food
  650. X@^f ~^Force/bash item/monster^^F^Fill lamp with oil
  651. X^i^Inventory list^^G^Gain new magic spells
  652. X^m^magic spell casting^^M^Map shown reduced size
  653. X@^o ~^Open a door/chest^^P^Peruse a book
  654. X^p^Pray^^Q^Quit the game
  655. X^q^Quaff a potion^@^R^Rest for a period
  656. X^r^Read a scroll^@^S ~^Spike a door
  657. X@^s^Search for trap or door^^T^Take off an item
  658. X^t^Throw an item^^V^View scores
  659. X^v^Version, and manual^^W^Where: locate self
  660. X^w^Wear/Wield an item^^X^Exchange weapon
  661. X^x ~^Examine surroundings^^Z^Zap a staff
  662. X^z^Zap a wand^^#^Search Mode
  663. X^\&=^Set options^^<^Go up an up staircase
  664. X^/^Identify a character^^>^Go down a down stair
  665. X@^CTRL-P^Previous message review^^{^Inscribe an object
  666. X@^\- ~^Move without pickup^^?^Type this page
  667. X@^CTRL ~^Tunnel in a direction^^CTRL-X^Save game and exit
  668. X@^SHFT ~^Run in direction^@^~^for movement
  669. X.TE
  670. X.KE
  671. X
  672. X.NH 2
  673. XSpecial keys.
  674. X.LP
  675. XCertain commands may be entered at any time input is accepted.
  676. XThe special character control-R, entered as a single key stroke, will
  677. Xalways refresh the screen.  This may be used at any prompt for input,
  678. Xand is otherwise ignored.
  679. X.LP
  680. XIf you are playing on a UNIX or similar system, then there are some
  681. Xadditional special characters used by \fImoria\fP.
  682. XThe special character control-C will interrupt \fImoria\fP, and ask if you
  683. Xreally want to die and quit the game.
  684. END_OF_FILE
  685. if test 25261 -ne `wc -c <'doc/moria1.ms.1'`; then
  686.     echo shar: \"'doc/moria1.ms.1'\" unpacked with wrong size!
  687. fi
  688. # end of 'doc/moria1.ms.1'
  689. fi
  690. if test -f 'source/misc3.c.1' -a "${1}" != "-c" ; then 
  691.   echo shar: Will not clobber existing file \"'source/misc3.c.1'\"
  692. else
  693. echo shar: Extracting \"'source/misc3.c.1'\" \(29086 characters\)
  694. sed "s/^X//" >'source/misc3.c.1' <<'END_OF_FILE'
  695. X/* source/misc3.c: misc code for maintaining the dungeon, printing player info
  696. X
  697. X   Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke
  698. X
  699. X   This software may be copied and distributed for educational, research, and
  700. X   not for profit purposes provided that this copyright and statement are
  701. X   included in all such copies. */
  702. X
  703. X#ifdef __TURBOC__
  704. X#include    <stdio.h>
  705. X#endif
  706. X
  707. X#include "config.h"
  708. X#include "constant.h"
  709. X#include "types.h"
  710. X#include "externs.h"
  711. X
  712. X#include <ctype.h>
  713. X
  714. X#ifndef USG
  715. X#include <sys/types.h>
  716. X#include <sys/param.h>
  717. X#endif
  718. X
  719. X#ifdef USG
  720. X#ifndef ATARIST_MWC
  721. X#include <string.h>
  722. X#else
  723. Xchar *index();
  724. X#endif
  725. X#else
  726. X#include <strings.h>
  727. X#endif
  728. X
  729. X#if defined(LINT_ARGS)
  730. Xstatic void prt_lnum(char *, int32, int, int);
  731. Xstatic void prt_num(char *, int, int, int);
  732. Xstatic void prt_long(int32, int, int);
  733. Xstatic void prt_int(int, int, int);
  734. Xstatic void gain_level(void);
  735. X#endif
  736. X
  737. Xstatic char *stat_names[] = { "STR : ", "INT : ", "WIS : ",
  738. X                 "DEX : ", "CON : ", "CHR : " };
  739. X#define BLANK_LENGTH    24
  740. Xstatic char blank_string[] = "                        ";
  741. X
  742. X
  743. X/* Places a particular trap at location y, x        -RAK-    */
  744. Xvoid place_trap(y, x, subval)
  745. Xint y, x, subval;
  746. X{
  747. X  register int cur_pos;
  748. X
  749. X  cur_pos = popt();
  750. X  cave[y][x].tptr  = cur_pos;
  751. X  invcopy(&t_list[cur_pos], OBJ_TRAP_LIST + subval);
  752. X}
  753. X
  754. X
  755. X/* Places rubble at location y, x            -RAK-    */
  756. Xvoid place_rubble(y, x)
  757. Xint y, x;
  758. X{
  759. X  register int cur_pos;
  760. X  register cave_type *cave_ptr;
  761. X
  762. X  cur_pos = popt();
  763. X  cave_ptr = &cave[y][x];
  764. X  cave_ptr->tptr = cur_pos;
  765. X  cave_ptr->fval = BLOCKED_FLOOR;
  766. X  invcopy(&t_list[cur_pos], OBJ_RUBBLE);
  767. X}
  768. X
  769. X
  770. X/* Places a treasure (Gold or Gems) at given row, column -RAK-    */
  771. Xvoid place_gold(y, x)
  772. Xint y, x;
  773. X{
  774. X  register int i, cur_pos;
  775. X#ifdef M_XENIX
  776. X  /* Avoid 'register' bug.  */
  777. X  inven_type *t_ptr;
  778. X#else
  779. X  register inven_type *t_ptr;
  780. X#endif
  781. X
  782. X  cur_pos = popt();
  783. X  i = ((randint(dun_level+2)+2) / 2) - 1;
  784. X  if (randint(OBJ_GREAT) == 1)
  785. X    i += randint(dun_level+1);
  786. X  if (i >= MAX_GOLD)
  787. X    i = MAX_GOLD - 1;
  788. X  cave[y][x].tptr = cur_pos;
  789. X  invcopy(&t_list[cur_pos], OBJ_GOLD_LIST+i);
  790. X  t_ptr = &t_list[cur_pos];
  791. X  t_ptr->cost += (8L * (long)randint((int)t_ptr->cost)) + randint(8);
  792. X  if (cave[y][x].cptr == 1)
  793. X    msg_print ("You feel something roll beneath your feet.");
  794. X}
  795. X
  796. X
  797. X/* Returns the array number of a random object        -RAK-    */
  798. Xint get_obj_num(level)
  799. Xint level;
  800. X{
  801. X  register int i, j;
  802. X
  803. X  if (level == 0)
  804. X    i = randint(t_level[0]) - 1;
  805. X  else
  806. X    {
  807. X      if (level >= MAX_OBJ_LEVEL)
  808. X    level = MAX_OBJ_LEVEL;
  809. X      else if (randint(OBJ_GREAT) == 1)
  810. X    {
  811. X      level = level * MAX_OBJ_LEVEL / randint (MAX_OBJ_LEVEL) + 1;
  812. X      if (level > MAX_OBJ_LEVEL)
  813. X        level = MAX_OBJ_LEVEL;
  814. X    }
  815. X
  816. X      /* This code has been added to make it slightly more likely to get the
  817. X     higher level objects.    Originally a uniform distribution over all
  818. X     objects less than or equal to the dungeon level.  This distribution
  819. X     makes a level n objects occur approx 2/n% of the time on level n,
  820. X     and 1/2n are 0th level. */
  821. X
  822. X      if (randint(2) == 1)
  823. X    i = randint(t_level[level]) - 1;
  824. X      else /* Choose three objects, pick the highest level. */
  825. X    {
  826. X      i = randint(t_level[level]) - 1;
  827. X      j = randint(t_level[level]) - 1;
  828. X      if (i < j)
  829. X        i = j;
  830. X      j = randint(t_level[level]) - 1;
  831. X      if (i < j)
  832. X        i = j;
  833. X      j = object_list[sorted_objects[i]].level;
  834. X      if (j == 0)
  835. X        i = randint(t_level[0]) - 1;
  836. X      else
  837. X        i = randint(t_level[j]-t_level[j-1]) - 1 + t_level[j-1];
  838. X    }
  839. X    }
  840. X  return(i);
  841. X}
  842. X
  843. X
  844. X/* Places an object at given row, column co-ordinate    -RAK-    */
  845. Xvoid place_object(y, x)
  846. Xint y, x;
  847. X{
  848. X  register int cur_pos, tmp;
  849. X
  850. X  cur_pos = popt();
  851. X  cave[y][x].tptr = cur_pos;
  852. X  /* split this line up to avoid a reported compiler bug */
  853. X  tmp = get_obj_num(dun_level);
  854. X  invcopy(&t_list[cur_pos], sorted_objects[tmp]);
  855. X  magic_treasure(cur_pos, dun_level);
  856. X  if (cave[y][x].cptr == 1)
  857. X    msg_print ("You feel something roll beneath your feet.");    /* -CJS- */
  858. X}
  859. X
  860. X
  861. X/* Allocates an object for tunnels and rooms        -RAK-    */
  862. Xvoid alloc_object(alloc_set, typ, num)
  863. Xint (*alloc_set)();
  864. Xint typ, num;
  865. X{
  866. X  register int i, j, k;
  867. X
  868. X  for (k = 0; k < num; k++)
  869. X    {
  870. X      do
  871. X    {
  872. X      i = randint(cur_height) - 1;
  873. X      j = randint(cur_width) - 1;
  874. X    }
  875. X      /* don't put an object beneath the player, this could cause problems
  876. X     if player is standing under rubble, or on a trap */
  877. X      while ((!(*alloc_set)(cave[i][j].fval)) ||
  878. X         (cave[i][j].tptr != 0) || (i == char_row && j == char_col));
  879. X      if (typ < 4) {    /* typ == 2 not used, used to be visible traps */
  880. X    if (typ == 1) place_trap(i, j, randint(MAX_TRAP)-1); /* typ == 1 */
  881. X    else          place_rubble(i, j); /* typ == 3 */
  882. X      } else {
  883. X    if (typ == 4) place_gold(i, j); /* typ == 4 */
  884. X    else          place_object(i, j); /* typ == 5 */
  885. X      }
  886. X    }
  887. X}
  888. X
  889. X
  890. X/* Creates objects nearby the coordinates given        -RAK-    */
  891. Xvoid random_object(y, x, num)
  892. Xint y, x, num;
  893. X{
  894. X  register int i, j, k;
  895. X  register cave_type *cave_ptr;
  896. X
  897. X  do
  898. X    {
  899. X      i = 0;
  900. X      do
  901. X    {
  902. X      j = y - 3 + randint(5);
  903. X      k = x - 4 + randint(7);
  904. X      cave_ptr = &cave[j][k];
  905. X      if (in_bounds(j, k) && (cave_ptr->fval <= MAX_CAVE_FLOOR)
  906. X          && (cave_ptr->tptr == 0))
  907. X        {
  908. X          if (randint(100) < 75)
  909. X        place_object(j, k);
  910. X          else
  911. X        place_gold(j, k);
  912. X          i = 9;
  913. X        }
  914. X      i++;
  915. X    }
  916. X      while(i <= 10);
  917. X      num--;
  918. X    }
  919. X  while (num != 0);
  920. X}
  921. X
  922. X
  923. X/* Converts stat num into string            -RAK-    */
  924. Xvoid cnv_stat(stat, out_val)
  925. Xint8u stat;
  926. Xchar *out_val;
  927. X{
  928. X  register int part1, part2;
  929. X
  930. X  if (stat > 18)
  931. X    {
  932. X      part1 = 18;
  933. X      part2 = stat - 18;
  934. X      if (part2 == 100)
  935. X    (void) strcpy(out_val, "18/100");
  936. X      else
  937. X    (void) sprintf(out_val, " %2d/%02d", part1, part2);
  938. X    }
  939. X  else
  940. X    (void) sprintf(out_val, "%6d", stat);
  941. X}
  942. X
  943. X
  944. X/* Print character stat in given row, column        -RAK-    */
  945. Xvoid prt_stat(stat)
  946. Xint stat;
  947. X{
  948. X  stat_type out_val1;
  949. X
  950. X  cnv_stat(py.stats.use_stat[stat], out_val1);
  951. X  put_buffer(stat_names[stat], 6+stat, STAT_COLUMN);
  952. X  put_buffer (out_val1, 6+stat, STAT_COLUMN+6);
  953. X}
  954. X
  955. X
  956. X/* Print character info in given row, column        -RAK-    */
  957. X/* the longest title is 13 characters, so only pad to 13 */
  958. Xvoid prt_field(info, row, column)
  959. Xchar *info;
  960. Xint row, column;
  961. X{
  962. X  put_buffer (&blank_string[BLANK_LENGTH-13], row, column);
  963. X  put_buffer (info, row, column);
  964. X}
  965. X
  966. X/* Print long number with header at given row, column */
  967. Xstatic void prt_lnum(header, num, row, column)
  968. Xchar *header;
  969. Xint32 num;
  970. Xint row, column;
  971. X{
  972. X  vtype out_val;
  973. X
  974. X  (void) sprintf(out_val, "%s: %6ld", header, num);
  975. X  put_buffer(out_val, row, column);
  976. X}
  977. X
  978. X/* Print number with header at given row, column    -RAK-    */
  979. Xstatic void prt_num(header, num, row, column)
  980. Xchar *header;
  981. Xint num, row, column;
  982. X{
  983. X  vtype out_val;
  984. X
  985. X  (void) sprintf(out_val, "%s: %6d", header, num);
  986. X  put_buffer(out_val, row, column);
  987. X}
  988. X
  989. X/* Print long number at given row, column */
  990. Xstatic void prt_long(num, row, column)
  991. Xint32 num;
  992. Xint row, column;
  993. X{
  994. X  vtype out_val;
  995. X
  996. X  (void) sprintf(out_val, "%6ld", num);
  997. X  put_buffer(out_val, row, column);
  998. X}
  999. X
  1000. X/* Print number at given row, column    -RAK-    */
  1001. Xstatic void prt_int(num, row, column)
  1002. Xint num, row, column;
  1003. X{
  1004. X  vtype out_val;
  1005. X
  1006. X  (void) sprintf(out_val, "%6d", num);
  1007. X  put_buffer(out_val, row, column);
  1008. X}
  1009. X
  1010. X
  1011. X/* Adjustment for wisdom/intelligence                -JWT-    */
  1012. Xint stat_adj(stat)
  1013. Xint stat;
  1014. X{
  1015. X  register int value;
  1016. X
  1017. X  value = py.stats.use_stat[stat];
  1018. X  if (value > 117)
  1019. X    return(7);
  1020. X  else if (value > 107)
  1021. X    return(6);
  1022. X  else if (value > 87)
  1023. X    return(5);
  1024. X  else if (value > 67)
  1025. X    return(4);
  1026. X  else if (value > 17)
  1027. X    return(3);
  1028. X  else if (value > 14)
  1029. X    return(2);
  1030. X  else if (value > 7)
  1031. X    return(1);
  1032. X  else
  1033. X    return(0);
  1034. X}
  1035. X
  1036. X
  1037. X/* Adjustment for charisma                -RAK-    */
  1038. X/* Percent decrease or increase in price of goods         */
  1039. Xint chr_adj()
  1040. X{
  1041. X  register int charisma;
  1042. X
  1043. X  charisma = py.stats.use_stat[A_CHR];
  1044. X  if (charisma > 117)
  1045. X    return(90);
  1046. X  else if (charisma > 107)
  1047. X    return(92);
  1048. X  else if (charisma > 87)
  1049. X    return(94);
  1050. X  else if (charisma > 67)
  1051. X    return(96);
  1052. X  else if (charisma > 18)
  1053. X    return(98);
  1054. X  else
  1055. X    switch(charisma)
  1056. X      {
  1057. X      case 18:    return(100);
  1058. X      case 17:    return(101);
  1059. X      case 16:    return(102);
  1060. X      case 15:    return(103);
  1061. X      case 14:    return(104);
  1062. X      case 13:    return(106);
  1063. X      case 12:    return(108);
  1064. X      case 11:    return(110);
  1065. X      case 10:    return(112);
  1066. X      case 9:  return(114);
  1067. X      case 8:  return(116);
  1068. X      case 7:  return(118);
  1069. X      case 6:  return(120);
  1070. X      case 5:  return(122);
  1071. X      case 4:  return(125);
  1072. X      case 3:  return(130);
  1073. X      default: return(100);
  1074. X      }
  1075. X}
  1076. X
  1077. X
  1078. X/* Returns a character's adjustment to hit points     -JWT-     */
  1079. Xint con_adj()
  1080. X{
  1081. X  register int con;
  1082. X
  1083. X  con = py.stats.use_stat[A_CON];
  1084. X  if (con < 7)
  1085. X    return(con - 7);
  1086. X  else if (con < 17)
  1087. X    return(0);
  1088. X  else if (con ==  17)
  1089. X    return(1);
  1090. X  else if (con <  94)
  1091. X    return(2);
  1092. X  else if (con < 117)
  1093. X    return(3);
  1094. X  else
  1095. X    return(4);
  1096. X}
  1097. X
  1098. X
  1099. Xchar *title_string()
  1100. X{
  1101. X  register char *p;
  1102. X
  1103. X  if (py.misc.lev < 1)
  1104. X    p = "Babe in arms";
  1105. X  else if (py.misc.lev <= MAX_PLAYER_LEVEL)
  1106. X    p = player_title[py.misc.pclass][py.misc.lev-1];
  1107. X  else if (py.misc.male)
  1108. X    p = "**KING**";
  1109. X  else
  1110. X    p = "**QUEEN**";
  1111. X  return p;
  1112. X}
  1113. X
  1114. X
  1115. X/* Prints title of character                -RAK-    */
  1116. Xvoid prt_title()
  1117. X{
  1118. X  prt_field(title_string(), 4, STAT_COLUMN);
  1119. X}
  1120. X
  1121. X
  1122. X/* Prints level                        -RAK-    */
  1123. Xvoid prt_level()
  1124. X{
  1125. X  prt_int((int)py.misc.lev, 13, STAT_COLUMN+6);
  1126. X}
  1127. X
  1128. X
  1129. X/* Prints players current mana points.         -RAK-    */
  1130. Xvoid prt_cmana()
  1131. X{
  1132. X  prt_int(py.misc.cmana, 15, STAT_COLUMN+6);
  1133. X}
  1134. X
  1135. X
  1136. X/* Prints Max hit points                -RAK-    */
  1137. Xvoid prt_mhp()
  1138. X{
  1139. X  prt_int(py.misc.mhp, 16, STAT_COLUMN+6);
  1140. X}
  1141. X
  1142. X
  1143. X/* Prints players current hit points            -RAK-    */
  1144. Xvoid prt_chp()
  1145. X{
  1146. X  prt_int(py.misc.chp, 17, STAT_COLUMN+6);
  1147. X}
  1148. X
  1149. X
  1150. X/* prints current AC                    -RAK-    */
  1151. Xvoid prt_pac()
  1152. X{
  1153. X  prt_int(py.misc.dis_ac, 19, STAT_COLUMN+6);
  1154. X}
  1155. X
  1156. X
  1157. X/* Prints current gold                    -RAK-    */
  1158. Xvoid prt_gold()
  1159. X{
  1160. X  prt_long(py.misc.au, 20, STAT_COLUMN+6);
  1161. X}
  1162. X
  1163. X
  1164. X/* Prints depth in stat area                -RAK-    */
  1165. Xvoid prt_depth()
  1166. X{
  1167. X  vtype depths;
  1168. X  register int depth;
  1169. X
  1170. X  depth = dun_level*50;
  1171. X  if (depth == 0)
  1172. X    (void) strcpy(depths, "Town level");
  1173. X  else
  1174. X    (void) sprintf(depths, "%d feet", depth);
  1175. X  prt(depths, 23, 65);
  1176. X}
  1177. X
  1178. X
  1179. X/* Prints status of hunger                -RAK-    */
  1180. Xvoid prt_hunger()
  1181. X{
  1182. X  if (PY_WEAK & py.flags.status)
  1183. X    put_buffer("Weak  ", 23, 0);
  1184. X  else if (PY_HUNGRY & py.flags.status)
  1185. X    put_buffer("Hungry", 23, 0);
  1186. X  else
  1187. X    put_buffer(&blank_string[BLANK_LENGTH-6], 23, 0);
  1188. X}
  1189. X
  1190. X
  1191. X/* Prints Blind status                    -RAK-    */
  1192. Xvoid prt_blind()
  1193. X{
  1194. X  if (PY_BLIND & py.flags.status)
  1195. X    put_buffer("Blind", 23, 7);
  1196. X  else
  1197. X    put_buffer(&blank_string[BLANK_LENGTH-5], 23, 7);
  1198. X}
  1199. X
  1200. X
  1201. X/* Prints Confusion status                -RAK-    */
  1202. Xvoid prt_confused()
  1203. X{
  1204. X  if (PY_CONFUSED & py.flags.status)
  1205. X    put_buffer("Confused", 23, 13);
  1206. X  else
  1207. X    put_buffer(&blank_string[BLANK_LENGTH-8], 23, 13);
  1208. X}
  1209. X
  1210. X
  1211. X/* Prints Fear status                    -RAK-    */
  1212. Xvoid prt_afraid()
  1213. X{
  1214. X  if (PY_FEAR & py.flags.status)
  1215. X    put_buffer("Afraid", 23, 22);
  1216. X  else
  1217. X    put_buffer(&blank_string[BLANK_LENGTH-6], 23, 22);
  1218. X}
  1219. X
  1220. X
  1221. X/* Prints Poisoned status                -RAK-    */
  1222. Xvoid prt_poisoned()
  1223. X{
  1224. X  if (PY_POISONED & py.flags.status)
  1225. X    put_buffer("Poisoned", 23, 29);
  1226. X  else
  1227. X    put_buffer(&blank_string[BLANK_LENGTH-8], 23, 29);
  1228. X}
  1229. X
  1230. X
  1231. X/* Prints Searching, Resting, Paralysis, or 'count' status    -RAK-    */
  1232. Xvoid prt_state()
  1233. X{
  1234. X  char tmp[16];
  1235. X#ifdef ATARIST_MWC
  1236. X  int32u holder;
  1237. X#endif
  1238. X
  1239. X#ifdef ATARIST_MWC
  1240. X  py.flags.status &= ~(holder = PY_REPEAT);
  1241. X#else
  1242. X  py.flags.status &= ~PY_REPEAT;
  1243. X#endif
  1244. X  if (py.flags.paralysis > 1)
  1245. X    put_buffer ("Paralysed", 23, 38);
  1246. X  else if (PY_REST & py.flags.status)
  1247. X    {
  1248. X      if (py.flags.rest < 0)
  1249. X    (void) strcpy (tmp, "Rest *");
  1250. X      else if (display_counts)
  1251. X    (void) sprintf (tmp, "Rest %-5d", py.flags.rest);
  1252. X      else
  1253. X    (void) strcpy (tmp, "Rest");
  1254. X      put_buffer (tmp, 23, 38);
  1255. X    }
  1256. X  else if (command_count > 0)
  1257. X    {
  1258. X      if (display_counts)
  1259. X    (void) sprintf (tmp, "Repeat %-3d", command_count);
  1260. X      else
  1261. X    (void) strcpy (tmp, "Repeat");
  1262. X#ifdef ATARIST_MWC
  1263. X      py.flags.status |= holder;
  1264. X#else
  1265. X      py.flags.status |= PY_REPEAT;
  1266. X#endif
  1267. X      put_buffer (tmp, 23, 38);
  1268. X      if (PY_SEARCH & py.flags.status)
  1269. X    put_buffer ("Search", 23, 38);
  1270. X    }
  1271. X  else if (PY_SEARCH & py.flags.status)
  1272. X    put_buffer("Searching", 23, 38);
  1273. X  else        /* "repeat 999" is 10 characters */
  1274. X    put_buffer(&blank_string[BLANK_LENGTH-10], 23, 38);
  1275. X}
  1276. X
  1277. X
  1278. X/* Prints the speed of a character.            -CJS- */
  1279. Xvoid prt_speed ()
  1280. X{
  1281. X  register int i;
  1282. X
  1283. X  i = py.flags.speed;
  1284. X  if (PY_SEARCH & py.flags.status)   /* Search mode. */
  1285. X    i--;
  1286. X  if (i > 1)
  1287. X    put_buffer ("Very Slow", 23, 49);
  1288. X  else if (i == 1)
  1289. X    put_buffer ("Slow     ", 23, 49);
  1290. X  else if (i == 0)
  1291. X    put_buffer (&blank_string[BLANK_LENGTH-9], 23, 49);
  1292. X  else if (i == -1)
  1293. X    put_buffer ("Fast     ", 23, 49);
  1294. X  else
  1295. X    put_buffer ("Very Fast", 23, 49);
  1296. X}
  1297. X
  1298. X
  1299. Xvoid prt_study()
  1300. X{
  1301. X#ifdef ATARIST_MWC
  1302. X  int32u holder;
  1303. X#endif
  1304. X
  1305. X#ifdef ATARIST_MWC
  1306. X  py.flags.status &= ~(holder = PY_STUDY);
  1307. X#else
  1308. X  py.flags.status &= ~PY_STUDY;
  1309. X#endif
  1310. X  if (py.flags.new_spells == 0)
  1311. X    put_buffer (&blank_string[BLANK_LENGTH-5], 23, 59);
  1312. X  else
  1313. X    put_buffer ("Study", 23, 59);
  1314. X}
  1315. X
  1316. X
  1317. X/* Prints winner status on display            -RAK-    */
  1318. Xvoid prt_winner()
  1319. X{
  1320. X  if (noscore & 0x2)
  1321. X    {
  1322. X      if (wizard)
  1323. X    put_buffer("Is wizard  ", 22, 0);
  1324. X      else
  1325. X    put_buffer("Was wizard ", 22, 0);
  1326. X    }
  1327. X  else if (noscore & 0x1)
  1328. X    put_buffer("Resurrected", 22, 0);
  1329. X  else if (noscore & 0x4)
  1330. X    put_buffer ("Duplicate", 22, 0);
  1331. X  else if (total_winner)
  1332. X    put_buffer("*Winner*   ", 22, 0);
  1333. X}
  1334. X
  1335. X
  1336. Xint8u modify_stat (stat, amount)
  1337. Xint stat;
  1338. Xint16 amount;
  1339. X{
  1340. X  register int loop, i;
  1341. X  register int8u tmp_stat;
  1342. X
  1343. X  tmp_stat = py.stats.cur_stat[stat];
  1344. X  loop = (amount < 0 ? -amount : amount);
  1345. X  for (i = 0; i < loop; i++)
  1346. X    {
  1347. X      if (amount > 0)
  1348. X    {
  1349. X      if (tmp_stat < 18)
  1350. X        tmp_stat++;
  1351. X      else if (tmp_stat < 108)
  1352. X        tmp_stat += 10;
  1353. X      else
  1354. X        tmp_stat = 118;
  1355. X    }
  1356. X      else
  1357. X    {
  1358. X      if (tmp_stat > 27)
  1359. X        tmp_stat -= 10;
  1360. X      else if (tmp_stat > 18)
  1361. X        tmp_stat = 18;
  1362. X      else if (tmp_stat > 3)
  1363. X        tmp_stat--;
  1364. X    }
  1365. X    }
  1366. X  return tmp_stat;
  1367. X}
  1368. X
  1369. X
  1370. X/* Set the value of the stat which is actually used.     -CJS- */
  1371. Xvoid set_use_stat(stat)
  1372. Xint stat;
  1373. X{
  1374. X#ifdef ATARIST_MWC
  1375. X  int32u holder;
  1376. X#endif
  1377. X
  1378. X  py.stats.use_stat[stat] = modify_stat (stat, py.stats.mod_stat[stat]);
  1379. X
  1380. X  if (stat == A_STR)
  1381. X    {
  1382. X#ifdef ATARIST_MWC
  1383. X      py.flags.status |= (holder = PY_STR_WGT);
  1384. X#else
  1385. X      py.flags.status |= PY_STR_WGT;
  1386. X#endif
  1387. X      calc_bonuses();
  1388. X    }
  1389. X  else if (stat == A_DEX)
  1390. X    calc_bonuses();
  1391. X  else if (stat == A_INT && class[py.misc.pclass].spell == MAGE)
  1392. X    {
  1393. X      calc_spells(A_INT);
  1394. X      calc_mana(A_INT);
  1395. X    }
  1396. X  else if (stat == A_WIS && class[py.misc.pclass].spell == PRIEST)
  1397. X    {
  1398. X      calc_spells(A_WIS);
  1399. X      calc_mana(A_WIS);
  1400. X    }
  1401. X  else if (stat == A_CON)
  1402. X    calc_hitpoints();
  1403. X}
  1404. X
  1405. X
  1406. X/* Increases a stat by one randomized level        -RAK-    */
  1407. Xint inc_stat(stat)
  1408. Xregister int stat;
  1409. X{
  1410. X  register int tmp_stat, gain;
  1411. X
  1412. X  tmp_stat = py.stats.cur_stat[stat];
  1413. X  if (tmp_stat < 118)
  1414. X    {
  1415. X      if (tmp_stat < 18)
  1416. X    tmp_stat++;
  1417. X      else if (tmp_stat < 116)
  1418. X    {
  1419. X      /* stat increases by 1/6 to 1/3 of difference from max */
  1420. X      gain = ((118 - tmp_stat)/3 + 1) >> 1;
  1421. X      tmp_stat += randint(gain) + gain;
  1422. X    }
  1423. X      else
  1424. X    tmp_stat++;
  1425. X
  1426. X      py.stats.cur_stat[stat] = tmp_stat;
  1427. X      if (tmp_stat > py.stats.max_stat[stat])
  1428. X    py.stats.max_stat[stat] = tmp_stat;
  1429. X      set_use_stat (stat);
  1430. X      prt_stat (stat);
  1431. X      return TRUE;
  1432. X    }
  1433. X  else
  1434. X    return FALSE;
  1435. X}
  1436. X
  1437. X
  1438. X/* Decreases a stat by one randomized level        -RAK-    */
  1439. Xint dec_stat(stat)
  1440. Xregister int stat;
  1441. X{
  1442. X  register int tmp_stat, loss;
  1443. X
  1444. X  tmp_stat = py.stats.cur_stat[stat];
  1445. X  if (tmp_stat > 3)
  1446. X    {
  1447. X      if (tmp_stat < 19)
  1448. X    tmp_stat--;
  1449. X      else if (tmp_stat < 117)
  1450. X    {
  1451. X      loss = (((118 - tmp_stat) >> 1) + 1) >> 1;
  1452. X      tmp_stat += -randint(loss) - loss;
  1453. X      if (tmp_stat < 18)
  1454. X        tmp_stat = 18;
  1455. X    }
  1456. X      else
  1457. X    tmp_stat--;
  1458. X
  1459. X      py.stats.cur_stat[stat] = tmp_stat;
  1460. X      set_use_stat (stat);
  1461. X      prt_stat (stat);
  1462. X      return TRUE;
  1463. X    }
  1464. X  else
  1465. X    return FALSE;
  1466. X}
  1467. X
  1468. X
  1469. X/* Restore a stat.  Return TRUE only if this actually makes a difference. */
  1470. Xint res_stat (stat)
  1471. Xint stat;
  1472. X{
  1473. X  register int i;
  1474. X
  1475. X  i = py.stats.max_stat[stat] - py.stats.cur_stat[stat];
  1476. X  if (i)
  1477. X    {
  1478. X      py.stats.cur_stat[stat] += i;
  1479. X      set_use_stat (stat);
  1480. X      prt_stat (stat);
  1481. X      return TRUE;
  1482. X    }
  1483. X  return FALSE;
  1484. X}
  1485. X
  1486. X/* Boost a stat artificially (by wearing something). If the display argument
  1487. X   is TRUE, then increase is shown on the screen. */
  1488. Xvoid bst_stat (stat, amount)
  1489. Xint stat, amount;
  1490. X{
  1491. X#ifdef ATARIST_MWC
  1492. X  int32u holder;
  1493. X#endif
  1494. X
  1495. X  py.stats.mod_stat[stat] += amount;
  1496. X
  1497. X  set_use_stat (stat);
  1498. X  /* can not call prt_stat() here, may be in store, may be in inven_command */
  1499. X#ifdef ATARIST_MWC
  1500. X  py.flags.status |= ((holder = PY_STR) << stat);
  1501. X#else
  1502. X  py.flags.status |= (PY_STR << stat);
  1503. X#endif
  1504. X}
  1505. X
  1506. X
  1507. X/* Returns a character's adjustment to hit.         -JWT-     */
  1508. Xint tohit_adj()
  1509. X{
  1510. X  register int total, stat;
  1511. X
  1512. X  stat = py.stats.use_stat[A_DEX];
  1513. X  if      (stat <   4)    total = -3;
  1514. X  else if (stat <   6)    total = -2;
  1515. X  else if (stat <   8)    total = -1;
  1516. X  else if (stat <  16)    total =     0;
  1517. X  else if (stat <  17)    total =     1;
  1518. X  else if (stat <  18)    total =     2;
  1519. X  else if (stat <  69)    total =     3;
  1520. X  else if (stat < 118)    total =     4;
  1521. X  else            total =     5;
  1522. X  stat = py.stats.use_stat[A_STR];
  1523. X  if      (stat <   4)    total -= 3;
  1524. X  else if (stat <   5)    total -= 2;
  1525. X  else if (stat <   7)    total -= 1;
  1526. X  else if (stat <  18)    total -= 0;
  1527. X  else if (stat <  94)    total += 1;
  1528. X  else if (stat < 109)    total += 2;
  1529. X  else if (stat < 117)    total += 3;
  1530. X  else            total += 4;
  1531. X  return(total);
  1532. X}
  1533. X
  1534. X
  1535. X/* Returns a character's adjustment to armor class     -JWT-     */
  1536. Xint toac_adj()
  1537. X{
  1538. X  register int stat;
  1539. X
  1540. X  stat = py.stats.use_stat[A_DEX];
  1541. X  if      (stat <   4)    return(-4);
  1542. X  else if (stat ==  4)    return(-3);
  1543. X  else if (stat ==  5)    return(-2);
  1544. X  else if (stat ==  6)    return(-1);
  1545. X  else if (stat <  15)    return( 0);
  1546. X  else if (stat <  18)    return( 1);
  1547. X  else if (stat <  59)    return( 2);
  1548. X  else if (stat <  94)    return( 3);
  1549. X  else if (stat < 117)    return( 4);
  1550. X  else            return( 5);
  1551. X}
  1552. X
  1553. X
  1554. X/* Returns a character's adjustment to disarm         -RAK-     */
  1555. Xint todis_adj()
  1556. X{
  1557. X  register int stat;
  1558. X
  1559. X  stat = py.stats.use_stat[A_DEX];
  1560. X  if      (stat <   3)    return(-8);
  1561. X  else if (stat ==  4)    return(-6);
  1562. X  else if (stat ==  5)    return(-4);
  1563. X  else if (stat ==  6)    return(-2);
  1564. X  else if (stat ==  7)    return(-1);
  1565. X  else if (stat <  13)    return( 0);
  1566. X  else if (stat <  16)    return( 1);
  1567. X  else if (stat <  18)    return( 2);
  1568. X  else if (stat <  59)    return( 4);
  1569. X  else if (stat <  94)    return( 5);
  1570. X  else if (stat < 117)    return( 6);
  1571. X  else            return( 8);
  1572. X}
  1573. X
  1574. X
  1575. X/* Returns a character's adjustment to damage         -JWT-     */
  1576. Xint todam_adj()
  1577. X{
  1578. X  register int stat;
  1579. X
  1580. X  stat = py.stats.use_stat[A_STR];
  1581. X  if      (stat <   4)    return(-2);
  1582. X  else if (stat <   5)    return(-1);
  1583. X  else if (stat <  16)    return( 0);
  1584. X  else if (stat <  17)    return( 1);
  1585. X  else if (stat <  18)    return( 2);
  1586. X  else if (stat <  94)    return( 3);
  1587. X  else if (stat < 109)    return( 4);
  1588. X  else if (stat < 117)    return( 5);
  1589. X  else            return( 6);
  1590. X}
  1591. X
  1592. X
  1593. X/* Prints character-screen info                -RAK-    */
  1594. Xvoid prt_stat_block()
  1595. X{
  1596. X  register int32u status;
  1597. X  register struct misc *m_ptr;
  1598. X  register int i;
  1599. X
  1600. X  m_ptr = &py.misc;
  1601. X  prt_field(race[py.misc.prace].trace,      2, STAT_COLUMN);
  1602. X  prt_field(class[py.misc.pclass].title,  3, STAT_COLUMN);
  1603. X  prt_field(title_string(),          4, STAT_COLUMN);
  1604. X  for (i = 0; i < 6; i++)
  1605. X    prt_stat (i);
  1606. X  prt_num ("LEV ", (int)m_ptr->lev,    13, STAT_COLUMN);
  1607. X  prt_lnum("EXP ", m_ptr->exp,           14, STAT_COLUMN);
  1608. X  prt_num ("MANA", m_ptr->cmana,     15, STAT_COLUMN);
  1609. X  prt_num ("MHP ", m_ptr->mhp,           16, STAT_COLUMN);
  1610. X  prt_num ("CHP ", m_ptr->chp,     17, STAT_COLUMN);
  1611. X  prt_num ("AC  ", m_ptr->dis_ac,      19, STAT_COLUMN);
  1612. X  prt_lnum("GOLD", m_ptr->au,           20, STAT_COLUMN);
  1613. X  prt_winner();
  1614. X  status = py.flags.status;
  1615. X  if ((PY_HUNGRY|PY_WEAK) & status)
  1616. X    prt_hunger();
  1617. X  if (PY_BLIND & status)
  1618. X    prt_blind();
  1619. X  if (PY_CONFUSED & status)
  1620. X    prt_confused();
  1621. X  if (PY_FEAR & status)
  1622. X    prt_afraid();
  1623. X  if (PY_POISONED & status)
  1624. X    prt_poisoned();
  1625. X  if ((PY_SEARCH|PY_REST) & status)
  1626. X    prt_state ();
  1627. X  /* if speed non zero, print it, modify speed if Searching */
  1628. X  if (py.flags.speed - ((PY_SEARCH & status) >> 8) != 0)
  1629. X    prt_speed ();
  1630. X  /* display the study field */
  1631. X  prt_study();
  1632. X}
  1633. X
  1634. X
  1635. X/* Draws entire screen                    -RAK-    */
  1636. Xvoid draw_cave()
  1637. X{
  1638. X  clear_screen ();
  1639. X  prt_stat_block();
  1640. X  prt_map();
  1641. X  prt_depth();
  1642. X}
  1643. X
  1644. X
  1645. X/* Prints the following information on the screen.    -JWT-    */
  1646. Xvoid put_character()
  1647. X{
  1648. X  register struct misc *m_ptr;
  1649. X
  1650. X  m_ptr = &py.misc;
  1651. X  clear_screen ();
  1652. X  put_buffer ("Name        :", 2, 1);
  1653. X  put_buffer ("Race        :", 3, 1);
  1654. X  put_buffer ("Sex         :", 4, 1);
  1655. X  put_buffer ("Class       :", 5, 1);
  1656. X  if (character_generated)
  1657. X    {
  1658. X      put_buffer (m_ptr->name, 2, 15);
  1659. X      put_buffer (race[m_ptr->prace].trace, 3, 15);
  1660. X      put_buffer ((m_ptr->male ? "Male" : "Female"), 4, 15);
  1661. X      put_buffer (class[m_ptr->pclass].title, 5, 15);
  1662. X    }
  1663. X}
  1664. X
  1665. X
  1666. X/* Prints the following information on the screen.    -JWT-    */
  1667. Xvoid put_stats()
  1668. X{
  1669. X  register struct misc *m_ptr;
  1670. X  register int i;
  1671. X  vtype buf;
  1672. X
  1673. X  m_ptr = &py.misc;
  1674. X  for (i = 0; i < 6; i++)
  1675. X    {
  1676. X      cnv_stat (py.stats.use_stat[i], buf);
  1677. X      put_buffer (stat_names[i], 2+i, 61);
  1678. X      put_buffer (buf, 2+i, 66);
  1679. X      if (py.stats.max_stat[i] > py.stats.cur_stat[i])
  1680. X    {
  1681. X      cnv_stat (py.stats.max_stat[i], buf);
  1682. X      put_buffer (buf, 2+i, 73);
  1683. X    }
  1684. X    }
  1685. X  prt_num("+ To Hit    ", m_ptr->dis_th,  9, 1);
  1686. X  prt_num("+ To Damage ", m_ptr->dis_td, 10, 1);
  1687. X  prt_num("+ To AC     ", m_ptr->dis_tac, 11, 1);
  1688. X  prt_num("  Total AC  ", m_ptr->dis_ac, 12, 1);
  1689. X}
  1690. X
  1691. X
  1692. X/* Returns a rating of x depending on y            -JWT-    */
  1693. Xchar *likert(x, y)
  1694. Xint x, y;
  1695. X{
  1696. X  switch((x/y))
  1697. X    {
  1698. X      case -3: case -2: case -1: return("Very Bad");
  1699. X      case 0: case 1:         return("Bad");
  1700. X      case 2:             return("Poor");
  1701. X      case 3: case 4:         return("Fair");
  1702. X      case  5:             return("Good");
  1703. X      case 6:             return("Very Good");
  1704. X      case 7: case 8:         return("Excellent");
  1705. X      default:             return("Superb");
  1706. X      }
  1707. X}
  1708. X
  1709. X
  1710. X/* Prints age, height, weight, and SC            -JWT-    */
  1711. Xvoid put_misc1()
  1712. X{
  1713. X  register struct misc *m_ptr;
  1714. X
  1715. X  m_ptr = &py.misc;
  1716. X  prt_num("Age          ", (int)m_ptr->age, 2, 38);
  1717. X  prt_num("Height       ", (int)m_ptr->ht, 3, 38);
  1718. X  prt_num("Weight       ", (int)m_ptr->wt, 4, 38);
  1719. X  prt_num("Social Class ", (int)m_ptr->sc, 5, 38);
  1720. X}
  1721. X
  1722. X
  1723. X/* Prints the following information on the screen.    -JWT-    */
  1724. Xvoid put_misc2()
  1725. X{
  1726. X  register struct misc *m_ptr;
  1727. X
  1728. X  m_ptr = &py.misc;
  1729. X  prt_num("Level      ", (int)m_ptr->lev, 9, 29);
  1730. X  prt_lnum("Experience ", m_ptr->exp, 10, 29);
  1731. X  prt_lnum("Max Exp    ", m_ptr->max_exp, 11, 29);
  1732. X  if (m_ptr->lev == MAX_PLAYER_LEVEL)
  1733. X    prt ("Exp to Adv.: ******", 12, 29);
  1734. X  else
  1735. X    prt_lnum("Exp to Adv.", (int32)(player_exp[m_ptr->lev-1]
  1736. X                    * m_ptr->expfact / 100), 12, 29);
  1737. X  prt_lnum("Gold       ", m_ptr->au, 13, 29);
  1738. X  prt_num("Max Hit Points ", m_ptr->mhp, 9, 52);
  1739. X  prt_num("Cur Hit Points ", m_ptr->chp, 10, 52);
  1740. X  prt_num("Max Mana       ", m_ptr->mana, 11, 52);
  1741. X  prt_num("Cur Mana       ", m_ptr->cmana, 12, 52);
  1742. X}
  1743. X
  1744. X
  1745. X/* Prints ratings on certain abilities            -RAK-    */
  1746. Xvoid put_misc3()
  1747. X{
  1748. X  int xbth, xbthb, xfos, xsrh, xstl, xdis, xsave, xdev;
  1749. X  vtype xinfra;
  1750. X  register struct misc *p_ptr;
  1751. X
  1752. X  clear_from(14);
  1753. X  p_ptr = &py.misc;
  1754. X  xbth    = p_ptr->bth + p_ptr->ptohit*BTH_PLUS_ADJ
  1755. X    + (class_level_adj[p_ptr->pclass][CLA_BTH] * p_ptr->lev);
  1756. X  xbthb = p_ptr->bthb + p_ptr->ptohit*BTH_PLUS_ADJ
  1757. X    + (class_level_adj[p_ptr->pclass][CLA_BTHB] * p_ptr->lev);
  1758. X  /* this results in a range from 0 to 29 */
  1759. X  xfos    = 40 - p_ptr->fos;
  1760. X  if (xfos < 0)     xfos = 0;
  1761. X  xsrh    = p_ptr->srh;
  1762. X  /* this results in a range from 0 to 9 */
  1763. X  xstl    = p_ptr->stl + 1;
  1764. X  xdis    = p_ptr->disarm + 2*todis_adj() + stat_adj(A_INT)
  1765. X    + (class_level_adj[p_ptr->pclass][CLA_DISARM] * p_ptr->lev / 3);
  1766. X  xsave = p_ptr->save + stat_adj(A_WIS)
  1767. X    + (class_level_adj[p_ptr->pclass][CLA_SAVE] * p_ptr->lev / 3);
  1768. X  xdev    = p_ptr->save + stat_adj(A_INT)
  1769. X    + (class_level_adj[p_ptr->pclass][CLA_DEVICE] * p_ptr->lev / 3);
  1770. X
  1771. X  (void) sprintf(xinfra, "%d feet", py.flags.see_infra*10);
  1772. X
  1773. X  put_buffer ("(Miscellaneous Abilities)", 15, 25);
  1774. X  put_buffer ("Fighting    :", 16, 1);
  1775. X  put_buffer (likert (xbth, 12), 16, 15);
  1776. X  put_buffer ("Bows/Throw  :", 17, 1);
  1777. X  put_buffer (likert (xbthb, 12), 17, 15);
  1778. X  put_buffer ("Saving Throw:", 18, 1);
  1779. X  put_buffer (likert (xsave, 6), 18, 15);
  1780. X
  1781. X  put_buffer ("Stealth     :", 16, 28);
  1782. X  put_buffer (likert (xstl, 1), 16, 42);
  1783. X  put_buffer ("Disarming   :", 17, 28);
  1784. X  put_buffer (likert (xdis, 8), 17, 42);
  1785. X  put_buffer ("Magic Device:", 18, 28);
  1786. X  put_buffer (likert (xdev, 6), 18, 42);
  1787. X
  1788. X  put_buffer ("Perception  :", 16, 55);
  1789. X  put_buffer (likert (xfos, 3), 16, 69);
  1790. X  put_buffer ("Searching   :", 17, 55);
  1791. X  put_buffer (likert (xsrh, 6), 17, 69);
  1792. X  put_buffer ("Infra-Vision:", 18, 55);
  1793. X  put_buffer (xinfra, 18, 69);
  1794. X}
  1795. X
  1796. X
  1797. X/* Used to display the character on the screen.        -RAK-    */
  1798. Xvoid display_char()
  1799. X{
  1800. X  put_character();
  1801. X  put_misc1();
  1802. X  put_stats();
  1803. X  put_misc2();
  1804. X  put_misc3();
  1805. X}
  1806. X
  1807. X
  1808. X/* Gets a name for the character            -JWT-    */
  1809. Xvoid get_name()
  1810. X{
  1811. X  prt("Enter your player's name  [press <RETURN> when finished]", 21, 2);
  1812. X  put_buffer (&blank_string[BLANK_LENGTH-23], 2, 15);
  1813. X#if defined(MAC) || defined(AMIGA)
  1814. X  /* Force player to give a name, would be nice to get name from chooser
  1815. X     (STR -16096), but that name might be too long */
  1816. X  while (!get_string(py.misc.name, 2, 15, 23) || py.misc.name[0] == 0);
  1817. X#else
  1818. X  if (!get_string(py.misc.name, 2, 15, 23) || py.misc.name[0] == 0)
  1819. X    {
  1820. X      user_name (py.misc.name);
  1821. X      put_buffer (py.misc.name, 2, 15);
  1822. X    }
  1823. X#endif
  1824. X  clear_from (20);
  1825. X#ifdef MAC
  1826. X  /* Use the new name to set save file default name. */
  1827. X  initsavedefaults();
  1828. X#endif
  1829. X}
  1830. X
  1831. X
  1832. X/* Changes the name of the character            -JWT-    */
  1833. Xvoid change_name()
  1834. X{
  1835. X  register char c;
  1836. X  register int flag;
  1837. X#ifndef MAC
  1838. X  vtype temp;
  1839. X#endif
  1840. X
  1841. X  flag = FALSE;
  1842. X  display_char();
  1843. X  do
  1844. X    {
  1845. X      prt( "<f>ile character description. <c>hange character name.", 21, 2);
  1846. X      c = inkey();
  1847. X      switch(c)
  1848. X    {
  1849. X    case 'c':
  1850. X      get_name();
  1851. X      flag = TRUE;
  1852. X      break;
  1853. X    case 'f':
  1854. X#ifdef MAC
  1855. X      /* On mac, file_character() gets filename with std file dialog. */
  1856. X      if (file_character ())
  1857. X        flag = TRUE;
  1858. X#else
  1859. X      prt ("File name:", 0, 0);
  1860. X      if (get_string (temp, 0, 10, 60) && temp[0])
  1861. X        if (file_character (temp))
  1862. X          flag = TRUE;
  1863. X#endif
  1864. X      break;
  1865. X    case ESCAPE: case ' ':
  1866. X    case '\n': case '\r':
  1867. X      flag = TRUE;
  1868. X      break;
  1869. X    default:
  1870. X      bell ();
  1871. X      break;
  1872. X    }
  1873. X    }
  1874. X  while (!flag);
  1875. X}
  1876. X
  1877. X
  1878. X/* Destroy an item in the inventory            -RAK-    */
  1879. Xvoid inven_destroy(item_val)
  1880. Xint item_val;
  1881. X{
  1882. X  register int j;
  1883. X  register inven_type *i_ptr;
  1884. X#ifdef ATARIST_MWC
  1885. X  int32u holder;
  1886. X#endif
  1887. X
  1888. X  i_ptr = &inventory[item_val];
  1889. X  if ((i_ptr->number > 1) && (i_ptr->subval <= ITEM_SINGLE_STACK_MAX))
  1890. X    {
  1891. X      i_ptr->number--;
  1892. X      inven_weight -= i_ptr->weight;
  1893. X    }
  1894. X  else
  1895. X    {
  1896. X      inven_weight -= i_ptr->weight*i_ptr->number;
  1897. X      for (j = item_val; j < inven_ctr-1; j++)
  1898. X    inventory[j] = inventory[j+1];
  1899. X      invcopy(&inventory[inven_ctr-1], OBJ_NOTHING);
  1900. X      inven_ctr--;
  1901. X    }
  1902. X#ifdef ATARIST_MWC
  1903. X  py.flags.status |= (holder = PY_STR_WGT);
  1904. X#else
  1905. X  py.flags.status |= PY_STR_WGT;
  1906. X#endif
  1907. X}
  1908. X
  1909. X
  1910. X/* Copies the object in the second argument over the first argument.
  1911. X   However, the second always gets a number of one except for ammo etc. */
  1912. Xvoid take_one_item (s_ptr, i_ptr)
  1913. Xregister inven_type *s_ptr, *i_ptr;
  1914. X{
  1915. X  *s_ptr = *i_ptr;
  1916. X  if ((s_ptr->number > 1) && (s_ptr->subval >= ITEM_SINGLE_STACK_MIN)
  1917. X      && (s_ptr->subval <= ITEM_SINGLE_STACK_MAX))
  1918. X    s_ptr->number = 1;
  1919. X}
  1920. X
  1921. X
  1922. X/* Drops an item from inventory to given location    -RAK-    */
  1923. Xvoid inven_drop(item_val, drop_all)
  1924. Xregister int item_val, drop_all;
  1925. X{
  1926. X  int i;
  1927. X  register inven_type *i_ptr;
  1928. X  vtype prt2;
  1929. X  bigvtype prt1;
  1930. X#ifdef ATARIST_MWC
  1931. X  int32u holder;
  1932. X#endif
  1933. X
  1934. X  if (cave[char_row][char_col].tptr != 0)
  1935. X    (void) delete_object(char_row, char_col);
  1936. X  i = popt ();
  1937. X  i_ptr = &inventory[item_val];
  1938. X  t_list[i] = *i_ptr;
  1939. X  cave[char_row][char_col].tptr = i;
  1940. X
  1941. X  if (item_val >= INVEN_WIELD)
  1942. X    takeoff (item_val, -1);
  1943. X  else
  1944. X    {
  1945. X      if (drop_all || i_ptr->number == 1)
  1946. X    {
  1947. X      inven_weight -= i_ptr->weight*i_ptr->number;
  1948. X      inven_ctr--;
  1949. X      while (item_val < inven_ctr)
  1950. X        {
  1951. X          inventory[item_val] = inventory[item_val+1];
  1952. X          item_val++;
  1953. X        }
  1954. X      invcopy(&inventory[inven_ctr], OBJ_NOTHING);
  1955. X    }
  1956. X      else
  1957. X    {
  1958. X      t_list[i].number = 1;
  1959. X      inven_weight -= i_ptr->weight;
  1960. X      i_ptr->number--;
  1961. X    }
  1962. X      objdes (prt1, &t_list[i], TRUE);
  1963. X      (void) sprintf (prt2, "Dropped %s", prt1);
  1964. X      msg_print (prt2);
  1965. X    }
  1966. X#ifdef ATARIST_MWC
  1967. X  py.flags.status |= (holder = PY_STR_WGT);
  1968. X#else
  1969. X  py.flags.status |= PY_STR_WGT;
  1970. X#endif
  1971. X}
  1972. X
  1973. X
  1974. X/* Destroys a type of item on a given percent chance    -RAK-    */
  1975. Xint inven_damage(typ, perc)
  1976. Xint (*typ)();
  1977. Xregister int perc;
  1978. X{
  1979. X  register int i, j;
  1980. X
  1981. X  j = 0;
  1982. X  for (i = 0; i < inven_ctr; i++)
  1983. X    if ((*typ)(&inventory[i]) && (randint(100) < perc))
  1984. X      {
  1985. X    inven_destroy(i);
  1986. X    j++;
  1987. X      }
  1988. X  return(j);
  1989. X}
  1990. X
  1991. X
  1992. X/* Computes current weight limit            -RAK-    */
  1993. Xint weight_limit()
  1994. X{
  1995. END_OF_FILE
  1996. if test 29086 -ne `wc -c <'source/misc3.c.1'`; then
  1997.     echo shar: \"'source/misc3.c.1'\" unpacked with wrong size!
  1998. fi
  1999. # end of 'source/misc3.c.1'
  2000. fi
  2001. echo shar: End of archive 24 \(of 39\).
  2002. cp /dev/null ark24isdone
  2003. MISSING=""
  2004. 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
  2005.     if test ! -f ark${I}isdone ; then
  2006.     MISSING="${MISSING} ${I}"
  2007.     fi
  2008. done
  2009. if test "${MISSING}" = "" ; then
  2010.     echo You have unpacked all 39 archives.
  2011.     echo "Now run "bldfiles.sh" to build split files"
  2012.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2013. else
  2014.     echo You still need to unpack the following archives:
  2015.     echo "        " ${MISSING}
  2016. fi
  2017. ##  End of shell archive.
  2018. exit 0
  2019.