home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sources / games / 187 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  57.4 KB

  1. Path: sparky!uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v14i057:  umoria4 - single player dungeon simulation (ver. 5.5), Part25/39
  5. Message-ID: <3421@master.CNA.TEK.COM>
  6. Date: 22 Aug 92 22:13:14 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 1955
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: grabiner@math.harvard.edu (David Grabiner)
  12. Posting-number: Volume 14, Issue 57
  13. Archive-name: umoria4/Part25
  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 25 (of 39)."
  26. # Contents:  doc/moria2.txt.2 source/spells.c.2
  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/moria2.txt.2' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'doc/moria2.txt.2'\"
  31. else
  32. echo shar: Extracting \"'doc/moria2.txt.2'\" \(26116 characters\)
  33. sed "s/^X//" >'doc/moria2.txt.2' <<'END_OF_FILE'
  34. X
  35. X          A character must wield a torch or lamp in order to supply his own
  36. X          light.   Once  a  torch  or  lamp  has only 50 or less turns left
  37. X          before burning out, the message "Your  light  is  growing  faint"
  38. X
  39. X
  40. X
  41. X
  42. X
  43. X
  44. X
  45. X
  46. X
  47. X          The Dungeons of Moria                                Page 28
  48. X
  49. X
  50. X          will  be  displayed  at  random intervals.  Once a torch is burnt
  51. X          out, it is useless and can be dropped.  A lamp or lantern can  be
  52. X          refilled  with  oil  by  using the Fill `F' command.  You must of
  53. X          course be carrying extra oil to refill a lantern.
  54. X
  55. X
  56. X          8.  Attacking and Being Attacked
  57. X
  58. X          Attacking is simple in moria.  If you move into a  creature,  you
  59. X          attack  him.  You can attack from a distance by firing a missile,
  60. X          or by magical means such as aiming a wand.  Creatures  attack  in
  61. X          the  same  way,  if  they  move  into you, they attack you.  Some
  62. X          creatures can also cast spells from a distance,  and  others  can
  63. X          breathe fire or worse on you from a distance.
  64. X
  65. X          Creatures moving in walls can not be attacked by wands and  other
  66. X          magic  attacks  normally  stopped  by  walls.   You  can attack a
  67. X          creature in a wall normally though by trying  to  move  into  the
  68. X          wall  space containing the creature.  However, in order to attack
  69. X          an invisible creature in a wall, you must tunnel  into  the  wall
  70. X          containing  the creature.  If you just try to move into the wall,
  71. X          you will bump your head and look quite silly.
  72. X
  73. X          If you are wielding a weapon, the damage for the weapon  is  used
  74. X          when  you  hit  a  creature.  Otherwise you get two fist strikes.
  75. X          Very strong creatures can do a lot of damage with their  fists...
  76. X          You  may  have  a primary weapon, and a secondary weapon which is
  77. X          kept on your belt or shoulder for immediate use.  You can  switch
  78. X          between your primary and secondary weapons with the exchange com-
  79. X          mand.  Be sure to wield the proper weapon when fighting.  Hitting
  80. X          a  dragon  over the head with a bow will simply make him mad, and
  81. X          get you killed.
  82. X
  83. X          Missile weapons, such as bows,  can  be  wielded,  and  then  the
  84. X          proper  missile,  in  this case an arrow, can be fired across the
  85. X          room into a target.  Missiles can be used without the proper mis-
  86. X          sile  weapon,  but used together they have a greater range and do
  87. X          far more damage.
  88. X
  89. X          Hits and misses are determined by ability  to  hit  versus  armor
  90. X          class.   A  hit  is a strike that does some damage; a miss may in
  91. X          fact reach a target, but fails to do any  damage.   Higher  armor
  92. X          classes make it harder to do damage, and so lead to more misses.
  93. X
  94. X
  95. X          8.1.  Monster Memories.
  96. X
  97. X          There are hundreds of different creatures in the mines of  moria,
  98. X          many  of which look the same on the screen.  The exact species of
  99. X          a creature can be discovered by looking at it.  It is  also  very
  100. X          difficult to keep track of the capabilities of various creatures.
  101. X          Rather than forcing you to keep notes, moria automatically  keeps
  102. X          track  of  your  experiences with a particular creature.  This is
  103. X          called the  monster  memory.   Your monster  memory  recalls  the
  104. X
  105. X
  106. X
  107. X
  108. X
  109. X
  110. X
  111. X
  112. X
  113. X          The Dungeons of Moria                                Page 29
  114. X
  115. X
  116. X          particular attacks of each creature (whether or not technically a
  117. X          monster) which you have suffered, as well  as  recalling  if  you
  118. X          have  observed  them  to  multiply  or  move erratically, or drop
  119. X          treasure, or many other attributes.
  120. X
  121. X          If you have killed enough of a particular creature,  or  suffered
  122. X          enough attacks, recalling the monster memory may also provide you
  123. X          with information not otherwise available, such as a  armor  class
  124. X          or  hit dice.  These are not explained, but may be useful to give
  125. X          the relative danger of each creature.  This memory can be  passed
  126. X          on  to  a new character even after you die, by means of a reduced
  127. X          save file.
  128. X
  129. X
  130. X          8.2.  Your Weapon
  131. X
  132. X          Carrying a weapon in your backpack does you no  good.   You  must
  133. X          wield  a  weapon  before  it can be used in a fight.  A secondary
  134. X          weapon can be kept by wielding it and  then  using  the  exchange
  135. X          command.   A  secondary  weapon is not in use, simply ready to be
  136. X          switched with the current weapon if needed.
  137. X
  138. X          Weapons have two main characteristics, their ability to  hit  and
  139. X          their  ability  to  do  damage, expressed as `(+#,+#)'.  A normal
  140. X          weapon would be `(+0,+0)'.  Many weapons in  moria  have  magical
  141. X          bonuses  to  hit  and/or do damage.  Some weapons are cursed, and
  142. X          have penalties that hurt the player.  Cursed  weapons  cannot  be
  143. X          unwielded until the curse is lifted.
  144. X
  145. X          Moria assumes that your youth in the rough environment  near  the
  146. X          dungeons has taught you the relative merits of different weapons,
  147. X          and displays as part of their description the damage  dice  which
  148. X          define their capabilities.  The ability to damage is added to the
  149. X          dice roll for that weapon.  The dice used for a given  weapon  is
  150. X          displayed  as `#d#'.  The first number indicates how many dice to
  151. X          roll, and the second indicates how many sides they have.  A "2d6"
  152. X          weapon will give damage from 2 to 12, plus any damage bonus.  The
  153. X          weight of a weapon is also a consideration.   Heavy  weapons  may
  154. X          hit  harder,  but they are also harder to use.  Depending on your
  155. X          strength and the weight of the weapon, you may get  several  hits
  156. X          in one turn.
  157. X
  158. X          Missile booster weapons, such as bows, have their characteristics
  159. X          added  to those of the missile used, if the proper weapon/missile
  160. X          combination is used.  Also, these weapons will multiply the  base
  161. X          damage  of  the missile by a number from 2 to 4, depending on the
  162. X          strength of the weapon.  This multiplier is displayed as `(*#)'.
  163. X
  164. X          Although you receive any magical bonuses an  unidentified  weapon
  165. X          may possess when you wield it, those bonuses will not be added in
  166. X          to the displayed values of to-hit and to-dam  on  your  character
  167. X          sheet.   You must identify the weapon before the displayed values
  168. X          reflect the real values used.
  169. X
  170. X
  171. X
  172. X
  173. X
  174. X
  175. X
  176. X
  177. X
  178. X
  179. X          The Dungeons of Moria                                Page 30
  180. X
  181. X
  182. X          Finally, some rare weapons have  special  abilities.   These  are
  183. X          called  ego  weapons,  and  are feared by great and meek.  An ego
  184. X          sword must be wielded to receive benefit of its abilities.
  185. X
  186. X          Special weapons are denoted by the following abbreviations:
  187. X
  188. X          DF - Defender.
  189. X               A magical weapon that actually helps the wielder defend him-
  190. X               self,  thus  increasing  his/her armor class, and protecting
  191. X               him/her against damage from fire,  frost,  acid,  lightning,
  192. X               and falls.  This weapon also will increase your stealth, let
  193. X               you see invisible creatures, protect you  from  paralyzation
  194. X               attacks, and help you regenerate hit points and mana faster.
  195. X               As a result of the regerenation ability,  you  will  use  up
  196. X               food faster than normal while wielding such a weapon.
  197. X
  198. X          FB - Frost Brand.
  199. X               A magical weapon of ice that delivers  a  cold  critical  to
  200. X               heat  based creatures.  It will inflict one and a half times
  201. X               the normal damage when used against a heat based creature.
  202. X
  203. X          FT - Flame Tongue.
  204. X               A magical weapon of flame that delivers a heat  critical  to
  205. X               cold  based creatures.  It will inflict one and a half times
  206. X               the normal damage when used against cold based  or  inflamm-
  207. X               able creatures.
  208. X
  209. X          HA - Holy Avenger.
  210. X               A Holy Avenger is one of the most powerful  of  weapons.   A
  211. X               Holy  Avenger  will  increase  your  strength and your armor
  212. X               class.  This weapon will do extra damage when  used  against
  213. X               evil  and undead creatures, and will also give you the abil-
  214. X               ity to see invisible creatures.
  215. X
  216. X          SD - Slay Dragon.
  217. X               A Slay Dragon weapon is a special purpose weapon whose  sole
  218. X               intent  is  to  destroy  dragon-kind.   Therefore, when used
  219. X               against a dragon, the amount of damage done  is  four  times
  220. X               the normal amount.
  221. X
  222. X          SE - Slay Evil.
  223. X               A Slay Evil weapon is a special purpose  weapon  whose  sole
  224. X               intent  is  to destroy all forms of evil.  When used against
  225. X               an evil creature, either alive or undead,  the  damage  done
  226. X               twice the normal amount.
  227. X
  228. X          SM - Slay Animal.
  229. X               A Slay Animal weapon is a special purpose weapon whose  sole
  230. X               intent is to destroy all the dangerous animals in the world.
  231. X               An animal is any creature natural to the  world.   Therefore
  232. X               an  orc  would not be an animal, but a giant snake would be.
  233. X               This will inflict twice the normal  amount  of  damage  when
  234. X               used against an animal.
  235. X
  236. X
  237. X
  238. X
  239. X
  240. X
  241. X
  242. X
  243. X
  244. X
  245. X          The Dungeons of Moria                                Page 31
  246. X
  247. X
  248. X          SU - Slay Undead.
  249. X               A Slay Undead weapon is a special purpose weapon whose  sole
  250. X               intent  is  to  destroy all forms of undead.  This weapon is
  251. X               hated and feared by the intelligent  undead,  for  a  single
  252. X               blow  from  this  weapon will inflict three times the normal
  253. X               amount of damage.  This weapon also gives you the ability to
  254. X               see  invisible creatures, which is especially useful against
  255. X               undead, since many of them are normally invisible.
  256. X
  257. X
  258. X          8.3.  Body and Shield Bashes
  259. X
  260. X          Weight is the primary factor in being able to bash something, but
  261. X          strength plays a role too.  After bashing, a character may be off
  262. X          balance for several rounds depending upon his dexterity.
  263. X
  264. X          Doors can be broken down by bashing them.  Once a door is  bashed
  265. X          open, it is forever useless and cannot be closed.
  266. X
  267. X          Chests too may be bashed open, but be warned  that  the  careless
  268. X          smashing  of  a  chest  often ruins the contents.  Bashing open a
  269. X          chest will not disarm any traps it may contain,  but  does  allow
  270. X          the strong and ignorant to see what is inside.
  271. X
  272. X          Finally, a creature may be bashed.   If  a  shield  is  currently
  273. X          being  worn,  the  bash is a shield bash and will do more damage.
  274. X          In either case, a bash may throw an opponent off  balance  for  a
  275. X          number of rounds, allowing a player to get in a free hit or more.
  276. X          If the player is thrown off balance, his opponent  may  get  free
  277. X          hits on him.  This is a risky attack.
  278. X
  279. X
  280. X          8.4.  Your Armor Class
  281. X
  282. X          Armor class is a number that describes the amount and the quality
  283. X          of armor being worn.  Armor class will generally run from about 0
  284. X          to 60, but could become negative  or  greater  than  60  in  rare
  285. X          cases.
  286. X
  287. X          The larger your armor class, the more protective it is.  A  nega-
  288. X          tive armor class would actually help get you hit.  Armor protects
  289. X          you in three manners.  One, it makes you harder  to  be  hit  for
  290. X          damage.   A  hit  for no damage is the same as a miss.  Two, good
  291. X          armor will absorb some of the damage that  your  character  would
  292. X          have  taken.  An armor class of 30 would absorb 15% of any damage
  293. X          meant for him.  Three, acid damage is  reduced  by  wearing  body
  294. X          armor.   It is obvious that a high armor class is a must for sur-
  295. X          viving the lower levels of moria.
  296. X
  297. X          Each piece of armor has an armor class adjustment, and a  magical
  298. X          bonus.   Armor  bought  in  town will have these values displayed
  299. X          with their description.  Armor that is found within  the  dungeon
  300. X          must  be  identified  before these values will be displayed.  All
  301. X          armor always has the base armor class  displayed,  to  which  the
  302. X
  303. X
  304. X
  305. X
  306. X
  307. X
  308. X
  309. X
  310. X
  311. X          The Dungeons of Moria                                Page 32
  312. X
  313. X
  314. X          bonus is added.  It is always possible to figure this out anyway,
  315. X          by watching the effect it has on your displayed armor class.
  316. X
  317. X          Armor class values are always displayed between a set of brackets
  318. X          as  `[#]' or `[#,+#]'.  The first value is the armor class of the
  319. X          item.  The second number is the magical bonus of the  item  which
  320. X          is only displayed if known, and will always have a sign preceding
  321. X          the value.  There are a few cases where the form `[+#]' is  used,
  322. X          meaning the object has no armor class, only a magical armor bonus
  323. X          if worn.
  324. X
  325. X          Some pieces of armor will possess special  abilities  denoted  by
  326. X          the following abbreviations:
  327. X
  328. X          RA - Resist Acid.
  329. X               A character using such an object will take  only  one  third
  330. X               normal  damage  from any acid thrown upon him.  In addition,
  331. X               armor so enchanted will resist the acid's effects and not be
  332. X               damaged by it.
  333. X
  334. X          RC - Resist Cold.
  335. X               A character using a resist cold object will  take  only  one
  336. X               third damage from frost and cold.
  337. X
  338. X          RF - Resist Fire.
  339. X               A character using a resist fire object will  take  only  one
  340. X               third damage from heat and fire.
  341. X
  342. X          RL - Resist Lightning.
  343. X               A character using a resist lightning object will  take  only
  344. X               one third damage from electrical attacks.
  345. X
  346. X          R - Resistance.
  347. X               A character wearing armor with this ability will have resis-
  348. X               tance  to  Acid,  Cold,  Fire, and Lightning as explained in
  349. X               each part above.
  350. X
  351. X
  352. X          8.5.  Crowns
  353. X
  354. X          Some crowns also have special magical abilities that improve your
  355. X          chances in a battle.
  356. X
  357. X          Crown of Might
  358. X               This is the great crown of the warriors.   The  wearer  will
  359. X               have  an increased strength, dexterity, and constituion, and
  360. X               will also be immune to any foe's attempt to slow or paralyze
  361. X               him or her.
  362. X
  363. X          Crown of the Magi
  364. X                This is the great crown of the wizards.   The  wearer  will
  365. X               have  an  increased  intelligence,  and  will  also be given
  366. X               resistance against fire, frost, acid, and lightning.
  367. X
  368. X
  369. X
  370. X
  371. X
  372. X
  373. X
  374. X
  375. X
  376. X
  377. X          The Dungeons of Moria                                Page 33
  378. X
  379. X
  380. X          Crown of Lordliness
  381. X               This is the great crown of the  priests.   The  wearer  will
  382. X               have an increased wisdom and charisma.
  383. X
  384. X          Crown of Seeing
  385. X               This is the great crown of the rogues.  The wearer  will  be
  386. X               able  to  see  even  invisible  creatures,  and will have an
  387. X               increased ability to locate traps and secret doors.
  388. X
  389. X          Crown of Regeneration
  390. X               This crown will help you regenerate hit points and mana more
  391. X               quickly  than  normal,  allowing  you to fight longer before
  392. X               needing to rest.  You will use of food  faster  than  normal
  393. X               while   wearing  this  crown  because  of  the  regenerative
  394. X               effects.
  395. X
  396. X          Crown of Beauty
  397. X               This  crown  looks  impressive,  and  will   increase   your
  398. X               charisma, but is otherwise not useful.
  399. X
  400. X
  401. X          9.  Objects Found In The Dungeon
  402. X
  403. X          The mines are full of objects just waiting to be  picked  up  and
  404. X          used.   How did they get there?  Well, the main source for useful
  405. X          items are all the foolish adventurers  that  proceeded  into  the
  406. X          dungeon  before  you.  They get killed, and the helpful creatures
  407. X          scatter the various treasure throughout the dungeon.  Most cursed
  408. X          items  are placed there by the joyful evil sorcerers, who enjoy a
  409. X          good joke when it gets you killed.
  410. X
  411. X          You pick up objects by moving on top of them.  You can  carry  up
  412. X          to 22 different items in your backpack while wearing and wielding
  413. X          many others.  Although you are limited to 22 different items, you
  414. X          may be carrying several items of each kind restricted only by the
  415. X          amount of weight your character can carry.  Your weight limit  is
  416. X          determined  by your strength.  Only one object may occupy a given
  417. X          floor location, which may or may not also contain  one  creature.
  418. X          Doors, traps, and staircases are considered objects for this pur-
  419. X          pose.
  420. X
  421. X          If you try to carry more weight than your limit,  you  will  move
  422. X          more  slowly  than  normal  until  you drop the extra weight.  If
  423. X          picking up an object would take you over your weight limit,  then
  424. X          you will be asked whether you really want to pick it up.  It is a
  425. X          good idea to leave the object alone if you  are  fleeing  from  a
  426. X          monster.
  427. X
  428. X          Many objects found within the dungeon have special  commands  for
  429. X          their  use.   Wands  must  be Aimed, staves must be Used, scrolls
  430. X          must be Read, and potions must be Quaffed.  In any case, you must
  431. X          first  be  able  to  carry an object before you can use it.  Some
  432. X          objects, such as chests, are very complex.  Chests contain  other
  433. X          objects  and  may  be  trapped,  and/or locked.  Read the list of
  434. X
  435. X
  436. X
  437. X
  438. X
  439. X
  440. X
  441. X
  442. X
  443. X          The Dungeons of Moria                                Page 34
  444. X
  445. X
  446. X          player commands carefully for a further understanding of chests.
  447. X
  448. X          One item in particular will be discussed  here.   The  scroll  of
  449. X          "Word  of  Recall"  can be found within the dungeon, or bought at
  450. X          the temple in town.  It acts in two manners, depending upon  your
  451. X          current  location.   If read within the dungeon, it will teleport
  452. X          you back to town.  If read in town, it  will  teleport  you  back
  453. X          down to the deepest level of the dungeon one which your character
  454. X          has previously been.  This makes the scroll very useful for  get-
  455. X          ting  back  to  the  deeper levels of moria.  Once the scroll has
  456. X          been read it takes a while for the spell to act, so don't  expect
  457. X          it to save you in a crisis.
  458. X
  459. X          The game provides some automatic inscriptions to  help  you  keep
  460. X          track  of  your possessions.  Wands and staves which are known to
  461. X          be empty will be inscribed with "empty".  Objects which have been
  462. X          tried  at  least  once,  but  haven't been identified yet will be
  463. X          inscribed  with  "tried".   Cursed  objects  are  inscribed  with
  464. X          "damned".   Also,  occasionally you will notice that something in
  465. X          your inventory or equipment list seems to be magical.  High level
  466. X          characters  are  much  more  likely to notice this than beginning
  467. X          characters.  When you do notice this, the item in  question  will
  468. X          be inscribed with "magik".
  469. X
  470. X          And lastly, a final warning: not all objects are what they  seem.
  471. X          Skeletons  lying  peacefully about the dungeon have been known to
  472. X          get up...
  473. X
  474. X
  475. X          9.1.  Cursed Objects
  476. X
  477. X          Some objects, mainly armor and weapons, have had curses laid upon
  478. X          them.   These  horrible  objects  will look like any other normal
  479. X          item, but will detract from your character's stats  or  abilities
  480. X          if  worn.   They will also be impossible to remove until a remove
  481. X          curse is done.
  482. X
  483. X          If you wear or wield a cursed item,  you  will  immediately  feel
  484. X          something wrong.  The item will also be inscribed "damned".
  485. X
  486. X
  487. X          9.2.  Mining
  488. X
  489. X          Much of the treasure within the dungeon can be found only by min-
  490. X          ing  it  out  of  the walls.  Many rich strikes exist within each
  491. X          level, but must  be  found  and  mined.   Quartz  veins  are  the
  492. X          richest,  yielding the most metals and gems, but magma veins will
  493. X          have some hordes hidden within.
  494. X
  495. X          Mining is virtually impossible without a pick or  shovel.   Picks
  496. X          and  shovels  have  an  additional  magical  ability expressed as
  497. X          `(+#)'.  The higher the number, the better  the  magical  digging
  498. X          ability of the tool.  A pick or shovel also has pluses to hit and
  499. X          damage, and can be used as a weapon.
  500. X
  501. X
  502. X
  503. X
  504. X
  505. X
  506. X
  507. X
  508. X
  509. X          The Dungeons of Moria                                Page 35
  510. X
  511. X
  512. X          When a vein of quartz or magma is located, the  character  should
  513. X          wield  his  pick or shovel and begin digging out a section.  When
  514. X          that section is removed, he should locate another section of  the
  515. X          vein,  and  begin  the process again.  Since granite rock is much
  516. X          harder to dig through, it is  much  faster  to  follow  the  vein
  517. X          exactly  and  dig  around  the  granite.   There is an option for
  518. X          highlighting magma and quartz.
  519. X
  520. X          If the character has a scroll or staff of treasure  location,  he
  521. X          can  immediately  locate  all  strikes  of treasure within a vein
  522. X          shown on the screen.  This makes mining much easier and more pro-
  523. X          fitable.
  524. X
  525. X          It is sometimes possible to get a character  trapped  within  the
  526. X          dungeon  by  using  various magical spells and items.  So it is a
  527. X          very good idea to always carry some kind of  digging  tool,  even
  528. X          when you are not planning on tunneling for treasure.
  529. X
  530. X
  531. X          9.3.  Staircases, Secret Doors, Passages, and Rooms
  532. X
  533. X          Staircases are the manner in which you get deeper, or  climb  out
  534. X          of  the  dungeon.  The symbols for the up and down staircases are
  535. X          the same as the commands to use them.  A  `<'  represents  an  up
  536. X          staircase  and  a `>' represents a down staircase.  You must move
  537. X          your character over the staircase before you can use them.
  538. X
  539. X          Each level has at least one up staircase, and at least  two  down
  540. X          staircases.   There are no exceptions to this rule.  You may have
  541. X          trouble finding some well hidden secret doors, but the stairs are
  542. X          there.
  543. X
  544. X          Many secret doors are used within  the  dungeon  to  confuse  and
  545. X          demoralize  adventurers  foolish  enough to enter.  But with some
  546. X          luck, and lots of concentration, you can find these secret doors.
  547. X          Secret  doors  will  sometimes  hide  rooms or corridors, or even
  548. X          entire sections of that level of  the  dungeon.   Sometimes  they
  549. X          simply hide small empty closets or even dead ends.
  550. X
  551. X          Creatures in the dungeon will generally know and use these secret
  552. X          doors.   If  they  leave  one  open, you will be able to go right
  553. X          through it.  If they close it behind them you will have to search
  554. X          for  the  catch first.  Once a secret door has been discovered by
  555. X          you, it is drawn as a known door and no more  searching  will  be
  556. X          required to use it.
  557. X
  558. X
  559. X          10.  Winning The Game
  560. X
  561. X          Once your character has progressed into killing dragons with  but
  562. X          a mean glance and snap of his fingers, he may be ready to take on
  563. X          the Balrog.  The Balrog will appear on most  levels  after  level
  564. X          49, so don't go down there until you are ready for him.
  565. X
  566. X
  567. X
  568. X
  569. X
  570. X
  571. X
  572. X
  573. X
  574. X
  575. X          The Dungeons of Moria                                Page 36
  576. X
  577. X
  578. X          The Balrog cannot be killed in some of the easier methods used on
  579. X          normal  creatures.   Because  of  the  Balrog's  cunning, he will
  580. X          teleport away to another level if a spell such as destruction  is
  581. X          used  upon  him,  and  the  Balrog  cannot be polymorphed, slept,
  582. X          charmed, or genocided.  Magical spells like coldball  are  effec-
  583. X          tive  against him as are weapons, but he is difficult to kill and
  584. X          if allowed to escape for a time can heal himself.
  585. X
  586. X          If you should actually survive the attempt of killing the Balrog,
  587. X          you  will  receive the status of WINNER.  Since you have defeated
  588. X          the toughest creature alive, your character is  ready  to  retire
  589. X          and  cannot  be  saved.   When  you quit the game, your character
  590. X          receives a surprise bonus score.
  591. X
  592. X
  593. X          11.  Upon Death and Dying
  594. X
  595. X          If your character falls below 0 hit points, he has died and  can-
  596. X          not  be  restored.   A  tombstone  showing information about your
  597. X          character will be displayed.  You are also  permitted  to  get  a
  598. X          record  of  your  character,  and all your equipment (identified)
  599. X          either on the screen or in a file.
  600. X
  601. X          Your character will leave behind a reduced save file, which  con-
  602. X          tains only the monster memory and your option choices.  It may be
  603. X          restored, in which case the new character is generated exactly as
  604. X          if  the file was not there, but the new player will find his mon-
  605. X          ster memory containing all the experience of past incarnations.
  606. X
  607. X
  608. X          12.  Wizards
  609. X
  610. X          There are rumors of moria Wizards which,  if  asked  nicely,  can
  611. X          explain  details  of  the  moria  game  that  seem complicated to
  612. X          beginners.
  613. X
  614. X
  615. X
  616. X
  617. X
  618. X
  619. X
  620. X
  621. X
  622. X
  623. X
  624. X
  625. X
  626. X
  627. X
  628. X
  629. X
  630. X
  631. X
  632. X
  633. X
  634. X
  635. X
  636. X
  637. X
  638. END_OF_FILE
  639. if test 26116 -ne `wc -c <'doc/moria2.txt.2'`; then
  640.     echo shar: \"'doc/moria2.txt.2'\" unpacked with wrong size!
  641. fi
  642. # end of 'doc/moria2.txt.2'
  643. fi
  644. if test -f 'source/spells.c.2' -a "${1}" != "-c" ; then 
  645.   echo shar: Will not clobber existing file \"'source/spells.c.2'\"
  646. else
  647. echo shar: Extracting \"'source/spells.c.2'\" \(28204 characters\)
  648. sed "s/^X//" >'source/spells.c.2' <<'END_OF_FILE'
  649. X    }
  650. X  while (!flag);
  651. X  return(confuse);
  652. X}
  653. X
  654. X
  655. X/* Sleep a creature.                    -RAK-    */
  656. Xint sleep_monster(dir, y, x)
  657. Xint dir, y, x;
  658. X{
  659. X  int flag, dist, sleep;
  660. X  register cave_type *c_ptr;
  661. X  register monster_type *m_ptr;
  662. X  register creature_type *r_ptr;
  663. X  vtype out_val, m_name;
  664. X
  665. X  sleep = FALSE;
  666. X  flag = FALSE;
  667. X  dist = 0;
  668. X  do
  669. X    {
  670. X      (void) mmove(dir, &y, &x);
  671. X      dist++;
  672. X      c_ptr = &cave[y][x];
  673. X      if ((dist > OBJ_BOLT_RANGE) || c_ptr->fval >= MIN_CLOSED_SPACE)
  674. X    flag = TRUE;
  675. X      else if (c_ptr->cptr > 1)
  676. X    {
  677. X      m_ptr = &m_list[c_ptr->cptr];
  678. X      r_ptr = &c_list[m_ptr->mptr];
  679. X      flag = TRUE;
  680. X      monster_name (m_name, m_ptr, r_ptr);
  681. X      if ((randint(MAX_MONS_LEVEL) < r_ptr->level) ||
  682. X          (CD_NO_SLEEP & r_ptr->cdefense))
  683. X        {
  684. X          if (m_ptr->ml && (r_ptr->cdefense & CD_NO_SLEEP))
  685. X        c_recall[m_ptr->mptr].r_cdefense |= CD_NO_SLEEP;
  686. X          (void) sprintf(out_val, "%s is unaffected.", m_name);
  687. X          msg_print(out_val);
  688. X        }
  689. X      else
  690. X        {
  691. X          m_ptr->csleep = 500;
  692. X          sleep = TRUE;
  693. X          (void) sprintf(out_val, "%s falls asleep.", m_name);
  694. X          msg_print(out_val);
  695. X        }
  696. X    }
  697. X    }
  698. X  while (!flag);
  699. X  return(sleep);
  700. X}
  701. X
  702. X
  703. X/* Turn stone to mud, delete wall.            -RAK-    */
  704. Xint wall_to_mud(dir, y, x)
  705. Xint dir, y, x;
  706. X{
  707. X  int i, wall, dist;
  708. X  bigvtype out_val, tmp_str;
  709. X  register int flag;
  710. X  register cave_type *c_ptr;
  711. X  register monster_type *m_ptr;
  712. X  register creature_type *r_ptr;
  713. X  vtype m_name;
  714. X
  715. X  wall = FALSE;
  716. X  flag = FALSE;
  717. X  dist = 0;
  718. X  do
  719. X    {
  720. X      (void) mmove(dir, &y, &x);
  721. X      dist++;
  722. X      c_ptr = &cave[y][x];
  723. X      /* note, this ray can move through walls as it turns them to mud */
  724. X      if (dist == OBJ_BOLT_RANGE)
  725. X    flag = TRUE;
  726. X      if ((c_ptr->fval >= MIN_CAVE_WALL) && (c_ptr->fval != BOUNDARY_WALL))
  727. X    {
  728. X      flag = TRUE;
  729. X      (void) twall(y, x, 1, 0);
  730. X      if (test_light(y, x))
  731. X        {
  732. X          msg_print("The wall turns into mud.");
  733. X          wall = TRUE;
  734. X        }
  735. X    }
  736. X      else if ((c_ptr->tptr != 0) && (c_ptr->fval >= MIN_CLOSED_SPACE))
  737. X    {
  738. X      flag = TRUE;
  739. X      if (panel_contains(y, x) && test_light(y, x))
  740. X        {
  741. X          objdes(tmp_str, &t_list[c_ptr->tptr], FALSE);
  742. X          (void) sprintf(out_val, "The %s turns into mud.", tmp_str);
  743. X          msg_print(out_val);
  744. X          wall = TRUE;
  745. X        }
  746. X      (void) delete_object(y, x);
  747. X    }
  748. X      if (c_ptr->cptr > 1)
  749. X    {
  750. X      m_ptr = &m_list[c_ptr->cptr];
  751. X      r_ptr = &c_list[m_ptr->mptr];
  752. X      if (CD_STONE & r_ptr->cdefense)
  753. X        {
  754. X          monster_name (m_name, m_ptr, r_ptr);
  755. X          i = mon_take_hit((int)c_ptr->cptr, 100);
  756. X          /* Should get these messages even if the monster is not
  757. X         visible.  */
  758. X          if (i >= 0)
  759. X        {
  760. X          c_recall[i].r_cdefense |= CD_STONE;
  761. X          (void) sprintf(out_val, "%s dissolves!", m_name);
  762. X          msg_print(out_val);
  763. X          prt_experience(); /* print msg before calling prt_exp */
  764. X        }
  765. X          else
  766. X        {
  767. X          c_recall[m_ptr->mptr].r_cdefense |= CD_STONE;
  768. X          (void) sprintf(out_val, "%s grunts in pain!",m_name);
  769. X          msg_print(out_val);
  770. X        }
  771. X          flag = TRUE;
  772. X        }
  773. X    }
  774. X    }
  775. X  while (!flag);
  776. X  return(wall);
  777. X}
  778. X
  779. X
  780. X/* Destroy all traps and doors in a given direction    -RAK-    */
  781. Xint td_destroy2(dir, y, x)
  782. Xint dir, y, x;
  783. X{
  784. X  register int destroy2, dist;
  785. X  register cave_type *c_ptr;
  786. X  register inven_type *t_ptr;
  787. X
  788. X  destroy2 = FALSE;
  789. X  dist= 0;
  790. X  do
  791. X    {
  792. X      (void) mmove(dir, &y, &x);
  793. X      dist++;
  794. X      c_ptr = &cave[y][x];
  795. X      /* must move into first closed spot, as it might be a secret door */
  796. X      if (c_ptr->tptr != 0)
  797. X    {
  798. X      t_ptr = &t_list[c_ptr->tptr];
  799. X      if ((t_ptr->tval == TV_INVIS_TRAP) || (t_ptr->tval == TV_CLOSED_DOOR)
  800. X          || (t_ptr->tval == TV_VIS_TRAP) || (t_ptr->tval == TV_OPEN_DOOR)
  801. X          || (t_ptr->tval == TV_SECRET_DOOR))
  802. X        {
  803. X          if (delete_object(y, x))
  804. X        {
  805. X          msg_print("There is a bright flash of light!");
  806. X          destroy2 = TRUE;
  807. X        }
  808. X        }
  809. X      else if (t_ptr->tval == TV_CHEST)
  810. X        {
  811. X          msg_print("Click!");
  812. X          t_ptr->flags &= ~(CH_TRAPPED|CH_LOCKED);
  813. X          destroy2 = TRUE;
  814. X          t_ptr->name2 = SN_UNLOCKED;
  815. X          known2(t_ptr);
  816. X        }
  817. X    }
  818. X    }
  819. X  while ((dist <= OBJ_BOLT_RANGE) || c_ptr->fval <= MAX_OPEN_SPACE);
  820. X  return(destroy2);
  821. X}
  822. X
  823. X
  824. X/* Polymorph a monster                    -RAK-    */
  825. X/* NOTE: cannot polymorph a winning creature (BALROG)         */
  826. Xint poly_monster(dir, y, x)
  827. Xint dir, y, x;
  828. X{
  829. X  int dist, flag, poly;
  830. X  register cave_type *c_ptr;
  831. X  register creature_type *r_ptr;
  832. X  register monster_type *m_ptr;
  833. X  vtype out_val, m_name;
  834. X
  835. X  poly = FALSE;
  836. X  flag = FALSE;
  837. X  dist = 0;
  838. X  do
  839. X    {
  840. X      (void) mmove(dir, &y, &x);
  841. X      dist++;
  842. X      c_ptr = &cave[y][x];
  843. X      if ((dist > OBJ_BOLT_RANGE) || c_ptr->fval >= MIN_CLOSED_SPACE)
  844. X    flag = TRUE;
  845. X      else if (c_ptr->cptr > 1)
  846. X    {
  847. X      m_ptr = &m_list[c_ptr->cptr];
  848. X      r_ptr = &c_list[m_ptr->mptr];
  849. X      if (randint(MAX_MONS_LEVEL) > r_ptr->level)
  850. X        {
  851. X          flag = TRUE;
  852. X          delete_monster((int)c_ptr->cptr);
  853. X          /* Place_monster() should always return TRUE here.  */
  854. X          poly = place_monster(y, x,
  855. X                   randint(m_level[MAX_MONS_LEVEL]-m_level[0])
  856. X                   - 1 + m_level[0], FALSE);
  857. X          /* don't test c_ptr->fm here, only pl/tl */
  858. X          if (poly && panel_contains(y, x) && (c_ptr->tl || c_ptr->pl))
  859. X        poly = TRUE;
  860. X        }
  861. X      else
  862. X        {
  863. X          monster_name (m_name, m_ptr, r_ptr);
  864. X          (void) sprintf(out_val, "%s is unaffected.", m_name);
  865. X          msg_print(out_val);
  866. X        }
  867. X    }
  868. X    }
  869. X  while (!flag);
  870. X  return(poly);
  871. X}
  872. X
  873. X
  874. X/* Create a wall.                    -RAK-    */
  875. Xint build_wall(dir, y, x)
  876. Xint dir, y, x;
  877. X{
  878. X  register int i;
  879. X  int build, damage, dist, flag;
  880. X  register cave_type *c_ptr;
  881. X  register monster_type *m_ptr;
  882. X  register creature_type *r_ptr;
  883. X  vtype m_name, out_val;
  884. X#ifdef ATARIST_MWC
  885. X  int32u holder;
  886. X#endif
  887. X
  888. X  build = FALSE;
  889. X  dist = 0;
  890. X  flag = FALSE;
  891. X  do
  892. X    {
  893. X      (void) mmove(dir, &y, &x);
  894. X      dist++;
  895. X      c_ptr = &cave[y][x];
  896. X      if ((dist > OBJ_BOLT_RANGE) || c_ptr->fval >= MIN_CLOSED_SPACE)
  897. X    flag = TRUE;
  898. X      else
  899. X    {
  900. X      if (c_ptr->tptr != 0)
  901. X        (void) delete_object(y, x);
  902. X      if (c_ptr->cptr > 1)
  903. X        {
  904. X          /* stop the wall building */
  905. X          flag = TRUE;
  906. X          m_ptr = &m_list[c_ptr->cptr];
  907. X          r_ptr = &c_list[m_ptr->mptr];
  908. X
  909. X#ifdef ATARIST_MWC
  910. X          if (!(r_ptr->cmove & (holder = CM_PHASE)))
  911. X#else
  912. X          if (!(r_ptr->cmove & CM_PHASE))
  913. X#endif
  914. X        {
  915. X          /* monster does not move, can't escape the wall */
  916. X          if (r_ptr->cmove & CM_ATTACK_ONLY)
  917. X            damage = 3000; /* this will kill everything */
  918. X          else
  919. X            damage = damroll (4, 8);
  920. X
  921. X          monster_name (m_name, m_ptr, r_ptr);
  922. X          (void) sprintf (out_val, "%s wails out in pain!", m_name);
  923. X          msg_print (out_val);
  924. X          i = mon_take_hit((int)c_ptr->cptr, damage);
  925. X          if (i >= 0)
  926. X            {
  927. X              (void) sprintf (out_val, "%s is embedded in the rock.",
  928. X                      m_name);
  929. X              msg_print (out_val);
  930. X              prt_experience();
  931. X            }
  932. X        }
  933. X          else if (r_ptr->cchar == 'E' || r_ptr->cchar == 'X')
  934. X        {
  935. X          /* must be an earth elemental or an earth spirit, or a Xorn
  936. X             increase its hit points */
  937. X          m_ptr->hp += damroll(4, 8);
  938. X        }
  939. X        }
  940. X      c_ptr->fval  = MAGMA_WALL;
  941. X      c_ptr->fm = FALSE;
  942. X      /* Permanently light this wall if it is lit by player's lamp.  */
  943. X      c_ptr->pl = (c_ptr->tl || c_ptr->pl);
  944. X      lite_spot(y, x);
  945. X      i++;
  946. X      build = TRUE;
  947. X    }
  948. X    }
  949. X  while (!flag);
  950. X  return(build);
  951. X}
  952. X
  953. X
  954. X/* Replicate a creature                    -RAK-    */
  955. Xint clone_monster(dir, y, x)
  956. Xint dir, y, x;
  957. X{
  958. X  register cave_type *c_ptr;
  959. X  register int dist, flag;
  960. X
  961. X  dist = 0;
  962. X  flag = FALSE;
  963. X  do
  964. X    {
  965. X      (void) mmove(dir, &y, &x);
  966. X      dist++;
  967. X      c_ptr = &cave[y][x];
  968. X      if ((dist > OBJ_BOLT_RANGE) || c_ptr->fval >= MIN_CLOSED_SPACE)
  969. X    flag = TRUE;
  970. X      else if (c_ptr->cptr > 1)
  971. X    {
  972. X      m_list[c_ptr->cptr].csleep = 0;
  973. X      /* monptr of 0 is safe here, since can't reach here from creatures */
  974. X      return multiply_monster(y, x, (int)m_list[c_ptr->cptr].mptr, 0);
  975. X    }
  976. X    }
  977. X  while (!flag);
  978. X  return(FALSE);
  979. X}
  980. X
  981. X
  982. X/* Move the creature record to a new location        -RAK-    */
  983. Xvoid teleport_away(monptr, dis)
  984. Xint monptr, dis;
  985. X{
  986. X  register int yn, xn, ctr;
  987. X  register monster_type *m_ptr;
  988. X
  989. X  m_ptr = &m_list[monptr];
  990. X  ctr = 0;
  991. X  do
  992. X    {
  993. X      do
  994. X    {
  995. X      yn = m_ptr->fy + (randint(2*dis+1) - (dis + 1));
  996. X      xn = m_ptr->fx + (randint(2*dis+1) - (dis + 1));
  997. X    }
  998. X      while (!in_bounds(yn, xn));
  999. X      ctr++;
  1000. X      if (ctr > 9)
  1001. X    {
  1002. X      ctr = 0;
  1003. X      dis += 5;
  1004. X    }
  1005. X    }
  1006. X  while ((cave[yn][xn].fval >= MIN_CLOSED_SPACE) || (cave[yn][xn].cptr != 0));
  1007. X  move_rec((int)m_ptr->fy, (int)m_ptr->fx, yn, xn);
  1008. X  lite_spot((int)m_ptr->fy, (int)m_ptr->fx);
  1009. X  m_ptr->fy = yn;
  1010. X  m_ptr->fx = xn;
  1011. X  /* this is necessary, because the creature is not currently visible
  1012. X     in its new position */
  1013. X  m_ptr->ml = FALSE;
  1014. X  m_ptr->cdis = distance (char_row, char_col, yn, xn);
  1015. X  update_mon (monptr);
  1016. X}
  1017. X
  1018. X
  1019. X/* Teleport player to spell casting creature        -RAK-    */
  1020. Xvoid teleport_to(ny, nx)
  1021. Xint ny, nx;
  1022. X{
  1023. X  int dis, ctr, y, x;
  1024. X  register int i, j;
  1025. X  register cave_type *c_ptr;
  1026. X
  1027. X  dis = 1;
  1028. X  ctr = 0;
  1029. X  do
  1030. X    {
  1031. X      y = ny + (randint(2*dis+1) - (dis + 1));
  1032. X      x = nx + (randint(2*dis+1) - (dis + 1));
  1033. X      ctr++;
  1034. X      if (ctr > 9)
  1035. X    {
  1036. X      ctr = 0;
  1037. X      dis++;
  1038. X    }
  1039. X    }
  1040. X  while (!in_bounds(y, x) || (cave[y][x].fval >= MIN_CLOSED_SPACE)
  1041. X     || (cave[y][x].cptr >= 2));
  1042. X  move_rec(char_row, char_col, y, x);
  1043. X  for (i = char_row-1; i <= char_row+1; i++)
  1044. X    for (j = char_col-1; j <= char_col+1; j++)
  1045. X      {
  1046. X    c_ptr = &cave[i][j];
  1047. X    c_ptr->tl = FALSE;
  1048. X    lite_spot(i, j);
  1049. X      }
  1050. X  lite_spot(char_row, char_col);
  1051. X  char_row = y;
  1052. X  char_col = x;
  1053. X  check_view();
  1054. X  /* light creatures */
  1055. X  creatures(FALSE);
  1056. X}
  1057. X
  1058. X
  1059. X/* Teleport all creatures in a given direction away    -RAK-    */
  1060. Xint teleport_monster(dir, y, x)
  1061. Xint dir, y, x;
  1062. X{
  1063. X  register int flag, result, dist;
  1064. X  register cave_type *c_ptr;
  1065. X
  1066. X  flag = FALSE;
  1067. X  result = FALSE;
  1068. X  dist = 0;
  1069. X  do
  1070. X    {
  1071. X      (void) mmove(dir, &y, &x);
  1072. X      dist++;
  1073. X      c_ptr = &cave[y][x];
  1074. X      if ((dist > OBJ_BOLT_RANGE) || c_ptr->fval >= MIN_CLOSED_SPACE)
  1075. X    flag = TRUE;
  1076. X      else if (c_ptr->cptr > 1)
  1077. X    {
  1078. X      m_list[c_ptr->cptr].csleep = 0; /* wake it up */
  1079. X      teleport_away((int)c_ptr->cptr, MAX_SIGHT);
  1080. X      result = TRUE;
  1081. X    }
  1082. X    }
  1083. X  while (!flag);
  1084. X  return(result);
  1085. X}
  1086. X
  1087. X
  1088. X/* Delete all creatures within max_sight distance    -RAK-    */
  1089. X/* NOTE : Winning creatures cannot be genocided             */
  1090. Xint mass_genocide()
  1091. X{
  1092. X  register int i, result;
  1093. X  register monster_type *m_ptr;
  1094. X  register creature_type *r_ptr;
  1095. X#ifdef ATARIST_MWC
  1096. X  int32u holder;
  1097. X#endif
  1098. X
  1099. X  result = FALSE;
  1100. X  for (i = mfptr - 1; i >= MIN_MONIX; i--)
  1101. X    {
  1102. X      m_ptr = &m_list[i];
  1103. X      r_ptr = &c_list[m_ptr->mptr];
  1104. X#ifdef ATARIST_MWC
  1105. X      if ((m_ptr->cdis <= MAX_SIGHT) &&
  1106. X      ((r_ptr->cmove & (holder = CM_WIN)) == 0))
  1107. X#else
  1108. X      if ((m_ptr->cdis <= MAX_SIGHT) && ((r_ptr->cmove & CM_WIN) == 0))
  1109. X#endif
  1110. X    {
  1111. X      delete_monster(i);
  1112. X      result = TRUE;
  1113. X    }
  1114. X    }
  1115. X  return(result);
  1116. X}
  1117. X
  1118. X/* Delete all creatures of a given type from level.    -RAK-    */
  1119. X/* This does not keep creatures of type from appearing later.     */
  1120. X/* NOTE : Winning creatures can not be genocided. */
  1121. Xint genocide()
  1122. X{
  1123. X  register int i, killed;
  1124. X  char typ;
  1125. X  register monster_type *m_ptr;
  1126. X  register creature_type *r_ptr;
  1127. X  vtype out_val;
  1128. X#ifdef ATARIST_MWC
  1129. X  int32u holder;
  1130. X#endif
  1131. X
  1132. X  killed = FALSE;
  1133. X  if (get_com("Which type of creature do you wish exterminated?", &typ))
  1134. X    for (i = mfptr - 1; i >= MIN_MONIX; i--)
  1135. X      {
  1136. X    m_ptr = &m_list[i];
  1137. X    r_ptr = &c_list[m_ptr->mptr];
  1138. X    if (typ == c_list[m_ptr->mptr].cchar)
  1139. X#ifdef ATARIST_MWC
  1140. X      if ((r_ptr->cmove & (holder = CM_WIN)) == 0)
  1141. X#else
  1142. X      if ((r_ptr->cmove & CM_WIN) == 0)
  1143. X#endif
  1144. X        {
  1145. X          delete_monster(i);
  1146. X          killed = TRUE;
  1147. X        }
  1148. X      else
  1149. X        {
  1150. X          /* genocide is a powerful spell, so we will let the player
  1151. X         know the names of the creatures he did not destroy,
  1152. X         this message makes no sense otherwise */
  1153. X          (void) sprintf(out_val, "The %s is unaffected.", r_ptr->name);
  1154. X          msg_print(out_val);
  1155. X        }
  1156. X      }
  1157. X  return(killed);
  1158. X}
  1159. X
  1160. X
  1161. X/* Change speed of any creature .            -RAK-    */
  1162. X/* NOTE: cannot slow a winning creature (BALROG)         */
  1163. Xint speed_monsters(spd)
  1164. Xint spd;
  1165. X{
  1166. X  register int i, speed;
  1167. X  register monster_type *m_ptr;
  1168. X  register creature_type *r_ptr;
  1169. X  vtype out_val, m_name;
  1170. X
  1171. X  speed = FALSE;
  1172. X  for (i = mfptr - 1; i >= MIN_MONIX; i--)
  1173. X    {
  1174. X      m_ptr = &m_list[i];
  1175. X      r_ptr = &c_list[m_ptr->mptr];
  1176. X      monster_name (m_name, m_ptr, r_ptr);
  1177. X
  1178. X      if ((m_ptr->cdis > MAX_SIGHT) ||
  1179. X      !los(char_row, char_col, (int)m_ptr->fy, (int)m_ptr->fx))
  1180. X    /* do nothing */
  1181. X    ;
  1182. X      else if (spd > 0)
  1183. X    {
  1184. X      m_ptr->cspeed += spd;
  1185. X      m_ptr->csleep = 0;
  1186. X      if (m_ptr->ml)
  1187. X        {
  1188. X          speed = TRUE;
  1189. X          (void) sprintf (out_val, "%s starts moving faster.", m_name);
  1190. X          msg_print (out_val);
  1191. X        }
  1192. X    }
  1193. X      else if (randint(MAX_MONS_LEVEL) > r_ptr->level)
  1194. X    {
  1195. X      m_ptr->cspeed += spd;
  1196. X      m_ptr->csleep = 0;
  1197. X      if (m_ptr->ml)
  1198. X        {
  1199. X          (void) sprintf (out_val, "%s starts moving slower.", m_name);
  1200. X          msg_print (out_val);
  1201. X          speed = TRUE;
  1202. X        }
  1203. X    }
  1204. X      else if (m_ptr->ml)
  1205. X    {
  1206. X      m_ptr->csleep = 0;
  1207. X      (void) sprintf(out_val, "%s is unaffected.", m_name);
  1208. X      msg_print(out_val);
  1209. X    }
  1210. X    }
  1211. X  return(speed);
  1212. X}
  1213. X
  1214. X
  1215. X/* Sleep any creature .        -RAK-    */
  1216. Xint sleep_monsters2()
  1217. X{
  1218. X  register int i, sleep;
  1219. X  register monster_type *m_ptr;
  1220. X  register creature_type *r_ptr;
  1221. X  vtype out_val, m_name;
  1222. X
  1223. X  sleep = FALSE;
  1224. X  for (i = mfptr - 1; i >= MIN_MONIX; i--)
  1225. X    {
  1226. X      m_ptr = &m_list[i];
  1227. X      r_ptr = &c_list[m_ptr->mptr];
  1228. X      monster_name (m_name, m_ptr, r_ptr);
  1229. X      if ((m_ptr->cdis > MAX_SIGHT) || 
  1230. X      !los(char_row, char_col, (int)m_ptr->fy, (int)m_ptr->fx))
  1231. X    /* do nothing */
  1232. X    ;
  1233. X      else if ((randint(MAX_MONS_LEVEL) < r_ptr->level) ||
  1234. X      (CD_NO_SLEEP & r_ptr->cdefense))
  1235. X    {
  1236. X      if (m_ptr->ml)
  1237. X        {
  1238. X          if (r_ptr->cdefense & CD_NO_SLEEP)
  1239. X        c_recall[m_ptr->mptr].r_cdefense |= CD_NO_SLEEP;
  1240. X          (void) sprintf(out_val, "%s is unaffected.", m_name);
  1241. X          msg_print(out_val);
  1242. X        }
  1243. X    }
  1244. X      else
  1245. X    {
  1246. X      m_ptr->csleep = 500;
  1247. X      if (m_ptr->ml)
  1248. X        {
  1249. X          (void) sprintf(out_val, "%s falls asleep.", m_name);
  1250. X          msg_print(out_val);
  1251. X          sleep = TRUE;
  1252. X        }
  1253. X    }
  1254. X    }
  1255. X  return(sleep);
  1256. X}
  1257. X
  1258. X
  1259. X/* Polymorph any creature that player can see.    -RAK-    */
  1260. X/* NOTE: cannot polymorph a winning creature (BALROG)         */
  1261. Xint mass_poly()
  1262. X{
  1263. X  register int i;
  1264. X  int y, x, mass;
  1265. X  register monster_type *m_ptr;
  1266. X  register creature_type *r_ptr;
  1267. X#ifdef ATARIST_MWC
  1268. X  int32u holder;
  1269. X#endif
  1270. X
  1271. X  mass = FALSE;
  1272. X  for (i = mfptr - 1; i >= MIN_MONIX; i--)
  1273. X    {
  1274. X      m_ptr = &m_list[i];
  1275. X      if (m_ptr->cdis <= MAX_SIGHT)
  1276. X    {
  1277. X      r_ptr = &c_list[m_ptr->mptr];
  1278. X#ifdef ATARIST_MWC
  1279. X      if ((r_ptr->cmove & (holder = CM_WIN)) == 0)
  1280. X#else
  1281. X      if ((r_ptr->cmove & CM_WIN) == 0)
  1282. X#endif
  1283. X        {
  1284. X          y = m_ptr->fy;
  1285. X          x = m_ptr->fx;
  1286. X          delete_monster(i);
  1287. X          /* Place_monster() should always return TRUE here.  */
  1288. X          mass = place_monster(y, x,
  1289. X                   randint(m_level[MAX_MONS_LEVEL]-m_level[0])
  1290. X                   - 1 + m_level[0], FALSE);
  1291. X        }
  1292. X    }
  1293. X    }
  1294. X  return(mass);
  1295. X}
  1296. X
  1297. X
  1298. X/* Display evil creatures on current panel        -RAK-    */
  1299. Xint detect_evil()
  1300. X{
  1301. X  register int i, flag;
  1302. X  register monster_type *m_ptr;
  1303. X
  1304. X  flag = FALSE;
  1305. X  for (i = mfptr - 1; i >= MIN_MONIX; i--)
  1306. X    {
  1307. X      m_ptr = &m_list[i];
  1308. X      if (panel_contains((int)m_ptr->fy, (int)m_ptr->fx) &&
  1309. X      (CD_EVIL & c_list[m_ptr->mptr].cdefense))
  1310. X    {
  1311. X      m_ptr->ml = TRUE;
  1312. X      /* works correctly even if hallucinating */
  1313. X      print((char)c_list[m_ptr->mptr].cchar, (int)m_ptr->fy,
  1314. X        (int)m_ptr->fx);
  1315. X      flag = TRUE;
  1316. X    }
  1317. X    }
  1318. X  if (flag)
  1319. X    {
  1320. X      msg_print("You sense the presence of evil!");
  1321. X      msg_print(CNIL);
  1322. X      /* must unlight every monster just lighted */
  1323. X      creatures(FALSE);
  1324. X    }
  1325. X  return(flag);
  1326. X}
  1327. X
  1328. X
  1329. X/* Change players hit points in some manner        -RAK-    */
  1330. Xint hp_player(num)
  1331. Xint num;
  1332. X{
  1333. X  register int res;
  1334. X  register struct misc *m_ptr;
  1335. X
  1336. X  res = FALSE;
  1337. X  m_ptr = &py.misc;
  1338. X  if (m_ptr->chp < m_ptr->mhp)
  1339. X    {
  1340. X      m_ptr->chp += num;
  1341. X      if (m_ptr->chp > m_ptr->mhp)
  1342. X    {
  1343. X      m_ptr->chp = m_ptr->mhp;
  1344. X      m_ptr->chp_frac = 0;
  1345. X    }
  1346. X      prt_chp();
  1347. X
  1348. X      num = num / 5;
  1349. X      if (num < 3) {
  1350. X    if (num == 0) msg_print("You feel a little better.");
  1351. X    else          msg_print("You feel better.");
  1352. X      } else {
  1353. X    if (num < 7) msg_print("You feel much better.");
  1354. X    else         msg_print("You feel very good.");
  1355. X      }
  1356. X      res = TRUE;
  1357. X    }
  1358. X  return(res);
  1359. X}
  1360. X
  1361. X
  1362. X/* Cure players confusion                -RAK-    */
  1363. Xint cure_confusion()
  1364. X{
  1365. X  register int cure;
  1366. X  register struct flags *f_ptr;
  1367. X
  1368. X  cure = FALSE;
  1369. X  f_ptr = &py.flags;
  1370. X  if (f_ptr->confused > 1)
  1371. X    {
  1372. X      f_ptr->confused = 1;
  1373. X      cure = TRUE;
  1374. X    }
  1375. X  return(cure);
  1376. X}
  1377. X
  1378. X
  1379. X/* Cure players blindness                -RAK-    */
  1380. Xint cure_blindness()
  1381. X{
  1382. X  register int cure;
  1383. X  register struct flags *f_ptr;
  1384. X
  1385. X  cure = FALSE;
  1386. X  f_ptr = &py.flags;
  1387. X  if (f_ptr->blind > 1)
  1388. X    {
  1389. X      f_ptr->blind = 1;
  1390. X      cure = TRUE;
  1391. X    }
  1392. X  return(cure);
  1393. X}
  1394. X
  1395. X
  1396. X/* Cure poisoning                    -RAK-    */
  1397. Xint cure_poison()
  1398. X{
  1399. X  register int cure;
  1400. X  register struct flags *f_ptr;
  1401. X
  1402. X  cure = FALSE;
  1403. X  f_ptr = &py.flags;
  1404. X  if (f_ptr->poisoned > 1)
  1405. X    {
  1406. X      f_ptr->poisoned = 1;
  1407. X      cure = TRUE;
  1408. X    }
  1409. X  return(cure);
  1410. X}
  1411. X
  1412. X
  1413. X/* Cure the players fear                -RAK-    */
  1414. Xint remove_fear()
  1415. X{
  1416. X  register int result;
  1417. X  register struct flags *f_ptr;
  1418. X
  1419. X  result = FALSE;
  1420. X  f_ptr = &py.flags;
  1421. X  if (f_ptr->afraid > 1)
  1422. X    {
  1423. X      f_ptr->afraid = 1;
  1424. X      result = TRUE;
  1425. X    }
  1426. X  return(result);
  1427. X}
  1428. X
  1429. X
  1430. X/* This is a fun one.  In a given block, pick some walls and    */
  1431. X/* turn them into open spots.  Pick some open spots and turn     */
  1432. X/* them into walls.  An "Earthquake" effect.           -RAK-   */
  1433. Xvoid earthquake()
  1434. X{
  1435. X  register int i, j;
  1436. X  register cave_type *c_ptr;
  1437. X  register monster_type *m_ptr;
  1438. X  register creature_type *r_ptr;
  1439. X  int damage, tmp;
  1440. X  vtype out_val, m_name;
  1441. X#ifdef ATARIST_MWC
  1442. X  int32u holder;
  1443. X#endif
  1444. X
  1445. X  for (i = char_row-8; i <= char_row+8; i++)
  1446. X    for (j = char_col-8; j <= char_col+8; j++)
  1447. X      if (((i != char_row) || (j != char_col)) &&
  1448. X      in_bounds(i, j) && (randint(8) == 1))
  1449. X    {
  1450. X      c_ptr = &cave[i][j];
  1451. X      if (c_ptr->tptr != 0)
  1452. X        (void) delete_object(i, j);
  1453. X      if (c_ptr->cptr > 1)
  1454. X        {
  1455. X          m_ptr = &m_list[c_ptr->cptr];
  1456. X          r_ptr = &c_list[m_ptr->mptr];
  1457. X
  1458. X#ifdef ATARIST_MWC
  1459. X          if (!(r_ptr->cmove & (holder = CM_PHASE)))
  1460. X#else
  1461. X          if (!(r_ptr->cmove & CM_PHASE))
  1462. X#endif
  1463. X        {
  1464. X          if(r_ptr->cmove & CM_ATTACK_ONLY)
  1465. X            damage = 3000; /* this will kill everything */
  1466. X          else
  1467. X            damage = damroll (4, 8);
  1468. X
  1469. X          monster_name (m_name, m_ptr, r_ptr);
  1470. X          (void) sprintf (out_val, "%s wails out in pain!", m_name);
  1471. X          msg_print (out_val);
  1472. X          i = mon_take_hit((int)c_ptr->cptr, damage);
  1473. X          if (i >= 0)
  1474. X            {
  1475. X              (void) sprintf (out_val, "%s is embedded in the rock.",
  1476. X                      m_name);
  1477. X              msg_print (out_val);
  1478. X              prt_experience();
  1479. X            }
  1480. X        }
  1481. X          else if (r_ptr->cchar == 'E' || r_ptr->cchar == 'X')
  1482. X        {
  1483. X          /* must be an earth elemental or an earth spirit, or a Xorn
  1484. X             increase its hit points */
  1485. X          m_ptr->hp += damroll(4, 8);
  1486. X        }
  1487. X        }
  1488. X
  1489. X      if ((c_ptr->fval >= MIN_CAVE_WALL) && (c_ptr->fval != BOUNDARY_WALL))
  1490. X        {
  1491. X          c_ptr->fval  = CORR_FLOOR;
  1492. X          c_ptr->pl = FALSE;
  1493. X          c_ptr->fm = FALSE;
  1494. X        }
  1495. X      else if (c_ptr->fval <= MAX_CAVE_FLOOR)
  1496. X        {
  1497. X          tmp = randint(10);
  1498. X          if (tmp < 6)
  1499. X        c_ptr->fval  = QUARTZ_WALL;
  1500. X          else if (tmp < 9)
  1501. X        c_ptr->fval  = MAGMA_WALL;
  1502. X          else
  1503. X        c_ptr->fval  = GRANITE_WALL;
  1504. X
  1505. X          c_ptr->fm = FALSE;
  1506. X        }
  1507. X      lite_spot(i, j);
  1508. X    }
  1509. X}
  1510. X
  1511. X
  1512. X/* Evil creatures don't like this.               -RAK-   */
  1513. Xint protect_evil()
  1514. X{
  1515. X  register int res;
  1516. X  register struct flags *f_ptr;
  1517. X
  1518. X  f_ptr = &py.flags;
  1519. X  if (f_ptr->protevil == 0)
  1520. X    res = TRUE;
  1521. X  else
  1522. X    res = FALSE;
  1523. X  f_ptr->protevil += randint(25) + 3*py.misc.lev;
  1524. X  return(res);
  1525. X}
  1526. X
  1527. X
  1528. X/* Create some high quality mush for the player.    -RAK-    */
  1529. Xvoid create_food()
  1530. X{
  1531. X  register cave_type *c_ptr;
  1532. X
  1533. X  c_ptr = &cave[char_row][char_col];
  1534. X  if (c_ptr->tptr != 0)
  1535. X    {
  1536. X      /* take no action here, don't want to destroy object under player */
  1537. X      msg_print ("There is already an object under you.");
  1538. X      /* set free_turn_flag so that scroll/spell points won't be used */
  1539. X      free_turn_flag = TRUE;
  1540. X    }
  1541. X  else
  1542. X    {
  1543. X      place_object(char_row, char_col);
  1544. X      invcopy(&t_list[c_ptr->tptr], OBJ_MUSH);
  1545. X    }
  1546. X}
  1547. X
  1548. X
  1549. X/* Attempts to destroy a type of creature.  Success depends on    */
  1550. X/* the creatures level VS. the player's level         -RAK-     */
  1551. Xint dispel_creature(cflag, damage)
  1552. Xint cflag;
  1553. Xint damage;
  1554. X{
  1555. X  register int i;
  1556. X  int k, dispel;
  1557. X  register monster_type *m_ptr;
  1558. X  register creature_type *r_ptr;
  1559. X  vtype out_val, m_name;
  1560. X
  1561. X  dispel = FALSE;
  1562. X  for (i = mfptr - 1; i >= MIN_MONIX; i--)
  1563. X    {
  1564. X      m_ptr = &m_list[i];
  1565. X      if ((m_ptr->cdis <= MAX_SIGHT) &&
  1566. X      (cflag & c_list[m_ptr->mptr].cdefense) &&
  1567. X      los(char_row, char_col, (int)m_ptr->fy, (int)m_ptr->fx))
  1568. X    {
  1569. X      r_ptr = &c_list[m_ptr->mptr];
  1570. X      c_recall[m_ptr->mptr].r_cdefense |= cflag;
  1571. X      monster_name (m_name, m_ptr, r_ptr);
  1572. X      k = mon_take_hit (i, randint(damage));
  1573. X      /* Should get these messages even if the monster is not
  1574. X         visible.  */
  1575. X      if (k >= 0)
  1576. X        (void) sprintf(out_val, "%s dissolves!", m_name);
  1577. X      else
  1578. X        (void) sprintf(out_val, "%s shudders.", m_name);
  1579. X      msg_print(out_val);
  1580. X      dispel = TRUE;
  1581. X      if (k >= 0)
  1582. X        prt_experience();
  1583. X    }
  1584. X    }
  1585. X  return(dispel);
  1586. X}
  1587. X
  1588. X
  1589. X/* Attempt to turn (confuse) undead creatures.    -RAK-    */
  1590. Xint turn_undead()
  1591. X{
  1592. X  register int i, turn_und;
  1593. X  register monster_type *m_ptr;
  1594. X  register creature_type *r_ptr;
  1595. X  vtype out_val, m_name;
  1596. X
  1597. X  turn_und = FALSE;
  1598. X  for (i = mfptr - 1; i >= MIN_MONIX; i--)
  1599. X    {
  1600. X      m_ptr = &m_list[i];
  1601. X      r_ptr = &c_list[m_ptr->mptr];
  1602. X      if ((m_ptr->cdis <= MAX_SIGHT) &&
  1603. X      (CD_UNDEAD & r_ptr->cdefense) &&
  1604. X      (los(char_row, char_col, (int)m_ptr->fy, (int)m_ptr->fx)))
  1605. X    {
  1606. X      monster_name (m_name, m_ptr, r_ptr);
  1607. X      if (((py.misc.lev+1) > r_ptr->level) ||
  1608. X          (randint(5) == 1))
  1609. X        {
  1610. X          if (m_ptr->ml)
  1611. X        {
  1612. X          (void) sprintf(out_val, "%s runs frantically!", m_name);
  1613. X          msg_print(out_val);
  1614. X          turn_und = TRUE;
  1615. X          c_recall[m_ptr->mptr].r_cdefense |= CD_UNDEAD;
  1616. X        }
  1617. X          m_ptr->confused = TRUE;
  1618. X        }
  1619. X      else if (m_ptr->ml)
  1620. X        {
  1621. X          (void) sprintf(out_val, "%s is unaffected.", m_name);
  1622. X          msg_print(out_val);
  1623. X        }
  1624. X    }
  1625. X    }
  1626. X  return(turn_und);
  1627. X}
  1628. X
  1629. X
  1630. X/* Leave a glyph of warding. Creatures will not pass over! -RAK-*/
  1631. Xvoid warding_glyph()
  1632. X{
  1633. X  register int i;
  1634. X  register cave_type *c_ptr;
  1635. X
  1636. X  c_ptr = &cave[char_row][char_col];
  1637. X  if (c_ptr->tptr == 0)
  1638. X    {
  1639. X      i = popt();
  1640. X      c_ptr->tptr = i;
  1641. X      invcopy(&t_list[i], OBJ_SCARE_MON);
  1642. X    }
  1643. X}
  1644. X
  1645. X
  1646. X/* Lose a strength point.                -RAK-    */
  1647. Xvoid lose_str()
  1648. X{
  1649. X  if (!py.flags.sustain_str)
  1650. X    {
  1651. X      (void) dec_stat (A_STR);
  1652. X      msg_print("You feel very sick.");
  1653. X    }
  1654. X  else
  1655. X    msg_print("You feel sick for a moment,  it passes.");
  1656. X}
  1657. X
  1658. X
  1659. X/* Lose an intelligence point.                -RAK-    */
  1660. Xvoid lose_int()
  1661. X{
  1662. X  if (!py.flags.sustain_int)
  1663. X    {
  1664. X      (void) dec_stat(A_INT);
  1665. X      msg_print("You become very dizzy.");
  1666. X    }
  1667. X  else
  1668. X    msg_print("You become dizzy for a moment,  it passes.");
  1669. X}
  1670. X
  1671. X
  1672. X/* Lose a wisdom point.                    -RAK-    */
  1673. Xvoid lose_wis()
  1674. X{
  1675. X  if (!py.flags.sustain_wis)
  1676. X    {
  1677. X      (void) dec_stat(A_WIS);
  1678. X      msg_print("You feel very naive.");
  1679. X    }
  1680. X  else
  1681. X    msg_print("You feel naive for a moment,  it passes.");
  1682. X}
  1683. X
  1684. X
  1685. X/* Lose a dexterity point.                -RAK-    */
  1686. Xvoid lose_dex()
  1687. X{
  1688. X  if (!py.flags.sustain_dex)
  1689. X    {
  1690. X      (void) dec_stat(A_DEX);
  1691. X      msg_print("You feel very sore.");
  1692. X    }
  1693. X  else
  1694. X    msg_print("You feel sore for a moment,  it passes.");
  1695. X}
  1696. X
  1697. X
  1698. X/* Lose a constitution point.                -RAK-    */
  1699. Xvoid lose_con()
  1700. X{
  1701. X  if (!py.flags.sustain_con)
  1702. X    {
  1703. X      (void) dec_stat(A_CON);
  1704. X      msg_print("You feel very sick.");
  1705. X    }
  1706. X  else
  1707. X    msg_print("You feel sick for a moment,  it passes.");
  1708. X}
  1709. X
  1710. X
  1711. X/* Lose a charisma point.                -RAK-    */
  1712. Xvoid lose_chr()
  1713. X{
  1714. X  if (!py.flags.sustain_chr)
  1715. X    {
  1716. X      (void) dec_stat(A_CHR);
  1717. X      msg_print("Your skin starts to itch.");
  1718. X    }
  1719. X  else
  1720. X    msg_print("Your skin starts to itch, but feels better now.");
  1721. X}
  1722. X
  1723. X
  1724. X/* Lose experience                    -RAK-    */
  1725. Xvoid lose_exp(amount)
  1726. Xint32 amount;
  1727. X{
  1728. X  register int i;
  1729. X  register struct misc *m_ptr;
  1730. X  register class_type *c_ptr;
  1731. X
  1732. X  m_ptr = &py.misc;
  1733. X  if (amount > m_ptr->exp)
  1734. X    m_ptr->exp = 0;
  1735. X  else
  1736. X    m_ptr->exp -= amount;
  1737. X  prt_experience();
  1738. X
  1739. X  i = 0;
  1740. X  while ((player_exp[i] * m_ptr->expfact / 100) <= m_ptr->exp)
  1741. X    i++;
  1742. X  /* increment i once more, because level 1 exp is stored in player_exp[0] */
  1743. X  i++;
  1744. X
  1745. X  if (m_ptr->lev != i)
  1746. X    {
  1747. X      m_ptr->lev = i;
  1748. X
  1749. X      calc_hitpoints();
  1750. X      c_ptr = &class[m_ptr->pclass];
  1751. X      if (c_ptr->spell == MAGE)
  1752. X    {
  1753. X      calc_spells(A_INT);
  1754. X      calc_mana(A_INT);
  1755. X    }
  1756. X      else if (c_ptr->spell == PRIEST)
  1757. X    {
  1758. X      calc_spells(A_WIS);
  1759. X      calc_mana(A_WIS);
  1760. X    }
  1761. X      prt_level();
  1762. X      prt_title();
  1763. X    }
  1764. X}
  1765. X
  1766. X
  1767. X/* Slow Poison                        -RAK-    */
  1768. Xint slow_poison()
  1769. X{
  1770. X  register int slow;
  1771. X  register struct flags *f_ptr;
  1772. X
  1773. X  slow = FALSE;
  1774. X  f_ptr = &py.flags;
  1775. X  if (f_ptr->poisoned > 0)
  1776. X    {
  1777. X      f_ptr->poisoned = f_ptr->poisoned / 2;
  1778. X      if (f_ptr->poisoned < 1)    f_ptr->poisoned = 1;
  1779. X      slow = TRUE;
  1780. X      msg_print("The effect of the poison has been reduced.");
  1781. X    }
  1782. X  return(slow);
  1783. X}
  1784. X
  1785. X
  1786. X/* Bless                        -RAK-    */
  1787. Xvoid bless(amount)
  1788. Xint amount;
  1789. X{
  1790. X  py.flags.blessed += amount;
  1791. X}
  1792. X
  1793. X
  1794. X/* Detect Invisible for period of time            -RAK-    */
  1795. Xvoid detect_inv2(amount)
  1796. Xint amount;
  1797. X{
  1798. X  py.flags.detect_inv += amount;
  1799. X}
  1800. X
  1801. X
  1802. Xstatic void replace_spot(y, x, typ)
  1803. Xint y, x, typ;
  1804. X{
  1805. X  register cave_type *c_ptr;
  1806. X
  1807. X  c_ptr = &cave[y][x];
  1808. X  switch(typ)
  1809. X    {
  1810. X    case 1: case 2: case 3:
  1811. X      c_ptr->fval  = CORR_FLOOR;
  1812. X      break;
  1813. X    case 4: case 7: case 10:
  1814. X      c_ptr->fval  = GRANITE_WALL;
  1815. X      break;
  1816. X    case 5: case 8: case 11:
  1817. X      c_ptr->fval  = MAGMA_WALL;
  1818. X      break;
  1819. X    case 6: case 9: case 12:
  1820. X      c_ptr->fval  = QUARTZ_WALL;
  1821. X      break;
  1822. X    }
  1823. X  c_ptr->pl = FALSE;
  1824. X  c_ptr->fm = FALSE;
  1825. X  c_ptr->lr = FALSE;  /* this is no longer part of a room */
  1826. X  if (c_ptr->tptr != 0)
  1827. X    (void) delete_object(y, x);
  1828. X  if (c_ptr->cptr > 1)
  1829. X    delete_monster((int)c_ptr->cptr);
  1830. X}
  1831. X
  1832. X
  1833. X/* The spell of destruction.                -RAK-    */
  1834. X/* NOTE : Winning creatures that are deleted will be considered     */
  1835. X/*      as teleporting to another level.  This will NOT win the*/
  1836. X/*      game.                               */
  1837. Xvoid destroy_area(y, x)
  1838. Xregister int y, x;
  1839. X{
  1840. X  register int i, j, k;
  1841. X
  1842. X  if (dun_level > 0)
  1843. X    {
  1844. X      for (i = (y-15); i <= (y+15); i++)
  1845. X    for (j = (x-15); j <= (x+15); j++)
  1846. X      if (in_bounds(i, j) && (cave[i][j].fval != BOUNDARY_WALL))
  1847. X        {
  1848. X          k = distance(i, j, y, x);
  1849. X          if (k == 0) /* clear player's spot, but don't put wall there */
  1850. X        replace_spot(i, j, 1);
  1851. X          else if (k < 13)
  1852. X        replace_spot(i, j, randint(6));
  1853. X          else if (k < 16)
  1854. X        replace_spot(i, j, randint(9));
  1855. X        }
  1856. X    }
  1857. X  msg_print("There is a searing blast of light!");
  1858. X  py.flags.blind += 10 + randint(10);
  1859. X}
  1860. X
  1861. X
  1862. X/* Enchants a plus onto an item.            -RAK-    */
  1863. Xint enchant(plusses, limit)
  1864. Xint16 *plusses;
  1865. Xint16 limit; /* maximum bonus allowed; usually 10, but weapon's maximum damage
  1866. X        when enchanting melee weapons to damage */
  1867. X{
  1868. X  register int chance, res;
  1869. X  
  1870. X  if (limit <= 0) /* avoid randint(0) call */
  1871. X    return(FALSE);
  1872. X  chance = 0;
  1873. X  res = FALSE;
  1874. X  if (*plusses > 0)
  1875. X    {
  1876. X      chance = *plusses;
  1877. X      if (randint(100) == 1) /* very rarely allow enchantment over limit */
  1878. X    chance = randint(chance) - 1;
  1879. X    }
  1880. X  if (randint(limit) > chance)
  1881. X    {
  1882. X      *plusses += 1;
  1883. X      res = TRUE;
  1884. X    }
  1885. X  return(res);
  1886. X}
  1887. X
  1888. X
  1889. X/* Removes curses from items in inventory        -RAK-    */
  1890. Xint remove_curse()
  1891. X{
  1892. X  register int i, result;
  1893. X  register inven_type *i_ptr;
  1894. X#ifdef ATARIST_MWC
  1895. X  int32u holder = TR_CURSED;
  1896. X#endif
  1897. X
  1898. X  result = FALSE;
  1899. X  for (i = INVEN_WIELD; i <= INVEN_OUTER; i++)
  1900. X    {
  1901. X      i_ptr = &inventory[i];
  1902. X#ifdef ATARIST_MWC
  1903. X      if (holder & i_ptr->flags)
  1904. X#else
  1905. X      if (TR_CURSED & i_ptr->flags)
  1906. X#endif
  1907. X    {
  1908. X#ifdef ATARIST_MWC
  1909. X      i_ptr->flags &= ~holder;
  1910. X#else
  1911. X      i_ptr->flags &= ~TR_CURSED;
  1912. X#endif
  1913. X      calc_bonuses();
  1914. X      result = TRUE;
  1915. X    }
  1916. X    }
  1917. X  return(result);
  1918. X}
  1919. X
  1920. X
  1921. X/* Restores any drained experience            -RAK-    */
  1922. Xint restore_level()
  1923. X{
  1924. X  register int restore;
  1925. X  register struct misc *m_ptr;
  1926. X
  1927. X  restore = FALSE;
  1928. X  m_ptr = &py.misc;
  1929. X  if (m_ptr->max_exp > m_ptr->exp)
  1930. X    {
  1931. X      restore = TRUE;
  1932. X      msg_print("You feel your life energies returning.");
  1933. X      /* this while loop is not redundant, ptr_exp may reduce the exp level */
  1934. X      while (m_ptr->exp < m_ptr->max_exp)
  1935. X    {
  1936. X      m_ptr->exp = m_ptr->max_exp;
  1937. X      prt_experience();
  1938. X    }
  1939. X    }
  1940. X  return(restore);
  1941. X}
  1942. END_OF_FILE
  1943. if test 28204 -ne `wc -c <'source/spells.c.2'`; then
  1944.     echo shar: \"'source/spells.c.2'\" unpacked with wrong size!
  1945. fi
  1946. # end of 'source/spells.c.2'
  1947. fi
  1948. echo shar: End of archive 25 \(of 39\).
  1949. cp /dev/null ark25isdone
  1950. MISSING=""
  1951. 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
  1952.     if test ! -f ark${I}isdone ; then
  1953.     MISSING="${MISSING} ${I}"
  1954.     fi
  1955. done
  1956. if test "${MISSING}" = "" ; then
  1957.     echo You have unpacked all 39 archives.
  1958.     echo "Now run "bldfiles.sh" to build split files"
  1959.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1960. else
  1961.     echo You still need to unpack the following archives:
  1962.     echo "        " ${MISSING}
  1963. fi
  1964. ##  End of shell archive.
  1965. exit 0
  1966.