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 ""; } }
/* external hook for do.c (level change check) */ boolean ok_to_quest(boolean verbose) { if (!(Qstat(got_quest)) && !(Qstat(got_thanks))) { if (verbose) { if (Hallucination) You_hear("the man telling you what you can and can't do."); else You_hear("a mysterious voice say " "\"You must have permission to descend.\""); } } else if (is_pure(TRUE) <= 0) { if (verbose) { if (Hallucination) You_hear("someone whining about how you should treat %s " "better.", halu_gname(u.ualignbase[A_ORIGINAL])); else You_hear("a mysterious voice say " "\"Only the faithful of %s may descend.\"", align_gname(u.ualignbase[A_ORIGINAL])); } } else return TRUE; if (verbose) { if (Hallucination) pline("This staircase is a lie, man!"); else pline("A mysterious force prevents you from descending."); } return FALSE; }
void summon_minion(aligntyp alignment, boolean talk) { struct monst *mon; int mnum; switch ((int)alignment) { case A_LAWFUL: mnum = lminion(); break; case A_NEUTRAL: mnum = PM_AIR_ELEMENTAL + rn2(4); break; case A_CHAOTIC: case A_NONE: mnum = ndemon(&u.uz, alignment); break; default: impossible("unaligned player?"); mnum = ndemon(&u.uz, A_NONE); break; } if (mnum == NON_PM) { mon = 0; } else if (mons[mnum].pxtyp == MX_NONE) { const struct permonst *pm = &mons[mnum]; mon = makemon(pm, level, u.ux, u.uy, MM_EMIN); if (mon) { mon->isminion = TRUE; EMIN(mon)->min_align = alignment; } } else if (roamer_type(&mons[mnum])) { mon = makemon(&mons[mnum], level, u.ux, u.uy, NO_MM_FLAGS); if (mon) { mon->isminion = TRUE; EPRI(mon)->shralign = alignment; } } else mon = makemon(&mons[mnum], level, u.ux, u.uy, NO_MM_FLAGS); if (mon) { if (talk) { pline("The voice of %s booms:", align_gname(alignment)); verbalize("Thou shalt pay for thy indiscretion!"); if (!Blind) pline("%s appears before you.", Amonnam(mon)); } mon->mpeaceful = FALSE; /* don't call set_malign(); player was naughty */ } }