home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sources / games / 174 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  56.3 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: v14i044:  umoria4 - single player dungeon simulation (ver. 5.5), Part12/39
  5. Message-ID: <3402@master.CNA.TEK.COM>
  6. Date: 20 Aug 92 18:04:07 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 1489
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: grabiner@math.harvard.edu (David Grabiner)
  12. Posting-number: Volume 14, Issue 44
  13. Archive-name: umoria4/Part12
  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 12 (of 39)."
  26. # Contents:  ERRORS source/files.c
  27. # Wrapped by billr@saab on Thu Aug 20 09:11:29 1992
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'ERRORS' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'ERRORS'\"
  31. else
  32. echo shar: Extracting \"'ERRORS'\" \(37776 characters\)
  33. sed "s/^X//" >'ERRORS' <<'END_OF_FILE'
  34. Xstores probably should buy items which have been marked {damned} by being worn
  35. Xand then cleared via remove curse, after all they buy unident damned items
  36. X
  37. Xcreating traps can destroy staircases
  38. X
  39. Xchests should create treasure appropriate to the level they were found on,
  40. Xnot the level that they are opened on
  41. X
  42. Xcolor MacMoria bugs: the colors dialog box says greed not green
  43. X    the help dialog lists the wrong versions
  44. X    my address is wrong
  45. X
  46. Xwhen wearing a ring of speed, light should not be used up as fast, the faster
  47. Xyou are moving, the more turns it should last
  48. X- by the same reasoning, store lockout are broken too, in fact just about
  49. X  anything using time won't work `correctly' when character is sped up
  50. X
  51. Xcalling put_qio() every turn during running significantly slows it down
  52. Xon slow hosts which are using curses, I believe it was added only for
  53. Xaesthetics, and it probably isn't strictly necessary, could at least
  54. Xsurround it with an #ifndef FAST_RUNNING or similar
  55. X
  56. Xwhen thief steals an object, say what was stolen in message
  57. Xwhen item in backpack is destroyed, indicate what item was destroyed
  58. Xinventory does not take a turn
  59. X
  60. Xdisplay_scores(), at end of the game, should display top 15 or so scores, and
  61. Xlist the current player's score below that if not in the top 15 list, at least,
  62. Xthe value of show_player should be false at the end
  63. X- better, display_scores can put a message line at the bottom like this
  64. X    ( ESC : return to game    space : toggle all scores/your scores)
  65. Xand then the player can easily choose which scores to see
  66. X
  67. Xthe 32767 limit in the recall code for number of monsters killed is too
  68. Xeasy to reach, making it unsigned will extend the range to 65535,
  69. Xmaking it a long would increase program size by 2K, I don't think that this
  70. Xchange is worth the extra memory used
  71. X
  72. XMac: choosing `9 point' from the screen menu results in a 1" square window
  73. Xwhich won't expand or grow, switching back to 12 point gives a huge window
  74. Xwith type that appears to be about 100 points or so
  75. X
  76. Xmonsters should probably not be summoned on top of a rune of protection
  77. X
  78. Xcould make scorefile code more efficient if I read/write more than one entry
  79. Xat a time
  80. X
  81. Xfor MSDOS: shouldn't the treasure.c file change '#' to wallsym, and '.'
  82. X  to floorsym?, shouldn't the save.c file change '.' to floorsym and vice
  83. X  versa, just like it already does for wallsym?
  84. X
  85. XVMS curses apparently has a bug, during resting, the program continually
  86. Xmoves the cursor to the @ sign, which is a no-op and should result in no
  87. Xoutput, but the VMS curses code outputs control commands to the terminal,
  88. Xthis makes resting run slow on bandwidth limited terminals
  89. X
  90. XVMS has 32 bit user ids (UIC), should increase the size of uid's in the
  91. Xscorefile to 32 bits, and then make the vms uic = getgid()<<16+getuid()
  92. Xwhich is 32 bits
  93. X
  94. Xremove the hours support for all micros, or else give people the option
  95. Xin the config.h file to remove it
  96. X
  97. Xwhen functions are not used, ifdef out the calls instead of providing
  98. Xdummy functions, to save some space
  99. X
  100. Xsave.c creates two files under VMS, because it first calls 'open' and
  101. Xthen later calls 'fopen', rewrite so that only one file will be created
  102. X
  103. Xin store.c, the comment "Your mother was a troll!" doesn't mean anything
  104. Xif you are a half-troll, change to Ogre?
  105. X
  106. Xthe ms_misc.c file maps the 'Ins' key, which is the '0' key to 'i',
  107. Xthis confuses the hell out of a lot of people, this IS documented, but
  108. Xfew people read the documentation
  109. X
  110. Xadd a turns counter to the higscores entry, and check this when restoring
  111. Xa character, don't score the character if this value is different
  112. Xthis prevents someone from playing a character, goofing, saving it while
  113. Xalive, and then going back to the first savefile
  114. X
  115. Xhaste self is a level 1 potion, and super heroism is level 3, both
  116. Xseem far too low of a level for the potions considering how useful they
  117. Xare, increasing the levels would make them more common deeper in the dungeon
  118. Xrestore potions are level 40 are too deep, they are available in the stores,
  119. Xand just aren't that powerful of a potion
  120. XDJG: haste self is needed at level 1 for early encounters with nasty monsters
  121. Xsuper heroism could be higher
  122. X
  123. Xthe sorting code does not work with foodstuffs, problem is that when
  124. Xrestore a 5.2.1 character which has unsorted food, the new code may
  125. Xput a food ration at the start instead of merging it with the other unsorted
  126. Xfood, thus overflowing the inventory size, there are few 5.2.1 characters
  127. Xleft anyways, so perhaps this isn't much of a problem anymore
  128. X
  129. Xwine/ale should be potions to be quaffed, not foodstuffs to be eaten
  130. X
  131. X^M = ^J when digging, can't really solve well, because of bugs in some
  132. Xversion of curses which requires this to be true
  133. X
  134. Xperhaps add an option to control the Drop One/Drop All query for multiple
  135. Xstacking items
  136. X
  137. Xthe choice of whether or not duplicate characters should be scored should
  138. Xreally be an option in the config.h file, since there exist single-user
  139. Xunix machines, and multi-user IBM-PCs (on a network)
  140. X- also, the decision of whether to limit each player to one entry per
  141. Xcharacter type should be an option (perhaps the same one)
  142. X
  143. Xgive warriors a better chance of detecting that ego weapons are magik,
  144. Xbut only for ego weapons, not all items
  145. X
  146. Xan inscription is lost when two objects are merged, either choose longest,
  147. Xor ask player, try to combine them, at least do something
  148. X
  149. XMacintosh
  150. X- mac version does not clear screen after saving a character
  151. X  restart variables are not reset as they should (maybe fixed?)
  152. X- mac moria crashes with the 384 size resource?, works fine with 512k size
  153. X- mac moria crashes when trying to write past the end of the screen,
  154. X  specifically, if have a weapon with more than 80 characters, and put it last
  155. X  in the equipment list, then mac version will crash
  156. X  add code to put_buffer to truncate strings?
  157. X- the CRuntime.o and CLibraries.o ARE needed for the mac makefiles.
  158. X- the file type and creator are not set for the character stats file
  159. X- when save a game and hit the cancel button, it still says the
  160. X  game is being saved even though it isn't
  161. X- when a character dies, the savefile is not marked as dead
  162. X- should be able to find config file in same directory as the program
  163. X- should get version number from constants, not hardwired into resources
  164. X- should have color menu enabled even on B&W monitor, so you can switch
  165. X    black and white if desired
  166. X- does not work on 512K mac, seems to be enough memory, but it uses routines
  167. X    which are not in the old ROMS, 512K macs are obsolete, so this is
  168. X    probably not worth fixing
  169. X
  170. XIBMPC
  171. X- received report that -w command gives 'file from wrong version' error
  172. X- when followed by monster, and reach edge of screen, sometimes the game
  173. X  hangs and you must type a character for it to continue, either a Turbo C
  174. X  bug or a PC-Moria bug
  175. X- tunneling does not work with the numeric keypad when using rogue-like mode,
  176. X  i.e. ctrl-4
  177. X- on PC, only draw during traceback, perhaps make this an option, this is
  178. X  a CGA specific problem (most people have VGA now a days), and only applies
  179. X  to the Turbo C builtin screen code, tcio.c, PC-Curses does not have this
  180. X  problem, in Turbo Pascal, there is a variable in the CRT unit that one
  181. X  can set to enable this feature
  182. X- tcio.c file does not handle redraw ^R at all
  183. X
  184. Xrun under Saber C to see if that turns up any bugs
  185. X
  186. X- when read curse weapon on a HA/DF weapon, the code does not clear the AC
  187. X  bonus of the weapon, cursed gauntlets of slaying don't lose +tohit/+todam,
  188. X  and other cases should be fixed also
  189. X- if you curse a special magic item (HA, RF, etc), it retains its very high
  190. X  value, its cost should be reset to the value in object_list[index]
  191. X- if you curse a special cursed object (noise, irritation), it will lose its
  192. X  special cursed ability (two wrongs make a right?!?), this should not happen,
  193. X  instead of clearing ALL flag bits, should only clear the 'good' ones
  194. X
  195. Xif wield a torch, and a silver jelly immediately drains it to 1,
  196. Xthe program will be confused for one turn thinking that you still have
  197. Xlight even though you don't
  198. X
  199. Xscoring unfair to humans/warriors/etc, since they have a lower max exp than
  200. Xother race/classes, should adjust exp downward by inflationary factors
  201. Xwhen calculating score?
  202. XDJG: unnecessary
  203. X
  204. Xshould reduce stack usage in generate.c
  205. X
  206. Xin the store, should have some way to determine how close one is to
  207. Xgetting perfect haggling
  208. X
  209. Xreplace all of those heavy weapon messages with an automatic inscription,
  210. Xhow should this be maintainted, should it change only when wielded,
  211. Xor should it change whenever the players strength changes?
  212. X
  213. Xthrowing a lot of objects into a pile can cause problems?
  214. X
  215. Xmake the printing of stuff under monsters an option for those who find
  216. Xit bothersome
  217. X
  218. Xmake monster movement more intelligent:
  219. X- for slow monsters, in movement_rate(), instead of using mod, use
  220. X  (randint(2 - speed) == 1) to make monster movement a little more uncertain
  221. X  for fast monsters, give a little variance to speed, i.e. 66% of time monster
  222. X  moves at speed, 17% of time move at speed+1, 17% of time move at speed-1
  223. X- monsters which are about to die should flee if intelligent
  224. X- monsters should breathe at player if only separated by a single column
  225. X- better spell selection, don't cast teleport_to when standing next to
  226. X  player, etc.
  227. X- have monsters with multiple attacks spread the attacks over each turn if
  228. X  moving slower than player, instead of doing nothing one turn, and then
  229. X  attacking multiple times on the next turn
  230. X- remember the previous two moves for each intelligent monster, so they can
  231. X  tell which direction they are moving
  232. X
  233. Xin get_com(), get_dir(), etc, put -escape- on the msg line if escape
  234. Xkey pressed, useful if message doesn't get deleted, but doesn't this
  235. Xalways happen?, apparently not on the Atari ST MWC port
  236. X
  237. Xrubble can be generated underneath a monster, which should not happen
  238. X
  239. Xwhy call sigsetmask(0)?
  240. Xdelete signals() and nosignals() as unnecessary?
  241. X
  242. Xkilling a shell -1 results in the game disappearing without leaving
  243. Xa save file, what happened?
  244. X
  245. Xthe save.c code that says "file exists, overwrite?", can this ever be
  246. Xexecuted?, if so, does it do the right thing?,  and also, what happens on
  247. XEOF? will it go into an infinite loop on EOF?
  248. X
  249. Xwhat exactly does the damned flag mean, should it be on for all except known2
  250. Xitems, or should it be on when an item is known to be cursed?
  251. X
  252. Xadd ptodam to damage before calling critical_hits
  253. X- modify C command to print to dam bonuses modified by weapon, should
  254. X  print both the unmodified bonus, and the modified bonus
  255. X- should take about 10 slay dragon arrows to kill AMHD, check this after
  256. X  ptodam code is changed, may need to increase damages from +3?
  257. X- also check other ego weapons for play balance, maybe reduce ego multipliers
  258. X
  259. Xwhen rogues list Beginners Majik spell book, spells are listed 'a'-'e',
  260. Xwhen cast from the spell book, spells are listed 'b'-'f', the spell casting
  261. Xlist should also go from 'a'-'e', but this looks hard to fix
  262. X
  263. Xallow SPACE to exit from inventory commands
  264. X
  265. Xno monster, except Balrog, can resist mass polymorph, should I make it more
  266. Xlike polymorph?
  267. Xmass polymorph is much higher level than polymorph, and is useful for
  268. Xdire emergencies, either don't give monsters a saving throw, or make is
  269. Xsomething like level/(3*MAX_MONS_LEVEL/2) which will make it possible but not
  270. Xcertain that the staff will work on AMHD's
  271. X
  272. Xshould mac port have a separate io.c file?
  273. X
  274. Xinvisible monsters, and 'headless' monsters should not glare when recovering
  275. Xfrom a bash
  276. X
  277. Xversion.inf file should not contain version number/copyright, these should
  278. Xbe printed from the variable values
  279. X
  280. Xin misc1.c, the pusht code requires search of entire cave structure,
  281. Xthis needs to be written more efficiently, perhaps put x,y into inven_type for
  282. Xevery object located somewhere in the cave?
  283. X
  284. Xeliminate all #if 0 in the code
  285. X
  286. X**************************
  287. XChanges that can wait...
  288. X
  289. Xonly let warriors get *GREAT* hits?
  290. Xin critical_hits(), change the threshholds to 400-600-800, which will make
  291. Xall melee weapons eligible for great hits, and only let warriors get great
  292. Xhits
  293. Xsince this makes Mage's much worse fighters, swap Sleep II for Lightning
  294. XBall (giving a much needed intermediate Ball spell), and Recharge I for
  295. XObject Dectection (to compensate for Priest's sense surroundings)
  296. XDJG: object detection isn't very useful
  297. X
  298. Xincrease the classes of weapons from 3 to 5, i.e. missile, blunt, assassin,
  299. Xmelee (two handed weapons, etc., only these can do *GREAT* hits), and normal.
  300. XThen modify fighting abilities as follows:
  301. X         mis   blu   ass   mel   nor
  302. X          a)    b)    c)    d)    e)              -- := suck
  303. XWarrior   +     +     +     ++    +               -  := iffy
  304. XRogue     +     0     ++    -     0               0  := unchanged
  305. XMage      0     0     0     --    0               +  := improved
  306. XRanger    ++    0     0     0     0               ++ := hyperb
  307. XPriest    0     +     -     --    0
  308. XPaladin   0     ++    0     0     0
  309. X
  310. Xthe monster memory always prints monster attack types and damage types
  311. Xtogether, this can lead to strange situations, for example, if a grey
  312. Xmushroom patch releases spores, but does not confuse the player, nothing
  313. Xappears in the monster memory because the player does not know they were
  314. Xconfusion spores, but he/she does know that that spores are released
  315. X
  316. XIBMPC COLOR
  317. X- the experimental color support for PC-Moria does not work well when
  318. X  trying to display a monster which is the same color as the background
  319. X- the disenchanter w and b are not the same color
  320. X- CHP changes to the same color as ball/breath that lowered it
  321. X- all mushrooms are wrong, except the grey mushroom patch
  322. X- invisible monsters can easily be found by casting stinking cloud at the walls
  323. X  which will color all spaces green, except the one with the invisible monster
  324. X
  325. Xshow how many spells player can learn via the 'G' command
  326. X
  327. Xadd max mana to display in addition to current mana
  328. X
  329. Xadd inscriptions that apply to a class of objects, not just a single instance
  330. X
  331. Xshouldn't be able to genocide invalid letters; escape out of genocide
  332. X
  333. Xhave alternative messages to 'dies in a fit of agony', that gets
  334. Xa bit repetitive, and boring
  335. X
  336. Xa command to allow writing the monster memory to a file
  337. X
  338. Xget sources for nethack/omega, look for any really good ideas, also check
  339. Xto see how the implement Mac compatibility, portability, protection,
  340. Xand other general concepts
  341. X
  342. Xtreasure.c has an arrow and a bolt out of order (arrow in the rings, and
  343. Xbolt in the amulets)
  344. X
  345. Xsecret doors are always granite, would be nice to have secrets doors
  346. Xhidden in other types of rock, would make them less obvious when
  347. Xhightlight seams is on, also current scheme gives an advantage while searching
  348. Xsince walls displayed as % obviously are not secret doors
  349. X
  350. XMAX_SIGHT is 20, but rooms can be larger than twenty across, that gives
  351. Xstrange situation where moving one step away from a monster in a large room
  352. Xcan cause it to disappear, either increase MAX_SIGHT to be size of largest
  353. Xpossible room size, or else use different MAX_SIGHT values in rooms/corridors/
  354. Xtown level?
  355. X
  356. Xinstead of printing 'it can hit to attack and hit to attack' print
  357. X'it can hit to attack twice' in monster descriptions?
  358. X
  359. X- change haggling so that initial price depends on how many good bargains
  360. Xyou have had
  361. X- add key to accept price, instead of forcing player to type in price
  362. X- when reach perfect haggling, should just give object to player without
  363. Xasking for any prompt, bad idea if someone mistypes a letter
  364. X- add an option so that player can play with or without haggling, without
  365. Xhaggling, give prices that are always, say, 30% above the minimum
  366. X- add store commands to buy/sell without haggling, with price say, 20%,
  367. Xless/greater than asking price
  368. X
  369. Ximprove map command (see nethack), define an array of special characters,
  370. Xone for each type of composite wall, say, and then let end users specify
  371. Xthe necessary graphic characters, allow for multiple character graphic
  372. Xsequences
  373. X
  374. Xcombat in a room should have a chance of waking up sleeping monsters, except
  375. Xthat it would not be fair, since monsters can send breath weapons through
  376. Xother monsters, but the player can only attack the nearest monsters
  377. X
  378. X(high level?) monsters should slowly regenerate hit points, esp since the
  379. Xdoc states that the Balrog does
  380. Xnote, if leave level and come back, the Balrog is regenerated (sic) with
  381. Xfull hit points
  382. Xevery 128 turns, let monsters regenerate 1/64 of their total hit points?
  383. X
  384. Xhave several different types of Balrog, i.e. a fire breathing one,
  385. Xa cold breathing one, a lightning breathing one, etc.
  386. X
  387. Xshould be a chance of weapons breaking when try to dig with them?
  388. XNO, it is too easy to dig with weapon by accident, shouldn't dull them unless
  389. Xthere is some way to sharpen them which there currently isn't
  390. X
  391. Xcan get small groups of rooms which are connected to each other, but not
  392. Xto the rest of the rooms on the level, perhaps check for cycles in
  393. Xtunnel/room graph before trying to build tunnels?
  394. X
  395. Xcan not use counted commands while bashing a door, because of the
  396. Xparalyzation that sometimes occurs always stops a counted command
  397. X
  398. Xallow character building, by allocation of a limited number of stat points,
  399. Xinstead of random rerolling??
  400. X
  401. Xadd another aux inventory slot, so that there is one for picks, and one for
  402. Xbows
  403. X
  404. Xdecrease mithril values, increase gem values, more expensive items in the
  405. Xshops, should be greater difference between prices of low level objects
  406. Xand high level objects, more gold/silver/copper on lower levels, selling
  407. Xhigh enchanted objects should not be so profitable
  408. X(good idea here, favorite suggestion for fixing the money problem)
  409. X
  410. Xin object_offset(), give 70/71 and 75/76 different codes, shift by 5 (32)
  411. Xeverywhere instead of 6 (64), reduce size of object_ident[] from
  412. X7*64 to 9*32, objects 71 must all have 2 added to subval so that they
  413. Xstart at 96, objects 76 must all have 1 added to subval
  414. X
  415. Xall variables (including bss) should be initialized before they are used,
  416. Xsee the mac sources
  417. X
  418. Xadd a macro capability
  419. X
  420. Xmost case statements should use table or if/else instead, table are much
  421. Xfaster, both give much smaller code
  422. X
  423. Xif have one unidentified object, and sell it to a store, and it gets
  424. Xidentified, and you happen to have some similar store items, you will get
  425. Xa 'combining' message, even though no combining is really taking place,
  426. Xperhaps adding an extra parameter to identify which indicates whether
  427. Xthe item will remain in inventory after ident, if it does not remain,
  428. Xthen should not give combining message if there is only one of them
  429. X
  430. Xmany of the constants in constant.h should really be enums instead, this
  431. Xwould make the game more maintainable
  432. X
  433. Xsome fields of treasure_type are const and could be deleted
  434. X
  435. Xmissile weapons should be made more useful, make them stackable after
  436. Xidentified if they are identical, increase the benefit of using proper
  437. Xbow/arrow combo, increase +todam, +tohit more than now, perhaps give
  438. Xan advantage here to fighters/paladins/rangers/rogues somehow, don't
  439. Xdecrease ptohit so much in inven_throw() (currently reduced by distance)
  440. X
  441. Xshould recall info be set in breath() for other monsters?
  442. X
  443. Xfinish monster compiler, write defs for all monsters
  444. X
  445. Xshould be able to increase digging plusses for weapons??
  446. X
  447. Xshould be able to increase ring plusses?? this would seriously unbalance
  448. Xthe game if allowed
  449. X
  450. Xin the store bargain code, separate the sell good bargains from the purchase
  451. Xgood bargains?  this is important for owners with very high inflate values
  452. Xas it is easy to reach sell final value, but very difficult to reach purchase
  453. Xfinal value, change from 20 to 10 if do this
  454. X
  455. Xchange move to take a char-number i.e. '0' instead of a number, i.e. 0
  456. X
  457. Xput all prt_ functions into a separate file, put all movement functions
  458. Xin a separate file
  459. X
  460. Xdefine constants for all possible tchars, number-directions, attack-types,
  461. Xlast_line = 23, scroll flags, potion flags, etc
  462. X
  463. Xwould be nice if 10-23 were all wielded objects, i.e. move light 15 outside
  464. Xthis range
  465. X
  466. Xuse scroll bars on the Mac version for showing the rest of the level,
  467. XL/W, might be confusing since this won't scroll the whole window, only
  468. Xthe dungeon view
  469. Xhave multiple windows, one for inventory, one resizable/scrollable for
  470. Xdungeon view, etc...
  471. X
  472. Xshould eliminate need for 70/71 scrolls and 75/76 potions
  473. X
  474. Xreplace hex flag fields in treasure with constants
  475. X
  476. Xshould not get message "something rolls under feet" when step on a loose rock
  477. X/* Hid Obj*/ trap?, also should not get this message when cast create food
  478. Xsome people prefer to have these messages though
  479. X
  480. X%%%%%%%%%%%%%
  481. Xideas from Bron Campbell Nelson bron%bronze.wpd.sgi.com@sgi.sgi.com
  482. X
  483. Xpotion of boldness should have duration, i.e. should be safe from fear for
  484. Xa little while after quaffing boldness potion (also heroism/super-heroism)
  485. Xthe current length values seem a little long, perhaps just improve the
  486. Xcharacters resistance to fear?
  487. X
  488. Xwarriors too hard, give them more hitpoints?, lower base-to-hit of other
  489. Xclasses?, fix warrior so can withstand one AMHD poison breath attack?
  490. X
  491. Xboots of speed are too hard to find, 1/7000 is ring of speed, 1/14000+ is
  492. Xboots of speed, other evidence suggests that boots are about 10 times as
  493. Xrare as rings
  494. X
  495. Xitems needed for win: see invisible, free action, resist fire, speed, if
  496. Xadd black market, don't make it too easy to get these items
  497. X
  498. Xblack market suggestions:
  499. Xstaff of teleportation 20000, staff of speed 100000, mushroom of restoring
  500. X20000, and perhaps some powerful archery items
  501. X
  502. Xheavy armor is useless, does not protect against spells/breate, and reduces
  503. Xfrom to-hit, reduce penalty for characters with high STR?
  504. X
  505. Xnew shop: enchantorium, where enchantments can be purchased for a high
  506. Xprice, price proportional to how many enchants already there (i.e. enchanting
  507. Xa +9 item costs a fabulous amount, but enchanting a +0 item costs a little
  508. Xmore than one enchant armor/weapon scroll), allow enchant to any value, i.e.
  509. XAC/digging for HA/DF, digging for picks/shovels/etc, etc...
  510. X
  511. Xless reasonble suggestions follow...
  512. X
  513. Xtoo many weapon types, the variety is useless
  514. X
  515. Xhave armor protect by subtracting ac/10 (sic) instead of reducing by %
  516. X
  517. Xspeed is too important, need smaller time quanta
  518. X
  519. Xrace/class adjustments should be more meaningful, give races/classes max
  520. Xstat values which are not 18/100
  521. X
  522. Xadd an autosave option
  523. X
  524. Xadd more up stairways? currently there are only randint(2) per level,
  525. Xperhaps guarantee that there will be at least 2
  526. X
  527. Xwarriors should automatically recognize ego weapons
  528. X
  529. Xdispel evil/undead are nearly worthless since they do not do much damage for
  530. Xtheir mana cost, change dispel_creature from mon_take_hit (i, randint(damage))
  531. Xto mon_take_hit (i, damage)
  532. X
  533. Xrune of protection is too powerful, reduce OBJ_RUNE_PROT to 800, maybe 1000,
  534. Xif make this change, should make the spell somewhat easier to cast, say
  535. X50% for a level 33 priest
  536. XDJG: this makes them much less useful against the Balrog
  537. X
  538. XBalrog should not cast cause serious wounds as it does less damage than a
  539. Xnormal attack, should not cast slow/paralyze since the player almost
  540. Xcertainly will have some form of free action
  541. X
  542. X%%%%%%%%%%%%%%%%%%%%%%%%%
  543. X
  544. Xreincarnate, and lose 1/2 exp?
  545. X
  546. Xgive enchant scrolls (or perhaps just *enchant*) a small probability
  547. Xof creating ego weapons
  548. Xgive enchant scrolls a small probability of destroying ego enchantments
  549. Xif they fail to increase pluses
  550. X
  551. Xmake the number of hits per round probabilistic, i.e. instead of getting
  552. X1/2/3/4 hits per round, gives weapons 2.4 hits per round etc, to smoothen
  553. Xthe curve
  554. X
  555. Xperhaps add option to order monsters differently?
  556. Xgive list of all monsters of that type, and then recall all if type 0,
  557. Xelse only recall the one indicated by the number typed in
  558. Xchange ident_char() in help.c
  559. X
  560. Xhave all top level action functions (aim, move, throw, inven_command, etc.)
  561. Xreturn true if took a turn, otherwise false
  562. X
  563. Xadd command to show number of turns played, time spent playing, date character
  564. Xstarted, perhaps even a calendar to give game date '1037 in the Third Age'
  565. X
  566. Xenter_store in store2.c calls draw_cave when exiting the store, it should
  567. Xsave the current screen contents away in memory and then restore from that
  568. Xsaved screen
  569. X
  570. Xif type control-C while resting, sometimes the counter is not cleared, happens
  571. Xoften when count less than 10, to fix, should move all I/O code out of signal
  572. Xhandler, it should just set a flag and return
  573. X
  574. Xshould examine_book(), scrolls(), and spells/prayers work when hallucinating?
  575. X
  576. Xchange player attributes to counters, things like sustain_stat, etc.
  577. Xthis would greatly simplify calc_bonuses()
  578. X
  579. Xshould not be able to stun creates which do not move, and creatures
  580. Xwhich have no brains
  581. X
  582. Xlos code used to determine if monsters are visible but not for objects,
  583. Xthis leads to strange situations, when room lights up, one can see all objects
  584. Xin the room, but must enter the room before can see then monsters
  585. X
  586. Xhave the monster generator make a table of undead monster indexes, to simplify
  587. Xsummon_undead()
  588. X
  589. Xadd some unique levels to make it more interesting, mazes, etc.
  590. X
  591. Xadd a metric option
  592. X
  593. Xadd diagonal corridors???
  594. X
  595. Xadd a storage rental shop, so players can save objects until they need them,
  596. Xbut must pay for the priviledge, and have to go back to level 0 to
  597. Xretrieve the objects
  598. X
  599. Xcreate a safe haven for the player, where hp regen faster, poison/disease
  600. Xcure faster, and player must be in to win
  601. X
  602. Xadd amulet of poison resistance, make it a high level item, people would
  603. Xhave to take off amulet of the magi to wear it
  604. X
  605. Xadd another set of gain stat potions, at about 1550 feet, to encourage
  606. Xpeople to go deeper in search of them
  607. X
  608. Xadd a bank for saving/borrowing money (I don't like this), would rather
  609. Xmake money less plentiful, perhaps make magic items less profitable to
  610. Xsell?
  611. X
  612. Xpossible AD&D enhancements
  613. Xmages can't wear armor and cast at the same time, stealth decreases
  614. Xwhen wearing armor (for thieves), priests can't use edged weapons, spell
  615. Xcasting takes time (more than one turn for high level spells?), ranger
  616. Xattack bonuses, paladin's laying on hands and wealth limits
  617. X
  618. Xgive females better dexterity, and/or better spell casting ability, and/or
  619. Xmore stealth
  620. X
  621. XOrcs should always appear in groups?
  622. X
  623. Xpossible balancing enhancements
  624. Xcharacters have max stat of 18/50+ initial race/class mod, for example,
  625. Xhuman mage has max str of 18/50 - 5 = 18.
  626. Xincrease warrior HP so that a warrior can withstand one breath of any type
  627. Xfrlom any dragon
  628. Xdex is very important, so everybody should have a chance of getting high
  629. Xdex values
  630. X
  631. Xadd option to find code so that it can optionally stop before lighting
  632. X    up or entering a room
  633. Xadd otpion to find code so that will enter corridor intersections
  634. X
  635. XChange key-dispatch table in dungeon.c back to ORIGINAL mode.
  636. X
  637. Xput shell_out code in OS dependent files, unix.c/msdos.c/etc.
  638. X
  639. Xsave all levels, problems with the sheer size of doing this, 10K * 50 levels
  640. Xis 500K total
  641. X
  642. Xchange stats to straight 1-40 range
  643. X
  644. Xreplace sets.c with an array ~110*16 with a flag for each type of damage
  645. X    faster and smaller than current scheme
  646. X
  647. Xadd option to loc_symbol so that it can optionally print char to screen,
  648. X    most loc_symbol calls feed directly to print()
  649. X
  650. Xthe look code uses a different algorithm from the los code, is recursive,
  651. X    hard to understand, has 3 gotos, I would prefer code more like los
  652. X    using the shading ideas of jnh
  653. X
  654. Xlose_dex is never called, well, we'd better fix that!
  655. X
  656. Xfor characters with low dex, should have slight chance of dropping weapon,
  657. Xmaybe less for fighters, more for mages and priests, should also trip
  658. Xoccassionally when running
  659. Xacid attacks should lower charisma?
  660. X
  661. Xthe first nasty invisible monster is the Banshee at 1200 feet, so need to
  662. Xhave see invisible items start appearing at about this time, the current
  663. Xbalance seems OK to me though
  664. X
  665. Xblack mold, and shimmering mold have 00000080 CMOVE flag set which has no
  666. X    effect
  667. X
  668. Xboots of great mass can be identified by checking the weight display,
  669. Xshould eliminate them and replace with some other type of cursed boots
  670. Xsuggestion: boots of two left feet, (- to dexterity)
  671. X
  672. Xadd another field to monster_type, treasurep, cloned/multiplyed monsters
  673. X    should not have treasure, but if they pick up an object, then
  674. X    again let them carry treasure
  675. X
  676. Xchange randnor from table lookup to 8d99, save 512 bytes for table
  677. X
  678. Xremove ASCII dependencies
  679. X    many places assume that a-z are consecutive, i.e. 'a'+25 = 'z'
  680. X    the hallucination code assumes ascii - randint(95)+31 (misc1.c)
  681. X
  682. Xeliminate sscanf calls in ms_misc.c and wizard.c
  683. X
  684. Xallow numbers instead of letters in menus, i.e. spell lists, inventory/equip
  685. X    lists
  686. X
  687. Xdon't use num-lock for tunneling in PC version, this is a locking key
  688. X
  689. Xcharacters accumulate too much cash, perhaps do this:
  690. X    change OBJ_TOWN_LEVEL from 7 to 17, and change place_gold() in misc2.c
  691. X    293c293,294
  692. X    <   i = ((randint(dun_level+2)+2)/2.0) - 1;
  693. X    ---
  694. X    > /* NF: Change randint multiplier from (r(d+2)+2)/2 to (r(d+2)+4)/3 */
  695. X    >   i = ((randint(dun_level+2)+4)/3.0) - 1;
  696. Xthe fixes above (decrease mithril values ...) are preferable
  697. X
  698. Xshow time elapsed playing, date character started, and number of turns
  699. Xelapsed
  700. X
  701. Xhave option to put inventory/equipment list on one screen
  702. X
  703. Xset a timer, and if the game has been idle for 15 minutes, gracefully
  704. Xsave and exit?
  705. X
  706. Xnew monster suggestions by berman-andrew@yale, because there are no
  707. Xmedium difficult mosnters before level 40...
  708. X{"Electric Golem", 0x00020002, 0x00080004, 0x1080, 100, 380,
  709. X  12, 85, 0, 'g', "70d8", "8 1 1d24|8 1 1d24", 35}
  710. X{"Queen Harpy",    0x37120012, 0x00008208, 0x2036, 100, 1200,
  711. X  20, 80, 2, 'h', "46d8", "1 3 2d6|1 3 2d6|1 2 2d12|3 7 0d0", 35}
  712. X
  713. Xnew monster suggestions by Don Dodson
  714. XNether Lich: invisible, phases through walls, similar to Emperor Lich in
  715. X    other respects
  716. XArcher: fires arrows that do normal damage, or poison, or reduce stat
  717. XWizard: Like a sorceror but more powerful.  Casts fireballs, summons all sorts
  718. X    of nasties, blindness, and hold person.  Very high saving throw
  719. X    and resistant for fire/frost.
  720. X
  721. Xballs should affect player if inside radius, unfortunately, this is not
  722. Xreally such a good idea, since the player is often forced to cast to the
  723. Xnext space, would be OK if the player can specify any point for the target
  724. Xof the spell
  725. X
  726. Xwhen resting, a player should have a chance of not waking up when a monster
  727. Xenters a room
  728. X
  729. Xadd wizard command that would create new MORIA_HOU file, since there already
  730. X    is a default def for it, otherwise, make days array bss
  731. X
  732. Xfor HA weapons, p1 is used for both str increase, and sustain stat
  733. X
  734. Xrewrite my own sprintf routine that just takes strings %s and integers %d
  735. Xand nothing else, may be faster/smaller than the library version, or perhaps
  736. Xhave a routine which cats 3 strings together, or 2 strings and an int
  737. X
  738. Xage characters before killing them of Ripe-Old-Age
  739. X
  740. Xthese commands which take a dir should not work when confused,
  741. X   bash, closeobject, jamdoor, openobject
  742. X
  743. Xmonsters need a 'not carry large object' flag in CMOVE, have all chests (type
  744. X2), polearms (type 22) and staffs (type 55) be large objects, these should
  745. Xbe rerolled if they occur when only small objects allowed, chests should have
  746. Xthis bit set, also small creatures should have it set: kobolds, mummified
  747. Xkobolds, greedy little gnomes, scruffy-looking hobbits.
  748. X
  749. Xtrap names are vague,
  750. X   have two names for each trap, a simple search discloses current vague name,
  751. X   setting it off, or a find/identify trap gives the long name
  752. X
  753. Xallow option of making aux files either hard coded paths, or paths relative
  754. Xto the executables directory, could then make the aux files relative, put
  755. Xexe file in same directory as aux files, and start up program with shell
  756. Xscript that cds to aux file direcotry, this makes it easy to keep multiply
  757. Xmoria versions around
  758. X
  759. Xallow rerolling after choose race/class
  760. X
  761. Xstill too slow on i/o, perhaps rewrite to avoid refresh() calls?
  762. X    perhaps use only motion optimization stuff?
  763. X
  764. Xshould we call m_name if spell only applies to visible creatures?
  765. X
  766. Xwhen moving on objects, say what character moved onto (like rogue)
  767. X
  768. Xfor throw command, ask for direction first (like rogue)
  769. X
  770. Xshould be able to enchant to-hit to-dam of gauntlets of slaying?
  771. X   likewise, enchant toac of HA swords, etc.
  772. Xeither should allow enchant of HA sword toac, or else disenchanter bats
  773. X  should not be allowed to reduce it
  774. X
  775. Xfix save files to include obj desc, then only need one random number
  776. X    generator which can use table program
  777. X
  778. Xgive rogues detect treasure and detect objects, also give them a chance to
  779. Xsteal objects from monsters
  780. X
  781. Xmodify 'x' command to show monster hitpoints
  782. X
  783. Xreplace magic numbers with constants
  784. X
  785. Xname objects if use did not identify them
  786. X
  787. Xwhen creature steals and then dies, the stolen item should appear, unless
  788. Xcreature has teleported away in the meantime
  789. X
  790. Xalways add exp to current and max, instead of just increasing max when current
  791. Xexceeds it, this would make attacking undead creatures a little more profitable
  792. Xsince you are guaranteed a net gain of exp if you kill it, even if it drains
  793. Xa lot of EXP from you
  794. X
  795. Xallow chests to hold items
  796. X
  797. Xhave a global variable, savefile field to keep track of the number of times
  798. Xa character has been resurrected
  799. X
  800. Xshould not be able to use a two-handed weapon (two-handed sword, pole arm,
  801. Xbow, crossbow, flail, etc.) at same time as wearing a shield
  802. Xshould be able to also choose to wield two weapons, but with a penalty of
  803. Xsome sort, probably lowered AC
  804. X
  805. Xcan't cast in any direction, should be able to, should also be able to cast
  806. Xdown at feet (5), should be able to cast area affect spells (balls) at any
  807. Xpoint, so that the burst will affect any desired area
  808. X
  809. XLong term stuff, enhancement suggestions:
  810. Xgive player something to do with money, i.e. 1Million gp for HA +10 +10 sword
  811. X'flavor' the levels, dragons on one level, undead on another, etc.
  812. Xwhat's been discovered list
  813. Xcommands not close enough to rogue style
  814. Xfixed item lettering in inventory, in-line/cmd-line options?
  815. Xcommand line option to print out times open
  816. XY destroy command, allow destroy from equipment list
  817. Xlet o, c, D commands automatically pick direction when they can
  818. Xgive rogue's a chance to steal, e.g. let monsters carry items that they
  819. X  pick up, if rogue fails, then monster gets a free hit, otherwise monster
  820. X  stays asleep, with a small chance of monster waking up
  821. Xgive magic users a chance at pre identifying scrolls
  822. Xcould use a help system, like VMS version
  823. Xhave multiple character parties, note that almost everything character
  824. X    dependent is stored in the py structure already
  825. X
  826. X
  827. Xcould reduce the size of the types.h file (and other source files too) if
  828. X    eliminate reduce type specifiers, i.e. int32u cmove;\n int32u spells;
  829. X    could be int32u cmove,\n        spells;
  830. X
  831. Xadd color, i.e. red dragons show up as a red 'D', etc
  832. X
  833. Xan inn on the town level, in which you must pay to stay, could be used
  834. Xby those who need to wait to get back into a store, or who want to wait
  835. Xuntil a store's inventory changes
  836. X
  837. Xwhen look at monsters, give monster state in addition to monster name, i.e.
  838. X"You see a sleeping ancient red dragon."
  839. X
  840. Xadd code to the get_dir() function so that one can optionally specific a
  841. X    hex instead of a direction, i.e. if you enter '.', then program goes
  842. X    into a cursor positioning mode, allowing you to move the cursor to
  843. X    the spot you want to specify
  844. X
  845. Xdon't like the player_exp values, the increase is not very even, especially
  846. Xin the upper levels
  847. X
  848. Xcloak of protection is misleading, it has no special features
  849. X
  850. Xneed documentation on what each spell/prayer/staff/etc does, this is needed
  851. X    for priestly spells in particular, since these are non obvious
  852. X    also needed for special objects, such as crown of magi
  853. X
  854. Xeating elvish waybread for curing can cause a character to become bloated and
  855. X    start moving slower, either decrease food value of ew to 5000, or
  856. X    increase player food limit to 17500, or combination of both, or perhaps
  857. X    change the you are full message, maybe have another message at 7500?,
  858. X    or maybe make elvish waybread immune to the slowing effect
  859. X
  860. Xmonsters should be more intelligent, should know about corridors so that they
  861. Xdon't get stuck in dead ends, or continually retrace their movement
  862. X
  863. XRNG for Moria should have a table shuffle, see Knuth
  864. X
  865. Xdon't update store inventories across save, unless the save file is at least,
  866. Xsay, an hour old
  867. X
  868. Xwhen monster appears, print its name, may need some work to work reasonably
  869. X    with detect spells
  870. X
  871. XFeatures:
  872. Xhero/superhero do not subtract hit points when effect wears off
  873. XWOR scroll can save you with minus hit points!!
  874. Xdetect monster does not detect invisible monsters (normally)
  875. Xcan hit monsters in walls, but can not cast at them
  876. Xcan not enchant something with negative numbers (i.e. cursed items)
  877. Xhow does armor protect against breath/gas? it doesn't!!!
  878. X
  879. Xmissing amulets: strength, constitution, intelligence, dexterity
  880. Xmissing rings: gain wisdom, gain charisma
  881. X    note that missing rings/amulets are disjoint
  882. Xmissing detect monster potion (feature!)
  883. Xmissing blank scrolls (feature!)
  884. Xmissing staff genocide (feature!)
  885. Xmissing staff mass_genocide (feature!)
  886. X
  887. XD&D Inconsistencies, most of these should not be fixed since that would
  888. X    unbalance the game:
  889. Xpriests should not need light for prayers
  890. Xmagic missile should do 1d4+1 per level
  891. Xdetect invisible should last 5 rounds, instead of 1
  892. Xstinking cloud should be renamed cloudkill
  893. Xfireball does 1d6 per level, should destroy all paper/wood and melt metal
  894. Xlightning does 1d6 per level
  895. Xhold monster 1 round per level of caster
  896. Xphase door by touching a wall, and end up on other side of the wall
  897. Xlight spells should be mobile
  898. Xheroism should not work when over level 11, superheroism should not work when
  899. X    over level 14
  900. Xrings can not be used cummulatively, rings or prot have no effect if
  901. X    wearing armor
  902. XFlame Tongue, +3 versus cold creatures and avian, +4 vs undead
  903. XHoly Avenger, +50% on all saving throws
  904. X
  905. END_OF_FILE
  906. if test 37776 -ne `wc -c <'ERRORS'`; then
  907.     echo shar: \"'ERRORS'\" unpacked with wrong size!
  908. fi
  909. # end of 'ERRORS'
  910. fi
  911. if test -f 'source/files.c' -a "${1}" != "-c" ; then 
  912.   echo shar: Will not clobber existing file \"'source/files.c'\"
  913. else
  914. echo shar: Extracting \"'source/files.c'\" \(16041 characters\)
  915. sed "s/^X//" >'source/files.c' <<'END_OF_FILE'
  916. X/* source/files.c: misc code to access files used by Moria
  917. X
  918. X   Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke
  919. X
  920. X   This software may be copied and distributed for educational, research, and
  921. X   not for profit purposes provided that this copyright and statement are
  922. X   included in all such copies. */
  923. X
  924. X#include <stdio.h>
  925. X
  926. X#ifndef STDIO_LOADED
  927. X#define STDIO_LOADED
  928. X#endif
  929. X
  930. X#if 0
  931. X/* moved to externs.h to avoid VMS 'psect' problem */
  932. X#include <errno.h>
  933. X#endif
  934. X
  935. X#ifdef __TURBOC__
  936. X#include    <io.h>
  937. X#include    <stdlib.h>
  938. X#endif /* __TURBOC__ */
  939. X#include "config.h"
  940. X#include "constant.h"
  941. X#include "types.h"
  942. X
  943. X#if defined(GEMDOS) && (__STDC__ == 0) && !defined(ATARIST_TC)
  944. X#include <access.h>
  945. Xchar *strcat();
  946. X#endif
  947. X
  948. X#ifdef VMS
  949. X#include <string.h>
  950. X#include <file.h>
  951. X#else
  952. X#ifdef USG
  953. X#ifndef ATARIST_MWC
  954. X#include <string.h>
  955. X#ifndef ATARIST_TC
  956. X#include <fcntl.h>
  957. X#endif
  958. X#endif
  959. X#else
  960. X#include <strings.h>
  961. X#include <sys/file.h>
  962. X#endif
  963. X#if defined(ultrix) || defined(USG)
  964. Xvoid exit();
  965. X#endif
  966. X#endif
  967. X
  968. X/* This must be included after fcntl.h, which has a prototype for `open'
  969. X   on some systems.  Otherwise, the `open' prototype conflicts with the
  970. X   `topen' declaration.  */
  971. X#include "externs.h"
  972. X
  973. X#ifdef ATARIST_TC
  974. X/* Include this to get prototypes for standard library functions.  */
  975. X#include <stdlib.h>
  976. X#endif
  977. X
  978. X#ifdef MAC
  979. X#include "ScrnMgr.h"
  980. X#define GNRL_ALRT    1024
  981. X#endif
  982. X
  983. X/*
  984. X *  init_scorefile
  985. X *  Open the score file while we still have the setuid privileges.  Later
  986. X *  when the score is being written out, you must be sure to flock the file
  987. X *  so we don't have multiple people trying to write to it at the same time.
  988. X *  Craig Norborg (doc)        Mon Aug 10 16:41:59 EST 1987
  989. X */
  990. Xvoid init_scorefile()
  991. X{
  992. X#ifdef MAC
  993. X  appldirectory ();
  994. X#endif
  995. X
  996. X#if defined(atarist) || defined(ATARI_ST) || defined(MAC)
  997. X  highscore_fp = fopen(MORIA_TOP, "rb+");
  998. X#else
  999. X  highscore_fp = fopen(MORIA_TOP, "r+");
  1000. X#endif
  1001. X
  1002. X  if (highscore_fp == NULL)
  1003. X    {
  1004. X#ifdef MAC
  1005. X      highscore_fp = fopen (MORIA_TOP, "wb");    /* Create it if not there.  */
  1006. X      if (highscore_fp == NULL)
  1007. X    {
  1008. X      ParamText ("\pCan't create score file!", NULL, NULL, NULL);
  1009. X      DoScreenALRT (GNRL_ALRT, akStop, fixHalf, fixThird);
  1010. X      ExitToShell ();
  1011. X    }
  1012. X      setfileinfo (MORIA_TOP, currentdirectory (), SCORE_FTYPE);
  1013. X#else
  1014. X      (void) fprintf (stderr, "Can't open score file \"%s\"\n", MORIA_TOP);
  1015. X      exit(1);
  1016. X#endif
  1017. X    }
  1018. X#if defined(MSDOS) || defined(VMS) || defined(MAC)
  1019. X  /* can't leave it open, since this causes problems on networked PCs and VMS,
  1020. X     we DO want to check to make sure we can open the file, though */
  1021. X  fclose (highscore_fp);
  1022. X#endif
  1023. X
  1024. X#ifdef MAC
  1025. X  restoredirectory ();
  1026. X#endif
  1027. X}
  1028. X
  1029. X#ifndef MAC
  1030. X/* Attempt to open the intro file            -RAK-     */
  1031. X/* This routine also checks the hours file vs. what time it is    -Doc */
  1032. Xvoid read_times()
  1033. X{
  1034. X  vtype in_line;
  1035. X  register int i;
  1036. X  FILE *file1;
  1037. X
  1038. X#ifdef MORIA_HOU
  1039. X  /* Attempt to read hours.dat.     If it does not exist,       */
  1040. X  /* inform the user so he can tell the wizard about it     */
  1041. X  if ((file1 = fopen(MORIA_HOU, "r")) != NULL)
  1042. X    {
  1043. X      while (fgets(in_line, 80, file1) != CNIL)
  1044. X    if (strlen(in_line) > 3)
  1045. X      {
  1046. X        if (!strncmp(in_line, "SUN:", 4))
  1047. X          (void) strcpy(days[0], in_line);
  1048. X        else if (!strncmp(in_line, "MON:", 4))
  1049. X          (void) strcpy(days[1], in_line);
  1050. X        else if (!strncmp(in_line, "TUE:", 4))
  1051. X          (void) strcpy(days[2], in_line);
  1052. X        else if (!strncmp(in_line, "WED:", 4))
  1053. X          (void) strcpy(days[3], in_line);
  1054. X        else if (!strncmp(in_line, "THU:", 4))
  1055. X          (void) strcpy(days[4], in_line);
  1056. X        else if (!strncmp(in_line, "FRI:", 4))
  1057. X          (void) strcpy(days[5], in_line);
  1058. X        else if (!strncmp(in_line, "SAT:", 4))
  1059. X          (void) strcpy(days[6], in_line);
  1060. X      }
  1061. X      (void) fclose(file1);
  1062. X    }
  1063. X  else
  1064. X    {
  1065. X      restore_term();
  1066. X      (void) fprintf(stderr, "There is no hours file \"%s\".\n", MORIA_HOU);
  1067. X      (void) fprintf(stderr, "Please inform the wizard, %s, so he ", WIZARD);
  1068. X      (void) fprintf(stderr, "can correct this!\n");
  1069. X      exit(1);
  1070. X    }
  1071. X
  1072. X  /* Check the hours, if closed    then exit. */
  1073. X  if (!check_time())
  1074. X    {
  1075. X      if ((file1 = fopen(MORIA_HOU, "r")) != NULL)
  1076. X    {
  1077. X      clear_screen();
  1078. X#ifdef VMS
  1079. X      restore_screen();
  1080. X#endif
  1081. X      for (i = 0; fgets(in_line, 80, file1) != CNIL; i++)
  1082. X        put_buffer(in_line, i, 0);
  1083. X      pause_line (23);
  1084. X      (void) fclose(file1);
  1085. X    }
  1086. X      exit_game();
  1087. X    }
  1088. X#endif
  1089. X
  1090. X  /* Print the introduction message, news, etc.         */
  1091. X  if ((file1 = fopen(MORIA_MOR, "r")) != NULL)
  1092. X    {
  1093. X      clear_screen();
  1094. X#ifdef VMS
  1095. X      restore_screen();
  1096. X#endif
  1097. X      for (i = 0; fgets(in_line, 80, file1) != CNIL; i++)
  1098. X    put_buffer(in_line, i, 0);
  1099. X      pause_line(23);
  1100. X      (void) fclose(file1);
  1101. X    }
  1102. X}
  1103. X#endif
  1104. X
  1105. X/* File perusal.        -CJS-
  1106. X   primitive, but portable */
  1107. Xvoid helpfile(filename)
  1108. Xchar *filename;
  1109. X#ifdef MAC
  1110. X{
  1111. X  mac_helpfile(filename, TRUE);
  1112. X}
  1113. X#else
  1114. X{
  1115. X  bigvtype tmp_str;
  1116. X  FILE *file;
  1117. X  char input;
  1118. X  int i;
  1119. X
  1120. X  file = fopen(filename, "r");
  1121. X  if (file == NULL)
  1122. X    {
  1123. X      (void) sprintf (tmp_str, "Can not find help file \"%s\".\n", filename);
  1124. X      prt (tmp_str, 0, 0);
  1125. X      return;
  1126. X    }
  1127. X
  1128. X  save_screen();
  1129. X
  1130. X  while (!feof(file))
  1131. X    {
  1132. X      clear_screen();
  1133. X      for (i = 0; i < 23; i++)
  1134. X    if (fgets (tmp_str, BIGVTYPESIZ-1, file) != CNIL)
  1135. X      put_buffer (tmp_str, i, 0);
  1136. X      prt("[Press any key to continue.]", 23, 23);
  1137. X      input = inkey();
  1138. X      if (input == ESCAPE)
  1139. X    break;
  1140. X    }
  1141. X
  1142. X  (void) fclose(file);
  1143. X  restore_screen();
  1144. X}
  1145. X#endif
  1146. X
  1147. X/* Prints a list of random objects to a file.  Note that -RAK-     */
  1148. X/* the objects produced is a sampling of objects which         */
  1149. X/* be expected to appear on that level.                 */
  1150. Xvoid print_objects()
  1151. X{
  1152. X  register int i;
  1153. X  int nobj, j, level;
  1154. X  vtype filename1; bigvtype tmp_str;
  1155. X  register FILE *file1;
  1156. X  register inven_type *i_ptr;
  1157. X#ifdef MAC
  1158. X  short vrefnum;
  1159. X#endif
  1160. X#ifdef ATARIST_MWC
  1161. X  int32u holder;
  1162. X#endif
  1163. X
  1164. X  prt("Produce objects on what level?: ", 0, 0);
  1165. X  level = 0;
  1166. X  if (!get_string(tmp_str, 0, 32, 10))
  1167. X    return;
  1168. X  level = atoi(tmp_str);
  1169. X  prt("Produce how many objects?: ", 0, 0);
  1170. X  nobj = 0;
  1171. X  if (!get_string(tmp_str, 0, 27, 10))
  1172. X    return;
  1173. X  nobj = atoi(tmp_str);
  1174. X  if ((nobj > 0) && (level > -1) && (level < 1201))
  1175. X    {
  1176. X      if (nobj > 10000)
  1177. X    nobj = 10000;
  1178. X#ifdef MAC
  1179. X      (void) strcpy(filename1, "Objects");
  1180. X      if (doputfile("Save objects in:", filename1, &vrefnum))
  1181. X#else
  1182. X      prt("File name: ", 0, 0);
  1183. X      if (get_string(filename1, 0, 11, 64))
  1184. X#endif
  1185. X    {
  1186. X      if (strlen(filename1) == 0)
  1187. X        return;
  1188. X#ifdef MAC
  1189. X      changedirectory(vrefnum);
  1190. X#endif
  1191. X      if ((file1 = fopen(filename1, "w")) != NULL)
  1192. X        {
  1193. X#ifdef MAC
  1194. X          macbeginwait ();
  1195. X#endif
  1196. X
  1197. X          (void) sprintf(tmp_str, "%d", nobj);
  1198. X          prt(strcat(tmp_str, " random objects being produced..."), 0, 0);
  1199. X          put_qio();
  1200. X          (void) fprintf(file1, "*** Random Object Sampling:\n");
  1201. X          (void) fprintf(file1, "*** %d objects\n", nobj);
  1202. X          (void) fprintf(file1, "*** For Level %d\n", level);
  1203. X          (void) fprintf(file1, "\n");
  1204. X          (void) fprintf(file1, "\n");
  1205. X          j = popt();
  1206. X          for (i = 0; i < nobj; i++)
  1207. X        {
  1208. X          invcopy(&t_list[j], sorted_objects[get_obj_num(level)]);
  1209. X          magic_treasure(j, level);
  1210. X          i_ptr = &t_list[j];
  1211. X          store_bought(i_ptr);
  1212. X#ifdef ATARIST_MWC
  1213. X          if (i_ptr->flags & (holder = TR_CURSED))
  1214. X#else
  1215. X          if (i_ptr->flags & TR_CURSED)
  1216. X#endif
  1217. X            add_inscribe(i_ptr, ID_DAMD);
  1218. X          objdes(tmp_str, i_ptr, TRUE);
  1219. X          (void) fprintf(file1, "%d %s\n", i_ptr->level, tmp_str);
  1220. X        }
  1221. X          pusht((int8u)j);
  1222. X          (void) fclose(file1);
  1223. X#ifdef MAC
  1224. X          setfileinfo(filename1, vrefnum, INFO_FTYPE);
  1225. X          macendwait ();
  1226. X#endif
  1227. X          prt("Completed.", 0, 0);
  1228. X        }
  1229. X      else
  1230. X        prt("File could not be opened.", 0, 0);
  1231. X#ifdef MAC
  1232. X      restoredirectory();
  1233. X#endif
  1234. X    }
  1235. X    }
  1236. X  else
  1237. X    prt ("Parameters no good.", 0, 0);
  1238. X}
  1239. X
  1240. X
  1241. X/* Print the character to a file or device        -RAK-     */
  1242. X#ifdef MAC
  1243. Xint file_character()
  1244. X#else
  1245. Xint file_character(filename1)
  1246. Xchar *filename1;
  1247. X#endif
  1248. X{
  1249. X  register int i;
  1250. X  int j, xbth, xbthb, xfos, xsrh, xstl, xdis, xsave, xdev;
  1251. X  vtype xinfra;
  1252. X  int fd;
  1253. X  register FILE *file1;
  1254. X  bigvtype prt2;
  1255. X  register struct misc *p_ptr;
  1256. X  register inven_type *i_ptr;
  1257. X  vtype out_val, prt1;
  1258. X  char *p, *colon, *blank;
  1259. X#ifdef MAC
  1260. X  vtype filename1;
  1261. X  short vrefnum;
  1262. X#endif
  1263. X
  1264. X#ifdef MAC
  1265. X  (void) makefilename(filename1, "Stats", TRUE);
  1266. X  if (!doputfile("Save character description in:", filename1, &vrefnum))
  1267. X    return (FALSE);
  1268. X#endif
  1269. X
  1270. X#ifndef VMS
  1271. X  /* VMS creates a new version of a file, so no need to check for rewrite. */
  1272. X#ifdef MAC
  1273. X  changedirectory(vrefnum);
  1274. X  fd = open (filename1, O_WRONLY|O_CREAT|O_TRUNC);
  1275. X  restoredirectory();
  1276. X  macbeginwait ();
  1277. X#else
  1278. X#if defined(GEMDOS) && (__STDC__ == 0) && !defined(ATARIST_TC)
  1279. X  if (!access(filename1, AREAD))
  1280. X    {
  1281. X      (void) sprintf(out_val, "Replace existing file %s?", filename1);
  1282. X      if (get_check(out_val))
  1283. X    fd = creat(filename1, 1);
  1284. X    }
  1285. X  else
  1286. X    fd = creat (filename1, 1);
  1287. X#else
  1288. X  fd = open (filename1, O_WRONLY|O_CREAT|O_EXCL, 0644);
  1289. X  if (fd < 0 && errno == EEXIST)
  1290. X    {
  1291. X      (void) sprintf(out_val, "Replace existing file %s?", filename1);
  1292. X      if (get_check(out_val))
  1293. X    fd = open(filename1, O_WRONLY, 0644);
  1294. X    }
  1295. X#endif
  1296. X#endif
  1297. X  if (fd >= 0)
  1298. X    {
  1299. X      /* on some non-unix machines, fdopen() is not reliable, hence must call
  1300. X     close() and then fopen() */
  1301. X      (void) close(fd);
  1302. X      file1 = fopen(filename1, "w");
  1303. X    }
  1304. X  else
  1305. X    file1 = NULL;
  1306. X#else /* VMS */
  1307. X  fd = -1;
  1308. X  file1 = fopen (filename1, "w");
  1309. X#endif
  1310. X
  1311. X  if (file1 != NULL)
  1312. X    {
  1313. X      prt("Writing character sheet...", 0, 0);
  1314. X      put_qio();
  1315. X      colon = ":";
  1316. X      blank = " ";
  1317. X#ifdef MAC
  1318. X      (void) fprintf(file1, "\n\n");
  1319. X#else
  1320. X      (void) fprintf(file1, "%c\n\n", CTRL('L'));
  1321. X#endif
  1322. X      (void) fprintf(file1, " Name%9s %-23s", colon, py.misc.name);
  1323. X      (void) fprintf(file1, " Age%11s %6d", colon, (int)py.misc.age);
  1324. X      cnv_stat(py.stats.use_stat[A_STR], prt1);
  1325. X      (void) fprintf(file1, "   STR : %s\n", prt1);
  1326. X      (void) fprintf(file1, " Race%9s %-23s", colon,
  1327. X             race[py.misc.prace].trace);
  1328. X      (void) fprintf(file1, " Height%8s %6d", colon, (int)py.misc.ht);
  1329. X      cnv_stat(py.stats.use_stat[A_INT], prt1);
  1330. X      (void) fprintf(file1, "   INT : %s\n", prt1);
  1331. X      (void) fprintf(file1, " Sex%10s %-23s", colon,
  1332. X             (py.misc.male ? "Male" : "Female"));
  1333. X      (void) fprintf(file1, " Weight%8s %6d", colon, (int)py.misc.wt);
  1334. X      cnv_stat(py.stats.use_stat[A_WIS], prt1);
  1335. X      (void) fprintf(file1, "   WIS : %s\n", prt1);
  1336. X      (void) fprintf(file1, " Class%8s %-23s", colon,
  1337. X             class[py.misc.pclass].title);
  1338. X      (void) fprintf(file1, " Social Class : %6d", py.misc.sc);
  1339. X      cnv_stat(py.stats.use_stat[A_DEX], prt1);
  1340. X      (void) fprintf(file1, "   DEX : %s\n", prt1);
  1341. X      (void) fprintf(file1, " Title%8s %-23s", colon, title_string());
  1342. X      (void) fprintf(file1, "%22s", blank);
  1343. X      cnv_stat(py.stats.use_stat[A_CON], prt1);
  1344. X      (void) fprintf(file1, "   CON : %s\n", prt1);
  1345. X      (void) fprintf(file1, "%34s", blank);
  1346. X      (void) fprintf(file1, "%26s", blank);
  1347. X      cnv_stat(py.stats.use_stat[A_CHR], prt1);
  1348. X      (void) fprintf(file1, "   CHR : %s\n\n", prt1);
  1349. X
  1350. X      (void) fprintf(file1, " + To Hit    : %6d", py.misc.dis_th);
  1351. X      (void) fprintf(file1, "%8sLevel      : %6d", blank, (int)py.misc.lev);
  1352. X      (void) fprintf(file1, "    Max Hit Points : %6d\n", py.misc.mhp);
  1353. X      (void) fprintf(file1, " + To Damage : %6d", py.misc.dis_td);
  1354. X      (void) fprintf(file1, "%8sExperience : %6ld", blank, py.misc.exp);
  1355. X      (void) fprintf(file1, "    Cur Hit Points : %6d\n", py.misc.chp);
  1356. X      (void) fprintf(file1, " + To AC     : %6d", py.misc.dis_tac);
  1357. X      (void) fprintf(file1, "%8sMax Exp    : %6ld", blank, py.misc.max_exp);
  1358. X      (void) fprintf(file1, "    Max Mana%8s %6d\n", colon, py.misc.mana);
  1359. X      (void) fprintf(file1, "   Total AC  : %6d", py.misc.dis_ac);
  1360. X      if (py.misc.lev == MAX_PLAYER_LEVEL)
  1361. X    (void) fprintf (file1, "%8sExp to Adv : ******", blank);
  1362. X      else
  1363. X    (void) fprintf(file1, "%8sExp to Adv : %6ld", blank,
  1364. X               (int32)(player_exp[py.misc.lev-1]
  1365. X                   * py.misc.expfact / 100));
  1366. X      (void) fprintf(file1, "    Cur Mana%8s %6d\n", colon, py.misc.cmana);
  1367. X      (void) fprintf(file1, "%29sGold%8s %6ld\n\n", blank, colon,
  1368. X             py.misc.au);
  1369. X
  1370. X      p_ptr = &py.misc;
  1371. X      xbth = p_ptr->bth + p_ptr->ptohit * BTH_PLUS_ADJ
  1372. X    + (class_level_adj[p_ptr->pclass][CLA_BTH] * p_ptr->lev);
  1373. X      xbthb = p_ptr->bthb + p_ptr->ptohit * BTH_PLUS_ADJ
  1374. X    + (class_level_adj[p_ptr->pclass][CLA_BTHB] * p_ptr->lev);
  1375. X      /* this results in a range from 0 to 29 */
  1376. X      xfos = 40 - p_ptr->fos;
  1377. X      if (xfos < 0)
  1378. X    xfos = 0;
  1379. X      xsrh = p_ptr->srh;
  1380. X      /* this results in a range from 0 to 9 */
  1381. X      xstl = p_ptr->stl + 1;
  1382. X      xdis = p_ptr->disarm + 2 * todis_adj() + stat_adj(A_INT)
  1383. X    + (class_level_adj[p_ptr->pclass][CLA_DISARM] * p_ptr->lev / 3);
  1384. X      xsave = p_ptr->save + stat_adj(A_WIS)
  1385. X    + (class_level_adj[p_ptr->pclass][CLA_SAVE] * p_ptr->lev / 3);
  1386. X      xdev = p_ptr->save + stat_adj(A_INT)
  1387. X    + (class_level_adj[p_ptr->pclass][CLA_DEVICE] * p_ptr->lev / 3);
  1388. X
  1389. X      (void) sprintf(xinfra, "%d feet", py.flags.see_infra * 10);
  1390. X
  1391. X      (void) fprintf(file1, "(Miscellaneous Abilities)\n\n");
  1392. X      (void) fprintf(file1, " Fighting    : %-10s", likert(xbth, 12));
  1393. X      (void) fprintf(file1, "   Stealth     : %-10s", likert(xstl, 1));
  1394. X      (void) fprintf(file1, "   Perception  : %s\n", likert(xfos, 3));
  1395. X      (void) fprintf(file1, " Bows/Throw  : %-10s", likert(xbthb, 12));
  1396. X      (void) fprintf(file1, "   Disarming   : %-10s", likert(xdis, 8));
  1397. X      (void) fprintf(file1, "   Searching   : %s\n", likert(xsrh, 6));
  1398. X      (void) fprintf(file1, " Saving Throw: %-10s", likert(xsave, 6));
  1399. X      (void) fprintf(file1, "   Magic Device: %-10s", likert(xdev, 6));
  1400. X      (void) fprintf(file1, "   Infra-Vision: %s\n\n", xinfra);
  1401. X      /* Write out the character's history     */
  1402. X      (void) fprintf(file1, "Character Background\n");
  1403. X      for (i = 0; i < 4; i++)
  1404. X    (void) fprintf(file1, " %s\n", py.misc.history[i]);
  1405. X      /* Write out the equipment list.         */
  1406. X      j = 0;
  1407. X      (void) fprintf(file1, "\n  [Character's Equipment List]\n\n");
  1408. X      if (equip_ctr == 0)
  1409. X    (void) fprintf(file1, "  Character has no equipment in use.\n");
  1410. X      else
  1411. X    for (i = INVEN_WIELD; i < INVEN_ARRAY_SIZE; i++)
  1412. X      {
  1413. X        i_ptr = &inventory[i];
  1414. X        if (i_ptr->tval != TV_NOTHING)
  1415. X          {
  1416. X        switch (i)
  1417. X          {
  1418. X          case INVEN_WIELD:    p = "You are wielding";    break;
  1419. X          case INVEN_HEAD:    p = "Worn on head";    break;
  1420. X          case INVEN_NECK:    p = "Worn around neck";    break;
  1421. X          case INVEN_BODY:    p = "Worn on body";    break;
  1422. X          case INVEN_ARM:    p = "Worn on shield arm";break;
  1423. X          case INVEN_HANDS:    p = "Worn on hands";    break;
  1424. X          case INVEN_RIGHT:    p = "Right ring finger";break;
  1425. X          case INVEN_LEFT:    p = "Left  ring finger";break;
  1426. X          case INVEN_FEET:    p = "Worn on feet";    break;
  1427. X          case INVEN_OUTER:    p = "Worn about body";    break;
  1428. X          case INVEN_LIGHT:    p = "Light source is";    break;
  1429. X          case INVEN_AUX:    p = "Secondary weapon";    break;
  1430. X          default: p = "*Unknown value*";     break;
  1431. X          }
  1432. X        objdes(prt2, &inventory[i], TRUE);
  1433. X        (void) fprintf(file1, "  %c) %-19s: %s\n", j+'a', p, prt2);
  1434. X        j++;
  1435. X          }
  1436. X      }
  1437. X
  1438. X      /* Write out the character's inventory.         */
  1439. X#ifdef MAC
  1440. X      (void) fprintf(file1, "\n\n");
  1441. X#else
  1442. X      (void) fprintf(file1, "%c\n\n", CTRL('L'));
  1443. X#endif
  1444. X      (void) fprintf(file1, "  [General Inventory List]\n\n");
  1445. X      if (inven_ctr == 0)
  1446. X    (void) fprintf(file1, "  Character has no objects in inventory.\n");
  1447. X      else
  1448. X    {
  1449. X      for (i = 0; i < inven_ctr; i++)
  1450. X        {
  1451. X          objdes(prt2, &inventory[i], TRUE);
  1452. X          (void) fprintf(file1, "%c) %s\n", i+'a', prt2);
  1453. X        }
  1454. X    }
  1455. X#ifndef MAC
  1456. X      (void) fprintf(file1, "%c", CTRL('L'));
  1457. X#endif
  1458. X      (void) fclose(file1);
  1459. X#ifdef MAC
  1460. X      setfileinfo(filename1, vrefnum, INFO_FTYPE);
  1461. X      macendwait ();
  1462. X#endif
  1463. X      prt("Completed.", 0, 0);
  1464. X      return TRUE;
  1465. X    }
  1466. X  else
  1467. X    {
  1468. X      if (fd >= 0)
  1469. X    (void) close (fd);
  1470. X      (void) sprintf (out_val, "Can't open file %s:", filename1);
  1471. X      msg_print(out_val);
  1472. X      return FALSE;
  1473. X    }
  1474. X}
  1475. END_OF_FILE
  1476. if test 16041 -ne `wc -c <'source/files.c'`; then
  1477.     echo shar: \"'source/files.c'\" unpacked with wrong size!
  1478. fi
  1479. # end of 'source/files.c'
  1480. fi
  1481. echo shar: End of archive 12 \(of 39\).
  1482. cp /dev/null ark12isdone
  1483. MISSING=""
  1484. 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
  1485.     if test ! -f ark${I}isdone ; then
  1486.     MISSING="${MISSING} ${I}"
  1487.     fi
  1488. done
  1489. if test "${MISSING}" = "" ; then
  1490.     echo You have unpacked all 39 archives.
  1491.     echo "Now run "bldfiles.sh" to build split files"
  1492.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1493. else
  1494.     echo You still need to unpack the following archives:
  1495.     echo "        " ${MISSING}
  1496. fi
  1497. ##  End of shell archive.
  1498. exit 0
  1499.