$! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.2-007 22-FEB-1990 $! On 1-JUL-1993 16:33:04.68 By user MASMUMMY $! $! This VMS_SHARE Written by: $! Andy Harper, Kings College London UK $! $! Acknowledgements to: $! James Gray - Original VMS_SHARE $! Michael Bednarek - Original Concept and implementation $! $!+ THIS PACKAGE DISTRIBUTED IN 77 PARTS, TO KEEP EACH PART $! BELOW 30 BLOCKS $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. CONFIG.H;1 $! 2. CONSTANT.H;1 $! 3. CREATE.C;1 $! 4. CREATURE.C;1 $! 5. DEATH.C;1 $! 6. DEBUG.MMS;1 $! 7. DESC.C;1 $! 8. DESCRIP.MMS;1 $! 9. DUNGEON.C;1 $! 10. EAT.C;1 $! 11. ERRORS.;1 $! 12. EXTERNS.H;1 $! 13. FILES.C;1 $! 14. GENERATE.C;1 $! 15. GETCH.C;1 $! 16. HELP.C;1 $! 17. HOURS.;1 $! 18. IO.C;1 $! 19. MAGIC.C;1 $! 20. MAIN.C;1 $! 21. MAKE.COM;1 $! 22. MAKEFILE.;1 $! 23. MISC1.C;1 $! 24. MISC2.C;1 $! 25. MISC3.C;1 $! 26. MISC4.C;1 $! 27. MONSTERS.C;1 $! 28. MORIA.OPT;1 $! 29. MORIA1.C;1 $! 30. MORIA2.C;1 $! 31. MORIA3.C;1 $! 32. MORIA4.C;1 $! 33. NEWS.;1 $! 34. ORIGCMDS.HLP;1 $! 35. OWIZCMDS.HLP;1 $! 36. PLAYER.C;1 $! 37. POTIONS.C;1 $! 38. PRAYER.C;1 $! 39. README.;1 $! 40. RECALL.C;1 $! 41. RND.C;1 $! 42. ROGLCMDS.HLP;1 $! 43. RWIZCMDS.HLP;1 $! 44. SAVE.C;1 $! 45. SCORES.;1 $! 46. SCORES.FDL;1 $! 47. SCROLLS.C;1 $! 48. SETS.C;1 $! 49. SIGNALS.C;1 $! 50. SPELLS.C;1 $! 51. STAFFS.C;1 $! 52. STORE1.C;1 $! 53. STORE2.C;1 $! 54. TABLES.C;1 $! 55. TREASURE.C;1 $! 56. TYPES.H;1 $! 57. UEXIT.C;1 $! 58. VARIABLE.C;1 $! 59. VERSION.HLP;1 $! 60. WANDS.C;1 $! 61. WELCOME.HLP;1 $! 62. WIZARD.C;1 $! $set="set" $set symbol/scope=(nolocal,noglobal) $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if f$trnlnm("SHARE_LOG") then $ w = "!" $ ve=f$getsyi("version") $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$verify(v) $ exit 44 $UNPACK: SUBROUTINE ! P1=filename, P2=checksum $ if f$search(P1) .eqs. "" then $ goto file_absent $ e "-W-EXISTS, File ''P1' exists. Skipped." $ delete 'f'* $ exit $file_absent: $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'." $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped." $ delete 'f'* $ exit $dirok: $ w "-I-PROCESS, Processing file ''P1'." $ if .not. f$verify() then $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1' PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:= CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b)); LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION( BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1); IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE; MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1; ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")= 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF"; POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r); ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1; COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE, "output_file"));ENDPROCEDURE;Unpacker;QUIT; $ delete/nolog 'f'* $ CHECKSUM 'P1' $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT $ e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ ENDSUBROUTINE $START: $ create 'f' X/* source/config.h: configuration definitions X X Copyright (c) 1989-92 James E. Wilson X X This software may be copied and distributed for educational, research, an Vd X not for profit purposes provided that this copyright and statement are X included in all such copies. */ X X#define CONFIG_H_INCLUDED X#ifdef CONSTANT_H_INCLUDED XConstant.h should always be included after config.h, because it uses Xsome of the system defines set up here. X#endif X X/* Person to bother if something goes wrong. */ X/* Recompile files.c and misc2.c if this changes. */ X#define WIZARD`09"David Grabiner" X/* The wizard password and wizard uid are no longer used. */ X X X/* System definitions. You must define one of these as appropriate for X the system you are compiling moria on. */ X X/* No system definition is needed for 4.3BSD, SUN OS, DG/UX. */ X X/* If you are compiling on an ultrix/4.2BSD/Dynix/etc. version of UNIX, X define this. It is not needed for SUNs. */ X/* #ifndef ultrix X#define ultrix X#endif */ X X/* If you are compiling under IBM's AIX 3.0, then you can either define X SYS_V, or you can define nothing (thus compiling as if on a BSD system) X but you must comment out the AIX LFLAG line in the Makefile so that X moria will be linked with -lbsd. */ X X/* If you are compiling on a SYS V version of UNIX, define this. */ X/* #define SYS_V */ X X/* If you are compiling on a SYS III version of UNIX, define this. X The SYS_III support may not be complete. I do not know if this works. * V/ X/* #define SYS_III */ X X/* If you are compiling on an ATARI ST with Mark Williams C, define this. * V/ X/* #define ATARIST_MWC */ X X/* If you are compiling on an Atari ST with GCC, you do not need to define X anything. */ X X/* If you are compiling on an Atari ST with TC, define this. */ X/* #define ATARIST_TC */ X X/* If you are compiling on a Macintosh with MPW C 3.0, define this. */ X/* #define MAC */ X X/* If we are in Think C, then we must be on a mac. */ X#ifdef THINK_C X#define MAC X#endif X X/* For Xenix systems, define SYS_V and unix. */ X#ifdef M_XENIX X#define SYS_V X#define unix X#endif X X/* If you are compiling under VMS, define this. */ X/* #define VMS */ X X/* If you are using the tcio.c file instead of io.c, then define this. X The tcio.c file uses TURBO C builtin functions instead of curses library X calls. It only works if you are using TURBO C. X The default is to assume you are using it if you are using TURBO C X on an IBM-PC. */ X#if defined(MSDOS) && defined(__TURBOC__) X#define USING_TCIO X#endif X X X/* Files used by moria, set these to valid pathnames for your system. */ X X#ifdef MSDOS X/* Files which can be in a varying place */ X#define MORIA_SAV`09moriasav X#define MORIA_TOP`09moriatop X#define MORIA_MOR`09"news" X#define MORIA_TOP_NAME`09"scores" X#define MORIA_SAV_NAME`09"MORIA.SAV" X#define MORIA_CNF_NAME`09"MORIA.CNF" X#define MORIA_HELP`09"roglcmds.hlp" X#define MORIA_ORIG_HELP`09"origcmds.hlp" X#define MORIA_WIZ_HELP`09"rwizcmds.hlp" X#define MORIA_OWIZ_HELP`09"owizcmds.hlp" X#define MORIA_WELCOME`09"welcome.hlp" X#define MORIA_VER`09"version.hlp" X X#else X#ifdef MAC X X/* These files are concatenated into the data fork of the app */ X/* The names are retained to find the appropriate text */ X#define MORIA_MOR`09"news" X#define MORIA_HELP`09"roglcmds.hlp" X#define MORIA_ORIG_HELP`09"origcmds.hlp" X#define MORIA_WIZ_HELP`09"rwizcmds.hlp" X#define MORIA_OWIZ_HELP`09"owizcmds.hlp" X#define MORIA_WELCOME`09"welcome.hlp" X#define MORIA_VER`09"version.hlp" X/* Do not know what will happen with these yet */ X#define MORIA_TOP`09"Moria High Scores" X/* File types and creators for the Mac */ X#define MORIA_FCREATOR`09'MRIA' X#define SAVE_FTYPE`09'SAVE' X#define INFO_FTYPE`09'TEXT' X#define SCORE_FTYPE`09'SCOR' X#define CONFIG_FTYPE`09'CNFG' X X/* Options for building resources: X THINK C doesn't have -D switch, so we need to define this stuff here. X Uncomment RSRC when building DumpRes1 or DumpRes2; uncomment RSRC_PARTn X as appropriate. When building application, comment all of them. X I don't think any of this is necessary for MPW C -- BS. */ X#ifdef THINK_C X/* #define RSRC */`09/* This copy is for creating resources. */ X X/* THINK C can only take 32K data, so we need to dump the resources in X two parts. */ X/* #define RSRC_PART1 */ X/* #define RSRC_PART2 */ X#endif X X#else X X#ifdef VMS X#define MORIA_SAV`09"moria.sav" X/* These 3 files need a dot at the end to prevent VMS from deciding that X they are *.DAT files or anything else equally wierd. */ X#define MORIA_HOU`09"moria:hours." X#define MORIA_MOR`09"moria:news." X#define MORIA_TOP`09"moria:scores." X#define MORIA_HELP`09"moria:roglcmds.hlp" X#define MORIA_ORIG_HELP "moria:origcmds.hlp" X#define MORIA_WIZ_HELP "moria:rwizcmds.hlp" X#define MORIA_OWIZ_HELP "moria:owizcmds.hlp" X#define MORIA_WELCOME`09"moria:welcome.hlp" X#define MORIA_VER`09"moria:version.hlp" X X#else X X#ifdef AMIGA X#define MORIA_SAV `09"moria.sav" X#define MORIA_HOU`09"moria:hours" X#define MORIA_MOR`09"moria:news" X#define MORIA_TOP`09"moria:scores" X#define MORIA_HELP`09"moria:roglcmds.hlp" X#define MORIA_ORIG_HELP "moria:origcmds.hlp" X#define MORIA_WIZ_HELP "moria:rwizcmds.hlp" X#define MORIA_OWIZ_HELP "moria:owizcmds.hlp" X#define MORIA_WELCOME`09"moria:welcome.hlp" X#define MORIA_VER`09"moria:version.hlp" X X#else X#if defined(GEMDOS) X/* Atari ST */ X#define MORIA_SAV`09"moria.sav" X#define MORIA_HOU`09"files\\hours" X#define MORIA_MOR`09"files\\news" X#define MORIA_TOP`09"files\\scores" X#define MORIA_HELP`09"files\\roglcmds.hlp" X#define MORIA_ORIG_HELP`09"files\\origcmds.hlp" X#define MORIA_WIZ_HELP`09"files\\rwizcmds.hlp" X#define MORIA_OWIZ_HELP`09"files\\owizcmds.hlp" X#define MORIA_WELCOME`09"files\\welcome.hlp" X#define MORIA_VER`09"files\\version.hlp" X X#else X#if defined(atarist) && defined(__GNUC__) X/* atari-st compiled with gnu-c */ X X#define MORIA_SAV`09"moria.save" X#define MORIA_HOU`09(char *)prefix_file("files/hours") X#define MORIA_MOR`09(char *)prefix_file("files/news") X#define MORIA_TOP`09(char *)prefix_file("files/scores") X#define MORIA_HELP`09(char *)prefix_file("files/roglcmds.hlp") X#define MORIA_ORIG_HELP`09(char *)prefix_file("files/origcmds.hlp") X#define MORIA_WIZ_HELP`09(char *)prefix_file("files/rwizcmds.hlp") X#define MORIA_OWIZ_HELP`09(char *)prefix_file("files/owizcmds.hlp") X#define MORIA_WELCOME`09(char *)prefix_file("files/welcome.hlp") X#define MORIA_VER`09(char *)prefix_file("files/version.hlp") X X#else X X/* This must be unix. */ X#define MORIA_SAV`09"moria.save" X#define MORIA_HOU`09"/home/zariski/grabiner/moria/files/hours" X#define MORIA_MOR`09"/home/zariski/grabiner/moria/files/news" X#define MORIA_TOP`09"/home/zariski/grabiner/moria/files/scores" X#define MORIA_HELP`09"/home/zariski/grabiner/moria/files/roglcmds.hlp" X#define MORIA_ORIG_HELP`09"/home/zariski/grabiner/moria/files/origcmds.hlp" X#define MORIA_WIZ_HELP`09"/home/zariski/grabiner/moria/files/rwizcmds.hlp" X#define MORIA_OWIZ_HELP`09"/home/zariski/grabiner/moria/files/owizcmds.hlp" X#define MORIA_WELCOME`09"/home/zariski/grabiner/moria/files/welcome.hlp" X#define MORIA_VER`09"/home/zariski/grabiner/moria/files/version.hlp" X X#endif X#endif X#endif X#endif X#endif X#endif X X X/* This sets the default user interface. */ X/* To use the original key bindings (keypad for movement) set ROGUE_LIKE X to FALSE; to use the rogue-like key bindings (vi style movement) X set ROGUE_LIKE to TRUE. */ X/* If you change this, you only need to recompile main.c. */ X#define ROGUE_LIKE FALSE X X X/* For the ANDREW distributed file system, define this to ensure that X the program is secure with respect to the setuid code, this prohibits X inferior shells. It also does not relinquish setuid priviledges at the X start, but instead calls the ANDREW library routines bePlayer(), beGames( V), X and Authenticate(). */ X/* #define SECURE */ X X X X/* System dependent defines follow. You should not need to change anything X below. */ X X#ifdef ATARIST_TC X#define USG X#include `09/* Needed for TC ...printf */ X#endif X X#if defined(ATARIST_TC) `7C`7C defined(ATARIST_MWC) X#define ATARI_ST X#endif X X/* Substitute strchr for index on USG versions of UNIX. */ X#if defined(SYS_V) `7C`7C defined(MSDOS) `7C`7C defined(MAC) `7C`7C defined( VVMS) X#define index strchr X#endif X#ifdef ATARIST_TC X#define index strchr X#endif X X#ifdef SYS_III Xchar *index(); X#endif X X/* Define USG for many systems, this is basically to select SYS V style X system calls (as opposed to BSD style). */ X#if defined(SYS_III) `7C`7C defined(SYS_V) `7C`7C defined(MSDOS) `7C`7C defi Vned(MAC) X#ifndef USG X#define USG X#endif X#endif X X#if defined(ATARIST_MWC) `7C`7C defined(AMIGA) `7C`7C defined(VMS) X#define USG X#endif X X#ifdef AMIGA X#ifndef ultrix X#define ultrix X#endif X#endif X X/* Pyramid runs 4.2BSD-like UNIX version */ X#if defined(Pyramid) X#define ultrix X#endif X X#if defined(_MSC_VER) && (_MSC_VER < 600) X#define register /* MSC 4.0 still has a problem with register bugs ... V */ X#endif X X#ifdef MAC X#ifdef RSRC X#define MACRSRC`09`09/* Defined if we are building the resources. */ X#else X#define MACGAME`09`09/* Defined if we are building the game. */ X#endif X#endif X X#ifdef MAC X/* Screen dimensions */ X#define SCRN_ROWS`0924 X#define SCRN_COLS`0980 X#endif X X#ifdef VMS X#define unlink delete X#define index strchr X#define exit uexit X/* In constants.h, ESCAPE is defined to be the CTRL-Z key, instead of the X escape key. */ X#endif X X#if defined(SYS_V) && defined(lint) X/* Define this to prevent from including on a PC/RT X running AIX. This prevents a bunch of lint errors. */ X#define RTPC_NO_NLS X#endif X X#ifdef SECURE Xextern int PlayerUID; X#define getuid() PlayerUID X#define geteuid() PlayerUID X#endif X X#ifdef THINK_C X/* Apparently, THINK C is only happy if this is defined. This can not X be defined in general, because some systems have include files which +-+-+-+-+-+-+-+- END OF PART 1 +-+-+-+-+-+-+-+-