1*36982Sbostic /* display.c Larn is copyrighted 1986 by Noah Morgan. */ 2*36982Sbostic #include "header.h" 3*36982Sbostic #define makecode(_a,_b,_c) (((_a)<<16) + ((_b)<<8) + (_c)) 4*36982Sbostic 5*36982Sbostic static int minx,maxx,miny,maxy,k,m; 6*36982Sbostic static char bot1f=0,bot2f=0,bot3f=0; 7*36982Sbostic char always=0; 8*36982Sbostic /* 9*36982Sbostic bottomline() 10*36982Sbostic 11*36982Sbostic now for the bottom line of the display 12*36982Sbostic */ 13*36982Sbostic bottomline() 14*36982Sbostic { recalc(); bot1f=1; } 15*36982Sbostic bottomhp() 16*36982Sbostic { bot2f=1; } 17*36982Sbostic bottomspell() 18*36982Sbostic { bot3f=1; } 19*36982Sbostic bottomdo() 20*36982Sbostic { 21*36982Sbostic if (bot1f) { bot3f=bot1f=bot2f=0; bot_linex(); return; } 22*36982Sbostic if (bot2f) { bot2f=0; bot_hpx(); } 23*36982Sbostic if (bot3f) { bot3f=0; bot_spellx(); } 24*36982Sbostic } 25*36982Sbostic 26*36982Sbostic bot_linex() 27*36982Sbostic { 28*36982Sbostic register int i; 29*36982Sbostic if (cbak[SPELLS] <= -50 || (always)) 30*36982Sbostic { 31*36982Sbostic cursor( 1,18); 32*36982Sbostic if (c[SPELLMAX]>99) lprintf("Spells:%3d(%3d)",(long)c[SPELLS],(long)c[SPELLMAX]); 33*36982Sbostic else lprintf("Spells:%3d(%2d) ",(long)c[SPELLS],(long)c[SPELLMAX]); 34*36982Sbostic lprintf(" AC: %-3d WC: %-3d Level",(long)c[AC],(long)c[WCLASS]); 35*36982Sbostic if (c[LEVEL]>99) lprintf("%3d",(long)c[LEVEL]); 36*36982Sbostic else lprintf(" %-2d",(long)c[LEVEL]); 37*36982Sbostic lprintf(" Exp: %-9d %s\n",(long)c[EXPERIENCE],class[c[LEVEL]-1]); 38*36982Sbostic lprintf("HP: %3d(%3d) STR=%-2d INT=%-2d ", 39*36982Sbostic (long)c[HP],(long)c[HPMAX],(long)(c[STRENGTH]+c[STREXTRA]),(long)c[INTELLIGENCE]); 40*36982Sbostic lprintf("WIS=%-2d CON=%-2d DEX=%-2d CHA=%-2d LV:", 41*36982Sbostic (long)c[WISDOM],(long)c[CONSTITUTION],(long)c[DEXTERITY],(long)c[CHARISMA]); 42*36982Sbostic 43*36982Sbostic if ((level==0) || (wizard)) c[TELEFLAG]=0; 44*36982Sbostic if (c[TELEFLAG]) lprcat(" ?"); else lprcat(levelname[level]); 45*36982Sbostic lprintf(" Gold: %-6d",(long)c[GOLD]); 46*36982Sbostic always=1; botside(); 47*36982Sbostic c[TMP] = c[STRENGTH]+c[STREXTRA]; 48*36982Sbostic for (i=0; i<100; i++) cbak[i]=c[i]; 49*36982Sbostic return; 50*36982Sbostic } 51*36982Sbostic 52*36982Sbostic botsub(makecode(SPELLS,8,18),"%3d"); 53*36982Sbostic if (c[SPELLMAX]>99) botsub(makecode(SPELLMAX,12,18),"%3d)"); 54*36982Sbostic else botsub(makecode(SPELLMAX,12,18),"%2d) "); 55*36982Sbostic botsub(makecode(HP,5,19),"%3d"); 56*36982Sbostic botsub(makecode(HPMAX,9,19),"%3d"); 57*36982Sbostic botsub(makecode(AC,21,18),"%-3d"); 58*36982Sbostic botsub(makecode(WCLASS,30,18),"%-3d"); 59*36982Sbostic botsub(makecode(EXPERIENCE,49,18),"%-9d"); 60*36982Sbostic if (c[LEVEL] != cbak[LEVEL]) 61*36982Sbostic { cursor(59,18); lprcat(class[c[LEVEL]-1]); } 62*36982Sbostic if (c[LEVEL]>99) botsub(makecode(LEVEL,40,18),"%3d"); 63*36982Sbostic else botsub(makecode(LEVEL,40,18)," %-2d"); 64*36982Sbostic c[TMP] = c[STRENGTH]+c[STREXTRA]; botsub(makecode(TMP,18,19),"%-2d"); 65*36982Sbostic botsub(makecode(INTELLIGENCE,25,19),"%-2d"); 66*36982Sbostic botsub(makecode(WISDOM,32,19),"%-2d"); 67*36982Sbostic botsub(makecode(CONSTITUTION,39,19),"%-2d"); 68*36982Sbostic botsub(makecode(DEXTERITY,46,19),"%-2d"); 69*36982Sbostic botsub(makecode(CHARISMA,53,19),"%-2d"); 70*36982Sbostic if ((level != cbak[CAVELEVEL]) || (c[TELEFLAG] != cbak[TELEFLAG])) 71*36982Sbostic { 72*36982Sbostic if ((level==0) || (wizard)) c[TELEFLAG]=0; 73*36982Sbostic cbak[TELEFLAG] = c[TELEFLAG]; 74*36982Sbostic cbak[CAVELEVEL] = level; cursor(59,19); 75*36982Sbostic if (c[TELEFLAG]) lprcat(" ?"); else lprcat(levelname[level]); 76*36982Sbostic } 77*36982Sbostic botsub(makecode(GOLD,69,19),"%-6d"); 78*36982Sbostic botside(); 79*36982Sbostic } 80*36982Sbostic 81*36982Sbostic /* 82*36982Sbostic special subroutine to update only the gold number on the bottomlines 83*36982Sbostic called from ogold() 84*36982Sbostic */ 85*36982Sbostic bottomgold() 86*36982Sbostic { 87*36982Sbostic botsub(makecode(GOLD,69,19),"%-6d"); 88*36982Sbostic /* botsub(GOLD,"%-6d",69,19); */ 89*36982Sbostic } 90*36982Sbostic 91*36982Sbostic /* 92*36982Sbostic special routine to update hp and level fields on bottom lines 93*36982Sbostic called in monster.c hitplayer() and spattack() 94*36982Sbostic */ 95*36982Sbostic bot_hpx() 96*36982Sbostic { 97*36982Sbostic if (c[EXPERIENCE] != cbak[EXPERIENCE]) 98*36982Sbostic { 99*36982Sbostic recalc(); bot_linex(); 100*36982Sbostic } 101*36982Sbostic else botsub(makecode(HP,5,19),"%3d"); 102*36982Sbostic } 103*36982Sbostic 104*36982Sbostic /* 105*36982Sbostic special routine to update number of spells called from regen() 106*36982Sbostic */ 107*36982Sbostic bot_spellx() 108*36982Sbostic { 109*36982Sbostic botsub(makecode(SPELLS,9,18),"%2d"); 110*36982Sbostic } 111*36982Sbostic 112*36982Sbostic /* 113*36982Sbostic common subroutine for a more economical bottomline() 114*36982Sbostic */ 115*36982Sbostic static struct bot_side_def 116*36982Sbostic { 117*36982Sbostic int typ; 118*36982Sbostic char *string; 119*36982Sbostic } 120*36982Sbostic bot_data[] = 121*36982Sbostic { 122*36982Sbostic STEALTH,"stealth", UNDEADPRO,"undead pro", SPIRITPRO,"spirit pro", 123*36982Sbostic CHARMCOUNT,"Charm", TIMESTOP,"Time Stop", HOLDMONST,"Hold Monst", 124*36982Sbostic GIANTSTR,"Giant Str", FIRERESISTANCE,"Fire Resit", DEXCOUNT,"Dexterity", 125*36982Sbostic STRCOUNT,"Strength", SCAREMONST,"Scare", HASTESELF,"Haste Self", 126*36982Sbostic CANCELLATION,"Cancel", INVISIBILITY,"Invisible", ALTPRO,"Protect 3", 127*36982Sbostic PROTECTIONTIME,"Protect 2", WTW,"Wall-Walk" 128*36982Sbostic }; 129*36982Sbostic 130*36982Sbostic botside() 131*36982Sbostic { 132*36982Sbostic register int i,idx; 133*36982Sbostic for (i=0; i<17; i++) 134*36982Sbostic { 135*36982Sbostic idx = bot_data[i].typ; 136*36982Sbostic if ((always) || (c[idx] != cbak[idx])) 137*36982Sbostic { 138*36982Sbostic if ((always) || (cbak[idx] == 0)) 139*36982Sbostic { if (c[idx]) { cursor(70,i+1); lprcat(bot_data[i].string); } } else 140*36982Sbostic if (c[idx]==0) { cursor(70,i+1); lprcat(" "); } 141*36982Sbostic cbak[idx]=c[idx]; 142*36982Sbostic } 143*36982Sbostic } 144*36982Sbostic always=0; 145*36982Sbostic } 146*36982Sbostic 147*36982Sbostic static botsub(idx,str) 148*36982Sbostic register int idx; 149*36982Sbostic char *str; 150*36982Sbostic { 151*36982Sbostic register int x,y; 152*36982Sbostic y = idx & 0xff; x = (idx>>8) & 0xff; idx >>= 16; 153*36982Sbostic if (c[idx] != cbak[idx]) 154*36982Sbostic { cbak[idx]=c[idx]; cursor(x,y); lprintf(str,(long)c[idx]); } 155*36982Sbostic } 156*36982Sbostic 157*36982Sbostic /* 158*36982Sbostic * subroutine to draw only a section of the screen 159*36982Sbostic * only the top section of the screen is updated. If entire lines are being 160*36982Sbostic * drawn, then they will be cleared first. 161*36982Sbostic */ 162*36982Sbostic int d_xmin=0,d_xmax=MAXX,d_ymin=0,d_ymax=MAXY; /* for limited screen drawing */ 163*36982Sbostic draws(xmin,xmax,ymin,ymax) 164*36982Sbostic int xmin,xmax,ymin,ymax; 165*36982Sbostic { 166*36982Sbostic register int i,idx; 167*36982Sbostic if (xmin==0 && xmax==MAXX) /* clear section of screen as needed */ 168*36982Sbostic { 169*36982Sbostic if (ymin==0) cl_up(79,ymax); 170*36982Sbostic else for (i=ymin; i<ymin; i++) cl_line(1,i+1); 171*36982Sbostic xmin = -1; 172*36982Sbostic } 173*36982Sbostic d_xmin=xmin; d_xmax=xmax; d_ymin=ymin; d_ymax=ymax; /* for limited screen drawing */ 174*36982Sbostic drawscreen(); 175*36982Sbostic if (xmin<=0 && xmax==MAXX) /* draw stuff on right side of screen as needed*/ 176*36982Sbostic { 177*36982Sbostic for (i=ymin; i<ymax; i++) 178*36982Sbostic { 179*36982Sbostic idx = bot_data[i].typ; 180*36982Sbostic if (c[idx]) 181*36982Sbostic { 182*36982Sbostic cursor(70,i+1); lprcat(bot_data[i].string); 183*36982Sbostic } 184*36982Sbostic cbak[idx]=c[idx]; 185*36982Sbostic } 186*36982Sbostic } 187*36982Sbostic } 188*36982Sbostic 189*36982Sbostic /* 190*36982Sbostic drawscreen() 191*36982Sbostic 192*36982Sbostic subroutine to redraw the whole screen as the player knows it 193*36982Sbostic */ 194*36982Sbostic char screen[MAXX][MAXY],d_flag; /* template for the screen */ 195*36982Sbostic drawscreen() 196*36982Sbostic { 197*36982Sbostic register int i,j,k; 198*36982Sbostic int lastx,lasty; /* variables used to optimize the object printing */ 199*36982Sbostic if (d_xmin==0 && d_xmax==MAXX && d_ymin==0 && d_ymax==MAXY) 200*36982Sbostic { 201*36982Sbostic d_flag=1; clear(); /* clear the screen */ 202*36982Sbostic } 203*36982Sbostic else 204*36982Sbostic { 205*36982Sbostic d_flag=0; cursor(1,1); 206*36982Sbostic } 207*36982Sbostic if (d_xmin<0) 208*36982Sbostic d_xmin=0; /* d_xmin=-1 means display all without bottomline */ 209*36982Sbostic 210*36982Sbostic for (i=d_ymin; i<d_ymax; i++) 211*36982Sbostic for (j=d_xmin; j<d_xmax; j++) 212*36982Sbostic if (know[j][i]==0) screen[j][i] = ' '; else 213*36982Sbostic if (k=mitem[j][i]) screen[j][i] = monstnamelist[k]; else 214*36982Sbostic if ((k=item[j][i])==OWALL) screen[j][i] = '#'; 215*36982Sbostic else screen[j][i] = ' '; 216*36982Sbostic 217*36982Sbostic for (i=d_ymin; i<d_ymax; i++) 218*36982Sbostic { 219*36982Sbostic j=d_xmin; while ((screen[j][i]==' ') && (j<d_xmax)) j++; 220*36982Sbostic /* was m=0 */ 221*36982Sbostic if (j >= d_xmax) m=d_xmin; /* don't search backwards if blank line */ 222*36982Sbostic else 223*36982Sbostic { /* search backwards for end of line */ 224*36982Sbostic m=d_xmax-1; while ((screen[m][i]==' ') && (m>d_xmin)) --m; 225*36982Sbostic if (j<=m) cursor(j+1,i+1); else continue; 226*36982Sbostic } 227*36982Sbostic while (j <= m) 228*36982Sbostic { 229*36982Sbostic if (j <= m-3) 230*36982Sbostic { 231*36982Sbostic for (k=j; k<=j+3; k++) if (screen[k][i] != ' ') k=1000; 232*36982Sbostic if (k < 1000) 233*36982Sbostic { while(screen[j][i]==' ' && j<=m) j++; cursor(j+1,i+1); } 234*36982Sbostic } 235*36982Sbostic lprc(screen[j++][i]); 236*36982Sbostic } 237*36982Sbostic } 238*36982Sbostic setbold(); /* print out only bold objects now */ 239*36982Sbostic 240*36982Sbostic for (lastx=lasty=127, i=d_ymin; i<d_ymax; i++) 241*36982Sbostic for (j=d_xmin; j<d_xmax; j++) 242*36982Sbostic { 243*36982Sbostic if (k=item[j][i]) 244*36982Sbostic if (k != OWALL) 245*36982Sbostic if ((know[j][i]) && (mitem[j][i]==0)) 246*36982Sbostic if (objnamelist[k]!=' ') 247*36982Sbostic { 248*36982Sbostic if (lasty!=i+1 || lastx!=j) 249*36982Sbostic cursor(lastx=j+1,lasty=i+1); else lastx++; 250*36982Sbostic lprc(objnamelist[k]); 251*36982Sbostic } 252*36982Sbostic } 253*36982Sbostic 254*36982Sbostic resetbold(); if (d_flag) { always=1; botside(); always=1; bot_linex(); } 255*36982Sbostic oldx=99; 256*36982Sbostic d_xmin = 0 , d_xmax = MAXX , d_ymin = 0 , d_ymax = MAXY; /* for limited screen drawing */ 257*36982Sbostic } 258*36982Sbostic 259*36982Sbostic /* 260*36982Sbostic showcell(x,y) 261*36982Sbostic 262*36982Sbostic subroutine to display a cell location on the screen 263*36982Sbostic */ 264*36982Sbostic showcell(x,y) 265*36982Sbostic int x,y; 266*36982Sbostic { 267*36982Sbostic register int i,j,k,m; 268*36982Sbostic if (c[BLINDCOUNT]) return; /* see nothing if blind */ 269*36982Sbostic if (c[AWARENESS]) { minx = x-3; maxx = x+3; miny = y-3; maxy = y+3; } 270*36982Sbostic else { minx = x-1; maxx = x+1; miny = y-1; maxy = y+1; } 271*36982Sbostic 272*36982Sbostic if (minx < 0) minx=0; if (maxx > MAXX-1) maxx = MAXX-1; 273*36982Sbostic if (miny < 0) miny=0; if (maxy > MAXY-1) maxy = MAXY-1; 274*36982Sbostic 275*36982Sbostic for (j=miny; j<=maxy; j++) 276*36982Sbostic for (m=minx; m<=maxx; m++) 277*36982Sbostic if (know[m][j]==0) 278*36982Sbostic { 279*36982Sbostic cursor(m+1,j+1); 280*36982Sbostic x=maxx; while (know[x][j]) --x; 281*36982Sbostic for (i=m; i<=x; i++) 282*36982Sbostic { 283*36982Sbostic if ((k=mitem[i][j]) != 0) lprc(monstnamelist[k]); 284*36982Sbostic else switch(k=item[i][j]) 285*36982Sbostic { 286*36982Sbostic case OWALL: case 0: case OIVTELETRAP: case OTRAPARROWIV: 287*36982Sbostic case OIVDARTRAP: case OIVTRAPDOOR: 288*36982Sbostic lprc(objnamelist[k]); break; 289*36982Sbostic 290*36982Sbostic default: setbold(); lprc(objnamelist[k]); resetbold(); 291*36982Sbostic }; 292*36982Sbostic know[i][j]=1; 293*36982Sbostic } 294*36982Sbostic m = maxx; 295*36982Sbostic } 296*36982Sbostic } 297*36982Sbostic 298*36982Sbostic /* 299*36982Sbostic this routine shows only the spot that is given it. the spaces around 300*36982Sbostic these coordinated are not shown 301*36982Sbostic used in godirect() in monster.c for missile weapons display 302*36982Sbostic */ 303*36982Sbostic show1cell(x,y) 304*36982Sbostic int x,y; 305*36982Sbostic { 306*36982Sbostic if (c[BLINDCOUNT]) return; /* see nothing if blind */ 307*36982Sbostic cursor(x+1,y+1); 308*36982Sbostic if ((k=mitem[x][y]) != 0) lprc(monstnamelist[k]); 309*36982Sbostic else switch(k=item[x][y]) 310*36982Sbostic { 311*36982Sbostic case OWALL: case 0: case OIVTELETRAP: case OTRAPARROWIV: 312*36982Sbostic case OIVDARTRAP: case OIVTRAPDOOR: 313*36982Sbostic lprc(objnamelist[k]); break; 314*36982Sbostic 315*36982Sbostic default: setbold(); lprc(objnamelist[k]); resetbold(); 316*36982Sbostic }; 317*36982Sbostic know[x][y]|=1; /* we end up knowing about it */ 318*36982Sbostic } 319*36982Sbostic 320*36982Sbostic /* 321*36982Sbostic showplayer() 322*36982Sbostic 323*36982Sbostic subroutine to show where the player is on the screen 324*36982Sbostic cursor values start from 1 up 325*36982Sbostic */ 326*36982Sbostic showplayer() 327*36982Sbostic { 328*36982Sbostic cursor(playerx+1,playery+1); 329*36982Sbostic oldx=playerx; oldy=playery; 330*36982Sbostic } 331*36982Sbostic 332*36982Sbostic /* 333*36982Sbostic moveplayer(dir) 334*36982Sbostic 335*36982Sbostic subroutine to move the player from one room to another 336*36982Sbostic returns 0 if can't move in that direction or hit a monster or on an object 337*36982Sbostic else returns 1 338*36982Sbostic nomove is set to 1 to stop the next move (inadvertent monsters hitting 339*36982Sbostic players when walking into walls) if player walks off screen or into wall 340*36982Sbostic */ 341*36982Sbostic short diroffx[] = { 0, 0, 1, 0, -1, 1, -1, 1, -1 }; 342*36982Sbostic short diroffy[] = { 0, 1, 0, -1, 0, -1, -1, 1, 1 }; 343*36982Sbostic moveplayer(dir) 344*36982Sbostic int dir; /* from = present room # direction = [1-north] 345*36982Sbostic [2-east] [3-south] [4-west] [5-northeast] 346*36982Sbostic [6-northwest] [7-southeast] [8-southwest] 347*36982Sbostic if direction=0, don't move--just show where he is */ 348*36982Sbostic { 349*36982Sbostic register int k,m,i,j; 350*36982Sbostic if (c[CONFUSE]) if (c[LEVEL]<rnd(30)) dir=rund(9); /*if confused any dir*/ 351*36982Sbostic k = playerx + diroffx[dir]; m = playery + diroffy[dir]; 352*36982Sbostic if (k<0 || k>=MAXX || m<0 || m>=MAXY) { nomove=1; return(yrepcount = 0); } 353*36982Sbostic i = item[k][m]; j = mitem[k][m]; 354*36982Sbostic if (i==OWALL && c[WTW]==0) { nomove=1; return(yrepcount = 0); } /* hit a wall */ 355*36982Sbostic if (k==33 && m==MAXY-1 && level==1) 356*36982Sbostic { 357*36982Sbostic newcavelevel(0); for (k=0; k<MAXX; k++) for (m=0; m<MAXY; m++) 358*36982Sbostic if (item[k][m]==OENTRANCE) 359*36982Sbostic { playerx=k; playery=m; positionplayer(); drawscreen(); return(0); } 360*36982Sbostic } 361*36982Sbostic if (j>0) { hitmonster(k,m); return(yrepcount = 0); } /* hit a monster*/ 362*36982Sbostic lastpx = playerx; lastpy = playery; 363*36982Sbostic playerx = k; playery = m; 364*36982Sbostic if (i && i!=OTRAPARROWIV && i!=OIVTELETRAP && i!=OIVDARTRAP && i!=OIVTRAPDOOR) return(yrepcount = 0); else return(1); 365*36982Sbostic } 366*36982Sbostic 367*36982Sbostic /* 368*36982Sbostic * function to show what magic items have been discovered thus far 369*36982Sbostic * enter with -1 for just spells, anything else will give scrolls & potions 370*36982Sbostic */ 371*36982Sbostic static int lincount,count; 372*36982Sbostic seemagic(arg) 373*36982Sbostic int arg; 374*36982Sbostic { 375*36982Sbostic register int i,number; 376*36982Sbostic count = lincount = 0; nosignal=1; 377*36982Sbostic 378*36982Sbostic if (arg== -1) /* if display spells while casting one */ 379*36982Sbostic { 380*36982Sbostic for (number=i=0; i<SPNUM; i++) if (spelknow[i]) number++; 381*36982Sbostic number = (number+2)/3 + 4; /* # lines needed to display */ 382*36982Sbostic cl_up(79,number); cursor(1,1); 383*36982Sbostic } 384*36982Sbostic else 385*36982Sbostic { 386*36982Sbostic resetscroll(); clear(); 387*36982Sbostic } 388*36982Sbostic 389*36982Sbostic lprcat("The magic spells you have discovered thus far:\n\n"); 390*36982Sbostic for (i=0; i<SPNUM; i++) 391*36982Sbostic if (spelknow[i]) 392*36982Sbostic { lprintf("%s %-20s ",spelcode[i],spelname[i]); seepage(); } 393*36982Sbostic 394*36982Sbostic if (arg== -1) 395*36982Sbostic { 396*36982Sbostic seepage(); more(); nosignal=0; 397*36982Sbostic draws(0,MAXX,0,number); return; 398*36982Sbostic } 399*36982Sbostic 400*36982Sbostic lincount += 3; if (count!=0) { count=2; seepage(); } 401*36982Sbostic 402*36982Sbostic lprcat("\nThe magic scrolls you have found to date are:\n\n"); 403*36982Sbostic count=0; 404*36982Sbostic for (i=0; i<MAXSCROLL; i++) 405*36982Sbostic if (scrollname[i][0]) 406*36982Sbostic if (scrollname[i][1]!=' ') 407*36982Sbostic { lprintf("%-26s",&scrollname[i][1]); seepage(); } 408*36982Sbostic 409*36982Sbostic lincount += 3; if (count!=0) { count=2; seepage(); } 410*36982Sbostic 411*36982Sbostic lprcat("\nThe magic potions you have found to date are:\n\n"); 412*36982Sbostic count=0; 413*36982Sbostic for (i=0; i<MAXPOTION; i++) 414*36982Sbostic if (potionname[i][0]) 415*36982Sbostic if (potionname[i][1]!=' ') 416*36982Sbostic { lprintf("%-26s",&potionname[i][1]); seepage(); } 417*36982Sbostic 418*36982Sbostic if (lincount!=0) more(); nosignal=0; setscroll(); drawscreen(); 419*36982Sbostic } 420*36982Sbostic 421*36982Sbostic /* 422*36982Sbostic * subroutine to paginate the seemagic function 423*36982Sbostic */ 424*36982Sbostic seepage() 425*36982Sbostic { 426*36982Sbostic if (++count==3) 427*36982Sbostic { 428*36982Sbostic lincount++; count=0; lprc('\n'); 429*36982Sbostic if (lincount>17) { lincount=0; more(); clear(); } 430*36982Sbostic } 431*36982Sbostic } 432