[comp.sources.games.bugs] Wanderer2 - movement counter enhancements

john@sysint.UUCP (John Abbott) (11/09/88)

The following enhancement changes the way in which wanderer counts the # of 
moves which the user has made.  In particular, only moves which result in
some movement are counted; Invalid input is not counted as a move any longer.

Apply the following patches using Larry Wall's patch program:

*** /tmp/,RCSt1a12150	Fri Nov  4 14:39:44 1988
--- game.c	Fri Nov  4 10:30:06 1988
***************
*** 132,138
  int  x,y,nx,ny,deadyet =0,
       sx = -1,sy = -1,tx = -1,ty = -1,lx = 0,ly = 0,mx = -1,my = -1,
       bx, by, nbx, nby,
!      newnum,
       max_score = 250,
       diamonds = 0, nf = 0,hd ,vd ,xdirection,ydirection;
  char (*frow)[ROWLEN+1] = screen,

--- 132,138 -----
  int  x,y,nx,ny,deadyet =0,
       sx = -1,sy = -1,tx = -1,ty = -1,lx = 0,ly = 0,mx = -1,my = -1,
       bx, by, nbx, nby,
!      newnum, moved,
       max_score = 250,
       diamonds = 0, nf = 0,hd ,vd ,xdirection,ydirection;
  char (*frow)[ROWLEN+1] = screen,
***************
*** 257,262
  	ny++;
  if(ch == keys[0])
          ny--;
  if(ch == '1')                  /* Add or get rid of that awful sound */
  	{
          move(10,45);

--- 257,263 -----
  	ny++;
  if(ch == keys[0])
          ny--;
+ moved = (nx != x) || (ny != y);	/* remember if we have moved */
  if(ch == '1')                  /* Add or get rid of that awful sound */
  	{
          move(10,45);
***************
*** 621,626
  	refresh();
          break;
      default:
          break;
      }
  if((y == ny) && (x == nx) && (maxmoves>0))

--- 622,628 -----
  	refresh();
          break;
      default:
+ 		moved = 0;	/* we didn't move! */
          break;
      }
  if(moved && (maxmoves>0))
***************
*** 623,629
      default:
          break;
      }
! if((y == ny) && (x == nx) && (maxmoves>0))
      {
      (void) sprintf(buffer,"Moves remaining = %d ",--maxmoves);
      move(15,48);

--- 625,631 -----
  		moved = 0;	/* we didn't move! */
          break;
      }
! if(moved && (maxmoves>0))
      {
      (void) sprintf(buffer,"Moves remaining = %d ",--maxmoves);
      move(15,48);
-- 
      /\    John Abbott                       Systems Interface Inc.
     /  \   VOICE: (613) 230-4103             560 Rochester St, 2nd Floor
    /----\  FAX:   (613) 230-6928             Ottawa, Ontario, CANADA  K1S 5K2
\__/      \ UUCP:  uunet!mnetor!dciem!nrcaer!cognos!sysint!john

play@cwi.nl (The MC Funhouse Master) (11/18/88)

In article <154@sysint.UUCP> john@sysint.UUCP (John Abbott) writes:
 > The following enhancement changes the way in which wanderer counts the # of 
 > moves which the user has made.  In particular, only moves which result in
 > some movement are counted; Invalid input is not counted as a move any longer.
 > 
 > ...
 > 
It may be that invalid input is not counted as a move any longer, but still
various things will happen (monsters will still move etc.).
I do not think this must be included in the game.
If you have problems with the maximal number of moves alloted for some
screens, try to be a bit more efficient.  All screens are pretty generous
with the maximal number of moves.
-- 
Game Keeper
Mail: play@cwi.nl