1 /* NetHack 3.6 mhitu.c $NHDT-Date: 1575245065 2019/12/02 00:04:25 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.168 $ */
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. */
6 /* JNetHack Copyright */
7 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
8 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2020 */
9 /* JNetHack may be freely redistributed. See license for details. */
14 STATIC_VAR NEARDATA struct obj *mon_currwep = (struct obj *) 0;
16 STATIC_DCL boolean FDECL(u_slip_free, (struct monst *, struct attack *));
17 STATIC_DCL int FDECL(passiveum, (struct permonst *, struct monst *,
19 STATIC_DCL void FDECL(mayberem, (struct monst *, const char *,
20 struct obj *, const char *));
21 STATIC_DCL boolean FDECL(diseasemu, (struct permonst *));
22 STATIC_DCL int FDECL(hitmu, (struct monst *, struct attack *));
23 STATIC_DCL int FDECL(gulpmu, (struct monst *, struct attack *));
24 STATIC_DCL int FDECL(explmu, (struct monst *, struct attack *, BOOLEAN_P));
25 STATIC_DCL void FDECL(missmu, (struct monst *, BOOLEAN_P, struct attack *));
26 STATIC_DCL void FDECL(mswings, (struct monst *, struct obj *));
27 STATIC_DCL void FDECL(wildmiss, (struct monst *, struct attack *));
28 STATIC_DCL void FDECL(hitmsg, (struct monst *, struct attack *));
30 /* See comment in mhitm.c. If we use this a lot it probably should be */
31 /* changed to a parameter to mhitu. */
41 char *Monst_name = Monnam(mtmp);
43 /* Note: if opposite gender, "seductively" */
44 /* If same gender, "engagingly" for nymph, normal msg for others */
45 if ((compat = could_seduce(mtmp, &youmonst, mattk)) != 0
46 && !mtmp->mcan && !mtmp->mspec_used) {
48 pline("%s %s you %s.", Monst_name,
49 !Blind ? "smiles at" : !Deaf ? "talks to" : "touches",
50 (compat == 2) ? "engagingly" : "seductively");
52 pline("%s
\82Í
\82 \82È
\82½%s%s
\81D", Monst_name,
53 (compat == 2) ? "
\82ð
\88ø
\82«
\82Â
\82¯
\82é
\82æ
\82¤
\82É" : "
\82É
\8dD
\88Ó
\82ð
\82æ
\82¹
\82é
\82æ
\82¤
\82É",
54 !Blind ? "
\94÷
\8fÎ
\82ñ
\82¾" : !Deaf ? "
\98b
\82µ
\82©
\82¯
\82½" : "
\90G
\82ê
\82½");
57 switch (mattk->aatyp) {
62 pfmt = "%s
\82Í
\8a\9a\82Ý
\82Â
\82¢
\82½
\81I";
66 pline("%s kicks%c", Monst_name,
67 thick_skinned(youmonst.data) ? '.' : '!');
69 pline("%s
\82Í
\8fR
\82Æ
\82Î
\82µ
\82½%s",Monnam(mtmp),
70 thick_skinned(youmonst.data) ? "
\81D" : "
\81I");
77 pfmt = "%s
\82Í
\93Ë
\82«
\82³
\82µ
\82½
\81I";
83 pfmt = "%s
\82Í
\93ª
\93Ë
\82«
\82ð
\82
\82ç
\82í
\82µ
\82½
\81I";
87 pfmt = "%s touches you!";
89 pfmt = "%s
\82Í
\82 \82È
\82½
\82É
\90G
\82ê
\82½
\81I";
93 pfmt = "%s tentacles suck you!";
95 pfmt = "%s
\82Ì
\90G
\8eè
\82ª
\82 \82È
\82½
\82Ì
\91Ì
\89t
\82ð
\8bz
\82¢
\82Æ
\82Á
\82½
\81I";
97 Monst_name = s_suffix(Monst_name);
103 pfmt = "%s explodes!";
105 pfmt = "%s
\82Í
\94\9a\94
\82µ
\82½
\81I";
111 pfmt = "%s
\82Ì
\8dU
\8c\82\82Í
\96½
\92\86\82µ
\82½
\81I";
114 pline(pfmt, Monst_name);
118 /* monster missed you */
120 missmu(mtmp, nearmiss, mattk)
123 struct attack *mattk;
125 if (!canspotmon(mtmp))
126 map_invisible(mtmp->mx, mtmp->my);
128 if (could_seduce(mtmp, &youmonst, mattk) && !mtmp->mcan)
130 pline("%s pretends to be friendly.", Monnam(mtmp));
132 pline("%s
\82Í
\97F
\8dD
\93I
\82È
\82Ó
\82è
\82ð
\82µ
\82Ä
\82¢
\82é
\81D",Monnam(mtmp));
135 pline("%s %smisses!", Monnam(mtmp),
136 (nearmiss && flags.verbose) ? "just " : "");
138 pline("%s
\82Ì
\8dU
\8c\82\82Í%s
\82½
\81D", Monnam(mtmp),
139 (nearmiss && flags.verbose) ? "
\8bó
\82ð
\90Ø
\82Á" : "
\82Í
\82¸
\82ê");
145 /* monster swings obj */
151 if (flags.verbose && !Blind && mon_visible(mtmp)) {
153 pline("%s %s %s%s %s.", Monnam(mtmp),
154 (objects[otemp->otyp].oc_dir & PIERCE) ? "thrusts" : "swings",
155 (otemp->quan > 1L) ? "one of " : "", mhis(mtmp), xname(otemp));
157 pline("%s
\82Í%s%s
\81D", Monnam(mtmp),
159 (objects[otemp->otyp].oc_dir & PIERCE) ? "
\82ð
\93Ë
\82¢
\82½" : "
\82ð
\90U
\82è
\82Ü
\82í
\82µ
\82½");
164 /* return how a poison attack was delivered */
166 mpoisons_subj(mtmp, mattk)
168 struct attack *mattk;
170 if (mattk->aatyp == AT_WEAP) {
171 struct obj *mwep = (mtmp == &youmonst) ? uwep : MON_WEP(mtmp);
172 /* "Foo's attack was poisoned." is pretty lame, but at least
173 it's better than "sting" when not a stinging attack... */
175 return (!mwep || !mwep->opoisoned) ? "attack" : "weapon";
177 return (!mwep || !mwep->opoisoned) ? "
\8dU
\8c\82" : "
\95\90\8aí";
180 return (mattk->aatyp == AT_TUCH) ? "contact"
181 : (mattk->aatyp == AT_GAZE) ? "gaze"
182 : (mattk->aatyp == AT_BITE) ? "bite" : "sting";
184 return (mattk->aatyp == AT_TUCH) ? "
\90Ú
\90G"
185 : (mattk->aatyp == AT_GAZE) ? "
\82É
\82ç
\82Ý"
186 : (mattk->aatyp == AT_BITE) ? "
\8a\9a\82Ý
\82Â
\82«" : "
\93Ë
\82«
\82³
\82µ";
191 /* called when your intrinsic speed is taken away */
200 You("
\93®
\82«
\82ª
\92x
\82
\82È
\82Á
\82½
\81D");
201 else /* speed boots */
203 Your("quickness feels less natural.");
205 You("
\91¬
\82³
\82É
\82Â
\82¢
\82Ä
\82¢
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
206 exercise(A_DEX, FALSE);
209 /* monster attacked your displaced image */
211 wildmiss(mtmp, mattk)
213 struct attack *mattk;
216 const char *Monst_name; /* Monnam(mtmp) */
218 /* no map_invisible() -- no way to tell where _this_ is coming from */
222 if (!cansee(mtmp->mx, mtmp->my))
224 /* maybe it's attacking an image around the corner? */
226 compat = ((mattk->adtyp == AD_SEDU || mattk->adtyp == AD_SSEX)
227 ? could_seduce(mtmp, &youmonst, mattk) : 0);
228 Monst_name = Monnam(mtmp);
230 if (!mtmp->mcansee || (Invis && !perceives(mtmp->data))) {
232 const char *swings = (mattk->aatyp == AT_BITE) ? "snaps"
233 : (mattk->aatyp == AT_KICK) ? "kicks"
234 : (mattk->aatyp == AT_STNG
235 || mattk->aatyp == AT_BUTT
236 || nolimbs(mtmp->data)) ? "lunges"
239 const char *swings = (mattk->aatyp == AT_BITE) ? "
\8a\9a\82Ý
\82Â
\82"
240 : (mattk->aatyp == AT_KICK) ? "
\8fR
\82Æ
\82Î
\82·"
241 : (mattk->aatyp == AT_STNG
242 || mattk->aatyp == AT_BUTT
243 || nolimbs(mtmp->data)) ? "
\93Ë
\90i
\82·
\82é"
244 : "
\90U
\82è
\89ñ
\82·";
249 pline("%s tries to touch you and misses!", Monst_name);
251 pline("%s
\82Í
\82 \82È
\82½
\82É
\90G
\82ë
\82¤
\82Æ
\82µ
\82½
\82ª
\8e¸
\94s
\82µ
\82½
\81I", Monst_name);
256 pline("%s %s wildly and misses!", Monst_name, swings);
258 pline("%s
\82Í
\8c\83\82µ
\82%s
\82ª
\81C
\82Í
\82¸
\82µ
\82½
\81I", Monst_name, swings);
262 pline("%s attacks a spot beside you.", Monst_name);
264 pline("%s
\82Ì
\8dU
\8c\82\82Í
\82 \82È
\82½
\82Ì
\98e
\95 \82ð
\82©
\82·
\82ß
\82½
\81D", Monst_name);
268 pline("%s strikes at %s!", Monst_name,
269 (levl[mtmp->mux][mtmp->muy].typ == WATER)
273 pline("%s
\82Í%s
\82ð
\91Å
\82¿
\82Â
\82¯
\82½
\81I", Monst_name,
274 (levl[mtmp->mux][mtmp->muy].typ == WATER)
276 : "
\89½
\82à
\82È
\82¢
\82Æ
\82±
\82ë");
281 pline("%s %s wildly!", Monst_name, swings);
283 pline("%s
\82Í
\8c\83\82µ
\82%s
\81I", Monst_name, swings);
287 } else if (Displaced) {
288 /* give 'displaced' message even if hero is Blind */
291 pline("%s smiles %s at your %sdisplaced image...", Monst_name,
292 (compat == 2) ? "engagingly" : "seductively",
293 Invis ? "invisible " : "");
295 pline("%s
\82Í%s
\82 \82È
\82½
\82Ì
\8c¶
\89e
\82É
\91Î
\82µ
\82Ä%s
\94÷
\8fÎ
\82ñ
\82¾
\81D
\81D
\81D", Monst_name,
296 Invis ? "
\93§
\96¾
\82È" : "",
297 (compat == 2) ? "
\96£
\97Í
\93I
\82É" : "
\97U
\98f
\93I
\82É");
301 pline("%s strikes at your %sdisplaced image and misses you!",
302 /* Note: if you're both invisible and displaced, only
303 * monsters which see invisible will attack your displaced
304 * image, since the displaced image is also invisible. */
305 Monst_name, Invis ? "invisible " : "");
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È" : "");
311 } else if (Underwater) {
312 /* monsters may miss especially on water level where
313 bubbles shake the player here and there */
316 pline("%s reaches towards your distorted image.", Monst_name);
318 pline("%s
\82Í
\82 \82È
\82½
\82Ì
\98c
\82ñ
\82¾
\8c¶
\89e
\82Ì
\95û
\82Ö
\8cü
\82©
\82Á
\82½
\81D", Monst_name);
321 pline("%s is fooled by water reflections and misses!",
323 pline("%s
\82Í
\90\85\82Ì
\94½
\8eË
\82É
\82¾
\82Ü
\82³
\82ê
\81C
\82Í
\82¸
\82µ
\82½
\81I",
327 impossible("%s attacks you without knowing your location?",
332 expels(mtmp, mdat, message)
334 struct permonst *mdat; /* if mtmp is polymorphed, mdat != mtmp->data */
338 if (is_animal(mdat)) {
340 You("get regurgitated!");
342 You("
\93f
\82«
\82¾
\82³
\82ê
\82½
\81I");
345 struct attack *attk = attacktype_fordmg(mdat, AT_ENGL, AD_ANY);
349 impossible("Swallower has no engulfing attack?");
351 if (is_whirly(mdat)) {
352 switch (attk->adtyp) {
355 Strcpy(blast, " in a shower of sparks");
357 Strcpy(blast, "
\82Ì
\89Î
\89Ô
\82Ì
\89J
\82Ì
\92\86\82©
\82ç");
361 Strcpy(blast, " in a blast of frost");
363 Strcpy(blast, "
\82Ì
\97â
\8bC
\82Ì
\95\97\82Ì
\92\86\82©
\82ç");
368 Strcpy(blast, " with a squelch");
370 Strcpy(blast, "
\82©
\82ç
\93f
\82«
\8fo
\82³
\82ê
\82é
\82æ
\82¤
\82É");
373 You("get expelled from %s%s!", mon_nam(mtmp), blast);
375 You("%s%s
\92E
\8fo
\82µ
\82½
\81I", mon_nam(mtmp), blast);
379 unstuck(mtmp); /* ball&chain returned in unstuck() */
383 /* to cover for a case where mtmp is not in a next square */
384 if (um_dist(mtmp->mx, mtmp->my, 1))
386 pline("Brrooaa... You land hard at some distance.");
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");
391 /* select a monster's next attack, possibly substituting for its usual one */
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;
398 struct permonst *mptr = magr->data;
399 struct attack *attk = &mptr->mattk[indx];
400 struct obj *weap = (magr == &youmonst) ? uwep : MON_WEP(magr);
403 if (!SYSOPT_SEDUCE) {
404 extern const struct attack sa_no[NATTK];
406 /* if the first attack is for SSEX damage, all six attacks will be
407 substituted (expected succubus/incubus handling); if it isn't
408 but another one is, only that other one will be substituted */
409 if (mptr->mattk[0].adtyp == AD_SSEX) {
410 *alt_attk_buf = sa_no[indx];
412 } else if (attk->adtyp == AD_SSEX) {
413 *alt_attk_buf = *attk;
415 attk->adtyp = AD_DRLI;
419 /* prevent a monster with two consecutive disease or hunger attacks
420 from hitting with both of them on the same turn; if the first has
421 already hit, switch to a stun attack for the second */
422 if (indx > 0 && prev_result[indx - 1] > 0
423 && (attk->adtyp == AD_DISE || attk->adtyp == AD_PEST
424 || attk->adtyp == AD_FAMN)
425 && attk->adtyp == mptr->mattk[indx - 1].adtyp) {
426 *alt_attk_buf = *attk;
428 attk->adtyp = AD_STUN;
430 /* make drain-energy damage be somewhat in proportion to energy */
431 } else if (attk->adtyp == AD_DREN && mdef == &youmonst) {
432 int ulev = max(u.ulevel, 6);
434 *alt_attk_buf = *attk;
436 /* 3.6.0 used 4d6 but since energy drain came out of max energy
437 once current energy was gone, that tended to have a severe
438 effect on low energy characters; it's now 2d6 with ajustments */
439 if (u.uen <= 5 * ulev && attk->damn > 1) {
440 attk->damn -= 1; /* low energy: 2d6 -> 1d6 */
441 if (u.uenmax <= 2 * ulev && attk->damd > 3)
442 attk->damd -= 3; /* very low energy: 1d6 -> 1d3 */
443 } else if (u.uen > 12 * ulev) {
444 attk->damn += 1; /* high energy: 2d6 -> 3d6 */
445 if (u.uenmax > 20 * ulev)
446 attk->damd += 3; /* very high energy: 3d6 -> 3d9 */
447 /* note: 3d9 is slightly higher than previous 4d6 */
450 } else if (attk->aatyp == AT_ENGL && magr->mspec_used) {
451 /* can't re-engulf yet; switch to simpler attack */
452 *alt_attk_buf = *attk;
454 if (attk->adtyp == AD_ACID || attk->adtyp == AD_ELEC
455 || attk->adtyp == AD_COLD || attk->adtyp == AD_FIRE) {
456 attk->aatyp = AT_TUCH;
458 attk->aatyp = AT_CLAW; /* attack message will be "<foo> hits" */
459 attk->adtyp = AD_PHYS;
461 attk->damn = 1; /* relatively weak: 1d6 */
464 /* barrow wight, Nazgul, erinys have weapon attack for non-physical
465 damage; force physical damage if attacker has been cancelled or
466 if weapon is sufficiently interesting; a few unique creatures
467 have two weapon attacks where one does physical damage and other
468 doesn't--avoid forcing physical damage for those */
469 } else if (indx == 0 && magr != &youmonst
470 && attk->aatyp == AT_WEAP && attk->adtyp != AD_PHYS
471 && !(mptr->mattk[1].aatyp == AT_WEAP
472 && mptr->mattk[1].adtyp == AD_PHYS)
474 || (weap && ((weap->otyp == CORPSE
475 && touch_petrifies(&mons[weap->corpsenm]))
476 || weap->oartifact == ART_STORMBRINGER
477 || weap->oartifact == ART_VORPAL_BLADE)))) {
478 *alt_attk_buf = *attk;
480 attk->adtyp = AD_PHYS;
486 * mattacku: monster attacks you
487 * returns 1 if monster dies (e.g. "yellow light"), 0 otherwise
488 * Note: if you're displaced or invisible the monster might attack the
490 * Assumption: it's attacking you or an empty square; if there's another
491 * monster which it attacks by mistake, the caller had better
496 register struct monst *mtmp;
498 struct attack *mattk, alt_attk;
499 int i, j = 0, tmp, sum[NATTK];
500 struct permonst *mdat = mtmp->data;
501 boolean ranged = (distu(mtmp->mx, mtmp->my) > 3);
502 /* Is it near you? Affects your actions */
503 boolean range2 = !monnear(mtmp, mtmp->mux, mtmp->muy);
504 /* Does it think it's near you? Affects its actions */
505 boolean foundyou = (mtmp->mux == u.ux && mtmp->muy == u.uy);
506 /* Is it attacking you or your image? */
507 boolean youseeit = canseemon(mtmp);
508 /* Might be attacking your image around the corner, or
509 * invisible, or you might be blind....
511 boolean skipnonmagc = FALSE;
512 /* Are further physical attack attempts useless? */
516 if (DEADMONSTER(mtmp) || (Underwater && !is_swimmer(mtmp->data)))
519 /* If swallowed, can only be affected by u.ustuck */
521 if (mtmp != u.ustuck)
523 u.ustuck->mux = u.ux;
524 u.ustuck->muy = u.uy;
528 return 0; /* stomachs can't hurt you! */
530 } else if (u.usteed) {
531 if (mtmp == u.usteed)
532 /* Your steed won't attack you */
534 /* Orcs like to steal and eat horses and the like */
535 if (!rn2(is_orc(mtmp->data) ? 2 : 4)
536 && distu(mtmp->mx, mtmp->my) <= 2) {
537 /* Attack your steed instead */
538 i = mattackm(mtmp, u.usteed);
539 if ((i & MM_AGR_DIED))
541 /* make sure steed is still alive and within range */
542 if ((i & MM_DEF_DIED) || !u.usteed
543 || distu(mtmp->mx, mtmp->my) > 2)
545 /* Let your steed retaliate */
546 return !!(mattackm(u.usteed, mtmp) & MM_DEF_DIED);
550 if (u.uundetected && !range2 && foundyou && !u.uswallow) {
551 if (!canspotmon(mtmp))
552 map_invisible(mtmp->mx, mtmp->my);
554 if (is_hider(youmonst.data) && u.umonnum != PM_TRAPPER) {
556 coord cc; /* maybe we need a unexto() function? */
560 You("fall from the %s!", ceiling(u.ux, u.uy));
562 You("%s
\82©
\82ç
\97\8e\82¿
\82½
\81I", ceiling(u.ux,u.uy));
563 /* take monster off map now so that its location
564 is eligible for placing hero; we assume that a
565 removed monster remembers its old spot <mx,my> */
566 remove_monster(mtmp->mx, mtmp->my);
567 if (!enexto(&cc, u.ux, u.uy, youmonst.data)
568 /* a fish won't voluntarily swap positions
569 when it's in water and hero is over land */
570 || (mtmp->data->mlet == S_EEL
571 && is_pool(mtmp->mx, mtmp->my)
572 && !is_pool(u.ux, u.uy))) {
573 /* couldn't find any spot for hero; this used to
574 kill off attacker, but now we just give a "miss"
575 message and keep both mtmp and hero at their
576 original positions; hero has become unconcealed
577 so mtmp's next move will be a regular attack */
578 place_monster(mtmp, mtmp->mx, mtmp->my); /* put back */
579 newsym(u.ux, u.uy); /* u.uundetected was toggled */
581 pline("%s draws back as you drop!", Monnam(mtmp));
583 pline("
\82 \82È
\82½
\82ª
\97\8e\82¿
\82é
\82±
\82Æ
\82Å%s
\82Í
\88ø
\82«
\96ß
\82³
\82ê
\82½
\81I", Monnam(mtmp));
587 /* put mtmp at hero's spot and move hero to <cc.x,.y> */
588 newsym(mtmp->mx, mtmp->my); /* finish removal */
589 place_monster(mtmp, u.ux, u.uy);
592 /* tail hasn't grown, so if it now occupies <cc.x,.y>
593 then one of its original spots must be free */
594 if (m_at(cc.x, cc.y))
595 (void) enexto(&cc, u.ux, u.uy, youmonst.data);
597 teleds(cc.x, cc.y, TRUE); /* move hero */
601 if (youmonst.data->mlet != S_PIERCER)
602 return 0; /* lurkers don't attack */
604 obj = which_armor(mtmp, WORN_HELMET);
605 if (obj && is_metallic(obj)) {
607 Your("blow glances off %s %s.", s_suffix(mon_nam(mtmp)),
608 helm_simple_name(obj));
610 Your("
\8dU
\8c\82\82Í%s
\82Ì%s
\82ð
\82©
\82·
\82ß
\82½
\82¾
\82¯
\82¾
\82Á
\82½
\81D", mon_nam(mtmp),
611 helm_simple_name(obj));
614 if (3 + find_mac(mtmp) <= rnd(20)) {
616 pline("%s is hit by a falling piercer (you)!",
618 pline("%s
\82Í
\97\8e\82¿
\82Ä
\82«
\82½
\90j(
\82 \82È
\82½)
\82Å
\8f\9d\82Â
\82¢
\82½
\81I",
620 if ((mtmp->mhp -= d(3, 6)) < 1)
624 pline("%s is almost hit by a falling piercer (you)!",
626 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",
634 pline("It tries to move where you are hiding.");
636 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");
638 /* Ugly kludge for eggs. The message is phrased so as
639 * to be directed at the monster, not the player,
640 * which makes "laid by you" wrong. For the
641 * parallelism to work, we can't rephrase it, so we
642 * zap the "laid by you" momentarily instead.
644 struct obj *obj = level.objects[u.ux][u.uy];
646 if (obj || u.umonnum == PM_TRAPPER
647 || (youmonst.data->mlet == S_EEL
648 && is_pool(u.ux, u.uy))) {
649 int save_spe = 0; /* suppress warning */
653 if (obj->otyp == EGG)
656 /* note that m_monnam() overrides hallucination, which is
657 what we want when message is from mtmp's perspective */
658 if (youmonst.data->mlet == S_EEL
659 || u.umonnum == PM_TRAPPER)
662 "Wait, %s! There's a hidden %s named %s there!",
663 m_monnam(mtmp), youmonst.data->mname, plname);
665 "
\91Ò
\82Ä
\81C%s
\81I%s
\82Æ
\82¢
\82¤
\96¼
\82Ì%s
\82ª
\89B
\82ê
\82Ä
\82¢
\82é
\81I",
666 m_monnam(mtmp), plname, youmonst.data->mname);
671 "Wait, %s! There's a %s named %s hiding under %s!",
672 m_monnam(mtmp), youmonst.data->mname, plname,
673 doname(level.objects[u.ux][u.uy]));
675 "
\91Ò
\82Ä
\81C%s
\81I%s
\82Æ
\82¢
\82¤
\96¼
\82Ì%s
\82ª%s
\82Ì
\89º
\82É
\89B
\82ê
\82Ä
\82¢
\82é
\81I",
676 m_monnam(mtmp), plname, youmonst.data->mname,
677 doname(level.objects[u.ux][u.uy]));
682 impossible("hiding under nothing?");
689 /* hero might be a mimic, concealed via #monster */
690 if (youmonst.data->mlet == S_MIMIC && U_AP_TYPE && !range2
691 && foundyou && !u.uswallow) {
692 boolean sticky = sticks(youmonst.data);
694 if (!canspotmon(mtmp))
695 map_invisible(mtmp->mx, mtmp->my);
696 if (sticky && !youseeit)
698 pline("It gets stuck on you.");
700 pline("
\89½
\8eÒ
\82©
\82ª
\82 \82È
\82½
\82Ì
\8fã
\82É
\82Ì
\82µ
\82©
\82©
\82Á
\82½
\81D");
701 else /* see note about m_monnam() above */
703 pline("Wait, %s! That's a %s named %s!", m_monnam(mtmp),
704 youmonst.data->mname, plname);
706 pline("
\91Ò
\82Ä
\81C%s
\81I
\82»
\82ê
\82Í%s
\82Æ
\82¢
\82¤
\96¼
\82Ì%s
\82¾
\81I", m_monnam(mtmp),
707 plname, youmonst.data->mname);
711 youmonst.m_ap_type = M_AP_NOTHING;
712 youmonst.mappearance = 0;
717 /* non-mimic hero might be mimicking an object after eating m corpse */
718 if (U_AP_TYPE == M_AP_OBJECT && !range2 && foundyou && !u.uswallow) {
719 if (!canspotmon(mtmp))
720 map_invisible(mtmp->mx, mtmp->my);
723 pline("%s %s!", Something, (likes_gold(mtmp->data)
724 && youmonst.mappearance == GOLD_PIECE)
725 ? "tries to pick you up"
728 pline("%s
\82Í%s
\81I", Something, (likes_gold(mtmp->data)
729 && youmonst.mappearance == GOLD_PIECE)
730 ? "
\82 \82È
\82½
\82ð
\8fE
\82¨
\82¤
\82Æ
\82µ
\82½"
731 : "
\96³
\8e\8b\82µ
\82½");
733 else /* see note about m_monnam() above */
735 pline("Wait, %s! That %s is really %s named %s!", m_monnam(mtmp),
736 mimic_obj_name(&youmonst), an(mons[u.umonnum].mname),
739 pline("
\91Ò
\82Ä
\81C%s
\81I
\82»
\82Ì%s
\82Í%s
\82Æ
\82¢
\82¤
\96¼
\82Ì%s
\82¾
\81I", m_monnam(mtmp),
740 mimic_obj_name(&youmonst), plname,
741 mons[u.umonnum].mname);
743 if (multi < 0) { /* this should always be the case */
747 Sprintf(buf, "You appear to be %s again.",
748 Upolyd ? (const char *) an(youmonst.data->mname)
749 : (const char *) "yourself");
751 Sprintf(buf, "
\82 \82È
\82½
\82Í
\82Ó
\82½
\82½
\82Ñ%s
\82É
\82È
\82Á
\82½
\81D",
752 Upolyd ? (const char *) youmonst.data->mname
753 : (const char *) "
\8e©
\95ª
\8e©
\90g");
755 unmul(buf); /* immediately stop mimicking */
760 /* Work out the armor class differential */
761 tmp = AC_VALUE(u.uac) + 10; /* tmp ~= 0 - 20 */
765 if ((Invis && !perceives(mdat)) || !mtmp->mcansee)
772 /* make eels visible the moment they hit/miss us */
773 if (mdat->mlet == S_EEL && mtmp->minvis && cansee(mtmp->mx, mtmp->my)) {
775 newsym(mtmp->mx, mtmp->my);
778 /* Special demon handling code */
779 if ((mtmp->cham == NON_PM) && is_demon(mdat) && !range2
780 && mtmp->data != &mons[PM_BALROG] && mtmp->data != &mons[PM_SUCCUBUS]
781 && mtmp->data != &mons[PM_INCUBUS])
782 if (!mtmp->mcan && !rn2(13))
783 (void) msummon(mtmp);
785 /* Special lycanthrope handling code */
786 if ((mtmp->cham == NON_PM) && is_were(mdat) && !range2) {
787 if (is_human(mdat)) {
788 if (!rn2(5 - (night() * 2)) && !mtmp->mcan)
790 } else if (!rn2(30) && !mtmp->mcan)
794 if (!rn2(10) && !mtmp->mcan) {
795 int numseen, numhelp;
797 char buf[BUFSZ], genericwere[BUFSZ];
799 char genericwere[BUFSZ];
803 Strcpy(genericwere, "creature");
805 Strcpy(genericwere, "
\89½
\82©");
806 numhelp = were_summon(mdat, FALSE, &numseen, genericwere);
809 pline("%s summons help!", Monnam(mtmp));
811 pline("%s
\82Í
\8f\95\82¯
\82ð
\8cÄ
\82ñ
\82¾
\81I", Monnam(mtmp));
815 You_feel("hemmed in.");
817 pline("
\89½
\8eÒ
\82©
\82É
\88Í
\82Ü
\82ê
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82·
\82é
\81D");
820 pline("But none comes.");
822 pline("
\82µ
\82©
\82µ
\89½
\82à
\97\88\82È
\82©
\82Á
\82½
\81D");
824 const char *from_nowhere;
828 pline("%s %s!", Something, makeplural(growl_sound(mtmp)));
830 pline("
\89½
\82©
\82ª%s
\81I", growl_sound(mtmp));
834 from_nowhere = " from nowhere";
836 from_nowhere = "
\82Ç
\82±
\82©
\82ç
\82Æ
\82à
\82È
\82";
840 You_feel("hemmed in.");
842 pline("
\89½
\8eÒ
\82©
\82É
\88Í
\82Ü
\82ê
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82·
\82é
\81D");
846 Sprintf(buf, "%s appears", an(genericwere));
848 Sprintf(buf, "%s appear",
849 makeplural(genericwere));
850 pline("%s%s!", upstart(buf), from_nowhere);
852 pline("%s
\82ª%s
\8c»
\82ê
\82½
\81I",
853 genericwere, from_nowhere);
856 } /* else no help came; but you didn't know it tried */
861 if (u.uinvulnerable) {
862 /* monsters won't attack you */
863 if (mtmp == u.ustuck) {
865 pline("%s loosens its grip slightly.", Monnam(mtmp));
867 pline("%s
\82Í
\92÷
\82ß
\82Â
\82¯
\82ð
\82í
\82¸
\82©
\82É
\8aÉ
\82ß
\82½
\81D", Monnam(mtmp));
868 } else if (!range2) {
869 if (youseeit || sensemon(mtmp))
871 pline("%s starts to attack you, but pulls back.",
873 pline("%s
\82Í
\82 \82È
\82½
\82ð
\8dU
\8c\82\82µ
\82©
\82¯
\82½
\82ª
\81C
\82Ð
\82Á
\82±
\82ß
\82½
\81D",
877 You_feel("%s move nearby.", something);
879 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");
884 /* Unlike defensive stuff, don't let them use item _and_ attack. */
885 if (find_offensive(mtmp)) {
886 int foo = use_offensive(mtmp);
892 for (i = 0; i < NATTK; i++) {
894 mon_currwep = (struct obj *)0;
895 mattk = getmattk(mtmp, &youmonst, i, sum, &alt_attk);
896 if ((u.uswallow && mattk->aatyp != AT_ENGL)
897 || (skipnonmagc && mattk->aatyp != AT_MAGC))
900 switch (mattk->aatyp) {
901 case AT_CLAW: /* "hand to hand" attacks */
908 if (!range2 && (!MON_WEP(mtmp) || mtmp->mconf || Conflict
909 || !touch_petrifies(youmonst.data))) {
911 if (tmp > (j = rnd(20 + i))) {
912 if (mattk->aatyp != AT_KICK
913 || !thick_skinned(youmonst.data))
914 sum[i] = hitmu(mtmp, mattk);
916 missmu(mtmp, (tmp == j), mattk);
918 wildmiss(mtmp, mattk);
919 /* skip any remaining non-spell attacks */
925 case AT_HUGS: /* automatic if prev two attacks succeed */
926 /* Note: if displaced, prev attacks never succeeded */
927 if ((!range2 && i >= 2 && sum[i - 1] && sum[i - 2])
929 sum[i] = hitmu(mtmp, mattk);
932 case AT_GAZE: /* can affect you either ranged or not */
933 /* Medusa gaze already operated through m_respond in
934 dochug(); don't gaze more than once per round. */
935 if (mdat != &mons[PM_MEDUSA])
936 sum[i] = gazemu(mtmp, mattk);
939 case AT_EXPL: /* automatic hit if next to, and aimed at you */
941 sum[i] = explmu(mtmp, mattk, foundyou);
948 || (!mtmp->mspec_used && tmp > (j = rnd(20 + i)))) {
949 /* force swallowing monster to be displayed
950 even when hero is moving away */
952 sum[i] = gulpmu(mtmp, mattk);
954 missmu(mtmp, (tmp == j), mattk);
956 } else if (is_animal(mtmp->data)) {
958 pline("%s gulps some air!", Monnam(mtmp));
960 pline("%s
\82Í
\91§
\82ð
\8bz
\82¢
\82±
\82ñ
\82¾
\81I", Monnam(mtmp));
964 pline("%s lunges forward and recoils!", Monnam(mtmp));
966 pline("%s
\82Í
\93Ë
\90i
\82µ
\81C
\96ß
\82Á
\82½
\81I", Monnam(mtmp));
969 You_hear("a %s nearby.",
970 is_whirly(mtmp->data) ? "rushing noise"
973 You_hear("
\82·
\82®
\82»
\82Î
\82Å%s
\89¹
\82ð
\95·
\82¢
\82½
\81D",
974 is_whirly(mtmp->data) ? "
\93Ë
\8c\82\82µ
\82Ä
\82
\82é"
975 : "
\83s
\83V
\83\83\83b
\82Æ
\82¢
\82¤");
982 sum[i] = breamu(mtmp, mattk);
983 /* Note: breamu takes care of displacement */
987 sum[i] = spitmu(mtmp, mattk);
988 /* Note: spitmu takes care of displacement */
992 if (!Is_rogue_level(&u.uz))
997 /* Rare but not impossible. Normally the monster
998 * wields when 2 spaces away, but it can be
999 * teleported or whatever....
1001 if (mtmp->weapon_check == NEED_WEAPON || !MON_WEP(mtmp)) {
1002 mtmp->weapon_check = NEED_HTH_WEAPON;
1003 /* mon_wield_item resets weapon_check as appropriate */
1004 if (mon_wield_item(mtmp) != 0)
1008 mon_currwep = MON_WEP(mtmp);
1010 hittmp = hitval(mon_currwep, &youmonst);
1012 mswings(mtmp, mon_currwep);
1014 if (tmp > (j = dieroll = rnd(20 + i)))
1015 sum[i] = hitmu(mtmp, mattk);
1017 missmu(mtmp, (tmp == j), mattk);
1018 /* KMH -- Don't accumulate to-hit bonuses */
1022 wildmiss(mtmp, mattk);
1023 /* skip any remaining non-spell attacks */
1030 sum[i] = buzzmu(mtmp, mattk);
1032 sum[i] = castmu(mtmp, mattk, TRUE, foundyou);
1035 default: /* no attack */
1040 /* give player a chance of waking up before dying -kaa */
1041 if (sum[i] == 1) { /* successful attack */
1042 if (u.usleep && u.usleep < monstermoves && !rn2(10)) {
1045 nomovemsg = "The combat suddenly awakens you.";
1047 nomovemsg = "
\82 \82È
\82½
\82Í
\8bN
\82±
\82³
\82ê
\82½
\81D";
1051 return 1; /* attacker dead */
1053 break; /* attacker teleported, no more attacks */
1054 /* sum[i] == 0: unsuccessful attack */
1061 struct permonst *mdat;
1063 if (Sick_resistance) {
1065 You_feel("a slight illness.");
1067 You("
\82·
\82±
\82µ
\8bC
\95ª
\82ª
\88«
\82
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
1070 make_sick(Sick ? Sick / 3L + 1L : (long) rn1(ACURR(A_CON), 20),
1071 mdat->mname, TRUE, SICK_NONVOMITABLE);
1076 /* check whether slippery clothing protects from hug or wrap attack */
1078 u_slip_free(mtmp, mattk)
1080 struct attack *mattk;
1082 struct obj *obj = (uarmc ? uarmc : uarm);
1086 if (mattk->adtyp == AD_DRIN)
1089 /* if your cloak/armor is greased, monster slips off; this
1090 protection might fail (33% chance) when the armor is cursed */
1091 if (obj && (obj->greased || obj->otyp == OILSKIN_CLOAK)
1092 && (!obj->cursed || rn2(3))) {
1094 pline("%s %s your %s %s!", Monnam(mtmp),
1095 (mattk->adtyp == AD_WRAP) ? "slips off of"
1096 : "grabs you, but cannot hold onto",
1097 obj->greased ? "greased" : "slippery",
1098 /* avoid "slippery slippery cloak"
1099 for undiscovered oilskin cloak */
1100 (obj->greased || objects[obj->otyp].oc_name_known)
1102 : cloak_simple_name(obj));
1104 pline("%s
\82Í%s%s%s
\81I", Monnam(mtmp),
1105 obj->greased ? "
\96û
\82Ì
\93h
\82ç
\82ê
\82½" : "
\8a\8a\82è
\82â
\82·
\82¢",
1106 (obj->greased || objects[obj->otyp].oc_name_known)
1108 : cloak_simple_name(obj),
1109 (mattk->adtyp == AD_WRAP) ? "
\82Å
\8a\8a\82Á
\82½"
1110 : "
\82ð
\82Â
\82©
\82Ü
\82¦
\82æ
\82¤
\82Æ
\82µ
\82½
\82ª
\81C
\82Å
\82«
\82È
\82©
\82Á
\82½");
1113 if (obj->greased && !rn2(2)) {
1115 pline_The("grease wears off.");
1117 pline("
\8e\89\82Í
\97\8e\82¿
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D");
1126 /* armor that sufficiently covers the body might be able to block magic */
1134 boolean is_you = (mon == &youmonst),
1135 gotprot = is_you ? (EProtection != 0L)
1136 /* high priests have innate protection */
1137 : (mon->data == &mons[PM_HIGH_PRIEST]);
1139 for (o = is_you ? invent : mon->minvent; o; o = o->nobj) {
1140 /* a_can field is only applicable for armor (which must be worn) */
1141 if ((o->owornmask & W_ARMOR) != 0L) {
1142 armpro = objects[o->otyp].a_can;
1146 /* if we've already confirmed Protection, skip additional checks */
1147 if (is_you || gotprot)
1150 /* omit W_SWAPWEP+W_QUIVER; W_ART+W_ARTI handled by protects() */
1151 wearmask = W_ARMOR | W_ACCESSORY;
1152 if (o->oclass == WEAPON_CLASS || is_weptool(o))
1154 if (protects(o, ((o->owornmask & wearmask) != 0L) ? TRUE : FALSE))
1159 /* extrinsic Protection increases mc by 1 */
1162 } else if (mc < 1) {
1163 /* intrinsic Protection is weaker (play balance; obtaining divine
1164 protection is too easy); it confers minimum mc 1 instead of 0 */
1165 if ((is_you && ((HProtection && u.ublessed > 0) || u.uspellprot))
1166 /* aligned priests and angels have innate intrinsic Protection */
1167 || (mon->data == &mons[PM_ALIGNED_PRIEST] || is_minion(mon->data)))
1174 * hitmu: monster hits you
1175 * returns 2 if monster dies (e.g. "yellow light"), 1 otherwise
1176 * 3 if the monster lives but teleported/paralyzed, so it can't keep
1181 register struct monst *mtmp;
1182 register struct attack *mattk;
1184 struct permonst *mdat = mtmp->data;
1185 int uncancelled, ptmp;
1186 int dmg, armpro, permdmg, tmphp;
1188 struct permonst *olduasmon = youmonst.data;
1191 if (!canspotmon(mtmp))
1192 map_invisible(mtmp->mx, mtmp->my);
1194 /* If the monster is undetected & hits you, you should know where
1195 * the attack came from.
1197 if (mtmp->mundetected && (hides_under(mdat) || mdat->mlet == S_EEL)) {
1198 mtmp->mundetected = 0;
1199 if (!(Blind ? Blind_telepat : Unblind_telepat)) {
1205 if ((obj = level.objects[mtmp->mx][mtmp->my]) != 0) {
1207 if (Blind && !obj->dknown)
1209 else if (is_pool(mtmp->mx, mtmp->my) && !Underwater)
1214 pline("%s was hidden under %s!", Amonnam(mtmp), what);
1216 if (Blind && !obj->dknown)
1217 pline("%s
\82ª
\89½
\82©
\82Ì
\89º
\82É
\89B
\82ê
\82Ä
\82¢
\82é
\81I", Amonnam(mtmp));
1218 else if (is_pool(mtmp->mx, mtmp->my) && !Underwater)
1219 pline("%s
\82ª
\90\85\92\86\82É
\89B
\82ê
\82Ä
\82¢
\82é
\81I", Amonnam(mtmp));
1221 pline("%s
\82ª%s
\82Ì
\89º
\82É
\89B
\82ê
\82Ä
\82¢
\82é
\81I", Amonnam(mtmp), doname(obj));
1224 newsym(mtmp->mx, mtmp->my);
1228 /* First determine the base damage done */
1229 dmg = d((int) mattk->damn, (int) mattk->damd);
1230 if ((is_undead(mdat) || is_vampshifter(mtmp)) && midnight())
1231 dmg += d((int) mattk->damn, (int) mattk->damd); /* extra damage */
1233 /* Next a cancellation factor.
1234 * Use uncancelled when cancellation factor takes into account certain
1235 * armor's special magic protection. Otherwise just use !mtmp->mcan.
1237 armpro = magic_negation(&youmonst);
1238 uncancelled = !mtmp->mcan && (rn2(10) >= 3 * armpro);
1241 /* Now, adjust damages via resistances or specific attacks */
1242 switch (mattk->adtyp) {
1244 if (mattk->aatyp == AT_HUGS && !sticks(youmonst.data)) {
1245 if (!u.ustuck && rn2(2)) {
1246 if (u_slip_free(mtmp, mattk)) {
1251 pline("%s grabs you!", Monnam(mtmp));
1253 pline("%s
\82É
\82Â
\82©
\82Ü
\82¦
\82ç
\82ê
\82Ä
\82¢
\82é
\81I", Monnam(mtmp));
1255 } else if (u.ustuck == mtmp) {
1256 exercise(A_STR, FALSE);
1258 You("are being %s.", (mtmp->data == &mons[PM_ROPE_GOLEM])
1262 You("%s
\82Ä
\82¢
\82é
\81D", (mtmp->data == &mons[PM_ROPE_GOLEM])
1263 ? "
\8eñ
\82ð
\8di
\82ß
\82ç
\82ê"
1264 : "
\89\9f\82µ
\82Â
\82Ô
\82³
\82ê");
1267 } else { /* hand to hand weapon */
1268 struct obj *otmp = mon_currwep;
1270 if (mattk->aatyp == AT_WEAP && otmp) {
1274 if (otmp->otyp == CORPSE
1275 && touch_petrifies(&mons[otmp->corpsenm])) {
1278 pline("%s hits you with the %s corpse.", Monnam(mtmp),
1279 mons[otmp->corpsenm].mname);
1281 pline("%s
\82Í%s
\82Ì
\8e\80\91Ì
\82Å
\8dU
\8c\82\82µ
\82½
\81D", Monnam(mtmp),
1282 mons[otmp->corpsenm].mname);
1287 dmg += dmgval(otmp, &youmonst);
1288 if ((marmg = which_armor(mtmp, W_ARMG)) != 0
1289 && marmg->otyp == GAUNTLETS_OF_POWER)
1290 dmg += rn1(4, 3); /* 3..6 */
1293 if (!(otmp->oartifact
1294 && artifact_hit(mtmp, &youmonst, otmp, &dmg, dieroll)))
1295 hitmsg(mtmp, mattk);
1298 if (objects[otmp->otyp].oc_material == SILVER
1301 pline_The("silver sears your flesh!");
1303 pline("
\82 \82È
\82½
\82Ì
\91Ì
\82Í
\8bâ
\82Å
\8fÄ
\82©
\82ê
\82½
\81I");
1304 exercise(A_CON, FALSE);
1306 /* this redundancy necessary because you have
1307 to take the damage _before_ being cloned;
1308 need to have at least 2 hp left to split */
1315 && (objects[otmp->otyp].oc_material == IRON
1316 /* relevant 'metal' objects are scalpel and tsurugi */
1317 || objects[otmp->otyp].oc_material == METAL)
1318 && (u.umonnum == PM_BLACK_PUDDING
1319 || u.umonnum == PM_BROWN_PUDDING)) {
1321 exercise(A_STR, FALSE);
1322 /* inflict damage now; we know it can't be fatal */
1325 dmg = 0; /* don't inflict more damage below */
1328 You("divide as %s hits you!", mon_nam(mtmp));
1330 pline("%s
\82Ì
\8dU
\8c\82\82É
\82æ
\82Á
\82Ä
\82 \82È
\82½
\82Í
\95ª
\97ô
\82µ
\82½
\81I", mon_nam(mtmp));
1332 rustm(&youmonst, otmp);
1333 } else if (mattk->aatyp != AT_TUCH || dmg != 0
1334 || mtmp != u.ustuck)
1335 hitmsg(mtmp, mattk);
1339 hitmsg(mtmp, mattk);
1340 if (!diseasemu(mdat))
1344 hitmsg(mtmp, mattk);
1347 pline("You're %s!", on_fire(youmonst.data, mattk));
1349 pline("
\82 \82È
\82½
\82Í%s
\81I", on_fire(youmonst.data, mattk));
1350 if (completelyburns(youmonst.data)) { /* paper or straw golem */
1352 You("go up in flames!");
1354 You("
\89\8a\82É
\95ï
\82Ü
\82ê
\82½
\81I");
1355 /* KMH -- this is okay with unchanging */
1358 } else if (Fire_resistance) {
1360 pline_The("fire doesn't feel hot!");
1362 pline("
\89Î
\82Í
\82º
\82ñ
\82º
\82ñ
\94M
\82
\82È
\82¢
\81I");
1365 if ((int) mtmp->m_lev > rn2(20))
1366 destroy_item(SCROLL_CLASS, AD_FIRE);
1367 if ((int) mtmp->m_lev > rn2(20))
1368 destroy_item(POTION_CLASS, AD_FIRE);
1369 if ((int) mtmp->m_lev > rn2(25))
1370 destroy_item(SPBOOK_CLASS, AD_FIRE);
1376 hitmsg(mtmp, mattk);
1379 pline("You're covered in frost!");
1381 You("
\95X
\82Å
\95¢
\82í
\82ê
\82½
\81I");
1382 if (Cold_resistance) {
1384 pline_The("frost doesn't seem cold!");
1386 pline("
\95X
\82Í
\97â
\82³
\82ð
\8a´
\82¶
\82³
\82¹
\82È
\82¢
\81I");
1389 if ((int) mtmp->m_lev > rn2(20))
1390 destroy_item(POTION_CLASS, AD_COLD);
1395 hitmsg(mtmp, mattk);
1400 You("
\93d
\8c\82\82ð
\82
\82ç
\82Á
\82½
\81I");
1401 if (Shock_resistance) {
1403 pline_The("zap doesn't shock you!");
1405 pline("
\93d
\8c\82\82Í
\82µ
\82Ñ
\82ê
\82ð
\8a´
\82¶
\82³
\82¹
\82È
\82¢
\81I");
1408 if ((int) mtmp->m_lev > rn2(20))
1409 destroy_item(WAND_CLASS, AD_ELEC);
1410 if ((int) mtmp->m_lev > rn2(20))
1411 destroy_item(RING_CLASS, AD_ELEC);
1416 hitmsg(mtmp, mattk);
1417 if (uncancelled && multi >= 0 && !rn2(5)) {
1418 if (Sleep_resistance)
1420 fall_asleep(-rnd(10), TRUE);
1423 You("are put to sleep!");
1425 You("
\96°
\82è
\82É
\82¨
\82¿
\82½
\81I");
1428 You("are put to sleep by %s!", mon_nam(mtmp));
1430 You("%s
\82É
\96°
\82ç
\82³
\82ê
\82½
\81I", mon_nam(mtmp));
1434 if (can_blnd(mtmp, &youmonst, mattk->aatyp, (struct obj *) 0)) {
1437 pline("%s blinds you!", Monnam(mtmp));
1439 pline("%s
\82Ì
\8dU
\8c\82\82Å
\96Ú
\82ª
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81I", Monnam(mtmp));
1440 make_blinded(Blinded + (long) dmg, FALSE);
1442 Your1(vision_clears);
1455 hitmsg(mtmp, mattk);
1456 if (uncancelled && !rn2(8)) {
1458 Sprintf(buf, "%s %s", s_suffix(Monnam(mtmp)),
1459 mpoisons_subj(mtmp, mattk));
1461 Sprintf(buf, "%s
\82Ì%s", Monnam(mtmp),
1462 mpoisons_subj(mtmp, mattk));
1464 poisoned(buf, ptmp, mdat->mname, 30, FALSE);
1468 hitmsg(mtmp, mattk);
1469 if (defends(AD_DRIN, uwep) || !has_head(youmonst.data)) {
1471 You("don't seem harmed.");
1473 You("
\8f\9d\82Â
\82¢
\82Ä
\82¢
\82È
\82¢
\82æ
\82¤
\82¾
\81D");
1474 /* Not clear what to do for green slimes */
1477 if (u_slip_free(mtmp, mattk))
1480 if (uarmh && rn2(8)) {
1481 /* not body_part(HEAD) */
1483 Your("%s blocks the attack to your head.",
1485 Your("%s
\82ª
\93ª
\82Ö
\82Ì
\8dU
\8c\82\82ð
\96h
\82¢
\82¾
\81D",
1486 helm_simple_name(uarmh));
1489 /* negative armor class doesn't reduce this damage */
1490 if (Half_physical_damage)
1491 dmg = (dmg + 1) / 2;
1492 mdamageu(mtmp, dmg);
1493 dmg = 0; /* don't inflict a second dose below */
1495 if (!uarmh || uarmh->otyp != DUNCE_CAP) {
1496 /* eat_brains() will miss if target is mindless (won't
1497 happen here; hero is considered to retain his mind
1498 regardless of current shape) or is noncorporeal
1499 (can't happen here; no one can poly into a ghost
1500 or shade) so this check for missing is academic */
1501 if (eat_brains(mtmp, &youmonst, TRUE, (int *) 0) == MM_MISS)
1504 /* adjattrib gives dunce cap message when appropriate */
1505 (void) adjattrib(A_INT, -rnd(2), FALSE);
1506 forget_levels(25); /* lose memory of 25% of levels */
1507 forget_objects(25); /* lose memory of 25% of objects */
1510 hitmsg(mtmp, mattk);
1511 if (uncancelled && multi >= 0 && !rn2(3)) {
1514 You("momentarily stiffen.");
1516 You("
\88ê
\8fu
\8dd
\92¼
\82µ
\82½
\81D");
1522 You("
\93®
\82¯
\82È
\82¢
\81I");
1525 You("are frozen by %s!", mon_nam(mtmp));
1527 pline("%s
\82É
\82æ
\82Á
\82Ä
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81I", mon_nam(mtmp));
1528 nomovemsg = You_can_move_again;
1531 multi_reason = "paralyzed by a monster";
1533 multi_reason = "
\89ö
\95¨
\82É
\96\83á
\83\82³
\82¹
\82ç
\82ê
\82½
\8c\84\82É";
1534 exercise(A_DEX, FALSE);
1539 hitmsg(mtmp, mattk);
1540 if (uncancelled && !rn2(3) && !Drain_resistance) {
1542 losexp("life drainage");
1544 losexp("
\90¶
\96½
\97Í
\82ð
\8bz
\8eû
\82³
\82ê
\82Ä");
1548 long side = rn2(2) ? RIGHT_SIDE : LEFT_SIDE;
1550 const char *sidestr = (side == RIGHT_SIDE) ? "right" : "left",
1552 const char *sidestr = (side == RIGHT_SIDE) ? "
\89E" : "
\8d¶",
1553 *Monst_name = Monnam(mtmp), *leg = body_part(LEG);
1555 /* This case is too obvious to ignore, but Nethack is not in
1556 * general very good at considering height--most short monsters
1557 * still _can_ attack you when you're flying or mounted.
1559 if ((u.usteed || Levitation || Flying) && !is_flyer(mtmp->data)) {
1561 pline("%s tries to reach your %s %s!", Monst_name, sidestr, leg);
1563 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s%s
\82É
\8dU
\8c\82\82µ
\82æ
\82¤
\82Æ
\82µ
\82½
\81I", Monst_name, sidestr, leg);
1565 } else if (mtmp->mcan) {
1567 pline("%s nuzzles against your %s %s!", Monnam(mtmp),
1570 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s%s
\82É
\95@
\82ð
\82·
\82è
\82æ
\82¹
\82½
\81I", Monnam(mtmp),
1576 if (rn2(2) && (uarmf->otyp == LOW_BOOTS
1577 || uarmf->otyp == IRON_SHOES)) {
1579 pline("%s pricks the exposed part of your %s %s!",
1580 Monst_name, sidestr, leg);
1582 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s%s
\82ð
\82¿
\82
\82è
\82Æ
\8eh
\82µ
\82½
\81I",
1583 Monst_name, sidestr, leg);
1585 } else if (!rn2(5)) {
1587 pline("%s pricks through your %s boot!", Monst_name,
1590 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82Ì
\8cC
\82²
\82µ
\82É
\82¿
\82
\82è
\82Æ
\8eh
\82µ
\82½
\81I", Monst_name,
1595 pline("%s scratches your %s boot!", Monst_name,
1598 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82Ì
\8cC
\82ð
\82Ð
\82Á
\82©
\82¢
\82½
\81I", Monst_name,
1606 pline("%s pricks your %s %s!", Monst_name, sidestr, leg);
1608 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s%s
\82ð
\82¿
\82
\82è
\82Æ
\8eh
\82µ
\82½
\81I", Monst_name, sidestr, leg);
1610 set_wounded_legs(side, rnd(60 - ACURR(A_DEX)));
1611 exercise(A_STR, FALSE);
1612 exercise(A_DEX, FALSE);
1616 case AD_STON: /* cockatrice */
1617 hitmsg(mtmp, mattk);
1622 You_hear("a cough from %s!", mon_nam(mtmp));
1624 You_hear("%s
\82ª
\83S
\83z
\83b
\83S
\83z
\83b
\82Æ
\82¢
\82¤
\89¹
\82ð
\95·
\82¢
\82½
\81I", mon_nam(mtmp));
1628 You_hear("%s hissing!", s_suffix(mon_nam(mtmp)));
1630 You_hear("%s
\82ª
\83V
\83\85\81[
\83b
\82Æ
\82¢
\82¤
\90º
\82ð
\95·
\82¢
\82½
\81I", mon_nam(mtmp));
1632 || (flags.moonphase == NEW_MOON && !have_lizard())) {
1634 if (!Stoned && !Stone_resistance
1635 && !(poly_when_stoned(youmonst.data)
1636 && polymon(PM_STONE_GOLEM))) {
1637 int kformat = KILLED_BY_AN;
1638 const char *kname = mtmp->data->mname;
1640 if (mtmp->data->geno & G_UNIQ) {
1641 if (!type_is_pname(mtmp->data))
1643 kformat = KILLED_BY;
1645 make_stoned(5L, (char *) 0, kformat, kname);
1647 /* done_in_by(mtmp, STONING); */
1654 hitmsg(mtmp, mattk);
1655 if (uncancelled && !u.ustuck && !sticks(youmonst.data))
1659 if ((!mtmp->mcan || u.ustuck == mtmp) && !sticks(youmonst.data)) {
1660 if (!u.ustuck && !rn2(10)) {
1661 if (u_slip_free(mtmp, mattk)) {
1665 pline("%s swings itself around you!", Monnam(mtmp));
1667 pline("%s
\82Í
\82 \82È
\82½
\82É
\91Ì
\82ð
\97\8d\82Ý
\82Â
\82©
\82¹
\82½
\81I", Monnam(mtmp));
1670 } else if (u.ustuck == mtmp) {
1671 if (is_pool(mtmp->mx, mtmp->my) && !Swimming && !Amphibious) {
1672 boolean moat = (levl[mtmp->mx][mtmp->my].typ != POOL)
1673 && (levl[mtmp->mx][mtmp->my].typ != WATER)
1674 && !Is_medusa_level(&u.uz)
1675 && !Is_waterlevel(&u.uz);
1678 pline("%s drowns you...", Monnam(mtmp));
1680 pline("
\82 \82È
\82½
\82Í%s
\82É
\97\8d\82Ý
\82Â
\82©
\82ê
\82Ä
\93M
\82ê
\82½
\81D
\81D
\81D", Monnam(mtmp));
1681 killer.format = KILLED_BY_AN;
1683 Sprintf(killer.name, "%s by %s",
1684 moat ? "moat" : "pool of water",
1685 an(mtmp->data->mname));
1687 Sprintf(buf, "%s
\82Ì%s
\82É
\97\8d\82Ý
\82Â
\82©
\82ê
\82Ä",
1688 moat ? "
\96x" : "
\92r",
1692 } else if (mattk->aatyp == AT_HUGS)
1694 You("are being crushed.");
1696 You("
\82Â
\82Ô
\82³
\82ê
\82Â
\82Â
\82 \82é
\81D");
1701 pline("%s brushes against your %s.", Monnam(mtmp),
1704 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82É
\90G
\82ê
\82½
\81D", Monnam(mtmp),
1712 hitmsg(mtmp, mattk);
1713 if (uncancelled && !rn2(4) && u.ulycn == NON_PM
1714 && !Protection_from_shape_changers && !defends(AD_WERE, uwep)) {
1716 You_feel("feverish.");
1718 You("
\94M
\82ª
\82 \82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
1719 exercise(A_CON, FALSE);
1720 set_ulycn(monsndx(mdat));
1721 retouch_equipment(2);
1725 hitmsg(mtmp, mattk);
1726 if (youmonst.data->mlet == mdat->mlet)
1733 if (SYSOPT_SEDUCE) {
1734 if (could_seduce(mtmp, &youmonst, mattk) == 1 && !mtmp->mcan)
1740 case AD_SITM: /* for now these are the same */
1742 if (is_animal(mtmp->data)) {
1743 hitmsg(mtmp, mattk);
1746 /* Continue below */
1747 } else if (dmgtype(youmonst.data, AD_SEDU)
1748 /* !SYSOPT_SEDUCE: when hero is attacking and AD_SSEX
1749 is disabled, it would be changed to another damage
1750 type, but when defending, it remains as-is */
1751 || dmgtype(youmonst.data, AD_SSEX)) {
1753 pline("%s %s.", Monnam(mtmp),
1754 Deaf ? "says something but you can't hear it"
1756 ? "brags about the goods some dungeon explorer provided"
1757 : "makes some remarks about how difficult theft is lately");
1759 pline("%s
\82Í%s
\81D", Monnam(mtmp),
1760 Deaf ? "
\89½
\82©
\82ð
\8c¾
\82Á
\82½
\82ª
\95·
\82±
\82¦
\82È
\82©
\82Á
\82½"
1762 ? "
\82 \82é
\96À
\8b{
\92T
\8c\9f\89Æ
\82ª
\92u
\82¢
\82Ä
\82Á
\82½
\95i
\95¨
\82ð
\8e©
\96\9d\82µ
\82½"
1763 : "
\8dÅ
\8bß
\90Þ
\93\90\82ª
\82¢
\82©
\82É
\8d¢
\93ï
\82©
\92W
\81X
\82Æ
\8fq
\82×
\82½");
1765 if (!tele_restrict(mtmp))
1766 (void) rloc(mtmp, TRUE);
1768 } else if (mtmp->mcan) {
1771 pline("%s tries to %s you, but you seem %s.",
1772 Adjmonnam(mtmp, "plain"),
1773 flags.female ? "charm" : "seduce",
1774 flags.female ? "unaffected" : "uninterested");
1776 pline("%s
\82Í
\82 \82È
\82½
\82ð%s
\82µ
\82æ
\82¤
\82Æ
\82µ
\82½
\81C
\82µ
\82©
\82µ
\82 \82È
\82½
\82Í%s
\81D",
1777 Adjmonnam(mtmp, "
\92n
\96¡
\82È"),
1778 flags.female ? "
\96£
\97¹" : "
\97U
\98f",
1779 flags.female ? "
\89e
\8b¿
\82ð
\8eó
\82¯
\82È
\82¢" : "
\8b»
\96¡
\82ª
\82È
\82¢");
1782 if (!tele_restrict(mtmp))
1783 (void) rloc(mtmp, TRUE);
1789 switch (steal(mtmp, buf)) {
1795 if (!is_animal(mtmp->data) && !tele_restrict(mtmp))
1796 (void) rloc(mtmp, TRUE);
1797 if (is_animal(mtmp->data) && *buf) {
1798 if (canseemon(mtmp))
1800 pline("%s tries to %s away with %s.", Monnam(mtmp),
1801 locomotion(mtmp->data, "run"), buf);
1803 pline("%s
\82Í%s
\82ð
\8e\9d\82Á
\82Ä
\93¦
\82°
\8fo
\82µ
\82½
\81D", Monnam(mtmp),
1807 monflee(mtmp, 0, FALSE, FALSE);
1813 hitmsg(mtmp, mattk);
1814 /* when the Wizard or quest nemesis hits, there's a 1/20 chance
1815 to steal a quest artifact (any, not just the one for the hero's
1816 own role) or the Amulet or one of the invocation tools */
1822 hitmsg(mtmp, mattk);
1826 Your("position suddenly seems %suncertain!",
1827 (Teleport_control && !Stunned && !unconscious()) ? ""
1830 pline("
\8e©
\95ª
\82Ì
\82¢
\82é
\88Ê
\92u
\82ª
\93Ë
\91R%s
\95s
\96¾
\8am
\82É
\82È
\82Á
\82½
\81I",
1831 (Teleport_control && !Stunned && !unconscious()) ? ""
1835 /* As of 3.6.2: make sure damage isn't fatal; previously, it
1836 was possible to be teleported and then drop dead at
1837 the destination when QM's 1d4 damage gets applied below;
1838 even though that wasn't "wrong", it seemed strange,
1839 particularly if the teleportation had been controlled
1840 [applying the damage first and not teleporting if fatal
1841 is another alternative but it has its own complications] */
1842 if ((Half_physical_damage ? (dmg - 1) / 2 : dmg)
1843 >= (tmphp = (Upolyd ? u.mh : u.uhp))) {
1845 if (Half_physical_damage)
1846 dmg *= 2; /* doesn't actually increase damage; we only
1847 * get here if half the original damage would
1848 * would have been fatal, so double reduced
1849 * damage will be less than original damage */
1850 if (dmg < 1) { /* implies (tmphp <= 1) */
1852 /* this might increase current HP beyond maximum HP but
1853 it will be immediately reduced below, so that should
1854 be indistinguishable from zero damage; we don't drop
1855 damage all the way to zero because that inhibits any
1856 passive counterattack if poly'd hero has one */
1857 if (Upolyd && u.mh == 1)
1859 else if (!Upolyd && u.uhp == 1)
1861 /* [don't set context.botl here] */
1867 hitmsg(mtmp, mattk);
1870 if (u.umonnum == PM_IRON_GOLEM) {
1874 You("
\8eK
\82Ñ
\82Â
\82¢
\82½
\81I");
1875 /* KMH -- this is okay with unchanging */
1879 erode_armor(&youmonst, ERODE_RUST);
1882 hitmsg(mtmp, mattk);
1885 erode_armor(&youmonst, ERODE_CORRODE);
1888 hitmsg(mtmp, mattk);
1891 if (u.umonnum == PM_WOOD_GOLEM || u.umonnum == PM_LEATHER_GOLEM) {
1895 You("
\95\85\82Á
\82½
\81I");
1896 /* KMH -- this is okay with unchanging */
1900 erode_armor(&youmonst, ERODE_ROT);
1903 /* a cancelled nurse is just an ordinary monster,
1904 * nurses don't heal those that cause petrification */
1905 if (mtmp->mcan || (Upolyd && touch_petrifies(youmonst.data))) {
1906 hitmsg(mtmp, mattk);
1909 if (!uwep && !uarmu && !uarm && !uarmc
1910 && !uarms && !uarmg && !uarmf && !uarmh) {
1911 boolean goaway = FALSE;
1914 pline("%s hits! (I hope you don't mind.)", Monnam(mtmp));
1916 pline("%s
\82Ì
\8dU
\8c\82\82Í
\96½
\92\86\82µ
\82½
\81D(
\8bC
\82É
\82µ
\82È
\82¢
\82æ
\82¤
\82É
\81D)", Monnam(mtmp));
1920 /* no upper limit necessary; effect is temporary */
1930 /* hard upper limit via nurse care: 25 * ulevel */
1931 if (u.uhpmax < 5 * u.ulevel + d(2 * u.ulevel, 10))
1936 if (u.uhp > u.uhpmax)
1940 exercise(A_STR, TRUE);
1942 exercise(A_CON, TRUE);
1944 make_sick(0L, (char *) 0, FALSE, SICK_ALL);
1949 } else if (!rn2(33)) {
1950 if (!tele_restrict(mtmp))
1951 (void) rloc(mtmp, TRUE);
1952 monflee(mtmp, d(3, 6), TRUE, FALSE);
1957 if (Role_if(PM_HEALER)) {
1958 if (!Deaf && !(moves % 5))
1960 verbalize("Doc, I can't help you unless you cooperate.");
1962 verbalize("
\83h
\83N
\83^
\81[
\81I
\8b¦
\97Í
\82ð
\82¨
\82Ë
\82ª
\82¢
\82µ
\82Ü
\82·
\82í
\81D");
1965 hitmsg(mtmp, mattk);
1969 hitmsg(mtmp, mattk);
1970 if (!night() && mdat == &mons[PM_GREMLIN])
1972 if (!mtmp->mcan && !rn2(10)) {
1976 You_hear("laughter.");
1978 You_hear("
\8fÎ
\82¢
\90º
\82ð
\95·
\82¢
\82½
\81D");
1981 pline("%s chuckles.", Monnam(mtmp));
1983 pline("%s
\82Í
\83N
\83X
\83N
\83X
\8fÎ
\82Á
\82½
\81D", Monnam(mtmp));
1985 if (u.umonnum == PM_CLAY_GOLEM) {
1987 pline("Some writing vanishes from your head!");
1989 pline("
\82¢
\82
\82Â
\82©
\82Ì
\95¶
\8e\9a\82ª
\82 \82È
\82½
\82Ì
\93ª
\82©
\82ç
\8fÁ
\82¦
\82½
\81I");
1990 /* KMH -- this is okay with unchanging */
1998 hitmsg(mtmp, mattk);
1999 if (!mtmp->mcan && !rn2(4)) {
2000 make_stunned((HStun & TIMEOUT) + (long) dmg, TRUE);
2005 hitmsg(mtmp, mattk);
2006 if (!mtmp->mcan && !rn2(3))
2007 if (Acid_resistance) {
2009 pline("You're covered in %s, but it seems harmless.",
2012 pline("%s
\82Å
\95¢
\82í
\82ê
\82½
\81D
\82µ
\82©
\82µ
\8f\9d\82Â
\82©
\82È
\82¢
\81D",
2018 pline("You're covered in %s! It burns!", hliquid("acid"));
2020 pline("%s
\82Å
\95¢
\82í
\82ê
\8fÄ
\82¯
\82½
\81I", hliquid("
\8e_"));
2021 exercise(A_STR, FALSE);
2027 hitmsg(mtmp, mattk);
2028 if (uncancelled && HFast && !defends(AD_SLOW, uwep) && !rn2(4))
2032 hitmsg(mtmp, mattk);
2033 if (uncancelled && !rn2(4)) /* 25% chance */
2038 hitmsg(mtmp, mattk);
2039 if (!mtmp->mcan && !rn2(4) && !mtmp->mspec_used) {
2040 mtmp->mspec_used = mtmp->mspec_used + (dmg + rn2(6));
2043 You("are getting even more confused.");
2045 You("
\82Ü
\82·
\82Ü
\82·
\8d¬
\97\90\82µ
\82½
\81D");
2048 You("are getting confused.");
2050 You("
\8d¬
\97\90\82µ
\82Ä
\82«
\82½
\81D");
2051 make_confused(HConfusion + dmg, FALSE);
2057 pline("%s reaches out with its deadly touch.", Monnam(mtmp));
2059 pline("%s
\82Í
\8e\80\82Ì
\98r
\82ð
\82Ì
\82Î
\82µ
\82½
\81D", Monnam(mtmp));
2060 if (is_undead(youmonst.data)) {
2061 /* Still does normal damage */
2063 pline("Was that the touch of death?");
2065 pline("
\8d¡
\82Ì
\82Í
\8e\80\82Ì
\90é
\8d\90\82¾
\82Á
\82½
\82Ì
\82©
\82È
\81H");
2073 killer.format = KILLED_BY_AN;
2075 Strcpy(killer.name, "touch of death");
2077 Strcpy(killer.name, "
\8e\80\82Ì
\90é
\8d\90\82Å");
2083 default: /* case 16: ... case 5: */
2085 You_feel("your life force draining away...");
2087 You("
\91Ì
\97Í
\82ª
\92D
\82í
\82ê
\82Ä
\82¢
\82
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D
\81D
\81D");
2088 permdmg = 1; /* actual damage done below */
2096 shieldeff(u.ux, u.uy);
2098 pline("Lucky for you, it didn't work!");
2100 pline("
\89^
\82Ì
\82æ
\82¢
\82±
\82Æ
\82É
\82È
\82ñ
\82Æ
\82à
\82È
\82©
\82Á
\82½
\81I");
2107 pline("%s reaches out, and you feel fever and chills.", Monnam(mtmp));
2109 pline("%s
\82Í
\98r
\82ð
\82Ì
\82Î
\82µ
\82½
\81C
\82 \82È
\82½
\82Í
\88«
\8a¦
\82ð
\8a´
\82¶
\82½
\81D", Monnam(mtmp));
2110 (void) diseasemu(mdat); /* plus the normal damage */
2114 pline("%s reaches out, and your body shrivels.", Monnam(mtmp));
2116 pline("%s
\82Í
\98r
\82ð
\90L
\82Î
\82µ
\82½
\81C
\82 \82È
\82½
\82Ì
\91Ì
\82Í
\82µ
\82È
\82Ñ
\82½
\81D", Monnam(mtmp));
2117 exercise(A_CON, FALSE);
2119 morehungry(rn1(40, 40));
2120 /* plus the normal damage */
2123 hitmsg(mtmp, mattk);
2126 if (flaming(youmonst.data)) {
2128 pline_The("slime burns away!");
2130 pline_The("
\83X
\83\89\83C
\83\80\82Í
\94R
\82¦
\82½
\81I");
2132 } else if (Unchanging || noncorporeal(youmonst.data)
2133 || youmonst.data == &mons[PM_GREEN_SLIME]) {
2135 You("are unaffected.");
2137 You("
\89e
\8b¿
\82ð
\8eó
\82¯
\82È
\82¢
\81D");
2139 } else if (!Slimed) {
2141 You("don't feel very well.");
2143 You("
\8bC
\95ª
\82ª
\88«
\82¢
\81D");
2144 make_slimed(10L, (char *) 0);
2145 delayed_killer(SLIMED, KILLED_BY_AN, mtmp->data->mname);
2150 pline("
\83E
\83Q
\83F
\81[
\81I");
2152 case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */
2153 hitmsg(mtmp, mattk);
2154 /* uncancelled is sufficient enough; please
2155 don't make this attack less frequent */
2157 struct obj *obj = some_armor(&youmonst);
2160 /* some rings are susceptible;
2161 amulets and blindfolds aren't (at present) */
2179 if (drain_item(obj, FALSE)) {
2181 pline("%s less effective.", Yobjnam2(obj, "seem"));
2183 Your("%s
\82©
\82ç
\96\82\97Í
\82ª
\8fÁ
\82¦
\82½
\82æ
\82¤
\82¾
\81D", xname(obj));
2191 if ((Upolyd ? u.mh : u.uhp) < 1) {
2192 /* already dead? call rehumanize() or done_in_by() as appropriate */
2197 /* Negative armor class reduces damage done instead of fully protecting
2200 if (dmg && u.uac < 0) {
2207 if (Half_physical_damage
2208 /* Mitre of Holiness */
2209 || (Role_if(PM_PRIEST) && uarmh && is_quest_artifact(uarmh)
2210 && (is_undead(mtmp->data) || is_demon(mtmp->data)
2211 || is_vampshifter(mtmp))))
2212 dmg = (dmg + 1) / 2;
2214 if (permdmg) { /* Death's life force drain */
2215 int lowerlimit, *hpmax_p;
2217 * Apply some of the damage to permanent hit points:
2218 * polymorphed 100% against poly'd hpmax
2219 * hpmax > 25*lvl 100% against normal hpmax
2220 * hpmax > 10*lvl 50..100%
2221 * hpmax > 5*lvl 25..75%
2223 * Never reduces hpmax below 1 hit point per level.
2225 permdmg = rn2(dmg / 2 + 1);
2226 if (Upolyd || u.uhpmax > 25 * u.ulevel)
2228 else if (u.uhpmax > 10 * u.ulevel)
2230 else if (u.uhpmax > 5 * u.ulevel)
2235 /* [can't use youmonst.m_lev] */
2236 lowerlimit = min((int) youmonst.data->mlevel, u.ulevel);
2238 hpmax_p = &u.uhpmax;
2239 lowerlimit = u.ulevel;
2241 if (*hpmax_p - permdmg > lowerlimit)
2242 *hpmax_p -= permdmg;
2243 else if (*hpmax_p > lowerlimit)
2244 *hpmax_p = lowerlimit;
2246 * already at or below minimum threshold; do nothing */
2250 mdamageu(mtmp, dmg);
2254 res = passiveum(olduasmon, mtmp, mattk);
2261 /* An interface for use when taking a blindfold off, for example,
2262 * to see if an engulfing attack should immediately take affect, like
2263 * a passive attack. TRUE if engulfing blindness occurred */
2267 struct attack *mattk;
2269 if (!Blinded && u.uswallow
2270 && (mattk = attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND))
2271 && can_blnd(u.ustuck, &youmonst, mattk->aatyp, (struct obj *) 0)) {
2272 ++u.uswldtim; /* compensate for gulpmu change */
2273 (void) gulpmu(u.ustuck, mattk);
2279 /* monster swallows you, or damage if u.uswallow */
2283 struct attack *mattk;
2285 struct trap *t = t_at(u.ux, u.uy);
2286 int tmp = d((int) mattk->damn, (int) mattk->damd);
2290 boolean physical_damage = FALSE;
2292 if (!u.uswallow) { /* swallows you */
2293 int omx = mtmp->mx, omy = mtmp->my;
2295 if (!engulf_target(mtmp, &youmonst))
2297 if ((t && is_pit(t->ttyp)) && sobj_at(BOULDER, u.ux, u.uy))
2301 unplacebc(); /* ball&chain go away */
2302 remove_monster(omx, omy);
2303 mtmp->mtrapped = 0; /* no longer on old trap */
2304 place_monster(mtmp, u.ux, u.uy);
2306 newsym(mtmp->mx, mtmp->my);
2307 if (is_animal(mtmp->data) && u.usteed) {
2310 /* Too many quirks presently if hero and steed
2311 * are swallowed. Pretend purple worms don't
2312 * like horses for now :-)
2314 Strcpy(buf, mon_nam(u.usteed));
2316 pline("%s lunges forward and plucks you off %s!", Monnam(mtmp),
2319 pline("%s
\82Í
\93Ë
\90i
\82µ
\82 \82È
\82½
\82ð%s
\82©
\82ç
\88ø
\82«
\97\8e\82µ
\82½
\81I", Monnam(mtmp),
2322 dismount_steed(DISMOUNT_ENGULFED);
2325 pline("%s engulfs you!", Monnam(mtmp));
2327 pline("%s
\82Í
\82 \82È
\82½
\82ð
\88ù
\82Ý
\82±
\82ñ
\82¾
\81I", Monnam(mtmp));
2329 reset_occupations(); /* behave as if you had moved */
2333 You("are released from the %s!",
2334 u.utraptype == TT_WEB ? "web" : "trap");
2336 You("%s
\82©
\82ç
\89ð
\95ú
\82³
\82ê
\82½
\81I",
2337 u.utraptype == TT_WEB ? "
\82
\82à
\82Ì
\91\83" : "ã©");
2342 i = number_leashed();
2345 const char *s = (i > 1) ? "leashes" : "leash";
2347 pline_The("%s %s loose.", s, vtense(s, "snap"));
2349 pline("
\95R
\82Í
\83p
\83`
\83\93\82Æ
\82Í
\82¸
\82ê
\82½
\81D");
2354 if (touch_petrifies(youmonst.data) && !resists_ston(mtmp)) {
2355 /* put the attacker back where it started;
2356 the resulting statue will end up there */
2357 remove_monster(mtmp->mx, mtmp->my); /* u.ux,u.uy */
2358 place_monster(mtmp, omx, omy);
2359 minstapetrify(mtmp, TRUE);
2360 /* normally unstuck() would do this, but we're not
2361 fully swallowed yet so that won't work here */
2365 return (!DEADMONSTER(mtmp)) ? 0 : 2;
2368 display_nhwindow(WIN_MESSAGE, FALSE);
2369 vision_recalc(2); /* hero can't see anything */
2371 /* for digestion, shorter time is more dangerous;
2372 for other swallowings, longer time means more
2373 chances for the swallower to attack */
2374 if (mattk->adtyp == AD_DGST) {
2375 tim_tmp = 25 - (int) mtmp->m_lev;
2377 tim_tmp = rnd(tim_tmp) / 2;
2378 else if (tim_tmp < 0)
2379 tim_tmp = -(rnd(-tim_tmp) / 2);
2380 /* having good armor & high constitution makes
2381 it take longer for you to be digested, but
2382 you'll end up trapped inside for longer too */
2383 tim_tmp += -u.uac + 10 + (ACURR(A_CON) / 3 - 1);
2385 /* higher level attacker takes longer to eject hero */
2386 tim_tmp = rnd((int) mtmp->m_lev + 10 / 2);
2388 /* u.uswldtim always set > 1 */
2389 u.uswldtim = (unsigned) ((tim_tmp < 2) ? 2 : tim_tmp);
2391 for (otmp2 = invent; otmp2; otmp2 = otmp2->nobj)
2392 (void) snuff_lit(otmp2);
2395 if (mtmp != u.ustuck)
2398 /* ball&chain are in limbo while swallowed; update their internal
2399 location to be at swallower's spot */
2400 if (uchain->where == OBJ_FREE)
2401 uchain->ox = mtmp->mx, uchain->oy = mtmp->my;
2402 if (uball->where == OBJ_FREE)
2403 uball->ox = mtmp->mx, uball->oy = mtmp->my;
2408 switch (mattk->adtyp) {
2410 physical_damage = TRUE;
2411 if (Slow_digestion) {
2412 /* Messages are handled below */
2415 } else if (u.uswldtim == 0) {
2417 pline("%s totally digests you!", Monnam(mtmp));
2419 pline("%s
\82Í
\82 \82È
\82½
\82ð
\8a®
\91S
\82É
\8fÁ
\89»
\82µ
\82½
\81I", Monnam(mtmp));
2421 if (Half_physical_damage)
2422 tmp *= 2; /* sorry */
2425 pline("%s%s digests you!", Monnam(mtmp),
2426 (u.uswldtim == 2) ? " thoroughly"
2427 : (u.uswldtim == 1) ? " utterly" : "");
2429 pline("%s
\82Í
\82 \82È
\82½
\82ð%s
\8fÁ
\89»
\82µ
\82Ä
\82¢
\82é
\81I", Monnam(mtmp),
2430 (u.uswldtim == 2) ? "
\93O
\92ê
\93I
\82É"
2431 : (u.uswldtim == 1) ? "
\8a®
\91S
\82É" : "");
2433 exercise(A_STR, FALSE);
2437 physical_damage = TRUE;
2438 if (mtmp->data == &mons[PM_FOG_CLOUD]) {
2440 You("are laden with moisture and %s",
2441 flaming(youmonst.data)
2442 ? "are smoldering out!"
2443 : Breathless ? "find it mildly uncomfortable."
2444 : amphibious(youmonst.data)
2446 : "can barely breathe!");
2448 You("
\8e¼
\8bC
\82É
\8bê
\82µ
\82ß
\82ç
\82ê
\81C%s",
2449 flaming(youmonst.data)
2450 ? "
\82
\82·
\82Ô
\82Á
\82½
\81I"
2451 : Breathless ? "
\8f
\81X
\95s
\89õ
\82É
\8a´
\82¶
\82½
\81D"
2452 : amphibious(youmonst.data)
2453 ? "
\88À
\82ç
\82¬
\82ð
\8a´
\82¶
\82½
\81D"
2454 : "
\91§
\82ð
\82·
\82é
\82Ì
\82ª
\82â
\82Á
\82Æ
\82¾
\81I");
2456 /* NB: Amphibious includes Breathless */
2457 if (Amphibious && !flaming(youmonst.data))
2461 You("are pummeled with debris!");
2463 You("
\8a¢âI
\82Å
\92É
\82ß
\82Â
\82¯
\82ç
\82ê
\82½
\81I");
2464 exercise(A_STR, FALSE);
2468 if (Acid_resistance) {
2470 You("are covered with a seemingly harmless goo.");
2472 You("
\96³
\8aQ
\82Á
\82Û
\82¢
\82Ë
\82Î
\82Â
\82
\82à
\82Ì
\82Å
\82¨
\82¨
\82í
\82ê
\82½
\81D");
2477 pline("Ouch! You've been slimed!");
2479 pline("
\82°
\82°
\82ñ
\81I
\82 \82È
\82½
\82Í
\82Ê
\82é
\82Ê
\82é
\82¾
\81I");
2482 You("are covered in slime! It burns!");
2484 You("
\82×
\82Æ
\82×
\82Æ
\82É
\82È
\82Á
\82½
\81D
\82»
\82µ
\82Ä
\8e_
\82É
\8fÄ
\82©
\82ê
\82½
\81I");
2485 exercise(A_STR, FALSE);
2489 if (can_blnd(mtmp, &youmonst, mattk->aatyp, (struct obj *) 0)) {
2491 long was_blinded = Blinded;
2495 You_cant("see in here!");
2497 You("
\89½
\82à
\8c©
\82¦
\82È
\82¢
\81I");
2498 make_blinded((long) tmp, FALSE);
2499 if (!was_blinded && !Blind)
2500 Your1(vision_clears);
2502 /* keep him blind until disgorged */
2503 make_blinded(Blinded + 1, FALSE);
2508 if (!mtmp->mcan && rn2(2)) {
2510 pline_The("air around you crackles with electricity.");
2512 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");
2513 if (Shock_resistance) {
2514 shieldeff(u.ux, u.uy);
2516 You("seem unhurt.");
2518 You("
\8f\9d\82Â
\82©
\82È
\82¢
\82æ
\82¤
\82¾
\81D");
2519 ugolemeffects(AD_ELEC, tmp);
2526 if (!mtmp->mcan && rn2(2)) {
2527 if (Cold_resistance) {
2528 shieldeff(u.ux, u.uy);
2530 You_feel("mildly chilly.");
2532 pline("
\82Ð
\82ñ
\82â
\82è
\82µ
\82½
\81D");
2533 ugolemeffects(AD_COLD, tmp);
2537 You("are freezing to death!");
2539 You("
\93\80\8e\80\82µ
\82»
\82¤
\82¾
\81I");
2544 if (!mtmp->mcan && rn2(2)) {
2545 if (Fire_resistance) {
2546 shieldeff(u.ux, u.uy);
2548 You_feel("mildly hot.");
2550 pline("
\83|
\83J
\83|
\83J
\82µ
\82½
\81D");
2551 ugolemeffects(AD_FIRE, tmp);
2555 You("are burning to a crisp!");
2557 You("
\94R
\82¦
\82Ä
\83J
\83\89\83J
\83\89\82É
\82È
\82Á
\82½
\81I");
2563 if (!diseasemu(mtmp->data))
2567 /* AC magic cancellation doesn't help when engulfed */
2568 if (!mtmp->mcan && rn2(4)) /* 75% chance */
2573 physical_damage = TRUE;
2578 if (physical_damage)
2579 tmp = Maybe_Half_Phys(tmp);
2581 mdamageu(mtmp, tmp);
2586 ; /* life-saving has already expelled swallowed hero */
2587 } else if (touch_petrifies(youmonst.data) && !resists_ston(mtmp)) {
2589 pline("%s very hurriedly %s you!", Monnam(mtmp),
2590 is_animal(mtmp->data) ? "regurgitates" : "expels");
2592 pline("%s
\82Í
\8dQ
\82Ä
\82Ä
\82 \82È
\82½
\82ð%s
\82µ
\82½
\81I", Monnam(mtmp),
2593 is_animal(mtmp->data)? "
\93f
\82«
\96ß" : "
\94r
\8fo");
2595 expels(mtmp, mtmp->data, FALSE);
2596 } else if (!u.uswldtim || youmonst.data->msize >= MZ_HUGE) {
2597 /* As of 3.6.2: u.uswldtim used to be set to 0 by life-saving but it
2598 expels now so the !u.uswldtim case is no longer possible;
2599 however, polymorphing into a huge form while already
2600 swallowed is still possible */
2602 You("get %s!", is_animal(mtmp->data) ? "regurgitated" : "expelled");
2604 You("%s
\82³
\82ê
\82½
\81I", is_animal(mtmp->data)? "
\93f
\82«
\96ß" : "
\94r
\8fo");
2606 && (is_animal(mtmp->data)
2607 || (dmgtype(mtmp->data, AD_DGST) && Slow_digestion)))
2609 pline("Obviously %s doesn't like your taste.", mon_nam(mtmp));
2611 You("
\82Ç
\82¤
\82à%s
\8dD
\82Ý
\82Ì
\96¡
\82¶
\82á
\82È
\82¢
\82æ
\82¤
\82¾
\81D", mon_nam(mtmp));
2612 expels(mtmp, mtmp->data, FALSE);
2617 /* monster explodes in your face */
2619 explmu(mtmp, mattk, ufound)
2621 struct attack *mattk;
2624 boolean physical_damage = TRUE, kill_agr = TRUE;
2631 pline("%s explodes at a spot in %s!",
2632 canseemon(mtmp) ? Monnam(mtmp) : "It",
2633 levl[mtmp->mux][mtmp->muy].typ == WATER ? "empty water"
2636 pline("%s
\82Í
\89½
\82à
\82È
\82¢%s
\82Å
\94\9a\94
\82µ
\82½
\81I",
2637 canseemon(mtmp) ? Monnam(mtmp) : "
\89½
\8eÒ
\82©",
2638 levl[mtmp->mux][mtmp->muy].typ == WATER ? "
\90\85\92\86"
2642 int tmp = d((int) mattk->damn, (int) mattk->damd);
2643 boolean not_affected = defends((int) mattk->adtyp, uwep);
2645 hitmsg(mtmp, mattk);
2647 switch (mattk->adtyp) {
2649 physical_damage = FALSE;
2650 not_affected |= Cold_resistance;
2653 physical_damage = FALSE;
2654 not_affected |= Fire_resistance;
2657 physical_damage = FALSE;
2658 not_affected |= Shock_resistance;
2661 /* there aren't any exploding creatures with AT_EXPL attack
2662 for AD_PHYS damage but there might be someday; without this,
2663 static analysis complains that 'physical_damage' is always
2664 False when tested below; it's right, but having that in
2665 place means one less thing to update if AD_PHYS gets added */
2668 if (!not_affected) {
2669 if (ACURR(A_DEX) > rnd(20)) {
2671 You("duck some of the blast.");
2673 You("
\8fÕ
\8c\82\82ð
\82³
\82¯
\82½
\81D");
2674 tmp = (tmp + 1) / 2;
2678 You("get blasted!");
2680 You("
\8fÕ
\8c\82\82ð
\82
\82ç
\82Á
\82½
\81I");
2682 if (mattk->adtyp == AD_FIRE)
2684 if (physical_damage)
2685 tmp = Maybe_Half_Phys(tmp);
2686 mdamageu(mtmp, tmp);
2691 not_affected = resists_blnd(&youmonst);
2692 if (!not_affected) {
2693 /* sometimes you're affected even if it's invisible */
2694 if (mon_visible(mtmp) || (rnd(tmp /= 2) > u.ulevel)) {
2696 You("are blinded by a blast of light!");
2698 You("
\82Ü
\82Î
\82ä
\82¢
\8cõ
\82É
\96Ú
\82ª
\82
\82ç
\82ñ
\82¾
\81I");
2699 make_blinded((long) tmp, FALSE);
2701 Your1(vision_clears);
2702 } else if (flags.verbose)
2704 You("get the impression it was not terribly bright.");
2706 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");
2711 not_affected |= Blind || (u.umonnum == PM_BLACK_LIGHT
2712 || u.umonnum == PM_VIOLET_FUNGUS
2713 || dmgtype(youmonst.data, AD_STUN));
2714 if (!not_affected) {
2718 You("are caught in a blast of kaleidoscopic light!");
2720 You("
\96\9c\89Ø
\8b¾
\82Ì
\8cõ
\82É
\95ß
\82ç
\82¦
\82ç
\82ê
\82½
\81I");
2721 /* avoid hallucinating the black light as it dies */
2722 mondead(mtmp); /* remove it from map now */
2723 kill_agr = FALSE; /* already killed (maybe lifesaved) */
2725 make_hallucinated(HHallucination + (long) tmp, FALSE, 0L);
2727 You("%s.", chg ? "are freaked out" : "seem unaffected");
2729 You("%s
\81D", chg ? "
\90\8c\82¢
\82µ
\82ê
\82½" : "
\89e
\8b¿
\82ð
\8eó
\82¯
\82È
\82©
\82Á
\82½");
2738 You("seem unaffected by it.");
2740 You("
\89e
\8b¿
\82ð
\8eó
\82¯
\82È
\82¢
\82æ
\82¤
\82¾
\81D");
2741 ugolemeffects((int) mattk->adtyp, tmp);
2746 wake_nearto(mtmp->mx, mtmp->my, 7 * 7);
2747 return (!DEADMONSTER(mtmp)) ? 0 : 2;
2750 /* monster gazes at you */
2754 struct attack *mattk;
2756 static const char *const reactions[] = {
2758 "confused", /* [0] */
2759 "stunned", /* [1] */
2760 "puzzled", "dazzled", /* [2,3] */
2761 "irritated", "inflamed", /* [4,5] */
2765 "
\8d¬
\97\90\82µ
\82½", /* [0] */
2766 "
\9eN
\9eO
\82Æ
\82µ
\82½", /* [1] */
2767 "
\8d¢
\98f
\82µ
\82½", "
\8c¶
\98f
\82³
\82ê
\82½", /* [2,3] */
2768 "
\83C
\83\89\83C
\83\89\82µ
\82½", "
\8b»
\95±
\82µ
\82½", /* [4,5] */
2769 "
\94æ
\82ê
\82½", /* [6] */
2770 "
\82Ú
\82ñ
\82â
\82è
\82µ
\82½", /* [7] */
2774 boolean cancelled = (mtmp->mcan != 0), already = FALSE;
2776 /* assumes that hero has to see monster's gaze in order to be
2777 affected, rather than monster just having to look at hero;
2778 when hallucinating, hero's brain doesn't register what
2779 it's seeing correctly so the gaze is usually ineffective
2780 [this could be taken a lot farther and select a gaze effect
2781 appropriate to what's currently being displayed, giving
2782 ordinary monsters a gaze attack when hero thinks he or she
2783 is facing a gazing creature, but let's not go that far...] */
2784 if (Hallucination && rn2(4))
2787 switch (mattk->adtyp) {
2789 if (cancelled || !mtmp->mcansee) {
2790 if (!canseemon(mtmp))
2791 break; /* silently */
2793 pline("%s %s.", Monnam(mtmp),
2794 (mtmp->data == &mons[PM_MEDUSA] && mtmp->mcan)
2795 ? "doesn't look all that ugly"
2796 : "gazes ineffectually");
2798 pline("%s
\82Í%s
\81D", Monnam(mtmp),
2799 (mtmp->data == &mons[PM_MEDUSA] && mtmp->mcan)
2800 ? "
\82»
\82ê
\82Ù
\82Ç
\8fX
\82
\82È
\82¢
\82±
\82Æ
\82É
\8bC
\82ª
\82Â
\82¢
\82½"
2801 : "
\96³
\88Ó
\96¡
\82É
\82É
\82ç
\82ñ
\82¾");
2805 if (Reflecting && couldsee(mtmp->mx, mtmp->my)
2806 && mtmp->data == &mons[PM_MEDUSA]) {
2807 /* hero has line of sight to Medusa and she's not blind */
2808 boolean useeit = canseemon(mtmp);
2812 (void) ureflects("%s gaze is reflected by your %s.",
2813 s_suffix(Monnam(mtmp)));
2815 (void) ureflects("%s
\82Ì
\82É
\82ç
\82Ý
\82Í%s
\82Å
\94½
\8eË
\82³
\82ê
\82½
\81D",
2819 mtmp, !useeit ? (char *) 0
2821 : "The gaze is reflected away by %s %s!"))
2823 : "
\82É
\82ç
\82Ý
\82Í%s
\82Ì%s
\82É
\82æ
\82Á
\82Ä
\94½
\8eË
\82³
\82ê
\82½
\81I"))
2825 if (!m_canseeu(mtmp)) { /* probably you're invisible */
2829 "%s doesn't seem to notice that %s gaze was reflected.",
2830 Monnam(mtmp), mhis(mtmp));
2832 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",
2839 pline("%s is turned to stone!", Monnam(mtmp));
2841 pline("%s
\82Í
\90Î
\82É
\82È
\82Á
\82½
\81I", Monnam(mtmp));
2845 if (!DEADMONSTER(mtmp))
2849 if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my)
2850 && !Stone_resistance) {
2852 You("meet %s gaze.", s_suffix(mon_nam(mtmp)));
2854 You("%s
\82É
\82É
\82ç
\82Ü
\82ê
\82½
\81D", mon_nam(mtmp));
2856 if (poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))
2859 You("turn to stone...");
2861 You("
\90Î
\82É
\82È
\82Á
\82½
\81D
\81D
\81D");
2862 killer.format = KILLED_BY;
2863 Strcpy(killer.name, mtmp->data->mname);
2868 if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
2869 && !mtmp->mspec_used && rn2(5)) {
2871 react = 0; /* "confused" */
2872 already = (mtmp->mconf != 0);
2876 mtmp->mspec_used = mtmp->mspec_used + (conf + rn2(6));
2879 pline("%s gaze confuses you!", s_suffix(Monnam(mtmp)));
2881 pline("%s
\82Ì
\82É
\82ç
\82Ý
\82Å
\82 \82È
\82½
\82Í
\8d¬
\97\90\82µ
\82½
\81I", Monnam(mtmp));
2884 You("are getting more and more confused.");
2886 You("
\82Ü
\82·
\82Ü
\82·
\8d¬
\97\90\82µ
\82½
\81D");
2887 make_confused(HConfusion + conf, FALSE);
2893 if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
2894 && !mtmp->mspec_used && rn2(5)) {
2896 react = 1; /* "stunned" */
2897 already = (mtmp->mstun != 0);
2901 mtmp->mspec_used = mtmp->mspec_used + (stun + rn2(6));
2903 pline("%s stares piercingly at you!", Monnam(mtmp));
2905 pline("%s
\82Í
\97â
\82½
\82¢
\82Ü
\82È
\82´
\82µ
\82ð
\82 \82È
\82½
\82É
\8cü
\82¯
\82½
\81I", Monnam(mtmp));
2906 make_stunned((HStun & TIMEOUT) + (long) stun, TRUE);
2912 if (canseemon(mtmp) && !resists_blnd(&youmonst)
2913 && distu(mtmp->mx, mtmp->my) <= BOLT_LIM * BOLT_LIM) {
2915 react = rn1(2, 2); /* "puzzled" || "dazzled" */
2916 already = (mtmp->mcansee == 0);
2917 /* Archons gaze every round; we don't want cancelled ones
2918 giving the "seems puzzled/dazzled" message that often */
2919 if (mtmp->mcan && mtmp->data == &mons[PM_ARCHON] && rn2(5))
2922 int blnd = d((int) mattk->damn, (int) mattk->damd);
2925 You("are blinded by %s radiance!", s_suffix(mon_nam(mtmp)));
2927 You("%s
\82Ì
\8cõ
\82Å
\96Ú
\82ª
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81I", mon_nam(mtmp));
2928 make_blinded((long) blnd, FALSE);
2930 /* not blind at this point implies you're wearing
2931 the Eyes of the Overworld; make them block this
2932 particular stun attack too */
2934 Your1(vision_clears);
2936 long oldstun = (HStun & TIMEOUT), newstun = (long) rnd(3);
2938 /* we don't want to increment stun duration every time
2939 or sighted hero will become incapacitated */
2940 make_stunned(max(oldstun, newstun), TRUE);
2946 if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
2947 && !mtmp->mspec_used && rn2(5)) {
2949 react = rn1(2, 4); /* "irritated" || "inflamed" */
2951 int dmg = d(2, 6), lev = (int) mtmp->m_lev;
2954 pline("%s attacks you with a fiery gaze!", Monnam(mtmp));
2956 pline("%s
\82Í
\89\8a\82Ì
\82É
\82ç
\82Ý
\8dU
\8c\82\82ð
\82µ
\82Ä
\82«
\82½
\81I", Monnam(mtmp));
2958 if (Fire_resistance) {
2960 pline_The("fire doesn't feel hot!");
2962 pline("
\89Î
\82Í
\82º
\82ñ
\82º
\82ñ
\94M
\82
\82È
\82¢
\81I");
2967 destroy_item(SCROLL_CLASS, AD_FIRE);
2969 destroy_item(POTION_CLASS, AD_FIRE);
2971 destroy_item(SPBOOK_CLASS, AD_FIRE);
2973 mdamageu(mtmp, dmg);
2977 #ifdef PM_BEHOLDER /* work in progress */
2979 if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
2980 && multi >= 0 && !rn2(5) && !Sleep_resistance) {
2982 react = 6; /* "tired" */
2983 already = (mtmp->mfrozen != 0); /* can't happen... */
2985 fall_asleep(-rnd(10), TRUE);
2987 pline("%s gaze makes you very sleepy...",
2988 s_suffix(Monnam(mtmp)));
2990 pline("%s
\82Ì
\82É
\82ç
\82Ý
\82Å
\82 \82È
\82½
\82Í
\96°
\82
\82È
\82Á
\82½
\81D
\81D
\81D",
2997 if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
2998 && (HFast & (INTRINSIC | TIMEOUT)) && !defends(AD_SLOW, uwep)
3001 react = 7; /* "dulled" */
3002 already = (mtmp->mspeed == MSLOW);
3009 #endif /* BEHOLDER */
3011 impossible("Gaze attack %d?", mattk->adtyp);
3015 if (Hallucination && rn2(3))
3016 react = rn2(SIZE(reactions));
3017 /* cancelled/hallucinatory feedback; monster might look "confused",
3018 "stunned",&c but we don't actually set corresponding attribute */
3020 pline("%s looks %s%s.", Monnam(mtmp),
3021 !rn2(3) ? "" : already ? "quite "
3022 : (!rn2(2) ? "a bit " : "somewhat "),
3025 pline("%s
\82Í%s%s
\82æ
\82¤
\82¾
\81D", Monnam(mtmp),
3026 !rn2(3) ? "" : already ? "
\82©
\82È
\82è"
3027 : (!rn2(2) ? "
\8f
\82µ" : "
\82¢
\82
\82ç
\82©"),
3034 /* mtmp hits you for n points damage */
3048 done_in_by(mtmp, DIED);
3052 /* returns 0 if seduction impossible,
3054 * 2 if wrong gender for nymph
3057 could_seduce(magr, mdef, mattk)
3058 struct monst *magr, *mdef;
3059 struct attack *mattk; /* non-Null: current attack; Null: general capability */
3061 struct permonst *pagr;
3062 boolean agrinvis, defperc;
3063 xchar genagr, gendef;
3066 if (is_animal(magr->data))
3068 if (magr == &youmonst) {
3069 pagr = youmonst.data;
3070 agrinvis = (Invis != 0);
3071 genagr = poly_gender();
3074 agrinvis = magr->minvis;
3075 genagr = gender(magr);
3077 if (mdef == &youmonst) {
3078 defperc = (See_invisible != 0);
3079 gendef = poly_gender();
3081 defperc = perceives(mdef->data);
3082 gendef = gender(mdef);
3085 adtyp = mattk ? mattk->adtyp
3086 : dmgtype(pagr, AD_SSEX) ? AD_SSEX
3087 : dmgtype(pagr, AD_SEDU) ? AD_SEDU
3089 if (adtyp == AD_SSEX && !SYSOPT_SEDUCE)
3092 if (agrinvis && !defperc && adtyp == AD_SEDU)
3095 /* nymphs have two attacks, one for steal-item damage and the other
3096 for seduction, both pass the could_seduce() test;
3097 incubi/succubi have three attacks, their claw attacks for damage
3098 don't pass the test */
3099 if ((pagr->mlet != S_NYMPH
3100 && pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS])
3101 || (adtyp != AD_SEDU && adtyp != AD_SSEX && adtyp != AD_SITM))
3104 return (genagr == 1 - gendef) ? 1 : (pagr->mlet == S_NYMPH) ? 2 : 0;
3107 /* returns 1 if monster teleported (or hero leaves monster's vicinity) */
3112 struct obj *ring, *nring;
3113 boolean fem = (mon->data == &mons[PM_SUCCUBUS]); /* otherwise incubus */
3114 boolean seewho, naked; /* True iff no armor */
3115 int attr_tot, tried_gloves = 0;
3116 char qbuf[QBUFSZ], Who[QBUFSZ];
3118 if (mon->mcan || mon->mspec_used) {
3120 pline("%s acts as though %s has got a %sheadache.", Monnam(mon),
3121 mhe(mon), mon->mcan ? "severe " : "");
3123 pline("%s
\82Í%s
\93ª
\82ª
\92É
\82¢
\82Ó
\82è
\82ð
\82µ
\82½
\81D", Monnam(mon),
3124 mon->mcan ? "
\82Ð
\82Ç
\82" : "");
3128 if (unconscious()) {
3130 pline("%s seems dismayed at your lack of response.", Monnam(mon));
3132 pline("%s
\82Í
\95Ô
\8e\96\82ª
\82È
\82¢
\82Ì
\82Å
\8bC
\82ª
\88Þ
\82¦
\82½
\82æ
\82¤
\82¾
\81D", Monnam(mon));
3135 seewho = canseemon(mon);
3138 pline("Someone caresses you...");
3140 pline("
\89½
\8eÒ
\82©
\82ª
\82 \82È
\82½
\82ð
\95ø
\82«
\82µ
\82ß
\82Ä
\82¢
\82é
\81D
\81D
\81D");
3143 You_feel("very attracted to %s.", mon_nam(mon));
3145 You("%s
\82É
\88ø
\82«
\82Â
\82¯
\82ç
\82ê
\82Ä
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", mon_nam(mon));
3146 /* cache the seducer's name in a local buffer */
3148 Strcpy(Who, (!seewho ? (fem ? "She" : "He") : Monnam(mon)));
3150 Strcpy(Who, (!seewho ? (fem ? "
\94Þ
\8f\97" : "
\94Þ") : Monnam(mon)));
3152 /* if in the process of putting armor on or taking armor off,
3153 interrupt that activity now */
3154 (void) stop_donning((struct obj *) 0);
3155 /* don't try to take off gloves if cursed weapon blocks them */
3159 for (ring = invent; ring; ring = nring) {
3161 if (ring->otyp != RIN_ADORNMENT)
3164 if (ring->owornmask && uarmg) {
3165 /* don't take off worn ring if gloves are in the way */
3166 if (!tried_gloves++)
3168 mayberem(mon, Who, uarmg, "gloves");
3170 mayberem(mon, Who, uarmg, "
\8f¬
\8eè");
3172 continue; /* next ring might not be worn */
3174 /* confirmation prompt when charisma is high bypassed if deaf */
3175 if (!Deaf && rn2(20) < ACURR(A_CHA)) {
3177 (void) safe_qbuf(qbuf, "\"That ",
3178 " looks pretty. May I have it?\"", ring,
3179 xname, simpleonames, "ring");
3181 (void) safe_qbuf(qbuf, "
\81u
\82È
\82ñ
\82Ä
\91f
\93G
\82È",
3182 "
\82Å
\82µ
\82å
\82¤
\81D
\82í
\82½
\82µ
\82É
\82
\82ê
\82Ü
\82¹
\82ñ
\81H
\81v", ring,
3183 xname, simpleonames, "
\8ew
\97Ö");
3185 makeknown(RIN_ADORNMENT);
3186 if (yn(qbuf) == 'n')
3190 pline("%s decides she'd like %s, and takes it.",
3193 pline("%s
\82Í%s
\82ª
\82Æ
\82Ä
\82à
\8bC
\82É
\82¢
\82Á
\82Ä
\81C
\82»
\82ê
\82ð
\8eæ
\82è
\82 \82°
\82½
\81D",
3196 makeknown(RIN_ADORNMENT);
3197 /* might be in left or right ring slot or weapon/alt-wep/quiver */
3198 if (ring->owornmask)
3199 remove_worn_item(ring, FALSE);
3201 (void) mpickobj(mon, ring);
3203 if (uleft && uright && uleft->otyp == RIN_ADORNMENT
3204 && uright->otyp == RIN_ADORNMENT)
3206 if (ring == uleft || ring == uright)
3209 /* don't put on ring if gloves are in the way */
3210 if (!tried_gloves++)
3212 mayberem(mon, Who, uarmg, "gloves");
3214 mayberem(mon, Who, uarmg, "
\8f¬
\8eè");
3216 break; /* no point trying further rings */
3218 /* confirmation prompt when charisma is high bypassed if deaf */
3219 if (!Deaf && rn2(20) < ACURR(A_CHA)) {
3221 (void) safe_qbuf(qbuf, "\"That ",
3222 " looks pretty. Would you wear it for me?\"",
3223 ring, xname, simpleonames, "ring");
3225 (void) safe_qbuf(qbuf, "
\81u
\82¨
\82â
\82È
\82ñ
\82Ä
\82·
\82Î
\82ç
\82µ
\82¢",
3226 "
\82¾
\81D
\8e\84\82Ì
\82½
\82ß
\82É
\8ew
\82É
\82Í
\82ß
\82Ä
\82
\82ê
\82È
\82¢
\82©
\82¢
\81H
\81v",
3227 ring, xname, simpleonames, "
\8ew
\97Ö");
3229 makeknown(RIN_ADORNMENT);
3230 if (yn(qbuf) == 'n')
3234 pline("%s decides you'd look prettier wearing %s,",
3237 pline("%s
\82Í%s
\82ð
\82Â
\82¯
\82½
\82 \82È
\82½
\82ª
\82æ
\82è
\96£
\97Í
\93I
\82¾
\82Æ
\8dl
\82¦
\81C",
3241 pline("and puts it on your finger.");
3243 pline("
\82 \82È
\82½
\82Ì
\8ew
\82É
\82»
\82ê
\82ð
\82Í
\82ß
\82½
\81D");
3245 makeknown(RIN_ADORNMENT);
3248 pline("%s puts %s on your right %s.",
3249 Who, the(xname(ring)), body_part(HAND));
3251 pline("%s
\82Í%s
\82ð
\82 \82È
\82½
\82Ì
\89E%s
\82É
\82Í
\82ß
\82½
\81D",
3252 Who, the(xname(ring)), body_part(HAND));
3254 setworn(ring, RIGHT_RING);
3255 } else if (!uleft) {
3257 pline("%s puts %s on your left %s.",
3258 Who, the(xname(ring)), body_part(HAND));
3260 pline("%s
\82Í%s
\82ð
\82 \82È
\82½
\82Ì
\8d¶%s
\82É
\82Í
\82ß
\82½
\81D",
3261 Who, the(xname(ring)), body_part(HAND));
3263 setworn(ring, LEFT_RING);
3264 } else if (uright && uright->otyp != RIN_ADORNMENT) {
3265 /* note: the "replaces" message might be inaccurate if
3266 hero's location changes and the process gets interrupted,
3267 but trying to figure that out in advance in order to use
3268 alternate wording is not worth the effort */
3270 pline("%s replaces %s with %s.",
3271 Who, yname(uright), yname(ring));
3273 pline("%s
\82Í%s
\82ð%s
\82É
\82Æ
\82è
\82©
\82¦
\82½
\81D",
3274 Who, yname(uright), xname(ring));
3277 /* ring removal might cause loss of levitation which could
3278 drop hero onto trap that transports hero somewhere else */
3279 if (u.utotype || distu(mon->mx, mon->my) > 2)
3281 setworn(ring, RIGHT_RING);
3282 } else if (uleft && uleft->otyp != RIN_ADORNMENT) {
3283 /* see "replaces" note above */
3285 pline("%s replaces %s with %s.",
3286 Who, yname(uleft), yname(ring));
3288 pline("%s
\82Í%s
\82ð%s
\82É
\82Æ
\82è
\82©
\82¦
\82½
\81D",
3289 Who, yname(uleft), xname(ring));
3292 if (u.utotype || distu(mon->mx, mon->my) > 2)
3294 setworn(ring, LEFT_RING);
3296 impossible("ring replacement");
3298 prinv((char *) 0, ring, 0L);
3302 naked = (!uarmc && !uarmf && !uarmg && !uarms && !uarmh && !uarmu);
3304 pline("%s %s%s.", Who,
3305 Deaf ? "seems to murmur into your ear"
3306 : naked ? "murmurs sweet nothings into your ear"
3307 : "murmurs in your ear",
3308 naked ? "" : ", while helping you undress");
3310 pline("%s
\82Í%s%s
\81D", Who,
3311 naked ? "" : "
\82 \82È
\82½
\82Ì
\95\9e\82ð
\92E
\82ª
\82¹
\82È
\82ª
\82ç",
3312 Deaf ? "
\8e¨
\82à
\82Æ
\82Å
\89½
\82©
\82Â
\82Ô
\82â
\82¢
\82½
\82æ
\82¤
\82¾"
3313 : naked ? "
\8e¨
\82à
\82Æ
\82Å
\8aÃ
\82¢
\82³
\82³
\82â
\82«
\82ð
\82Â
\82Ô
\82â
\82¢
\82½"
3314 : "
\82 \82È
\82½
\82Ì
\8e¨
\82à
\82Æ
\82Å
\82Â
\82Ô
\82â
\82¢
\82½");
3316 mayberem(mon, Who, uarmc, cloak_simple_name(uarmc));
3318 mayberem(mon, Who, uarm, suit_simple_name(uarm));
3320 mayberem(mon, Who, uarmf, "boots");
3322 mayberem(mon, Who, uarmf, "
\83u
\81[
\83c");
3325 mayberem(mon, Who, uarmg, "gloves");
3327 mayberem(mon, Who, uarmg, "
\8f¬
\8eè");
3329 mayberem(mon, Who, uarms, "shield");
3331 mayberem(mon, Who, uarms, "
\8f\82");
3332 mayberem(mon, Who, uarmh, helm_simple_name(uarmh));
3333 if (!uarmc && !uarm)
3335 mayberem(mon, Who, uarmu, "shirt");
3337 mayberem(mon, Who, uarmu, "
\83V
\83\83\83c");
3339 /* removing armor (levitation boots, or levitation ring to make
3340 room for adornment ring with incubus case) might result in the
3341 hero falling through a trap door or landing on a teleport trap
3342 and changing location, so hero might not be adjacent to seducer
3343 any more (mayberem() has its own adjacency test so we don't need
3344 to check after each potential removal) */
3345 if (u.utotype || distu(mon->mx, mon->my) > 2)
3348 if (uarm || uarmc) {
3351 verbalize("You're such a %s; I wish...",
3352 flags.female ? "sweet lady" : "nice guy");
3354 verbalize("%s
\82¾
\81D
\81D
\81D
\82Æ
\82¢
\82¢
\82Ì
\82É
\81D",
3355 flags.female ? "
\83`
\83\83\81[
\83~
\83\93\83O" : "
\82·
\82Ä
\82«");
3359 pline("%s appears to sigh.", Monnam(mon));
3361 pline("%s
\82Í
\82½
\82ß
\91§
\82ð
\82Â
\82¢
\82½
\82æ
\82¤
\82¾
\81D", Monnam(mon));
3362 /* else no regret message if can't see or hear seducer */
3364 if (!tele_restrict(mon))
3365 (void) rloc(mon, TRUE);
3368 if (u.ualign.type == A_CHAOTIC)
3371 /* by this point you have discovered mon's identity, blind or not... */
3373 pline("Time stands still while you and %s lie in each other's arms...",
3375 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",
3377 /* 3.6.1: a combined total for charisma plus intelligence of 35-1
3378 used to guarantee successful outcome; now total maxes out at 32
3379 as far as deciding what will happen; chance for bad outcome when
3380 Cha+Int is 32 or more is 2/35, a bit over 5.7% */
3381 attr_tot = ACURR(A_CHA) + ACURR(A_INT);
3382 if (rn2(35) > min(attr_tot, 32)) {
3383 /* Don't bother with mspec_used here... it didn't get tired! */
3385 pline("%s seems to have enjoyed it more than you...",
3387 pline("%s
\82Í
\82 \82È
\82½
\82æ
\82è
\8ay
\82µ
\82ñ
\82¾
\82æ
\82¤
\82¾
\81D
\81D
\81D",
3392 You_feel("drained of energy.");
3394 You("
\91Ì
\97Í
\82ª
\8fÁ
\96Õ
\82µ
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
3396 u.uenmax -= rnd(Half_physical_damage ? 5 : 10);
3397 exercise(A_CON, FALSE);
3403 You("are down in the dumps.");
3405 You("
\88Ó
\8bC
\8fÁ
\92¾
\82µ
\82½
\81D");
3406 (void) adjattrib(A_CON, -1, TRUE);
3407 exercise(A_CON, FALSE);
3412 Your("senses are dulled.");
3414 Your("
\8cÜ
\8a´
\82Í
\93Ý
\82Á
\82½
\81D");
3415 (void) adjattrib(A_WIS, -1, TRUE);
3416 exercise(A_WIS, FALSE);
3420 if (!resists_drli(&youmonst)) {
3422 You_feel("out of shape.");
3424 You("
\82
\82½
\82Ñ
\82ê
\82½
\81D");
3426 losexp("overexertion");
3428 losexp("
\89ß
\98J
\82Å");
3431 You("have a curious feeling...");
3433 You("
\95Ï
\82È
\8a´
\82¶
\82ª
\82µ
\82½
\81D
\81D
\81D");
3435 exercise(A_CON, FALSE);
3436 exercise(A_DEX, FALSE);
3437 exercise(A_WIS, FALSE);
3443 You_feel("exhausted.");
3445 You("
\94æ
\82ê
\82ð
\8a´
\82¶
\82½
\81D");
3446 exercise(A_STR, FALSE);
3449 losehp(Maybe_Half_Phys(tmp), "exhaustion", KILLED_BY);
3451 losehp(Maybe_Half_Phys(tmp), "
\90¸
\97Í
\82Ì
\8eg
\82¢
\82·
\82¬
\82Å", KILLED_BY);
3456 mon->mspec_used = rnd(100); /* monster is worn out */
3458 You("seem to have enjoyed it more than %s...", noit_mon_nam(mon));
3460 You("%s
\82æ
\82è
\82à
\8ay
\82µ
\82ñ
\82¾
\82æ
\82¤
\82¾
\81D
\81D
\81D", noit_mon_nam(mon));
3464 You_feel("raised to your full potential.");
3466 You("
\90ö
\8dÝ
\94\
\97Í
\82ª
\8d\82\82Ü
\82Á
\82½
\82æ
\82¤
\82É
\8a´
\82¶
\82½
\81D");
3467 exercise(A_CON, TRUE);
3468 u.uen = (u.uenmax += rnd(5));
3472 You_feel("good enough to do it again.");
3474 You("
\82à
\82¤
\88ê
\93x
\82Å
\82«
\82é
\82Æ
\8ev
\82Á
\82½
\81D");
3475 (void) adjattrib(A_CON, 1, TRUE);
3476 exercise(A_CON, TRUE);
3481 You("will always remember %s...", noit_mon_nam(mon));
3483 You("
\82¢
\82Â
\82Ü
\82Å
\82à%s
\82ð
\8ao
\82¦
\82Ä
\82é
\82¾
\82ë
\82¤
\81D
\81D
\81D", mon_nam(mon));
3484 (void) adjattrib(A_WIS, 1, TRUE);
3485 exercise(A_WIS, TRUE);
3490 pline("That was a very educational experience.");
3492 pline("
\82Æ
\82Ä
\82à
\8bM
\8fd
\82È
\8co
\8c±
\82¾
\82Á
\82½
\81D");
3494 exercise(A_WIS, TRUE);
3498 You_feel("restored to health!");
3500 You("
\82Æ
\82Ä
\82à
\8c\92\8dN
\82É
\82È
\82Á
\82½
\81I");
3504 exercise(A_STR, TRUE);
3510 if (mon->mtame) { /* don't charge */
3512 } else if (rn2(20) < ACURR(A_CHA)) {
3514 pline("%s demands that you pay %s, but you refuse...",
3515 noit_Monnam(mon), noit_mhim(mon));
3517 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",
3520 } else if (u.umonnum == PM_LEPRECHAUN) {
3522 pline("%s tries to take your money, but fails...", noit_Monnam(mon));
3524 pline("%s
\82Í
\8bà
\82ð
\8eæ
\82ë
\82¤
\82Æ
\82µ
\82½
\82ª
\81C
\8e¸
\94s
\82µ
\82½
\81D
\81D
\81D", noit_Monnam(mon));
3527 long umoney = money_cnt(invent);
3529 if (umoney > (long) LARGEST_INT - 10L)
3530 cost = (long) rnd(LARGEST_INT) + 500L;
3532 cost = (long) rnd((int) umoney + 10) + 500L;
3533 if (mon->mpeaceful) {
3542 verbalize("It's on the house!");
3544 verbalize("
\82±
\82ê
\82Í
\82¨
\82²
\82è%s
\81I", fem ? "
\82æ" : "
\82³");
3547 pline("%s takes %ld %s for services rendered!", noit_Monnam(mon),
3548 cost, currency(cost));
3550 pline("%s
\82Í
\83T
\81[
\83r
\83X
\97¿
\82Æ
\82µ
\82Ä%ld%s
\92D
\82¢
\8eæ
\82Á
\82½
\81I", noit_Monnam(mon),
3551 cost, currency(cost));
3553 money2mon(mon, cost);
3558 mon->mcan = 1; /* monster is worn out */
3559 if (!tele_restrict(mon))
3560 (void) rloc(mon, TRUE);
3565 mayberem(mon, seducer, obj, str)
3567 const char *seducer; /* only used for alternate message */
3573 if (!obj || !obj->owornmask)
3575 /* removal of a previous item might have sent the hero elsewhere
3576 (loss of levitation that leads to landing on a transport trap) */
3577 if (u.utotype || distu(mon->mx, mon->my) > 2)
3580 /* being deaf overrides confirmation prompt for high charisma */
3583 pline("%s takes off your %s.", seducer, str);
3585 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82ð
\92E
\82ª
\82¹
\82½
\81D", seducer, str);
3586 } else if (rn2(20) < ACURR(A_CHA)) {
3588 Sprintf(qbuf, "\"Shall I remove your %s, %s?\"", str,
3589 (!rn2(2) ? "lover" : !rn2(2) ? "dear" : "sweetheart"));
3591 Sprintf(qbuf,"
\81u%s
\82ð
\8eæ
\82Á
\82Ä
\82¢
\82¢
\81C%s
\81H
\81v", str,
3592 (!rn2(2) ? "
\82Ë
\82¥" : flags.female ? "
\83n
\83j
\81[" : "
\83_
\81[
\83\8a\83\93" ));
3594 if (yn(qbuf) == 'n')
3597 char hairbuf[BUFSZ];
3600 Sprintf(hairbuf, "let me run my fingers through your %s",
3604 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¢",
3608 verbalize("Take off your %s; %s.", str,
3610 ? "let's get a little closer"
3611 : (obj == uarmc || obj == uarms)
3614 ? "let me rub your feet"
3616 ? "they're too clumsy"
3618 ? "let me massage you"
3622 verbalize("%s
\82ð
\92E
\82¢
\82Å
\81D
\81D
\81D%s
\81D", str,
3624 ? "
\82à
\82¤
\82¿
\82å
\82Á
\82Æ
\8añ
\82è
\82»
\82Á
\82Ä"
3625 : (obj == uarmc || obj == uarms)
3626 ? "
\82»
\82¤
\82»
\82¤"
3628 ? (flags.female ? "ãY
\97í
\82È
\91«
\82¾
\82Ë" : "
\82¤
\82Ó
\82Á
\81C
\82½
\82
\82Ü
\82µ
\82¢
\91«
\82Ë")
3630 ? (flags.female ? "
\82È
\82ñ
\82Ä
\91f
\93G
\82È
\8eè
\82¾" : "
\82½
\82
\82Ü
\82µ
\82¢
\98r
\82Ë")
3632 ? (flags.female ? "
\82«
\82ê
\82¢
\82È
\91Ì
\82¾" : "
\82½
\82
\82Ü
\82µ
\82¢
\82Ì
\82Ë")
3637 remove_worn_item(obj, TRUE);
3641 * sequencing issue: a monster's attack might cause poly'd hero
3642 * to revert to normal form. The messages for passive counterattack
3643 * would look better if they came before reverting form, but we need
3644 * to know whether hero reverted in order to decide whether passive
3648 passiveum(olduasmon, mtmp, mattk)
3649 struct permonst *olduasmon;
3651 struct attack *mattk;
3654 struct attack *oldu_mattk = 0;
3657 * mattk == mtmp's attack that hit you;
3658 * oldu_mattk == your passive counterattack (even if mtmp's attack
3659 * has already caused you to revert to normal form).
3661 for (i = 0; !oldu_mattk; i++) {
3664 if (olduasmon->mattk[i].aatyp == AT_NONE
3665 || olduasmon->mattk[i].aatyp == AT_BOOM)
3666 oldu_mattk = &olduasmon->mattk[i];
3668 if (oldu_mattk->damn)
3669 tmp = d((int) oldu_mattk->damn, (int) oldu_mattk->damd);
3670 else if (oldu_mattk->damd)
3671 tmp = d((int) olduasmon->mlevel + 1, (int) oldu_mattk->damd);
3675 /* These affect the enemy even if you were "killed" (rehumanized) */
3676 switch (oldu_mattk->adtyp) {
3680 pline("%s is splashed by %s%s!", Monnam(mtmp),
3681 /* temporary? hack for sequencing issue: "your acid"
3682 looks strange coming immediately after player has
3683 been told that hero has reverted to normal form */
3684 !Upolyd ? "" : "your ", hliquid("acid"));
3686 pline("%s
\82Í%s%s
\82ð
\90H
\82ç
\82Á
\82½
\81I", Monnam(mtmp),
3687 /* temporary? hack for sequencing issue: "your acid"
3688 looks strange coming immediately after player has
3689 been told that hero has reverted to normal form */
3690 !Upolyd ? "" : "
\82 \82È
\82½
\82Ì", hliquid("
\8e_"));
3692 if (resists_acid(mtmp)) {
3694 pline("%s is not affected.", Monnam(mtmp));
3696 pline("%s
\82Í
\89e
\8b¿
\82ð
\8eó
\82¯
\82È
\82¢
\81D", Monnam(mtmp));
3702 erode_armor(mtmp, ERODE_CORRODE);
3704 acid_damage(MON_WEP(mtmp));
3706 case AD_STON: /* cockatrice */
3708 long protector = attk_protection((int) mattk->aatyp),
3709 wornitems = mtmp->misc_worn_check;
3711 /* wielded weapon gives same protection as gloves here */
3712 if (MON_WEP(mtmp) != 0)
3713 wornitems |= W_ARMG;
3715 if (!resists_ston(mtmp)
3717 || (protector != ~0L
3718 && (wornitems & protector) != protector))) {
3719 if (poly_when_stoned(mtmp->data)) {
3724 pline("%s turns to stone!", Monnam(mtmp));
3726 pline("%s
\82Í
\90Î
\82É
\82È
\82Á
\82½
\81I", Monnam(mtmp));
3728 xkilled(mtmp, XKILL_NOMSG);
3729 if (!DEADMONSTER(mtmp))
3735 case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */
3737 /* by_you==True: passive counterattack to hero's action
3739 (void) drain_item(mon_currwep, TRUE);
3749 /* These affect the enemy only if you are still a monster */
3751 switch (oldu_mattk->adtyp) {
3753 if (oldu_mattk->aatyp == AT_BOOM) {
3757 pline("
\82 \82È
\82½
\82Í
\94\9a\94
\82µ
\82½
\81I");
3758 /* KMH, balance patch -- this is okay with unchanging */
3763 case AD_PLYS: /* Floating eye */
3766 if (u.umonnum == PM_FLOATING_EYE) {
3769 if (mtmp->mcansee && haseyes(mtmp->data) && rn2(3)
3770 && (perceives(mtmp->data) || !Invis)) {
3773 pline("As a blind %s, you cannot defend yourself.",
3775 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",
3776 youmonst.data->mname);
3778 if (mon_reflects(mtmp,
3780 "Your gaze is reflected by %s %s."))
3782 "
\82 \82È
\82½
\82Ì
\82É
\82ç
\82Ý
\82Í%s
\82Ì%s
\82Å
\94½
\8eË
\82µ
\82½
\81D"))
3785 pline("%s is frozen by your gaze!", Monnam(mtmp));
3787 pline("%s
\82Í
\82 \82È
\82½
\82Ì
\82É
\82ç
\82Ý
\82Å
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81I", Monnam(mtmp));
3788 paralyze_monst(mtmp, tmp);
3792 } else { /* gelatinous cube */
3794 pline("%s is frozen by you.", Monnam(mtmp));
3796 pline("%s
\82Í
\93®
\82¯
\82È
\82¢
\81D", Monnam(mtmp));
3797 paralyze_monst(mtmp, tmp);
3801 case AD_COLD: /* Brown mold or blue jelly */
3802 if (resists_cold(mtmp)) {
3803 shieldeff(mtmp->mx, mtmp->my);
3805 pline("%s is mildly chilly.", Monnam(mtmp));
3807 pline("%s
\82Í
\97â
\82¦
\82½
\81D", Monnam(mtmp));
3808 golemeffects(mtmp, AD_COLD, tmp);
3813 pline("%s is suddenly very cold!", Monnam(mtmp));
3815 pline("%s
\82Í
\93Ë
\91R
\93\80\82è
\82Ã
\82¯
\82É
\82È
\82Á
\82½
\81I", Monnam(mtmp));
3819 if (u.mhmax > ((youmonst.data->mlevel + 1) * 8))
3820 (void) split_mon(&youmonst, mtmp);
3822 case AD_STUN: /* Yellow mold */
3826 pline("%s %s.", Monnam(mtmp),
3827 makeplural(stagger(mtmp->data, "stagger")));
3829 pline("%s
\82Í%s
\81D", Monnam(mtmp),
3830 jpast(stagger(mtmp->data, "
\82æ
\82ë
\82ß
\82")));
3835 case AD_FIRE: /* Red mold */
3836 if (resists_fire(mtmp)) {
3837 shieldeff(mtmp->mx, mtmp->my);
3839 pline("%s is mildly warm.", Monnam(mtmp));
3841 pline("%s
\82Í
\92g
\82©
\82
\82È
\82Á
\82½
\81D", Monnam(mtmp));
3843 golemeffects(mtmp, AD_FIRE, tmp);
3848 pline("%s is suddenly very hot!", Monnam(mtmp));
3850 pline("%s
\82Í
\93Ë
\91R
\94M
\82
\82È
\82Á
\82½
\81I", Monnam(mtmp));
3854 if (resists_elec(mtmp)) {
3855 shieldeff(mtmp->mx, mtmp->my);
3857 pline("%s is slightly tingled.", Monnam(mtmp));
3859 pline("%s
\82Í
\82¿
\82å
\82Á
\82Æ
\83s
\83\8a\83s
\83\8a\82µ
\82½
\81D", Monnam(mtmp));
3861 golemeffects(mtmp, AD_ELEC, tmp);
3866 pline("%s is jolted with your electricity!", Monnam(mtmp));
3868 pline("%s
\82Í
\93d
\8bC
\83V
\83\87\83b
\83N
\82ð
\82¤
\82¯
\82½
\81I", Monnam(mtmp));
3879 if ((mtmp->mhp -= tmp) <= 0) {
3881 pline("%s dies!", Monnam(mtmp));
3883 pline("%s
\82Í
\8e\80\82ñ
\82¾
\81I", Monnam(mtmp));
3884 xkilled(mtmp, XKILL_NOMSG);
3885 if (!DEADMONSTER(mtmp))
3896 int mndx = monsndx(youmonst.data);
3899 return (struct monst *) 0;
3900 if (mvitals[mndx].mvflags & G_EXTINCT)
3901 return (struct monst *) 0;
3902 mon = makemon(youmonst.data, u.ux, u.uy, NO_MINVENT | MM_EDOG);
3906 mon = christen_monst(mon, plname);
3908 mon->m_lev = youmonst.data->mlevel;
3909 mon->mhpmax = u.mhmax;
3910 mon->mhp = u.mh / 2;