static void convert_arg (char c) { const char *str; switch (c) { case 'p': str = plname; break; case 'c': str = (flags.female && urole.name.f) ? urole.name.f : urole.name.m; break; case 'r': str = rank_of(u.ulevel, Role_switch, flags.female); break; case 'R': str = rank_of(MIN_QUEST_LEVEL, Role_switch, flags.female); break; case 's': str = (flags.female) ? "sister" : "brother"; break; case 'S': str = (flags.female) ? "daughter" : "son"; break; case 'l': str = ldrname(); break; case 'i': str = intermed(); break; case 'o': str = the(artiname(urole.questarti)); break; case 'n': str = neminame(); break; case 'g': str = guardname(); break; case 'G': str = align_gtitle(u.ualignbase[A_ORIGINAL]); break; case 'H': str = homebase(); break; case 'a': str = align_str(u.ualignbase[A_ORIGINAL]); break; case 'A': str = align_str(u.ualign.type); break; case 'd': str = align_gname(u.ualignbase[A_ORIGINAL]); break; case 'D': str = align_gname(A_LAWFUL); break; case 'C': str = "chaotic"; break; case 'N': str = "neutral"; break; case 'L': str = "lawful"; break; case 'x': str = Blind() ? "sense" : "see"; break; case 'Z': str = dungeons[0].dname; break; case '%': str = "%"; break; default: str = ""; break; } strcpy(cvt_buf, str); }
static const char * convert_arg(char c) { switch (c) { case 'p': return msg_from_string(u.uplname); case 'c': return (u.ufemale && urole.name.f) ? urole.name.f : urole.name.m; case 'r': return rank_of(u.ulevel, Role_switch, u.ufemale); case 'R': return rank_of(MIN_QUEST_LEVEL, Role_switch, u.ufemale); case 's': return (u.ufemale) ? "sister" : "brother"; case 'S': return (u.ufemale) ? "daughter" : "son"; case 'l': case 'n': { int i = c == 'l' ? urole.ldrnum : urole.neminum;; return msgcat(type_is_pname(&mons[i]) ? "" : "the ", mons[i].mname); } case 'i': return urole.intermed; case 'o': return the(artiname(urole.questarti)); case 'g': return mons[urole.guardnum].mname; case 'G': return align_gtitle(u.ualignbase[A_ORIGINAL]); case 'H': return urole.homebase; case 'a': return align_str(u.ualignbase[A_ORIGINAL]); case 'A': return align_str(u.ualign.type); case 'd': return align_gname(u.ualignbase[A_ORIGINAL]); case 'D': return align_gname(A_LAWFUL); case 'C': return "chaotic"; case 'N': return "neutral"; case 'L': return "lawful"; case 'x': return Blind ? "sense" : "see"; case 'Z': return msg_from_string(gamestate.dungeons[0].dname); case '%': return "%"; default: return ""; } }
/* display a list of discovered artifacts; return their count */ int disp_artifact_discoveries( struct menulist *menu /* supplied by dodiscover() */ ) { int i, m, otyp; char buf[BUFSZ]; for (i = 0; i < NROFARTIFACTS; i++) { if (artidisco[i] == 0) break; /* empty slot implies end of list */ if (i == 0) add_menuheading(menu, "Artifacts"); m = artidisco[i]; otyp = artilist[m].otyp; sprintf(buf, " %s [%s %s]", artiname(m), align_str(artilist[m].alignment), simple_typename(otyp)); add_menutext(menu, buf); } return i; }