[comp.sources.games] v06i034: ega-wanderer - wanderer 2.2 for EGA or curses, Patch3

games@tekred.CNA.TEK.COM (03/23/89)

Submitted-by: "Tony L. Hansen" <hansen@pegasus.att.com>
Posting-number: Volume 6, Issue 34
Archive-name: ega-wanderer/Patch3

	[Here is an additional patch which adds knowledge of the runkeys to
	 the help functions and man page.  The revised man page is enclosed
	 in its entirety (thanks to Tanya Katz).  -br]

#! /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 shell archive."
# Contents:  Patches03 wanderer.6
# Wrapped by billr@saab on Wed Mar 22 12:10:54 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Patches03' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Patches03'\"
else
echo shar: Extracting \"'Patches03'\" \(5109 characters\)
sed "s/^X//" >'Patches03' <<'END_OF_FILE'
X*** game.c.old	Thu Mar  9 13:23:07 1989
X--- game.c	Thu Mar 16 09:08:37 1989
X***************
X*** 361,367
X  
X  else if(ch == '?')
X      {
X!     helpme(keys);
X  #ifdef	EGA
X      if(EGAaddr)
X  	redraw_screen(&maxmoves,*num,*score,nf,diamonds,mx,sx,sy);
X--- 361,367 -----
X  
X  else if(ch == '?')
X      {
X!     helpme(keys,runkeys);
X  #ifdef	EGA
X      if(EGAaddr)
X  	redraw_screen(&maxmoves,*num,*score,nf,diamonds,mx,sx,sy);
X***************
X*** 441,447 ****
X  	}
X      continue;
X      }
X! else if(ch == 'R')    	/* restore game */
X      {
X      extern	struct	save_vars	zz;
X  
X--- 441,447 ----
X  	}
X      continue;
X      }
X! if(ch == 'R')    	/* restore game */
X      {
X      extern	struct	save_vars	zz;
X  
X*** help.c.old	Wed Feb 15 09:05:22 1989
X--- help.c	Thu Mar 16 09:08:01 1989
X***************
X*** 9,16
X  /* 5  */ "",
X  /* 6  */ " Then go through the exit:    %X",
X  /* 7  */ "",
X! /* 8  */ "  %h  Left       %j  Down",
X! /* 9  */ "  %k  Up         %l  Right",
X  /* 10 */ "  1  Loud       q  Quit game",
X  /* 11 */ "  0  Quiet      v  Look at map",
X  /* 12 */ "  S  Save game  R  Restore Game",
X--- 9,16 -----
X  /* 5  */ "",
X  /* 6  */ " Then go through the exit:    %X",
X  /* 7  */ "",
X! /* 8  */ "  %h,%H Left       %j,%J Down",
X! /* 9  */ "  %k,%K Up         %l,%L Right",
X  /* 10 */ "  1  Loud       q  Quit game",
X  /* 11 */ "  0  Quiet      v  Look at map",
X  /* 12 */ "  S  Save game  R  Restore Game",
X***************
X*** 119,125
X  "",
X  "   NEWNAME,NAME,FULLNAME,USER,LOGNAME : Checked in that order for your name",
X  "",
X! "   NEWKEYS : Redefine movement keys (default \"hlkj\")",
X  "",
X  "   SAVENAME : File used for saved games",
X  "",
X--- 119,125 -----
X  "",
X  "   NEWNAME,NAME,FULLNAME,USER,LOGNAME : Checked in that order for your name",
X  "",
X! "   NEWKEYS : Redefine movement keys (default \"hlkjHLKJ\")",
X  "",
X  "   SAVENAME : File used for saved games",
X  "",
X***************
X*** 134,141
X  "",
X  "",
X  "",
X! "     Keys are:     %h   Left                  %j   Down",
X! "                   %k   Up                    %l   Right",
X  "                   1   Loud                  q   Quit game",
X  "                   0   Quiet                 v   Look at map",
X  "                   S   Save game             R   Restore game",
X--- 134,141 -----
X  "",
X  "",
X  "",
X! "     Keys are:     %h,%H Left                  %j,%J Down",
X! "                   %k,%K Up                    %l,%L Right",
X  "                   1   Loud                  q   Quit game",
X  "                   0   Quiet                 v   Look at map",
X  "                   S   Save game             R   Restore game",
X***************
X*** 231,237
X  
X  static
X  char *
X! expand( y, line, keys )
X  char *line;
X  char *keys;
X  {
X--- 231,237 -----
X  
X  static
X  char *
X! expand( y, line, keys, runkeys )
X  char *line;
X  char *keys, *runkeys;
X  {
X***************
X*** 233,239
X  char *
X  expand( y, line, keys )
X  char *line;
X! char *keys;
X  {
X  	static char expansion[100];
X  	char *p;
X--- 233,239 -----
X  char *
X  expand( y, line, keys, runkeys )
X  char *line;
X! char *keys, *runkeys;
X  {
X  	static char expansion[100];
X  	char *p;
X***************
X*** 250,255
X  				case 'j': c = keys[1]; break;
X  				case 'k': c = keys[0]; break;
X  				case 'l': c = keys[3]; break;
X  				default:
X  					nextcoordinate->y = y;
X  					nextcoordinate->x = p - expansion;
X--- 250,259 -----
X  				case 'j': c = keys[1]; break;
X  				case 'k': c = keys[0]; break;
X  				case 'l': c = keys[3]; break;
X+ 				case 'H': c = runkeys[2]; break;
X+ 				case 'J': c = runkeys[1]; break;
X+ 				case 'K': c = runkeys[0]; break;
X+ 				case 'L': c = runkeys[3]; break;
X  				default:
X  					nextcoordinate->y = y;
X  					nextcoordinate->x = p - expansion;
X***************
X*** 269,275
X  
X  static
X  int
X! dopage( page, keys )
X  char **page;
X  char *keys;
X  {
X--- 273,279 -----
X  
X  static
X  int
X! dopage( page, keys, runkeys )
X  char **page;
X  char *keys, *runkeys;
X  {
X***************
X*** 271,277
X  int
X  dopage( page, keys )
X  char **page;
X! char *keys;
X  {
X  	struct graphics *p;
X  	char *line;
X--- 275,281 -----
X  int
X  dopage( page, keys, runkeys )
X  char **page;
X! char *keys, *runkeys;
X  {
X  	struct graphics *p;
X  	char *line;
X***************
X*** 285,291
X  #endif
X  	for( y = 0; line = *page++; ++y )
X  		{
X! 		line = expand( y, line, keys );
X  #ifdef	EGA
X  		if ( EGAaddr )
X  			egaputs( 0, 10*y, line );
X--- 289,295 -----
X  #endif
X  	for( y = 0; line = *page++; ++y )
X  		{
X! 		line = expand( y, line, keys, runkeys );
X  #ifdef	EGA
X  		if ( EGAaddr )
X  			egaputs( 0, 10*y, line );
X***************
X*** 322,329
X  }
X  
X  void
X! helpme(keys)	/* routine to show help menu. */
X! char *keys;
X  {
X  	char ***pages, **page;
X  
X--- 326,333 -----
X  }
X  
X  void
X! helpme(keys, runkeys)	/* routine to show help menu. */
X! char *keys, *runkeys;
X  {
X  	char ***pages, **page;
X  
X***************
X*** 335,341
X  		pages = texthelp;
X  
X  	while( page = *pages++ )
X! 		if( dopage(page,keys) == ' ' )
X  			break;
X  
X  #ifdef	EGA
X--- 339,345 -----
X  		pages = texthelp;
X  
X  	while( page = *pages++ )
X! 		if( dopage(page,keys,runkeys) == ' ' )
X  			break;
X  
X  #ifdef	EGA
END_OF_FILE
if test 5109 -ne `wc -c <'Patches03'`; then
    echo shar: \"'Patches03'\" unpacked with wrong size!
fi
# end of 'Patches03'
fi
if test -f 'wanderer.6' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'wanderer.6'\"
else
echo shar: Extracting \"'wanderer.6'\" \(3846 characters\)
sed "s/^X//" >'wanderer.6' <<'END_OF_FILE'
X'br $Header: EGA-WANDERER 2.2  03/14/89 S. Shipway $
X.TH WANDERER 6
X.SH NAME
X.ad
Xwanderer - collect treasure by wandering around
X.SH SYNOPSIS
Xwanderer [ -e [file] | -m | -c | -s | -f ]
X.SH DESCRIPTION
XThe object of the game is to move around, collecting treasure, and escape
Xthrough the exit.
XThe idea for the game came from the games 'Repton', 'Boulderdash'
Xand 'XOR', and was then developed further.
X.SH OPTIONS
XA list of the interesting command line options is given below.
X.TP 12
X.B -c
XReads credits file from SCREENPATH/credits
X.TP 12
X.B -m
XEnters hiscore table editor after prompting for the MASTERPASSWORD
X.TP 12
X.B -s
XShows hiscore table from HISCOREPATH.
X.TP 12
X.B -e [file]  
XIf file is given,
Xit will take this as the file to be edited. eg, 'wanderer -e screen.1'
Xwill edit the file 'screen.1' instead of './screen' (the default).
XIn Editor - x = quit edit without saving.
X.TP 12
X.B -f
XStarts game with map-type screen instead of normal screen - although
Xthis makes the game too easy...
X.sp 2
X.SH MOVING ABOUT
X.br
X.nf
X.ta 0.5i +1.25i +0.25i +0.75i
X
Xh,H	Left (walk,run)	1	Loud
Xj,J	Down	0	Quiet	<- Very useful!
Xk,K	Up	q	Quit game
Xl,L	Right	~	Jump level	**NB This means
X				you don't receive your bonus!
XS	Save Game       
XR	Restore Game
XW	Redraw screen	@	moves you to center of screen
X!	Look at map	#	toggle between normal and fullscreen
X?	On-line help
X
XThis is you:
X\ \|o
X<|>	You are a spider.
X	(At least, that's what you look like)
X.fi
X.bp
X.SH OBSTACLES, MONSTERS, ETC.
X.br
X.nf
X.ta 0.625i 1.0i
X.\" these characters look real funny in this source file because of
X.\" the \^ and \| padding characters added to make the spacing come
X.\" out correct for troff. (Tabs are also used for columnation.)
X  ###	-=-
X  ### and	=-=	Solid rock    
X
X  <O>		Time capsule (5 points, +250 moves)
X   .
X  . .		Passable earth  (one point)
X
X  /\|^\|\\
X  \\\^_\|/		Boulder (falls down, boulders and arrows fall off it)
X
X  <--	-->	Arrows       
X  <--  and	-->	(run left and right)     
X
X  /$\\		(10 points)       
X  \\$/		Money  (collect it) 
X
X  TTT		Cage. Holds baby monsters
X  \^I\|\^I\|\^I		and changes into diamond
X
X  -o-
X  /\^*\^\\		Baby monster (kills you)
X
X		When a baby monster hits a cage
X		it is captured and you get 50 points. 
X		Also the cage becomes a diamond.
X
X  !!!	I                            
X  !!!  and	o	Instant annihilation 
X
X
X  \\_	\|\|_/	Slopes                    
X    \|\|\\  and	/	(boulders etc slide off)     
X
X  }o{		Monster  (eats you up whole. Yum yum yum.)
X  /\^\|^\|\^\\		(100 points)  Kill with a rock or an arrow.
X
X  Way		The exit. Collect all the treasure first.
X  \|out		(250 point bonus)
X
X  (*)
X  (*)		Teleport  (50 points for using it)
X
X  /\|~\|\\		Baloon (new addition for version 2.2M).
X  \\_X		The balloon rises, and is popped by arrows. 
X		It does *not* kill you. 
X.fi
X.bp
X.SH ENVIRONMENT VARIABLES
X.TP 18
X.B NEWKEYS
XYou can define your own keys for movement by using the environment
Xvariable NEWKEYS.
XThe first set of four characters are for walking, the second set of
Xfour characters for running.
XFor example to use 'a' UP, 'z' DOWN, 'n' LEFT, 'm' RIGHT,
X'A' run UP, 'Z' run DOWN, 'N' run LEFT and 'M' run right,
Xadd
X.I setenv NEWKEYS aznmAZNM
Xto your .login or .cshrc file.  
X.TP 18
X.B NEWNAME or NAME
XUse either of these environment variables to change your name.
X.TP 18
X.B SAVENAME 
XFile used for saved games. Unless NO_ENCRYPTION has been #def'd,
Xthe saved games are encrypted.
X.SH AUTHOR
X.nf
XSteven Shipway 
Xmaujp@sol.warwick.ac.uk 
X{maujp,csupt}@uk.ac.warwick.cu
X...!mcvax!ukc!warwick!{maujp,csupt}
X
Xwith thanks to:
X.br
X	Mark (mjs@opal) for curing the bus error
X	James Beckett(cstrhey) for designing screens 5 and 6
X	Mike Taylor(maujf) for helpful suggestions
X.fi
X.LP
XPort for EGA Graphics by Rick Richardson (pcrat!rick@uunet.uu.net);
Xrunning feature and more porting by Tony Hansen (hansen@pegasus.att.com).
END_OF_FILE
if test 3846 -ne `wc -c <'wanderer.6'`; then
    echo shar: \"'wanderer.6'\" unpacked with wrong size!
fi
# end of 'wanderer.6'
fi
echo shar: End of shell archive.
exit 0