construct text for the menu entries for IA_NAME_OBJ and IA_NAME_OTYP */
| 43 | |
| 44 | /* construct text for the menu entries for IA_NAME_OBJ and IA_NAME_OTYP */ |
| 45 | staticfn boolean |
| 46 | item_naming_classification( |
| 47 | struct obj *obj, |
| 48 | char *onamebuf, |
| 49 | char *ocallbuf) |
| 50 | { |
| 51 | static const char |
| 52 | Name[] = "Name", |
| 53 | Rename[] = "Rename or un-name", |
| 54 | Call[] = "Call", |
| 55 | /* "re-call" seems a bit weird, but "recall" and |
| 56 | "rename" don't fit for changing a type name */ |
| 57 | Recall[] = "Re-call or un-call"; |
| 58 | |
| 59 | onamebuf[0] = ocallbuf[0] = '\0'; |
| 60 | if (name_ok(obj) == GETOBJ_SUGGEST) { |
| 61 | Sprintf(onamebuf, "%s %s %s", |
| 62 | (!has_oname(obj) || !*ONAME(obj)) ? Name : Rename, |
| 63 | the_unique_obj(obj) ? "the" |
| 64 | : !is_plural(obj) ? "this specific" |
| 65 | : "this stack of", /*"these",*/ |
| 66 | simpleonames(obj)); |
| 67 | } |
| 68 | if (call_ok(obj) == GETOBJ_SUGGEST) { |
| 69 | char *callname = simpleonames(obj); |
| 70 | |
| 71 | /* prefix known unique item with "the", make all other types plural */ |
| 72 | if (the_unique_obj(obj)) /* treats unID'd fake amulets as if real */ |
| 73 | callname = the(callname); |
| 74 | else if (!is_plural(obj)) |
| 75 | callname = makeplural(callname); |
| 76 | Sprintf(ocallbuf, "%s the type for %s", |
| 77 | (!objects[obj->otyp].oc_uname |
| 78 | || !*objects[obj->otyp].oc_uname) ? Call : Recall, |
| 79 | callname); |
| 80 | } |
| 81 | return (*onamebuf || *ocallbuf) ? TRUE : FALSE; |
| 82 | } |
| 83 | |
| 84 | /* construct text for the menu entries for IA_READ_OBJ */ |
| 85 | staticfn int |
no test coverage detected