1 /* SCCS Id: @(#)do_name.c 3.4 2003/01/14 */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
9 STATIC_DCL void FDECL(do_oname, (struct obj *));
10 static void FDECL(getpos_help, (BOOLEAN_P,const char *));
12 extern const char what_is_an_unknown_object[]; /* from pager.c */
14 /* the response for '?' help request in getpos() */
16 getpos_help(force, goal)
21 boolean doing_what_is;
22 winid tmpwin = create_nhwindow(NHW_MENU);
24 Sprintf(sbuf, "Use [%s] to move the cursor to %s.",
25 iflags.num_pad ? "2468" : "hjkl", goal);
26 putstr(tmpwin, 0, sbuf);
27 putstr(tmpwin, 0, "Use [HJKL] to move the cursor 8 units at a time.");
28 putstr(tmpwin, 0, "Or enter a background symbol (ex. <).");
29 /* disgusting hack; the alternate selection characters work for any
30 getpos call, but they only matter for dowhatis (and doquickwhatis) */
31 doing_what_is = (goal == what_is_an_unknown_object);
32 Sprintf(sbuf, "Type a .%s when you are at the right place.",
33 doing_what_is ? " or , or ; or :" : "");
34 putstr(tmpwin, 0, sbuf);
36 putstr(tmpwin, 0, "Type Space or Escape when you're done.");
37 putstr(tmpwin, 0, "");
38 display_nhwindow(tmpwin, TRUE);
39 destroy_nhwindow(tmpwin);
43 getpos(cc, force, goal)
51 boolean msg_given = TRUE; /* clear message window by default */
52 static const char pick_chars[] = ".,;:";
55 if(iflags.num_pad) sdp = ndir; else sdp = sdir; /* DICE workaround */
58 pline("(For instructions type a ?)");
69 lock_mouse_cursor(TRUE);
72 c = nh_poskey(&tx, &ty, &sidx);
75 msg_given = TRUE; /* force clear */
80 if (!isok(tx, ty)) continue;
81 /* a mouse click event, just assign and return */
86 if ((cp = index(pick_chars, c)) != 0) {
87 /* '.' => 0, ',' => 1, ';' => 2, ':' => 3 */
88 result = cp - pick_chars;
91 for (i = 0; i < 8; i++) {
95 /* a normal movement letter or digit */
98 } else if (sdir[i] == lowc((char)c)) {
99 /* a shifted movement letter */
105 /* truncate at map edge; diagonal moves complicate this... */
107 dy -= sgn(dy) * (1 - (cx + dx));
108 dx = 1 - cx; /* so that (cx+dx == 1) */
109 } else if (cx + dx > COLNO-1) {
110 dy += sgn(dy) * ((COLNO-1) - (cx + dx));
114 dx -= sgn(dx) * (0 - (cy + dy));
115 dy = 0 - cy; /* so that (cy+dy == 0) */
116 } else if (cy + dy > ROWNO-1) {
117 dx += sgn(dx) * ((ROWNO-1) - (cy + dy));
126 getpos_help(force, goal);
128 if (!index(quitchars, c)) {
129 char matching[MAXPCHARS];
130 int pass, lo_x, lo_y, hi_x, hi_y, k = 0;
131 (void)memset((genericptr_t)matching, 0, sizeof matching);
132 for (sidx = 1; sidx < MAXPCHARS; sidx++)
133 if (c == defsyms[sidx].sym || c == (int)showsyms[sidx])
134 matching[sidx] = (char) ++k;
136 for (pass = 0; pass <= 1; pass++) {
137 /* pass 0: just past current pos to lower right;
138 pass 1: upper left corner to current pos */
139 lo_y = (pass == 0) ? cy : 0;
140 hi_y = (pass == 0) ? ROWNO - 1 : cy;
141 for (ty = lo_y; ty <= hi_y; ty++) {
142 lo_x = (pass == 0 && ty == lo_y) ? cx + 1 : 1;
143 hi_x = (pass == 1 && ty == hi_y) ? cx : COLNO - 1;
144 for (tx = lo_x; tx <= hi_x; tx++) {
145 k = levl[tx][ty].glyph;
146 if (glyph_is_cmap(k) &&
147 matching[glyph_to_cmap(k)]) {
150 clear_nhwindow(WIN_MESSAGE);
158 pline("Can't find dungeon feature '%c'.", c);
162 pline("Unknown direction: '%s' (%s).",
165 iflags.num_pad ? "use 2468 or ." : "use hjkl or .");
167 } /* k => matching */
169 if (force) goto nxtc;
171 msg_given = FALSE; /* suppress clear */
174 result = 0; /* not -1 */
185 lock_mouse_cursor(FALSE);
187 if (msg_given) clear_nhwindow(WIN_MESSAGE);
194 christen_monst(mtmp, name)
202 /* dogname & catname are PL_PSIZ arrays; object names have same limit */
203 lth = *name ? (int)(strlen(name) + 1) : 0;
206 name = strncpy(buf, name, PL_PSIZ - 1);
207 buf[PL_PSIZ - 1] = '\0';
209 if (lth == mtmp->mnamelth) {
210 /* don't need to allocate a new monst struct */
211 if (lth) Strcpy(NAME(mtmp), name);
214 mtmp2 = newmonst(mtmp->mxlth + lth);
216 (void) memcpy((genericptr_t)mtmp2->mextra,
217 (genericptr_t)mtmp->mextra, mtmp->mxlth);
218 mtmp2->mnamelth = lth;
219 if (lth) Strcpy(NAME(mtmp2), name);
230 register struct monst *mtmp;
234 You("would never recognize it anyway.");
239 if (getpos(&cc, FALSE, "the monster you want to name") < 0 ||
244 if (cx == u.ux && cy == u.uy) {
246 if (u.usteed && canspotmon(u.usteed))
250 pline("This %s creature is called %s and cannot be renamed.",
252 (flags.female ? "beautiful" : "handsome") :
262 if (!mtmp || (!sensemon(mtmp) &&
263 (!(cansee(cx,cy) || see_with_infrared(mtmp)) || mtmp->mundetected
264 || mtmp->m_ap_type == M_AP_FURNITURE
265 || mtmp->m_ap_type == M_AP_OBJECT
266 || (mtmp->minvis && !See_invisible)))) {
267 pline("I see no monster there.");
270 /* special case similar to the one in lookat() */
271 (void) distant_monnam(mtmp, ARTICLE_THE, buf);
272 Sprintf(qbuf, "What do you want to call %s?", buf);
274 if(!*buf || *buf == '\033') return(0);
275 /* strip leading and trailing spaces; unnames monster if all spaces */
276 (void)mungspaces(buf);
278 if (mtmp->data->geno & G_UNIQ)
279 pline("%s doesn't like being called names!", Monnam(mtmp));
281 (void) christen_monst(mtmp, buf);
286 * This routine changes the address of obj. Be careful not to call it
287 * when there might be pointers around in unknown places. For now: only
288 * when obj is in the inventory.
293 register struct obj *obj;
295 char buf[BUFSZ], qbuf[QBUFSZ];
299 Sprintf(qbuf, "What do you want to name %s %s?",
300 is_plural(obj) ? "these" : "this", xname(obj));
302 if(!*buf || *buf == '\033') return;
303 /* strip leading and trailing spaces; unnames item if all spaces */
304 (void)mungspaces(buf);
306 /* relax restrictions over proper capitalization for artifacts */
307 if ((aname = artifact_name(buf, &objtyp)) != 0 && objtyp == obj->otyp)
310 if (obj->oartifact) {
311 pline_The("artifact seems to resist the attempt.");
313 } else if (restrict_name(obj, buf) || exist_artifact(obj->otyp, buf)) {
314 int n = rn2((int)strlen(buf));
315 register char c1, c2;
318 do c2 = 'a' + rn2('z'-'a'); while (c1 == c2);
319 buf[n] = (buf[n] == c1) ? c2 : highc(c2); /* keep same case */
320 pline("While engraving your %s slips.", body_part(HAND));
321 display_nhwindow(WIN_MESSAGE, FALSE);
322 You("engrave: \"%s\".",buf);
324 obj = oname(obj, buf);
328 * Allocate a new and possibly larger storage space for an obj.
331 realloc_obj(obj, oextra_size, oextra_src, oname_size, name)
333 int oextra_size; /* storage to allocate for oextra */
334 genericptr_t oextra_src;
335 int oname_size; /* size of name string + 1 (null terminator) */
340 otmp = newobj(oextra_size + oname_size);
341 *otmp = *obj; /* the cobj pointer is copied to otmp */
344 (void) memcpy((genericptr_t)otmp->oextra, oextra_src,
347 otmp->oattached = OATTACHED_NOTHING;
349 otmp->oxlth = oextra_size;
351 otmp->onamelth = oname_size;
352 otmp->timed = 0; /* not timed, yet */
353 otmp->lamplit = 0; /* ditto */
354 /* __GNUC__ note: if the assignment of otmp->onamelth immediately
355 precedes this `if' statement, a gcc bug will miscompile the
356 test on vax (`insv' instruction used to store bitfield does
357 not set condition codes, but optimizer behaves as if it did).
358 gcc-2.7.2.1 finally fixed this. */
361 Strcpy(ONAME(otmp), name);
364 if (obj->owornmask) {
365 boolean save_twoweap = u.twoweap;
366 /* unwearing the old instance will clear dual-wield mode
367 if this object is either of the two weapons */
368 setworn((struct obj *)0, obj->owornmask);
369 setworn(otmp, otmp->owornmask);
370 u.twoweap = save_twoweap;
373 /* replace obj with otmp */
374 replace_object(obj, otmp);
376 /* fix ocontainer pointers */
377 if (Has_contents(obj)) {
380 for(inside = obj->cobj; inside; inside = inside->nobj)
381 inside->ocontainer = otmp;
384 /* move timers and light sources from obj to otmp */
385 if (obj->timed) obj_move_timers(obj, otmp);
386 if (obj->lamplit) obj_move_light_source(obj, otmp);
388 /* objects possibly being manipulated by multi-turn occupations
389 which have been interrupted but might be subsequently resumed */
390 if (obj->oclass == FOOD_CLASS)
391 food_substitution(obj, otmp); /* eat food or open tin */
392 else if (obj->oclass == SPBOOK_CLASS)
393 book_substitution(obj, otmp); /* read spellbook */
395 /* obfree(obj, otmp); now unnecessary: no pointers on bill */
396 dealloc_obj(obj); /* let us hope nobody else saved a pointer */
408 lth = *name ? (int)(strlen(name) + 1) : 0;
411 name = strncpy(buf, name, PL_PSIZ - 1);
412 buf[PL_PSIZ - 1] = '\0';
414 /* If named artifact exists in the game, do not create another.
415 * Also trying to create an artifact shouldn't de-artifact
416 * it (e.g. Excalibur from prayer). In this case the object
417 * will retain its current name. */
418 if (obj->oartifact || (lth && exist_artifact(obj->otyp, name)))
421 if (lth == obj->onamelth) {
422 /* no need to replace entire object */
423 if (lth) Strcpy(ONAME(obj), name);
425 obj = realloc_obj(obj, obj->oxlth,
426 (genericptr_t)obj->oextra, lth, name);
428 if (lth) artifact_exists(obj, name, TRUE);
429 if (obj->oartifact) {
430 /* can't dual-wield with artifact as secondary weapon */
431 if (obj == uswapwep) untwoweapon();
432 /* activate warning if you've just named your weapon "Sting" */
433 if (obj == uwep) set_artifact_intrinsic(obj, TRUE, W_WEP);
435 if (carried(obj)) update_inventory();
439 static NEARDATA const char callable[] = {
440 SCROLL_CLASS, POTION_CLASS, WAND_CLASS, RING_CLASS, AMULET_CLASS,
441 GEM_CLASS, SPBOOK_CLASS, ARMOR_CLASS, TOOL_CLASS, 0 };
446 register struct obj *obj;
456 ynq("Name an individual object?")) {
463 allowall[0] = ALL_CLASSES; allowall[1] = '\0';
464 obj = getobj(allowall, "name");
465 if(obj) do_oname(obj);
471 obj = getobj(callable, "call");
473 /* behave as if examining it in inventory;
474 this might set dknown if it was picked up
475 while blind and the hero can now see */
479 You("would never recognize another one.");
491 register struct obj *obj;
493 char buf[BUFSZ], qbuf[QBUFSZ];
495 register char **str1;
497 if (!obj->dknown) return; /* probably blind */
502 if (objects[otemp.otyp].oc_class == POTION_CLASS && otemp.fromsink)
503 /* kludge, meaning it's sink water */
504 Sprintf(qbuf,"Call a stream of %s fluid:",
505 OBJ_DESCR(objects[otemp.otyp]));
507 Sprintf(qbuf, "Call %s:", an(xname(&otemp)));
509 if(!*buf || *buf == '\033')
513 str1 = &(objects[obj->otyp].oc_uname);
514 if(*str1) free((genericptr_t)*str1);
516 /* strip leading and trailing spaces; uncalls item if all spaces */
517 (void)mungspaces(buf);
519 if (*str1) { /* had name, so possibly remove from disco[] */
520 /* strip name first, for the update_inventory() call
521 from undiscover_object() */
523 undiscover_object(obj->otyp);
526 *str1 = strcpy((char *) alloc((unsigned)strlen(buf)+1), buf);
527 discover_object(obj->otyp, FALSE, TRUE); /* possibly add to disco[] */
534 static const char * const ghostnames[] = {
535 /* these names should have length < PL_NSIZ */
536 /* Capitalize the names for aesthetics -dgk */
537 "Adri", "Andries", "Andreas", "Bert", "David", "Dirk", "Emile",
538 "Frans", "Fred", "Greg", "Hether", "Jay", "John", "Jon", "Karnov",
539 "Kay", "Kenny", "Kevin", "Maud", "Michiel", "Mike", "Peter", "Robert",
540 "Ron", "Tom", "Wilmar", "Nick Danger", "Phoenix", "Jiro", "Mizue",
541 "Stephan", "Lance Braccus", "Shadowhawk"
544 /* ghost names formerly set by x_monnam(), now by makemon() instead */
548 return rn2(7) ? ghostnames[rn2(SIZE(ghostnames))] : (const char *)plname;
551 /* Monster naming functions:
552 * x_monnam is the generic monster-naming function.
553 * seen unseen detected named
554 * mon_nam: the newt it the invisible orc Fido
555 * noit_mon_nam:the newt (as if detected) the invisible orc Fido
556 * l_monnam: newt it invisible orc dog called fido
557 * Monnam: The newt It The invisible orc Fido
558 * noit_Monnam: The newt (as if detected) The invisible orc Fido
559 * Adjmonnam: The poor newt It The poor invisible orc The poor Fido
560 * Amonnam: A newt It An invisible orc Fido
561 * a_monnam: a newt it an invisible orc Fido
562 * m_monnam: newt xan orc Fido
563 * y_monnam: your newt your xan your invisible orc Fido
566 /* Bug: if the monster is a priest or shopkeeper, not every one of these
567 * options works, since those are special cases.
570 x_monnam(mtmp, article, adjective, suppress, called)
571 register struct monst *mtmp;
573 /* ARTICLE_NONE, ARTICLE_THE, ARTICLE_A: obvious
574 * ARTICLE_YOUR: "your" on pets, "the" on everything else
576 * If the monster would be referred to as "it" or if the monster has a name
577 * _and_ there is no adjective, "invisible", "saddled", etc., override this
578 * and always use no article.
580 const char *adjective;
582 /* SUPPRESS_IT, SUPPRESS_INVISIBLE, SUPPRESS_HALLUCINATION, SUPPRESS_SADDLE.
583 * EXACT_NAME: combination of all the above
587 #ifdef LINT /* static char buf[BUFSZ]; */
590 static char buf[BUFSZ];
592 struct permonst *mdat = mtmp->data;
593 boolean do_hallu, do_invis, do_it, do_saddle;
594 boolean name_at_start, has_adjectives;
597 if (program_state.gameover)
598 suppress |= SUPPRESS_HALLUCINATION;
599 if (article == ARTICLE_YOUR && !mtmp->mtame)
600 article = ARTICLE_THE;
602 do_hallu = Hallucination && !(suppress & SUPPRESS_HALLUCINATION);
603 do_invis = mtmp->minvis && !(suppress & SUPPRESS_INVISIBLE);
604 do_it = !canspotmon(mtmp) &&
605 article != ARTICLE_YOUR &&
606 !program_state.gameover &&
610 !(u.uswallow && mtmp == u.ustuck) &&
611 !(suppress & SUPPRESS_IT);
612 do_saddle = !(suppress & SUPPRESS_SADDLE);
616 /* unseen monsters, etc. Use "it" */
622 /* priests and minions: don't even use this function */
623 if (mtmp->ispriest || mtmp->isminion) {
624 char priestnambuf[BUFSZ];
626 long save_prop = EHalluc_resistance;
627 unsigned save_invis = mtmp->minvis;
629 /* when true name is wanted, explicitly block Hallucination */
630 if (!do_hallu) EHalluc_resistance = 1L;
631 if (!do_invis) mtmp->minvis = 0;
632 name = priestname(mtmp, priestnambuf);
633 EHalluc_resistance = save_prop;
634 mtmp->minvis = save_invis;
635 if (article == ARTICLE_NONE && !strncmp(name, "the ", 4))
637 return strcpy(buf, name);
640 /* Shopkeepers: use shopkeeper name. For normal shopkeepers, just
641 * "Asidonhopo"; for unusual ones, "Asidonhopo the invisible
642 * shopkeeper" or "Asidonhopo the blue dragon". If hallucinating,
643 * none of this applies.
645 if (mtmp->isshk && !do_hallu) {
646 if (adjective && article == ARTICLE_THE) {
647 /* pathological case: "the angry Asidonhopo the blue dragon"
650 Strcat(strcat(buf, adjective), " ");
651 Strcat(buf, shkname(mtmp));
654 Strcat(buf, shkname(mtmp));
655 if (mdat == &mons[PM_SHOPKEEPER] && !do_invis)
657 Strcat(buf, " the ");
659 Strcat(buf, "invisible ");
660 Strcat(buf, mdat->mname);
664 /* Put the adjectives in the buffer */
666 Strcat(strcat(buf, adjective), " ");
668 Strcat(buf, "invisible ");
670 if (do_saddle && (mtmp->misc_worn_check & W_SADDLE) &&
671 !Blind && !Hallucination)
672 Strcat(buf, "saddled ");
675 has_adjectives = TRUE;
677 has_adjectives = FALSE;
679 /* Put the actual monster name or type into the buffer now */
680 /* Be sure to remember whether the buffer starts with a name */
682 Strcat(buf, rndmonnam());
683 name_at_start = FALSE;
684 } else if (mtmp->mnamelth) {
685 char *name = NAME(mtmp);
687 if (mdat == &mons[PM_GHOST]) {
688 Sprintf(eos(buf), "%s ghost", s_suffix(name));
689 name_at_start = TRUE;
691 Sprintf(eos(buf), "%s called %s", mdat->mname, name);
692 name_at_start = (boolean)type_is_pname(mdat);
693 } else if (is_mplayer(mdat) && (bp = strstri(name, " the ")) != 0) {
694 /* <name> the <adjective> <invisible> <saddled> <rank> */
698 pbuf[bp - name + 5] = '\0'; /* adjectives right after " the " */
701 Strcat(pbuf, bp + 5); /* append the rest of the name */
703 article = ARTICLE_NONE;
704 name_at_start = TRUE;
707 name_at_start = TRUE;
709 } else if (is_mplayer(mdat) && !In_endgame(&u.uz)) {
711 Strcpy(pbuf, rank_of((int)mtmp->m_lev,
713 (boolean)mtmp->female));
714 Strcat(buf, lcase(pbuf));
715 name_at_start = FALSE;
717 Strcat(buf, mdat->mname);
718 name_at_start = (boolean)type_is_pname(mdat);
721 if (name_at_start && (article == ARTICLE_YOUR || !has_adjectives)) {
722 if (mdat == &mons[PM_WIZARD_OF_YENDOR])
723 article = ARTICLE_THE;
725 article = ARTICLE_NONE;
726 } else if ((mdat->geno & G_UNIQ) && article == ARTICLE_A) {
727 article = ARTICLE_THE;
735 Strcpy(buf2, "your ");
740 Strcpy(buf2, "the ");
758 register struct monst *mtmp;
760 return(x_monnam(mtmp, ARTICLE_NONE, (char *)0,
761 mtmp->mnamelth ? SUPPRESS_SADDLE : 0, TRUE));
769 register struct monst *mtmp;
771 return(x_monnam(mtmp, ARTICLE_THE, (char *)0,
772 mtmp->mnamelth ? SUPPRESS_SADDLE : 0, FALSE));
775 /* print the name as if mon_nam() was called, but assume that the player
776 * can always see the monster--used for probing and for monsters aggravating
777 * the player with a cursed potion of invisibility
781 register struct monst *mtmp;
783 return(x_monnam(mtmp, ARTICLE_THE, (char *)0,
784 mtmp->mnamelth ? (SUPPRESS_SADDLE|SUPPRESS_IT) :
785 SUPPRESS_IT, FALSE));
790 register struct monst *mtmp;
792 register char *bp = mon_nam(mtmp);
800 register struct monst *mtmp;
802 register char *bp = noit_mon_nam(mtmp);
808 /* monster's own name */
813 return x_monnam(mtmp, ARTICLE_NONE, (char *)0, EXACT_NAME, FALSE);
816 /* pet name: "your little dog" */
821 int prefix, suppression_flag;
823 prefix = mtmp->mtame ? ARTICLE_YOUR : ARTICLE_THE;
824 suppression_flag = (mtmp->mnamelth
826 /* "saddled" is redundant when mounted */
829 ) ? SUPPRESS_SADDLE : 0;
831 return x_monnam(mtmp, prefix, (char *)0, suppression_flag, FALSE);
839 register struct monst *mtmp;
840 register const char *adj;
842 register char *bp = x_monnam(mtmp, ARTICLE_THE, adj,
843 mtmp->mnamelth ? SUPPRESS_SADDLE : 0, FALSE);
851 register struct monst *mtmp;
853 return x_monnam(mtmp, ARTICLE_A, (char *)0,
854 mtmp->mnamelth ? SUPPRESS_SADDLE : 0, FALSE);
859 register struct monst *mtmp;
861 register char *bp = a_monnam(mtmp);
867 /* used for monster ID by the '/', ';', and 'C' commands to block remote
868 identification of the endgame altars via their attending priests */
870 distant_monnam(mon, article, outbuf)
872 int article; /* only ARTICLE_NONE and ARTICLE_THE are handled here */
875 /* high priest(ess)'s identity is concealed on the Astral Plane,
876 unless you're adjacent (overridden for hallucination which does
877 its own obfuscation) */
878 if (mon->data == &mons[PM_HIGH_PRIEST] && !Hallucination &&
879 Is_astralevel(&u.uz) && distu(mon->mx, mon->my) > 2) {
880 Strcpy(outbuf, article == ARTICLE_THE ? "the " : "");
881 Strcat(outbuf, mon->female ? "high priestess" : "high priest");
883 Strcpy(outbuf, x_monnam(mon, article, (char *)0, 0, TRUE));
888 static const char * const bogusmons[] = {
889 "jumbo shrimp", "giant pigmy", "gnu", "killer penguin",
890 "giant cockroach", "giant slug", "maggot", "pterodactyl",
891 "tyrannosaurus rex", "basilisk", "beholder", "nightmare",
892 "efreeti", "marid", "rot grub", "bookworm", "master lichen",
893 "shadow", "hologram", "jester", "attorney", "sleazoid",
894 "killer tomato", "amazon", "robot", "battlemech",
895 "rhinovirus", "harpy", "lion-dog", "rat-ant", "Y2K bug",
897 "grue", "Christmas-tree monster", "luck sucker", "paskald",
898 "brogmoid", "dornbeast", /* Quendor (Zork, &c.) */
899 "Ancient Multi-Hued Dragon", "Evil Iggy",
901 "emu", "kestrel", "xeroc", "venus flytrap",
903 "creeping coins", /* Wizardry */
904 "hydra", "siren", /* Greek legend */
905 "killer bunny", /* Monty Python */
906 "rodent of unusual size", /* The Princess Bride */
907 "Smokey the bear", /* "Only you can prevent forest fires!" */
908 "Luggage", /* Discworld */
909 "Ent", /* Lord of the Rings */
910 "tangle tree", "nickelpede", "wiggle", /* Xanth */
911 "white rabbit", "snark", /* Lewis Carroll */
912 "pushmi-pullyu", /* Dr. Doolittle */
913 "smurf", /* The Smurfs */
914 "tribble", "Klingon", "Borg", /* Star Trek */
915 "Ewok", /* Star Wars */
916 "Totoro", /* Tonari no Totoro */
917 "ohmu", /* Nausicaa */
918 "youma", /* Sailor Moon */
919 "nyaasu", /* Pokemon (Meowth) */
920 "Godzilla", "King Kong", /* monster movies */
921 "earthquake beast", /* old L of SH */
922 "Invid", /* Robotech */
923 "Terminator", /* The Terminator */
924 "boomer", /* Bubblegum Crisis */
925 "Dalek", /* Dr. Who ("Exterminate!") */
926 "microscopic space fleet", "Ravenous Bugblatter Beast of Traal",
928 "teenage mutant ninja turtle", /* TMNT */
929 "samurai rabbit", /* Usagi Yojimbo */
930 "aardvark", /* Cerebus */
931 "Audrey II", /* Little Shop of Horrors */
932 "witch doctor", "one-eyed one-horned flying purple people eater",
933 /* 50's rock 'n' roll */
934 "Barney the dinosaur", /* saccharine kiddy TV */
935 "Morgoth", /* Angband */
936 "Vorlon", /* Babylon 5 */
937 "questing beast", /* King Arthur */
938 "Predator", /* Movie */
939 "mother-in-law" /* common pest */
943 /* Return a random monster name, for hallucination.
944 * KNOWN BUG: May be a proper name (Godzilla, Barney), may not
945 * (the Terminator, a Dalek). There's no elegant way to deal
946 * with this without radically modifying the calling functions.
954 name = rn1(SPECIAL_PM + SIZE(bogusmons) - LOW_PM, LOW_PM);
955 } while (name < SPECIAL_PM &&
956 (type_is_pname(&mons[name]) || (mons[name].geno & G_NOGEN)));
958 if (name >= SPECIAL_PM) return bogusmons[name - SPECIAL_PM];
959 return mons[name].mname;
964 roguename() /* Name of a Rogue player */
968 if ((opts = nh_getenv("ROGUEOPTS")) != 0) {
969 for (i = opts; *i; i++)
970 if (!strncmp("name=",i,5)) {
972 if ((j = index(i+5,',')) != 0)
977 return rn2(3) ? (rn2(2) ? "Michael Toy" : "Kenneth Arnold")
980 #endif /* REINCARNATION */
985 static NEARDATA const char * const hcolors[] = {
986 "ultraviolet", "infrared", "bluish-orange",
987 "reddish-green", "dark white", "light black", "sky blue-pink",
988 "salty", "sweet", "sour", "bitter",
989 "striped", "spiral", "swirly", "plaid", "checkered", "argyle",
990 "paisley", "blotchy", "guernsey-spotted", "polka-dotted",
991 "square", "round", "triangular",
992 "cabernet", "sangria", "fuchsia", "wisteria",
993 "lemon-lime", "strawberry-banana", "peppermint",
994 "romantic", "incandescent"
999 const char *colorpref;
1001 return (Hallucination || !colorpref) ?
1002 hcolors[rn2(SIZE(hcolors))] : colorpref;
1005 /* return a random real color unless hallucinating */
1009 int k = rn2(CLR_MAX);
1010 return Hallucination ? hcolor((char *)0) : (k == NO_COLOR) ?
1011 "colorless" : c_obj_colors[k];
1014 /* Aliases for road-runner nemesis
1016 static const char * const coynames[] = {
1017 "Carnivorous Vulgaris","Road-Runnerus Digestus",
1018 "Eatibus Anythingus" ,"Famishus-Famishus",
1019 "Eatibus Almost Anythingus","Eatius Birdius",
1020 "Famishius Fantasticus","Eternalii Famishiis",
1021 "Famishus Vulgarus","Famishius Vulgaris Ingeniusi",
1022 "Eatius-Slobbius","Hardheadipus Oedipus",
1023 "Carnivorous Slobbius","Hard-Headipus Ravenus",
1024 "Evereadii Eatibus","Apetitius Giganticus",
1025 "Hungrii Flea-Bagius","Overconfidentii Vulgaris",
1026 "Caninus Nervous Rex","Grotesques Appetitus",
1027 "Nemesis Riduclii","Canis latrans"
1031 coyotename(mtmp, buf)
1036 Sprintf(buf, "%s - %s",
1037 x_monnam(mtmp, ARTICLE_NONE, (char *)0, 0, TRUE),
1038 mtmp->mcan ? coynames[SIZE(coynames)-1] : coynames[rn2(SIZE(coynames)-1)]);