void cgetret(char *s) { putsym('\n'); if(flags.standout) standoutbeg(); putstr("Hit "); putstr(flags.cbreak ? "space" : "return"); putstr(" to continue: "); if(flags.standout) standoutend(); xwaitforspace(s); }
static void getret() { xputs("\n"); if(flags.standout) standoutbeg(); xputs("Hit "); xputs(flags.cbreak ? "space" : "return"); xputs(" to continue: "); if(flags.standout) standoutend(); xwaitforspace(""); }
static void xmore(const char *s) /* allowed chars besides space/return */ { if(flags.toplin) { curs(tlx, tly); if(tlx + 8 > CO) putsym('\n'), tly++; } if(flags.standout) standoutbeg(); putstr("--More--"); if(flags.standout) standoutend(); xwaitforspace(s); if(flags.toplin && tly > 1) { home(); cl_end(); docorner(1, tly-1); } flags.toplin = 0; }
/* so>0: standout line; so=0: ordinary line; so<0: no output, return lth */ static int outentry(int rank, struct toptenentry *t1, int so) { boolean quit = FALSE, dead = FALSE, starv = FALSE; char linebuf[BUFSZ]; linebuf[0] = 0; if(rank) Sprintf(eos(linebuf), "%3d", rank); else Sprintf(eos(linebuf), " "); Sprintf(eos(linebuf), " %6ld %8s", t1->points, t1->name); if(t1->plchar == 'X') Sprintf(eos(linebuf), " "); else Sprintf(eos(linebuf), "-%c ", t1->plchar); if(!strncmp("escaped", t1->death, 7)) { if(!strcmp(" (with amulet)", t1->death+7)) Sprintf(eos(linebuf), "escaped the dungeon with amulet"); else Sprintf(eos(linebuf), "escaped the dungeon [max level %d]", t1->maxlvl); } else { if(!strncmp(t1->death,"quit",4)) { quit = TRUE; if(t1->maxhp < 3*t1->hp && t1->maxlvl < 4) Sprintf(eos(linebuf), "cravenly gave up"); else Sprintf(eos(linebuf), "quit"); } else if(!strcmp(t1->death,"choked")) Sprintf(eos(linebuf), "choked on %s food", (t1->sex == 'F') ? "her" : "his"); else if(!strncmp(t1->death,"starv",5)) Sprintf(eos(linebuf), "starved to death"), starv = TRUE; else Sprintf(eos(linebuf), "was killed"), dead = TRUE; Sprintf(eos(linebuf), " on%s level %d", (dead || starv) ? "" : " dungeon", t1->level); if(t1->maxlvl != t1->level) Sprintf(eos(linebuf), " [max %d]", t1->maxlvl); if(quit && t1->death[4]) Sprintf(eos(linebuf), t1->death + 4); } if(dead) Sprintf(eos(linebuf), " by %s%s", (!strncmp(t1->death, "trick", 5) || !strncmp(t1->death, "the ", 4)) ? "" : index(vowels,*t1->death) ? "an " : "a ", t1->death); Sprintf(eos(linebuf), "."); if(t1->maxhp) { char *bp = eos(linebuf); char hpbuf[10]; int hppos; Sprintf(hpbuf, (t1->hp > 0) ? itoa(t1->hp) : "-"); hppos = COLNO - 7 - strlen(hpbuf); if(bp <= linebuf + hppos) { while(bp < linebuf + hppos) *bp++ = ' '; strcpy(bp, hpbuf); Sprintf(eos(bp), " [%d]", t1->maxhp); } } if(so == 0) puts(linebuf); else if(so > 0) { char *bp = eos(linebuf); if(so >= COLNO) so = COLNO-1; while(bp < linebuf + so) *bp++ = ' '; *bp = 0; standoutbeg(); fputs(linebuf,stdout); standoutend(); putchar('\n'); } return(strlen(linebuf)); }