home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
TOP
/
USR
/
SRC
/
wanderer2.t.Z
/
wanderer2.t
/
patches01
< prev
next >
Wrap
Text File
|
1988-12-02
|
31KB
|
1,176 lines
*** Makefile.orig Tue Nov 29 16:43:18 1988
--- Makefile Tue Nov 29 16:44:07 1988
***************
*** 2,8 ****
# modified again by play@cwi.nl
# and again by me.. maujp@uk.ac.warwick.cu
! OBJ = m.o save.o jump.o display.o icon.o game.o read.o help.o fall.o scores.o edit.o
CFLAGS = -O
LIBS = -lcurses -ltermcap
--- 2,8 ----
# modified again by play@cwi.nl
# and again by me.. maujp@uk.ac.warwick.cu
! OBJ = m.o save.o jump.o display.o icon.o game.o read.o help.o fall.o scores.o edit.o encrypt.o
CFLAGS = -O
LIBS = -lcurses -ltermcap
*** display.c.orig Tue Nov 29 16:43:20 1988
--- display.c Tue Nov 29 16:44:16 1988
***************
*** 26,35 ****
addch(ch);
}
else
! if(ch==' '||ch=='#'||ch=='<'||ch=='>'||ch=='O'||ch==':'||
ch=='/'||ch=='\\'||ch=='*'||ch=='='||ch=='@'||ch=='T'||
ch=='X'||ch=='!'||ch=='M'||ch=='S'||ch=='C'||ch=='+'||
! ch=='A')
addch(ch);
else
addch('"');
--- 26,35 ----
addch(ch);
}
else
! if(ch==' '||ch=='#'||ch=='<'||ch=='>'||ch=='O'||ch==':'||
ch=='/'||ch=='\\'||ch=='*'||ch=='='||ch=='@'||ch=='T'||
ch=='X'||ch=='!'||ch=='M'||ch=='S'||ch=='C'||ch=='+'||
! ch=='A'||ch=='^')
addch(ch);
else
addch('"');
***************
*** 114,117 ****
--- 114,151 ----
} /* end y loop */
move(16,0);
refresh();
+ }
+ void redraw_screen(maxmoves,num,score,nf,diamonds,mx,sx,sy,frow)
+ int maxmoves,num,score,nf,diamonds,mx,sx,sy;
+ char **frow;
+ {
+ char buffer[50];
+ clear();
+ move(0,48);
+ (void) addstr("Score\t Diamonds");
+ move(1,48);
+ (void) addstr("\tFound\tTotal");
+ move(3,48);
+ (void) sprintf(buffer,"%d\t %d\t %d ",score,nf,diamonds);
+ (void) addstr(buffer);
+ move(6,48);
+ (void) sprintf(buffer,"Current screen %d",num);
+ (void) addstr(buffer);
+ if(maxmoves != 0)
+ (void) sprintf(buffer,"Moves remaining = %d ",maxmoves);
+ else
+ {
+ (void) strcpy(buffer," Unlimited moves ");
+ maxmoves = -1;
+ };
+ move(15,48);
+ (void) addstr(buffer);
+ if(mx != -1) /* tell player if monster exists */
+ draw_symbol(48,10,'M');
+ else
+ draw_symbol(48,10,' ');
+ if(!debug_disp)
+ display(sx,sy,frow,score);
+ else
+ map(frow);
}
*** edit.c.orig Tue Nov 29 16:43:08 1988
--- edit.c Tue Nov 29 16:44:20 1988
***************
*** 3,15 ****
extern char *playscreen();
extern int debug_disp;
extern char screen[NOOFROWS][ROWLEN+1];
- /* Print instructions around the screen */
- void instruct()
- {
static char *inst[] = { "O Boulder",
"< > Arrows",
": Earth",
"! Landmine",
"* Treasure",
--- 3,14 ----
extern char *playscreen();
extern int debug_disp;
+ extern char *edit_screen;
extern char screen[NOOFROWS][ROWLEN+1];
static char *inst[] = { "O Boulder",
"< > Arrows",
+ "^ Balloon",
": Earth",
"! Landmine",
"* Treasure",
***************
*** 16,22 ****
"/ \\ Deflectors",
"+ Cage",
"= # Rock",
! "T Teleport (1 max)",
"A Arrival (1 max)",
"X Exit (always 1)",
"@ Start (always 1)",
--- 15,21 ----
"/ \\ Deflectors",
"+ Cage",
"= # Rock",
! "T Teleport",
"A Arrival (1 max)",
"X Exit (always 1)",
"@ Start (always 1)",
***************
*** 23,48 ****
"M Big Monster (1 max)",
"S Baby Monster",
"- Alternative space",
! "C Time Capsule" };
int loop;
! for(loop = 1;loop < 17; loop++)
{
! move(loop,55);
! addstr(inst[loop-1]);
}
! move(21,0);
! addstr("Use wanderer keys to move. q = quit, p/n = play, m = change no. of moves.");
}
void noins()
{
int loop;
! for(loop =1;loop < 17; loop++)
{
! move(loop,55);
addstr(" ");
}
! move(21,0);
addstr(" ");
}
--- 22,53 ----
"M Big Monster (1 max)",
"S Baby Monster",
"- Alternative space",
! "C Time Capsule",
! NULL };
! /* Print instructions around the screen */
! void instruct()
! {
int loop;
! for(loop = 0; inst[loop] ; loop++)
{
! move(loop+1,55);
! addstr(inst[loop]);
}
! move(20,0);
! addstr("Use wanderer keys to move. m = change no. of moves, p = play game\n");
! addstr("n = play game with full screen, q = quit, x = quit without save.");
}
void noins()
{
int loop;
! for(loop =0; inst[loop] ; loop++)
{
! move(loop+1,55);
addstr(" ");
}
! move(20,0);
! addstr(" \n");
addstr(" ");
}
***************
*** 54,60 ****
*score;
char keys[10];
{
! int x,y,sx=0,sy=0,quit=0,nx,ny;
char (*frow)[ROWLEN+1] = screen,
ch;
char buffer[50];
--- 59,65 ----
*score;
char keys[10];
{
! int x,y,sx=0,sy=0,quit=0,nx,ny,nosave =0;
char (*frow)[ROWLEN+1] = screen,
ch;
char buffer[50];
***************
*** 107,116 ****
}
else if(ch == 'q')
{
! move(19,0);
! addstr(" ");
break;
}
else if(ch == 'm') /* change to number of moves for the screen */
{
move(19,0);
--- 112,141 ----
}
else if(ch == 'q')
{
! noins();
break;
}
+ else if(ch == 'x')
+ {
+ noins();
+ move(20,0);
+ addstr("You will lose any changes made this session - sre you sure? (y/n)");
+ refresh();
+ ch = getch();
+ if(ch != 'y')
+ {
+ noins();
+ instruct();
+ refresh();
+ }
+ else
+ {
+ nosave = 1;
+ addstr("\n");
+ refresh();
+ break;
+ }
+ }
else if(ch == 'm') /* change to number of moves for the screen */
{
move(19,0);
***************
*** 132,138 ****
else if(ch == 'p' || ch == 'n') /* play the game (test) */
{
noins();
! wscreen(num,maxmoves);
if(ch == 'p')
{
debug_disp = 0;
--- 157,163 ----
else if(ch == 'p' || ch == 'n') /* play the game (test) */
{
noins();
! wscreen(num,maxmoves);
if(ch == 'p')
{
debug_disp = 0;
***************
*** 181,192 ****
y=ny;
}
! for(y = 0; y<NOOFROWS;y++) /* certain editors - eg ded - have a */
! /* habit of truncating trailing spaces*/
! /* so this should stop them! */
! if(screen[y][ROWLEN-1] == ' ')
! screen[y][ROWLEN-1] = '-';
! wscreen(num,maxmoves);
move(20,0);
refresh();
}
--- 206,221 ----
y=ny;
}
! if(! nosave)
! {
! for(y = 0; y<=NOOFROWS;y++) /* certain editors - eg ded - have a */
! /* habit of truncating trailing spaces*/
! /* so this should stop them! */
! if(screen[y][ROWLEN-1] == ' ')
! screen[y][ROWLEN-1] = '-';
! wscreen(num,maxmoves);
! }
! noins();
move(20,0);
refresh();
}
*** fall.c.orig Tue Nov 29 16:43:09 1988
--- fall.c Tue Nov 29 16:44:26 1988
***************
*** 26,36 ****
int x,y,sx,sy, *mx, *my;
char howdead[25];
{
! int nx = x,nyl = y,nyr = y,retval = 0;
if ((y>(NOOFROWS-1))||(y<0)||(x<0)||(x>(ROWLEN-1)))
return(0);
if((screen[y][x] != 'O') && (screen[y][x] != ' ') && (screen[y][x] != 'M') &&
! (screen[y][x] !='\\') && (screen[y][x] != '/') && (screen[y][x] != '@'))
return(0);
if(screen[y][x] == 'O')
{
--- 26,37 ----
int x,y,sx,sy, *mx, *my;
char howdead[25];
{
! int nx = x,nxu = x,nyl = y,nyr = y,retval = 0;
if ((y>(NOOFROWS-1))||(y<0)||(x<0)||(x>(ROWLEN-1)))
return(0);
if((screen[y][x] != 'O') && (screen[y][x] != ' ') && (screen[y][x] != 'M') &&
! (screen[y][x] !='\\') && (screen[y][x] != '/') && (screen[y][x] != '@') &&
! (screen[y][x] != '^'))
return(0);
if(screen[y][x] == 'O')
{
***************
*** 43,48 ****
--- 44,58 ----
else
nx = -1;
}
+ if((screen[y][x-1] == ' ') && (screen[y+1][x-1] == ' '))
+ nxu--;
+ else
+ {
+ if((screen[y][x+1] == ' ') && (screen[y+1][x+1] == ' '))
+ nxu++;
+ else
+ nxu = -1;
+ }
if((screen[y-1][x] == ' ') && (screen[y-1][x+1] == ' '))
nyr--;
else
***************
*** 66,71 ****
--- 76,83 ----
{
if(screen[y-1][++nx] != ' ')
nx = -1;
+ if(screen[y+1][--nxu] != ' ')
+ nxu = -1;
if(screen[--nyr][x+1] != ' ')
nyr = -1;
if(screen[++nyl][x-1] != ' ')
***************
*** 75,80 ****
--- 87,94 ----
{
if(screen[y-1][--nx] != ' ')
nx = -1;
+ if(screen[y+1][++nxu] != ' ')
+ nxu = -1;
if(screen[++nyr][x+1] != ' ')
nyr = -1;
if(screen[--nyl][x-1] != ' ')
***************
*** 82,88 ****
}
if((screen[y][nx] != ' ') && (screen[y][nx] != 'M'))
nx = -1;
! if((screen[y-1][x] == 'O') && (nx >= 0) && (y > 0)) /* boulder falls ? */
{
screen[y-1][x] = ' ';
if(screen[y][nx] == '@')
--- 96,103 ----
}
if((screen[y][nx] != ' ') && (screen[y][nx] != 'M'))
nx = -1;
! if((screen[y-1][x] == 'O') && (nx >= 0) && (y > 0) &&
! (screen[y][nx] != '^')) /* boulder falls ? */
{
screen[y-1][x] = ' ';
if(screen[y][nx] == '@')
***************
*** 124,130 ****
screen[y+1][nx] = ' ';
}
}
! if((screen[nyr][x] != ' ')&&(screen[nyr][x] != 'M'))
nyr = -1;
if((screen[y][x+1] == '<')&&(nyr>=0)&&(x+1<ROWLEN)) /* arrow moves ( < ) ? */
{
--- 139,145 ----
screen[y+1][nx] = ' ';
}
}
! if((screen[nyr][x] != '^')&&(screen[nyr][x] != ' ')&&(screen[nyr][x] != 'M'))
nyr = -1;
if((screen[y][x+1] == '<')&&(nyr>=0)&&(x+1<ROWLEN)) /* arrow moves ( < ) ? */
{
***************
*** 168,174 ****
screen[nyr][x-1] = ' ';
}
}
! if((screen[nyl][x] != ' ')&&(screen[nyl][x] != 'M'))
nyl = -1;
if((screen[y][x-1] == '>')&&(nyl>=0)&&(x>0)) /* arrow moves ( > ) ? */
{
--- 183,189 ----
screen[nyr][x-1] = ' ';
}
}
! if((screen[nyl][x] != ' ')&&(screen[nyl][x] != '^')&&(screen[nyl][x] != 'M'))
nyl = -1;
if((screen[y][x-1] == '>')&&(nyl>=0)&&(x>0)) /* arrow moves ( > ) ? */
{
***************
*** 211,216 ****
--- 226,256 ----
*mx = *my = -2;
screen[nyl][x+1] = ' ';
}
+ }
+ if(screen[y][nxu] != ' ')
+ nxu = -1;
+ if((screen[y+1][x] == '^') && (nxu >= 0) && (y < NOOFROWS) &&
+ (screen[y][x] != '^')) /* balloon rises? */
+ {
+ screen[y+1][x] = ' ';
+ screen[y][nxu] = '^';
+ if(!debug_disp)
+ {
+ if((y<(sy+3)) && (y>(sy-5)) && (x>(sx-6)) && (x<(sx+6)))
+ draw_symbol((x-sx+5)*3,(y-sy+4)*2,' ');
+ if((y<(sy+4)) && (y>(sy-4)) && (nxu>(sx-6)) && (nxu<(sx+6)))
+ draw_symbol((nxu-sx+5)*3,(y-sy+3)*2,'^');
+ }
+ else
+ {
+ move(y+2,x+1);
+ addch(' ');
+ move(y+1,nxu+1);
+ addch('^');
+ }
+ refresh();
+ retval+=fall(mx,my,nxu ,y-1,sx,sy,howdead);
+ retval+=check(mx,my,x,y+1,0,-1,sx,sy,howdead);
}
if(retval>0)
return(1);
*** game.c.orig Tue Nov 29 16:43:11 1988
--- game.c Tue Nov 29 16:44:31 1988
***************
*** 1,7 ****
#include "wand_head.h"
#define viable(x,y) (((screen[y][x] == ' ') || (screen[y][x] == ':') ||\
! (screen[y][x] == '@') || (screen[y][x] == '+')) && (y >= 0) &&\
(x >= 0) && (y < NOOFROWS) && (x < ROWLEN))
/* typedef struct mon_rec *//* M002 struct mon_rec moved */
--- 1,8 ----
#include "wand_head.h"
#define viable(x,y) (((screen[y][x] == ' ') || (screen[y][x] == ':') ||\
! (screen[y][x] == '@') || (screen[y][x] == '+') ||\
! (screen[y][x] == 'S')) && (y >= 0) &&\
(x >= 0) && (y < NOOFROWS) && (x < ROWLEN))
/* typedef struct mon_rec *//* M002 struct mon_rec moved */
***************
*** 33,38 ****
--- 34,40 ----
extern void map();
+ extern void redraw_screen();
extern int debug_disp;
extern int edit_mode;
extern int saved_game;
***************
*** 131,137 ****
{
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;
--- 133,139 ----
{
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, tmpx,tmpy,
newnum,
max_score = 250,
diamonds = 0, nf = 0,hd ,vd ,xdirection,ydirection;
***************
*** 249,261 ****
nx=x;
ny=y;
! if(ch == keys[3]) /* move about - but thats obvious */
nx++;
! if(ch == keys[2])
nx--;
! if((ch == keys[1]) && (y<(NOOFROWS-1)))
ny++;
! if(ch == keys[0])
ny--;
if(ch == '1') /* Add or get rid of that awful sound */
{
--- 251,263 ----
nx=x;
ny=y;
! if((ch == keys[3]) && (x <(ROWLEN-1))) /* move about - but thats obvious */
nx++;
! if((ch == keys[2]) && (x > 0))
nx--;
! if((ch == keys[1]) && (y <(NOOFROWS-1)))
ny++;
! if((ch == keys[0]) && (y > 0))
ny--;
if(ch == '1') /* Add or get rid of that awful sound */
{
***************
*** 305,313 ****
--- 307,348 ----
if(ch == '?')
{
helpme();
+ if(debug_disp)
+ map(frow);
+ else
+ display(sx,sy,frow,*score);
+ continue;
+ }
+ if((ch == '@')&&(!debug_disp))
+ {
+ sx = x;
+ sy = y;
display(sx,sy,frow,*score);
continue;
}
+ if(ch == '#')
+ {
+ debug_disp = 1 - debug_disp;
+ if(debug_disp)
+ map(frow);
+ else
+ {
+ for(tmpy=0;tmpy<=(NOOFROWS+1);tmpy++)
+ {
+ move(tmpy,0);
+ for(tmpx=0;tmpx<=(ROWLEN+2);tmpx++)
+ addch(' ');
+ }
+ sx = x; sy = y;
+ display(sx,sy,frow,*score);
+ }
+ continue;
+ }
+ if(ch == 'W')
+ {
+ redraw_screen(maxmoves,*num,*score,nf,diamonds,mx,sx,sy,frow);
+ continue;
+ }
/* M002 Added save/restore game feature. Gregory H. Margo */
if(ch == 'S') /* save game */
***************
*** 463,468 ****
--- 498,536 ----
x = nx;
}
break;
+ case '^':
+ if(screen[y][nx*2-x] == ' ')
+ {
+ screen[y][nx*2-x] = '^';
+ screen[y][x] = ' ';
+ screen[ny][nx] = '@';
+ if(!debug_disp)
+ {
+ draw_symbol((x-sx+5)*3,(y-sy+3)*2,' ');
+ draw_symbol((nx-sx+5)*3,(ny-sy+3)*2,'@');
+ if(nx*2-x>sx-6&&nx*2-x<sx+6)
+ draw_symbol((nx*2-x-sx+5)*3,(y-sy+3)*2,'^');
+ }
+ else
+ {
+ move(y+1,x+1);
+ addch(' ');
+ move(ny+1,nx+1);
+ addch('@');
+ move(y+1,nx*2-x+1);
+ addch('^');
+ }
+ deadyet += fall(&mx,&my,nx*2-x,y-1,sx,sy,howdead);
+ deadyet += fall(&mx,&my,x*2-nx,y,sx,sy,howdead);
+ deadyet += fall(&mx,&my,x,y,sx,sy,howdead);
+ deadyet += fall(&mx,&my,x,y+1,sx,sy,howdead);
+ deadyet += fall(&mx,&my,x,y-1,sx,sy,howdead);
+ move(16,0);
+ refresh();
+ y = ny;
+ x = nx;
+ }
+ break;
case '<':
case '>':
if(screen[ny*2-y][x] == 'M')
***************
*** 718,730 ****
refresh();
}
! current = &start_of_list;
while((current != tail_of_list)&&(!deadyet))
/* deal with those little monsters */
{
monster = current->next;
new_disp = new_direction( monster->x, monster->y, monster->mx, monster->my );
! if(monster->under!='S')
{
screen[monster->y][monster->x] = monster->under;
if(!debug_disp)
--- 786,798 ----
refresh();
}
! current = &start_of_list; /* baby monsters now */
while((current != tail_of_list)&&(!deadyet))
/* deal with those little monsters */
{
monster = current->next;
new_disp = new_direction( monster->x, monster->y, monster->mx, monster->my );
! if(monster->under!='S') /* if on top of another baby */
{
screen[monster->y][monster->x] = monster->under;
if(!debug_disp)
*** help.c.orig Tue Nov 29 16:43:21 1988
--- help.c Tue Nov 29 16:44:35 1988
***************
*** 10,24 ****
" Collect all the treasure: /$\\ ", /* 4 */
" \\$/ ", /* 5 */
" Then go through the exit: Way ", /* 6 */
! " Default keys are: out ", /* 7 */
" h Left j Down ", /* 8 */
" k Up l Right ", /* 9 */
" 1 Loud q Quit game ", /* 10 */
" 0 Quiet ! Look at map ", /* 11 */
" S Save game R Restore Game ", /* 12 */
! " ? Enter help mode ", /* 13 */
! " ~ Jump to next level ", /* 14 */
! " (does not receive level bonus)", /* 15 */
"This is you: You are a spider. ", /* 0 */
" o (At least, that's ", /* 1 */
--- 10,24 ----
" Collect all the treasure: /$\\ ", /* 4 */
" \\$/ ", /* 5 */
" Then go through the exit: Way ", /* 6 */
! " out ", /* 7 */
" h Left j Down ", /* 8 */
" k Up l Right ", /* 9 */
" 1 Loud q Quit game ", /* 10 */
" 0 Quiet ! Look at map ", /* 11 */
" S Save game R Restore Game ", /* 12 */
! " ? Help mode @ Center screen ", /* 13 */
! " ~ Jump level # Switch mode ", /* 14 */
! " nb: No level bonus for jumping. ", /* 15 */
"This is you: You are a spider. ", /* 0 */
" o (At least, that's ", /* 1 */
***************
*** 58,65 ****
"is captured and you get 50 points. ", /* 1 */
"The cage also becomes a diamond. ", /* 2 */
" ", /* 3 */
! " !!! and I Instant annihilation ", /* 4 */
! " !!! o ", /* 5 */
" ", /* 6 */
" \\_ _/ Slopes (boulders ", /* 7 */
" \\ and / and etc slide off) ", /* 8 */
--- 58,65 ----
"is captured and you get 50 points. ", /* 1 */
"The cage also becomes a diamond. ", /* 2 */
" ", /* 3 */
! " I Instant annihilation ", /* 4 */
! " o ", /* 5 */
" ", /* 6 */
" \\_ _/ Slopes (boulders ", /* 7 */
" \\ and / and etc slide off) ", /* 8 */
***************
*** 70,75 ****
--- 70,91 ----
" ", /* 3 */
" Way Exit -- Must Collect all the ", /* 4 */
" out treasure first. (250 bonus) ", /* 5 */
+ " /~\\ A new addition for version ", /* 0 */
+ " \\_X 2.2M . The balloon rises, ", /* 1 */
+ " and is popped by arrows. It ", /* 2 */
+ " does *not* kill you. ", /* 3 */
+ " ", /* 4 */
+ " OOO Unrecognised symbol in map. ", /* 5 */
+ " OOO This is probably a **bug** ! ", /* 6 */
+ " ", /* 7 */
+ " ENVIRONMENT VARIABLES: ", /* 8 */
+ " ", /* 9 */
+ " NEWNAME,NAME : Checked in that ", /* 0 */
+ " order for the hiscore table ", /* 1 */
+ " NEWKEYS : Redefine movement keys", /* 2 */
+ " eg- 'hlkj' for default ", /* 3 */
+ " SAVENAME : File used for saved ", /* 4 */
+ " games. ", /* 5 */
};
***************
*** 81,87 ****
char *ptr; /* pointer in array.. */
char ch;
! for(i1 = 0; i1 < 4; i1++) /* times to show loop. */
{
for(i = 0; i < 16; i++) /* show one menu. */
{
--- 97,103 ----
char *ptr; /* pointer in array.. */
char ch;
! for(i1 = 0; i1 < 5; i1++) /* times to show loop. */
{
for(i = 0; i < 16; i++) /* show one menu. */
{
*** icon.c.orig Tue Nov 29 16:43:22 1988
--- icon.c Tue Nov 29 16:44:40 1988
***************
*** 9,83 ****
(*iconrow)[4] = icon;
switch(ch)
{
! case ' ':
! strcpy((*iconrow++)," ");
! strcpy((*iconrow)," ");
break;
! case '#':
strcpy(*iconrow++,"###");
! strcpy(*iconrow,"###");
break;
! case '<':
strcpy(*iconrow++,"<--");
! strcpy(*iconrow,"<--");
break;
case '>':
strcpy(*iconrow++,"-->");
! strcpy(*iconrow,"-->");
break;
! case 'O':
strcpy(*iconrow++,"/^\\");
! strcpy(*iconrow,"\\_/");
break;
! case ':':
strcpy(*iconrow++,". .");
! strcpy(*iconrow," . ");
break;
! case '/':
strcpy(*iconrow++," _/");
! strcpy(*iconrow,"/ ");
break;
case '\\':
strcpy(*iconrow++,"\\_ ");
! strcpy(*iconrow," \\");
break;
! case '*':
strcpy(*iconrow++,"/$\\");
! strcpy(*iconrow, "\\$/");
break;
! case '=':
strcpy(*iconrow++,"=-=");
strcpy(*iconrow, "-=-");
break;
! case '@':
strcpy(*iconrow++," o ");
strcpy(*iconrow, "<|>");
break;
! case 'T':
strcpy(*iconrow++,"(*)");
strcpy(*iconrow, "(*)");
break;
! case 'X':
strcpy(*iconrow++,"Way");
strcpy(*iconrow, "Out");
break;
! case '!':
strcpy(*iconrow++," I ");
strcpy(*iconrow, " o ");
break;
! case 'M':
strcpy(*iconrow++,"}o{");
strcpy(*iconrow, "/^\\");
break;
! case 'S':
strcpy(*iconrow++,"-o-");
strcpy(*iconrow, "/*\\");
break;
! case 'C':
strcpy(*iconrow++," ");
strcpy(*iconrow, "<O>");
break;
! case '+':
strcpy(*iconrow++,"TTT");
strcpy(*iconrow, "III");
break;
--- 9,87 ----
(*iconrow)[4] = icon;
switch(ch)
{
! case ' ': /* space */
! strcpy(*iconrow++," ");
! strcpy(*iconrow, " ");
break;
! case '#': /* rock */
strcpy(*iconrow++,"###");
! strcpy(*iconrow, "###");
break;
! case '<': /* arrows */
strcpy(*iconrow++,"<--");
! strcpy(*iconrow, "<--");
break;
case '>':
strcpy(*iconrow++,"-->");
! strcpy(*iconrow, "-->");
break;
! case 'O': /* boulder */
strcpy(*iconrow++,"/^\\");
! strcpy(*iconrow, "\\_/");
break;
! case ':': /* earth */
strcpy(*iconrow++,". .");
! strcpy(*iconrow, " . ");
break;
! case '/': /* slopes */
strcpy(*iconrow++," _/");
! strcpy(*iconrow, "/ ");
break;
case '\\':
strcpy(*iconrow++,"\\_ ");
! strcpy(*iconrow, " \\");
break;
! case '*': /* diamond */
strcpy(*iconrow++,"/$\\");
! strcpy(*iconrow, "\\$/");
break;
! case '=': /* rock */
strcpy(*iconrow++,"=-=");
strcpy(*iconrow, "-=-");
break;
! case '@': /* YOU!!! */
strcpy(*iconrow++," o ");
strcpy(*iconrow, "<|>");
break;
! case 'T': /* teleport */
strcpy(*iconrow++,"(*)");
strcpy(*iconrow, "(*)");
break;
! case 'X': /* exits */
strcpy(*iconrow++,"Way");
strcpy(*iconrow, "Out");
break;
! case '!': /* landmine */
strcpy(*iconrow++," I ");
strcpy(*iconrow, " o ");
break;
! case 'M': /* big monster */
strcpy(*iconrow++,"}o{");
strcpy(*iconrow, "/^\\");
break;
! case 'S': /* baby monster */
strcpy(*iconrow++,"-o-");
strcpy(*iconrow, "/*\\");
break;
! case '^': /* balloon */
! strcpy(*iconrow++,"/~\\");
! strcpy(*iconrow, "\\_X");
! break;
! case 'C': /* time capsule */
strcpy(*iconrow++," ");
strcpy(*iconrow, "<O>");
break;
! case '+': /* cage */
strcpy(*iconrow++,"TTT");
strcpy(*iconrow, "III");
break;
*** m.c.orig Tue Nov 29 16:43:23 1988
--- m.c Tue Nov 29 16:44:52 1988
***************
*** 12,17 ****
--- 12,18 ----
char screen[NOOFROWS][ROWLEN+1];
int edit_mode = 0;
int saved_game = 0;
+ char *edit_screen;
main(argc,argv)
int argc;
***************
*** 28,33 ****
--- 29,35 ----
if(!strcmp(argv[1], "-e"))
{
edit_mode = 1;
+ edit_screen = NULL;
}
else if(!strcmp(argv[1], "-m"))
{
***************
*** 58,71 ****
}
else
{
! fprintf(stderr,"Usage: %s [ -e | -m | -c | -s | -f ]\n",argv[0]);
exit(1);
}
}
if(argc > 2)
{
! fprintf(stderr,"Usage: %s [ -e | -m | -c | -s | -f ]\n",argv[0]);
! exit(1);
}
/* check for passwords - if file no_pws is in screen dir no pws! */
--- 60,81 ----
}
else
{
! fprintf(stderr,"Usage: %s [ -e [ file ] | -m | -c | -s | -f ]\n",argv[0]);
exit(1);
}
}
if(argc > 2)
{
! if(!strcmp(argv[1],"-e"))
! {
! edit_mode = 1;
! edit_screen = argv[2];
! }
! else
! {
! fprintf(stderr,"Usage: %s [ -e [ file ] | -m | -c | -s | -f ]\n",argv[0]);
! exit(1);
! }
}
/* check for passwords - if file no_pws is in screen dir no pws! */
*** read.c.orig Tue Nov 29 16:43:13 1988
--- read.c Tue Nov 29 16:44:55 1988
***************
*** 1,6 ****
--- 1,7 ----
#include "wand_head.h"
extern int edit_mode;
+ extern char *edit_screen;
extern char screen[NOOFROWS][ROWLEN+1];
int rscreen(num,maxmoves)
***************
*** 13,22 ****
if(!edit_mode)
sprintf(name,"%s/screen.%d",SCREENPATH,num);
else
! sprintf(name,"./screen");
fp = fopen(name,"r");
if(fp == NULL)
! printf("\nFile for screen %d unavailable.\n\n",num) ;
else
{
for(y = 0;y<NOOFROWS;y++)
--- 14,33 ----
if(!edit_mode)
sprintf(name,"%s/screen.%d",SCREENPATH,num);
else
! {
! if(!edit_screen)
! sprintf(name,"./screen");
! else
! sprintf(name,"%s",edit_screen);
! }
fp = fopen(name,"r");
if(fp == NULL)
! {
! if(edit_mode)
! printf("\nCannot find file %s.\n\n",name);
! else
! printf("\nFile for screen %d unavailable.\n\n",num) ;
! }
else
{
for(y = 0;y<NOOFROWS;y++)
***************
*** 36,43 ****
{
int y,x;
FILE *fp;
char (*row_ptr)[ROWLEN+1] = screen;
! fp = fopen("./screen","w");
if(fp == NULL)
printf("\nFile for screen cannot be written.\n\n") ;
else
--- 47,68 ----
{
int y,x;
FILE *fp;
+ char name[50];
char (*row_ptr)[ROWLEN+1] = screen;
! if(!edit_screen)
! sprintf(name,"./screen");
! else
! sprintf(name,"%s",edit_screen);
! fp = fopen(name,"w");
! if(fp == NULL)
! {
! sprintf(name,"/tmp/screen.%d",getpid());
! fp = fopen(name,"w");
! move(21,0);
! addstr("Written file is ");
! addstr(name);
! refresh();
! }
if(fp == NULL)
printf("\nFile for screen cannot be written.\n\n") ;
else
*** save.c.orig Tue Nov 29 16:43:25 1988
--- save.c Tue Nov 29 16:45:02 1988
***************
*** 1,8 ****
--- 1,10 ----
#include "wand_head.h"
+ #include <errno.h>
extern char screen[NOOFROWS][ROWLEN+1];
extern int saved_game;
+ extern void crypt_file();
struct saved_game {
short num;
short score;
***************
*** 37,43 ****
gets(fp);
}
if ((FILE *)NULL == (fo = fopen(fp, W_BIN))) {
! printf("Open error on '%s'n", fp);
exit(1);
}
--- 39,45 ----
gets(fp);
}
if ((FILE *)NULL == (fo = fopen(fp, W_BIN))) {
! perror(fp);
exit(1);
}
***************
*** 76,82 ****
}
fclose(fo);
!
exit(0);
}
--- 78,86 ----
}
fclose(fo);
! #ifndef NO_ENCRYPTION
! crypt_file(fp,0); /* encrpyt the saved game */
! #endif
exit(0);
}
***************
*** 103,112 ****
}
clear();
refresh();
!
if ((FILE *)NULL == (fi = fopen(fp, R_BIN))) {
endwin();
! printf("Open error on '%s'n", fp);
exit(1);
}
if ( (1 != fread((char *)&s, sizeof(s), 1, fi)) ||
--- 107,119 ----
}
clear();
refresh();
! #ifndef NO_ENCRYPTION
! crypt_file(fp,1); /*decrypt it*/
! #endif
if ((FILE *)NULL == (fi = fopen(fp, R_BIN))) {
endwin();
! printf("Open error on '%s'\n", fp);
! printf("Cannot restore game --- sorry.\n");
exit(1);
}
if ( (1 != fread((char *)&s, sizeof(s), 1, fi)) ||
***************
*** 114,119 ****
--- 121,127 ----
(1 != fread((char *)&zz, sizeof(zz), 1, fi)) ) {
endwin();
printf("Read error on '%s'n", fp);
+ printf("Cannot restore game --- sorry.\n");
fclose(fi);
exit(1);
}
***************
*** 150,155 ****
--- 158,164 ----
if ((struct mon_rec *)NULL == (mp = make_monster(0, 0))) {
endwin();
printf("Monster alloc error on '%s'n", fp);
+ printf("Try again - it might work.\nBut then,pigs might fly...\n");
fclose(fi);
exit(1);
}
***************
*** 156,161 ****
--- 165,171 ----
if (1 != fread((char *)&tmp_monst, sizeof(struct mon_rec), 1, fi)) {
endwin();
printf("Monster read error on '%s'n", fp);
+ printf("Cannot restore game --- sorry.\n");
fclose(fi);
exit(1);
}
*** wand_head.h.orig Tue Nov 29 16:43:17 1988
--- wand_head.h Tue Nov 29 16:45:09 1988
***************
*** 19,24 ****
--- 19,29 ----
/* change the numbers in this as well, but keep it in the same form */
#define PASSWD (num * num * 4373 + num * 16927 + 39)
+ /* To disable the recording of hiscores from games restored from saves */
+ /* #define NO_RESTORED_GAME_HISCORES */
+ /* #define COMPARE_BY_NAME define this to compare by name, not uid */
+ #define GUESTUID 0 /* guestuid always compared by name */
+ /* #define NO_ENCRYPTION define this to disable the savefile encryptor */
/* cbreak switching via curses package. */
/* on some Ultrix systems you may need to use crmode() and nocrmode() */
/* if so, just change the #defs to the necessary. I also know that Xenix */
***************
*** 31,38 ****
#define CBOFF nocbreak()
#endif
- /* To disable the recording of hiscores from games restored from saves */
- /* #define NO_RESTORED_GAME_HISCORES */
/* MSDOS modifications (M001) by Gregory H. Margo */
#ifdef MSDOS
--- 36,41 ----