OSDN Git Service

import nethack-3.6.0
[jnethack/source.git] / src / wizard.c
1 /* NetHack 3.6  wizard.c        $NHDT-Date: 1446078768 2015/10/29 00:32:48 $  $NHDT-Branch: master $:$NHDT-Revision: 1.42 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed.  See license for details. */
4
5 /* wizard code - inspired by rogue code from Merlyn Leroy (digi-g!brian) */
6 /*             - heavily modified to give the wiz balls.  (genat!mike)   */
7 /*             - dewimped and given some maledictions. -3. */
8 /*             - generalized for 3.1 (mike@bullns.on01.bull.ca) */
9
10 #include "hack.h"
11 #include "qtext.h"
12
13 extern const int monstr[];
14
15 STATIC_DCL short FDECL(which_arti, (int));
16 STATIC_DCL boolean FDECL(mon_has_arti, (struct monst *, SHORT_P));
17 STATIC_DCL struct monst *FDECL(other_mon_has_arti, (struct monst *, SHORT_P));
18 STATIC_DCL struct obj *FDECL(on_ground, (SHORT_P));
19 STATIC_DCL boolean FDECL(you_have, (int));
20 STATIC_DCL unsigned long FDECL(target_on, (int, struct monst *));
21 STATIC_DCL unsigned long FDECL(strategy, (struct monst *));
22
23 static NEARDATA const int nasties[] = {
24     PM_COCKATRICE, PM_ETTIN, PM_STALKER, PM_MINOTAUR, PM_RED_DRAGON,
25     PM_BLACK_DRAGON, PM_GREEN_DRAGON, PM_OWLBEAR, PM_PURPLE_WORM,
26     PM_ROCK_TROLL, PM_XAN, PM_GREMLIN, PM_UMBER_HULK, PM_VAMPIRE_LORD,
27     PM_XORN, PM_ZRUTY, PM_ELF_LORD, PM_ELVENKING, PM_YELLOW_DRAGON,
28     PM_LEOCROTTA, PM_BALUCHITHERIUM, PM_CARNIVOROUS_APE, PM_FIRE_GIANT,
29     PM_COUATL, PM_CAPTAIN, PM_WINGED_GARGOYLE, PM_MASTER_MIND_FLAYER,
30     PM_FIRE_ELEMENTAL, PM_JABBERWOCK, PM_ARCH_LICH, PM_OGRE_KING, PM_OLOG_HAI,
31     PM_IRON_GOLEM, PM_OCHRE_JELLY, PM_GREEN_SLIME, PM_DISENCHANTER
32 };
33
34 static NEARDATA const unsigned wizapp[] = {
35     PM_HUMAN,      PM_WATER_DEMON,  PM_VAMPIRE,       PM_RED_DRAGON,
36     PM_TROLL,      PM_UMBER_HULK,   PM_XORN,          PM_XAN,
37     PM_COCKATRICE, PM_FLOATING_EYE, PM_GUARDIAN_NAGA, PM_TRAPPER
38 };
39
40 /* If you've found the Amulet, make the Wizard appear after some time */
41 /* Also, give hints about portal locations, if amulet is worn/wielded -dlc */
42 void
43 amulet()
44 {
45     struct monst *mtmp;
46     struct trap *ttmp;
47     struct obj *amu;
48
49 #if 0 /* caller takes care of this check */
50     if (!u.uhave.amulet)
51         return;
52 #endif
53     if ((((amu = uamul) != 0 && amu->otyp == AMULET_OF_YENDOR)
54          || ((amu = uwep) != 0 && amu->otyp == AMULET_OF_YENDOR))
55         && !rn2(15)) {
56         for (ttmp = ftrap; ttmp; ttmp = ttmp->ntrap) {
57             if (ttmp->ttyp == MAGIC_PORTAL) {
58                 int du = distu(ttmp->tx, ttmp->ty);
59                 if (du <= 9)
60                     pline("%s hot!", Tobjnam(amu, "feel"));
61                 else if (du <= 64)
62                     pline("%s very warm.", Tobjnam(amu, "feel"));
63                 else if (du <= 144)
64                     pline("%s warm.", Tobjnam(amu, "feel"));
65                 /* else, the amulet feels normal */
66                 break;
67             }
68         }
69     }
70
71     if (!context.no_of_wizards)
72         return;
73     /* find Wizard, and wake him if necessary */
74     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
75         if (DEADMONSTER(mtmp))
76             continue;
77         if (mtmp->iswiz && mtmp->msleeping && !rn2(40)) {
78             mtmp->msleeping = 0;
79             if (distu(mtmp->mx, mtmp->my) > 2)
80                 You(
81       "get the creepy feeling that somebody noticed your taking the Amulet.");
82             return;
83         }
84     }
85 }
86
87 int
88 mon_has_amulet(mtmp)
89 register struct monst *mtmp;
90 {
91     register struct obj *otmp;
92
93     for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
94         if (otmp->otyp == AMULET_OF_YENDOR)
95             return 1;
96     return 0;
97 }
98
99 int
100 mon_has_special(mtmp)
101 register struct monst *mtmp;
102 {
103     register struct obj *otmp;
104
105     for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
106         if (otmp->otyp == AMULET_OF_YENDOR || is_quest_artifact(otmp)
107             || otmp->otyp == BELL_OF_OPENING
108             || otmp->otyp == CANDELABRUM_OF_INVOCATION
109             || otmp->otyp == SPE_BOOK_OF_THE_DEAD)
110             return 1;
111     return 0;
112 }
113
114 /*
115  *      New for 3.1  Strategy / Tactics for the wiz, as well as other
116  *      monsters that are "after" something (defined via mflag3).
117  *
118  *      The strategy section decides *what* the monster is going
119  *      to attempt, the tactics section implements the decision.
120  */
121 #define STRAT(w, x, y, typ)                            \
122     ((unsigned long) (w) | ((unsigned long) (x) << 16) \
123      | ((unsigned long) (y) << 8) | (unsigned long) (typ))
124
125 #define M_Wants(mask) (mtmp->data->mflags3 & (mask))
126
127 STATIC_OVL short
128 which_arti(mask)
129 register int mask;
130 {
131     switch (mask) {
132     case M3_WANTSAMUL:
133         return AMULET_OF_YENDOR;
134     case M3_WANTSBELL:
135         return BELL_OF_OPENING;
136     case M3_WANTSCAND:
137         return CANDELABRUM_OF_INVOCATION;
138     case M3_WANTSBOOK:
139         return SPE_BOOK_OF_THE_DEAD;
140     default:
141         break; /* 0 signifies quest artifact */
142     }
143     return 0;
144 }
145
146 /*
147  *      If "otyp" is zero, it triggers a check for the quest_artifact,
148  *      since bell, book, candle, and amulet are all objects, not really
149  *      artifacts right now.  [MRS]
150  */
151 STATIC_OVL boolean
152 mon_has_arti(mtmp, otyp)
153 register struct monst *mtmp;
154 register short otyp;
155 {
156     register struct obj *otmp;
157
158     for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) {
159         if (otyp) {
160             if (otmp->otyp == otyp)
161                 return 1;
162         } else if (is_quest_artifact(otmp))
163             return 1;
164     }
165     return 0;
166 }
167
168 STATIC_OVL struct monst *
169 other_mon_has_arti(mtmp, otyp)
170 register struct monst *mtmp;
171 register short otyp;
172 {
173     register struct monst *mtmp2;
174
175     for (mtmp2 = fmon; mtmp2; mtmp2 = mtmp2->nmon)
176         /* no need for !DEADMONSTER check here since they have no inventory */
177         if (mtmp2 != mtmp)
178             if (mon_has_arti(mtmp2, otyp))
179                 return mtmp2;
180
181     return (struct monst *) 0;
182 }
183
184 STATIC_OVL struct obj *
185 on_ground(otyp)
186 register short otyp;
187 {
188     register struct obj *otmp;
189
190     for (otmp = fobj; otmp; otmp = otmp->nobj)
191         if (otyp) {
192             if (otmp->otyp == otyp)
193                 return otmp;
194         } else if (is_quest_artifact(otmp))
195             return otmp;
196     return (struct obj *) 0;
197 }
198
199 STATIC_OVL boolean
200 you_have(mask)
201 register int mask;
202 {
203     switch (mask) {
204     case M3_WANTSAMUL:
205         return (boolean) u.uhave.amulet;
206     case M3_WANTSBELL:
207         return (boolean) u.uhave.bell;
208     case M3_WANTSCAND:
209         return (boolean) u.uhave.menorah;
210     case M3_WANTSBOOK:
211         return (boolean) u.uhave.book;
212     case M3_WANTSARTI:
213         return (boolean) u.uhave.questart;
214     default:
215         break;
216     }
217     return 0;
218 }
219
220 STATIC_OVL unsigned long
221 target_on(mask, mtmp)
222 register int mask;
223 register struct monst *mtmp;
224 {
225     register short otyp;
226     register struct obj *otmp;
227     register struct monst *mtmp2;
228
229     if (!M_Wants(mask))
230         return (unsigned long) STRAT_NONE;
231
232     otyp = which_arti(mask);
233     if (!mon_has_arti(mtmp, otyp)) {
234         if (you_have(mask))
235             return STRAT(STRAT_PLAYER, u.ux, u.uy, mask);
236         else if ((otmp = on_ground(otyp)))
237             return STRAT(STRAT_GROUND, otmp->ox, otmp->oy, mask);
238         else if ((mtmp2 = other_mon_has_arti(mtmp, otyp)) != 0
239                  /* when seeking the Amulet, avoid targetting the Wizard
240                     or temple priests (to protect Moloch's high priest) */
241                  && (otyp != AMULET_OF_YENDOR
242                      || (!mtmp2->iswiz && !inhistemple(mtmp2))))
243             return STRAT(STRAT_MONSTR, mtmp2->mx, mtmp2->my, mask);
244     }
245     return (unsigned long) STRAT_NONE;
246 }
247
248 STATIC_OVL unsigned long
249 strategy(mtmp)
250 register struct monst *mtmp;
251 {
252     unsigned long strat, dstrat;
253
254     if (!is_covetous(mtmp->data)
255         /* perhaps a shopkeeper has been polymorphed into a master
256            lich; we don't want it teleporting to the stairs to heal
257            because that will leave its shop untended */
258         || (mtmp->isshk && inhishop(mtmp))
259         /* likewise for temple priests */
260         || (mtmp->ispriest && inhistemple(mtmp)))
261         return (unsigned long) STRAT_NONE;
262
263     switch ((mtmp->mhp * 3) / mtmp->mhpmax) { /* 0-3 */
264
265     default:
266     case 0: /* panic time - mtmp is almost snuffed */
267         return (unsigned long) STRAT_HEAL;
268
269     case 1: /* the wiz is less cautious */
270         if (mtmp->data != &mons[PM_WIZARD_OF_YENDOR])
271             return (unsigned long) STRAT_HEAL;
272     /* else fall through */
273
274     case 2:
275         dstrat = STRAT_HEAL;
276         break;
277
278     case 3:
279         dstrat = STRAT_NONE;
280         break;
281     }
282
283     if (context.made_amulet)
284         if ((strat = target_on(M3_WANTSAMUL, mtmp)) != STRAT_NONE)
285             return strat;
286
287     if (u.uevent.invoked) { /* priorities change once gate opened */
288         if ((strat = target_on(M3_WANTSARTI, mtmp)) != STRAT_NONE)
289             return strat;
290         if ((strat = target_on(M3_WANTSBOOK, mtmp)) != STRAT_NONE)
291             return strat;
292         if ((strat = target_on(M3_WANTSBELL, mtmp)) != STRAT_NONE)
293             return strat;
294         if ((strat = target_on(M3_WANTSCAND, mtmp)) != STRAT_NONE)
295             return strat;
296     } else {
297         if ((strat = target_on(M3_WANTSBOOK, mtmp)) != STRAT_NONE)
298             return strat;
299         if ((strat = target_on(M3_WANTSBELL, mtmp)) != STRAT_NONE)
300             return strat;
301         if ((strat = target_on(M3_WANTSCAND, mtmp)) != STRAT_NONE)
302             return strat;
303         if ((strat = target_on(M3_WANTSARTI, mtmp)) != STRAT_NONE)
304             return strat;
305     }
306     return dstrat;
307 }
308
309 int
310 tactics(mtmp)
311 register struct monst *mtmp;
312 {
313     unsigned long strat = strategy(mtmp);
314
315     mtmp->mstrategy =
316         (mtmp->mstrategy & (STRAT_WAITMASK | STRAT_APPEARMSG)) | strat;
317
318     switch (strat) {
319     case STRAT_HEAL: /* hide and recover */
320         /* if wounded, hole up on or near the stairs (to block them) */
321         /* unless, of course, there are no stairs (e.g. endlevel) */
322         mtmp->mavenge = 1; /* covetous monsters attack while fleeing */
323         if (In_W_tower(mtmp->mx, mtmp->my, &u.uz)
324             || (mtmp->iswiz && !xupstair && !mon_has_amulet(mtmp))) {
325             if (!rn2(3 + mtmp->mhp / 10))
326                 (void) rloc(mtmp, TRUE);
327         } else if (xupstair
328                    && (mtmp->mx != xupstair || mtmp->my != yupstair)) {
329             (void) mnearto(mtmp, xupstair, yupstair, TRUE);
330         }
331         /* if you're not around, cast healing spells */
332         if (distu(mtmp->mx, mtmp->my) > (BOLT_LIM * BOLT_LIM))
333             if (mtmp->mhp <= mtmp->mhpmax - 8) {
334                 mtmp->mhp += rnd(8);
335                 return 1;
336             }
337     /* fall through :-) */
338
339     case STRAT_NONE: /* harass */
340         if (!rn2(!mtmp->mflee ? 5 : 33))
341             mnexto(mtmp);
342         return 0;
343
344     default: /* kill, maim, pillage! */
345     {
346         long where = (strat & STRAT_STRATMASK);
347         xchar tx = STRAT_GOALX(strat), ty = STRAT_GOALY(strat);
348         int targ = (int) (strat & STRAT_GOAL);
349         struct obj *otmp;
350
351         if (!targ) { /* simply wants you to close */
352             return 0;
353         }
354         if ((u.ux == tx && u.uy == ty) || where == STRAT_PLAYER) {
355             /* player is standing on it (or has it) */
356             mnexto(mtmp);
357             return 0;
358         }
359         if (where == STRAT_GROUND) {
360             if (!MON_AT(tx, ty) || (mtmp->mx == tx && mtmp->my == ty)) {
361                 /* teleport to it and pick it up */
362                 rloc_to(mtmp, tx, ty); /* clean old pos */
363
364                 if ((otmp = on_ground(which_arti(targ))) != 0) {
365                     if (cansee(mtmp->mx, mtmp->my))
366                         pline("%s picks up %s.", Monnam(mtmp),
367                               (distu(mtmp->mx, mtmp->my) <= 5)
368                                   ? doname(otmp)
369                                   : distant_name(otmp, doname));
370                     obj_extract_self(otmp);
371                     (void) mpickobj(mtmp, otmp);
372                     return 1;
373                 } else
374                     return 0;
375             } else {
376                 /* a monster is standing on it - cause some trouble */
377                 if (!rn2(5))
378                     mnexto(mtmp);
379                 return 0;
380             }
381         } else { /* a monster has it - 'port beside it. */
382             (void) mnearto(mtmp, tx, ty, FALSE);
383             return 0;
384         }
385     }
386     }
387     /*NOTREACHED*/
388     return 0;
389 }
390
391 void
392 aggravate()
393 {
394     register struct monst *mtmp;
395
396     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
397         if (DEADMONSTER(mtmp))
398             continue;
399         mtmp->mstrategy &= ~(STRAT_WAITFORU | STRAT_APPEARMSG);
400         mtmp->msleeping = 0;
401         if (!mtmp->mcanmove && !rn2(5)) {
402             mtmp->mfrozen = 0;
403             mtmp->mcanmove = 1;
404         }
405     }
406 }
407
408 void
409 clonewiz()
410 {
411     register struct monst *mtmp2;
412
413     if ((mtmp2 = makemon(&mons[PM_WIZARD_OF_YENDOR], u.ux, u.uy, NO_MM_FLAGS))
414         != 0) {
415         mtmp2->msleeping = mtmp2->mtame = mtmp2->mpeaceful = 0;
416         if (!u.uhave.amulet && rn2(2)) { /* give clone a fake */
417             (void) add_to_minv(mtmp2,
418                                mksobj(FAKE_AMULET_OF_YENDOR, TRUE, FALSE));
419         }
420         mtmp2->m_ap_type = M_AP_MONSTER;
421         mtmp2->mappearance = wizapp[rn2(SIZE(wizapp))];
422         newsym(mtmp2->mx, mtmp2->my);
423     }
424 }
425
426 /* also used by newcham() */
427 int
428 pick_nasty()
429 {
430     int res = nasties[rn2(SIZE(nasties))];
431
432     /* To do?  Possibly should filter for appropriate forms when
433      * in the elemental planes or surrounded by water or lava.
434      *
435      * We want monsters represented by uppercase on rogue level,
436      * but we don't try very hard.
437      */
438     if (Is_rogue_level(&u.uz)
439         && !('A' <= mons[res].mlet && mons[res].mlet <= 'Z'))
440         res = nasties[rn2(SIZE(nasties))];
441
442     return res;
443 }
444
445 /* create some nasty monsters, aligned or neutral with the caster */
446 /* a null caster defaults to a chaotic caster (e.g. the wizard) */
447 int
448 nasty(mcast)
449 struct monst *mcast;
450 {
451     register struct monst *mtmp;
452     register int i, j, tmp;
453     int castalign = (mcast ? sgn(mcast->data->maligntyp) : -1);
454     coord bypos;
455     int count, census;
456
457     /* some candidates may be created in groups, so simple count
458        of non-null makemon() return is inadequate */
459     census = monster_census(FALSE);
460
461     if (!rn2(10) && Inhell) {
462         count = msummon((struct monst *) 0); /* summons like WoY */
463     } else {
464         count = 0;
465         tmp = (u.ulevel > 3) ? u.ulevel / 3 : 1; /* just in case -- rph */
466         /* if we don't have a casting monster, the nasties appear around you
467          */
468         bypos.x = u.ux;
469         bypos.y = u.uy;
470         for (i = rnd(tmp); i > 0; --i)
471             for (j = 0; j < 20; j++) {
472                 int makeindex;
473
474                 /* Don't create more spellcasters of the monsters' level or
475                  * higher--avoids chain summoners filling up the level.
476                  */
477                 do {
478                     makeindex = pick_nasty();
479                 } while (mcast && attacktype(&mons[makeindex], AT_MAGC)
480                          && monstr[makeindex] >= monstr[mcast->mnum]);
481                 /* do this after picking the monster to place */
482                 if (mcast
483                     && !enexto(&bypos, mcast->mux, mcast->muy,
484                                &mons[makeindex]))
485                     continue;
486                 if ((mtmp = makemon(&mons[makeindex], bypos.x, bypos.y,
487                                     NO_MM_FLAGS)) != 0) {
488                     mtmp->msleeping = mtmp->mpeaceful = mtmp->mtame = 0;
489                     set_malign(mtmp);
490                 } else /* GENOD? */
491                     mtmp = makemon((struct permonst *) 0, bypos.x, bypos.y,
492                                    NO_MM_FLAGS);
493                 if (mtmp) {
494                     count++;
495                     if (mtmp->data->maligntyp == 0
496                         || sgn(mtmp->data->maligntyp) == castalign)
497                         break;
498                 }
499             }
500     }
501
502     if (count)
503         count = monster_census(FALSE) - census;
504     return count;
505 }
506
507 /* Let's resurrect the wizard, for some unexpected fun. */
508 void
509 resurrect()
510 {
511     struct monst *mtmp, **mmtmp;
512     long elapsed;
513     const char *verb;
514
515     if (!context.no_of_wizards) {
516         /* make a new Wizard */
517         verb = "kill";
518         mtmp = makemon(&mons[PM_WIZARD_OF_YENDOR], u.ux, u.uy, MM_NOWAIT);
519         /* affects experience; he's not coming back from a corpse
520            but is subject to repeated killing like a revived corpse */
521         if (mtmp) mtmp->mrevived = 1;
522     } else {
523         /* look for a migrating Wizard */
524         verb = "elude";
525         mmtmp = &migrating_mons;
526         while ((mtmp = *mmtmp) != 0) {
527             if (mtmp->iswiz
528                 /* if he has the Amulet, he won't bring it to you */
529                 && !mon_has_amulet(mtmp)
530                 && (elapsed = monstermoves - mtmp->mlstmv) > 0L) {
531                 mon_catchup_elapsed_time(mtmp, elapsed);
532                 if (elapsed >= LARGEST_INT)
533                     elapsed = LARGEST_INT - 1;
534                 elapsed /= 50L;
535                 if (mtmp->msleeping && rn2((int) elapsed + 1))
536                     mtmp->msleeping = 0;
537                 if (mtmp->mfrozen == 1) /* would unfreeze on next move */
538                     mtmp->mfrozen = 0, mtmp->mcanmove = 1;
539                 if (mtmp->mcanmove && !mtmp->msleeping) {
540                     *mmtmp = mtmp->nmon;
541                     mon_arrive(mtmp, TRUE);
542                     /* note: there might be a second Wizard; if so,
543                        he'll have to wait til the next resurrection */
544                     break;
545                 }
546             }
547             mmtmp = &mtmp->nmon;
548         }
549     }
550
551     if (mtmp) {
552         mtmp->mtame = mtmp->mpeaceful = 0; /* paranoia */
553         set_malign(mtmp);
554         if (!Deaf) {
555             pline("A voice booms out...");
556             verbalize("So thou thought thou couldst %s me, fool.", verb);
557         }
558     }
559 }
560
561 /* Here, we make trouble for the poor shmuck who actually
562    managed to do in the Wizard. */
563 void
564 intervene()
565 {
566     int which = Is_astralevel(&u.uz) ? rnd(4) : rn2(6);
567     /* cases 0 and 5 don't apply on the Astral level */
568     switch (which) {
569     case 0:
570     case 1:
571         You_feel("vaguely nervous.");
572         break;
573     case 2:
574         if (!Blind)
575             You("notice a %s glow surrounding you.", hcolor(NH_BLACK));
576         rndcurse();
577         break;
578     case 3:
579         aggravate();
580         break;
581     case 4:
582         (void) nasty((struct monst *) 0);
583         break;
584     case 5:
585         resurrect();
586         break;
587     }
588 }
589
590 void
591 wizdead()
592 {
593     context.no_of_wizards--;
594     if (!u.uevent.udemigod) {
595         u.uevent.udemigod = TRUE;
596         u.udg_cnt = rn1(250, 50);
597     }
598 }
599
600 const char *const random_insult[] = {
601     "antic",      "blackguard",   "caitiff",    "chucklehead",
602     "coistrel",   "craven",       "cretin",     "cur",
603     "dastard",    "demon fodder", "dimwit",     "dolt",
604     "fool",       "footpad",      "imbecile",   "knave",
605     "maledict",   "miscreant",    "niddering",  "poltroon",
606     "rattlepate", "reprobate",    "scapegrace", "varlet",
607     "villein", /* (sic.) */
608     "wittol",     "worm",         "wretch",
609 };
610
611 const char *const random_malediction[] = {
612     "Hell shall soon claim thy remains,", "I chortle at thee, thou pathetic",
613     "Prepare to die, thou", "Resistance is useless,",
614     "Surrender or die, thou", "There shall be no mercy, thou",
615     "Thou shalt repent of thy cunning,", "Thou art as a flea to me,",
616     "Thou art doomed,", "Thy fate is sealed,",
617     "Verily, thou shalt be one dead"
618 };
619
620 /* Insult or intimidate the player */
621 void
622 cuss(mtmp)
623 register struct monst *mtmp;
624 {
625     if (Deaf)
626         return;
627     if (mtmp->iswiz) {
628         if (!rn2(5)) /* typical bad guy action */
629             pline("%s laughs fiendishly.", Monnam(mtmp));
630         else if (u.uhave.amulet && !rn2(SIZE(random_insult)))
631             verbalize("Relinquish the amulet, %s!",
632                       random_insult[rn2(SIZE(random_insult))]);
633         else if (u.uhp < 5 && !rn2(2)) /* Panic */
634             verbalize(rn2(2) ? "Even now thy life force ebbs, %s!"
635                              : "Savor thy breath, %s, it be thy last!",
636                       random_insult[rn2(SIZE(random_insult))]);
637         else if (mtmp->mhp < 5 && !rn2(2)) /* Parthian shot */
638             verbalize(rn2(2) ? "I shall return." : "I'll be back.");
639         else
640             verbalize("%s %s!",
641                       random_malediction[rn2(SIZE(random_malediction))],
642                       random_insult[rn2(SIZE(random_insult))]);
643     } else if (is_lminion(mtmp)) {
644         com_pager(rn2(QTN_ANGELIC - 1 + (Hallucination ? 1 : 0))
645                   + QT_ANGELIC);
646     } else {
647         if (!rn2(5))
648             pline("%s casts aspersions on your ancestry.", Monnam(mtmp));
649         else
650             com_pager(rn2(QTN_DEMONIC) + QT_DEMONIC);
651     }
652 }
653
654 /*wizard.c*/