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

  1. Path: uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v14i067:  umoria4 - single player dungeon simulation (ver. 5.5), Part35/39
  5. Message-ID: <3431@master.CNA.TEK.COM>
  6. Date: 22 Aug 92 22:15:28 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 1707
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: grabiner@math.harvard.edu (David Grabiner)
  12. Posting-number: Volume 14, Issue 67
  13. Archive-name: umoria4/Part35
  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 35 (of 39)."
  26. # Contents:  atari_st/curscomp/curses.h doc/exp.doc mac/Install.hqx
  27. #   mac/dumpres/DumpRes.c mac/machelp.c misc/moria.msg source/help.c
  28. #   util/printit/pr_items.c util/weapons/calchits.c
  29. # Wrapped by billr@saab on Thu Aug 20 09:11:35 1992
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'atari_st/curscomp/curses.h' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'atari_st/curscomp/curses.h'\"
  33. else
  34. echo shar: Extracting \"'atari_st/curscomp/curses.h'\" \(6490 characters\)
  35. sed "s/^X//" >'atari_st/curscomp/curses.h' <<'END_OF_FILE'
  36. X/****************************************************************************/
  37. X/*                                                                          */
  38. X/*   CURSES.H                      include file for programs using CURSES   */
  39. X/*                                                                          */
  40. X/****************************************************************************/
  41. X/*                                                                          */
  42. X/* This source and resulting object may be modified, used or distributed by */
  43. X/* anyone who so desires under the following conditions :                   */
  44. X/*                                                                          */
  45. X/*  1) This notice and the copyright notice shall not be removed or         */
  46. X/*     changed.                                                             */
  47. X/*  2) No credit shall be taken for this source and resulting objects       */
  48. X/*  3) This source or resulting objects is not to be traded, sold or        */
  49. X/*     used for personal gain or profit.                                    */
  50. X/*  4) Inclusion of this source or resulting objects in commercially        */
  51. X/*     available packages is forbidden without written consent of the       */
  52. X/*     author of this source.                                               */
  53. X/*                                                                          */
  54. X/****************************************************************************/
  55. X
  56. X#include "stdio.h"
  57. X
  58. Xtypedef unsigned char bool;
  59. Xtypedef short         int16;
  60. Xtypedef long          int32;
  61. X
  62. X#define OK          1
  63. X#define ERR         0
  64. X#define TRUE        1
  65. X#define FALSE       0
  66. X#define _SUBWIN     01
  67. X#define _ENDLINE    02
  68. X#define _FULLWIN    04
  69. X#define _SCROLLWIN  010
  70. X#define _STANDOUT   0200
  71. X#define WINDOW      struct _win_st
  72. X
  73. X#define TOUCHED     0x0200
  74. X#define STANDOUT    0x0100
  75. X
  76. X/* prototypes of functions in curses.c */
  77. XWINDOW *initscr ( void );
  78. Xvoid endwin ( void );
  79. XWINDOW *newwin ( int l , int c , int by , int bx );
  80. Xvoid delwin ( WINDOW *w );
  81. Xint mvwin ( WINDOW *w , int y , int x );
  82. Xvoid touchwin ( WINDOW *w );
  83. XWINDOW *subwin ( WINDOW *w , int l , int c , int by , int bx );
  84. Xvoid leaveok ( WINDOW *w , bool f );
  85. Xvoid scrollok ( WINDOW *w , bool f );
  86. Xvoid nl ( void );
  87. Xvoid nonl ( void );
  88. Xvoid longname ( char *termbuf , char *name );
  89. Xint  waddch ( WINDOW *w , char c );
  90. Xint  waddstr ( WINDOW *w , char *s );
  91. Xvoid box ( WINDOW *w , char v , char h );
  92. Xvoid wclear ( WINDOW *w );
  93. Xvoid wclrtobot ( WINDOW *w );
  94. Xvoid wclrtoeol ( WINDOW *w );
  95. Xint  wdelch ( WINDOW *w );
  96. Xint  wdeleteln ( WINDOW *w );
  97. Xvoid werase ( WINDOW *w );
  98. Xint  winsch ( WINDOW *w , char c );
  99. Xvoid winsertln ( WINDOW *w );
  100. Xint  wmove ( WINDOW *w , int y , int x );
  101. Xvoid overlay ( WINDOW *v , WINDOW *w );
  102. Xvoid overwrite ( WINDOW *v , WINDOW *w );
  103. Xvoid wstandout ( WINDOW *w );
  104. Xvoid wstandend ( WINDOW *w );
  105. Xvoid raw ( void );
  106. Xvoid noraw ( void );
  107. Xvoid crmode ( void );
  108. Xvoid nocrmode ( void );
  109. Xvoid echo ( void );
  110. Xvoid noecho ( void );
  111. Xlong wgetch ( WINDOW *w );
  112. Xint  wgetstr ( WINDOW *w , char *s );
  113. Xvoid wrefresh ( WINDOW *w );
  114. Xvoid mvcur ( int ly , int lx , int ny , int nx );
  115. Xvoid _movcur ( int16 y , int16 x );
  116. Xint  scroll ( WINDOW *w );
  117. X/* end of prototypes for curses.c */
  118. X
  119. X#define addch(c)            waddch(stdscr, c)
  120. X#if 0
  121. X/* The original code, does not return error codes properly.  */
  122. X#define mvaddch(y,x,c)      { wmove(stdscr,y,x) ; waddch(stdscr,c) ; }
  123. X#define mvwaddch(w,y,x,c)   { wmove(w,y,x) ; waddch(w,c) ; }
  124. X#else
  125. X#define mvaddch(y,x,c)      (wmove(stdscr,y,x) == ERR ? ERR : waddch(stdscr,c))
  126. X#define mvwaddch(w,y,x,c)   (wmove(w,y,x) == ERR ? ERR : waddch(w,c))
  127. X#endif
  128. X#define addstr(s)           waddstr(stdscr,s)
  129. X#if 0
  130. X/* The original code, does not return error codes properly.  */
  131. X#define mvaddstr(y,x,s)     { wmove(stdscr,y,x) ; waddstr(stdscr,s) ; }
  132. X#define mvwaddstr(w,y,x,s)  { wmove(w,y,x) ; waddstr(w,s) ; }
  133. X#else
  134. X#define mvaddstr(y,x,s)     (wmove(stdscr,y,x) == ERR ? ERR :waddstr(stdscr,s))
  135. X#define mvwaddstr(w,y,x,s)  (wmove(w,y,x) == ERR ? ERR : waddstr(w,s))
  136. X#endif
  137. X#define clear()             wclear(stdscr)
  138. X#define clearok(w,f)        { w->_clear = (w->_flags & _FULLWIN) ? f : \
  139. X                              w->_clear ; }
  140. X#define clrtobot()          wclrtobot(stdscr)
  141. X#define clrtoeol()          wclrtoeol(stdscr)
  142. X#define delch()             wdelch(stdscr)
  143. X#define mvdelch(y,x)        { wmove(stdscr,y,x) ; wdelch(stdscr) ; }
  144. X#define mvwdelch(w,y,x)     { wmove(w,y,x) ; wdelch(w) ; }
  145. X#define deleteln()          wdeleteln(stdscr)
  146. X#define mvdeleteln(y,x)     { wmove(stdscr,y,x) ; wdeleteln(stdscr) ; }
  147. X#define mvwdeleteln(w,y,x)  { wmove(w,y,x) ; wdeleteln(w) ; }
  148. X#define erase()             werase(stdscr)
  149. X#define insch(c)            winsch(stdscr,c)
  150. X#define mvinsch(y,x,c)      { wmove(stdscr,y,x) ; winsch(stdscr,c) ; }
  151. X#define mvwinsch(w,y,x,c)   { wmove(w,y,x) ; winsch(w,c) ; }
  152. X#define insertln()          winsertln(stdscr)
  153. X#define mvinsertln(y,x)     { wmove(stdscr,y,x) ; winsertln(stdscr) ; }
  154. X#define mvwinsertln(w,y,x)  { wmove(w,y,x) ; winsertln(w) ; }
  155. X#define move(y,x)           wmove(stdscr,y,x)
  156. X#define refresh()           wrefresh(stdscr)
  157. X#define standout()          wstandout(stdscr)
  158. X#define standend()          wstandend(stdscr)
  159. X#define getch()             wgetch(stdscr)
  160. X#define mvgetch(y,x)        ( wmove(stdscr,y,x) , wgetch(stdscr) )
  161. X#define mvwgetch(w,y,x)     ( wmove(w,y,x) , wgetch(w) )
  162. X#define getstr(s)           wgetstr(stdscr,s)
  163. X#define mvgetstr(y,x,s)     { wmove(stdscr,y,x) ; wgetstr(stdscr,s) ; }
  164. X#define mvwgetstr(w,y,x,s)  { wmove(w,y,x) ; wgetstr(w,s) ; }
  165. X#define getyx(w,y,x)        { y = w->_cury ; x = w->_curx ; }
  166. X#define inch()              ( stdscr->_y[stdscr->_cury][stdscr->_curx])
  167. X#define mvinch(y,x)         ( wmove(stdscr,y,x) , \
  168. X                              stdscr->_y[stdscr->_cury][stdscr->_curx])
  169. X#define mvwinch(w,y,x)      ( wmove(w,y,x) , w4->_y[w->_cury][w->_curx])
  170. X#define winch(w)            (w->_y[w->_cury][w->_curx])
  171. X
  172. Xstruct _win_st 
  173. X{
  174. X  int16 _cury, _curx ;
  175. X  int16 _maxy, _maxx ;
  176. X  int16 _begy, _begx ;
  177. X  int16 _flags ;
  178. X  bool  _clear ;
  179. X  bool  _leave ;
  180. X  bool  _scroll ;
  181. X  int16 **_y ;
  182. X  int16 *_firstch ;
  183. X  int16 *_lastch ;
  184. X  int16 *_yend;
  185. X};
  186. X
  187. Xextern WINDOW *curscr;
  188. Xextern WINDOW *stdscr;
  189. Xextern char   *Def_term;
  190. Xextern bool   My_term;
  191. Xextern char   *ttytype;
  192. Xextern int    LINES;
  193. Xextern int    COLS;
  194. X/****************END OF SOURCE CURSES.H************************************/
  195. END_OF_FILE
  196. if test 6490 -ne `wc -c <'atari_st/curscomp/curses.h'`; then
  197.     echo shar: \"'atari_st/curscomp/curses.h'\" unpacked with wrong size!
  198. fi
  199. # end of 'atari_st/curscomp/curses.h'
  200. fi
  201. if test -f 'doc/exp.doc' -a "${1}" != "-c" ; then 
  202.   echo shar: Will not clobber existing file \"'doc/exp.doc'\"
  203. else
  204. echo shar: Extracting \"'doc/exp.doc'\" \(6074 characters\)
  205. sed "s/^X//" >'doc/exp.doc' <<'END_OF_FILE'
  206. XAddendum to the Moria manual
  207. X
  208. XProposed Contribution.  Written by Mike Marcelais
  209. X                                   North Carolina School of
  210. X                                         Science And Math
  211. X                                   mrm@odin.ncssm.edu
  212. X                                   games@odin.ncssm.edu
  213. X
  214. X1.  Experience
  215. X
  216. XAll characters receive experience during the game.  Experience
  217. Xdetermines your level, which determines hit points, mana points,
  218. Xspells, abilities, etc.  The amount of experience required to 
  219. Xadvance a level is a base value (shown below) plus a penalty
  220. Xfor race and class.
  221. X
  222. X1.1  Calculating Experience Levels
  223. X
  224. XBase Experience
  225. X
  226. XLv   Exp to Adv     Lv   Exp to Adv     Lv   Exp to Adv
  227. X 1      10          14    1,400         27      35,000
  228. X 2      25          15    1,800         28      50,000
  229. X 3      45          16    2,300         29      75,000
  230. X 4      70          17    2,900         30     100,000
  231. X 5     100          18    3,600         31     150,000
  232. X 6     140          19    4,400         32     200,000
  233. X 7     200          20    5,400         33     300,000
  234. X 8     280          21    6,800         34     400,000
  235. X 9     380          22    8,400         35     500,000
  236. X10     500          23   10,200         36     750,000
  237. X11     650          24   12,500         37   1,500,000
  238. X12     850          25   17,500         38   2,500,000
  239. X13   1,100          26   25,000         39   5,000,000
  240. X
  241. XMaximum level is 40 and maximum experience is 9,999,999
  242. X
  243. XThere are percent penalties for various races and classes to
  244. Xhelp even them out.  The table below lists all the penalties.
  245. X
  246. X      Human       0%     Warrior    0%
  247. X      Half-Elf   10%     Mage      30%
  248. X      Elf        20%     Priest    20%
  249. X      Halfling   10%     Rogue      0%
  250. X      Gnome      25%     Ranger    40%
  251. X      Dwarf      20%     Paladin   35%
  252. X      Half-Orc   10%
  253. X      Half-Troll 20%
  254. X
  255. XFor example:  For a 10'th level Gnomish Mage to achieve 11'th level
  256. Xneeds:
  257. X           500 *  1.25 * 1.30 = 812.5
  258. X         (base) (gnome) (mage)
  259. X
  260. XNote:  Even for the worst case (Gnomish Ranger) it is still possible
  261. Xto achieve the 40th level.  (5,000,000*1.25*1.40=8,750,000 experience)
  262. X
  263. XThe program internally keeps experience out to the fourth decimal place
  264. Xeven though it only displays the integer portion on the screen.
  265. X
  266. X1.2  Getting Experience
  267. X
  268. XThere are many ways to gain experience.  This list shows a few.
  269. X
  270. X1.  Defeating monsters
  271. X2.  Disarming traps
  272. X3.  Picking locks
  273. X4.  Using a scroll, potion, staff, wand, or rod for the first time
  274. X      and discovering what it did.
  275. X5.  Casting a spell successfully for the first time.
  276. X6.  Drinking a potion of gain experience or gain level
  277. X
  278. X1.3  Titles
  279. X
  280. XEach experience level has a title which is displayed under your name
  281. Xand class.  Below is a listing of all the titles for each level and
  282. Xclass.
  283. X
  284. X   Warrior      Mage         Priest       Rogue        Ranger       Paladin
  285. X 1 Rookie       Novice       Believer     Vagabond     Runner(1st)  Gallant
  286. X 2 Private      Apprentice   Acolyte(1st) Footpad      Runner(2nd)  Keeper(1st)
  287. X 3 Soldier      Trickster-1  Acolyte(2nd) Cutpurse     Runner(3rd)  Keeper(2nd)
  288. X 4 Mercenary    Trickster-2  Acolyte(3rd) Robber       Strider(1st) Keeper(3rd)
  289. X 5 Veteran(1st) Trickster-3  Adept(1st)   Burglar      Strider(2nd) Keeper(4th)
  290. X 6 Veteran(2nd) Cabalist-1   Adept(2nd)   Filcher      Strider(3rd) Keeper(5th)
  291. X 7 Veteran(3rd) Cabalist-2   Adept(3rd)   Sharper      Scout(1st)   Keeper(6th)
  292. X 8 Warrior(1st) Cabalist-3   Priest(1st)  Magsman      Scout(2nd)   Keeper(7th)
  293. X 9 Warrior(2nd) Visionist    Priest(2nd)  Common Rogue Scout(3rd)   Keeper(8th)
  294. X10 Warrior(3rd) Phantasmist  Priest(3rd)  Rogue(1st)   Scout(4th)   Keeper(9th)
  295. X11 Warrior(4th) Shadowist    Priest(4th)  Rogue(2nd)   Scout(5th)   Protector-1
  296. X12 Swordsman-1  Spellbinder  Priest(5th)  Rogue(3rd)   Courser(1st) Protector-2
  297. X13 Swordsman-2  Illusionist  Priest(6th)  Rogue(4th)   Courser(2nd) Protector-3
  298. X14 Swordsman-3  Evoker(1st)  Priest(7th)  Rogue(5th)   Courser(3rd) Protector-4
  299. X15 Hero         Evoker(2nd)  Priest(8th)  Rogue(6th)   Courser(4th) Protector-5
  300. X16 Swashbuckler Evoker(3rd)  Priest(9th)  Rogue(7th)   Courser(5th) Protector-6
  301. X17 Myrmidon     Evoker(4th)  Curate(1st)  Rogue(8th)   Tracker(1st) Protector-7
  302. X18 Champion-1   Conjurer     Curate(2nd)  Rogue(9th)   Tracker(2nd) Protector-8
  303. X19 Champion-2   Theurgist    Curate(3rd)  Master Rogue Tracker(3rd) Defender-1
  304. X20 Champion-3   Thaumaturge  Curate(4th)  Expert Rogue Tracker(4th) Defender-2
  305. X21 Superhero    Magician     Curate(5th)  Senior Rogue Tracker(5th) Defender-3
  306. X22 Knight       Enchanter    Curate(6th)  Chief Rogue  Tracker(6th) Defender-4
  307. X23 Superior Knt Warlock      Curate(7th)  Prime Rogue  Tracker(7th) Defender-5
  308. X24 Gallant Knt Sorcerer     Curate(8th)  Low Thief    Tracker(8th) Defender-6
  309. X25 Knt Errant   Necromancer  Curate(9th)  Thief(1st)   Tracker(9th) Defender-7
  310. X26 Guardian Knt Mage(1st)    Canon(1st)   Thief(2nd)   Guide(1st)   Defender-8
  311. X27 Baron        Mage(2nd)    Canon(2nd)   Thief(3rd)   Guide(2nd)   Warder(1st)
  312. X28 Duke         Mage(3rd)    Canon(3rd)   Thief(4th)   Guide(3rd)   Warder(2nd)
  313. X29 Lord(1st)    Mage(4th)    Canon(4th)   Thief(5th)   Guide(4th)   Warder(3rd)
  314. X30 Lord(2nd)    Mage(5th)    Canon(5th)   Thief(6th)   Guide(5th)   Warder(4th)
  315. X31 Lord(3rd)    Wizard(1st)  Low Lama     Thief(7th)   Guide(6th)   Warder(5th)
  316. X32 Lord(4th)    Wizard(2nd)  Lama-1       Thief(8th)   Guide(7th)   Warder(6th)
  317. X33 Lord(5th)    Wizard(3rd)  Lama-2       Thief(9th)   Guide(8th)   Warder(7th)
  318. X34 Lord(6th)    Wizard(4th)  Lama-3       High Thief   Guide(9th)   Warder(8th)
  319. X35 Lord(7th)    Wizard(5th)  High Lama    Master Thief Pathfinder-1 Warder(9th)
  320. X36 Lord(8th)    Wizard(6th)  Great Lama   Executioner  Pathfinder-2 Guardian
  321. X37 Lord(9th)    Wizard(7th)  Patriarch    Low Assassin Pathfinder-3 Chevalier
  322. X38 Lord Gallant Wizard(8th)  High Priest  Assassin     Ranger       Justiciar
  323. X39 Lord Keeper  Wizard(9th)  Great Priest High AssassinHigh Ranger  Paladin
  324. X40 Lord Noble   Wizard Lord  Noble Priest Guildmaster  Ranger Lord  High Lord
  325. END_OF_FILE
  326. if test 6074 -ne `wc -c <'doc/exp.doc'`; then
  327.     echo shar: \"'doc/exp.doc'\" unpacked with wrong size!
  328. fi
  329. # end of 'doc/exp.doc'
  330. fi
  331. if test -f 'mac/Install.hqx' -a "${1}" != "-c" ; then 
  332.   echo shar: Will not clobber existing file \"'mac/Install.hqx'\"
  333. else
  334. echo shar: Extracting \"'mac/Install.hqx'\" \(4447 characters\)
  335. sed "s/^X//" >'mac/Install.hqx' <<'END_OF_FILE'
  336. X(This file must be converted with BinHex 4.0)
  337. X:"dPZFh4KE'`!9%9B9%e38b!"!!!!#a%!!!&q)bdM#8PZGQpMBA4TEfik#3P*ER0
  338. XdB@aX)'4TFh4bD@*eG'P[EN4TFQ9MG'pbH5"LG@PXC%4TFQ9MG'pbH3dM$5-*9'K
  339. XTFb"cBh*TF(3JFQ9QEh*YBA4c)'&XE#"QD@aPFb"bC@0PDACPC#"KFb"`BA*d)'p
  340. XQ)(4SC5"cEh9bBf8JC'PcG(*TBR9dD@pZ$5-*CQpb)%e[FQPK,L!J5A3JG'KPEL"
  341. XYEhCPFb"[EQaj)(4SC5"QD@aPFb"ZC@0PFh0KFRNJCQpb)'*eD@aND@jR)(4SC5"
  342. XRB@eP)'PZG'm0)`PK)'*eD@aN)'4TFQ9MG'pbH5!SF'pcFfPLE(NJBh*PBA4TEQF
  343. XJDA3T,JdM$5-*9d&56NP14cS*9'KTFb"cBh*TF(3JFh9QCQ9bFb"QFQpY)'%JEQ&
  344. XcG(NJCQpbE5"[CL"cC@aQ,A*PCQ9bC@jMC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fk)0eV!!!!!!!!!!!!!!"fi"!!!!!3!!!!&-!!!!6!!!!$)!(X5
  404. Xd"lJ!!!!F!$)!!%e38e)!!!!+!qhrr`!!!!!!(mH%TZN:
  405. END_OF_FILE
  406. if test 4447 -ne `wc -c <'mac/Install.hqx'`; then
  407.     echo shar: \"'mac/Install.hqx'\" unpacked with wrong size!
  408. fi
  409. # end of 'mac/Install.hqx'
  410. fi
  411. if test -f 'mac/dumpres/DumpRes.c' -a "${1}" != "-c" ; then 
  412.   echo shar: Will not clobber existing file \"'mac/dumpres/DumpRes.c'\"
  413. else
  414. echo shar: Extracting \"'mac/dumpres/DumpRes.c'\" \(5368 characters\)
  415. sed "s/^X//" >'mac/dumpres/DumpRes.c' <<'END_OF_FILE'
  416. X/* mac/dumpres/DumpRes.c: convert C data to resources and dump to file
  417. X
  418. X   Copyright (c) 1989-1991 Curtis McCauley, James E. Wilson
  419. X
  420. X   This software may be copied and distributed for educational, research, and
  421. X   not for profit purposes provided that this copyright and statement are
  422. X   included in all such copies. */
  423. X
  424. X#include <StdIO.h>
  425. X#include <String.h>
  426. X#ifndef THINK_C
  427. X#include <Strings.h>
  428. X#endif
  429. X#include <SetJmp.h>
  430. X
  431. X#ifndef THINK_C
  432. X#include <Types.h>
  433. X#include <Memory.h>
  434. X#include <OSUtils.h>
  435. X#include <Resources.h>
  436. X#include <Files.h>
  437. X#endif
  438. X
  439. X#include "DumpRes.h"
  440. X
  441. X#ifdef THINK_C
  442. X#define p2cstr(x)    (char *)PtoCstr((char *)x)
  443. X#define c2pstr(x)    (char *)CtoPstr((char *)x)
  444. X#endif
  445. X
  446. X#define rsrcCreator                    'RSED'
  447. X#define rsrcType                    'rsrc'
  448. X
  449. X#define strType                        'STR#'
  450. X
  451. X#define errDataHandle                1
  452. X#define errStrHandle                2
  453. X#define errStrLen                    3
  454. X#define errOpenResFile                4
  455. X#define errAddData                    5
  456. X#define errAddStr                    6
  457. X#define errCloseResFile                7
  458. X
  459. Xstatic char *errtab[7] = {
  460. X    "Unable to move data into handle",
  461. X    "Unable to allocate string handle",
  462. X    "String too long",
  463. X    "Failure opening resource file",
  464. X    "Failure adding data resource",
  465. X    "Failure adding string resource",
  466. X    "Failure closing resource file"
  467. X};
  468. X
  469. Xstatic jmp_buf abort;
  470. X
  471. Xstatic unsigned long strLen;
  472. Xstatic short strCount;
  473. Xstatic char *strLoc;
  474. X
  475. Xstatic void SumStr(ptr)
  476. Xchar **ptr;
  477. X
  478. X{
  479. X    strLen += strlen(*ptr) + 1;
  480. X    return;
  481. X}
  482. X
  483. Xstatic void AddStr(ptr)
  484. Xchar **ptr;
  485. X
  486. X{
  487. X    unsigned len;
  488. X
  489. X    len = strlen(*ptr);
  490. X    if (len > 255) longjmp(abort, errStrLen);
  491. X
  492. X    strcpy(strLoc, *ptr);
  493. X    c2pstr(strLoc);
  494. X
  495. X    strLoc += len + 1;
  496. X
  497. X    strCount++;
  498. X
  499. X    return;
  500. X}
  501. X
  502. Xstatic void NxtString(ptr)
  503. Xchar **ptr;
  504. X
  505. X{
  506. X    *ptr = strLoc;
  507. X    strLoc += strlen(p2cstr(strLoc)) + 1;
  508. X
  509. X    return;
  510. X}
  511. X
  512. Xvoid DumpRes(fileName, resType, resID, resName, resAttrs, elemPtr, elemCnt,
  513. X         elemSiz, strProc)
  514. Xchar *fileName;
  515. Xlong resType;
  516. Xlong resID;
  517. Xchar *resName;
  518. Xlong resAttrs;
  519. Xchar *elemPtr;
  520. Xunsigned long elemCnt, elemSiz;
  521. Xvoid (*strProc)(char *elem, void (*proc)(char **str));
  522. X
  523. X{
  524. X    Handle dataHandle, strHandle, oldHandle;
  525. X    OSErr err;
  526. X    Str255 pFileName, pResName;
  527. X    short resFile;
  528. X    char *anElem;
  529. X    long errno;
  530. X    unsigned long i;
  531. X
  532. X    if ((errno = setjmp(abort)) != 0) {
  533. X        fprintf(stderr, "Error dumping to resource %s to file %s.\n",
  534. X            resName, fileName);
  535. X        fprintf(stderr, "%s\n", errtab[errno - 1]);
  536. X        exit(1);
  537. X    }
  538. X
  539. X    strncpy((char *)pFileName, fileName, 255);
  540. X    pFileName[255] = '\0';
  541. X    c2pstr(pFileName);
  542. X
  543. X    strncpy((char *)pResName, resName, 255);
  544. X    pResName[255] = '\0';
  545. X    c2pstr(pResName);
  546. X
  547. X    err = PtrToHand(elemPtr, &dataHandle, elemCnt * elemSiz);
  548. X    if (err != noErr) longjmp(abort, errDataHandle);
  549. X
  550. X    if (strProc != NULL) {
  551. X
  552. X        strLen = sizeof(short);
  553. X        anElem = elemPtr;
  554. X        for (i = 0; i < elemCnt; i++) {
  555. X            (*strProc)(anElem, SumStr);
  556. X            anElem += elemSiz;
  557. X        }
  558. X
  559. X        strHandle = NewHandle(strLen);
  560. X        if (MemError() != noErr) longjmp(abort, errStrHandle);
  561. X
  562. X        strCount = 0;
  563. X        strLoc = (char *) *strHandle + sizeof(short);
  564. X        anElem = elemPtr;
  565. X        for (i = 0; i < elemCnt; i++) {
  566. X            (*strProc)(anElem, AddStr);
  567. X            anElem += elemSiz;
  568. X        }
  569. X
  570. X        *((short *) *strHandle) = strCount;
  571. X
  572. X    }
  573. X
  574. X    else
  575. X        strHandle = NULL;
  576. X
  577. X    (void) Create(pFileName, 0, rsrcCreator, rsrcType);
  578. X    CreateResFile(pFileName);
  579. X
  580. X    resFile = OpenResFile(pFileName);
  581. X    if (resFile == -1) longjmp(abort, errOpenResFile);
  582. X
  583. X    oldHandle = Get1Resource(resType, (short) resID);
  584. X    if (oldHandle != NULL) {
  585. X        RmveResource(oldHandle);
  586. X        DisposHandle(oldHandle);
  587. X    }
  588. X
  589. X    oldHandle = Get1Resource(strType, (short) resID);
  590. X    if (oldHandle != NULL) {
  591. X        RmveResource(oldHandle);
  592. X        DisposHandle(oldHandle);
  593. X    }
  594. X
  595. X    AddResource(dataHandle, resType, (short) resID, pResName);
  596. X    if (ResError() != noErr) longjmp(abort, errAddData);
  597. X
  598. X    SetResAttrs(dataHandle, resAttrs | resChanged);
  599. X
  600. X    if (strHandle != NULL) {
  601. X
  602. X        AddResource(strHandle, strType, (short) resID, pResName);
  603. X        if (ResError() != noErr) longjmp(abort, errAddStr);
  604. X
  605. X        SetResAttrs(strHandle, resAttrs | resChanged);
  606. X
  607. X    }
  608. X
  609. X    CloseResFile(resFile);
  610. X    if (ResError() != noErr) longjmp(abort, errCloseResFile);
  611. X
  612. X    return;
  613. X}
  614. X
  615. Xlong LoadRes(memPtr, resType, resID, elemCnt, elemSiz, strProc)
  616. Xchar **memPtr;
  617. Xlong resType;
  618. Xlong resID;
  619. Xunsigned long elemCnt, elemSiz;
  620. Xvoid (*strProc)(char *elem, void (*proc)(char **str));
  621. X
  622. X{
  623. X    Handle dataHandle, strHandle;
  624. X    unsigned long dataLen, strLen;
  625. X    char *elemPtr, *anElem;
  626. X    long i;
  627. X
  628. X    dataHandle = GetResource(resType, resID);
  629. X    if (dataHandle == NULL) return(false);
  630. X
  631. X    MoveHHi(dataHandle);
  632. X    HLock(dataHandle);
  633. X
  634. X    dataLen = GetHandleSize(dataHandle);
  635. X
  636. X    if (strProc != NULL) {
  637. X
  638. X        strHandle = GetResource(strType, resID);
  639. X        if (strHandle == NULL) return(false);
  640. X
  641. X        MoveHHi(strHandle);
  642. X        HLock(strHandle);
  643. X
  644. X        strLen = GetHandleSize(strHandle);
  645. X
  646. X    }
  647. X
  648. X    else {
  649. X
  650. X        strHandle = NULL;
  651. X        strLen = 0;
  652. X
  653. X    }
  654. X
  655. X    if (*memPtr == NULL) {
  656. X
  657. X        elemPtr = NewPtr(dataLen + strLen);
  658. X        if (elemPtr == NULL) return(false);
  659. X
  660. X    }
  661. X
  662. X    else {
  663. X
  664. X        elemPtr = *memPtr;
  665. X        if (GetPtrSize(elemPtr) < (dataLen + strLen)) return(false);
  666. X
  667. X    }
  668. X
  669. X    if (strHandle != NULL) {
  670. X
  671. X        BlockMove(*strHandle, elemPtr + dataLen, strLen);
  672. X
  673. X        HUnlock(strHandle);
  674. X        ReleaseResource(strHandle);
  675. X
  676. X    }
  677. X
  678. X    BlockMove(*dataHandle, elemPtr, dataLen);
  679. X
  680. X    HUnlock(dataHandle);
  681. X    ReleaseResource(dataHandle);
  682. X
  683. X    if (strHandle != NULL) {
  684. X        strLoc = elemPtr + dataLen + sizeof(short);
  685. X        anElem = elemPtr;
  686. X        for (i = 0; i < elemCnt; i++) {
  687. X            (*strProc)(anElem, NxtString);
  688. X            anElem += elemSiz;
  689. X        }
  690. X    }
  691. X
  692. X    *memPtr = elemPtr;
  693. X
  694. X    return(true);
  695. X}
  696. END_OF_FILE
  697. if test 5368 -ne `wc -c <'mac/dumpres/DumpRes.c'`; then
  698.     echo shar: \"'mac/dumpres/DumpRes.c'\" unpacked with wrong size!
  699. fi
  700. # end of 'mac/dumpres/DumpRes.c'
  701. fi
  702. if test -f 'mac/machelp.c' -a "${1}" != "-c" ; then 
  703.   echo shar: Will not clobber existing file \"'mac/machelp.c'\"
  704. else
  705. echo shar: Extracting \"'mac/machelp.c'\" \(5404 characters\)
  706. sed "s/^X//" >'mac/machelp.c' <<'END_OF_FILE'
  707. X/* mac/machelp.c -- support code for mac like help system
  708. X
  709. X   Copyright (c) 1989-1991 Curtis McCauley, James E. Wilson
  710. X
  711. X   This software may be copied and distributed for educational, research, and
  712. X   not for profit purposes provided that this copyright and statement are
  713. X   included in all such copies. */
  714. X
  715. X#ifndef THINK_C
  716. X#include <Types.h>
  717. X#include <Resources.h>
  718. X#include <Events.h>
  719. X#include <Quickdraw.h>
  720. X#include <TextEdit.h>
  721. X#include <Controls.h>
  722. X#include <Dialogs.h>
  723. X
  724. X#include <ScrnMgr.h>
  725. X#else
  726. X#include <stddef.h>
  727. X#include "ScrnMgr.h"
  728. X#endif
  729. X
  730. X#include "config.h"
  731. X#include "constant.h"
  732. X#include "types.h"
  733. X
  734. X#define textType                'TEXT'
  735. X#define textID                    512
  736. X
  737. X#define macHelpDlgID            512
  738. X#define dfltBorder                2
  739. X#define textBox                    3
  740. X#define scrollBar                4
  741. X
  742. X#define codeEnter                0x03
  743. X#define codeReturn                0x0D
  744. X
  745. X#ifdef THINK_C
  746. X/* Cover up error in THINK C library.  */
  747. X#define ok    OK
  748. X#define cancel    Cancel
  749. X#endif
  750. X
  751. Xstatic ControlHandle okButton;
  752. X
  753. Xstatic ControlHandle myScrollBar;
  754. Xstatic short scrollMin, scrollMax;
  755. Xstatic short pageLines;
  756. X
  757. Xstatic TEHandle myTEHandle;
  758. X
  759. Xstatic pascal void ActOnScroll(theControl, partCode)
  760. XControlHandle theControl;
  761. Xshort partCode;
  762. X
  763. X{
  764. X    short delta;
  765. X    short newVal, origVal;
  766. X
  767. X    if (theControl != myScrollBar) return;
  768. X
  769. X    switch (partCode) {
  770. X        case inUpButton:
  771. X            delta = -1;
  772. X            break;
  773. X        case inDownButton:
  774. X            delta = 1;
  775. X            break;
  776. X        case inPageUp:
  777. X            delta = -pageLines;
  778. X            break;
  779. X        case inPageDown:
  780. X            delta = pageLines;
  781. X            break;
  782. X        default:
  783. X            delta = 0;
  784. X            break;
  785. X    }
  786. X
  787. X    if (delta) {
  788. X        origVal = GetCtlValue(myScrollBar);
  789. X        newVal = origVal + delta;
  790. X        if (newVal < scrollMin) newVal = scrollMin;
  791. X        if (newVal > scrollMax) newVal = scrollMax;
  792. X        if (newVal != origVal) {
  793. X            delta = newVal - origVal;
  794. X            SetCtlValue(myScrollBar, newVal);
  795. X            TEScroll(0, -delta * (*myTEHandle)->lineHeight, myTEHandle);
  796. X        }
  797. X    }
  798. X
  799. X    return;
  800. X}
  801. X
  802. Xstatic void DoHScroll(where, part)
  803. XPoint where;
  804. Xshort part;
  805. X
  806. X{
  807. X    short origVal, newVal;
  808. X
  809. X    switch (part) {
  810. X
  811. X        case inUpButton:
  812. X        case inDownButton:
  813. X        case inPageUp:
  814. X        case inPageDown:
  815. X            TrackControl(myScrollBar, where, (ProcPtr) ActOnScroll);
  816. X            break;
  817. X
  818. X        case inThumb:
  819. X            origVal = GetCtlValue(myScrollBar);
  820. X            TrackControl(myScrollBar, where, NULL);
  821. X            newVal = GetCtlValue(myScrollBar);
  822. X            if (newVal != origVal)
  823. X                TEScroll(0, (origVal - newVal) * (*myTEHandle)->lineHeight, myTEHandle);
  824. X            break;
  825. X
  826. X    }
  827. X
  828. X    return;
  829. X}
  830. X
  831. Xstatic pascal Boolean MacHelpFilter(theDialog, theEvent, itemHit)
  832. XDialogPtr theDialog;
  833. XEventRecord *theEvent;
  834. Xshort *itemHit;
  835. X
  836. X{
  837. X    GrafPtr oldPort;
  838. X    Point localPt;
  839. X    WindowPtr theWindow;
  840. X    ControlHandle theControl;
  841. X    Boolean handled;
  842. X    char key;
  843. X    short part;
  844. X
  845. X    handled = false;
  846. X
  847. X    switch (theEvent->what) {
  848. X
  849. X        case keyDown:
  850. X            key = theEvent->message & charCodeMask;
  851. X            if ( (key == codeEnter) || (key == codeReturn) ) {
  852. X                handled = true;
  853. X                HiliteControl(okButton, inButton);
  854. X                *itemHit = ok;
  855. X            }
  856. X            break;
  857. X
  858. X        case mouseDown:
  859. X            part = FindWindow(theEvent->where, &theWindow);
  860. X            if ( (theWindow == (WindowPtr) theDialog) && (part == inContent) ) {
  861. X                GetPort(&oldPort);
  862. X                SetPort((GrafPtr) theWindow);
  863. X                localPt = theEvent->where;
  864. X                GlobalToLocal(&localPt);
  865. X                part = FindControl(localPt, theWindow, &theControl);
  866. X                if (theControl == myScrollBar) {
  867. X                    handled = true;
  868. X                    DoHScroll(localPt, part);
  869. X                    *itemHit = scrollBar;
  870. X                }
  871. X                SetPort(oldPort);
  872. X            }
  873. X            break;
  874. X
  875. X    }
  876. X
  877. X    return(handled);
  878. X}
  879. X
  880. Xstatic pascal void DrawTextBox(theWindow, theItem)
  881. XWindowPtr theWindow;
  882. Xshort theItem;
  883. X
  884. X{
  885. X    short itsType;
  886. X    Handle itsHandle;
  887. X    Rect itsRect;
  888. X
  889. X    GetDItem((DialogPtr) theWindow, theItem, &itsType, &itsHandle, &itsRect);
  890. X    FrameRect(&itsRect);
  891. X
  892. X    TEUpdate(&theWindow->portRect, myTEHandle);
  893. X
  894. X    return;
  895. X}
  896. X
  897. Xvoid DoMacHelp()
  898. X
  899. X{
  900. X    GrafPtr oldPort;
  901. X    DialogPtr theDialog;
  902. X    Handle itsHandle;
  903. X    Handle textHandle;
  904. X    Handle versionHandle;
  905. X    short itemHit;
  906. X    short itsType;
  907. X    Rect itsRect;
  908. X    Rect textRect;
  909. X    int32 h, v;
  910. X
  911. X    theDialog = GetNewDialog(macHelpDlgID, nil, (WindowPtr) -1);
  912. X
  913. X    GetPort(&oldPort);
  914. X    SetPort((GrafPtr) theDialog);
  915. X
  916. X    CenterScreenDLOG(macHelpDlgID, fixHalf, fixThird, &h, &v);
  917. X    MoveWindow((WindowPtr) theDialog, (short) h, (short) v, false);
  918. X
  919. X    GetDItem(theDialog, ok, &itsType, (Handle *) &okButton, &itsRect);
  920. X    InsetRect(&itsRect, -4, -4);
  921. X
  922. X    SetDItem(theDialog, dfltBorder, userItem, (Handle) DrawDefaultBorder,
  923. X         &itsRect);
  924. X
  925. X    GetDItem(theDialog, scrollBar, &itsType, (Handle *) &myScrollBar, &itsRect);
  926. X
  927. X    GetDItem(theDialog, textBox, &itsType, &itsHandle, &textRect);
  928. X    SetDItem(theDialog, textBox, userItem, (Handle) DrawTextBox, &textRect);
  929. X    InsetRect(&textRect, 4, 4);
  930. X
  931. X    myTEHandle = TENew(&textRect, &textRect);
  932. X
  933. X    textHandle = GetResource(textType, textID);
  934. X    DetachResource(textHandle);
  935. X
  936. X    (*myTEHandle)->hText = textHandle;
  937. X    (*myTEHandle)->txFont = monaco;
  938. X    (*myTEHandle)->txSize = 9;
  939. X    TECalText(myTEHandle);
  940. X
  941. X    pageLines = (textRect.bottom - textRect.top) / (*myTEHandle)->lineHeight;
  942. X
  943. X    scrollMin = 0;
  944. X    scrollMax = (*myTEHandle)->nLines - pageLines;
  945. X    if (scrollMax < 0) scrollMax = 0;
  946. X
  947. X    SetCtlMin(myScrollBar, scrollMin);
  948. X    SetCtlMax(myScrollBar, scrollMax);
  949. X
  950. X    /* Get the version string.  */
  951. X    versionHandle = GetResource(MORIA_FCREATOR, 0);
  952. X    HLock(versionHandle);
  953. X    ParamText(*versionHandle, NULL, NULL, NULL);
  954. X
  955. X    ShowWindow((WindowPtr) theDialog);
  956. X
  957. X    do {
  958. X        ModalDialog(MacHelpFilter, &itemHit);
  959. X    } while (itemHit != ok);
  960. X
  961. X    HUnlock(versionHandle);
  962. X    TEDispose(myTEHandle);
  963. X
  964. X    SetPort(oldPort);
  965. X
  966. X    DisposDialog(theDialog);
  967. X
  968. X    return;
  969. X}
  970. END_OF_FILE
  971. if test 5404 -ne `wc -c <'mac/machelp.c'`; then
  972.     echo shar: \"'mac/machelp.c'\" unpacked with wrong size!
  973. fi
  974. # end of 'mac/machelp.c'
  975. fi
  976. if test -f 'misc/moria.msg' -a "${1}" != "-c" ; then 
  977.   echo shar: Will not clobber existing file \"'misc/moria.msg'\"
  978. else
  979. echo shar: Extracting \"'misc/moria.msg'\" \(6087 characters\)
  980. sed "s/^X//" >'misc/moria.msg' <<'END_OF_FILE'
  981. XFrom boyne@hplvla.hp.com Tue Feb 27 08:03:46 1990
  982. XReceived: from hp-sde.sde.hp.com by ernie.Berkeley.EDU (5.61/1.36)
  983. X    id AA19235; Tue, 27 Feb 90 08:03:44 -0800
  984. XReceived: from hp-lvld.lvld.hp.com by hp-sde.sde.hp.com with SMTP
  985. X    (15.11.1.3/15.5+IOS 3.13) id AA03131; Tue, 27 Feb 90 08:03:15 pst
  986. XReceived: from hplvla.HP.COM by hplisa.lvld.hp.com; Tue, 27 Feb 90 09:04:05mst
  987. XReceived: from hplvre.HP.COM by hplvla.HP.COM; Tue, 27 Feb 90 09:04:43 mst
  988. XReceived: by hplvre.HP.COM; Tue, 27 Feb 90 09:04:41 mst
  989. XDate: Tue, 27 Feb 90 09:04:41 mst
  990. XFrom: Art Boyne <boyne@hplvla.hp.com>
  991. XMessage-Id: <9002271604.AA19981@hplvre.HP.COM>
  992. XTo: wilson@ernie.Berkeley.EDU
  993. XSubject: Re: Hmmmmm (actually enchanting plusses)
  994. XStatus: RO
  995. X
  996. X
  997. X> >    I have an odd little question to ask...  how does one increase the
  998. X> > first `plus' on a pick or shovel?  The two enchantment scrolls (Damage and
  999. X> > To-Hit) seem to increase the second set of pluses, and have no effect on
  1000. X> > the first.
  1001. X>
  1002. X> This is a possibility.  However, it has to be done carefully to avoid
  1003. X> problems.  There must be a limit on how high digging ability can be increase
  1004. X> just like weapons/armor are effectively limited to +10.  I think +10 is
  1005. X> ridiculously high for digging though, perhaps limiting it to 5 would be OK.
  1006. X
  1007. XActually, I have found on several occasions Gnomish Shovels (+6), but never
  1008. Xanything higher (both in umoria 4.87 and PC-MORIA 4.873).  So perhaps +6
  1009. Xshould be the asymptotic limit, with decreasing chance of success for each
  1010. X+, similar to enchanting weapon.
  1011. X
  1012. X>Also, if this were allowed, then creatures should be allowed to 'disenchant'
  1013. X>the digging ability of weapons, and there should be traps/scrolls/whatever
  1014. X>that reduce the digging ability.  And there are probably some other changes
  1015. X>needed as well that don't come immediately to mind.
  1016. X
  1017. XCertainly - disenchanter creatures could affect digging ability, and (see
  1018. Xbelow) the enchantments on rings, etc.  Digging ability could also be reduced
  1019. Xby repeatedly digging through "hard" rock - say up to a 1% chance based on
  1020. Xwhat you are digging through.
  1021. X
  1022. X>>You can't.  Period.  This is another feature I would like to see changed,
  1023. X>>along with being able to increase the enchantment of rings, etc.
  1024. X>
  1025. X>I am very leary about adding this, because rings are permanent magic items.
  1026. X>In particular, letting someone enchant a ring of speed to +2 or higher will
  1027. X>seriously unbalance the game, as this is an incredible advantage for a
  1028. X>player.
  1029. X
  1030. XAgain, allowing disenchanter creatures to affect this would overcome the
  1031. Ximbalance.  Also, there could be a small chance that an enchant item scroll
  1032. Xcould destroy the item.  In fact, this should probably be the case even
  1033. Xfor the existing enchant weapon/armor scrolls, since right now you have
  1034. X*nothing* to lose by trying 100 times to get an extra + on weapons/armor.
  1035. X
  1036. XAlso, I still would like to see a very small chance that enchanting
  1037. Xweapons/armor would produce a special weapon (SD/SU/SE/SM/HA/DF) or
  1038. Xspecial armor (RC/RA/RL/RF/R).  Again, this would be counterbalanced
  1039. Xby the (slightly greater?) chance of destroying the item.  Perhaps,
  1040. Xtoo, disenchanter creatures could be allowed to remove the special
  1041. Xattributes.
  1042. X
  1043. XArt Boyne, boyne@hplvla.hp.com
  1044. X
  1045. XFrom ucbvax!decwrl!ames!think!samsung!usc!cs.utexas.edu!tut.cis.ohio-state.ed
  1046. XStatus: RO
  1047. X
  1048. XArticle 4487 of rec.games.moria:
  1049. XPath: ucbvax!decwrl!ames!think!samsung!usc!cs.utexas.edu!tut.cis.ohio-state.e
  1050. X>From: dtate@unix.cis.pitt.edu (David M Tate)
  1051. XNewsgroups: rec.games.moria
  1052. XSubject: Re: Enhancements to Umoria5.0 : the One Ring
  1053. XKeywords: One Ring
  1054. XMessage-ID: <22578@unix.cis.pitt.edu>
  1055. XDate: 27 Feb 90 16:46:31 GMT
  1056. XReferences: <1990Feb22.005217.22427@cs.rochester.edu> <562@auvax.AthabascaU.CA
  1057. XReply-To: dtate@unix.cis.pitt.edu (David M Tate)
  1058. XDistribution: all
  1059. XOrganization: Univ. of Pittsburgh, Comp & Info Services
  1060. XLines: 47
  1061. X
  1062. XIn article <562@auvax.AthabascaU.CA> kevinc@cs.AthabascaU.CA (Kevin Crocker)
  1063. X>
  1064. X>Remember, at least some of the Elven rings still existed, the Dwarven
  1065. X>rings are presumably lost in the Mines of Moria, HINT!, HINT!, and of
  1066. X>course the Nine walk abroad but are but wraiths of doom.
  1067. X>
  1068. X>All kinds of interesting thoughts appear.
  1069. X>
  1070. XActually, if I remember my Ring-lore correctly, the seven were all taken by
  1071. XSauron.  The last was the ring of Thrain, which was taken from Thror (or was
  1072. Xit Thrain?) by Sauron in the dungeons of Dol Guldor.  No more Rings of Power
  1073. Xfloating around in Moria.  The only rings still "available" are the three
  1074. Xrings (Narya, Nenya, Vilya) of the Elves, made by Celebrimbor. But I'm getting
  1075. Xpedantic...
  1076. X
  1077. XI, too, would love to see an even-more-Tolkienish descendant of Moria...if you
  1078. Xget tired of Moria, maybe you could bash your way across Mirkwood to deal with
  1079. XSmaug or the Necromancer.  Having Nazgul would add some spice, too.  And for
  1080. Xartifacts, you could find a palantir, which would let you look at any desired
  1081. Xportion of the level as if you were in the room(s), but from a distance.
  1082. X
  1083. XOf course, I'm sure Jim Wilson is reading these postings and saying "Yeah, in
  1084. Xyour dreams." :-)
  1085. X
  1086. XI do like the idea of having more "special attribute" items, good and bad.
  1087. XYou could actually make the choices a lot harder by mixing them up: what would
  1088. X*you* do if you found Boots [3,+7] (R) of Noise?  Or ego weapons with both
  1089. Xgood and bad side effects (remember "Bessman's Flailing Hammer", in Larn?).
  1090. XItems of invisibility would be great, too.
  1091. X
  1092. XAny chance of getting Alter-ego Weapons?  A dagger (-2,-4) of Summon Undead?
  1093. XOr something that *increases* susceptibility to certain breath/trap attacks,
  1094. Xlike a ring (or armor) of Susceptibility to Cold/Fire/Poison/Acid/Lightning?
  1095. X
  1096. XHow about being able to buy lightning rods in the general store?  Plant one in
  1097. Xthe floor, and all lightning attacks (dragon, wand, whatever) get drawn to it.
  1098. XJust don't stand too close!
  1099. X
  1100. Xetc.
  1101. X
  1102. X
  1103. X
  1104. X--
  1105. X        David M. Tate       | "It made the basses of their being throb in
  1106. X  dtate@unix.cis.pitt.edu   |  witching chords, and their thin blood pulse
  1107. X                            |  pizzicati of Hosanna..."
  1108. X "A Man for all Seasonings" |                     -- Wallace Stevens
  1109. X
  1110. X
  1111. END_OF_FILE
  1112. if test 6087 -ne `wc -c <'misc/moria.msg'`; then
  1113.     echo shar: \"'misc/moria.msg'\" unpacked with wrong size!
  1114. fi
  1115. # end of 'misc/moria.msg'
  1116. fi
  1117. if test -f 'source/help.c' -a "${1}" != "-c" ; then 
  1118.   echo shar: Will not clobber existing file \"'source/help.c'\"
  1119. else
  1120. echo shar: Extracting \"'source/help.c'\" \(6400 characters\)
  1121. sed "s/^X//" >'source/help.c' <<'END_OF_FILE'
  1122. X/* source/help.c: identify a symbol
  1123. X
  1124. X   Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke
  1125. X
  1126. X   This software may be copied and distributed for educational, research, and
  1127. X   not for profit purposes provided that this copyright and statement are
  1128. X   included in all such copies. */
  1129. X
  1130. X#include "config.h"
  1131. X#include "constant.h"
  1132. X#include "types.h"
  1133. X#include "externs.h"
  1134. X
  1135. X
  1136. Xvoid ident_char()
  1137. X{
  1138. X  char command, query;
  1139. X  register int i, n;
  1140. X
  1141. X  if (get_com("Enter character to be identified :", &command))
  1142. X    switch(command)
  1143. X      {
  1144. X    /* every printing ASCII character is listed here, in the order in which
  1145. X       they appear in the ASCII character set */
  1146. X      case ' ': prt("  - An open pit.", 0, 0); break;
  1147. X      case '!': prt("! - A potion.", 0, 0); break;
  1148. X      case '"': prt("\" - An amulet, periapt, or necklace.", 0, 0); break;
  1149. X      case '#': prt("# - A stone wall.", 0, 0); break;
  1150. X      case '$': prt("$ - Treasure.", 0, 0); break;
  1151. X      case '%':
  1152. X    if (highlight_seams == TRUE)
  1153. X      prt("% - A magma or quartz vein.", 0, 0);
  1154. X    else
  1155. X      prt("% - Not used.", 0, 0);
  1156. X    break;
  1157. X      case '&': prt("& - Treasure chest.", 0, 0); break;
  1158. X      case '\'': prt("' - An open door.", 0, 0); break;
  1159. X      case '(': prt("( - Soft armor.", 0, 0); break;
  1160. X      case ')': prt(") - A shield.", 0, 0); break;
  1161. X      case '*': prt("* - Gems.", 0, 0); break;
  1162. X      case '+': prt("+ - A closed door.", 0, 0); break;
  1163. X      case ',': prt(", - Food or mushroom patch.", 0, 0); break;
  1164. X      case '-': prt("- - A wand", 0, 0); break;
  1165. X      case '.': prt(". - Floor.", 0, 0); break;
  1166. X      case '/': prt("/ - A pole weapon.", 0, 0); break;
  1167. X    /* case '0': prt("0 - Not used.", 0, 0); break; */
  1168. X      case '1': prt("1 - Entrance to General Store.", 0, 0); break;
  1169. X      case '2': prt("2 - Entrance to Armory.", 0, 0); break;
  1170. X      case '3': prt("3 - Entrance to Weaponsmith.", 0, 0); break;
  1171. X      case '4': prt("4 - Entrance to Temple.", 0, 0); break;
  1172. X      case '5': prt("5 - Entrance to Alchemy shop.", 0, 0); break;
  1173. X      case '6': prt("6 - Entrance to Magic-Users store.", 0, 0); break;
  1174. X    /* case '7': prt("7 - Not used.", 0, 0); break; */
  1175. X    /* case '8': prt("8 - Not used.", 0, 0); break; */
  1176. X    /* case '9': prt("9 - Not used.", 0, 0);  break;*/
  1177. X      case ':': prt(": - Rubble.", 0, 0); break;
  1178. X      case ';': prt("; - A loose rock.", 0, 0); break;
  1179. X      case '<': prt("< - An up staircase.", 0, 0); break;
  1180. X      case '=': prt("= - A ring.", 0, 0); break;
  1181. X      case '>': prt("> - A down staircase.", 0, 0); break;
  1182. X      case '?': prt("? - A scroll.", 0, 0); break;
  1183. X      case '@': prt(py.misc.name, 0, 0); break;
  1184. X      case 'A': prt("A - Giant Ant Lion.", 0, 0); break;
  1185. X      case 'B': prt("B - The Balrog.", 0, 0); break;
  1186. X      case 'C': prt("C - Gelatinous Cube.", 0, 0); break;
  1187. X      case 'D': prt("D - An Ancient Dragon (Beware).", 0, 0); break;
  1188. X      case 'E': prt("E - Elemental.", 0, 0); break;
  1189. X      case 'F': prt("F - Giant Fly.", 0, 0); break;
  1190. X      case 'G': prt("G - Ghost.", 0, 0); break;
  1191. X      case 'H': prt("H - Hobgoblin.", 0, 0); break;
  1192. X    /* case 'I': prt("I - Invisible Stalker.", 0, 0); break; */
  1193. X      case 'J': prt("J - Jelly.", 0, 0); break;
  1194. X      case 'K': prt("K - Killer Beetle.", 0, 0); break;
  1195. X      case 'L': prt("L - Lich.", 0, 0); break;
  1196. X      case 'M': prt("M - Mummy.", 0, 0); break;
  1197. X    /* case 'N': prt("N - Not used.", 0, 0); break; */
  1198. X      case 'O': prt("O - Ooze.", 0, 0); break;
  1199. X      case 'P': prt("P - Giant humanoid.", 0, 0); break;
  1200. X      case 'Q': prt("Q - Quylthulg (Pulsing Flesh Mound).", 0, 0); break;
  1201. X      case 'R': prt("R - Reptile.", 0, 0); break;
  1202. X      case 'S': prt("S - Giant Scorpion.", 0, 0); break;
  1203. X      case 'T': prt("T - Troll.", 0, 0); break;
  1204. X      case 'U': prt("U - Umber Hulk.", 0, 0); break;
  1205. X      case 'V': prt("V - Vampire.", 0, 0); break;
  1206. X      case 'W': prt("W - Wight or Wraith.", 0, 0); break;
  1207. X      case 'X': prt("X - Xorn.", 0, 0); break;
  1208. X      case 'Y': prt("Y - Yeti.", 0, 0); break;
  1209. X    /* case 'Z': prt("Z - Not used.", 0, 0); break; */
  1210. X      case '[': prt("[ - Hard armor.", 0, 0); break;
  1211. X      case '\\': prt("\\ - A hafted weapon.", 0, 0); break;
  1212. X      case ']': prt("] - Misc. armor.", 0, 0); break;
  1213. X      case '^': prt("^ - A trap.", 0, 0); break;
  1214. X      case '_': prt("_ - A staff.", 0, 0); break;
  1215. X    /* case '`': prt("` - Not used.", 0, 0); break; */
  1216. X      case 'a': prt("a - Giant Ant.", 0, 0); break;
  1217. X      case 'b': prt("b - Giant Bat.", 0, 0); break;
  1218. X      case 'c': prt("c - Giant Centipede.", 0, 0); break;
  1219. X      case 'd': prt("d - Dragon.", 0, 0); break;
  1220. X      case 'e': prt("e - Floating Eye.", 0, 0); break;
  1221. X      case 'f': prt("f - Giant Frog.", 0, 0); break;
  1222. X      case 'g': prt("g - Golem.", 0, 0); break;
  1223. X      case 'h': prt("h - Harpy.", 0, 0); break;
  1224. X      case 'i': prt("i - Icky Thing.", 0, 0); break;
  1225. X      case 'j': prt("j - Jackal.", 0, 0); break;
  1226. X      case 'k': prt("k - Kobold.", 0, 0); break;
  1227. X      case 'l': prt("l - Giant Louse.", 0, 0); break;
  1228. X      case 'm': prt("m - Mold.", 0, 0); break;
  1229. X      case 'n': prt("n - Naga.", 0, 0); break;
  1230. X      case 'o': prt("o - Orc or Ogre.", 0, 0); break;
  1231. X      case 'p': prt("p - Person (Humanoid).", 0, 0); break;
  1232. X      case 'q': prt("q - Quasit.", 0, 0); break;
  1233. X      case 'r': prt("r - Rodent.", 0, 0); break;
  1234. X      case 's': prt("s - Skeleton.", 0, 0); break;
  1235. X      case 't': prt("t - Giant Tick.", 0, 0); break;
  1236. X    /* case 'u': prt("u - Not used.", 0, 0); break; */
  1237. X    /* case 'v': prt("v - Not used.", 0, 0); break; */
  1238. X      case 'w': prt("w - Worm or Worm Mass.", 0, 0); break;
  1239. X    /* case 'x': prt("x - Not used.", 0, 0); break; */
  1240. X      case 'y': prt("y - Yeek.", 0, 0); break;
  1241. X      case 'z': prt("z - Zombie.", 0, 0); break;
  1242. X      case '{': prt("{ - Arrow, bolt, or bullet.", 0, 0); break;
  1243. X      case '|': prt("| - A sword or dagger.", 0, 0); break;
  1244. X      case '}': prt("} - Bow, crossbow, or sling.", 0, 0); break;
  1245. X      case '~': prt("~ - Miscellaneous item.", 0, 0); break;
  1246. X      default:    prt("Not Used.", 0, 0); break;
  1247. X      }
  1248. X
  1249. X  /* Allow access to monster memory. -CJS- */
  1250. X  n = 0;
  1251. X  for (i = MAX_CREATURES-1; i >= 0; i--)
  1252. X    if ((c_list[i].cchar == command) && bool_roff_recall (i))
  1253. X      {
  1254. X    if (n == 0)
  1255. X      {
  1256. X        put_buffer ("You recall those details? [y/n]", 0, 40);
  1257. X        query = inkey();
  1258. X        if (query != 'y' && query != 'Y')
  1259. X          break;
  1260. X        erase_line (0, 40);
  1261. X        save_screen ();
  1262. X      }
  1263. X    n++;
  1264. X    query = roff_recall (i);
  1265. X    restore_screen ();
  1266. X    if (query == ESCAPE)
  1267. X      break;
  1268. X      }
  1269. X}
  1270. END_OF_FILE
  1271. if test 6400 -ne `wc -c <'source/help.c'`; then
  1272.     echo shar: \"'source/help.c'\" unpacked with wrong size!
  1273. fi
  1274. # end of 'source/help.c'
  1275. fi
  1276. if test -f 'util/printit/pr_items.c' -a "${1}" != "-c" ; then 
  1277.   echo shar: Will not clobber existing file \"'util/printit/pr_items.c'\"
  1278. else
  1279. echo shar: Extracting \"'util/printit/pr_items.c'\" \(5222 characters\)
  1280. sed "s/^X//" >'util/printit/pr_items.c' <<'END_OF_FILE'
  1281. X/* util/printit/pr_items.c: pretty print item/treasure info
  1282. X
  1283. X   Copyright (c) 1990-1992: Carlton Hommel, James E. Wilson
  1284. X
  1285. X   This software may be copied and distributed for educational, research, and
  1286. X   not for profit purposes provided that this copyright and statement are
  1287. X   included in all such copies. */
  1288. X
  1289. X#include "config.h"
  1290. X#include "constant.h"
  1291. X#include "types.h"
  1292. X
  1293. Xextern treasure_type object_list[];
  1294. X
  1295. Xmain()
  1296. X{
  1297. X    int i;
  1298. X    treasure_type *t;
  1299. X
  1300. X    printf("[tval,sub] p1\tLvl   $ lbs\t  Dam [+, +]\t[AC,+]\tChar Name");
  1301. X    printf("\tFlags\n");
  1302. X    for (i=0; i<MAX_OBJECTS; i++) {
  1303. X    t = &object_list[i];
  1304. X    call_it(t);
  1305. X    }
  1306. X    return 0;
  1307. X}
  1308. X
  1309. Xcall_it(t)
  1310. Xtreasure_type *t;
  1311. X{
  1312. X    printf("[%2d,%3d] ", t->tval, t->subval);
  1313. X
  1314. X    if (t->p1)
  1315. X     printf("%d\t", t->p1);
  1316. X    else printf(" \t");
  1317. X
  1318. X    printf("%2d %4ld %3d\t", t->level, t->cost, t->weight);
  1319. X
  1320. X    if (t->damage[0] || t->damage[1])
  1321. X    printf("%2dd%d ", t->damage[0], t->damage[1]);
  1322. X    else printf("     ");
  1323. X
  1324. X    if (t->tohit || t->todam)
  1325. X     printf("[%d, %d]\t", t->tohit, t->todam);
  1326. X    else printf("      \t");
  1327. X
  1328. X    if (t->ac!=0 || t->toac!=0)
  1329. X    printf("{%d, %d}\t", t->ac, t->toac);
  1330. X    else printf("      \t");
  1331. X
  1332. X    printf("'%c' \"%s\"\t",
  1333. X    t->tchar, t->name);
  1334. X
  1335. X    print_flags(t->tval, t->flags);
  1336. X
  1337. X    printf("\n");
  1338. X}
  1339. X
  1340. Xprint_flags(tval, flags)
  1341. Xchar tval;
  1342. Xunsigned long flags;
  1343. X{
  1344. X    int count;
  1345. X    unsigned long mask;
  1346. X
  1347. X    if (flags == 0)
  1348. X    return;
  1349. X
  1350. X    if (tval==80) {
  1351. X    printf("<");
  1352. X    for (count=0,mask=0x01; count<32; mask <<= 1, count++) {
  1353. X        switch (flags & mask) {
  1354. X        case 0x00000001: printf("poison(lvl+rnd(10)) ");        break;
  1355. X        case 0x00000002: printf("blind(10*lvl+rnd(250)+100) ");    break;
  1356. X        case 0x00000004: printf("fear(lvl+rnd(10) ");        break;
  1357. X        case 0x00000008: printf("confused(lvl+rnd(10) ");        break;
  1358. X        case 0x00000010: printf("hallucinate(25*lvl+rnd(200)+200) ");break;
  1359. X        case 0x00000020: printf("cure_poison ");            break;
  1360. X        case 0x00000040: printf("cure_blindness ");        break;
  1361. X        case 0x00000080: printf("cure_fear ");        break;
  1362. X        case 0x00000100: printf("cure_confuse ");        break;
  1363. X        case 0x00000200: printf("lose_str ");        break;
  1364. X        case 0x00000400: printf("lose_con ");        break;
  1365. X        case 0x00000800: printf("lose_int ");        break;
  1366. X        case 0x00001000: printf("lose_wis ");        break;
  1367. X        case 0x00002000: printf("lose_dex ");        break;
  1368. X        case 0x00004000: printf("lose_chr ");        break;
  1369. X        case 0x00008000: printf("rest_str ");        break;
  1370. X        case 0x00010000: printf("rest_con ");        break;
  1371. X        case 0x00020000: printf("rest_int ");        break;
  1372. X        case 0x00040000: printf("rest_wis ");        break;
  1373. X        case 0x00080000: printf("rest_dex ");        break;
  1374. X        case 0x00100000: printf("rest_chr ");        break;
  1375. X        case 0x00200000: printf("hp+(rnd(6)) ");        break;
  1376. X        case 0x00400000: printf("hp+(rnd(12)) ");        break;
  1377. X        case 0x00800000: printf("hp+(rnd(18)) ");        break;
  1378. X        case 0x01000000: printf("hp+(rnd(3d6)) ");        break;
  1379. X        case 0x02000000: printf("hp+(rnd(3d12)) ");        break;
  1380. X        case 0x04000000: printf("hp-(rnd(18)) ");        break;
  1381. X        case 0x08000000: printf("hp-(rnd(8)) ");        break;
  1382. X        case 0x10000000: printf("hp-(rnd(2d8))  ");        break;
  1383. X        case 0x20000000: printf("hp-(rnd(3d8))  ");        break;
  1384. X        case 0x40000000: printf("??? ");            break;
  1385. X        case 0x80000000: printf("??? ");            break;
  1386. X        }
  1387. X    }
  1388. X    printf(">");
  1389. X    }
  1390. X    else
  1391. X    if (tval>=TV_MIN_WEAR && tval<=TV_MAX_WEAR) {
  1392. X    printf("<");
  1393. X    for (count=0,mask=0x01; count<32; mask <<= 1, count++) {
  1394. X        switch (flags & mask) {
  1395. X        case TR_STR:        printf("Strength ");        break;
  1396. X        case TR_INT:        printf("Intelligence ");    break;
  1397. X        case TR_WIS:        printf("Wisdom ");        break;
  1398. X        case TR_DEX:        printf("Dexterity ");        break;
  1399. X        case TR_CON:        printf("Constitution ");    break;
  1400. X        case TR_CHR:        printf("Charisma ");        break;
  1401. X        case TR_SEARCH:        printf("Searching ");        break;
  1402. X        case TR_SLOW_DIGEST:    printf("Slow_digestion ");    break;
  1403. X        case TR_STEALTH:        printf("Stealth ");        break;
  1404. X        case TR_AGGRAVATE:        printf("Aggravation ");        break;
  1405. X        case TR_TELEPORT:        printf("Teleportation ");    break;
  1406. X        case TR_REGEN:        printf("Regeneration ");    break;
  1407. X        case TR_SPEED:        printf("Speed ");        break;
  1408. X        case TR_SLAY_DRAGON:    printf("Slay_Dragon ");        break;
  1409. X        case TR_SLAY_ANIMAL:    printf("Slay_Animal ");        break;
  1410. X        case TR_SLAY_EVIL:        printf("Slay_Evil ");        break;
  1411. X        case TR_SLAY_UNDEAD:    printf("Slay_Undead ");        break;
  1412. X        case TR_FROST_BRAND:    printf("Cold_Brand ");        break;
  1413. X        case TR_FLAME_TONGUE:    printf("Flame_Brand ");        break;
  1414. X        case TR_RES_FIRE:        printf("Resist_Fire ");        break;
  1415. X        case TR_RES_ACID:        printf("Resist_Acid ");        break;
  1416. X        case TR_RES_COLD:        printf("Resist_Cold ");        break;
  1417. X        case TR_SUST_STAT:        printf("Sustain_Stat ");    break;
  1418. X        case TR_FREE_ACT:        printf("Free_Action ");        break;
  1419. X        case TR_SEE_INVIS:        printf("See_Invisible ");    break;
  1420. X        case TR_RES_LIGHT:        printf("Resist_Lightning ");    break;
  1421. X        case TR_FFALL:        printf("Feather_Fall ");    break;
  1422. X        case TR_BLIND:        printf("Blindness ");        break;
  1423. X        case TR_TIMID:        printf("Timidness ");        break;
  1424. X        case TR_TUNNEL:        printf("Tunneling ");        break;
  1425. X        case TR_INFRA:        printf("Infra_vision ");    break;
  1426. X        case TR_CURSED:        printf("Cursed ");        break;
  1427. X        }
  1428. X    }
  1429. X    printf(">");
  1430. X    }
  1431. X}
  1432. END_OF_FILE
  1433. if test 5222 -ne `wc -c <'util/printit/pr_items.c'`; then
  1434.     echo shar: \"'util/printit/pr_items.c'\" unpacked with wrong size!
  1435. fi
  1436. # end of 'util/printit/pr_items.c'
  1437. fi
  1438. if test -f 'util/weapons/calchits.c' -a "${1}" != "-c" ; then 
  1439.   echo shar: Will not clobber existing file \"'util/weapons/calchits.c'\"
  1440. else
  1441. echo shar: Extracting \"'util/weapons/calchits.c'\" \(5835 characters\)
  1442. sed "s/^X//" >'util/weapons/calchits.c' <<'END_OF_FILE'
  1443. X/* util/weapons/calchits.c: calculates relative weapon effectiveness
  1444. X
  1445. X   Copyright (c) 1989-1992 Wayne Schlitt, James E. Wilson
  1446. X
  1447. X   This software may be copied and distributed for educational, research, and
  1448. X   not for profit purposes provided that this copyright and statement are
  1449. X   included in all such copies. */
  1450. X
  1451. X#include <stdio.h>
  1452. X
  1453. X#define    max(a,b)    ( (a) > (b) ? (a) : (b) )
  1454. X#define min(a,b)    ( (a) < (b) ? (a) : (b) )
  1455. X#define fabs(a)        ( (a) < 0 ? -(a) : (a) )
  1456. X
  1457. Xchar blows_table[7][6] = {
  1458. X/* STR/W:       9  18  67 107 117 118   : DEX */
  1459. X/* <2 */    {  1,  1,  1,  1,  1,  1 },
  1460. X/* <3 */    {  1,  1,  1,  1,  2,  2 },
  1461. X/* <4 */    {  1,  1,  1,  2,  2,  3 },
  1462. X/* <5 */    {  1,  1,  2,  2,  3,  3 },
  1463. X/* <7 */    {  1,  2,  2,  3,  3,  4 },
  1464. X/* <9 */    {  1,  2,  2,  3,  4,  4 },
  1465. X/* >9 */    {  2,  2,  3,  3,  4,  4 }
  1466. X};
  1467. X
  1468. X
  1469. X/* Weapon weight VS strength and dexterity        -RAK-    */
  1470. Xvoid attack_blows(weight, cstr, cdex, max_blows, real_blows, adj_weight )
  1471. X    int weight, cstr, cdex;
  1472. X    int *max_blows, *real_blows;
  1473. X    int *adj_weight;
  1474. X{
  1475. X  int dex_index, str_index;
  1476. X
  1477. X    if ((cstr*15) < weight)
  1478. X    {
  1479. X    *max_blows = 0;
  1480. X    *real_blows = 0;
  1481. X    *adj_weight = 0.0;
  1482. X    }
  1483. X    else
  1484. X    {
  1485. X    if      (cdex <  10)  dex_index = 0;
  1486. X    else if (cdex <  19)  dex_index = 1;
  1487. X    else if (cdex <  68)  dex_index = 2;
  1488. X    else if (cdex < 108)  dex_index = 3;
  1489. X    else if (cdex < 118)  dex_index = 4;
  1490. X    else                  dex_index = 5;
  1491. X    *adj_weight = ((cstr*10)/weight);
  1492. X    if      (*adj_weight < 2)  str_index = 0;
  1493. X    else if (*adj_weight < 3)  str_index = 1;
  1494. X    else if (*adj_weight < 4)  str_index = 2;
  1495. X    else if (*adj_weight < 5)  str_index = 3;
  1496. X    else if (*adj_weight < 7)  str_index = 4;
  1497. X    else if (*adj_weight < 9)  str_index = 5;
  1498. X    else                       str_index = 6;
  1499. X    *max_blows = blows_table[6][dex_index];
  1500. X    *real_blows = blows_table[str_index][dex_index];
  1501. X    }
  1502. X
  1503. X}
  1504. X
  1505. X
  1506. X#define calc_chance(low,high,weight) \
  1507. X    max( 0., min( (high - low), \
  1508. X         (high - low) - (high - (650. + weight)) \
  1509. X         ) \
  1510. X    ) / 650.
  1511. X
  1512. X
  1513. X/* Critical hits, Nasty way to die...            -RAK-    */
  1514. Xint critical_blow(weight, plus, dam, player_level)
  1515. X    int weight, player_level;
  1516. X    double plus, dam;
  1517. X{
  1518. X    int critical;
  1519. X
  1520. X    int        added_dam;
  1521. X    double    chance_critical, chance_dam, total_chance;
  1522. X
  1523. X    int        debug = 0;
  1524. X
  1525. X
  1526. X    critical = dam;
  1527. X    chance_critical = ( (int)(weight+5*plus+3*player_level) ) / 5000.;
  1528. X
  1529. X    if( debug ) printf( "chance_critical=%g  chance_dam=(", chance_critical );
  1530. X
  1531. X    chance_dam = calc_chance( weight, 400., weight );
  1532. X    if( debug ) printf( "%g", chance_dam );
  1533. X    total_chance = chance_dam;
  1534. X    added_dam  = (2*dam +  5) * chance_dam;
  1535. X
  1536. X    chance_dam = calc_chance( 400., 700., weight );
  1537. X    if( debug ) printf( "+%g", chance_dam );
  1538. X    total_chance += chance_dam;
  1539. X    added_dam += (3*dam + 10) * chance_dam;
  1540. X
  1541. X    chance_dam = calc_chance( 700., 900., weight );
  1542. X    if( debug ) printf( "+%g", chance_dam );
  1543. X    total_chance += chance_dam;
  1544. X    added_dam += (4*dam + 15) * chance_dam;
  1545. X
  1546. X    chance_dam = calc_chance( 900., 2000., weight );
  1547. X    if( debug ) printf( "+%g)  ", chance_dam );
  1548. X    total_chance += chance_dam;
  1549. X    added_dam += (5*dam + 20) * chance_dam;
  1550. X
  1551. X    if( debug ) printf( "added_dam = %d\n", added_dam );
  1552. X
  1553. X    if( fabs( total_chance - 1. ) > 1e-14 )
  1554. X    {
  1555. X    printf( "ERROR:  total_chance=%g (%g)\n",
  1556. X           total_chance, total_chance - 1. );
  1557. X    exit( 1 );
  1558. X    }
  1559. X
  1560. X    return( critical + added_dam * chance_critical );
  1561. X
  1562. X}
  1563. X
  1564. X
  1565. Xint get_stat( stat )
  1566. X    int        *stat;
  1567. X{
  1568. X    int        tmp, c;
  1569. X
  1570. X
  1571. X    if( 1 != scanf( " %d", &tmp ) )
  1572. X    return( 0 );
  1573. X
  1574. X    *stat = tmp;
  1575. X
  1576. X    if( tmp == 18 )
  1577. X    {
  1578. X    c = getchar();
  1579. X    if( c == '/' )
  1580. X    {
  1581. X        if( 1 != scanf( "%d", &tmp ) )
  1582. X        return( 0 );
  1583. X        *stat += tmp;
  1584. X    }
  1585. X    else
  1586. X        ungetc(c, stdin);
  1587. X
  1588. X    }
  1589. X
  1590. X    return( 1 );
  1591. X}
  1592. X
  1593. X
  1594. X
  1595. X
  1596. X
  1597. X#define MWEAPONS 100
  1598. X
  1599. Xint main()
  1600. X{
  1601. X    int        cstr, cdex, player_level;
  1602. X
  1603. X    int        weight[MWEAPONS];
  1604. X    double    to_hit[MWEAPONS], to_dam[MWEAPONS], weapon_dam[MWEAPONS];
  1605. X
  1606. X    int        num_weapons, i;
  1607. X
  1608. X    int        max_blows, real_blows;
  1609. X    int        adj_weight;
  1610. X    double    avg_dam, critical;
  1611. X
  1612. X    int        num_die, die_sides;
  1613. X
  1614. X
  1615. X    printf( "Enter level of your character: " );
  1616. X    if( 1 != scanf( " %d", &player_level ) )
  1617. X    {
  1618. X    putchar( '\n');
  1619. X    exit( 1 );
  1620. X    }
  1621. X
  1622. X
  1623. X    printf( "Enter number of weapons: " );
  1624. X    if( 1 != scanf( " %d", &num_weapons ) )
  1625. X    {
  1626. X    putchar( '\n');
  1627. X    exit( 1 );
  1628. X    }
  1629. X
  1630. X
  1631. X    for( i = 0; i < num_weapons; i++ )
  1632. X    {
  1633. X    printf( "Enter weight, weapon_dam, to_hit, to_dam for weapon #%d: ",
  1634. X           i );
  1635. X    if( 5 != scanf( " %d %dd%d %lf %lf",
  1636. X               &weight[i], &num_die, &die_sides,
  1637. X               &to_hit[i], &to_dam[i] )
  1638. X       )
  1639. X    {
  1640. X        putchar( '\n');
  1641. X        exit( 1 );
  1642. X    }
  1643. X
  1644. X    weapon_dam[i] = ( num_die * die_sides + num_die )/2.;
  1645. X    }
  1646. X
  1647. X
  1648. X    while( 1 )
  1649. X    {
  1650. X    printf( "Enter cstr, cdex: " );
  1651. X    if( !get_stat( &cstr ) || !get_stat( &cdex ) )
  1652. X    {
  1653. X        putchar( '\n');
  1654. X        exit( 1 );
  1655. X    }
  1656. X
  1657. X
  1658. X    if( cstr == 0 && cdex == 0 )
  1659. X        break;
  1660. X
  1661. X    printf( "  Weapon | Max blows | Blows | weight ratio | hp of dam |");
  1662. X    printf( " w/ critical |\n" );
  1663. X
  1664. X    for( i = 0; i < num_weapons; i++ )
  1665. X    {
  1666. X        attack_blows( weight[i], cstr, cdex,
  1667. X             &max_blows, &real_blows, &adj_weight );
  1668. X#if 0
  1669. X        /* multiply to dam bonuses by max/real number of hits */
  1670. X        if (real_blows != 0)
  1671. X          avg_dam = (int) (real_blows*(weapon_dam[i]+
  1672. X                 (max_blows * (int)to_dam[i] / real_blows)));
  1673. X        else
  1674. X          avg_dam = 0;
  1675. X        critical = critical_blow( weight[i], to_hit[i], avg_dam,
  1676. X                     player_level );
  1677. X#else
  1678. X        /* this is the old way, to_dam added after critical */
  1679. X        avg_dam = (int) (real_blows*weapon_dam[i]);
  1680. X        critical = critical_blow( weight[i], to_hit[i], avg_dam,
  1681. X                     player_level );
  1682. X        avg_dam += (int) real_blows*to_dam[i];
  1683. X        critical += (int) real_blows*to_dam[i];
  1684. X#endif
  1685. X
  1686. X        printf( "  %4d   | %6d    | %4d  | %8d     | %6g    |  %7g    |\n",
  1687. X           i, max_blows, real_blows, adj_weight, avg_dam, critical );
  1688. X    }
  1689. X    printf( "\n" );
  1690. X    }
  1691. X    return( 0 );
  1692. X}
  1693. X
  1694. END_OF_FILE
  1695. if test 5835 -ne `wc -c <'util/weapons/calchits.c'`; then
  1696.     echo shar: \"'util/weapons/calchits.c'\" unpacked with wrong size!
  1697. fi
  1698. # end of 'util/weapons/calchits.c'
  1699. fi
  1700. echo shar: End of archive 35 \(of 39\).
  1701. cp /dev/null ark35isdone
  1702. MISSING=""
  1703. 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
  1704.     if test ! -f ark${I}isdone ; then
  1705.     MISSING="${MISSING} ${I}"
  1706.     fi
  1707. done
  1708. if test "${MISSING}" = "" ; then
  1709.     echo You have unpacked all 39 archives.
  1710.     echo "Now run "bldfiles.sh" to build split files"
  1711.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1712. else
  1713.     echo You still need to unpack the following archives:
  1714.     echo "        " ${MISSING}
  1715. fi
  1716. ##  End of shell archive.
  1717. exit 0
  1718.