construct " {him|her|it}self" which might be distorted by Hallu; if that's plural, adjust monnamtext and verb */
| 1218 | /* construct "<monnamtext> <verb> <othertext> {him|her|it}self" which might |
| 1219 | be distorted by Hallu; if that's plural, adjust monnamtext and verb */ |
| 1220 | char * |
| 1221 | monverbself( |
| 1222 | struct monst *mon, |
| 1223 | char *monnamtext, /* modifiable 'mbuf' with adequate room at end */ |
| 1224 | const char *verb, |
| 1225 | const char *othertext) |
| 1226 | { |
| 1227 | char *verbs, selfbuf[40]; /* sizeof "themselves" suffices */ |
| 1228 | |
| 1229 | /* "himself"/"herself"/"itself", maybe "themselves" if hallucinating */ |
| 1230 | Strcpy(selfbuf, mon_nam_too(mon, mon)); |
| 1231 | /* verb starts plural; this will yield singular except for "themselves" */ |
| 1232 | verbs = vtense(selfbuf, verb); |
| 1233 | if (!strcmp(verb, verbs)) { /* a match indicates that it stayed plural */ |
| 1234 | monnamtext = makeplural(monnamtext); |
| 1235 | /* for "it", makeplural() produces "them" but we want "they" */ |
| 1236 | if (!strcmpi(monnamtext, genders[3].he)) { |
| 1237 | boolean capitaliz = (monnamtext[0] == highc(monnamtext[0])); |
| 1238 | |
| 1239 | Strcpy(monnamtext, genders[3].him); |
| 1240 | if (capitaliz) |
| 1241 | monnamtext[0] = highc(monnamtext[0]); |
| 1242 | } |
| 1243 | } |
| 1244 | Strcat(strcat(monnamtext, " "), verbs); |
| 1245 | if (othertext && *othertext) |
| 1246 | Strcat(strcat(monnamtext, " "), othertext); |
| 1247 | Strcat(strcat(monnamtext, " "), selfbuf); |
| 1248 | return monnamtext; |
| 1249 | } |
| 1250 | |
| 1251 | /* for debugging messages, where data might be suspect and we aren't |
| 1252 | taking what the hero does or doesn't know into consideration */ |
no test coverage detected