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

  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: v14i059:  umoria4 - single player dungeon simulation (ver. 5.5), Part27/39
  5. Message-ID: <3423@master.CNA.TEK.COM>
  6. Date: 22 Aug 92 22:13:39 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 1734
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: grabiner@math.harvard.edu (David Grabiner)
  12. Posting-number: Volume 14, Issue 59
  13. Archive-name: umoria4/Part27
  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 27 (of 39)."
  26. # Contents:  doc/moria2.ms source/misc2.c
  27. # Wrapped by billr@saab on Thu Aug 20 09:11:33 1992
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'doc/moria2.ms' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'doc/moria2.ms'\"
  31. else
  32. echo shar: Extracting \"'doc/moria2.ms'\" \(26700 characters\)
  33. sed "s/^X//" >'doc/moria2.ms' <<'END_OF_FILE'
  34. X.NH 1
  35. XThe Town Level
  36. X.LP
  37. XThe town level is where you will begin your adventure.  The
  38. Xtown consists of six buildings each with an entrance, some
  39. Xtowns people, and a wall which surrounds the town.  The first time
  40. Xyou are in town it will be daytime, but you may return to find
  41. Xthat darkness has fallen.  (Note that some spells may act
  42. Xdifferently in the town level.)
  43. X
  44. X.NH 2
  45. XTownspeople
  46. X.LP
  47. XThe town contains many different kinds of people.  There are
  48. Xthe street urchins, young children who will mob an adventurer for
  49. Xmoney, and seem to come out of the woodwork when excited.
  50. XBlubbering Idiots are a constant annoyance, but not harmful.
  51. XPublic drunks wander about the town singing, and are of no
  52. Xthreat to anyone.  Sneaky rogues hang about watching for a
  53. Xlikely victim to mug.  And finally, what town would be complete
  54. Xwithout a swarm of half drunk warriors, who take offense or
  55. Xbecome annoyed just for the fun of it.
  56. X.LP
  57. XMost of the towns people should be avoided by the largest
  58. Xpossible distance when you wander from store to store.  Fights
  59. Xwill break out though, so be prepared.  Since your character grew
  60. Xup in this world of intrigue, no experience is awarded for
  61. Xkilling on the town level.
  62. X
  63. X.NH 2
  64. XSupplies
  65. X.LP
  66. XYour character will begin his adventure with some supplies
  67. Xalready on him.  Use the Inventory `i' command to check what
  68. Xthese supplies are.  It will be necessary to buy other supplies
  69. Xbefore continuing into the dungeon, however, so be sure to enter
  70. Xeach of the stores.
  71. X
  72. X.NH 2
  73. XTown Buildings
  74. X.LP
  75. XYou may enter any of the stores, if they are open, and
  76. Xbarter with the owner for items you can afford.
  77. XWhen bartering, you enter prices you will pay (or accept) for
  78. Xsome object.  You can either enter the absolute amount, or
  79. Xprecede a number with a plus or minus sign to give a positive or negative
  80. Xincrement on your previous offer.  If you have previously given an
  81. Xincrement or decrement amount, you can just type RETURN, and the program
  82. Xwill use the last increment amount that you typed.
  83. XBut be warned
  84. Xthat the owners can easily be insulted, and may even throw you
  85. Xout for a while if you insult them too often.  To enter a store,
  86. Xsimply move onto the entrance represented by the numbers 1
  87. Xthrough 6.
  88. X.LP
  89. XIf you consistently bargain well in a store, that is, you reach
  90. Xthe final offer much more often than not, then the store owner will
  91. Xeventually recognize that you are a superb haggler, and will go directly
  92. Xto the final offer instead of haggling with you.  Items which cost
  93. Xless than 10 gold pieces do not count, as haggling well with these items
  94. Xis usually either very easy or almost impossible.
  95. XAlso, the store owner will always haggle for items costing more than
  96. X1000 gold pieces, because of the amount of money involved.
  97. X.LP
  98. XOnce inside a store, the store inventory will appear on the screen
  99. Xalong with a set of options for your character.  You may browse
  100. Xthe store's inventory if it takes more than one page to display,
  101. Xand you may sell to, or purchase items from, his inventory.  You can
  102. Xexecute your inventory and equipment commands to see what you are
  103. Xcarrying.  Not shown with the options are the wear, take off, and
  104. Xexchange commands which will also work, but were excluded to keep
  105. Xthe options simple.
  106. X.LP
  107. XStores do not always have everything in stock.  As the game
  108. Xprogresses, they may get new items so check from time to time.
  109. XAlso, if you sell them an item, it may get sold to a customer
  110. Xwhile you are adventuring, so don't always expect to be able to
  111. Xget back everything you have sold.
  112. X.LP
  113. XStore owners will not buy harmful or useless items.  If an
  114. Xobject is unidentified, they will pay you some base price for it.
  115. XOnce they have bought it they will immediately identify the
  116. Xobject.  If it is a good object, they will add it to their
  117. Xinventory.  If it was a bad bargain, they simply throw the item
  118. Xaway.  In any case, you may receive some knowledge of the item if
  119. Xanother is encountered.
  120. X.IP "The General Store"
  121. XThe General Store sells foods, drinks, some clothing,
  122. Xtorches, lamps, oil, shovels, picks, and spikes.  All of these items,
  123. Xand some others,
  124. Xcan be sold back to the General store for money.  The entrance to
  125. Xthe General Store is a `1'.
  126. X.IP "The Armory"
  127. XThe Armory is where the town's armor is fashioned.  All
  128. Xsorts of protective gear may be bought and sold here.  The
  129. Xentrance to the Armory is a `2'.
  130. X.IP "The Weaponsmith\'s Shop"
  131. XThe Weaponsmith's Shop is where the town's weapons are
  132. Xfashioned.  Hand and missile weapons may be purchased and sold
  133. Xhere, along with arrows, bolts, and shots.  The entrance to the
  134. XWeaponsmith's is a `3'.
  135. X.IP "The Temple"
  136. XThe Temple deals in healing and restoration potions, as well
  137. Xas bless scrolls, word of recall scrolls, some approved priestly
  138. Xweapons, etc.  The entrance to the Temple is a `4'.
  139. X.IP "The Alchemy shop"
  140. XThe Alchemy Shop deals in all manner of potions and scrolls.
  141. XThe entrance to the Alchemy Shop is a `5'.
  142. X.IP "The Magic User\'s Shop"
  143. XThe Magic User's Shop is the most expensive of all the
  144. Xstores.  It deals in all sorts of rings, wands, amulets, and
  145. Xstaves.  The entrance to the Magic Shop is a `6'.
  146. X
  147. X.NH 1
  148. XWithin The Dungeon
  149. X.LP
  150. XOnce your character is adequately supplied with food, light,
  151. Xarmor, and weapons, he is ready to enter the dungeon.  Move on
  152. Xtop of the `>' symbol and use the down `>' command.  Your
  153. Xcharacter enters a maze of interconnecting staircases and finally
  154. Xpasses through a one-way door.  He is now on the first level of
  155. Xthe dungeon (50 feet), and must survive many horrible and
  156. Xchallenging encounters to find the treasure lying about.
  157. X.LP
  158. XThere are two sources for light once inside the dungeon.
  159. XPermanent light which has been magically placed within rooms, and
  160. Xa light source carried by the player.  If neither is present, the
  161. Xcharacter will be unable to map or see any attackers.  Lack of
  162. Xlight will also affect searching, picking locks, and disarming.
  163. X.LP
  164. XA character must wield a torch or lamp in order to supply
  165. Xhis own light.  Once a torch or lamp has only 50 or less turns
  166. Xleft before burning out, the message \*QYour light is growing faint\*U
  167. Xwill be displayed at random intervals.  Once a torch is burnt
  168. Xout, it is useless and can be dropped.  A lamp or lantern can be
  169. Xrefilled with oil by using the Fill `F' command.  You must of
  170. Xcourse be carrying extra oil to refill a lantern.
  171. X
  172. X.NH 1
  173. XAttacking and Being Attacked
  174. X.LP
  175. XAttacking is simple in \fImoria\fP.  If you move into a creature,
  176. Xyou attack him.  You can attack from a distance by firing a
  177. Xmissile, or by magical means such as aiming a wand.  Creatures
  178. Xattack in the same way, if they move into you, they attack you.
  179. XSome creatures can also cast spells from a distance, and others
  180. Xcan breathe fire or worse on you from a distance.
  181. X.LP
  182. XCreatures moving in walls can not be attacked by wands and other magic
  183. Xattacks normally stopped by walls.  You can attack a creature in a wall
  184. Xnormally though by trying to move into the wall space containing the
  185. Xcreature.  However, in order to attack an invisible creature in
  186. Xa wall, you must tunnel into the wall containing the creature.  If you
  187. Xjust try to move into the wall, you will bump your head and look quite
  188. Xsilly.
  189. X.LP
  190. XIf you are wielding a weapon, the damage for the weapon is
  191. Xused when you hit a creature.  Otherwise
  192. Xyou get two fist strikes.  Very strong creatures can do
  193. Xa lot of damage with their fists...  You may have a
  194. Xprimary weapon, and a secondary weapon which is kept on your
  195. Xbelt or shoulder for immediate use.  You can switch
  196. Xbetween your primary and secondary weapons with the exchange
  197. Xcommand.  Be sure to wield the proper weapon when
  198. Xfighting.  Hitting a dragon over the head with a bow will simply
  199. Xmake him mad, and get you killed.
  200. X.LP
  201. XMissile weapons, such as bows, can be wielded, and then the
  202. Xproper missile, in this case an arrow, can be fired across the
  203. Xroom into a target.  Missiles can be used without the proper
  204. Xmissile weapon, but used together they have a greater range and
  205. Xdo far more damage.
  206. X.LP
  207. XHits and misses are determined by ability to hit versus armor
  208. Xclass.  A hit is a strike that does some damage;
  209. Xa miss may in fact reach a target, but fails to do any damage.
  210. XHigher armor classes
  211. Xmake it harder to do damage, and so lead to more misses.
  212. X
  213. X.NH 2
  214. XMonster Memories.
  215. X.LP
  216. XThere are hundreds of different creatures in the mines of \fImoria\fP,
  217. Xmany of which look the same on the screen.
  218. XThe exact species of a creature can be discovered by looking at it.
  219. XIt is also very difficult to keep track of the capabilities of
  220. Xvarious creatures.  Rather than forcing you to keep notes, \fImoria\fP
  221. Xautomatically keeps track of your experiences with a particular
  222. Xcreature.  This is called the monster memory.  Your monster memory
  223. Xrecalls the particular attacks of each creature (whether or not
  224. Xtechnically a monster) which you have suffered, as well as recalling
  225. Xif you have observed them to multiply or move erratically, or drop
  226. Xtreasure, or many other attributes.
  227. X.LP
  228. XIf you have killed enough of a particular creature, or suffered
  229. Xenough attacks, recalling the monster memory may also provide you with
  230. Xinformation not otherwise available, such as a armor class or hit dice.
  231. XThese are not explained, but may be useful to give the relative danger
  232. Xof each creature.  This memory can be passed on to a new character
  233. Xeven after you die, by means of a reduced save file.
  234. X
  235. X.NH 2
  236. XYour Weapon
  237. X.LP
  238. XCarrying a weapon in your backpack does you no good.  You
  239. Xmust wield a weapon before it can be used in a fight.
  240. XA secondary weapon can be kept by wielding it and then using the
  241. Xexchange command.  A secondary weapon is not in use, simply
  242. Xready to be switched with the current weapon if needed.
  243. X.LP
  244. XWeapons have two main characteristics, their ability to hit
  245. Xand their ability to do damage, expressed as `(+#,+#)'.  A normal
  246. Xweapon would be `(+0,+0)'.  Many weapons in \fImoria\fP have magical
  247. Xbonuses to hit and/or do damage.  Some weapons are cursed, and
  248. Xhave penalties that hurt the player.  Cursed weapons
  249. Xcannot be unwielded until the curse is lifted.
  250. X.LP
  251. X\fIMoria\fP assumes that your youth in the rough environment
  252. Xnear the dungeons
  253. Xhas taught you the relative merits of different
  254. Xweapons, and displays as part of their description the damage dice which
  255. Xdefine their capabilities.
  256. XThe ability to damage is added to the dice roll for that weapon.
  257. XThe dice used for a given weapon is displayed as `#d#'.  The first
  258. Xnumber indicates how many dice to roll, and the second indicates how many
  259. Xsides they have.  A \*Q2d6\*U weapon will give damage from 2 to 12, plus any
  260. Xdamage bonus.  The weight of a weapon is also a consideration.  Heavy
  261. Xweapons may hit harder, but they are also harder to use.
  262. XDepending on your strength and the weight of the weapon, you may get
  263. Xseveral hits in one turn.
  264. X.LP
  265. XMissile booster weapons, such as bows, have their characteristics added
  266. Xto those of the missile used, if the proper weapon/missile combination
  267. Xis used.  Also, these weapons will multiply the base damage of the missile
  268. Xby a number from 2 to 4, depending on the strength of the weapon.  This
  269. Xmultiplier is displayed as `(*#)'.
  270. X.LP
  271. XAlthough you receive any magical bonuses an unidentified
  272. Xweapon may possess when you wield it, those bonuses will not be
  273. Xadded in to the displayed values of to-hit and to-dam on your
  274. Xcharacter sheet.  You must identify the weapon before the
  275. Xdisplayed values reflect the real values used.
  276. X.LP
  277. XFinally, some rare weapons have special abilities.  These are
  278. Xcalled ego weapons, and are feared by great and meek.  An ego
  279. Xsword must be wielded to receive benefit of its abilities.
  280. X.LP
  281. XSpecial weapons are denoted by the following abbreviations:
  282. X.IP "DF - Defender."
  283. XA magical weapon that actually helps the wielder defend
  284. Xhimself, thus increasing his/her armor class, and protecting him/her
  285. Xagainst damage from fire, frost, acid, lightning, and falls.
  286. XThis weapon also will increase your stealth, let you see invisible
  287. Xcreatures, protect you from paralyzation attacks, and help you
  288. Xregenerate hit points and mana faster.  As a result of the
  289. Xregerenation ability, you will use up food faster than normal
  290. Xwhile wielding such a weapon.
  291. X.IP "FB - Frost Brand."
  292. XA magical weapon of ice that delivers a cold critical to
  293. Xheat based creatures.  It will inflict one and a half times
  294. Xthe normal damage when used against a heat based creature.
  295. X.IP "FT - Flame Tongue."
  296. XA magical weapon of flame that delivers a heat critical
  297. Xto cold based creatures.  It will inflict one and a half times
  298. Xthe normal damage when used against cold based or
  299. Xinflammable creatures.
  300. X.IP "HA - Holy Avenger."
  301. XA Holy Avenger is one of the most powerful of weapons.
  302. XA Holy Avenger will increase your strength and your armor class.
  303. XThis weapon will do extra damage when used against evil and undead
  304. Xcreatures, and will also give you the ability to see invisible
  305. Xcreatures.
  306. X.IP "SD - Slay Dragon."
  307. XA Slay Dragon weapon is a special purpose weapon whose
  308. Xsole intent is to destroy dragon-kind.  Therefore, when used
  309. Xagainst a dragon, the amount of damage done is four
  310. Xtimes the normal amount.
  311. X.IP "SE - Slay Evil."
  312. XA Slay Evil weapon is a special purpose weapon whose
  313. Xsole intent is to destroy all forms of evil.  When used
  314. Xagainst an evil creature, either alive or undead, the damage
  315. Xdone twice the normal amount.
  316. X.IP "SM - Slay Animal."
  317. XA Slay Animal weapon is a special purpose weapon whose
  318. Xsole intent is to destroy all the dangerous animals in the world.
  319. XAn animal is any creature natural to the world.
  320. XTherefore an orc would not be an animal, but a giant snake would
  321. Xbe.  This will inflict twice the normal amount of damage when
  322. Xused against an animal.
  323. X.IP "SU - Slay Undead."
  324. XA Slay Undead weapon is a special purpose weapon whose
  325. Xsole intent is to destroy all forms of undead.  This weapon
  326. Xis hated and feared by the intelligent undead, for a single
  327. Xblow from this weapon will inflict three times the normal
  328. Xamount of damage.
  329. XThis weapon also gives you the ability to see invisible creatures,
  330. Xwhich is especially useful against undead, since many of them
  331. Xare normally invisible.
  332. X
  333. X.NH 2
  334. XBody and Shield Bashes
  335. X.LP
  336. XWeight is the primary factor in being able to bash
  337. Xsomething, but strength plays a role too.  After bashing, a
  338. Xcharacter may be off balance for several rounds depending upon
  339. Xhis dexterity.
  340. X.LP
  341. XDoors can be broken down by bashing them.  Once a door is
  342. Xbashed open, it is forever useless and cannot be closed.
  343. X.LP
  344. XChests too may be bashed open, but be warned that the
  345. Xcareless smashing of a chest often ruins the contents.  Bashing
  346. Xopen a chest will not disarm any traps it may contain, but does
  347. Xallow the strong and ignorant to see what is inside.
  348. X.LP
  349. XFinally, a creature may be bashed.  If a shield is currently
  350. Xbeing worn, the bash is a shield bash and will do more damage.
  351. XIn either case, a bash may throw an opponent off balance for a
  352. Xnumber of rounds, allowing a player to get in a free hit or more.
  353. XIf the player is thrown off balance, his opponent may get free
  354. Xhits on him.  This is a risky attack.
  355. X
  356. X.NH 2
  357. XYour Armor Class
  358. X.LP
  359. XArmor class is a number that describes the amount and the
  360. Xquality of armor being worn.  Armor class will generally run from
  361. Xabout 0 to 60, but could become negative or greater than 60 in
  362. Xrare cases.
  363. X.LP
  364. XThe larger your armor class, the more protective it is.  A
  365. Xnegative armor class would actually help get you hit.  Armor
  366. Xprotects you in three manners.  One, it makes you harder to be
  367. Xhit for damage.  A hit for no damage is the same as a miss.  Two,
  368. Xgood armor will absorb some of the damage that your character
  369. Xwould have taken.  An armor class of 30 would absorb 15% of any
  370. Xdamage meant for him.  Three, acid damage is reduced by
  371. Xwearing body armor.  It is obvious that a high armor class is a
  372. Xmust for surviving the lower levels of \fImoria\fP.
  373. X.LP
  374. XEach piece of armor has an armor class adjustment, and a
  375. Xmagical bonus.  Armor bought in town will have these values
  376. Xdisplayed with their description.  Armor that is found within the
  377. Xdungeon must be identified before these values will be displayed.
  378. XAll armor always has the base armor class displayed, to which the
  379. Xbonus is added.  It is always possible to figure this out anyway,
  380. Xby watching the effect it has on your displayed armor class.
  381. X.LP
  382. XArmor class values are always displayed between a set of
  383. Xbrackets as `[#]' or `[#,+#]'.  The first value is the armor
  384. Xclass of the item.  The
  385. Xsecond number is the magical bonus of the item which is only
  386. Xdisplayed if known, and will always
  387. Xhave a sign preceding the value.  There are a few cases where the
  388. Xform `[+#]' is used, meaning the object has no armor class, only
  389. Xa magical armor bonus if worn.
  390. X.LP
  391. XSome pieces of armor will possess special abilities denoted
  392. Xby the following abbreviations:
  393. X.IP "RA - Resist Acid."
  394. XA character using such an object will take only one third normal
  395. Xdamage from any acid thrown upon him.  In addition, armor so
  396. Xenchanted will resist the acid's effects and not be damaged
  397. Xby it.
  398. X.IP "RC - Resist Cold."
  399. XA character using a resist cold object will take only
  400. Xone third damage from frost and cold.
  401. X.IP "RF - Resist Fire."
  402. XA character using a resist fire object will take only one
  403. Xthird damage from heat and fire.
  404. X.IP "RL - Resist Lightning."
  405. XA character using a resist lightning object will take only
  406. Xone third damage from electrical attacks.
  407. X.IP "R - Resistance."
  408. XA character wearing armor with this ability will have
  409. Xresistance to Acid, Cold, Fire, and Lightning as explained in
  410. Xeach part above.
  411. X
  412. X.NH 2
  413. XCrowns
  414. X.LP
  415. XSome crowns also have special magical abilities that improve
  416. Xyour chances in a battle.
  417. X.IP "Crown of Might"
  418. XThis is the great crown of the warriors.  The wearer will
  419. Xhave an increased strength, dexterity, and constituion, and will also be
  420. Ximmune to any foe's attempt to slow or paralyze him or her.
  421. X.IP "Crown of the Magi"
  422. X This is the great crown of the wizards.  The wearer will have
  423. Xan increased intelligence, and will also be given resistance against
  424. Xfire, frost, acid, and lightning.
  425. X.IP "Crown of Lordliness"
  426. XThis is the great crown of the priests.  The wearer will have
  427. Xan increased wisdom and charisma.
  428. X.IP "Crown of Seeing"
  429. XThis is the great crown of the rogues.  The wearer will be able
  430. Xto see even invisible creatures, and will have an increased ability
  431. Xto locate traps and secret doors.
  432. X.IP "Crown of Regeneration"
  433. XThis crown will help you regenerate hit points and mana more quickly
  434. Xthan normal, allowing you to fight longer before needing to rest.
  435. XYou will use of food faster than normal while wearing this crown
  436. Xbecause of the regenerative effects.
  437. X.IP "Crown of Beauty"
  438. XThis crown looks impressive, and will increase your charisma, but
  439. Xis otherwise not useful.
  440. X
  441. X.NH 1
  442. XObjects Found In The Dungeon
  443. X.LP
  444. XThe mines are full of objects just waiting to be picked up
  445. Xand used.  How did they get there?  Well, the main source for
  446. Xuseful items are all the foolish adventurers that proceeded into
  447. Xthe dungeon before you.  They get killed, and the helpful
  448. Xcreatures scatter the various treasure throughout the dungeon.
  449. XMost cursed items are placed there by the joyful evil sorcerers,
  450. Xwho enjoy a good joke when it gets you killed.
  451. X.LP
  452. XYou pick up objects by moving on top of them.  You can carry
  453. Xup to 22 different items in your backpack while wearing and
  454. Xwielding many others.  Although you are limited to 22
  455. Xdifferent items, you may be carrying several items of each kind
  456. Xrestricted only by the amount of weight your character can carry.
  457. XYour weight limit is determined by your strength.
  458. XOnly one object may occupy a given floor location, which
  459. Xmay or may not also contain one creature.  Doors, traps,
  460. Xand staircases are considered objects for this purpose.
  461. X.LP
  462. XIf you try to carry more weight than your limit, you will move
  463. Xmore slowly than normal until you drop the extra weight.  If picking
  464. Xup an object would take you over your weight limit, then you will
  465. Xbe asked whether you really want to pick it up.  It is a good idea
  466. Xto leave the object alone if you are fleeing from a monster.
  467. X.LP
  468. XMany objects found within the dungeon have special commands
  469. Xfor their use.  Wands must be Aimed, staves must be Used, scrolls
  470. Xmust be Read, and potions must be Quaffed.  In any case, you must
  471. Xfirst be able to carry an object before you can use it.  Some
  472. Xobjects, such as chests, are very complex.  Chests contain other
  473. Xobjects and may be trapped, and/or locked.  Read the list of
  474. Xplayer commands carefully for a further understanding of chests.
  475. X.LP
  476. XOne item in particular will be discussed here.  The scroll
  477. Xof \*QWord of Recall\*U can be found within the dungeon, or bought at
  478. Xthe temple in town.  It acts in two manners, depending upon your
  479. Xcurrent location.  If read within the dungeon, it will teleport
  480. Xyou back to town.  If read in town, it will teleport you back
  481. Xdown to the deepest level of the dungeon one which your character
  482. Xhas previously been.  This makes the scroll very useful for
  483. Xgetting back to the deeper levels of \fImoria\fP.  Once the scroll has
  484. Xbeen read it takes a while for the spell to act, so don't expect
  485. Xit to save you in a crisis.
  486. X.LP
  487. XThe game provides some automatic inscriptions to help you keep track
  488. Xof your possessions.  Wands and staves which are known to be empty
  489. Xwill be inscribed with \*Qempty\*U.  Objects which have been tried
  490. Xat least once, but haven't been identified yet will be inscribed with
  491. X\*Qtried\*U.  Cursed objects are inscribed with \*Qdamned\*U.  Also,
  492. Xoccasionally you will notice that something in your inventory or
  493. Xequipment list seems to be magical.  High level characters are much
  494. Xmore likely to notice this than beginning characters.  When you do
  495. Xnotice this, the item in question will be inscribed with \*Qmagik\*U.
  496. X.LP
  497. XAnd lastly, a final warning: not all objects are what they
  498. Xseem.  Skeletons lying peacefully about the dungeon have been
  499. Xknown to get up...
  500. X
  501. X.NH 2
  502. XCursed Objects
  503. X.LP
  504. XSome objects, mainly armor and weapons, have had curses laid
  505. Xupon them.  These horrible objects will look like any other
  506. Xnormal item, but will detract from your character's stats or
  507. Xabilities if worn.  They will also be impossible to remove until
  508. Xa remove curse is done.
  509. X.LP
  510. XIf you wear or wield a cursed item, you will immediately feel
  511. Xsomething wrong.  The item will also be inscribed \*Qdamned\*U.
  512. X
  513. X.NH 2
  514. XMining
  515. X.LP
  516. XMuch of the treasure within the dungeon can be found only by
  517. Xmining it out of the walls.  Many rich strikes exist within each
  518. Xlevel, but must be found and mined.  Quartz veins are the
  519. Xrichest, yielding the most metals and gems, but magma veins will
  520. Xhave some hordes hidden within.
  521. X.LP
  522. XMining is virtually impossible without a pick or shovel.
  523. XPicks and shovels have an additional magical ability expressed as `(+#)'.
  524. XThe higher the number, the better the magical digging
  525. Xability of the tool.  A pick or shovel also has pluses
  526. Xto hit and damage, and can be used as a weapon.
  527. X.LP
  528. XWhen a vein of quartz or magma is located, the character
  529. Xshould wield his pick or shovel and begin digging out a section.
  530. XWhen that section is removed, he should locate another section of
  531. Xthe vein, and begin the process again.  Since granite rock is
  532. Xmuch harder to dig through, it is much faster to follow the vein
  533. Xexactly and dig around the granite.
  534. XThere is an option for highlighting magma and quartz.
  535. X.LP
  536. XIf the character has a scroll or staff of treasure location,
  537. Xhe can immediately locate all strikes of treasure within a vein
  538. Xshown on the screen.  This makes mining much easier and more
  539. Xprofitable.
  540. X.LP
  541. XIt is sometimes possible to get a character trapped within
  542. Xthe dungeon by using various magical spells and items.  So it is
  543. Xa very good idea to always carry some kind of digging tool, even
  544. Xwhen you are not planning on tunneling for treasure.
  545. X
  546. X.NH 2
  547. XStaircases, Secret Doors, Passages, and Rooms
  548. X.LP
  549. XStaircases are the manner in which you get deeper, or climb
  550. Xout of the dungeon.  The symbols for the up and down staircases
  551. Xare the same as the commands to use them.  A `<' represents an up
  552. Xstaircase and a `>' represents a down staircase.  You must move
  553. Xyour character over the staircase before you can use them.
  554. X.LP
  555. XEach level has at least one up staircase, and at least two
  556. Xdown staircases.  There are no exceptions to this rule.  You may
  557. Xhave trouble finding some well hidden secret doors, but the
  558. Xstairs are there.
  559. X.LP
  560. XMany secret doors are used within the dungeon to confuse and
  561. Xdemoralize adventurers foolish enough to enter.  But with some
  562. Xluck, and lots of concentration, you can find these secret doors.
  563. XSecret doors will sometimes hide rooms or corridors, or even
  564. Xentire sections of that level of the dungeon.  Sometimes they
  565. Xsimply hide small empty closets or even dead ends.
  566. X.LP
  567. XCreatures in the dungeon will generally know and use these
  568. Xsecret doors.  If they leave one open, you will be able to go
  569. Xright through it.  If they close it behind them you will have to
  570. Xsearch for the catch first.  Once a secret door has been
  571. Xdiscovered by you, it is drawn as a known door and no more
  572. Xsearching will be required to use it.
  573. X
  574. X.NH 1
  575. XWinning The Game
  576. X.LP
  577. XOnce your character has progressed into killing dragons with
  578. Xbut a mean glance and snap of his fingers, he may be ready to
  579. Xtake on the Balrog.  The Balrog will appear on most levels after
  580. Xlevel 49, so don't go down there until you are ready for him.
  581. X.LP
  582. XThe Balrog cannot be killed in some of the easier methods
  583. Xused on normal creatures.  Because of the Balrog's cunning, he
  584. Xwill teleport away to another level if a spell such as destruction
  585. Xis used upon him, and the Balrog cannot be polymorphed, slept,
  586. Xcharmed, or genocided.
  587. XMagical spells like coldball are effective against him
  588. Xas are weapons, but he is difficult to kill and if allowed to
  589. Xescape for a time can heal himself.
  590. X.LP
  591. XIf you should actually survive the attempt of killing the
  592. XBalrog, you will receive the status of WINNER.  Since you have
  593. Xdefeated the toughest creature alive, your character is ready to
  594. Xretire and cannot be saved.  When you quit the game, your
  595. Xcharacter receives a surprise bonus score.
  596. X
  597. X.NH 1
  598. XUpon Death and Dying
  599. X.LP
  600. XIf your character falls below 0 hit points, he has died and
  601. Xcannot be restored.  A tombstone showing information about your
  602. Xcharacter will be displayed.
  603. XYou are also permitted to get a record of your character, and all
  604. Xyour equipment (identified) either on the screen or in a file.
  605. X.LP
  606. XYour character will leave behind a reduced save file, which contains
  607. Xonly the monster memory and your option choices.  It may be restored,
  608. Xin which case the new character is generated exactly as if the file
  609. Xwas not there, but the new player will find his monster memory
  610. Xcontaining all the experience of past incarnations.
  611. X
  612. X.NH 1
  613. XWizards
  614. X.LP
  615. XThere are rumors of \fImoria\fP Wizards which, if asked nicely,
  616. Xcan explain details of the \fImoria\fP game that seem complicated to
  617. Xbeginners.
  618. END_OF_FILE
  619. if test 26700 -ne `wc -c <'doc/moria2.ms'`; then
  620.     echo shar: \"'doc/moria2.ms'\" unpacked with wrong size!
  621. fi
  622. # end of 'doc/moria2.ms'
  623. fi
  624. if test -f 'source/misc2.c' -a "${1}" != "-c" ; then 
  625.   echo shar: Will not clobber existing file \"'source/misc2.c'\"
  626. else
  627. echo shar: Extracting \"'source/misc2.c'\" \(26765 characters\)
  628. sed "s/^X//" >'source/misc2.c' <<'END_OF_FILE'
  629. X/* source/misc2.c: misc utility and initialization code, magic objects code
  630. X
  631. X   Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke
  632. X
  633. X   This software may be copied and distributed for educational, research, and
  634. X   not for profit purposes provided that this copyright and statement are
  635. X   included in all such copies. */
  636. X
  637. X#ifdef __TURBOC__
  638. X#include    <stdio.h>
  639. X#endif /* __TURBOC__ */
  640. X
  641. X#include "config.h"
  642. X#include "constant.h"
  643. X#include "types.h"
  644. X#include "externs.h"
  645. X
  646. X
  647. X/* Chance of treasure having magic abilities        -RAK-    */
  648. X/* Chance increases with each dungeon level             */
  649. Xvoid magic_treasure(x, level)
  650. Xint x, level;
  651. X{
  652. X  register inven_type *t_ptr;
  653. X  register int chance, special, cursed, i;
  654. X  int tmp;
  655. X#ifdef ATARIST_MWC
  656. X  int32u holder;
  657. X#endif
  658. X
  659. X  chance = OBJ_BASE_MAGIC + level;
  660. X  if (chance > OBJ_BASE_MAX)
  661. X    chance = OBJ_BASE_MAX;
  662. X  special = chance / OBJ_DIV_SPECIAL;
  663. X  cursed  = (10 * chance) / OBJ_DIV_CURSED;
  664. X  t_ptr = &t_list[x];
  665. X
  666. X  /* some objects appear multiple times in the object_list with different
  667. X     levels, this is to make the object occur more often, however, for
  668. X     consistency, must set the level of these duplicates to be the same
  669. X     as the object with the lowest level */
  670. X
  671. X  /* Depending on treasure type, it can have certain magical properties*/
  672. X  switch (t_ptr->tval)
  673. X    {
  674. X    case TV_SHIELD: case TV_HARD_ARMOR: case TV_SOFT_ARMOR:
  675. X      if (magik(chance))
  676. X    {
  677. X      t_ptr->toac += m_bonus(1, 30, level);
  678. X      if (magik(special))
  679. X        switch(randint(9))
  680. X          {
  681. X          case 1:
  682. X#ifdef ATARIST_MWC
  683. X        t_ptr->flags |= (holder = TR_RES_LIGHT|TR_RES_COLD|TR_RES_ACID|
  684. X                 TR_RES_FIRE);
  685. X#else
  686. X        t_ptr->flags |= (TR_RES_LIGHT|TR_RES_COLD|TR_RES_ACID|
  687. X                 TR_RES_FIRE);
  688. X#endif
  689. X        t_ptr->name2 = SN_R;
  690. X        t_ptr->toac += 5;
  691. X        t_ptr->cost += 2500;
  692. X        break;
  693. X          case 2:     /* Resist Acid      */
  694. X#ifdef ATARIST_MWC
  695. X        t_ptr->flags |= (holder = TR_RES_ACID);
  696. X#else
  697. X        t_ptr->flags |= TR_RES_ACID;
  698. X#endif
  699. X        t_ptr->name2 = SN_RA;
  700. X        t_ptr->cost += 1000;
  701. X        break;
  702. X          case 3: case 4:     /* Resist Fire      */
  703. X#ifdef ATARIST_MWC
  704. X        t_ptr->flags |= (holder = TR_RES_FIRE);
  705. X#else
  706. X        t_ptr->flags |= TR_RES_FIRE;
  707. X#endif
  708. X        t_ptr->name2 = SN_RF;
  709. X        t_ptr->cost += 600;
  710. X        break;
  711. X          case 5: case 6:    /* Resist Cold     */
  712. X#ifdef ATARIST_MWC
  713. X        t_ptr->flags |= (holder = TR_RES_COLD);
  714. X#else
  715. X        t_ptr->flags |= TR_RES_COLD;
  716. X#endif
  717. X        t_ptr->name2 = SN_RC;
  718. X        t_ptr->cost += 600;
  719. X        break;
  720. X          case 7: case 8: case 9:  /* Resist Lightning*/
  721. X#ifdef ATARIST_MWC
  722. X        t_ptr->flags |= (holder = TR_RES_LIGHT);
  723. X#else
  724. X        t_ptr->flags |= TR_RES_LIGHT;
  725. X#endif
  726. X        t_ptr->name2 = SN_RL;
  727. X        t_ptr->cost += 500;
  728. X        break;
  729. X          }
  730. X    }
  731. X      else if (magik(cursed))
  732. X    {
  733. X      t_ptr->toac -= m_bonus(1, 40, level);
  734. X      t_ptr->cost = 0;
  735. X#ifdef ATARIST_MWC
  736. X      t_ptr->flags |= (holder = TR_CURSED);
  737. X#else
  738. X      t_ptr->flags |= TR_CURSED;
  739. X#endif
  740. X    }
  741. X      break;
  742. X
  743. X    case TV_HAFTED: case TV_POLEARM: case TV_SWORD:
  744. X      /* always show tohit/todam values if identified */
  745. X      t_ptr->ident |= ID_SHOW_HITDAM;
  746. X      if (magik(chance))
  747. X    {
  748. X      t_ptr->tohit += m_bonus(0, 40, level);
  749. X      /* Magical damage bonus now proportional to weapon base damage */
  750. X      tmp = t_ptr->damage[0] * t_ptr->damage[1];
  751. X      t_ptr->todam += m_bonus(0, 4*tmp, tmp*level/10);
  752. X      /* the 3*special/2 is needed because weapons are not as common as
  753. X         before change to treasure distribution, this helps keep same
  754. X         number of ego weapons same as before, see also missiles */
  755. X      if (magik(3*special/2))
  756. X        switch(randint(16))
  757. X          {
  758. X          case 1:    /* Holy Avenger     */
  759. X#ifdef ATARIST_MWC
  760. X        t_ptr->flags |= (holder = TR_SEE_INVIS|TR_SUST_STAT|
  761. X                 TR_SLAY_UNDEAD|TR_SLAY_EVIL|TR_STR);
  762. X#else
  763. X        t_ptr->flags |= (TR_SEE_INVIS|TR_SUST_STAT|TR_SLAY_UNDEAD|
  764. X                 TR_SLAY_EVIL|TR_STR);
  765. X#endif
  766. X        t_ptr->tohit += 5;
  767. X        t_ptr->todam += 5;
  768. X        t_ptr->toac  += randint(4);
  769. X        /* the value in p1 is used for strength increase */
  770. X        /* p1 is also used for sustain stat */
  771. X        t_ptr->p1    = randint(4);
  772. X        t_ptr->name2 = SN_HA;
  773. X        t_ptr->cost += t_ptr->p1*500;
  774. X        t_ptr->cost += 10000;
  775. X        break;
  776. X          case 2:    /* Defender     */
  777. X#ifdef ATARIST_MWC
  778. X        t_ptr->flags |= (holder = TR_FFALL|TR_RES_LIGHT|TR_SEE_INVIS|
  779. X                 TR_FREE_ACT|TR_RES_COLD|TR_RES_ACID|
  780. X                 TR_RES_FIRE|TR_REGEN|TR_STEALTH);
  781. X#else
  782. X        t_ptr->flags |= (TR_FFALL|TR_RES_LIGHT|TR_SEE_INVIS|TR_FREE_ACT
  783. X                 |TR_RES_COLD|TR_RES_ACID|TR_RES_FIRE|
  784. X                 TR_REGEN|TR_STEALTH);
  785. X#endif
  786. X        t_ptr->tohit += 3;
  787. X        t_ptr->todam += 3;
  788. X        t_ptr->toac  += 5 + randint(5);
  789. X        t_ptr->name2 = SN_DF;
  790. X        /* the value in p1 is used for stealth */
  791. X        t_ptr->p1    = randint(3);
  792. X        t_ptr->cost += t_ptr->p1*500;
  793. X        t_ptr->cost += 7500;
  794. X        break;
  795. X          case 3: case 4:     /* Slay Animal  */
  796. X        t_ptr->flags |= TR_SLAY_ANIMAL;
  797. X        t_ptr->tohit += 3;
  798. X        t_ptr->todam += 3;
  799. X        t_ptr->name2 = SN_SA;
  800. X        t_ptr->cost += 5000;
  801. X        break;
  802. X          case 5: case 6:    /* Slay Dragon     */
  803. X        t_ptr->flags |= TR_SLAY_DRAGON;
  804. X        t_ptr->tohit += 3;
  805. X        t_ptr->todam += 3;
  806. X        t_ptr->name2 = SN_SD;
  807. X        t_ptr->cost += 4000;
  808. X        break;
  809. X          case 7: case 8:      /* Slay Evil       */
  810. X        t_ptr->flags |= TR_SLAY_EVIL;
  811. X        t_ptr->tohit += 3;
  812. X        t_ptr->todam += 3;
  813. X        t_ptr->name2 = SN_SE;
  814. X        t_ptr->cost += 4000;
  815. X        break;
  816. X          case 9: case 10:     /* Slay Undead      */
  817. X#ifdef ATARIST_MWC
  818. X        t_ptr->flags |= (holder = TR_SEE_INVIS|TR_SLAY_UNDEAD);
  819. X#else
  820. X        t_ptr->flags |= (TR_SEE_INVIS|TR_SLAY_UNDEAD);
  821. X#endif
  822. X        t_ptr->tohit += 2;
  823. X        t_ptr->todam += 2;
  824. X        t_ptr->name2 = SN_SU;
  825. X        t_ptr->cost += 3000;
  826. X        break;
  827. X          case 11: case 12: case 13:   /* Flame Tongue  */
  828. X#ifdef ATARIST_MWC
  829. X        t_ptr->flags |= (holder = TR_FLAME_TONGUE);
  830. X#else
  831. X        t_ptr->flags |= TR_FLAME_TONGUE;
  832. X#endif
  833. X        t_ptr->tohit++;
  834. X        t_ptr->todam += 3;
  835. X        t_ptr->name2 = SN_FT;
  836. X        t_ptr->cost += 2000;
  837. X        break;
  838. X          case 14: case 15: case 16:   /* Frost Brand   */
  839. X#ifdef ATARIST_MWC
  840. X        t_ptr->flags |= (holder = TR_FROST_BRAND);
  841. X#else
  842. X        t_ptr->flags |= TR_FROST_BRAND;
  843. X#endif
  844. X        t_ptr->tohit++;
  845. X        t_ptr->todam++;
  846. X        t_ptr->name2 = SN_FB;
  847. X        t_ptr->cost += 1200;
  848. X        break;
  849. X          }
  850. X    }
  851. X      else if (magik(cursed))
  852. X    {
  853. X      t_ptr->tohit -= m_bonus(1, 55, level);
  854. X      /* Magical damage bonus now proportional to weapon base damage */
  855. X      tmp = t_ptr->damage[0] * t_ptr->damage[1];
  856. X      t_ptr->todam -= m_bonus(1, 11*tmp/2, tmp*level/10);
  857. X#ifdef ATARIST_MWC
  858. X      t_ptr->flags |= (holder = TR_CURSED);
  859. X#else
  860. X      t_ptr->flags |= TR_CURSED;
  861. X#endif
  862. X      t_ptr->cost = 0;
  863. X    }
  864. X      break;
  865. X
  866. X    case TV_BOW:
  867. X      /* always show tohit/todam values if identified */
  868. X      t_ptr->ident |= ID_SHOW_HITDAM;
  869. X      if (magik(chance))
  870. X    {
  871. X      t_ptr->tohit += m_bonus(1, 30, level);
  872. X      t_ptr->todam += m_bonus(1, 20, level); /* add damage. -CJS- */
  873. X    }
  874. X      else if (magik(cursed))
  875. X    {
  876. X      t_ptr->tohit -= m_bonus(1, 50, level);
  877. X      t_ptr->todam -= m_bonus(1, 30, level); /* add damage. -CJS- */
  878. X#ifdef ATARIST_MWC
  879. X      t_ptr->flags |= (holder = TR_CURSED);
  880. X#else
  881. X      t_ptr->flags |= TR_CURSED;
  882. X#endif
  883. X      t_ptr->cost = 0;
  884. X    }
  885. X      break;
  886. X
  887. X    case TV_DIGGING:
  888. X      /* always show tohit/todam values if identified */
  889. X      t_ptr->ident |= ID_SHOW_HITDAM;
  890. X      if (magik(chance))
  891. X    {
  892. X      tmp = randint(3);
  893. X      if (tmp < 3)
  894. X        t_ptr->p1 += m_bonus(0, 25, level);
  895. X      else
  896. X        {
  897. X          /* a cursed digging tool */
  898. X          t_ptr->p1 = -m_bonus(1, 30, level);
  899. X          t_ptr->cost = 0;
  900. X#ifdef ATARIST_MWC
  901. X          t_ptr->flags |= (holder = TR_CURSED);
  902. X#else
  903. X          t_ptr->flags |= TR_CURSED;
  904. X#endif
  905. X        }
  906. X    }
  907. X      break;
  908. X
  909. X    case TV_GLOVES:
  910. X      if (magik(chance))
  911. X    {
  912. X      t_ptr->toac += m_bonus(1, 20, level);
  913. X      if (magik(special))
  914. X        {
  915. X          if (randint(2) == 1)
  916. X        {
  917. X#ifdef ATARIST_MWC
  918. X          t_ptr->flags |= (holder = TR_FREE_ACT);
  919. X#else
  920. X          t_ptr->flags |= TR_FREE_ACT;
  921. X#endif
  922. X          t_ptr->name2 = SN_FREE_ACTION;
  923. X          t_ptr->cost += 1000;
  924. X        }
  925. X          else
  926. X        {
  927. X          t_ptr->ident |= ID_SHOW_HITDAM;
  928. X          t_ptr->tohit += 1 + randint(3);
  929. X          t_ptr->todam += 1 + randint(3);
  930. X          t_ptr->name2 = SN_SLAYING;
  931. X          t_ptr->cost += (t_ptr->tohit+t_ptr->todam)*250;
  932. X        }
  933. X        }
  934. X    }
  935. X      else if (magik(cursed))
  936. X    {
  937. X      if (magik(special))
  938. X        {
  939. X          if (randint(2) == 1)
  940. X        {
  941. X          t_ptr->flags |= TR_DEX;
  942. X          t_ptr->name2 = SN_CLUMSINESS;
  943. X        }
  944. X          else
  945. X        {
  946. X          t_ptr->flags |= TR_STR;
  947. X          t_ptr->name2 = SN_WEAKNESS;
  948. X        }
  949. X          t_ptr->ident |= ID_SHOW_P1;
  950. X          t_ptr->p1   = -m_bonus(1, 10, level);
  951. X        }
  952. X      t_ptr->toac -= m_bonus(1, 40, level);
  953. X#ifdef ATARIST_MWC
  954. X      t_ptr->flags |= (holder = TR_CURSED);
  955. X#else
  956. X      t_ptr->flags |= TR_CURSED;
  957. X#endif
  958. X      t_ptr->cost = 0;
  959. X    }
  960. X      break;
  961. X
  962. X    case TV_BOOTS:
  963. X      if (magik(chance))
  964. X    {
  965. X      t_ptr->toac += m_bonus(1, 20, level);
  966. X      if (magik(special))
  967. X        {
  968. X          tmp = randint(12);
  969. X          if (tmp > 5)
  970. X        {
  971. X#ifdef ATARIST_MWC
  972. X          t_ptr->flags |= (holder = TR_FFALL);
  973. X#else
  974. X          t_ptr->flags |= TR_FFALL;
  975. X#endif
  976. X          t_ptr->name2 = SN_SLOW_DESCENT;
  977. X          t_ptr->cost += 250;
  978. X        }
  979. X          else if (tmp == 1)
  980. X        {
  981. X          t_ptr->flags |= TR_SPEED;
  982. X          t_ptr->name2 = SN_SPEED;
  983. X          t_ptr->ident |= ID_SHOW_P1;
  984. X          t_ptr->p1 = 1;
  985. X          t_ptr->cost += 5000;
  986. X        }
  987. X          else /* 2 - 5 */
  988. X        {
  989. X          t_ptr->flags |= TR_STEALTH;
  990. X          t_ptr->ident |= ID_SHOW_P1;
  991. X          t_ptr->p1 = randint(3);
  992. X          t_ptr->name2 = SN_STEALTH;
  993. X          t_ptr->cost += 500;
  994. X        }
  995. X        }
  996. X    }
  997. X      else if (magik(cursed))
  998. X    {
  999. X      tmp = randint(3);
  1000. X      if (tmp == 1)
  1001. X        {
  1002. X          t_ptr->flags |= TR_SPEED;
  1003. X          t_ptr->name2 = SN_SLOWNESS;
  1004. X          t_ptr->ident |= ID_SHOW_P1;
  1005. X          t_ptr->p1 = -1;
  1006. X        }
  1007. X      else if (tmp == 2)
  1008. X        {
  1009. X          t_ptr->flags |= TR_AGGRAVATE;
  1010. X          t_ptr->name2 = SN_NOISE;
  1011. X        }
  1012. X      else
  1013. X        {
  1014. X          t_ptr->name2 = SN_GREAT_MASS;
  1015. X          t_ptr->weight = t_ptr->weight * 5;
  1016. X        }
  1017. X      t_ptr->cost = 0;
  1018. X      t_ptr->toac -= m_bonus(2, 45, level);
  1019. X#ifdef ATARIST_MWC
  1020. X      t_ptr->flags |= (holder = TR_CURSED);
  1021. X#else
  1022. X      t_ptr->flags |= TR_CURSED;
  1023. X#endif
  1024. X    }
  1025. X      break;
  1026. X
  1027. X    case TV_HELM:  /* Helms */
  1028. X      if ((t_ptr->subval >= 6) && (t_ptr->subval <= 8))
  1029. X    {
  1030. X      /* give crowns a higher chance for magic */
  1031. X      chance += (int) (t_ptr->cost / 100);
  1032. X      special += special;
  1033. X    }
  1034. X      if (magik(chance))
  1035. X    {
  1036. X      t_ptr->toac += m_bonus(1, 20, level);
  1037. X      if (magik(special))
  1038. X        {
  1039. X          if (t_ptr->subval < 6)
  1040. X        {
  1041. X          tmp = randint(3);
  1042. X          t_ptr->ident |= ID_SHOW_P1;
  1043. X          if (tmp == 1)
  1044. X            {
  1045. X              t_ptr->p1 = randint(2);
  1046. X              t_ptr->flags |= TR_INT;
  1047. X              t_ptr->name2 = SN_INTELLIGENCE;
  1048. X              t_ptr->cost += t_ptr->p1*500;
  1049. X            }
  1050. X          else if (tmp == 2)
  1051. X            {
  1052. X              t_ptr->p1 = randint(2);
  1053. X              t_ptr->flags |= TR_WIS;
  1054. X              t_ptr->name2 = SN_WISDOM;
  1055. X              t_ptr->cost += t_ptr->p1*500;
  1056. X            }
  1057. X          else
  1058. X            {
  1059. X              t_ptr->p1 = 1 + randint(4);
  1060. X#ifdef ATARIST_MWC
  1061. X              t_ptr->flags |= (holder = TR_INFRA);
  1062. X#else
  1063. X              t_ptr->flags |= TR_INFRA;
  1064. X#endif
  1065. X              t_ptr->name2 = SN_INFRAVISION;
  1066. X              t_ptr->cost += t_ptr->p1*250;
  1067. X            }
  1068. X        }
  1069. X          else
  1070. X        {
  1071. X          switch(randint(6))
  1072. X            {
  1073. X            case 1:
  1074. X              t_ptr->ident |= ID_SHOW_P1;
  1075. X              t_ptr->p1 = randint(3);
  1076. X#ifdef ATARIST_MWC
  1077. X              t_ptr->flags |= (holder = TR_FREE_ACT|TR_CON|TR_DEX|
  1078. X                       TR_STR);
  1079. X#else
  1080. X              t_ptr->flags |= (TR_FREE_ACT|TR_CON|TR_DEX|TR_STR);
  1081. X#endif
  1082. X              t_ptr->name2 = SN_MIGHT;
  1083. X              t_ptr->cost += 1000 + t_ptr->p1*500;
  1084. X              break;
  1085. X            case 2:
  1086. X              t_ptr->ident |= ID_SHOW_P1;
  1087. X              t_ptr->p1 = randint(3);
  1088. X              t_ptr->flags |= (TR_CHR|TR_WIS);
  1089. X              t_ptr->name2 = SN_LORDLINESS;
  1090. X              t_ptr->cost += 1000 + t_ptr->p1*500;
  1091. X              break;
  1092. X            case 3:
  1093. X              t_ptr->ident |= ID_SHOW_P1;
  1094. X              t_ptr->p1 = randint(3);
  1095. X#ifdef ATARIST_MWC
  1096. X              t_ptr->flags |= (holder = TR_RES_LIGHT|TR_RES_COLD|
  1097. X                       TR_RES_ACID|TR_RES_FIRE|TR_INT);
  1098. X#else
  1099. X              t_ptr->flags |= (TR_RES_LIGHT|TR_RES_COLD|TR_RES_ACID|
  1100. X                       TR_RES_FIRE|TR_INT);
  1101. X#endif
  1102. X              t_ptr->name2 = SN_MAGI;
  1103. X              t_ptr->cost += 3000 + t_ptr->p1*500;
  1104. X              break;
  1105. X            case 4:
  1106. X              t_ptr->ident |= ID_SHOW_P1;
  1107. X              t_ptr->p1 = randint(3);
  1108. X              t_ptr->flags |= TR_CHR;
  1109. X              t_ptr->name2 = SN_BEAUTY;
  1110. X              t_ptr->cost += 750;
  1111. X              break;
  1112. X            case 5:
  1113. X              t_ptr->ident |= ID_SHOW_P1;
  1114. X              t_ptr->p1 = 5*(1 + randint(4));
  1115. X#ifdef ATARIST_MWC
  1116. X              t_ptr->flags |= (holder = TR_SEE_INVIS|TR_SEARCH);
  1117. X#else
  1118. X              t_ptr->flags |= (TR_SEE_INVIS|TR_SEARCH);
  1119. X#endif
  1120. X              t_ptr->name2 = SN_SEEING;
  1121. X              t_ptr->cost += 1000 + t_ptr->p1*100;
  1122. X              break;
  1123. X            case 6:
  1124. X              t_ptr->flags |= TR_REGEN;
  1125. X              t_ptr->name2 = SN_REGENERATION;
  1126. X              t_ptr->cost += 1500;
  1127. X              break;
  1128. X            }
  1129. X        }
  1130. X        }
  1131. X    }
  1132. X      else if (magik(cursed))
  1133. X    {
  1134. X      t_ptr->toac -= m_bonus(1, 45, level);
  1135. X#ifdef ATARIST_MWC
  1136. X      t_ptr->flags |= (holder = TR_CURSED);
  1137. X#else
  1138. X      t_ptr->flags |= TR_CURSED;
  1139. X#endif
  1140. X      t_ptr->cost = 0;
  1141. X      if (magik(special))
  1142. X        switch(randint(7))
  1143. X          {
  1144. X          case 1:
  1145. X        t_ptr->ident |= ID_SHOW_P1;
  1146. X        t_ptr->p1 = -randint (5);
  1147. X        t_ptr->flags |= TR_INT;
  1148. X        t_ptr->name2 = SN_STUPIDITY;
  1149. X        break;
  1150. X          case 2:
  1151. X        t_ptr->ident |= ID_SHOW_P1;
  1152. X        t_ptr->p1 = -randint (5);
  1153. X        t_ptr->flags |= TR_WIS;
  1154. X        t_ptr->name2 = SN_DULLNESS;
  1155. X        break;
  1156. X          case 3:
  1157. X#ifdef ATARIST_MWC
  1158. X        t_ptr->flags |= (holder = TR_BLIND);
  1159. X#else
  1160. X        t_ptr->flags |= TR_BLIND;
  1161. X#endif
  1162. X        t_ptr->name2 = SN_BLINDNESS;
  1163. X        break;
  1164. X          case 4:
  1165. X#ifdef ATARIST_MWC
  1166. X        t_ptr->flags |= (holder = TR_TIMID);
  1167. X#else
  1168. X        t_ptr->flags |= TR_TIMID;
  1169. X#endif
  1170. X        t_ptr->name2 = SN_TIMIDNESS;
  1171. X        break;
  1172. X          case 5:
  1173. X        t_ptr->ident |= ID_SHOW_P1;
  1174. X        t_ptr->p1 = -randint (5);
  1175. X        t_ptr->flags |= TR_STR;
  1176. X        t_ptr->name2 = SN_WEAKNESS;
  1177. X        break;
  1178. X          case 6:
  1179. X        t_ptr->flags |= TR_TELEPORT;
  1180. X        t_ptr->name2 = SN_TELEPORTATION;
  1181. X        break;
  1182. X          case 7:
  1183. X        t_ptr->ident |= ID_SHOW_P1;
  1184. X        t_ptr->p1 = -randint (5);
  1185. X        t_ptr->flags |= TR_CHR;
  1186. X        t_ptr->name2 = SN_UGLINESS;
  1187. X        break;
  1188. X          }
  1189. X    }
  1190. X      break;
  1191. X
  1192. X    case TV_RING: /* Rings          */
  1193. X      switch(t_ptr->subval)
  1194. X    {
  1195. X    case 0: case 1: case 2: case 3:
  1196. X      if (magik(cursed))
  1197. X        {
  1198. X          t_ptr->p1 = -m_bonus(1, 20, level);
  1199. X#ifdef ATARIST_MWC
  1200. X          t_ptr->flags |= TR_CURSED;
  1201. X#else
  1202. X          t_ptr->flags |= TR_CURSED;
  1203. X#endif
  1204. X          t_ptr->cost = -t_ptr->cost;
  1205. X        }
  1206. X      else
  1207. X        {
  1208. X          t_ptr->p1 = m_bonus(1, 10, level);
  1209. X          t_ptr->cost += t_ptr->p1*100;
  1210. X        }
  1211. X      break;
  1212. X    case 4:
  1213. X      if (magik(cursed))
  1214. X        {
  1215. X          t_ptr->p1 = -randint(3);
  1216. X#ifdef ATARIST_MWC
  1217. X          t_ptr->flags |= (holder = TR_CURSED);
  1218. X#else
  1219. X          t_ptr->flags |= TR_CURSED;
  1220. X#endif
  1221. X          t_ptr->cost = -t_ptr->cost;
  1222. X        }
  1223. X      else
  1224. X        t_ptr->p1 = 1;
  1225. X      break;
  1226. X    case 5:
  1227. X      t_ptr->p1 = 5 * m_bonus(1, 20, level);
  1228. X      t_ptr->cost += t_ptr->p1*50;
  1229. X      if (magik (cursed))
  1230. X        {
  1231. X          t_ptr->p1 = -t_ptr->p1;
  1232. X#ifdef ATARIST_MWC
  1233. X          t_ptr->flags |= (holder = TR_CURSED);
  1234. X#else
  1235. X          t_ptr->flags |= TR_CURSED;
  1236. X#endif
  1237. X          t_ptr->cost = -t_ptr->cost;
  1238. X        }
  1239. X      break;
  1240. X    case 19:     /* Increase damage          */
  1241. X      t_ptr->todam += m_bonus(1, 20, level);
  1242. X      t_ptr->cost += t_ptr->todam*100;
  1243. X      if (magik(cursed))
  1244. X        {
  1245. X          t_ptr->todam = -t_ptr->todam;
  1246. X#ifdef ATARIST_MWC
  1247. X          t_ptr->flags |= (holder = TR_CURSED);
  1248. X#else
  1249. X          t_ptr->flags |= TR_CURSED;
  1250. X#endif
  1251. X          t_ptr->cost = -t_ptr->cost;
  1252. X        }
  1253. X      break;
  1254. X    case 20:     /* Increase To-Hit          */
  1255. X      t_ptr->tohit += m_bonus(1, 20, level);
  1256. X      t_ptr->cost += t_ptr->tohit*100;
  1257. X      if (magik(cursed))
  1258. X        {
  1259. X          t_ptr->tohit = -t_ptr->tohit;
  1260. X#ifdef ATARIST_MWC
  1261. X          t_ptr->flags |= (holder = TR_CURSED);
  1262. X#else
  1263. X          t_ptr->flags |= TR_CURSED;
  1264. X#endif
  1265. X          t_ptr->cost = -t_ptr->cost;
  1266. X        }
  1267. X      break;
  1268. X    case 21:     /* Protection          */
  1269. X      t_ptr->toac += m_bonus(1, 20, level);
  1270. X      t_ptr->cost += t_ptr->toac*100;
  1271. X      if (magik(cursed))
  1272. X        {
  1273. X          t_ptr->toac = -t_ptr->toac;
  1274. X#ifdef ATARIST_MWC
  1275. X          t_ptr->flags |= (holder = TR_CURSED);
  1276. X#else
  1277. X          t_ptr->flags |= TR_CURSED;
  1278. X#endif
  1279. X          t_ptr->cost = -t_ptr->cost;
  1280. X        }
  1281. X      break;
  1282. X    case 24: case 25: case 26:
  1283. X    case 27: case 28: case 29:
  1284. X      t_ptr->ident |= ID_NOSHOW_P1;
  1285. X      break;
  1286. X    case 30:     /* Slaying          */
  1287. X      t_ptr->ident |= ID_SHOW_HITDAM;
  1288. X      t_ptr->todam += m_bonus(1, 25, level);
  1289. X      t_ptr->tohit += m_bonus(1, 25, level);
  1290. X      t_ptr->cost += (t_ptr->tohit+t_ptr->todam)*100;
  1291. X      if (magik(cursed))
  1292. X        {
  1293. X          t_ptr->tohit = -t_ptr->tohit;
  1294. X          t_ptr->todam = -t_ptr->todam;
  1295. X#ifdef ATARIST_MWC
  1296. X          t_ptr->flags |= (holder = TR_CURSED);
  1297. X#else
  1298. X          t_ptr->flags |= TR_CURSED;
  1299. X#endif
  1300. X          t_ptr->cost = -t_ptr->cost;
  1301. X        }
  1302. X      break;
  1303. X    default:
  1304. X      break;
  1305. X    }
  1306. X      break;
  1307. X
  1308. X    case TV_AMULET: /* Amulets          */
  1309. X      if (t_ptr->subval < 2)
  1310. X    {
  1311. X      if (magik(cursed))
  1312. X        {
  1313. X          t_ptr->p1 = -m_bonus(1, 20, level);
  1314. X#ifdef ATARIST_MWC
  1315. X          t_ptr->flags |= (holder = TR_CURSED);
  1316. X#else
  1317. X          t_ptr->flags |= TR_CURSED;
  1318. X#endif
  1319. X          t_ptr->cost = -t_ptr->cost;
  1320. X        }
  1321. X      else
  1322. X        {
  1323. X          t_ptr->p1 = m_bonus(1, 10, level);
  1324. X          t_ptr->cost += t_ptr->p1*100;
  1325. X        }
  1326. X    }
  1327. X      else if (t_ptr->subval == 2)
  1328. X    {
  1329. X      t_ptr->p1 = 5 * m_bonus(1, 25, level);
  1330. X      if (magik(cursed))
  1331. X        {
  1332. X          t_ptr->p1 = -t_ptr->p1;
  1333. X          t_ptr->cost = -t_ptr->cost;
  1334. X#ifdef ATARIST_MWC
  1335. X          t_ptr->flags |= (holder = TR_CURSED);
  1336. X#else
  1337. X          t_ptr->flags |= TR_CURSED;
  1338. X#endif
  1339. X        }
  1340. X      else
  1341. X        t_ptr->cost += 50*t_ptr->p1;
  1342. X    }
  1343. X      else if (t_ptr->subval == 8)
  1344. X    {
  1345. X      /* amulet of the magi is never cursed */
  1346. X      t_ptr->p1 = 5 * m_bonus(1, 25, level);
  1347. X      t_ptr->cost += 20*t_ptr->p1;
  1348. X    }
  1349. X      break;
  1350. X
  1351. X      /* Subval should be even for store, odd for dungeon*/
  1352. X      /* Dungeon found ones will be partially charged     */
  1353. X    case TV_LIGHT:
  1354. X      if ((t_ptr->subval % 2) == 1)
  1355. X    {
  1356. X      t_ptr->p1 = randint(t_ptr->p1);
  1357. X      t_ptr->subval -= 1;
  1358. X    }
  1359. X      break;
  1360. X
  1361. X    case TV_WAND:
  1362. X      switch(t_ptr->subval)
  1363. X    {
  1364. X    case 0:      t_ptr->p1 = randint(10) +     6; break;
  1365. X    case 1:      t_ptr->p1 = randint(8)  +     6; break;
  1366. X    case 2:      t_ptr->p1 = randint(5)  +     6; break;
  1367. X    case 3:      t_ptr->p1 = randint(8)  +     6; break;
  1368. X    case 4:      t_ptr->p1 = randint(4)  +     3; break;
  1369. X    case 5:      t_ptr->p1 = randint(8)  +     6; break;
  1370. X    case 6:      t_ptr->p1 = randint(20) +     12; break;
  1371. X    case 7:      t_ptr->p1 = randint(20) +     12; break;
  1372. X    case 8:      t_ptr->p1 = randint(10) +     6; break;
  1373. X    case 9:      t_ptr->p1 = randint(12) +     6; break;
  1374. X    case 10:   t_ptr->p1 = randint(10) +     12; break;
  1375. X    case 11:   t_ptr->p1 = randint(3)  +     3; break;
  1376. X    case 12:   t_ptr->p1 = randint(8)  +     6; break;
  1377. X    case 13:   t_ptr->p1 = randint(10) +     6; break;
  1378. X    case 14:   t_ptr->p1 = randint(5)  +     3; break;
  1379. X    case 15:   t_ptr->p1 = randint(5)  +     3; break;
  1380. X    case 16:   t_ptr->p1 = randint(5)  +     6; break;
  1381. X    case 17:   t_ptr->p1 = randint(5)  +     4; break;
  1382. X    case 18:   t_ptr->p1 = randint(8)  +     4; break;
  1383. X    case 19:   t_ptr->p1 = randint(6)  +     2; break;
  1384. X    case 20:   t_ptr->p1 = randint(4)  +     2; break;
  1385. X    case 21:   t_ptr->p1 = randint(8)  +     6; break;
  1386. X    case 22:   t_ptr->p1 = randint(5)  +     2; break;
  1387. X    case 23:   t_ptr->p1 = randint(12) + 12; break;
  1388. X    default:
  1389. X      break;
  1390. X    }
  1391. X      break;
  1392. X
  1393. X    case TV_STAFF:
  1394. X      switch(t_ptr->subval)
  1395. X    {
  1396. X    case 0:      t_ptr->p1 = randint(20) +     12; break;
  1397. X    case 1:      t_ptr->p1 = randint(8)  +     6; break;
  1398. X    case 2:      t_ptr->p1 = randint(5)  +     6; break;
  1399. X    case 3:      t_ptr->p1 = randint(20) +     12; break;
  1400. X    case 4:      t_ptr->p1 = randint(15) +     6; break;
  1401. X    case 5:      t_ptr->p1 = randint(4)  +     5; break;
  1402. X    case 6:      t_ptr->p1 = randint(5)  +     3; break;
  1403. X    case 7:      t_ptr->p1 = randint(3)  +     1;
  1404. X      t_ptr->level = 10;
  1405. X      break;
  1406. X    case 8:      t_ptr->p1 = randint(3)  +     1; break;
  1407. X    case 9:      t_ptr->p1 = randint(5)  +     6; break;
  1408. X    case 10:   t_ptr->p1 = randint(10) +     12; break;
  1409. X    case 11:   t_ptr->p1 = randint(5)  +     6; break;
  1410. X    case 12:   t_ptr->p1 = randint(5)  +     6; break;
  1411. X    case 13:   t_ptr->p1 = randint(5)  +     6; break;
  1412. X    case 14:   t_ptr->p1 = randint(10) +     12; break;
  1413. X    case 15:   t_ptr->p1 = randint(3)  +     4; break;
  1414. X    case 16:   t_ptr->p1 = randint(5)  +     6; break;
  1415. X    case 17:   t_ptr->p1 = randint(5)  +     6; break;
  1416. X    case 18:   t_ptr->p1 = randint(3)  +     4; break;
  1417. X    case 19:   t_ptr->p1 = randint(10) +     12; break;
  1418. X    case 20:   t_ptr->p1 = randint(3)  +     4; break;
  1419. X    case 21:   t_ptr->p1 = randint(3)  +     4; break;
  1420. X    case 22:   t_ptr->p1 = randint(10) + 6;
  1421. X      t_ptr->level = 5;
  1422. X      break;
  1423. X    default:
  1424. X      break;
  1425. X    }
  1426. X      break;
  1427. X
  1428. X    case TV_CLOAK:
  1429. X      if (magik(chance))
  1430. X    {
  1431. X      if (magik(special))
  1432. X        {
  1433. X          if (randint(2) == 1)
  1434. X        {
  1435. X          t_ptr->name2 = SN_PROTECTION;
  1436. X          t_ptr->toac += m_bonus(2, 40, level);
  1437. X          t_ptr->cost += 250;
  1438. X        }
  1439. X          else
  1440. X        {
  1441. X          t_ptr->toac += m_bonus(1, 20, level);
  1442. X          t_ptr->ident |= ID_SHOW_P1;
  1443. X          t_ptr->p1 = randint(3);
  1444. X          t_ptr->flags |= TR_STEALTH;
  1445. X          t_ptr->name2 = SN_STEALTH;
  1446. X          t_ptr->cost += 500;
  1447. X        }
  1448. X        }
  1449. X      else
  1450. X        t_ptr->toac += m_bonus(1, 20, level);
  1451. X    }
  1452. X      else if (magik(cursed))
  1453. X    {
  1454. X      tmp = randint(3);
  1455. X      if (tmp == 1)
  1456. X        {
  1457. X          t_ptr->flags |= TR_AGGRAVATE;
  1458. X          t_ptr->name2 = SN_IRRITATION;
  1459. X          t_ptr->toac  -= m_bonus(1, 10, level);
  1460. X          t_ptr->ident |= ID_SHOW_HITDAM;
  1461. X          t_ptr->tohit -= m_bonus(1, 10, level);
  1462. X          t_ptr->todam -= m_bonus(1, 10, level);
  1463. X          t_ptr->cost =  0;
  1464. X        }
  1465. X      else if (tmp == 2)
  1466. X        {
  1467. X          t_ptr->name2 = SN_VULNERABILITY;
  1468. X          t_ptr->toac -= m_bonus(10, 100, level+50);
  1469. X          t_ptr->cost = 0;
  1470. X        }
  1471. X      else
  1472. X        {
  1473. X          t_ptr->name2 = SN_ENVELOPING;
  1474. X          t_ptr->toac  -= m_bonus(1, 10, level);
  1475. X          t_ptr->ident |= ID_SHOW_HITDAM;
  1476. X          t_ptr->tohit -= m_bonus(2, 40, level+10);
  1477. X          t_ptr->todam -= m_bonus(2, 40, level+10);
  1478. X          t_ptr->cost = 0;
  1479. X        }
  1480. X#ifdef ATARIST_MWC
  1481. X      t_ptr->flags |= (holder = TR_CURSED);
  1482. X#else
  1483. X      t_ptr->flags |= TR_CURSED;
  1484. X#endif
  1485. X    }
  1486. X      break;
  1487. X
  1488. X    case TV_CHEST:
  1489. X      switch(randint(level+4))
  1490. X    {
  1491. X    case 1:
  1492. X      t_ptr->flags = 0;
  1493. X      t_ptr->name2 = SN_EMPTY;
  1494. X      break;
  1495. X    case 2:
  1496. X      t_ptr->flags |= CH_LOCKED;
  1497. X      t_ptr->name2 = SN_LOCKED;
  1498. X      break;
  1499. X    case 3: case 4:
  1500. X      t_ptr->flags |= (CH_LOSE_STR|CH_LOCKED);
  1501. X      t_ptr->name2 = SN_POISON_NEEDLE;
  1502. X      break;
  1503. X    case 5: case 6:
  1504. X      t_ptr->flags |= (CH_POISON|CH_LOCKED);
  1505. X      t_ptr->name2 = SN_POISON_NEEDLE;
  1506. X      break;
  1507. X    case 7: case 8: case 9:
  1508. X      t_ptr->flags |= (CH_PARALYSED|CH_LOCKED);
  1509. X      t_ptr->name2 = SN_GAS_TRAP;
  1510. X      break;
  1511. X    case 10: case 11:
  1512. X      t_ptr->flags |= (CH_EXPLODE|CH_LOCKED);
  1513. X      t_ptr->name2 = SN_EXPLOSION_DEVICE;
  1514. X      break;
  1515. X    case 12: case 13: case 14:
  1516. X      t_ptr->flags |= (CH_SUMMON|CH_LOCKED);
  1517. X      t_ptr->name2 = SN_SUMMONING_RUNES;
  1518. X      break;
  1519. X    case 15: case 16: case 17:
  1520. X      t_ptr->flags |= (CH_PARALYSED|CH_POISON|CH_LOSE_STR|CH_LOCKED);
  1521. X      t_ptr->name2 = SN_MULTIPLE_TRAPS;
  1522. X      break;
  1523. X    default:
  1524. X      t_ptr->flags |= (CH_SUMMON|CH_EXPLODE|CH_LOCKED);
  1525. X      t_ptr->name2 = SN_MULTIPLE_TRAPS;
  1526. X      break;
  1527. X    }
  1528. X      break;
  1529. X
  1530. X    case TV_SLING_AMMO: case TV_SPIKE:
  1531. X    case TV_BOLT: case TV_ARROW:
  1532. X      if (t_ptr->tval == TV_SLING_AMMO || t_ptr->tval == TV_BOLT
  1533. X      || t_ptr->tval == TV_ARROW)
  1534. X    {
  1535. X      /* always show tohit/todam values if identified */
  1536. X      t_ptr->ident |= ID_SHOW_HITDAM;
  1537. X
  1538. X      if (magik(chance))
  1539. X        {
  1540. X          t_ptr->tohit += m_bonus(1, 35, level);
  1541. X          t_ptr->todam += m_bonus(1, 35, level);
  1542. X          /* see comment for weapons */
  1543. X          if (magik(3*special/2))
  1544. X        switch(randint(10))
  1545. X          {
  1546. X          case 1: case 2: case 3:
  1547. X            t_ptr->name2 = SN_SLAYING;
  1548. X            t_ptr->tohit += 5;
  1549. X            t_ptr->todam += 5;
  1550. X            t_ptr->cost += 20;
  1551. X            break;
  1552. X          case 4: case 5:
  1553. X#ifdef ATARIST_MWC
  1554. X            t_ptr->flags |= (holder = TR_FLAME_TONGUE);
  1555. X#else
  1556. X            t_ptr->flags |= TR_FLAME_TONGUE;
  1557. X#endif
  1558. X            t_ptr->tohit += 2;
  1559. X            t_ptr->todam += 4;
  1560. X            t_ptr->name2 = SN_FIRE;
  1561. X            t_ptr->cost += 25;
  1562. X            break;
  1563. X          case 6: case 7:
  1564. X            t_ptr->flags |= TR_SLAY_EVIL;
  1565. X            t_ptr->tohit += 3;
  1566. X            t_ptr->todam += 3;
  1567. X            t_ptr->name2 = SN_SLAY_EVIL;
  1568. X            t_ptr->cost += 25;
  1569. X            break;
  1570. X          case 8: case 9:
  1571. X            t_ptr->flags |= TR_SLAY_ANIMAL;
  1572. X            t_ptr->tohit += 2;
  1573. X            t_ptr->todam += 2;
  1574. X            t_ptr->name2 = SN_SLAY_ANIMAL;
  1575. X            t_ptr->cost += 30;
  1576. X            break;
  1577. X          case 10:
  1578. X            t_ptr->flags |= TR_SLAY_DRAGON;
  1579. X            t_ptr->tohit += 3;
  1580. X            t_ptr->todam += 3;
  1581. X            t_ptr->name2 = SN_DRAGON_SLAYING;
  1582. X            t_ptr->cost += 35;
  1583. X            break;
  1584. X          }
  1585. X        }
  1586. X      else if (magik(cursed))
  1587. X        {
  1588. X          t_ptr->tohit -= m_bonus(5, 55, level);
  1589. X          t_ptr->todam -= m_bonus(5, 55, level);
  1590. X#ifdef ATARIST_MWC
  1591. X          t_ptr->flags |= (holder = TR_CURSED);
  1592. X#else
  1593. X          t_ptr->flags |= TR_CURSED;
  1594. X#endif
  1595. X          t_ptr->cost = 0;
  1596. X        }
  1597. X    }
  1598. X
  1599. X      t_ptr->number = 0;
  1600. X      for (i = 0; i < 7; i++)
  1601. X    t_ptr->number += randint(6);
  1602. X      if (missile_ctr == MAX_SHORT)
  1603. X    missile_ctr = -MAX_SHORT - 1;
  1604. X      else
  1605. X    missile_ctr++;
  1606. X      t_ptr->p1 = missile_ctr;
  1607. X      break;
  1608. X
  1609. X    case TV_FOOD:
  1610. X      /* make sure all food rations have the same level */
  1611. X      if (t_ptr->subval == 90)
  1612. X    t_ptr->level = 0;
  1613. X      /* give all elvish waybread the same level */
  1614. X      else if (t_ptr->subval == 92)
  1615. X    t_ptr->level = 6;
  1616. X      break;
  1617. X
  1618. X    case TV_SCROLL1:
  1619. X      /* give all identify scrolls the same level */
  1620. X      if (t_ptr->subval == 67)
  1621. X    t_ptr->level = 1;
  1622. X      /* scroll of light */
  1623. X      else if (t_ptr->subval == 69)
  1624. X    t_ptr->level = 0;
  1625. X      /* scroll of trap detection */
  1626. X      else if (t_ptr->subval == 80)
  1627. X    t_ptr->level = 5;
  1628. X      /* scroll of door/stair location */
  1629. X      else if (t_ptr->subval == 81)
  1630. X    t_ptr->level = 5;
  1631. X      break;
  1632. X
  1633. X    case TV_POTION1:  /* potions */
  1634. X      /* cure light */
  1635. X      if (t_ptr->subval == 76)
  1636. X    t_ptr->level = 0;
  1637. X      break;
  1638. X
  1639. X    default:
  1640. X      break;
  1641. X    }
  1642. X}
  1643. X
  1644. X
  1645. Xstatic struct opt_desc { char *o_prompt; int *o_var; } options[] = {
  1646. X  { "Running: cut known corners",        &find_cut },
  1647. X  { "Running: examine potential corners",    &find_examine },
  1648. X  { "Running: print self during run",        &find_prself },
  1649. X  { "Running: stop when map sector changes",    &find_bound },
  1650. X  { "Running: run through open doors",        &find_ignore_doors },
  1651. X  { "Prompt to pick up objects",        &prompt_carry_flag },
  1652. X  { "Rogue like commands",            &rogue_like_commands },
  1653. X  { "Show weights in inventory",        &show_weight_flag },
  1654. X  { "Highlight and notice mineral seams",    &highlight_seams },
  1655. X  { "Beep for invalid character",        &sound_beep_flag },
  1656. X  { "Display rest/repeat counts",        &display_counts },
  1657. X  { 0, 0 } };
  1658. X
  1659. X
  1660. X/* Set or unset various boolean options.        -CJS- */
  1661. Xvoid set_options()
  1662. X{
  1663. X  register int i, max;
  1664. X  vtype string;
  1665. X
  1666. X  prt("  ESC when finished, y/n to set options, <return> or - to move cursor",
  1667. X        0, 0);
  1668. X  for (max = 0; options[max].o_prompt != 0; max++)
  1669. X    {
  1670. X      (void) sprintf(string, "%-38s: %s", options[max].o_prompt,
  1671. X             (*options[max].o_var ? "yes" : "no "));
  1672. X      prt(string, max+1, 0);
  1673. X    }
  1674. X  erase_line(max+1, 0);
  1675. X  i = 0;
  1676. X  for(;;)
  1677. X    {
  1678. X      move_cursor(i+1, 40);
  1679. X      switch(inkey())
  1680. X    {
  1681. X    case ESCAPE:
  1682. X      return;
  1683. X    case '-':
  1684. X      if (i > 0)
  1685. X        i--;
  1686. X      else
  1687. X        i = max-1;
  1688. X      break;
  1689. X    case ' ':
  1690. X    case '\n':
  1691. X    case '\r':
  1692. X      if (i+1 < max)
  1693. X        i++;
  1694. X      else
  1695. X        i = 0;
  1696. X      break;
  1697. X    case 'y':
  1698. X    case 'Y':
  1699. X      put_buffer("yes", i+1, 40);
  1700. X      *options[i].o_var = TRUE;
  1701. X      if (i+1 < max)
  1702. X        i++;
  1703. X      else
  1704. X        i = 0;
  1705. X      break;
  1706. X    case 'n':
  1707. X    case 'N':
  1708. X      put_buffer("no ", i+1, 40);
  1709. X      *options[i].o_var = FALSE;
  1710. X      if (i+1 < max)
  1711. X        i++;
  1712. X      else
  1713. X        i = 0;
  1714. X      break;
  1715. X    default:
  1716. X      bell();
  1717. X      break;
  1718. X    }
  1719. X    }
  1720. X}
  1721. END_OF_FILE
  1722. if test 26765 -ne `wc -c <'source/misc2.c'`; then
  1723.     echo shar: \"'source/misc2.c'\" unpacked with wrong size!
  1724. fi
  1725. # end of 'source/misc2.c'
  1726. fi
  1727. echo shar: End of archive 27 \(of 39\).
  1728. cp /dev/null ark27isdone
  1729. MISSING=""
  1730. 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
  1731.     if test ! -f ark${I}isdone ; then
  1732.     MISSING="${MISSING} ${I}"
  1733.     fi
  1734. done
  1735. if test "${MISSING}" = "" ; then
  1736.     echo You have unpacked all 39 archives.
  1737.     echo "Now run "bldfiles.sh" to build split files"
  1738.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1739. else
  1740.     echo You still need to unpack the following archives:
  1741.     echo "        " ${MISSING}
  1742. fi
  1743. ##  End of shell archive.
  1744. exit 0
  1745.