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 >
Text File  |  1988-12-02  |  31KB  |  1,176 lines

  1. *** Makefile.orig    Tue Nov 29 16:43:18 1988
  2. --- Makefile    Tue Nov 29 16:44:07 1988
  3. ***************
  4. *** 2,8 ****
  5.   # modified again by play@cwi.nl
  6.   # and again by me.. maujp@uk.ac.warwick.cu
  7.   
  8. ! OBJ = m.o save.o jump.o display.o icon.o game.o read.o help.o fall.o scores.o edit.o
  9.   
  10.   CFLAGS = -O
  11.   LIBS = -lcurses -ltermcap
  12. --- 2,8 ----
  13.   # modified again by play@cwi.nl
  14.   # and again by me.. maujp@uk.ac.warwick.cu
  15.   
  16. ! 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
  17.   
  18.   CFLAGS = -O
  19.   LIBS = -lcurses -ltermcap
  20. *** display.c.orig    Tue Nov 29 16:43:20 1988
  21. --- display.c    Tue Nov 29 16:44:16 1988
  22. ***************
  23. *** 26,35 ****
  24.           addch(ch);
  25.           }
  26.       else
  27. !         if(ch==' '||ch=='#'||ch=='<'||ch=='>'||ch=='O'||ch==':'||
  28.              ch=='/'||ch=='\\'||ch=='*'||ch=='='||ch=='@'||ch=='T'||
  29.              ch=='X'||ch=='!'||ch=='M'||ch=='S'||ch=='C'||ch=='+'||
  30. !            ch=='A')
  31.           addch(ch);
  32.           else
  33.           addch('"');
  34. --- 26,35 ----
  35.           addch(ch);
  36.           }
  37.       else
  38. !             if(ch==' '||ch=='#'||ch=='<'||ch=='>'||ch=='O'||ch==':'||
  39.              ch=='/'||ch=='\\'||ch=='*'||ch=='='||ch=='@'||ch=='T'||
  40.              ch=='X'||ch=='!'||ch=='M'||ch=='S'||ch=='C'||ch=='+'||
  41. !                ch=='A'||ch=='^')
  42.           addch(ch);
  43.           else
  44.           addch('"');
  45. ***************
  46. *** 114,117 ****
  47. --- 114,151 ----
  48.       }                       /* end y loop */
  49.       move(16,0);
  50.       refresh();
  51. + }
  52. + void redraw_screen(maxmoves,num,score,nf,diamonds,mx,sx,sy,frow)
  53. + int maxmoves,num,score,nf,diamonds,mx,sx,sy;
  54. + char **frow;
  55. + {
  56. + char buffer[50];
  57. + clear();
  58. + move(0,48);
  59. + (void) addstr("Score\t   Diamonds");
  60. + move(1,48);
  61. + (void) addstr("\tFound\tTotal");
  62. + move(3,48);
  63. + (void) sprintf(buffer,"%d\t %d\t %d  ",score,nf,diamonds);
  64. + (void) addstr(buffer);
  65. + move(6,48);
  66. + (void) sprintf(buffer,"Current screen %d",num);
  67. + (void) addstr(buffer);
  68. + if(maxmoves != 0)
  69. + (void) sprintf(buffer,"Moves remaining = %d   ",maxmoves);
  70. + else
  71. + {
  72. +     (void) strcpy(buffer,"     Unlimited moves     ");
  73. +     maxmoves = -1;
  74. + };
  75. + move(15,48);
  76. + (void) addstr(buffer);
  77. + if(mx != -1)                            /* tell player if monster exists */
  78. +     draw_symbol(48,10,'M');
  79. + else
  80. +     draw_symbol(48,10,' ');
  81. + if(!debug_disp)
  82. +     display(sx,sy,frow,score);
  83. + else
  84. +     map(frow);
  85.   }
  86. *** edit.c.orig    Tue Nov 29 16:43:08 1988
  87. --- edit.c    Tue Nov 29 16:44:20 1988
  88. ***************
  89. *** 3,15 ****
  90.   extern char *playscreen();
  91.   
  92.   extern int debug_disp;
  93.   extern char screen[NOOFROWS][ROWLEN+1];
  94.   
  95. - /* Print instructions around the screen */
  96. - void instruct()
  97. - {
  98.   static char *inst[] = { "O   Boulder",
  99.               "< > Arrows",
  100.               ":   Earth",
  101.               "!   Landmine",
  102.               "*   Treasure",
  103. --- 3,14 ----
  104.   extern char *playscreen();
  105.   
  106.   extern int debug_disp;
  107. + extern char *edit_screen;
  108.   extern char screen[NOOFROWS][ROWLEN+1];
  109.   
  110.   static char *inst[] = { "O   Boulder",
  111.               "< > Arrows",
  112. +             "^   Balloon",
  113.               ":   Earth",
  114.               "!   Landmine",
  115.               "*   Treasure",
  116. ***************
  117. *** 16,22 ****
  118.               "/ \\ Deflectors",
  119.               "+   Cage",
  120.               "= # Rock",
  121. !             "T   Teleport (1 max)",
  122.               "A   Arrival (1 max)",
  123.               "X   Exit (always 1)",
  124.               "@   Start (always 1)",
  125. --- 15,21 ----
  126.               "/ \\ Deflectors",
  127.               "+   Cage",
  128.               "= # Rock",
  129. !             "T   Teleport",
  130.               "A   Arrival (1 max)",
  131.               "X   Exit (always 1)",
  132.               "@   Start (always 1)",
  133. ***************
  134. *** 23,48 ****
  135.               "M   Big Monster (1 max)",
  136.               "S   Baby Monster",
  137.               "-   Alternative space",
  138. !             "C   Time Capsule" };
  139.   int loop;
  140. ! for(loop = 1;loop < 17; loop++)
  141.       {
  142. !     move(loop,55);
  143. !     addstr(inst[loop-1]);
  144.       }
  145. ! move(21,0);
  146. ! addstr("Use wanderer keys to move. q = quit, p/n = play, m = change no. of moves.");
  147.   }
  148.   
  149.   void noins()
  150.   {
  151.   int loop;
  152. ! for(loop =1;loop < 17; loop++)
  153.       {
  154. !     move(loop,55);
  155.       addstr("                       ");
  156.       }
  157. ! move(21,0);
  158.   addstr("                                                                            ");
  159.   }
  160.   
  161. --- 22,53 ----
  162.               "M   Big Monster (1 max)",
  163.               "S   Baby Monster",
  164.               "-   Alternative space",
  165. !             "C   Time Capsule",
  166. !             NULL };
  167. ! /* Print instructions around the screen */
  168. ! void instruct()
  169. ! {
  170.   int loop;
  171. ! for(loop = 0; inst[loop] ; loop++)
  172.       {
  173. !     move(loop+1,55);
  174. !     addstr(inst[loop]);
  175.       }
  176. ! move(20,0);
  177. ! addstr("Use wanderer keys to move. m = change no. of moves, p = play game\n");
  178. ! addstr("n = play game with full screen, q = quit, x = quit without save.");
  179.   }
  180.   
  181.   void noins()
  182.   {
  183.   int loop;
  184. ! for(loop =0; inst[loop] ; loop++)
  185.       {
  186. !     move(loop+1,55);
  187.       addstr("                       ");
  188.       }
  189. ! move(20,0);
  190. ! addstr("                                                                            \n");
  191.   addstr("                                                                            ");
  192.   }
  193.   
  194. ***************
  195. *** 54,60 ****
  196.        *score;
  197.   char keys[10];
  198.   {
  199. ! int  x,y,sx=0,sy=0,quit=0,nx,ny;
  200.   char (*frow)[ROWLEN+1] = screen,
  201.        ch;
  202.   char buffer[50];
  203. --- 59,65 ----
  204.        *score;
  205.   char keys[10];
  206.   {
  207. ! int  x,y,sx=0,sy=0,quit=0,nx,ny,nosave =0;
  208.   char (*frow)[ROWLEN+1] = screen,
  209.        ch;
  210.   char buffer[50];
  211. ***************
  212. *** 107,116 ****
  213.       }
  214.   else if(ch == 'q')
  215.       {
  216. !     move(19,0);
  217. !     addstr("                                                                          ");
  218.       break;
  219.       }
  220.   else if(ch == 'm')              /* change to number of moves for the screen */
  221.       {
  222.       move(19,0);
  223. --- 112,141 ----
  224.       }
  225.   else if(ch == 'q')
  226.       {
  227. !     noins();
  228.       break;
  229.       }
  230. + else if(ch == 'x')
  231. +     {
  232. +     noins();
  233. +     move(20,0);
  234. +     addstr("You will lose any changes made this session - sre you sure? (y/n)");
  235. +     refresh();
  236. +     ch = getch();
  237. +     if(ch != 'y')
  238. +     {
  239. +     noins();
  240. +     instruct();
  241. +     refresh();
  242. +         }
  243. +     else
  244. +     {
  245. +     nosave = 1;
  246. +     addstr("\n");
  247. +     refresh();
  248. +     break;
  249. +         }
  250. +     }
  251.   else if(ch == 'm')              /* change to number of moves for the screen */
  252.       {
  253.       move(19,0);
  254. ***************
  255. *** 132,138 ****
  256.   else if(ch == 'p' || ch == 'n')       /* play the game (test) */
  257.       {
  258.       noins();
  259. !     wscreen(num,maxmoves);
  260.       if(ch == 'p')
  261.           {
  262.           debug_disp = 0;
  263. --- 157,163 ----
  264.   else if(ch == 'p' || ch == 'n')       /* play the game (test) */
  265.       {
  266.       noins();
  267. !         wscreen(num,maxmoves);
  268.       if(ch == 'p')
  269.           {
  270.           debug_disp = 0;
  271. ***************
  272. *** 181,192 ****
  273.   y=ny;
  274.   }
  275.   
  276. ! for(y = 0; y<NOOFROWS;y++)       /* certain editors - eg ded - have a */
  277. !                      /* habit of truncating trailing spaces*/
  278. !                          /* so this should stop them! */
  279. !     if(screen[y][ROWLEN-1] == ' ')
  280. !     screen[y][ROWLEN-1] = '-';
  281. ! wscreen(num,maxmoves);
  282.   move(20,0);
  283.   refresh();
  284.   }
  285. --- 206,221 ----
  286.   y=ny;
  287.   }
  288.   
  289. ! if(! nosave)
  290. !     {
  291. !     for(y = 0; y<=NOOFROWS;y++) /* certain editors - eg ded - have a */
  292. !                                 /* habit of truncating trailing spaces*/
  293. !                             /* so this should stop them! */
  294. !         if(screen[y][ROWLEN-1] == ' ')
  295. !         screen[y][ROWLEN-1] = '-';
  296. !     wscreen(num,maxmoves);
  297. !     }
  298. ! noins();
  299.   move(20,0);
  300.   refresh();
  301.   }
  302. *** fall.c.orig    Tue Nov 29 16:43:09 1988
  303. --- fall.c    Tue Nov 29 16:44:26 1988
  304. ***************
  305. *** 26,36 ****
  306.   int  x,y,sx,sy, *mx, *my;
  307.   char howdead[25];
  308.   {
  309. ! int nx = x,nyl = y,nyr = y,retval = 0;
  310.   if ((y>(NOOFROWS-1))||(y<0)||(x<0)||(x>(ROWLEN-1)))
  311.       return(0);
  312.   if((screen[y][x] != 'O') && (screen[y][x] != ' ') && (screen[y][x] != 'M') &&
  313. !    (screen[y][x] !='\\') && (screen[y][x] != '/') && (screen[y][x] != '@'))
  314.       return(0);
  315.   if(screen[y][x] == 'O')
  316.       {
  317. --- 26,37 ----
  318.   int  x,y,sx,sy, *mx, *my;
  319.   char howdead[25];
  320.   {
  321. ! int nx = x,nxu = x,nyl = y,nyr = y,retval = 0;
  322.   if ((y>(NOOFROWS-1))||(y<0)||(x<0)||(x>(ROWLEN-1)))
  323.       return(0);
  324.   if((screen[y][x] != 'O') && (screen[y][x] != ' ') && (screen[y][x] != 'M') &&
  325. !    (screen[y][x] !='\\') && (screen[y][x] != '/') && (screen[y][x] != '@') &&
  326. !    (screen[y][x] != '^'))
  327.       return(0);
  328.   if(screen[y][x] == 'O')
  329.       {
  330. ***************
  331. *** 43,48 ****
  332. --- 44,58 ----
  333.       else
  334.           nx = -1;
  335.       }
  336. +     if((screen[y][x-1] == ' ') && (screen[y+1][x-1] == ' '))
  337. +         nxu--;
  338. +     else
  339. +     {
  340. +         if((screen[y][x+1] == ' ') && (screen[y+1][x+1] == ' '))
  341. +             nxu++;
  342. +     else
  343. +         nxu = -1;
  344. +     }
  345.       if((screen[y-1][x] == ' ') && (screen[y-1][x+1] == ' '))
  346.           nyr--;
  347.       else
  348. ***************
  349. *** 66,71 ****
  350. --- 76,83 ----
  351.       {
  352.       if(screen[y-1][++nx] != ' ')
  353.       nx = -1;
  354. +     if(screen[y+1][--nxu] != ' ')
  355. +         nxu = -1;
  356.       if(screen[--nyr][x+1] != ' ')
  357.           nyr = -1;
  358.       if(screen[++nyl][x-1] != ' ')
  359. ***************
  360. *** 75,80 ****
  361. --- 87,94 ----
  362.       {
  363.       if(screen[y-1][--nx] != ' ')
  364.       nx = -1;
  365. +     if(screen[y+1][++nxu] != ' ')
  366. +         nxu = -1;
  367.       if(screen[++nyr][x+1] != ' ')
  368.       nyr = -1;
  369.       if(screen[--nyl][x-1] != ' ')
  370. ***************
  371. *** 82,88 ****
  372.       }
  373.   if((screen[y][nx] != ' ') && (screen[y][nx] != 'M'))
  374.       nx = -1;
  375. ! if((screen[y-1][x] == 'O') && (nx >= 0) && (y > 0)) /* boulder falls ? */
  376.       {
  377.       screen[y-1][x] = ' ';
  378.       if(screen[y][nx] == '@')
  379. --- 96,103 ----
  380.       }
  381.   if((screen[y][nx] != ' ') && (screen[y][nx] != 'M'))
  382.       nx = -1;
  383. ! if((screen[y-1][x] == 'O') && (nx >= 0) && (y > 0) &&
  384. !    (screen[y][nx] != '^')) /* boulder falls ? */
  385.       {
  386.       screen[y-1][x] = ' ';
  387.       if(screen[y][nx] == '@')
  388. ***************
  389. *** 124,130 ****
  390.       screen[y+1][nx] = ' ';
  391.           }
  392.       }
  393. ! if((screen[nyr][x] != ' ')&&(screen[nyr][x] != 'M'))
  394.       nyr = -1;
  395.   if((screen[y][x+1] == '<')&&(nyr>=0)&&(x+1<ROWLEN)) /* arrow moves ( < ) ? */
  396.       {
  397. --- 139,145 ----
  398.       screen[y+1][nx] = ' ';
  399.           }
  400.       }
  401. ! if((screen[nyr][x] != '^')&&(screen[nyr][x] != ' ')&&(screen[nyr][x] != 'M'))
  402.       nyr = -1;
  403.   if((screen[y][x+1] == '<')&&(nyr>=0)&&(x+1<ROWLEN)) /* arrow moves ( < ) ? */
  404.       {
  405. ***************
  406. *** 168,174 ****
  407.       screen[nyr][x-1] = ' ';
  408.           }
  409.       }
  410. ! if((screen[nyl][x] != ' ')&&(screen[nyl][x] != 'M'))
  411.       nyl = -1;
  412.   if((screen[y][x-1] == '>')&&(nyl>=0)&&(x>0))       /* arrow moves ( > ) ? */
  413.       {
  414. --- 183,189 ----
  415.       screen[nyr][x-1] = ' ';
  416.           }
  417.       }
  418. ! if((screen[nyl][x] != ' ')&&(screen[nyl][x] != '^')&&(screen[nyl][x] != 'M'))
  419.       nyl = -1;
  420.   if((screen[y][x-1] == '>')&&(nyl>=0)&&(x>0))       /* arrow moves ( > ) ? */
  421.       {
  422. ***************
  423. *** 211,216 ****
  424. --- 226,256 ----
  425.           *mx = *my = -2;
  426.       screen[nyl][x+1] = ' ';
  427.           }
  428. +     }
  429. + if(screen[y][nxu] != ' ')
  430. +     nxu = -1;
  431. + if((screen[y+1][x] == '^') && (nxu >= 0) && (y < NOOFROWS) &&
  432. +    (screen[y][x] != '^')) /* balloon rises? */
  433. +     {
  434. +     screen[y+1][x] = ' ';
  435. +     screen[y][nxu] = '^';
  436. +     if(!debug_disp)
  437. +     {
  438. +         if((y<(sy+3)) && (y>(sy-5)) && (x>(sx-6)) && (x<(sx+6)))
  439. +             draw_symbol((x-sx+5)*3,(y-sy+4)*2,' ');
  440. +         if((y<(sy+4)) && (y>(sy-4)) && (nxu>(sx-6)) && (nxu<(sx+6)))
  441. +             draw_symbol((nxu-sx+5)*3,(y-sy+3)*2,'^');
  442. +     }
  443. +     else
  444. +     {
  445. +     move(y+2,x+1);
  446. +     addch(' ');
  447. +     move(y+1,nxu+1);
  448. +     addch('^');
  449. +     }
  450. +     refresh();
  451. +     retval+=fall(mx,my,nxu ,y-1,sx,sy,howdead);
  452. +     retval+=check(mx,my,x,y+1,0,-1,sx,sy,howdead);
  453.       }
  454.   if(retval>0)
  455.       return(1);
  456. *** game.c.orig    Tue Nov 29 16:43:11 1988
  457. --- game.c    Tue Nov 29 16:44:31 1988
  458. ***************
  459. *** 1,7 ****
  460.   #include "wand_head.h"
  461.   
  462.   #define viable(x,y) (((screen[y][x] == ' ') || (screen[y][x] == ':') ||\
  463. !     (screen[y][x] == '@') || (screen[y][x] == '+')) && (y >= 0) &&\
  464.       (x >= 0) && (y < NOOFROWS) && (x < ROWLEN))
  465.   
  466.   /* typedef struct mon_rec        *//* M002 struct mon_rec moved    */
  467. --- 1,8 ----
  468.   #include "wand_head.h"
  469.   
  470.   #define viable(x,y) (((screen[y][x] == ' ') || (screen[y][x] == ':') ||\
  471. !     (screen[y][x] == '@') || (screen[y][x] == '+') ||\
  472. !     (screen[y][x] == 'S')) && (y >= 0) &&\
  473.       (x >= 0) && (y < NOOFROWS) && (x < ROWLEN))
  474.   
  475.   /* typedef struct mon_rec        *//* M002 struct mon_rec moved    */
  476. ***************
  477. *** 33,38 ****
  478. --- 34,40 ----
  479.   
  480.   extern void map();
  481.   
  482. + extern void redraw_screen();
  483.   extern int debug_disp;
  484.   extern int edit_mode;
  485.   extern int saved_game;
  486. ***************
  487. *** 131,137 ****
  488.   {
  489.   int  x,y,nx,ny,deadyet =0,
  490.        sx = -1,sy = -1,tx = -1,ty = -1,lx = 0,ly = 0,mx = -1,my = -1,
  491. !      bx, by, nbx, nby,
  492.        newnum,
  493.        max_score = 250,
  494.        diamonds = 0, nf = 0,hd ,vd ,xdirection,ydirection;
  495. --- 133,139 ----
  496.   {
  497.   int  x,y,nx,ny,deadyet =0,
  498.        sx = -1,sy = -1,tx = -1,ty = -1,lx = 0,ly = 0,mx = -1,my = -1,
  499. !      bx, by, nbx, nby, tmpx,tmpy,
  500.        newnum,
  501.        max_score = 250,
  502.        diamonds = 0, nf = 0,hd ,vd ,xdirection,ydirection;
  503. ***************
  504. *** 249,261 ****
  505.   nx=x;
  506.   ny=y;
  507.   
  508. ! if(ch == keys[3])              /* move about - but thats obvious */
  509.       nx++;
  510. ! if(ch == keys[2])
  511.       nx--;
  512. ! if((ch == keys[1]) && (y<(NOOFROWS-1)))
  513.       ny++;
  514. ! if(ch == keys[0])
  515.           ny--;
  516.   if(ch == '1')                  /* Add or get rid of that awful sound */
  517.       {
  518. --- 251,263 ----
  519.   nx=x;
  520.   ny=y;
  521.   
  522. ! if((ch == keys[3]) && (x <(ROWLEN-1)))  /* move about - but thats obvious */
  523.       nx++;
  524. ! if((ch == keys[2]) && (x > 0))
  525.       nx--;
  526. ! if((ch == keys[1]) && (y <(NOOFROWS-1)))
  527.       ny++;
  528. ! if((ch == keys[0]) && (y > 0))
  529.           ny--;
  530.   if(ch == '1')                  /* Add or get rid of that awful sound */
  531.       {
  532. ***************
  533. *** 305,313 ****
  534. --- 307,348 ----
  535.   if(ch == '?')
  536.       {
  537.       helpme();
  538. +     if(debug_disp)
  539. +         map(frow);
  540. +         else
  541. +         display(sx,sy,frow,*score);
  542. +     continue;
  543. +     }
  544. + if((ch == '@')&&(!debug_disp))
  545. +     {
  546. +     sx = x;
  547. +     sy = y;
  548.       display(sx,sy,frow,*score);
  549.       continue;
  550.       }
  551. + if(ch == '#')
  552. +     {
  553. +     debug_disp = 1 - debug_disp;
  554. +     if(debug_disp)
  555. +         map(frow);
  556. +     else
  557. +         {
  558. +          for(tmpy=0;tmpy<=(NOOFROWS+1);tmpy++)
  559. +                 {
  560. +                 move(tmpy,0);
  561. +                 for(tmpx=0;tmpx<=(ROWLEN+2);tmpx++)
  562. +                     addch(' ');
  563. +             }
  564. +         sx = x; sy = y;
  565. +         display(sx,sy,frow,*score);
  566. +         }
  567. +     continue;
  568. +     }
  569. + if(ch == 'W')
  570. +     {
  571. +         redraw_screen(maxmoves,*num,*score,nf,diamonds,mx,sx,sy,frow);
  572. +     continue;
  573. +     }
  574.   
  575.   /* M002  Added save/restore game feature.  Gregory H. Margo    */
  576.   if(ch == 'S')           /* save game */
  577. ***************
  578. *** 463,468 ****
  579. --- 498,536 ----
  580.           x = nx;
  581.           }
  582.       break;
  583. +     case '^':
  584. +     if(screen[y][nx*2-x] == ' ')
  585. +         {
  586. +         screen[y][nx*2-x] = '^';
  587. +         screen[y][x] = ' ';
  588. +             screen[ny][nx] = '@';
  589. +         if(!debug_disp)
  590. +         {
  591. +                 draw_symbol((x-sx+5)*3,(y-sy+3)*2,' ');
  592. +                 draw_symbol((nx-sx+5)*3,(ny-sy+3)*2,'@');
  593. +         if(nx*2-x>sx-6&&nx*2-x<sx+6)
  594. +                     draw_symbol((nx*2-x-sx+5)*3,(y-sy+3)*2,'^');
  595. +         }
  596. +         else
  597. +         {
  598. +         move(y+1,x+1);
  599. +         addch(' ');
  600. +         move(ny+1,nx+1);
  601. +         addch('@');
  602. +         move(y+1,nx*2-x+1);
  603. +         addch('^');
  604. +         }
  605. +             deadyet += fall(&mx,&my,nx*2-x,y-1,sx,sy,howdead);
  606. +             deadyet += fall(&mx,&my,x*2-nx,y,sx,sy,howdead);
  607. +             deadyet += fall(&mx,&my,x,y,sx,sy,howdead);
  608. +             deadyet += fall(&mx,&my,x,y+1,sx,sy,howdead);
  609. +             deadyet += fall(&mx,&my,x,y-1,sx,sy,howdead);
  610. +             move(16,0);
  611. +             refresh();
  612. +         y = ny;
  613. +         x = nx;
  614. +         }
  615. +     break;
  616.       case '<':
  617.       case '>':
  618.       if(screen[ny*2-y][x] == 'M')
  619. ***************
  620. *** 718,730 ****
  621.       refresh();
  622.       }
  623.   
  624. ! current = &start_of_list;
  625.   while((current != tail_of_list)&&(!deadyet))
  626.       /* deal with those little monsters */
  627.       {
  628.       monster = current->next;
  629.       new_disp = new_direction( monster->x, monster->y, monster->mx, monster->my );
  630. !     if(monster->under!='S')
  631.       {
  632.           screen[monster->y][monster->x] = monster->under;
  633.           if(!debug_disp)
  634. --- 786,798 ----
  635.       refresh();
  636.       }
  637.   
  638. ! current = &start_of_list;                         /* baby monsters now */
  639.   while((current != tail_of_list)&&(!deadyet))
  640.       /* deal with those little monsters */
  641.       {
  642.       monster = current->next;
  643.       new_disp = new_direction( monster->x, monster->y, monster->mx, monster->my );
  644. !     if(monster->under!='S')             /* if on top of another baby */
  645.       {
  646.           screen[monster->y][monster->x] = monster->under;
  647.           if(!debug_disp)
  648. *** help.c.orig    Tue Nov 29 16:43:21 1988
  649. --- help.c    Tue Nov 29 16:44:35 1988
  650. ***************
  651. *** 10,24 ****
  652.   " Collect all the treasure:    /$\\  ", /* 4 */
  653.   "                              \\$/  ", /* 5 */
  654.   " Then go through the exit:    Way  ", /* 6 */
  655. ! " Default keys are:            out  ", /* 7 */
  656.   "  h  Left       j  Down            ", /* 8 */
  657.   "  k  Up         l  Right           ", /* 9 */
  658.   "  1  Loud       q  Quit game       ", /* 10 */
  659.   "  0  Quiet      !  Look at map     ", /* 11 */
  660.   "  S  Save game  R  Restore Game    ", /* 12 */
  661. ! "  ?  Enter help mode               ", /* 13 */
  662. ! "  ~  Jump to next level            ", /* 14 */
  663. ! "     (does not receive level bonus)", /* 15 */
  664.   
  665.   "This is you:  You are a spider.    ", /* 0 */
  666.   "      o       (At least, that's    ", /* 1 */
  667. --- 10,24 ----
  668.   " Collect all the treasure:    /$\\  ", /* 4 */
  669.   "                              \\$/  ", /* 5 */
  670.   " Then go through the exit:    Way  ", /* 6 */
  671. ! "                              out  ", /* 7 */
  672.   "  h  Left       j  Down            ", /* 8 */
  673.   "  k  Up         l  Right           ", /* 9 */
  674.   "  1  Loud       q  Quit game       ", /* 10 */
  675.   "  0  Quiet      !  Look at map     ", /* 11 */
  676.   "  S  Save game  R  Restore Game    ", /* 12 */
  677. ! "  ?  Help mode  @  Center screen   ", /* 13 */
  678. ! "  ~  Jump level #  Switch mode     ", /* 14 */
  679. ! " nb: No level bonus for jumping.   ", /* 15 */
  680.   
  681.   "This is you:  You are a spider.    ", /* 0 */
  682.   "      o       (At least, that's    ", /* 1 */
  683. ***************
  684. *** 58,65 ****
  685.   "is captured and you get 50 points. ", /* 1 */
  686.   "The cage also becomes a diamond.   ", /* 2 */
  687.   "                                   ", /* 3 */
  688. ! " !!! and  I  Instant annihilation  ", /* 4 */
  689. ! " !!!      o                        ", /* 5 */
  690.   "                                   ", /* 6 */
  691.   " \\_       _/   Slopes (boulders    ", /* 7 */
  692.   "   \\ and /     and etc slide off)  ", /* 8 */
  693. --- 58,65 ----
  694.   "is captured and you get 50 points. ", /* 1 */
  695.   "The cage also becomes a diamond.   ", /* 2 */
  696.   "                                   ", /* 3 */
  697. ! "  I   Instant annihilation         ", /* 4 */
  698. ! "  o                                ", /* 5 */
  699.   "                                   ", /* 6 */
  700.   " \\_       _/   Slopes (boulders    ", /* 7 */
  701.   "   \\ and /     and etc slide off)  ", /* 8 */
  702. ***************
  703. *** 70,75 ****
  704. --- 70,91 ----
  705.   "                                   ", /* 3 */
  706.   " Way  Exit -- Must Collect all the ", /* 4 */
  707.   " out  treasure first. (250 bonus)  ", /* 5 */
  708. + " /~\\  A new addition for version   ", /* 0 */
  709. + " \\_X  2.2M . The balloon rises,    ", /* 1 */
  710. + "      and is popped by arrows. It  ", /* 2 */
  711. + "      does *not* kill you.         ", /* 3 */
  712. + "                                   ", /* 4 */
  713. + " OOO  Unrecognised symbol in map.  ", /* 5 */
  714. + " OOO  This is probably a **bug** ! ", /* 6 */
  715. + "                                   ", /* 7 */
  716. + " ENVIRONMENT VARIABLES:            ", /* 8 */
  717. + "                                   ", /* 9 */
  718. + "   NEWNAME,NAME : Checked in that  ", /* 0 */
  719. + "       order for the hiscore table ", /* 1 */
  720. + "   NEWKEYS : Redefine movement keys", /* 2 */
  721. + "       eg- 'hlkj' for default      ", /* 3 */
  722. + "   SAVENAME : File used for saved  ", /* 4 */
  723. + "       games.                      ", /* 5 */
  724.   };
  725.   
  726.   
  727. ***************
  728. *** 81,87 ****
  729.       char *ptr;  /* pointer in array.. */
  730.       char ch;
  731.   
  732. !     for(i1 = 0; i1 < 4; i1++)  /* times to show loop. */
  733.       {
  734.           for(i = 0; i < 16; i++)    /* show one menu. */
  735.           {
  736. --- 97,103 ----
  737.       char *ptr;  /* pointer in array.. */
  738.       char ch;
  739.   
  740. !     for(i1 = 0; i1 < 5; i1++)  /* times to show loop. */
  741.       {
  742.           for(i = 0; i < 16; i++)    /* show one menu. */
  743.           {
  744. *** icon.c.orig    Tue Nov 29 16:43:22 1988
  745. --- icon.c    Tue Nov 29 16:44:40 1988
  746. ***************
  747. *** 9,83 ****
  748.            (*iconrow)[4] = icon;
  749.       switch(ch)
  750.       {
  751. !     case ' ':
  752. !         strcpy((*iconrow++),"   ");
  753. !         strcpy((*iconrow),"   ");
  754.           break;
  755. !     case '#':
  756.           strcpy(*iconrow++,"###");
  757. !         strcpy(*iconrow,"###");
  758.           break;
  759. !     case '<':
  760.           strcpy(*iconrow++,"<--");
  761. !         strcpy(*iconrow,"<--");
  762.           break;
  763.       case '>':
  764.           strcpy(*iconrow++,"-->");
  765. !         strcpy(*iconrow,"-->");
  766.           break;
  767. !     case 'O':
  768.           strcpy(*iconrow++,"/^\\");
  769. !         strcpy(*iconrow,"\\_/");
  770.           break;
  771. !     case ':':
  772.           strcpy(*iconrow++,". .");
  773. !         strcpy(*iconrow," . ");
  774.           break;
  775. !     case '/':
  776.           strcpy(*iconrow++," _/");
  777. !         strcpy(*iconrow,"/  ");
  778.           break;
  779.       case '\\':
  780.           strcpy(*iconrow++,"\\_ ");
  781. !         strcpy(*iconrow,"  \\");
  782.           break;
  783. !     case '*':
  784.           strcpy(*iconrow++,"/$\\");
  785. !         strcpy(*iconrow, "\\$/");
  786.           break;
  787. !     case '=':
  788.           strcpy(*iconrow++,"=-=");
  789.           strcpy(*iconrow,  "-=-");
  790.           break;
  791. !     case '@':
  792.           strcpy(*iconrow++," o ");
  793.           strcpy(*iconrow,  "<|>");
  794.           break;
  795. !     case 'T':
  796.           strcpy(*iconrow++,"(*)");
  797.           strcpy(*iconrow,  "(*)");
  798.           break;
  799. !     case 'X':
  800.           strcpy(*iconrow++,"Way");
  801.           strcpy(*iconrow,  "Out");
  802.           break;
  803. !     case '!':
  804.           strcpy(*iconrow++," I ");
  805.           strcpy(*iconrow,  " o ");
  806.           break;
  807. !     case 'M':
  808.           strcpy(*iconrow++,"}o{");
  809.           strcpy(*iconrow,  "/^\\");
  810.           break;
  811. !     case 'S':
  812.           strcpy(*iconrow++,"-o-");
  813.           strcpy(*iconrow,  "/*\\");
  814.           break;
  815. !     case 'C':
  816.           strcpy(*iconrow++,"   ");
  817.           strcpy(*iconrow,  "<O>");
  818.           break;
  819. !     case '+':
  820.           strcpy(*iconrow++,"TTT");
  821.           strcpy(*iconrow,  "III");
  822.           break;
  823. --- 9,87 ----
  824.            (*iconrow)[4] = icon;
  825.       switch(ch)
  826.       {
  827. !     case ' ':                    /*  space  */
  828. !         strcpy(*iconrow++,"   ");
  829. !         strcpy(*iconrow,  "   ");
  830.           break;
  831. !     case '#':                   /*  rock  */
  832.           strcpy(*iconrow++,"###");
  833. !         strcpy(*iconrow,  "###");
  834.           break;
  835. !     case '<':                   /*  arrows  */
  836.           strcpy(*iconrow++,"<--");
  837. !         strcpy(*iconrow,  "<--");
  838.           break;
  839.       case '>':
  840.           strcpy(*iconrow++,"-->");
  841. !         strcpy(*iconrow,  "-->");
  842.           break;
  843. !     case 'O':                    /* boulder  */
  844.           strcpy(*iconrow++,"/^\\");
  845. !         strcpy(*iconrow,  "\\_/");
  846.           break;
  847. !     case ':':                    /*  earth  */
  848.           strcpy(*iconrow++,". .");
  849. !         strcpy(*iconrow,  " . ");
  850.           break;
  851. !     case '/':                    /*  slopes */
  852.           strcpy(*iconrow++," _/");
  853. !         strcpy(*iconrow,  "/  ");
  854.           break;
  855.       case '\\':
  856.           strcpy(*iconrow++,"\\_ ");
  857. !         strcpy(*iconrow,  "  \\");
  858.           break;
  859. !     case '*':                     /*  diamond  */
  860.           strcpy(*iconrow++,"/$\\");
  861. !         strcpy(*iconrow,  "\\$/");
  862.           break;
  863. !     case '=':                     /*  rock  */
  864.           strcpy(*iconrow++,"=-=");
  865.           strcpy(*iconrow,  "-=-");
  866.           break;
  867. !     case '@':                     /*  YOU!!! */
  868.           strcpy(*iconrow++," o ");
  869.           strcpy(*iconrow,  "<|>");
  870.           break;
  871. !     case 'T':                   /*  teleport  */
  872.           strcpy(*iconrow++,"(*)");
  873.           strcpy(*iconrow,  "(*)");
  874.           break;
  875. !     case 'X':                    /*  exits  */
  876.           strcpy(*iconrow++,"Way");
  877.           strcpy(*iconrow,  "Out");
  878.           break;
  879. !     case '!':                    /*  landmine  */
  880.           strcpy(*iconrow++," I ");
  881.           strcpy(*iconrow,  " o ");
  882.           break;
  883. !     case 'M':                     /* big monster  */
  884.           strcpy(*iconrow++,"}o{");
  885.           strcpy(*iconrow,  "/^\\");
  886.           break;
  887. !     case 'S':                     /* baby monster */
  888.           strcpy(*iconrow++,"-o-");
  889.           strcpy(*iconrow,  "/*\\");
  890.           break;
  891. !     case '^':             /* balloon */
  892. !         strcpy(*iconrow++,"/~\\");
  893. !         strcpy(*iconrow,  "\\_X");
  894. !         break;
  895. !     case 'C':                    /* time capsule */
  896.           strcpy(*iconrow++,"   ");
  897.           strcpy(*iconrow,  "<O>");
  898.           break;
  899. !     case '+':                    /* cage */
  900.           strcpy(*iconrow++,"TTT");
  901.           strcpy(*iconrow,  "III");
  902.           break;
  903. *** m.c.orig    Tue Nov 29 16:43:23 1988
  904. --- m.c    Tue Nov 29 16:44:52 1988
  905. ***************
  906. *** 12,17 ****
  907. --- 12,18 ----
  908.   char screen[NOOFROWS][ROWLEN+1];
  909.   int edit_mode = 0;
  910.   int saved_game = 0;
  911. + char *edit_screen;
  912.   
  913.   main(argc,argv)
  914.   int  argc;
  915. ***************
  916. *** 28,33 ****
  917. --- 29,35 ----
  918.       if(!strcmp(argv[1], "-e"))
  919.       {
  920.       edit_mode = 1;
  921. +     edit_screen = NULL;
  922.       }
  923.       else if(!strcmp(argv[1], "-m"))
  924.       {
  925. ***************
  926. *** 58,71 ****
  927.       }
  928.       else
  929.       {
  930. !     fprintf(stderr,"Usage: %s [ -e | -m | -c | -s | -f ]\n",argv[0]);
  931.       exit(1);
  932.           }
  933.       }
  934.   if(argc > 2)
  935.       {
  936. !     fprintf(stderr,"Usage: %s [ -e | -m | -c | -s | -f ]\n",argv[0]);
  937. !     exit(1);
  938.       }
  939.   
  940.   /* check for passwords - if file no_pws is in screen dir no pws! */
  941. --- 60,81 ----
  942.       }
  943.       else
  944.       {
  945. !     fprintf(stderr,"Usage: %s [ -e [ file ] | -m | -c | -s | -f ]\n",argv[0]);
  946.       exit(1);
  947.           }
  948.       }
  949.   if(argc > 2)
  950.       {
  951. !     if(!strcmp(argv[1],"-e"))
  952. !     {
  953. !     edit_mode = 1;
  954. !     edit_screen = argv[2];
  955. !     }
  956. !     else
  957. !     {
  958. !         fprintf(stderr,"Usage: %s [ -e [ file ] | -m | -c | -s | -f ]\n",argv[0]);
  959. !         exit(1);
  960. !     }
  961.       }
  962.   
  963.   /* check for passwords - if file no_pws is in screen dir no pws! */
  964. *** read.c.orig    Tue Nov 29 16:43:13 1988
  965. --- read.c    Tue Nov 29 16:44:55 1988
  966. ***************
  967. *** 1,6 ****
  968. --- 1,7 ----
  969.   #include "wand_head.h"
  970.   
  971.   extern int edit_mode;
  972. + extern char *edit_screen;
  973.   extern char screen[NOOFROWS][ROWLEN+1];
  974.   
  975.   int rscreen(num,maxmoves)
  976. ***************
  977. *** 13,22 ****
  978.   if(!edit_mode)
  979.       sprintf(name,"%s/screen.%d",SCREENPATH,num);
  980.   else
  981. !     sprintf(name,"./screen");
  982.   fp = fopen(name,"r");
  983.   if(fp == NULL)
  984. !     printf("\nFile for screen %d unavailable.\n\n",num) ;
  985.   else
  986.       {
  987.       for(y = 0;y<NOOFROWS;y++)
  988. --- 14,33 ----
  989.   if(!edit_mode)
  990.       sprintf(name,"%s/screen.%d",SCREENPATH,num);
  991.   else
  992. !     {
  993. !     if(!edit_screen)
  994. !         sprintf(name,"./screen");
  995. !     else
  996. !     sprintf(name,"%s",edit_screen);
  997. !     }
  998.   fp = fopen(name,"r");
  999.   if(fp == NULL)
  1000. !     {
  1001. !     if(edit_mode)
  1002. !     printf("\nCannot find file %s.\n\n",name);
  1003. !     else
  1004. !         printf("\nFile for screen %d unavailable.\n\n",num) ;
  1005. !     }
  1006.   else
  1007.       {
  1008.       for(y = 0;y<NOOFROWS;y++)
  1009. ***************
  1010. *** 36,43 ****
  1011.   {
  1012.   int  y,x;
  1013.   FILE *fp;
  1014.   char (*row_ptr)[ROWLEN+1] = screen;
  1015. ! fp = fopen("./screen","w");
  1016.   if(fp == NULL)
  1017.       printf("\nFile for screen cannot be written.\n\n") ;
  1018.   else
  1019. --- 47,68 ----
  1020.   {
  1021.   int  y,x;
  1022.   FILE *fp;
  1023. + char name[50];
  1024.   char (*row_ptr)[ROWLEN+1] = screen;
  1025. ! if(!edit_screen)
  1026. !     sprintf(name,"./screen");
  1027. ! else
  1028. !     sprintf(name,"%s",edit_screen);
  1029. ! fp = fopen(name,"w");
  1030. ! if(fp == NULL)
  1031. !     {
  1032. !     sprintf(name,"/tmp/screen.%d",getpid());
  1033. !     fp = fopen(name,"w");
  1034. !     move(21,0);
  1035. !     addstr("Written file is ");
  1036. !     addstr(name);
  1037. !     refresh();
  1038. !     }
  1039.   if(fp == NULL)
  1040.       printf("\nFile for screen cannot be written.\n\n") ;
  1041.   else
  1042. *** save.c.orig    Tue Nov 29 16:43:25 1988
  1043. --- save.c    Tue Nov 29 16:45:02 1988
  1044. ***************
  1045. *** 1,8 ****
  1046. --- 1,10 ----
  1047.   #include "wand_head.h"
  1048. + #include <errno.h>
  1049.   
  1050.   extern char screen[NOOFROWS][ROWLEN+1];
  1051.   extern int saved_game;
  1052.   
  1053. + extern void crypt_file();
  1054.   struct    saved_game    {
  1055.       short    num;
  1056.       short    score;
  1057. ***************
  1058. *** 37,43 ****
  1059.           gets(fp);
  1060.       }
  1061.       if ((FILE *)NULL == (fo = fopen(fp, W_BIN))) {
  1062. !         printf("Open error on '%s'n", fp);
  1063.           exit(1);
  1064.       }
  1065.   
  1066. --- 39,45 ----
  1067.           gets(fp);
  1068.       }
  1069.       if ((FILE *)NULL == (fo = fopen(fp, W_BIN))) {
  1070. !         perror(fp);
  1071.           exit(1);
  1072.       }
  1073.   
  1074. ***************
  1075. *** 76,82 ****
  1076.       }
  1077.   
  1078.       fclose(fo);
  1079.       exit(0);
  1080.   }
  1081.   
  1082. --- 78,86 ----
  1083.       }
  1084.   
  1085.       fclose(fo);
  1086. ! #ifndef NO_ENCRYPTION
  1087. !     crypt_file(fp,0);   /* encrpyt the saved game */
  1088. ! #endif
  1089.       exit(0);
  1090.   }
  1091.   
  1092. ***************
  1093. *** 103,112 ****
  1094.       }
  1095.       clear();
  1096.       refresh();
  1097.       if ((FILE *)NULL == (fi = fopen(fp, R_BIN))) {
  1098.           endwin();
  1099. !         printf("Open error on '%s'n", fp);
  1100.           exit(1);
  1101.       }
  1102.       if ( (1 != fread((char *)&s, sizeof(s), 1, fi)) ||
  1103. --- 107,119 ----
  1104.       }
  1105.       clear();
  1106.       refresh();
  1107. ! #ifndef NO_ENCRYPTION
  1108. !      crypt_file(fp,1);   /*decrypt it*/
  1109. ! #endif
  1110.       if ((FILE *)NULL == (fi = fopen(fp, R_BIN))) {
  1111.           endwin();
  1112. !         printf("Open error on '%s'\n", fp);
  1113. !         printf("Cannot restore game --- sorry.\n");
  1114.           exit(1);
  1115.       }
  1116.       if ( (1 != fread((char *)&s, sizeof(s), 1, fi)) ||
  1117. ***************
  1118. *** 114,119 ****
  1119. --- 121,127 ----
  1120.            (1 != fread((char *)&zz, sizeof(zz), 1, fi)) ) {
  1121.           endwin();
  1122.           printf("Read error on '%s'n", fp);
  1123. +         printf("Cannot restore game --- sorry.\n");
  1124.           fclose(fi);
  1125.           exit(1);
  1126.       }
  1127. ***************
  1128. *** 150,155 ****
  1129. --- 158,164 ----
  1130.           if ((struct mon_rec *)NULL == (mp = make_monster(0, 0))) {
  1131.               endwin();
  1132.               printf("Monster alloc error on '%s'n", fp);
  1133. +                         printf("Try again - it might work.\nBut then,pigs might fly...\n");
  1134.               fclose(fi);
  1135.               exit(1);
  1136.           }
  1137. ***************
  1138. *** 156,161 ****
  1139. --- 165,171 ----
  1140.           if (1 != fread((char *)&tmp_monst, sizeof(struct mon_rec), 1, fi)) {
  1141.               endwin();
  1142.               printf("Monster read error on '%s'n", fp);
  1143. +             printf("Cannot restore game --- sorry.\n");
  1144.               fclose(fi);
  1145.               exit(1);
  1146.           }
  1147. *** wand_head.h.orig    Tue Nov 29 16:43:17 1988
  1148. --- wand_head.h    Tue Nov 29 16:45:09 1988
  1149. ***************
  1150. *** 19,24 ****
  1151. --- 19,29 ----
  1152.   /* change the numbers in this as well, but keep it in the same form */
  1153.   #define PASSWD (num * num * 4373 + num * 16927 + 39)
  1154.   
  1155. + /* To disable the recording of hiscores from games restored from saves */
  1156. + /* #define NO_RESTORED_GAME_HISCORES  */
  1157. + /* #define COMPARE_BY_NAME  define this to compare by name, not uid */
  1158. + #define GUESTUID 0    /* guestuid always compared by name */
  1159. + /* #define NO_ENCRYPTION define this to disable the savefile encryptor */
  1160.   /* cbreak switching via curses package. */
  1161.   /* on some Ultrix systems you may need to use crmode() and nocrmode() */
  1162.   /* if so, just change the #defs to the necessary. I also know that Xenix */
  1163. ***************
  1164. *** 31,38 ****
  1165.   #define CBOFF nocbreak()
  1166.   #endif
  1167.   
  1168. - /* To disable the recording of hiscores from games restored from saves */
  1169. - /* #define NO_RESTORED_GAME_HISCORES  */
  1170.   
  1171.   /* MSDOS modifications (M001) by Gregory H. Margo    */
  1172.   #ifdef    MSDOS
  1173. --- 36,41 ----
  1174.