home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Games / larn12s.arc / LARN.ARC / DISPLAY.C < prev    next >
C/C++ Source or Header  |  1987-10-28  |  16KB  |  580 lines

  1. /*    display.c        Larn is copyrighted 1986 by Noah Morgan. */
  2. #include "header.h"
  3. # ifndef UNIX
  4. #define makecode(_a,_b,_c) ((((long) (_a)) <<16) + ((_b)<<8) + (_c))
  5. # else
  6. #define makecode(_a,_b,_c) (((_a)<<16) + ((_b)<<8) + (_c))
  7. #endif
  8.  
  9. static int minx,maxx,miny,maxy,k,m;
  10. static char bot1f=0,bot2f=0,bot3f=0;
  11. char always=0;
  12. /*
  13.     bottomline()
  14.  
  15.     now for the bottom line of the display
  16.  */
  17. bottomline()
  18.     {    recalc();    bot1f=1;    }
  19. bottomhp()
  20.     {    bot2f=1;    }
  21. bottomspell()
  22.     {    bot3f=1;    }
  23. bottomdo()
  24.     {
  25.     if (bot1f) { bot3f=bot1f=bot2f=0; bot_linex(); return; }
  26.     if (bot2f) { bot2f=0; bot_hpx(); }
  27.     if (bot3f) { bot3f=0; bot_spellx(); }
  28.     }
  29.  
  30. bot_linex()
  31.     {
  32.     register int i;
  33.     if (cbak[SPELLS] <= -50 || (always))
  34.         {
  35.         cursor( 1,18);
  36.         if (c[SPELLMAX]>99)  lprintf("Spells:%3d(%3d)",(long)c[SPELLS],(long)c[SPELLMAX]);
  37.                         else lprintf("Spells:%3d(%2d) ",(long)c[SPELLS],(long)c[SPELLMAX]);
  38.         lprintf(" AC: %-3d  WC: %-3d  Level",(long)c[AC],(long)c[WCLASS]);
  39.         if (c[LEVEL]>99) lprintf("%3d",(long)c[LEVEL]);
  40.                     else lprintf(" %-2d",(long)c[LEVEL]);
  41.         lprintf(" Exp: %-9d %s\n",(long)c[EXPERIENCE],class[c[LEVEL]-1]);
  42.         lprintf("HP: %3d(%3d) STR=%-2d INT=%-2d ",
  43.             (long)c[HP],(long)c[HPMAX],(long)(c[STRENGTH]+c[STREXTRA]),(long)c[INTELLIGENCE]);
  44.         lprintf("WIS=%-2d CON=%-2d DEX=%-2d CHA=%-2d LV:",
  45.             (long)c[WISDOM],(long)c[CONSTITUTION],(long)c[DEXTERITY],(long)c[CHARISMA]);
  46.  
  47.         if ((level==0) || (wizard))  c[TELEFLAG]=0;
  48.         if (c[TELEFLAG])  lprcat(" ?");  else  lprcat(levelname[level]);
  49.         lprintf("  Gold: %-6d",(long)c[GOLD]);
  50.         always=1;  botside();
  51.         c[TMP] = c[STRENGTH]+c[STREXTRA];
  52.         for (i=0; i<100; i++) cbak[i]=c[i];
  53.         return;
  54.         }
  55.  
  56.     botsub(makecode(SPELLS,8,18),"%3d");
  57.     if (c[SPELLMAX]>99)  botsub(makecode(SPELLMAX,12,18),"%3d)");
  58.                     else botsub(makecode(SPELLMAX,12,18),"%2d) ");
  59.     botsub(makecode(HP,5,19),"%3d");
  60.     botsub(makecode(HPMAX,9,19),"%3d");
  61.     botsub(makecode(AC,21,18),"%-3d");
  62.     botsub(makecode(WCLASS,30,18),"%-3d");
  63.     botsub(makecode(EXPERIENCE,49,18),"%-9d");
  64.     if (c[LEVEL] != cbak[LEVEL])
  65.         { cursor(59,18);    lprcat(class[c[LEVEL]-1]);  }
  66.     if (c[LEVEL]>99) botsub(makecode(LEVEL,40,18),"%3d");
  67.                 else botsub(makecode(LEVEL,40,18)," %-2d");
  68.     c[TMP] = c[STRENGTH]+c[STREXTRA];    botsub(makecode(TMP,18,19),"%-2d");
  69.     botsub(makecode(INTELLIGENCE,25,19),"%-2d");
  70.     botsub(makecode(WISDOM,32,19),"%-2d");
  71.     botsub(makecode(CONSTITUTION,39,19),"%-2d");
  72.     botsub(makecode(DEXTERITY,46,19),"%-2d");
  73.     botsub(makecode(CHARISMA,53,19),"%-2d");
  74.     if ((level != cbak[CAVELEVEL]) || (c[TELEFLAG] != cbak[TELEFLAG]))
  75.         {
  76.         if ((level==0) || (wizard))  c[TELEFLAG]=0;
  77.         cbak[TELEFLAG] = c[TELEFLAG];
  78.         cbak[CAVELEVEL] = level;    cursor(59,19);
  79.         if (c[TELEFLAG])  lprcat(" ?");  else  lprcat(levelname[level]);
  80.         }
  81.     botsub(makecode(GOLD,69,19),"%-6d");
  82.     botside();
  83.     }
  84.  
  85. /*
  86.     special subroutine to update only the gold number on the bottomlines
  87.     called from ogold()
  88.  */
  89. bottomgold()
  90.     {
  91.     botsub(makecode(GOLD,69,19),"%-6d");
  92. /*    botsub(GOLD,"%-6d",69,19); */
  93.     }
  94.  
  95. /*
  96.     special routine to update hp and level fields on bottom lines
  97.     called in monster.c hitplayer() and spattack()
  98.  */
  99. bot_hpx()
  100.     {
  101.     if (c[EXPERIENCE] != cbak[EXPERIENCE])
  102.         {
  103.         recalc();     bot_linex();
  104.         }
  105.     else botsub(makecode(HP,5,19),"%3d");    
  106.     }
  107.  
  108. /*
  109.     special routine to update number of spells called from regen()
  110.  */
  111. bot_spellx()
  112.     {
  113.     botsub(makecode(SPELLS,9,18),"%2d");
  114.     }
  115.  
  116. /*
  117.     common subroutine for a more economical bottomline()
  118.  */
  119. static struct bot_side_def
  120.     {
  121.     int typ;
  122.     char *string;
  123.     }
  124.     bot_data[] =
  125.     {
  126.     STEALTH,"stealth",        UNDEADPRO,"undead pro",        SPIRITPRO,"spirit pro",
  127.     CHARMCOUNT,"Charm",        TIMESTOP,"Time Stop",        HOLDMONST,"Hold Monst",
  128.     GIANTSTR,"Giant Str",    FIRERESISTANCE,"Fire Resit", DEXCOUNT,"Dexterity",
  129.     STRCOUNT,"Strength",    SCAREMONST,"Scare",            HASTESELF,"Haste Self",
  130.     CANCELLATION,"Cancel",    INVISIBILITY,"Invisible",    ALTPRO,"Protect 3",
  131.     PROTECTIONTIME,"Protect 2", WTW,"Wall-Walk"
  132.     };
  133.  
  134. botside()
  135.     {
  136.     register int i,idx;
  137.     for (i=0; i<17; i++)
  138.         {
  139.         idx = bot_data[i].typ;
  140.         if ((always) || (c[idx] != cbak[idx]))
  141.            {
  142.            if ((always) || (cbak[idx] == 0))
  143.                 { if (c[idx]) { cursor(70,i+1); lprcat(bot_data[i].string); } }  else
  144.            if (c[idx]==0)     { cursor(70,i+1); lprcat("          "); }
  145.            cbak[idx]=c[idx];
  146.            }
  147.         }
  148.     always=0;
  149.     }
  150.  
  151. static botsub(idx,str)
  152.     register long idx;
  153.     char *str;
  154.     {
  155.     register int x,y;
  156.     y = idx & 0xff;        x = (idx>>8) & 0xff;      idx >>= 16;
  157.     if (c[idx] != cbak[idx])
  158.         { cbak[idx]=c[idx];  cursor(x,y);  lprintf(str,(long)c[idx]); }
  159.     }
  160.  
  161. /*
  162.  *    subroutine to draw only a section of the screen
  163.  *    only the top section of the screen is updated.  If entire lines are being
  164.  *    drawn, then they will be cleared first.
  165.  */
  166. int d_xmin=0,d_xmax=MAXX,d_ymin=0,d_ymax=MAXY;    /* for limited screen drawing */
  167. draws(xmin,xmax,ymin,ymax)
  168.     int xmin,xmax,ymin,ymax;
  169.     {
  170.     register int i,idx;
  171.     if (xmin==0 && xmax==MAXX) /* clear section of screen as needed */
  172.         {
  173.         if (ymin==0) cl_up(79,ymax);
  174.         else for (i=ymin; i<ymin; i++)  cl_line(1,i+1);
  175.         xmin = -1;
  176.         }
  177.     d_xmin=xmin;    d_xmax=xmax;    d_ymin=ymin;    d_ymax=ymax;    /* for limited screen drawing */
  178.     drawscreen();
  179.     if (xmin<=0 && xmax==MAXX) /* draw stuff on right side of screen as needed*/
  180.         {
  181.         for (i=ymin; i<ymax; i++)
  182.             {
  183.             idx = bot_data[i].typ;
  184.             if (c[idx])
  185.                 {
  186.                 cursor(70,i+1); lprcat(bot_data[i].string);
  187.                 }
  188.             cbak[idx]=c[idx];
  189.             }
  190.         }
  191.     }
  192.  
  193. # ifdef DGK
  194. static int DECgraphics;        /* The graphics mode toggle */
  195.  
  196. # define DECgraphicsON() if (!DECgraphics) lprc('\16'), DECgraphics = 1
  197. # define DECgraphicsOFF() if (DECgraphics) lprc('\17'), DECgraphics = 0
  198.  
  199. /* For debugging on a non-DEC
  200. # define DECgraphicsON() if (!DECgraphics) lprcat("\33[4m"), DECgraphics = 1
  201. # define DECgraphicsOFF() if (DECgraphics) lprcat("\33[0m"), DECgraphics = 0
  202. */
  203.  
  204. # define DEClprc(ch)    if (ch & 0x80) {\
  205.                 DECgraphicsON();\
  206.                 lprc(ch ^ 0x80);\
  207.             } else {\
  208.                 DECgraphicsOFF();\
  209.                 lprc(ch);\
  210.             }
  211. # endif
  212.  
  213. /*
  214.     drawscreen()
  215.  
  216.     subroutine to redraw the whole screen as the player knows it
  217.  */
  218. char screen[MAXX][MAXY],d_flag;    /* template for the screen */
  219. drawscreen()
  220.     {
  221.     register int i,j,k;
  222.     int lastx,lasty;  /* variables used to optimize the object printing */
  223.     char    ch;
  224.  
  225.     if (d_xmin==0 && d_xmax==MAXX && d_ymin==0 && d_ymax==MAXY)
  226.         {
  227.         d_flag=1;  clear(); /* clear the screen */
  228.         }
  229.     else 
  230.         {
  231.         d_flag=0;  cursor(1,1);
  232.         }
  233.     if (d_xmin<0)
  234.         d_xmin=0; /* d_xmin=-1 means display all without bottomline */
  235.  
  236. #ifdef DGK
  237.     /* When we redraw this portion of the screen, we have 4 cases:
  238.      *    squares we know nothing about
  239.      *        - know == 0
  240.      *    squares we've been at and still know whats there
  241.      *        - know == KNOWALL (== KNOWHERE | HAVESEEN)
  242.      *    squares we've been at, but don't still recall because
  243.      *    something else happened there.
  244.      *        - know == HAVESEEN
  245.      *    squares we recall, but haven't been at (an error condition)
  246.      *        - know == KNOWHERE
  247.      */
  248.       for (i=d_ymin; i<d_ymax; i++)
  249.         for (j=d_xmin; j<d_xmax; j++)
  250.  
  251.         /* If we don't know anything about the square, it'a a blank
  252.          */
  253.         if (know[j][i] == 0)
  254.             screen[j][i] = ' ';
  255.         else if (know[j][i] & HAVESEEN) {
  256.  
  257.             /* Otherwise, if there's is a monster here, and we
  258.              * still know this square, show it.  Otherwise, the
  259.              * square is a WALL or a floor.
  260.              */
  261.             if ((k = mitem[j][i]) && know[j][i] & KNOWHERE)
  262.                 screen[j][i] = monstnamelist[k];
  263.             else if ((k = item[j][i]) == OWALL)
  264.                 screen[j][i] = wallc;
  265.             else
  266.                 screen[j][i] = floorc;
  267.         } else {
  268.  
  269.             /* Somehow we know what's here but have never
  270.              * actually been here.  This is because of some
  271.              * other routine incorrectly setting KNOWHERE and
  272.              * not HAVESEEN.
  273.              */
  274.             cursors();
  275.             lprintf("You know, but haven't seen %d,%d %d!?\n",
  276.                 (long) j, (long) i, (long) know[j][i]);
  277.             screen[j][i] = '?';
  278.         }
  279. # else
  280.       for (i=d_ymin; i<d_ymax; i++)
  281.         for (j=d_xmin; j<d_xmax; j++)
  282.           if (know[j][i]==0)  screen[j][i] = ' ';  else
  283.           if (k=mitem[j][i])  screen[j][i] = monstnamelist[k];  else
  284.           if ((k=item[j][i])==OWALL) screen[j][i] = '#';
  285.           else screen[j][i] = ' ';
  286. # endif
  287.   
  288.     for (i=d_ymin; i<d_ymax; i++) {
  289.         j=d_xmin;
  290.         while ((screen[j][i]==' ') && (j<d_xmax))
  291.             j++;
  292.         /* was m=0 */
  293.         if (j >= d_xmax)
  294.             m=d_xmin; /* don't search backwards if blank line */
  295.         else {    /* search backwards for end of line */
  296.             m=d_xmax-1;
  297.             while ((screen[m][i]==' ') && (m>d_xmin))
  298.                 --m;
  299.             if (j<=m)
  300.                 cursor(j+1,i+1);
  301.             else
  302.                 continue;
  303.         }
  304.         while (j <= m) {
  305.             if (j <= m-3) {
  306.                 for (k=j; k<=j+3; k++)
  307.                     if (screen[k][i] != ' ')
  308.                         k=1000;
  309.                 if (k < 1000) {
  310.                     while(screen[j][i]==' ' && j<=m)
  311.                         j++;
  312.                     cursor(j+1,i+1);
  313.                 }
  314.             }
  315. #ifdef MSDOS
  316. # ifdef DGK
  317.             if (DECRainbow) {
  318.                 ch = screen[j++][i];
  319.                 DEClprc(ch);
  320.             } else
  321. # endif
  322. #endif
  323.                 lprc(screen[j++][i]);
  324.         }
  325.     }
  326. #ifdef MSDOS
  327. # ifdef DGK
  328.     if (DECRainbow)
  329.         DECgraphicsOFF();
  330. # endif
  331. #endif
  332.     setbold();        /* print out only bold objects now */
  333.  
  334.     for (lastx=lasty=127, i=d_ymin; i<d_ymax; i++)
  335.         for (j=d_xmin; j<d_xmax; j++) {
  336.             if (k=item[j][i])
  337.                 if (k != OWALL)
  338.                     if ((know[j][i]) && (mitem[j][i]==0))
  339. #ifdef DGK
  340.                         if (objnamelist[k] != floorc) {
  341. #else
  342.                         if (objnamelist[k]!=' ') {
  343. #endif
  344.                             if (lasty!=i+1 || lastx!=j)
  345.                                 cursor(lastx=j+1,lasty=i+1);
  346.                             else
  347.                                 lastx++;
  348.                             lprc(objnamelist[k]);
  349.                         }
  350.         }
  351.  
  352.     resetbold();  if (d_flag)  { always=1; botside(); always=1; bot_linex(); }
  353.     oldx=99;
  354.     d_xmin = 0 , d_xmax = MAXX , d_ymin = 0 , d_ymax = MAXY; /* for limited screen drawing */
  355.     }
  356.  
  357. /*
  358.     showcell(x,y)
  359.  
  360.     subroutine to display a cell location on the screen
  361.  */
  362. showcell(x,y)
  363.     int x,y;
  364.     {
  365.     register int i,j,k,m;
  366. # ifdef DGK
  367.     /* Update places you've been to already, but no new exploration.
  368.      */
  369.     if (c[BLINDCOUNT]) {
  370.         if (know[x][y] & HAVESEEN) {
  371.             minx = maxx = x;
  372.             miny = maxy = y;
  373.         } else
  374.             return;
  375.     } else
  376. # else
  377.     if (c[BLINDCOUNT])  return;    /* see nothing if blind        */
  378. # endif
  379.     if (c[AWARENESS]) { minx = x-3;    maxx = x+3;    miny = y-3;    maxy = y+3; }
  380.             else      { minx = x-1;    maxx = x+1;    miny = y-1;    maxy = y+1; }
  381.  
  382.     if (minx < 0) minx=0;        if (maxx > MAXX-1) maxx = MAXX-1;
  383.     if (miny < 0) miny=0;        if (maxy > MAXY-1) maxy = MAXY-1;
  384.  
  385.     for (j=miny; j<=maxy; j++)
  386.       for (m=minx; m<=maxx; m++)
  387.       for (j=miny; j<=maxy; j++)
  388.         for (m=minx; m<=maxx; m++)
  389. # ifdef DGK
  390.         if ((know[m][j] & KNOWHERE) == 0)
  391. # else
  392.         if (know[m][j]==0)
  393. # endif
  394.             {
  395.             cursor(m+1,j+1);
  396. # ifdef DGK
  397.             x=maxx;  while (know[x][j] & KNOWHERE) --x;
  398. # else
  399.             x=maxx;  while (know[x][j]) --x;
  400. # endif
  401.             for (i=m; i<=x; i++)
  402.                 {
  403.                 if ((k=mitem[i][j]) != 0)  lprc(monstnamelist[k]);
  404.                 else switch(k=item[i][j])
  405.                     {
  406.                     case OWALL:  case 0: case OIVTELETRAP:  case OTRAPARROWIV:
  407.                     case OIVDARTRAP: case OIVTRAPDOOR:    
  408. #ifdef MSDOS
  409. # ifdef DGK
  410.                         if (DECRainbow) {
  411.                             DEClprc(objnamelist[k]);
  412.                         } else
  413. # endif
  414. #endif
  415.                         lprc(objnamelist[k]);    break;
  416.                     default: setbold(); lprc(objnamelist[k]); resetbold();
  417.                     };
  418. # ifdef DGK
  419.                 know[i][j] = KNOWALL;
  420. # else
  421.                 know[i][j]=1;
  422. # endif
  423.                 }
  424.             m = maxx;
  425. #ifdef MSDOS
  426. # ifdef DGK
  427.             if (DECRainbow)
  428.                 DECgraphicsOFF();
  429. # endif
  430. #endif
  431.             }
  432.     }
  433.  
  434. /*
  435.     this routine shows only the spot that is given it.  the spaces around
  436.     these coordinated are not shown
  437.     used in godirect() in monster.c for missile weapons display
  438.  */
  439. show1cell(x,y)
  440.     int x,y;
  441.     {
  442.     if (c[BLINDCOUNT])  return;    /* see nothing if blind        */
  443.     cursor(x+1,y+1);
  444.     if ((k=mitem[x][y]) != 0)  lprc(monstnamelist[k]);
  445.         else switch(k=item[x][y])
  446.             {
  447.             case OWALL:  case 0:  case OIVTELETRAP:  case OTRAPARROWIV: 
  448.             case OIVDARTRAP: case OIVTRAPDOOR:
  449. #ifdef MSDOS
  450. # ifdef DGK
  451.                 if (DECRainbow) {
  452.                     DEClprc(objnamelist[k]);
  453.                     DECgraphicsOFF();
  454.                 } else
  455. # endif
  456. #endif
  457.                 lprc(objnamelist[k]);    break;
  458.  
  459.             default: setbold(); lprc(objnamelist[k]); resetbold();
  460.             };
  461. # ifdef DGK
  462.     know[x][y] = KNOWALL;    /* we end up knowing about it */
  463. # else
  464.     know[x][y]|=1;    /* we end up knowing about it */
  465. # endif
  466.     }
  467.  
  468. /*
  469.     showplayer()
  470.  
  471.     subroutine to show where the player is on the screen
  472.     cursor values start from 1 up
  473.  */
  474. showplayer()
  475.     {
  476.     cursor(playerx+1,playery+1);
  477.     oldx=playerx;  oldy=playery;
  478.     }
  479.  
  480. /*
  481.     moveplayer(dir)
  482.  
  483.     subroutine to move the player from one room to another
  484.     returns 0 if can't move in that direction or hit a monster or on an object
  485.     else returns 1
  486.     nomove is set to 1 to stop the next move (inadvertent monsters hitting
  487.     players when walking into walls) if player walks off screen or into wall
  488.  */
  489. short diroffx[] = { 0,  0, 1,  0, -1,  1, -1, 1, -1 };
  490. short diroffy[] = { 0,  1, 0, -1,  0, -1, -1, 1,  1 };
  491. moveplayer(dir)
  492.     int dir;            /*    from = present room #  direction = [1-north]
  493.                             [2-east] [3-south] [4-west] [5-northeast]
  494.                             [6-northwest] [7-southeast] [8-southwest]
  495.                         if direction=0, don't move--just show where he is */
  496.     {
  497.     register int k,m,i,j;
  498.     if (c[CONFUSE]) if (c[LEVEL]<rnd(30)) dir=rund(9); /*if confused any dir*/
  499.     k = playerx + diroffx[dir];        m = playery + diroffy[dir];
  500.     if (k<0 || k>=MAXX || m<0 || m>=MAXY) { nomove=1; return(yrepcount = 0); }
  501.     i = item[k][m];            j = mitem[k][m];
  502.     if (i==OWALL && c[WTW]==0) { nomove=1;  return(yrepcount = 0); }        /*    hit a wall    */
  503.     if (k==33 && m==MAXY-1 && level==1)
  504.         {
  505.         newcavelevel(0); for (k=0; k<MAXX; k++) for (m=0; m<MAXY; m++)
  506.         if (item[k][m]==OENTRANCE)
  507.           { playerx=k; playery=m; positionplayer();  drawscreen(); return(0); }
  508.         }
  509.     if (j>0)     { hitmonster(k,m);    return(yrepcount = 0); } /* hit a monster*/
  510.     lastpx = playerx;            lastpy = playery;
  511.     playerx = k;        playery = m;
  512.     if (i && i!=OTRAPARROWIV && i!=OIVTELETRAP && i!=OIVDARTRAP && i!=OIVTRAPDOOR) return(yrepcount = 0);  else return(1);
  513.     }
  514.  
  515. /*
  516.  *    function to show what magic items have been discovered thus far
  517.  *    enter with -1 for just spells, anything else will give scrolls & potions
  518.  */
  519. static int lincount,count;
  520. seemagic(arg)
  521.     int arg;
  522.     {
  523.     register int i,number;
  524.     count = lincount = 0;  nosignal=1;
  525.  
  526.     if (arg== -1) /* if display spells while casting one */
  527.         {
  528.         for (number=i=0; i<SPNUM; i++) if (spelknow[i]) number++;
  529.         number = (number+2)/3 + 4;    /* # lines needed to display */
  530.         cl_up(79,number);  cursor(1,1);
  531.         }
  532.     else
  533.         {
  534.         resetscroll();  clear();
  535.         }
  536.  
  537.     lprcat("The magic spells you have discovered thus far:\n\n");
  538.     for (i=0; i<SPNUM; i++)
  539.         if (spelknow[i])
  540.             { lprintf("%s %-20s ",spelcode[i],spelname[i]);  seepage(); }
  541.  
  542.     if (arg== -1)
  543.         {
  544.         seepage();  more();     nosignal=0;
  545.         draws(0,MAXX,0,number);  return;
  546.         }
  547.  
  548.     lincount += 3;  if (count!=0) { count=2;  seepage(); }
  549.  
  550.     lprcat("\nThe magic scrolls you have found to date are:\n\n");
  551.     count=0;
  552.     for (i=0; i<MAXSCROLL; i++)
  553.         if (scrollname[i][0])
  554.           if (scrollname[i][1]!=' ')
  555.             { lprintf("%-26s",&scrollname[i][1]);  seepage(); }
  556.  
  557.     lincount += 3;  if (count!=0) { count=2;  seepage(); }
  558.  
  559.     lprcat("\nThe magic potions you have found to date are:\n\n");
  560.     count=0;
  561.     for (i=0; i<MAXPOTION; i++)
  562.         if (potionname[i][0])
  563.           if (potionname[i][1]!=' ')
  564.             { lprintf("%-26s",&potionname[i][1]);  seepage(); }
  565.  
  566.     if (lincount!=0) more();    nosignal=0;  setscroll();    drawscreen();
  567.     }
  568.  
  569. /*
  570.  *    subroutine to paginate the seemagic function
  571.  */
  572. seepage()
  573.     {
  574.     if (++count==3)
  575.         {
  576.         lincount++;    count=0;    lprc('\n');
  577.         if (lincount>17) {    lincount=0;  more();  clear();    }
  578.         }
  579.     }
  580.