| 3249 | } |
| 3250 | |
| 3251 | staticfn boolean |
| 3252 | create_particular_creation( |
| 3253 | struct _create_particular_data *d) |
| 3254 | { |
| 3255 | struct permonst *whichpm = NULL; |
| 3256 | int i, mx, my, firstchoice = NON_PM; |
| 3257 | struct monst *mtmp; |
| 3258 | boolean madeany = FALSE; |
| 3259 | |
| 3260 | if (!d->randmonst) { |
| 3261 | firstchoice = d->which; |
| 3262 | if (cant_revive(&d->which, FALSE, (struct obj *) 0) |
| 3263 | && firstchoice != PM_LONG_WORM_TAIL) { |
| 3264 | /* wizard mode can override handling of special monsters */ |
| 3265 | char buf[BUFSZ]; |
| 3266 | |
| 3267 | Sprintf(buf, "Creating %s instead; force %s?", |
| 3268 | mons[d->which].pmnames[NEUTRAL], |
| 3269 | mons[firstchoice].pmnames[NEUTRAL]); |
| 3270 | if (y_n(buf) == 'y') |
| 3271 | d->which = firstchoice; |
| 3272 | } |
| 3273 | whichpm = &mons[d->which]; |
| 3274 | } |
| 3275 | for (i = 0; i < d->quan; i++) { |
| 3276 | mmflags_nht mmflags = NO_MM_FLAGS; |
| 3277 | |
| 3278 | if (d->monclass != MAXMCLASSES) |
| 3279 | whichpm = mkclass(d->monclass, 0); |
| 3280 | else if (d->randmonst) |
| 3281 | whichpm = rndmonst(); |
| 3282 | if (d->genderconf == -1) { |
| 3283 | /* no conflict exists between explicit gender term and |
| 3284 | the specified monster name */ |
| 3285 | if (d->fem != -1 && (!whichpm || (!is_male(whichpm) |
| 3286 | && !is_female(whichpm)))) |
| 3287 | mmflags |= (d->fem == FEMALE) ? MM_FEMALE |
| 3288 | : (d->fem == MALE) ? MM_MALE : 0; |
| 3289 | /* no surprise; "<mon> appears." rather than "<mon> appears!" */ |
| 3290 | mmflags |= MM_NOEXCLAM; |
| 3291 | } else { |
| 3292 | /* conundrum alert: an explicit gender term conflicts with an |
| 3293 | explicit gender-tied naming term (i.e. male cavewoman) */ |
| 3294 | |
| 3295 | /* option not gone with: name overrides the explicit gender as |
| 3296 | commented out here */ |
| 3297 | /* d->fem = d->genderconf; */ |
| 3298 | |
| 3299 | /* option chosen: let the explicit gender term (male or female) |
| 3300 | override the gender-tied naming term, so leave d->fem as-is */ |
| 3301 | |
| 3302 | mmflags |= (d->fem == FEMALE) ? MM_FEMALE |
| 3303 | : (d->fem == MALE) ? MM_MALE : 0; |
| 3304 | |
| 3305 | /* another option would be to consider it a faulty specification |
| 3306 | and reject the request completely and produce a random monster |
| 3307 | with a gender matching that specified instead (i.e. there is |
| 3308 | no such thing as a male cavewoman) */ |
no test coverage detected