OSDN Git Service

update year to 2019
[jnethack/source.git] / src / mhitu.c
1 /* NetHack 3.6  mhitu.c $NHDT-Date: 1513297347 2017/12/15 00:22:27 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.149 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Robert Patrick Rankin, 2012. */
4 /* NetHack may be freely redistributed.  See license for details. */
5
6 /* JNetHack Copyright */
7 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000  */
8 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2019            */
9 /* JNetHack may be freely redistributed.  See license for details. */
10
11 #include "hack.h"
12 #include "artifact.h"
13
14 STATIC_VAR NEARDATA struct obj *mon_currwep = (struct obj *) 0;
15
16 STATIC_DCL boolean FDECL(u_slip_free, (struct monst *, struct attack *));
17 STATIC_DCL int FDECL(passiveum, (struct permonst *, struct monst *,
18                                  struct attack *));
19 STATIC_DCL void FDECL(mayberem, (struct obj *, const char *));
20 STATIC_DCL boolean FDECL(diseasemu, (struct permonst *));
21 STATIC_DCL int FDECL(hitmu, (struct monst *, struct attack *));
22 STATIC_DCL int FDECL(gulpmu, (struct monst *, struct attack *));
23 STATIC_DCL int FDECL(explmu, (struct monst *, struct attack *, BOOLEAN_P));
24 STATIC_DCL void FDECL(missmu, (struct monst *, BOOLEAN_P, struct attack *));
25 STATIC_DCL void FDECL(mswings, (struct monst *, struct obj *));
26 STATIC_DCL void FDECL(wildmiss, (struct monst *, struct attack *));
27 STATIC_DCL void FDECL(hitmsg, (struct monst *, struct attack *));
28
29 /* See comment in mhitm.c.  If we use this a lot it probably should be */
30 /* changed to a parameter to mhitu. */
31 static int dieroll;
32
33 STATIC_OVL void
34 hitmsg(mtmp, mattk)
35 struct monst *mtmp;
36 struct attack *mattk;
37 {
38     int compat;
39     const char *pfmt = 0;
40     char *Monst_name = Monnam(mtmp);
41
42     /* Note: if opposite gender, "seductively" */
43     /* If same gender, "engagingly" for nymph, normal msg for others */
44     if ((compat = could_seduce(mtmp, &youmonst, mattk)) != 0
45         && !mtmp->mcan && !mtmp->mspec_used) {
46 #if 0 /*JP:T*/
47         pline("%s %s you %s.", Monst_name,
48               Blind ? "talks to" : "smiles at",
49               (compat == 2) ? "engagingly" : "seductively");
50 #else
51         pline("%s\82Í\82 \82È\82½%s%s\81D", Monst_name,
52               (compat == 2) ? "\82ð\88ø\82«\82Â\82¯\82é\82æ\82¤\82É" : "\82É\8dD\88Ó\82ð\82æ\82¹\82é\82æ\82¤\82É",
53               Blind ? "\98b\82µ\82©\82¯\82½" : "\94÷\8fÎ\82ñ\82¾");
54 #endif
55     } else {
56         switch (mattk->aatyp) {
57         case AT_BITE:
58 /*JP
59             pfmt = "%s bites!";
60 */
61             pfmt = "%s\82Í\8a\9a\82Ý\82Â\82¢\82½\81I";
62             break;
63         case AT_KICK:
64 #if 0 /*JP:T*/
65             pline("%s kicks%c", Monst_name,
66                   thick_skinned(youmonst.data) ? '.' : '!');
67 #else
68             pline("%s\82Í\8fR\82Æ\82Î\82µ\82½%s",Monnam(mtmp), 
69                   thick_skinned(youmonst.data) ? "\81D" : "\81I");
70 #endif
71             break;
72         case AT_STNG:
73 /*JP
74             pfmt = "%s stings!";
75 */
76             pfmt = "%s\82Í\93Ë\82«\82³\82µ\82½\81I";
77             break;
78         case AT_BUTT:
79 /*JP
80             pfmt = "%s butts!";
81 */
82             pfmt = "%s\82Í\93ª\93Ë\82«\82ð\82­\82ç\82í\82µ\82½\81I";
83             break;
84         case AT_TUCH:
85 /*JP
86             pfmt = "%s touches you!";
87 */
88             pfmt = "%s\82Í\82 \82È\82½\82É\90G\82ê\82½\81I";
89             break;
90         case AT_TENT:
91 /*JP
92             pfmt = "%s tentacles suck you!";
93 */
94             pfmt = "%s\82Ì\90G\8eè\82ª\82 \82È\82½\82Ì\91Ì\89t\82ð\8bz\82¢\82Æ\82Á\82½\81I";
95 #if 0 /*JP*/
96             Monst_name = s_suffix(Monst_name);
97 #endif
98             break;
99         case AT_EXPL:
100         case AT_BOOM:
101 /*JP
102             pfmt = "%s explodes!";
103 */
104             pfmt = "%s\82Í\94\9a\94­\82µ\82½\81I";
105             break;
106         default:
107 /*JP
108             pfmt = "%s hits!";
109 */
110             pfmt = "%s\82Ì\8dU\8c\82\82Í\96½\92\86\82µ\82½\81I";
111         }
112         if (pfmt)
113             pline(pfmt, Monst_name);
114     }
115 }
116
117 /* monster missed you */
118 STATIC_OVL void
119 missmu(mtmp, nearmiss, mattk)
120 struct monst *mtmp;
121 boolean nearmiss;
122 struct attack *mattk;
123 {
124     if (!canspotmon(mtmp))
125         map_invisible(mtmp->mx, mtmp->my);
126
127     if (could_seduce(mtmp, &youmonst, mattk) && !mtmp->mcan)
128 /*JP
129         pline("%s pretends to be friendly.", Monnam(mtmp));
130 */
131         pline("%s\82Í\97F\8dD\93I\82È\82Ó\82è\82ð\82µ\82Ä\82¢\82é\81D",Monnam(mtmp));
132     else
133 #if 0 /*JP*/
134         pline("%s %smisses!", Monnam(mtmp),
135               (nearmiss && flags.verbose) ? "just " : "");
136 #else
137         pline("%s\82Ì\8dU\8c\82\82Í%s\82½\81D", Monnam(mtmp),
138               (nearmiss && flags.verbose) ? "\8bó\82ð\90Ø\82Á" : "\82Í\82¸\82ê");
139 #endif
140
141     stop_occupation();
142 }
143
144 /* monster swings obj */
145 STATIC_OVL void
146 mswings(mtmp, otemp)
147 struct monst *mtmp;
148 struct obj *otemp;
149 {
150     if (flags.verbose && !Blind && mon_visible(mtmp)) {
151 #if 0 /*JP*/
152         pline("%s %s %s%s %s.", Monnam(mtmp),
153               (objects[otemp->otyp].oc_dir & PIERCE) ? "thrusts" : "swings",
154               (otemp->quan > 1L) ? "one of " : "", mhis(mtmp), xname(otemp));
155 #else
156         pline("%s\82Í%s%s\81D", Monnam(mtmp),
157               xname(otemp),
158               (objects[otemp->otyp].oc_dir & PIERCE) ? "\82ð\93Ë\82¢\82½" : "\82ð\90U\82è\82Ü\82í\82µ\82½");
159 #endif
160     }
161 }
162
163 /* return how a poison attack was delivered */
164 const char *
165 mpoisons_subj(mtmp, mattk)
166 struct monst *mtmp;
167 struct attack *mattk;
168 {
169     if (mattk->aatyp == AT_WEAP) {
170         struct obj *mwep = (mtmp == &youmonst) ? uwep : MON_WEP(mtmp);
171         /* "Foo's attack was poisoned." is pretty lame, but at least
172            it's better than "sting" when not a stinging attack... */
173 /*JP
174         return (!mwep || !mwep->opoisoned) ? "attack" : "weapon";
175 */
176         return (!mwep || !mwep->opoisoned) ? "\8dU\8c\82" : "\95\90\8aí";
177     } else {
178 #if 0 /*JP*/
179         return (mattk->aatyp == AT_TUCH) ? "contact"
180                   : (mattk->aatyp == AT_GAZE) ? "gaze"
181                        : (mattk->aatyp == AT_BITE) ? "bite" : "sting";
182 #else
183         return (mattk->aatyp == AT_TUCH) ? "\90Ú\90G"
184                   : (mattk->aatyp == AT_GAZE) ? "\82É\82ç\82Ý"
185                        : (mattk->aatyp == AT_BITE) ? "\8a\9a\82Ý\82Â\82«" : "\93Ë\82«\82³\82µ";
186 #endif
187     }
188 }
189
190 /* called when your intrinsic speed is taken away */
191 void
192 u_slow_down()
193 {
194     HFast = 0L;
195     if (!Fast)
196 /*JP
197         You("slow down.");
198 */
199         You("\93®\82«\82ª\92x\82­\82È\82Á\82½\81D");
200     else /* speed boots */
201 /*JP
202         Your("quickness feels less natural.");
203 */
204         You("\91¬\82³\82É\82Â\82¢\82Ä\82¢\82¯\82È\82­\82È\82Á\82½\81D");
205     exercise(A_DEX, FALSE);
206 }
207
208 /* monster attacked your displaced image */
209 STATIC_OVL void
210 wildmiss(mtmp, mattk)
211 struct monst *mtmp;
212 struct attack *mattk;
213 {
214     int compat;
215     const char *Monst_name; /* Monnam(mtmp) */
216
217     /* no map_invisible() -- no way to tell where _this_ is coming from */
218
219     if (!flags.verbose)
220         return;
221     if (!cansee(mtmp->mx, mtmp->my))
222         return;
223     /* maybe it's attacking an image around the corner? */
224
225     compat = ((mattk->adtyp == AD_SEDU || mattk->adtyp == AD_SSEX)
226               && could_seduce(mtmp, &youmonst, (struct attack *) 0));
227     Monst_name = Monnam(mtmp);
228
229     if (!mtmp->mcansee || (Invis && !perceives(mtmp->data))) {
230 #if 0 /*JP:T*/
231         const char *swings = (mattk->aatyp == AT_BITE) ? "snaps"
232                              : (mattk->aatyp == AT_KICK) ? "kicks"
233                                : (mattk->aatyp == AT_STNG
234                                   || mattk->aatyp == AT_BUTT
235                                   || nolimbs(mtmp->data)) ? "lunges"
236                                  : "swings";
237 #else
238         const char *swings = (mattk->aatyp == AT_BITE) ? "\8a\9a\82Ý\82Â\82­"
239                              : (mattk->aatyp == AT_KICK) ? "\8fR\82Æ\82Î\82·"
240                                : (mattk->aatyp == AT_STNG
241                                   || mattk->aatyp == AT_BUTT
242                                   || nolimbs(mtmp->data)) ? "\93Ë\90i\82·\82é"
243                                  : "\90U\82è\89ñ\82·";
244 #endif
245
246         if (compat)
247 /*JP
248             pline("%s tries to touch you and misses!", Monst_name);
249 */
250             pline("%s\82Í\82 \82È\82½\82É\90G\82ë\82¤\82Æ\82µ\82½\82ª\8e¸\94s\82µ\82½\81I", Monst_name);
251         else
252             switch (rn2(3)) {
253             case 0:
254 /*JP
255                 pline("%s %s wildly and misses!", Monst_name, swings);
256 */
257                 pline("%s\82Í\8c\83\82µ\82­%s\82ª\81C\82Í\82¸\82µ\82½\81I", Monst_name, swings);
258                 break;
259             case 1:
260 /*JP
261                 pline("%s attacks a spot beside you.", Monst_name);
262 */
263                 pline("%s\82Ì\8dU\8c\82\82Í\82 \82È\82½\82Ì\98e\95 \82ð\82©\82·\82ß\82½\81D", Monst_name);
264                 break;
265             case 2:
266 #if 0 /*JP*/
267                 pline("%s strikes at %s!", Monst_name,
268                       (levl[mtmp->mux][mtmp->muy].typ == WATER)
269                         ? "empty water"
270                         : "thin air");
271 #else
272                 pline("%s\82Í%s\82ð\91Å\82¿\82Â\82¯\82½\81I", Monst_name,
273                       (levl[mtmp->mux][mtmp->muy].typ == WATER)
274                         ? "\90\85"
275                         : "\89½\82à\82È\82¢\82Æ\82±\82ë");
276 #endif
277                 break;
278             default:
279 /*JP
280                 pline("%s %s wildly!", Monst_name, swings);
281 */
282                 pline("%s\82Í\8c\83\82µ\82­%s\81I", Monst_name, swings);
283                 break;
284             }
285
286     } else if (Displaced) {
287         if (compat)
288 #if 0 /*JP*/
289             pline("%s smiles %s at your %sdisplaced image...", Monst_name,
290                   (compat == 2) ? "engagingly" : "seductively",
291                   Invis ? "invisible " : "");
292 #else
293             pline("%s\82Í%s\82 \82È\82½\82Ì\8c\89e\82É\91Î\82µ\82Ä%s\94÷\8fÎ\82ñ\82¾\81D\81D\81D", Monst_name,
294                   Invis ? "\93§\96¾\82È" : "",
295                   (compat == 2) ? "\96£\97Í\93I\82É" : "\97U\98f\93I\82É");
296 #endif
297         else
298 #if 0 /*JP*/
299             pline("%s strikes at your %sdisplaced image and misses you!",
300                   /* Note: if you're both invisible and displaced,
301                    * only monsters which see invisible will attack your
302                    * displaced image, since the displaced image is also
303                    * invisible.
304                    */
305                   Monst_name, Invis ? "invisible " : "");
306 #else
307             pline("%s\82Í\82 \82È\82½\82Ì%s\8c\89e\82ð\8dU\8c\82\82µ\81C\82Í\82¸\82µ\82½\81I",
308                   Monst_name, Invis ? "\93§\96¾\82È" : "");
309 #endif
310
311     } else if (Underwater) {
312         /* monsters may miss especially on water level where
313            bubbles shake the player here and there */
314         if (compat)
315 /*JP
316             pline("%s reaches towards your distorted image.", Monst_name);
317 */
318             pline("%s\82Í\82 \82È\82½\82Ì\98c\82ñ\82¾\8c\89e\82Ì\95û\82Ö\8cü\82©\82Á\82½\81D", Monst_name);
319         else
320 /*JP
321             pline("%s is fooled by water reflections and misses!",
322 */
323             pline("%s\82Í\90\85\82Ì\94½\8eË\82É\82¾\82Ü\82³\82ê\81C\82Í\82¸\82µ\82½\81I",
324                   Monst_name);
325
326     } else
327         impossible("%s attacks you without knowing your location?",
328                    Monst_name);
329 }
330
331 void
332 expels(mtmp, mdat, message)
333 struct monst *mtmp;
334 struct permonst *mdat; /* if mtmp is polymorphed, mdat != mtmp->data */
335 boolean message;
336 {
337     if (message) {
338         if (is_animal(mdat)) {
339 /*JP
340             You("get regurgitated!");
341 */
342             You("\93f\82«\82¾\82³\82ê\82½\81I");
343         } else {
344             char blast[40];
345             struct attack *attk = attacktype_fordmg(mdat, AT_ENGL, AD_ANY);
346
347             blast[0] = '\0';
348             if (!attk) {
349                 impossible("Swallower has no engulfing attack?");
350             } else {
351                 if (is_whirly(mdat)) {
352                     switch (attk->adtyp) {
353                     case AD_ELEC:
354 /*JP
355                         Strcpy(blast, " in a shower of sparks");
356 */
357                         Strcpy(blast, "\82Ì\89Î\89Ô\82Ì\89J\82Ì\92\86\82©\82ç");
358                         break;
359                     case AD_COLD:
360 /*JP
361                         Strcpy(blast, " in a blast of frost");
362 */
363                         Strcpy(blast, "\82Ì\97â\8bC\82Ì\95\97\82Ì\92\86\82©\82ç");
364                         break;
365                     }
366                 } else {
367 /*JP
368                     Strcpy(blast, " with a squelch");
369 */
370                     Strcpy(blast, "\82©\82ç\93f\82«\8fo\82³\82ê\82é\82æ\82¤\82É");
371                 }
372 /*JP
373                 You("get expelled from %s%s!", mon_nam(mtmp), blast);
374 */
375                 You("%s%s\92E\8fo\82µ\82½\81I", mon_nam(mtmp), blast);
376             }
377         }
378     }
379     unstuck(mtmp); /* ball&chain returned in unstuck() */
380     mnexto(mtmp);
381     newsym(u.ux, u.uy);
382     spoteffects(TRUE);
383     /* to cover for a case where mtmp is not in a next square */
384     if (um_dist(mtmp->mx, mtmp->my, 1))
385 /*JP
386         pline("Brrooaa...  You land hard at some distance.");
387 */
388         pline("\83u\83\8d\83\8d\83\8d\81D\81D\89\93\82­\82É\92\85\97¤\82·\82é\82Ì\82Í\93ï\82µ\82¢\81D");
389 }
390
391 /* select a monster's next attack, possibly substituting for its usual one */
392 struct attack *
393 getmattk(magr, mdef, indx, prev_result, alt_attk_buf)
394 struct monst *magr, *mdef;
395 int indx, prev_result[];
396 struct attack *alt_attk_buf;
397 {
398     struct permonst *mptr = magr->data;
399     struct attack *attk = &mptr->mattk[indx];
400     struct obj *weap = (magr == &youmonst) ? uwep : MON_WEP(magr);
401
402     /* prevent a monster with two consecutive disease or hunger attacks
403        from hitting with both of them on the same turn; if the first has
404        already hit, switch to a stun attack for the second */
405     if (indx > 0 && prev_result[indx - 1] > 0
406         && (attk->adtyp == AD_DISE || attk->adtyp == AD_PEST
407             || attk->adtyp == AD_FAMN)
408         && attk->adtyp == mptr->mattk[indx - 1].adtyp) {
409         *alt_attk_buf = *attk;
410         attk = alt_attk_buf;
411         attk->adtyp = AD_STUN;
412
413     /* make drain-energy damage be somewhat in proportion to energy */
414     } else if (attk->adtyp == AD_DREN && mdef == &youmonst) {
415         int ulev = max(u.ulevel, 6);
416
417         *alt_attk_buf = *attk;
418         attk = alt_attk_buf;
419         /* 3.6.0 used 4d6 but since energy drain came out of max energy
420            once current energy was gone, that tended to have a severe
421            effect on low energy characters; it's now 2d6 with ajustments */
422         if (u.uen <= 5 * ulev && attk->damn > 1) {
423             attk->damn -= 1; /* low energy: 2d6 -> 1d6 */
424             if (u.uenmax <= 2 * ulev && attk->damd > 3)
425                 attk->damd -= 3; /* very low energy: 1d6 -> 1d3 */
426         } else if (u.uen > 12 * ulev) {
427             attk->damn += 1; /* high energy: 2d6 -> 3d6 */
428             if (u.uenmax > 20 * ulev)
429                 attk->damd += 3; /* very high energy: 3d6 -> 3d9 */
430             /* note: 3d9 is slightly higher than previous 4d6 */
431         }
432
433     } else if (attk->aatyp == AT_ENGL && magr->mspec_used) {
434         /* can't re-engulf yet; switch to simpler attack */
435         *alt_attk_buf = *attk;
436         attk = alt_attk_buf;
437         if (attk->adtyp == AD_ACID || attk->adtyp == AD_ELEC
438             || attk->adtyp == AD_COLD || attk->adtyp == AD_FIRE) {
439             attk->aatyp = AT_TUCH;
440         } else {
441             attk->aatyp = AT_CLAW; /* attack message will be "<foo> hits" */
442             attk->adtyp = AD_PHYS;
443         }
444         attk->damn = 1; /* relatively weak: 1d6 */
445         attk->damd = 6;
446
447     /* barrow wight, Nazgul, erinys have weapon attack for non-physical
448        damage; force physical damage if attacker has been cancelled or
449        if weapon is sufficiently interesting; a few unique creatures
450        have two weapon attacks where one does physical damage and other
451        doesn't--avoid forcing physical damage for those */
452     } else if (indx == 0 && magr != &youmonst
453                && attk->aatyp == AT_WEAP && attk->adtyp != AD_PHYS
454                && !(mptr->mattk[1].aatyp == AT_WEAP
455                     && mptr->mattk[1].adtyp == AD_PHYS)
456                && (magr->mcan
457                    || (weap && ((weap->otyp == CORPSE
458                                  && touch_petrifies(&mons[weap->corpsenm]))
459                                 || weap->oartifact == ART_STORMBRINGER
460                                 || weap->oartifact == ART_VORPAL_BLADE)))) {
461         *alt_attk_buf = *attk;
462         attk = alt_attk_buf;
463         attk->adtyp = AD_PHYS;
464     }
465     return attk;
466 }
467
468 /*
469  * mattacku: monster attacks you
470  *      returns 1 if monster dies (e.g. "yellow light"), 0 otherwise
471  *      Note: if you're displaced or invisible the monster might attack the
472  *              wrong position...
473  *      Assumption: it's attacking you or an empty square; if there's another
474  *              monster which it attacks by mistake, the caller had better
475  *              take care of it...
476  */
477 int
478 mattacku(mtmp)
479 register struct monst *mtmp;
480 {
481     struct attack *mattk, alt_attk;
482     int i, j = 0, tmp, sum[NATTK];
483     struct permonst *mdat = mtmp->data;
484     boolean ranged = (distu(mtmp->mx, mtmp->my) > 3);
485     /* Is it near you?  Affects your actions */
486     boolean range2 = !monnear(mtmp, mtmp->mux, mtmp->muy);
487     /* Does it think it's near you?  Affects its actions */
488     boolean foundyou = (mtmp->mux == u.ux && mtmp->muy == u.uy);
489     /* Is it attacking you or your image? */
490     boolean youseeit = canseemon(mtmp);
491     /* Might be attacking your image around the corner, or
492      * invisible, or you might be blind....
493      */
494     boolean skipnonmagc = FALSE;
495     /* Are further physical attack attempts useless? */
496
497     if (!ranged)
498         nomul(0);
499     if (mtmp->mhp <= 0 || (Underwater && !is_swimmer(mtmp->data)))
500         return 0;
501
502     /* If swallowed, can only be affected by u.ustuck */
503     if (u.uswallow) {
504         if (mtmp != u.ustuck)
505             return 0;
506         u.ustuck->mux = u.ux;
507         u.ustuck->muy = u.uy;
508         range2 = 0;
509         foundyou = 1;
510         if (u.uinvulnerable)
511             return 0; /* stomachs can't hurt you! */
512
513     } else if (u.usteed) {
514         if (mtmp == u.usteed)
515             /* Your steed won't attack you */
516             return 0;
517         /* Orcs like to steal and eat horses and the like */
518         if (!rn2(is_orc(mtmp->data) ? 2 : 4)
519             && distu(mtmp->mx, mtmp->my) <= 2) {
520             /* Attack your steed instead */
521             i = mattackm(mtmp, u.usteed);
522             if ((i & MM_AGR_DIED))
523                 return 1;
524             /* make sure steed is still alive and within range */
525             if ((i & MM_DEF_DIED) || !u.usteed
526                 || distu(mtmp->mx, mtmp->my) > 2)
527                 return 0;
528             /* Let your steed retaliate */
529             return !!(mattackm(u.usteed, mtmp) & MM_DEF_DIED);
530         }
531     }
532
533     if (u.uundetected && !range2 && foundyou && !u.uswallow) {
534         if (!canspotmon(mtmp))
535             map_invisible(mtmp->mx, mtmp->my);
536         u.uundetected = 0;
537         if (is_hider(youmonst.data) && u.umonnum != PM_TRAPPER) {
538             /* ceiling hider */
539             coord cc; /* maybe we need a unexto() function? */
540             struct obj *obj;
541
542 /*JP
543             You("fall from the %s!", ceiling(u.ux, u.uy));
544 */
545             You("%s\82©\82ç\97\8e\82¿\82½\81I", ceiling(u.ux,u.uy));
546             /* take monster off map now so that its location
547                is eligible for placing hero; we assume that a
548                removed monster remembers its old spot <mx,my> */
549             remove_monster(mtmp->mx, mtmp->my);
550             if (!enexto(&cc, u.ux, u.uy, youmonst.data)
551                 /* a fish won't voluntarily swap positions
552                    when it's in water and hero is over land */
553                 || (mtmp->data->mlet == S_EEL
554                     && is_pool(mtmp->mx, mtmp->my)
555                     && !is_pool(u.ux, u.uy))) {
556                 /* couldn't find any spot for hero; this used to
557                    kill off attacker, but now we just give a "miss"
558                    message and keep both mtmp and hero at their
559                    original positions; hero has become unconcealed
560                    so mtmp's next move will be a regular attack */
561                 place_monster(mtmp, mtmp->mx, mtmp->my); /* put back */
562                 newsym(u.ux, u.uy); /* u.uundetected was toggled */
563 /*JP
564                 pline("%s draws back as you drop!", Monnam(mtmp));
565 */
566                 pline("\82 \82È\82½\82ª\97\8e\82¿\82é\82±\82Æ\82Å%s\82Í\88ø\82«\96ß\82³\82ê\82½\81I", Monnam(mtmp));
567                 return 0;
568             }
569
570             /* put mtmp at hero's spot and move hero to <cc.x,.y> */
571             newsym(mtmp->mx, mtmp->my); /* finish removal */
572             place_monster(mtmp, u.ux, u.uy);
573             if (mtmp->wormno) {
574                 worm_move(mtmp);
575                 /* tail hasn't grown, so if it now occupies <cc.x,.y>
576                    then one of its original spots must be free */
577                 if (m_at(cc.x, cc.y))
578                     (void) enexto(&cc, u.ux, u.uy, youmonst.data);
579             }
580             teleds(cc.x, cc.y, TRUE); /* move hero */
581             set_apparxy(mtmp);
582             newsym(u.ux, u.uy);
583
584             if (youmonst.data->mlet != S_PIERCER)
585                 return 0; /* lurkers don't attack */
586
587             obj = which_armor(mtmp, WORN_HELMET);
588             if (obj && is_metallic(obj)) {
589 #if 0 /*JP*/
590                 Your("blow glances off %s %s.", s_suffix(mon_nam(mtmp)),
591                      helm_simple_name(obj));
592 #else
593                 Your("\8dU\8c\82\82Í%s\82Ì%s\82ð\82©\82·\82ß\82½\82¾\82¯\82¾\82Á\82½\81D", mon_nam(mtmp),
594                       helm_simple_name(obj));
595 #endif
596             } else {
597                 if (3 + find_mac(mtmp) <= rnd(20)) {
598 /*JP
599                     pline("%s is hit by a falling piercer (you)!",
600 */
601                     pline("%s\82Í\97\8e\82¿\82Ä\82«\82½\90j(\82 \82È\82½)\82Å\8f\9d\82Â\82¢\82½\81I",
602                           Monnam(mtmp));
603                     if ((mtmp->mhp -= d(3, 6)) < 1)
604                         killed(mtmp);
605                 } else
606 /*JP
607                     pline("%s is almost hit by a falling piercer (you)!",
608 */
609                     pline("%s\82Í\82à\82¤\8f­\82µ\82Å\97\8e\82¿\82Ä\82«\82½\90j(\82 \82È\82½)\82Å\8f\9d\82Â\82­\82Æ\82±\82ë\82¾\82Á\82½\81I",
610                           Monnam(mtmp));
611             }
612
613         } else {
614             /* surface hider */
615             if (!youseeit) {
616 /*JP
617                 pline("It tries to move where you are hiding.");
618 */
619                 pline("\89½\8eÒ\82©\82ª\82 \82È\82½\82ª\89B\82ê\82Ä\82¢\82é\82Æ\82±\82ë\82ð\88Ú\93®\82µ\82æ\82¤\82Æ\82µ\82½\81D");
620             } else {
621                 /* Ugly kludge for eggs.  The message is phrased so as
622                  * to be directed at the monster, not the player,
623                  * which makes "laid by you" wrong.  For the
624                  * parallelism to work, we can't rephrase it, so we
625                  * zap the "laid by you" momentarily instead.
626                  */
627                 struct obj *obj = level.objects[u.ux][u.uy];
628
629                 if (obj || u.umonnum == PM_TRAPPER
630                     || (youmonst.data->mlet == S_EEL
631                         && is_pool(u.ux, u.uy))) {
632                     int save_spe = 0; /* suppress warning */
633
634                     if (obj) {
635                         save_spe = obj->spe;
636                         if (obj->otyp == EGG)
637                             obj->spe = 0;
638                     }
639                     /* note that m_monnam() overrides hallucination, which is
640                        what we want when message is from mtmp's perspective */
641                     if (youmonst.data->mlet == S_EEL
642                         || u.umonnum == PM_TRAPPER)
643                         pline(
644 #if 0 /*JP*/
645                              "Wait, %s!  There's a hidden %s named %s there!",
646                               m_monnam(mtmp), youmonst.data->mname, plname);
647 #else
648                               "\91Ò\82Ä\81C%s\81I%s\82Æ\82¢\82¤\96¼\82Ì%s\82ª\89B\82ê\82Ä\82¢\82é\81I",
649                               m_monnam(mtmp), plname, youmonst.data->mname);
650 #endif
651                     else
652                         pline(
653 #if 0 /*JP*/
654                           "Wait, %s!  There's a %s named %s hiding under %s!",
655                               m_monnam(mtmp), youmonst.data->mname, plname,
656                               doname(level.objects[u.ux][u.uy]));
657 #else
658                           "\91Ò\82Ä\81C%s\81I%s\82Æ\82¢\82¤\96¼\82Ì%s\82ª%s\82Ì\89º\82É\89B\82ê\82Ä\82¢\82é\81I",
659                               m_monnam(mtmp), plname, youmonst.data->mname, 
660                               doname(level.objects[u.ux][u.uy]));
661 #endif
662                     if (obj)
663                         obj->spe = save_spe;
664                 } else
665                     impossible("hiding under nothing?");
666             }
667             newsym(u.ux, u.uy);
668         }
669         return 0;
670     }
671
672     /* hero might be a mimic, concealed via #monster */
673     if (youmonst.data->mlet == S_MIMIC && youmonst.m_ap_type && !range2
674         && foundyou && !u.uswallow) {
675         boolean sticky = sticks(youmonst.data);
676
677         if (!canspotmon(mtmp))
678             map_invisible(mtmp->mx, mtmp->my);
679         if (sticky && !youseeit)
680 /*JP
681             pline("It gets stuck on you.");
682 */
683             pline("\89½\8eÒ\82©\82ª\82 \82È\82½\82Ì\8fã\82É\82Ì\82µ\82©\82©\82Á\82½\81D");
684         else /* see note about m_monnam() above */
685 #if 0 /*JP*/
686             pline("Wait, %s!  That's a %s named %s!", m_monnam(mtmp),
687                   youmonst.data->mname, plname);
688 #else
689             pline("\91Ò\82Ä\81C%s\81I\82»\82ê\82Í%s\82Æ\82¢\82¤\96¼\82Ì%s\82¾\81I", m_monnam(mtmp), 
690                   plname, youmonst.data->mname);
691 #endif
692         if (sticky)
693             u.ustuck = mtmp;
694         youmonst.m_ap_type = M_AP_NOTHING;
695         youmonst.mappearance = 0;
696         newsym(u.ux, u.uy);
697         return 0;
698     }
699
700     /* non-mimic hero might be mimicking an object after eating m corpse */
701     if (youmonst.m_ap_type == M_AP_OBJECT && !range2 && foundyou
702         && !u.uswallow) {
703         if (!canspotmon(mtmp))
704             map_invisible(mtmp->mx, mtmp->my);
705         if (!youseeit)
706 #if 0 /*JP*/
707             pline("%s %s!", Something, (likes_gold(mtmp->data)
708                                         && youmonst.mappearance == GOLD_PIECE)
709                                            ? "tries to pick you up"
710                                            : "disturbs you");
711 #else
712             pline("%s\82Í%s\81I", Something, (likes_gold(mtmp->data)
713                                         && youmonst.mappearance == GOLD_PIECE)
714                                            ? "\82 \82È\82½\82ð\8fE\82¨\82¤\82Æ\82µ\82½"
715                                            : "\96³\8e\8b\82µ\82½");
716 #endif
717         else /* see note about m_monnam() above */
718 #if 0 /*JP*/
719             pline("Wait, %s!  That %s is really %s named %s!", m_monnam(mtmp),
720                   mimic_obj_name(&youmonst), an(mons[u.umonnum].mname),
721                   plname);
722 #else
723             pline("\91Ò\82Ä\81C%s\81I\82»\82Ì%s\82Í%s\82Æ\82¢\82¤\96¼\82Ì%s\82¾\81I", m_monnam(mtmp),
724                   mimic_obj_name(&youmonst), plname,
725                   mons[u.umonnum].mname);
726 #endif
727         if (multi < 0) { /* this should always be the case */
728             char buf[BUFSZ];
729
730 #if 0 /*JP*/
731             Sprintf(buf, "You appear to be %s again.",
732                     Upolyd ? (const char *) an(youmonst.data->mname)
733                            : (const char *) "yourself");
734 #else
735             Sprintf(buf, "\82 \82È\82½\82Í\82Ó\82½\82½\82Ñ%s\82É\82È\82Á\82½\81D",
736                     Upolyd ? (const char *) youmonst.data->mname
737                            : (const char *) "\8e©\95ª\8e©\90g");
738 #endif
739             unmul(buf); /* immediately stop mimicking */
740         }
741         return 0;
742     }
743
744     /*  Work out the armor class differential   */
745     tmp = AC_VALUE(u.uac) + 10; /* tmp ~= 0 - 20 */
746     tmp += mtmp->m_lev;
747     if (multi < 0)
748         tmp += 4;
749     if ((Invis && !perceives(mdat)) || !mtmp->mcansee)
750         tmp -= 2;
751     if (mtmp->mtrapped)
752         tmp -= 2;
753     if (tmp <= 0)
754         tmp = 1;
755
756     /* make eels visible the moment they hit/miss us */
757     if (mdat->mlet == S_EEL && mtmp->minvis && cansee(mtmp->mx, mtmp->my)) {
758         mtmp->minvis = 0;
759         newsym(mtmp->mx, mtmp->my);
760     }
761
762     /*  Special demon handling code */
763     if ((mtmp->cham == NON_PM) && is_demon(mdat) && !range2
764         && mtmp->data != &mons[PM_BALROG] && mtmp->data != &mons[PM_SUCCUBUS]
765         && mtmp->data != &mons[PM_INCUBUS])
766         if (!mtmp->mcan && !rn2(13))
767             (void) msummon(mtmp);
768
769     /*  Special lycanthrope handling code */
770     if ((mtmp->cham == NON_PM) && is_were(mdat) && !range2) {
771         if (is_human(mdat)) {
772             if (!rn2(5 - (night() * 2)) && !mtmp->mcan)
773                 new_were(mtmp);
774         } else if (!rn2(30) && !mtmp->mcan)
775             new_were(mtmp);
776         mdat = mtmp->data;
777
778         if (!rn2(10) && !mtmp->mcan) {
779             int numseen, numhelp;
780 #if 0 /*JP*/
781             char buf[BUFSZ], genericwere[BUFSZ];
782 #else
783             char genericwere[BUFSZ];
784 #endif
785
786 /*JP
787             Strcpy(genericwere, "creature");
788 */
789             Strcpy(genericwere, "\89½\82©");
790             numhelp = were_summon(mdat, FALSE, &numseen, genericwere);
791             if (youseeit) {
792 /*JP
793                 pline("%s summons help!", Monnam(mtmp));
794 */
795                 pline("%s\82Í\8f\95\82¯\82ð\8cÄ\82ñ\82¾\81I", Monnam(mtmp));
796                 if (numhelp > 0) {
797                     if (numseen == 0)
798 /*JP
799                         You_feel("hemmed in.");
800 */
801                         pline("\89½\8eÒ\82©\82É\88Í\82Ü\82ê\82½\82æ\82¤\82È\8bC\82ª\82·\82é\81D");
802                 } else
803 /*JP
804                     pline("But none comes.");
805 */
806                     pline("\82µ\82©\82µ\89½\82à\97\88\82È\82©\82Á\82½\81D");
807             } else {
808                 const char *from_nowhere;
809
810                 if (!Deaf) {
811 /*JP
812                     pline("%s %s!", Something, makeplural(growl_sound(mtmp)));
813 */
814                     pline("\89½\82©\82ª%s\81I", growl_sound(mtmp));
815                     from_nowhere = "";
816                 } else
817 /*JP
818                     from_nowhere = " from nowhere";
819 */
820                     from_nowhere = "\82Ç\82±\82©\82ç\82Æ\82à\82È\82­";
821                 if (numhelp > 0) {
822                     if (numseen < 1)
823 /*JP
824                         You_feel("hemmed in.");
825 */
826                         pline("\89½\8eÒ\82©\82É\88Í\82Ü\82ê\82½\82æ\82¤\82È\8bC\82ª\82·\82é\81D");
827                     else {
828 #if 0 /*JP*/
829                         if (numseen == 1)
830                             Sprintf(buf, "%s appears", an(genericwere));
831                         else
832                             Sprintf(buf, "%s appear",
833                                     makeplural(genericwere));
834                         pline("%s%s!", upstart(buf), from_nowhere);
835 #else
836                         pline("%s\82ª%s\8c»\82ê\82½\81I",
837                               genericwere, from_nowhere);
838 #endif
839                     }
840                 } /* else no help came; but you didn't know it tried */
841             }
842         }
843     }
844
845     if (u.uinvulnerable) {
846         /* monsters won't attack you */
847         if (mtmp == u.ustuck)
848 /*JP
849             pline("%s loosens its grip slightly.", Monnam(mtmp));
850 */
851             pline("%s\82Í\92÷\82ß\82Â\82¯\82ð\82í\82¸\82©\82É\8aÉ\82ß\82½\81D", Monnam(mtmp));
852         else if (!range2) {
853             if (youseeit || sensemon(mtmp))
854 /*JP
855                 pline("%s starts to attack you, but pulls back.",
856 */
857                 pline("%s\82Í\82 \82È\82½\82ð\8dU\8c\82\82µ\82©\82¯\82½\82ª\81C\82Ð\82Á\82±\82ß\82½\81D",
858                       Monnam(mtmp));
859             else
860 /*JP
861                 You_feel("%s move nearby.", something);
862 */
863                 pline("\89½\8eÒ\82©\82ª\82 \82È\82½\82Ì\82»\82Î\82ð\92Ê\82è\82Ê\82¯\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
864         }
865         return 0;
866     }
867
868     /* Unlike defensive stuff, don't let them use item _and_ attack. */
869     if (find_offensive(mtmp)) {
870         int foo = use_offensive(mtmp);
871
872         if (foo != 0)
873             return (foo == 1);
874     }
875
876     for (i = 0; i < NATTK; i++) {
877         sum[i] = 0;
878         mon_currwep = (struct obj *)0;
879         mattk = getmattk(mtmp, &youmonst, i, sum, &alt_attk);
880         if ((u.uswallow && mattk->aatyp != AT_ENGL)
881             || (skipnonmagc && mattk->aatyp != AT_MAGC))
882             continue;
883
884         switch (mattk->aatyp) {
885         case AT_CLAW: /* "hand to hand" attacks */
886         case AT_KICK:
887         case AT_BITE:
888         case AT_STNG:
889         case AT_TUCH:
890         case AT_BUTT:
891         case AT_TENT:
892             if (!range2 && (!MON_WEP(mtmp) || mtmp->mconf || Conflict
893                             || !touch_petrifies(youmonst.data))) {
894                 if (foundyou) {
895                     if (tmp > (j = rnd(20 + i))) {
896                         if (mattk->aatyp != AT_KICK
897                             || !thick_skinned(youmonst.data))
898                             sum[i] = hitmu(mtmp, mattk);
899                     } else
900                         missmu(mtmp, (tmp == j), mattk);
901                 } else {
902                     wildmiss(mtmp, mattk);
903                     /* skip any remaining non-spell attacks */
904                     skipnonmagc = TRUE;
905                 }
906             }
907             break;
908
909         case AT_HUGS: /* automatic if prev two attacks succeed */
910             /* Note: if displaced, prev attacks never succeeded */
911             if ((!range2 && i >= 2 && sum[i - 1] && sum[i - 2])
912                 || mtmp == u.ustuck)
913                 sum[i] = hitmu(mtmp, mattk);
914             break;
915
916         case AT_GAZE: /* can affect you either ranged or not */
917             /* Medusa gaze already operated through m_respond in
918                dochug(); don't gaze more than once per round. */
919             if (mdat != &mons[PM_MEDUSA])
920                 sum[i] = gazemu(mtmp, mattk);
921             break;
922
923         case AT_EXPL: /* automatic hit if next to, and aimed at you */
924             if (!range2)
925                 sum[i] = explmu(mtmp, mattk, foundyou);
926             break;
927
928         case AT_ENGL:
929             if (!range2) {
930                 if (foundyou) {
931                     if (u.uswallow
932                         || (!mtmp->mspec_used && tmp > (j = rnd(20 + i)))) {
933                         /* force swallowing monster to be displayed
934                            even when hero is moving away */
935                         flush_screen(1);
936                         sum[i] = gulpmu(mtmp, mattk);
937                     } else {
938                         missmu(mtmp, (tmp == j), mattk);
939                     }
940                 } else if (is_animal(mtmp->data)) {
941 /*JP
942                     pline("%s gulps some air!", Monnam(mtmp));
943 */
944                     pline("%s\82Í\91§\82ð\8bz\82¢\82±\82ñ\82¾\81I", Monnam(mtmp));
945                 } else {
946                     if (youseeit)
947 /*JP
948                         pline("%s lunges forward and recoils!", Monnam(mtmp));
949 */
950                         pline("%s\82Í\93Ë\90i\82µ\81C\96ß\82Á\82½\81I", Monnam(mtmp));
951                     else
952 #if 0 /*JP*/
953                         You_hear("a %s nearby.",
954                                  is_whirly(mtmp->data) ? "rushing noise"
955                                                        : "splat");
956 #else
957                         You_hear("\82·\82®\82»\82Î\82Å%s\89¹\82ð\95·\82¢\82½\81D",
958                                  is_whirly(mtmp->data) ? "\93Ë\8c\82\82µ\82Ä\82­\82é"
959                                                        : "\83s\83V\83\83\83b\82Æ\82¢\82¤");
960 #endif
961                 }
962             }
963             break;
964         case AT_BREA:
965             if (range2)
966                 sum[i] = breamu(mtmp, mattk);
967             /* Note: breamu takes care of displacement */
968             break;
969         case AT_SPIT:
970             if (range2)
971                 sum[i] = spitmu(mtmp, mattk);
972             /* Note: spitmu takes care of displacement */
973             break;
974         case AT_WEAP:
975             if (range2) {
976                 if (!Is_rogue_level(&u.uz))
977                     thrwmu(mtmp);
978             } else {
979                 int hittmp = 0;
980
981                 /* Rare but not impossible.  Normally the monster
982                  * wields when 2 spaces away, but it can be
983                  * teleported or whatever....
984                  */
985                 if (mtmp->weapon_check == NEED_WEAPON || !MON_WEP(mtmp)) {
986                     mtmp->weapon_check = NEED_HTH_WEAPON;
987                     /* mon_wield_item resets weapon_check as appropriate */
988                     if (mon_wield_item(mtmp) != 0)
989                         break;
990                 }
991                 if (foundyou) {
992                     mon_currwep = MON_WEP(mtmp);
993                     if (mon_currwep) {
994                         hittmp = hitval(mon_currwep, &youmonst);
995                         tmp += hittmp;
996                         mswings(mtmp, mon_currwep);
997                     }
998                     if (tmp > (j = dieroll = rnd(20 + i)))
999                         sum[i] = hitmu(mtmp, mattk);
1000                     else
1001                         missmu(mtmp, (tmp == j), mattk);
1002                     /* KMH -- Don't accumulate to-hit bonuses */
1003                     if (mon_currwep)
1004                         tmp -= hittmp;
1005                 } else {
1006                     wildmiss(mtmp, mattk);
1007                     /* skip any remaining non-spell attacks */
1008                     skipnonmagc = TRUE;
1009                 }
1010             }
1011             break;
1012         case AT_MAGC:
1013             if (range2)
1014                 sum[i] = buzzmu(mtmp, mattk);
1015             else
1016                 sum[i] = castmu(mtmp, mattk, TRUE, foundyou);
1017             break;
1018
1019         default: /* no attack */
1020             break;
1021         }
1022         if (context.botl)
1023             bot();
1024         /* give player a chance of waking up before dying -kaa */
1025         if (sum[i] == 1) { /* successful attack */
1026             if (u.usleep && u.usleep < monstermoves && !rn2(10)) {
1027                 multi = -1;
1028 /*JP
1029                 nomovemsg = "The combat suddenly awakens you.";
1030 */
1031                 nomovemsg = "\82 \82È\82½\82Í\8bN\82±\82³\82ê\82½\81D";
1032             }
1033         }
1034         if (sum[i] == 2)
1035             return 1; /* attacker dead */
1036         if (sum[i] == 3)
1037             break; /* attacker teleported, no more attacks */
1038         /* sum[i] == 0: unsuccessful attack */
1039     }
1040     return 0;
1041 }
1042
1043 STATIC_OVL boolean
1044 diseasemu(mdat)
1045 struct permonst *mdat;
1046 {
1047     if (Sick_resistance) {
1048 /*JP
1049         You_feel("a slight illness.");
1050 */
1051         You("\82·\82±\82µ\8bC\95ª\82ª\88«\82­\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
1052         return FALSE;
1053     } else {
1054         make_sick(Sick ? Sick / 3L + 1L : (long) rn1(ACURR(A_CON), 20),
1055                   mdat->mname, TRUE, SICK_NONVOMITABLE);
1056         return TRUE;
1057     }
1058 }
1059
1060 /* check whether slippery clothing protects from hug or wrap attack */
1061 STATIC_OVL boolean
1062 u_slip_free(mtmp, mattk)
1063 struct monst *mtmp;
1064 struct attack *mattk;
1065 {
1066     struct obj *obj = (uarmc ? uarmc : uarm);
1067
1068     if (!obj)
1069         obj = uarmu;
1070     if (mattk->adtyp == AD_DRIN)
1071         obj = uarmh;
1072
1073     /* if your cloak/armor is greased, monster slips off; this
1074        protection might fail (33% chance) when the armor is cursed */
1075     if (obj && (obj->greased || obj->otyp == OILSKIN_CLOAK)
1076         && (!obj->cursed || rn2(3))) {
1077 #if 0 /*JP*/
1078         pline("%s %s your %s %s!", Monnam(mtmp),
1079               (mattk->adtyp == AD_WRAP) ? "slips off of"
1080                                         : "grabs you, but cannot hold onto",
1081               obj->greased ? "greased" : "slippery",
1082               /* avoid "slippery slippery cloak"
1083                  for undiscovered oilskin cloak */
1084               (obj->greased || objects[obj->otyp].oc_name_known)
1085                   ? xname(obj)
1086                   : cloak_simple_name(obj));
1087 #else
1088         pline("%s\82Í%s%s%s\81I", Monnam(mtmp),
1089               obj->greased ? "\96û\82Ì\93h\82ç\82ê\82½" : "\8a\8a\82è\82â\82·\82¢",
1090               (obj->greased || objects[obj->otyp].oc_name_known)
1091                   ? xname(obj)
1092                   : cloak_simple_name(obj),
1093               (mattk->adtyp == AD_WRAP) ? "\82Å\8a\8a\82Á\82½"
1094                                         : "\82ð\82Â\82©\82Ü\82¦\82æ\82¤\82Æ\82µ\82½\82ª\81C\82Å\82«\82È\82©\82Á\82½");
1095 #endif
1096
1097         if (obj->greased && !rn2(2)) {
1098 /*JP
1099             pline_The("grease wears off.");
1100 */
1101             pline("\8e\89\82Í\97\8e\82¿\82Ä\82µ\82Ü\82Á\82½\81D");
1102             obj->greased = 0;
1103             update_inventory();
1104         }
1105         return TRUE;
1106     }
1107     return FALSE;
1108 }
1109
1110 /* armor that sufficiently covers the body might be able to block magic */
1111 int
1112 magic_negation(mon)
1113 struct monst *mon;
1114 {
1115     struct obj *o;
1116     long wearmask;
1117     int armpro, mc = 0;
1118     boolean is_you = (mon == &youmonst),
1119             gotprot = is_you ? (EProtection != 0L)
1120                              /* high priests have innate protection */
1121                              : (mon->data == &mons[PM_HIGH_PRIEST]);
1122
1123     for (o = is_you ? invent : mon->minvent; o; o = o->nobj) {
1124         /* a_can field is only applicable for armor (which must be worn) */
1125         if ((o->owornmask & W_ARMOR) != 0L) {
1126             armpro = objects[o->otyp].a_can;
1127             if (armpro > mc)
1128                 mc = armpro;
1129         }
1130         /* if we've already confirmed Protection, skip additional checks */
1131         if (is_you || gotprot)
1132             continue;
1133
1134         /* omit W_SWAPWEP+W_QUIVER; W_ART+W_ARTI handled by protects() */
1135         wearmask = W_ARMOR | W_ACCESSORY;
1136         if (o->oclass == WEAPON_CLASS || is_weptool(o))
1137             wearmask |= W_WEP;
1138         if (protects(o, ((o->owornmask & wearmask) != 0L) ? TRUE : FALSE))
1139             gotprot = TRUE;
1140     }
1141
1142     if (gotprot) {
1143         /* extrinsic Protection increases mc by 1 */
1144         if (mc < 3)
1145             mc += 1;
1146     } else if (mc < 1) {
1147         /* intrinsic Protection is weaker (play balance; obtaining divine
1148            protection is too easy); it confers minimum mc 1 instead of 0 */
1149         if ((is_you && ((HProtection && u.ublessed > 0) || u.uspellprot))
1150             /* aligned priests and angels have innate intrinsic Protection */
1151             || (mon->data == &mons[PM_ALIGNED_PRIEST] || is_minion(mon->data)))
1152             mc = 1;
1153     }
1154     return mc;
1155 }
1156
1157 /*
1158  * hitmu: monster hits you
1159  *        returns 2 if monster dies (e.g. "yellow light"), 1 otherwise
1160  *        3 if the monster lives but teleported/paralyzed, so it can't keep
1161  *             attacking you
1162  */
1163 STATIC_OVL int
1164 hitmu(mtmp, mattk)
1165 register struct monst *mtmp;
1166 register struct attack *mattk;
1167 {
1168     struct permonst *mdat = mtmp->data;
1169     int uncancelled, ptmp;
1170     int dmg, armpro, permdmg;
1171     char buf[BUFSZ];
1172     struct permonst *olduasmon = youmonst.data;
1173     int res;
1174
1175     if (!canspotmon(mtmp))
1176         map_invisible(mtmp->mx, mtmp->my);
1177
1178     /*  If the monster is undetected & hits you, you should know where
1179      *  the attack came from.
1180      */
1181     if (mtmp->mundetected && (hides_under(mdat) || mdat->mlet == S_EEL)) {
1182         mtmp->mundetected = 0;
1183         if (!(Blind ? Blind_telepat : Unblind_telepat)) {
1184             struct obj *obj;
1185 #if 0 /*JP*/
1186             const char *what;
1187 #endif
1188
1189             if ((obj = level.objects[mtmp->mx][mtmp->my]) != 0) {
1190 #if 0 /*JP*/
1191                 if (Blind && !obj->dknown)
1192                     what = something;
1193                 else if (is_pool(mtmp->mx, mtmp->my) && !Underwater)
1194                     what = "the water";
1195                 else
1196                     what = doname(obj);
1197
1198                 pline("%s was hidden under %s!", Amonnam(mtmp), what);
1199 #else
1200                 if (Blind && !obj->dknown)
1201                     pline("%s\82ª\89½\82©\82Ì\89º\82É\89B\82ê\82Ä\82¢\82é\81I", Amonnam(mtmp));
1202                 else if (is_pool(mtmp->mx, mtmp->my) && !Underwater)
1203                     pline("%s\82ª\90\85\92\86\82É\89B\82ê\82Ä\82¢\82é\81I", Amonnam(mtmp));
1204                 else
1205                     pline("%s\82ª%s\82Ì\89º\82É\89B\82ê\82Ä\82¢\82é\81I", Amonnam(mtmp), doname(obj));
1206 #endif
1207             }
1208             newsym(mtmp->mx, mtmp->my);
1209         }
1210     }
1211
1212     /*  First determine the base damage done */
1213     dmg = d((int) mattk->damn, (int) mattk->damd);
1214     if ((is_undead(mdat) || is_vampshifter(mtmp)) && midnight())
1215         dmg += d((int) mattk->damn, (int) mattk->damd); /* extra damage */
1216
1217     /*  Next a cancellation factor.
1218      *  Use uncancelled when cancellation factor takes into account certain
1219      *  armor's special magic protection.  Otherwise just use !mtmp->mcan.
1220      */
1221     armpro = magic_negation(&youmonst);
1222     uncancelled = !mtmp->mcan && (rn2(10) >= 3 * armpro);
1223
1224     permdmg = 0;
1225     /*  Now, adjust damages via resistances or specific attacks */
1226     switch (mattk->adtyp) {
1227     case AD_PHYS:
1228         if (mattk->aatyp == AT_HUGS && !sticks(youmonst.data)) {
1229             if (!u.ustuck && rn2(2)) {
1230                 if (u_slip_free(mtmp, mattk)) {
1231                     dmg = 0;
1232                 } else {
1233                     u.ustuck = mtmp;
1234 /*JP
1235                     pline("%s grabs you!", Monnam(mtmp));
1236 */
1237                     pline("%s\82É\82Â\82©\82Ü\82¦\82ç\82ê\82Ä\82¢\82é\81I", Monnam(mtmp));
1238                 }
1239             } else if (u.ustuck == mtmp) {
1240                 exercise(A_STR, FALSE);
1241 #if 0 /*JP*/
1242                 You("are being %s.", (mtmp->data == &mons[PM_ROPE_GOLEM])
1243                                          ? "choked"
1244                                          : "crushed");
1245 #else
1246                 You("%s\82Ä\82¢\82é\81D", (mtmp->data == &mons[PM_ROPE_GOLEM])
1247                                          ? "\8eñ\82ð\8di\82ß\82ç\82ê"
1248                                          : "\89\9f\82µ\82Â\82Ô\82³\82ê");
1249 #endif
1250             }
1251         } else { /* hand to hand weapon */
1252             struct obj *otmp = mon_currwep;
1253
1254             if (mattk->aatyp == AT_WEAP && otmp) {
1255                 struct obj *marmg;
1256                 int tmp;
1257
1258                 if (otmp->otyp == CORPSE
1259                     && touch_petrifies(&mons[otmp->corpsenm])) {
1260                     dmg = 1;
1261 #if 0 /*JP*/
1262                     pline("%s hits you with the %s corpse.", Monnam(mtmp),
1263                           mons[otmp->corpsenm].mname);
1264 #else
1265                     pline("%s\82Í%s\82Ì\8e\80\91Ì\82Å\8dU\8c\82\82µ\82½\81D", Monnam(mtmp),
1266                           mons[otmp->corpsenm].mname);
1267 #endif
1268                     if (!Stoned)
1269                         goto do_stone;
1270                 }
1271                 dmg += dmgval(otmp, &youmonst);
1272                 if ((marmg = which_armor(mtmp, W_ARMG)) != 0
1273                     && marmg->otyp == GAUNTLETS_OF_POWER)
1274                     dmg += rn1(4, 3); /* 3..6 */
1275                 if (dmg <= 0)
1276                     dmg = 1;
1277                 if (!(otmp->oartifact
1278                       && artifact_hit(mtmp, &youmonst, otmp, &dmg, dieroll)))
1279                     hitmsg(mtmp, mattk);
1280                 if (!dmg)
1281                     break;
1282                 if (objects[otmp->otyp].oc_material == SILVER
1283                     && Hate_silver) {
1284 /*JP
1285                     pline_The("silver sears your flesh!");
1286 */
1287                     pline("\82 \82È\82½\82Ì\91Ì\82Í\8bâ\82Å\8fÄ\82©\82ê\82½\81I");
1288                     exercise(A_CON, FALSE);
1289                 }
1290                 /* this redundancy necessary because you have
1291                    to take the damage _before_ being cloned;
1292                    need to have at least 2 hp left to split */
1293                 tmp = dmg;
1294                 if (u.uac < 0)
1295                     tmp -= rnd(-u.uac);
1296                 if (tmp < 1)
1297                     tmp = 1;
1298                 if (u.mh - tmp > 1
1299                     && (objects[otmp->otyp].oc_material == IRON
1300                         /* relevant 'metal' objects are scalpel and tsurugi */
1301                         || objects[otmp->otyp].oc_material == METAL)
1302                     && (u.umonnum == PM_BLACK_PUDDING
1303                         || u.umonnum == PM_BROWN_PUDDING)) {
1304                     if (tmp > 1)
1305                         exercise(A_STR, FALSE);
1306                     /* inflict damage now; we know it can't be fatal */
1307                     u.mh -= tmp;
1308                     context.botl = 1;
1309                     dmg = 0; /* don't inflict more damage below */
1310                     if (cloneu())
1311 /*JP
1312                         You("divide as %s hits you!", mon_nam(mtmp));
1313 */
1314                         pline("%s\82Ì\8dU\8c\82\82É\82æ\82Á\82Ä\82 \82È\82½\82Í\95ª\97ô\82µ\82½\81I", mon_nam(mtmp));
1315                 }
1316                 rustm(&youmonst, otmp);
1317             } else if (mattk->aatyp != AT_TUCH || dmg != 0
1318                        || mtmp != u.ustuck)
1319                 hitmsg(mtmp, mattk);
1320         }
1321         break;
1322     case AD_DISE:
1323         hitmsg(mtmp, mattk);
1324         if (!diseasemu(mdat))
1325             dmg = 0;
1326         break;
1327     case AD_FIRE:
1328         hitmsg(mtmp, mattk);
1329         if (uncancelled) {
1330 /*JP
1331             pline("You're %s!", on_fire(youmonst.data, mattk));
1332 */
1333             pline("\82 \82È\82½\82Í%s\81I", on_fire(youmonst.data, mattk));
1334             if (completelyburns(youmonst.data)) { /* paper or straw golem */
1335 /*JP
1336                 You("go up in flames!");
1337 */
1338                 You("\89\8a\82É\95ï\82Ü\82ê\82½\81I");
1339                 /* KMH -- this is okay with unchanging */
1340                 rehumanize();
1341                 break;
1342             } else if (Fire_resistance) {
1343 /*JP
1344                 pline_The("fire doesn't feel hot!");
1345 */
1346                 pline("\89Î\82Í\82º\82ñ\82º\82ñ\94M\82­\82È\82¢\81I");
1347                 dmg = 0;
1348             }
1349             if ((int) mtmp->m_lev > rn2(20))
1350                 destroy_item(SCROLL_CLASS, AD_FIRE);
1351             if ((int) mtmp->m_lev > rn2(20))
1352                 destroy_item(POTION_CLASS, AD_FIRE);
1353             if ((int) mtmp->m_lev > rn2(25))
1354                 destroy_item(SPBOOK_CLASS, AD_FIRE);
1355             burn_away_slime();
1356         } else
1357             dmg = 0;
1358         break;
1359     case AD_COLD:
1360         hitmsg(mtmp, mattk);
1361         if (uncancelled) {
1362 /*JP
1363             pline("You're covered in frost!");
1364 */
1365             You("\95X\82Å\95¢\82í\82ê\82½\81I");
1366             if (Cold_resistance) {
1367 /*JP
1368                 pline_The("frost doesn't seem cold!");
1369 */
1370                 pline("\95X\82Í\97â\82³\82ð\8a´\82\82³\82¹\82È\82¢\81I");
1371                 dmg = 0;
1372             }
1373             if ((int) mtmp->m_lev > rn2(20))
1374                 destroy_item(POTION_CLASS, AD_COLD);
1375         } else
1376             dmg = 0;
1377         break;
1378     case AD_ELEC:
1379         hitmsg(mtmp, mattk);
1380         if (uncancelled) {
1381 /*JP
1382             You("get zapped!");
1383 */
1384             You("\93d\8c\82\82ð\82­\82ç\82Á\82½\81I");
1385             if (Shock_resistance) {
1386 /*JP
1387                 pline_The("zap doesn't shock you!");
1388 */
1389                 pline("\93d\8c\82\82Í\82µ\82Ñ\82ê\82ð\8a´\82\82³\82¹\82È\82¢\81I");
1390                 dmg = 0;
1391             }
1392             if ((int) mtmp->m_lev > rn2(20))
1393                 destroy_item(WAND_CLASS, AD_ELEC);
1394             if ((int) mtmp->m_lev > rn2(20))
1395                 destroy_item(RING_CLASS, AD_ELEC);
1396         } else
1397             dmg = 0;
1398         break;
1399     case AD_SLEE:
1400         hitmsg(mtmp, mattk);
1401         if (uncancelled && multi >= 0 && !rn2(5)) {
1402             if (Sleep_resistance)
1403                 break;
1404             fall_asleep(-rnd(10), TRUE);
1405             if (Blind)
1406 /*JP
1407                 You("are put to sleep!");
1408 */
1409                 You("\96°\82è\82É\82¨\82¿\82½\81I");
1410             else
1411 /*JP
1412                 You("are put to sleep by %s!", mon_nam(mtmp));
1413 */
1414                 You("%s\82É\96°\82ç\82³\82ê\82½\81I", mon_nam(mtmp));
1415         }
1416         break;
1417     case AD_BLND:
1418         if (can_blnd(mtmp, &youmonst, mattk->aatyp, (struct obj *) 0)) {
1419             if (!Blind)
1420 /*JP
1421                 pline("%s blinds you!", Monnam(mtmp));
1422 */
1423                 pline("%s\82Ì\8dU\8c\82\82Å\96Ú\82ª\8c©\82¦\82È\82­\82È\82Á\82½\81I", Monnam(mtmp));
1424             make_blinded(Blinded + (long) dmg, FALSE);
1425             if (!Blind)
1426                 Your1(vision_clears);
1427         }
1428         dmg = 0;
1429         break;
1430     case AD_DRST:
1431         ptmp = A_STR;
1432         goto dopois;
1433     case AD_DRDX:
1434         ptmp = A_DEX;
1435         goto dopois;
1436     case AD_DRCO:
1437         ptmp = A_CON;
1438     dopois:
1439         hitmsg(mtmp, mattk);
1440         if (uncancelled && !rn2(8)) {
1441 #if 0 /*JP*/
1442             Sprintf(buf, "%s %s", s_suffix(Monnam(mtmp)),
1443                     mpoisons_subj(mtmp, mattk));
1444 #else
1445             Sprintf(buf, "%s\82Ì%s", Monnam(mtmp),
1446                     mpoisons_subj(mtmp, mattk));
1447 #endif
1448             poisoned(buf, ptmp, mdat->mname, 30, FALSE);
1449         }
1450         break;
1451     case AD_DRIN:
1452         hitmsg(mtmp, mattk);
1453         if (defends(AD_DRIN, uwep) || !has_head(youmonst.data)) {
1454 /*JP
1455             You("don't seem harmed.");
1456 */
1457             You("\8f\9d\82Â\82¢\82Ä\82¢\82È\82¢\82æ\82¤\82¾\81D");
1458             /* Not clear what to do for green slimes */
1459             break;
1460         }
1461         if (u_slip_free(mtmp, mattk))
1462             break;
1463
1464         if (uarmh && rn2(8)) {
1465             /* not body_part(HEAD) */
1466 /*JP
1467             Your("%s blocks the attack to your head.",
1468 */
1469             Your("%s\82ª\93ª\82Ö\82Ì\8dU\8c\82\82ð\96h\82¢\82¾\81D",
1470                  helm_simple_name(uarmh));
1471             break;
1472         }
1473         /* negative armor class doesn't reduce this damage */
1474         if (Half_physical_damage)
1475             dmg = (dmg + 1) / 2;
1476         mdamageu(mtmp, dmg);
1477         dmg = 0; /* don't inflict a second dose below */
1478
1479         if (!uarmh || uarmh->otyp != DUNCE_CAP) {
1480             /* eat_brains() will miss if target is mindless (won't
1481                happen here; hero is considered to retain his mind
1482                regardless of current shape) or is noncorporeal
1483                (can't happen here; no one can poly into a ghost
1484                or shade) so this check for missing is academic */
1485             if (eat_brains(mtmp, &youmonst, TRUE, (int *) 0) == MM_MISS)
1486                 break;
1487         }
1488         /* adjattrib gives dunce cap message when appropriate */
1489         (void) adjattrib(A_INT, -rnd(2), FALSE);
1490         forget_levels(25);  /* lose memory of 25% of levels */
1491         forget_objects(25); /* lose memory of 25% of objects */
1492         break;
1493     case AD_PLYS:
1494         hitmsg(mtmp, mattk);
1495         if (uncancelled && multi >= 0 && !rn2(3)) {
1496             if (Free_action) {
1497 /*JP
1498                 You("momentarily stiffen.");
1499 */
1500                 You("\88ê\8fu\8dd\92¼\82µ\82½\81D");
1501             } else {
1502                 if (Blind)
1503 /*JP
1504                     You("are frozen!");
1505 */
1506                     You("\93®\82¯\82È\82¢\81I");
1507                 else
1508 /*JP
1509                     You("are frozen by %s!", mon_nam(mtmp));
1510 */
1511                     pline("%s\82É\82æ\82Á\82Ä\93®\82¯\82È\82­\82È\82Á\82½\81I", mon_nam(mtmp));
1512                 nomovemsg = You_can_move_again;
1513                 nomul(-rnd(10));
1514 /*JP
1515                 multi_reason = "paralyzed by a monster";
1516 */
1517                 multi_reason = "\89ö\95¨\82É\96\83á\83\82³\82¹\82ç\82ê\82½\8c\84\82É";
1518                 exercise(A_DEX, FALSE);
1519             }
1520         }
1521         break;
1522     case AD_DRLI:
1523         hitmsg(mtmp, mattk);
1524         if (uncancelled && !rn2(3) && !Drain_resistance) {
1525 /*JP
1526             losexp("life drainage");
1527 */
1528             losexp("\90\96½\97Í\82ð\8bz\8eû\82³\82ê\82Ä");
1529         }
1530         break;
1531     case AD_LEGS: {
1532         long side = rn2(2) ? RIGHT_SIDE : LEFT_SIDE;
1533 /*JP
1534         const char *sidestr = (side == RIGHT_SIDE) ? "right" : "left",
1535 */
1536         const char *sidestr = (side == RIGHT_SIDE) ? "\89E" : "\8d¶",
1537                    *Monst_name = Monnam(mtmp), *leg = body_part(LEG);
1538
1539         /* This case is too obvious to ignore, but Nethack is not in
1540          * general very good at considering height--most short monsters
1541          * still _can_ attack you when you're flying or mounted.
1542          * [FIXME: why can't a flying attacker overcome this?]
1543          */
1544         if (u.usteed || Levitation || Flying) {
1545 /*JP
1546             pline("%s tries to reach your %s %s!", Monst_name, sidestr, leg);
1547 */
1548             pline("%s\82Í\82 \82È\82½\82Ì%s%s\82É\8dU\8c\82\82µ\82æ\82¤\82Æ\82µ\82½\81I", Monst_name, sidestr, leg);
1549             dmg = 0;
1550         } else if (mtmp->mcan) {
1551 #if 0 /*JP:T*/
1552             pline("%s nuzzles against your %s %s!", Monnam(mtmp),
1553                   sidestr, leg);
1554 #else
1555             pline("%s\82Í\82 \82È\82½\82Ì%s%s\82É\95@\82ð\82·\82è\82æ\82¹\82½\81I", Monnam(mtmp),
1556                   sidestr, leg);
1557 #endif
1558             dmg = 0;
1559         } else {
1560             if (uarmf) {
1561                 if (rn2(2) && (uarmf->otyp == LOW_BOOTS
1562                                || uarmf->otyp == IRON_SHOES)) {
1563 #if 0 /*JP:T*/
1564                     pline("%s pricks the exposed part of your %s %s!",
1565                           Monst_name, sidestr, leg);
1566 #else
1567                     pline("%s\82Í\82 \82È\82½\82Ì%s%s\82ð\82¿\82­\82è\82Æ\8eh\82µ\82½\81I",
1568                           Monst_name, sidestr, leg);
1569 #endif
1570                 } else if (!rn2(5)) {
1571 #if 0 /*JP*/
1572                     pline("%s pricks through your %s boot!", Monst_name,
1573                           sidestr);
1574 #else
1575                     pline("%s\82Í\82 \82È\82½\82Ì%s\82Ì\8cC\82²\82µ\82É\82¿\82­\82è\82Æ\8eh\82µ\82½\81I", Monst_name,
1576                           sidestr);
1577 #endif
1578                 } else {
1579 #if 0 /*JP*/
1580                     pline("%s scratches your %s boot!", Monst_name,
1581                           sidestr);
1582 #else
1583                     pline("%s\82Í\82 \82È\82½\82Ì%s\82Ì\8cC\82ð\82Ð\82Á\82©\82¢\82½\81I", Monst_name,
1584                           sidestr);
1585 #endif
1586                     dmg = 0;
1587                     break;
1588                 }
1589             } else
1590 /*JP
1591                 pline("%s pricks your %s %s!", Monst_name, sidestr, leg);
1592 */
1593                 pline("%s\82Í\82 \82È\82½\82Ì%s%s\82ð\82¿\82­\82è\82Æ\8eh\82µ\82½\81I", Monst_name, sidestr, leg);
1594
1595             set_wounded_legs(side, rnd(60 - ACURR(A_DEX)));
1596             exercise(A_STR, FALSE);
1597             exercise(A_DEX, FALSE);
1598         }
1599         break;
1600     }
1601     case AD_STON: /* cockatrice */
1602         hitmsg(mtmp, mattk);
1603         if (!rn2(3)) {
1604             if (mtmp->mcan) {
1605                 if (!Deaf)
1606 /*JP
1607                     You_hear("a cough from %s!", mon_nam(mtmp));
1608 */
1609                     You_hear("%s\82ª\83S\83z\83b\83S\83z\83b\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81I", mon_nam(mtmp));
1610             } else {
1611                 if (!Deaf)
1612 /*JP
1613                     You_hear("%s hissing!", s_suffix(mon_nam(mtmp)));
1614 */
1615                     You_hear("%s\82ª\83V\83\85\81[\83b\82Æ\82¢\82¤\90º\82ð\95·\82¢\82½\81I", mon_nam(mtmp));
1616                 if (!rn2(10)
1617                     || (flags.moonphase == NEW_MOON && !have_lizard())) {
1618                 do_stone:
1619                     if (!Stoned && !Stone_resistance
1620                         && !(poly_when_stoned(youmonst.data)
1621                              && polymon(PM_STONE_GOLEM))) {
1622                         int kformat = KILLED_BY_AN;
1623                         const char *kname = mtmp->data->mname;
1624
1625                         if (mtmp->data->geno & G_UNIQ) {
1626                             if (!type_is_pname(mtmp->data))
1627                                 kname = the(kname);
1628                             kformat = KILLED_BY;
1629                         }
1630                         make_stoned(5L, (char *) 0, kformat, kname);
1631                         return 1;
1632                         /* done_in_by(mtmp, STONING); */
1633                     }
1634                 }
1635             }
1636         }
1637         break;
1638     case AD_STCK:
1639         hitmsg(mtmp, mattk);
1640         if (uncancelled && !u.ustuck && !sticks(youmonst.data))
1641             u.ustuck = mtmp;
1642         break;
1643     case AD_WRAP:
1644         if ((!mtmp->mcan || u.ustuck == mtmp) && !sticks(youmonst.data)) {
1645             if (!u.ustuck && !rn2(10)) {
1646                 if (u_slip_free(mtmp, mattk)) {
1647                     dmg = 0;
1648                 } else {
1649 /*JP
1650                     pline("%s swings itself around you!", Monnam(mtmp));
1651 */
1652                     pline("%s\82Í\82 \82È\82½\82É\91Ì\82ð\97\8d\82Ý\82Â\82©\82¹\82½\81I", Monnam(mtmp));
1653                     u.ustuck = mtmp;
1654                 }
1655             } else if (u.ustuck == mtmp) {
1656                 if (is_pool(mtmp->mx, mtmp->my) && !Swimming && !Amphibious) {
1657                     boolean moat = (levl[mtmp->mx][mtmp->my].typ != POOL)
1658                                    && (levl[mtmp->mx][mtmp->my].typ != WATER)
1659                                    && !Is_medusa_level(&u.uz)
1660                                    && !Is_waterlevel(&u.uz);
1661
1662 /*JP
1663                     pline("%s drowns you...", Monnam(mtmp));
1664 */
1665                     pline("\82 \82È\82½\82Í%s\82É\97\8d\82Ý\82Â\82©\82ê\82Ä\93M\82ê\82½\81D\81D\81D", Monnam(mtmp));
1666                     killer.format = KILLED_BY_AN;
1667 #if 0 /*JP*/
1668                     Sprintf(killer.name, "%s by %s",
1669                             moat ? "moat" : "pool of water",
1670                             an(mtmp->data->mname));
1671 #else
1672                     Sprintf(buf, "%s\82Ì%s\82É\97\8d\82Ý\82Â\82©\82ê\82Ä",
1673                             moat ? "\96x" : "\92r",
1674                             mtmp->data->mname);
1675 #endif
1676                     done(DROWNING);
1677                 } else if (mattk->aatyp == AT_HUGS)
1678 /*JP
1679                     You("are being crushed.");
1680 */
1681                     You("\82Â\82Ô\82³\82ê\82Â\82Â\82 \82é\81D");
1682             } else {
1683                 dmg = 0;
1684                 if (flags.verbose)
1685 #if 0 /*JP*/
1686                     pline("%s brushes against your %s.", Monnam(mtmp),
1687                           body_part(LEG));
1688 #else
1689                     pline("%s\82Í\82 \82È\82½\82Ì%s\82É\90G\82ê\82½\81D", Monnam(mtmp),
1690                           body_part(LEG));
1691 #endif
1692             }
1693         } else
1694             dmg = 0;
1695         break;
1696     case AD_WERE:
1697         hitmsg(mtmp, mattk);
1698         if (uncancelled && !rn2(4) && u.ulycn == NON_PM
1699             && !Protection_from_shape_changers && !defends(AD_WERE, uwep)) {
1700 /*JP
1701             You_feel("feverish.");
1702 */
1703             You("\94M\82ª\82 \82é\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
1704             exercise(A_CON, FALSE);
1705             set_ulycn(monsndx(mdat));
1706             retouch_equipment(2);
1707         }
1708         break;
1709     case AD_SGLD:
1710         hitmsg(mtmp, mattk);
1711         if (youmonst.data->mlet == mdat->mlet)
1712             break;
1713         if (!mtmp->mcan)
1714             stealgold(mtmp);
1715         break;
1716
1717     case AD_SSEX:
1718         if (SYSOPT_SEDUCE) {
1719             if (could_seduce(mtmp, &youmonst, mattk) == 1 && !mtmp->mcan)
1720                 if (doseduce(mtmp))
1721                     return 3;
1722             break;
1723         }
1724         /*FALLTHRU*/
1725     case AD_SITM: /* for now these are the same */
1726     case AD_SEDU:
1727         if (is_animal(mtmp->data)) {
1728             hitmsg(mtmp, mattk);
1729             if (mtmp->mcan)
1730                 break;
1731             /* Continue below */
1732         } else if (dmgtype(youmonst.data, AD_SEDU)
1733                    || (SYSOPT_SEDUCE && dmgtype(youmonst.data, AD_SSEX))) {
1734 #if 0 /*JP:T*/
1735             pline("%s %s.", Monnam(mtmp),
1736                   mtmp->minvent
1737                       ? "brags about the goods some dungeon explorer provided"
1738                   : "makes some remarks about how difficult theft is lately");
1739 #else
1740             pline("%s\82Í%s\81D", Monnam(mtmp),
1741                   mtmp->minvent
1742                       ? "\82 \82é\96À\8b{\92T\8c\9f\89Æ\82ª\92u\82¢\82Ä\82Á\82½\95i\95¨\82ð\8e©\96\9d\82µ\82½"
1743                       : "\8dÅ\8bß\90Þ\93\90\82ª\82¢\82©\82É\8d¢\93ï\82©\92W\81X\82Æ\8fq\82×\82½");
1744 #endif
1745             if (!tele_restrict(mtmp))
1746                 (void) rloc(mtmp, TRUE);
1747             return 3;
1748         } else if (mtmp->mcan) {
1749             if (!Blind)
1750 #if 0 /*JP*/
1751                 pline("%s tries to %s you, but you seem %s.",
1752                       Adjmonnam(mtmp, "plain"),
1753                       flags.female ? "charm" : "seduce",
1754                       flags.female ? "unaffected" : "uninterested");
1755 #else
1756                 pline("%s\82Í\82 \82È\82½\82ð%s\82µ\82æ\82¤\82Æ\82µ\82½\81C\82µ\82©\82µ\82 \82È\82½\82Í%s\81D",
1757                       Adjmonnam(mtmp, "\92n\96¡\82È"),
1758                       flags.female ? "\96£\97¹" : "\97U\98f",
1759                       flags.female ? "\89e\8b¿\82ð\8eó\82¯\82È\82¢" : "\8b»\96¡\82ª\82È\82¢");
1760 #endif
1761             if (rn2(3)) {
1762                 if (!tele_restrict(mtmp))
1763                     (void) rloc(mtmp, TRUE);
1764                 return 3;
1765             }
1766             break;
1767         }
1768         buf[0] = '\0';
1769         switch (steal(mtmp, buf)) {
1770         case -1:
1771             return 2;
1772         case 0:
1773             break;
1774         default:
1775             if (!is_animal(mtmp->data) && !tele_restrict(mtmp))
1776                 (void) rloc(mtmp, TRUE);
1777             if (is_animal(mtmp->data) && *buf) {
1778                 if (canseemon(mtmp))
1779 #if 0 /*JP*/
1780                     pline("%s tries to %s away with %s.", Monnam(mtmp),
1781                           locomotion(mtmp->data, "run"), buf);
1782 #else
1783                     pline("%s\82Í%s\82ð\8e\9d\82Á\82Ä\93¦\82°\8fo\82µ\82½\81D", Monnam(mtmp),
1784                           buf);
1785 #endif
1786             }
1787             monflee(mtmp, 0, FALSE, FALSE);
1788             return 3;
1789         }
1790         break;
1791
1792     case AD_SAMU:
1793         hitmsg(mtmp, mattk);
1794         /* when the Wizard or quest nemesis hits, there's a 1/20 chance
1795            to steal a quest artifact (any, not just the one for the hero's
1796            own role) or the Amulet or one of the invocation tools */
1797         if (!rn2(20))
1798             stealamulet(mtmp);
1799         break;
1800
1801     case AD_TLPT:
1802         hitmsg(mtmp, mattk);
1803         if (uncancelled) {
1804             if (flags.verbose)
1805 /*JP
1806                 Your("position suddenly seems very uncertain!");
1807 */
1808                 pline("\8e©\95ª\82Ì\82¢\82é\88Ê\92u\82ª\93Ë\91R\95s\96¾\8am\82É\82È\82Á\82½\81I");
1809             tele();
1810         }
1811         break;
1812     case AD_RUST:
1813         hitmsg(mtmp, mattk);
1814         if (mtmp->mcan)
1815             break;
1816         if (u.umonnum == PM_IRON_GOLEM) {
1817 /*JP
1818             You("rust!");
1819 */
1820             You("\8eK\82Ñ\82Â\82¢\82½\81I");
1821             /* KMH -- this is okay with unchanging */
1822             rehumanize();
1823             break;
1824         }
1825         erode_armor(&youmonst, ERODE_RUST);
1826         break;
1827     case AD_CORR:
1828         hitmsg(mtmp, mattk);
1829         if (mtmp->mcan)
1830             break;
1831         erode_armor(&youmonst, ERODE_CORRODE);
1832         break;
1833     case AD_DCAY:
1834         hitmsg(mtmp, mattk);
1835         if (mtmp->mcan)
1836             break;
1837         if (u.umonnum == PM_WOOD_GOLEM || u.umonnum == PM_LEATHER_GOLEM) {
1838 /*JP
1839             You("rot!");
1840 */
1841             You("\95\85\82Á\82½\81I");
1842             /* KMH -- this is okay with unchanging */
1843             rehumanize();
1844             break;
1845         }
1846         erode_armor(&youmonst, ERODE_ROT);
1847         break;
1848     case AD_HEAL:
1849         /* a cancelled nurse is just an ordinary monster,
1850          * nurses don't heal those that cause petrification */
1851         if (mtmp->mcan || (Upolyd && touch_petrifies(youmonst.data))) {
1852             hitmsg(mtmp, mattk);
1853             break;
1854         }
1855         if (!uwep && !uarmu && !uarm && !uarmc
1856             && !uarms && !uarmg && !uarmf && !uarmh) {
1857             boolean goaway = FALSE;
1858
1859 /*JP
1860             pline("%s hits!  (I hope you don't mind.)", Monnam(mtmp));
1861 */
1862             pline("%s\82Ì\8dU\8c\82\82Í\96½\92\86\82µ\82½\81D(\8bC\82É\82µ\82È\82¢\82æ\82¤\82É\81D)", Monnam(mtmp));
1863             if (Upolyd) {
1864                 u.mh += rnd(7);
1865                 if (!rn2(7)) {
1866                     /* no upper limit necessary; effect is temporary */
1867                     u.mhmax++;
1868                     if (!rn2(13))
1869                         goaway = TRUE;
1870                 }
1871                 if (u.mh > u.mhmax)
1872                     u.mh = u.mhmax;
1873             } else {
1874                 u.uhp += rnd(7);
1875                 if (!rn2(7)) {
1876                     /* hard upper limit via nurse care: 25 * ulevel */
1877                     if (u.uhpmax < 5 * u.ulevel + d(2 * u.ulevel, 10))
1878                         u.uhpmax++;
1879                     if (!rn2(13))
1880                         goaway = TRUE;
1881                 }
1882                 if (u.uhp > u.uhpmax)
1883                     u.uhp = u.uhpmax;
1884             }
1885             if (!rn2(3))
1886                 exercise(A_STR, TRUE);
1887             if (!rn2(3))
1888                 exercise(A_CON, TRUE);
1889             if (Sick)
1890                 make_sick(0L, (char *) 0, FALSE, SICK_ALL);
1891             context.botl = 1;
1892             if (goaway) {
1893                 mongone(mtmp);
1894                 return 2;
1895             } else if (!rn2(33)) {
1896                 if (!tele_restrict(mtmp))
1897                     (void) rloc(mtmp, TRUE);
1898                 monflee(mtmp, d(3, 6), TRUE, FALSE);
1899                 return 3;
1900             }
1901             dmg = 0;
1902         } else {
1903             if (Role_if(PM_HEALER)) {
1904                 if (!Deaf && !(moves % 5))
1905 /*JP
1906                     verbalize("Doc, I can't help you unless you cooperate.");
1907 */
1908                     verbalize("\83h\83N\83^\81[\81I\8b¦\97Í\82ð\82¨\82Ë\82ª\82¢\82µ\82Ü\82·\82í\81D");
1909                 dmg = 0;
1910             } else
1911                 hitmsg(mtmp, mattk);
1912         }
1913         break;
1914     case AD_CURS:
1915         hitmsg(mtmp, mattk);
1916         if (!night() && mdat == &mons[PM_GREMLIN])
1917             break;
1918         if (!mtmp->mcan && !rn2(10)) {
1919             if (!Deaf) {
1920                 if (Blind)
1921 /*JP
1922                     You_hear("laughter.");
1923 */
1924                     You_hear("\8fÎ\82¢\90º\82ð\95·\82¢\82½\81D");
1925                 else
1926 /*JP
1927                     pline("%s chuckles.", Monnam(mtmp));
1928 */
1929                     pline("%s\82Í\83N\83X\83N\83X\8fÎ\82Á\82½\81D", Monnam(mtmp));
1930             }
1931             if (u.umonnum == PM_CLAY_GOLEM) {
1932 /*JP
1933                 pline("Some writing vanishes from your head!");
1934 */
1935                 pline("\82¢\82­\82Â\82©\82Ì\95\8e\9a\82ª\82 \82È\82½\82Ì\93ª\82©\82ç\8fÁ\82¦\82½\81I");
1936                 /* KMH -- this is okay with unchanging */
1937                 rehumanize();
1938                 break;
1939             }
1940             attrcurse();
1941         }
1942         break;
1943     case AD_STUN:
1944         hitmsg(mtmp, mattk);
1945         if (!mtmp->mcan && !rn2(4)) {
1946             make_stunned((HStun & TIMEOUT) + (long) dmg, TRUE);
1947             dmg /= 2;
1948         }
1949         break;
1950     case AD_ACID:
1951         hitmsg(mtmp, mattk);
1952         if (!mtmp->mcan && !rn2(3))
1953             if (Acid_resistance) {
1954 #if 0 /*JP:T*/
1955                 pline("You're covered in %s, but it seems harmless.",
1956                       hliquid("acid"));
1957 #else
1958                 pline("%s\82Å\95¢\82í\82ê\82½\81D\82µ\82©\82µ\8f\9d\82Â\82©\82È\82¢\81D",
1959                       hliquid("\8e_"));
1960 #endif
1961                 dmg = 0;
1962             } else {
1963 /*JP
1964                 pline("You're covered in %s!  It burns!", hliquid("acid"));
1965 */
1966                 pline("%s\82Å\95¢\82í\82ê\8fÄ\82¯\82½\81I", hliquid("\8e_"));
1967                 exercise(A_STR, FALSE);
1968             }
1969         else
1970             dmg = 0;
1971         break;
1972     case AD_SLOW:
1973         hitmsg(mtmp, mattk);
1974         if (uncancelled && HFast && !defends(AD_SLOW, uwep) && !rn2(4))
1975             u_slow_down();
1976         break;
1977     case AD_DREN:
1978         hitmsg(mtmp, mattk);
1979         if (uncancelled && !rn2(4)) /* 25% chance */
1980             drain_en(dmg);
1981         dmg = 0;
1982         break;
1983     case AD_CONF:
1984         hitmsg(mtmp, mattk);
1985         if (!mtmp->mcan && !rn2(4) && !mtmp->mspec_used) {
1986             mtmp->mspec_used = mtmp->mspec_used + (dmg + rn2(6));
1987             if (Confusion)
1988 /*JP
1989                 You("are getting even more confused.");
1990 */
1991                 You("\82Ü\82·\82Ü\82·\8d¬\97\90\82µ\82½\81D");
1992             else
1993 /*JP
1994                 You("are getting confused.");
1995 */
1996                 You("\8d¬\97\90\82µ\82Ä\82«\82½\81D");
1997             make_confused(HConfusion + dmg, FALSE);
1998         }
1999         dmg = 0;
2000         break;
2001     case AD_DETH:
2002 /*JP
2003         pline("%s reaches out with its deadly touch.", Monnam(mtmp));
2004 */
2005         pline("%s\82Í\8e\80\82Ì\98r\82ð\82Ì\82Î\82µ\82½\81D", Monnam(mtmp));
2006         if (is_undead(youmonst.data)) {
2007             /* Still does normal damage */
2008 /*JP
2009             pline("Was that the touch of death?");
2010 */
2011             pline("\8d¡\82Ì\82Í\8e\80\82Ì\90é\8d\90\82¾\82Á\82½\82Ì\82©\82È\81H");
2012             break;
2013         }
2014         switch (rn2(20)) {
2015         case 19:
2016         case 18:
2017         case 17:
2018             if (!Antimagic) {
2019                 killer.format = KILLED_BY_AN;
2020 /*JP
2021                 Strcpy(killer.name, "touch of death");
2022 */
2023                 Strcpy(killer.name, "\8e\80\82Ì\90é\8d\90\82Å");
2024                 done(DIED);
2025                 dmg = 0;
2026                 break;
2027             }
2028             /*FALLTHRU*/
2029         default: /* case 16: ... case 5: */
2030 /*JP
2031             You_feel("your life force draining away...");
2032 */
2033             You("\91Ì\97Í\82ª\92D\82í\82ê\82Ä\82¢\82­\82æ\82¤\82È\8bC\82ª\82µ\82½\81D\81D\81D");
2034             permdmg = 1; /* actual damage done below */
2035             break;
2036         case 4:
2037         case 3:
2038         case 2:
2039         case 1:
2040         case 0:
2041             if (Antimagic)
2042                 shieldeff(u.ux, u.uy);
2043 /*JP
2044             pline("Lucky for you, it didn't work!");
2045 */
2046             pline("\89^\82Ì\82æ\82¢\82±\82Æ\82É\82È\82ñ\82Æ\82à\82È\82©\82Á\82½\81I");
2047             dmg = 0;
2048             break;
2049         }
2050         break;
2051     case AD_PEST:
2052 /*JP
2053         pline("%s reaches out, and you feel fever and chills.", Monnam(mtmp));
2054 */
2055         pline("%s\82Í\98r\82ð\82Ì\82Î\82µ\82½\81C\82 \82È\82½\82Í\88«\8a¦\82ð\8a´\82\82½\81D", Monnam(mtmp));
2056         (void) diseasemu(mdat); /* plus the normal damage */
2057         break;
2058     case AD_FAMN:
2059 /*JP
2060         pline("%s reaches out, and your body shrivels.", Monnam(mtmp));
2061 */
2062         pline("%s\82Í\98r\82ð\90L\82Î\82µ\82½\81C\82 \82È\82½\82Ì\91Ì\82Í\82µ\82È\82Ñ\82½\81D", Monnam(mtmp));
2063         exercise(A_CON, FALSE);
2064         if (!is_fainted())
2065             morehungry(rn1(40, 40));
2066         /* plus the normal damage */
2067         break;
2068     case AD_SLIM:
2069         hitmsg(mtmp, mattk);
2070         if (!uncancelled)
2071             break;
2072         if (flaming(youmonst.data)) {
2073 /*JP
2074             pline_The("slime burns away!");
2075 */
2076             pline_The("\83X\83\89\83C\83\80\82Í\94R\82¦\82½\81I");
2077             dmg = 0;
2078         } else if (Unchanging || noncorporeal(youmonst.data)
2079                    || youmonst.data == &mons[PM_GREEN_SLIME]) {
2080 /*JP
2081             You("are unaffected.");
2082 */
2083             You("\89e\8b¿\82ð\8eó\82¯\82È\82¢\81D");
2084             dmg = 0;
2085         } else if (!Slimed) {
2086 /*JP
2087             You("don't feel very well.");
2088 */
2089             You("\8bC\95ª\82ª\88«\82¢\81D");
2090             make_slimed(10L, (char *) 0);
2091             delayed_killer(SLIMED, KILLED_BY_AN, mtmp->data->mname);
2092         } else
2093 /*JP
2094             pline("Yuck!");
2095 */
2096             pline("\83E\83Q\83F\81[\81I");
2097         break;
2098     case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */
2099         hitmsg(mtmp, mattk);
2100         /* uncancelled is sufficient enough; please
2101            don't make this attack less frequent */
2102         if (uncancelled) {
2103             struct obj *obj = some_armor(&youmonst);
2104
2105             if (!obj) {
2106                 /* some rings are susceptible;
2107                    amulets and blindfolds aren't (at present) */
2108                 switch (rn2(5)) {
2109                 case 0:
2110                     break;
2111                 case 1:
2112                     obj = uright;
2113                     break;
2114                 case 2:
2115                     obj = uleft;
2116                     break;
2117                 case 3:
2118                     obj = uamul;
2119                     break;
2120                 case 4:
2121                     obj = ublindf;
2122                     break;
2123                 }
2124             }
2125             if (drain_item(obj, FALSE)) {
2126 /*JP
2127                 pline("%s less effective.", Yobjnam2(obj, "seem"));
2128 */
2129                 Your("%s\82©\82ç\96\82\97Í\82ª\8fÁ\82¦\82½\82æ\82¤\82¾\81D", xname(obj));
2130             }
2131         }
2132         break;
2133     default:
2134         dmg = 0;
2135         break;
2136     }
2137     if ((Upolyd ? u.mh : u.uhp) < 1) {
2138         /* already dead? call rehumanize() or done_in_by() as appropriate */
2139         mdamageu(mtmp, 1);
2140         dmg = 0;
2141     }
2142
2143     /*  Negative armor class reduces damage done instead of fully protecting
2144      *  against hits.
2145      */
2146     if (dmg && u.uac < 0) {
2147         dmg -= rnd(-u.uac);
2148         if (dmg < 1)
2149             dmg = 1;
2150     }
2151
2152     if (dmg) {
2153         if (Half_physical_damage
2154             /* Mitre of Holiness */
2155             || (Role_if(PM_PRIEST) && uarmh && is_quest_artifact(uarmh)
2156                 && (is_undead(mtmp->data) || is_demon(mtmp->data)
2157                     || is_vampshifter(mtmp))))
2158             dmg = (dmg + 1) / 2;
2159
2160         if (permdmg) { /* Death's life force drain */
2161             int lowerlimit, *hpmax_p;
2162             /*
2163              * Apply some of the damage to permanent hit points:
2164              *  polymorphed         100% against poly'd hpmax
2165              *  hpmax > 25*lvl      100% against normal hpmax
2166              *  hpmax > 10*lvl  50..100%
2167              *  hpmax >  5*lvl  25..75%
2168              *  otherwise        0..50%
2169              * Never reduces hpmax below 1 hit point per level.
2170              */
2171             permdmg = rn2(dmg / 2 + 1);
2172             if (Upolyd || u.uhpmax > 25 * u.ulevel)
2173                 permdmg = dmg;
2174             else if (u.uhpmax > 10 * u.ulevel)
2175                 permdmg += dmg / 2;
2176             else if (u.uhpmax > 5 * u.ulevel)
2177                 permdmg += dmg / 4;
2178
2179             if (Upolyd) {
2180                 hpmax_p = &u.mhmax;
2181                 /* [can't use youmonst.m_lev] */
2182                 lowerlimit = min((int) youmonst.data->mlevel, u.ulevel);
2183             } else {
2184                 hpmax_p = &u.uhpmax;
2185                 lowerlimit = u.ulevel;
2186             }
2187             if (*hpmax_p - permdmg > lowerlimit)
2188                 *hpmax_p -= permdmg;
2189             else if (*hpmax_p > lowerlimit)
2190                 *hpmax_p = lowerlimit;
2191             /* else unlikely...
2192              * already at or below minimum threshold; do nothing */
2193             context.botl = 1;
2194         }
2195
2196         mdamageu(mtmp, dmg);
2197     }
2198
2199     if (dmg)
2200         res = passiveum(olduasmon, mtmp, mattk);
2201     else
2202         res = 1;
2203     stop_occupation();
2204     return res;
2205 }
2206
2207 /* An interface for use when taking a blindfold off, for example,
2208  * to see if an engulfing attack should immediately take affect, like
2209  * a passive attack. TRUE if engulfing blindness occurred */
2210 boolean
2211 gulp_blnd_check()
2212 {
2213     struct attack *mattk;
2214
2215     if (!Blinded && u.uswallow
2216         && (mattk = attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND))
2217         && can_blnd(u.ustuck, &youmonst, mattk->aatyp, (struct obj *) 0)) {
2218         ++u.uswldtim; /* compensate for gulpmu change */
2219         (void) gulpmu(u.ustuck, mattk);
2220         return TRUE;
2221     }
2222     return FALSE;
2223 }
2224
2225 /* monster swallows you, or damage if u.uswallow */
2226 STATIC_OVL int
2227 gulpmu(mtmp, mattk)
2228 struct monst *mtmp;
2229 struct attack *mattk;
2230 {
2231     struct trap *t = t_at(u.ux, u.uy);
2232     int tmp = d((int) mattk->damn, (int) mattk->damd);
2233     int tim_tmp;
2234     struct obj *otmp2;
2235     int i;
2236     boolean physical_damage = FALSE;
2237
2238     if (!u.uswallow) { /* swallows you */
2239         int omx = mtmp->mx, omy = mtmp->my;
2240
2241         if (!engulf_target(mtmp, &youmonst))
2242             return 0;
2243         if ((t && ((t->ttyp == PIT) || (t->ttyp == SPIKED_PIT)))
2244             && sobj_at(BOULDER, u.ux, u.uy))
2245             return 0;
2246
2247         if (Punished)
2248             unplacebc(); /* ball&chain go away */
2249         remove_monster(omx, omy);
2250         mtmp->mtrapped = 0; /* no longer on old trap */
2251         place_monster(mtmp, u.ux, u.uy);
2252         u.ustuck = mtmp;
2253         newsym(mtmp->mx, mtmp->my);
2254         if (is_animal(mtmp->data) && u.usteed) {
2255             char buf[BUFSZ];
2256
2257             /* Too many quirks presently if hero and steed
2258              * are swallowed. Pretend purple worms don't
2259              * like horses for now :-)
2260              */
2261             Strcpy(buf, mon_nam(u.usteed));
2262 #if 0 /*JP*/
2263             pline("%s lunges forward and plucks you off %s!", Monnam(mtmp),
2264                   buf);
2265 #else
2266             pline("%s\82Í\93Ë\90i\82µ\82 \82È\82½\82ð%s\82©\82ç\88ø\82«\97\8e\82µ\82½\81I", Monnam(mtmp),
2267                   buf);
2268 #endif
2269             dismount_steed(DISMOUNT_ENGULFED);
2270         } else
2271 /*JP
2272             pline("%s engulfs you!", Monnam(mtmp));
2273 */
2274             pline("%s\82Í\82 \82È\82½\82ð\88ù\82Ý\82±\82ñ\82¾\81I", Monnam(mtmp));
2275         stop_occupation();
2276         reset_occupations(); /* behave as if you had moved */
2277
2278         if (u.utrap) {
2279 #if 0 /*JP:T*/
2280             You("are released from the %s!",
2281                 u.utraptype == TT_WEB ? "web" : "trap");
2282 #else
2283             You("%s\82©\82ç\89ð\95ú\82³\82ê\82½\81I",
2284                 u.utraptype == TT_WEB ? "\82­\82à\82Ì\91\83" : "ã©");
2285 #endif
2286             u.utrap = 0;
2287         }
2288
2289         i = number_leashed();
2290         if (i > 0) {
2291 #if 0 /*JP*/
2292             const char *s = (i > 1) ? "leashes" : "leash";
2293
2294             pline_The("%s %s loose.", s, vtense(s, "snap"));
2295 #else
2296             pline("\95R\82Í\83p\83`\83\93\82Æ\82Í\82¸\82ê\82½\81D");
2297 #endif
2298             unleash_all();
2299         }
2300
2301         if (touch_petrifies(youmonst.data) && !resists_ston(mtmp)) {
2302             /* put the attacker back where it started;
2303                the resulting statue will end up there */
2304             remove_monster(mtmp->mx, mtmp->my); /* u.ux,u.uy */
2305             place_monster(mtmp, omx, omy);
2306             minstapetrify(mtmp, TRUE);
2307             /* normally unstuck() would do this, but we're not
2308                fully swallowed yet so that won't work here */
2309             if (Punished)
2310                 placebc();
2311             u.ustuck = 0;
2312             return (mtmp->mhp > 0) ? 0 : 2;
2313         }
2314
2315         display_nhwindow(WIN_MESSAGE, FALSE);
2316         vision_recalc(2); /* hero can't see anything */
2317         u.uswallow = 1;
2318         /* for digestion, shorter time is more dangerous;
2319            for other swallowings, longer time means more
2320            chances for the swallower to attack */
2321         if (mattk->adtyp == AD_DGST) {
2322             tim_tmp = 25 - (int) mtmp->m_lev;
2323             if (tim_tmp > 0)
2324                 tim_tmp = rnd(tim_tmp) / 2;
2325             else if (tim_tmp < 0)
2326                 tim_tmp = -(rnd(-tim_tmp) / 2);
2327             /* having good armor & high constitution makes
2328                it take longer for you to be digested, but
2329                you'll end up trapped inside for longer too */
2330             tim_tmp += -u.uac + 10 + (ACURR(A_CON) / 3 - 1);
2331         } else {
2332             /* higher level attacker takes longer to eject hero */
2333             tim_tmp = rnd((int) mtmp->m_lev + 10 / 2);
2334         }
2335         /* u.uswldtim always set > 1 */
2336         u.uswldtim = (unsigned) ((tim_tmp < 2) ? 2 : tim_tmp);
2337         swallowed(1);
2338         for (otmp2 = invent; otmp2; otmp2 = otmp2->nobj)
2339             (void) snuff_lit(otmp2);
2340     }
2341
2342     if (mtmp != u.ustuck)
2343         return 0;
2344     if (u.uswldtim > 0)
2345         u.uswldtim -= 1;
2346
2347     switch (mattk->adtyp) {
2348     case AD_DGST:
2349         physical_damage = TRUE;
2350         if (Slow_digestion) {
2351             /* Messages are handled below */
2352             u.uswldtim = 0;
2353             tmp = 0;
2354         } else if (u.uswldtim == 0) {
2355 /*JP
2356             pline("%s totally digests you!", Monnam(mtmp));
2357 */
2358             pline("%s\82Í\82 \82È\82½\82ð\8a®\91S\82É\8fÁ\89»\82µ\82½\81I", Monnam(mtmp));
2359             tmp = u.uhp;
2360             if (Half_physical_damage)
2361                 tmp *= 2; /* sorry */
2362         } else {
2363 #if 0 /*JP*/
2364             pline("%s%s digests you!", Monnam(mtmp),
2365                   (u.uswldtim == 2) ? " thoroughly"
2366                                     : (u.uswldtim == 1) ? " utterly" : "");
2367 #else
2368             pline("%s\82Í\82 \82È\82½\82ð%s\8fÁ\89»\82µ\82Ä\82¢\82é\81I", Monnam(mtmp),
2369                   (u.uswldtim == 2) ? "\93O\92ê\93I\82É"
2370                                     : (u.uswldtim == 1) ? "\8a®\91S\82É" : "");
2371 #endif
2372             exercise(A_STR, FALSE);
2373         }
2374         break;
2375     case AD_PHYS:
2376         physical_damage = TRUE;
2377         if (mtmp->data == &mons[PM_FOG_CLOUD]) {
2378 #if 0 /*JP*/
2379             You("are laden with moisture and %s",
2380                 flaming(youmonst.data)
2381                     ? "are smoldering out!"
2382                     : Breathless ? "find it mildly uncomfortable."
2383                                  : amphibious(youmonst.data)
2384                                        ? "feel comforted."
2385                                        : "can barely breathe!");
2386 #else
2387             You("\8e¼\8bC\82É\8bê\82µ\82ß\82ç\82ê\81C%s",
2388                 flaming(youmonst.data)
2389                     ? "\82­\82·\82Ô\82Á\82½\81I"
2390                     : Breathless ? "\8f­\81X\95s\89õ\82É\8a´\82\82½\81D"
2391                                  : amphibious(youmonst.data)
2392                                        ? "\88À\82ç\82¬\82ð\8a´\82\82½\81D"
2393                                        : "\91§\82ð\82·\82é\82Ì\82ª\82â\82Á\82Æ\82¾\81I");
2394 #endif
2395             /* NB: Amphibious includes Breathless */
2396             if (Amphibious && !flaming(youmonst.data))
2397                 tmp = 0;
2398         } else {
2399 /*JP
2400             You("are pummeled with debris!");
2401 */
2402             You("\8a¢âI\82Å\92É\82ß\82Â\82¯\82ç\82ê\82½\81I");
2403             exercise(A_STR, FALSE);
2404         }
2405         break;
2406     case AD_ACID:
2407         if (Acid_resistance) {
2408 /*JP
2409             You("are covered with a seemingly harmless goo.");
2410 */
2411             You("\96³\8aQ\82Á\82Û\82¢\82Ë\82Î\82Â\82­\82à\82Ì\82Å\82¨\82¨\82í\82ê\82½\81D");
2412             tmp = 0;
2413         } else {
2414             if (Hallucination)
2415 /*JP
2416                 pline("Ouch!  You've been slimed!");
2417 */
2418                 pline("\82°\82°\82ñ\81I\82 \82È\82½\82Í\82Ê\82é\82Ê\82é\82¾\81I");
2419             else
2420 /*JP
2421                 You("are covered in slime!  It burns!");
2422 */
2423                 You("\82×\82Æ\82×\82Æ\82É\82È\82Á\82½\81D\82»\82µ\82Ä\8e_\82É\8fÄ\82©\82ê\82½\81I");
2424             exercise(A_STR, FALSE);
2425         }
2426         break;
2427     case AD_BLND:
2428         if (can_blnd(mtmp, &youmonst, mattk->aatyp, (struct obj *) 0)) {
2429             if (!Blind) {
2430                 long was_blinded = Blinded;
2431                 if (!Blinded)
2432 /*JP
2433                     You_cant("see in here!");
2434 */
2435                     You("\89½\82à\8c©\82¦\82È\82¢\81I");
2436                 make_blinded((long) tmp, FALSE);
2437                 if (!was_blinded && !Blind)
2438                     Your1(vision_clears);
2439             } else
2440                 /* keep him blind until disgorged */
2441                 make_blinded(Blinded + 1, FALSE);
2442         }
2443         tmp = 0;
2444         break;
2445     case AD_ELEC:
2446         if (!mtmp->mcan && rn2(2)) {
2447 /*JP
2448             pline_The("air around you crackles with electricity.");
2449 */
2450             pline("\82 \82È\82½\82Ì\89ñ\82è\82Ì\8bó\8bC\82Í\93d\8bC\82Å\83s\83\8a\83s\83\8a\82µ\82Ä\82¢\82é\81D");
2451             if (Shock_resistance) {
2452                 shieldeff(u.ux, u.uy);
2453 /*JP
2454                 You("seem unhurt.");
2455 */
2456                 You("\8f\9d\82Â\82©\82È\82¢\82æ\82¤\82¾\81D");
2457                 ugolemeffects(AD_ELEC, tmp);
2458                 tmp = 0;
2459             }
2460         } else
2461             tmp = 0;
2462         break;
2463     case AD_COLD:
2464         if (!mtmp->mcan && rn2(2)) {
2465             if (Cold_resistance) {
2466                 shieldeff(u.ux, u.uy);
2467 /*JP
2468                 You_feel("mildly chilly.");
2469 */
2470                 pline("\82Ð\82ñ\82â\82è\82µ\82½\81D");
2471                 ugolemeffects(AD_COLD, tmp);
2472                 tmp = 0;
2473             } else
2474 /*JP
2475                 You("are freezing to death!");
2476 */
2477                 You("\93\80\8e\80\82µ\82»\82¤\82¾\81I");
2478         } else
2479             tmp = 0;
2480         break;
2481     case AD_FIRE:
2482         if (!mtmp->mcan && rn2(2)) {
2483             if (Fire_resistance) {
2484                 shieldeff(u.ux, u.uy);
2485 /*JP
2486                 You_feel("mildly hot.");
2487 */
2488                 pline("\83|\83J\83|\83J\82µ\82½\81D");
2489                 ugolemeffects(AD_FIRE, tmp);
2490                 tmp = 0;
2491             } else
2492 /*JP
2493                 You("are burning to a crisp!");
2494 */
2495                 You("\94R\82¦\82Ä\83J\83\89\83J\83\89\82É\82È\82Á\82½\81I");
2496             burn_away_slime();
2497         } else
2498             tmp = 0;
2499         break;
2500     case AD_DISE:
2501         if (!diseasemu(mtmp->data))
2502             tmp = 0;
2503         break;
2504     case AD_DREN:
2505         /* AC magic cancellation doesn't help when engulfed */
2506         if (!mtmp->mcan && rn2(4)) /* 75% chance */
2507             drain_en(tmp);
2508         tmp = 0;
2509         break;
2510     default:
2511         physical_damage = TRUE;
2512         tmp = 0;
2513         break;
2514     }
2515
2516     if (physical_damage)
2517         tmp = Maybe_Half_Phys(tmp);
2518
2519     mdamageu(mtmp, tmp);
2520     if (tmp)
2521         stop_occupation();
2522
2523     if (touch_petrifies(youmonst.data) && !resists_ston(mtmp)) {
2524 #if 0 /*JP*/
2525         pline("%s very hurriedly %s you!", Monnam(mtmp),
2526               is_animal(mtmp->data) ? "regurgitates" : "expels");
2527 #else
2528         pline("%s\82Í\8dQ\82Ä\82Ä\82 \82È\82½\82ð%s\82µ\82½\81I", Monnam(mtmp),
2529               is_animal(mtmp->data)? "\93f\82«\96ß" : "\94r\8fo");
2530 #endif
2531         expels(mtmp, mtmp->data, FALSE);
2532     } else if (!u.uswldtim || youmonst.data->msize >= MZ_HUGE) {
2533 /*JP
2534         You("get %s!", is_animal(mtmp->data) ? "regurgitated" : "expelled");
2535 */
2536         You("%s\82³\82ê\82½\81I", is_animal(mtmp->data)? "\93f\82«\96ß" : "\94r\8fo");
2537         if (flags.verbose
2538             && (is_animal(mtmp->data)
2539                 || (dmgtype(mtmp->data, AD_DGST) && Slow_digestion)))
2540 /*JP
2541             pline("Obviously %s doesn't like your taste.", mon_nam(mtmp));
2542 */
2543             You("\82Ç\82¤\82à%s\8dD\82Ý\82Ì\96¡\82\82á\82È\82¢\82æ\82¤\82¾\81D", mon_nam(mtmp));
2544         expels(mtmp, mtmp->data, FALSE);
2545     }
2546     return 1;
2547 }
2548
2549 /* monster explodes in your face */
2550 STATIC_OVL int
2551 explmu(mtmp, mattk, ufound)
2552 struct monst *mtmp;
2553 struct attack *mattk;
2554 boolean ufound;
2555 {
2556     boolean physical_damage = TRUE, kill_agr = TRUE;
2557
2558     if (mtmp->mcan)
2559         return 0;
2560
2561     if (!ufound)
2562 #if 0 /*JP*/
2563         pline("%s explodes at a spot in %s!",
2564               canseemon(mtmp) ? Monnam(mtmp) : "It",
2565               levl[mtmp->mux][mtmp->muy].typ == WATER ? "empty water"
2566                                                       : "thin air");
2567 #else
2568         pline("%s\82Í\89½\82à\82È\82¢%s\82Å\94\9a\94­\82µ\82½\81I",
2569               canseemon(mtmp) ? Monnam(mtmp) : "\89½\8eÒ\82©",
2570               levl[mtmp->mux][mtmp->muy].typ == WATER ? "\90\85\92\86"
2571                                                       : "\8bó\8aÔ");
2572 #endif
2573     else {
2574         int tmp = d((int) mattk->damn, (int) mattk->damd);
2575         boolean not_affected = defends((int) mattk->adtyp, uwep);
2576
2577         hitmsg(mtmp, mattk);
2578
2579         switch (mattk->adtyp) {
2580         case AD_COLD:
2581             physical_damage = FALSE;
2582             not_affected |= Cold_resistance;
2583             goto common;
2584         case AD_FIRE:
2585             physical_damage = FALSE;
2586             not_affected |= Fire_resistance;
2587             goto common;
2588         case AD_ELEC:
2589             physical_damage = FALSE;
2590             not_affected |= Shock_resistance;
2591         common:
2592
2593             if (!not_affected) {
2594                 if (ACURR(A_DEX) > rnd(20)) {
2595 /*JP
2596                     You("duck some of the blast.");
2597 */
2598                     You("\8fÕ\8c\82\82ð\82³\82¯\82½\81D");
2599                     tmp = (tmp + 1) / 2;
2600                 } else {
2601                     if (flags.verbose)
2602 /*JP
2603                         You("get blasted!");
2604 */
2605                         You("\8fÕ\8c\82\82ð\82­\82ç\82Á\82½\81I");
2606                 }
2607                 if (mattk->adtyp == AD_FIRE)
2608                     burn_away_slime();
2609                 if (physical_damage)
2610                     tmp = Maybe_Half_Phys(tmp);
2611                 mdamageu(mtmp, tmp);
2612             }
2613             break;
2614
2615         case AD_BLND:
2616             not_affected = resists_blnd(&youmonst);
2617             if (!not_affected) {
2618                 /* sometimes you're affected even if it's invisible */
2619                 if (mon_visible(mtmp) || (rnd(tmp /= 2) > u.ulevel)) {
2620 /*JP
2621                     You("are blinded by a blast of light!");
2622 */
2623                     You("\82Ü\82Î\82ä\82¢\8cõ\82É\96Ú\82ª\82­\82ç\82ñ\82¾\81I");
2624                     make_blinded((long) tmp, FALSE);
2625                     if (!Blind)
2626                         Your1(vision_clears);
2627                 } else if (flags.verbose)
2628 /*JP
2629                     You("get the impression it was not terribly bright.");
2630 */
2631                     You("\82»\82ê\82Í\8b°\82ë\82µ\82­\82Ü\82Ô\82µ\82¢\82Æ\82¢\82¤\82Ù\82Ç\82\82á\82È\82¢\82Æ\8ev\82Á\82½\81D");
2632             }
2633             break;
2634
2635         case AD_HALU:
2636             not_affected |= Blind || (u.umonnum == PM_BLACK_LIGHT
2637                                       || u.umonnum == PM_VIOLET_FUNGUS
2638                                       || dmgtype(youmonst.data, AD_STUN));
2639             if (!not_affected) {
2640                 boolean chg;
2641                 if (!Hallucination)
2642 /*JP
2643                     You("are caught in a blast of kaleidoscopic light!");
2644 */
2645                     You("\96\9c\89Ø\8b¾\82Ì\8cõ\82É\95ß\82ç\82¦\82ç\82ê\82½\81I");
2646                 /* avoid hallucinating the black light as it dies */
2647                 mondead(mtmp);    /* remove it from map now */
2648                 kill_agr = FALSE; /* already killed (maybe lifesaved) */
2649                 chg =
2650                     make_hallucinated(HHallucination + (long) tmp, FALSE, 0L);
2651 /*JP
2652                 You("%s.", chg ? "are freaked out" : "seem unaffected");
2653 */
2654                 You("%s\81D", chg ? "\90\8c\82¢\82µ\82ê\82½" : "\89e\8b¿\82ð\8eó\82¯\82È\82©\82Á\82½");
2655             }
2656             break;
2657
2658         default:
2659             break;
2660         }
2661         if (not_affected) {
2662 /*JP
2663             You("seem unaffected by it.");
2664 */
2665             You("\89e\8b¿\82ð\8eó\82¯\82È\82¢\82æ\82¤\82¾\81D");
2666             ugolemeffects((int) mattk->adtyp, tmp);
2667         }
2668     }
2669     if (kill_agr)
2670         mondead(mtmp);
2671     wake_nearto(mtmp->mx, mtmp->my, 7 * 7);
2672     return (mtmp->mhp > 0) ? 0 : 2;
2673 }
2674
2675 /* monster gazes at you */
2676 int
2677 gazemu(mtmp, mattk)
2678 struct monst *mtmp;
2679 struct attack *mattk;
2680 {
2681     static const char *const reactions[] = {
2682 #if 0 /*JP*/
2683         "confused",              /* [0] */
2684         "stunned",               /* [1] */
2685         "puzzled",   "dazzled",  /* [2,3] */
2686         "irritated", "inflamed", /* [4,5] */
2687         "tired",                 /* [6] */
2688         "dulled",                /* [7] */
2689 #else
2690         "\8d¬\97\90\82µ\82½",                 /* [0] */
2691         "\9eN\9eO\82Æ\82µ\82½",               /* [1] */
2692         "\8d¢\98f\82µ\82½",   "\8c\98f\82³\82ê\82½", /* [2,3] */
2693         "\83C\83\89\83C\83\89\82µ\82½", "\8b»\95±\82µ\82½", /* [4,5] */
2694         "\94æ\82ê\82½",                   /* [6] */
2695         "\82Ú\82ñ\82â\82è\82µ\82½",             /* [7] */
2696 #endif
2697     };
2698     int react = -1;
2699     boolean cancelled = (mtmp->mcan != 0), already = FALSE;
2700
2701     /* assumes that hero has to see monster's gaze in order to be
2702        affected, rather than monster just having to look at hero;
2703        when hallucinating, hero's brain doesn't register what
2704        it's seeing correctly so the gaze is usually ineffective
2705        [this could be taken a lot farther and select a gaze effect
2706        appropriate to what's currently being displayed, giving
2707        ordinary monsters a gaze attack when hero thinks he or she
2708        is facing a gazing creature, but let's not go that far...] */
2709     if (Hallucination && rn2(4))
2710         cancelled = TRUE;
2711
2712     switch (mattk->adtyp) {
2713     case AD_STON:
2714         if (cancelled || !mtmp->mcansee) {
2715             if (!canseemon(mtmp))
2716                 break; /* silently */
2717 #if 0 /*JP*/
2718             pline("%s %s.", Monnam(mtmp),
2719                   (mtmp->data == &mons[PM_MEDUSA] && mtmp->mcan)
2720                       ? "doesn't look all that ugly"
2721                       : "gazes ineffectually");
2722 #else
2723             pline("%s\82Í%s\81D", Monnam(mtmp),
2724                   (mtmp->data == &mons[PM_MEDUSA] && mtmp->mcan)
2725                       ? "\82»\82ê\82Ù\82Ç\8fX\82­\82È\82¢\82±\82Æ\82É\8bC\82ª\82Â\82¢\82½"
2726                       : "\96³\88Ó\96¡\82É\82É\82ç\82ñ\82¾");
2727 #endif
2728             break;
2729         }
2730         if (Reflecting && couldsee(mtmp->mx, mtmp->my)
2731             && mtmp->data == &mons[PM_MEDUSA]) {
2732             /* hero has line of sight to Medusa and she's not blind */
2733             boolean useeit = canseemon(mtmp);
2734
2735             if (useeit)
2736 #if 0 /*JP:T*/
2737                 (void) ureflects("%s gaze is reflected by your %s.",
2738                                  s_suffix(Monnam(mtmp)));
2739 #else
2740                 (void) ureflects("%s\82Ì\82É\82ç\82Ý\82Í%s\82Å\94½\8eË\82³\82ê\82½\81D",
2741                                  Monnam(mtmp));
2742 #endif
2743             if (mon_reflects(
2744                     mtmp, !useeit ? (char *) 0
2745 /*JP
2746                                   : "The gaze is reflected away by %s %s!"))
2747 */
2748                                   : "\82É\82ç\82Ý\82Í%s\82Ì%s\82É\82æ\82Á\82Ä\94½\8eË\82³\82ê\82½\81I"))
2749                 break;
2750             if (!m_canseeu(mtmp)) { /* probably you're invisible */
2751                 if (useeit)
2752 #if 0 /*JP*/
2753                     pline(
2754                       "%s doesn't seem to notice that %s gaze was reflected.",
2755                           Monnam(mtmp), mhis(mtmp));
2756 #else
2757                     pline("\82É\82ç\82Ý\82ª\94½\8eË\82µ\82Ä\82¢\82é\82±\82Æ\82É%s\82Í\8bC\95t\82¢\82Ä\82¢\82È\82¢\82æ\82¤\82¾\81D",
2758                           Monnam(mtmp));
2759 #endif
2760                 break;
2761             }
2762             if (useeit)
2763 /*JP
2764                 pline("%s is turned to stone!", Monnam(mtmp));
2765 */
2766                 pline("%s\82Í\90Î\82É\82È\82Á\82½\81I", Monnam(mtmp));
2767             stoned = TRUE;
2768             killed(mtmp);
2769
2770             if (mtmp->mhp > 0)
2771                 break;
2772             return 2;
2773         }
2774         if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my)
2775             && !Stone_resistance) {
2776 /*JP
2777             You("meet %s gaze.", s_suffix(mon_nam(mtmp)));
2778 */
2779             You("%s\82É\82É\82ç\82Ü\82ê\82½\81D", mon_nam(mtmp));
2780             stop_occupation();
2781             if (poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))
2782                 break;
2783 /*JP
2784             You("turn to stone...");
2785 */
2786             You("\90Î\82É\82È\82Á\82½\81D\81D\81D");
2787             killer.format = KILLED_BY;
2788             Strcpy(killer.name, mtmp->data->mname);
2789             done(STONING);
2790         }
2791         break;
2792     case AD_CONF:
2793         if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
2794             && !mtmp->mspec_used && rn2(5)) {
2795             if (cancelled) {
2796                 react = 0; /* "confused" */
2797                 already = (mtmp->mconf != 0);
2798             } else {
2799                 int conf = d(3, 4);
2800
2801                 mtmp->mspec_used = mtmp->mspec_used + (conf + rn2(6));
2802                 if (!Confusion)
2803 /*JP
2804                     pline("%s gaze confuses you!", s_suffix(Monnam(mtmp)));
2805 */
2806                     pline("%s\82Ì\82É\82ç\82Ý\82Å\82 \82È\82½\82Í\8d¬\97\90\82µ\82½\81I", Monnam(mtmp));
2807                 else
2808 /*JP
2809                     You("are getting more and more confused.");
2810 */
2811                     You("\82Ü\82·\82Ü\82·\8d¬\97\90\82µ\82½\81D");
2812                 make_confused(HConfusion + conf, FALSE);
2813                 stop_occupation();
2814             }
2815         }
2816         break;
2817     case AD_STUN:
2818         if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
2819             && !mtmp->mspec_used && rn2(5)) {
2820             if (cancelled) {
2821                 react = 1; /* "stunned" */
2822                 already = (mtmp->mstun != 0);
2823             } else {
2824                 int stun = d(2, 6);
2825
2826                 mtmp->mspec_used = mtmp->mspec_used + (stun + rn2(6));
2827 /*JP
2828                 pline("%s stares piercingly at you!", Monnam(mtmp));
2829 */
2830                 pline("%s\82Í\97â\82½\82¢\82Ü\82È\82´\82µ\82ð\82 \82È\82½\82É\8cü\82¯\82½\81I", Monnam(mtmp));
2831                 make_stunned((HStun & TIMEOUT) + (long) stun, TRUE);
2832                 stop_occupation();
2833             }
2834         }
2835         break;
2836     case AD_BLND:
2837         if (canseemon(mtmp) && !resists_blnd(&youmonst)
2838             && distu(mtmp->mx, mtmp->my) <= BOLT_LIM * BOLT_LIM) {
2839             if (cancelled) {
2840                 react = rn1(2, 2); /* "puzzled" || "dazzled" */
2841                 already = (mtmp->mcansee == 0);
2842                 /* Archons gaze every round; we don't want cancelled ones
2843                    giving the "seems puzzled/dazzled" message that often */
2844                 if (mtmp->mcan && mtmp->data == &mons[PM_ARCHON] && rn2(5))
2845                     react = -1;
2846             } else {
2847                 int blnd = d((int) mattk->damn, (int) mattk->damd);
2848
2849 /*JP
2850                 You("are blinded by %s radiance!", s_suffix(mon_nam(mtmp)));
2851 */
2852                 You("%s\82Ì\8cõ\82Å\96Ú\82ª\8c©\82¦\82È\82­\82È\82Á\82½\81I", mon_nam(mtmp));
2853                 make_blinded((long) blnd, FALSE);
2854                 stop_occupation();
2855                 /* not blind at this point implies you're wearing
2856                    the Eyes of the Overworld; make them block this
2857                    particular stun attack too */
2858                 if (!Blind) {
2859                     Your1(vision_clears);
2860                 } else {
2861                     long oldstun = (HStun & TIMEOUT), newstun = (long) rnd(3);
2862
2863                     /* we don't want to increment stun duration every time
2864                        or sighted hero will become incapacitated */
2865                     make_stunned(max(oldstun, newstun), TRUE);
2866                 }
2867             }
2868         }
2869         break;
2870     case AD_FIRE:
2871         if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
2872             && !mtmp->mspec_used && rn2(5)) {
2873             if (cancelled) {
2874                 react = rn1(2, 4); /* "irritated" || "inflamed" */
2875             } else {
2876                 int dmg = d(2, 6), lev = (int) mtmp->m_lev;
2877
2878 /*JP
2879                 pline("%s attacks you with a fiery gaze!", Monnam(mtmp));
2880 */
2881                 pline("%s\82Í\89\8a\82Ì\82É\82ç\82Ý\8dU\8c\82\82ð\82µ\82Ä\82«\82½\81I", Monnam(mtmp));
2882                 stop_occupation();
2883                 if (Fire_resistance) {
2884 /*JP
2885                     pline_The("fire doesn't feel hot!");
2886 */
2887                     pline("\89Î\82Í\82º\82ñ\82º\82ñ\94M\82­\82È\82¢\81I");
2888                     dmg = 0;
2889                 }
2890                 burn_away_slime();
2891                 if (lev > rn2(20))
2892                     destroy_item(SCROLL_CLASS, AD_FIRE);
2893                 if (lev > rn2(20))
2894                     destroy_item(POTION_CLASS, AD_FIRE);
2895                 if (lev > rn2(25))
2896                     destroy_item(SPBOOK_CLASS, AD_FIRE);
2897                 if (dmg)
2898                     mdamageu(mtmp, dmg);
2899             }
2900         }
2901         break;
2902 #ifdef PM_BEHOLDER /* work in progress */
2903     case AD_SLEE:
2904         if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
2905             && multi >= 0 && !rn2(5) && !Sleep_resistance) {
2906             if (cancelled) {
2907                 react = 6;                      /* "tired" */
2908                 already = (mtmp->mfrozen != 0); /* can't happen... */
2909             } else {
2910                 fall_asleep(-rnd(10), TRUE);
2911 #if 0 /*JP:T*/
2912                 pline("%s gaze makes you very sleepy...",
2913                       s_suffix(Monnam(mtmp)));
2914 #else
2915                 pline("%s\82Ì\82É\82ç\82Ý\82Å\82 \82È\82½\82Í\96°\82­\82È\82Á\82½\81D\81D\81D",
2916                       Monnam(mtmp));
2917 #endif
2918             }
2919         }
2920         break;
2921     case AD_SLOW:
2922         if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
2923             && (HFast & (INTRINSIC | TIMEOUT)) && !defends(AD_SLOW, uwep)
2924             && !rn2(4)) {
2925             if (cancelled) {
2926                 react = 7; /* "dulled" */
2927                 already = (mtmp->mspeed == MSLOW);
2928             } else {
2929                 u_slow_down();
2930                 stop_occupation();
2931             }
2932         }
2933         break;
2934 #endif /* BEHOLDER */
2935     default:
2936         impossible("Gaze attack %d?", mattk->adtyp);
2937         break;
2938     }
2939     if (react >= 0) {
2940         if (Hallucination && rn2(3))
2941             react = rn2(SIZE(reactions));
2942         /* cancelled/hallucinatory feedback; monster might look "confused",
2943            "stunned",&c but we don't actually set corresponding attribute */
2944 #if 0 /*JP*/
2945         pline("%s looks %s%s.", Monnam(mtmp),
2946               !rn2(3) ? "" : already ? "quite "
2947                                      : (!rn2(2) ? "a bit " : "somewhat "),
2948               reactions[react]);
2949 #else
2950         pline("%s\82Í%s%s\82æ\82¤\82¾\81D", Monnam(mtmp),
2951               !rn2(3) ? "" : already ? "\82©\82È\82è"
2952                                      : (!rn2(2) ? "\8f­\82µ" : "\82¢\82­\82ç\82©"),
2953               reactions[react]);
2954 #endif
2955     }
2956     return 0;
2957 }
2958
2959 /* mtmp hits you for n points damage */
2960 void
2961 mdamageu(mtmp, n)
2962 struct monst *mtmp;
2963 int n;
2964 {
2965     context.botl = 1;
2966     if (Upolyd) {
2967         u.mh -= n;
2968         if (u.mh < 1)
2969             rehumanize();
2970     } else {
2971         u.uhp -= n;
2972         if (u.uhp < 1)
2973             done_in_by(mtmp, DIED);
2974     }
2975 }
2976
2977 /* returns 0 if seduction impossible,
2978  *         1 if fine,
2979  *         2 if wrong gender for nymph
2980  */
2981 int
2982 could_seduce(magr, mdef, mattk)
2983 struct monst *magr, *mdef;
2984 struct attack *mattk;
2985 {
2986     struct permonst *pagr;
2987     boolean agrinvis, defperc;
2988     xchar genagr, gendef;
2989
2990     if (is_animal(magr->data))
2991         return 0;
2992     if (magr == &youmonst) {
2993         pagr = youmonst.data;
2994         agrinvis = (Invis != 0);
2995         genagr = poly_gender();
2996     } else {
2997         pagr = magr->data;
2998         agrinvis = magr->minvis;
2999         genagr = gender(magr);
3000     }
3001     if (mdef == &youmonst) {
3002         defperc = (See_invisible != 0);
3003         gendef = poly_gender();
3004     } else {
3005         defperc = perceives(mdef->data);
3006         gendef = gender(mdef);
3007     }
3008
3009     if (agrinvis && !defperc
3010         && (!SYSOPT_SEDUCE || (mattk && mattk->adtyp != AD_SSEX)))
3011         return 0;
3012
3013     if (pagr->mlet != S_NYMPH
3014         && ((pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS])
3015             || (SYSOPT_SEDUCE && mattk && mattk->adtyp != AD_SSEX)))
3016         return 0;
3017
3018     if (genagr == 1 - gendef)
3019         return 1;
3020     else
3021         return (pagr->mlet == S_NYMPH) ? 2 : 0;
3022 }
3023
3024 /* Returns 1 if monster teleported */
3025 int
3026 doseduce(mon)
3027 struct monst *mon;
3028 {
3029     struct obj *ring, *nring;
3030     boolean fem = (mon->data == &mons[PM_SUCCUBUS]); /* otherwise incubus */
3031     int attr_tot, tried_gloves = 0;
3032     char qbuf[QBUFSZ];
3033
3034     if (mon->mcan || mon->mspec_used) {
3035 #if 0 /*JP*/
3036         pline("%s acts as though %s has got a %sheadache.", Monnam(mon),
3037               mhe(mon), mon->mcan ? "severe " : "");
3038 #else
3039         pline("%s\82Í%s\93ª\82ª\92É\82¢\82Ó\82è\82ð\82µ\82½\81D", Monnam(mon),
3040               mon->mcan ? "\82Ð\82Ç\82­" : "");
3041 #endif
3042         return 0;
3043     }
3044
3045     if (unconscious()) {
3046 /*JP
3047         pline("%s seems dismayed at your lack of response.", Monnam(mon));
3048 */
3049         pline("%s\82Í\95Ô\8e\96\82ª\82È\82¢\82Ì\82Å\8bC\82ª\88Þ\82¦\82½\82æ\82¤\82¾\81D", Monnam(mon));
3050         return 0;
3051     }
3052
3053     if (Blind)
3054 /*JP
3055         pline("It caresses you...");
3056 */
3057         pline("\89½\8eÒ\82©\82ª\82 \82È\82½\82ð\95ø\82«\82µ\82ß\82Ä\82¢\82é\81D\81D\81D");
3058     else
3059 /*JP
3060         You_feel("very attracted to %s.", mon_nam(mon));
3061 */
3062         You("%s\82É\88ø\82«\82Â\82¯\82ç\82ê\82Ä\82é\82æ\82¤\82È\8bC\82ª\82µ\82½\81D", mon_nam(mon));
3063     /* if in the process of putting armor on or taking armor off,
3064        interrupt that activity now */
3065     (void) stop_donning((struct obj *) 0);
3066     /* don't try to take off gloves if cursed weapon blocks them */
3067     if (welded(uwep))
3068         tried_gloves = 1;
3069
3070     for (ring = invent; ring; ring = nring) {
3071         nring = ring->nobj;
3072         if (ring->otyp != RIN_ADORNMENT)
3073             continue;
3074         if (fem) {
3075             if (ring->owornmask && uarmg) {
3076                 /* don't take off worn ring if gloves are in the way */
3077                 if (!tried_gloves++)
3078 /*JP
3079                     mayberem(uarmg, "gloves");
3080 */
3081                     mayberem(uarmg, "\8f¬\8eè");
3082                 if (uarmg)
3083                     continue; /* next ring might not be worn */
3084             }
3085             if (rn2(20) < ACURR(A_CHA)) {
3086 #if 0 /*JP*/
3087                 (void) safe_qbuf(qbuf, "\"That ",
3088                                  " looks pretty.  May I have it?\"", ring,
3089                                  xname, simpleonames, "ring");
3090 #else
3091                 (void) safe_qbuf(qbuf, "\81u\82È\82ñ\82Ä\91f\93G\82È",
3092                                  "\82Å\82µ\82å\82¤\81D\82í\82½\82µ\82É\82­\82ê\82Ü\82¹\82ñ\81H\81v", ring,
3093                                  xname, simpleonames, "\8ew\97Ö");
3094 #endif
3095                 makeknown(RIN_ADORNMENT);
3096                 if (yn(qbuf) == 'n')
3097                     continue;
3098             } else
3099 #if 0 /*JP*/
3100                 pline("%s decides she'd like %s, and takes it.",
3101                       Blind ? "She" : Monnam(mon), yname(ring));
3102 #else
3103                 pline("%s\82Í%s\82ª\82Æ\82Ä\82à\8bC\82É\82¢\82Á\82Ä\81C\82»\82ê\82ð\8eæ\82è\82 \82°\82½\81D",
3104                       Blind ? "\94Þ\8f\97" : Monnam(mon), xname(ring));
3105 #endif
3106             makeknown(RIN_ADORNMENT);
3107             if (ring == uleft || ring == uright)
3108                 Ring_gone(ring);
3109             if (ring == uwep)
3110                 setuwep((struct obj *) 0);
3111             if (ring == uswapwep)
3112                 setuswapwep((struct obj *) 0);
3113             if (ring == uquiver)
3114                 setuqwep((struct obj *) 0);
3115             freeinv(ring);
3116             (void) mpickobj(mon, ring);
3117         } else {
3118             if (uleft && uright && uleft->otyp == RIN_ADORNMENT
3119                 && uright->otyp == RIN_ADORNMENT)
3120                 break;
3121             if (ring == uleft || ring == uright)
3122                 continue;
3123             if (uarmg) {
3124                 /* don't put on ring if gloves are in the way */
3125                 if (!tried_gloves++)
3126 /*JP
3127                     mayberem(uarmg, "gloves");
3128 */
3129                     mayberem(uarmg, "\8f¬\8eè");
3130                 if (uarmg)
3131                     break; /* no point trying further rings */
3132             }
3133             if (rn2(20) < ACURR(A_CHA)) {
3134 #if 0 /*JP*/
3135                 (void) safe_qbuf(qbuf, "\"That ",
3136                                 " looks pretty.  Would you wear it for me?\"",
3137                                  ring, xname, simpleonames, "ring");
3138 #else
3139                 (void) safe_qbuf(qbuf, "\81u\82¨\82â\82È\82ñ\82Ä\82·\82Î\82ç\82µ\82¢",
3140                                 "\82¾\81D\8e\84\82Ì\82½\82ß\82É\8ew\82É\82Í\82ß\82Ä\82­\82ê\82È\82¢\82©\82¢\81H\81v",
3141                                  ring, xname, simpleonames, "\8ew\97Ö");
3142 #endif
3143                 makeknown(RIN_ADORNMENT);
3144                 if (yn(qbuf) == 'n')
3145                     continue;
3146             } else {
3147 #if 0 /*JP*/
3148                 pline("%s decides you'd look prettier wearing %s,",
3149                       Blind ? "He" : Monnam(mon), yname(ring));
3150 #else
3151                 pline("%s\82Í%s\82ð\82Â\82¯\82½\82 \82È\82½\82ª\82æ\82è\96£\97Í\93I\82¾\82Æ\8dl\82¦\81C",
3152                       Blind ? "\94Þ" : Monnam(mon), xname(ring));
3153 #endif
3154 /*JP
3155                 pline("and puts it on your finger.");
3156 */
3157                 pline("\82 \82È\82½\82Ì\8ew\82É\82»\82ê\82ð\82Í\82ß\82½\81D");
3158             }
3159             makeknown(RIN_ADORNMENT);
3160             if (!uright) {
3161 #if 0 /*JP*/
3162                 pline("%s puts %s on your right %s.",
3163                       Blind ? "He" : Monnam(mon), the(xname(ring)),
3164                       body_part(HAND));
3165 #else
3166                 pline("%s\82Í%s\82ð\82 \82È\82½\82Ì\89E%s\82É\82Í\82ß\82½\81D",
3167                       Blind ? "\94Þ" : Monnam(mon), the(xname(ring)),
3168                       body_part(HAND));
3169 #endif
3170                 setworn(ring, RIGHT_RING);
3171             } else if (!uleft) {
3172 #if 0 /*JP*/
3173                 pline("%s puts %s on your left %s.",
3174                       Blind ? "He" : Monnam(mon), the(xname(ring)),
3175                       body_part(HAND));
3176 #else
3177                 pline("%s\82Í%s\82ð\82 \82È\82½\82Ì\8d¶%s\82É\82Í\82ß\82½\81D",
3178                       Blind ? "\94Þ" : Monnam(mon), the(xname(ring)),
3179                       body_part(HAND));
3180 #endif
3181                 setworn(ring, LEFT_RING);
3182             } else if (uright && uright->otyp != RIN_ADORNMENT) {
3183 #if 0 /*JP*/
3184                 pline("%s replaces %s with %s.", Blind ? "He" : Monnam(mon),
3185                       yname(uright), yname(ring));
3186 #else
3187                 pline("%s\82Í%s\82ð%s\82É\82Æ\82è\82©\82¦\82½\81D", Blind ? "\94Þ" : Monnam(mon),
3188                       yname(uright), xname(ring));
3189 #endif
3190                 Ring_gone(uright);
3191                 setworn(ring, RIGHT_RING);
3192             } else if (uleft && uleft->otyp != RIN_ADORNMENT) {
3193 #if 0 /*JP*/
3194                 pline("%s replaces %s with %s.", Blind ? "He" : Monnam(mon),
3195                       yname(uleft), yname(ring));
3196 #else
3197                 pline("%s\82Í%s\82ð%s\82É\82Æ\82è\82©\82¦\82½\81D", Blind ? "\94Þ" : Monnam(mon),
3198                       yname(uleft), xname(ring));
3199 #endif
3200                 Ring_gone(uleft);
3201                 setworn(ring, LEFT_RING);
3202             } else
3203                 impossible("ring replacement");
3204             Ring_on(ring);
3205             prinv((char *) 0, ring, 0L);
3206         }
3207     }
3208
3209     if (!uarmc && !uarmf && !uarmg && !uarms && !uarmh && !uarmu)
3210 #if 0 /*JP*/
3211         pline("%s murmurs sweet nothings into your ear.",
3212               Blind ? (fem ? "She" : "He") : Monnam(mon));
3213 #else
3214         pline("%s\82Í\82 \82È\82½\82Ì\8e¨\82à\82Æ\82Å\8aÃ\82¢\82³\82³\82â\82«\82ð\82Â\82Ô\82â\82¢\82½\81D",
3215               Blind ? (fem ? "\94Þ\8f\97" : "\94Þ") : Monnam(mon));
3216 #endif
3217     else
3218 #if 0 /*JP*/
3219         pline("%s murmurs in your ear, while helping you undress.",
3220               Blind ? (fem ? "She" : "He") : Monnam(mon));
3221 #else
3222         pline("%s\82Í\8e¨\82à\82Æ\82Å\82 \82È\82½\82Ì\95\9e\82ð\92E\82ª\82¹\82È\82ª\82ç\82³\82³\82â\82¢\82½\81D",
3223               Blind ? (fem ? "\94Þ\8f\97" : "\94Þ") : Monnam(mon));
3224 #endif
3225     mayberem(uarmc, cloak_simple_name(uarmc));
3226     if (!uarmc)
3227 /*JP
3228         mayberem(uarm, "suit");
3229 */
3230         mayberem(uarm, "\83X\81[\83c");
3231 /*JP
3232     mayberem(uarmf, "boots");
3233 */
3234     mayberem(uarmf, "\83u\81[\83c");
3235     if (!tried_gloves)
3236 /*JP
3237         mayberem(uarmg, "gloves");
3238 */
3239         mayberem(uarmg, "\8f¬\8eè");
3240 /*JP
3241     mayberem(uarms, "shield");
3242 */
3243     mayberem(uarms, "\8f\82");
3244     mayberem(uarmh, helm_simple_name(uarmh));
3245     if (!uarmc && !uarm)
3246 /*JP
3247         mayberem(uarmu, "shirt");
3248 */
3249         mayberem(uarmu, "\83V\83\83\83c");
3250
3251     if (uarm || uarmc) {
3252 #if 0 /*JP*/
3253         verbalize("You're such a %s; I wish...",
3254                   flags.female ? "sweet lady" : "nice guy");
3255 #else
3256         verbalize("%s\82¾\81D\81D\81D\82Æ\82¢\82¢\82Ì\82É\81D",
3257                   flags.female ? "\83`\83\83\81[\83~\83\93\83O" : "\82·\82Ä\82«");
3258 #endif
3259         if (!tele_restrict(mon))
3260             (void) rloc(mon, TRUE);
3261         return 1;
3262     }
3263     if (u.ualign.type == A_CHAOTIC)
3264         adjalign(1);
3265
3266     /* by this point you have discovered mon's identity, blind or not... */
3267 /*JP
3268     pline("Time stands still while you and %s lie in each other's arms...",
3269 */
3270     pline("\82 \82È\82½\82Æ%s\82ª\95ø\82«\8d\87\82¤\82Æ\81C\8e\9e\82ª\8e~\82Ü\82Á\82½\82æ\82¤\82É\8a´\82\82½\81D\81D\81D",
3271           noit_mon_nam(mon));
3272     /* 3.6.1: a combined total for charisma plus intelligence of 35-1
3273        used to guarantee successful outcome; now total maxes out at 32
3274        as far as deciding what will happen; chance for bad outcome when
3275        Cha+Int is 32 or more is 2/35, a bit over 5.7% */
3276     attr_tot = ACURR(A_CHA) + ACURR(A_INT);
3277     if (rn2(35) > min(attr_tot, 32)) {
3278         /* Don't bother with mspec_used here... it didn't get tired! */
3279 /*JP
3280         pline("%s seems to have enjoyed it more than you...",
3281 */
3282         pline("%s\82Í\82 \82È\82½\82æ\82è\8ay\82µ\82ñ\82¾\82æ\82¤\82¾\81D\81D\81D",
3283               noit_Monnam(mon));
3284         switch (rn2(5)) {
3285         case 0:
3286 /*JP
3287             You_feel("drained of energy.");
3288 */
3289             You("\91Ì\97Í\82ª\8fÁ\96Õ\82µ\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
3290             u.uen = 0;
3291             u.uenmax -= rnd(Half_physical_damage ? 5 : 10);
3292             exercise(A_CON, FALSE);
3293             if (u.uenmax < 0)
3294                 u.uenmax = 0;
3295             break;
3296         case 1:
3297 /*JP
3298             You("are down in the dumps.");
3299 */
3300             You("\88Ó\8bC\8fÁ\92¾\82µ\82½\81D");
3301             (void) adjattrib(A_CON, -1, TRUE);
3302             exercise(A_CON, FALSE);
3303             context.botl = 1;
3304             break;
3305         case 2:
3306 /*JP
3307             Your("senses are dulled.");
3308 */
3309             Your("\8cÜ\8a´\82Í\93Ý\82Á\82½\81D");
3310             (void) adjattrib(A_WIS, -1, TRUE);
3311             exercise(A_WIS, FALSE);
3312             context.botl = 1;
3313             break;
3314         case 3:
3315             if (!resists_drli(&youmonst)) {
3316 /*JP
3317                 You_feel("out of shape.");
3318 */
3319                 You("\82­\82½\82Ñ\82ê\82½\81D");
3320 /*JP
3321                 losexp("overexertion");
3322 */
3323                 losexp("\89ß\98J\82Å");
3324             } else {
3325 /*JP
3326                 You("have a curious feeling...");
3327 */
3328                 You("\95Ï\82È\8a´\82\82ª\82µ\82½\81D\81D\81D");
3329             }
3330             exercise(A_CON, FALSE);
3331             exercise(A_DEX, FALSE);
3332             exercise(A_WIS, FALSE);
3333             break;
3334         case 4: {
3335             int tmp;
3336
3337 /*JP
3338             You_feel("exhausted.");
3339 */
3340             You("\94æ\82ê\82ð\8a´\82\82½\81D");
3341             exercise(A_STR, FALSE);
3342             tmp = rn1(10, 6);
3343 /*JP
3344             losehp(Maybe_Half_Phys(tmp), "exhaustion", KILLED_BY);
3345 */
3346             losehp(Maybe_Half_Phys(tmp), "\90¸\97Í\82Ì\8eg\82¢\82·\82¬\82Å", KILLED_BY);
3347             break;
3348         } /* case 4 */
3349         } /* switch */
3350     } else {
3351         mon->mspec_used = rnd(100); /* monster is worn out */
3352 /*JP
3353         You("seem to have enjoyed it more than %s...", noit_mon_nam(mon));
3354 */
3355         You("%s\82æ\82è\82à\8ay\82µ\82ñ\82¾\82æ\82¤\82¾\81D\81D\81D", noit_mon_nam(mon));
3356         switch (rn2(5)) {
3357         case 0:
3358 /*JP
3359             You_feel("raised to your full potential.");
3360 */
3361             You("\90ö\8dÝ\94\\97Í\82ª\8d\82\82Ü\82Á\82½\82æ\82¤\82É\8a´\82\82½\81D");
3362             exercise(A_CON, TRUE);
3363             u.uen = (u.uenmax += rnd(5));
3364             break;
3365         case 1:
3366 /*JP
3367             You_feel("good enough to do it again.");
3368 */
3369             You("\82à\82¤\88ê\93x\82Å\82«\82é\82Æ\8ev\82Á\82½\81D");
3370             (void) adjattrib(A_CON, 1, TRUE);
3371             exercise(A_CON, TRUE);
3372             context.botl = 1;
3373             break;
3374         case 2:
3375 /*JP
3376             You("will always remember %s...", noit_mon_nam(mon));
3377 */
3378             You("\82¢\82Â\82Ü\82Å\82à%s\82ð\8ao\82¦\82Ä\82é\82¾\82ë\82¤\81D\81D\81D", mon_nam(mon));
3379             (void) adjattrib(A_WIS, 1, TRUE);
3380             exercise(A_WIS, TRUE);
3381             context.botl = 1;
3382             break;
3383         case 3:
3384 /*JP
3385             pline("That was a very educational experience.");
3386 */
3387             pline("\82Æ\82Ä\82à\8bM\8fd\82È\8co\8c±\82¾\82Á\82½\81D");
3388             pluslvl(FALSE);
3389             exercise(A_WIS, TRUE);
3390             break;
3391         case 4:
3392 /*JP
3393             You_feel("restored to health!");
3394 */
3395             You("\82Æ\82Ä\82à\8c\92\8dN\82É\82È\82Á\82½\81I");
3396             u.uhp = u.uhpmax;
3397             if (Upolyd)
3398                 u.mh = u.mhmax;
3399             exercise(A_STR, TRUE);
3400             context.botl = 1;
3401             break;
3402         }
3403     }
3404
3405     if (mon->mtame) { /* don't charge */
3406         ;
3407     } else if (rn2(20) < ACURR(A_CHA)) {
3408 #if 0 /*JP*/
3409         pline("%s demands that you pay %s, but you refuse...",
3410               noit_Monnam(mon), Blind ? (fem ? "her" : "him") : mhim(mon));
3411 #else
3412         pline("%s\82Í\82 \82È\82½\82É\8bà\82ð\95¥\82¤\82æ\82¤\97v\8b\81\82µ\82½\82ª\81C\82 \82È\82½\82Í\8b\91\82ñ\82¾\81D\81D\81D",
3413               noit_Monnam(mon));
3414 #endif
3415     } else if (u.umonnum == PM_LEPRECHAUN) {
3416 /*JP
3417         pline("%s tries to take your money, but fails...", noit_Monnam(mon));
3418 */
3419         pline("%s\82Í\8bà\82ð\8eæ\82ë\82¤\82Æ\82µ\82½\82ª\81C\8e¸\94s\82µ\82½\81D\81D\81D", noit_Monnam(mon));
3420     } else {
3421         long cost;
3422         long umoney = money_cnt(invent);
3423
3424         if (umoney > (long) LARGEST_INT - 10L)
3425             cost = (long) rnd(LARGEST_INT) + 500L;
3426         else
3427             cost = (long) rnd((int) umoney + 10) + 500L;
3428         if (mon->mpeaceful) {
3429             cost /= 5L;
3430             if (!cost)
3431                 cost = 1L;
3432         }
3433         if (cost > umoney)
3434             cost = umoney;
3435         if (!cost) {
3436 /*JP
3437             verbalize("It's on the house!");
3438 */
3439             verbalize("\82±\82ê\82Í\82¨\82²\82è%s\81I", fem ? "\82æ" : "\82³");
3440         } else {
3441 #if 0 /*JP*/
3442             pline("%s takes %ld %s for services rendered!", noit_Monnam(mon),
3443                   cost, currency(cost));
3444 #else
3445             pline("%s\82Í\83T\81[\83r\83X\97¿\82Æ\82µ\82Ä%ld%s\92D\82¢\8eæ\82Á\82½\81I", noit_Monnam(mon),
3446                   cost, currency(cost));
3447 #endif
3448             money2mon(mon, cost);
3449             context.botl = 1;
3450         }
3451     }
3452     if (!rn2(25))
3453         mon->mcan = 1; /* monster is worn out */
3454     if (!tele_restrict(mon))
3455         (void) rloc(mon, TRUE);
3456     return 1;
3457 }
3458
3459 STATIC_OVL void
3460 mayberem(obj, str)
3461 struct obj *obj;
3462 const char *str;
3463 {
3464     char qbuf[QBUFSZ];
3465
3466     if (!obj || !obj->owornmask)
3467         return;
3468
3469     if (rn2(20) < ACURR(A_CHA)) {
3470 #if 0 /*JP*/
3471         Sprintf(qbuf, "\"Shall I remove your %s, %s?\"", str,
3472                 (!rn2(2) ? "lover" : !rn2(2) ? "dear" : "sweetheart"));
3473 #else
3474         Sprintf(qbuf,"\81u%s\82ð\8eæ\82Á\82Ä\82¢\82¢\81C%s\81H\81v", str,
3475                 (!rn2(2) ? "\82Ë\82¥" : flags.female ? "\83n\83j\81[" : "\83_\81[\83\8a\83\93" ));
3476 #endif
3477         if (yn(qbuf) == 'n')
3478             return;
3479     } else {
3480         char hairbuf[BUFSZ];
3481
3482 #if 0 /*JP*/
3483         Sprintf(hairbuf, "let me run my fingers through your %s",
3484                 body_part(HAIR));
3485 #else
3486         Sprintf(hairbuf,
3487                 flags.female ? "\82È\82ñ\82ÄãY\97í\82È%s\82È\82ñ\82¾" : "\8a\95\82ð\8eæ\82Á\82½\82ç\82È\82©\82È\82©\83C\83J\83X\82\82á\82È\82¢",
3488                 body_part(HAIR));
3489 #endif
3490 #if 0 /*JP*/
3491         verbalize("Take off your %s; %s.", str,
3492                   (obj == uarm)
3493                      ? "let's get a little closer"
3494                      : (obj == uarmc || obj == uarms)
3495                         ? "it's in the way"
3496                         : (obj == uarmf)
3497                            ? "let me rub your feet"
3498                            : (obj == uarmg)
3499                               ? "they're too clumsy"
3500                               : (obj == uarmu)
3501                                  ? "let me massage you"
3502                                  /* obj == uarmh */
3503                                  : hairbuf);
3504 #else
3505         verbalize("%s\82ð\92E\82¢\82Å\81D\81D\81D%s\81D", str,
3506                   (obj == uarm)
3507                   ? "\82à\82¤\82¿\82å\82Á\82Æ\8añ\82è\82»\82Á\82Ä"
3508                   : (obj == uarmc || obj == uarms)
3509                   ? "\82»\82¤\82»\82¤"
3510                   : (obj == uarmf)
3511                   ? (flags.female ? "ãY\97í\82È\91«\82¾\82Ë" : "\82¤\82Ó\82Á\81C\82½\82­\82Ü\82µ\82¢\91«\82Ë")
3512                   : (obj == uarmg)
3513                   ? (flags.female ? "\82È\82ñ\82Ä\91f\93G\82È\8eè\82¾" : "\82½\82­\82Ü\82µ\82¢\98r\82Ë")
3514                   : (obj == uarmu)
3515                   ? (flags.female ? "\82«\82ê\82¢\82È\91Ì\82¾" : "\82½\82­\82Ü\82µ\82¢\82Ì\82Ë")
3516                   /* obj == uarmh */
3517                   : hairbuf);
3518 #endif
3519     }
3520     remove_worn_item(obj, TRUE);
3521 }
3522
3523 /* FIXME:
3524  *  sequencing issue:  a monster's attack might cause poly'd hero
3525  *  to revert to normal form.  The messages for passive counterattack
3526  *  would look better if they came before reverting form, but we need
3527  *  to know whether hero reverted in order to decide whether passive
3528  *  damage applies.
3529  */
3530 STATIC_OVL int
3531 passiveum(olduasmon, mtmp, mattk)
3532 struct permonst *olduasmon;
3533 struct monst *mtmp;
3534 struct attack *mattk;
3535 {
3536     int i, tmp;
3537     struct attack *oldu_mattk = 0;
3538
3539     /*
3540      * mattk      == mtmp's attack that hit you;
3541      * oldu_mattk == your passive counterattack (even if mtmp's attack
3542      *               has already caused you to revert to normal form).
3543      */
3544     for (i = 0; !oldu_mattk; i++) {
3545         if (i >= NATTK)
3546             return 1;
3547         if (olduasmon->mattk[i].aatyp == AT_NONE
3548             || olduasmon->mattk[i].aatyp == AT_BOOM)
3549             oldu_mattk = &olduasmon->mattk[i];
3550     }
3551     if (oldu_mattk->damn)
3552         tmp = d((int) oldu_mattk->damn, (int) oldu_mattk->damd);
3553     else if (oldu_mattk->damd)
3554         tmp = d((int) olduasmon->mlevel + 1, (int) oldu_mattk->damd);
3555     else
3556         tmp = 0;
3557
3558     /* These affect the enemy even if you were "killed" (rehumanized) */
3559     switch (oldu_mattk->adtyp) {
3560     case AD_ACID:
3561         if (!rn2(2)) {
3562 #if 0 /*JP*/
3563             pline("%s is splashed by %s%s!", Monnam(mtmp),
3564                   /* temporary? hack for sequencing issue:  "your acid"
3565                      looks strange coming immediately after player has
3566                      been told that hero has reverted to normal form */
3567                   !Upolyd ? "" : "your ", hliquid("acid"));
3568 #else
3569             pline("%s\82Í%s%s\82ð\90H\82ç\82Á\82½\81I", Monnam(mtmp),
3570                   /* temporary? hack for sequencing issue:  "your acid"
3571                      looks strange coming immediately after player has
3572                      been told that hero has reverted to normal form */
3573                   !Upolyd ? "" : "\82 \82È\82½\82Ì", hliquid("\8e_"));
3574 #endif
3575             if (resists_acid(mtmp)) {
3576 /*JP
3577                 pline("%s is not affected.", Monnam(mtmp));
3578 */
3579                 pline("%s\82Í\89e\8b¿\82ð\8eó\82¯\82È\82¢\81D", Monnam(mtmp));
3580                 tmp = 0;
3581             }
3582         } else
3583             tmp = 0;
3584         if (!rn2(30))
3585             erode_armor(mtmp, ERODE_CORRODE);
3586         if (!rn2(6))
3587             acid_damage(MON_WEP(mtmp));
3588         goto assess_dmg;
3589     case AD_STON: /* cockatrice */
3590     {
3591         long protector = attk_protection((int) mattk->aatyp),
3592              wornitems = mtmp->misc_worn_check;
3593
3594         /* wielded weapon gives same protection as gloves here */
3595         if (MON_WEP(mtmp) != 0)
3596             wornitems |= W_ARMG;
3597
3598         if (!resists_ston(mtmp)
3599             && (protector == 0L
3600                 || (protector != ~0L
3601                     && (wornitems & protector) != protector))) {
3602             if (poly_when_stoned(mtmp->data)) {
3603                 mon_to_stone(mtmp);
3604                 return 1;
3605             }
3606 /*JP
3607             pline("%s turns to stone!", Monnam(mtmp));
3608 */
3609             pline("%s\82Í\90Î\82É\82È\82Á\82½\81I", Monnam(mtmp));
3610             stoned = 1;
3611             xkilled(mtmp, XKILL_NOMSG);
3612             if (mtmp->mhp > 0)
3613                 return 1;
3614             return 2;
3615         }
3616         return 1;
3617     }
3618     case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */
3619         if (mon_currwep) {
3620             /* by_you==True: passive counterattack to hero's action
3621                is hero's fault */
3622             (void) drain_item(mon_currwep, TRUE);
3623             /* No message */
3624         }
3625         return 1;
3626     default:
3627         break;
3628     }
3629     if (!Upolyd)
3630         return 1;
3631
3632     /* These affect the enemy only if you are still a monster */
3633     if (rn2(3))
3634         switch (oldu_mattk->adtyp) {
3635         case AD_PHYS:
3636             if (oldu_mattk->aatyp == AT_BOOM) {
3637 /*JP
3638                 You("explode!");
3639 */
3640                 pline("\82 \82È\82½\82Í\94\9a\94­\82µ\82½\81I");
3641                 /* KMH, balance patch -- this is okay with unchanging */
3642                 rehumanize();
3643                 goto assess_dmg;
3644             }
3645             break;
3646         case AD_PLYS: /* Floating eye */
3647             if (tmp > 127)
3648                 tmp = 127;
3649             if (u.umonnum == PM_FLOATING_EYE) {
3650                 if (!rn2(4))
3651                     tmp = 127;
3652                 if (mtmp->mcansee && haseyes(mtmp->data) && rn2(3)
3653                     && (perceives(mtmp->data) || !Invis)) {
3654                     if (Blind)
3655 /*JP
3656                         pline("As a blind %s, you cannot defend yourself.",
3657 */
3658                         pline("%s\82Í\96Ú\82ª\8c©\82¦\82È\82¢\82Ì\82Å\81C\82 \82È\82½\82Í\82É\82ç\82Ý\82Å\96h\8cä\82Å\82«\82È\82¢\81D",
3659                               youmonst.data->mname);
3660                     else {
3661                         if (mon_reflects(mtmp,
3662 /*JP
3663                                          "Your gaze is reflected by %s %s."))
3664 */
3665                                          "\82 \82È\82½\82Ì\82É\82ç\82Ý\82Í%s\82Ì%s\82Å\94½\8eË\82µ\82½\81D"))
3666                             return 1;
3667 /*JP
3668                         pline("%s is frozen by your gaze!", Monnam(mtmp));
3669 */
3670                         pline("%s\82Í\82 \82È\82½\82Ì\82É\82ç\82Ý\82Å\93®\82¯\82È\82­\82È\82Á\82½\81I", Monnam(mtmp));
3671                         paralyze_monst(mtmp, tmp);
3672                         return 3;
3673                     }
3674                 }
3675             } else { /* gelatinous cube */
3676 /*JP
3677                 pline("%s is frozen by you.", Monnam(mtmp));
3678 */
3679                 pline("%s\82Í\93®\82¯\82È\82¢\81D", Monnam(mtmp));
3680                 paralyze_monst(mtmp, tmp);
3681                 return 3;
3682             }
3683             return 1;
3684         case AD_COLD: /* Brown mold or blue jelly */
3685             if (resists_cold(mtmp)) {
3686                 shieldeff(mtmp->mx, mtmp->my);
3687 /*JP
3688                 pline("%s is mildly chilly.", Monnam(mtmp));
3689 */
3690                 pline("%s\82Í\97â\82¦\82½\81D", Monnam(mtmp));
3691                 golemeffects(mtmp, AD_COLD, tmp);
3692                 tmp = 0;
3693                 break;
3694             }
3695 /*JP
3696             pline("%s is suddenly very cold!", Monnam(mtmp));
3697 */
3698             pline("%s\82Í\93Ë\91R\93\80\82è\82Ã\82¯\82É\82È\82Á\82½\81I", Monnam(mtmp));
3699             u.mh += tmp / 2;
3700             if (u.mhmax < u.mh)
3701                 u.mhmax = u.mh;
3702             if (u.mhmax > ((youmonst.data->mlevel + 1) * 8))
3703                 (void) split_mon(&youmonst, mtmp);
3704             break;
3705         case AD_STUN: /* Yellow mold */
3706             if (!mtmp->mstun) {
3707                 mtmp->mstun = 1;
3708 #if 0 /*JP*/
3709                 pline("%s %s.", Monnam(mtmp),
3710                       makeplural(stagger(mtmp->data, "stagger")));
3711 #else
3712                 pline("%s\82Í%s\81D", Monnam(mtmp),
3713                       jpast(stagger(mtmp->data, "\82æ\82ë\82ß\82­")));
3714 #endif
3715             }
3716             tmp = 0;
3717             break;
3718         case AD_FIRE: /* Red mold */
3719             if (resists_fire(mtmp)) {
3720                 shieldeff(mtmp->mx, mtmp->my);
3721 #if 0 /*JP*/
3722                 pline("%s is mildly warm.", Monnam(mtmp));
3723 #else
3724                 pline("%s\82Í\92g\82©\82­\82È\82Á\82½\81D", Monnam(mtmp));
3725 #endif
3726                 golemeffects(mtmp, AD_FIRE, tmp);
3727                 tmp = 0;
3728                 break;
3729             }
3730 #if 0 /*JP*/
3731             pline("%s is suddenly very hot!", Monnam(mtmp));
3732 #else
3733             pline("%s\82Í\93Ë\91R\94M\82­\82È\82Á\82½\81I", Monnam(mtmp));
3734 #endif
3735             break;
3736         case AD_ELEC:
3737             if (resists_elec(mtmp)) {
3738                 shieldeff(mtmp->mx, mtmp->my);
3739 #if 0 /*JP*/
3740                 pline("%s is slightly tingled.", Monnam(mtmp));
3741 #else
3742                 pline("%s\82Í\82¿\82å\82Á\82Æ\83s\83\8a\83s\83\8a\82µ\82½\81D", Monnam(mtmp));
3743 #endif
3744                 golemeffects(mtmp, AD_ELEC, tmp);
3745                 tmp = 0;
3746                 break;
3747             }
3748 #if 0 /*JP*/
3749             pline("%s is jolted with your electricity!", Monnam(mtmp));
3750 #else
3751             pline("%s\82Í\93d\8bC\83V\83\87\83b\83N\82ð\82¤\82¯\82½\81I", Monnam(mtmp));
3752 #endif
3753             break;
3754         default:
3755             tmp = 0;
3756             break;
3757         }
3758     else
3759         tmp = 0;
3760
3761 assess_dmg:
3762     if ((mtmp->mhp -= tmp) <= 0) {
3763 /*JP
3764         pline("%s dies!", Monnam(mtmp));
3765 */
3766         pline("%s\82Í\8e\80\82ñ\82¾\81I", Monnam(mtmp));
3767         xkilled(mtmp, XKILL_NOMSG);
3768         if (mtmp->mhp > 0)
3769             return 1;
3770         return 2;
3771     }
3772     return 1;
3773 }
3774
3775 struct monst *
3776 cloneu()
3777 {
3778     struct monst *mon;
3779     int mndx = monsndx(youmonst.data);
3780
3781     if (u.mh <= 1)
3782         return (struct monst *) 0;
3783     if (mvitals[mndx].mvflags & G_EXTINCT)
3784         return (struct monst *) 0;
3785     mon = makemon(youmonst.data, u.ux, u.uy, NO_MINVENT | MM_EDOG);
3786     if (!mon)
3787         return NULL;
3788     mon->mcloned = 1;
3789     mon = christen_monst(mon, plname);
3790     initedog(mon);
3791     mon->m_lev = youmonst.data->mlevel;
3792     mon->mhpmax = u.mhmax;
3793     mon->mhp = u.mh / 2;
3794     u.mh -= mon->mhp;
3795     context.botl = 1;
3796     return mon;
3797 }
3798
3799 /*mhitu.c*/