[comp.sources.games] v07i038: omega3 - rogue like dungeon exploration

billr@saab.CNA.TEK.COM (Bill Randle) (07/14/89)

Submitted-by: "Laurence R. Brothers"   <brothers@paul.rutgers.edu>
Posting-number: Volume 7, Issue 38
Archive-name: omega3/Part19
Supersedes: omega2: Volume 5, Issue 12-29,38-40



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 19 (of 20)."
# Contents:  Makefile.dos doscomp.txt dosread.me fixstr.c ocity.dat
#   ocountry.dat ohelp1.txt ohelp12.txt ohelp2.txt ohelp3.txt
#   ohelp9.txt ommove.c oscroll1.txt
# Wrapped by billr@saab on Thu Jun 29 08:14:15 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile.dos' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile.dos'\"
else
echo shar: Extracting \"'Makefile.dos'\" \(2078 characters\)
sed "s/^X//" >'Makefile.dos' <<'END_OF_FILE'
X# Makefile for omega for IBM-PC
X
XMODEL = L
XCFLAGS = -A$(MODEL) -Os -Gs -Gt10
XLIBS = lcurses
XLFLAGS = /noigno /cp:1 /seg:256 /stack:0x1000
X# Don't add in the /exepack flag if you value your sanity!
X# Run exepack separately yourself if you want to.
X
XCFILESEXCEPTO = oabyss.c oaux1.c oaux2.c oaux3.c ochar.c ocity.c \
X	ocom1.c ocom2.c ocom3.c \
X	ocountry.c oeffect1.c oeffect2.c oeffect3.c \
X	oenv.c oetc.c ofile.c ogen1.c ogen2.c \
X	oguild1.c oguild2.c ohouse.c oinit.c \
X	oinv.c oitem.c oitemf1.c oitemf2.c oitemf3.c olev.c \
X	ommelee.c ommove.c omon.c omove.c omovef.c omspec.c \
X	omstrike.c omtalk.c opriest.c \
X	osave.c oscr.c osite1.c osite2.c \
X	ospell.c otime.c otrap.c outil.c ovillage.c
X
XOBJS =	o.obj oabyss.obj oaux1.obj oaux2.obj oaux3.obj ochar.obj ocity.obj \
X	ocom1.obj ocom2.obj ocom3.obj ocountry.obj \
X	oeffect1.obj oeffect2.obj oeffect3.obj oenv.obj oetc.obj ofile.obj\
X	ogen1.obj ogen2.obj oguild1.obj oguild2.obj ohouse.obj oinit.obj\
X	oinv.obj oitem.obj oitemf1.obj oitemf2.obj oitemf3.obj olev.obj \
X	ommelee.obj ommove.obj omon.obj omove.obj omovef.obj omspec.obj \
X	omstrike.obj omtalk.obj opriest.obj \
X	osave.obj oscr.obj osite1.obj osite2.obj \
X	ospell.obj otime.obj otrap.obj outil.obj ovillage.obj
X
XOFILES = o (oabyss) oaux1 oaux2 oaux3 (ochar) (ocity + olev + ovillage) \
X	ocom1 ocom2 ocom3 \
X	(ocountry) (oeffect1) (oeffect2) (oeffect3) (oenv)\
X	oetc (ofile) (ogen1 + ogen2) (oguild1) (oguild2) (ohouse) (oinit) \
X	oinv oitem (oitemf1) (oitemf2) (oitemf3) \
X	ommelee ommove omon omove omovef (omspec) \
X	(omstrike) (omtalk) (opriest) \
X	(osave) oscr (osite1) (osite2) \
X	ospell otime (otrap) outil
X
Xomega.exe: $(OBJS)
X	link $(LFLAGS) $(OFILES),omega,,$(LIBS)
X
X$(OBJS): odefs.h oextern.h oglob.h
X
X$(OBJS):	$*.c
X
Xocom3.obj:	odate.h
X
X
XREAL = realc
X
Xo.c:	$(REAL)\$@
X	copy $? .
X
X$(CFILESEXCEPTO):	$(REAL)\$@
X	copy $? .
X	fixstr $@
X
Xoinit.obj:	oiinit.h ominit.h
X
X#BINDIR = /u/kyrimis/bin/games
X#LIBDIR = /u/kyrimis/games/omega
X#install: omega
X#	mv omega $(BINDIR)
X#	chmod u+s $(BINDIR)/omega
X#	cp omega.* *.dat *.txt $(LIBDIR)
X#
X#clean:
X#	rm -rf *.o omega
END_OF_FILE
if test 2078 -ne `wc -c <'Makefile.dos'`; then
    echo shar: \"'Makefile.dos'\" unpacked with wrong size!
fi
# end of 'Makefile.dos'
fi
if test -f 'doscomp.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'doscomp.txt'\"
else
echo shar: Extracting \"'doscomp.txt'\" \(3793 characters\)
sed "s/^X//" >'doscomp.txt' <<'END_OF_FILE'
XNote on compiling PC-Omega
X--------------------------
XThe PC version was written for MSC5.0 and PC-Curses, and I used Ndmake
Xto help with compilation. The PC-Curses I actually used was the
Xone from Bjorn Larsson. Ndmake is from Don Kneller. Both are
Xavailable from the simtel20 archives and elsewhere. MSC4.0 or MSC5.1
Xwill probably also work, but I make no guarantees.
X
X
XThis is a *very* large program. Be prepared to have around 4MB available
Xon your disk to do this, plus whatever space is needed for backup copies
Xand level files created when you run the game. Compilation from the
Xstart takes around 1.5 hrs on an AT-type machine.
X
X
XUse the makefile called makefile.dos.
X
XSet up a main directory for your compilation. Put the makefile and the
Xheader files (*.h) into this directory. Create a subdirectory called
Xrealc, and put the source files (*.c) in there. The object files and
Xexecutable are going to be put in the main directory.
X
XYou'll want to either put all the data files in the main directory with
Xthe header files, or create another subdirectory and put them in it.
XIn the latter case you'll have to move the executable in there to
Xrun it (unless you've changed the source so that it's not necessary).
X
XYou'll have to edit odefs.h to change a few things to be specific
Xfor the pc and your system. The comment around NORANDOM should
Xbe removed, so that this macro is defined. Similarly the comment
Xaround EXCESSIVE_REDRAW should be removed. The OMEGALIB macro
Xshould be changed to reflect where all the data files will be.
XI usually set this to "./". WIZARD can be changed or not changed.
XIf you change it to "pcuser", then wizard mode will work all the time;
Xif not, it will never work.
X
XThe progam fixstr should be compiled from fixstr.c directly. This is
Xa utility program I wrote which is used in compilation, and compiling
Xinformation for it does not appear in the makefile. "cl fixstr.c"
Xshould suffice. The executable should either be put into the PATH, or
Xinto the main directory.
X
XThe reason for the elaborate setup with the realc subdirectory is
Xbecause of the fact that there are so many string constants in the
Xsource, and that these all would get put in the same segment in
Xmemory. Because of this, the sources cannot link "as is." They have
Xto be transformed using my "fixstr" program to alleviate this
Xproblem. 
X
XMy setup (as described above) is to have a subdirectory, for example
Xcall it realc, which contains the real C sources (only the .c files).
XThe headers and everything else are in your main directory. If you
Xuse my makefile, it copies the sources from realc into the main
Xdirectory, modifies them using fixstr, and then compiles the modified
Xfiles there.
X
XDepending on what variety of the make program you use, you may have
Xsome problems. The version I use (ndmake 4.3) has the problem that if
Xyou run make with everything set up as above the first time, it will
Xcopy all the .c files from realc into the main directory and run
Xfixstr on them, but won't compile them. If you run make again, it
Xdoes the compilation. In general this seems to happen when the .c
Xfiles are missing from the main directory.  When I tried using a
Xlater version of this program, it did not work at all because the $@
Xmacro wouldn't work. Just a warning. If you use a completely independent
Xversion of make, there's no guaranteeing what will happen if it's buggy.
X
XAll of the changes required in order for Omega to work on the IBM-PC
Xunder MSDOS have been done using #ifdef's for MSDOS, etc,. The macro
XMSDOS is automatically defined when using MSC.
X
XOne last thing: The village data file names are too long for Dos. So
Xyou should rename ovillage1.dat to be ovillag1.dat, etc.
X
X				- Nathan Glasser
X				nathan@brokaw.lcs.mit.edu	(internet)
X				nathan@mit-eddie.uucp		(usenet)
END_OF_FILE
if test 3793 -ne `wc -c <'doscomp.txt'`; then
    echo shar: \"'doscomp.txt'\" unpacked with wrong size!
fi
# end of 'doscomp.txt'
fi
if test -f 'dosread.me' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'dosread.me'\"
else
echo shar: Extracting \"'dosread.me'\" \(3550 characters\)
sed "s/^X//" >'dosread.me' <<'END_OF_FILE'
X								4/17/89
X
XThis message is about the current version of Omega for the IBM-PC, 0.75.
X
XThis is the first new version since July '88, corresponding to the
Xfirst general Omega release since then.
X
XYou need a full 640K of memory and (almost certainly) a hard disk to play.
XThe executable itself is too large to fit on one floppy, and during
Xthe course of the game large level files are created. If you don't have
Xmuch space on the hard disk, you may also have problems.
X
XI have added the 'X' command which will tell you the state of the
Xheap (-2 is ok) and how much memory is left. For me this usually
Xstarts out around 75K-80K.
X
XAs the game progresses, more and more memory is allocated which
Xisn't freed, though it is no longer needed. Consequently, you
Xshould probably do the X command once in a while, and save the
Xgame when it starts to get really low.
X
XThe screen display may act differently in some places than it does
Xwhen running under Unix, but I haven't found any places where
Xit does something blatently wrong that the unix version doesn't also
Xdo.
X
XThe '^P' command (reprint last message) has been moved to '^O'.  The
Xreason has to do with using the printer, and the fact that Omega was
Xmeant to run in cbreak mode and not raw mode, and because Dos isn't
Xas flexible as Unix.
X
XIf you've only got the executable and associated files needed to run
Xthe game, you obviously can't configure Omega as to where to look for
Xthese files. Consequently you've got to have all the files in one
Xdirectory and play the game from there. (If you've got the sources,
Xyou can change this.)
X
XMost general bug reports should probably be sent to the writer of Omega,
XLaurence Brothers (brothers@paul.rutgers.edu). Bugs which seem to
Xbe PC specific should probably be reported to me.
X
X				- Nathan Glasser
X				nathan@brokaw.lcs.mit.edu	(internet)
X				nathan@mit-eddie.uucp		(usenet)
X
X
XRecent bug fixes specific to PC users include:
X-	The house bug - Entering houses no longer screws up the game.
X-	The return bug - You can now use the "return" spell as documented.
X-	Level creation time - The time to create levels is reasonable again.
X
XOther comments:
X
XFor those of you who feel lost without them, arrow keys and home and
Xend may be used in some menus: inventory, options, and selecting the
Xnumber of multiple items to drop.
X
XAs long as you exit the game normally, all level files will be removed.
X
XThe general version of the game performs saving/restoring in a strange way.
XOnly the town level and the current level of the dungeon you're in (if any)
Xare saved. I personally don't think this is the right thing to do, but
Xhave not changed this for the PC. Thus it is not a bug when previously
Xvisited levels disappear after saving the game.
X
XAlso, there is still no way to set up the options to use every time
Xyou play without "playing yourself." This is obviously another area
Xin which the game could be slightly improved, but it's not a bug
Xthat it doesn't do this.
X
XThe game as a whole has always been fairly buggy, and there are even
Xstill some known bugs in the game which haven't been fixed, though
Xit's much better than when the game was first introduced. Because of
Xthe overall bugginess, there are still (unknown?) bugs which manfest
Xthemselves on the PC by causing the machine to crash after quitting
Xthe game, forcing you to reboot. I've not seen anything worse than
Xthis in quite a while, but you never know what might still be lurking
Xin there.
X
X				- Nathan Glasser
X				nathan@brokaw.lcs.mit.edu	(internet)
X				nathan@mit-eddie.uucp		(usenet)
END_OF_FILE
if test 3550 -ne `wc -c <'dosread.me'`; then
    echo shar: \"'dosread.me'\" unpacked with wrong size!
fi
# end of 'dosread.me'
fi
if test -f 'fixstr.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'fixstr.c'\"
else
echo shar: Extracting \"'fixstr.c'\" \(3456 characters\)
sed "s/^X//" >'fixstr.c' <<'END_OF_FILE'
X/* This utility program is not part of the sources to Omega.
X   It was written by Nathan Glasser (nathan@brokaw.lcs.mit.edu	(internet)
X	   			     nathan@mit-eddie.uucp	(usenet).
X   As such, it is copyright by Nathan Glasser, 1987,1988,1989.
X   Please don't attempt to sell this program or take credit for it
X   yourself, and please don't remove this notice.
X*/
X
X
X/* This program reads in a C source file and replaces all static strings
Xwith variable names defined above in the file, which are all declared
Xto be far arrays. You don't need to run this for the unix version. */
X
X/* This program does not know about comments, or \'s in front of "'s.
XThus it can be broken. */
X
X#include <stdio.h>
X#include <malloc.h>
X
X#define TMPFILE "fixtmp.c"
X
Xint num_strings;
Xchar **string_list;
X
X#define REALLOC_INCR 500
X
X
Xmain(argc,argv)
Xint argc;
Xchar **argv;
X{
X    FILE *sourcefp,*destfp;
X
X    if (argc != 2)
X    {
X    	printf("Usage: %s <cfile>\n",argv[0]);
X	exit(1);
X    }
X
X    if ((sourcefp = fopen(argv[1],"r")) == NULL ||
X      (destfp = fopen(TMPFILE,"w")) == NULL)
X    {
X    	perror("Can't open a file (pass1)");
X	exit(1);
X    }
X
X    printf("Scanning %s...",argv[1]);
X    fflush(stdout);
X    do_scan(sourcefp,destfp);
X    printf("Done\n");
X
X    fclose(sourcefp);
X    fclose(destfp);
X
X    if ((sourcefp = fopen(TMPFILE,"r")) == NULL ||
X      (destfp = fopen(argv[1],"w")) == NULL)
X    {
X    	perror("Can't open a file (pass2)");
X	exit(1);
X    }
X
X    printf("Writing new %s...",argv[1]);
X    fflush(stdout);
X    do_output(sourcefp,destfp);
X    printf("Done\n");
X    remove(TMPFILE);
X    exit(0);
X}
X
Xchar include[] = "#include";
X#define include_size (sizeof(include) - 1)
X
Xdo_scan(sourcefp,destfp)
XFILE *sourcefp,*destfp;
X{
X    int max_strings;
X    int ch,last_ch = EOF;
X    char temp_string[128],*temp;
X
X    /* Vars for figuring out about #include's */
X    int pos = 0,include_flag = 0,include_tmp = 1;
X
X    string_list = (char **)malloc((max_strings = REALLOC_INCR) *
X      sizeof(char *));
X
X    while ((ch = getc(sourcefp)) != EOF)
X    {
X    	switch (ch)
X	{
X	    case '\n':
X	    	putc(ch,destfp);
X		pos = include_flag = 0;
X		include_tmp = 1;
X		break;
X	    case '"':
X	    	if (!include_flag && last_ch != '\'')
X		{
X		    /* Start of a string */
X		    for (temp = temp_string; (*temp = getc(sourcefp)) != '"';
X		      temp++);
X		    *temp = '\0';
X		    strcpy((string_list[num_strings] =
X		      (char *)malloc(temp - temp_string + 1)),temp_string);
X		    fprintf(destfp,"_str_%d",num_strings);
X		    if (++num_strings == max_strings)
X		    	string_list = (char **)realloc(string_list,
X			  (max_strings += REALLOC_INCR) * sizeof(char *));
X		    include_tmp = 0;
X		    break;
X		}
X	    default:
X	    	if (include_tmp)
X		{
X		    if ((include_tmp = ch == include[pos++]) &&
X		      pos == include_size)
X		    {
X		        include_flag = 1;
X			include_tmp = 0;
X		    }
X		}
X		putc(ch,destfp);
X		break;
X	}
X	last_ch = ch;
X    }
X}
X
Xdo_output(sourcefp,destfp)
XFILE *sourcefp,*destfp;
X{
X    char buf[1024];
X    int i;
X
X    fprintf(destfp,"/* These static strings have been moved here to */\n");
X    fprintf(destfp,"/* declare them as far and avoid having too much */\n");
X    fprintf(destfp,"/* initialized memory in the CONST segment. */\n\n");
X
X    for (i = 0; i < num_strings; i++)
X    	fprintf(destfp,"static char far _str_%d[] = \"%s\";\n",
X	  i,string_list[i]);
X
X    putc('\n',destfp);
X
X    while (i = fread(buf,1,sizeof(buf),sourcefp))
X    	fwrite(buf,i,1,destfp);
X}
END_OF_FILE
if test 3456 -ne `wc -c <'fixstr.c'`; then
    echo shar: \"'fixstr.c'\" unpacked with wrong size!
fi
# end of 'fixstr.c'
fi
if test -f 'ocity.dat' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ocity.dat'\"
else
echo shar: Extracting \"'ocity.dat'\" \(4162 characters\)
sed "s/^X//" >'ocity.dat' <<'END_OF_FILE'
X################################################################
X#..............................................................#
X#.######.#######..########..##x....x##.#########..###.###.###..#
X#.######.######x..####x###..###."".###.#########..#######.##x..#
X#.x####x........................"".....#########..#######.###..#
X#.######.######x..#x#..#x#..##x."".###.####........####s.......#
X#.######.#######..###..###..###."".x##.###C.......#######.###..#
X#.................###xx###......"".....###C.......#######.###..#
X#..#######..####..########...#x."".x##.####.......###.###.#x#..#
X#.##2#6#5##.x###.###########.##."".###.#########...............#
X#..#.....#..###x.#.........#...."".x##.#########...............#
X#.####.####.####.#.###.###.#.##."".....#########..##....##...#.#
X#..#3...4#.......#.##x.x##.#.#x."".##.............###MM###..##.#
X#.####.####.##...............##."".##..######..##..######..#x#.#
X#....#t#....##...#.##x.x##.#.#x."".x#..#####x..###..####..####.#
X#................#.###.###.#.##."".##..######........##..#####.#
X#.#########.####.#.........#.......##..######.######....####x..#
X#.#########.####.#####.#####....##.....######.#####x#..#x###.###
X#.#########.###x................##...........................#G#
X#.####H.....####.....#B#...G##################################G#
X#.#########.........#####......................................X
X#.#########.######..#####......................................X
X#.#########.######...###...G##################################G#
X#............................................................#G#
X#""""""""""""""""""""""""""".......###########.###.#############
X#""""""""""""""""""""""""""".......#####x#####.###.#####x#####.#
X#"".......................""...................................#
X#"".."""".##########.""""."".......######..#######.##x.##x.##x.#
X#"".."=~1.#==#==#==#.1~="."".......x#####..##x#x##.###.###.###.#
X#"".."""".#==#~~#==#.""""."".......######......................#
X#"".......#111~~111#......"".......######..#####...##...##.###.#
X#""..""""."..~~~~.."."""".""...............#####x#.##...##.....#
X#""..""""."""1..1""".""""."".......#######......##.####.##x###.#
X#"".......................g........x######.#x##....####.####x#.#
X#"".#."""""""""""""""""""""".......#######.####.##.##x#.....##.#
X#"#y#??????????????????????".......x######.x###.##..........##.#
X#"#-#??????????????????????".......#######.####....######...##.#
X#"#.#??????????????????????".......................######.####.#
X#"#u#??????????????????????".......###......###.##........##x#.#
X#"#.#??????????????????????".......x##.####.###.##.#x##x#...##.#
X#"#.#??????????????????????".......###.x###........######...##.#
X#"#-#??????????????????????"...........####.#x##x#.######.#.##.#
X#"#.#??????????????????????".......###......######........#....#
X#"#.#??????????????????????".......x##.####.....##.##.###.#.##.#
X#"#u#??????????????????????".......###.####.###.#x.#x.###...##.#
X#"#.#??????????????????????".......x##......###.......##x##.##.#
X#"#.#??????????????????????".......###..####x##.##.##.#####.##.#
X#"#.#??????????????????????"............####...................#
X#"#u#######################".......###.......##..###.#######.#.#
X#"#.....-.....u-1-$U$U$U$U#".......###..####.##..###.####x##.#.#
X#"#########################".......##x##x###.##..#x#.###..##.#.#
X#"""""""""""""""""""""""""""...................................#
X#.####~~~~~~~~~~~~~~~~~~####.......##*##*##*##.....######......#
X#.####S#####################.......##*##*#*###...###....###....#
X#.###S###S#^################.......##T#T#T#T##..###..##..###...#
X#.##,###S#^#V#%%%%%%########.......##7#7#7#7##..##..####..##...#
X#..#S##,####\#%%%%%%####c..........##R#R#R#R##..##..####..##...#
X#..#^#%#####%%%%%%%%####c..........##.......##..###..##..###...#
X#.###,######%%%%%%%%########.......####GJG####..####....####...#
X#.##########################.....................####..####....#
X#.##########################.......####GPG####.....##AA##......#
X#.####..................####.......#####S#####.................#
X#..................................####GjG####.................#
X################################################################
X
X
END_OF_FILE
if test 4162 -ne `wc -c <'ocity.dat'`; then
    echo shar: \"'ocity.dat'\" unpacked with wrong size!
fi
# end of 'ocity.dat'
fi
if test -f 'ocountry.dat' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ocountry.dat'\"
else
echo shar: Extracting \"'ocountry.dat'\" \(4207 characters\)
sed "s/^X//" >'ocountry.dat' <<'END_OF_FILE'
X^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
X+^^^^^%^^^^^^^^^^^^^---^^^^^^^^^^^^^^^^((((((------^^^^^^^^^~~^^
X++^^~^^v^^^---------------((((((((((((((((((--------^^^^^^~~~~~^ 
X+++^^~^^v^^------------(((((((((((((((((((((((((------^^^~~~~|~^
X++++^^~^^v^------((((((((((((((^^^((((((((((------------^^^~v~~^
X++++^~^^v^^----------((((((((((^5^((((((((-------.......a~~^~~~^
X++++^^~d^^--------------(((((((^(^(((((---------.------~~^^^^^^^
X+++----~.......-----------((((((((((-----------.------~~--^^^^^^
X++++--~--------.......------((((((((((((------.-------~^^^^^^^^^
X+++++++---------------.......(((((((((-------.--------~~--^^^^^^
X+++++++----------------------......-.........--------~~-----^^^^
X+++++++++--------------((((((((((((b(((((((------^^3~~------^^^^
X++++++++++++---------------(((((((.(((((((------^^^~~-------^^^^
X++++++++++-------((((((((((((((((.(((((((((((((^^^-~~-------^^^^
X+++++++----------------(((((((((.(((((((((---^^^----~~------^^^^
X++++++++++++---------------((((.(((((((((--^^^-----~~---^^^^^^^^
X++++++++++++++++--------------.--------^^^^^------~~---^^^^^^^^^
X+++++++++++++++++++----------.------^^^^---------~~---^^^^^^^^^^
X++++++++++++++++++++++++----.---v^^^^^^^^-((((--~~----------^^^^
X+++++++++++++++++++++++++++O--^^^v^^^((((((((((((~~---^^^^^^^^^^
X+++++++++++++-------------.----^^^v^(((((((((((((~~(----^^^^^^^^
X++++++++++---------------.-^^^^^^(((((((((((((((~~((--------^^^^
X++++++++++++++++++++++...-^*^^^^(((((((((((((((~~((((((-----^^^^
X++++++++++++++++++-...-----^^^-(((((((((((((((~~(((((((((---^^^^
X+++++++++++++-----.------^^^^((((((((((((((((~~(((((((((----^^^^
X++++++++++-------.-----^^^^--((((((((((((((~~~(((((((((-----^^^^
X++++++++++++++++.------^^^-------(((((((((~~(((((((((((((---^^^^
X+++++++++++++++.------^^^---((((((((((((((~~(((((((--------^^^^^
X+++++++++++++++.-----^^^(((((((((((((((~~~~(((((((-------^^^^^^^
X+++++++++++++--.------vvv(((((((((((~~~~(((((((((-------^^^"^^^^
X+++++++++++++++.-----^1^-------((~~~~(((((((((((((((-^^^^^""^^^^
X+++++++++++++++.------^^^-----((~~~((((((((((((((((-^^^"""""^^^^
X++++++++++-----.----^^^------(((((~~(((((((((---^^^^""""""""^^^^
X++++++++-------.----^^^-(((((((((((~((((((((((((--^"""""""^^^^^^
X++++++---------.-----^^^(((((((((((~~((((((((((--^^^""""""""$^^^
X+++++++++++++++.----^^-(((((((((((~~((((((((((--^^^"""""""""^^^^
X+++++++++++++++.-----^^^^((((((((~~(((((((((-------""""""""^^^^^
X++++++++++++---.----^^^(((((((~~~~(((((((-----^^""""""""""""^^^^
X+++++++++++++++.---^^^-(((~~~~~(((((((------^^^"""""""""""""^^^^
X+++++++++++++++.---^^^^~~~~(((((----------^^^"""""""""""""""^^^^
X++++++++++c....-...~~~~~-((((((((((-----^^^^""""""""""""""""^^^^
X++++++++++++++~~~~~.f==-------------^^^^""""""""""""""""^^^^^^^^
X++++++++++++=====~==~======----^^^^^^^^^"""""""""""""""""""^^^^^
X+++++++++++=====~====~====---------------e""""""""""""""^^^^^^^^
X+++++++++++++++~====~====-^^-------^^^^^^"""""""""""""""""""^^^^
X+++++++++++++++====~====-^^------^^^"""""""""2"""""""""""---^^^^
X+++++++++++++=====~4~===---^-----^^"""""""""""---^^^^-------^^^^
X++++++++++=======~==~====---------^^"""""""""--^^-----------^^^^
X+++++++++++++===~====~====--^--------""""""---^^-)))-^^-----^^^^
X++++++++++++===~======~===---^^^^------------^^~)))))--^^---^^^^
X+++++++++++++++======~======-----^^^------^----)~)))))--^^^-^^^^
X+++++++++++++++=====~===^=======--~~~^^^-^---))))~))))))----^^^^
X++++++++++++++=====~=============~~=~~~~^^))))))))~))))))))-^^^^
X+++++++++++++++===~=~~~~~~=====~~~~====^^^^)))))))~)))))))^^^^^^
X++++&++++++++++==~========~~~~~~==~~~~===^^^)))))))~))))))))^^^^
X+++++=+++++++===~=~=========~===~~===~~~~~~^^)))))))~)))))^^^^^^
X++++++=++++++++~===~===^===~===~=====~====^^^^)))))))~))))))^^^^
X+++++++=+++++++====~~=====~===^=======~====^^)))))))))~)))))^^^+
X++++++++=+========~==~===~===^!^=======~===^^^))+++)))~)))^^^^++
X+++++++++=++=====~====~=~~====^=======~=~=^^^)))+6+))~)))^^^^+++
X++++++++++++====~======~==~++++======~===~==^^))+++))~^^^^^+++++
X++++++++++++++++========~++++++++===~====~^^^^^^^+^^^^~^^+++++++
X++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X	       						        
X	       						        
END_OF_FILE
if test 4207 -ne `wc -c <'ocountry.dat'`; then
    echo shar: \"'ocountry.dat'\" unpacked with wrong size!
fi
# end of 'ocountry.dat'
fi
if test -f 'ohelp1.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ohelp1.txt'\"
else
echo shar: Extracting \"'ohelp1.txt'\" \(3288 characters\)
sed "s/^X//" >'ohelp1.txt' <<'END_OF_FILE'
XOMEGA OVERVIEW
X==============
Xomega is a complex rogue-style game of dungeon exploration.  Unlike
Xother such games, there are a number of ways to "win", depending on
Xvarious actions taken during play. The ways you can get your name on
Xthe hiscore board include becoming the highest ranked head of a guild,
Xsect, college, etc., as well as gaining the most points figured from
Xpossessions and experience. The game (via the oracle) may impose some
Xstructure on your exploration, but you need not follow all of the
Xoracle's advice. There *is* a "total winner" status, by the way.
X
Xomega offers a richness of playing detail that goes beyond a simple
Xgame like rogue. However, the majority of gameplay is very similar to
Xrogue, hack, ultrarogue, larn, and other such games. The player is
Xrepresented by the highlighted "@" symbol, objects and terrain
Xfeatures are represented by non-alphabetic symbols, monsters are
Xrepresented by the various upper and lower case letters, and other
Xhumans are represented by a non-highlighted "@". It is recommended
Xthat the novice read the man pages for rogue or some other such game
Xand perhaps play a few games before playing omega. 
X
Xomega currently consists of a countryside in which are sited a city,
Xvarious villages, several dungeons, and some "special" sites, such as
Xthe temple HQ's of the various priesthoods. The game starts in the
Xcity of Rampart, where all the guilds have headquarters. As a dungeon
Xis explored, all generated levels are saved in memory. However, only
Xone dungeon is "remembered" at a time, so if you enter two dungeons,
Xthe first will be forgotten (it will be regenerated should you wish to
Xenter it again). However, if a dungeon is "completed", this fact will
Xbe remembered, basically meaning that the unique monster at the bottom
Xwill not be regenerated if you've killed him already. In addition,
Xsaving the game in a dungeon only saves the current level, so the
Xother levels will be recreated on reentry.
X
XYou will first want to explore the city of Rampart. Although the
Xarchitecture and important sites remain the same from game to game,
Xdetails such as the precise position of certain shops, etc. will
Xchange. Rampart is relatively safe if you don't wander into places
Xthat are obviously dangerous or do things like breaking and entering.
XIf you are reckless, it is quite possible to get killed before ever
Xfinding the dungeons. The 'M' command now allows you to return
Ximmediately to any establishment you have already visited that game,
Xand is preset to "know" the permanent locations of Rampart.
X
XMany Rampart establishments are only open in the daytime, but some are
Xonly active at night. Due to the stringent anti-crime measures taken
Xby the Duke, it is usually safe to sleep in the streets. You will find
Xit far more rewarding, however, to rent or purchase your own lodgings,
Xif you can afford them.
X
XThe point of omega, though, is dungeon exploration. There are a number
Xof dungeons hidden about the countryside. These dungeons are at
Xdifferent levels of difficulty and have various idiosyncratic
Xdifferences. The easiest are the Caves of the Goblin King, which is
Xdue south of Rampart, in the nearby mountains. The caves must be
Xsearched for with 's' command unless you are lucky enough to move
Xdirectly onto them.
END_OF_FILE
if test 3288 -ne `wc -c <'ohelp1.txt'`; then
    echo shar: \"'ohelp1.txt'\" unpacked with wrong size!
fi
# end of 'ohelp1.txt'
fi
if test -f 'ohelp12.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ohelp12.txt'\"
else
echo shar: Extracting \"'ohelp12.txt'\" \(4522 characters\)
sed "s/^X//" >'ohelp12.txt' <<'END_OF_FILE'
XDUNGEON/CITY COMMAND LIST:
X______________________________________________________________________________
Xkey  : description                                                : # seconds
X______________________________________________________________________________
X^f   : abort the spell of shadow form                             :     0
X^g   : enter wizard mode (WIZARD only)                            :     0
X^i   : list items in pack                                         :     5
X^l   : redraw screen (redraw each window)                         :     0
X^p   : print previous message (more or less)                      :     0
X^r   : redraw screen (redraw curscr)                              :     0
X^x   : make a wish (wizard mode only)                             :     0
X^w   : magic-map screen (wizard mode only)                        :     0
Xa    : activate a wand, staff, or rod                             :     10*
Xc    : close door                                                 :     2*
Xd    : drop object at current location                            :     5*
Xe    : eat something                                              :     30
Xf    : fire/throw something                                       :     5*
Xg    : pick up object at current location                         :     10*
Xi    : primary inventory mode (as per TOPINV option)              :  variable
Xm    : cast a magic spell                                         :     20
Xo    : open door                                                  :     5*
Xp    : pick the pocket of an adjacent monster                     :     20*
Xq    : quaff a potion                                             :     10
Xr    : read a scroll                                              :     30*
Xs    : search all around you, # of times = SEARCHNUM              :     20
Xt    : talk to an adjacent monster                                :     10
Xv    : vault over a few intervening spaces                        :     10*
Xx    : examine a location                                         :     1
Xz    : bash something (adjacent location)                         :     10
XA    : activate an item or artifact                               :     10
XC    : call an item something                                     :     0
XD    : disarm an adjacent trap                                    :     30
XE    : dismount (exit?) from your horse                           :     10*
XF    : set combat action sequence                                 :     0
XG    : give something to an adjacent monster                      :     15
XI    : secondary inventory mode (as per TOPINV option)            :  variable
XM    : move quickly to some discovered site (city only)           :  variable
XO    : set options                                                :     0
XP    : public license information                                 :     0
XQ    : quit                                                       :     0
XR    : rename character                                           :     0
XS    : save game and quit                                         :     0
XT    : dig a tunnel through a wall                                :     30*
XV    : version information                                        :     0
XZ    : bash something (item carried)                              :     10*
X.    : rest a turn                                                :     10
X,    : sleep some number of minutes                               :  60..6000
X@    : stay in current location, activating any local effect here :     5
X>    : go down a level                                            :     0~
X<    : go up a level                                              :     0~
X/    : identify the onscreen usage of some character              :     0
X
Xvi keys (hjklbnyu) & keypad number: 
X       walk one space or fight adjacent monster (Regular Combat
X       Mode), pick up things if PICKUP option set                 :     5*+
X
Xcapitalized vi keys (HJKLBNYU) or 5 followed by keypad number:
X       run in that direction, fight adjacent monster if
X       BELLIGERENT option set,don't display slowly if JUMPMOVE 
X       option set, stop for doorways, etc. if RUNSTOP option 
X       set.                                                       :     4*+
X
X?    : display or copy help files                                 :     0
X
X* Actual time taken varies according to SPEED factor.
X+ Takes longer in City or Village (different scale for movement)
X~ Reduced to 0 time by popular demand
END_OF_FILE
if test 4522 -ne `wc -c <'ohelp12.txt'`; then
    echo shar: \"'ohelp12.txt'\" unpacked with wrong size!
fi
# end of 'ohelp12.txt'
fi
if test -f 'ohelp2.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ohelp2.txt'\"
else
echo shar: Extracting \"'ohelp2.txt'\" \(3786 characters\)
sed "s/^X//" >'ohelp2.txt' <<'END_OF_FILE'
XCHARACTER CREATION AND DEVELOPMENT
X==================================
XYou will have the opportunity to create a new character each time you
Xstart up omega. A random selection of statistics will be generated.
XTo discourage sitting around trying to get an "optimal" character,
Xyou can only "reroll" 9 times before having to reload the game. Since
Xyour statistics tend to go up as you play, it isn't fatal to
Xhave low statistics when you start out. On the other hand, high stats
Xdon't hurt, either....
X
XEach statistic is very important, but depending what sort of character
Xyou wish to play, different statistics will stand out. Combat is
Xhelped by Strength and Dexterity, Magic-use is aided by Intelligence
Xand Power. Agility helps you avoid getting hit and avoid traps, while
XConstitution determines how many hits you can take before dying.
X
XA new option for omega is to "play yourself". By answering a sequence
Xof personal questions, omega arrives at what your personal statistics
Xshould be. It is in seriously bad taste to lie.... Only the character
Xyou create in this mode can be saved to the omegarc. The questions are
Xset up so that a "renaissance man" type of person will probably have
Xstats generally around 14-15. The rest of us will stay around 9-12 on
Xaverage. If you are really impressively good at something you can
Xstart out with a stat of up to 18, but this is pretty unlikely for
Xmost of us.
X
XAs you continue to play, you will hopefully accumulate experience and
Xtreasure. You can gain skills and abilities through various means,
Xthe most important being training in one of the Rampart establishments
Xdevoted to self-improvement. Thus, you can choose to work out at the
Xgym, study at the Collegium Magii, meditate at a Temple, and
Xso on. Certain skills and abilities may only be gained through
Xadventuring, and others are mutually exclusive. For example, you can
Xonly be a priest of one particular deity. One of the appeals of
Xomega is the variety of different types of characters you can play,
Xeach with its own set of goals and benefits.
X
XAnother aspect of your character is alignment. Characters are aligned
Xtowards the primal forces of Chaos and Law, or they can be neutral.
XVarious actions affect this factor; killing peaceful monsters, or
Xcommitting burgalry, for example, are chaotic acts.  Alignment
Xdetermines which guilds will let you in, the behavior of some
Xartifacts and monsters, as well as much else.
X
XYour character will gain various statuses, abilities, immunities,
Xetc., both harmful and beneficial. Most of the time these are kept
Xhidden from you, but there are various ways of discovering the truth
X-- self-knowledge is very useful in omega. Remember, the oracle
Xknows all, sees all....
X
XExperience is accrued for skillful actions in the game. As in rogue,
Xone of the main methods of acquiring experience is defeating monsters.
XYou need not kill an opponent to defeat it (you can use the 'threaten'
Xoption of the 't' command, sometimes).  There are many other ways of
Xgaining experience, though, including learning spells, deactivating
Xtraps, using artifacts correctly, etc. 
X
XExperience goes towards two kinds of character development. First,
Xin the bizarre tradition of role-playing games like * & *, hit
Xpoints and combat capabilities go up as experience is gained.
X
XSecondly, experience gained is shared out to each of the guilds,
Xpriesthoods, etc. that the character belongs to. The more guilds
Xthe character is a member of, the slower promotion will be
X(except in the City Nobility, and among the Gladiators, where
Xpromotion is not based on experience, but on quests and combats,
Xrespectively). Regardless of the number of guilds the character
Xis a member of, overall character level, the first type of
Xexperience will not be adversely affected.
END_OF_FILE
if test 3786 -ne `wc -c <'ohelp2.txt'`; then
    echo shar: \"'ohelp2.txt'\" unpacked with wrong size!
fi
# end of 'ohelp2.txt'
fi
if test -f 'ohelp3.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ohelp3.txt'\"
else
echo shar: Extracting \"'ohelp3.txt'\" \(5156 characters\)
sed "s/^X//" >'ohelp3.txt' <<'END_OF_FILE'
XINVENTORY
X=========
Xomega inventories are now much different from other rogue-like games.
X
XUnlike rogue, et al., you cannot directly employ every object you
Xcarry. Every object may either go into your "pack" or into some
Xspecific inventory slot such as "belt" or "ready hand" or "left
Xshoulder" etc. Some slots are dedicated to certain types of items (eg,
Xonly armor can go in the armor slot), but other slots are general
Xpurpose, like your belt or your shoulder.
X
XIt takes game time to transfer an object from your pack, (which can
Xhold a fixed number of items) to specific slots from which the item may be
Xuseable. The pack is implemented as a mock-stack, so the deeper you burrow
Xinto your pack looking for some item, the more game time you are
Xwasting. Therefore, carrying a whole lot of (semi)useless items may be
Xa strategically bad move.  Of course, as always, you can't carry more
Xweight (either in your pack or in your inventory slots) than is
Xdictated by your current STRENGTH and AGILITY.
X
XINVENTORY CONTROL MODES
X=======================
XThere are two type of inventory control: Display mode and Quick mode.
XWhich mode you use by default can be toggled by the TOPLINE option
Xsettable with the 'O' command and in your .omegarc file.
X
XIn Display mode, all the inventory slots are displayed in the menu
Xwindow. In Quick mode, only the message lines above the main window
Xare used, and therefore the slots are not all displayed, only
Xone of them at a time. Additionally, the commands are slightly 
Xdifferent. One nuance to the display -- note the character following
Xthe index of the slot in the following two lines.
X
X-- a> weapon hand: mace
X-- e) belt: short sword
X
XThe '>' in the first line indicates the mace is "in use", while 
Xthe ') in the second lines means the short sword is not currently
Xbeing used. If it is possible for an item to be "in use" in the
Xcurrent slot, it will be indicated by a '>'. Therefore, if you
Xdon't want to put some new unidentified weapon into use, don't
Xtry to carry it in the weapon hand; the same holds for shields
Xin the shield slot, etc.
X
XThe amount of time each action takes is indicated below. Dropping two
Xitems takes twice as long as dropping one item.
X
XDISPLAY MODE:
X^l,^r: Redisplay inventory (if screen is munged). Takes no time.
Xd:  Drop the item currently in the 'up-in-the-air' slot, or in the
X    'selected' slot if there is nothing 'up-in-the-air'. Takes one second.
Xp:  Put the 'up-in-the-air' item into your pack, or the 'selected'
X    item, if the 'up-in-the-air' item is vacant. Takes 5 seconds.
Xs:  Show the contents of your pack. Takes 5 seconds.
Xt:  Take an item from your pack and put into the 'selected' slot, or
X    if that is full, tries to put into the 'up-in-the-air' slot.
X    Takes 5 seconds + 1 second/item examined in pack. I.e., rummaging
X    at three items before taking one takes 8 seconds.
Xe:  Exchange the 'up-in-the-air' slot with the 'selected' slot. This
X    will merge two quantities of an item together if possible.
X    Either slot may be vacant, in which case it is a simple 'put'
X    or 'take' to a slot.
X    Takes 2 seconds.
Xx:  Same as 'e' but quit inventory mode immediately if the
X    up-in-the-air slot is vacant after the action (ie, if it wasn't
X    an exchange, but was just a put). Helpful when picking up new items.
X    Takes 2 seconds.
X>:  Cause the next slot lower down to be the 'selected' one. Takes no time.
X<:  Cause the next slot higher up to be the 'selected' one. Takes no time.
X?:  Print this help. Takes no time.
XESCAPE: return to game, dropping any object in the 'up-in-the-air' slot.
X        Takes no time.
X
XIn Display Mode, the 'selected' slot is the one with a highlighted
X'->' before it.
X
XQUICK (TOPINV) MODE:
Xd:  Drop an item. Takes one second.
Xp:  Put some item into your pack. Takes 5 seconds.
Xs:  Show the contents of your pack. Takes 5 seconds.
Xt:  Take an item from your pack and put into some inventory slot, or
X    into the 'up-in-the-air' slot if the one selected is full.
X    Takes 5 seconds + depth of item in pack.
Xe:  Exchange the 'up-in-the-air' slot with some slot. This
X    will merge two quantities of an item together if possible.
X    Either slot may be vacant, in which case it is a simple 'put'
X    or 'take' to a slot.
X    Takes 2 seconds.
Xx:  Same as 'e' but quit inventory mode immediately if the
X    up-in-the-air slot is vacant after the action (ie, if it wasn't
X    an exchange, but was just a put). Helpful when picking up new items.
X    Takes 2 seconds.
X~:  Enter Display Mode. Takes no time.
X?:  Print this help. Takes no time.
XESCAPE: return to game, dropping any object in the 'up-in-the-air' slot.
X        Takes no time.
X
XIn quick mode, there is no 'selected' slot, instead the letter
Xidentifying the slot must be entered following the command.
X
XThe 'e' and 'x' commands in both modes are the ones you'll use most;
Xit combines taking and putting from inventory slot to "up-in-air"
Xwhere picked-up items will be, and where you will drop items from on
Xleaving the inventory mode. Usually the pack is used for items which
Xit is not important to be able to get at easily, while inventory
Xslots are for useful items.
END_OF_FILE
if test 5156 -ne `wc -c <'ohelp3.txt'`; then
    echo shar: \"'ohelp3.txt'\" unpacked with wrong size!
fi
# end of 'ohelp3.txt'
fi
if test -f 'ohelp9.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ohelp9.txt'\"
else
echo shar: Extracting \"'ohelp9.txt'\" \(4139 characters\)
sed "s/^X//" >'ohelp9.txt' <<'END_OF_FILE'
XWHAT YOU SEE ON THE SCREEN 
X==========================
X
XMap: The large central area represents a map of the current
Xenvironment.  On it, the highlighted @ always represents the player,
Xletters represent monsters, non-highlighted @'s represent other
Xhumans, and other characters represent either objects or terrain
Xfeatures.  The map will take up as much of the screen as is possible,
Xso if you are running in a windowing system make the omega window as
Xlarge as it can be.
X
XSince the same character can represent different things or entities
X(even in the same environment), a good command to remember is 'x'
X(examine), which will tell you precisely what you are dealing with in
Xany situation. This is especially helpful before you have terrain
Xtypes like deep pools and lava pits (!) memorized.... You can use the
XCONFIRM option to avoid walking absent-mindedly into a trap, pool,
Xetc.  The '/' command will give you more general help, for example
Xtelling you that the ')' character represents a weapon. The '?'
Xcommand can give you either a command list or this file. The command
Xlists will differ depending whether you are in the countryside, or a
Xdungeon or city.
X
XMessages: Directly above the map window is a three line area that
Xshows current messages from the game describing what is going on.
XThe ^p command can show old messages (The last 10 are kept).
X
XLocation: Directly beneath the map window is a one line description
Xof your current location or environment.
X
XStatistics: Beneath the Location line are two lines that show
Xthe current state of the player's statistics such as strength,
Xdexterity, constitution, agility, intelligence, power, mana,
Xgold pieces, carrying capacity, etc. When the value given looks
Xlike  number1 / number2, number1 represents the current value,
Xand number2 represents a maximum value.
X
XFlags: In the upper right corner of the omega display, below the date
Xand time, and phase of the moon, you will see four flags: The top
Xdescribes your food status, the second describes your status with
Xrespect to poison, the third your health (diseased or healthy), and
Xthe fourth, your mode of transportation.  While you are diseased you
Xwill not regain hit points naturally. While you are poisoned you will
Xtake damage periodically until cured or killed (or the poison's effect
Xcan naturally fade).  When your food runs out, and you start starving,
Xyou will take more and more damage as time passes until finally you
Xdie of starvation. It's always a good idea to stock up at the
XCommandant's.... If you manage to acquire a horse, your SPEED will
Xprobably improve (unless you were very fast already). Regardless of
XSPEED, having a horse will save some time in countryside movement, and
Xmay also help out your combat strength. However, horses tend not to
Xenjoy going into dungeons....
X
XCombat Abilities: In the lower right of the display, your current
Xcombat abilities are displayed. These are:
X
XHit: is your current chance to hit with the weapon currently wielded,
X     the higher the better. This factor varies with your DEXTERITY,
X     experience level, and the weapon wielded.
XDmg: is the maximum amount of damage you can do with a hit. This factor
X     varies with your STRENGTH and the weapon wielded.
XDef: is your defensive rating, how hard it is for monsters to hit you. This
X     factor varies with your AGILITY and experience level, and with
X     the shield being used.
XArm: is your armor rating, how much damage is absorbed when a monster
X     hits you before you take damage. Armor only absorbs normal damage;
X     various effects and forms of magic may penetrate armor. This factor
X     varies with the armor worn.
XSpd: is a speed factor, how quickly or how slowly you move. This factor is
X     calculated about a base of 1.00; 2.00 means you move twice as fast;
X     0.50 means you move twice as slowly as normal. This factor varies
X     with your AGILITY and the amount of weight you are carrying.
X     Every monster has its own speed factor. The maximum speed is 5.0;
X     the minimum is ?
X
XMagic spells, special items, and monster effects can affect all these factors,
Xpositively and negatively.
END_OF_FILE
if test 4139 -ne `wc -c <'ohelp9.txt'`; then
    echo shar: \"'ohelp9.txt'\" unpacked with wrong size!
fi
# end of 'ohelp9.txt'
fi
if test -f 'ommove.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ommove.c'\"
else
echo shar: Extracting \"'ommove.c'\" \(5360 characters\)
sed "s/^X//" >'ommove.c' <<'END_OF_FILE'
X/* omega copyright (c) 1987,1988,1989 by Laurence Raphael Brothers */
X/* ommove.c */
X/* monster move functions */
X
X#include "oglob.h"
X
X
X/* like m_normal_move, but can open doors */
Xvoid m_smart_move(m)
Xstruct monster *m;
X{
X  m_simple_move(m);
X}
X
X/* not very smart, but not altogether stupid movement */
Xvoid m_normal_move(m)
Xstruct monster *m;
X{
X  m_simple_move(m);
X}
X
X
X/* used by both m_normal_move and m_smart_move */
Xvoid m_simple_move(m)
Xstruct monster *m;
X{
X  int dx = sign(Player.x - m->x);
X  int dy = sign(Player.y - m->y);
X  erase_monster(m);
X  if (m->hp < Monsters[m->id].hp/4) {
X    dx = - dx;
X    dy = - dy;
X    m->movef = M_MOVE_SCAREDY;
X    if (m->uniqueness == COMMON) {
X      strcpy(Str2,"The ");
X      strcat(Str2,m->monstring);
X    }
X    else strcpy(Str2,m->monstring);
X    if (m->possessions != NULL) {
X      strcat(Str2," drops its treasure and flees!");
X      m_dropstuff(m);
X    }
X    else strcat(Str2," flees!");
X    mprint(Str2);
X    m->speed = min(2,m->speed-1);
X  }
X  if ((! m_statusp(m,HOSTILE)) || 
X      (Player.status[INVISIBLE] > 0)) m_random_move(m);
X  else {
X    if (m_unblocked(m,m->x+dx,m->y+dy))
X      movemonster(m,m->x+dx,m->y+dy);
X    else if (dx == 0) {
X      if (m_unblocked(m,m->x+1,m->y+dy))
X	movemonster(m,m->x+1,m->y+dy);
X      else if (m_unblocked(m,m->x-1,m->y+dy))
X	movemonster(m,m->x-1,m->y+dy);
X    }
X    
X    else if (dy == 0) {
X      if (m_unblocked(m,m->x+dx,m->y+1))
X	movemonster(m,m->x+dx,m->y+1);
X      else if (m_unblocked(m,m->x+dx,m->y-1))
X	movemonster(m,m->x+dx,m->y-1);
X    }
X    
X    else {
X      if (m_unblocked(m,m->x+dx,m->y))
X	movemonster(m,m->x+dx,m->y);
X      else if (m_unblocked(m,m->x,m->y+dy))
X	movemonster(m,m->x,m->y+dy);
X    }
X  }
X}
X
X
X
X
Xvoid m_move_animal(m)
Xstruct monster *m;
X{
X  if (m_statusp(m,HOSTILE))
X    m_normal_move(m);
X  else m_scaredy_move(m);
X}
X
X
X
X
X/* same as simple move except run in opposite direction */
Xvoid m_scaredy_move(m)
Xstruct monster *m;
X{
X  int dx = -sign(Player.x - m->x);
X  int dy = -sign(Player.y - m->y);
X  erase_monster(m);
X  if (Player.status[INVISIBLE]) m_random_move(m);
X  else {
X    if (m_unblocked(m,m->x+dx,m->y+dy))
X      movemonster(m,m->x+dx,m->y+dy);
X    else if (dx == 0) {
X      if (m_unblocked(m,m->x+1,m->y+dy))
X	movemonster(m,m->x+1,m->y+dy);
X      else if (m_unblocked(m,m->x-1,m->y+dy))
X	movemonster(m,m->x-1,m->y+dy);
X    }
X    
X    else if (dy == 0) {
X      if (m_unblocked(m,m->x+dx,m->y+1))
X	movemonster(m,m->x+dx,m->y+1);
X      else if (m_unblocked(m,m->x+dx,m->y-1))
X	movemonster(m,m->x+dx,m->y-1);
X    }
X    
X    else {
X      if (m_unblocked(m,m->x+dx,m->y))
X	movemonster(m,m->x+dx,m->y);
X      else if (m_unblocked(m,m->x,m->y+dy))
X	movemonster(m,m->x,m->y+dy);
X    }
X  }
X}
X
X
X
X
X
X
X/* for spirits (and earth creatures) who can ignore blockages because
X   either they are noncorporeal or they can move through stone */
Xvoid m_spirit_move(m)
Xstruct monster *m;
X{
X  int dx = sign(Player.x - m->x);
X  int dy = sign(Player.y - m->y);
X  erase_monster(m);
X  if (m->hp < Monsters[m->id].hp/6) {
X    dx = -dx;
X    dy = -dy;
X  }
X
X  if (Player.status[INVISIBLE] > 0) m_random_move(m);
X  else movemonster(m,m->x+dx,m->y+dy);
X}
X
X
X  
X/* fluttery dumb movement */
Xvoid m_flutter_move(m)
Xstruct monster *m;
X{
X  int trange,range = distance(m->x,m->y,Player.x,Player.y);
X  int i,tx,ty,nx=m->x,ny=m->y;
X  erase_monster(m);
X  if (Player.status[INVISIBLE] > 0) m_random_move(m);
X  else {
X    for (i=0;i<8;i++) {
X      tx = m->x+Dirs[0][i];
X      ty = m->y+Dirs[1][i];
X      trange = distance(tx,ty,Player.x,Player.y);
X      if (m->hp < Monsters[m->id].hp/6) {
X	if ((trange > range) && m_unblocked(m,tx,ty)) {
X	  range = trange;
X	  nx = tx;
X	  ny = ty;
X	}
X      }
X      else if ((trange <= range) && m_unblocked(m,tx,ty)) {
X	range = trange;
X	nx = tx;
X	ny = ty;
X      }
X    }
X    movemonster(m,nx,ny);
X  }
X}
X
X
Xvoid m_follow_move(m)
Xstruct monster *m;
X{
X  if (! m_statusp(m,HOSTILE))
X    m_normal_move(m);
X  else m_scaredy_move(m);
X}
X
X
X
X/* allows monsters to fall into pools, revealed traps, etc */
Xvoid m_confused_move(m)
Xstruct monster *m;
X{
X  int i,nx,ny,done=FALSE;
X  erase_monster(m);
X  for (i=0;((i<8)&&(! done));i++) {
X    nx = m->x+random_range(3)-1;
X    ny = m->y+random_range(3)-1;
X    if (unblocked(nx,ny) && 
X	((nx != Player.x) || 
X	 (ny != Player.y))) {
X      done = TRUE;
X      movemonster(m,nx,ny);
X    }
X  }
X}
X
Xvoid m_random_move(m)
Xstruct monster *m;
X{
X  int i,nx,ny,done=FALSE;
X  erase_monster(m);
X  for (i=0;((i<8)&&(! done));i++) {
X    nx = m->x+random_range(3)-1;
X    ny = m->y+random_range(3)-1;
X    if (m_unblocked(m,nx,ny) && 
X	((nx != Player.x) || 
X	 (ny != Player.y))) {
X      done = TRUE;
X      movemonster(m,nx,ny);
X    }
X  }
X}
X
X    
X/* monster removed from play */
Xvoid m_vanish(m)
Xstruct monster *m;
X{
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  strcat(Str2," vanishes in the twinkling of an eye!");
X  mprint(Str2);
X  Level->site[m->x][m->y].creature = NULL;
X  erase_monster(m);
X  m->hp = -1; /* signals "death" -- no credit to payer, though */
X}
X
X/* monster still in play */
Xvoid m_teleport(m)
Xstruct monster *m;
X{
X  erase_monster(m);
X  if (m_statusp(m,AWAKE)) {
X    Level->site[m->x][m->y].creature = NULL;
X    putspot(m->x,m->y,getspot(m->x,m->y,FALSE));
X    findspace(&(m->x),&(m->y),-1);
X    Level->site[m->x][m->y].creature = m;
X  }
X}
END_OF_FILE
if test 5360 -ne `wc -c <'ommove.c'`; then
    echo shar: \"'ommove.c'\" unpacked with wrong size!
fi
# end of 'ommove.c'
fi
if test -f 'oscroll1.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'oscroll1.txt'\"
else
echo shar: Extracting \"'oscroll1.txt'\" \(2291 characters\)
sed "s/^X//" >'oscroll1.txt' <<'END_OF_FILE'
XTheogony of Omega,
X
Xbeing an explication of the Ways of the Gods of Omega.
X
XKnow ye, O ignorant ones, that Omega is the battleground of the mighty forces
Xof Law and Chaos. Powerful are the Champions and Avatars of the two great
Xforces, but most powerful of all are the Gods who, it is rumored, have
Xbeen summoned from other planes to represent the two forces.
X
XOn the side of Law:
X
X  Odin, God of Vengeance -- followers of Odin vow to eradicate the taint
Xof chaos wherever it may be found. Odin rewards his faithful with the
Xpower to strike strong blows against the Legions of Chaos.
X
X  Athena, Goddess of Justice -- devotees of Athena, while prepared to
Xfight the forces of chaos, choose a more intellectual approach to the
Xbattle, marshalling the more subtle powers of magic in their striving.
X
XOn the side of Chaos:
X
X  Set, God of Destruction -- worshippers of Set will follow any path to
Xdestroy and corrupt Law and its minions. Set teaches his followers powers
Xequally as potent as those of Odin.
X
X  Hecate, Goddess of Illusion -- Hecate matches Athena's wisdom with 
Xdeception, and matches Athena's defensive powers with destructive
Xabilities.
X
XFollowers of any of these deities must be careful to keep to the true path --
Xthe wrath of a God is fearsome.... It is also said the Gods are jealous --
Xhonoring another deity, even of the same alignment, is an extremely bad idea.
XOn the other hand, any act against a God of the opposite alignment would
Xbe looked on kindly by your patron deity.
X
XIt should be noted that there are still other Gods of Omega. The Druids
Xthink themselves beyond the struggles of Law and Chaos and attempt to
Xmaintain a Balance between the two -- they are despised by all the
Xaligned Gods. The ArchDruid is said to command powers greater than
Xany other cleric.
X
XThe mysterious Lords of Destiny are said to preside over the struggles
Xof Law and Chaos as a referee rules a bout. Their powers are said to
Xbe extremely subtle and pervasive, and while no one has ever seen this
Xpower displayed, the self-appointed clerics of these mysterious beings
Xclaim great abilities.  Certain it is that the aligned Gods have never
Xacted against the followers of the Lords of Destiny, though whether
Xthis is because of their power, or because they offer no threat, is
Xunknown.
END_OF_FILE
if test 2291 -ne `wc -c <'oscroll1.txt'`; then
    echo shar: \"'oscroll1.txt'\" unpacked with wrong size!
fi
# end of 'oscroll1.txt'
fi
echo shar: End of archive 19 \(of 20\).
cp /dev/null ark19isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 20 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0