home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sources / games / 185 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  56.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: v14i055:  umoria4 - single player dungeon simulation (ver. 5.5), Part23/39
  5. Message-ID: <3419@master.CNA.TEK.COM>
  6. Date: 22 Aug 92 22:12:46 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 1703
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: grabiner@math.harvard.edu (David Grabiner)
  12. Posting-number: Volume 14, Issue 55
  13. Archive-name: umoria4/Part23
  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 23 (of 39)."
  26. # Contents:  doc/moria1.ms.2 source/desc.c util/scores/delete.c
  27. # Wrapped by billr@saab on Thu Aug 20 09:11:32 1992
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'doc/moria1.ms.2' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'doc/moria1.ms.2'\"
  31. else
  32. echo shar: Extracting \"'doc/moria1.ms.2'\" \(29377 characters\)
  33. sed "s/^X//" >'doc/moria1.ms.2' <<'END_OF_FILE'
  34. XIf you choose not to die, \fImoria\fP merely continues as before, except that
  35. Xresting, running, repeated commands, etc will be terminated.
  36. XYou can suspend the game with control-Z, and return to the original
  37. Xcommand shell.  In this case, \fImoria\fP is not terminated, and may be
  38. Xrestarted at any time from the shell.  Alternatively, the special
  39. Xcommand `!' is available to run any normal shell command.  When it is
  40. Xcomplete, \fImoria\fP will restart.
  41. X.LP
  42. XFor many input requests or queries, the special character ESCAPE
  43. Xwill abort the command.  For the \*Q\-more\-\*U message prompts, any
  44. Xof SPACE, ESCAPE, RETURN (control-m), or LINEFEED (control-j)
  45. Xcan be used to continue after pausing to read the displayed message.
  46. X.LP
  47. XIt is possible to give control character commands in two key stroke,
  48. Xby typing a `^' followed by the appropriate letter of the alphabet.
  49. XThis is useful when running \fImoria\fP in circumstances where control
  50. Xcharacters are intercepted by some external process, or by the
  51. Xoperating system.
  52. X.NH 2
  53. XDirection.
  54. X.LP
  55. XFor the original style command set,
  56. Xa direction is given by a digit which is in the appropriate
  57. Xorientation on your keypad.  For the rogue like command set,
  58. Xa direction is given by one of the letters `hykulnjb'.  Again,
  59. Xthe relative position of the keys on the keyboard gives a clue
  60. Xas to the direction.
  61. XThe digit `5' for the original commands, and the period `.'
  62. Xfor rogue like commands, is a null direction indicator.
  63. XThis is only allowed in a movement command (to stay in one place)
  64. Xor in a look command (to look in all directions).
  65. X.RS
  66. X.KS
  67. X.TS
  68. Xtab(^);
  69. Xc s s
  70. Xn n n.
  71. XOriginal Directions
  72. X.sp
  73. X\0\\\\\&^\0|\&\0^\0\&/
  74. X7^8^9
  75. X.sp
  76. X\-\0 4^ ^6\&\0\0\-
  77. X.sp
  78. X1^2^3
  79. X\0/\0\&^\0|\&\0^\0\&\\\\
  80. X.TE
  81. X.KE
  82. X.KS
  83. X.TS
  84. Xtab(^);
  85. Xc s s
  86. Xn n n.
  87. XRogue-like Directions
  88. X.sp
  89. X\0\\\\\&^\0|\&\0^\0\&/
  90. Xy\&^k\&^u\&
  91. X.sp
  92. X\-\0 h\&^ ^l\&\0\0\-
  93. X.sp
  94. Xb\&^j\&^n\&
  95. X\0/\0\&^\0|\&\0^\0\&\\\\
  96. X.TE
  97. X.KE
  98. X.RE
  99. X.LP
  100. XMovement is accomplished by specifying a direction immediately.
  101. XSimply press the appropriate key and you character will move
  102. Xone step in that direction.
  103. XYou can only move onto
  104. Xand through floor spots, and only if they contain no creatures or
  105. Xobstructing objects such as a closed door.
  106. X.LP
  107. XOther commands that require a direction will prompt for it.
  108. X.LP
  109. XMoving your character one step at a time can be time
  110. Xconsuming and boring, so a faster method has been supplied.
  111. XFor the original style command set, by
  112. Xusing the Run command `.', you may move in a direction until
  113. Xsomething interesting happens.  For instance, by pressing the
  114. Xperiod key `.' followed by the direction 8, your character would
  115. Xcontinue to move up the screen, only coming to a stop after at
  116. Xleast one condition is satisfied.
  117. XFor the rogue like command set, typing a shifted directional letter
  118. Xwill move you in that direction until something interesting happens.
  119. XThe stopping conditions are described more completely in
  120. Xthe run command description below.
  121. X
  122. X.NH 2
  123. XCommand counts.
  124. X.LP
  125. XSome commands can be executed a fixed number of times by preceding
  126. Xthem with a count.  Counted commands will execute until the count
  127. Xexpires, or until you type any character, or until something significant
  128. Xhappens, such as being attacked.  Thus, a counted command doesn't work
  129. Xto attack another creature.  While the command is being repeated,
  130. Xthe number of times left to be repeated will flash by on the command
  131. Xline at the bottom of the screen.
  132. X.LP
  133. XTo give a count to a command in the rogue like mode, type the number
  134. Xin digits, then the command.  A count of zero defaults to a count of
  135. X99.
  136. X.LP
  137. XTo give a count to a command in the original mode, type a `#', followed
  138. Xby the digits.  To count a movement command (which is itself a digit),
  139. Xtype a space after the number, and you will then be prompted for the
  140. Xcommand.
  141. X.LP
  142. XCounted commands are very useful for searching or tunneling, as they
  143. Xautomatically terminate on success, or if you are attacked.
  144. XYou may also terminate a counted command, or a Run command, by typing
  145. Xany character.  This character is ignored, but it is safest to use
  146. Xa SPACE or ESCAPE which are always ignored as commands.
  147. X
  148. X.NH 2
  149. XSelection of objects.
  150. X.LP
  151. XMany commands will also prompt for a particular object to be used.
  152. XFor example, the command to read a scroll will ask you which of the scrolls
  153. Xthat you are carrying that you wish to read.
  154. XIn such cases, the selection is made by typing a letter of the alphabet.
  155. XThe prompt will indicate the possible letters, and will also allow you
  156. Xto type the key `*', which causes all of the available options to
  157. Xbe described.
  158. X.LP
  159. XThe particular object may be selected by an upper case or a lower case
  160. Xletter.  If lower case is used, the selection takes place immediately.
  161. XIf upper case is used, then the particular option is described, and you
  162. Xare given the option of confirming or retracting that choice.
  163. XUpper case selection is thus safer, but requires an extra key stroke.
  164. X
  165. X.NH 2
  166. XCommand descriptions
  167. X.LP
  168. XIn the following command descriptions, the original style key is
  169. Xgiven.  If the rogue like key for that command is different, then it
  170. Xwill be shown inside the braces following the command name.
  171. X.IP "B <Dir> - Bash. {f - force}"
  172. XThe bash command includes breaking open doors and chests, or
  173. Xbashing an opponent.  Your bashing ability increases with
  174. Xweight and strength.  In addition,
  175. Xwhen bashing an opponent, you will either perform a body bash, or,
  176. Xif wielding a shield, perform a shield bash which is more
  177. Xeffective.
  178. X.sp
  179. XBashing a door can throw you off balance, but this
  180. Xwill not generally be a problem.  Doors that have been jammed
  181. Xclosed with spikes can only be opened by bashing.  Locked doors
  182. Xmay also be bashed open.  Bashing a door open will
  183. Xpermanently break it.
  184. X.sp
  185. XBashing a creature affects both you and the opponent.
  186. XDepending on your dexterity, you may or may
  187. Xnot be thrown off balance allowing free moves to your opponent.
  188. XIf the bash is successful, your opponent may be thrown
  189. Xoff balance, thus giving you some free
  190. Xhits or a chance to run.  Huge creatures such as ancient dragons
  191. Xwill be difficult or impossible to bash successfully.
  192. X.sp
  193. XA player automatically performs a shield bash instead of a
  194. Xbody bash, if he is currently wearing a shield.  A shield bash
  195. Xadds the damage of a shield to that of the bash, so it is more
  196. Xeffective.  Size and material both affect the damage
  197. Xthat a shield will do.
  198. X.sp
  199. XYou can apply a count to this command, but if you are thrown off
  200. Xbalance, the count will be reset straight away.
  201. X.IP "C  - Print character (to screen or file)."
  202. XThis command allows the player to either display his
  203. Xcharacter on the terminal screen, or to print an entire character
  204. Xinfo listing to a file.  The character's history, equipment,
  205. Xand inventory list are also included if you chose to print it to a file.
  206. X.IP "D <Dir> - Disarm a trap."
  207. XYou can attempt to disarm floor traps, or trapped chests.
  208. XIf you fail to disarm a trap, there is a chance that you blunder
  209. Xand set it off.  You can only disarm a trap on a chest after
  210. Xfinding it with the search command.  This command can have a count.
  211. X.IP "E  - Eat some food."
  212. XA character must eat occasionally to remain effective.  As a
  213. Xcharacter grows hungry, a message will appear at the bottom of
  214. Xthe screen saying \*QHungry\*U.  If a character remains hungry long
  215. Xenough, he will become weak and eventually start fainting.
  216. XEventually, you will die of starvation if you do not eat.
  217. X.IP "F  - Fill a lamp or lantern with oil."
  218. XIf your character is currently using a lamp for light, and
  219. Xif he has a flask of oil in inventory, he may refill the lamp by
  220. Xusing this command.  A lamp is capable of a maximum of 15000 turns
  221. Xof light, and each flask has 7500 turns of oil contained in it.
  222. X.IP "G  - Gain new spells."
  223. XTo actually learn new spells, you must use this command.
  224. XWhen you are able to learn some spells, the word \*QStudy\*U
  225. Xwill appear on the status line at the bottom of the screen.
  226. XMages, rogues, and rangers must have the magic books containing
  227. Xnew spells to be able to learn them.  Priests and Paladins are
  228. Xgiven their prayers by their gods, and hence do not need a holy
  229. Xbook before learning the spells in it.
  230. X.IP "L  - Location on map. {W - where}"
  231. XThe location command allows you to look at all parts of the
  232. Xcurrent dungeon level.  The displayed view of the dungeon is
  233. Xshifted to bring your current position as close to the center
  234. Xas possible.  You may then shift the displayed map in any of the eight
  235. Xpossible directions.  Each shift moves your view point by one
  236. Xhalf screen.  The top line displays a map section number, each map
  237. Xsection having a height and width one half that of the display, and
  238. Xindicates the direction of the display from your current position.
  239. XIf you exit this command while you are not on the display, then the
  240. Xdisplay is centered again.
  241. X.IP "M  - Map shown reduced size."
  242. XThis command will show the entire map, reduced by a factor of nine,
  243. Xon the screen.  Since nine places map into every character on the screen,
  244. Xonly the major dungeon features will be visible.  This is especially
  245. Xuseful for finding where the stairs are in relation to your current
  246. Xposition.  It is also useful for identifying unexplored areas.
  247. X.IP "R  - Rest for a number of turns."
  248. XYou may rest one turn with the null movement command.  Resting for
  249. Xlonger periods of time is accomplished by using the Rest command,
  250. Xfollowed by the number of turns you want to rest your character.
  251. XResting will continue until the specified duration has expired,
  252. Xor something to wake the character happens, such as a creature
  253. Xwandering by, or getting hungry, or some disability like
  254. Xblindness expiring.
  255. XIt is sometimes a good idea to rest a beat up
  256. Xcharacter until he regains some of his hit points, but be sure to
  257. Xhave plenty of food if you rest often.
  258. X.sp
  259. XIf you have accidentally entered in a rest period too large,
  260. Xor change your mind about the resting period, you may wake your
  261. Xcharacter up by typing any character.  Space is best, since if the
  262. Xrest ends just before the character is typed, the space is ignored
  263. Xas a command.
  264. X.sp
  265. XIt is also possible to rest by typing the count first, and using
  266. Xeither the Rest or the null movement command.
  267. X.sp
  268. XIf you type `*' for the rest count, your character will rest until both
  269. Xhp and mana reach their maximum values.  As above, you will immediately
  270. Xstop resting if anything interesting happens.
  271. X.IP "S  - Search mode toggle. {#}"
  272. XThe Searching toggle will take you into and out of
  273. Xsearch mode.  When first pressed, the message \*QSearching\*U will
  274. Xappear at the bottom of the screen.  You are now taking
  275. Xtwo turns for each command, one for the command and one turn to
  276. Xsearch.  This means that you are taking twice the
  277. Xtime to move about the dungeon, and therefore twice the food.  If
  278. Xa creature should happen by or attack you, search mode will
  279. Xautomatically shut off.  You may also turn off search mode
  280. Xby again pressing the `S' {or #} key.
  281. X.IP "T <Dir> - Tunnel through rock. {control-<Dir>}"
  282. XTunneling (Mining) is a very useful art.  There are four
  283. Xkinds of rock present in the dungeons of \fImoria\fP: Permanent Rock,
  284. XGranite Rock, Magma Intrusion, and Quartz Veins.  Permanent Rock
  285. Xis exactly that, permanent.  Granite is very hard, therefore hard
  286. Xto dig through, and contains no valuable metals.  Magma and
  287. XQuartz veins are softer and sometimes bear valuable metals and
  288. Xgems, shown as a `$' or a `*' character.  You can tell if the
  289. Xmetal or gems are embedded into the wall by trying to move onto
  290. Xthem.  If you can't move over them, you'll have to dig them out.
  291. XThere is an option which causes magma and quartz to be displayed
  292. Xdifferently than other rock types.
  293. X.sp
  294. XTunneling can be VERY difficult by hand, so when you dig be
  295. Xsure to wield either a shovel or a pick.  Magical shovels and
  296. Xpicks can be found which allow the wielder to dig much faster
  297. Xthan normal, and a good strength also helps.
  298. X.sp
  299. XTunneling can have a count.
  300. X.IP "V  - View scoreboard."
  301. XThis command will display the contents of the score board on the
  302. Xscreen.  On a multiuser system, typing `V' again will show only those
  303. Xscores from the score board that are yours.
  304. X.IP "a <Dir> - Aim a wand. {z - zap}"
  305. XWands must be aimed in a direction to be used.  Wands are
  306. Xmagical devices and therefore use the Magical Devices ability of
  307. Xthe player.  They will either affect the first object/creature
  308. Xencountered, or affect anything in a given direction, depending
  309. Xupon the wand.  An obstruction such as door or wall will generally
  310. Xstop the effects of a wand from traveling further.
  311. X.IP "b  - Browse a book. {P - peruse}"
  312. XYou can only read a book if you are of its realm.
  313. XTherefore a magic user could read a magic book, but not a holy
  314. Xbook.  Warriors will not be able to read either kind of book.
  315. XWhen the browse command is used, all of the spells or prayers
  316. Xcontained therein are displayed, along with information such as
  317. Xtheir level, the amount of mana used up in casting them, and whether
  318. Xor not you know the spell or prayer.  There
  319. Xare a total of 31 different magical spells in four books, and 31
  320. Xdifferent prayers in four books.
  321. X.IP "c <Dir> - Close a door."
  322. XNonintelligent and certain other creatures will not be able
  323. Xto open a door.  Therefore shutting doors can be a life saver.
  324. XYou must be adjacent to an open door, and you cannot close broken
  325. Xdoors.  Bashing a door open will break it.
  326. X.IP "d  - Drop an object from your inventory."
  327. XYou can drop an object onto the floor beneath you if
  328. Xthat floor spot does not already contain an object.
  329. XDoors and traps are considered objects in this sense.  If you
  330. Xhave several objects of the same kind, you will be prompted
  331. Xfor dropping one or all of them.  It is possible to directly drop things
  332. Xwhich you are wielding or wearing.
  333. X.IP "e  - Display a list of equipment being used."
  334. XUse the Equipment command to display a list of objects
  335. Xcurrently being used by your character.  Each object
  336. Xhas a specific place where it is placed, and that only one object
  337. Xof each type may be used at any one time, excepting rings of
  338. Xwhich two can be worn, one on each hand.
  339. X.IP "f <Dir> - Fire/Throw an object/use a missile weapon. {t - throw}"
  340. XYou may throw any object carried by your character.
  341. XDepending upon the weight of an object, it may travel across a
  342. Xroom or drop down beside you.  If you throw an object such as an
  343. Xarrow, only one will be used at a time.
  344. X.sp
  345. XIf you throw at a creature, your chance of hitting the
  346. Xcreature is determined by your pluses to hit, your ability at
  347. Xthrowing, and the object's pluses to hit.  Once the creature is
  348. Xhit, the object may or may not do any actual damage to it.
  349. XCertain objects in the dungeon can do great amounts of damage
  350. Xwhen thrown, but it's for you to figure out the obscure ones.
  351. XOil flasks are considered to be lit before thrown, therefore they
  352. Xwill do fire damage to a creature if they hit it.
  353. X.sp
  354. XTo use a bow with arrows, simply wield the bow and throw the
  355. Xarrows.  Extra pluses to damage and hitting are gained by
  356. Xwielding the proper weapon and throwing the corresponding ammo.
  357. XA heavy crossbow with bolts for example, is a killer...
  358. X.IP "i  - Display a list of objects being carried."
  359. XThis command displays a list of all objects being
  360. Xcarried, but not currently in use.  You may carry up to 22
  361. Xdifferent kinds of objects, not including those in your equipment
  362. Xlist.  Depending upon your strength, you will be able carry many
  363. Xidentical objects before hitting your weight limit.
  364. X.IP "j <Dir> - Jam a door with an iron spike. {S - spike}"
  365. XMost humanoid and many intelligent creatures can simply open
  366. Xa closed door, and can eventually get through a locked door.
  367. XTherefore you may spike a door in order to jam it.  Each spike
  368. Xused on a door will increase its strength, although the more
  369. Xspikes you add, the less effect each additional spike has.
  370. XIt is very easy to
  371. Xjam a door so much as to make it impossible for your character to
  372. Xbash it down, so spike doors wisely.  The bigger a
  373. Xcreature is, the easier it can bash a door down.  Therefore twenty
  374. Xor more spikes might be necessary to slow down a dragon, where
  375. Xone spike would slow down a kobold.  This command can be counted.
  376. X.IP "l <Dir> - Look in a direction. {x - examine}"
  377. XThe Look command is useful in identifying the exact type of
  378. Xobject or creature shown on the screen.  Also, if a creature is
  379. Xon top of an object, the look command will describe both.  You
  380. Xcan see creatures and objects up to 200 feet away (20 spaces).
  381. XYou may freely use the Look command without the
  382. Xcreatures getting a move on you.
  383. X.sp
  384. XLooking in a particular direction sees everything within a cone
  385. Xof vision which just overlaps the cones of the two adjacent directions.
  386. XLooking with the null direction `5' (or `.') sees everything which there
  387. Xis to be seen.
  388. X.sp
  389. XYou are also able to access your monster memories with this command.
  390. XIf you see a creature, you are prompted to ask if you wish to see
  391. Xa short paragraph of information about your experiences with that
  392. Xcreature.  See also the section on being attacked.
  393. X.IP "m  - Cast a magic spell."
  394. XTo cast a spell, a character must have previously learned it,
  395. Xand must also have in the inventory a magical book from which the
  396. Xspell may be read.
  397. XEach spell has a chance of failure which starts out fairly large
  398. Xbut decreases as a character gains levels.  If a character does
  399. Xnot have enough mana, the chance of failure is greatly increased,
  400. Xand he gambles on losing a point of constitution.  You will be
  401. Xprompted for confirmation before trying to cast a spell when you
  402. Xdon't have enough mana.  Since a
  403. Xcharacter must read the spell from a book, he cannot be blind or
  404. Xconfused when casting a spell, and there must be some light
  405. Xpresent.
  406. X.IP "o <Dir> - Open a door, chest, or lock."
  407. XTo open an object such as a door or chest you must use the
  408. XOpen command.  If the object is locked, the Open command will
  409. Xattempt to pick the lock, based on your ability at disarming.
  410. XIf an object is trapped and you open it, the trap will
  411. Xbe set off.
  412. XThis command can be counted, you may need several tries to get it
  413. Xopen.
  414. X.IP "p  - Read a prayer."
  415. XTo pay effectively, a character must have learned the prayer,
  416. Xand must also have in the inventory a holy book from which
  417. Xthe prayer may be read.
  418. XEach prayer has a chance of being ignored which starts out fairly large
  419. Xbut decreases as a
  420. Xcharacter gains levels.  If a character does not have enough
  421. Xmana, the chance of failure is greatly increased, and he
  422. Xgambles on losing a point of constitution.  You will be prompted
  423. Xfor confirmation before trying to pray when you don't have enough mana.
  424. XSince a character
  425. Xmust read the prayer from a book, he cannot be blind or confused
  426. Xwhen praying, and there must be some light present.
  427. X.IP "q  - Quaff a potion."
  428. XTo drink a potion use the Quaff command.  A potion affects
  429. Xthe player in some manner.  The effects of the potion may be
  430. Ximmediately noticed, or they may be subtle and unnoticed.
  431. X.IP "r  - Read a scroll."
  432. XTo read a scroll use the Read command.  A scroll spell has
  433. Xan area affect, except in a few cases such as identify scrolls
  434. Xwhich act on other objects.  Two scrolls, the identify
  435. Xscroll and the recharge scroll, have titles which can be read
  436. Xwithout setting them off, and by pressing ESCAPE can be saved
  437. Xfor future use.
  438. X.IP "s  - Search general area one turn."
  439. XThe Search command can be used to locate hidden traps and
  440. Xsecret doors about the player.  More than a single turn
  441. Xof searching will be required in most cases.  You should always
  442. Xsearch a chest before trying to open it because they are
  443. Xgenerally trapped.
  444. XThis command can be counted, which is useful if you are really sure
  445. Xof finding something eventually.  A counted search ends as soon as
  446. Xanything is found.
  447. X.IP "t  - Take off a piece of equipment. {T}"
  448. XUse the Take Off command to remove an object from use, and
  449. Xreturn it to your inventory.  Occasionally you will run into a
  450. Xcursed item which cannot be removed.  Cursed items are always
  451. Xbad, and can only be taken off after removing the curse.
  452. X.IP "u  - Use a staff. {Z - Zap}"
  453. XThe Use command will activate a staff.  Like scrolls, most
  454. Xstaffs have an area affect.  Because staffs are generally more
  455. Xpowerful than most other items, they are also harder to use
  456. Xcorrectly.
  457. X.IP "v  - Display current version of game."
  458. XThe Version command displays the credits for the current
  459. Xversion of \fImoria\fP.
  460. X.IP "w  - Wear or wield an item being carried."
  461. XTo wear or wield an object in your inventory, use the
  462. XWear/Wield command.  If an object is already in use for the same
  463. Xfunction, it is automatically removed first.  An
  464. Xobject's bonuses cannot be gained until it is worn or wielded.
  465. X.IP "x  - Exchange primary and secondary weapons. {X}"
  466. XA secondary weapon is any weapon which may be needed often.
  467. XInstead of searching through your inventory, you may use the
  468. Xexchange command to keep the weapon ready.  For instance, if you
  469. Xwanted to use your bow most of the time, but needed a sword for
  470. Xclose combat, you could wield your sword, use the exchange
  471. Xcommand to make it the secondary weapon, then wield your bow.  If
  472. Xthe sword was suddenly needed, simply use the exchange command to
  473. Xswitch between the bow and the sword.
  474. X.IP "/  - Identify a character shown on screen."
  475. XUse the identify command to find out what a character
  476. Xdisplayed on the screen stands for.  For instance, by
  477. Xpressing `/.', you can find out that the `.' stands for a floor spot.
  478. XWhen used with a creature, the identify command will tell you
  479. Xonly what class of creature the symbol stands for, not the
  480. Xspecific creature, therefore use the look command for this
  481. Xinformation.
  482. X.sp
  483. XIf you identify the character for a creature in your monster memory,
  484. Xyou are also prompted to ask if you wish to see a paragraph of
  485. Xinformation on those creatures identified by the given character.
  486. XSeveral creatures may be identified in this way.
  487. XTyping ESCAPE after the paragraph for any creature will abort back to
  488. Xcommand level.  See also the section on being attacked.
  489. X.IP "?  - Display a list of commands."
  490. XThe ? command displays a quick reference help page
  491. Xon the screen.
  492. X.IP "\-  - Move without pickup."
  493. XThis is followed by a move command, and causes you to move over any
  494. Xobject without picking it up.
  495. XYou can associate a count with this command.
  496. X.IP "=  - Set options."
  497. XThis is a free move, to set various \fImoria\fP options.
  498. XThe available options are:
  499. X.IP " (1)"
  500. XCut known corners when running.  This is on by default, and the only reason
  501. Xfor switching it off would be if you had the search flag on and wished to
  502. Xlook for doors in the extremity of every corner.
  503. X.IP " (2)"
  504. XExamine potential corners when running.  This is on by default, and allows
  505. Xyou to run along an unknown curving corridor.  If, however, you are running
  506. Xfrom a creature, and wish to stop at an unknown corner to make a considered
  507. Xdecision, then you may wish to switch this option off.
  508. X.IP " (3)"
  509. XPrint self during a run.  This is off by default, which gives faster screen
  510. Xupdating.
  511. X.IP " (4)"
  512. XStop when map sector changes.  This is off by default, but can be switched
  513. Xon if you wish to stop running whenever a new part of the dungeon appears
  514. Xin view.
  515. X.IP " (5)"
  516. XTreat open doors as empty space while running.  This is off by default, in
  517. Xwhich case you stop when ever you run up to an open door.
  518. X.IP " (6)"
  519. XPrompt to pick up objects.  This is off by default, in which case stepping
  520. Xover an object automatically causes you to pick it up.  With the option
  521. Xon, you get prompted in all such cases with a description of the object
  522. Xto see if you really want to take it.
  523. X.IP " (7)"
  524. XRogue like command set.  This option controls the command set in use.  It
  525. Xis off by default.
  526. X.IP " (8)"
  527. XShow weights in inventory.  This is off by default: switching it on causes
  528. Xthe inventory and equipment listings to include the weight of all objects.
  529. XThis may be useful to know if your pack is getting too heavy.
  530. X.IP " (9)"
  531. XHighlight mineral seams.  This is off by default.  Switching it on causes
  532. Xquartz and magma to be displayed as `%' instead of `#'.
  533. XThis is handy when mining.
  534. XSetting this option does not immediately highlight all minerals,
  535. Xbut only those which are subsequently displayed.  To display all minerals,
  536. Xjust move the map around a bit with the `Where' (or `Locate') command.
  537. X.IP " (10)"
  538. XBeep for invalid character.  This is on by default.  When on, the program
  539. Xwill beep for most invalid characters, such as trying to choose a spell
  540. Xthat you haven't learned yet.  When off, there are no such beeps.
  541. X.IP " (11)"
  542. XDisplay rest/repeat counts.  This is on by default.  When on, the program
  543. Xwill progessively display the remaining turns left while resting, and
  544. Xfor repeated commands.  For those trying to play over a 2400 bps or less
  545. Xconnection, or for those playing on very slow microcomputers, turning this
  546. Xoff will make resting and repeated commands work much faster.
  547. X.IP
  548. XThe setting of all these options persist in your savefile, even after you
  549. Xdie.
  550. X.IP "^P  - Previous message."
  551. XThe Control-P command will
  552. Xredisplay the last message printed on the message line at the
  553. Xtop of your screen.
  554. XA second such command will display all of the saved messages.
  555. XYou may also give this command a count to specify the number
  556. Xof previous messages to display.  At present, only 22 messages are saved.
  557. X.IP "^K  - Quit the game without saving. {Q}"
  558. XTo exit the game without saving your character (i.e. kill him/her)
  559. Xuse the
  560. XControl-K command.  Once exited in this manner, your character
  561. Xis nonrecoverable.
  562. X.IP "^X  - Save your character and exit the game."
  563. XTo save your game so that it can be restarted later, use the
  564. XControl-X command.  Save files will also be generated if the game
  565. Xcrashes due to a system error.  When you die, a reduced save file
  566. Xis produced containing only your monster memory, and your option
  567. Xsettings.
  568. X.IP "{  - Inscribe an object."
  569. XThis command can be used to inscribe any short string on an object.
  570. XInscriptions are limited to twelve characters.
  571. XThe inscription applies only to the particular object, it is not
  572. Xautomatically transferred to all similar objects.
  573. XUnder certain circumstances, \fImoria\fP will itself inscribe objects: if they
  574. Xhave been discovered to be cursed or enchanted, or if they have been
  575. Xsampled without being identified.
  576. XIn this last case, \fImoria\fP does in fact carefully inscribe every such
  577. Xitem.
  578. X.IP "!  - Shell out of game."
  579. XUse the Shell command `!' to temporarily exit the game to
  580. Xexecute UNIX or MSDOS commands.  You may reenter the game by typing exit
  581. Xto end the spawned process.  This is not implemented in the
  582. XMacintosh version.
  583. X.IP "<  - Go up an up staircase."
  584. XIf you move onto an up staircase you may use the `<' command
  585. Xto go up one level.  There is always one staircase going up on
  586. Xevery level except for the town level (this does not mean it's
  587. Xeasy to find).  Going up a staircase will always take you to a
  588. Xnew dungeon area except for the town level, which remains the
  589. Xsame for the duration of your character.
  590. X.IP ">  - Go down a down staircase."
  591. XIf you are on top of a down staircase you may use the `>'
  592. Xcommand to go down one level.  There are always two or three
  593. Xstaircases going down on each level, except the town level which
  594. Xhas only one.  Going down will always take you to a new dungeon
  595. Xarea.
  596. X.IP ". <Dir> - Move in direction. {shift<Dir>}"
  597. XThe Run command will move you in the indicated
  598. Xdirection until either you have to make a choice as between two
  599. Xdirections, or something interesting happens.  There are options
  600. Xwhich determine behaviour at corners, and at screen boundaries.
  601. XMore precisely, the conditions which stop a run are as follows:
  602. X.IP (1)
  603. XA creature appears on the screen, one already on the screen moves,
  604. Xor a creature attacks you or casts a spell at you.
  605. X.IP (2)
  606. XYou move next to an object, or a feature such as a door or trap.
  607. X.IP (3)
  608. XYou come to the end of open space, or the end of a passage, or
  609. Xa junction of passages, or a hole in a wall.
  610. X.IP (4)
  611. XCorners are more complex.  A corner allows a choice between adjacent
  612. Xrectangular and diagonal directions.  If you can see walls which ensure
  613. Xthat the diagonal gives a faster traversal, then action is determined
  614. Xby the \*Qcut corners\*U options.
  615. XIf it is set, then you move diagonally through the corner.  This gives
  616. Xyou maximum speed (as is nice if you are fleeing a hidden creature).
  617. XOn the other hand, this option should not be set if you want
  618. Xmore careful coverage (as when you are searching) so that you
  619. Xtake two moves through the corner.
  620. X.IP (5)
  621. XAt a potential corner, where walls are not yet visible ahead of the
  622. Xrectangular direction, the \*Qexamine corners\*U option is considered.
  623. XIf set, you will move straight into the corner, which will light up
  624. Xall the corner and so determine where you can go from there.  This
  625. Xallows you to follow corners in new passages.  If the option is not set,
  626. Xyou stop.  This allows highly cautious running where you want to stop
  627. Xat all potential choice points.
  628. X.IP (6)
  629. XIf you move off the screen while running, then a new section of the dungeon
  630. Xis display and the run continues.  However, if the \*Qstop when
  631. Xmap changes\*U option
  632. Xis set, you will stop.  Again, this is an option for nervous players, after
  633. Xall, there may be a dragon on the new screen.
  634. X.IP (7)
  635. XAnything typed during a run causes the run to stop.  The character
  636. Xcausing this to occur is ignored.  It is best to use a space,
  637. Xwhich is ignored as a command, just in case the run stops just before
  638. Xyou type the character.
  639. X.IP (8)
  640. XVarious changes of state, such as recovery from fear or loss of heroism,
  641. Xwill stop a run.
  642. END_OF_FILE
  643. if test 29377 -ne `wc -c <'doc/moria1.ms.2'`; then
  644.     echo shar: \"'doc/moria1.ms.2'\" unpacked with wrong size!
  645. fi
  646. # end of 'doc/moria1.ms.2'
  647. fi
  648. if test -f 'source/desc.c' -a "${1}" != "-c" ; then 
  649.   echo shar: Will not clobber existing file \"'source/desc.c'\"
  650. else
  651. echo shar: Extracting \"'source/desc.c'\" \(17810 characters\)
  652. sed "s/^X//" >'source/desc.c' <<'END_OF_FILE'
  653. X/* source/desc.c: handle object descriptions, mostly string handling code
  654. X
  655. X   Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke
  656. X
  657. X   This software may be copied and distributed for educational, research, and
  658. X   not for profit purposes provided that this copyright and statement are
  659. X   included in all such copies. */
  660. X
  661. X#ifdef __TURBOC__
  662. X#include    <stdio.h>
  663. X#include    <stdlib.h>
  664. X#endif /* __TURBOC__ */
  665. X#include "config.h"
  666. X#include "constant.h"
  667. X#include "types.h"
  668. X#include "externs.h"
  669. X
  670. X#ifdef USG
  671. X#ifndef ATARIST_MWC
  672. X#include <string.h>
  673. X#endif
  674. X#else
  675. X#include <strings.h>
  676. X#endif
  677. X
  678. X#if defined(LINT_ARGS)
  679. Xstatic void unsample(struct inven_type *);
  680. X#else
  681. Xstatic void unsample();
  682. X#endif
  683. X
  684. X#ifdef ATARIST_TC
  685. X/* Include this to get prototypes for standard library functions.  */
  686. X#include <stdlib.h>
  687. X#endif
  688. X
  689. Xchar titles[MAX_TITLES][10];
  690. X
  691. X/* Object descriptor routines                    */
  692. X
  693. Xint is_a_vowel(ch)
  694. Xchar ch;
  695. X{
  696. X  switch(ch)
  697. X    {
  698. X    case 'a': case 'e': case 'i': case 'o': case 'u':
  699. X    case 'A': case 'E': case 'I': case 'O': case 'U':
  700. X      return(TRUE);
  701. X    default:
  702. X      return(FALSE);
  703. X    }
  704. X}
  705. X
  706. X/* Initialize all Potions, wands, staves, scrolls, etc.    */
  707. Xvoid magic_init()
  708. X{
  709. X  register int h, i, j, k;
  710. X  register char *tmp;
  711. X  vtype string;
  712. X
  713. X  set_seed(randes_seed);
  714. X
  715. X  /* The first 3 entries for colors are fixed, (slime & apple juice, water) */
  716. X  for (i = 3; i < MAX_COLORS; i++)
  717. X    {
  718. X      j = randint(MAX_COLORS - 3) + 2;
  719. X      tmp = colors[i];
  720. X      colors[i] = colors[j];
  721. X      colors[j] = tmp;
  722. X    }
  723. X  for (i = 0; i < MAX_WOODS; i++)
  724. X    {
  725. X      j = randint(MAX_WOODS) - 1;
  726. X      tmp = woods[i];
  727. X      woods[i] = woods[j];
  728. X      woods[j] = tmp;
  729. X    }
  730. X  for (i = 0; i < MAX_METALS; i++)
  731. X    {
  732. X      j = randint(MAX_METALS) - 1;
  733. X      tmp = metals[i];
  734. X      metals[i] = metals[j];
  735. X      metals[j] = tmp;
  736. X    }
  737. X  for (i = 0; i < MAX_ROCKS; i++)
  738. X    {
  739. X      j = randint(MAX_ROCKS) - 1;
  740. X      tmp = rocks[i];
  741. X      rocks[i] = rocks[j];
  742. X      rocks[j] = tmp;
  743. X    }
  744. X  for (i = 0; i < MAX_AMULETS; i++)
  745. X    {
  746. X      j = randint(MAX_AMULETS) - 1;
  747. X      tmp = amulets[i];
  748. X      amulets[i] = amulets[j];
  749. X      amulets[j] = tmp;
  750. X    }
  751. X  for (i = 0; i < MAX_MUSH; i++)
  752. X    {
  753. X      j = randint(MAX_MUSH) - 1;
  754. X      tmp = mushrooms[i];
  755. X      mushrooms[i] = mushrooms[j];
  756. X      mushrooms[j] = tmp;
  757. X    }
  758. X  for (h = 0; h < MAX_TITLES; h++)
  759. X    {
  760. X      string[0] = '\0';
  761. X      k = randint(2) + 1;
  762. X      for (i = 0; i < k; i++)
  763. X    {
  764. X      for (j = randint(2); j > 0; j--)
  765. X        (void) strcat(string, syllables[randint(MAX_SYLLABLES) - 1]);
  766. X      if (i < k-1)
  767. X        (void) strcat(string, " ");
  768. X    }
  769. X      if (string[8] == ' ')
  770. X    string[8] = '\0';
  771. X      else
  772. X    string[9] = '\0';
  773. X      (void) strcpy(titles[h], string);
  774. X    }
  775. X  reset_seed();
  776. X}
  777. X
  778. Xint16 object_offset(t_ptr)
  779. Xinven_type *t_ptr;
  780. X{
  781. X  switch (t_ptr->tval)
  782. X    {
  783. X    case TV_AMULET:    return(0);
  784. X    case TV_RING:    return(1);
  785. X    case TV_STAFF:    return(2);
  786. X    case TV_WAND:    return(3);
  787. X    case TV_SCROLL1:
  788. X    case TV_SCROLL2:    return(4);
  789. X    case TV_POTION1:
  790. X    case TV_POTION2:    return(5);
  791. X    case TV_FOOD:
  792. X      if ((t_ptr->subval & (ITEM_SINGLE_STACK_MIN - 1)) < MAX_MUSH)
  793. X    return(6);
  794. X      return(-1);
  795. X    default:  return(-1);
  796. X    }
  797. X}
  798. X
  799. X/* Remove "Secret" symbol for identity of object            */
  800. Xvoid known1(i_ptr)
  801. Xinven_type *i_ptr;
  802. X{
  803. X  int16 offset;
  804. X  int8u indexx;
  805. X
  806. X  if ((offset = object_offset(i_ptr)) < 0)
  807. X    return;
  808. X  offset <<= 6;
  809. X  indexx = i_ptr->subval & (ITEM_SINGLE_STACK_MIN - 1);
  810. X  object_ident[offset + indexx] |= OD_KNOWN1;
  811. X  /* clear the tried flag, since it is now known */
  812. X  object_ident[offset + indexx] &= ~OD_TRIED;
  813. X}
  814. X
  815. Xint known1_p(i_ptr)
  816. Xinven_type *i_ptr;
  817. X{
  818. X  int16 offset;
  819. X  int8u indexx;
  820. X
  821. X  /* Items which don't have a 'color' are always known1, so that they can
  822. X     be carried in order in the inventory.  */
  823. X  if ((offset = object_offset(i_ptr)) < 0)
  824. X    return OD_KNOWN1;
  825. X  if (store_bought_p(i_ptr))
  826. X    return OD_KNOWN1;
  827. X  offset <<= 6;
  828. X  indexx = i_ptr->subval & (ITEM_SINGLE_STACK_MIN - 1);
  829. X  return(object_ident[offset + indexx] & OD_KNOWN1);
  830. X}
  831. X
  832. X/* Remove "Secret" symbol for identity of plusses            */
  833. Xvoid known2(i_ptr)
  834. Xinven_type *i_ptr;
  835. X{
  836. X  unsample(i_ptr);
  837. X  i_ptr->ident |= ID_KNOWN2;
  838. X}
  839. X
  840. Xint known2_p(i_ptr)
  841. Xinven_type *i_ptr;
  842. X{
  843. X  return (i_ptr->ident & ID_KNOWN2);
  844. X}
  845. X
  846. Xvoid clear_known2(i_ptr)
  847. Xinven_type *i_ptr;
  848. X{
  849. X  i_ptr->ident &= ~ID_KNOWN2;
  850. X}
  851. X
  852. Xvoid clear_empty(i_ptr)
  853. Xinven_type *i_ptr;
  854. X{
  855. X  i_ptr->ident &= ~ID_EMPTY;
  856. X}
  857. X
  858. Xvoid store_bought(i_ptr)
  859. Xinven_type *i_ptr;
  860. X{
  861. X  i_ptr->ident |= ID_STOREBOUGHT;
  862. X  known2(i_ptr);
  863. X}
  864. X
  865. Xint store_bought_p(i_ptr)
  866. Xinven_type *i_ptr;
  867. X{
  868. X  return (i_ptr->ident & ID_STOREBOUGHT);
  869. X}
  870. X
  871. X/*    Remove an automatically generated inscription.    -CJS- */
  872. Xstatic void unsample(i_ptr)
  873. Xinven_type *i_ptr;
  874. X{
  875. X  int16 offset;
  876. X  int8u indexx;
  877. X
  878. X  /* used to clear ID_DAMD flag, but I think it should remain set */
  879. X  i_ptr->ident &= ~(ID_MAGIK|ID_EMPTY);
  880. X  if ((offset = object_offset(i_ptr)) < 0)
  881. X    return;
  882. X  offset <<= 6;
  883. X  indexx = i_ptr->subval & (ITEM_SINGLE_STACK_MIN - 1);
  884. X  object_ident[offset + indexx] &= ~OD_TRIED;
  885. X}
  886. X
  887. X/* unquote() is no longer needed */
  888. X
  889. X/* Somethings been sampled -CJS- */
  890. Xvoid sample (i_ptr)
  891. Xinven_type *i_ptr;
  892. X{
  893. X  int16 offset;
  894. X  int8u indexx;
  895. X
  896. X  if ((offset = object_offset(i_ptr)) < 0)
  897. X    return;
  898. X  offset <<= 6;
  899. X  indexx = i_ptr->subval & (ITEM_SINGLE_STACK_MIN - 1);
  900. X  object_ident[offset + indexx] |= OD_TRIED;
  901. X}
  902. X
  903. X/* Somethings been identified                    */
  904. X/* extra complexity by CJS so that it can merge store/dungeon objects
  905. X   when appropriate */
  906. Xvoid identify(item)
  907. Xint *item;
  908. X{
  909. X  register int i, x1, x2;
  910. X  int j;
  911. X  register inven_type *i_ptr, *t_ptr;
  912. X#ifdef ATARIST_MWC
  913. X  int32u holder;
  914. X#endif
  915. X
  916. X  i_ptr = &inventory[*item];
  917. X
  918. X#ifdef ATARIST_MWC
  919. X  if (i_ptr->flags & (holder = TR_CURSED))
  920. X#else
  921. X  if (i_ptr->flags & TR_CURSED)
  922. X#endif
  923. X    add_inscribe(i_ptr, ID_DAMD);
  924. X
  925. X  if (!known1_p(i_ptr))
  926. X    {
  927. X      known1(i_ptr);
  928. X      x1 = i_ptr->tval;
  929. X      x2 = i_ptr->subval;
  930. X      if (x2 < ITEM_SINGLE_STACK_MIN || x2 >= ITEM_GROUP_MIN)
  931. X    /* no merging possible */
  932. X    ;
  933. X      else
  934. X    for (i = 0; i < inven_ctr; i++)
  935. X      {
  936. X        t_ptr = &inventory[i];
  937. X        if (t_ptr->tval == x1 && t_ptr->subval == x2 && i != *item
  938. X        && ((int)t_ptr->number + (int)i_ptr->number < 256))
  939. X          {
  940. X        /* make *item the smaller number */
  941. X        if (*item > i)
  942. X          {
  943. X            j = *item; *item = i; i = j;
  944. X          }
  945. X      msg_print ("You combine similar objects from the shop and dungeon.");
  946. X
  947. X        inventory[*item].number += inventory[i].number;
  948. X        inven_ctr--;
  949. X        for (j = i; j < inven_ctr; j++)
  950. X          inventory[j] = inventory[j+1];
  951. X        invcopy(&inventory[j], OBJ_NOTHING);
  952. X          }
  953. X      }
  954. X    }
  955. X}
  956. X
  957. X/* If an object has lost magical properties,
  958. X * remove the appropriate portion of the name.           -CJS-
  959. X */
  960. Xvoid unmagic_name(i_ptr)
  961. Xinven_type *i_ptr;
  962. X{
  963. X  i_ptr->name2 = SN_NULL;
  964. X}
  965. X
  966. X/* defines for p1_use, determine how the p1 field is printed */
  967. X#define IGNORED  0
  968. X#define CHARGES  1
  969. X#define PLUSSES  2
  970. X#define LIGHT    3
  971. X#define FLAGS    4
  972. X#define Z_PLUSSES 5
  973. X
  974. X/* Returns a description of item for inventory            */
  975. X/* pref indicates that there should be an article added (prefix) */
  976. X/* note that since out_val can easily exceed 80 characters, objdes must
  977. X   always be called with a bigvtype as the first paramter */
  978. Xvoid objdes(out_val, i_ptr, pref)
  979. Xchar *out_val;
  980. Xregister inven_type *i_ptr;
  981. Xint pref;
  982. X{
  983. X  /* base name, modifier string*/
  984. X  register char *basenm, *modstr;
  985. X  bigvtype tmp_val;
  986. X  vtype tmp_str, damstr;
  987. X  int indexx, p1_use, modify, append_name, tmp;
  988. X
  989. X  indexx = i_ptr->subval & (ITEM_SINGLE_STACK_MIN - 1);
  990. X  basenm = object_list[i_ptr->index].name;
  991. X  modstr = CNIL;
  992. X  damstr[0] = '\0';
  993. X  p1_use = IGNORED;
  994. X  modify = (known1_p(i_ptr) ? FALSE : TRUE);
  995. X  append_name = FALSE;
  996. X  switch(i_ptr->tval)
  997. X    {
  998. X    case  TV_MISC:
  999. X    case  TV_CHEST:
  1000. X      break;
  1001. X    case  TV_SLING_AMMO:
  1002. X    case  TV_BOLT:
  1003. X    case  TV_ARROW:
  1004. X      (void) sprintf(damstr, " (%dd%d)", i_ptr->damage[0], i_ptr->damage[1]);
  1005. X      break;
  1006. X    case  TV_LIGHT:
  1007. X      p1_use = LIGHT;
  1008. X      break;
  1009. X    case  TV_SPIKE:
  1010. X      break;
  1011. X    case  TV_BOW:
  1012. X      if (i_ptr->p1 == 1 || i_ptr->p1 == 2)
  1013. X    tmp = 2;
  1014. X      else if (i_ptr->p1 == 3 || i_ptr->p1 == 5)
  1015. X    tmp = 3;
  1016. X      else if (i_ptr->p1 == 4 || i_ptr->p1 == 6)
  1017. X    tmp = 4;
  1018. X      else
  1019. X    tmp = -1;
  1020. X      (void) sprintf (damstr, " (x%d)", tmp);
  1021. X      break;
  1022. X    case  TV_HAFTED:
  1023. X    case  TV_POLEARM:
  1024. X    case  TV_SWORD:
  1025. X      (void) sprintf(damstr, " (%dd%d)", i_ptr->damage[0], i_ptr->damage[1]);
  1026. X      p1_use = FLAGS;
  1027. X      break;
  1028. X    case  TV_DIGGING:
  1029. X      p1_use = Z_PLUSSES;
  1030. X      (void) sprintf(damstr, " (%dd%d)", i_ptr->damage[0], i_ptr->damage[1]);
  1031. X      break;
  1032. X    case  TV_BOOTS:
  1033. X    case  TV_GLOVES:
  1034. X    case  TV_CLOAK:
  1035. X    case  TV_HELM:
  1036. X    case  TV_SHIELD:
  1037. X    case  TV_HARD_ARMOR:
  1038. X    case  TV_SOFT_ARMOR:
  1039. X      break;
  1040. X    case  TV_AMULET:
  1041. X      if (modify)
  1042. X    {
  1043. X      basenm = "& %s Amulet";
  1044. X      modstr = amulets[indexx];
  1045. X    }
  1046. X      else
  1047. X    {
  1048. X      basenm = "& Amulet";
  1049. X      append_name = TRUE;
  1050. X    }
  1051. X      p1_use = PLUSSES;
  1052. X      break;
  1053. X    case  TV_RING:
  1054. X      if (modify)
  1055. X    {
  1056. X      basenm = "& %s Ring";
  1057. X      modstr = rocks[indexx];
  1058. X    }
  1059. X      else
  1060. X    {
  1061. X      basenm = "& Ring";
  1062. X      append_name = TRUE;
  1063. X    }
  1064. X      p1_use = PLUSSES;
  1065. X      break;
  1066. X    case  TV_STAFF:
  1067. X      if (modify)
  1068. X    {
  1069. X      basenm = "& %s Staff";
  1070. X      modstr = woods[indexx];
  1071. X    }
  1072. X      else
  1073. X    {
  1074. X      basenm = "& Staff";
  1075. X      append_name = TRUE;
  1076. X    }
  1077. X      p1_use = CHARGES;
  1078. X      break;
  1079. X    case  TV_WAND:
  1080. X      if (modify)
  1081. X    {
  1082. X      basenm = "& %s Wand";
  1083. X      modstr = metals[indexx];
  1084. X    }
  1085. X      else
  1086. X    {
  1087. X      basenm = "& Wand";
  1088. X      append_name = TRUE;
  1089. X    }
  1090. X      p1_use = CHARGES;
  1091. X      break;
  1092. X    case  TV_SCROLL1:
  1093. X    case  TV_SCROLL2:
  1094. X      if (modify)
  1095. X    {
  1096. X      basenm =  "& Scroll~ titled \"%s\"";
  1097. X      modstr = titles[indexx];
  1098. X    }
  1099. X      else
  1100. X    {
  1101. X      basenm = "& Scroll~";
  1102. X      append_name = TRUE;
  1103. X    }
  1104. X      break;
  1105. X    case  TV_POTION1:
  1106. X    case  TV_POTION2:
  1107. X      if (modify)
  1108. X    {
  1109. X      basenm = "& %s Potion~";
  1110. X      modstr = colors[indexx];
  1111. X    }
  1112. X      else
  1113. X    {
  1114. X      basenm = "& Potion~";
  1115. X      append_name = TRUE;
  1116. X    }
  1117. X      break;
  1118. X    case  TV_FLASK:
  1119. X      break;
  1120. X    case  TV_FOOD:
  1121. X      if (modify)
  1122. X    {
  1123. X      if (indexx <= 15)
  1124. X        basenm = "& %s Mushroom~";
  1125. X      else if (indexx <= 20)
  1126. X        basenm = "& Hairy %s Mold~";
  1127. X      if (indexx <= 20)
  1128. X        modstr = mushrooms[indexx];
  1129. X    }
  1130. X      else
  1131. X    {
  1132. X      append_name = TRUE;
  1133. X      if (indexx <= 15)
  1134. X        basenm = "& Mushroom~";
  1135. X      else if (indexx <= 20)
  1136. X        basenm = "& Hairy Mold~";
  1137. X      else
  1138. X        /* Ordinary food does not have a name appended.  */
  1139. X        append_name = FALSE;
  1140. X    }
  1141. X      break;
  1142. X    case  TV_MAGIC_BOOK:
  1143. X      modstr = basenm;
  1144. X      basenm = "& Book~ of Magic Spells %s";
  1145. X      break;
  1146. X    case  TV_PRAYER_BOOK:
  1147. X      modstr = basenm;
  1148. X      basenm = "& Holy Book~ of Prayers %s";
  1149. X      break;
  1150. X    case TV_OPEN_DOOR:
  1151. X    case TV_CLOSED_DOOR:
  1152. X    case TV_SECRET_DOOR:
  1153. X    case TV_RUBBLE:
  1154. X      break;
  1155. X    case TV_GOLD:
  1156. X    case TV_INVIS_TRAP:
  1157. X    case TV_VIS_TRAP:
  1158. X    case TV_UP_STAIR:
  1159. X    case TV_DOWN_STAIR:
  1160. X      (void) strcpy(out_val, object_list[i_ptr->index].name);
  1161. X      (void) strcat(out_val, ".");
  1162. X      return;
  1163. X    case TV_STORE_DOOR:
  1164. X      (void) sprintf(out_val, "the entrance to the %s.",
  1165. X             object_list[i_ptr->index].name);
  1166. X      return;
  1167. X    default:
  1168. X      (void) strcpy(out_val, "Error in objdes()");
  1169. X      return;
  1170. X    }
  1171. X  if (modstr != CNIL)
  1172. X    (void) sprintf(tmp_val, basenm, modstr);
  1173. X  else
  1174. X    (void) strcpy(tmp_val, basenm);
  1175. X  if (append_name)
  1176. X    {
  1177. X      (void) strcat(tmp_val, " of ");
  1178. X      (void) strcat(tmp_val, object_list[i_ptr->index].name);
  1179. X    }
  1180. X  if (i_ptr->number != 1)
  1181. X    {
  1182. X      insert_str(tmp_val, "ch~", "ches");
  1183. X      insert_str(tmp_val, "~", "s");
  1184. X    }
  1185. X  else
  1186. X    insert_str(tmp_val, "~", CNIL);
  1187. X  if (!pref)
  1188. X    {
  1189. X      if (!strncmp("some", tmp_val, 4))
  1190. X    (void) strcpy(out_val, &tmp_val[5]);
  1191. X      else if (tmp_val[0] == '&')
  1192. X    /* eliminate the '& ' at the beginning */
  1193. X    (void) strcpy(out_val, &tmp_val[2]);
  1194. X      else
  1195. X    (void) strcpy(out_val, tmp_val);
  1196. X    }
  1197. X  else
  1198. X    {
  1199. X      if (i_ptr->name2 != SN_NULL && known2_p(i_ptr))
  1200. X    {
  1201. X      (void) strcat(tmp_val, " ");
  1202. X      (void) strcat(tmp_val, special_names[i_ptr->name2]);
  1203. X    }
  1204. X      if (damstr[0] != '\0')
  1205. X    (void) strcat(tmp_val, damstr);
  1206. X      if (known2_p(i_ptr))
  1207. X    {
  1208. X      /* originally used %+d, but several machines don't support it */
  1209. X      if (i_ptr->ident & ID_SHOW_HITDAM)
  1210. X        (void) sprintf(tmp_str, " (%c%d,%c%d)",
  1211. X               (i_ptr->tohit < 0) ? '-' : '+', abs(i_ptr->tohit),
  1212. X               (i_ptr->todam < 0) ? '-' : '+', abs(i_ptr->todam));
  1213. X      else if (i_ptr->tohit != 0)
  1214. X        (void) sprintf(tmp_str, " (%c%d)",
  1215. X               (i_ptr->tohit < 0) ? '-' : '+', abs(i_ptr->tohit));
  1216. X      else if (i_ptr->todam != 0)
  1217. X        (void) sprintf(tmp_str, " (%c%d)",
  1218. X               (i_ptr->todam < 0) ? '-' : '+', abs(i_ptr->todam));
  1219. X      else
  1220. X        tmp_str[0] = '\0';
  1221. X      (void) strcat(tmp_val, tmp_str);
  1222. X    }
  1223. X      /* Crowns have a zero base AC, so make a special test for them. */
  1224. X      if (i_ptr->ac != 0 || (i_ptr->tval == TV_HELM))
  1225. X    {
  1226. X      (void) sprintf(tmp_str, " [%d", i_ptr->ac);
  1227. X      (void) strcat(tmp_val, tmp_str);
  1228. X      if (known2_p(i_ptr))
  1229. X        {
  1230. X          /* originally used %+d, but several machines don't support it */
  1231. X          (void) sprintf(tmp_str, ",%c%d",
  1232. X                 (i_ptr->toac < 0) ? '-' : '+', abs(i_ptr->toac));
  1233. X          (void) strcat(tmp_val, tmp_str);
  1234. X        }
  1235. X      (void) strcat(tmp_val, "]");
  1236. X    }
  1237. X      else if ((i_ptr->toac != 0) && known2_p(i_ptr))
  1238. X    {
  1239. X      /* originally used %+d, but several machines don't support it */
  1240. X      (void) sprintf(tmp_str, " [%c%d]",
  1241. X             (i_ptr->toac < 0) ? '-' : '+', abs(i_ptr->toac));
  1242. X      (void) strcat(tmp_val, tmp_str);
  1243. X    }
  1244. X
  1245. X      /* override defaults, check for p1 flags in the ident field */
  1246. X      if (i_ptr->ident & ID_NOSHOW_P1)
  1247. X    p1_use = IGNORED;
  1248. X      else if (i_ptr->ident & ID_SHOW_P1)
  1249. X    p1_use = Z_PLUSSES;
  1250. X      tmp_str[0] = '\0';
  1251. X      if (p1_use == LIGHT)
  1252. X    (void) sprintf(tmp_str, " with %d turns of light", i_ptr->p1);
  1253. X      else if (p1_use == IGNORED)
  1254. X    ;
  1255. X      else if (known2_p(i_ptr))
  1256. X    {
  1257. X      if (p1_use == Z_PLUSSES)
  1258. X      /* originally used %+d, but several machines don't support it */
  1259. X        (void) sprintf(tmp_str, " (%c%d)",
  1260. X               (i_ptr->p1 < 0) ? '-' : '+', abs(i_ptr->p1));
  1261. X      else if (p1_use == CHARGES)
  1262. X        (void) sprintf(tmp_str, " (%d charges)", i_ptr->p1);
  1263. X      else if (i_ptr->p1 != 0)
  1264. X        {
  1265. X          if (p1_use == PLUSSES)
  1266. X            (void) sprintf(tmp_str, " (%c%d)",
  1267. X                   (i_ptr->p1 < 0) ? '-' : '+', abs(i_ptr->p1));
  1268. X          else if (p1_use == FLAGS)
  1269. X        {
  1270. X          if (i_ptr->flags & TR_STR)
  1271. X            (void) sprintf(tmp_str, " (%c%d to STR)",
  1272. X                   (i_ptr->p1 < 0) ? '-' : '+',abs(i_ptr->p1));
  1273. X          else if (i_ptr->flags & TR_STEALTH)
  1274. X            (void) sprintf(tmp_str, " (%c%d to stealth)",
  1275. X                   (i_ptr->p1 < 0) ? '-' : '+',abs(i_ptr->p1));
  1276. X        }
  1277. X        }
  1278. X    }
  1279. X      (void) strcat(tmp_val, tmp_str);
  1280. X
  1281. X      /* ampersand is always the first character */
  1282. X      if (tmp_val[0] == '&')
  1283. X    {
  1284. X      /* use &tmp_val[1], so that & does not appear in output */
  1285. X      if (i_ptr->number > 1)
  1286. X        (void) sprintf(out_val, "%d%s", (int)i_ptr->number, &tmp_val[1]);
  1287. X      else if (i_ptr->number < 1)
  1288. X        (void) sprintf(out_val, "%s%s", "no more", &tmp_val[1]);
  1289. X      else if (is_a_vowel(tmp_val[2]))
  1290. X        (void) sprintf(out_val, "an%s", &tmp_val[1]);
  1291. X      else
  1292. X        (void) sprintf(out_val, "a%s", &tmp_val[1]);
  1293. X    }
  1294. X      /* handle 'no more' case specially */
  1295. X      else if (i_ptr->number < 1)
  1296. X    {
  1297. X      /* check for "some" at start */
  1298. X      if (!strncmp("some", tmp_val, 4))
  1299. X        (void) sprintf(out_val, "no more %s", &tmp_val[5]);
  1300. X      /* here if no article */
  1301. X      else
  1302. X        (void) sprintf(out_val, "no more %s", tmp_val);
  1303. X    }
  1304. X      else
  1305. X    (void) strcpy(out_val, tmp_val);
  1306. X
  1307. X      tmp_str[0] = '\0';
  1308. X      if ((indexx = object_offset(i_ptr)) >= 0)
  1309. X    {
  1310. X      indexx = (indexx <<= 6) +
  1311. X        (i_ptr->subval & (ITEM_SINGLE_STACK_MIN - 1));
  1312. X      /* don't print tried string for store bought items */
  1313. X      if ((object_ident[indexx] & OD_TRIED) && !store_bought_p(i_ptr))
  1314. X        (void) strcat(tmp_str, "tried ");
  1315. X    }
  1316. X      if (i_ptr->ident & (ID_MAGIK|ID_EMPTY|ID_DAMD))
  1317. X    {
  1318. X      if (i_ptr->ident & ID_MAGIK)
  1319. X        (void) strcat(tmp_str, "magik ");
  1320. X      if (i_ptr->ident & ID_EMPTY)
  1321. X        (void) strcat(tmp_str, "empty ");
  1322. X      if (i_ptr->ident & ID_DAMD)
  1323. X        (void) strcat(tmp_str, "damned ");
  1324. X    }
  1325. X      if (i_ptr->inscrip[0] != '\0')
  1326. X    (void) strcat(tmp_str, i_ptr->inscrip);
  1327. X      else if ((indexx = strlen(tmp_str)) > 0)
  1328. X      /* remove the extra blank at the end */
  1329. X      tmp_str[indexx-1] = '\0';
  1330. X      if (tmp_str[0])
  1331. X    {
  1332. X      (void) sprintf(tmp_val, " {%s}", tmp_str);
  1333. X      (void) strcat(out_val, tmp_val);
  1334. X    }
  1335. X      (void) strcat(out_val, ".");
  1336. X    }
  1337. X}
  1338. X
  1339. Xvoid invcopy(to, from_index)
  1340. Xregister inven_type *to;
  1341. Xint from_index;
  1342. X{
  1343. X  register treasure_type *from;
  1344. X
  1345. X  from = &object_list[from_index];
  1346. X  to->index    = from_index;
  1347. X  to->name2     = SN_NULL;
  1348. X  to->inscrip[0] = '\0';
  1349. X  to->flags     = from->flags;
  1350. X  to->tval      = from->tval;
  1351. X  to->tchar     = from->tchar;
  1352. X  to->p1        = from->p1;
  1353. X  to->cost    = from->cost;
  1354. X  to->subval    = from->subval;
  1355. X  to->number    = from->number;
  1356. X  to->weight    = from->weight;
  1357. X  to->tohit     = from->tohit;
  1358. X  to->todam     = from->todam;
  1359. X  to->ac        = from->ac;
  1360. X  to->toac      = from->toac;
  1361. X  to->damage[0] = from->damage[0];
  1362. X  to->damage[1] = from->damage[1];
  1363. X  to->level     = from->level;
  1364. X  to->ident    = 0;
  1365. X}
  1366. X
  1367. X
  1368. X/* Describe number of remaining charges.        -RAK-    */
  1369. Xvoid desc_charges(item_val)
  1370. Xint item_val;
  1371. X{
  1372. X  register int rem_num;
  1373. X  vtype out_val;
  1374. X
  1375. X  if (known2_p(&inventory[item_val]))
  1376. X    {
  1377. X      rem_num = inventory[item_val].p1;
  1378. X      (void) sprintf(out_val, "You have %d charges remaining.", rem_num);
  1379. X      msg_print(out_val);
  1380. X    }
  1381. X}
  1382. X
  1383. X
  1384. X/* Describe amount of item remaining.            -RAK-    */
  1385. Xvoid desc_remain(item_val)
  1386. Xint item_val;
  1387. X{
  1388. X  bigvtype out_val, tmp_str;
  1389. X  register inven_type *i_ptr;
  1390. X
  1391. X  i_ptr = &inventory[item_val];
  1392. X  i_ptr->number--;
  1393. X  objdes(tmp_str, i_ptr, TRUE);
  1394. X  i_ptr->number++;
  1395. X  /* the string already has a dot at the end. */
  1396. X  (void) sprintf(out_val, "You have %s", tmp_str);
  1397. X  msg_print(out_val);
  1398. X}
  1399. END_OF_FILE
  1400. if test 17810 -ne `wc -c <'source/desc.c'`; then
  1401.     echo shar: \"'source/desc.c'\" unpacked with wrong size!
  1402. fi
  1403. # end of 'source/desc.c'
  1404. fi
  1405. if test -f 'util/scores/delete.c' -a "${1}" != "-c" ; then 
  1406.   echo shar: Will not clobber existing file \"'util/scores/delete.c'\"
  1407. else
  1408. echo shar: Extracting \"'util/scores/delete.c'\" \(5947 characters\)
  1409. sed "s/^X//" >'util/scores/delete.c' <<'END_OF_FILE'
  1410. X/* util/scores/delete.c: standalone program to delete record from scorefile
  1411. X
  1412. X   Copyright (c) 1991 James E. Wilson
  1413. X
  1414. X   This software may be copied and distributed for educational, research, and
  1415. X   not for profit purposes provided that this copyright and statement are
  1416. X   included in all such copies. */
  1417. X
  1418. X#include <stdio.h>
  1419. X
  1420. X#include "../../source/config.h"
  1421. X#include "../../source/constant.h"
  1422. X#include "../../source/types.h"
  1423. X#include "../../source/externs.h"
  1424. X
  1425. X#if defined(USG) || defined(VMS)
  1426. X#ifndef L_SET
  1427. X#define L_SET 0
  1428. X#endif
  1429. X#ifndef L_INCR
  1430. X#define L_INCR 1
  1431. X#endif
  1432. X#endif
  1433. X
  1434. X#undef fopen
  1435. X
  1436. X#ifndef USG
  1437. X/* only needed for Berkeley UNIX */
  1438. X#include <sys/param.h>
  1439. X#include <sys/types.h>
  1440. X#include <sys/file.h>
  1441. X#endif
  1442. X
  1443. Xextern race_type race[MAX_RACES];
  1444. Xextern class_type class[MAX_CLASS];
  1445. X
  1446. XFILE *highscore_fp;
  1447. XFILE *fileptr;
  1448. Xint8u xor_byte;
  1449. X
  1450. Xvoid set_fileptr();
  1451. X
  1452. Xmain(argc, argv)
  1453. X     int argc;
  1454. X     char *argv[];
  1455. X{
  1456. X  register int i, rank;
  1457. X  high_scores score;
  1458. X  int8u version_maj, version_min, patch_level;
  1459. X  int delete_number;
  1460. X
  1461. X  if (argc != 3)
  1462. X    {
  1463. X      printf ("Usage: delete scorefile index > newscore\n");
  1464. X      exit (-2);
  1465. X    }
  1466. X
  1467. X  if ((highscore_fp = fopen (argv[1], "r")) == NULL)
  1468. X    {
  1469. X      printf ("Error opening score file \"%s\"\n", MORIA_TOP);
  1470. X      exit (-1);
  1471. X    }
  1472. X
  1473. X  if ((delete_number = atoi (argv[2])) <= 0)
  1474. X    {
  1475. X      printf ("Index must be a positive number.\n");
  1476. X      printf ("Usage: delete scorefile index\n");
  1477. X      exit (-2);
  1478. X    }
  1479. X
  1480. X#ifdef MSDOS
  1481. X  (void) setmode (fileno(highscore_fp), O_BINARY);
  1482. X#endif
  1483. X
  1484. X#ifndef BSD4_3
  1485. X  (void) fseek(highscore_fp, (long)0, L_SET);
  1486. X#else
  1487. X  (void) fseek(highscore_fp, (off_t)0, L_SET);
  1488. X#endif
  1489. X
  1490. X  /* Read version numbers from the score file, and check for validity.  */
  1491. X  version_maj = getc (highscore_fp);
  1492. X  version_min = getc (highscore_fp);
  1493. X  patch_level = getc (highscore_fp);
  1494. X  /* Support score files from 5.2.2 to present.  */
  1495. X  if (feof (highscore_fp))
  1496. X    {
  1497. X      printf ("The scorefile is empty.\n");
  1498. X      exit (-1);
  1499. X    }
  1500. X  else if ((version_maj != CUR_VERSION_MAJ)
  1501. X      || (version_min > CUR_VERSION_MIN)
  1502. X      || (version_min == CUR_VERSION_MIN && patch_level > PATCH_LEVEL)
  1503. X      || (version_min == 2 && patch_level < 2)
  1504. X      || (version_min < 2))
  1505. X    {
  1506. X      printf("Sorry. This scorefile is from a different version of umoria.\n");
  1507. X      exit (-1);
  1508. X    }
  1509. X
  1510. X  (void) putc (version_maj, stdout);
  1511. X  (void) putc (version_min, stdout);
  1512. X  (void) putc (patch_level, stdout);
  1513. X
  1514. X  /* set the static fileptr in save.c to the highscore file pointer */
  1515. X  set_fileptr(highscore_fp);
  1516. X
  1517. X  rank = 1;
  1518. X  rd_highscore(&score);
  1519. X  while (!feof(highscore_fp))
  1520. X    {
  1521. X      i = 1;
  1522. X      /* Put twenty scores on each page, on lines 2 through 21. */
  1523. X      while (!feof(highscore_fp) && i < 21)
  1524. X    {
  1525. X      if (rank != delete_number)
  1526. X        {
  1527. X          set_fileptr (stdout);
  1528. X          wr_highscore (&score);
  1529. X          set_fileptr (highscore_fp);
  1530. X        }
  1531. X      rank++;
  1532. X      rd_highscore(&score);
  1533. X    }
  1534. X    }
  1535. X
  1536. X  /* Success.  */
  1537. X  exit (0);
  1538. X}
  1539. X
  1540. Xstatic void wr_byte(c)
  1541. Xint8u c;
  1542. X{
  1543. X  xor_byte ^= c;
  1544. X  (void) putc((int)xor_byte, fileptr);
  1545. X}
  1546. X
  1547. Xstatic void wr_short(s)
  1548. Xint16u s;
  1549. X{
  1550. X  xor_byte ^= (s & 0xFF);
  1551. X  (void) putc((int)xor_byte, fileptr);
  1552. X  xor_byte ^= ((s >> 8) & 0xFF);
  1553. X  (void) putc((int)xor_byte, fileptr);
  1554. X}
  1555. X
  1556. Xstatic void wr_long(l)
  1557. Xregister int32u l;
  1558. X{
  1559. X  xor_byte ^= (l & 0xFF);
  1560. X  (void) putc((int)xor_byte, fileptr);
  1561. X  xor_byte ^= ((l >> 8) & 0xFF);
  1562. X  (void) putc((int)xor_byte, fileptr);
  1563. X  xor_byte ^= ((l >> 16) & 0xFF);
  1564. X  (void) putc((int)xor_byte, fileptr);
  1565. X  xor_byte ^= ((l >> 24) & 0xFF);
  1566. X  (void) putc((int)xor_byte, fileptr);
  1567. X}
  1568. X
  1569. Xstatic void wr_bytes(c, count)
  1570. Xint8u *c;
  1571. Xregister int count;
  1572. X{
  1573. X  register int i;
  1574. X  register int8u *ptr;
  1575. X
  1576. X  ptr = c;
  1577. X  for (i = 0; i < count; i++)
  1578. X    {
  1579. X      xor_byte ^= *ptr++;
  1580. X      (void) putc((int)xor_byte, fileptr);
  1581. X    }
  1582. X}
  1583. X
  1584. Xstatic void rd_byte(ptr)
  1585. Xint8u *ptr;
  1586. X{
  1587. X  int8u c;
  1588. X
  1589. X  c = getc(fileptr) & 0xFF;
  1590. X  *ptr = c ^ xor_byte;
  1591. X  xor_byte = c;
  1592. X}
  1593. X
  1594. Xstatic void rd_short(ptr)
  1595. Xint16u *ptr;
  1596. X{
  1597. X  int8u c;
  1598. X  int16u s;
  1599. X
  1600. X  c = (getc(fileptr) & 0xFF);
  1601. X  s = c ^ xor_byte;
  1602. X  xor_byte = (getc(fileptr) & 0xFF);
  1603. X  s |= (int16u)(c ^ xor_byte) << 8;
  1604. X  *ptr = s;
  1605. X}
  1606. X
  1607. Xstatic void rd_long(ptr)
  1608. Xint32u *ptr;
  1609. X{
  1610. X  register int32u l;
  1611. X  register int8u c;
  1612. X
  1613. X  c = (getc(fileptr) & 0xFF);
  1614. X  l = c ^ xor_byte;
  1615. X  xor_byte = (getc(fileptr) & 0xFF);
  1616. X  l |= (int32u)(c ^ xor_byte) << 8;
  1617. X  c = (getc(fileptr) & 0xFF);
  1618. X  l |= (int32u)(c ^ xor_byte) << 16;
  1619. X  xor_byte = (getc(fileptr) & 0xFF);
  1620. X  l |= (int32u)(c ^ xor_byte) << 24;
  1621. X  *ptr = l;
  1622. X}
  1623. X
  1624. Xstatic void rd_bytes(ch_ptr, count)
  1625. Xint8u *ch_ptr;
  1626. Xregister int count;
  1627. X{
  1628. X  register int i;
  1629. X  register int8u *ptr;
  1630. X  register int8u c;
  1631. X
  1632. X  ptr = ch_ptr;
  1633. X  for (i = 0; i < count; i++)
  1634. X    {
  1635. X      c = (getc(fileptr) & 0xFF);
  1636. X      *ptr++ = c ^ xor_byte;
  1637. X      xor_byte = c;
  1638. X    }
  1639. X}
  1640. X
  1641. X/* set the local fileptr to the scorefile fileptr */
  1642. Xvoid set_fileptr(file)
  1643. XFILE *file;
  1644. X{
  1645. X  fileptr = file;
  1646. X}
  1647. X
  1648. Xvoid wr_highscore(score)
  1649. Xhigh_scores *score;
  1650. X{
  1651. X  /* Save the encryption byte for robustness.  */
  1652. X  wr_byte(xor_byte);
  1653. X
  1654. X  wr_long((int32u) score->points);
  1655. X  wr_long((int32u) score->birth_date);
  1656. X  wr_short((int16u) score->uid);
  1657. X  wr_short((int16u) score->mhp);
  1658. X  wr_short((int16u) score->chp);
  1659. X  wr_byte(score->dun_level);
  1660. X  wr_byte(score->lev);
  1661. X  wr_byte(score->max_dlv);
  1662. X  wr_byte(score->sex);
  1663. X  wr_byte(score->race);
  1664. X  wr_byte(score->class);
  1665. X  wr_bytes((int8u *)score->name, PLAYER_NAME_SIZE);
  1666. X  wr_bytes((int8u *)score->died_from, 25);
  1667. X}
  1668. X
  1669. Xvoid rd_highscore(score)
  1670. Xhigh_scores *score;
  1671. X{
  1672. X  /* Read the encryption byte.  */
  1673. X  rd_byte (&xor_byte);
  1674. X
  1675. X  rd_long((int32u *)&score->points);
  1676. X  rd_long((int32u *)&score->birth_date);
  1677. X  rd_short((int16u *)&score->uid);
  1678. X  rd_short((int16u *)&score->mhp);
  1679. X  rd_short((int16u *)&score->chp);
  1680. X  rd_byte(&score->dun_level);
  1681. X  rd_byte(&score->lev);
  1682. X  rd_byte(&score->max_dlv);
  1683. X  rd_byte(&score->sex);
  1684. X  rd_byte(&score->race);
  1685. X  rd_byte(&score->class);
  1686. X  rd_bytes((int8u *)score->name, PLAYER_NAME_SIZE);
  1687. X  rd_bytes((int8u *)score->died_from, 25);
  1688. X}
  1689. END_OF_FILE
  1690. if test 5947 -ne `wc -c <'util/scores/delete.c'`; then
  1691.     echo shar: \"'util/scores/delete.c'\" unpacked with wrong size!
  1692. fi
  1693. # end of 'util/scores/delete.c'
  1694. fi
  1695. echo shar: End of archive 23 \(of 39\).
  1696. cp /dev/null ark23isdone
  1697. MISSING=""
  1698. 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
  1699.     if test ! -f ark${I}isdone ; then
  1700.     MISSING="${MISSING} ${I}"
  1701.     fi
  1702. done
  1703. if test "${MISSING}" = "" ; then
  1704.     echo You have unpacked all 39 archives.
  1705.     echo "Now run "bldfiles.sh" to build split files"
  1706.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1707. else
  1708.     echo You still need to unpack the following archives:
  1709.     echo "        " ${MISSING}
  1710. fi
  1711. ##  End of shell archive.
  1712. exit 0
  1713.